diff --git a/.gitignore b/.gitignore index 04fca98..bf2991e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,18 @@ # data specific files derivatives/* sourcedata/ + +# monitoring scripts and files +data-monitoring/central-tracker_*.csv +data-monitoring/data-monitoring-log.md +data-monitoring/hallMonitor.sh +data-monitoring/hallMonitor.sub +data-monitoring/update-tracker.py +data-monitoring/verify-copy.py +data-monitoring/check-datadict.py +data-monitoring/check-id.py +data-monitoring/slurm*.out +data-monitoring/preprocess*.out +data-monitoring/data-dictionary/central-tracker_datadict_latest.csv +data-monitoring/preprocess.sub +data-monitoring/rename-cols.py diff --git a/code/eeg_timing_test/thrive_resp_timing_test.R b/code/eeg_timing_test/thrive_resp_timing_test.R index 89656f1..6e82acc 100755 --- a/code/eeg_timing_test/thrive_resp_timing_test.R +++ b/code/eeg_timing_test/thrive_resp_timing_test.R @@ -13,7 +13,7 @@ library(dplyr) #setwd("~/Users/kihossei/Desktop") #set working directory to where your text file (the one that you have triggers and their times) is located. path <- ("/Users/kihossei/Documents/GitHub/thrive-dataset/code/eeg_timing_test") -mrkTxt <- readLines(paste(path, "/sys_1_timetest_resp.vmrk", sep = "")) # load the .vmrk file into the workspace. +mrkTxt <- readLines(paste(path, "/thrive_sys_1_timingtest_resp.vmrk", sep = "")) # load the .vmrk file into the workspace. myDat <- setNames(data.frame(matrix(nrow = length(mrkTxt), ncol = 1)), c("colA")) # creates an empty data frame with a single column and row # = length(mrkTxt) # This for loop creates a dataframe from the loaded text file. @@ -59,7 +59,7 @@ for (i in 1:nrow(newDat)){ if (str_detect(newDat$colC[i], "S 41") || str_detect(newDat$colC[i], "S 42") || str_detect(newDat$colC[i], "S 43") || str_detect(newDat$colC[i], "S 44")){ # detects non-social stim markers current_trial_num <- trial_num_counter # store the current trial number so, we can use it below trial_num_counter <- trial_num_counter + 1 # as we have found the stim marker above, we update trial number counter for the next trial - stim_marker_sent <- gsub(",.*", "", newDat$colC[i]) # The stim marker was sent + stim_marker_sent <- gsub(",.*", "", newDat$colC[i]) # Type of the sent stim marker condition_type <- "non_social" trial_num <- current_trial_num marker_sent <- stim_marker_sent # The stim marker was sent @@ -80,8 +80,8 @@ for (i in 1:nrow(newDat)){ time_sent <- str2num(gsub(".*,", "", newDat$colC[i + n])) # the time when the marker was sent main_dat[nrow(main_dat) + 1,] <- c(condition_type, trial_num, stim_marker_sent, marker_sent, time_sent) } + n <- n + 1 # updating the counter for "while" loop } - n <- n + 1 # updating the counter for "while" loop } } else if (str_detect(newDat$colC[i], "S 51") || str_detect(newDat$colC[i], "S 52") || str_detect(newDat$colC[i], "S 53") || str_detect(newDat$colC[i], "S 54")){ # detects social stim markers current_trial_num <- trial_num_counter @@ -107,8 +107,8 @@ for (i in 1:nrow(newDat)){ time_sent <- str2num(gsub(".*,", "", newDat$colC[i + n])) # the time when the marker was sent main_dat[nrow(main_dat) + 1,] <- c(condition_type, trial_num, stim_marker_sent, marker_sent, time_sent) } + n <- n + 1 # updating the counter for "while" loop } - n <- n + 1 # updating the counter for "while" loop } } else if (str_detect(newDat$colC[i], "S 1") || str_detect(newDat$colC[i], "S 2") || str_detect(newDat$colC[i], "S 3") || str_detect(newDat$colC[i], "S 4")){ # detects practice stim markers @@ -134,12 +134,20 @@ for (i in 1:nrow(newDat)){ time_sent <- str2num(gsub(".*,", "", newDat$colC[i + n])) # the time when the marker was sent main_dat[nrow(main_dat) + 1,] <- c(condition_type, trial_num, stim_marker_sent, marker_sent, time_sent) } + n <- n + 1 # updating the counter for "while" loop } - n <- n + 1 # updating the counter for "while" loop } } } -# +# Run the code all the way here. After finishing there is gonna be an error as the data row finishes. +# Then select the codes below to run. + + + + + + + # Computing the response time offset using the data set created above (i.e., main_dat) latency_dat <- setNames(data.frame(matrix(ncol = 4)), c("condition_type", "trial_num", "stim_marker_sent", "time_diff")) # an empty dataframe that will be filled with this information. number_of_trials <- max(as.numeric(main_dat$trial_num), na.rm = TRUE) # total number of trials in this dataset (i.e., main_dat) @@ -197,6 +205,7 @@ for (trial_num_in_dat in 1:number_of_trials){ latency_dat[nrow(latency_dat) + 1,] <- c(condition_type, trial_num, stim_marker_sent, time_diff) } } + latency_dat$time_diff <- as.numeric(latency_dat$time_diff) # min(latency_dat$time_diff, na.rm = TRUE) # max(latency_dat$time_diff, na.rm = TRUE) @@ -206,18 +215,6 @@ sd(latency_dat$time_diff, na.rm = TRUE) reorderd_latency_dat_max_to_min <- latency_dat %>% arrange(desc(time_diff)) # reordering data set for visual inspection -<<<<<<< Updated upstream:code/eeg_timing_test/mini_mfe_resp_timing_test.R -######## Below is the timing test results for the Flanker task of the thrive study task on April 5, 2023- System 2 with block level trigger loss ###### -# response triggers -# mean(test$value) -# 1.700855 -# sd(test$value) -# 2.085521 -======= ->>>>>>> Stashed changes:code/eeg_timing_test/thrive_resp_timing_test.R - - - diff --git a/code/eeg_timing_test/thrive_stim_timing_test.R b/code/eeg_timing_test/thrive_stim_timing_test.R index 76c83d9..927d778 100755 --- a/code/eeg_timing_test/thrive_stim_timing_test.R +++ b/code/eeg_timing_test/thrive_stim_timing_test.R @@ -53,6 +53,7 @@ newDat <- read.csv(paste(path,proc_fileName, sep = "/", collapse = NULL)) ########## RUN THE CODE BELOW If YOU WANT RUN TIMING TEST USING The SOCIAL and NON-SOCIAL Conditions.################### ######################################################################################################################## + flanker_dat <- setNames(data.frame(matrix(ncol = 1)), c("timeDiff")) # creating an empty data frame that will be filled with time difference values! dVal <- setNames(data.frame(matrix(ncol = 1)), c("timeDiff")) @@ -128,6 +129,7 @@ practice_dat <- na.omit(practice_dat, na.action = "omit") mean(practice_dat$timeDiff) sd(practice_dat$timeDiff) + ################################################ END of PRACTICE TIMING TEST ########################################### ######################################################################################################################## @@ -169,6 +171,7 @@ sd(practice_dat$timeDiff) # sd(test$value) # 1.575718 ######## Below is the timing test results for the Flanker task of the thrive study task on April 2, 2023- System 1 + # stimulus triggers # mean(test$value) # 12.775 diff --git a/code/eeg_timing_test/thrive_sys1_timingTest_stim.vmrk b/code/eeg_timing_test/thrive_sys1_timingTest_stim.vmrk new file mode 100755 index 0000000..dff7292 --- /dev/null +++ b/code/eeg_timing_test/thrive_sys1_timingTest_stim.vmrk @@ -0,0 +1,1736 @@ +BrainVision Data Exchange Marker File Version 1.0 + +[Common Infos] +Codepage=UTF-8 +DataFile=sys1_timingTest_stim.eeg + +[Marker Infos] +; Each entry: Mk=,,, +; , +; Fields are delimited by commas, some fields might be omitted (empty). +; Commas in type or description text are coded as "\1". +Mk1=New Segment,,1,1,0,20230602130357615225 +Mk2=Stimulus,S 1,17881,1,0 +Mk3=Stimulus,S128,17892,1,0 +Mk4=Stimulus,S 11,18330,1,0 +Mk5=Stimulus,S 21,18670,1,0 +Mk6=Stimulus,S 1,19493,1,0 +Mk7=Stimulus,S128,19503,1,0 +Mk8=Stimulus,S 11,19911,1,0 +Mk9=Stimulus,S 2,21347,1,0 +Mk10=Stimulus,S128,21358,1,0 +Mk11=Stimulus,S 11,21918,1,0 +Mk12=Stimulus,S 3,23293,1,0 +Mk13=Stimulus,S128,23307,1,0 +Mk14=Stimulus,S 11,23714,1,0 +Mk15=Stimulus,S 1,25205,1,0 +Mk16=Stimulus,S128,25216,1,0 +Mk17=Stimulus,S 11,25587,1,0 +Mk18=Stimulus,S 1,26788,1,0 +Mk19=Stimulus,S128,26801,1,0 +Mk20=Stimulus,S 11,27512,1,0 +Mk21=Stimulus,S 1,28423,1,0 +Mk22=Stimulus,S128,28435,1,0 +Mk23=Stimulus,S 11,28982,1,0 +Mk24=Stimulus,S 2,30030,1,0 +Mk25=Stimulus,S128,30043,1,0 +Mk26=Stimulus,S 11,30760,1,0 +Mk27=Stimulus,S 2,31589,1,0 +Mk28=Stimulus,S128,31601,1,0 +Mk29=Stimulus,S 11,32336,1,0 +Mk30=Stimulus,S 2,33462,1,0 +Mk31=Stimulus,S128,33474,1,0 +Mk32=Stimulus,S 11,33918,1,0 +Mk33=Stimulus,S 1,35365,1,0 +Mk34=Stimulus,S128,35380,1,0 +Mk35=Stimulus,S 11,35908,1,0 +Mk36=Stimulus,S 4,37346,1,0 +Mk37=Stimulus,S128,37360,1,0 +Mk38=Stimulus,S 11,37780,1,0 +Mk39=Stimulus,S 4,39052,1,0 +Mk40=Stimulus,S128,39062,1,0 +Mk41=Stimulus,S 11,39396,1,0 +Mk42=Stimulus,S 3,40755,1,0 +Mk43=Stimulus,S128,40771,1,0 +Mk44=Stimulus,S 11,41354,1,0 +Mk45=Stimulus,S 3,42475,1,0 +Mk46=Stimulus,S128,42489,1,0 +Mk47=Stimulus,S 11,43309,1,0 +Mk48=Stimulus,S 2,44277,1,0 +Mk49=Stimulus,S128,44289,1,0 +Mk50=Stimulus,S 11,44836,1,0 +Mk51=Stimulus,S 3,46188,1,0 +Mk52=Stimulus,S128,46202,1,0 +Mk53=Stimulus,S 11,46585,1,0 +Mk54=Stimulus,S 3,48137,1,0 +Mk55=Stimulus,S128,48150,1,0 +Mk56=Stimulus,S 11,48588,1,0 +Mk57=Stimulus,S 3,50019,1,0 +Mk58=Stimulus,S128,50033,1,0 +Mk59=Stimulus,S 11,50422,1,0 +Mk60=Stimulus,S 3,51610,1,0 +Mk61=Stimulus,S128,51623,1,0 +Mk62=Stimulus,S 11,51982,1,0 +Mk63=Stimulus,S 3,53345,1,0 +Mk64=Stimulus,S128,53360,1,0 +Mk65=Stimulus,S 11,53658,1,0 +Mk66=Stimulus,S 4,54930,1,0 +Mk67=Stimulus,S128,54940,1,0 +Mk68=Stimulus,S 11,55311,1,0 +Mk69=Stimulus,S 2,56536,1,0 +Mk70=Stimulus,S128,56550,1,0 +Mk71=Stimulus,S 11,57079,1,0 +Mk72=Stimulus,S 4,58411,1,0 +Mk73=Stimulus,S128,58423,1,0 +Mk74=Stimulus,S 11,58806,1,0 +Mk75=Stimulus,S 4,60146,1,0 +Mk76=Stimulus,S128,60160,1,0 +Mk77=Stimulus,S 11,60610,1,0 +Mk78=Stimulus,S 4,62064,1,0 +Mk79=Stimulus,S128,62077,1,0 +Mk80=Stimulus,S 11,62448,1,0 +Mk81=Stimulus,S 1,63999,1,0 +Mk82=Stimulus,S128,64010,1,0 +Mk83=Stimulus,S 12,64260,1,0 +Mk84=Stimulus,S 4,65677,1,0 +Mk85=Stimulus,S128,65691,1,0 +Mk86=Stimulus,S 12,66068,1,0 +Mk87=Stimulus,S 3,67705,1,0 +Mk88=Stimulus,S128,67719,1,0 +Mk89=Stimulus,S 11,68090,1,0 +Mk90=Stimulus,S 4,69289,1,0 +Mk91=Stimulus,S128,69300,1,0 +Mk92=Stimulus,S 11,69859,1,0 +Mk93=Stimulus,S 3,70992,1,0 +Mk94=Stimulus,S128,71006,1,0 +Mk95=Stimulus,S 11,71577,1,0 +Mk96=Stimulus,S 4,72649,1,0 +Mk97=Stimulus,S128,72660,1,0 +Mk98=Stimulus,S 11,73262,1,0 +Mk99=Stimulus,S 4,74564,1,0 +Mk100=Stimulus,S128,74579,1,0 +Mk101=Stimulus,S 11,75004,1,0 +Mk102=Stimulus,S 2,76241,1,0 +Mk103=Stimulus,S128,76255,1,0 +Mk104=Stimulus,S 11,76796,1,0 +Mk105=Stimulus,S 2,78068,1,0 +Mk106=Stimulus,S128,78079,1,0 +Mk107=Stimulus,S 11,78741,1,0 +Mk108=Stimulus,S 1,79686,1,0 +Mk109=Stimulus,S128,79699,1,0 +Mk110=Stimulus,S 11,80447,1,0 +Mk111=Stimulus,S 2,81634,1,0 +Mk112=Stimulus,S128,81646,1,0 +Mk113=Stimulus,S 11,82163,1,0 +Mk114=Stimulus,S 2,83223,1,0 +Mk115=Stimulus,S128,83237,1,0 +Mk116=Stimulus,S 11,83766,1,0 +Mk117=Stimulus,S 1,84777,1,0 +Mk118=Stimulus,S128,84791,1,0 +Mk119=Stimulus,S 11,85350,1,0 +Mk120=Stimulus,S 1,86616,1,0 +Mk121=Stimulus,S128,86627,1,0 +Mk122=Stimulus,S 11,87120,1,0 +Mk123=Stimulus,S 53,98400,1,0 +Mk124=Stimulus,S128,98412,1,0 +Mk125=Stimulus,S 54,100081,1,0 +Mk126=Stimulus,S128,100094,1,0 +Mk127=Stimulus,S 51,101962,1,0 +Mk128=Stimulus,S128,101976,1,0 +Mk129=Stimulus,S 54,103861,1,0 +Mk130=Stimulus,S128,103872,1,0 +Mk131=Stimulus,S 51,105661,1,0 +Mk132=Stimulus,S128,105674,1,0 +Mk133=Stimulus,S 51,107675,1,0 +Mk134=Stimulus,S128,107690,1,0 +Mk135=Stimulus,S 52,109709,1,0 +Mk136=Stimulus,S128,109720,1,0 +Mk137=Stimulus,S 52,111709,1,0 +Mk138=Stimulus,S128,111722,1,0 +Mk139=Stimulus,S 54,113717,1,0 +Mk140=Stimulus,S128,113730,1,0 +Mk141=Stimulus,S 51,115640,1,0 +Mk142=Stimulus,S128,115653,1,0 +Mk143=Stimulus,S 54,117511,1,0 +Mk144=Stimulus,S128,117525,1,0 +Mk145=Stimulus,S 52,119314,1,0 +Mk146=Stimulus,S128,119326,1,0 +Mk147=Stimulus,S 54,121255,1,0 +Mk148=Stimulus,S128,121269,1,0 +Mk149=Stimulus,S 53,123009,1,0 +Mk150=Stimulus,S128,123020,1,0 +Mk151=Stimulus,S 52,124827,1,0 +Mk152=Stimulus,S128,124841,1,0 +Mk153=Stimulus,S 51,126630,1,0 +Mk154=Stimulus,S128,126641,1,0 +Mk155=Stimulus,S 51,128320,1,0 +Mk156=Stimulus,S128,128334,1,0 +Mk157=Stimulus,S 54,129880,1,0 +Mk158=Stimulus,S128,129892,1,0 +Mk159=Stimulus,S 52,131568,1,0 +Mk160=Stimulus,S128,131582,1,0 +Mk161=Stimulus,S 53,133116,1,0 +Mk162=Stimulus,S128,133128,1,0 +Mk163=Stimulus,S 51,134892,1,0 +Mk164=Stimulus,S128,134905,1,0 +Mk165=Stimulus,S 53,136828,1,0 +Mk166=Stimulus,S128,136840,1,0 +Mk167=Stimulus,S 51,138434,1,0 +Mk168=Stimulus,S128,138447,1,0 +Mk169=Stimulus,S 53,140297,1,0 +Mk170=Stimulus,S128,140310,1,0 +Mk171=Stimulus,S 51,142263,1,0 +Mk172=Stimulus,S128,142276,1,0 +Mk173=Stimulus,S 52,144163,1,0 +Mk174=Stimulus,S128,144173,1,0 +Mk175=Stimulus,S 54,145744,1,0 +Mk176=Stimulus,S128,145757,1,0 +Mk177=Stimulus,S 52,147716,1,0 +Mk178=Stimulus,S128,147729,1,0 +Mk179=Stimulus,S 53,149408,1,0 +Mk180=Stimulus,S128,149422,1,0 +Mk181=Stimulus,S 53,151332,1,0 +Mk182=Stimulus,S128,151345,1,0 +Mk183=Stimulus,S 54,152976,1,0 +Mk184=Stimulus,S128,152989,1,0 +Mk185=Stimulus,S 51,154887,1,0 +Mk186=Stimulus,S128,154900,1,0 +Mk187=Stimulus,S 52,156501,1,0 +Mk188=Stimulus,S128,156515,1,0 +Mk189=Stimulus,S 54,158428,1,0 +Mk190=Stimulus,S128,158439,1,0 +Mk191=Stimulus,S 53,160416,1,0 +Mk192=Stimulus,S128,160430,1,0 +Mk193=Stimulus,S 54,162358,1,0 +Mk194=Stimulus,S128,162371,1,0 +Mk195=Stimulus,S 53,164118,1,0 +Mk196=Stimulus,S128,164131,1,0 +Mk197=Stimulus,S 53,165805,1,0 +Mk198=Stimulus,S128,165819,1,0 +Mk199=Stimulus,S 52,167499,1,0 +Mk200=Stimulus,S128,167509,1,0 +Mk201=Stimulus,S 52,169213,1,0 +Mk202=Stimulus,S128,169227,1,0 +Mk203=Stimulus,S 53,236097,1,0 +Mk204=Stimulus,S128,236110,1,0 +Mk205=Stimulus,S 53,237874,1,0 +Mk206=Stimulus,S128,237885,1,0 +Mk207=Stimulus,S 51,239595,1,0 +Mk208=Stimulus,S128,239609,1,0 +Mk209=Stimulus,S 52,241276,1,0 +Mk210=Stimulus,S128,241290,1,0 +Mk211=Stimulus,S 53,243163,1,0 +Mk212=Stimulus,S128,243177,1,0 +Mk213=Stimulus,S 51,244856,1,0 +Mk214=Stimulus,S128,244870,1,0 +Mk215=Stimulus,S 53,246446,1,0 +Mk216=Stimulus,S128,246460,1,0 +Mk217=Stimulus,S 51,248018,1,0 +Mk218=Stimulus,S128,248029,1,0 +Mk219=Stimulus,S 53,249643,1,0 +Mk220=Stimulus,S128,249656,1,0 +Mk221=Stimulus,S 54,251599,1,0 +Mk222=Stimulus,S128,251613,1,0 +Mk223=Stimulus,S 51,253165,1,0 +Mk224=Stimulus,S128,253178,1,0 +Mk225=Stimulus,S 54,254742,1,0 +Mk226=Stimulus,S128,254756,1,0 +Mk227=Stimulus,S 53,256435,1,0 +Mk228=Stimulus,S128,256446,1,0 +Mk229=Stimulus,S 52,258229,1,0 +Mk230=Stimulus,S128,258240,1,0 +Mk231=Stimulus,S 53,260083,1,0 +Mk232=Stimulus,S128,260096,1,0 +Mk233=Stimulus,S 52,262055,1,0 +Mk234=Stimulus,S128,262066,1,0 +Mk235=Stimulus,S 52,263679,1,0 +Mk236=Stimulus,S128,263693,1,0 +Mk237=Stimulus,S 51,265442,1,0 +Mk238=Stimulus,S128,265457,1,0 +Mk239=Stimulus,S 52,267458,1,0 +Mk240=Stimulus,S128,267472,1,0 +Mk241=Stimulus,S 51,269260,1,0 +Mk242=Stimulus,S128,269271,1,0 +Mk243=Stimulus,S 51,271072,1,0 +Mk244=Stimulus,S128,271085,1,0 +Mk245=Stimulus,S 52,272759,1,0 +Mk246=Stimulus,S128,272772,1,0 +Mk247=Stimulus,S 54,274403,1,0 +Mk248=Stimulus,S128,274414,1,0 +Mk249=Stimulus,S 53,276081,1,0 +Mk250=Stimulus,S128,276095,1,0 +Mk251=Stimulus,S 52,278049,1,0 +Mk252=Stimulus,S128,278065,1,0 +Mk253=Stimulus,S 54,279951,1,0 +Mk254=Stimulus,S128,279962,1,0 +Mk255=Stimulus,S 54,281823,1,0 +Mk256=Stimulus,S128,281837,1,0 +Mk257=Stimulus,S 53,283850,1,0 +Mk258=Stimulus,S128,283864,1,0 +Mk259=Stimulus,S 54,285823,1,0 +Mk260=Stimulus,S128,285834,1,0 +Mk261=Stimulus,S 51,287671,1,0 +Mk262=Stimulus,S128,287685,1,0 +Mk263=Stimulus,S 54,289280,1,0 +Mk264=Stimulus,S128,289291,1,0 +Mk265=Stimulus,S 54,290977,1,0 +Mk266=Stimulus,S128,290990,1,0 +Mk267=Stimulus,S 52,292727,1,0 +Mk268=Stimulus,S128,292741,1,0 +Mk269=Stimulus,S 51,294421,1,0 +Mk270=Stimulus,S128,294432,1,0 +Mk271=Stimulus,S 53,296269,1,0 +Mk272=Stimulus,S128,296283,1,0 +Mk273=Stimulus,S 54,298235,1,0 +Mk274=Stimulus,S128,298249,1,0 +Mk275=Stimulus,S 51,299795,1,0 +Mk276=Stimulus,S128,299806,1,0 +Mk277=Stimulus,S 52,301484,1,0 +Mk278=Stimulus,S128,301496,1,0 +Mk279=Stimulus,S 52,303212,1,0 +Mk280=Stimulus,S128,303226,1,0 +Mk281=Stimulus,S 54,305070,1,0 +Mk282=Stimulus,S128,305084,1,0 +Mk283=Stimulus,S 52,328913,1,0 +Mk284=Stimulus,S128,328925,1,0 +Mk285=Stimulus,S 51,330884,1,0 +Mk286=Stimulus,S128,330897,1,0 +Mk287=Stimulus,S 54,332880,1,0 +Mk288=Stimulus,S128,332891,1,0 +Mk289=Stimulus,S 54,334589,1,0 +Mk290=Stimulus,S128,334603,1,0 +Mk291=Stimulus,S 51,336362,1,0 +Mk292=Stimulus,S128,336375,1,0 +Mk293=Stimulus,S 51,338194,1,0 +Mk294=Stimulus,S128,338208,1,0 +Mk295=Stimulus,S 52,340197,1,0 +Mk296=Stimulus,S128,340213,1,0 +Mk297=Stimulus,S 51,342093,1,0 +Mk298=Stimulus,S128,342107,1,0 +Mk299=Stimulus,S 53,343744,1,0 +Mk300=Stimulus,S128,343757,1,0 +Mk301=Stimulus,S 53,345389,1,0 +Mk302=Stimulus,S128,345399,1,0 +Mk303=Stimulus,S 54,347042,1,0 +Mk304=Stimulus,S128,347055,1,0 +Mk305=Stimulus,S 53,348923,1,0 +Mk306=Stimulus,S128,348937,1,0 +Mk307=Stimulus,S 53,350697,1,0 +Mk308=Stimulus,S128,350710,1,0 +Mk309=Stimulus,S 54,352438,1,0 +Mk310=Stimulus,S128,352449,1,0 +Mk311=Stimulus,S 52,354313,1,0 +Mk312=Stimulus,S128,354326,1,0 +Mk313=Stimulus,S 53,355945,1,0 +Mk314=Stimulus,S128,355956,1,0 +Mk315=Stimulus,S 51,357862,1,0 +Mk316=Stimulus,S128,357873,1,0 +Mk317=Stimulus,S 51,359674,1,0 +Mk318=Stimulus,S128,359688,1,0 +Mk319=Stimulus,S 53,361598,1,0 +Mk320=Stimulus,S128,361608,1,0 +Mk321=Stimulus,S 52,363318,1,0 +Mk322=Stimulus,S128,363328,1,0 +Mk323=Stimulus,S 54,365173,1,0 +Mk324=Stimulus,S128,365185,1,0 +Mk325=Stimulus,S 53,366732,1,0 +Mk326=Stimulus,S128,366744,1,0 +Mk327=Stimulus,S 53,368631,1,0 +Mk328=Stimulus,S128,368644,1,0 +Mk329=Stimulus,S 52,370651,1,0 +Mk330=Stimulus,S128,370664,1,0 +Mk331=Stimulus,S 51,372525,1,0 +Mk332=Stimulus,S128,372538,1,0 +Mk333=Stimulus,S 54,374145,1,0 +Mk334=Stimulus,S128,374158,1,0 +Mk335=Stimulus,S 54,375783,1,0 +Mk336=Stimulus,S128,375797,1,0 +Mk337=Stimulus,S 52,377339,1,0 +Mk338=Stimulus,S128,377352,1,0 +Mk339=Stimulus,S 52,379341,1,0 +Mk340=Stimulus,S128,379354,1,0 +Mk341=Stimulus,S 53,380982,1,0 +Mk342=Stimulus,S128,380995,1,0 +Mk343=Stimulus,S 52,382620,1,0 +Mk344=Stimulus,S128,382633,1,0 +Mk345=Stimulus,S 52,384483,1,0 +Mk346=Stimulus,S128,384493,1,0 +Mk347=Stimulus,S 54,386088,1,0 +Mk348=Stimulus,S128,386101,1,0 +Mk349=Stimulus,S 51,387707,1,0 +Mk350=Stimulus,S128,387717,1,0 +Mk351=Stimulus,S 54,389481,1,0 +Mk352=Stimulus,S128,389495,1,0 +Mk353=Stimulus,S 53,391145,1,0 +Mk354=Stimulus,S128,391158,1,0 +Mk355=Stimulus,S 52,393129,1,0 +Mk356=Stimulus,S128,393140,1,0 +Mk357=Stimulus,S 54,395094,1,0 +Mk358=Stimulus,S128,395105,1,0 +Mk359=Stimulus,S 51,396839,1,0 +Mk360=Stimulus,S128,396850,1,0 +Mk361=Stimulus,S 51,398596,1,0 +Mk362=Stimulus,S128,398610,1,0 +Mk363=Stimulus,S 51,414221,1,0 +Mk364=Stimulus,S128,414234,1,0 +Mk365=Stimulus,S 53,415823,1,0 +Mk366=Stimulus,S128,415837,1,0 +Mk367=Stimulus,S 54,417710,1,0 +Mk368=Stimulus,S128,417722,1,0 +Mk369=Stimulus,S 53,419468,1,0 +Mk370=Stimulus,S128,419481,1,0 +Mk371=Stimulus,S 51,421185,1,0 +Mk372=Stimulus,S128,421198,1,0 +Mk373=Stimulus,S 51,423110,1,0 +Mk374=Stimulus,S128,423123,1,0 +Mk375=Stimulus,S 53,424796,1,0 +Mk376=Stimulus,S128,424810,1,0 +Mk377=Stimulus,S 52,426501,1,0 +Mk378=Stimulus,S128,426512,1,0 +Mk379=Stimulus,S 54,428179,1,0 +Mk380=Stimulus,S128,428194,1,0 +Mk381=Stimulus,S 52,430152,1,0 +Mk382=Stimulus,S128,430165,1,0 +Mk383=Stimulus,S 51,431741,1,0 +Mk384=Stimulus,S128,431755,1,0 +Mk385=Stimulus,S 52,433277,1,0 +Mk386=Stimulus,S128,433288,1,0 +Mk387=Stimulus,S 51,435235,1,0 +Mk388=Stimulus,S128,435249,1,0 +Mk389=Stimulus,S 53,436814,1,0 +Mk390=Stimulus,S128,436828,1,0 +Mk391=Stimulus,S 53,438502,1,0 +Mk392=Stimulus,S128,438515,1,0 +Mk393=Stimulus,S 54,440153,1,0 +Mk394=Stimulus,S128,440167,1,0 +Mk395=Stimulus,S 52,442095,1,0 +Mk396=Stimulus,S128,442109,1,0 +Mk397=Stimulus,S 52,443958,1,0 +Mk398=Stimulus,S128,443969,1,0 +Mk399=Stimulus,S 54,445515,1,0 +Mk400=Stimulus,S128,445529,1,0 +Mk401=Stimulus,S 53,447130,1,0 +Mk402=Stimulus,S128,447143,1,0 +Mk403=Stimulus,S 54,448704,1,0 +Mk404=Stimulus,S128,448715,1,0 +Mk405=Stimulus,S 52,450565,1,0 +Mk406=Stimulus,S128,450579,1,0 +Mk407=Stimulus,S 53,452537,1,0 +Mk408=Stimulus,S128,452548,1,0 +Mk409=Stimulus,S 53,454416,1,0 +Mk410=Stimulus,S128,454427,1,0 +Mk411=Stimulus,S 51,456283,1,0 +Mk412=Stimulus,S128,456294,1,0 +Mk413=Stimulus,S 51,458180,1,0 +Mk414=Stimulus,S128,458194,1,0 +Mk415=Stimulus,S 51,459825,1,0 +Mk416=Stimulus,S128,459837,1,0 +Mk417=Stimulus,S 54,461499,1,0 +Mk418=Stimulus,S128,461512,1,0 +Mk419=Stimulus,S 51,463061,1,0 +Mk420=Stimulus,S128,463072,1,0 +Mk421=Stimulus,S 54,464727,1,0 +Mk422=Stimulus,S128,464741,1,0 +Mk423=Stimulus,S 52,466366,1,0 +Mk424=Stimulus,S128,466380,1,0 +Mk425=Stimulus,S 54,468363,1,0 +Mk426=Stimulus,S128,468375,1,0 +Mk427=Stimulus,S 52,470043,1,0 +Mk428=Stimulus,S128,470056,1,0 +Mk429=Stimulus,S 52,471844,1,0 +Mk430=Stimulus,S128,471856,1,0 +Mk431=Stimulus,S 53,473797,1,0 +Mk432=Stimulus,S128,473811,1,0 +Mk433=Stimulus,S 51,475570,1,0 +Mk434=Stimulus,S128,475584,1,0 +Mk435=Stimulus,S 52,477336,1,0 +Mk436=Stimulus,S128,477347,1,0 +Mk437=Stimulus,S 54,479142,1,0 +Mk438=Stimulus,S128,479156,1,0 +Mk439=Stimulus,S 54,480987,1,0 +Mk440=Stimulus,S128,481002,1,0 +Mk441=Stimulus,S 53,482548,1,0 +Mk442=Stimulus,S128,482559,1,0 +Mk443=Stimulus,S 52,499935,1,0 +Mk444=Stimulus,S128,499947,1,0 +Mk445=Stimulus,S 51,501851,1,0 +Mk446=Stimulus,S128,501862,1,0 +Mk447=Stimulus,S 53,503767,1,0 +Mk448=Stimulus,S128,503780,1,0 +Mk449=Stimulus,S 54,505344,1,0 +Mk450=Stimulus,S128,505358,1,0 +Mk451=Stimulus,S 54,507099,1,0 +Mk452=Stimulus,S128,507109,1,0 +Mk453=Stimulus,S 53,508922,1,0 +Mk454=Stimulus,S128,508936,1,0 +Mk455=Stimulus,S 54,510749,1,0 +Mk456=Stimulus,S128,510762,1,0 +Mk457=Stimulus,S 51,512716,1,0 +Mk458=Stimulus,S128,512729,1,0 +Mk459=Stimulus,S 54,514567,1,0 +Mk460=Stimulus,S128,514578,1,0 +Mk461=Stimulus,S 51,516118,1,0 +Mk462=Stimulus,S128,516134,1,0 +Mk463=Stimulus,S 53,517747,1,0 +Mk464=Stimulus,S128,517761,1,0 +Mk465=Stimulus,S 51,519538,1,0 +Mk466=Stimulus,S128,519548,1,0 +Mk467=Stimulus,S 54,521555,1,0 +Mk468=Stimulus,S128,521570,1,0 +Mk469=Stimulus,S 53,523473,1,0 +Mk470=Stimulus,S128,523487,1,0 +Mk471=Stimulus,S 52,525160,1,0 +Mk472=Stimulus,S128,525175,1,0 +Mk473=Stimulus,S 53,527152,1,0 +Mk474=Stimulus,S128,527166,1,0 +Mk475=Stimulus,S 51,528845,1,0 +Mk476=Stimulus,S128,528856,1,0 +Mk477=Stimulus,S 54,530550,1,0 +Mk478=Stimulus,S128,530564,1,0 +Mk479=Stimulus,S 52,532322,1,0 +Mk480=Stimulus,S128,532335,1,0 +Mk481=Stimulus,S 52,533948,1,0 +Mk482=Stimulus,S128,533961,1,0 +Mk483=Stimulus,S 53,535829,1,0 +Mk484=Stimulus,S128,535843,1,0 +Mk485=Stimulus,S 51,537467,1,0 +Mk486=Stimulus,S128,537482,1,0 +Mk487=Stimulus,S 53,539101,1,0 +Mk488=Stimulus,S128,539111,1,0 +Mk489=Stimulus,S 51,540730,1,0 +Mk490=Stimulus,S128,540744,1,0 +Mk491=Stimulus,S 51,542351,1,0 +Mk492=Stimulus,S128,542361,1,0 +Mk493=Stimulus,S 52,543938,1,0 +Mk494=Stimulus,S128,543949,1,0 +Mk495=Stimulus,S 52,545659,1,0 +Mk496=Stimulus,S128,545669,1,0 +Mk497=Stimulus,S 53,547391,1,0 +Mk498=Stimulus,S128,547404,1,0 +Mk499=Stimulus,S 51,549277,1,0 +Mk500=Stimulus,S128,549291,1,0 +Mk501=Stimulus,S 51,550861,1,0 +Mk502=Stimulus,S128,550874,1,0 +Mk503=Stimulus,S 52,552735,1,0 +Mk504=Stimulus,S128,552749,1,0 +Mk505=Stimulus,S 52,554471,1,0 +Mk506=Stimulus,S128,554485,1,0 +Mk507=Stimulus,S 54,556471,1,0 +Mk508=Stimulus,S128,556482,1,0 +Mk509=Stimulus,S 53,558461,1,0 +Mk510=Stimulus,S128,558475,1,0 +Mk511=Stimulus,S 54,560082,1,0 +Mk512=Stimulus,S128,560092,1,0 +Mk513=Stimulus,S 52,561851,1,0 +Mk514=Stimulus,S128,561865,1,0 +Mk515=Stimulus,S 54,563635,1,0 +Mk516=Stimulus,S128,563649,1,0 +Mk517=Stimulus,S 53,565644,1,0 +Mk518=Stimulus,S128,565654,1,0 +Mk519=Stimulus,S 54,567285,1,0 +Mk520=Stimulus,S128,567299,1,0 +Mk521=Stimulus,S 52,569106,1,0 +Mk522=Stimulus,S128,569119,1,0 +Mk523=Stimulus,S 53,588276,1,0 +Mk524=Stimulus,S128,588290,1,0 +Mk525=Stimulus,S 51,589836,1,0 +Mk526=Stimulus,S128,589849,1,0 +Mk527=Stimulus,S 53,591626,1,0 +Mk528=Stimulus,S128,591637,1,0 +Mk529=Stimulus,S 52,593657,1,0 +Mk530=Stimulus,S128,593670,1,0 +Mk531=Stimulus,S 53,595252,1,0 +Mk532=Stimulus,S128,595264,1,0 +Mk533=Stimulus,S 51,596871,1,0 +Mk534=Stimulus,S128,596884,1,0 +Mk535=Stimulus,S 52,598552,1,0 +Mk536=Stimulus,S128,598564,1,0 +Mk537=Stimulus,S 52,600256,1,0 +Mk538=Stimulus,S128,600269,1,0 +Mk539=Stimulus,S 51,602254,1,0 +Mk540=Stimulus,S128,602267,1,0 +Mk541=Stimulus,S 51,604029,1,0 +Mk542=Stimulus,S128,604042,1,0 +Mk543=Stimulus,S 52,605886,1,0 +Mk544=Stimulus,S128,605900,1,0 +Mk545=Stimulus,S 53,607549,1,0 +Mk546=Stimulus,S128,607563,1,0 +Mk547=Stimulus,S 53,609577,1,0 +Mk548=Stimulus,S128,609591,1,0 +Mk549=Stimulus,S 52,611288,1,0 +Mk550=Stimulus,S128,611302,1,0 +Mk551=Stimulus,S 52,613297,1,0 +Mk552=Stimulus,S128,613308,1,0 +Mk553=Stimulus,S 51,615309,1,0 +Mk554=Stimulus,S128,615320,1,0 +Mk555=Stimulus,S 51,617334,1,0 +Mk556=Stimulus,S128,617345,1,0 +Mk557=Stimulus,S 54,619146,1,0 +Mk558=Stimulus,S128,619159,1,0 +Mk559=Stimulus,S 51,620705,1,0 +Mk560=Stimulus,S128,620717,1,0 +Mk561=Stimulus,S 54,622633,1,0 +Mk562=Stimulus,S128,622646,1,0 +Mk563=Stimulus,S 54,624635,1,0 +Mk564=Stimulus,S128,624648,1,0 +Mk565=Stimulus,S 54,626505,1,0 +Mk566=Stimulus,S128,626519,1,0 +Mk567=Stimulus,S 51,628380,1,0 +Mk568=Stimulus,S128,628391,1,0 +Mk569=Stimulus,S 51,629961,1,0 +Mk570=Stimulus,S128,629977,1,0 +Mk571=Stimulus,S 52,631882,1,0 +Mk572=Stimulus,S128,631896,1,0 +Mk573=Stimulus,S 51,633648,1,0 +Mk574=Stimulus,S128,633658,1,0 +Mk575=Stimulus,S 52,635611,1,0 +Mk576=Stimulus,S128,635622,1,0 +Mk577=Stimulus,S 53,637618,1,0 +Mk578=Stimulus,S128,637631,1,0 +Mk579=Stimulus,S 53,639559,1,0 +Mk580=Stimulus,S128,639572,1,0 +Mk581=Stimulus,S 54,641519,1,0 +Mk582=Stimulus,S128,641529,1,0 +Mk583=Stimulus,S 54,643057,1,0 +Mk584=Stimulus,S128,643071,1,0 +Mk585=Stimulus,S 54,644900,1,0 +Mk586=Stimulus,S128,644912,1,0 +Mk587=Stimulus,S 53,646654,1,0 +Mk588=Stimulus,S128,646667,1,0 +Mk589=Stimulus,S 54,648644,1,0 +Mk590=Stimulus,S128,648658,1,0 +Mk591=Stimulus,S 52,650586,1,0 +Mk592=Stimulus,S128,650599,1,0 +Mk593=Stimulus,S 54,652230,1,0 +Mk594=Stimulus,S128,652241,1,0 +Mk595=Stimulus,S 52,653993,1,0 +Mk596=Stimulus,S128,654007,1,0 +Mk597=Stimulus,S 54,655765,1,0 +Mk598=Stimulus,S128,655779,1,0 +Mk599=Stimulus,S 53,657732,1,0 +Mk600=Stimulus,S128,657746,1,0 +Mk601=Stimulus,S 53,659419,1,0 +Mk602=Stimulus,S128,659432,1,0 +Mk603=Stimulus,S 52,679548,1,0 +Mk604=Stimulus,S128,679562,1,0 +Mk605=Stimulus,S 54,681515,1,0 +Mk606=Stimulus,S128,681529,1,0 +Mk607=Stimulus,S 51,683159,1,0 +Mk608=Stimulus,S128,683171,1,0 +Mk609=Stimulus,S 51,685171,1,0 +Mk610=Stimulus,S128,685182,1,0 +Mk611=Stimulus,S 53,686958,1,0 +Mk612=Stimulus,S128,686972,1,0 +Mk613=Stimulus,S 51,688652,1,0 +Mk614=Stimulus,S128,688663,1,0 +Mk615=Stimulus,S 53,690398,1,0 +Mk616=Stimulus,S128,690413,1,0 +Mk617=Stimulus,S 54,692402,1,0 +Mk618=Stimulus,S128,692415,1,0 +Mk619=Stimulus,S 52,694434,1,0 +Mk620=Stimulus,S128,694445,1,0 +Mk621=Stimulus,S 53,696295,1,0 +Mk622=Stimulus,S128,696308,1,0 +Mk623=Stimulus,S 52,698121,1,0 +Mk624=Stimulus,S128,698133,1,0 +Mk625=Stimulus,S 53,699958,1,0 +Mk626=Stimulus,S128,699972,1,0 +Mk627=Stimulus,S 54,701609,1,0 +Mk628=Stimulus,S128,701623,1,0 +Mk629=Stimulus,S 54,703430,1,0 +Mk630=Stimulus,S128,703444,1,0 +Mk631=Stimulus,S 51,705375,1,0 +Mk632=Stimulus,S128,705389,1,0 +Mk633=Stimulus,S 53,707038,1,0 +Mk634=Stimulus,S128,707052,1,0 +Mk635=Stimulus,S 52,708797,1,0 +Mk636=Stimulus,S128,708811,1,0 +Mk637=Stimulus,S 53,710770,1,0 +Mk638=Stimulus,S128,710780,1,0 +Mk639=Stimulus,S 53,712308,1,0 +Mk640=Stimulus,S128,712319,1,0 +Mk641=Stimulus,S 52,714144,1,0 +Mk642=Stimulus,S128,714157,1,0 +Mk643=Stimulus,S 54,716141,1,0 +Mk644=Stimulus,S128,716151,1,0 +Mk645=Stimulus,S 54,717898,1,0 +Mk646=Stimulus,S128,717910,1,0 +Mk647=Stimulus,S 53,719910,1,0 +Mk648=Stimulus,S128,719924,1,0 +Mk649=Stimulus,S 51,721931,1,0 +Mk650=Stimulus,S128,721944,1,0 +Mk651=Stimulus,S 51,723963,1,0 +Mk652=Stimulus,S128,723977,1,0 +Mk653=Stimulus,S 52,725778,1,0 +Mk654=Stimulus,S128,725791,1,0 +Mk655=Stimulus,S 52,727555,1,0 +Mk656=Stimulus,S128,727568,1,0 +Mk657=Stimulus,S 52,729253,1,0 +Mk658=Stimulus,S128,729267,1,0 +Mk659=Stimulus,S 54,731226,1,0 +Mk660=Stimulus,S128,731236,1,0 +Mk661=Stimulus,S 51,733034,1,0 +Mk662=Stimulus,S128,733047,1,0 +Mk663=Stimulus,S 52,734678,1,0 +Mk664=Stimulus,S128,734691,1,0 +Mk665=Stimulus,S 51,736383,1,0 +Mk666=Stimulus,S128,736396,1,0 +Mk667=Stimulus,S 54,738306,1,0 +Mk668=Stimulus,S128,738319,1,0 +Mk669=Stimulus,S 53,739865,1,0 +Mk670=Stimulus,S128,739878,1,0 +Mk671=Stimulus,S 53,741886,1,0 +Mk672=Stimulus,S128,741899,1,0 +Mk673=Stimulus,S 51,743858,1,0 +Mk674=Stimulus,S128,743871,1,0 +Mk675=Stimulus,S 54,745751,1,0 +Mk676=Stimulus,S128,745766,1,0 +Mk677=Stimulus,S 52,747697,1,0 +Mk678=Stimulus,S128,747710,1,0 +Mk679=Stimulus,S 51,749280,1,0 +Mk680=Stimulus,S128,749291,1,0 +Mk681=Stimulus,S 54,751116,1,0 +Mk682=Stimulus,S128,751129,1,0 +Mk683=Stimulus,S 54,775333,1,0 +Mk684=Stimulus,S128,775344,1,0 +Mk685=Stimulus,S 52,777084,1,0 +Mk686=Stimulus,S128,777097,1,0 +Mk687=Stimulus,S 52,778625,1,0 +Mk688=Stimulus,S128,778639,1,0 +Mk689=Stimulus,S 54,780403,1,0 +Mk690=Stimulus,S128,780413,1,0 +Mk691=Stimulus,S 51,782033,1,0 +Mk692=Stimulus,S128,782046,1,0 +Mk693=Stimulus,S 53,783661,1,0 +Mk694=Stimulus,S128,783675,1,0 +Mk695=Stimulus,S 52,785439,1,0 +Mk696=Stimulus,S128,785450,1,0 +Mk697=Stimulus,S 51,787111,1,0 +Mk698=Stimulus,S128,787123,1,0 +Mk699=Stimulus,S 53,788931,1,0 +Mk700=Stimulus,S128,788944,1,0 +Mk701=Stimulus,S 53,790679,1,0 +Mk702=Stimulus,S128,790693,1,0 +Mk703=Stimulus,S 54,792435,1,0 +Mk704=Stimulus,S128,792445,1,0 +Mk705=Stimulus,S 54,794136,1,0 +Mk706=Stimulus,S128,794150,1,0 +Mk707=Stimulus,S 53,795964,1,0 +Mk708=Stimulus,S128,795974,1,0 +Mk709=Stimulus,S 53,797709,1,0 +Mk710=Stimulus,S128,797722,1,0 +Mk711=Stimulus,S 54,799505,1,0 +Mk712=Stimulus,S128,799518,1,0 +Mk713=Stimulus,S 54,801338,1,0 +Mk714=Stimulus,S128,801351,1,0 +Mk715=Stimulus,S 52,803261,1,0 +Mk716=Stimulus,S128,803272,1,0 +Mk717=Stimulus,S 54,805043,1,0 +Mk718=Stimulus,S128,805054,1,0 +Mk719=Stimulus,S 52,806970,1,0 +Mk720=Stimulus,S128,806984,1,0 +Mk721=Stimulus,S 52,808730,1,0 +Mk722=Stimulus,S128,808744,1,0 +Mk723=Stimulus,S 53,810491,1,0 +Mk724=Stimulus,S128,810506,1,0 +Mk725=Stimulus,S 52,812210,1,0 +Mk726=Stimulus,S128,812220,1,0 +Mk727=Stimulus,S 54,813784,1,0 +Mk728=Stimulus,S128,813797,1,0 +Mk729=Stimulus,S 52,815452,1,0 +Mk730=Stimulus,S128,815465,1,0 +Mk731=Stimulus,S 54,817187,1,0 +Mk732=Stimulus,S128,817200,1,0 +Mk733=Stimulus,S 53,818894,1,0 +Mk734=Stimulus,S128,818905,1,0 +Mk735=Stimulus,S 53,820512,1,0 +Mk736=Stimulus,S128,820526,1,0 +Mk737=Stimulus,S 53,822321,1,0 +Mk738=Stimulus,S128,822335,1,0 +Mk739=Stimulus,S 51,824150,1,0 +Mk740=Stimulus,S128,824161,1,0 +Mk741=Stimulus,S 51,825931,1,0 +Mk742=Stimulus,S128,825944,1,0 +Mk743=Stimulus,S 51,827866,1,0 +Mk744=Stimulus,S128,827879,1,0 +Mk745=Stimulus,S 51,829492,1,0 +Mk746=Stimulus,S128,829506,1,0 +Mk747=Stimulus,S 51,831155,1,0 +Mk748=Stimulus,S128,831169,1,0 +Mk749=Stimulus,S 53,833001,1,0 +Mk750=Stimulus,S128,833015,1,0 +Mk751=Stimulus,S 54,834567,1,0 +Mk752=Stimulus,S128,834581,1,0 +Mk753=Stimulus,S 52,836279,1,0 +Mk754=Stimulus,S128,836293,1,0 +Mk755=Stimulus,S 51,838046,1,0 +Mk756=Stimulus,S128,838056,1,0 +Mk757=Stimulus,S 52,839662,1,0 +Mk758=Stimulus,S128,839676,1,0 +Mk759=Stimulus,S 51,841670,1,0 +Mk760=Stimulus,S128,841681,1,0 +Mk761=Stimulus,S 51,843694,1,0 +Mk762=Stimulus,S128,843705,1,0 +Mk763=Stimulus,S 53,864645,1,0 +Mk764=Stimulus,S128,864659,1,0 +Mk765=Stimulus,S 52,866460,1,0 +Mk766=Stimulus,S128,866470,1,0 +Mk767=Stimulus,S 54,868049,1,0 +Mk768=Stimulus,S128,868061,1,0 +Mk769=Stimulus,S 54,869656,1,0 +Mk770=Stimulus,S128,869669,1,0 +Mk771=Stimulus,S 53,871227,1,0 +Mk772=Stimulus,S128,871241,1,0 +Mk773=Stimulus,S 54,872854,1,0 +Mk774=Stimulus,S128,872867,1,0 +Mk775=Stimulus,S 53,874438,1,0 +Mk776=Stimulus,S128,874449,1,0 +Mk777=Stimulus,S 54,876463,1,0 +Mk778=Stimulus,S128,876476,1,0 +Mk779=Stimulus,S 52,878247,1,0 +Mk780=Stimulus,S128,878261,1,0 +Mk781=Stimulus,S 51,880178,1,0 +Mk782=Stimulus,S128,880194,1,0 +Mk783=Stimulus,S 54,881800,1,0 +Mk784=Stimulus,S128,881811,1,0 +Mk785=Stimulus,S 53,883351,1,0 +Mk786=Stimulus,S128,883364,1,0 +Mk787=Stimulus,S 51,885256,1,0 +Mk788=Stimulus,S128,885270,1,0 +Mk789=Stimulus,S 51,887204,1,0 +Mk790=Stimulus,S128,887215,1,0 +Mk791=Stimulus,S 51,888955,1,0 +Mk792=Stimulus,S128,888969,1,0 +Mk793=Stimulus,S 52,890588,1,0 +Mk794=Stimulus,S128,890600,1,0 +Mk795=Stimulus,S 54,892286,1,0 +Mk796=Stimulus,S128,892300,1,0 +Mk797=Stimulus,S 54,893982,1,0 +Mk798=Stimulus,S128,893993,1,0 +Mk799=Stimulus,S 54,895848,1,0 +Mk800=Stimulus,S128,895862,1,0 +Mk801=Stimulus,S 53,897790,1,0 +Mk802=Stimulus,S128,897804,1,0 +Mk803=Stimulus,S 53,899362,1,0 +Mk804=Stimulus,S128,899372,1,0 +Mk805=Stimulus,S 54,901100,1,0 +Mk806=Stimulus,S128,901113,1,0 +Mk807=Stimulus,S 51,902932,1,0 +Mk808=Stimulus,S128,902946,1,0 +Mk809=Stimulus,S 51,904469,1,0 +Mk810=Stimulus,S128,904479,1,0 +Mk811=Stimulus,S 51,906189,1,0 +Mk812=Stimulus,S128,906201,1,0 +Mk813=Stimulus,S 53,908196,1,0 +Mk814=Stimulus,S128,908209,1,0 +Mk815=Stimulus,S 52,910065,1,0 +Mk816=Stimulus,S128,910078,1,0 +Mk817=Stimulus,S 53,911746,1,0 +Mk818=Stimulus,S128,911756,1,0 +Mk819=Stimulus,S 52,913491,1,0 +Mk820=Stimulus,S128,913505,1,0 +Mk821=Stimulus,S 53,915087,1,0 +Mk822=Stimulus,S128,915099,1,0 +Mk823=Stimulus,S 53,916863,1,0 +Mk824=Stimulus,S128,916877,1,0 +Mk825=Stimulus,S 51,918611,1,0 +Mk826=Stimulus,S128,918624,1,0 +Mk827=Stimulus,S 51,920243,1,0 +Mk828=Stimulus,S128,920255,1,0 +Mk829=Stimulus,S 51,921776,1,0 +Mk830=Stimulus,S128,921787,1,0 +Mk831=Stimulus,S 52,923466,1,0 +Mk832=Stimulus,S128,923480,1,0 +Mk833=Stimulus,S 52,925384,1,0 +Mk834=Stimulus,S128,925398,1,0 +Mk835=Stimulus,S 52,927059,1,0 +Mk836=Stimulus,S128,927072,1,0 +Mk837=Stimulus,S 52,928946,1,0 +Mk838=Stimulus,S128,928957,1,0 +Mk839=Stimulus,S 52,930940,1,0 +Mk840=Stimulus,S128,930953,1,0 +Mk841=Stimulus,S 54,932605,1,0 +Mk842=Stimulus,S128,932618,1,0 +Mk843=Stimulus,S 54,970828,1,0 +Mk844=Stimulus,S128,970843,1,0 +Mk845=Stimulus,S 51,972826,1,0 +Mk846=Stimulus,S128,972840,1,0 +Mk847=Stimulus,S 54,974513,1,0 +Mk848=Stimulus,S128,974527,1,0 +Mk849=Stimulus,S 53,976170,1,0 +Mk850=Stimulus,S128,976181,1,0 +Mk851=Stimulus,S 51,977964,1,0 +Mk852=Stimulus,S128,977978,1,0 +Mk853=Stimulus,S 53,979864,1,0 +Mk854=Stimulus,S128,979876,1,0 +Mk855=Stimulus,S 54,981822,1,0 +Mk856=Stimulus,S128,981836,1,0 +Mk857=Stimulus,S 52,983468,1,0 +Mk858=Stimulus,S128,983480,1,0 +Mk859=Stimulus,S 53,985245,1,0 +Mk860=Stimulus,S128,985258,1,0 +Mk861=Stimulus,S 52,986825,1,0 +Mk862=Stimulus,S128,986838,1,0 +Mk863=Stimulus,S 54,988700,1,0 +Mk864=Stimulus,S128,988712,1,0 +Mk865=Stimulus,S 52,990726,1,0 +Mk866=Stimulus,S128,990740,1,0 +Mk867=Stimulus,S 54,992650,1,0 +Mk868=Stimulus,S128,992660,1,0 +Mk869=Stimulus,S 51,994479,1,0 +Mk870=Stimulus,S128,994493,1,0 +Mk871=Stimulus,S 53,996324,1,0 +Mk872=Stimulus,S128,996338,1,0 +Mk873=Stimulus,S 53,997999,1,0 +Mk874=Stimulus,S128,998013,1,0 +Mk875=Stimulus,S 53,999790,1,0 +Mk876=Stimulus,S128,999801,1,0 +Mk877=Stimulus,S 52,1001365,1,0 +Mk878=Stimulus,S128,1001376,1,0 +Mk879=Stimulus,S 54,1003044,1,0 +Mk880=Stimulus,S128,1003057,1,0 +Mk881=Stimulus,S 51,1005040,1,0 +Mk882=Stimulus,S128,1005052,1,0 +Mk883=Stimulus,S 52,1006682,1,0 +Mk884=Stimulus,S128,1006696,1,0 +Mk885=Stimulus,S 54,1008673,1,0 +Mk886=Stimulus,S128,1008686,1,0 +Mk887=Stimulus,S 51,1010547,1,0 +Mk888=Stimulus,S128,1010558,1,0 +Mk889=Stimulus,S 53,1012407,1,0 +Mk890=Stimulus,S128,1012421,1,0 +Mk891=Stimulus,S 51,1013988,1,0 +Mk892=Stimulus,S128,1014001,1,0 +Mk893=Stimulus,S 52,1015942,1,0 +Mk894=Stimulus,S128,1015956,1,0 +Mk895=Stimulus,S 52,1017811,1,0 +Mk896=Stimulus,S128,1017825,1,0 +Mk897=Stimulus,S 51,1019631,1,0 +Mk898=Stimulus,S128,1019646,1,0 +Mk899=Stimulus,S 53,1021659,1,0 +Mk900=Stimulus,S128,1021673,1,0 +Mk901=Stimulus,S 51,1023662,1,0 +Mk902=Stimulus,S128,1023676,1,0 +Mk903=Stimulus,S 52,1025659,1,0 +Mk904=Stimulus,S128,1025670,1,0 +Mk905=Stimulus,S 54,1027568,1,0 +Mk906=Stimulus,S128,1027582,1,0 +Mk907=Stimulus,S 51,1029368,1,0 +Mk908=Stimulus,S128,1029381,1,0 +Mk909=Stimulus,S 51,1030994,1,0 +Mk910=Stimulus,S128,1031008,1,0 +Mk911=Stimulus,S 52,1032724,1,0 +Mk912=Stimulus,S128,1032735,1,0 +Mk913=Stimulus,S 53,1034515,1,0 +Mk914=Stimulus,S128,1034526,1,0 +Mk915=Stimulus,S 54,1036430,1,0 +Mk916=Stimulus,S128,1036440,1,0 +Mk917=Stimulus,S 53,1038174,1,0 +Mk918=Stimulus,S128,1038188,1,0 +Mk919=Stimulus,S 54,1039911,1,0 +Mk920=Stimulus,S128,1039925,1,0 +Mk921=Stimulus,S 52,1041513,1,0 +Mk922=Stimulus,S128,1041527,1,0 +Mk923=Stimulus,S 41,1061785,1,0 +Mk924=Stimulus,S128,1061796,1,0 +Mk925=Stimulus,S 41,1063384,1,0 +Mk926=Stimulus,S128,1063395,1,0 +Mk927=Stimulus,S 41,1065232,1,0 +Mk928=Stimulus,S128,1065246,1,0 +Mk929=Stimulus,S 43,1067096,1,0 +Mk930=Stimulus,S128,1067105,1,0 +Mk931=Stimulus,S 42,1069047,1,0 +Mk932=Stimulus,S128,1069058,1,0 +Mk933=Stimulus,S 43,1070805,1,0 +Mk934=Stimulus,S128,1070818,1,0 +Mk935=Stimulus,S 41,1072728,1,0 +Mk936=Stimulus,S128,1072742,1,0 +Mk937=Stimulus,S 42,1074530,1,0 +Mk938=Stimulus,S128,1074544,1,0 +Mk939=Stimulus,S 42,1076466,1,0 +Mk940=Stimulus,S128,1076478,1,0 +Mk941=Stimulus,S 43,1078127,1,0 +Mk942=Stimulus,S128,1078141,1,0 +Mk943=Stimulus,S 41,1079796,1,0 +Mk944=Stimulus,S128,1079807,1,0 +Mk945=Stimulus,S 41,1081668,1,0 +Mk946=Stimulus,S128,1081683,1,0 +Mk947=Stimulus,S 43,1083605,1,0 +Mk948=Stimulus,S128,1083618,1,0 +Mk949=Stimulus,S 42,1085407,1,0 +Mk950=Stimulus,S128,1085420,1,0 +Mk951=Stimulus,S 44,1087066,1,0 +Mk952=Stimulus,S128,1087078,1,0 +Mk953=Stimulus,S 42,1089000,1,0 +Mk954=Stimulus,S128,1089014,1,0 +Mk955=Stimulus,S 44,1090930,1,0 +Mk956=Stimulus,S128,1090943,1,0 +Mk957=Stimulus,S 41,1092823,1,0 +Mk958=Stimulus,S128,1092837,1,0 +Mk959=Stimulus,S 44,1094759,1,0 +Mk960=Stimulus,S128,1094770,1,0 +Mk961=Stimulus,S 43,1096395,1,0 +Mk962=Stimulus,S128,1096406,1,0 +Mk963=Stimulus,S 41,1098310,1,0 +Mk964=Stimulus,S128,1098324,1,0 +Mk965=Stimulus,S 44,1099876,1,0 +Mk966=Stimulus,S128,1099890,1,0 +Mk967=Stimulus,S 41,1101703,1,0 +Mk968=Stimulus,S128,1101713,1,0 +Mk969=Stimulus,S 43,1103563,1,0 +Mk970=Stimulus,S128,1103576,1,0 +Mk971=Stimulus,S 44,1105359,1,0 +Mk972=Stimulus,S128,1105372,1,0 +Mk973=Stimulus,S 42,1107034,1,0 +Mk974=Stimulus,S128,1107048,1,0 +Mk975=Stimulus,S 43,1108788,1,0 +Mk976=Stimulus,S128,1108799,1,0 +Mk977=Stimulus,S 42,1110357,1,0 +Mk978=Stimulus,S128,1110371,1,0 +Mk979=Stimulus,S 44,1112257,1,0 +Mk980=Stimulus,S128,1112267,1,0 +Mk981=Stimulus,S 43,1114047,1,0 +Mk982=Stimulus,S128,1114060,1,0 +Mk983=Stimulus,S 41,1115594,1,0 +Mk984=Stimulus,S128,1115604,1,0 +Mk985=Stimulus,S 44,1117478,1,0 +Mk986=Stimulus,S128,1117492,1,0 +Mk987=Stimulus,S 44,1119396,1,0 +Mk988=Stimulus,S128,1119410,1,0 +Mk989=Stimulus,S 43,1121077,1,0 +Mk990=Stimulus,S128,1121088,1,0 +Mk991=Stimulus,S 43,1122725,1,0 +Mk992=Stimulus,S128,1122738,1,0 +Mk993=Stimulus,S 44,1124339,1,0 +Mk994=Stimulus,S128,1124352,1,0 +Mk995=Stimulus,S 42,1125971,1,0 +Mk996=Stimulus,S128,1125982,1,0 +Mk997=Stimulus,S 42,1127900,1,0 +Mk998=Stimulus,S128,1127914,1,0 +Mk999=Stimulus,S 42,1129557,1,0 +Mk1000=Stimulus,S128,1129570,1,0 +Mk1001=Stimulus,S 44,1131232,1,0 +Mk1002=Stimulus,S128,1131245,1,0 +Mk1003=Stimulus,S 42,1161069,1,0 +Mk1004=Stimulus,S128,1161079,1,0 +Mk1005=Stimulus,S 42,1162839,1,0 +Mk1006=Stimulus,S128,1162852,1,0 +Mk1007=Stimulus,S 44,1164719,1,0 +Mk1008=Stimulus,S128,1164733,1,0 +Mk1009=Stimulus,S 42,1166662,1,0 +Mk1010=Stimulus,S128,1166675,1,0 +Mk1011=Stimulus,S 43,1168658,1,0 +Mk1012=Stimulus,S128,1168668,1,0 +Mk1013=Stimulus,S 42,1170616,1,0 +Mk1014=Stimulus,S128,1170630,1,0 +Mk1015=Stimulus,S 43,1172255,1,0 +Mk1016=Stimulus,S128,1172268,1,0 +Mk1017=Stimulus,S 41,1173929,1,0 +Mk1018=Stimulus,S128,1173942,1,0 +Mk1019=Stimulus,S 43,1175730,1,0 +Mk1020=Stimulus,S128,1175741,1,0 +Mk1021=Stimulus,S 44,1177730,1,0 +Mk1022=Stimulus,S128,1177740,1,0 +Mk1023=Stimulus,S 42,1179668,1,0 +Mk1024=Stimulus,S128,1179680,1,0 +Mk1025=Stimulus,S 41,1181592,1,0 +Mk1026=Stimulus,S128,1181603,1,0 +Mk1027=Stimulus,S 43,1183247,1,0 +Mk1028=Stimulus,S128,1183262,1,0 +Mk1029=Stimulus,S 43,1185100,1,0 +Mk1030=Stimulus,S128,1185113,1,0 +Mk1031=Stimulus,S 42,1187041,1,0 +Mk1032=Stimulus,S128,1187055,1,0 +Mk1033=Stimulus,S 44,1188728,1,0 +Mk1034=Stimulus,S128,1188742,1,0 +Mk1035=Stimulus,S 41,1190694,1,0 +Mk1036=Stimulus,S128,1190707,1,0 +Mk1037=Stimulus,S 43,1192544,1,0 +Mk1038=Stimulus,S128,1192554,1,0 +Mk1039=Stimulus,S 44,1194507,1,0 +Mk1040=Stimulus,S128,1194517,1,0 +Mk1041=Stimulus,S 42,1196196,1,0 +Mk1042=Stimulus,S128,1196209,1,0 +Mk1043=Stimulus,S 42,1198103,1,0 +Mk1044=Stimulus,S128,1198117,1,0 +Mk1045=Stimulus,S 41,1200094,1,0 +Mk1046=Stimulus,S128,1200107,1,0 +Mk1047=Stimulus,S 41,1201841,1,0 +Mk1048=Stimulus,S128,1201855,1,0 +Mk1049=Stimulus,S 43,1203698,1,0 +Mk1050=Stimulus,S128,1203711,1,0 +Mk1051=Stimulus,S 41,1205639,1,0 +Mk1052=Stimulus,S128,1205653,1,0 +Mk1053=Stimulus,S 43,1207180,1,0 +Mk1054=Stimulus,S128,1207194,1,0 +Mk1055=Stimulus,S 41,1208905,1,0 +Mk1056=Stimulus,S128,1208918,1,0 +Mk1057=Stimulus,S 43,1210550,1,0 +Mk1058=Stimulus,S128,1210560,1,0 +Mk1059=Stimulus,S 44,1212410,1,0 +Mk1060=Stimulus,S128,1212423,1,0 +Mk1061=Stimulus,S 43,1214400,1,0 +Mk1062=Stimulus,S128,1214414,1,0 +Mk1063=Stimulus,S 42,1216294,1,0 +Mk1064=Stimulus,S128,1216307,1,0 +Mk1065=Stimulus,S 41,1217962,1,0 +Mk1066=Stimulus,S128,1217973,1,0 +Mk1067=Stimulus,S 44,1219597,1,0 +Mk1068=Stimulus,S128,1219608,1,0 +Mk1069=Stimulus,S 44,1221257,1,0 +Mk1070=Stimulus,S128,1221268,1,0 +Mk1071=Stimulus,S 41,1222832,1,0 +Mk1072=Stimulus,S128,1222843,1,0 +Mk1073=Stimulus,S 41,1224476,1,0 +Mk1074=Stimulus,S128,1224490,1,0 +Mk1075=Stimulus,S 42,1226321,1,0 +Mk1076=Stimulus,S128,1226335,1,0 +Mk1077=Stimulus,S 44,1227905,1,0 +Mk1078=Stimulus,S128,1227916,1,0 +Mk1079=Stimulus,S 44,1229795,1,0 +Mk1080=Stimulus,S128,1229806,1,0 +Mk1081=Stimulus,S 44,1231498,1,0 +Mk1082=Stimulus,S128,1231512,1,0 +Mk1083=Stimulus,S 41,1254341,1,0 +Mk1084=Stimulus,S128,1254351,1,0 +Mk1085=Stimulus,S 44,1255922,1,0 +Mk1086=Stimulus,S128,1255936,1,0 +Mk1087=Stimulus,S 42,1257938,1,0 +Mk1088=Stimulus,S128,1257952,1,0 +Mk1089=Stimulus,S 44,1259546,1,0 +Mk1090=Stimulus,S128,1259558,1,0 +Mk1091=Stimulus,S 44,1261431,1,0 +Mk1092=Stimulus,S128,1261445,1,0 +Mk1093=Stimulus,S 43,1262979,1,0 +Mk1094=Stimulus,S128,1262990,1,0 +Mk1095=Stimulus,S 43,1264997,1,0 +Mk1096=Stimulus,S128,1265010,1,0 +Mk1097=Stimulus,S 41,1266550,1,0 +Mk1098=Stimulus,S128,1266564,1,0 +Mk1099=Stimulus,S 41,1268329,1,0 +Mk1100=Stimulus,S128,1268339,1,0 +Mk1101=Stimulus,S 43,1270147,1,0 +Mk1102=Stimulus,S128,1270158,1,0 +Mk1103=Stimulus,S 43,1272051,1,0 +Mk1104=Stimulus,S128,1272062,1,0 +Mk1105=Stimulus,S 42,1273821,1,0 +Mk1106=Stimulus,S128,1273831,1,0 +Mk1107=Stimulus,S 43,1275505,1,0 +Mk1108=Stimulus,S128,1275519,1,0 +Mk1109=Stimulus,S 44,1277315,1,0 +Mk1110=Stimulus,S128,1277329,1,0 +Mk1111=Stimulus,S 41,1278996,1,0 +Mk1112=Stimulus,S128,1279007,1,0 +Mk1113=Stimulus,S 44,1280826,1,0 +Mk1114=Stimulus,S128,1280840,1,0 +Mk1115=Stimulus,S 41,1282501,1,0 +Mk1116=Stimulus,S128,1282515,1,0 +Mk1117=Stimulus,S 44,1284362,1,0 +Mk1118=Stimulus,S128,1284375,1,0 +Mk1119=Stimulus,S 44,1286212,1,0 +Mk1120=Stimulus,S128,1286223,1,0 +Mk1121=Stimulus,S 42,1287890,1,0 +Mk1122=Stimulus,S128,1287904,1,0 +Mk1123=Stimulus,S 42,1289808,1,0 +Mk1124=Stimulus,S128,1289822,1,0 +Mk1125=Stimulus,S 44,1291641,1,0 +Mk1126=Stimulus,S128,1291655,1,0 +Mk1127=Stimulus,S 41,1293225,1,0 +Mk1128=Stimulus,S128,1293235,1,0 +Mk1129=Stimulus,S 43,1294914,1,0 +Mk1130=Stimulus,S128,1294928,1,0 +Mk1131=Stimulus,S 42,1296729,1,0 +Mk1132=Stimulus,S128,1296740,1,0 +Mk1133=Stimulus,S 43,1298428,1,0 +Mk1134=Stimulus,S128,1298441,1,0 +Mk1135=Stimulus,S 41,1300260,1,0 +Mk1136=Stimulus,S128,1300274,1,0 +Mk1137=Stimulus,S 42,1302057,1,0 +Mk1138=Stimulus,S128,1302070,1,0 +Mk1139=Stimulus,S 42,1303737,1,0 +Mk1140=Stimulus,S128,1303748,1,0 +Mk1141=Stimulus,S 41,1305549,1,0 +Mk1142=Stimulus,S128,1305563,1,0 +Mk1143=Stimulus,S 42,1307558,1,0 +Mk1144=Stimulus,S128,1307569,1,0 +Mk1145=Stimulus,S 41,1309515,1,0 +Mk1146=Stimulus,S128,1309529,1,0 +Mk1147=Stimulus,S 44,1311257,1,0 +Mk1148=Stimulus,S128,1311270,1,0 +Mk1149=Stimulus,S 43,1312822,1,0 +Mk1150=Stimulus,S128,1312836,1,0 +Mk1151=Stimulus,S 42,1314443,1,0 +Mk1152=Stimulus,S128,1314454,1,0 +Mk1153=Stimulus,S 43,1316049,1,0 +Mk1154=Stimulus,S128,1316063,1,0 +Mk1155=Stimulus,S 44,1318003,1,0 +Mk1156=Stimulus,S128,1318017,1,0 +Mk1157=Stimulus,S 41,1319823,1,0 +Mk1158=Stimulus,S128,1319838,1,0 +Mk1159=Stimulus,S 42,1321669,1,0 +Mk1160=Stimulus,S128,1321683,1,0 +Mk1161=Stimulus,S 43,1323665,1,0 +Mk1162=Stimulus,S128,1323676,1,0 +Mk1163=Stimulus,S 44,1340167,1,0 +Mk1164=Stimulus,S128,1340181,1,0 +Mk1165=Stimulus,S 41,1341805,1,0 +Mk1166=Stimulus,S128,1341819,1,0 +Mk1167=Stimulus,S 42,1343486,1,0 +Mk1168=Stimulus,S128,1343497,1,0 +Mk1169=Stimulus,S 41,1345031,1,0 +Mk1170=Stimulus,S128,1345045,1,0 +Mk1171=Stimulus,S 42,1346876,1,0 +Mk1172=Stimulus,S128,1346890,1,0 +Mk1173=Stimulus,S 43,1348612,1,0 +Mk1174=Stimulus,S128,1348625,1,0 +Mk1175=Stimulus,S 44,1350183,1,0 +Mk1176=Stimulus,S128,1350194,1,0 +Mk1177=Stimulus,S 44,1351898,1,0 +Mk1178=Stimulus,S128,1351911,1,0 +Mk1179=Stimulus,S 44,1353537,1,0 +Mk1180=Stimulus,S128,1353550,1,0 +Mk1181=Stimulus,S 44,1355268,1,0 +Mk1182=Stimulus,S128,1355278,1,0 +Mk1183=Stimulus,S 44,1357189,1,0 +Mk1184=Stimulus,S128,1357202,1,0 +Mk1185=Stimulus,S 43,1359040,1,0 +Mk1186=Stimulus,S128,1359051,1,0 +Mk1187=Stimulus,S 43,1360742,1,0 +Mk1188=Stimulus,S128,1360755,1,0 +Mk1189=Stimulus,S 41,1362459,1,0 +Mk1190=Stimulus,S128,1362470,1,0 +Mk1191=Stimulus,S 42,1364138,1,0 +Mk1192=Stimulus,S128,1364151,1,0 +Mk1193=Stimulus,S 44,1365988,1,0 +Mk1194=Stimulus,S128,1365999,1,0 +Mk1195=Stimulus,S 43,1367606,1,0 +Mk1196=Stimulus,S128,1367619,1,0 +Mk1197=Stimulus,S 42,1369641,1,0 +Mk1198=Stimulus,S128,1369651,1,0 +Mk1199=Stimulus,S 41,1371549,1,0 +Mk1200=Stimulus,S128,1371563,1,0 +Mk1201=Stimulus,S 44,1373085,1,0 +Mk1202=Stimulus,S128,1373094,1,0 +Mk1203=Stimulus,S 43,1374665,1,0 +Mk1204=Stimulus,S128,1374679,1,0 +Mk1205=Stimulus,S 43,1376570,1,0 +Mk1206=Stimulus,S128,1376584,1,0 +Mk1207=Stimulus,S 42,1378349,1,0 +Mk1208=Stimulus,S128,1378359,1,0 +Mk1209=Stimulus,S 42,1380239,1,0 +Mk1210=Stimulus,S128,1380253,1,0 +Mk1211=Stimulus,S 43,1382037,1,0 +Mk1212=Stimulus,S128,1382051,1,0 +Mk1213=Stimulus,S 42,1383670,1,0 +Mk1214=Stimulus,S128,1383680,1,0 +Mk1215=Stimulus,S 42,1385359,1,0 +Mk1216=Stimulus,S128,1385373,1,0 +Mk1217=Stimulus,S 43,1387388,1,0 +Mk1218=Stimulus,S128,1387401,1,0 +Mk1219=Stimulus,S 42,1389147,1,0 +Mk1220=Stimulus,S128,1389161,1,0 +Mk1221=Stimulus,S 41,1390706,1,0 +Mk1222=Stimulus,S128,1390716,1,0 +Mk1223=Stimulus,S 44,1392699,1,0 +Mk1224=Stimulus,S128,1392713,1,0 +Mk1225=Stimulus,S 43,1394328,1,0 +Mk1226=Stimulus,S128,1394341,1,0 +Mk1227=Stimulus,S 41,1396041,1,0 +Mk1228=Stimulus,S128,1396054,1,0 +Mk1229=Stimulus,S 41,1397873,1,0 +Mk1230=Stimulus,S128,1397886,1,0 +Mk1231=Stimulus,S 41,1399856,1,0 +Mk1232=Stimulus,S128,1399867,1,0 +Mk1233=Stimulus,S 42,1401741,1,0 +Mk1234=Stimulus,S128,1401754,1,0 +Mk1235=Stimulus,S 41,1403331,1,0 +Mk1236=Stimulus,S128,1403344,1,0 +Mk1237=Stimulus,S 44,1405102,1,0 +Mk1238=Stimulus,S128,1405115,1,0 +Mk1239=Stimulus,S 43,1406953,1,0 +Mk1240=Stimulus,S128,1406963,1,0 +Mk1241=Stimulus,S 41,1408589,1,0 +Mk1242=Stimulus,S128,1408599,1,0 +Mk1243=Stimulus,S 42,1446047,1,0 +Mk1244=Stimulus,S128,1446058,1,0 +Mk1245=Stimulus,S 43,1447871,1,0 +Mk1246=Stimulus,S128,1447885,1,0 +Mk1247=Stimulus,S 41,1449528,1,0 +Mk1248=Stimulus,S128,1449538,1,0 +Mk1249=Stimulus,S 44,1451212,1,0 +Mk1250=Stimulus,S128,1451222,1,0 +Mk1251=Stimulus,S 44,1452913,1,0 +Mk1252=Stimulus,S128,1452927,1,0 +Mk1253=Stimulus,S 41,1454776,1,0 +Mk1254=Stimulus,S128,1454787,1,0 +Mk1255=Stimulus,S 41,1456764,1,0 +Mk1256=Stimulus,S128,1456774,1,0 +Mk1257=Stimulus,S 43,1458539,1,0 +Mk1258=Stimulus,S128,1458552,1,0 +Mk1259=Stimulus,S 41,1460384,1,0 +Mk1260=Stimulus,S128,1460400,1,0 +Mk1261=Stimulus,S 42,1461977,1,0 +Mk1262=Stimulus,S128,1461991,1,0 +Mk1263=Stimulus,S 43,1463513,1,0 +Mk1264=Stimulus,S128,1463524,1,0 +Mk1265=Stimulus,S 43,1465130,1,0 +Mk1266=Stimulus,S128,1465145,1,0 +Mk1267=Stimulus,S 43,1466733,1,0 +Mk1268=Stimulus,S128,1466747,1,0 +Mk1269=Stimulus,S 44,1468457,1,0 +Mk1270=Stimulus,S128,1468470,1,0 +Mk1271=Stimulus,S 43,1470210,1,0 +Mk1272=Stimulus,S128,1470222,1,0 +Mk1273=Stimulus,S 42,1472090,1,0 +Mk1274=Stimulus,S128,1472100,1,0 +Mk1275=Stimulus,S 43,1474091,1,0 +Mk1276=Stimulus,S128,1474105,1,0 +Mk1277=Stimulus,S 44,1476070,1,0 +Mk1278=Stimulus,S128,1476084,1,0 +Mk1279=Stimulus,S 43,1477709,1,0 +Mk1280=Stimulus,S128,1477723,1,0 +Mk1281=Stimulus,S 41,1479742,1,0 +Mk1282=Stimulus,S128,1479753,1,0 +Mk1283=Stimulus,S 43,1481323,1,0 +Mk1284=Stimulus,S128,1481338,1,0 +Mk1285=Stimulus,S 41,1483284,1,0 +Mk1286=Stimulus,S128,1483296,1,0 +Mk1287=Stimulus,S 42,1485049,1,0 +Mk1288=Stimulus,S128,1485063,1,0 +Mk1289=Stimulus,S 41,1486852,1,0 +Mk1290=Stimulus,S128,1486866,1,0 +Mk1291=Stimulus,S 44,1488788,1,0 +Mk1292=Stimulus,S128,1488801,1,0 +Mk1293=Stimulus,S 42,1490657,1,0 +Mk1294=Stimulus,S128,1490670,1,0 +Mk1295=Stimulus,S 42,1492271,1,0 +Mk1296=Stimulus,S128,1492285,1,0 +Mk1297=Stimulus,S 44,1494244,1,0 +Mk1298=Stimulus,S128,1494255,1,0 +Mk1299=Stimulus,S 41,1495879,1,0 +Mk1300=Stimulus,S128,1495892,1,0 +Mk1301=Stimulus,S 42,1497486,1,0 +Mk1302=Stimulus,S128,1497499,1,0 +Mk1303=Stimulus,S 42,1499318,1,0 +Mk1304=Stimulus,S128,1499332,1,0 +Mk1305=Stimulus,S 42,1501111,1,0 +Mk1306=Stimulus,S128,1501121,1,0 +Mk1307=Stimulus,S 44,1502789,1,0 +Mk1308=Stimulus,S128,1502802,1,0 +Mk1309=Stimulus,S 41,1504324,1,0 +Mk1310=Stimulus,S128,1504335,1,0 +Mk1311=Stimulus,S 44,1506088,1,0 +Mk1312=Stimulus,S128,1506101,1,0 +Mk1313=Stimulus,S 41,1507647,1,0 +Mk1314=Stimulus,S128,1507659,1,0 +Mk1315=Stimulus,S 44,1509570,1,0 +Mk1316=Stimulus,S128,1509584,1,0 +Mk1317=Stimulus,S 43,1511196,1,0 +Mk1318=Stimulus,S128,1511210,1,0 +Mk1319=Stimulus,S 42,1513157,1,0 +Mk1320=Stimulus,S128,1513168,1,0 +Mk1321=Stimulus,S 44,1514796,1,0 +Mk1322=Stimulus,S128,1514809,1,0 +Mk1323=Stimulus,S 42,1549341,1,0 +Mk1324=Stimulus,S128,1549354,1,0 +Mk1325=Stimulus,S 43,1550960,1,0 +Mk1326=Stimulus,S128,1550971,1,0 +Mk1327=Stimulus,S 44,1552917,1,0 +Mk1328=Stimulus,S128,1552930,1,0 +Mk1329=Stimulus,S 43,1554846,1,0 +Mk1330=Stimulus,S128,1554859,1,0 +Mk1331=Stimulus,S 42,1556381,1,0 +Mk1332=Stimulus,S128,1556392,1,0 +Mk1333=Stimulus,S 41,1558295,1,0 +Mk1334=Stimulus,S128,1558306,1,0 +Mk1335=Stimulus,S 43,1559877,1,0 +Mk1336=Stimulus,S128,1559893,1,0 +Mk1337=Stimulus,S 43,1561766,1,0 +Mk1338=Stimulus,S128,1561779,1,0 +Mk1339=Stimulus,S 43,1563421,1,0 +Mk1340=Stimulus,S128,1563435,1,0 +Mk1341=Stimulus,S 43,1565059,1,0 +Mk1342=Stimulus,S128,1565073,1,0 +Mk1343=Stimulus,S 43,1567080,1,0 +Mk1344=Stimulus,S128,1567090,1,0 +Mk1345=Stimulus,S 43,1568708,1,0 +Mk1346=Stimulus,S128,1568722,1,0 +Mk1347=Stimulus,S 42,1570662,1,0 +Mk1348=Stimulus,S128,1570675,1,0 +Mk1349=Stimulus,S 41,1572344,1,0 +Mk1350=Stimulus,S128,1572353,1,0 +Mk1351=Stimulus,S 41,1574223,1,0 +Mk1352=Stimulus,S128,1574236,1,0 +Mk1353=Stimulus,S 44,1575849,1,0 +Mk1354=Stimulus,S128,1575861,1,0 +Mk1355=Stimulus,S 42,1577857,1,0 +Mk1356=Stimulus,S128,1577867,1,0 +Mk1357=Stimulus,S 43,1579595,1,0 +Mk1358=Stimulus,S128,1579608,1,0 +Mk1359=Stimulus,S 41,1581390,1,0 +Mk1360=Stimulus,S128,1581404,1,0 +Mk1361=Stimulus,S 44,1582956,1,0 +Mk1362=Stimulus,S128,1582969,1,0 +Mk1363=Stimulus,S 42,1584516,1,0 +Mk1364=Stimulus,S128,1584526,1,0 +Mk1365=Stimulus,S 44,1586134,1,0 +Mk1366=Stimulus,S128,1586147,1,0 +Mk1367=Stimulus,S 42,1587871,1,0 +Mk1368=Stimulus,S128,1587883,1,0 +Mk1369=Stimulus,S 44,1589411,1,0 +Mk1370=Stimulus,S128,1589425,1,0 +Mk1371=Stimulus,S 41,1591025,1,0 +Mk1372=Stimulus,S128,1591039,1,0 +Mk1373=Stimulus,S 41,1592578,1,0 +Mk1374=Stimulus,S128,1592592,1,0 +Mk1375=Stimulus,S 44,1594138,1,0 +Mk1376=Stimulus,S128,1594148,1,0 +Mk1377=Stimulus,S 41,1595852,1,0 +Mk1378=Stimulus,S128,1595866,1,0 +Mk1379=Stimulus,S 44,1597788,1,0 +Mk1380=Stimulus,S128,1597799,1,0 +Mk1381=Stimulus,S 42,1599657,1,0 +Mk1382=Stimulus,S128,1599667,1,0 +Mk1383=Stimulus,S 44,1601377,1,0 +Mk1384=Stimulus,S128,1601388,1,0 +Mk1385=Stimulus,S 44,1603322,1,0 +Mk1386=Stimulus,S128,1603335,1,0 +Mk1387=Stimulus,S 44,1605185,1,0 +Mk1388=Stimulus,S128,1605196,1,0 +Mk1389=Stimulus,S 43,1607130,1,0 +Mk1390=Stimulus,S128,1607143,1,0 +Mk1391=Stimulus,S 41,1609077,1,0 +Mk1392=Stimulus,S128,1609088,1,0 +Mk1393=Stimulus,S 42,1610694,1,0 +Mk1394=Stimulus,S128,1610708,1,0 +Mk1395=Stimulus,S 42,1612533,1,0 +Mk1396=Stimulus,S128,1612543,1,0 +Mk1397=Stimulus,S 42,1614109,1,0 +Mk1398=Stimulus,S128,1614123,1,0 +Mk1399=Stimulus,S 41,1615784,1,0 +Mk1400=Stimulus,S128,1615798,1,0 +Mk1401=Stimulus,S 41,1617756,1,0 +Mk1402=Stimulus,S128,1617767,1,0 +Mk1403=Stimulus,S 43,1645299,1,0 +Mk1404=Stimulus,S128,1645311,1,0 +Mk1405=Stimulus,S 44,1647306,1,0 +Mk1406=Stimulus,S128,1647320,1,0 +Mk1407=Stimulus,S 44,1649267,1,0 +Mk1408=Stimulus,S128,1649278,1,0 +Mk1409=Stimulus,S 41,1650951,1,0 +Mk1410=Stimulus,S128,1650965,1,0 +Mk1411=Stimulus,S 44,1652814,1,0 +Mk1412=Stimulus,S128,1652826,1,0 +Mk1413=Stimulus,S 42,1654568,1,0 +Mk1414=Stimulus,S128,1654581,1,0 +Mk1415=Stimulus,S 43,1656248,1,0 +Mk1416=Stimulus,S128,1656261,1,0 +Mk1417=Stimulus,S 42,1658159,1,0 +Mk1418=Stimulus,S128,1658172,1,0 +Mk1419=Stimulus,S 41,1660009,1,0 +Mk1420=Stimulus,S128,1660022,1,0 +Mk1421=Stimulus,S 41,1661823,1,0 +Mk1422=Stimulus,S128,1661837,1,0 +Mk1423=Stimulus,S 41,1663413,1,0 +Mk1424=Stimulus,S128,1663427,1,0 +Mk1425=Stimulus,S 44,1665434,1,0 +Mk1426=Stimulus,S128,1665445,1,0 +Mk1427=Stimulus,S 42,1667290,1,0 +Mk1428=Stimulus,S128,1667305,1,0 +Mk1429=Stimulus,S 44,1669027,1,0 +Mk1430=Stimulus,S128,1669041,1,0 +Mk1431=Stimulus,S 43,1670787,1,0 +Mk1432=Stimulus,S128,1670801,1,0 +Mk1433=Stimulus,S 41,1672322,1,0 +Mk1434=Stimulus,S128,1672333,1,0 +Mk1435=Stimulus,S 41,1673994,1,0 +Mk1436=Stimulus,S128,1674007,1,0 +Mk1437=Stimulus,S 41,1675843,1,0 +Mk1438=Stimulus,S128,1675856,1,0 +Mk1439=Stimulus,S 43,1677505,1,0 +Mk1440=Stimulus,S128,1677519,1,0 +Mk1441=Stimulus,S 42,1679108,1,0 +Mk1442=Stimulus,S128,1679122,1,0 +Mk1443=Stimulus,S 43,1680803,1,0 +Mk1444=Stimulus,S128,1680814,1,0 +Mk1445=Stimulus,S 42,1682730,1,0 +Mk1446=Stimulus,S128,1682741,1,0 +Mk1447=Stimulus,S 43,1684427,1,0 +Mk1448=Stimulus,S128,1684441,1,0 +Mk1449=Stimulus,S 44,1686169,1,0 +Mk1450=Stimulus,S128,1686181,1,0 +Mk1451=Stimulus,S 42,1688079,1,0 +Mk1452=Stimulus,S128,1688093,1,0 +Mk1453=Stimulus,S 43,1689706,1,0 +Mk1454=Stimulus,S128,1689720,1,0 +Mk1455=Stimulus,S 44,1691430,1,0 +Mk1456=Stimulus,S128,1691443,1,0 +Mk1457=Stimulus,S 41,1693111,1,0 +Mk1458=Stimulus,S128,1693121,1,0 +Mk1459=Stimulus,S 42,1694758,1,0 +Mk1460=Stimulus,S128,1694770,1,0 +Mk1461=Stimulus,S 43,1696419,1,0 +Mk1462=Stimulus,S128,1696434,1,0 +Mk1463=Stimulus,S 44,1698374,1,0 +Mk1464=Stimulus,S128,1698388,1,0 +Mk1465=Stimulus,S 42,1700061,1,0 +Mk1466=Stimulus,S128,1700075,1,0 +Mk1467=Stimulus,S 43,1701863,1,0 +Mk1468=Stimulus,S128,1701874,1,0 +Mk1469=Stimulus,S 44,1703663,1,0 +Mk1470=Stimulus,S128,1703676,1,0 +Mk1471=Stimulus,S 41,1705587,1,0 +Mk1472=Stimulus,S128,1705598,1,0 +Mk1473=Stimulus,S 41,1707401,1,0 +Mk1474=Stimulus,S128,1707415,1,0 +Mk1475=Stimulus,S 43,1709137,1,0 +Mk1476=Stimulus,S128,1709150,1,0 +Mk1477=Stimulus,S 44,1710696,1,0 +Mk1478=Stimulus,S128,1710707,1,0 +Mk1479=Stimulus,S 42,1712526,1,0 +Mk1480=Stimulus,S128,1712538,1,0 +Mk1481=Stimulus,S 42,1714401,1,0 +Mk1482=Stimulus,S128,1714414,1,0 +Mk1483=Stimulus,S 42,1743366,1,0 +Mk1484=Stimulus,S128,1743377,1,0 +Mk1485=Stimulus,S 41,1745335,1,0 +Mk1486=Stimulus,S128,1745348,1,0 +Mk1487=Stimulus,S 43,1747070,1,0 +Mk1488=Stimulus,S128,1747083,1,0 +Mk1489=Stimulus,S 42,1748878,1,0 +Mk1490=Stimulus,S128,1748892,1,0 +Mk1491=Stimulus,S 41,1750437,1,0 +Mk1492=Stimulus,S128,1750447,1,0 +Mk1493=Stimulus,S 41,1752467,1,0 +Mk1494=Stimulus,S128,1752480,1,0 +Mk1495=Stimulus,S 42,1754226,1,0 +Mk1496=Stimulus,S128,1754240,1,0 +Mk1497=Stimulus,S 43,1755847,1,0 +Mk1498=Stimulus,S128,1755857,1,0 +Mk1499=Stimulus,S 43,1757458,1,0 +Mk1500=Stimulus,S128,1757468,1,0 +Mk1501=Stimulus,S 42,1759226,1,0 +Mk1502=Stimulus,S128,1759237,1,0 +Mk1503=Stimulus,S 44,1761148,1,0 +Mk1504=Stimulus,S128,1761161,1,0 +Mk1505=Stimulus,S 42,1763104,1,0 +Mk1506=Stimulus,S128,1763119,1,0 +Mk1507=Stimulus,S 42,1765120,1,0 +Mk1508=Stimulus,S128,1765133,1,0 +Mk1509=Stimulus,S 41,1767080,1,0 +Mk1510=Stimulus,S128,1767090,1,0 +Mk1511=Stimulus,S 42,1768963,1,0 +Mk1512=Stimulus,S128,1768977,1,0 +Mk1513=Stimulus,S 42,1770523,1,0 +Mk1514=Stimulus,S128,1770534,1,0 +Mk1515=Stimulus,S 43,1772056,1,0 +Mk1516=Stimulus,S128,1772069,1,0 +Mk1517=Stimulus,S 43,1774083,1,0 +Mk1518=Stimulus,S128,1774096,1,0 +Mk1519=Stimulus,S 44,1775867,1,0 +Mk1520=Stimulus,S128,1775880,1,0 +Mk1521=Stimulus,S 44,1777768,1,0 +Mk1522=Stimulus,S128,1777779,1,0 +Mk1523=Stimulus,S 41,1779664,1,0 +Mk1524=Stimulus,S128,1779677,1,0 +Mk1525=Stimulus,S 43,1781272,1,0 +Mk1526=Stimulus,S128,1781283,1,0 +Mk1527=Stimulus,S 43,1782974,1,0 +Mk1528=Stimulus,S128,1782988,1,0 +Mk1529=Stimulus,S 41,1784576,1,0 +Mk1530=Stimulus,S128,1784590,1,0 +Mk1531=Stimulus,S 44,1786384,1,0 +Mk1532=Stimulus,S128,1786398,1,0 +Mk1533=Stimulus,S 42,1788253,1,0 +Mk1534=Stimulus,S128,1788267,1,0 +Mk1535=Stimulus,S 41,1790116,1,0 +Mk1536=Stimulus,S128,1790126,1,0 +Mk1537=Stimulus,S 41,1791751,1,0 +Mk1538=Stimulus,S128,1791762,1,0 +Mk1539=Stimulus,S 41,1793290,1,0 +Mk1540=Stimulus,S128,1793300,1,0 +Mk1541=Stimulus,S 43,1795210,1,0 +Mk1542=Stimulus,S128,1795223,1,0 +Mk1543=Stimulus,S 43,1797056,1,0 +Mk1544=Stimulus,S128,1797069,1,0 +Mk1545=Stimulus,S 44,1798893,1,0 +Mk1546=Stimulus,S128,1798904,1,0 +Mk1547=Stimulus,S 44,1800468,1,0 +Mk1548=Stimulus,S128,1800481,1,0 +Mk1549=Stimulus,S 44,1802288,1,0 +Mk1550=Stimulus,S128,1802302,1,0 +Mk1551=Stimulus,S 43,1804100,1,0 +Mk1552=Stimulus,S128,1804113,1,0 +Mk1553=Stimulus,S 41,1806072,1,0 +Mk1554=Stimulus,S128,1806081,1,0 +Mk1555=Stimulus,S 42,1807712,1,0 +Mk1556=Stimulus,S128,1807726,1,0 +Mk1557=Stimulus,S 44,1809406,1,0 +Mk1558=Stimulus,S128,1809417,1,0 +Mk1559=Stimulus,S 44,1811012,1,0 +Mk1560=Stimulus,S128,1811025,1,0 +Mk1561=Stimulus,S 44,1812808,1,0 +Mk1562=Stimulus,S128,1812821,1,0 +Mk1563=Stimulus,S 42,1830251,1,0 +Mk1564=Stimulus,S128,1830264,1,0 +Mk1565=Stimulus,S 41,1832271,1,0 +Mk1566=Stimulus,S128,1832285,1,0 +Mk1567=Stimulus,S 41,1834105,1,0 +Mk1568=Stimulus,S128,1834118,1,0 +Mk1569=Stimulus,S 43,1835731,1,0 +Mk1570=Stimulus,S128,1835745,1,0 +Mk1571=Stimulus,S 42,1837521,1,0 +Mk1572=Stimulus,S128,1837532,1,0 +Mk1573=Stimulus,S 44,1839429,1,0 +Mk1574=Stimulus,S128,1839443,1,0 +Mk1575=Stimulus,S 43,1841402,1,0 +Mk1576=Stimulus,S128,1841413,1,0 +Mk1577=Stimulus,S 41,1843135,1,0 +Mk1578=Stimulus,S128,1843149,1,0 +Mk1579=Stimulus,S 44,1844937,1,0 +Mk1580=Stimulus,S128,1844950,1,0 +Mk1581=Stimulus,S 43,1846593,1,0 +Mk1582=Stimulus,S128,1846606,1,0 +Mk1583=Stimulus,S 44,1848474,1,0 +Mk1584=Stimulus,S128,1848488,1,0 +Mk1585=Stimulus,S 44,1850289,1,0 +Mk1586=Stimulus,S128,1850300,1,0 +Mk1587=Stimulus,S 43,1852035,1,0 +Mk1588=Stimulus,S128,1852048,1,0 +Mk1589=Stimulus,S 44,1854012,1,0 +Mk1590=Stimulus,S128,1854027,1,0 +Mk1591=Stimulus,S 44,1855930,1,0 +Mk1592=Stimulus,S128,1855944,1,0 +Mk1593=Stimulus,S 43,1857667,1,0 +Mk1594=Stimulus,S128,1857681,1,0 +Mk1595=Stimulus,S 43,1859621,1,0 +Mk1596=Stimulus,S128,1859635,1,0 +Mk1597=Stimulus,S 44,1861451,1,0 +Mk1598=Stimulus,S128,1861461,1,0 +Mk1599=Stimulus,S 41,1863262,1,0 +Mk1600=Stimulus,S128,1863275,1,0 +Mk1601=Stimulus,S 43,1864827,1,0 +Mk1602=Stimulus,S128,1864841,1,0 +Mk1603=Stimulus,S 42,1866757,1,0 +Mk1604=Stimulus,S128,1866771,1,0 +Mk1605=Stimulus,S 42,1868608,1,0 +Mk1606=Stimulus,S128,1868619,1,0 +Mk1607=Stimulus,S 44,1870583,1,0 +Mk1608=Stimulus,S128,1870594,1,0 +Mk1609=Stimulus,S 41,1872443,1,0 +Mk1610=Stimulus,S128,1872457,1,0 +Mk1611=Stimulus,S 42,1874027,1,0 +Mk1612=Stimulus,S128,1874038,1,0 +Mk1613=Stimulus,S 42,1875695,1,0 +Mk1614=Stimulus,S128,1875709,1,0 +Mk1615=Stimulus,S 41,1877576,1,0 +Mk1616=Stimulus,S128,1877590,1,0 +Mk1617=Stimulus,S 41,1879281,1,0 +Mk1618=Stimulus,S128,1879292,1,0 +Mk1619=Stimulus,S 43,1881208,1,0 +Mk1620=Stimulus,S128,1881218,1,0 +Mk1621=Stimulus,S 44,1883129,1,0 +Mk1622=Stimulus,S128,1883143,1,0 +Mk1623=Stimulus,S 43,1884950,1,0 +Mk1624=Stimulus,S128,1884964,1,0 +Mk1625=Stimulus,S 41,1886752,1,0 +Mk1626=Stimulus,S128,1886763,1,0 +Mk1627=Stimulus,S 41,1888564,1,0 +Mk1628=Stimulus,S128,1888578,1,0 +Mk1629=Stimulus,S 41,1890100,1,0 +Mk1630=Stimulus,S128,1890110,1,0 +Mk1631=Stimulus,S 42,1891960,1,0 +Mk1632=Stimulus,S128,1891974,1,0 +Mk1633=Stimulus,S 42,1893774,1,0 +Mk1634=Stimulus,S128,1893786,1,0 +Mk1635=Stimulus,S 42,1895404,1,0 +Mk1636=Stimulus,S128,1895418,1,0 +Mk1637=Stimulus,S 42,1897267,1,0 +Mk1638=Stimulus,S128,1897279,1,0 +Mk1639=Stimulus,S 43,1899000,1,0 +Mk1640=Stimulus,S128,1899014,1,0 +Mk1641=Stimulus,S 44,1900882,1,0 +Mk1642=Stimulus,S128,1900895,1,0 +Mk1643=Stimulus,S 43,1918297,1,0 +Mk1644=Stimulus,S128,1918311,1,0 +Mk1645=Stimulus,S 42,1919917,1,0 +Mk1646=Stimulus,S128,1919930,1,0 +Mk1647=Stimulus,S 41,1921864,1,0 +Mk1648=Stimulus,S128,1921877,1,0 +Mk1649=Stimulus,S 41,1923623,1,0 +Mk1650=Stimulus,S128,1923636,1,0 +Mk1651=Stimulus,S 43,1925558,1,0 +Mk1652=Stimulus,S128,1925568,1,0 +Mk1653=Stimulus,S 44,1927430,1,0 +Mk1654=Stimulus,S128,1927443,1,0 +Mk1655=Stimulus,S 43,1929019,1,0 +Mk1656=Stimulus,S128,1929033,1,0 +Mk1657=Stimulus,S 42,1930864,1,0 +Mk1658=Stimulus,S128,1930878,1,0 +Mk1659=Stimulus,S 43,1932430,1,0 +Mk1660=Stimulus,S128,1932444,1,0 +Mk1661=Stimulus,S 41,1934150,1,0 +Mk1662=Stimulus,S128,1934160,1,0 +Mk1663=Stimulus,S 43,1935967,1,0 +Mk1664=Stimulus,S128,1935977,1,0 +Mk1665=Stimulus,S 41,1937753,1,0 +Mk1666=Stimulus,S128,1937766,1,0 +Mk1667=Stimulus,S 44,1939397,1,0 +Mk1668=Stimulus,S128,1939408,1,0 +Mk1669=Stimulus,S 44,1940936,1,0 +Mk1670=Stimulus,S128,1940949,1,0 +Mk1671=Stimulus,S 44,1942621,1,0 +Mk1672=Stimulus,S128,1942635,1,0 +Mk1673=Stimulus,S 42,1944448,1,0 +Mk1674=Stimulus,S128,1944458,1,0 +Mk1675=Stimulus,S 43,1946133,1,0 +Mk1676=Stimulus,S128,1946146,1,0 +Mk1677=Stimulus,S 42,1947953,1,0 +Mk1678=Stimulus,S128,1947966,1,0 +Mk1679=Stimulus,S 42,1949858,1,0 +Mk1680=Stimulus,S128,1949871,1,0 +Mk1681=Stimulus,S 42,1951423,1,0 +Mk1682=Stimulus,S128,1951436,1,0 +Mk1683=Stimulus,S 41,1953133,1,0 +Mk1684=Stimulus,S128,1953147,1,0 +Mk1685=Stimulus,S 43,1954971,1,0 +Mk1686=Stimulus,S128,1954982,1,0 +Mk1687=Stimulus,S 44,1956669,1,0 +Mk1688=Stimulus,S128,1956679,1,0 +Mk1689=Stimulus,S 42,1958443,1,0 +Mk1690=Stimulus,S128,1958456,1,0 +Mk1691=Stimulus,S 43,1960113,1,0 +Mk1692=Stimulus,S128,1960123,1,0 +Mk1693=Stimulus,S 44,1962040,1,0 +Mk1694=Stimulus,S128,1962050,1,0 +Mk1695=Stimulus,S 44,1964003,1,0 +Mk1696=Stimulus,S128,1964015,1,0 +Mk1697=Stimulus,S 44,1966004,1,0 +Mk1698=Stimulus,S128,1966017,1,0 +Mk1699=Stimulus,S 41,1967557,1,0 +Mk1700=Stimulus,S128,1967571,1,0 +Mk1701=Stimulus,S 42,1969262,1,0 +Mk1702=Stimulus,S128,1969273,1,0 +Mk1703=Stimulus,S 41,1970909,1,0 +Mk1704=Stimulus,S128,1970920,1,0 +Mk1705=Stimulus,S 43,1972830,1,0 +Mk1706=Stimulus,S128,1972843,1,0 +Mk1707=Stimulus,S 42,1974509,1,0 +Mk1708=Stimulus,S128,1974520,1,0 +Mk1709=Stimulus,S 42,1976484,1,0 +Mk1710=Stimulus,S128,1976497,1,0 +Mk1711=Stimulus,S 43,1978388,1,0 +Mk1712=Stimulus,S128,1978402,1,0 +Mk1713=Stimulus,S 41,1980391,1,0 +Mk1714=Stimulus,S128,1980404,1,0 +Mk1715=Stimulus,S 41,1982338,1,0 +Mk1716=Stimulus,S128,1982349,1,0 +Mk1717=Stimulus,S 41,1984339,1,0 +Mk1718=Stimulus,S128,1984349,1,0 +Mk1719=Stimulus,S 44,1985974,1,0 +Mk1720=Stimulus,S128,1985987,1,0 +Mk1721=Stimulus,S 44,1987764,1,0 +Mk1722=Stimulus,S128,1987775,1,0 +Mk1723=Stimulus,S127,2023026,1,0 +Mk1724=Stimulus,S255,2023367,1,0 +Mk1725=Stimulus,S127,2023378,1,0 diff --git a/code/eeg_timing_test/thrive_sys2_timingTest_resp.vmrk b/code/eeg_timing_test/thrive_sys2_timingTest_resp.vmrk new file mode 100755 index 0000000..4a3d5ba --- /dev/null +++ b/code/eeg_timing_test/thrive_sys2_timingTest_resp.vmrk @@ -0,0 +1,3268 @@ +BrainVision Data Exchange Marker File Version 1.0 + +[Common Infos] +Codepage=UTF-8 +DataFile=thrive_sys2_timingTest_resp.eeg + +[Marker Infos] +; Each entry: Mk=,,, +; , +; Fields are delimited by commas, some fields might be omitted (empty). +; Commas in type or description text are coded as "\1". +Mk1=New Segment,,1,1,0,20230602170936086210 +Mk2=Stimulus,S 52,19687,1,0 +Mk3=Stimulus,S 11,20145,1,0 +Mk4=Stimulus,S 51,21589,1,0 +Mk5=Stimulus,S128,22062,1,0 +Mk6=Stimulus,S139,22063,1,0 +Mk7=Stimulus,S128,22066,1,0 +Mk8=Stimulus,S 53,23616,1,0 +Mk9=Stimulus,S139,24189,1,0 +Mk10=Stimulus,S128,24191,1,0 +Mk11=Stimulus,S128,24211,1,0 +Mk12=Stimulus,S 54,25158,1,0 +Mk13=Stimulus,S 11,25744,1,0 +Mk14=Stimulus,S128,25746,1,0 +Mk15=Stimulus,S 52,27059,1,0 +Mk16=Stimulus,S 11,27678,1,0 +Mk17=Stimulus,S139,27679,1,0 +Mk18=Stimulus,S128,27681,1,0 +Mk19=Stimulus,S 51,28598,1,0 +Mk20=Stimulus,S 11,29165,1,0 +Mk21=Stimulus,S128,29169,1,0 +Mk22=Stimulus,S 52,30231,1,0 +Mk23=Stimulus,S128,30646,1,0 +Mk24=Stimulus,S139,30649,1,0 +Mk25=Stimulus,S128,30652,1,0 +Mk26=Stimulus,S 53,31812,1,0 +Mk27=Stimulus,S 11,32160,1,0 +Mk28=Stimulus,S139,32162,1,0 +Mk29=Stimulus,S128,32163,1,0 +Mk30=Stimulus,S 53,33536,1,0 +Mk31=Stimulus,S128,33979,1,0 +Mk32=Stimulus,S139,33981,1,0 +Mk33=Stimulus,S128,33984,1,0 +Mk34=Stimulus,S128,34175,1,0 +Mk35=Stimulus,S 54,35526,1,0 +Mk36=Stimulus,S128,35927,1,0 +Mk37=Stimulus,S139,35929,1,0 +Mk38=Stimulus,S128,35931,1,0 +Mk39=Stimulus,S128,35952,1,0 +Mk40=Stimulus,S 54,37463,1,0 +Mk41=Stimulus,S128,37823,1,0 +Mk42=Stimulus,S139,37826,1,0 +Mk43=Stimulus,S128,37829,1,0 +Mk44=Stimulus,S 51,39359,1,0 +Mk45=Stimulus,S 11,39854,1,0 +Mk46=Stimulus,S128,39856,1,0 +Mk47=Stimulus,S 54,40931,1,0 +Mk48=Stimulus,S128,41288,1,0 +Mk49=Stimulus,S139,41289,1,0 +Mk50=Stimulus,S128,41292,1,0 +Mk51=Stimulus,S 54,42937,1,0 +Mk52=Stimulus,S128,43362,1,0 +Mk53=Stimulus,S139,43364,1,0 +Mk54=Stimulus,S128,43367,1,0 +Mk55=Stimulus,S 53,44557,1,0 +Mk56=Stimulus,S128,44921,1,0 +Mk57=Stimulus,S139,44922,1,0 +Mk58=Stimulus,S128,44925,1,0 +Mk59=Stimulus,S 53,46226,1,0 +Mk60=Stimulus,S 12,46532,1,0 +Mk61=Stimulus,S140,46533,1,0 +Mk62=Stimulus,S128,46534,1,0 +Mk63=Stimulus,S 51,48035,1,0 +Mk64=Stimulus,S 11,48395,1,0 +Mk65=Stimulus,S139,48396,1,0 +Mk66=Stimulus,S128,48398,1,0 +Mk67=Stimulus,S 51,49984,1,0 +Mk68=Stimulus,S128,50369,1,0 +Mk69=Stimulus,S139,50371,1,0 +Mk70=Stimulus,S128,50374,1,0 +Mk71=Stimulus,S 54,51905,1,0 +Mk72=Stimulus,S128,52459,1,0 +Mk73=Stimulus,S139,52460,1,0 +Mk74=Stimulus,S128,52463,1,0 +Mk75=Stimulus,S128,52481,1,0 +Mk76=Stimulus,S 53,53871,1,0 +Mk77=Stimulus,S139,54384,1,0 +Mk78=Stimulus,S128,54387,1,0 +Mk79=Stimulus,S 52,55826,1,0 +Mk80=Stimulus,S 11,56333,1,0 +Mk81=Stimulus,S139,56334,1,0 +Mk82=Stimulus,S128,56335,1,0 +Mk83=Stimulus,S 54,57708,1,0 +Mk84=Stimulus,S128,58242,1,0 +Mk85=Stimulus,S139,58245,1,0 +Mk86=Stimulus,S128,58248,1,0 +Mk87=Stimulus,S 54,59531,1,0 +Mk88=Stimulus,S139,59928,1,0 +Mk89=Stimulus,S128,59930,1,0 +Mk90=Stimulus,S 51,61304,1,0 +Mk91=Stimulus,S128,61851,1,0 +Mk92=Stimulus,S139,61853,1,0 +Mk93=Stimulus,S128,61856,1,0 +Mk94=Stimulus,S 52,63103,1,0 +Mk95=Stimulus,S128,63704,1,0 +Mk96=Stimulus,S139,63706,1,0 +Mk97=Stimulus,S128,63709,1,0 +Mk98=Stimulus,S 52,65094,1,0 +Mk99=Stimulus,S 11,65636,1,0 +Mk100=Stimulus,S139,65638,1,0 +Mk101=Stimulus,S128,65639,1,0 +Mk102=Stimulus,S 51,66902,1,0 +Mk103=Stimulus,S128,67384,1,0 +Mk104=Stimulus,S139,67385,1,0 +Mk105=Stimulus,S128,67387,1,0 +Mk106=Stimulus,S 53,68711,1,0 +Mk107=Stimulus,S 11,69078,1,0 +Mk108=Stimulus,S139,69080,1,0 +Mk109=Stimulus,S128,69081,1,0 +Mk110=Stimulus,S 52,70703,1,0 +Mk111=Stimulus,S128,71129,1,0 +Mk112=Stimulus,S139,71130,1,0 +Mk113=Stimulus,S128,71133,1,0 +Mk114=Stimulus,S 54,72580,1,0 +Mk115=Stimulus,S 11,73113,1,0 +Mk116=Stimulus,S128,73117,1,0 +Mk117=Stimulus,S 51,74313,1,0 +Mk118=Stimulus,S128,74778,1,0 +Mk119=Stimulus,S139,74780,1,0 +Mk120=Stimulus,S128,74783,1,0 +Mk121=Stimulus,S 54,76066,1,0 +Mk122=Stimulus,S139,76463,1,0 +Mk123=Stimulus,S128,76465,1,0 +Mk124=Stimulus,S 51,77668,1,0 +Mk125=Stimulus,S 11,78126,1,0 +Mk126=Stimulus,S139,78127,1,0 +Mk127=Stimulus,S128,78129,1,0 +Mk128=Stimulus,S 53,79271,1,0 +Mk129=Stimulus,S 11,79777,1,0 +Mk130=Stimulus,S128,79780,1,0 +Mk131=Stimulus,S 52,81195,1,0 +Mk132=Stimulus,S 11,81571,1,0 +Mk133=Stimulus,S128,81574,1,0 +Mk134=Stimulus,S 53,82940,1,0 +Mk135=Stimulus,S 11,83310,1,0 +Mk136=Stimulus,S128,83312,1,0 +Mk137=Stimulus,S 52,84614,1,0 +Mk138=Stimulus,S128,85012,1,0 +Mk139=Stimulus,S139,85014,1,0 +Mk140=Stimulus,S128,85016,1,0 +Mk141=Stimulus,S 52,86450,1,0 +Mk142=Stimulus,S139,86962,1,0 +Mk143=Stimulus,S128,86965,1,0 +Mk144=Stimulus,S 53,88200,1,0 +Mk145=Stimulus,S 11,88737,1,0 +Mk146=Stimulus,S128,88740,1,0 +Mk147=Stimulus,S 51,89846,1,0 +Mk148=Stimulus,S128,90420,1,0 +Mk149=Stimulus,S140,90422,1,0 +Mk150=Stimulus,S128,90425,1,0 +Mk151=Stimulus,S128,100060,1,0 +Mk152=Stimulus,S 52,180394,1,0 +Mk153=Stimulus,S 11,181149,1,0 +Mk154=Stimulus,S128,181151,1,0 +Mk155=Stimulus,S 53,182373,1,0 +Mk156=Stimulus,S139,182809,1,0 +Mk157=Stimulus,S128,182812,1,0 +Mk158=Stimulus,S 54,184202,1,0 +Mk159=Stimulus,S128,184619,1,0 +Mk160=Stimulus,S139,184620,1,0 +Mk161=Stimulus,S128,184623,1,0 +Mk162=Stimulus,S 51,186080,1,0 +Mk163=Stimulus,S128,186521,1,0 +Mk164=Stimulus,S139,186523,1,0 +Mk165=Stimulus,S128,186525,1,0 +Mk166=Stimulus,S 53,187849,1,0 +Mk167=Stimulus,S128,188543,1,0 +Mk168=Stimulus,S139,188544,1,0 +Mk169=Stimulus,S128,188547,1,0 +Mk170=Stimulus,S 54,189612,1,0 +Mk171=Stimulus,S139,190190,1,0 +Mk172=Stimulus,S128,190193,1,0 +Mk173=Stimulus,S 51,191614,1,0 +Mk174=Stimulus,S 11,192017,1,0 +Mk175=Stimulus,S139,192018,1,0 +Mk176=Stimulus,S128,192020,1,0 +Mk177=Stimulus,S 52,193594,1,0 +Mk178=Stimulus,S 11,194162,1,0 +Mk179=Stimulus,S139,194163,1,0 +Mk180=Stimulus,S128,194165,1,0 +Mk181=Stimulus,S 52,195362,1,0 +Mk182=Stimulus,S 11,195829,1,0 +Mk183=Stimulus,S139,195830,1,0 +Mk184=Stimulus,S128,195832,1,0 +Mk185=Stimulus,S 52,197206,1,0 +Mk186=Stimulus,S128,197660,1,0 +Mk187=Stimulus,S139,197661,1,0 +Mk188=Stimulus,S128,197664,1,0 +Mk189=Stimulus,S 54,199123,1,0 +Mk190=Stimulus,S 11,199440,1,0 +Mk191=Stimulus,S139,199442,1,0 +Mk192=Stimulus,S128,199443,1,0 +Mk193=Stimulus,S 54,201064,1,0 +Mk194=Stimulus,S128,201393,1,0 +Mk195=Stimulus,S139,201394,1,0 +Mk196=Stimulus,S128,201398,1,0 +Mk197=Stimulus,S 53,202874,1,0 +Mk198=Stimulus,S 11,203313,1,0 +Mk199=Stimulus,S128,203315,1,0 +Mk200=Stimulus,S 52,204895,1,0 +Mk201=Stimulus,S128,205197,1,0 +Mk202=Stimulus,S140,205199,1,0 +Mk203=Stimulus,S128,205201,1,0 +Mk204=Stimulus,S128,205369,1,0 +Mk205=Stimulus,S 53,206720,1,0 +Mk206=Stimulus,S 11,207330,1,0 +Mk207=Stimulus,S128,207332,1,0 +Mk208=Stimulus,S 51,208354,1,0 +Mk209=Stimulus,S 11,208814,1,0 +Mk210=Stimulus,S139,208815,1,0 +Mk211=Stimulus,S128,208817,1,0 +Mk212=Stimulus,S 51,209923,1,0 +Mk213=Stimulus,S 11,210380,1,0 +Mk214=Stimulus,S139,210381,1,0 +Mk215=Stimulus,S128,210383,1,0 +Mk216=Stimulus,S 51,211895,1,0 +Mk217=Stimulus,S 11,212276,1,0 +Mk218=Stimulus,S139,212278,1,0 +Mk219=Stimulus,S128,212279,1,0 +Mk220=Stimulus,S 54,213785,1,0 +Mk221=Stimulus,S128,214211,1,0 +Mk222=Stimulus,S139,214213,1,0 +Mk223=Stimulus,S128,214216,1,0 +Mk224=Stimulus,S 52,215456,1,0 +Mk225=Stimulus,S128,215962,1,0 +Mk226=Stimulus,S139,215963,1,0 +Mk227=Stimulus,S128,215965,1,0 +Mk228=Stimulus,S 51,217362,1,0 +Mk229=Stimulus,S 11,217984,1,0 +Mk230=Stimulus,S128,217987,1,0 +Mk231=Stimulus,S 51,219293,1,0 +Mk232=Stimulus,S139,219763,1,0 +Mk233=Stimulus,S128,219767,1,0 +Mk234=Stimulus,S 52,221116,1,0 +Mk235=Stimulus,S 11,221623,1,0 +Mk236=Stimulus,S128,221628,1,0 +Mk237=Stimulus,S 54,222870,1,0 +Mk238=Stimulus,S128,223318,1,0 +Mk239=Stimulus,S139,223319,1,0 +Mk240=Stimulus,S128,223322,1,0 +Mk241=Stimulus,S 53,224749,1,0 +Mk242=Stimulus,S139,225199,1,0 +Mk243=Stimulus,S128,225201,1,0 +Mk244=Stimulus,S 52,226751,1,0 +Mk245=Stimulus,S128,227474,1,0 +Mk246=Stimulus,S139,227476,1,0 +Mk247=Stimulus,S128,227479,1,0 +Mk248=Stimulus,S 53,228469,1,0 +Mk249=Stimulus,S 11,228925,1,0 +Mk250=Stimulus,S139,228926,1,0 +Mk251=Stimulus,S128,228928,1,0 +Mk252=Stimulus,S 54,230004,1,0 +Mk253=Stimulus,S128,230520,1,0 +Mk254=Stimulus,S139,230521,1,0 +Mk255=Stimulus,S128,230524,1,0 +Mk256=Stimulus,S 53,231897,1,0 +Mk257=Stimulus,S 11,232288,1,0 +Mk258=Stimulus,S139,232290,1,0 +Mk259=Stimulus,S128,232291,1,0 +Mk260=Stimulus,S 53,233683,1,0 +Mk261=Stimulus,S139,234049,1,0 +Mk262=Stimulus,S128,234052,1,0 +Mk263=Stimulus,S 54,235340,1,0 +Mk264=Stimulus,S 11,236026,1,0 +Mk265=Stimulus,S139,236027,1,0 +Mk266=Stimulus,S128,236029,1,0 +Mk267=Stimulus,S 54,237051,1,0 +Mk268=Stimulus,S 11,237679,1,0 +Mk269=Stimulus,S139,237680,1,0 +Mk270=Stimulus,S128,237682,1,0 +Mk271=Stimulus,S 51,238593,1,0 +Mk272=Stimulus,S139,239293,1,0 +Mk273=Stimulus,S128,239296,1,0 +Mk274=Stimulus,S 52,240135,1,0 +Mk275=Stimulus,S128,240991,1,0 +Mk276=Stimulus,S139,240993,1,0 +Mk277=Stimulus,S128,240996,1,0 +Mk278=Stimulus,S 51,241828,1,0 +Mk279=Stimulus,S 11,242428,1,0 +Mk280=Stimulus,S128,242431,1,0 +Mk281=Stimulus,S 53,243707,1,0 +Mk282=Stimulus,S128,244118,1,0 +Mk283=Stimulus,S139,244119,1,0 +Mk284=Stimulus,S128,244122,1,0 +Mk285=Stimulus,S 53,245691,1,0 +Mk286=Stimulus,S128,246025,1,0 +Mk287=Stimulus,S139,246027,1,0 +Mk288=Stimulus,S128,246030,1,0 +Mk289=Stimulus,S 52,247505,1,0 +Mk290=Stimulus,S 11,248252,1,0 +Mk291=Stimulus,S139,248254,1,0 +Mk292=Stimulus,S128,248255,1,0 +Mk293=Stimulus,S 54,249281,1,0 +Mk294=Stimulus,S 11,250036,1,0 +Mk295=Stimulus,S128,250038,1,0 +Mk296=Stimulus,S 51,251198,1,0 +Mk297=Stimulus,S128,251668,1,0 +Mk298=Stimulus,S139,251669,1,0 +Mk299=Stimulus,S128,251671,1,0 +Mk300=Stimulus,S 51,278142,1,0 +Mk301=Stimulus,S128,278529,1,0 +Mk302=Stimulus,S139,278531,1,0 +Mk303=Stimulus,S128,278534,1,0 +Mk304=Stimulus,S 53,280070,1,0 +Mk305=Stimulus,S128,280567,1,0 +Mk306=Stimulus,S139,280570,1,0 +Mk307=Stimulus,S128,280574,1,0 +Mk308=Stimulus,S 52,281844,1,0 +Mk309=Stimulus,S139,282454,1,0 +Mk310=Stimulus,S128,282456,1,0 +Mk311=Stimulus,S 51,283508,1,0 +Mk312=Stimulus,S 11,284001,1,0 +Mk313=Stimulus,S128,284005,1,0 +Mk314=Stimulus,S 52,285457,1,0 +Mk315=Stimulus,S128,285794,1,0 +Mk316=Stimulus,S139,285797,1,0 +Mk317=Stimulus,S128,285800,1,0 +Mk318=Stimulus,S 54,287033,1,0 +Mk319=Stimulus,S139,288027,1,0 +Mk320=Stimulus,S128,288030,1,0 +Mk321=Stimulus,S 52,288868,1,0 +Mk322=Stimulus,S128,289299,1,0 +Mk323=Stimulus,S139,289301,1,0 +Mk324=Stimulus,S128,289304,1,0 +Mk325=Stimulus,S 52,290853,1,0 +Mk326=Stimulus,S 11,291234,1,0 +Mk327=Stimulus,S139,291236,1,0 +Mk328=Stimulus,S128,291237,1,0 +Mk329=Stimulus,S 54,292531,1,0 +Mk330=Stimulus,S128,292859,1,0 +Mk331=Stimulus,S139,292861,1,0 +Mk332=Stimulus,S128,292864,1,0 +Mk333=Stimulus,S 52,294280,1,0 +Mk334=Stimulus,S128,294614,1,0 +Mk335=Stimulus,S139,294615,1,0 +Mk336=Stimulus,S128,294618,1,0 +Mk337=Stimulus,S 51,295893,1,0 +Mk338=Stimulus,S 11,296423,1,0 +Mk339=Stimulus,S139,296425,1,0 +Mk340=Stimulus,S128,296426,1,0 +Mk341=Stimulus,S 54,297459,1,0 +Mk342=Stimulus,S 11,298062,1,0 +Mk343=Stimulus,S139,298063,1,0 +Mk344=Stimulus,S128,298064,1,0 +Mk345=Stimulus,S 53,299255,1,0 +Mk346=Stimulus,S128,299669,1,0 +Mk347=Stimulus,S139,299670,1,0 +Mk348=Stimulus,S128,299672,1,0 +Mk349=Stimulus,S 53,300912,1,0 +Mk350=Stimulus,S 11,301360,1,0 +Mk351=Stimulus,S139,301361,1,0 +Mk352=Stimulus,S128,301363,1,0 +Mk353=Stimulus,S 51,302518,1,0 +Mk354=Stimulus,S 11,302890,1,0 +Mk355=Stimulus,S139,302891,1,0 +Mk356=Stimulus,S128,302893,1,0 +Mk357=Stimulus,S 54,304471,1,0 +Mk358=Stimulus,S128,304752,1,0 +Mk359=Stimulus,S140,304753,1,0 +Mk360=Stimulus,S128,304756,1,0 +Mk361=Stimulus,S 54,306385,1,0 +Mk362=Stimulus,S128,306808,1,0 +Mk363=Stimulus,S139,306809,1,0 +Mk364=Stimulus,S128,306812,1,0 +Mk365=Stimulus,S 54,308288,1,0 +Mk366=Stimulus,S 11,308615,1,0 +Mk367=Stimulus,S128,308618,1,0 +Mk368=Stimulus,S 51,310030,1,0 +Mk369=Stimulus,S 12,310414,1,0 +Mk370=Stimulus,S128,310416,1,0 +Mk371=Stimulus,S 54,311685,1,0 +Mk372=Stimulus,S128,312387,1,0 +Mk373=Stimulus,S139,312388,1,0 +Mk374=Stimulus,S128,312391,1,0 +Mk375=Stimulus,S 53,313496,1,0 +Mk376=Stimulus,S139,314002,1,0 +Mk377=Stimulus,S128,314005,1,0 +Mk378=Stimulus,S 53,315153,1,0 +Mk379=Stimulus,S128,315555,1,0 +Mk380=Stimulus,S128,315583,1,0 +Mk381=Stimulus,S128,315612,1,0 +Mk382=Stimulus,S139,315613,1,0 +Mk383=Stimulus,S128,315616,1,0 +Mk384=Stimulus,S128,315641,1,0 +Mk385=Stimulus,S128,315654,1,0 +Mk386=Stimulus,S 52,316818,1,0 +Mk387=Stimulus,S139,317518,1,0 +Mk388=Stimulus,S128,317521,1,0 +Mk389=Stimulus,S 51,318469,1,0 +Mk390=Stimulus,S128,319051,1,0 +Mk391=Stimulus,S139,319053,1,0 +Mk392=Stimulus,S128,319056,1,0 +Mk393=Stimulus,S128,319251,1,0 +Mk394=Stimulus,S128,319265,1,0 +Mk395=Stimulus,S128,319279,1,0 +Mk396=Stimulus,S128,319293,1,0 +Mk397=Stimulus,S128,319308,1,0 +Mk398=Stimulus,S128,319322,1,0 +Mk399=Stimulus,S128,319338,1,0 +Mk400=Stimulus,S128,319352,1,0 +Mk401=Stimulus,S128,319368,1,0 +Mk402=Stimulus,S 54,320163,1,0 +Mk403=Stimulus,S 11,320557,1,0 +Mk404=Stimulus,S139,320558,1,0 +Mk405=Stimulus,S128,320559,1,0 +Mk406=Stimulus,S 51,321897,1,0 +Mk407=Stimulus,S 11,322272,1,0 +Mk408=Stimulus,S139,322274,1,0 +Mk409=Stimulus,S128,322276,1,0 +Mk410=Stimulus,S 51,323486,1,0 +Mk411=Stimulus,S 11,323998,1,0 +Mk412=Stimulus,S139,324000,1,0 +Mk413=Stimulus,S128,324001,1,0 +Mk414=Stimulus,S 53,325296,1,0 +Mk415=Stimulus,S139,325729,1,0 +Mk416=Stimulus,S128,325732,1,0 +Mk417=Stimulus,S 54,327068,1,0 +Mk418=Stimulus,S128,327658,1,0 +Mk419=Stimulus,S139,327659,1,0 +Mk420=Stimulus,S128,327662,1,0 +Mk421=Stimulus,S 51,328822,1,0 +Mk422=Stimulus,S128,329361,1,0 +Mk423=Stimulus,S139,329362,1,0 +Mk424=Stimulus,S128,329364,1,0 +Mk425=Stimulus,S 51,330671,1,0 +Mk426=Stimulus,S 11,331201,1,0 +Mk427=Stimulus,S139,331202,1,0 +Mk428=Stimulus,S128,331204,1,0 +Mk429=Stimulus,S 52,332479,1,0 +Mk430=Stimulus,S128,333179,1,0 +Mk431=Stimulus,S139,333180,1,0 +Mk432=Stimulus,S128,333183,1,0 +Mk433=Stimulus,S 53,334057,1,0 +Mk434=Stimulus,S128,334647,1,0 +Mk435=Stimulus,S139,334648,1,0 +Mk436=Stimulus,S128,334651,1,0 +Mk437=Stimulus,S 54,336017,1,0 +Mk438=Stimulus,S128,336451,1,0 +Mk439=Stimulus,S139,336454,1,0 +Mk440=Stimulus,S128,336457,1,0 +Mk441=Stimulus,S 53,337707,1,0 +Mk442=Stimulus,S139,338317,1,0 +Mk443=Stimulus,S128,338320,1,0 +Mk444=Stimulus,S 52,339281,1,0 +Mk445=Stimulus,S128,339740,1,0 +Mk446=Stimulus,S139,339742,1,0 +Mk447=Stimulus,S128,339745,1,0 +Mk448=Stimulus,S 53,341299,1,0 +Mk449=Stimulus,S 11,341768,1,0 +Mk450=Stimulus,S139,341770,1,0 +Mk451=Stimulus,S128,341771,1,0 +Mk452=Stimulus,S 52,343023,1,0 +Mk453=Stimulus,S 11,343426,1,0 +Mk454=Stimulus,S139,343427,1,0 +Mk455=Stimulus,S128,343429,1,0 +Mk456=Stimulus,S 52,344827,1,0 +Mk457=Stimulus,S139,345391,1,0 +Mk458=Stimulus,S128,345394,1,0 +Mk459=Stimulus,S 53,346760,1,0 +Mk460=Stimulus,S128,347201,1,0 +Mk461=Stimulus,S139,347203,1,0 +Mk462=Stimulus,S128,347205,1,0 +Mk463=Stimulus,S 54,391844,1,0 +Mk464=Stimulus,S139,392404,1,0 +Mk465=Stimulus,S128,392406,1,0 +Mk466=Stimulus,S 51,393561,1,0 +Mk467=Stimulus,S128,394027,1,0 +Mk468=Stimulus,S139,394028,1,0 +Mk469=Stimulus,S128,394031,1,0 +Mk470=Stimulus,S 52,395355,1,0 +Mk471=Stimulus,S128,395992,1,0 +Mk472=Stimulus,S139,395995,1,0 +Mk473=Stimulus,S128,395997,1,0 +Mk474=Stimulus,S 53,396994,1,0 +Mk475=Stimulus,S139,397773,1,0 +Mk476=Stimulus,S128,397776,1,0 +Mk477=Stimulus,S 54,398677,1,0 +Mk478=Stimulus,S128,399141,1,0 +Mk479=Stimulus,S139,399143,1,0 +Mk480=Stimulus,S128,399146,1,0 +Mk481=Stimulus,S 54,400344,1,0 +Mk482=Stimulus,S128,400940,1,0 +Mk483=Stimulus,S139,400942,1,0 +Mk484=Stimulus,S128,400944,1,0 +Mk485=Stimulus,S 53,402023,1,0 +Mk486=Stimulus,S 12,402517,1,0 +Mk487=Stimulus,S128,402520,1,0 +Mk488=Stimulus,S 52,403752,1,0 +Mk489=Stimulus,S140,404215,1,0 +Mk490=Stimulus,S128,404217,1,0 +Mk491=Stimulus,S 54,405760,1,0 +Mk492=Stimulus,S139,406084,1,0 +Mk493=Stimulus,S128,406087,1,0 +Mk494=Stimulus,S 52,407727,1,0 +Mk495=Stimulus,S128,408090,1,0 +Mk496=Stimulus,S140,408093,1,0 +Mk497=Stimulus,S128,408096,1,0 +Mk498=Stimulus,S 54,409646,1,0 +Mk499=Stimulus,S 11,409989,1,0 +Mk500=Stimulus,S139,409991,1,0 +Mk501=Stimulus,S128,409992,1,0 +Mk502=Stimulus,S 52,411651,1,0 +Mk503=Stimulus,S 12,411999,1,0 +Mk504=Stimulus,S140,412000,1,0 +Mk505=Stimulus,S128,412001,1,0 +Mk506=Stimulus,S 53,413259,1,0 +Mk507=Stimulus,S140,413641,1,0 +Mk508=Stimulus,S128,413644,1,0 +Mk509=Stimulus,S 52,414848,1,0 +Mk510=Stimulus,S 12,415427,1,0 +Mk511=Stimulus,S140,415429,1,0 +Mk512=Stimulus,S128,415430,1,0 +Mk513=Stimulus,S 53,416785,1,0 +Mk514=Stimulus,S 11,417395,1,0 +Mk515=Stimulus,S139,417396,1,0 +Mk516=Stimulus,S128,417398,1,0 +Mk517=Stimulus,S 52,418529,1,0 +Mk518=Stimulus,S 11,419163,1,0 +Mk519=Stimulus,S128,419165,1,0 +Mk520=Stimulus,S 53,420210,1,0 +Mk521=Stimulus,S 11,420952,1,0 +Mk522=Stimulus,S128,420954,1,0 +Mk523=Stimulus,S 54,422061,1,0 +Mk524=Stimulus,S128,422662,1,0 +Mk525=Stimulus,S139,422663,1,0 +Mk526=Stimulus,S128,422666,1,0 +Mk527=Stimulus,S 51,423869,1,0 +Mk528=Stimulus,S128,424470,1,0 +Mk529=Stimulus,S139,424472,1,0 +Mk530=Stimulus,S128,424475,1,0 +Mk531=Stimulus,S 53,425490,1,0 +Mk532=Stimulus,S139,426059,1,0 +Mk533=Stimulus,S128,426062,1,0 +Mk534=Stimulus,S 51,427102,1,0 +Mk535=Stimulus,S 11,427839,1,0 +Mk536=Stimulus,S128,427841,1,0 +Mk537=Stimulus,S 52,429105,1,0 +Mk538=Stimulus,S128,429768,1,0 +Mk539=Stimulus,S139,429769,1,0 +Mk540=Stimulus,S128,429772,1,0 +Mk541=Stimulus,S 51,430847,1,0 +Mk542=Stimulus,S 11,431435,1,0 +Mk543=Stimulus,S128,431437,1,0 +Mk544=Stimulus,S 52,432690,1,0 +Mk545=Stimulus,S139,433311,1,0 +Mk546=Stimulus,S128,433314,1,0 +Mk547=Stimulus,S 53,434595,1,0 +Mk548=Stimulus,S139,435083,1,0 +Mk549=Stimulus,S128,435086,1,0 +Mk550=Stimulus,S 51,436271,1,0 +Mk551=Stimulus,S128,436751,1,0 +Mk552=Stimulus,S139,436752,1,0 +Mk553=Stimulus,S128,436754,1,0 +Mk554=Stimulus,S 52,438194,1,0 +Mk555=Stimulus,S128,438787,1,0 +Mk556=Stimulus,S139,438788,1,0 +Mk557=Stimulus,S128,438791,1,0 +Mk558=Stimulus,S 51,440151,1,0 +Mk559=Stimulus,S139,440585,1,0 +Mk560=Stimulus,S128,440588,1,0 +Mk561=Stimulus,S 51,442178,1,0 +Mk562=Stimulus,S 11,442533,1,0 +Mk563=Stimulus,S139,442535,1,0 +Mk564=Stimulus,S128,442536,1,0 +Mk565=Stimulus,S 51,444074,1,0 +Mk566=Stimulus,S 11,444549,1,0 +Mk567=Stimulus,S128,444552,1,0 +Mk568=Stimulus,S 54,445872,1,0 +Mk569=Stimulus,S128,446532,1,0 +Mk570=Stimulus,S139,446535,1,0 +Mk571=Stimulus,S128,446538,1,0 +Mk572=Stimulus,S 54,447661,1,0 +Mk573=Stimulus,S128,448254,1,0 +Mk574=Stimulus,S139,448256,1,0 +Mk575=Stimulus,S128,448258,1,0 +Mk576=Stimulus,S 52,449643,1,0 +Mk577=Stimulus,S 11,450082,1,0 +Mk578=Stimulus,S128,450085,1,0 +Mk579=Stimulus,S 54,451617,1,0 +Mk580=Stimulus,S 11,452023,1,0 +Mk581=Stimulus,S128,452027,1,0 +Mk582=Stimulus,S128,452042,1,0 +Mk583=Stimulus,S 51,453550,1,0 +Mk584=Stimulus,S 11,454196,1,0 +Mk585=Stimulus,S139,454197,1,0 +Mk586=Stimulus,S128,454199,1,0 +Mk587=Stimulus,S 53,455111,1,0 +Mk588=Stimulus,S128,456032,1,0 +Mk589=Stimulus,S139,456034,1,0 +Mk590=Stimulus,S128,456036,1,0 +Mk591=Stimulus,S 53,457087,1,0 +Mk592=Stimulus,S128,457898,1,0 +Mk593=Stimulus,S139,457900,1,0 +Mk594=Stimulus,S128,457903,1,0 +Mk595=Stimulus,S 54,458730,1,0 +Mk596=Stimulus,S128,459728,1,0 +Mk597=Stimulus,S139,459729,1,0 +Mk598=Stimulus,S128,459731,1,0 +Mk599=Stimulus,S 51,460315,1,0 +Mk600=Stimulus,S 11,460977,1,0 +Mk601=Stimulus,S139,460978,1,0 +Mk602=Stimulus,S128,460979,1,0 +Mk603=Stimulus,S 53,462309,1,0 +Mk604=Stimulus,S 11,462791,1,0 +Mk605=Stimulus,S139,462792,1,0 +Mk606=Stimulus,S128,462793,1,0 +Mk607=Stimulus,S128,467976,1,0 +Mk608=Stimulus,S128,467989,1,0 +Mk609=Stimulus,S128,468282,1,0 +Mk610=Stimulus,S128,468339,1,0 +Mk611=Stimulus,S128,468440,1,0 +Mk612=Stimulus,S128,468553,1,0 +Mk613=Stimulus,S128,468913,1,0 +Mk614=Stimulus,S128,468926,1,0 +Mk615=Stimulus,S128,468940,1,0 +Mk616=Stimulus,S128,670448,1,0 +Mk617=Stimulus,S128,670529,1,0 +Mk618=Stimulus,S128,670936,1,0 +Mk619=Stimulus,S128,671527,1,0 +Mk620=Stimulus,S128,671585,1,0 +Mk621=Stimulus,S128,671687,1,0 +Mk622=Stimulus,S128,671704,1,0 +Mk623=Stimulus,S128,671898,1,0 +Mk624=Stimulus,S128,671984,1,0 +Mk625=Stimulus,S128,672014,1,0 +Mk626=Stimulus,S128,672109,1,0 +Mk627=Stimulus,S128,672270,1,0 +Mk628=Stimulus,S128,672325,1,0 +Mk629=Stimulus,S128,672361,1,0 +Mk630=Stimulus,S128,672555,1,0 +Mk631=Stimulus,S128,672611,1,0 +Mk632=Stimulus,S128,672739,1,0 +Mk633=Stimulus,S128,672901,1,0 +Mk634=Stimulus,S128,673007,1,0 +Mk635=Stimulus,S128,673055,1,0 +Mk636=Stimulus,S128,673099,1,0 +Mk637=Stimulus,S128,673240,1,0 +Mk638=Stimulus,S128,673266,1,0 +Mk639=Stimulus,S128,673302,1,0 +Mk640=Stimulus,S128,673457,1,0 +Mk641=Stimulus,S128,673479,1,0 +Mk642=Stimulus,S128,673493,1,0 +Mk643=Stimulus,S128,673578,1,0 +Mk644=Stimulus,S128,673625,1,0 +Mk645=Stimulus,S128,673852,1,0 +Mk646=Stimulus,S128,674324,1,0 +Mk647=Stimulus,S128,674433,1,0 +Mk648=Stimulus,S128,674492,1,0 +Mk649=Stimulus,S128,674543,1,0 +Mk650=Stimulus,S128,675039,1,0 +Mk651=Stimulus,S128,675413,1,0 +Mk652=Stimulus,S128,675476,1,0 +Mk653=Stimulus,S128,675589,1,0 +Mk654=Stimulus,S128,675632,1,0 +Mk655=Stimulus,S128,675719,1,0 +Mk656=Stimulus,S128,675747,1,0 +Mk657=Stimulus,S128,675805,1,0 +Mk658=Stimulus,S128,675863,1,0 +Mk659=Stimulus,S128,675915,1,0 +Mk660=Stimulus,S128,676064,1,0 +Mk661=Stimulus,S128,676091,1,0 +Mk662=Stimulus,S128,676356,1,0 +Mk663=Stimulus,S128,676435,1,0 +Mk664=Stimulus,S128,676515,1,0 +Mk665=Stimulus,S128,676540,1,0 +Mk666=Stimulus,S128,676639,1,0 +Mk667=Stimulus,S128,676664,1,0 +Mk668=Stimulus,S128,740077,1,0 +Mk669=Stimulus,S128,740329,1,0 +Mk670=Stimulus,S128,740397,1,0 +Mk671=Stimulus,S 51,745842,1,0 +Mk672=Stimulus,S 11,746273,1,0 +Mk673=Stimulus,S139,746274,1,0 +Mk674=Stimulus,S128,746276,1,0 +Mk675=Stimulus,S 53,747606,1,0 +Mk676=Stimulus,S139,748125,1,0 +Mk677=Stimulus,S128,748128,1,0 +Mk678=Stimulus,S128,748154,1,0 +Mk679=Stimulus,S 52,749270,1,0 +Mk680=Stimulus,S128,749768,1,0 +Mk681=Stimulus,S139,749770,1,0 +Mk682=Stimulus,S128,749773,1,0 +Mk683=Stimulus,S 53,751073,1,0 +Mk684=Stimulus,S 11,751595,1,0 +Mk685=Stimulus,S139,751596,1,0 +Mk686=Stimulus,S128,751597,1,0 +Mk687=Stimulus,S128,751794,1,0 +Mk688=Stimulus,S 53,752739,1,0 +Mk689=Stimulus,S128,753226,1,0 +Mk690=Stimulus,S139,753228,1,0 +Mk691=Stimulus,S128,753231,1,0 +Mk692=Stimulus,S 53,754373,1,0 +Mk693=Stimulus,S139,754870,1,0 +Mk694=Stimulus,S128,754872,1,0 +Mk695=Stimulus,S 52,756343,1,0 +Mk696=Stimulus,S 11,756923,1,0 +Mk697=Stimulus,S139,756925,1,0 +Mk698=Stimulus,S128,756926,1,0 +Mk699=Stimulus,S 53,758189,1,0 +Mk700=Stimulus,S 11,758552,1,0 +Mk701=Stimulus,S128,758555,1,0 +Mk702=Stimulus,S 53,759867,1,0 +Mk703=Stimulus,S128,760376,1,0 +Mk704=Stimulus,S139,760379,1,0 +Mk705=Stimulus,S128,760382,1,0 +Mk706=Stimulus,S 51,761894,1,0 +Mk707=Stimulus,S128,762241,1,0 +Mk708=Stimulus,S139,762243,1,0 +Mk709=Stimulus,S128,762246,1,0 +Mk710=Stimulus,S128,762414,1,0 +Mk711=Stimulus,S 53,763466,1,0 +Mk712=Stimulus,S139,764892,1,0 +Mk713=Stimulus,S128,764895,1,0 +Mk714=Stimulus,S 51,765278,1,0 +Mk715=Stimulus,S 54,767184,1,0 +Mk716=Stimulus,S 11,767593,1,0 +Mk717=Stimulus,S139,767594,1,0 +Mk718=Stimulus,S128,767596,1,0 +Mk719=Stimulus,S 54,768780,1,0 +Mk720=Stimulus,S139,769429,1,0 +Mk721=Stimulus,S128,769432,1,0 +Mk722=Stimulus,S 54,770380,1,0 +Mk723=Stimulus,S 11,770999,1,0 +Mk724=Stimulus,S139,771001,1,0 +Mk725=Stimulus,S128,771002,1,0 +Mk726=Stimulus,S 54,772120,1,0 +Mk727=Stimulus,S128,772558,1,0 +Mk728=Stimulus,S139,772559,1,0 +Mk729=Stimulus,S128,772563,1,0 +Mk730=Stimulus,S 54,773892,1,0 +Mk731=Stimulus,S128,774275,1,0 +Mk732=Stimulus,S139,774277,1,0 +Mk733=Stimulus,S128,774280,1,0 +Mk734=Stimulus,S 54,775774,1,0 +Mk735=Stimulus,S139,776141,1,0 +Mk736=Stimulus,S128,776144,1,0 +Mk737=Stimulus,S128,776351,1,0 +Mk738=Stimulus,S 51,777390,1,0 +Mk739=Stimulus,S 11,777932,1,0 +Mk740=Stimulus,S139,777934,1,0 +Mk741=Stimulus,S128,777936,1,0 +Mk742=Stimulus,S 52,778986,1,0 +Mk743=Stimulus,S128,779609,1,0 +Mk744=Stimulus,S139,779611,1,0 +Mk745=Stimulus,S128,779614,1,0 +Mk746=Stimulus,S 52,780976,1,0 +Mk747=Stimulus,S 11,781461,1,0 +Mk748=Stimulus,S139,781463,1,0 +Mk749=Stimulus,S128,781464,1,0 +Mk750=Stimulus,S 52,782672,1,0 +Mk751=Stimulus,S 11,783043,1,0 +Mk752=Stimulus,S139,783044,1,0 +Mk753=Stimulus,S128,783046,1,0 +Mk754=Stimulus,S 53,784570,1,0 +Mk755=Stimulus,S128,785341,1,0 +Mk756=Stimulus,S139,785342,1,0 +Mk757=Stimulus,S128,785345,1,0 +Mk758=Stimulus,S 53,786202,1,0 +Mk759=Stimulus,S128,786979,1,0 +Mk760=Stimulus,S139,786981,1,0 +Mk761=Stimulus,S128,786983,1,0 +Mk762=Stimulus,S128,787007,1,0 +Mk763=Stimulus,S 53,787835,1,0 +Mk764=Stimulus,S128,788601,1,0 +Mk765=Stimulus,S139,788602,1,0 +Mk766=Stimulus,S128,788605,1,0 +Mk767=Stimulus,S128,788786,1,0 +Mk768=Stimulus,S 54,789601,1,0 +Mk769=Stimulus,S128,790267,1,0 +Mk770=Stimulus,S139,790270,1,0 +Mk771=Stimulus,S128,790272,1,0 +Mk772=Stimulus,S 51,791349,1,0 +Mk773=Stimulus,S139,791746,1,0 +Mk774=Stimulus,S128,791748,1,0 +Mk775=Stimulus,S 54,793225,1,0 +Mk776=Stimulus,S 11,793638,1,0 +Mk777=Stimulus,S139,793639,1,0 +Mk778=Stimulus,S128,793640,1,0 +Mk779=Stimulus,S 51,794843,1,0 +Mk780=Stimulus,S 11,795265,1,0 +Mk781=Stimulus,S128,795268,1,0 +Mk782=Stimulus,S 52,796573,1,0 +Mk783=Stimulus,S 11,797024,1,0 +Mk784=Stimulus,S139,797025,1,0 +Mk785=Stimulus,S128,797027,1,0 +Mk786=Stimulus,S 51,798478,1,0 +Mk787=Stimulus,S128,798856,1,0 +Mk788=Stimulus,S139,798857,1,0 +Mk789=Stimulus,S128,798860,1,0 +Mk790=Stimulus,S 52,800463,1,0 +Mk791=Stimulus,S 11,800936,1,0 +Mk792=Stimulus,S139,800937,1,0 +Mk793=Stimulus,S128,800939,1,0 +Mk794=Stimulus,S 51,802312,1,0 +Mk795=Stimulus,S 11,802679,1,0 +Mk796=Stimulus,S139,802681,1,0 +Mk797=Stimulus,S128,802682,1,0 +Mk798=Stimulus,S 51,803915,1,0 +Mk799=Stimulus,S128,804505,1,0 +Mk800=Stimulus,S139,804506,1,0 +Mk801=Stimulus,S128,804509,1,0 +Mk802=Stimulus,S 52,805584,1,0 +Mk803=Stimulus,S128,806268,1,0 +Mk804=Stimulus,S139,806269,1,0 +Mk805=Stimulus,S128,806272,1,0 +Mk806=Stimulus,S 52,807329,1,0 +Mk807=Stimulus,S 11,808133,1,0 +Mk808=Stimulus,S139,808134,1,0 +Mk809=Stimulus,S128,808136,1,0 +Mk810=Stimulus,S 54,809206,1,0 +Mk811=Stimulus,S128,809973,1,0 +Mk812=Stimulus,S139,809974,1,0 +Mk813=Stimulus,S128,809977,1,0 +Mk814=Stimulus,S 51,810845,1,0 +Mk815=Stimulus,S128,811544,1,0 +Mk816=Stimulus,S139,811545,1,0 +Mk817=Stimulus,S128,811547,1,0 +Mk818=Stimulus,S 54,812744,1,0 +Mk819=Stimulus,S128,813409,1,0 +Mk820=Stimulus,S139,813412,1,0 +Mk821=Stimulus,S128,813414,1,0 +Mk822=Stimulus,S 52,814563,1,0 +Mk823=Stimulus,S 11,815112,1,0 +Mk824=Stimulus,S139,815114,1,0 +Mk825=Stimulus,S128,815115,1,0 +Mk826=Stimulus,S 52,830915,1,0 +Mk827=Stimulus,S128,831549,1,0 +Mk828=Stimulus,S139,831551,1,0 +Mk829=Stimulus,S128,831555,1,0 +Mk830=Stimulus,S 54,832539,1,0 +Mk831=Stimulus,S 11,833005,1,0 +Mk832=Stimulus,S139,833006,1,0 +Mk833=Stimulus,S128,833008,1,0 +Mk834=Stimulus,S 54,834247,1,0 +Mk835=Stimulus,S 11,834601,1,0 +Mk836=Stimulus,S128,834604,1,0 +Mk837=Stimulus,S128,834628,1,0 +Mk838=Stimulus,S 52,836093,1,0 +Mk839=Stimulus,S128,836434,1,0 +Mk840=Stimulus,S139,836435,1,0 +Mk841=Stimulus,S128,836437,1,0 +Mk842=Stimulus,S 54,838005,1,0 +Mk843=Stimulus,S128,838433,1,0 +Mk844=Stimulus,S139,838436,1,0 +Mk845=Stimulus,S128,838439,1,0 +Mk846=Stimulus,S 51,839777,1,0 +Mk847=Stimulus,S 11,840149,1,0 +Mk848=Stimulus,S128,840152,1,0 +Mk849=Stimulus,S 52,841580,1,0 +Mk850=Stimulus,S128,842143,1,0 +Mk851=Stimulus,S139,842144,1,0 +Mk852=Stimulus,S128,842146,1,0 +Mk853=Stimulus,S 51,843471,1,0 +Mk854=Stimulus,S139,843888,1,0 +Mk855=Stimulus,S128,843890,1,0 +Mk856=Stimulus,S 52,845246,1,0 +Mk857=Stimulus,S139,845613,1,0 +Mk858=Stimulus,S128,845616,1,0 +Mk859=Stimulus,S 51,847257,1,0 +Mk860=Stimulus,S128,847669,1,0 +Mk861=Stimulus,S139,847670,1,0 +Mk862=Stimulus,S128,847672,1,0 +Mk863=Stimulus,S 53,849251,1,0 +Mk864=Stimulus,S128,849792,1,0 +Mk865=Stimulus,S139,849793,1,0 +Mk866=Stimulus,S128,849796,1,0 +Mk867=Stimulus,S 52,850932,1,0 +Mk868=Stimulus,S 11,851468,1,0 +Mk869=Stimulus,S139,851469,1,0 +Mk870=Stimulus,S128,851471,1,0 +Mk871=Stimulus,S 53,852794,1,0 +Mk872=Stimulus,S128,853225,1,0 +Mk873=Stimulus,S139,853227,1,0 +Mk874=Stimulus,S128,853229,1,0 +Mk875=Stimulus,S 53,854651,1,0 +Mk876=Stimulus,S128,855076,1,0 +Mk877=Stimulus,S139,855078,1,0 +Mk878=Stimulus,S128,855080,1,0 +Mk879=Stimulus,S 54,856430,1,0 +Mk880=Stimulus,S 11,856908,1,0 +Mk881=Stimulus,S139,856909,1,0 +Mk882=Stimulus,S128,856911,1,0 +Mk883=Stimulus,S 54,858037,1,0 +Mk884=Stimulus,S139,858870,1,0 +Mk885=Stimulus,S128,858872,1,0 +Mk886=Stimulus,S 54,860045,1,0 +Mk887=Stimulus,S128,860628,1,0 +Mk888=Stimulus,S139,860629,1,0 +Mk889=Stimulus,S128,860631,1,0 +Mk890=Stimulus,S 53,861670,1,0 +Mk891=Stimulus,S 11,862741,1,0 +Mk892=Stimulus,S139,862742,1,0 +Mk893=Stimulus,S128,862743,1,0 +Mk894=Stimulus,S 51,863600,1,0 +Mk895=Stimulus,S 11,864154,1,0 +Mk896=Stimulus,S139,864156,1,0 +Mk897=Stimulus,S128,864157,1,0 +Mk898=Stimulus,S128,864192,1,0 +Mk899=Stimulus,S 51,865439,1,0 +Mk900=Stimulus,S128,866098,1,0 +Mk901=Stimulus,S139,866100,1,0 +Mk902=Stimulus,S128,866103,1,0 +Mk903=Stimulus,S 52,867129,1,0 +Mk904=Stimulus,S 11,867598,1,0 +Mk905=Stimulus,S139,867599,1,0 +Mk906=Stimulus,S128,867601,1,0 +Mk907=Stimulus,S 51,868946,1,0 +Mk908=Stimulus,S 11,869418,1,0 +Mk909=Stimulus,S139,869419,1,0 +Mk910=Stimulus,S128,869421,1,0 +Mk911=Stimulus,S 53,870818,1,0 +Mk912=Stimulus,S 11,871293,1,0 +Mk913=Stimulus,S128,871297,1,0 +Mk914=Stimulus,S 53,872419,1,0 +Mk915=Stimulus,S128,872854,1,0 +Mk916=Stimulus,S139,872858,1,0 +Mk917=Stimulus,S128,872862,1,0 +Mk918=Stimulus,S 54,874431,1,0 +Mk919=Stimulus,S 11,874891,1,0 +Mk920=Stimulus,S139,874892,1,0 +Mk921=Stimulus,S128,874894,1,0 +Mk922=Stimulus,S 51,876327,1,0 +Mk923=Stimulus,S 11,876633,1,0 +Mk924=Stimulus,S128,876638,1,0 +Mk925=Stimulus,S 54,878015,1,0 +Mk926=Stimulus,S 11,878443,1,0 +Mk927=Stimulus,S128,878446,1,0 +Mk928=Stimulus,S 52,879922,1,0 +Mk929=Stimulus,S128,880260,1,0 +Mk930=Stimulus,S140,880264,1,0 +Mk931=Stimulus,S128,880267,1,0 +Mk932=Stimulus,S 51,881659,1,0 +Mk933=Stimulus,S 12,881965,1,0 +Mk934=Stimulus,S140,881966,1,0 +Mk935=Stimulus,S128,881968,1,0 +Mk936=Stimulus,S 51,883214,1,0 +Mk937=Stimulus,S 11,883593,1,0 +Mk938=Stimulus,S139,883595,1,0 +Mk939=Stimulus,S128,883596,1,0 +Mk940=Stimulus,S 53,884866,1,0 +Mk941=Stimulus,S 11,885202,1,0 +Mk942=Stimulus,S139,885203,1,0 +Mk943=Stimulus,S128,885204,1,0 +Mk944=Stimulus,S 52,886825,1,0 +Mk945=Stimulus,S 11,887486,1,0 +Mk946=Stimulus,S139,887487,1,0 +Mk947=Stimulus,S128,887489,1,0 +Mk948=Stimulus,S 51,888462,1,0 +Mk949=Stimulus,S 11,888916,1,0 +Mk950=Stimulus,S139,888917,1,0 +Mk951=Stimulus,S128,888919,1,0 +Mk952=Stimulus,S 53,890379,1,0 +Mk953=Stimulus,S128,890814,1,0 +Mk954=Stimulus,S140,890815,1,0 +Mk955=Stimulus,S128,890818,1,0 +Mk956=Stimulus,S 54,891912,1,0 +Mk957=Stimulus,S128,892712,1,0 +Mk958=Stimulus,S139,892714,1,0 +Mk959=Stimulus,S128,892717,1,0 +Mk960=Stimulus,S 53,893811,1,0 +Mk961=Stimulus,S139,894344,1,0 +Mk962=Stimulus,S128,894347,1,0 +Mk963=Stimulus,S 52,895799,1,0 +Mk964=Stimulus,S 11,896303,1,0 +Mk965=Stimulus,S128,896305,1,0 +Mk966=Stimulus,S 53,897429,1,0 +Mk967=Stimulus,S128,897876,1,0 +Mk968=Stimulus,S139,897879,1,0 +Mk969=Stimulus,S128,897881,1,0 +Mk970=Stimulus,S 54,899078,1,0 +Mk971=Stimulus,S128,899624,1,0 +Mk972=Stimulus,S139,899626,1,0 +Mk973=Stimulus,S128,899628,1,0 +Mk974=Stimulus,S 52,900729,1,0 +Mk975=Stimulus,S128,901304,1,0 +Mk976=Stimulus,S140,901305,1,0 +Mk977=Stimulus,S128,901308,1,0 +Mk978=Stimulus,S 51,918285,1,0 +Mk979=Stimulus,S 11,918948,1,0 +Mk980=Stimulus,S139,918949,1,0 +Mk981=Stimulus,S128,918950,1,0 +Mk982=Stimulus,S 52,920209,1,0 +Mk983=Stimulus,S128,920845,1,0 +Mk984=Stimulus,S139,920849,1,0 +Mk985=Stimulus,S128,920852,1,0 +Mk986=Stimulus,S 54,922042,1,0 +Mk987=Stimulus,S128,922728,1,0 +Mk988=Stimulus,S139,922730,1,0 +Mk989=Stimulus,S128,922734,1,0 +Mk990=Stimulus,S 54,923845,1,0 +Mk991=Stimulus,S128,924487,1,0 +Mk992=Stimulus,S139,924488,1,0 +Mk993=Stimulus,S128,924491,1,0 +Mk994=Stimulus,S 54,925499,1,0 +Mk995=Stimulus,S 11,926431,1,0 +Mk996=Stimulus,S128,926433,1,0 +Mk997=Stimulus,S 51,927478,1,0 +Mk998=Stimulus,S139,927893,1,0 +Mk999=Stimulus,S128,927896,1,0 +Mk1000=Stimulus,S 52,929058,1,0 +Mk1001=Stimulus,S128,929737,1,0 +Mk1002=Stimulus,S139,929740,1,0 +Mk1003=Stimulus,S128,929743,1,0 +Mk1004=Stimulus,S 51,930669,1,0 +Mk1005=Stimulus,S128,931230,1,0 +Mk1006=Stimulus,S139,931233,1,0 +Mk1007=Stimulus,S128,931235,1,0 +Mk1008=Stimulus,S 52,932646,1,0 +Mk1009=Stimulus,S 11,933090,1,0 +Mk1010=Stimulus,S139,933092,1,0 +Mk1011=Stimulus,S128,933093,1,0 +Mk1012=Stimulus,S 51,934663,1,0 +Mk1013=Stimulus,S128,935197,1,0 +Mk1014=Stimulus,S139,935199,1,0 +Mk1015=Stimulus,S128,935202,1,0 +Mk1016=Stimulus,S 53,936611,1,0 +Mk1017=Stimulus,S139,937103,1,0 +Mk1018=Stimulus,S128,937106,1,0 +Mk1019=Stimulus,S 51,938539,1,0 +Mk1020=Stimulus,S128,938946,1,0 +Mk1021=Stimulus,S139,938948,1,0 +Mk1022=Stimulus,S128,938952,1,0 +Mk1023=Stimulus,S 51,940099,1,0 +Mk1024=Stimulus,S 11,940603,1,0 +Mk1025=Stimulus,S139,940604,1,0 +Mk1026=Stimulus,S128,940606,1,0 +Mk1027=Stimulus,S 53,942071,1,0 +Mk1028=Stimulus,S 11,942491,1,0 +Mk1029=Stimulus,S139,942492,1,0 +Mk1030=Stimulus,S128,942494,1,0 +Mk1031=Stimulus,S 54,943885,1,0 +Mk1032=Stimulus,S139,944530,1,0 +Mk1033=Stimulus,S128,944533,1,0 +Mk1034=Stimulus,S 51,945560,1,0 +Mk1035=Stimulus,S 11,946169,1,0 +Mk1036=Stimulus,S139,946170,1,0 +Mk1037=Stimulus,S128,946173,1,0 +Mk1038=Stimulus,S 54,947553,1,0 +Mk1039=Stimulus,S128,947986,1,0 +Mk1040=Stimulus,S139,947987,1,0 +Mk1041=Stimulus,S128,947989,1,0 +Mk1042=Stimulus,S 52,949222,1,0 +Mk1043=Stimulus,S 11,949781,1,0 +Mk1044=Stimulus,S139,949782,1,0 +Mk1045=Stimulus,S128,949783,1,0 +Mk1046=Stimulus,S 53,951248,1,0 +Mk1047=Stimulus,S 11,951632,1,0 +Mk1048=Stimulus,S128,951635,1,0 +Mk1049=Stimulus,S 54,953001,1,0 +Mk1050=Stimulus,S 11,953415,1,0 +Mk1051=Stimulus,S128,953418,1,0 +Mk1052=Stimulus,S 53,954991,1,0 +Mk1053=Stimulus,S 11,955346,1,0 +Mk1054=Stimulus,S139,955347,1,0 +Mk1055=Stimulus,S128,955349,1,0 +Mk1056=Stimulus,S 52,956642,1,0 +Mk1057=Stimulus,S139,956899,1,0 +Mk1058=Stimulus,S128,956902,1,0 +Mk1059=Stimulus,S 52,958518,1,0 +Mk1060=Stimulus,S128,958928,1,0 +Mk1061=Stimulus,S139,958930,1,0 +Mk1062=Stimulus,S128,958933,1,0 +Mk1063=Stimulus,S 52,960150,1,0 +Mk1064=Stimulus,S139,960748,1,0 +Mk1065=Stimulus,S128,960750,1,0 +Mk1066=Stimulus,S 53,961740,1,0 +Mk1067=Stimulus,S128,962372,1,0 +Mk1068=Stimulus,S139,962374,1,0 +Mk1069=Stimulus,S128,962377,1,0 +Mk1070=Stimulus,S 54,963355,1,0 +Mk1071=Stimulus,S128,963949,1,0 +Mk1072=Stimulus,S139,963952,1,0 +Mk1073=Stimulus,S128,963954,1,0 +Mk1074=Stimulus,S 51,965310,1,0 +Mk1075=Stimulus,S128,965680,1,0 +Mk1076=Stimulus,S139,965683,1,0 +Mk1077=Stimulus,S128,965686,1,0 +Mk1078=Stimulus,S 51,966955,1,0 +Mk1079=Stimulus,S 11,967573,1,0 +Mk1080=Stimulus,S139,967574,1,0 +Mk1081=Stimulus,S128,967576,1,0 +Mk1082=Stimulus,S128,967615,1,0 +Mk1083=Stimulus,S 54,968954,1,0 +Mk1084=Stimulus,S128,969474,1,0 +Mk1085=Stimulus,S139,969475,1,0 +Mk1086=Stimulus,S128,969478,1,0 +Mk1087=Stimulus,S 54,970881,1,0 +Mk1088=Stimulus,S128,971299,1,0 +Mk1089=Stimulus,S139,971302,1,0 +Mk1090=Stimulus,S128,971305,1,0 +Mk1091=Stimulus,S 52,972592,1,0 +Mk1092=Stimulus,S128,973062,1,0 +Mk1093=Stimulus,S139,973063,1,0 +Mk1094=Stimulus,S128,973065,1,0 +Mk1095=Stimulus,S 52,974219,1,0 +Mk1096=Stimulus,S128,974608,1,0 +Mk1097=Stimulus,S139,974610,1,0 +Mk1098=Stimulus,S128,974613,1,0 +Mk1099=Stimulus,S 53,975962,1,0 +Mk1100=Stimulus,S 11,976416,1,0 +Mk1101=Stimulus,S128,976420,1,0 +Mk1102=Stimulus,S 53,977859,1,0 +Mk1103=Stimulus,S 11,978238,1,0 +Mk1104=Stimulus,S139,978239,1,0 +Mk1105=Stimulus,S128,978241,1,0 +Mk1106=Stimulus,S 52,979620,1,0 +Mk1107=Stimulus,S 11,980199,1,0 +Mk1108=Stimulus,S139,980200,1,0 +Mk1109=Stimulus,S128,980202,1,0 +Mk1110=Stimulus,S 54,981156,1,0 +Mk1111=Stimulus,S128,982057,1,0 +Mk1112=Stimulus,S139,982060,1,0 +Mk1113=Stimulus,S128,982063,1,0 +Mk1114=Stimulus,S128,982106,1,0 +Mk1115=Stimulus,S 53,983182,1,0 +Mk1116=Stimulus,S139,983943,1,0 +Mk1117=Stimulus,S128,983946,1,0 +Mk1118=Stimulus,S 53,985172,1,0 +Mk1119=Stimulus,S 11,985655,1,0 +Mk1120=Stimulus,S139,985656,1,0 +Mk1121=Stimulus,S128,985658,1,0 +Mk1122=Stimulus,S 51,986890,1,0 +Mk1123=Stimulus,S128,987476,1,0 +Mk1124=Stimulus,S139,987478,1,0 +Mk1125=Stimulus,S128,987481,1,0 +Mk1126=Stimulus,S 53,988592,1,0 +Mk1127=Stimulus,S128,989104,1,0 +Mk1128=Stimulus,S139,989105,1,0 +Mk1129=Stimulus,S128,989107,1,0 +Mk1130=Stimulus,S 54,1006040,1,0 +Mk1131=Stimulus,S139,1006714,1,0 +Mk1132=Stimulus,S128,1006718,1,0 +Mk1133=Stimulus,S 52,1007934,1,0 +Mk1134=Stimulus,S 11,1008355,1,0 +Mk1135=Stimulus,S139,1008357,1,0 +Mk1136=Stimulus,S128,1008358,1,0 +Mk1137=Stimulus,S128,1008397,1,0 +Mk1138=Stimulus,S 51,1009931,1,0 +Mk1139=Stimulus,S140,1010436,1,0 +Mk1140=Stimulus,S128,1010439,1,0 +Mk1141=Stimulus,S 51,1011611,1,0 +Mk1142=Stimulus,S128,1011970,1,0 +Mk1143=Stimulus,S139,1011972,1,0 +Mk1144=Stimulus,S128,1011974,1,0 +Mk1145=Stimulus,S 53,1013535,1,0 +Mk1146=Stimulus,S128,1013809,1,0 +Mk1147=Stimulus,S140,1013810,1,0 +Mk1148=Stimulus,S128,1013813,1,0 +Mk1149=Stimulus,S 54,1015119,1,0 +Mk1150=Stimulus,S140,1015394,1,0 +Mk1151=Stimulus,S128,1015397,1,0 +Mk1152=Stimulus,S 52,1016922,1,0 +Mk1153=Stimulus,S 11,1017609,1,0 +Mk1154=Stimulus,S139,1017611,1,0 +Mk1155=Stimulus,S128,1017612,1,0 +Mk1156=Stimulus,S 21,1018089,1,0 +Mk1157=Stimulus,S 52,1018913,1,0 +Mk1158=Stimulus,S128,1019721,1,0 +Mk1159=Stimulus,S139,1019723,1,0 +Mk1160=Stimulus,S128,1019725,1,0 +Mk1161=Stimulus,S 52,1020928,1,0 +Mk1162=Stimulus,S 11,1021483,1,0 +Mk1163=Stimulus,S139,1021484,1,0 +Mk1164=Stimulus,S128,1021486,1,0 +Mk1165=Stimulus,S 53,1022689,1,0 +Mk1166=Stimulus,S 11,1023371,1,0 +Mk1167=Stimulus,S139,1023372,1,0 +Mk1168=Stimulus,S128,1023374,1,0 +Mk1169=Stimulus,S 51,1024452,1,0 +Mk1170=Stimulus,S139,1025018,1,0 +Mk1171=Stimulus,S128,1025021,1,0 +Mk1172=Stimulus,S 53,1026000,1,0 +Mk1173=Stimulus,S128,1026496,1,0 +Mk1174=Stimulus,S139,1026497,1,0 +Mk1175=Stimulus,S128,1026500,1,0 +Mk1176=Stimulus,S 53,1028006,1,0 +Mk1177=Stimulus,S 11,1028451,1,0 +Mk1178=Stimulus,S128,1028454,1,0 +Mk1179=Stimulus,S 53,1029997,1,0 +Mk1180=Stimulus,S128,1030460,1,0 +Mk1181=Stimulus,S139,1030461,1,0 +Mk1182=Stimulus,S128,1030464,1,0 +Mk1183=Stimulus,S 53,1031862,1,0 +Mk1184=Stimulus,S128,1032323,1,0 +Mk1185=Stimulus,S139,1032324,1,0 +Mk1186=Stimulus,S128,1032327,1,0 +Mk1187=Stimulus,S 54,1033517,1,0 +Mk1188=Stimulus,S 11,1034175,1,0 +Mk1189=Stimulus,S139,1034177,1,0 +Mk1190=Stimulus,S128,1034178,1,0 +Mk1191=Stimulus,S 53,1035424,1,0 +Mk1192=Stimulus,S 11,1035876,1,0 +Mk1193=Stimulus,S139,1035877,1,0 +Mk1194=Stimulus,S128,1035878,1,0 +Mk1195=Stimulus,S 53,1037264,1,0 +Mk1196=Stimulus,S 11,1037834,1,0 +Mk1197=Stimulus,S139,1037836,1,0 +Mk1198=Stimulus,S128,1037837,1,0 +Mk1199=Stimulus,S 54,1038967,1,0 +Mk1200=Stimulus,S 11,1039486,1,0 +Mk1201=Stimulus,S128,1039488,1,0 +Mk1202=Stimulus,S 54,1040976,1,0 +Mk1203=Stimulus,S128,1041478,1,0 +Mk1204=Stimulus,S139,1041480,1,0 +Mk1205=Stimulus,S128,1041483,1,0 +Mk1206=Stimulus,S128,1041537,1,0 +Mk1207=Stimulus,S 51,1042984,1,0 +Mk1208=Stimulus,S128,1043469,1,0 +Mk1209=Stimulus,S139,1043472,1,0 +Mk1210=Stimulus,S128,1043475,1,0 +Mk1211=Stimulus,S128,1043637,1,0 +Mk1212=Stimulus,S 54,1044958,1,0 +Mk1213=Stimulus,S128,1045417,1,0 +Mk1214=Stimulus,S139,1045420,1,0 +Mk1215=Stimulus,S128,1045423,1,0 +Mk1216=Stimulus,S 53,1046973,1,0 +Mk1217=Stimulus,S 11,1047479,1,0 +Mk1218=Stimulus,S139,1047480,1,0 +Mk1219=Stimulus,S128,1047482,1,0 +Mk1220=Stimulus,S 52,1048836,1,0 +Mk1221=Stimulus,S128,1049479,1,0 +Mk1222=Stimulus,S139,1049481,1,0 +Mk1223=Stimulus,S128,1049484,1,0 +Mk1224=Stimulus,S 54,1050452,1,0 +Mk1225=Stimulus,S128,1051000,1,0 +Mk1226=Stimulus,S139,1051001,1,0 +Mk1227=Stimulus,S128,1051004,1,0 +Mk1228=Stimulus,S 53,1052317,1,0 +Mk1229=Stimulus,S 11,1053102,1,0 +Mk1230=Stimulus,S139,1053104,1,0 +Mk1231=Stimulus,S128,1053105,1,0 +Mk1232=Stimulus,S 51,1053877,1,0 +Mk1233=Stimulus,S128,1055035,1,0 +Mk1234=Stimulus,S139,1055037,1,0 +Mk1235=Stimulus,S128,1055040,1,0 +Mk1236=Stimulus,S 54,1055514,1,0 +Mk1237=Stimulus,S128,1056285,1,0 +Mk1238=Stimulus,S139,1056288,1,0 +Mk1239=Stimulus,S128,1056290,1,0 +Mk1240=Stimulus,S 52,1057402,1,0 +Mk1241=Stimulus,S128,1058017,1,0 +Mk1242=Stimulus,S139,1058020,1,0 +Mk1243=Stimulus,S128,1058023,1,0 +Mk1244=Stimulus,S 51,1058977,1,0 +Mk1245=Stimulus,S 11,1059617,1,0 +Mk1246=Stimulus,S139,1059618,1,0 +Mk1247=Stimulus,S128,1059620,1,0 +Mk1248=Stimulus,S 54,1060568,1,0 +Mk1249=Stimulus,S128,1061376,1,0 +Mk1250=Stimulus,S139,1061378,1,0 +Mk1251=Stimulus,S128,1061381,1,0 +Mk1252=Stimulus,S 52,1062159,1,0 +Mk1253=Stimulus,S 11,1063053,1,0 +Mk1254=Stimulus,S139,1063055,1,0 +Mk1255=Stimulus,S128,1063056,1,0 +Mk1256=Stimulus,S 51,1063955,1,0 +Mk1257=Stimulus,S128,1064539,1,0 +Mk1258=Stimulus,S139,1064540,1,0 +Mk1259=Stimulus,S128,1064543,1,0 +Mk1260=Stimulus,S 52,1065625,1,0 +Mk1261=Stimulus,S 11,1066317,1,0 +Mk1262=Stimulus,S139,1066318,1,0 +Mk1263=Stimulus,S128,1066320,1,0 +Mk1264=Stimulus,S 21,1066802,1,0 +Mk1265=Stimulus,S 51,1067510,1,0 +Mk1266=Stimulus,S128,1068025,1,0 +Mk1267=Stimulus,S139,1068029,1,0 +Mk1268=Stimulus,S128,1068031,1,0 +Mk1269=Stimulus,S128,1068067,1,0 +Mk1270=Stimulus,S 51,1069355,1,0 +Mk1271=Stimulus,S128,1069896,1,0 +Mk1272=Stimulus,S139,1069898,1,0 +Mk1273=Stimulus,S128,1069901,1,0 +Mk1274=Stimulus,S 52,1070909,1,0 +Mk1275=Stimulus,S139,1071828,1,0 +Mk1276=Stimulus,S128,1071831,1,0 +Mk1277=Stimulus,S128,1071887,1,0 +Mk1278=Stimulus,S 21,1072332,1,0 +Mk1279=Stimulus,S 51,1072658,1,0 +Mk1280=Stimulus,S128,1073459,1,0 +Mk1281=Stimulus,S139,1073462,1,0 +Mk1282=Stimulus,S128,1073465,1,0 +Mk1283=Stimulus,S 52,1074250,1,0 +Mk1284=Stimulus,S128,1075119,1,0 +Mk1285=Stimulus,S139,1075121,1,0 +Mk1286=Stimulus,S128,1075124,1,0 +Mk1287=Stimulus,S 21,1075680,1,0 +Mk1288=Stimulus,S 54,1075799,1,0 +Mk1289=Stimulus,S128,1076695,1,0 +Mk1290=Stimulus,S139,1076698,1,0 +Mk1291=Stimulus,S128,1076700,1,0 +Mk1292=Stimulus,S128,1076734,1,0 +Mk1293=Stimulus,S 21,1077123,1,0 +Mk1294=Stimulus,S 51,1092415,1,0 +Mk1295=Stimulus,S 11,1092797,1,0 +Mk1296=Stimulus,S128,1092988,1,0 +Mk1297=Stimulus,S 54,1094075,1,0 +Mk1298=Stimulus,S128,1094698,1,0 +Mk1299=Stimulus,S139,1094702,1,0 +Mk1300=Stimulus,S128,1094705,1,0 +Mk1301=Stimulus,S 21,1095236,1,0 +Mk1302=Stimulus,S 21,1095303,1,0 +Mk1303=Stimulus,S 53,1095885,1,0 +Mk1304=Stimulus,S128,1096247,1,0 +Mk1305=Stimulus,S139,1096251,1,0 +Mk1306=Stimulus,S128,1096254,1,0 +Mk1307=Stimulus,S 54,1097433,1,0 +Mk1308=Stimulus,S128,1097813,1,0 +Mk1309=Stimulus,S139,1097816,1,0 +Mk1310=Stimulus,S128,1097819,1,0 +Mk1311=Stimulus,S 21,1098272,1,0 +Mk1312=Stimulus,S 53,1099125,1,0 +Mk1313=Stimulus,S128,1099518,1,0 +Mk1314=Stimulus,S139,1099521,1,0 +Mk1315=Stimulus,S128,1099524,1,0 +Mk1316=Stimulus,S 51,1100702,1,0 +Mk1317=Stimulus,S128,1101007,1,0 +Mk1318=Stimulus,S140,1101008,1,0 +Mk1319=Stimulus,S128,1101011,1,0 +Mk1320=Stimulus,S 53,1102728,1,0 +Mk1321=Stimulus,S139,1103201,1,0 +Mk1322=Stimulus,S128,1103204,1,0 +Mk1323=Stimulus,S128,1103233,1,0 +Mk1324=Stimulus,S 21,1103978,1,0 +Mk1325=Stimulus,S 53,1104431,1,0 +Mk1326=Stimulus,S128,1104912,1,0 +Mk1327=Stimulus,S139,1104913,1,0 +Mk1328=Stimulus,S128,1104915,1,0 +Mk1329=Stimulus,S 53,1106445,1,0 +Mk1330=Stimulus,S 11,1106751,1,0 +Mk1331=Stimulus,S128,1106754,1,0 +Mk1332=Stimulus,S128,1106796,1,0 +Mk1333=Stimulus,S128,1106936,1,0 +Mk1334=Stimulus,S 51,1108200,1,0 +Mk1335=Stimulus,S128,1108654,1,0 +Mk1336=Stimulus,S139,1108655,1,0 +Mk1337=Stimulus,S128,1108658,1,0 +Mk1338=Stimulus,S128,1108814,1,0 +Mk1339=Stimulus,S 54,1109922,1,0 +Mk1340=Stimulus,S128,1110323,1,0 +Mk1341=Stimulus,S140,1110325,1,0 +Mk1342=Stimulus,S128,1110327,1,0 +Mk1343=Stimulus,S 53,1111768,1,0 +Mk1344=Stimulus,S 11,1112122,1,0 +Mk1345=Stimulus,S139,1112123,1,0 +Mk1346=Stimulus,S128,1112125,1,0 +Mk1347=Stimulus,S 54,1113492,1,0 +Mk1348=Stimulus,S139,1113901,1,0 +Mk1349=Stimulus,S128,1113903,1,0 +Mk1350=Stimulus,S 52,1115471,1,0 +Mk1351=Stimulus,S128,1115924,1,0 +Mk1352=Stimulus,S139,1115925,1,0 +Mk1353=Stimulus,S128,1115927,1,0 +Mk1354=Stimulus,S 51,1117324,1,0 +Mk1355=Stimulus,S139,1117864,1,0 +Mk1356=Stimulus,S128,1117867,1,0 +Mk1357=Stimulus,S 51,1119084,1,0 +Mk1358=Stimulus,S128,1119705,1,0 +Mk1359=Stimulus,S139,1119708,1,0 +Mk1360=Stimulus,S128,1119711,1,0 +Mk1361=Stimulus,S 51,1120919,1,0 +Mk1362=Stimulus,S139,1121304,1,0 +Mk1363=Stimulus,S128,1121307,1,0 +Mk1364=Stimulus,S 52,1122812,1,0 +Mk1365=Stimulus,S128,1123436,1,0 +Mk1366=Stimulus,S139,1123439,1,0 +Mk1367=Stimulus,S128,1123442,1,0 +Mk1368=Stimulus,S 52,1124432,1,0 +Mk1369=Stimulus,S128,1125322,1,0 +Mk1370=Stimulus,S139,1125323,1,0 +Mk1371=Stimulus,S128,1125326,1,0 +Mk1372=Stimulus,S 51,1126276,1,0 +Mk1373=Stimulus,S 11,1126818,1,0 +Mk1374=Stimulus,S139,1126819,1,0 +Mk1375=Stimulus,S128,1126820,1,0 +Mk1376=Stimulus,S 52,1128230,1,0 +Mk1377=Stimulus,S139,1128779,1,0 +Mk1378=Stimulus,S128,1128783,1,0 +Mk1379=Stimulus,S 53,1129901,1,0 +Mk1380=Stimulus,S 11,1130303,1,0 +Mk1381=Stimulus,S139,1130304,1,0 +Mk1382=Stimulus,S128,1130305,1,0 +Mk1383=Stimulus,S 52,1131484,1,0 +Mk1384=Stimulus,S 11,1132104,1,0 +Mk1385=Stimulus,S139,1132105,1,0 +Mk1386=Stimulus,S128,1132107,1,0 +Mk1387=Stimulus,S 52,1133075,1,0 +Mk1388=Stimulus,S 11,1134113,1,0 +Mk1389=Stimulus,S128,1134116,1,0 +Mk1390=Stimulus,S 51,1134942,1,0 +Mk1391=Stimulus,S139,1135697,1,0 +Mk1392=Stimulus,S128,1135699,1,0 +Mk1393=Stimulus,S 53,1136563,1,0 +Mk1394=Stimulus,S128,1137501,1,0 +Mk1395=Stimulus,S139,1137503,1,0 +Mk1396=Stimulus,S128,1137505,1,0 +Mk1397=Stimulus,S 54,1138284,1,0 +Mk1398=Stimulus,S128,1139054,1,0 +Mk1399=Stimulus,S139,1139057,1,0 +Mk1400=Stimulus,S128,1139060,1,0 +Mk1401=Stimulus,S 53,1140002,1,0 +Mk1402=Stimulus,S 11,1140610,1,0 +Mk1403=Stimulus,S139,1140611,1,0 +Mk1404=Stimulus,S128,1140613,1,0 +Mk1405=Stimulus,S 52,1141549,1,0 +Mk1406=Stimulus,S139,1142019,1,0 +Mk1407=Stimulus,S128,1142021,1,0 +Mk1408=Stimulus,S 51,1143460,1,0 +Mk1409=Stimulus,S139,1143904,1,0 +Mk1410=Stimulus,S128,1143907,1,0 +Mk1411=Stimulus,S128,1143946,1,0 +Mk1412=Stimulus,S 54,1145085,1,0 +Mk1413=Stimulus,S139,1145621,1,0 +Mk1414=Stimulus,S128,1145623,1,0 +Mk1415=Stimulus,S128,1145658,1,0 +Mk1416=Stimulus,S 54,1146967,1,0 +Mk1417=Stimulus,S 11,1147777,1,0 +Mk1418=Stimulus,S139,1147778,1,0 +Mk1419=Stimulus,S128,1147779,1,0 +Mk1420=Stimulus,S128,1147819,1,0 +Mk1421=Stimulus,S 51,1148872,1,0 +Mk1422=Stimulus,S128,1149529,1,0 +Mk1423=Stimulus,S139,1149530,1,0 +Mk1424=Stimulus,S128,1149533,1,0 +Mk1425=Stimulus,S 52,1150531,1,0 +Mk1426=Stimulus,S 11,1151240,1,0 +Mk1427=Stimulus,S139,1151243,1,0 +Mk1428=Stimulus,S128,1151244,1,0 +Mk1429=Stimulus,S 54,1152417,1,0 +Mk1430=Stimulus,S128,1153268,1,0 +Mk1431=Stimulus,S139,1153269,1,0 +Mk1432=Stimulus,S128,1153272,1,0 +Mk1433=Stimulus,S 54,1154251,1,0 +Mk1434=Stimulus,S139,1155260,1,0 +Mk1435=Stimulus,S128,1155263,1,0 +Mk1436=Stimulus,S128,1155296,1,0 +Mk1437=Stimulus,S 54,1156200,1,0 +Mk1438=Stimulus,S128,1156939,1,0 +Mk1439=Stimulus,S139,1156940,1,0 +Mk1440=Stimulus,S128,1156942,1,0 +Mk1441=Stimulus,S 53,1157830,1,0 +Mk1442=Stimulus,S128,1158614,1,0 +Mk1443=Stimulus,S139,1158615,1,0 +Mk1444=Stimulus,S128,1158617,1,0 +Mk1445=Stimulus,S 52,1159759,1,0 +Mk1446=Stimulus,S 11,1160332,1,0 +Mk1447=Stimulus,S139,1160334,1,0 +Mk1448=Stimulus,S128,1160335,1,0 +Mk1449=Stimulus,S 52,1161508,1,0 +Mk1450=Stimulus,S128,1162171,1,0 +Mk1451=Stimulus,S139,1162172,1,0 +Mk1452=Stimulus,S128,1162175,1,0 +Mk1453=Stimulus,S128,1162207,1,0 +Mk1454=Stimulus,S 51,1191315,1,0 +Mk1455=Stimulus,S128,1191975,1,0 +Mk1456=Stimulus,S139,1191977,1,0 +Mk1457=Stimulus,S128,1191980,1,0 +Mk1458=Stimulus,S 51,1193111,1,0 +Mk1459=Stimulus,S128,1193653,1,0 +Mk1460=Stimulus,S139,1193657,1,0 +Mk1461=Stimulus,S128,1193660,1,0 +Mk1462=Stimulus,S 51,1194819,1,0 +Mk1463=Stimulus,S128,1195115,1,0 +Mk1464=Stimulus,S139,1195116,1,0 +Mk1465=Stimulus,S128,1195119,1,0 +Mk1466=Stimulus,S 51,1196796,1,0 +Mk1467=Stimulus,S139,1197101,1,0 +Mk1468=Stimulus,S128,1197103,1,0 +Mk1469=Stimulus,S128,1197129,1,0 +Mk1470=Stimulus,S128,1197273,1,0 +Mk1471=Stimulus,S 52,1198513,1,0 +Mk1472=Stimulus,S 11,1199104,1,0 +Mk1473=Stimulus,S139,1199106,1,0 +Mk1474=Stimulus,S128,1199107,1,0 +Mk1475=Stimulus,S 52,1200346,1,0 +Mk1476=Stimulus,S139,1200773,1,0 +Mk1477=Stimulus,S128,1200776,1,0 +Mk1478=Stimulus,S128,1200809,1,0 +Mk1479=Stimulus,S 53,1201980,1,0 +Mk1480=Stimulus,S139,1202405,1,0 +Mk1481=Stimulus,S128,1202408,1,0 +Mk1482=Stimulus,S 53,1203872,1,0 +Mk1483=Stimulus,S 12,1204208,1,0 +Mk1484=Stimulus,S128,1204211,1,0 +Mk1485=Stimulus,S128,1204247,1,0 +Mk1486=Stimulus,S 54,1205620,1,0 +Mk1487=Stimulus,S128,1206071,1,0 +Mk1488=Stimulus,S139,1206072,1,0 +Mk1489=Stimulus,S128,1206075,1,0 +Mk1490=Stimulus,S 52,1207249,1,0 +Mk1491=Stimulus,S128,1207810,1,0 +Mk1492=Stimulus,S139,1207811,1,0 +Mk1493=Stimulus,S128,1207814,1,0 +Mk1494=Stimulus,S 54,1209010,1,0 +Mk1495=Stimulus,S128,1209412,1,0 +Mk1496=Stimulus,S139,1209413,1,0 +Mk1497=Stimulus,S128,1209417,1,0 +Mk1498=Stimulus,S 54,1210875,1,0 +Mk1499=Stimulus,S128,1211201,1,0 +Mk1500=Stimulus,S139,1211202,1,0 +Mk1501=Stimulus,S128,1211206,1,0 +Mk1502=Stimulus,S 52,1212881,1,0 +Mk1503=Stimulus,S139,1213181,1,0 +Mk1504=Stimulus,S128,1213184,1,0 +Mk1505=Stimulus,S 52,1214720,1,0 +Mk1506=Stimulus,S128,1215138,1,0 +Mk1507=Stimulus,S139,1215139,1,0 +Mk1508=Stimulus,S128,1215142,1,0 +Mk1509=Stimulus,S 54,1216648,1,0 +Mk1510=Stimulus,S128,1217047,1,0 +Mk1511=Stimulus,S139,1217051,1,0 +Mk1512=Stimulus,S128,1217053,1,0 +Mk1513=Stimulus,S128,1217083,1,0 +Mk1514=Stimulus,S 53,1218567,1,0 +Mk1515=Stimulus,S 11,1219194,1,0 +Mk1516=Stimulus,S128,1219197,1,0 +Mk1517=Stimulus,S 54,1220130,1,0 +Mk1518=Stimulus,S128,1220654,1,0 +Mk1519=Stimulus,S139,1220658,1,0 +Mk1520=Stimulus,S128,1220661,1,0 +Mk1521=Stimulus,S 52,1221914,1,0 +Mk1522=Stimulus,S128,1222338,1,0 +Mk1523=Stimulus,S139,1222340,1,0 +Mk1524=Stimulus,S128,1222344,1,0 +Mk1525=Stimulus,S128,1222389,1,0 +Mk1526=Stimulus,S 53,1223716,1,0 +Mk1527=Stimulus,S139,1224209,1,0 +Mk1528=Stimulus,S128,1224211,1,0 +Mk1529=Stimulus,S 52,1225590,1,0 +Mk1530=Stimulus,S139,1225950,1,0 +Mk1531=Stimulus,S128,1225953,1,0 +Mk1532=Stimulus,S128,1225986,1,0 +Mk1533=Stimulus,S 51,1227138,1,0 +Mk1534=Stimulus,S128,1227737,1,0 +Mk1535=Stimulus,S139,1227740,1,0 +Mk1536=Stimulus,S128,1227743,1,0 +Mk1537=Stimulus,S 53,1228806,1,0 +Mk1538=Stimulus,S 11,1229329,1,0 +Mk1539=Stimulus,S139,1229330,1,0 +Mk1540=Stimulus,S128,1229332,1,0 +Mk1541=Stimulus,S 52,1230820,1,0 +Mk1542=Stimulus,S128,1231378,1,0 +Mk1543=Stimulus,S139,1231381,1,0 +Mk1544=Stimulus,S128,1231384,1,0 +Mk1545=Stimulus,S 53,1232370,1,0 +Mk1546=Stimulus,S128,1232991,1,0 +Mk1547=Stimulus,S139,1232995,1,0 +Mk1548=Stimulus,S128,1232998,1,0 +Mk1549=Stimulus,S 51,1234140,1,0 +Mk1550=Stimulus,S 11,1234705,1,0 +Mk1551=Stimulus,S139,1234706,1,0 +Mk1552=Stimulus,S128,1234708,1,0 +Mk1553=Stimulus,S 54,1235680,1,0 +Mk1554=Stimulus,S139,1236266,1,0 +Mk1555=Stimulus,S128,1236268,1,0 +Mk1556=Stimulus,S 54,1237290,1,0 +Mk1557=Stimulus,S128,1237895,1,0 +Mk1558=Stimulus,S139,1237897,1,0 +Mk1559=Stimulus,S128,1237900,1,0 +Mk1560=Stimulus,S 53,1238908,1,0 +Mk1561=Stimulus,S139,1239664,1,0 +Mk1562=Stimulus,S128,1239667,1,0 +Mk1563=Stimulus,S 52,1240749,1,0 +Mk1564=Stimulus,S 11,1241346,1,0 +Mk1565=Stimulus,S139,1241348,1,0 +Mk1566=Stimulus,S128,1241349,1,0 +Mk1567=Stimulus,S 51,1242758,1,0 +Mk1568=Stimulus,S 11,1243269,1,0 +Mk1569=Stimulus,S139,1243271,1,0 +Mk1570=Stimulus,S128,1243272,1,0 +Mk1571=Stimulus,S 51,1244312,1,0 +Mk1572=Stimulus,S 11,1244812,1,0 +Mk1573=Stimulus,S139,1244814,1,0 +Mk1574=Stimulus,S128,1244815,1,0 +Mk1575=Stimulus,S 54,1245970,1,0 +Mk1576=Stimulus,S128,1246612,1,0 +Mk1577=Stimulus,S139,1246614,1,0 +Mk1578=Stimulus,S128,1246617,1,0 +Mk1579=Stimulus,S128,1246648,1,0 +Mk1580=Stimulus,S 54,1247765,1,0 +Mk1581=Stimulus,S139,1248441,1,0 +Mk1582=Stimulus,S128,1248443,1,0 +Mk1583=Stimulus,S 53,1249404,1,0 +Mk1584=Stimulus,S128,1250091,1,0 +Mk1585=Stimulus,S139,1250092,1,0 +Mk1586=Stimulus,S128,1250095,1,0 +Mk1587=Stimulus,S 51,1251018,1,0 +Mk1588=Stimulus,S128,1251438,1,0 +Mk1589=Stimulus,S139,1251439,1,0 +Mk1590=Stimulus,S128,1251442,1,0 +Mk1591=Stimulus,S 51,1252942,1,0 +Mk1592=Stimulus,S 11,1253354,1,0 +Mk1593=Stimulus,S139,1253355,1,0 +Mk1594=Stimulus,S128,1253356,1,0 +Mk1595=Stimulus,S 52,1254492,1,0 +Mk1596=Stimulus,S128,1255071,1,0 +Mk1597=Stimulus,S139,1255075,1,0 +Mk1598=Stimulus,S128,1255077,1,0 +Mk1599=Stimulus,S128,1255107,1,0 +Mk1600=Stimulus,S 54,1256457,1,0 +Mk1601=Stimulus,S128,1256901,1,0 +Mk1602=Stimulus,S139,1256902,1,0 +Mk1603=Stimulus,S128,1256905,1,0 +Mk1604=Stimulus,S128,1256937,1,0 +Mk1605=Stimulus,S 53,1258144,1,0 +Mk1606=Stimulus,S128,1258825,1,0 +Mk1607=Stimulus,S139,1258827,1,0 +Mk1608=Stimulus,S128,1258830,1,0 +Mk1609=Stimulus,S 53,1259748,1,0 +Mk1610=Stimulus,S128,1260372,1,0 +Mk1611=Stimulus,S139,1260376,1,0 +Mk1612=Stimulus,S128,1260379,1,0 +Mk1613=Stimulus,S 43,1292019,1,0 +Mk1614=Stimulus,S128,1292364,1,0 +Mk1615=Stimulus,S139,1292367,1,0 +Mk1616=Stimulus,S128,1292370,1,0 +Mk1617=Stimulus,S 41,1293785,1,0 +Mk1618=Stimulus,S128,1294257,1,0 +Mk1619=Stimulus,S139,1294260,1,0 +Mk1620=Stimulus,S128,1294263,1,0 +Mk1621=Stimulus,S 43,1295533,1,0 +Mk1622=Stimulus,S128,1295877,1,0 +Mk1623=Stimulus,S139,1295881,1,0 +Mk1624=Stimulus,S128,1295885,1,0 +Mk1625=Stimulus,S 42,1297336,1,0 +Mk1626=Stimulus,S128,1297630,1,0 +Mk1627=Stimulus,S140,1297634,1,0 +Mk1628=Stimulus,S128,1297637,1,0 +Mk1629=Stimulus,S128,1297655,1,0 +Mk1630=Stimulus,S128,1297836,1,0 +Mk1631=Stimulus,S 42,1299338,1,0 +Mk1632=Stimulus,S128,1300036,1,0 +Mk1633=Stimulus,S139,1300039,1,0 +Mk1634=Stimulus,S128,1300042,1,0 +Mk1635=Stimulus,S 42,1301068,1,0 +Mk1636=Stimulus,S128,1301646,1,0 +Mk1637=Stimulus,S139,1301650,1,0 +Mk1638=Stimulus,S128,1301652,1,0 +Mk1639=Stimulus,S 21,1302203,1,0 +Mk1640=Stimulus,S 44,1302607,1,0 +Mk1641=Stimulus,S128,1303022,1,0 +Mk1642=Stimulus,S139,1303023,1,0 +Mk1643=Stimulus,S128,1303026,1,0 +Mk1644=Stimulus,S 42,1304375,1,0 +Mk1645=Stimulus,S128,1304689,1,0 +Mk1646=Stimulus,S139,1304692,1,0 +Mk1647=Stimulus,S128,1304694,1,0 +Mk1648=Stimulus,S128,1304728,1,0 +Mk1649=Stimulus,S 42,1306182,1,0 +Mk1650=Stimulus,S 11,1306549,1,0 +Mk1651=Stimulus,S128,1306550,1,0 +Mk1652=Stimulus,S128,1306589,1,0 +Mk1653=Stimulus,S 42,1308021,1,0 +Mk1654=Stimulus,S128,1308353,1,0 +Mk1655=Stimulus,S139,1308354,1,0 +Mk1656=Stimulus,S128,1308357,1,0 +Mk1657=Stimulus,S 44,1309579,1,0 +Mk1658=Stimulus,S139,1310036,1,0 +Mk1659=Stimulus,S128,1310039,1,0 +Mk1660=Stimulus,S 43,1311411,1,0 +Mk1661=Stimulus,S128,1312172,1,0 +Mk1662=Stimulus,S139,1312173,1,0 +Mk1663=Stimulus,S128,1312176,1,0 +Mk1664=Stimulus,S 42,1312953,1,0 +Mk1665=Stimulus,S128,1313638,1,0 +Mk1666=Stimulus,S139,1313641,1,0 +Mk1667=Stimulus,S128,1313644,1,0 +Mk1668=Stimulus,S 42,1314743,1,0 +Mk1669=Stimulus,S128,1315225,1,0 +Mk1670=Stimulus,S139,1315228,1,0 +Mk1671=Stimulus,S128,1315231,1,0 +Mk1672=Stimulus,S 21,1315695,1,0 +Mk1673=Stimulus,S 44,1316354,1,0 +Mk1674=Stimulus,S 11,1316960,1,0 +Mk1675=Stimulus,S139,1316961,1,0 +Mk1676=Stimulus,S128,1316963,1,0 +Mk1677=Stimulus,S128,1317013,1,0 +Mk1678=Stimulus,S 43,1318088,1,0 +Mk1679=Stimulus,S128,1318818,1,0 +Mk1680=Stimulus,S139,1318819,1,0 +Mk1681=Stimulus,S128,1318822,1,0 +Mk1682=Stimulus,S 44,1319679,1,0 +Mk1683=Stimulus,S128,1320348,1,0 +Mk1684=Stimulus,S139,1320349,1,0 +Mk1685=Stimulus,S128,1320351,1,0 +Mk1686=Stimulus,S 41,1321513,1,0 +Mk1687=Stimulus,S 11,1322013,1,0 +Mk1688=Stimulus,S128,1322016,1,0 +Mk1689=Stimulus,S 44,1323281,1,0 +Mk1690=Stimulus,S139,1323687,1,0 +Mk1691=Stimulus,S128,1323690,1,0 +Mk1692=Stimulus,S128,1323939,1,0 +Mk1693=Stimulus,S 41,1325282,1,0 +Mk1694=Stimulus,S128,1325914,1,0 +Mk1695=Stimulus,S139,1325915,1,0 +Mk1696=Stimulus,S128,1325918,1,0 +Mk1697=Stimulus,S 43,1327084,1,0 +Mk1698=Stimulus,S128,1327615,1,0 +Mk1699=Stimulus,S139,1327619,1,0 +Mk1700=Stimulus,S128,1327622,1,0 +Mk1701=Stimulus,S 41,1328626,1,0 +Mk1702=Stimulus,S139,1329272,1,0 +Mk1703=Stimulus,S128,1329275,1,0 +Mk1704=Stimulus,S 41,1330309,1,0 +Mk1705=Stimulus,S139,1330989,1,0 +Mk1706=Stimulus,S128,1330992,1,0 +Mk1707=Stimulus,S 41,1331842,1,0 +Mk1708=Stimulus,S128,1332588,1,0 +Mk1709=Stimulus,S139,1332590,1,0 +Mk1710=Stimulus,S128,1332593,1,0 +Mk1711=Stimulus,S 43,1333401,1,0 +Mk1712=Stimulus,S128,1334098,1,0 +Mk1713=Stimulus,S139,1334101,1,0 +Mk1714=Stimulus,S128,1334105,1,0 +Mk1715=Stimulus,S 44,1335362,1,0 +Mk1716=Stimulus,S128,1336085,1,0 +Mk1717=Stimulus,S139,1336086,1,0 +Mk1718=Stimulus,S128,1336089,1,0 +Mk1719=Stimulus,S 43,1337091,1,0 +Mk1720=Stimulus,S139,1337676,1,0 +Mk1721=Stimulus,S128,1337679,1,0 +Mk1722=Stimulus,S 42,1339015,1,0 +Mk1723=Stimulus,S128,1339646,1,0 +Mk1724=Stimulus,S139,1339647,1,0 +Mk1725=Stimulus,S128,1339650,1,0 +Mk1726=Stimulus,S 44,1340824,1,0 +Mk1727=Stimulus,S128,1341544,1,0 +Mk1728=Stimulus,S139,1341548,1,0 +Mk1729=Stimulus,S128,1341551,1,0 +Mk1730=Stimulus,S 44,1342717,1,0 +Mk1731=Stimulus,S 11,1343308,1,0 +Mk1732=Stimulus,S128,1343311,1,0 +Mk1733=Stimulus,S 41,1344665,1,0 +Mk1734=Stimulus,S 11,1345314,1,0 +Mk1735=Stimulus,S139,1345315,1,0 +Mk1736=Stimulus,S128,1345316,1,0 +Mk1737=Stimulus,S 41,1346211,1,0 +Mk1738=Stimulus,S128,1346776,1,0 +Mk1739=Stimulus,S139,1346777,1,0 +Mk1740=Stimulus,S128,1346779,1,0 +Mk1741=Stimulus,S 43,1347940,1,0 +Mk1742=Stimulus,S 11,1348414,1,0 +Mk1743=Stimulus,S139,1348415,1,0 +Mk1744=Stimulus,S128,1348417,1,0 +Mk1745=Stimulus,S128,1348448,1,0 +Mk1746=Stimulus,S 42,1349929,1,0 +Mk1747=Stimulus,S128,1350554,1,0 +Mk1748=Stimulus,S139,1350557,1,0 +Mk1749=Stimulus,S128,1350560,1,0 +Mk1750=Stimulus,S 41,1351804,1,0 +Mk1751=Stimulus,S 11,1352229,1,0 +Mk1752=Stimulus,S139,1352231,1,0 +Mk1753=Stimulus,S128,1352232,1,0 +Mk1754=Stimulus,S 44,1353782,1,0 +Mk1755=Stimulus,S128,1354134,1,0 +Mk1756=Stimulus,S139,1354137,1,0 +Mk1757=Stimulus,S128,1354140,1,0 +Mk1758=Stimulus,S 43,1355495,1,0 +Mk1759=Stimulus,S128,1355907,1,0 +Mk1760=Stimulus,S139,1355910,1,0 +Mk1761=Stimulus,S128,1355913,1,0 +Mk1762=Stimulus,S 41,1357468,1,0 +Mk1763=Stimulus,S139,1358123,1,0 +Mk1764=Stimulus,S128,1358126,1,0 +Mk1765=Stimulus,S128,1358155,1,0 +Mk1766=Stimulus,S 43,1359371,1,0 +Mk1767=Stimulus,S128,1359913,1,0 +Mk1768=Stimulus,S139,1359914,1,0 +Mk1769=Stimulus,S128,1359917,1,0 +Mk1770=Stimulus,S 44,1361198,1,0 +Mk1771=Stimulus,S139,1361830,1,0 +Mk1772=Stimulus,S128,1361833,1,0 +Mk1773=Stimulus,S 43,1390270,1,0 +Mk1774=Stimulus,S 11,1390798,1,0 +Mk1775=Stimulus,S128,1390801,1,0 +Mk1776=Stimulus,S 44,1392295,1,0 +Mk1777=Stimulus,S128,1393026,1,0 +Mk1778=Stimulus,S139,1393028,1,0 +Mk1779=Stimulus,S128,1393031,1,0 +Mk1780=Stimulus,S 44,1393882,1,0 +Mk1781=Stimulus,S 11,1394526,1,0 +Mk1782=Stimulus,S139,1394527,1,0 +Mk1783=Stimulus,S128,1394529,1,0 +Mk1784=Stimulus,S128,1394563,1,0 +Mk1785=Stimulus,S 21,1394904,1,0 +Mk1786=Stimulus,S 42,1395764,1,0 +Mk1787=Stimulus,S128,1396074,1,0 +Mk1788=Stimulus,S139,1396076,1,0 +Mk1789=Stimulus,S128,1396079,1,0 +Mk1790=Stimulus,S 21,1396440,1,0 +Mk1791=Stimulus,S 21,1396513,1,0 +Mk1792=Stimulus,S 42,1397664,1,0 +Mk1793=Stimulus,S128,1398058,1,0 +Mk1794=Stimulus,S139,1398059,1,0 +Mk1795=Stimulus,S128,1398061,1,0 +Mk1796=Stimulus,S 44,1399471,1,0 +Mk1797=Stimulus,S128,1399902,1,0 +Mk1798=Stimulus,S139,1399904,1,0 +Mk1799=Stimulus,S128,1399907,1,0 +Mk1800=Stimulus,S128,1399938,1,0 +Mk1801=Stimulus,S 21,1400335,1,0 +Mk1802=Stimulus,S 43,1401439,1,0 +Mk1803=Stimulus,S 12,1401994,1,0 +Mk1804=Stimulus,S128,1401996,1,0 +Mk1805=Stimulus,S 44,1403332,1,0 +Mk1806=Stimulus,S128,1404115,1,0 +Mk1807=Stimulus,S139,1404117,1,0 +Mk1808=Stimulus,S128,1404120,1,0 +Mk1809=Stimulus,S 41,1405201,1,0 +Mk1810=Stimulus,S139,1405646,1,0 +Mk1811=Stimulus,S128,1405649,1,0 +Mk1812=Stimulus,S128,1405680,1,0 +Mk1813=Stimulus,S 42,1406766,1,0 +Mk1814=Stimulus,S128,1407241,1,0 +Mk1815=Stimulus,S139,1407242,1,0 +Mk1816=Stimulus,S128,1407245,1,0 +Mk1817=Stimulus,S 42,1408382,1,0 +Mk1818=Stimulus,S128,1408831,1,0 +Mk1819=Stimulus,S139,1408834,1,0 +Mk1820=Stimulus,S128,1408836,1,0 +Mk1821=Stimulus,S 43,1410295,1,0 +Mk1822=Stimulus,S139,1410798,1,0 +Mk1823=Stimulus,S128,1410801,1,0 +Mk1824=Stimulus,S 42,1412017,1,0 +Mk1825=Stimulus,S128,1412525,1,0 +Mk1826=Stimulus,S139,1412526,1,0 +Mk1827=Stimulus,S128,1412529,1,0 +Mk1828=Stimulus,S 41,1413746,1,0 +Mk1829=Stimulus,S128,1414306,1,0 +Mk1830=Stimulus,S139,1414308,1,0 +Mk1831=Stimulus,S128,1414311,1,0 +Mk1832=Stimulus,S 43,1415623,1,0 +Mk1833=Stimulus,S 11,1416174,1,0 +Mk1834=Stimulus,S139,1416176,1,0 +Mk1835=Stimulus,S128,1416177,1,0 +Mk1836=Stimulus,S 44,1417452,1,0 +Mk1837=Stimulus,S128,1417961,1,0 +Mk1838=Stimulus,S139,1417964,1,0 +Mk1839=Stimulus,S128,1417967,1,0 +Mk1840=Stimulus,S 44,1419383,1,0 +Mk1841=Stimulus,S128,1419886,1,0 +Mk1842=Stimulus,S139,1419889,1,0 +Mk1843=Stimulus,S128,1419892,1,0 +Mk1844=Stimulus,S 44,1421280,1,0 +Mk1845=Stimulus,S128,1421661,1,0 +Mk1846=Stimulus,S139,1421664,1,0 +Mk1847=Stimulus,S128,1421666,1,0 +Mk1848=Stimulus,S 43,1423179,1,0 +Mk1849=Stimulus,S139,1423943,1,0 +Mk1850=Stimulus,S128,1423947,1,0 +Mk1851=Stimulus,S 43,1425142,1,0 +Mk1852=Stimulus,S128,1425659,1,0 +Mk1853=Stimulus,S139,1425660,1,0 +Mk1854=Stimulus,S128,1425662,1,0 +Mk1855=Stimulus,S 42,1427122,1,0 +Mk1856=Stimulus,S128,1427825,1,0 +Mk1857=Stimulus,S139,1427828,1,0 +Mk1858=Stimulus,S128,1427831,1,0 +Mk1859=Stimulus,S 44,1428961,1,0 +Mk1860=Stimulus,S128,1429541,1,0 +Mk1861=Stimulus,S139,1429543,1,0 +Mk1862=Stimulus,S128,1429546,1,0 +Mk1863=Stimulus,S 41,1430944,1,0 +Mk1864=Stimulus,S 11,1431559,1,0 +Mk1865=Stimulus,S139,1431560,1,0 +Mk1866=Stimulus,S128,1431561,1,0 +Mk1867=Stimulus,S 42,1432534,1,0 +Mk1868=Stimulus,S128,1433085,1,0 +Mk1869=Stimulus,S139,1433087,1,0 +Mk1870=Stimulus,S128,1433090,1,0 +Mk1871=Stimulus,S 41,1434523,1,0 +Mk1872=Stimulus,S128,1435113,1,0 +Mk1873=Stimulus,S139,1435115,1,0 +Mk1874=Stimulus,S128,1435117,1,0 +Mk1875=Stimulus,S 41,1436155,1,0 +Mk1876=Stimulus,S128,1436722,1,0 +Mk1877=Stimulus,S139,1436725,1,0 +Mk1878=Stimulus,S128,1436728,1,0 +Mk1879=Stimulus,S 41,1438058,1,0 +Mk1880=Stimulus,S139,1438452,1,0 +Mk1881=Stimulus,S128,1438455,1,0 +Mk1882=Stimulus,S 43,1439756,1,0 +Mk1883=Stimulus,S 11,1440207,1,0 +Mk1884=Stimulus,S139,1440208,1,0 +Mk1885=Stimulus,S128,1440209,1,0 +Mk1886=Stimulus,S 41,1441316,1,0 +Mk1887=Stimulus,S128,1441843,1,0 +Mk1888=Stimulus,S139,1441846,1,0 +Mk1889=Stimulus,S128,1441849,1,0 +Mk1890=Stimulus,S 44,1443161,1,0 +Mk1891=Stimulus,S128,1443803,1,0 +Mk1892=Stimulus,S139,1443806,1,0 +Mk1893=Stimulus,S128,1443809,1,0 +Mk1894=Stimulus,S 41,1444896,1,0 +Mk1895=Stimulus,S139,1445414,1,0 +Mk1896=Stimulus,S128,1445417,1,0 +Mk1897=Stimulus,S 42,1446692,1,0 +Mk1898=Stimulus,S128,1447142,1,0 +Mk1899=Stimulus,S139,1447143,1,0 +Mk1900=Stimulus,S128,1447146,1,0 +Mk1901=Stimulus,S 42,1448277,1,0 +Mk1902=Stimulus,S 11,1449010,1,0 +Mk1903=Stimulus,S139,1449011,1,0 +Mk1904=Stimulus,S128,1449013,1,0 +Mk1905=Stimulus,S 44,1450094,1,0 +Mk1906=Stimulus,S128,1450613,1,0 +Mk1907=Stimulus,S139,1450615,1,0 +Mk1908=Stimulus,S128,1450617,1,0 +Mk1909=Stimulus,S 42,1451732,1,0 +Mk1910=Stimulus,S128,1452157,1,0 +Mk1911=Stimulus,S139,1452158,1,0 +Mk1912=Stimulus,S128,1452161,1,0 +Mk1913=Stimulus,S 43,1453492,1,0 +Mk1914=Stimulus,S128,1454153,1,0 +Mk1915=Stimulus,S139,1454156,1,0 +Mk1916=Stimulus,S128,1454159,1,0 +Mk1917=Stimulus,S 41,1455075,1,0 +Mk1918=Stimulus,S128,1455736,1,0 +Mk1919=Stimulus,S139,1455737,1,0 +Mk1920=Stimulus,S128,1455740,1,0 +Mk1921=Stimulus,S 41,1456980,1,0 +Mk1922=Stimulus,S 11,1457541,1,0 +Mk1923=Stimulus,S139,1457543,1,0 +Mk1924=Stimulus,S128,1457544,1,0 +Mk1925=Stimulus,S 43,1458843,1,0 +Mk1926=Stimulus,S128,1459283,1,0 +Mk1927=Stimulus,S139,1459286,1,0 +Mk1928=Stimulus,S128,1459288,1,0 +Mk1929=Stimulus,S 43,1460837,1,0 +Mk1930=Stimulus,S 11,1461312,1,0 +Mk1931=Stimulus,S128,1461315,1,0 +Mk1932=Stimulus,S 42,1478519,1,0 +Mk1933=Stimulus,S128,1479291,1,0 +Mk1934=Stimulus,S139,1479297,1,0 +Mk1935=Stimulus,S128,1479300,1,0 +Mk1936=Stimulus,S 42,1480469,1,0 +Mk1937=Stimulus,S 11,1480914,1,0 +Mk1938=Stimulus,S128,1480917,1,0 +Mk1939=Stimulus,S 41,1482071,1,0 +Mk1940=Stimulus,S 11,1482766,1,0 +Mk1941=Stimulus,S139,1482768,1,0 +Mk1942=Stimulus,S128,1482769,1,0 +Mk1943=Stimulus,S 44,1483802,1,0 +Mk1944=Stimulus,S 11,1484275,1,0 +Mk1945=Stimulus,S139,1484277,1,0 +Mk1946=Stimulus,S128,1484278,1,0 +Mk1947=Stimulus,S 44,1485773,1,0 +Mk1948=Stimulus,S128,1486329,1,0 +Mk1949=Stimulus,S139,1486333,1,0 +Mk1950=Stimulus,S128,1486336,1,0 +Mk1951=Stimulus,S 44,1487308,1,0 +Mk1952=Stimulus,S128,1487905,1,0 +Mk1953=Stimulus,S139,1487908,1,0 +Mk1954=Stimulus,S128,1487910,1,0 +Mk1955=Stimulus,S128,1487941,1,0 +Mk1956=Stimulus,S 43,1489107,1,0 +Mk1957=Stimulus,S 11,1489731,1,0 +Mk1958=Stimulus,S139,1489732,1,0 +Mk1959=Stimulus,S128,1489733,1,0 +Mk1960=Stimulus,S 42,1490893,1,0 +Mk1961=Stimulus,S128,1491428,1,0 +Mk1962=Stimulus,S140,1491430,1,0 +Mk1963=Stimulus,S128,1491433,1,0 +Mk1964=Stimulus,S 42,1492545,1,0 +Mk1965=Stimulus,S128,1493174,1,0 +Mk1966=Stimulus,S139,1493175,1,0 +Mk1967=Stimulus,S128,1493178,1,0 +Mk1968=Stimulus,S 43,1494184,1,0 +Mk1969=Stimulus,S128,1494617,1,0 +Mk1970=Stimulus,S139,1494618,1,0 +Mk1971=Stimulus,S128,1494620,1,0 +Mk1972=Stimulus,S 41,1496084,1,0 +Mk1973=Stimulus,S 11,1496605,1,0 +Mk1974=Stimulus,S139,1496606,1,0 +Mk1975=Stimulus,S128,1496607,1,0 +Mk1976=Stimulus,S 42,1497889,1,0 +Mk1977=Stimulus,S128,1498634,1,0 +Mk1978=Stimulus,S139,1498635,1,0 +Mk1979=Stimulus,S128,1498637,1,0 +Mk1980=Stimulus,S 42,1499719,1,0 +Mk1981=Stimulus,S128,1500419,1,0 +Mk1982=Stimulus,S140,1500420,1,0 +Mk1983=Stimulus,S128,1500423,1,0 +Mk1984=Stimulus,S 43,1501382,1,0 +Mk1985=Stimulus,S128,1502051,1,0 +Mk1986=Stimulus,S139,1502053,1,0 +Mk1987=Stimulus,S128,1502055,1,0 +Mk1988=Stimulus,S 43,1503319,1,0 +Mk1989=Stimulus,S 11,1503683,1,0 +Mk1990=Stimulus,S139,1503685,1,0 +Mk1991=Stimulus,S128,1503686,1,0 +Mk1992=Stimulus,S 41,1505192,1,0 +Mk1993=Stimulus,S 11,1505498,1,0 +Mk1994=Stimulus,S139,1505500,1,0 +Mk1995=Stimulus,S128,1505501,1,0 +Mk1996=Stimulus,S 44,1506998,1,0 +Mk1997=Stimulus,S 11,1507782,1,0 +Mk1998=Stimulus,S139,1507783,1,0 +Mk1999=Stimulus,S128,1507785,1,0 +Mk2000=Stimulus,S 44,1508910,1,0 +Mk2001=Stimulus,S128,1509503,1,0 +Mk2002=Stimulus,S139,1509507,1,0 +Mk2003=Stimulus,S128,1509509,1,0 +Mk2004=Stimulus,S 42,1510610,1,0 +Mk2005=Stimulus,S128,1511567,1,0 +Mk2006=Stimulus,S139,1511571,1,0 +Mk2007=Stimulus,S128,1511574,1,0 +Mk2008=Stimulus,S 43,1512201,1,0 +Mk2009=Stimulus,S139,1512878,1,0 +Mk2010=Stimulus,S128,1512880,1,0 +Mk2011=Stimulus,S 44,1514016,1,0 +Mk2012=Stimulus,S128,1514512,1,0 +Mk2013=Stimulus,S139,1514514,1,0 +Mk2014=Stimulus,S128,1514517,1,0 +Mk2015=Stimulus,S 43,1515622,1,0 +Mk2016=Stimulus,S139,1516122,1,0 +Mk2017=Stimulus,S128,1516125,1,0 +Mk2018=Stimulus,S 43,1517511,1,0 +Mk2019=Stimulus,S128,1518171,1,0 +Mk2020=Stimulus,S139,1518173,1,0 +Mk2021=Stimulus,S128,1518176,1,0 +Mk2022=Stimulus,S 42,1519067,1,0 +Mk2023=Stimulus,S128,1519996,1,0 +Mk2024=Stimulus,S139,1519998,1,0 +Mk2025=Stimulus,S128,1520000,1,0 +Mk2026=Stimulus,S 41,1520851,1,0 +Mk2027=Stimulus,S128,1521496,1,0 +Mk2028=Stimulus,S139,1521497,1,0 +Mk2029=Stimulus,S128,1521499,1,0 +Mk2030=Stimulus,S 41,1522586,1,0 +Mk2031=Stimulus,S 11,1523294,1,0 +Mk2032=Stimulus,S139,1523295,1,0 +Mk2033=Stimulus,S128,1523296,1,0 +Mk2034=Stimulus,S 21,1523672,1,0 +Mk2035=Stimulus,S 21,1523763,1,0 +Mk2036=Stimulus,S 43,1524519,1,0 +Mk2037=Stimulus,S128,1524963,1,0 +Mk2038=Stimulus,S139,1524965,1,0 +Mk2039=Stimulus,S128,1524968,1,0 +Mk2040=Stimulus,S 41,1526213,1,0 +Mk2041=Stimulus,S128,1526761,1,0 +Mk2042=Stimulus,S139,1526765,1,0 +Mk2043=Stimulus,S128,1526768,1,0 +Mk2044=Stimulus,S 43,1528158,1,0 +Mk2045=Stimulus,S 11,1528786,1,0 +Mk2046=Stimulus,S139,1528787,1,0 +Mk2047=Stimulus,S128,1528789,1,0 +Mk2048=Stimulus,S 44,1530058,1,0 +Mk2049=Stimulus,S128,1530892,1,0 +Mk2050=Stimulus,S139,1530895,1,0 +Mk2051=Stimulus,S128,1530898,1,0 +Mk2052=Stimulus,S 42,1532024,1,0 +Mk2053=Stimulus,S128,1532801,1,0 +Mk2054=Stimulus,S139,1532802,1,0 +Mk2055=Stimulus,S128,1532805,1,0 +Mk2056=Stimulus,S 41,1533784,1,0 +Mk2057=Stimulus,S 11,1534429,1,0 +Mk2058=Stimulus,S128,1534433,1,0 +Mk2059=Stimulus,S 41,1535369,1,0 +Mk2060=Stimulus,S139,1536220,1,0 +Mk2061=Stimulus,S128,1536223,1,0 +Mk2062=Stimulus,S 44,1537013,1,0 +Mk2063=Stimulus,S128,1537935,1,0 +Mk2064=Stimulus,S139,1537937,1,0 +Mk2065=Stimulus,S128,1537940,1,0 +Mk2066=Stimulus,S 42,1538791,1,0 +Mk2067=Stimulus,S139,1539698,1,0 +Mk2068=Stimulus,S128,1539701,1,0 +Mk2069=Stimulus,S 41,1540363,1,0 +Mk2070=Stimulus,S 11,1541147,1,0 +Mk2071=Stimulus,S139,1541149,1,0 +Mk2072=Stimulus,S128,1541150,1,0 +Mk2073=Stimulus,S 41,1542085,1,0 +Mk2074=Stimulus,S128,1542886,1,0 +Mk2075=Stimulus,S139,1542889,1,0 +Mk2076=Stimulus,S128,1542891,1,0 +Mk2077=Stimulus,S 43,1543932,1,0 +Mk2078=Stimulus,S 11,1544610,1,0 +Mk2079=Stimulus,S139,1544611,1,0 +Mk2080=Stimulus,S128,1544613,1,0 +Mk2081=Stimulus,S 44,1545518,1,0 +Mk2082=Stimulus,S128,1546454,1,0 +Mk2083=Stimulus,S139,1546458,1,0 +Mk2084=Stimulus,S128,1546461,1,0 +Mk2085=Stimulus,S 44,1547045,1,0 +Mk2086=Stimulus,S128,1547969,1,0 +Mk2087=Stimulus,S139,1547970,1,0 +Mk2088=Stimulus,S128,1547973,1,0 +Mk2089=Stimulus,S128,1548005,1,0 +Mk2090=Stimulus,S 42,1564261,1,0 +Mk2091=Stimulus,S128,1564976,1,0 +Mk2092=Stimulus,S139,1564977,1,0 +Mk2093=Stimulus,S128,1564980,1,0 +Mk2094=Stimulus,S 42,1566237,1,0 +Mk2095=Stimulus,S128,1566802,1,0 +Mk2096=Stimulus,S139,1566807,1,0 +Mk2097=Stimulus,S128,1566810,1,0 +Mk2098=Stimulus,S128,1566841,1,0 +Mk2099=Stimulus,S 42,1567910,1,0 +Mk2100=Stimulus,S128,1568427,1,0 +Mk2101=Stimulus,S139,1568432,1,0 +Mk2102=Stimulus,S128,1568435,1,0 +Mk2103=Stimulus,S128,1568465,1,0 +Mk2104=Stimulus,S128,1568481,1,0 +Mk2105=Stimulus,S 43,1569573,1,0 +Mk2106=Stimulus,S128,1570193,1,0 +Mk2107=Stimulus,S139,1570194,1,0 +Mk2108=Stimulus,S128,1570197,1,0 +Mk2109=Stimulus,S 43,1571340,1,0 +Mk2110=Stimulus,S128,1571951,1,0 +Mk2111=Stimulus,S139,1571953,1,0 +Mk2112=Stimulus,S128,1571956,1,0 +Mk2113=Stimulus,S128,1571993,1,0 +Mk2114=Stimulus,S 44,1573093,1,0 +Mk2115=Stimulus,S128,1573808,1,0 +Mk2116=Stimulus,S139,1573811,1,0 +Mk2117=Stimulus,S128,1573814,1,0 +Mk2118=Stimulus,S128,1573844,1,0 +Mk2119=Stimulus,S 42,1574860,1,0 +Mk2120=Stimulus,S128,1575588,1,0 +Mk2121=Stimulus,S139,1575590,1,0 +Mk2122=Stimulus,S128,1575593,1,0 +Mk2123=Stimulus,S 43,1576655,1,0 +Mk2124=Stimulus,S128,1577303,1,0 +Mk2125=Stimulus,S139,1577307,1,0 +Mk2126=Stimulus,S128,1577310,1,0 +Mk2127=Stimulus,S128,1577459,1,0 +Mk2128=Stimulus,S 44,1578585,1,0 +Mk2129=Stimulus,S128,1579196,1,0 +Mk2130=Stimulus,S139,1579200,1,0 +Mk2131=Stimulus,S128,1579203,1,0 +Mk2132=Stimulus,S 44,1580588,1,0 +Mk2133=Stimulus,S139,1581337,1,0 +Mk2134=Stimulus,S128,1581340,1,0 +Mk2135=Stimulus,S 41,1582530,1,0 +Mk2136=Stimulus,S 11,1583194,1,0 +Mk2137=Stimulus,S128,1583197,1,0 +Mk2138=Stimulus,S 21,1583552,1,0 +Mk2139=Stimulus,S 41,1584492,1,0 +Mk2140=Stimulus,S 11,1585195,1,0 +Mk2141=Stimulus,S139,1585197,1,0 +Mk2142=Stimulus,S128,1585198,1,0 +Mk2143=Stimulus,S 42,1586467,1,0 +Mk2144=Stimulus,S128,1587034,1,0 +Mk2145=Stimulus,S139,1587037,1,0 +Mk2146=Stimulus,S128,1587040,1,0 +Mk2147=Stimulus,S 42,1588329,1,0 +Mk2148=Stimulus,S128,1589026,1,0 +Mk2149=Stimulus,S139,1589028,1,0 +Mk2150=Stimulus,S128,1589031,1,0 +Mk2151=Stimulus,S 43,1590119,1,0 +Mk2152=Stimulus,S128,1590821,1,0 +Mk2153=Stimulus,S139,1590822,1,0 +Mk2154=Stimulus,S128,1590825,1,0 +Mk2155=Stimulus,S 43,1591948,1,0 +Mk2156=Stimulus,S 11,1592641,1,0 +Mk2157=Stimulus,S139,1592642,1,0 +Mk2158=Stimulus,S128,1592644,1,0 +Mk2159=Stimulus,S 44,1593830,1,0 +Mk2160=Stimulus,S128,1594480,1,0 +Mk2161=Stimulus,S139,1594481,1,0 +Mk2162=Stimulus,S128,1594484,1,0 +Mk2163=Stimulus,S128,1594515,1,0 +Mk2164=Stimulus,S 41,1595528,1,0 +Mk2165=Stimulus,S128,1596070,1,0 +Mk2166=Stimulus,S139,1596071,1,0 +Mk2167=Stimulus,S128,1596074,1,0 +Mk2168=Stimulus,S 41,1597197,1,0 +Mk2169=Stimulus,S139,1597773,1,0 +Mk2170=Stimulus,S128,1597776,1,0 +Mk2171=Stimulus,S 43,1598913,1,0 +Mk2172=Stimulus,S 11,1599503,1,0 +Mk2173=Stimulus,S139,1599504,1,0 +Mk2174=Stimulus,S128,1599506,1,0 +Mk2175=Stimulus,S 41,1600788,1,0 +Mk2176=Stimulus,S128,1601268,1,0 +Mk2177=Stimulus,S139,1601273,1,0 +Mk2178=Stimulus,S128,1601276,1,0 +Mk2179=Stimulus,S 41,1602430,1,0 +Mk2180=Stimulus,S128,1602973,1,0 +Mk2181=Stimulus,S139,1602978,1,0 +Mk2182=Stimulus,S128,1602981,1,0 +Mk2183=Stimulus,S 42,1604403,1,0 +Mk2184=Stimulus,S128,1605056,1,0 +Mk2185=Stimulus,S139,1605059,1,0 +Mk2186=Stimulus,S128,1605063,1,0 +Mk2187=Stimulus,S128,1605093,1,0 +Mk2188=Stimulus,S 44,1606307,1,0 +Mk2189=Stimulus,S128,1606794,1,0 +Mk2190=Stimulus,S139,1606795,1,0 +Mk2191=Stimulus,S128,1606798,1,0 +Mk2192=Stimulus,S 43,1608000,1,0 +Mk2193=Stimulus,S128,1608566,1,0 +Mk2194=Stimulus,S139,1608570,1,0 +Mk2195=Stimulus,S128,1608573,1,0 +Mk2196=Stimulus,S 21,1608887,1,0 +Mk2197=Stimulus,S 42,1609584,1,0 +Mk2198=Stimulus,S139,1610618,1,0 +Mk2199=Stimulus,S128,1610621,1,0 +Mk2200=Stimulus,S 42,1611307,1,0 +Mk2201=Stimulus,S128,1612295,1,0 +Mk2202=Stimulus,S139,1612299,1,0 +Mk2203=Stimulus,S128,1612301,1,0 +Mk2204=Stimulus,S 41,1612975,1,0 +Mk2205=Stimulus,S128,1613787,1,0 +Mk2206=Stimulus,S139,1613788,1,0 +Mk2207=Stimulus,S128,1613790,1,0 +Mk2208=Stimulus,S128,1613845,1,0 +Mk2209=Stimulus,S 44,1614623,1,0 +Mk2210=Stimulus,S139,1615279,1,0 +Mk2211=Stimulus,S128,1615282,1,0 +Mk2212=Stimulus,S 41,1616171,1,0 +Mk2213=Stimulus,S 11,1616719,1,0 +Mk2214=Stimulus,S139,1616721,1,0 +Mk2215=Stimulus,S128,1616722,1,0 +Mk2216=Stimulus,S 42,1618179,1,0 +Mk2217=Stimulus,S128,1618743,1,0 +Mk2218=Stimulus,S139,1618745,1,0 +Mk2219=Stimulus,S128,1618748,1,0 +Mk2220=Stimulus,S 44,1620029,1,0 +Mk2221=Stimulus,S128,1620598,1,0 +Mk2222=Stimulus,S139,1620601,1,0 +Mk2223=Stimulus,S128,1620604,1,0 +Mk2224=Stimulus,S 43,1621965,1,0 +Mk2225=Stimulus,S128,1622666,1,0 +Mk2226=Stimulus,S139,1622669,1,0 +Mk2227=Stimulus,S128,1622672,1,0 +Mk2228=Stimulus,S 43,1623991,1,0 +Mk2229=Stimulus,S 11,1624430,1,0 +Mk2230=Stimulus,S139,1624431,1,0 +Mk2231=Stimulus,S128,1624433,1,0 +Mk2232=Stimulus,S 44,1625594,1,0 +Mk2233=Stimulus,S 11,1626337,1,0 +Mk2234=Stimulus,S139,1626338,1,0 +Mk2235=Stimulus,S128,1626340,1,0 +Mk2236=Stimulus,S 44,1627501,1,0 +Mk2237=Stimulus,S128,1628194,1,0 +Mk2238=Stimulus,S139,1628195,1,0 +Mk2239=Stimulus,S128,1628198,1,0 +Mk2240=Stimulus,S 44,1629317,1,0 +Mk2241=Stimulus,S139,1630020,1,0 +Mk2242=Stimulus,S128,1630024,1,0 +Mk2243=Stimulus,S 43,1631328,1,0 +Mk2244=Stimulus,S128,1631984,1,0 +Mk2245=Stimulus,S139,1631986,1,0 +Mk2246=Stimulus,S128,1631989,1,0 +Mk2247=Stimulus,S 41,1632973,1,0 +Mk2248=Stimulus,S139,1633842,1,0 +Mk2249=Stimulus,S128,1633845,1,0 +Mk2250=Stimulus,S 41,1634526,1,0 +Mk2251=Stimulus,S 11,1635560,1,0 +Mk2252=Stimulus,S139,1635561,1,0 +Mk2253=Stimulus,S128,1635563,1,0 +Mk2254=Stimulus,S 41,1653006,1,0 +Mk2255=Stimulus,S128,1653621,1,0 +Mk2256=Stimulus,S139,1653625,1,0 +Mk2257=Stimulus,S128,1653628,1,0 +Mk2258=Stimulus,S 21,1654013,1,0 +Mk2259=Stimulus,S 43,1654800,1,0 +Mk2260=Stimulus,S128,1655315,1,0 +Mk2261=Stimulus,S139,1655316,1,0 +Mk2262=Stimulus,S128,1655318,1,0 +Mk2263=Stimulus,S128,1655358,1,0 +Mk2264=Stimulus,S 42,1656631,1,0 +Mk2265=Stimulus,S128,1657288,1,0 +Mk2266=Stimulus,S139,1657294,1,0 +Mk2267=Stimulus,S128,1657297,1,0 +Mk2268=Stimulus,S 42,1658245,1,0 +Mk2269=Stimulus,S128,1659004,1,0 +Mk2270=Stimulus,S139,1659006,1,0 +Mk2271=Stimulus,S128,1659009,1,0 +Mk2272=Stimulus,S 41,1659828,1,0 +Mk2273=Stimulus,S128,1660622,1,0 +Mk2274=Stimulus,S139,1660623,1,0 +Mk2275=Stimulus,S128,1660625,1,0 +Mk2276=Stimulus,S 44,1661543,1,0 +Mk2277=Stimulus,S128,1662366,1,0 +Mk2278=Stimulus,S139,1662370,1,0 +Mk2279=Stimulus,S128,1662374,1,0 +Mk2280=Stimulus,S 44,1663139,1,0 +Mk2281=Stimulus,S 11,1664025,1,0 +Mk2282=Stimulus,S139,1664027,1,0 +Mk2283=Stimulus,S128,1664028,1,0 +Mk2284=Stimulus,S 42,1664790,1,0 +Mk2285=Stimulus,S128,1665568,1,0 +Mk2286=Stimulus,S139,1665569,1,0 +Mk2287=Stimulus,S128,1665571,1,0 +Mk2288=Stimulus,S 42,1666441,1,0 +Mk2289=Stimulus,S 11,1667391,1,0 +Mk2290=Stimulus,S128,1667393,1,0 +Mk2291=Stimulus,S 44,1668160,1,0 +Mk2292=Stimulus,S128,1668890,1,0 +Mk2293=Stimulus,S139,1668893,1,0 +Mk2294=Stimulus,S128,1668896,1,0 +Mk2295=Stimulus,S128,1669111,1,0 +Mk2296=Stimulus,S 44,1669984,1,0 +Mk2297=Stimulus,S128,1670553,1,0 +Mk2298=Stimulus,S139,1670555,1,0 +Mk2299=Stimulus,S128,1670558,1,0 +Mk2300=Stimulus,S 42,1671823,1,0 +Mk2301=Stimulus,S 11,1672298,1,0 +Mk2302=Stimulus,S139,1672299,1,0 +Mk2303=Stimulus,S128,1672302,1,0 +Mk2304=Stimulus,S 41,1673413,1,0 +Mk2305=Stimulus,S 11,1674053,1,0 +Mk2306=Stimulus,S128,1674056,1,0 +Mk2307=Stimulus,S 43,1675076,1,0 +Mk2308=Stimulus,S128,1675555,1,0 +Mk2309=Stimulus,S139,1675559,1,0 +Mk2310=Stimulus,S128,1675562,1,0 +Mk2311=Stimulus,S 44,1677104,1,0 +Mk2312=Stimulus,S128,1677788,1,0 +Mk2313=Stimulus,S139,1677792,1,0 +Mk2314=Stimulus,S128,1677795,1,0 +Mk2315=Stimulus,S 42,1678967,1,0 +Mk2316=Stimulus,S128,1679839,1,0 +Mk2317=Stimulus,S139,1679840,1,0 +Mk2318=Stimulus,S128,1679842,1,0 +Mk2319=Stimulus,S 41,1680930,1,0 +Mk2320=Stimulus,S128,1681564,1,0 +Mk2321=Stimulus,S139,1681567,1,0 +Mk2322=Stimulus,S128,1681570,1,0 +Mk2323=Stimulus,S 41,1682584,1,0 +Mk2324=Stimulus,S128,1683361,1,0 +Mk2325=Stimulus,S139,1683364,1,0 +Mk2326=Stimulus,S128,1683367,1,0 +Mk2327=Stimulus,S 42,1684539,1,0 +Mk2328=Stimulus,S128,1685208,1,0 +Mk2329=Stimulus,S139,1685209,1,0 +Mk2330=Stimulus,S128,1685211,1,0 +Mk2331=Stimulus,S 42,1686341,1,0 +Mk2332=Stimulus,S128,1686952,1,0 +Mk2333=Stimulus,S139,1686955,1,0 +Mk2334=Stimulus,S128,1686958,1,0 +Mk2335=Stimulus,S 41,1687953,1,0 +Mk2336=Stimulus,S128,1688714,1,0 +Mk2337=Stimulus,S139,1688715,1,0 +Mk2338=Stimulus,S128,1688718,1,0 +Mk2339=Stimulus,S 43,1689677,1,0 +Mk2340=Stimulus,S128,1690320,1,0 +Mk2341=Stimulus,S139,1690323,1,0 +Mk2342=Stimulus,S128,1690325,1,0 +Mk2343=Stimulus,S 43,1691687,1,0 +Mk2344=Stimulus,S128,1692140,1,0 +Mk2345=Stimulus,S139,1692142,1,0 +Mk2346=Stimulus,S128,1692144,1,0 +Mk2347=Stimulus,S 43,1693263,1,0 +Mk2348=Stimulus,S128,1693780,1,0 +Mk2349=Stimulus,S139,1693781,1,0 +Mk2350=Stimulus,S128,1693784,1,0 +Mk2351=Stimulus,S 42,1695047,1,0 +Mk2352=Stimulus,S128,1695848,1,0 +Mk2353=Stimulus,S139,1695851,1,0 +Mk2354=Stimulus,S128,1695853,1,0 +Mk2355=Stimulus,S128,1695884,1,0 +Mk2356=Stimulus,S 44,1696661,1,0 +Mk2357=Stimulus,S128,1697510,1,0 +Mk2358=Stimulus,S139,1697514,1,0 +Mk2359=Stimulus,S128,1697517,1,0 +Mk2360=Stimulus,S 41,1698296,1,0 +Mk2361=Stimulus,S 11,1699326,1,0 +Mk2362=Stimulus,S139,1699328,1,0 +Mk2363=Stimulus,S128,1699330,1,0 +Mk2364=Stimulus,S 44,1700107,1,0 +Mk2365=Stimulus,S139,1700801,1,0 +Mk2366=Stimulus,S128,1700805,1,0 +Mk2367=Stimulus,S 41,1701995,1,0 +Mk2368=Stimulus,S 11,1702753,1,0 +Mk2369=Stimulus,S128,1702755,1,0 +Mk2370=Stimulus,S 43,1703958,1,0 +Mk2371=Stimulus,S128,1704457,1,0 +Mk2372=Stimulus,S139,1704458,1,0 +Mk2373=Stimulus,S128,1704461,1,0 +Mk2374=Stimulus,S 43,1705937,1,0 +Mk2375=Stimulus,S139,1706279,1,0 +Mk2376=Stimulus,S128,1706281,1,0 +Mk2377=Stimulus,S 41,1707740,1,0 +Mk2378=Stimulus,S139,1708128,1,0 +Mk2379=Stimulus,S128,1708131,1,0 +Mk2380=Stimulus,S 43,1709327,1,0 +Mk2381=Stimulus,S 11,1709785,1,0 +Mk2382=Stimulus,S139,1709787,1,0 +Mk2383=Stimulus,S128,1709788,1,0 +Mk2384=Stimulus,S 44,1711300,1,0 +Mk2385=Stimulus,S 11,1711937,1,0 +Mk2386=Stimulus,S139,1711938,1,0 +Mk2387=Stimulus,S128,1711941,1,0 +Mk2388=Stimulus,S128,1711979,1,0 +Mk2389=Stimulus,S 42,1712863,1,0 +Mk2390=Stimulus,S128,1713488,1,0 +Mk2391=Stimulus,S139,1713491,1,0 +Mk2392=Stimulus,S128,1713494,1,0 +Mk2393=Stimulus,S 44,1714600,1,0 +Mk2394=Stimulus,S 11,1715361,1,0 +Mk2395=Stimulus,S139,1715362,1,0 +Mk2396=Stimulus,S128,1715364,1,0 +Mk2397=Stimulus,S 43,1716566,1,0 +Mk2398=Stimulus,S128,1717345,1,0 +Mk2399=Stimulus,S139,1717346,1,0 +Mk2400=Stimulus,S128,1717349,1,0 +Mk2401=Stimulus,S 41,1718455,1,0 +Mk2402=Stimulus,S128,1718902,1,0 +Mk2403=Stimulus,S139,1718904,1,0 +Mk2404=Stimulus,S128,1718906,1,0 +Mk2405=Stimulus,S 43,1720267,1,0 +Mk2406=Stimulus,S 11,1720646,1,0 +Mk2407=Stimulus,S139,1720647,1,0 +Mk2408=Stimulus,S128,1720649,1,0 +Mk2409=Stimulus,S 44,1721882,1,0 +Mk2410=Stimulus,S128,1722579,1,0 +Mk2411=Stimulus,S139,1722583,1,0 +Mk2412=Stimulus,S128,1722586,1,0 +Mk2413=Stimulus,S 42,1738354,1,0 +Mk2414=Stimulus,S128,1738987,1,0 +Mk2415=Stimulus,S139,1738990,1,0 +Mk2416=Stimulus,S128,1738992,1,0 +Mk2417=Stimulus,S128,1739022,1,0 +Mk2418=Stimulus,S 42,1740378,1,0 +Mk2419=Stimulus,S139,1740847,1,0 +Mk2420=Stimulus,S128,1740849,1,0 +Mk2421=Stimulus,S 43,1742010,1,0 +Mk2422=Stimulus,S 11,1742763,1,0 +Mk2423=Stimulus,S139,1742765,1,0 +Mk2424=Stimulus,S128,1742766,1,0 +Mk2425=Stimulus,S 44,1743672,1,0 +Mk2426=Stimulus,S139,1744295,1,0 +Mk2427=Stimulus,S128,1744298,1,0 +Mk2428=Stimulus,S 43,1745526,1,0 +Mk2429=Stimulus,S128,1746041,1,0 +Mk2430=Stimulus,S139,1746042,1,0 +Mk2431=Stimulus,S128,1746045,1,0 +Mk2432=Stimulus,S128,1746080,1,0 +Mk2433=Stimulus,S 43,1747230,1,0 +Mk2434=Stimulus,S128,1748030,1,0 +Mk2435=Stimulus,S139,1748032,1,0 +Mk2436=Stimulus,S128,1748034,1,0 +Mk2437=Stimulus,S128,1748071,1,0 +Mk2438=Stimulus,S 44,1748783,1,0 +Mk2439=Stimulus,S128,1749536,1,0 +Mk2440=Stimulus,S139,1749538,1,0 +Mk2441=Stimulus,S128,1749540,1,0 +Mk2442=Stimulus,S 44,1750732,1,0 +Mk2443=Stimulus,S128,1751313,1,0 +Mk2444=Stimulus,S139,1751314,1,0 +Mk2445=Stimulus,S128,1751317,1,0 +Mk2446=Stimulus,S 44,1752264,1,0 +Mk2447=Stimulus,S128,1752945,1,0 +Mk2448=Stimulus,S139,1752946,1,0 +Mk2449=Stimulus,S128,1752949,1,0 +Mk2450=Stimulus,S 43,1753916,1,0 +Mk2451=Stimulus,S128,1754546,1,0 +Mk2452=Stimulus,S139,1754549,1,0 +Mk2453=Stimulus,S128,1754553,1,0 +Mk2454=Stimulus,S 41,1755696,1,0 +Mk2455=Stimulus,S128,1756162,1,0 +Mk2456=Stimulus,S139,1756163,1,0 +Mk2457=Stimulus,S128,1756167,1,0 +Mk2458=Stimulus,S 44,1757400,1,0 +Mk2459=Stimulus,S128,1757805,1,0 +Mk2460=Stimulus,S140,1757809,1,0 +Mk2461=Stimulus,S128,1757812,1,0 +Mk2462=Stimulus,S 43,1759002,1,0 +Mk2463=Stimulus,S 11,1759647,1,0 +Mk2464=Stimulus,S139,1759648,1,0 +Mk2465=Stimulus,S128,1759650,1,0 +Mk2466=Stimulus,S 41,1760969,1,0 +Mk2467=Stimulus,S128,1761431,1,0 +Mk2468=Stimulus,S139,1761432,1,0 +Mk2469=Stimulus,S128,1761435,1,0 +Mk2470=Stimulus,S 42,1762681,1,0 +Mk2471=Stimulus,S128,1763438,1,0 +Mk2472=Stimulus,S139,1763442,1,0 +Mk2473=Stimulus,S128,1763444,1,0 +Mk2474=Stimulus,S128,1763474,1,0 +Mk2475=Stimulus,S 43,1764435,1,0 +Mk2476=Stimulus,S128,1765095,1,0 +Mk2477=Stimulus,S139,1765096,1,0 +Mk2478=Stimulus,S128,1765099,1,0 +Mk2479=Stimulus,S128,1765141,1,0 +Mk2480=Stimulus,S 42,1766357,1,0 +Mk2481=Stimulus,S128,1767157,1,0 +Mk2482=Stimulus,S139,1767160,1,0 +Mk2483=Stimulus,S128,1767163,1,0 +Mk2484=Stimulus,S 42,1768095,1,0 +Mk2485=Stimulus,S128,1768847,1,0 +Mk2486=Stimulus,S139,1768848,1,0 +Mk2487=Stimulus,S128,1768851,1,0 +Mk2488=Stimulus,S 44,1769958,1,0 +Mk2489=Stimulus,S128,1770781,1,0 +Mk2490=Stimulus,S139,1770783,1,0 +Mk2491=Stimulus,S128,1770785,1,0 +Mk2492=Stimulus,S 41,1771745,1,0 +Mk2493=Stimulus,S128,1772508,1,0 +Mk2494=Stimulus,S139,1772512,1,0 +Mk2495=Stimulus,S128,1772514,1,0 +Mk2496=Stimulus,S 41,1773457,1,0 +Mk2497=Stimulus,S139,1774206,1,0 +Mk2498=Stimulus,S128,1774209,1,0 +Mk2499=Stimulus,S 44,1775314,1,0 +Mk2500=Stimulus,S 11,1776001,1,0 +Mk2501=Stimulus,S139,1776002,1,0 +Mk2502=Stimulus,S128,1776004,1,0 +Mk2503=Stimulus,S 44,1776849,1,0 +Mk2504=Stimulus,S 11,1777570,1,0 +Mk2505=Stimulus,S139,1777571,1,0 +Mk2506=Stimulus,S128,1777573,1,0 +Mk2507=Stimulus,S 42,1778746,1,0 +Mk2508=Stimulus,S139,1779628,1,0 +Mk2509=Stimulus,S128,1779631,1,0 +Mk2510=Stimulus,S128,1779676,1,0 +Mk2511=Stimulus,S 41,1780330,1,0 +Mk2512=Stimulus,S 11,1781185,1,0 +Mk2513=Stimulus,S139,1781186,1,0 +Mk2514=Stimulus,S128,1781188,1,0 +Mk2515=Stimulus,S 41,1782336,1,0 +Mk2516=Stimulus,S128,1782852,1,0 +Mk2517=Stimulus,S139,1782854,1,0 +Mk2518=Stimulus,S128,1782857,1,0 +Mk2519=Stimulus,S128,1782885,1,0 +Mk2520=Stimulus,S 43,1784102,1,0 +Mk2521=Stimulus,S128,1784827,1,0 +Mk2522=Stimulus,S139,1784830,1,0 +Mk2523=Stimulus,S128,1784832,1,0 +Mk2524=Stimulus,S128,1784875,1,0 +Mk2525=Stimulus,S 43,1785986,1,0 +Mk2526=Stimulus,S 11,1786504,1,0 +Mk2527=Stimulus,S139,1786505,1,0 +Mk2528=Stimulus,S128,1786507,1,0 +Mk2529=Stimulus,S128,1786537,1,0 +Mk2530=Stimulus,S 41,1787619,1,0 +Mk2531=Stimulus,S128,1788287,1,0 +Mk2532=Stimulus,S139,1788291,1,0 +Mk2533=Stimulus,S128,1788294,1,0 +Mk2534=Stimulus,S 42,1789152,1,0 +Mk2535=Stimulus,S 11,1789992,1,0 +Mk2536=Stimulus,S139,1789994,1,0 +Mk2537=Stimulus,S128,1789995,1,0 +Mk2538=Stimulus,S 43,1791186,1,0 +Mk2539=Stimulus,S 11,1791892,1,0 +Mk2540=Stimulus,S139,1791894,1,0 +Mk2541=Stimulus,S128,1791895,1,0 +Mk2542=Stimulus,S 44,1793031,1,0 +Mk2543=Stimulus,S128,1793703,1,0 +Mk2544=Stimulus,S139,1793707,1,0 +Mk2545=Stimulus,S128,1793710,1,0 +Mk2546=Stimulus,S128,1793741,1,0 +Mk2547=Stimulus,S 41,1794876,1,0 +Mk2548=Stimulus,S128,1795452,1,0 +Mk2549=Stimulus,S139,1795454,1,0 +Mk2550=Stimulus,S128,1795457,1,0 +Mk2551=Stimulus,S 42,1796623,1,0 +Mk2552=Stimulus,S139,1797281,1,0 +Mk2553=Stimulus,S128,1797284,1,0 +Mk2554=Stimulus,S128,1797317,1,0 +Mk2555=Stimulus,S 41,1798609,1,0 +Mk2556=Stimulus,S128,1799183,1,0 +Mk2557=Stimulus,S139,1799185,1,0 +Mk2558=Stimulus,S128,1799188,1,0 +Mk2559=Stimulus,S 44,1800456,1,0 +Mk2560=Stimulus,S128,1801124,1,0 +Mk2561=Stimulus,S139,1801127,1,0 +Mk2562=Stimulus,S128,1801129,1,0 +Mk2563=Stimulus,S 21,1801528,1,0 +Mk2564=Stimulus,S 42,1802078,1,0 +Mk2565=Stimulus,S128,1802772,1,0 +Mk2566=Stimulus,S139,1802775,1,0 +Mk2567=Stimulus,S128,1802778,1,0 +Mk2568=Stimulus,S128,1802807,1,0 +Mk2569=Stimulus,S 21,1803188,1,0 +Mk2570=Stimulus,S 43,1804011,1,0 +Mk2571=Stimulus,S139,1804614,1,0 +Mk2572=Stimulus,S128,1804616,1,0 +Mk2573=Stimulus,S 41,1805868,1,0 +Mk2574=Stimulus,S139,1806349,1,0 +Mk2575=Stimulus,S128,1806352,1,0 +Mk2576=Stimulus,S128,1806388,1,0 +Mk2577=Stimulus,S 42,1807688,1,0 +Mk2578=Stimulus,S128,1808365,1,0 +Mk2579=Stimulus,S139,1808369,1,0 +Mk2580=Stimulus,S128,1808372,1,0 +Mk2581=Stimulus,S 44,1824818,1,0 +Mk2582=Stimulus,S128,1825491,1,0 +Mk2583=Stimulus,S139,1825492,1,0 +Mk2584=Stimulus,S128,1825495,1,0 +Mk2585=Stimulus,S128,1825528,1,0 +Mk2586=Stimulus,S 43,1826430,1,0 +Mk2587=Stimulus,S 11,1827002,1,0 +Mk2588=Stimulus,S139,1827004,1,0 +Mk2589=Stimulus,S128,1827005,1,0 +Mk2590=Stimulus,S 41,1828397,1,0 +Mk2591=Stimulus,S128,1828902,1,0 +Mk2592=Stimulus,S139,1828903,1,0 +Mk2593=Stimulus,S128,1828905,1,0 +Mk2594=Stimulus,S 43,1830162,1,0 +Mk2595=Stimulus,S 11,1830848,1,0 +Mk2596=Stimulus,S139,1830850,1,0 +Mk2597=Stimulus,S128,1830851,1,0 +Mk2598=Stimulus,S 41,1831848,1,0 +Mk2599=Stimulus,S 11,1832464,1,0 +Mk2600=Stimulus,S139,1832465,1,0 +Mk2601=Stimulus,S128,1832468,1,0 +Mk2602=Stimulus,S 42,1833834,1,0 +Mk2603=Stimulus,S139,1834567,1,0 +Mk2604=Stimulus,S128,1834570,1,0 +Mk2605=Stimulus,S128,1834603,1,0 +Mk2606=Stimulus,S 41,1835593,1,0 +Mk2607=Stimulus,S128,1836060,1,0 +Mk2608=Stimulus,S139,1836062,1,0 +Mk2609=Stimulus,S128,1836066,1,0 +Mk2610=Stimulus,S 42,1837153,1,0 +Mk2611=Stimulus,S128,1837642,1,0 +Mk2612=Stimulus,S139,1837645,1,0 +Mk2613=Stimulus,S128,1837648,1,0 +Mk2614=Stimulus,S128,1837693,1,0 +Mk2615=Stimulus,S 21,1838078,1,0 +Mk2616=Stimulus,S 43,1838798,1,0 +Mk2617=Stimulus,S 11,1839212,1,0 +Mk2618=Stimulus,S139,1839213,1,0 +Mk2619=Stimulus,S128,1839215,1,0 +Mk2620=Stimulus,S128,1839246,1,0 +Mk2621=Stimulus,S 43,1840789,1,0 +Mk2622=Stimulus,S 12,1841162,1,0 +Mk2623=Stimulus,S128,1841165,1,0 +Mk2624=Stimulus,S 44,1842331,1,0 +Mk2625=Stimulus,S 11,1843256,1,0 +Mk2626=Stimulus,S 41,1843935,1,0 +Mk2627=Stimulus,S128,1844457,1,0 +Mk2628=Stimulus,S139,1844459,1,0 +Mk2629=Stimulus,S128,1844462,1,0 +Mk2630=Stimulus,S 41,1845908,1,0 +Mk2631=Stimulus,S128,1846512,1,0 +Mk2632=Stimulus,S139,1846515,1,0 +Mk2633=Stimulus,S128,1846518,1,0 +Mk2634=Stimulus,S 41,1847477,1,0 +Mk2635=Stimulus,S 11,1848003,1,0 +Mk2636=Stimulus,S139,1848004,1,0 +Mk2637=Stimulus,S128,1848006,1,0 +Mk2638=Stimulus,S 44,1849452,1,0 +Mk2639=Stimulus,S128,1850069,1,0 +Mk2640=Stimulus,S139,1850072,1,0 +Mk2641=Stimulus,S128,1850075,1,0 +Mk2642=Stimulus,S 43,1851417,1,0 +Mk2643=Stimulus,S139,1851923,1,0 +Mk2644=Stimulus,S128,1851926,1,0 +Mk2645=Stimulus,S 43,1853165,1,0 +Mk2646=Stimulus,S128,1853889,1,0 +Mk2647=Stimulus,S139,1853890,1,0 +Mk2648=Stimulus,S128,1853892,1,0 +Mk2649=Stimulus,S 44,1854725,1,0 +Mk2650=Stimulus,S139,1855422,1,0 +Mk2651=Stimulus,S128,1855425,1,0 +Mk2652=Stimulus,S 42,1856336,1,0 +Mk2653=Stimulus,S128,1857367,1,0 +Mk2654=Stimulus,S139,1857370,1,0 +Mk2655=Stimulus,S128,1857373,1,0 +Mk2656=Stimulus,S128,1857403,1,0 +Mk2657=Stimulus,S 43,1858188,1,0 +Mk2658=Stimulus,S139,1858633,1,0 +Mk2659=Stimulus,S128,1858636,1,0 +Mk2660=Stimulus,S128,1858818,1,0 +Mk2661=Stimulus,S 42,1860112,1,0 +Mk2662=Stimulus,S128,1860550,1,0 +Mk2663=Stimulus,S139,1860557,1,0 +Mk2664=Stimulus,S128,1860560,1,0 +Mk2665=Stimulus,S128,1860588,1,0 +Mk2666=Stimulus,S 44,1862042,1,0 +Mk2667=Stimulus,S128,1862551,1,0 +Mk2668=Stimulus,S140,1862554,1,0 +Mk2669=Stimulus,S128,1862556,1,0 +Mk2670=Stimulus,S 42,1863936,1,0 +Mk2671=Stimulus,S 11,1864362,1,0 +Mk2672=Stimulus,S139,1864364,1,0 +Mk2673=Stimulus,S128,1864365,1,0 +Mk2674=Stimulus,S128,1864400,1,0 +Mk2675=Stimulus,S 41,1865515,1,0 +Mk2676=Stimulus,S128,1865977,1,0 +Mk2677=Stimulus,S139,1865978,1,0 +Mk2678=Stimulus,S128,1865981,1,0 +Mk2679=Stimulus,S 41,1867075,1,0 +Mk2680=Stimulus,S128,1867782,1,0 +Mk2681=Stimulus,S139,1867785,1,0 +Mk2682=Stimulus,S128,1867788,1,0 +Mk2683=Stimulus,S 44,1868615,1,0 +Mk2684=Stimulus,S128,1869344,1,0 +Mk2685=Stimulus,S139,1869345,1,0 +Mk2686=Stimulus,S128,1869348,1,0 +Mk2687=Stimulus,S 44,1870423,1,0 +Mk2688=Stimulus,S 11,1871359,1,0 +Mk2689=Stimulus,S139,1871361,1,0 +Mk2690=Stimulus,S128,1871362,1,0 +Mk2691=Stimulus,S128,1871397,1,0 +Mk2692=Stimulus,S 44,1872425,1,0 +Mk2693=Stimulus,S139,1873132,1,0 +Mk2694=Stimulus,S128,1873135,1,0 +Mk2695=Stimulus,S 42,1874349,1,0 +Mk2696=Stimulus,S128,1875001,1,0 +Mk2697=Stimulus,S139,1875004,1,0 +Mk2698=Stimulus,S128,1875007,1,0 +Mk2699=Stimulus,S 42,1876295,1,0 +Mk2700=Stimulus,S139,1876959,1,0 +Mk2701=Stimulus,S128,1876961,1,0 +Mk2702=Stimulus,S128,1876996,1,0 +Mk2703=Stimulus,S 44,1878170,1,0 +Mk2704=Stimulus,S139,1878819,1,0 +Mk2705=Stimulus,S128,1878822,1,0 +Mk2706=Stimulus,S128,1878854,1,0 +Mk2707=Stimulus,S 42,1879806,1,0 +Mk2708=Stimulus,S128,1880612,1,0 +Mk2709=Stimulus,S139,1880615,1,0 +Mk2710=Stimulus,S128,1880618,1,0 +Mk2711=Stimulus,S 43,1881360,1,0 +Mk2712=Stimulus,S128,1882360,1,0 +Mk2713=Stimulus,S139,1882364,1,0 +Mk2714=Stimulus,S128,1882366,1,0 +Mk2715=Stimulus,S 43,1882968,1,0 +Mk2716=Stimulus,S128,1883908,1,0 +Mk2717=Stimulus,S139,1883909,1,0 +Mk2718=Stimulus,S128,1883911,1,0 +Mk2719=Stimulus,S 21,1884316,1,0 +Mk2720=Stimulus,S 43,1884805,1,0 +Mk2721=Stimulus,S128,1885708,1,0 +Mk2722=Stimulus,S139,1885712,1,0 +Mk2723=Stimulus,S128,1885715,1,0 +Mk2724=Stimulus,S 42,1886802,1,0 +Mk2725=Stimulus,S128,1887638,1,0 +Mk2726=Stimulus,S139,1887641,1,0 +Mk2727=Stimulus,S128,1887644,1,0 +Mk2728=Stimulus,S128,1887674,1,0 +Mk2729=Stimulus,S 41,1888585,1,0 +Mk2730=Stimulus,S 11,1889255,1,0 +Mk2731=Stimulus,S139,1889256,1,0 +Mk2732=Stimulus,S128,1889257,1,0 +Mk2733=Stimulus,S 42,1890302,1,0 +Mk2734=Stimulus,S 11,1890910,1,0 +Mk2735=Stimulus,S139,1890911,1,0 +Mk2736=Stimulus,S128,1890913,1,0 +Mk2737=Stimulus,S128,1890947,1,0 +Mk2738=Stimulus,S128,1890966,1,0 +Mk2739=Stimulus,S 44,1891856,1,0 +Mk2740=Stimulus,S 12,1892356,1,0 +Mk2741=Stimulus,S140,1892358,1,0 +Mk2742=Stimulus,S128,1892359,1,0 +Mk2743=Stimulus,S 41,1893672,1,0 +Mk2744=Stimulus,S128,1894119,1,0 +Mk2745=Stimulus,S140,1894123,1,0 +Mk2746=Stimulus,S128,1894125,1,0 +Mk2747=Stimulus,S 42,1911783,1,0 +Mk2748=Stimulus,S128,1912353,1,0 +Mk2749=Stimulus,S139,1912355,1,0 +Mk2750=Stimulus,S128,1912358,1,0 +Mk2751=Stimulus,S128,1912389,1,0 +Mk2752=Stimulus,S 43,1913791,1,0 +Mk2753=Stimulus,S128,1914434,1,0 +Mk2754=Stimulus,S139,1914437,1,0 +Mk2755=Stimulus,S128,1914440,1,0 +Mk2756=Stimulus,S 41,1915328,1,0 +Mk2757=Stimulus,S128,1916023,1,0 +Mk2758=Stimulus,S139,1916027,1,0 +Mk2759=Stimulus,S128,1916029,1,0 +Mk2760=Stimulus,S128,1916056,1,0 +Mk2761=Stimulus,S 41,1917275,1,0 +Mk2762=Stimulus,S 11,1917743,1,0 +Mk2763=Stimulus,S139,1917745,1,0 +Mk2764=Stimulus,S128,1917746,1,0 +Mk2765=Stimulus,S 41,1919246,1,0 +Mk2766=Stimulus,S 11,1919684,1,0 +Mk2767=Stimulus,S139,1919685,1,0 +Mk2768=Stimulus,S128,1919686,1,0 +Mk2769=Stimulus,S 41,1921145,1,0 +Mk2770=Stimulus,S128,1921522,1,0 +Mk2771=Stimulus,S139,1921524,1,0 +Mk2772=Stimulus,S128,1921526,1,0 +Mk2773=Stimulus,S 41,1922912,1,0 +Mk2774=Stimulus,S139,1923345,1,0 +Mk2775=Stimulus,S128,1923348,1,0 +Mk2776=Stimulus,S128,1923376,1,0 +Mk2777=Stimulus,S 41,1924768,1,0 +Mk2778=Stimulus,S128,1925242,1,0 +Mk2779=Stimulus,S139,1925244,1,0 +Mk2780=Stimulus,S128,1925247,1,0 +Mk2781=Stimulus,S 42,1926596,1,0 +Mk2782=Stimulus,S128,1927489,1,0 +Mk2783=Stimulus,S139,1927493,1,0 +Mk2784=Stimulus,S128,1927495,1,0 +Mk2785=Stimulus,S128,1927525,1,0 +Mk2786=Stimulus,S 42,1928307,1,0 +Mk2787=Stimulus,S139,1929219,1,0 +Mk2788=Stimulus,S128,1929222,1,0 +Mk2789=Stimulus,S 41,1930122,1,0 +Mk2790=Stimulus,S 11,1930835,1,0 +Mk2791=Stimulus,S128,1930837,1,0 +Mk2792=Stimulus,S128,1930875,1,0 +Mk2793=Stimulus,S 42,1931931,1,0 +Mk2794=Stimulus,S128,1932697,1,0 +Mk2795=Stimulus,S139,1932698,1,0 +Mk2796=Stimulus,S128,1932701,1,0 +Mk2797=Stimulus,S 42,1933532,1,0 +Mk2798=Stimulus,S128,1934438,1,0 +Mk2799=Stimulus,S139,1934439,1,0 +Mk2800=Stimulus,S128,1934442,1,0 +Mk2801=Stimulus,S 42,1935359,1,0 +Mk2802=Stimulus,S128,1936426,1,0 +Mk2803=Stimulus,S139,1936427,1,0 +Mk2804=Stimulus,S128,1936429,1,0 +Mk2805=Stimulus,S 43,1937043,1,0 +Mk2806=Stimulus,S128,1938005,1,0 +Mk2807=Stimulus,S139,1938007,1,0 +Mk2808=Stimulus,S128,1938010,1,0 +Mk2809=Stimulus,S 43,1938703,1,0 +Mk2810=Stimulus,S128,1939716,1,0 +Mk2811=Stimulus,S139,1939718,1,0 +Mk2812=Stimulus,S128,1939720,1,0 +Mk2813=Stimulus,S 44,1940555,1,0 +Mk2814=Stimulus,S139,1941331,1,0 +Mk2815=Stimulus,S128,1941334,1,0 +Mk2816=Stimulus,S 44,1942348,1,0 +Mk2817=Stimulus,S 11,1943061,1,0 +Mk2818=Stimulus,S139,1943063,1,0 +Mk2819=Stimulus,S128,1943064,1,0 +Mk2820=Stimulus,S 42,1944327,1,0 +Mk2821=Stimulus,S128,1944855,1,0 +Mk2822=Stimulus,S139,1944858,1,0 +Mk2823=Stimulus,S128,1944860,1,0 +Mk2824=Stimulus,S 43,1946051,1,0 +Mk2825=Stimulus,S128,1946730,1,0 +Mk2826=Stimulus,S139,1946732,1,0 +Mk2827=Stimulus,S128,1946735,1,0 +Mk2828=Stimulus,S 42,1947647,1,0 +Mk2829=Stimulus,S128,1948346,1,0 +Mk2830=Stimulus,S139,1948351,1,0 +Mk2831=Stimulus,S128,1948354,1,0 +Mk2832=Stimulus,S 43,1949537,1,0 +Mk2833=Stimulus,S128,1950028,1,0 +Mk2834=Stimulus,S139,1950029,1,0 +Mk2835=Stimulus,S128,1950032,1,0 +Mk2836=Stimulus,S 41,1951132,1,0 +Mk2837=Stimulus,S128,1951733,1,0 +Mk2838=Stimulus,S139,1951734,1,0 +Mk2839=Stimulus,S128,1951737,1,0 +Mk2840=Stimulus,S 44,1952731,1,0 +Mk2841=Stimulus,S128,1953433,1,0 +Mk2842=Stimulus,S139,1953436,1,0 +Mk2843=Stimulus,S128,1953439,1,0 +Mk2844=Stimulus,S128,1953468,1,0 +Mk2845=Stimulus,S 44,1954595,1,0 +Mk2846=Stimulus,S139,1955155,1,0 +Mk2847=Stimulus,S128,1955158,1,0 +Mk2848=Stimulus,S128,1955191,1,0 +Mk2849=Stimulus,S 44,1956233,1,0 +Mk2850=Stimulus,S128,1956721,1,0 +Mk2851=Stimulus,S139,1956722,1,0 +Mk2852=Stimulus,S128,1956725,1,0 +Mk2853=Stimulus,S 44,1958182,1,0 +Mk2854=Stimulus,S 11,1958496,1,0 +Mk2855=Stimulus,S139,1958497,1,0 +Mk2856=Stimulus,S128,1958499,1,0 +Mk2857=Stimulus,S 42,1959951,1,0 +Mk2858=Stimulus,S139,1960323,1,0 +Mk2859=Stimulus,S128,1960326,1,0 +Mk2860=Stimulus,S 41,1961735,1,0 +Mk2861=Stimulus,S128,1962354,1,0 +Mk2862=Stimulus,S139,1962356,1,0 +Mk2863=Stimulus,S128,1962359,1,0 +Mk2864=Stimulus,S 43,1963556,1,0 +Mk2865=Stimulus,S128,1964223,1,0 +Mk2866=Stimulus,S139,1964226,1,0 +Mk2867=Stimulus,S128,1964229,1,0 +Mk2868=Stimulus,S128,1964257,1,0 +Mk2869=Stimulus,S 44,1965202,1,0 +Mk2870=Stimulus,S128,1965818,1,0 +Mk2871=Stimulus,S139,1965820,1,0 +Mk2872=Stimulus,S128,1965822,1,0 +Mk2873=Stimulus,S128,1965854,1,0 +Mk2874=Stimulus,S 44,1967201,1,0 +Mk2875=Stimulus,S 11,1967931,1,0 +Mk2876=Stimulus,S128,1967933,1,0 +Mk2877=Stimulus,S128,1967968,1,0 +Mk2878=Stimulus,S128,1968131,1,0 +Mk2879=Stimulus,S 43,1968765,1,0 +Mk2880=Stimulus,S139,1969739,1,0 +Mk2881=Stimulus,S128,1969741,1,0 +Mk2882=Stimulus,S128,1969772,1,0 +Mk2883=Stimulus,S 44,1970446,1,0 +Mk2884=Stimulus,S 11,1971447,1,0 +Mk2885=Stimulus,S139,1971448,1,0 +Mk2886=Stimulus,S128,1971450,1,0 +Mk2887=Stimulus,S128,1971484,1,0 +Mk2888=Stimulus,S 44,1972416,1,0 +Mk2889=Stimulus,S128,1973070,1,0 +Mk2890=Stimulus,S139,1973073,1,0 +Mk2891=Stimulus,S128,1973076,1,0 +Mk2892=Stimulus,S 42,1974315,1,0 +Mk2893=Stimulus,S128,1974743,1,0 +Mk2894=Stimulus,S139,1974746,1,0 +Mk2895=Stimulus,S128,1974749,1,0 +Mk2896=Stimulus,S128,1974778,1,0 +Mk2897=Stimulus,S 43,1975951,1,0 +Mk2898=Stimulus,S128,1976553,1,0 +Mk2899=Stimulus,S139,1976554,1,0 +Mk2900=Stimulus,S128,1976557,1,0 +Mk2901=Stimulus,S128,1976585,1,0 +Mk2902=Stimulus,S 43,1977717,1,0 +Mk2903=Stimulus,S128,1978116,1,0 +Mk2904=Stimulus,S139,1978117,1,0 +Mk2905=Stimulus,S128,1978121,1,0 +Mk2906=Stimulus,S128,1978148,1,0 +Mk2907=Stimulus,S 43,1979389,1,0 +Mk2908=Stimulus,S128,1979797,1,0 +Mk2909=Stimulus,S139,1979799,1,0 +Mk2910=Stimulus,S128,1979801,1,0 +Mk2911=Stimulus,S 41,1981059,1,0 +Mk2912=Stimulus,S128,1981512,1,0 +Mk2913=Stimulus,S139,1981514,1,0 +Mk2914=Stimulus,S128,1981517,1,0 +Mk2915=Stimulus,S 43,1997693,1,0 +Mk2916=Stimulus,S 42,1999660,1,0 +Mk2917=Stimulus,S128,1999963,1,0 +Mk2918=Stimulus,S140,1999966,1,0 +Mk2919=Stimulus,S128,1999969,1,0 +Mk2920=Stimulus,S128,2000021,1,0 +Mk2921=Stimulus,S 42,2001361,1,0 +Mk2922=Stimulus,S128,2002076,1,0 +Mk2923=Stimulus,S139,2002079,1,0 +Mk2924=Stimulus,S128,2002082,1,0 +Mk2925=Stimulus,S 41,2003146,1,0 +Mk2926=Stimulus,S128,2003808,1,0 +Mk2927=Stimulus,S139,2003810,1,0 +Mk2928=Stimulus,S128,2003813,1,0 +Mk2929=Stimulus,S128,2003840,1,0 +Mk2930=Stimulus,S 41,2005016,1,0 +Mk2931=Stimulus,S139,2005552,1,0 +Mk2932=Stimulus,S128,2005554,1,0 +Mk2933=Stimulus,S 44,2006618,1,0 +Mk2934=Stimulus,S128,2007280,1,0 +Mk2935=Stimulus,S139,2007282,1,0 +Mk2936=Stimulus,S128,2007284,1,0 +Mk2937=Stimulus,S 44,2008168,1,0 +Mk2938=Stimulus,S 12,2008756,1,0 +Mk2939=Stimulus,S140,2008757,1,0 +Mk2940=Stimulus,S128,2008760,1,0 +Mk2941=Stimulus,S 41,2009848,1,0 +Mk2942=Stimulus,S128,2010466,1,0 +Mk2943=Stimulus,S139,2010470,1,0 +Mk2944=Stimulus,S128,2010473,1,0 +Mk2945=Stimulus,S 44,2011628,1,0 +Mk2946=Stimulus,S128,2012286,1,0 +Mk2947=Stimulus,S139,2012290,1,0 +Mk2948=Stimulus,S128,2012293,1,0 +Mk2949=Stimulus,S 42,2013224,1,0 +Mk2950=Stimulus,S128,2013862,1,0 +Mk2951=Stimulus,S139,2013864,1,0 +Mk2952=Stimulus,S128,2013867,1,0 +Mk2953=Stimulus,S 43,2015044,1,0 +Mk2954=Stimulus,S128,2015652,1,0 +Mk2955=Stimulus,S139,2015655,1,0 +Mk2956=Stimulus,S128,2015658,1,0 +Mk2957=Stimulus,S 43,2016934,1,0 +Mk2958=Stimulus,S128,2017372,1,0 +Mk2959=Stimulus,S139,2017377,1,0 +Mk2960=Stimulus,S128,2017380,1,0 +Mk2961=Stimulus,S128,2017440,1,0 +Mk2962=Stimulus,S 42,2018559,1,0 +Mk2963=Stimulus,S128,2019273,1,0 +Mk2964=Stimulus,S139,2019275,1,0 +Mk2965=Stimulus,S128,2019277,1,0 +Mk2966=Stimulus,S 44,2020468,1,0 +Mk2967=Stimulus,S128,2021087,1,0 +Mk2968=Stimulus,S139,2021092,1,0 +Mk2969=Stimulus,S128,2021095,1,0 +Mk2970=Stimulus,S 41,2022085,1,0 +Mk2971=Stimulus,S 11,2022719,1,0 +Mk2972=Stimulus,S128,2022721,1,0 +Mk2973=Stimulus,S128,2023410,1,0 +Mk2974=Stimulus,S 43,2024040,1,0 +Mk2975=Stimulus,S139,2024607,1,0 +Mk2976=Stimulus,S128,2024610,1,0 +Mk2977=Stimulus,S 42,2025989,1,0 +Mk2978=Stimulus,S128,2026654,1,0 +Mk2979=Stimulus,S139,2026656,1,0 +Mk2980=Stimulus,S128,2026659,1,0 +Mk2981=Stimulus,S 44,2027940,1,0 +Mk2982=Stimulus,S 11,2028662,1,0 +Mk2983=Stimulus,S139,2028663,1,0 +Mk2984=Stimulus,S128,2028665,1,0 +Mk2985=Stimulus,S 41,2029740,1,0 +Mk2986=Stimulus,S128,2030420,1,0 +Mk2987=Stimulus,S139,2030422,1,0 +Mk2988=Stimulus,S128,2030425,1,0 +Mk2989=Stimulus,S 43,2031300,1,0 +Mk2990=Stimulus,S 11,2031974,1,0 +Mk2991=Stimulus,S139,2031975,1,0 +Mk2992=Stimulus,S128,2031977,1,0 +Mk2993=Stimulus,S 42,2032967,1,0 +Mk2994=Stimulus,S139,2033691,1,0 +Mk2995=Stimulus,S128,2033694,1,0 +Mk2996=Stimulus,S128,2033726,1,0 +Mk2997=Stimulus,S 41,2034538,1,0 +Mk2998=Stimulus,S 11,2035195,1,0 +Mk2999=Stimulus,S139,2035197,1,0 +Mk3000=Stimulus,S128,2035198,1,0 +Mk3001=Stimulus,S 42,2036244,1,0 +Mk3002=Stimulus,S140,2037102,1,0 +Mk3003=Stimulus,S128,2037105,1,0 +Mk3004=Stimulus,S128,2037153,1,0 +Mk3005=Stimulus,S 43,2038156,1,0 +Mk3006=Stimulus,S128,2038843,1,0 +Mk3007=Stimulus,S139,2038849,1,0 +Mk3008=Stimulus,S128,2038852,1,0 +Mk3009=Stimulus,S128,2038894,1,0 +Mk3010=Stimulus,S 41,2040019,1,0 +Mk3011=Stimulus,S139,2040459,1,0 +Mk3012=Stimulus,S128,2040461,1,0 +Mk3013=Stimulus,S 42,2041943,1,0 +Mk3014=Stimulus,S 11,2042521,1,0 +Mk3015=Stimulus,S139,2042522,1,0 +Mk3016=Stimulus,S128,2042523,1,0 +Mk3017=Stimulus,S 41,2043556,1,0 +Mk3018=Stimulus,S128,2044107,1,0 +Mk3019=Stimulus,S139,2044111,1,0 +Mk3020=Stimulus,S128,2044114,1,0 +Mk3021=Stimulus,S 43,2045486,1,0 +Mk3022=Stimulus,S128,2046022,1,0 +Mk3023=Stimulus,S139,2046023,1,0 +Mk3024=Stimulus,S128,2046026,1,0 +Mk3025=Stimulus,S 43,2047320,1,0 +Mk3026=Stimulus,S128,2047713,1,0 +Mk3027=Stimulus,S139,2047718,1,0 +Mk3028=Stimulus,S128,2047720,1,0 +Mk3029=Stimulus,S 43,2049293,1,0 +Mk3030=Stimulus,S128,2049707,1,0 +Mk3031=Stimulus,S139,2049711,1,0 +Mk3032=Stimulus,S128,2049715,1,0 +Mk3033=Stimulus,S 42,2051027,1,0 +Mk3034=Stimulus,S128,2051712,1,0 +Mk3035=Stimulus,S139,2051714,1,0 +Mk3036=Stimulus,S128,2051717,1,0 +Mk3037=Stimulus,S 44,2052750,1,0 +Mk3038=Stimulus,S128,2053540,1,0 +Mk3039=Stimulus,S139,2053541,1,0 +Mk3040=Stimulus,S128,2053544,1,0 +Mk3041=Stimulus,S128,2053589,1,0 +Mk3042=Stimulus,S 41,2054704,1,0 +Mk3043=Stimulus,S139,2055314,1,0 +Mk3044=Stimulus,S128,2055317,1,0 +Mk3045=Stimulus,S 41,2056387,1,0 +Mk3046=Stimulus,S128,2057096,1,0 +Mk3047=Stimulus,S139,2057097,1,0 +Mk3048=Stimulus,S128,2057099,1,0 +Mk3049=Stimulus,S 44,2058326,1,0 +Mk3050=Stimulus,S 11,2059141,1,0 +Mk3051=Stimulus,S139,2059143,1,0 +Mk3052=Stimulus,S128,2059144,1,0 +Mk3053=Stimulus,S 44,2060020,1,0 +Mk3054=Stimulus,S139,2060878,1,0 +Mk3055=Stimulus,S128,2060881,1,0 +Mk3056=Stimulus,S 44,2061622,1,0 +Mk3057=Stimulus,S128,2062617,1,0 +Mk3058=Stimulus,S139,2062620,1,0 +Mk3059=Stimulus,S128,2062623,1,0 +Mk3060=Stimulus,S 43,2063267,1,0 +Mk3061=Stimulus,S128,2064230,1,0 +Mk3062=Stimulus,S139,2064232,1,0 +Mk3063=Stimulus,S128,2064235,1,0 +Mk3064=Stimulus,S128,2064263,1,0 +Mk3065=Stimulus,S 44,2065158,1,0 +Mk3066=Stimulus,S139,2065925,1,0 +Mk3067=Stimulus,S128,2065927,1,0 +Mk3068=Stimulus,S 42,2067082,1,0 +Mk3069=Stimulus,S128,2067817,1,0 +Mk3070=Stimulus,S139,2067819,1,0 +Mk3071=Stimulus,S128,2067822,1,0 +Mk3072=Stimulus,S128,2067853,1,0 +Mk3073=Stimulus,S 43,2084714,1,0 +Mk3074=Stimulus,S128,2085517,1,0 +Mk3075=Stimulus,S139,2085520,1,0 +Mk3076=Stimulus,S128,2085523,1,0 +Mk3077=Stimulus,S128,2085575,1,0 +Mk3078=Stimulus,S 43,2086611,1,0 +Mk3079=Stimulus,S128,2087147,1,0 +Mk3080=Stimulus,S139,2087148,1,0 +Mk3081=Stimulus,S128,2087150,1,0 +Mk3082=Stimulus,S 42,2088318,1,0 +Mk3083=Stimulus,S128,2089007,1,0 +Mk3084=Stimulus,S139,2089009,1,0 +Mk3085=Stimulus,S128,2089012,1,0 +Mk3086=Stimulus,S128,2089177,1,0 +Mk3087=Stimulus,S 42,2090251,1,0 +Mk3088=Stimulus,S128,2090775,1,0 +Mk3089=Stimulus,S139,2090780,1,0 +Mk3090=Stimulus,S128,2090783,1,0 +Mk3091=Stimulus,S 43,2092107,1,0 +Mk3092=Stimulus,S 11,2092692,1,0 +Mk3093=Stimulus,S139,2092693,1,0 +Mk3094=Stimulus,S128,2092695,1,0 +Mk3095=Stimulus,S128,2092725,1,0 +Mk3096=Stimulus,S 44,2093923,1,0 +Mk3097=Stimulus,S139,2094602,1,0 +Mk3098=Stimulus,S128,2094604,1,0 +Mk3099=Stimulus,S 43,2095637,1,0 +Mk3100=Stimulus,S128,2096090,1,0 +Mk3101=Stimulus,S139,2096094,1,0 +Mk3102=Stimulus,S128,2096097,1,0 +Mk3103=Stimulus,S 42,2097311,1,0 +Mk3104=Stimulus,S139,2097896,1,0 +Mk3105=Stimulus,S128,2097898,1,0 +Mk3106=Stimulus,S128,2097937,1,0 +Mk3107=Stimulus,S 44,2099332,1,0 +Mk3108=Stimulus,S128,2099776,1,0 +Mk3109=Stimulus,S139,2099781,1,0 +Mk3110=Stimulus,S128,2099784,1,0 +Mk3111=Stimulus,S 44,2101061,1,0 +Mk3112=Stimulus,S 11,2101524,1,0 +Mk3113=Stimulus,S139,2101526,1,0 +Mk3114=Stimulus,S128,2101527,1,0 +Mk3115=Stimulus,S128,2101568,1,0 +Mk3116=Stimulus,S 44,2102689,1,0 +Mk3117=Stimulus,S 11,2103243,1,0 +Mk3118=Stimulus,S128,2103245,1,0 +Mk3119=Stimulus,S128,2103284,1,0 +Mk3120=Stimulus,S 43,2104666,1,0 +Mk3121=Stimulus,S 11,2105209,1,0 +Mk3122=Stimulus,S128,2105213,1,0 +Mk3123=Stimulus,S 44,2106403,1,0 +Mk3124=Stimulus,S128,2107008,1,0 +Mk3125=Stimulus,S139,2107011,1,0 +Mk3126=Stimulus,S128,2107014,1,0 +Mk3127=Stimulus,S128,2107050,1,0 +Mk3128=Stimulus,S 41,2108199,1,0 +Mk3129=Stimulus,S128,2108763,1,0 +Mk3130=Stimulus,S139,2108765,1,0 +Mk3131=Stimulus,S128,2108768,1,0 +Mk3132=Stimulus,S 41,2109764,1,0 +Mk3133=Stimulus,S128,2110251,1,0 +Mk3134=Stimulus,S139,2110252,1,0 +Mk3135=Stimulus,S128,2110254,1,0 +Mk3136=Stimulus,S 44,2111300,1,0 +Mk3137=Stimulus,S128,2111891,1,0 +Mk3138=Stimulus,S139,2111894,1,0 +Mk3139=Stimulus,S128,2111897,1,0 +Mk3140=Stimulus,S128,2111927,1,0 +Mk3141=Stimulus,S 41,2113024,1,0 +Mk3142=Stimulus,S 11,2113471,1,0 +Mk3143=Stimulus,S139,2113473,1,0 +Mk3144=Stimulus,S128,2113475,1,0 +Mk3145=Stimulus,S 41,2115047,1,0 +Mk3146=Stimulus,S128,2115523,1,0 +Mk3147=Stimulus,S139,2115525,1,0 +Mk3148=Stimulus,S128,2115528,1,0 +Mk3149=Stimulus,S 43,2116981,1,0 +Mk3150=Stimulus,S128,2117564,1,0 +Mk3151=Stimulus,S139,2117566,1,0 +Mk3152=Stimulus,S128,2117569,1,0 +Mk3153=Stimulus,S 41,2118591,1,0 +Mk3154=Stimulus,S128,2119277,1,0 +Mk3155=Stimulus,S139,2119282,1,0 +Mk3156=Stimulus,S128,2119284,1,0 +Mk3157=Stimulus,S 42,2120335,1,0 +Mk3158=Stimulus,S128,2121021,1,0 +Mk3159=Stimulus,S139,2121026,1,0 +Mk3160=Stimulus,S128,2121028,1,0 +Mk3161=Stimulus,S 41,2122110,1,0 +Mk3162=Stimulus,S128,2122564,1,0 +Mk3163=Stimulus,S139,2122568,1,0 +Mk3164=Stimulus,S128,2122570,1,0 +Mk3165=Stimulus,S 41,2123912,1,0 +Mk3166=Stimulus,S128,2124404,1,0 +Mk3167=Stimulus,S139,2124409,1,0 +Mk3168=Stimulus,S128,2124412,1,0 +Mk3169=Stimulus,S 43,2125531,1,0 +Mk3170=Stimulus,S128,2126038,1,0 +Mk3171=Stimulus,S139,2126043,1,0 +Mk3172=Stimulus,S128,2126046,1,0 +Mk3173=Stimulus,S128,2126079,1,0 +Mk3174=Stimulus,S 42,2127491,1,0 +Mk3175=Stimulus,S128,2128121,1,0 +Mk3176=Stimulus,S139,2128123,1,0 +Mk3177=Stimulus,S128,2128127,1,0 +Mk3178=Stimulus,S 44,2129240,1,0 +Mk3179=Stimulus,S128,2129871,1,0 +Mk3180=Stimulus,S139,2129874,1,0 +Mk3181=Stimulus,S128,2129877,1,0 +Mk3182=Stimulus,S 44,2130911,1,0 +Mk3183=Stimulus,S128,2131529,1,0 +Mk3184=Stimulus,S139,2131532,1,0 +Mk3185=Stimulus,S128,2131534,1,0 +Mk3186=Stimulus,S 44,2132834,1,0 +Mk3187=Stimulus,S139,2133382,1,0 +Mk3188=Stimulus,S128,2133384,1,0 +Mk3189=Stimulus,S 42,2134612,1,0 +Mk3190=Stimulus,S 11,2135184,1,0 +Mk3191=Stimulus,S139,2135185,1,0 +Mk3192=Stimulus,S128,2135187,1,0 +Mk3193=Stimulus,S 42,2136196,1,0 +Mk3194=Stimulus,S128,2136989,1,0 +Mk3195=Stimulus,S139,2136992,1,0 +Mk3196=Stimulus,S128,2136994,1,0 +Mk3197=Stimulus,S 43,2137804,1,0 +Mk3198=Stimulus,S139,2138570,1,0 +Mk3199=Stimulus,S128,2138572,1,0 +Mk3200=Stimulus,S 43,2139508,1,0 +Mk3201=Stimulus,S128,2140114,1,0 +Mk3202=Stimulus,S139,2140115,1,0 +Mk3203=Stimulus,S128,2140118,1,0 +Mk3204=Stimulus,S 42,2141116,1,0 +Mk3205=Stimulus,S128,2141802,1,0 +Mk3206=Stimulus,S139,2141804,1,0 +Mk3207=Stimulus,S128,2141806,1,0 +Mk3208=Stimulus,S 44,2142797,1,0 +Mk3209=Stimulus,S139,2143654,1,0 +Mk3210=Stimulus,S128,2143657,1,0 +Mk3211=Stimulus,S 43,2144331,1,0 +Mk3212=Stimulus,S128,2145065,1,0 +Mk3213=Stimulus,S139,2145067,1,0 +Mk3214=Stimulus,S128,2145071,1,0 +Mk3215=Stimulus,S128,2145104,1,0 +Mk3216=Stimulus,S 41,2146049,1,0 +Mk3217=Stimulus,S128,2146737,1,0 +Mk3218=Stimulus,S139,2146741,1,0 +Mk3219=Stimulus,S128,2146744,1,0 +Mk3220=Stimulus,S128,2146783,1,0 +Mk3221=Stimulus,S 42,2147620,1,0 +Mk3222=Stimulus,S128,2148373,1,0 +Mk3223=Stimulus,S139,2148375,1,0 +Mk3224=Stimulus,S128,2148378,1,0 +Mk3225=Stimulus,S128,2148418,1,0 +Mk3226=Stimulus,S 41,2149289,1,0 +Mk3227=Stimulus,S128,2149896,1,0 +Mk3228=Stimulus,S139,2149897,1,0 +Mk3229=Stimulus,S128,2149899,1,0 +Mk3230=Stimulus,S 41,2151267,1,0 +Mk3231=Stimulus,S128,2151839,1,0 +Mk3232=Stimulus,S139,2151840,1,0 +Mk3233=Stimulus,S128,2151842,1,0 +Mk3234=Stimulus,S 42,2152900,1,0 +Mk3235=Stimulus,S128,2153621,1,0 +Mk3236=Stimulus,S139,2153622,1,0 +Mk3237=Stimulus,S128,2153625,1,0 +Mk3238=Stimulus,S128,2164506,1,0 +Mk3239=Stimulus,S128,2164661,1,0 +Mk3240=Stimulus,S128,2164886,1,0 +Mk3241=Stimulus,S127,2172512,1,0 +Mk3242=Stimulus,S255,2175075,1,0 +Mk3243=Stimulus,S127,2175129,1,0 +Mk3244=Stimulus,S255,2175138,1,0 +Mk3245=Stimulus,S127,2175171,1,0 +Mk3246=Stimulus,S255,2175184,1,0 +Mk3247=Stimulus,S127,2175195,1,0 +Mk3248=Stimulus,S255,2175250,1,0 +Mk3249=Stimulus,S127,2175266,1,0 +Mk3250=Stimulus,S255,2176474,1,0 +Mk3251=Stimulus,S127,2176486,1,0 +Mk3252=Stimulus,S255,2176518,1,0 +Mk3253=Stimulus,S127,2176529,1,0 +Mk3254=Stimulus,S255,2176750,1,0 +Mk3255=Stimulus,S127,2176761,1,0 +Mk3256=Stimulus,S255,2176916,1,0 +Mk3257=Stimulus,S127,2176924,1,0 diff --git a/code/eeg_timing_test/thrive_sys2_timingtest_stim.vmrk b/code/eeg_timing_test/thrive_sys2_timingtest_stim.vmrk new file mode 100755 index 0000000..ede57d6 --- /dev/null +++ b/code/eeg_timing_test/thrive_sys2_timingtest_stim.vmrk @@ -0,0 +1,950 @@ +BrainVision Data Exchange Marker File Version 1.0 + +[Common Infos] +Codepage=UTF-8 +DataFile=thrive_sys2_timingtest_stim.eeg + +[Marker Infos] +; Each entry: Mk=,,, +; , +; Fields are delimited by commas, some fields might be omitted (empty). +; Commas in type or description text are coded as "\1". +Mk1=New Segment,,1,1,0,20230602134906173378 +Mk2=Stimulus,S255,45767,1,0 +Mk3=Stimulus,S127,45778,1,0 +Mk4=Stimulus,S 2,154441,1,0 +Mk5=Stimulus,S128,154452,1,0 +Mk6=Stimulus,S 4,156319,1,0 +Mk7=Stimulus,S128,156329,1,0 +Mk8=Stimulus,S 3,158314,1,0 +Mk9=Stimulus,S128,158327,1,0 +Mk10=Stimulus,S 4,160293,1,0 +Mk11=Stimulus,S128,160306,1,0 +Mk12=Stimulus,S 4,162062,1,0 +Mk13=Stimulus,S128,162073,1,0 +Mk14=Stimulus,S 2,163986,1,0 +Mk15=Stimulus,S128,163996,1,0 +Mk16=Stimulus,S 1,165883,1,0 +Mk17=Stimulus,S128,165896,1,0 +Mk18=Stimulus,S128,168339,1,0 +Mk19=Stimulus,S128,205467,1,0 +Mk20=Stimulus,S128,207879,1,0 +Mk21=Stimulus,S 2,211057,1,0 +Mk22=Stimulus,S128,211070,1,0 +Mk23=Stimulus,S 3,212685,1,0 +Mk24=Stimulus,S128,212698,1,0 +Mk25=Stimulus,S 4,214360,1,0 +Mk26=Stimulus,S128,214373,1,0 +Mk27=Stimulus,S 11,214811,1,0 +Mk28=Stimulus,S 1,216334,1,0 +Mk29=Stimulus,S128,216344,1,0 +Mk30=Stimulus,S 11,216776,1,0 +Mk31=Stimulus,S 3,218256,1,0 +Mk32=Stimulus,S128,218269,1,0 +Mk33=Stimulus,S 12,218562,1,0 +Mk34=Stimulus,S 4,219914,1,0 +Mk35=Stimulus,S128,219925,1,0 +Mk36=Stimulus,S 11,220600,1,0 +Mk37=Stimulus,S 3,221934,1,0 +Mk38=Stimulus,S128,221947,1,0 +Mk39=Stimulus,S 11,222367,1,0 +Mk40=Stimulus,S 1,223524,1,0 +Mk41=Stimulus,S128,223538,1,0 +Mk42=Stimulus,S 12,223952,1,0 +Mk43=Stimulus,S 4,225146,1,0 +Mk44=Stimulus,S128,225157,1,0 +Mk45=Stimulus,S 11,225595,1,0 +Mk46=Stimulus,S 3,226718,1,0 +Mk47=Stimulus,S128,226731,1,0 +Mk48=Stimulus,S 2,228587,1,0 +Mk49=Stimulus,S128,228601,1,0 +Mk50=Stimulus,S 12,229021,1,0 +Mk51=Stimulus,S 2,230542,1,0 +Mk52=Stimulus,S128,230555,1,0 +Mk53=Stimulus,S 11,230890,1,0 +Mk54=Stimulus,S 4,232095,1,0 +Mk55=Stimulus,S128,232108,1,0 +Mk56=Stimulus,S 11,232753,1,0 +Mk57=Stimulus,S 3,233777,1,0 +Mk58=Stimulus,S128,233788,1,0 +Mk59=Stimulus,S 11,234178,1,0 +Mk60=Stimulus,S 2,235747,1,0 +Mk61=Stimulus,S128,235760,1,0 +Mk62=Stimulus,S 11,236071,1,0 +Mk63=Stimulus,S 1,237653,1,0 +Mk64=Stimulus,S128,237666,1,0 +Mk65=Stimulus,S 11,237977,1,0 +Mk66=Stimulus,S 3,239548,1,0 +Mk67=Stimulus,S128,239562,1,0 +Mk68=Stimulus,S 11,239915,1,0 +Mk69=Stimulus,S 1,241243,1,0 +Mk70=Stimulus,S128,241253,1,0 +Mk71=Stimulus,S 11,241564,1,0 +Mk72=Stimulus,S 1,243025,1,0 +Mk73=Stimulus,S128,243035,1,0 +Mk74=Stimulus,S 11,243382,1,0 +Mk75=Stimulus,S 2,244947,1,0 +Mk76=Stimulus,S128,244960,1,0 +Mk77=Stimulus,S 11,245332,1,0 +Mk78=Stimulus,S 4,246628,1,0 +Mk79=Stimulus,S128,246641,1,0 +Mk80=Stimulus,S 11,247055,1,0 +Mk81=Stimulus,S 1,248583,1,0 +Mk82=Stimulus,S128,248596,1,0 +Mk83=Stimulus,S 11,248931,1,0 +Mk84=Stimulus,S 4,250385,1,0 +Mk85=Stimulus,S128,250395,1,0 +Mk86=Stimulus,S 11,250815,1,0 +Mk87=Stimulus,S 3,252409,1,0 +Mk88=Stimulus,S128,252422,1,0 +Mk89=Stimulus,S 11,252739,1,0 +Mk90=Stimulus,S 4,254397,1,0 +Mk91=Stimulus,S128,254410,1,0 +Mk92=Stimulus,S 11,254891,1,0 +Mk93=Stimulus,S 4,256376,1,0 +Mk94=Stimulus,S128,256389,1,0 +Mk95=Stimulus,S 11,256718,1,0 +Mk96=Stimulus,S 2,258306,1,0 +Mk97=Stimulus,S128,258320,1,0 +Mk98=Stimulus,S 11,258770,1,0 +Mk99=Stimulus,S 3,260019,1,0 +Mk100=Stimulus,S128,260032,1,0 +Mk101=Stimulus,S 11,260343,1,0 +Mk102=Stimulus,S 1,261876,1,0 +Mk103=Stimulus,S128,261889,1,0 +Mk104=Stimulus,S 11,262206,1,0 +Mk105=Stimulus,S 2,263771,1,0 +Mk106=Stimulus,S128,263784,1,0 +Mk107=Stimulus,S 11,264083,1,0 +Mk108=Stimulus,S 3,265513,1,0 +Mk109=Stimulus,S128,265524,1,0 +Mk110=Stimulus,S 11,265823,1,0 +Mk111=Stimulus,S 1,267505,1,0 +Mk112=Stimulus,S128,267515,1,0 +Mk113=Stimulus,S 11,267844,1,0 +Mk114=Stimulus,S 4,269468,1,0 +Mk115=Stimulus,S128,269478,1,0 +Mk116=Stimulus,S 11,269820,1,0 +Mk117=Stimulus,S 2,271213,1,0 +Mk118=Stimulus,S128,271223,1,0 +Mk119=Stimulus,S 11,271546,1,0 +Mk120=Stimulus,S 2,272825,1,0 +Mk121=Stimulus,S128,272839,1,0 +Mk122=Stimulus,S 11,273186,1,0 +Mk123=Stimulus,S 3,274392,1,0 +Mk124=Stimulus,S128,274405,1,0 +Mk125=Stimulus,S 11,274734,1,0 +Mk126=Stimulus,S 4,276236,1,0 +Mk127=Stimulus,S128,276249,1,0 +Mk128=Stimulus,S 11,276560,1,0 +Mk129=Stimulus,S 2,277784,1,0 +Mk130=Stimulus,S128,277798,1,0 +Mk131=Stimulus,S 11,278163,1,0 +Mk132=Stimulus,S 1,279660,1,0 +Mk133=Stimulus,S128,279670,1,0 +Mk134=Stimulus,S 11,279969,1,0 +Mk135=Stimulus,S 1,281435,1,0 +Mk136=Stimulus,S128,281452,1,0 +Mk137=Stimulus,S 11,281714,1,0 +Mk138=Stimulus,S 51,297233,1,0 +Mk139=Stimulus,S128,297249,1,0 +Mk140=Stimulus,S 52,298888,1,0 +Mk141=Stimulus,S128,298901,1,0 +Mk142=Stimulus,S 51,300812,1,0 +Mk143=Stimulus,S128,300822,1,0 +Mk144=Stimulus,S 51,302763,1,0 +Mk145=Stimulus,S128,302774,1,0 +Mk146=Stimulus,S 53,304479,1,0 +Mk147=Stimulus,S128,304493,1,0 +Mk148=Stimulus,S 52,306458,1,0 +Mk149=Stimulus,S128,306471,1,0 +Mk150=Stimulus,S 53,308103,1,0 +Mk151=Stimulus,S128,308113,1,0 +Mk152=Stimulus,S 53,309939,1,0 +Mk153=Stimulus,S128,309953,1,0 +Mk154=Stimulus,S 52,311597,1,0 +Mk155=Stimulus,S128,311607,1,0 +Mk156=Stimulus,S 53,313208,1,0 +Mk157=Stimulus,S128,313219,1,0 +Mk158=Stimulus,S 53,315148,1,0 +Mk159=Stimulus,S128,315157,1,0 +Mk160=Stimulus,S 52,316819,1,0 +Mk161=Stimulus,S128,316834,1,0 +Mk162=Stimulus,S 52,318411,1,0 +Mk163=Stimulus,S128,318425,1,0 +Mk164=Stimulus,S 53,319953,1,0 +Mk165=Stimulus,S128,319967,1,0 +Mk166=Stimulus,S 52,321531,1,0 +Mk167=Stimulus,S128,321544,1,0 +Mk168=Stimulus,S 54,323194,1,0 +Mk169=Stimulus,S128,323207,1,0 +Mk170=Stimulus,S 52,325215,1,0 +Mk171=Stimulus,S128,325226,1,0 +Mk172=Stimulus,S 52,327065,1,0 +Mk173=Stimulus,S128,327079,1,0 +Mk174=Stimulus,S 53,328626,1,0 +Mk175=Stimulus,S128,328635,1,0 +Mk176=Stimulus,S 54,330330,1,0 +Mk177=Stimulus,S128,330343,1,0 +Mk178=Stimulus,S 53,331962,1,0 +Mk179=Stimulus,S128,331973,1,0 +Mk180=Stimulus,S 51,333986,1,0 +Mk181=Stimulus,S128,333999,1,0 +Mk182=Stimulus,S 51,335886,1,0 +Mk183=Stimulus,S128,335898,1,0 +Mk184=Stimulus,S 54,337906,1,0 +Mk185=Stimulus,S128,337919,1,0 +Mk186=Stimulus,S 54,339527,1,0 +Mk187=Stimulus,S128,339540,1,0 +Mk188=Stimulus,S 51,341085,1,0 +Mk189=Stimulus,S128,341097,1,0 +Mk190=Stimulus,S 54,342845,1,0 +Mk191=Stimulus,S128,342858,1,0 +Mk192=Stimulus,S 52,344492,1,0 +Mk193=Stimulus,S128,344504,1,0 +Mk194=Stimulus,S 51,346375,1,0 +Mk195=Stimulus,S128,346388,1,0 +Mk196=Stimulus,S 54,348147,1,0 +Mk197=Stimulus,S128,348160,1,0 +Mk198=Stimulus,S 54,349849,1,0 +Mk199=Stimulus,S128,349859,1,0 +Mk200=Stimulus,S 51,351802,1,0 +Mk201=Stimulus,S128,351815,1,0 +Mk202=Stimulus,S 52,353725,1,0 +Mk203=Stimulus,S128,353738,1,0 +Mk204=Stimulus,S 54,355484,1,0 +Mk205=Stimulus,S128,355498,1,0 +Mk206=Stimulus,S 51,357150,1,0 +Mk207=Stimulus,S128,357163,1,0 +Mk208=Stimulus,S 53,359086,1,0 +Mk209=Stimulus,S128,359097,1,0 +Mk210=Stimulus,S 54,360765,1,0 +Mk211=Stimulus,S128,360778,1,0 +Mk212=Stimulus,S 54,362749,1,0 +Mk213=Stimulus,S128,362761,1,0 +Mk214=Stimulus,S 53,364417,1,0 +Mk215=Stimulus,S128,364430,1,0 +Mk216=Stimulus,S 51,365958,1,0 +Mk217=Stimulus,S128,365972,1,0 +Mk218=Stimulus,S 52,383762,1,0 +Mk219=Stimulus,S128,383772,1,0 +Mk220=Stimulus,S 52,385295,1,0 +Mk221=Stimulus,S128,385308,1,0 +Mk222=Stimulus,S 53,387201,1,0 +Mk223=Stimulus,S128,387214,1,0 +Mk224=Stimulus,S 52,389198,1,0 +Mk225=Stimulus,S128,389208,1,0 +Mk226=Stimulus,S 51,390871,1,0 +Mk227=Stimulus,S128,390881,1,0 +Mk228=Stimulus,S 51,392494,1,0 +Mk229=Stimulus,S128,392505,1,0 +Mk230=Stimulus,S 53,394294,1,0 +Mk231=Stimulus,S128,394308,1,0 +Mk232=Stimulus,S 54,396115,1,0 +Mk233=Stimulus,S128,396128,1,0 +Mk234=Stimulus,S 51,397688,1,0 +Mk235=Stimulus,S128,397698,1,0 +Mk236=Stimulus,S 54,399239,1,0 +Mk237=Stimulus,S128,399252,1,0 +Mk238=Stimulus,S 51,401150,1,0 +Mk239=Stimulus,S128,401162,1,0 +Mk240=Stimulus,S 53,403042,1,0 +Mk241=Stimulus,S128,403057,1,0 +Mk242=Stimulus,S 52,404725,1,0 +Mk243=Stimulus,S128,404737,1,0 +Mk244=Stimulus,S 53,406599,1,0 +Mk245=Stimulus,S128,406612,1,0 +Mk246=Stimulus,S 54,408219,1,0 +Mk247=Stimulus,S128,408231,1,0 +Mk248=Stimulus,S 53,409893,1,0 +Mk249=Stimulus,S128,409906,1,0 +Mk250=Stimulus,S 54,411914,1,0 +Mk251=Stimulus,S128,411925,1,0 +Mk252=Stimulus,S 51,413914,1,0 +Mk253=Stimulus,S128,413928,1,0 +Mk254=Stimulus,S 54,415918,1,0 +Mk255=Stimulus,S128,415932,1,0 +Mk256=Stimulus,S 53,417583,1,0 +Mk257=Stimulus,S128,417597,1,0 +Mk258=Stimulus,S 52,419301,1,0 +Mk259=Stimulus,S128,419311,1,0 +Mk260=Stimulus,S 51,421119,1,0 +Mk261=Stimulus,S128,421132,1,0 +Mk262=Stimulus,S 51,422678,1,0 +Mk263=Stimulus,S128,422691,1,0 +Mk264=Stimulus,S 51,424414,1,0 +Mk265=Stimulus,S128,424427,1,0 +Mk266=Stimulus,S 54,426180,1,0 +Mk267=Stimulus,S128,426190,1,0 +Mk268=Stimulus,S 53,427791,1,0 +Mk269=Stimulus,S128,427805,1,0 +Mk270=Stimulus,S 52,429334,1,0 +Mk271=Stimulus,S128,429347,1,0 +Mk272=Stimulus,S 51,430893,1,0 +Mk273=Stimulus,S128,430904,1,0 +Mk274=Stimulus,S 52,432724,1,0 +Mk275=Stimulus,S128,432736,1,0 +Mk276=Stimulus,S 54,434264,1,0 +Mk277=Stimulus,S128,434277,1,0 +Mk278=Stimulus,S 52,436188,1,0 +Mk279=Stimulus,S128,436198,1,0 +Mk280=Stimulus,S 53,438079,1,0 +Mk281=Stimulus,S128,438092,1,0 +Mk282=Stimulus,S 51,440046,1,0 +Mk283=Stimulus,S128,440059,1,0 +Mk284=Stimulus,S 52,441600,1,0 +Mk285=Stimulus,S128,441613,1,0 +Mk286=Stimulus,S 53,443411,1,0 +Mk287=Stimulus,S128,443424,1,0 +Mk288=Stimulus,S 54,445280,1,0 +Mk289=Stimulus,S128,445294,1,0 +Mk290=Stimulus,S 54,446822,1,0 +Mk291=Stimulus,S128,446835,1,0 +Mk292=Stimulus,S 54,448443,1,0 +Mk293=Stimulus,S128,448453,1,0 +Mk294=Stimulus,S 52,450315,1,0 +Mk295=Stimulus,S128,450328,1,0 +Mk296=Stimulus,S 53,452136,1,0 +Mk297=Stimulus,S128,452150,1,0 +Mk298=Stimulus,S 53,470020,1,0 +Mk299=Stimulus,S128,470033,1,0 +Mk300=Stimulus,S 52,471579,1,0 +Mk301=Stimulus,S128,471589,1,0 +Mk302=Stimulus,S 51,473221,1,0 +Mk303=Stimulus,S128,473234,1,0 +Mk304=Stimulus,S 51,474902,1,0 +Mk305=Stimulus,S128,474912,1,0 +Mk306=Stimulus,S 53,476871,1,0 +Mk307=Stimulus,S128,476884,1,0 +Mk308=Stimulus,S 52,478625,1,0 +Mk309=Stimulus,S128,478638,1,0 +Mk310=Stimulus,S 54,480318,1,0 +Mk311=Stimulus,S128,480330,1,0 +Mk312=Stimulus,S 54,481919,1,0 +Mk313=Stimulus,S128,481932,1,0 +Mk314=Stimulus,S 52,483509,1,0 +Mk315=Stimulus,S128,483522,1,0 +Mk316=Stimulus,S 51,485184,1,0 +Mk317=Stimulus,S128,485200,1,0 +Mk318=Stimulus,S 53,487020,1,0 +Mk319=Stimulus,S128,487034,1,0 +Mk320=Stimulus,S 53,488556,1,0 +Mk321=Stimulus,S128,488566,1,0 +Mk322=Stimulus,S 54,490520,1,0 +Mk323=Stimulus,S128,490530,1,0 +Mk324=Stimulus,S 54,492410,1,0 +Mk325=Stimulus,S128,492422,1,0 +Mk326=Stimulus,S 51,494163,1,0 +Mk327=Stimulus,S128,494176,1,0 +Mk328=Stimulus,S 54,495802,1,0 +Mk329=Stimulus,S128,495814,1,0 +Mk330=Stimulus,S 53,497397,1,0 +Mk331=Stimulus,S128,497407,1,0 +Mk332=Stimulus,S 52,499210,1,0 +Mk333=Stimulus,S128,499223,1,0 +Mk334=Stimulus,S 51,501043,1,0 +Mk335=Stimulus,S128,501056,1,0 +Mk336=Stimulus,S 51,502621,1,0 +Mk337=Stimulus,S128,502634,1,0 +Mk338=Stimulus,S 51,504339,1,0 +Mk339=Stimulus,S128,504349,1,0 +Mk340=Stimulus,S 53,505913,1,0 +Mk341=Stimulus,S128,505925,1,0 +Mk342=Stimulus,S 54,507696,1,0 +Mk343=Stimulus,S128,507709,1,0 +Mk344=Stimulus,S 51,509560,1,0 +Mk345=Stimulus,S128,509569,1,0 +Mk346=Stimulus,S 52,511171,1,0 +Mk347=Stimulus,S128,511183,1,0 +Mk348=Stimulus,S 54,512906,1,0 +Mk349=Stimulus,S128,512919,1,0 +Mk350=Stimulus,S 53,514781,1,0 +Mk351=Stimulus,S128,514790,1,0 +Mk352=Stimulus,S 52,516337,1,0 +Mk353=Stimulus,S128,516350,1,0 +Mk354=Stimulus,S 52,518297,1,0 +Mk355=Stimulus,S128,518308,1,0 +Mk356=Stimulus,S 53,520002,1,0 +Mk357=Stimulus,S128,520015,1,0 +Mk358=Stimulus,S 51,521986,1,0 +Mk359=Stimulus,S128,521998,1,0 +Mk360=Stimulus,S 51,523582,1,0 +Mk361=Stimulus,S128,523594,1,0 +Mk362=Stimulus,S 54,525331,1,0 +Mk363=Stimulus,S128,525344,1,0 +Mk364=Stimulus,S 52,527269,1,0 +Mk365=Stimulus,S128,527279,1,0 +Mk366=Stimulus,S 52,528917,1,0 +Mk367=Stimulus,S128,528930,1,0 +Mk368=Stimulus,S 53,530944,1,0 +Mk369=Stimulus,S128,530958,1,0 +Mk370=Stimulus,S 54,532480,1,0 +Mk371=Stimulus,S128,532490,1,0 +Mk372=Stimulus,S 54,534418,1,0 +Mk373=Stimulus,S128,534431,1,0 +Mk374=Stimulus,S 53,536063,1,0 +Mk375=Stimulus,S128,536076,1,0 +Mk376=Stimulus,S 52,537792,1,0 +Mk377=Stimulus,S128,537806,1,0 +Mk378=Stimulus,S 52,554772,1,0 +Mk379=Stimulus,S128,554782,1,0 +Mk380=Stimulus,S 53,556571,1,0 +Mk381=Stimulus,S128,556584,1,0 +Mk382=Stimulus,S128,556785,1,0 +Mk383=Stimulus,S 51,558119,1,0 +Mk384=Stimulus,S128,558129,1,0 +Mk385=Stimulus,S 51,559663,1,0 +Mk386=Stimulus,S128,559676,1,0 +Mk387=Stimulus,S 52,561605,1,0 +Mk388=Stimulus,S128,561618,1,0 +Mk389=Stimulus,S 54,563402,1,0 +Mk390=Stimulus,S128,563416,1,0 +Mk391=Stimulus,S 53,565266,1,0 +Mk392=Stimulus,S128,565276,1,0 +Mk393=Stimulus,S 52,567097,1,0 +Mk394=Stimulus,S128,567107,1,0 +Mk395=Stimulus,S 52,568826,1,0 +Mk396=Stimulus,S128,568839,1,0 +Mk397=Stimulus,S 51,570823,1,0 +Mk398=Stimulus,S128,570834,1,0 +Mk399=Stimulus,S 54,572611,1,0 +Mk400=Stimulus,S128,572624,1,0 +Mk401=Stimulus,S 51,574644,1,0 +Mk402=Stimulus,S128,574654,1,0 +Mk403=Stimulus,S 54,576632,1,0 +Mk404=Stimulus,S128,576644,1,0 +Mk405=Stimulus,S 53,578215,1,0 +Mk406=Stimulus,S128,578227,1,0 +Mk407=Stimulus,S 53,579877,1,0 +Mk408=Stimulus,S128,579891,1,0 +Mk409=Stimulus,S 53,581662,1,0 +Mk410=Stimulus,S128,581676,1,0 +Mk411=Stimulus,S 54,583677,1,0 +Mk412=Stimulus,S128,583690,1,0 +Mk413=Stimulus,S 54,585656,1,0 +Mk414=Stimulus,S128,585669,1,0 +Mk415=Stimulus,S 51,587380,1,0 +Mk416=Stimulus,S128,587392,1,0 +Mk417=Stimulus,S 54,589297,1,0 +Mk418=Stimulus,S128,589310,1,0 +Mk419=Stimulus,S 53,591071,1,0 +Mk420=Stimulus,S128,591085,1,0 +Mk421=Stimulus,S 54,592844,1,0 +Mk422=Stimulus,S128,592857,1,0 +Mk423=Stimulus,S 52,594416,1,0 +Mk424=Stimulus,S128,594426,1,0 +Mk425=Stimulus,S 53,596367,1,0 +Mk426=Stimulus,S128,596380,1,0 +Mk427=Stimulus,S 51,598260,1,0 +Mk428=Stimulus,S128,598271,1,0 +Mk429=Stimulus,S 52,599951,1,0 +Mk430=Stimulus,S128,599964,1,0 +Mk431=Stimulus,S 53,601662,1,0 +Mk432=Stimulus,S128,601675,1,0 +Mk433=Stimulus,S 51,603459,1,0 +Mk434=Stimulus,S128,603472,1,0 +Mk435=Stimulus,S 51,605291,1,0 +Mk436=Stimulus,S128,605305,1,0 +Mk437=Stimulus,S 54,606845,1,0 +Mk438=Stimulus,S128,606859,1,0 +Mk439=Stimulus,S 53,608873,1,0 +Mk440=Stimulus,S128,608886,1,0 +Mk441=Stimulus,S 52,610708,1,0 +Mk442=Stimulus,S128,610721,1,0 +Mk443=Stimulus,S 52,612663,1,0 +Mk444=Stimulus,S128,612676,1,0 +Mk445=Stimulus,S 51,614611,1,0 +Mk446=Stimulus,S128,614621,1,0 +Mk447=Stimulus,S 51,616259,1,0 +Mk448=Stimulus,S128,616269,1,0 +Mk449=Stimulus,S 54,617949,1,0 +Mk450=Stimulus,S128,617962,1,0 +Mk451=Stimulus,S 53,619867,1,0 +Mk452=Stimulus,S128,619881,1,0 +Mk453=Stimulus,S 52,621524,1,0 +Mk454=Stimulus,S128,621535,1,0 +Mk455=Stimulus,S 54,623172,1,0 +Mk456=Stimulus,S128,623182,1,0 +Mk457=Stimulus,S 52,625118,1,0 +Mk458=Stimulus,S128,625131,1,0 +Mk459=Stimulus,S 52,642920,1,0 +Mk460=Stimulus,S128,642931,1,0 +Mk461=Stimulus,S 53,644786,1,0 +Mk462=Stimulus,S128,644797,1,0 +Mk463=Stimulus,S 53,646665,1,0 +Mk464=Stimulus,S128,646676,1,0 +Mk465=Stimulus,S 51,648484,1,0 +Mk466=Stimulus,S128,648497,1,0 +Mk467=Stimulus,S 54,650505,1,0 +Mk468=Stimulus,S128,650516,1,0 +Mk469=Stimulus,S 54,652329,1,0 +Mk470=Stimulus,S128,652342,1,0 +Mk471=Stimulus,S 54,654059,1,0 +Mk472=Stimulus,S128,654075,1,0 +Mk473=Stimulus,S 53,655986,1,0 +Mk474=Stimulus,S128,655999,1,0 +Mk475=Stimulus,S 52,657582,1,0 +Mk476=Stimulus,S128,657592,1,0 +Mk477=Stimulus,S 51,659217,1,0 +Mk478=Stimulus,S128,659230,1,0 +Mk479=Stimulus,S 51,661159,1,0 +Mk480=Stimulus,S128,661172,1,0 +Mk481=Stimulus,S 51,663077,1,0 +Mk482=Stimulus,S128,663090,1,0 +Mk483=Stimulus,S 51,664880,1,0 +Mk484=Stimulus,S128,664890,1,0 +Mk485=Stimulus,S 53,666570,1,0 +Mk486=Stimulus,S128,666582,1,0 +Mk487=Stimulus,S 54,668593,1,0 +Mk488=Stimulus,S128,668603,1,0 +Mk489=Stimulus,S 54,670617,1,0 +Mk490=Stimulus,S128,670628,1,0 +Mk491=Stimulus,S 51,672217,1,0 +Mk492=Stimulus,S128,672230,1,0 +Mk493=Stimulus,S 52,673935,1,0 +Mk494=Stimulus,S128,673945,1,0 +Mk495=Stimulus,S 52,675492,1,0 +Mk496=Stimulus,S128,675505,1,0 +Mk497=Stimulus,S 54,677452,1,0 +Mk498=Stimulus,S128,677464,1,0 +Mk499=Stimulus,S 51,679266,1,0 +Mk500=Stimulus,S128,679278,1,0 +Mk501=Stimulus,S 52,681249,1,0 +Mk502=Stimulus,S128,681262,1,0 +Mk503=Stimulus,S 54,682869,1,0 +Mk504=Stimulus,S128,682881,1,0 +Mk505=Stimulus,S 51,684695,1,0 +Mk506=Stimulus,S128,684707,1,0 +Mk507=Stimulus,S 54,686672,1,0 +Mk508=Stimulus,S128,686686,1,0 +Mk509=Stimulus,S 52,688493,1,0 +Mk510=Stimulus,S128,688507,1,0 +Mk511=Stimulus,S 53,690108,1,0 +Mk512=Stimulus,S128,690121,1,0 +Mk513=Stimulus,S 52,691977,1,0 +Mk514=Stimulus,S128,691990,1,0 +Mk515=Stimulus,S 53,693755,1,0 +Mk516=Stimulus,S128,693765,1,0 +Mk517=Stimulus,S 54,695605,1,0 +Mk518=Stimulus,S128,695619,1,0 +Mk519=Stimulus,S 52,697542,1,0 +Mk520=Stimulus,S128,697552,1,0 +Mk521=Stimulus,S 51,699075,1,0 +Mk522=Stimulus,S128,699089,1,0 +Mk523=Stimulus,S 53,700884,1,0 +Mk524=Stimulus,S128,700898,1,0 +Mk525=Stimulus,S 53,702438,1,0 +Mk526=Stimulus,S128,702451,1,0 +Mk527=Stimulus,S 53,704441,1,0 +Mk528=Stimulus,S128,704455,1,0 +Mk529=Stimulus,S 51,706286,1,0 +Mk530=Stimulus,S128,706299,1,0 +Mk531=Stimulus,S 54,708247,1,0 +Mk532=Stimulus,S128,708257,1,0 +Mk533=Stimulus,S 53,709831,1,0 +Mk534=Stimulus,S128,709844,1,0 +Mk535=Stimulus,S 52,711366,1,0 +Mk536=Stimulus,S128,711377,1,0 +Mk537=Stimulus,S 52,713366,1,0 +Mk538=Stimulus,S128,713376,1,0 +Mk539=Stimulus,S 52,742323,1,0 +Mk540=Stimulus,S128,742333,1,0 +Mk541=Stimulus,S 54,744293,1,0 +Mk542=Stimulus,S128,744306,1,0 +Mk543=Stimulus,S 54,745955,1,0 +Mk544=Stimulus,S128,745968,1,0 +Mk545=Stimulus,S 51,747545,1,0 +Mk546=Stimulus,S128,747558,1,0 +Mk547=Stimulus,S 52,749122,1,0 +Mk548=Stimulus,S128,749136,1,0 +Mk549=Stimulus,S 54,750769,1,0 +Mk550=Stimulus,S128,750779,1,0 +Mk551=Stimulus,S 53,752762,1,0 +Mk552=Stimulus,S128,752776,1,0 +Mk553=Stimulus,S 52,754522,1,0 +Mk554=Stimulus,S128,754535,1,0 +Mk555=Stimulus,S 54,756124,1,0 +Mk556=Stimulus,S128,756137,1,0 +Mk557=Stimulus,S 53,757770,1,0 +Mk558=Stimulus,S128,757780,1,0 +Mk559=Stimulus,S 54,759417,1,0 +Mk560=Stimulus,S128,759427,1,0 +Mk561=Stimulus,S 52,760956,1,0 +Mk562=Stimulus,S128,760966,1,0 +Mk563=Stimulus,S 51,762895,1,0 +Mk564=Stimulus,S128,762907,1,0 +Mk565=Stimulus,S 53,764927,1,0 +Mk566=Stimulus,S128,764940,1,0 +Mk567=Stimulus,S 54,766553,1,0 +Mk568=Stimulus,S128,766567,1,0 +Mk569=Stimulus,S 51,768167,1,0 +Mk570=Stimulus,S128,768180,1,0 +Mk571=Stimulus,S 54,770109,1,0 +Mk572=Stimulus,S128,770122,1,0 +Mk573=Stimulus,S 54,771990,1,0 +Mk574=Stimulus,S128,772003,1,0 +Mk575=Stimulus,S 52,773665,1,0 +Mk576=Stimulus,S128,773677,1,0 +Mk577=Stimulus,S 51,775328,1,0 +Mk578=Stimulus,S128,775341,1,0 +Mk579=Stimulus,S 51,776883,1,0 +Mk580=Stimulus,S128,776896,1,0 +Mk581=Stimulus,S 54,778612,1,0 +Mk582=Stimulus,S128,778622,1,0 +Mk583=Stimulus,S 53,780157,1,0 +Mk584=Stimulus,S128,780169,1,0 +Mk585=Stimulus,S 51,781880,1,0 +Mk586=Stimulus,S128,781892,1,0 +Mk587=Stimulus,S 52,783439,1,0 +Mk588=Stimulus,S128,783448,1,0 +Mk589=Stimulus,S 53,785007,1,0 +Mk590=Stimulus,S128,785020,1,0 +Mk591=Stimulus,S 53,786839,1,0 +Mk592=Stimulus,S128,786852,1,0 +Mk593=Stimulus,S 53,788691,1,0 +Mk594=Stimulus,S128,788700,1,0 +Mk595=Stimulus,S 54,790636,1,0 +Mk596=Stimulus,S128,790648,1,0 +Mk597=Stimulus,S 52,792310,1,0 +Mk598=Stimulus,S128,792323,1,0 +Mk599=Stimulus,S 52,794258,1,0 +Mk600=Stimulus,S128,794267,1,0 +Mk601=Stimulus,S 51,795966,1,0 +Mk602=Stimulus,S128,795976,1,0 +Mk603=Stimulus,S 53,797765,1,0 +Mk604=Stimulus,S128,797778,1,0 +Mk605=Stimulus,S 51,799506,1,0 +Mk606=Stimulus,S128,799516,1,0 +Mk607=Stimulus,S 53,801440,1,0 +Mk608=Stimulus,S128,801453,1,0 +Mk609=Stimulus,S 52,803330,1,0 +Mk610=Stimulus,S128,803340,1,0 +Mk611=Stimulus,S 51,805293,1,0 +Mk612=Stimulus,S128,805302,1,0 +Mk613=Stimulus,S 52,807219,1,0 +Mk614=Stimulus,S128,807229,1,0 +Mk615=Stimulus,S 53,808915,1,0 +Mk616=Stimulus,S128,808925,1,0 +Mk617=Stimulus,S 51,810544,1,0 +Mk618=Stimulus,S128,810557,1,0 +Mk619=Stimulus,S 53,826507,1,0 +Mk620=Stimulus,S128,826520,1,0 +Mk621=Stimulus,S 52,828182,1,0 +Mk622=Stimulus,S128,828196,1,0 +Mk623=Stimulus,S 53,829725,1,0 +Mk624=Stimulus,S128,829739,1,0 +Mk625=Stimulus,S 53,831728,1,0 +Mk626=Stimulus,S128,831742,1,0 +Mk627=Stimulus,S 51,833440,1,0 +Mk628=Stimulus,S128,833453,1,0 +Mk629=Stimulus,S 53,835157,1,0 +Mk630=Stimulus,S128,835167,1,0 +Mk631=Stimulus,S 51,836860,1,0 +Mk632=Stimulus,S128,836873,1,0 +Mk633=Stimulus,S 51,838626,1,0 +Mk634=Stimulus,S128,838635,1,0 +Mk635=Stimulus,S 52,840582,1,0 +Mk636=Stimulus,S128,840596,1,0 +Mk637=Stimulus,S 51,842295,1,0 +Mk638=Stimulus,S128,842310,1,0 +Mk639=Stimulus,S 53,843996,1,0 +Mk640=Stimulus,S128,844009,1,0 +Mk641=Stimulus,S 51,846029,1,0 +Mk642=Stimulus,S128,846039,1,0 +Mk643=Stimulus,S 54,847834,1,0 +Mk644=Stimulus,S128,847844,1,0 +Mk645=Stimulus,S 51,849719,1,0 +Mk646=Stimulus,S128,849732,1,0 +Mk647=Stimulus,S 54,851327,1,0 +Mk648=Stimulus,S128,851338,1,0 +Mk649=Stimulus,S 54,853127,1,0 +Mk650=Stimulus,S128,853140,1,0 +Mk651=Stimulus,S 53,854954,1,0 +Mk652=Stimulus,S128,854964,1,0 +Mk653=Stimulus,S 52,856622,1,0 +Mk654=Stimulus,S128,856635,1,0 +Mk655=Stimulus,S 52,858176,1,0 +Mk656=Stimulus,S128,858189,1,0 +Mk657=Stimulus,S 51,859790,1,0 +Mk658=Stimulus,S128,859804,1,0 +Mk659=Stimulus,S 54,861545,1,0 +Mk660=Stimulus,S128,861555,1,0 +Mk661=Stimulus,S 52,863198,1,0 +Mk662=Stimulus,S128,863211,1,0 +Mk663=Stimulus,S 53,865195,1,0 +Mk664=Stimulus,S128,865205,1,0 +Mk665=Stimulus,S 51,867043,1,0 +Mk666=Stimulus,S128,867057,1,0 +Mk667=Stimulus,S 54,868743,1,0 +Mk668=Stimulus,S128,868755,1,0 +Mk669=Stimulus,S 52,870684,1,0 +Mk670=Stimulus,S128,870696,1,0 +Mk671=Stimulus,S 52,872540,1,0 +Mk672=Stimulus,S128,872553,1,0 +Mk673=Stimulus,S 51,874239,1,0 +Mk674=Stimulus,S128,874252,1,0 +Mk675=Stimulus,S 52,875998,1,0 +Mk676=Stimulus,S128,876012,1,0 +Mk677=Stimulus,S 53,877789,1,0 +Mk678=Stimulus,S128,877799,1,0 +Mk679=Stimulus,S 54,879608,1,0 +Mk680=Stimulus,S128,879621,1,0 +Mk681=Stimulus,S 51,881428,1,0 +Mk682=Stimulus,S128,881442,1,0 +Mk683=Stimulus,S 54,883288,1,0 +Mk684=Stimulus,S128,883302,1,0 +Mk685=Stimulus,S 54,884872,1,0 +Mk686=Stimulus,S128,884882,1,0 +Mk687=Stimulus,S 54,886666,1,0 +Mk688=Stimulus,S128,886676,1,0 +Mk689=Stimulus,S 54,888398,1,0 +Mk690=Stimulus,S128,888409,1,0 +Mk691=Stimulus,S 52,890222,1,0 +Mk692=Stimulus,S128,890236,1,0 +Mk693=Stimulus,S 53,891758,1,0 +Mk694=Stimulus,S128,891769,1,0 +Mk695=Stimulus,S 53,893431,1,0 +Mk696=Stimulus,S128,893441,1,0 +Mk697=Stimulus,S 52,895048,1,0 +Mk698=Stimulus,S128,895062,1,0 +Mk699=Stimulus,S 53,922966,1,0 +Mk700=Stimulus,S128,922979,1,0 +Mk701=Stimulus,S 52,924616,1,0 +Mk702=Stimulus,S128,924629,1,0 +Mk703=Stimulus,S 51,926273,1,0 +Mk704=Stimulus,S128,926283,1,0 +Mk705=Stimulus,S 51,928284,1,0 +Mk706=Stimulus,S128,928298,1,0 +Mk707=Stimulus,S 51,929941,1,0 +Mk708=Stimulus,S128,929954,1,0 +Mk709=Stimulus,S 52,931719,1,0 +Mk710=Stimulus,S128,931731,1,0 +Mk711=Stimulus,S 53,933442,1,0 +Mk712=Stimulus,S128,933455,1,0 +Mk713=Stimulus,S 52,935433,1,0 +Mk714=Stimulus,S128,935446,1,0 +Mk715=Stimulus,S 54,937280,1,0 +Mk716=Stimulus,S128,937293,1,0 +Mk717=Stimulus,S 54,938961,1,0 +Mk718=Stimulus,S128,938971,1,0 +Mk719=Stimulus,S 51,940706,1,0 +Mk720=Stimulus,S128,940716,1,0 +Mk721=Stimulus,S 54,942444,1,0 +Mk722=Stimulus,S128,942458,1,0 +Mk723=Stimulus,S 53,944307,1,0 +Mk724=Stimulus,S128,944320,1,0 +Mk725=Stimulus,S 51,946127,1,0 +Mk726=Stimulus,S128,946140,1,0 +Mk727=Stimulus,S 52,948002,1,0 +Mk728=Stimulus,S128,948012,1,0 +Mk729=Stimulus,S 52,949850,1,0 +Mk730=Stimulus,S128,949865,1,0 +Mk731=Stimulus,S 52,951794,1,0 +Mk732=Stimulus,S128,951808,1,0 +Mk733=Stimulus,S 54,953615,1,0 +Mk734=Stimulus,S128,953628,1,0 +Mk735=Stimulus,S 53,955217,1,0 +Mk736=Stimulus,S128,955230,1,0 +Mk737=Stimulus,S 53,956910,1,0 +Mk738=Stimulus,S128,956920,1,0 +Mk739=Stimulus,S 54,958649,1,0 +Mk740=Stimulus,S128,958663,1,0 +Mk741=Stimulus,S 54,960458,1,0 +Mk742=Stimulus,S128,960471,1,0 +Mk743=Stimulus,S 53,962473,1,0 +Mk744=Stimulus,S128,962485,1,0 +Mk745=Stimulus,S 51,964338,1,0 +Mk746=Stimulus,S128,964349,1,0 +Mk747=Stimulus,S 52,966289,1,0 +Mk748=Stimulus,S128,966300,1,0 +Mk749=Stimulus,S 51,968101,1,0 +Mk750=Stimulus,S128,968115,1,0 +Mk751=Stimulus,S 52,969661,1,0 +Mk752=Stimulus,S128,969672,1,0 +Mk753=Stimulus,S 51,971619,1,0 +Mk754=Stimulus,S128,971632,1,0 +Mk755=Stimulus,S 51,973270,1,0 +Mk756=Stimulus,S128,973283,1,0 +Mk757=Stimulus,S 51,974896,1,0 +Mk758=Stimulus,S128,974909,1,0 +Mk759=Stimulus,S 54,976584,1,0 +Mk760=Stimulus,S128,976597,1,0 +Mk761=Stimulus,S 54,978549,1,0 +Mk762=Stimulus,S128,978563,1,0 +Mk763=Stimulus,S 53,980122,1,0 +Mk764=Stimulus,S128,980132,1,0 +Mk765=Stimulus,S 54,982006,1,0 +Mk766=Stimulus,S128,982020,1,0 +Mk767=Stimulus,S 52,983657,1,0 +Mk768=Stimulus,S128,983671,1,0 +Mk769=Stimulus,S 53,985229,1,0 +Mk770=Stimulus,S128,985239,1,0 +Mk771=Stimulus,S 53,986992,1,0 +Mk772=Stimulus,S128,987005,1,0 +Mk773=Stimulus,S 53,988928,1,0 +Mk774=Stimulus,S128,988937,1,0 +Mk775=Stimulus,S 52,990899,1,0 +Mk776=Stimulus,S128,990912,1,0 +Mk777=Stimulus,S 54,992435,1,0 +Mk778=Stimulus,S128,992445,1,0 +Mk779=Stimulus,S 54,1009712,1,0 +Mk780=Stimulus,S128,1009725,1,0 +Mk781=Stimulus,S 54,1011726,1,0 +Mk782=Stimulus,S128,1011739,1,0 +Mk783=Stimulus,S 52,1013291,1,0 +Mk784=Stimulus,S128,1013305,1,0 +Mk785=Stimulus,S 53,1015124,1,0 +Mk786=Stimulus,S128,1015136,1,0 +Mk787=Stimulus,S 54,1016992,1,0 +Mk788=Stimulus,S128,1017005,1,0 +Mk789=Stimulus,S 53,1018621,1,0 +Mk790=Stimulus,S128,1018634,1,0 +Mk791=Stimulus,S 51,1020223,1,0 +Mk792=Stimulus,S128,1020238,1,0 +Mk793=Stimulus,S 52,1022234,1,0 +Mk794=Stimulus,S128,1022244,1,0 +Mk795=Stimulus,S 51,1024052,1,0 +Mk796=Stimulus,S128,1024062,1,0 +Mk797=Stimulus,S 54,1026082,1,0 +Mk798=Stimulus,S128,1026095,1,0 +Mk799=Stimulus,S 54,1027690,1,0 +Mk800=Stimulus,S128,1027700,1,0 +Mk801=Stimulus,S 52,1029253,1,0 +Mk802=Stimulus,S128,1029263,1,0 +Mk803=Stimulus,S 51,1031145,1,0 +Mk804=Stimulus,S128,1031157,1,0 +Mk805=Stimulus,S 51,1033147,1,0 +Mk806=Stimulus,S128,1033160,1,0 +Mk807=Stimulus,S 53,1035036,1,0 +Mk808=Stimulus,S128,1035048,1,0 +Mk809=Stimulus,S 52,1036915,1,0 +Mk810=Stimulus,S128,1036928,1,0 +Mk811=Stimulus,S 54,1038857,1,0 +Mk812=Stimulus,S128,1038871,1,0 +Mk813=Stimulus,S 52,1040411,1,0 +Mk814=Stimulus,S128,1040425,1,0 +Mk815=Stimulus,S 51,1042360,1,0 +Mk816=Stimulus,S128,1042369,1,0 +Mk817=Stimulus,S 52,1044340,1,0 +Mk818=Stimulus,S128,1044354,1,0 +Mk819=Stimulus,S 51,1046150,1,0 +Mk820=Stimulus,S128,1046163,1,0 +Mk821=Stimulus,S 51,1047916,1,0 +Mk822=Stimulus,S128,1047926,1,0 +Mk823=Stimulus,S 54,1049788,1,0 +Mk824=Stimulus,S128,1049801,1,0 +Mk825=Stimulus,S 53,1051644,1,0 +Mk826=Stimulus,S128,1051658,1,0 +Mk827=Stimulus,S 54,1053441,1,0 +Mk828=Stimulus,S128,1053454,1,0 +Mk829=Stimulus,S 52,1055273,1,0 +Mk830=Stimulus,S128,1055286,1,0 +Mk831=Stimulus,S 51,1057172,1,0 +Mk832=Stimulus,S128,1057182,1,0 +Mk833=Stimulus,S 53,1059099,1,0 +Mk834=Stimulus,S128,1059108,1,0 +Mk835=Stimulus,S 51,1060673,1,0 +Mk836=Stimulus,S128,1060683,1,0 +Mk837=Stimulus,S 52,1062541,1,0 +Mk838=Stimulus,S128,1062554,1,0 +Mk839=Stimulus,S 53,1064325,1,0 +Mk840=Stimulus,S128,1064338,1,0 +Mk841=Stimulus,S 54,1066249,1,0 +Mk842=Stimulus,S128,1066260,1,0 +Mk843=Stimulus,S 54,1067885,1,0 +Mk844=Stimulus,S128,1067898,1,0 +Mk845=Stimulus,S 51,1069821,1,0 +Mk846=Stimulus,S128,1069832,1,0 +Mk847=Stimulus,S 53,1071669,1,0 +Mk848=Stimulus,S128,1071682,1,0 +Mk849=Stimulus,S 52,1073315,1,0 +Mk850=Stimulus,S128,1073326,1,0 +Mk851=Stimulus,S 53,1074952,1,0 +Mk852=Stimulus,S128,1074965,1,0 +Mk853=Stimulus,S 53,1076884,1,0 +Mk854=Stimulus,S128,1076896,1,0 +Mk855=Stimulus,S 53,1078473,1,0 +Mk856=Stimulus,S128,1078486,1,0 +Mk857=Stimulus,S 52,1080463,1,0 +Mk858=Stimulus,S128,1080477,1,0 +Mk859=Stimulus,S 52,1096320,1,0 +Mk860=Stimulus,S128,1096330,1,0 +Mk861=Stimulus,S 52,1097973,1,0 +Mk862=Stimulus,S128,1097986,1,0 +Mk863=Stimulus,S 52,1099617,1,0 +Mk864=Stimulus,S128,1099628,1,0 +Mk865=Stimulus,S 51,1101174,1,0 +Mk866=Stimulus,S128,1101188,1,0 +Mk867=Stimulus,S 53,1102898,1,0 +Mk868=Stimulus,S128,1102911,1,0 +Mk869=Stimulus,S 53,1104451,1,0 +Mk870=Stimulus,S128,1104465,1,0 +Mk871=Stimulus,S 52,1106230,1,0 +Mk872=Stimulus,S128,1106242,1,0 +Mk873=Stimulus,S 53,1108092,1,0 +Mk874=Stimulus,S128,1108104,1,0 +Mk875=Stimulus,S 52,1109942,1,0 +Mk876=Stimulus,S128,1109953,1,0 +Mk877=Stimulus,S 54,1111815,1,0 +Mk878=Stimulus,S128,1111828,1,0 +Mk879=Stimulus,S 54,1113665,1,0 +Mk880=Stimulus,S128,1113676,1,0 +Mk881=Stimulus,S 53,1115496,1,0 +Mk882=Stimulus,S128,1115506,1,0 +Mk883=Stimulus,S 53,1117471,1,0 +Mk884=Stimulus,S128,1117481,1,0 +Mk885=Stimulus,S 53,1119240,1,0 +Mk886=Stimulus,S128,1119252,1,0 +Mk887=Stimulus,S 54,1120807,1,0 +Mk888=Stimulus,S128,1120820,1,0 +Mk889=Stimulus,S 54,1122561,1,0 +Mk890=Stimulus,S128,1122572,1,0 +Mk891=Stimulus,S 51,1124277,1,0 +Mk892=Stimulus,S128,1124290,1,0 +Mk893=Stimulus,S 51,1126031,1,0 +Mk894=Stimulus,S128,1126043,1,0 +Mk895=Stimulus,S 51,1127796,1,0 +Mk896=Stimulus,S128,1127809,1,0 +Mk897=Stimulus,S 54,1129483,1,0 +Mk898=Stimulus,S128,1129496,1,0 +Mk899=Stimulus,S 52,1131394,1,0 +Mk900=Stimulus,S128,1131405,1,0 +Mk901=Stimulus,S 52,1133024,1,0 +Mk902=Stimulus,S128,1133037,1,0 +Mk903=Stimulus,S 51,1134832,1,0 +Mk904=Stimulus,S128,1134846,1,0 +Mk905=Stimulus,S 54,1136451,1,0 +Mk906=Stimulus,S128,1136463,1,0 +Mk907=Stimulus,S 51,1138362,1,0 +Mk908=Stimulus,S128,1138373,1,0 +Mk909=Stimulus,S 51,1140368,1,0 +Mk910=Stimulus,S128,1140382,1,0 +Mk911=Stimulus,S 54,1141995,1,0 +Mk912=Stimulus,S128,1142008,1,0 +Mk913=Stimulus,S 54,1143646,1,0 +Mk914=Stimulus,S128,1143659,1,0 +Mk915=Stimulus,S 53,1145667,1,0 +Mk916=Stimulus,S128,1145677,1,0 +Mk917=Stimulus,S 52,1147256,1,0 +Mk918=Stimulus,S128,1147267,1,0 +Mk919=Stimulus,S 51,1148868,1,0 +Mk920=Stimulus,S128,1148880,1,0 +Mk921=Stimulus,S 54,1150470,1,0 +Mk922=Stimulus,S128,1150483,1,0 +Mk923=Stimulus,S 54,1152436,1,0 +Mk924=Stimulus,S128,1152450,1,0 +Mk925=Stimulus,S 52,1154306,1,0 +Mk926=Stimulus,S128,1154319,1,0 +Mk927=Stimulus,S 53,1156109,1,0 +Mk928=Stimulus,S128,1156119,1,0 +Mk929=Stimulus,S 52,1157708,1,0 +Mk930=Stimulus,S128,1157718,1,0 +Mk931=Stimulus,S 53,1159391,1,0 +Mk932=Stimulus,S128,1159405,1,0 +Mk933=Stimulus,S 53,1161390,1,0 +Mk934=Stimulus,S128,1161402,1,0 +Mk935=Stimulus,S 51,1162991,1,0 +Mk936=Stimulus,S128,1163004,1,0 +Mk937=Stimulus,S 51,1164550,1,0 +Mk938=Stimulus,S128,1164562,1,0 +Mk939=Stimulus,S128,1182785,1,0 diff --git a/code/eeg_timing_test/thrive_sys_1_timingtest_resp.vmrk b/code/eeg_timing_test/thrive_sys_1_timingtest_resp.vmrk new file mode 100644 index 0000000..700f382 --- /dev/null +++ b/code/eeg_timing_test/thrive_sys_1_timingtest_resp.vmrk @@ -0,0 +1,3488 @@ +BrainVision Data Exchange Marker File Version 1.0 + +[Common Infos] +Codepage=UTF-8 +DataFile=sys-2-timetest-resp.eeg + +[Marker Infos] +; Each entry: Mk=,,, +; , +; Fields are delimited by commas, some fields might be omitted (empty). +; Commas in type or description text are coded as "\1". +Mk1=New Segment,,1,1,0,20230604181650412387 +Mk2=Stimulus,S128,3952,1,0 +Mk3=Stimulus,S128,4011,1,0 +Mk4=Stimulus,S128,4037,1,0 +Mk5=Stimulus,S128,12581,1,0 +Mk6=Stimulus,S128,12610,1,0 +Mk7=Stimulus,S128,14577,1,0 +Mk8=Stimulus,S 1,17670,1,0 +Mk9=Stimulus,S 11,18070,1,0 +Mk10=Stimulus,S 3,19603,1,0 +Mk11=Stimulus,S 11,20139,1,0 +Mk12=Stimulus,S 1,21285,1,0 +Mk13=Stimulus,S 11,21673,1,0 +Mk14=Stimulus,S 2,23073,1,0 +Mk15=Stimulus,S 11,23446,1,0 +Mk16=Stimulus,S 3,24700,1,0 +Mk17=Stimulus,S 11,25128,1,0 +Mk18=Stimulus,S128,25132,1,0 +Mk19=Stimulus,S 3,26630,1,0 +Mk20=Stimulus,S 11,27051,1,0 +Mk21=Stimulus,S128,27056,1,0 +Mk22=Stimulus,S 3,28615,1,0 +Mk23=Stimulus,S 11,29052,1,0 +Mk24=Stimulus,S128,29056,1,0 +Mk25=Stimulus,S 3,30598,1,0 +Mk26=Stimulus,S128,31033,1,0 +Mk27=Stimulus,S139,31036,1,0 +Mk28=Stimulus,S128,31039,1,0 +Mk29=Stimulus,S 4,32151,1,0 +Mk30=Stimulus,S 11,32615,1,0 +Mk31=Stimulus,S128,32617,1,0 +Mk32=Stimulus,S 4,34012,1,0 +Mk33=Stimulus,S139,34494,1,0 +Mk34=Stimulus,S128,34496,1,0 +Mk35=Stimulus,S 3,36020,1,0 +Mk36=Stimulus,S 11,36499,1,0 +Mk37=Stimulus,S139,36500,1,0 +Mk38=Stimulus,S128,36503,1,0 +Mk39=Stimulus,S 3,37559,1,0 +Mk40=Stimulus,S128,37964,1,0 +Mk41=Stimulus,S139,37966,1,0 +Mk42=Stimulus,S128,37969,1,0 +Mk43=Stimulus,S 3,39310,1,0 +Mk44=Stimulus,S 11,39738,1,0 +Mk45=Stimulus,S 1,41210,1,0 +Mk46=Stimulus,S128,41577,1,0 +Mk47=Stimulus,S139,41580,1,0 +Mk48=Stimulus,S128,41582,1,0 +Mk49=Stimulus,S 4,42998,1,0 +Mk50=Stimulus,S 11,43552,1,0 +Mk51=Stimulus,S 1,44861,1,0 +Mk52=Stimulus,S 11,45341,1,0 +Mk53=Stimulus,S128,45347,1,0 +Mk54=Stimulus,S 4,46666,1,0 +Mk55=Stimulus,S 11,47150,1,0 +Mk56=Stimulus,S128,47186,1,0 +Mk57=Stimulus,S 2,48482,1,0 +Mk58=Stimulus,S128,48990,1,0 +Mk59=Stimulus,S139,48992,1,0 +Mk60=Stimulus,S128,48995,1,0 +Mk61=Stimulus,S 4,50379,1,0 +Mk62=Stimulus,S139,50862,1,0 +Mk63=Stimulus,S128,50865,1,0 +Mk64=Stimulus,S 2,51994,1,0 +Mk65=Stimulus,S128,52413,1,0 +Mk66=Stimulus,S139,52416,1,0 +Mk67=Stimulus,S128,52419,1,0 +Mk68=Stimulus,S 4,53694,1,0 +Mk69=Stimulus,S128,54156,1,0 +Mk70=Stimulus,S139,54158,1,0 +Mk71=Stimulus,S128,54160,1,0 +Mk72=Stimulus,S 4,55400,1,0 +Mk73=Stimulus,S128,55886,1,0 +Mk74=Stimulus,S139,55891,1,0 +Mk75=Stimulus,S128,55893,1,0 +Mk76=Stimulus,S 4,57128,1,0 +Mk77=Stimulus,S 11,57567,1,0 +Mk78=Stimulus,S128,57571,1,0 +Mk79=Stimulus,S 2,58859,1,0 +Mk80=Stimulus,S 11,59176,1,0 +Mk81=Stimulus,S128,59179,1,0 +Mk82=Stimulus,S 3,60593,1,0 +Mk83=Stimulus,S 12,61030,1,0 +Mk84=Stimulus,S 21,61055,1,0 +Mk85=Stimulus,S128,61058,1,0 +Mk86=Stimulus,S 2,62496,1,0 +Mk87=Stimulus,S139,62875,1,0 +Mk88=Stimulus,S128,62878,1,0 +Mk89=Stimulus,S 1,64038,1,0 +Mk90=Stimulus,S139,64454,1,0 +Mk91=Stimulus,S128,64457,1,0 +Mk92=Stimulus,S 4,65610,1,0 +Mk93=Stimulus,S 11,66016,1,0 +Mk94=Stimulus,S 3,67319,1,0 +Mk95=Stimulus,S 11,67733,1,0 +Mk96=Stimulus,S 1,69316,1,0 +Mk97=Stimulus,S128,69765,1,0 +Mk98=Stimulus,S139,69767,1,0 +Mk99=Stimulus,S128,69770,1,0 +Mk100=Stimulus,S 1,70997,1,0 +Mk101=Stimulus,S 11,71474,1,0 +Mk102=Stimulus,S139,71476,1,0 +Mk103=Stimulus,S128,71477,1,0 +Mk104=Stimulus,S 2,72669,1,0 +Mk105=Stimulus,S128,73110,1,0 +Mk106=Stimulus,S139,73114,1,0 +Mk107=Stimulus,S128,73117,1,0 +Mk108=Stimulus,S 2,74271,1,0 +Mk109=Stimulus,S139,74625,1,0 +Mk110=Stimulus,S128,74628,1,0 +Mk111=Stimulus,S 1,75946,1,0 +Mk112=Stimulus,S128,76302,1,0 +Mk113=Stimulus,S139,76306,1,0 +Mk114=Stimulus,S128,76309,1,0 +Mk115=Stimulus,S 1,77663,1,0 +Mk116=Stimulus,S128,77960,1,0 +Mk117=Stimulus,S139,77966,1,0 +Mk118=Stimulus,S128,77969,1,0 +Mk119=Stimulus,S 2,79450,1,0 +Mk120=Stimulus,S128,79805,1,0 +Mk121=Stimulus,S139,79806,1,0 +Mk122=Stimulus,S128,79809,1,0 +Mk123=Stimulus,S 1,81254,1,0 +Mk124=Stimulus,S 11,81545,1,0 +Mk125=Stimulus,S139,81546,1,0 +Mk126=Stimulus,S128,81548,1,0 +Mk127=Stimulus,S 2,83268,1,0 +Mk128=Stimulus,S 11,83610,1,0 +Mk129=Stimulus,S 2,85145,1,0 +Mk130=Stimulus,S139,85585,1,0 +Mk131=Stimulus,S128,85587,1,0 +Mk132=Stimulus,S 4,86911,1,0 +Mk133=Stimulus,S128,87372,1,0 +Mk134=Stimulus,S139,87379,1,0 +Mk135=Stimulus,S128,87382,1,0 +Mk136=Stimulus,S128,96568,1,0 +Mk137=Stimulus,S 51,99668,1,0 +Mk138=Stimulus,S128,100100,1,0 +Mk139=Stimulus,S139,100101,1,0 +Mk140=Stimulus,S128,100104,1,0 +Mk141=Stimulus,S 54,101222,1,0 +Mk142=Stimulus,S128,101756,1,0 +Mk143=Stimulus,S139,101759,1,0 +Mk144=Stimulus,S128,101761,1,0 +Mk145=Stimulus,S 52,102910,1,0 +Mk146=Stimulus,S 11,103356,1,0 +Mk147=Stimulus,S128,103359,1,0 +Mk148=Stimulus,S 54,104695,1,0 +Mk149=Stimulus,S128,105139,1,0 +Mk150=Stimulus,S139,105141,1,0 +Mk151=Stimulus,S128,105144,1,0 +Mk152=Stimulus,S 52,106644,1,0 +Mk153=Stimulus,S128,106950,1,0 +Mk154=Stimulus,S139,106953,1,0 +Mk155=Stimulus,S128,106956,1,0 +Mk156=Stimulus,S 54,108639,1,0 +Mk157=Stimulus,S128,109058,1,0 +Mk158=Stimulus,S139,109060,1,0 +Mk159=Stimulus,S128,109063,1,0 +Mk160=Stimulus,S 54,110666,1,0 +Mk161=Stimulus,S128,111170,1,0 +Mk162=Stimulus,S139,111173,1,0 +Mk163=Stimulus,S128,111176,1,0 +Mk164=Stimulus,S 53,112259,1,0 +Mk165=Stimulus,S128,112766,1,0 +Mk166=Stimulus,S139,112774,1,0 +Mk167=Stimulus,S128,112777,1,0 +Mk168=Stimulus,S 54,113933,1,0 +Mk169=Stimulus,S 11,114400,1,0 +Mk170=Stimulus,S128,114403,1,0 +Mk171=Stimulus,S 51,115801,1,0 +Mk172=Stimulus,S 11,116135,1,0 +Mk173=Stimulus,S139,116136,1,0 +Mk174=Stimulus,S128,116138,1,0 +Mk175=Stimulus,S 52,117530,1,0 +Mk176=Stimulus,S 11,117879,1,0 +Mk177=Stimulus,S139,117880,1,0 +Mk178=Stimulus,S128,117882,1,0 +Mk179=Stimulus,S 53,119309,1,0 +Mk180=Stimulus,S128,119663,1,0 +Mk181=Stimulus,S139,119668,1,0 +Mk182=Stimulus,S128,119671,1,0 +Mk183=Stimulus,S 54,121262,1,0 +Mk184=Stimulus,S128,121728,1,0 +Mk185=Stimulus,S139,121731,1,0 +Mk186=Stimulus,S128,121734,1,0 +Mk187=Stimulus,S 52,122979,1,0 +Mk188=Stimulus,S 11,123355,1,0 +Mk189=Stimulus,S139,123356,1,0 +Mk190=Stimulus,S128,123358,1,0 +Mk191=Stimulus,S 53,124580,1,0 +Mk192=Stimulus,S128,124969,1,0 +Mk193=Stimulus,S139,124970,1,0 +Mk194=Stimulus,S128,124973,1,0 +Mk195=Stimulus,S 51,126511,1,0 +Mk196=Stimulus,S 11,126859,1,0 +Mk197=Stimulus,S139,126861,1,0 +Mk198=Stimulus,S128,126862,1,0 +Mk199=Stimulus,S 52,128435,1,0 +Mk200=Stimulus,S128,128792,1,0 +Mk201=Stimulus,S139,128793,1,0 +Mk202=Stimulus,S128,128796,1,0 +Mk203=Stimulus,S 52,130194,1,0 +Mk204=Stimulus,S128,130549,1,0 +Mk205=Stimulus,S139,130554,1,0 +Mk206=Stimulus,S128,130557,1,0 +Mk207=Stimulus,S 52,131875,1,0 +Mk208=Stimulus,S128,132309,1,0 +Mk209=Stimulus,S139,132311,1,0 +Mk210=Stimulus,S128,132314,1,0 +Mk211=Stimulus,S 53,133633,1,0 +Mk212=Stimulus,S 11,134048,1,0 +Mk213=Stimulus,S139,134050,1,0 +Mk214=Stimulus,S128,134051,1,0 +Mk215=Stimulus,S 53,135558,1,0 +Mk216=Stimulus,S 11,136033,1,0 +Mk217=Stimulus,S128,136035,1,0 +Mk218=Stimulus,S 51,137329,1,0 +Mk219=Stimulus,S128,137706,1,0 +Mk220=Stimulus,S139,137708,1,0 +Mk221=Stimulus,S128,137711,1,0 +Mk222=Stimulus,S 53,139187,1,0 +Mk223=Stimulus,S128,139569,1,0 +Mk224=Stimulus,S139,139572,1,0 +Mk225=Stimulus,S128,139574,1,0 +Mk226=Stimulus,S 51,141014,1,0 +Mk227=Stimulus,S139,141329,1,0 +Mk228=Stimulus,S128,141332,1,0 +Mk229=Stimulus,S 53,142863,1,0 +Mk230=Stimulus,S128,143224,1,0 +Mk231=Stimulus,S139,143229,1,0 +Mk232=Stimulus,S128,143232,1,0 +Mk233=Stimulus,S 53,144719,1,0 +Mk234=Stimulus,S128,145003,1,0 +Mk235=Stimulus,S139,145007,1,0 +Mk236=Stimulus,S128,145010,1,0 +Mk237=Stimulus,S 52,146425,1,0 +Mk238=Stimulus,S128,146813,1,0 +Mk239=Stimulus,S139,146819,1,0 +Mk240=Stimulus,S128,146822,1,0 +Mk241=Stimulus,S 54,148170,1,0 +Mk242=Stimulus,S128,148689,1,0 +Mk243=Stimulus,S139,148693,1,0 +Mk244=Stimulus,S128,148695,1,0 +Mk245=Stimulus,S 51,149741,1,0 +Mk246=Stimulus,S128,150268,1,0 +Mk247=Stimulus,S139,150271,1,0 +Mk248=Stimulus,S128,150274,1,0 +Mk249=Stimulus,S 52,151670,1,0 +Mk250=Stimulus,S128,152127,1,0 +Mk251=Stimulus,S139,152128,1,0 +Mk252=Stimulus,S128,152130,1,0 +Mk253=Stimulus,S 52,153540,1,0 +Mk254=Stimulus,S139,154009,1,0 +Mk255=Stimulus,S128,154012,1,0 +Mk256=Stimulus,S 51,155482,1,0 +Mk257=Stimulus,S128,155926,1,0 +Mk258=Stimulus,S139,155928,1,0 +Mk259=Stimulus,S128,155931,1,0 +Mk260=Stimulus,S 51,157231,1,0 +Mk261=Stimulus,S128,157592,1,0 +Mk262=Stimulus,S139,157597,1,0 +Mk263=Stimulus,S128,157600,1,0 +Mk264=Stimulus,S 53,158980,1,0 +Mk265=Stimulus,S128,159416,1,0 +Mk266=Stimulus,S139,159420,1,0 +Mk267=Stimulus,S128,159422,1,0 +Mk268=Stimulus,S 51,160863,1,0 +Mk269=Stimulus,S128,161245,1,0 +Mk270=Stimulus,S139,161248,1,0 +Mk271=Stimulus,S128,161250,1,0 +Mk272=Stimulus,S 51,162866,1,0 +Mk273=Stimulus,S128,163205,1,0 +Mk274=Stimulus,S139,163208,1,0 +Mk275=Stimulus,S128,163211,1,0 +Mk276=Stimulus,S 54,164839,1,0 +Mk277=Stimulus,S128,165497,1,0 +Mk278=Stimulus,S139,165500,1,0 +Mk279=Stimulus,S128,165503,1,0 +Mk280=Stimulus,S 54,166531,1,0 +Mk281=Stimulus,S128,167216,1,0 +Mk282=Stimulus,S139,167219,1,0 +Mk283=Stimulus,S128,167222,1,0 +Mk284=Stimulus,S 54,168133,1,0 +Mk285=Stimulus,S128,168855,1,0 +Mk286=Stimulus,S139,168858,1,0 +Mk287=Stimulus,S128,168861,1,0 +Mk288=Stimulus,S 53,169712,1,0 +Mk289=Stimulus,S128,170252,1,0 +Mk290=Stimulus,S139,170260,1,0 +Mk291=Stimulus,S128,170263,1,0 +Mk292=Stimulus,S128,184006,1,0 +Mk293=Stimulus,S128,186016,1,0 +Mk294=Stimulus,S 54,189054,1,0 +Mk295=Stimulus,S128,189912,1,0 +Mk296=Stimulus,S139,189915,1,0 +Mk297=Stimulus,S128,189918,1,0 +Mk298=Stimulus,S 54,190629,1,0 +Mk299=Stimulus,S128,191209,1,0 +Mk300=Stimulus,S139,191211,1,0 +Mk301=Stimulus,S128,191214,1,0 +Mk302=Stimulus,S128,191402,1,0 +Mk303=Stimulus,S 53,192646,1,0 +Mk304=Stimulus,S128,193054,1,0 +Mk305=Stimulus,S139,193055,1,0 +Mk306=Stimulus,S128,193059,1,0 +Mk307=Stimulus,S 51,194522,1,0 +Mk308=Stimulus,S 11,194898,1,0 +Mk309=Stimulus,S139,194899,1,0 +Mk310=Stimulus,S128,194900,1,0 +Mk311=Stimulus,S 53,196231,1,0 +Mk312=Stimulus,S128,196676,1,0 +Mk313=Stimulus,S139,196680,1,0 +Mk314=Stimulus,S128,196684,1,0 +Mk315=Stimulus,S 52,197784,1,0 +Mk316=Stimulus,S 11,198327,1,0 +Mk317=Stimulus,S139,198328,1,0 +Mk318=Stimulus,S128,198330,1,0 +Mk319=Stimulus,S128,198543,1,0 +Mk320=Stimulus,S 54,199534,1,0 +Mk321=Stimulus,S128,199907,1,0 +Mk322=Stimulus,S140,199912,1,0 +Mk323=Stimulus,S128,199915,1,0 +Mk324=Stimulus,S 52,201410,1,0 +Mk325=Stimulus,S128,201937,1,0 +Mk326=Stimulus,S139,201938,1,0 +Mk327=Stimulus,S128,201940,1,0 +Mk328=Stimulus,S 54,203102,1,0 +Mk329=Stimulus,S128,203602,1,0 +Mk330=Stimulus,S139,203608,1,0 +Mk331=Stimulus,S128,203611,1,0 +Mk332=Stimulus,S 51,204716,1,0 +Mk333=Stimulus,S128,205073,1,0 +Mk334=Stimulus,S139,205077,1,0 +Mk335=Stimulus,S128,205080,1,0 +Mk336=Stimulus,S 51,206683,1,0 +Mk337=Stimulus,S128,207083,1,0 +Mk338=Stimulus,S139,207086,1,0 +Mk339=Stimulus,S128,207088,1,0 +Mk340=Stimulus,S 53,208632,1,0 +Mk341=Stimulus,S128,209127,1,0 +Mk342=Stimulus,S139,209129,1,0 +Mk343=Stimulus,S128,209132,1,0 +Mk344=Stimulus,S 52,210201,1,0 +Mk345=Stimulus,S128,210652,1,0 +Mk346=Stimulus,S139,210653,1,0 +Mk347=Stimulus,S128,210655,1,0 +Mk348=Stimulus,S128,210848,1,0 +Mk349=Stimulus,S 52,212223,1,0 +Mk350=Stimulus,S128,212652,1,0 +Mk351=Stimulus,S139,212654,1,0 +Mk352=Stimulus,S128,212657,1,0 +Mk353=Stimulus,S 51,214177,1,0 +Mk354=Stimulus,S128,214509,1,0 +Mk355=Stimulus,S139,214513,1,0 +Mk356=Stimulus,S128,214516,1,0 +Mk357=Stimulus,S 52,215986,1,0 +Mk358=Stimulus,S 11,216419,1,0 +Mk359=Stimulus,S128,216424,1,0 +Mk360=Stimulus,S 52,217545,1,0 +Mk361=Stimulus,S139,218031,1,0 +Mk362=Stimulus,S128,218034,1,0 +Mk363=Stimulus,S 53,219230,1,0 +Mk364=Stimulus,S128,219672,1,0 +Mk365=Stimulus,S139,219674,1,0 +Mk366=Stimulus,S128,219676,1,0 +Mk367=Stimulus,S 53,220891,1,0 +Mk368=Stimulus,S 11,221252,1,0 +Mk369=Stimulus,S139,221254,1,0 +Mk370=Stimulus,S128,221255,1,0 +Mk371=Stimulus,S 53,222530,1,0 +Mk372=Stimulus,S128,222934,1,0 +Mk373=Stimulus,S139,222939,1,0 +Mk374=Stimulus,S128,222942,1,0 +Mk375=Stimulus,S 54,224133,1,0 +Mk376=Stimulus,S128,224644,1,0 +Mk377=Stimulus,S139,224645,1,0 +Mk378=Stimulus,S128,224648,1,0 +Mk379=Stimulus,S 53,226076,1,0 +Mk380=Stimulus,S128,226501,1,0 +Mk381=Stimulus,S139,226503,1,0 +Mk382=Stimulus,S128,226506,1,0 +Mk383=Stimulus,S 51,227717,1,0 +Mk384=Stimulus,S128,228081,1,0 +Mk385=Stimulus,S139,228083,1,0 +Mk386=Stimulus,S128,228086,1,0 +Mk387=Stimulus,S 54,229685,1,0 +Mk388=Stimulus,S139,230276,1,0 +Mk389=Stimulus,S128,230279,1,0 +Mk390=Stimulus,S128,230468,1,0 +Mk391=Stimulus,S 51,231335,1,0 +Mk392=Stimulus,S128,231800,1,0 +Mk393=Stimulus,S139,231805,1,0 +Mk394=Stimulus,S128,231809,1,0 +Mk395=Stimulus,S 52,232883,1,0 +Mk396=Stimulus,S128,233414,1,0 +Mk397=Stimulus,S139,233417,1,0 +Mk398=Stimulus,S128,233419,1,0 +Mk399=Stimulus,S 54,234895,1,0 +Mk400=Stimulus,S128,235626,1,0 +Mk401=Stimulus,S139,235628,1,0 +Mk402=Stimulus,S128,235631,1,0 +Mk403=Stimulus,S 52,236574,1,0 +Mk404=Stimulus,S128,237012,1,0 +Mk405=Stimulus,S139,237014,1,0 +Mk406=Stimulus,S128,237016,1,0 +Mk407=Stimulus,S 54,238481,1,0 +Mk408=Stimulus,S 11,238921,1,0 +Mk409=Stimulus,S139,238923,1,0 +Mk410=Stimulus,S128,238924,1,0 +Mk411=Stimulus,S 53,240237,1,0 +Mk412=Stimulus,S128,240634,1,0 +Mk413=Stimulus,S139,240638,1,0 +Mk414=Stimulus,S128,240640,1,0 +Mk415=Stimulus,S 51,241800,1,0 +Mk416=Stimulus,S128,242150,1,0 +Mk417=Stimulus,S139,242153,1,0 +Mk418=Stimulus,S128,242155,1,0 +Mk419=Stimulus,S 51,243715,1,0 +Mk420=Stimulus,S128,244038,1,0 +Mk421=Stimulus,S139,244040,1,0 +Mk422=Stimulus,S128,244043,1,0 +Mk423=Stimulus,S 54,245276,1,0 +Mk424=Stimulus,S128,245530,1,0 +Mk425=Stimulus,S140,245532,1,0 +Mk426=Stimulus,S128,245535,1,0 +Mk427=Stimulus,S 53,246825,1,0 +Mk428=Stimulus,S 11,247192,1,0 +Mk429=Stimulus,S139,247193,1,0 +Mk430=Stimulus,S128,247195,1,0 +Mk431=Stimulus,S 54,248658,1,0 +Mk432=Stimulus,S128,249336,1,0 +Mk433=Stimulus,S139,249340,1,0 +Mk434=Stimulus,S128,249343,1,0 +Mk435=Stimulus,S128,249556,1,0 +Mk436=Stimulus,S 52,250613,1,0 +Mk437=Stimulus,S128,251043,1,0 +Mk438=Stimulus,S139,251046,1,0 +Mk439=Stimulus,S128,251049,1,0 +Mk440=Stimulus,S128,251235,1,0 +Mk441=Stimulus,S 51,252349,1,0 +Mk442=Stimulus,S128,252693,1,0 +Mk443=Stimulus,S139,252697,1,0 +Mk444=Stimulus,S128,252700,1,0 +Mk445=Stimulus,S 53,253915,1,0 +Mk446=Stimulus,S 11,254349,1,0 +Mk447=Stimulus,S139,254350,1,0 +Mk448=Stimulus,S128,254352,1,0 +Mk449=Stimulus,S 51,255646,1,0 +Mk450=Stimulus,S128,255976,1,0 +Mk451=Stimulus,S139,255979,1,0 +Mk452=Stimulus,S128,255981,1,0 +Mk453=Stimulus,S 52,257319,1,0 +Mk454=Stimulus,S128,257771,1,0 +Mk455=Stimulus,S139,257774,1,0 +Mk456=Stimulus,S128,257776,1,0 +Mk457=Stimulus,S128,269352,1,0 +Mk458=Stimulus,S128,270374,1,0 +Mk459=Stimulus,S 52,273405,1,0 +Mk460=Stimulus,S128,273967,1,0 +Mk461=Stimulus,S139,273971,1,0 +Mk462=Stimulus,S128,273974,1,0 +Mk463=Stimulus,S128,274135,1,0 +Mk464=Stimulus,S 54,275353,1,0 +Mk465=Stimulus,S128,275894,1,0 +Mk466=Stimulus,S139,275895,1,0 +Mk467=Stimulus,S128,275897,1,0 +Mk468=Stimulus,S 51,277300,1,0 +Mk469=Stimulus,S128,277778,1,0 +Mk470=Stimulus,S139,277781,1,0 +Mk471=Stimulus,S128,277783,1,0 +Mk472=Stimulus,S 52,279253,1,0 +Mk473=Stimulus,S140,279614,1,0 +Mk474=Stimulus,S128,279616,1,0 +Mk475=Stimulus,S 54,280897,1,0 +Mk476=Stimulus,S 12,281300,1,0 +Mk477=Stimulus,S 54,282779,1,0 +Mk478=Stimulus,S128,283253,1,0 +Mk479=Stimulus,S139,283254,1,0 +Mk480=Stimulus,S128,283257,1,0 +Mk481=Stimulus,S 54,284503,1,0 +Mk482=Stimulus,S139,284984,1,0 +Mk483=Stimulus,S128,284987,1,0 +Mk484=Stimulus,S 52,286086,1,0 +Mk485=Stimulus,S128,286549,1,0 +Mk486=Stimulus,S139,286554,1,0 +Mk487=Stimulus,S128,286557,1,0 +Mk488=Stimulus,S 53,288112,1,0 +Mk489=Stimulus,S128,288683,1,0 +Mk490=Stimulus,S139,288686,1,0 +Mk491=Stimulus,S128,288689,1,0 +Mk492=Stimulus,S 53,289758,1,0 +Mk493=Stimulus,S128,290297,1,0 +Mk494=Stimulus,S139,290303,1,0 +Mk495=Stimulus,S128,290306,1,0 +Mk496=Stimulus,S 53,291517,1,0 +Mk497=Stimulus,S128,291976,1,0 +Mk498=Stimulus,S139,291980,1,0 +Mk499=Stimulus,S128,291983,1,0 +Mk500=Stimulus,S 52,293193,1,0 +Mk501=Stimulus,S128,293668,1,0 +Mk502=Stimulus,S139,293669,1,0 +Mk503=Stimulus,S128,293671,1,0 +Mk504=Stimulus,S 53,294833,1,0 +Mk505=Stimulus,S128,295387,1,0 +Mk506=Stimulus,S139,295393,1,0 +Mk507=Stimulus,S128,295395,1,0 +Mk508=Stimulus,S 52,296472,1,0 +Mk509=Stimulus,S 11,297105,1,0 +Mk510=Stimulus,S139,297106,1,0 +Mk511=Stimulus,S128,297108,1,0 +Mk512=Stimulus,S 54,298166,1,0 +Mk513=Stimulus,S128,298711,1,0 +Mk514=Stimulus,S139,298717,1,0 +Mk515=Stimulus,S128,298720,1,0 +Mk516=Stimulus,S 52,299979,1,0 +Mk517=Stimulus,S139,300442,1,0 +Mk518=Stimulus,S128,300445,1,0 +Mk519=Stimulus,S 51,301654,1,0 +Mk520=Stimulus,S128,302165,1,0 +Mk521=Stimulus,S139,302166,1,0 +Mk522=Stimulus,S128,302169,1,0 +Mk523=Stimulus,S 53,303459,1,0 +Mk524=Stimulus,S 11,303901,1,0 +Mk525=Stimulus,S139,303902,1,0 +Mk526=Stimulus,S128,303903,1,0 +Mk527=Stimulus,S 53,304994,1,0 +Mk528=Stimulus,S128,305441,1,0 +Mk529=Stimulus,S139,305444,1,0 +Mk530=Stimulus,S128,305447,1,0 +Mk531=Stimulus,S 51,306996,1,0 +Mk532=Stimulus,S128,307490,1,0 +Mk533=Stimulus,S139,307496,1,0 +Mk534=Stimulus,S128,307499,1,0 +Mk535=Stimulus,S 53,308551,1,0 +Mk536=Stimulus,S128,309002,1,0 +Mk537=Stimulus,S139,309008,1,0 +Mk538=Stimulus,S128,309011,1,0 +Mk539=Stimulus,S 52,310304,1,0 +Mk540=Stimulus,S128,310773,1,0 +Mk541=Stimulus,S139,310777,1,0 +Mk542=Stimulus,S128,310779,1,0 +Mk543=Stimulus,S 51,311915,1,0 +Mk544=Stimulus,S128,312407,1,0 +Mk545=Stimulus,S139,312411,1,0 +Mk546=Stimulus,S128,312414,1,0 +Mk547=Stimulus,S 53,313859,1,0 +Mk548=Stimulus,S128,314263,1,0 +Mk549=Stimulus,S139,314267,1,0 +Mk550=Stimulus,S128,314270,1,0 +Mk551=Stimulus,S 51,315673,1,0 +Mk552=Stimulus,S139,315995,1,0 +Mk553=Stimulus,S128,315998,1,0 +Mk554=Stimulus,S 51,317317,1,0 +Mk555=Stimulus,S139,317640,1,0 +Mk556=Stimulus,S128,317643,1,0 +Mk557=Stimulus,S 52,318997,1,0 +Mk558=Stimulus,S128,319480,1,0 +Mk559=Stimulus,S139,319484,1,0 +Mk560=Stimulus,S128,319487,1,0 +Mk561=Stimulus,S 54,320537,1,0 +Mk562=Stimulus,S128,321059,1,0 +Mk563=Stimulus,S139,321062,1,0 +Mk564=Stimulus,S128,321064,1,0 +Mk565=Stimulus,S 51,322230,1,0 +Mk566=Stimulus,S139,322643,1,0 +Mk567=Stimulus,S128,322645,1,0 +Mk568=Stimulus,S 53,323782,1,0 +Mk569=Stimulus,S128,324228,1,0 +Mk570=Stimulus,S139,324232,1,0 +Mk571=Stimulus,S128,324235,1,0 +Mk572=Stimulus,S 53,325578,1,0 +Mk573=Stimulus,S128,325972,1,0 +Mk574=Stimulus,S139,325975,1,0 +Mk575=Stimulus,S128,325977,1,0 +Mk576=Stimulus,S 51,327247,1,0 +Mk577=Stimulus,S128,327668,1,0 +Mk578=Stimulus,S139,327670,1,0 +Mk579=Stimulus,S128,327674,1,0 +Mk580=Stimulus,S 52,329009,1,0 +Mk581=Stimulus,S128,329495,1,0 +Mk582=Stimulus,S139,329497,1,0 +Mk583=Stimulus,S128,329500,1,0 +Mk584=Stimulus,S 54,330540,1,0 +Mk585=Stimulus,S128,331044,1,0 +Mk586=Stimulus,S139,331046,1,0 +Mk587=Stimulus,S128,331049,1,0 +Mk588=Stimulus,S 52,332554,1,0 +Mk589=Stimulus,S128,332998,1,0 +Mk590=Stimulus,S139,332999,1,0 +Mk591=Stimulus,S128,333001,1,0 +Mk592=Stimulus,S 54,334501,1,0 +Mk593=Stimulus,S139,335047,1,0 +Mk594=Stimulus,S128,335049,1,0 +Mk595=Stimulus,S 51,336252,1,0 +Mk596=Stimulus,S128,336665,1,0 +Mk597=Stimulus,S139,336668,1,0 +Mk598=Stimulus,S128,336670,1,0 +Mk599=Stimulus,S 54,338086,1,0 +Mk600=Stimulus,S128,338693,1,0 +Mk601=Stimulus,S139,338695,1,0 +Mk602=Stimulus,S128,338697,1,0 +Mk603=Stimulus,S 51,340090,1,0 +Mk604=Stimulus,S128,340474,1,0 +Mk605=Stimulus,S139,340480,1,0 +Mk606=Stimulus,S128,340482,1,0 +Mk607=Stimulus,S 54,342087,1,0 +Mk608=Stimulus,S128,342654,1,0 +Mk609=Stimulus,S139,342658,1,0 +Mk610=Stimulus,S128,342660,1,0 +Mk611=Stimulus,S128,354737,1,0 +Mk612=Stimulus,S128,356227,1,0 +Mk613=Stimulus,S128,356244,1,0 +Mk614=Stimulus,S 51,359263,1,0 +Mk615=Stimulus,S128,359745,1,0 +Mk616=Stimulus,S139,359751,1,0 +Mk617=Stimulus,S128,359755,1,0 +Mk618=Stimulus,S 52,361011,1,0 +Mk619=Stimulus,S128,361473,1,0 +Mk620=Stimulus,S139,361474,1,0 +Mk621=Stimulus,S128,361477,1,0 +Mk622=Stimulus,S 51,362899,1,0 +Mk623=Stimulus,S128,363278,1,0 +Mk624=Stimulus,S139,363280,1,0 +Mk625=Stimulus,S128,363283,1,0 +Mk626=Stimulus,S 54,364697,1,0 +Mk627=Stimulus,S128,365126,1,0 +Mk628=Stimulus,S139,365131,1,0 +Mk629=Stimulus,S128,365134,1,0 +Mk630=Stimulus,S 54,366276,1,0 +Mk631=Stimulus,S139,366727,1,0 +Mk632=Stimulus,S128,366730,1,0 +Mk633=Stimulus,S 51,368286,1,0 +Mk634=Stimulus,S128,368612,1,0 +Mk635=Stimulus,S139,368613,1,0 +Mk636=Stimulus,S128,368615,1,0 +Mk637=Stimulus,S 54,370239,1,0 +Mk638=Stimulus,S128,370661,1,0 +Mk639=Stimulus,S139,370664,1,0 +Mk640=Stimulus,S128,370667,1,0 +Mk641=Stimulus,S 53,371998,1,0 +Mk642=Stimulus,S128,372377,1,0 +Mk643=Stimulus,S139,372382,1,0 +Mk644=Stimulus,S128,372385,1,0 +Mk645=Stimulus,S 53,373654,1,0 +Mk646=Stimulus,S128,374015,1,0 +Mk647=Stimulus,S139,374020,1,0 +Mk648=Stimulus,S128,374023,1,0 +Mk649=Stimulus,S 52,375189,1,0 +Mk650=Stimulus,S128,375633,1,0 +Mk651=Stimulus,S139,375634,1,0 +Mk652=Stimulus,S128,375637,1,0 +Mk653=Stimulus,S 54,377136,1,0 +Mk654=Stimulus,S128,377607,1,0 +Mk655=Stimulus,S139,377611,1,0 +Mk656=Stimulus,S128,377614,1,0 +Mk657=Stimulus,S 52,378926,1,0 +Mk658=Stimulus,S128,379345,1,0 +Mk659=Stimulus,S139,379352,1,0 +Mk660=Stimulus,S128,379354,1,0 +Mk661=Stimulus,S 54,380782,1,0 +Mk662=Stimulus,S128,381220,1,0 +Mk663=Stimulus,S139,381222,1,0 +Mk664=Stimulus,S128,381225,1,0 +Mk665=Stimulus,S 53,382460,1,0 +Mk666=Stimulus,S 11,382895,1,0 +Mk667=Stimulus,S139,382896,1,0 +Mk668=Stimulus,S128,382898,1,0 +Mk669=Stimulus,S 51,384155,1,0 +Mk670=Stimulus,S128,384589,1,0 +Mk671=Stimulus,S139,384592,1,0 +Mk672=Stimulus,S128,384595,1,0 +Mk673=Stimulus,S 52,385822,1,0 +Mk674=Stimulus,S128,386270,1,0 +Mk675=Stimulus,S139,386273,1,0 +Mk676=Stimulus,S128,386276,1,0 +Mk677=Stimulus,S128,386494,1,0 +Mk678=Stimulus,S 51,387613,1,0 +Mk679=Stimulus,S128,387989,1,0 +Mk680=Stimulus,S139,387991,1,0 +Mk681=Stimulus,S128,387995,1,0 +Mk682=Stimulus,S 53,389470,1,0 +Mk683=Stimulus,S128,389895,1,0 +Mk684=Stimulus,S139,389897,1,0 +Mk685=Stimulus,S128,389900,1,0 +Mk686=Stimulus,S 54,391090,1,0 +Mk687=Stimulus,S128,391571,1,0 +Mk688=Stimulus,S139,391576,1,0 +Mk689=Stimulus,S128,391579,1,0 +Mk690=Stimulus,S 53,392637,1,0 +Mk691=Stimulus,S128,393083,1,0 +Mk692=Stimulus,S139,393088,1,0 +Mk693=Stimulus,S128,393091,1,0 +Mk694=Stimulus,S 51,394378,1,0 +Mk695=Stimulus,S128,394726,1,0 +Mk696=Stimulus,S139,394731,1,0 +Mk697=Stimulus,S128,394733,1,0 +Mk698=Stimulus,S 51,396004,1,0 +Mk699=Stimulus,S128,396342,1,0 +Mk700=Stimulus,S139,396346,1,0 +Mk701=Stimulus,S128,396349,1,0 +Mk702=Stimulus,S 54,397971,1,0 +Mk703=Stimulus,S128,398618,1,0 +Mk704=Stimulus,S139,398623,1,0 +Mk705=Stimulus,S128,398625,1,0 +Mk706=Stimulus,S 53,399913,1,0 +Mk707=Stimulus,S128,400436,1,0 +Mk708=Stimulus,S139,400438,1,0 +Mk709=Stimulus,S128,400440,1,0 +Mk710=Stimulus,S 52,401522,1,0 +Mk711=Stimulus,S128,402010,1,0 +Mk712=Stimulus,S139,402013,1,0 +Mk713=Stimulus,S128,402016,1,0 +Mk714=Stimulus,S 54,403505,1,0 +Mk715=Stimulus,S128,403999,1,0 +Mk716=Stimulus,S139,404000,1,0 +Mk717=Stimulus,S128,404003,1,0 +Mk718=Stimulus,S 51,405259,1,0 +Mk719=Stimulus,S128,405608,1,0 +Mk720=Stimulus,S139,405612,1,0 +Mk721=Stimulus,S128,405614,1,0 +Mk722=Stimulus,S 53,407072,1,0 +Mk723=Stimulus,S128,407547,1,0 +Mk724=Stimulus,S139,407548,1,0 +Mk725=Stimulus,S128,407551,1,0 +Mk726=Stimulus,S 54,408712,1,0 +Mk727=Stimulus,S128,409186,1,0 +Mk728=Stimulus,S139,409188,1,0 +Mk729=Stimulus,S128,409191,1,0 +Mk730=Stimulus,S 52,410705,1,0 +Mk731=Stimulus,S128,411110,1,0 +Mk732=Stimulus,S139,411114,1,0 +Mk733=Stimulus,S128,411117,1,0 +Mk734=Stimulus,S 52,412307,1,0 +Mk735=Stimulus,S128,412728,1,0 +Mk736=Stimulus,S139,412729,1,0 +Mk737=Stimulus,S128,412732,1,0 +Mk738=Stimulus,S 51,414146,1,0 +Mk739=Stimulus,S128,414540,1,0 +Mk740=Stimulus,S139,414546,1,0 +Mk741=Stimulus,S128,414549,1,0 +Mk742=Stimulus,S 53,415903,1,0 +Mk743=Stimulus,S128,416349,1,0 +Mk744=Stimulus,S139,416351,1,0 +Mk745=Stimulus,S128,416355,1,0 +Mk746=Stimulus,S 54,417812,1,0 +Mk747=Stimulus,S 11,418232,1,0 +Mk748=Stimulus,S139,418233,1,0 +Mk749=Stimulus,S128,418235,1,0 +Mk750=Stimulus,S 52,419777,1,0 +Mk751=Stimulus,S139,420168,1,0 +Mk752=Stimulus,S128,420171,1,0 +Mk753=Stimulus,S 53,421472,1,0 +Mk754=Stimulus,S 11,421915,1,0 +Mk755=Stimulus,S139,421916,1,0 +Mk756=Stimulus,S128,421917,1,0 +Mk757=Stimulus,S 52,423376,1,0 +Mk758=Stimulus,S128,423768,1,0 +Mk759=Stimulus,S139,423773,1,0 +Mk760=Stimulus,S128,423775,1,0 +Mk761=Stimulus,S 51,425069,1,0 +Mk762=Stimulus,S128,425486,1,0 +Mk763=Stimulus,S139,425487,1,0 +Mk764=Stimulus,S128,425490,1,0 +Mk765=Stimulus,S 53,426936,1,0 +Mk766=Stimulus,S128,427397,1,0 +Mk767=Stimulus,S139,427399,1,0 +Mk768=Stimulus,S128,427402,1,0 +Mk769=Stimulus,S 52,428843,1,0 +Mk770=Stimulus,S128,429227,1,0 +Mk771=Stimulus,S139,429234,1,0 +Mk772=Stimulus,S128,429237,1,0 +Mk773=Stimulus,S128,441395,1,0 +Mk774=Stimulus,S128,442511,1,0 +Mk775=Stimulus,S 54,445550,1,0 +Mk776=Stimulus,S128,446098,1,0 +Mk777=Stimulus,S139,446101,1,0 +Mk778=Stimulus,S128,446104,1,0 +Mk779=Stimulus,S 52,447512,1,0 +Mk780=Stimulus,S139,447916,1,0 +Mk781=Stimulus,S128,447919,1,0 +Mk782=Stimulus,S 52,449141,1,0 +Mk783=Stimulus,S128,449529,1,0 +Mk784=Stimulus,S139,449532,1,0 +Mk785=Stimulus,S128,449534,1,0 +Mk786=Stimulus,S 54,450957,1,0 +Mk787=Stimulus,S128,451418,1,0 +Mk788=Stimulus,S139,451419,1,0 +Mk789=Stimulus,S128,451422,1,0 +Mk790=Stimulus,S 51,452867,1,0 +Mk791=Stimulus,S128,453278,1,0 +Mk792=Stimulus,S139,453282,1,0 +Mk793=Stimulus,S128,453285,1,0 +Mk794=Stimulus,S 51,454774,1,0 +Mk795=Stimulus,S128,455163,1,0 +Mk796=Stimulus,S139,455164,1,0 +Mk797=Stimulus,S128,455167,1,0 +Mk798=Stimulus,S 53,456686,1,0 +Mk799=Stimulus,S128,457066,1,0 +Mk800=Stimulus,S139,457068,1,0 +Mk801=Stimulus,S128,457070,1,0 +Mk802=Stimulus,S 52,458245,1,0 +Mk803=Stimulus,S128,458709,1,0 +Mk804=Stimulus,S139,458714,1,0 +Mk805=Stimulus,S128,458717,1,0 +Mk806=Stimulus,S 54,459780,1,0 +Mk807=Stimulus,S128,460265,1,0 +Mk808=Stimulus,S139,460268,1,0 +Mk809=Stimulus,S128,460270,1,0 +Mk810=Stimulus,S 51,461372,1,0 +Mk811=Stimulus,S128,461763,1,0 +Mk812=Stimulus,S139,461769,1,0 +Mk813=Stimulus,S128,461771,1,0 +Mk814=Stimulus,S 53,463339,1,0 +Mk815=Stimulus,S 11,463735,1,0 +Mk816=Stimulus,S139,463736,1,0 +Mk817=Stimulus,S128,463738,1,0 +Mk818=Stimulus,S 53,465244,1,0 +Mk819=Stimulus,S128,465646,1,0 +Mk820=Stimulus,S139,465647,1,0 +Mk821=Stimulus,S128,465650,1,0 +Mk822=Stimulus,S 53,467114,1,0 +Mk823=Stimulus,S128,467550,1,0 +Mk824=Stimulus,S139,467554,1,0 +Mk825=Stimulus,S128,467556,1,0 +Mk826=Stimulus,S 54,468955,1,0 +Mk827=Stimulus,S128,469393,1,0 +Mk828=Stimulus,S139,469397,1,0 +Mk829=Stimulus,S128,469400,1,0 +Mk830=Stimulus,S 54,470852,1,0 +Mk831=Stimulus,S128,471283,1,0 +Mk832=Stimulus,S139,471285,1,0 +Mk833=Stimulus,S128,471287,1,0 +Mk834=Stimulus,S 51,472690,1,0 +Mk835=Stimulus,S128,473031,1,0 +Mk836=Stimulus,S139,473036,1,0 +Mk837=Stimulus,S128,473039,1,0 +Mk838=Stimulus,S 53,474602,1,0 +Mk839=Stimulus,S128,474956,1,0 +Mk840=Stimulus,S139,474957,1,0 +Mk841=Stimulus,S128,474960,1,0 +Mk842=Stimulus,S 53,476162,1,0 +Mk843=Stimulus,S128,476651,1,0 +Mk844=Stimulus,S139,476653,1,0 +Mk845=Stimulus,S128,476656,1,0 +Mk846=Stimulus,S 51,478168,1,0 +Mk847=Stimulus,S128,478531,1,0 +Mk848=Stimulus,S139,478535,1,0 +Mk849=Stimulus,S128,478538,1,0 +Mk850=Stimulus,S 51,479722,1,0 +Mk851=Stimulus,S128,480123,1,0 +Mk852=Stimulus,S139,480126,1,0 +Mk853=Stimulus,S128,480129,1,0 +Mk854=Stimulus,S 54,481592,1,0 +Mk855=Stimulus,S 12,482056,1,0 +Mk856=Stimulus,S140,482057,1,0 +Mk857=Stimulus,S128,482058,1,0 +Mk858=Stimulus,S 52,483583,1,0 +Mk859=Stimulus,S128,484057,1,0 +Mk860=Stimulus,S139,484060,1,0 +Mk861=Stimulus,S128,484063,1,0 +Mk862=Stimulus,S 52,485613,1,0 +Mk863=Stimulus,S128,486050,1,0 +Mk864=Stimulus,S139,486052,1,0 +Mk865=Stimulus,S128,486055,1,0 +Mk866=Stimulus,S 52,487528,1,0 +Mk867=Stimulus,S128,487974,1,0 +Mk868=Stimulus,S139,487977,1,0 +Mk869=Stimulus,S128,487980,1,0 +Mk870=Stimulus,S 53,489261,1,0 +Mk871=Stimulus,S128,489764,1,0 +Mk872=Stimulus,S139,489765,1,0 +Mk873=Stimulus,S128,489768,1,0 +Mk874=Stimulus,S 52,491237,1,0 +Mk875=Stimulus,S128,491673,1,0 +Mk876=Stimulus,S139,491680,1,0 +Mk877=Stimulus,S128,491682,1,0 +Mk878=Stimulus,S 52,493176,1,0 +Mk879=Stimulus,S128,493627,1,0 +Mk880=Stimulus,S139,493628,1,0 +Mk881=Stimulus,S128,493631,1,0 +Mk882=Stimulus,S 52,495125,1,0 +Mk883=Stimulus,S128,495517,1,0 +Mk884=Stimulus,S139,495521,1,0 +Mk885=Stimulus,S128,495524,1,0 +Mk886=Stimulus,S 53,497031,1,0 +Mk887=Stimulus,S 11,497417,1,0 +Mk888=Stimulus,S 51,498798,1,0 +Mk889=Stimulus,S128,499231,1,0 +Mk890=Stimulus,S139,499234,1,0 +Mk891=Stimulus,S128,499237,1,0 +Mk892=Stimulus,S 53,500520,1,0 +Mk893=Stimulus,S128,501022,1,0 +Mk894=Stimulus,S139,501026,1,0 +Mk895=Stimulus,S128,501029,1,0 +Mk896=Stimulus,S 54,502547,1,0 +Mk897=Stimulus,S128,503064,1,0 +Mk898=Stimulus,S139,503065,1,0 +Mk899=Stimulus,S128,503067,1,0 +Mk900=Stimulus,S 51,504124,1,0 +Mk901=Stimulus,S139,504812,1,0 +Mk902=Stimulus,S128,504815,1,0 +Mk903=Stimulus,S 51,506078,1,0 +Mk904=Stimulus,S128,506450,1,0 +Mk905=Stimulus,S139,506451,1,0 +Mk906=Stimulus,S128,506454,1,0 +Mk907=Stimulus,S 51,507663,1,0 +Mk908=Stimulus,S128,508064,1,0 +Mk909=Stimulus,S139,508068,1,0 +Mk910=Stimulus,S128,508072,1,0 +Mk911=Stimulus,S 52,509408,1,0 +Mk912=Stimulus,S128,509867,1,0 +Mk913=Stimulus,S139,509869,1,0 +Mk914=Stimulus,S128,509872,1,0 +Mk915=Stimulus,S 53,511153,1,0 +Mk916=Stimulus,S128,511623,1,0 +Mk917=Stimulus,S139,511624,1,0 +Mk918=Stimulus,S128,511626,1,0 +Mk919=Stimulus,S 54,512842,1,0 +Mk920=Stimulus,S128,513358,1,0 +Mk921=Stimulus,S139,513361,1,0 +Mk922=Stimulus,S128,513363,1,0 +Mk923=Stimulus,S 54,514778,1,0 +Mk924=Stimulus,S128,515279,1,0 +Mk925=Stimulus,S139,515283,1,0 +Mk926=Stimulus,S128,515286,1,0 +Mk927=Stimulus,S 54,516312,1,0 +Mk928=Stimulus,S128,516893,1,0 +Mk929=Stimulus,S139,516897,1,0 +Mk930=Stimulus,S128,516899,1,0 +Mk931=Stimulus,S128,528465,1,0 +Mk932=Stimulus,S128,529184,1,0 +Mk933=Stimulus,S 53,532218,1,0 +Mk934=Stimulus,S128,532657,1,0 +Mk935=Stimulus,S139,532660,1,0 +Mk936=Stimulus,S128,532663,1,0 +Mk937=Stimulus,S 52,533770,1,0 +Mk938=Stimulus,S139,534373,1,0 +Mk939=Stimulus,S128,534376,1,0 +Mk940=Stimulus,S 51,535415,1,0 +Mk941=Stimulus,S128,535802,1,0 +Mk942=Stimulus,S139,535804,1,0 +Mk943=Stimulus,S128,535808,1,0 +Mk944=Stimulus,S 52,537072,1,0 +Mk945=Stimulus,S128,537556,1,0 +Mk946=Stimulus,S139,537560,1,0 +Mk947=Stimulus,S128,537563,1,0 +Mk948=Stimulus,S128,537789,1,0 +Mk949=Stimulus,S 54,538765,1,0 +Mk950=Stimulus,S128,539305,1,0 +Mk951=Stimulus,S139,539306,1,0 +Mk952=Stimulus,S128,539309,1,0 +Mk953=Stimulus,S 54,540402,1,0 +Mk954=Stimulus,S128,540986,1,0 +Mk955=Stimulus,S139,540987,1,0 +Mk956=Stimulus,S128,540990,1,0 +Mk957=Stimulus,S 51,542254,1,0 +Mk958=Stimulus,S128,542653,1,0 +Mk959=Stimulus,S139,542654,1,0 +Mk960=Stimulus,S128,542657,1,0 +Mk961=Stimulus,S 52,543945,1,0 +Mk962=Stimulus,S 12,544372,1,0 +Mk963=Stimulus,S 53,545592,1,0 +Mk964=Stimulus,S128,546052,1,0 +Mk965=Stimulus,S139,546055,1,0 +Mk966=Stimulus,S128,546058,1,0 +Mk967=Stimulus,S 52,547473,1,0 +Mk968=Stimulus,S128,547914,1,0 +Mk969=Stimulus,S139,547918,1,0 +Mk970=Stimulus,S128,547921,1,0 +Mk971=Stimulus,S 53,549131,1,0 +Mk972=Stimulus,S139,549554,1,0 +Mk973=Stimulus,S128,549557,1,0 +Mk974=Stimulus,S 54,550985,1,0 +Mk975=Stimulus,S128,551422,1,0 +Mk976=Stimulus,S139,551426,1,0 +Mk977=Stimulus,S128,551429,1,0 +Mk978=Stimulus,S 51,552840,1,0 +Mk979=Stimulus,S139,553242,1,0 +Mk980=Stimulus,S128,553245,1,0 +Mk981=Stimulus,S 52,554424,1,0 +Mk982=Stimulus,S128,554871,1,0 +Mk983=Stimulus,S139,554874,1,0 +Mk984=Stimulus,S128,554876,1,0 +Mk985=Stimulus,S 53,556341,1,0 +Mk986=Stimulus,S128,556743,1,0 +Mk987=Stimulus,S139,556744,1,0 +Mk988=Stimulus,S128,556746,1,0 +Mk989=Stimulus,S 53,558271,1,0 +Mk990=Stimulus,S128,558667,1,0 +Mk991=Stimulus,S139,558674,1,0 +Mk992=Stimulus,S128,558677,1,0 +Mk993=Stimulus,S 51,560166,1,0 +Mk994=Stimulus,S128,560509,1,0 +Mk995=Stimulus,S139,560514,1,0 +Mk996=Stimulus,S128,560517,1,0 +Mk997=Stimulus,S 54,562080,1,0 +Mk998=Stimulus,S128,562517,1,0 +Mk999=Stimulus,S139,562522,1,0 +Mk1000=Stimulus,S128,562524,1,0 +Mk1001=Stimulus,S128,562736,1,0 +Mk1002=Stimulus,S 53,563646,1,0 +Mk1003=Stimulus,S128,564110,1,0 +Mk1004=Stimulus,S139,564112,1,0 +Mk1005=Stimulus,S128,564115,1,0 +Mk1006=Stimulus,S 51,565422,1,0 +Mk1007=Stimulus,S128,565770,1,0 +Mk1008=Stimulus,S139,565776,1,0 +Mk1009=Stimulus,S128,565778,1,0 +Mk1010=Stimulus,S 54,567000,1,0 +Mk1011=Stimulus,S128,567499,1,0 +Mk1012=Stimulus,S139,567501,1,0 +Mk1013=Stimulus,S128,567504,1,0 +Mk1014=Stimulus,S128,567695,1,0 +Mk1015=Stimulus,S 54,568635,1,0 +Mk1016=Stimulus,S128,569088,1,0 +Mk1017=Stimulus,S139,569089,1,0 +Mk1018=Stimulus,S128,569092,1,0 +Mk1019=Stimulus,S 54,570424,1,0 +Mk1020=Stimulus,S128,570844,1,0 +Mk1021=Stimulus,S139,570850,1,0 +Mk1022=Stimulus,S128,570854,1,0 +Mk1023=Stimulus,S 51,572033,1,0 +Mk1024=Stimulus,S128,572448,1,0 +Mk1025=Stimulus,S139,572454,1,0 +Mk1026=Stimulus,S128,572458,1,0 +Mk1027=Stimulus,S 54,573952,1,0 +Mk1028=Stimulus,S128,574421,1,0 +Mk1029=Stimulus,S139,574422,1,0 +Mk1030=Stimulus,S128,574424,1,0 +Mk1031=Stimulus,S 53,575634,1,0 +Mk1032=Stimulus,S139,576221,1,0 +Mk1033=Stimulus,S128,576224,1,0 +Mk1034=Stimulus,S 54,577238,1,0 +Mk1035=Stimulus,S128,577917,1,0 +Mk1036=Stimulus,S139,577920,1,0 +Mk1037=Stimulus,S128,577923,1,0 +Mk1038=Stimulus,S 53,578888,1,0 +Mk1039=Stimulus,S128,579420,1,0 +Mk1040=Stimulus,S139,579425,1,0 +Mk1041=Stimulus,S128,579428,1,0 +Mk1042=Stimulus,S 51,580826,1,0 +Mk1043=Stimulus,S128,581233,1,0 +Mk1044=Stimulus,S139,581237,1,0 +Mk1045=Stimulus,S128,581240,1,0 +Mk1046=Stimulus,S 53,582734,1,0 +Mk1047=Stimulus,S128,583200,1,0 +Mk1048=Stimulus,S139,583204,1,0 +Mk1049=Stimulus,S128,583206,1,0 +Mk1050=Stimulus,S 51,584488,1,0 +Mk1051=Stimulus,S128,584891,1,0 +Mk1052=Stimulus,S139,584894,1,0 +Mk1053=Stimulus,S128,584897,1,0 +Mk1054=Stimulus,S 52,586190,1,0 +Mk1055=Stimulus,S128,586690,1,0 +Mk1056=Stimulus,S139,586691,1,0 +Mk1057=Stimulus,S128,586694,1,0 +Mk1058=Stimulus,S 52,587817,1,0 +Mk1059=Stimulus,S128,588254,1,0 +Mk1060=Stimulus,S139,588257,1,0 +Mk1061=Stimulus,S128,588260,1,0 +Mk1062=Stimulus,S 52,589583,1,0 +Mk1063=Stimulus,S128,590020,1,0 +Mk1064=Stimulus,S139,590026,1,0 +Mk1065=Stimulus,S128,590029,1,0 +Mk1066=Stimulus,S 51,591534,1,0 +Mk1067=Stimulus,S128,591977,1,0 +Mk1068=Stimulus,S139,591979,1,0 +Mk1069=Stimulus,S128,591982,1,0 +Mk1070=Stimulus,S 51,593263,1,0 +Mk1071=Stimulus,S128,593642,1,0 +Mk1072=Stimulus,S139,593647,1,0 +Mk1073=Stimulus,S128,593650,1,0 +Mk1074=Stimulus,S 54,595143,1,0 +Mk1075=Stimulus,S139,595643,1,0 +Mk1076=Stimulus,S128,595646,1,0 +Mk1077=Stimulus,S 53,596684,1,0 +Mk1078=Stimulus,S139,597129,1,0 +Mk1079=Stimulus,S128,597132,1,0 +Mk1080=Stimulus,S 52,598244,1,0 +Mk1081=Stimulus,S128,598667,1,0 +Mk1082=Stimulus,S139,598668,1,0 +Mk1083=Stimulus,S128,598670,1,0 +Mk1084=Stimulus,S 52,600202,1,0 +Mk1085=Stimulus,S139,600561,1,0 +Mk1086=Stimulus,S128,600564,1,0 +Mk1087=Stimulus,S128,612913,1,0 +Mk1088=Stimulus,S128,614186,1,0 +Mk1089=Stimulus,S 51,617225,1,0 +Mk1090=Stimulus,S128,617654,1,0 +Mk1091=Stimulus,S139,617655,1,0 +Mk1092=Stimulus,S128,617657,1,0 +Mk1093=Stimulus,S 51,618844,1,0 +Mk1094=Stimulus,S 11,619204,1,0 +Mk1095=Stimulus,S139,619205,1,0 +Mk1096=Stimulus,S128,619207,1,0 +Mk1097=Stimulus,S 53,620488,1,0 +Mk1098=Stimulus,S128,621027,1,0 +Mk1099=Stimulus,S139,621028,1,0 +Mk1100=Stimulus,S128,621031,1,0 +Mk1101=Stimulus,S 51,622307,1,0 +Mk1102=Stimulus,S128,622694,1,0 +Mk1103=Stimulus,S139,622695,1,0 +Mk1104=Stimulus,S128,622698,1,0 +Mk1105=Stimulus,S 54,624186,1,0 +Mk1106=Stimulus,S128,624678,1,0 +Mk1107=Stimulus,S139,624679,1,0 +Mk1108=Stimulus,S128,624682,1,0 +Mk1109=Stimulus,S 52,625831,1,0 +Mk1110=Stimulus,S128,626193,1,0 +Mk1111=Stimulus,S139,626196,1,0 +Mk1112=Stimulus,S128,626199,1,0 +Mk1113=Stimulus,S 54,627683,1,0 +Mk1114=Stimulus,S128,628168,1,0 +Mk1115=Stimulus,S139,628170,1,0 +Mk1116=Stimulus,S128,628173,1,0 +Mk1117=Stimulus,S 51,629595,1,0 +Mk1118=Stimulus,S128,629972,1,0 +Mk1119=Stimulus,S139,629974,1,0 +Mk1120=Stimulus,S128,629977,1,0 +Mk1121=Stimulus,S 51,631519,1,0 +Mk1122=Stimulus,S128,631882,1,0 +Mk1123=Stimulus,S139,631884,1,0 +Mk1124=Stimulus,S128,631887,1,0 +Mk1125=Stimulus,S 53,633061,1,0 +Mk1126=Stimulus,S128,633512,1,0 +Mk1127=Stimulus,S139,633517,1,0 +Mk1128=Stimulus,S128,633520,1,0 +Mk1129=Stimulus,S 54,635087,1,0 +Mk1130=Stimulus,S128,635603,1,0 +Mk1131=Stimulus,S139,635606,1,0 +Mk1132=Stimulus,S128,635608,1,0 +Mk1133=Stimulus,S 52,636629,1,0 +Mk1134=Stimulus,S139,637026,1,0 +Mk1135=Stimulus,S128,637029,1,0 +Mk1136=Stimulus,S 51,638511,1,0 +Mk1137=Stimulus,S128,638923,1,0 +Mk1138=Stimulus,S139,638926,1,0 +Mk1139=Stimulus,S128,638928,1,0 +Mk1140=Stimulus,S 53,640120,1,0 +Mk1141=Stimulus,S128,640506,1,0 +Mk1142=Stimulus,S139,640510,1,0 +Mk1143=Stimulus,S128,640512,1,0 +Mk1144=Stimulus,S 51,641703,1,0 +Mk1145=Stimulus,S128,642037,1,0 +Mk1146=Stimulus,S139,642039,1,0 +Mk1147=Stimulus,S128,642042,1,0 +Mk1148=Stimulus,S 53,643729,1,0 +Mk1149=Stimulus,S128,644179,1,0 +Mk1150=Stimulus,S139,644181,1,0 +Mk1151=Stimulus,S128,644184,1,0 +Mk1152=Stimulus,S 51,645643,1,0 +Mk1153=Stimulus,S128,645996,1,0 +Mk1154=Stimulus,S139,646000,1,0 +Mk1155=Stimulus,S128,646003,1,0 +Mk1156=Stimulus,S 54,647407,1,0 +Mk1157=Stimulus,S 11,647902,1,0 +Mk1158=Stimulus,S139,647903,1,0 +Mk1159=Stimulus,S128,647905,1,0 +Mk1160=Stimulus,S 52,649083,1,0 +Mk1161=Stimulus,S128,649477,1,0 +Mk1162=Stimulus,S139,649480,1,0 +Mk1163=Stimulus,S128,649482,1,0 +Mk1164=Stimulus,S128,649668,1,0 +Mk1165=Stimulus,S 54,650710,1,0 +Mk1166=Stimulus,S 11,651185,1,0 +Mk1167=Stimulus,S139,651187,1,0 +Mk1168=Stimulus,S128,651188,1,0 +Mk1169=Stimulus,S 52,652719,1,0 +Mk1170=Stimulus,S128,653094,1,0 +Mk1171=Stimulus,S139,653095,1,0 +Mk1172=Stimulus,S128,653098,1,0 +Mk1173=Stimulus,S 52,654744,1,0 +Mk1174=Stimulus,S139,655060,1,0 +Mk1175=Stimulus,S128,655062,1,0 +Mk1176=Stimulus,S 54,656308,1,0 +Mk1177=Stimulus,S128,656775,1,0 +Mk1178=Stimulus,S139,656780,1,0 +Mk1179=Stimulus,S128,656782,1,0 +Mk1180=Stimulus,S 51,657912,1,0 +Mk1181=Stimulus,S128,658403,1,0 +Mk1182=Stimulus,S139,658406,1,0 +Mk1183=Stimulus,S128,658408,1,0 +Mk1184=Stimulus,S 52,659829,1,0 +Mk1185=Stimulus,S 11,660378,1,0 +Mk1186=Stimulus,S139,660379,1,0 +Mk1187=Stimulus,S128,660382,1,0 +Mk1188=Stimulus,S 54,661501,1,0 +Mk1189=Stimulus,S139,661944,1,0 +Mk1190=Stimulus,S128,661947,1,0 +Mk1191=Stimulus,S128,661961,1,0 +Mk1192=Stimulus,S 54,663206,1,0 +Mk1193=Stimulus,S128,663667,1,0 +Mk1194=Stimulus,S139,663669,1,0 +Mk1195=Stimulus,S128,663672,1,0 +Mk1196=Stimulus,S 52,665021,1,0 +Mk1197=Stimulus,S128,665336,1,0 +Mk1198=Stimulus,S139,665339,1,0 +Mk1199=Stimulus,S128,665342,1,0 +Mk1200=Stimulus,S 54,666696,1,0 +Mk1201=Stimulus,S139,667099,1,0 +Mk1202=Stimulus,S128,667101,1,0 +Mk1203=Stimulus,S 53,668583,1,0 +Mk1204=Stimulus,S128,669079,1,0 +Mk1205=Stimulus,S139,669081,1,0 +Mk1206=Stimulus,S128,669084,1,0 +Mk1207=Stimulus,S 53,670391,1,0 +Mk1208=Stimulus,S 52,672029,1,0 +Mk1209=Stimulus,S128,672473,1,0 +Mk1210=Stimulus,S139,672475,1,0 +Mk1211=Stimulus,S128,672477,1,0 +Mk1212=Stimulus,S 52,673589,1,0 +Mk1213=Stimulus,S139,673953,1,0 +Mk1214=Stimulus,S128,673956,1,0 +Mk1215=Stimulus,S 53,675529,1,0 +Mk1216=Stimulus,S128,675930,1,0 +Mk1217=Stimulus,S139,675932,1,0 +Mk1218=Stimulus,S128,675934,1,0 +Mk1219=Stimulus,S 52,677404,1,0 +Mk1220=Stimulus,S139,677830,1,0 +Mk1221=Stimulus,S128,677833,1,0 +Mk1222=Stimulus,S 53,679358,1,0 +Mk1223=Stimulus,S128,679770,1,0 +Mk1224=Stimulus,S139,679773,1,0 +Mk1225=Stimulus,S128,679776,1,0 +Mk1226=Stimulus,S 54,681046,1,0 +Mk1227=Stimulus,S128,681524,1,0 +Mk1228=Stimulus,S139,681528,1,0 +Mk1229=Stimulus,S128,681531,1,0 +Mk1230=Stimulus,S 53,682660,1,0 +Mk1231=Stimulus,S128,683068,1,0 +Mk1232=Stimulus,S139,683075,1,0 +Mk1233=Stimulus,S128,683079,1,0 +Mk1234=Stimulus,S 53,684240,1,0 +Mk1235=Stimulus,S 11,684655,1,0 +Mk1236=Stimulus,S139,684657,1,0 +Mk1237=Stimulus,S128,684658,1,0 +Mk1238=Stimulus,S 51,685874,1,0 +Mk1239=Stimulus,S128,686229,1,0 +Mk1240=Stimulus,S139,686232,1,0 +Mk1241=Stimulus,S128,686235,1,0 +Mk1242=Stimulus,S128,698345,1,0 +Mk1243=Stimulus,S128,699436,1,0 +Mk1244=Stimulus,S 54,702475,1,0 +Mk1245=Stimulus,S128,703156,1,0 +Mk1246=Stimulus,S139,703161,1,0 +Mk1247=Stimulus,S128,703164,1,0 +Mk1248=Stimulus,S 51,704287,1,0 +Mk1249=Stimulus,S128,704673,1,0 +Mk1250=Stimulus,S139,704679,1,0 +Mk1251=Stimulus,S128,704682,1,0 +Mk1252=Stimulus,S 54,706102,1,0 +Mk1253=Stimulus,S128,706531,1,0 +Mk1254=Stimulus,S139,706533,1,0 +Mk1255=Stimulus,S128,706536,1,0 +Mk1256=Stimulus,S 52,707768,1,0 +Mk1257=Stimulus,S128,708143,1,0 +Mk1258=Stimulus,S139,708148,1,0 +Mk1259=Stimulus,S128,708150,1,0 +Mk1260=Stimulus,S 52,709420,1,0 +Mk1261=Stimulus,S128,709824,1,0 +Mk1262=Stimulus,S139,709829,1,0 +Mk1263=Stimulus,S128,709833,1,0 +Mk1264=Stimulus,S 52,710974,1,0 +Mk1265=Stimulus,S 11,711353,1,0 +Mk1266=Stimulus,S139,711354,1,0 +Mk1267=Stimulus,S128,711355,1,0 +Mk1268=Stimulus,S 51,712984,1,0 +Mk1269=Stimulus,S128,713339,1,0 +Mk1270=Stimulus,S139,713342,1,0 +Mk1271=Stimulus,S128,713345,1,0 +Mk1272=Stimulus,S 54,714584,1,0 +Mk1273=Stimulus,S139,715009,1,0 +Mk1274=Stimulus,S128,715012,1,0 +Mk1275=Stimulus,S 51,716466,1,0 +Mk1276=Stimulus,S128,716767,1,0 +Mk1277=Stimulus,S139,716771,1,0 +Mk1278=Stimulus,S128,716773,1,0 +Mk1279=Stimulus,S 53,718307,1,0 +Mk1280=Stimulus,S128,718579,1,0 +Mk1281=Stimulus,S140,718581,1,0 +Mk1282=Stimulus,S128,718584,1,0 +Mk1283=Stimulus,S 53,720304,1,0 +Mk1284=Stimulus,S139,720768,1,0 +Mk1285=Stimulus,S128,720770,1,0 +Mk1286=Stimulus,S 54,722041,1,0 +Mk1287=Stimulus,S128,722476,1,0 +Mk1288=Stimulus,S139,722480,1,0 +Mk1289=Stimulus,S128,722482,1,0 +Mk1290=Stimulus,S 51,723832,1,0 +Mk1291=Stimulus,S128,724189,1,0 +Mk1292=Stimulus,S139,724190,1,0 +Mk1293=Stimulus,S128,724193,1,0 +Mk1294=Stimulus,S 51,725512,1,0 +Mk1295=Stimulus,S128,725844,1,0 +Mk1296=Stimulus,S139,725848,1,0 +Mk1297=Stimulus,S128,725850,1,0 +Mk1298=Stimulus,S 53,727253,1,0 +Mk1299=Stimulus,S128,727641,1,0 +Mk1300=Stimulus,S139,727643,1,0 +Mk1301=Stimulus,S128,727646,1,0 +Mk1302=Stimulus,S 51,729055,1,0 +Mk1303=Stimulus,S128,729388,1,0 +Mk1304=Stimulus,S139,729391,1,0 +Mk1305=Stimulus,S128,729394,1,0 +Mk1306=Stimulus,S 53,730756,1,0 +Mk1307=Stimulus,S128,731150,1,0 +Mk1308=Stimulus,S139,731153,1,0 +Mk1309=Stimulus,S128,731157,1,0 +Mk1310=Stimulus,S 52,732779,1,0 +Mk1311=Stimulus,S128,733110,1,0 +Mk1312=Stimulus,S139,733114,1,0 +Mk1313=Stimulus,S128,733117,1,0 +Mk1314=Stimulus,S 51,734430,1,0 +Mk1315=Stimulus,S128,734784,1,0 +Mk1316=Stimulus,S139,734785,1,0 +Mk1317=Stimulus,S128,734788,1,0 +Mk1318=Stimulus,S 54,736215,1,0 +Mk1319=Stimulus,S139,736679,1,0 +Mk1320=Stimulus,S128,736681,1,0 +Mk1321=Stimulus,S 52,737903,1,0 +Mk1322=Stimulus,S139,738287,1,0 +Mk1323=Stimulus,S128,738290,1,0 +Mk1324=Stimulus,S 53,739602,1,0 +Mk1325=Stimulus,S128,739994,1,0 +Mk1326=Stimulus,S139,739998,1,0 +Mk1327=Stimulus,S128,740001,1,0 +Mk1328=Stimulus,S 53,741362,1,0 +Mk1329=Stimulus,S 11,741735,1,0 +Mk1330=Stimulus,S139,741737,1,0 +Mk1331=Stimulus,S128,741738,1,0 +Mk1332=Stimulus,S 53,742937,1,0 +Mk1333=Stimulus,S128,743358,1,0 +Mk1334=Stimulus,S139,743361,1,0 +Mk1335=Stimulus,S128,743364,1,0 +Mk1336=Stimulus,S 52,744597,1,0 +Mk1337=Stimulus,S128,745034,1,0 +Mk1338=Stimulus,S139,745039,1,0 +Mk1339=Stimulus,S128,745042,1,0 +Mk1340=Stimulus,S 53,746360,1,0 +Mk1341=Stimulus,S128,746763,1,0 +Mk1342=Stimulus,S139,746764,1,0 +Mk1343=Stimulus,S128,746767,1,0 +Mk1344=Stimulus,S 51,748213,1,0 +Mk1345=Stimulus,S128,748547,1,0 +Mk1346=Stimulus,S139,748553,1,0 +Mk1347=Stimulus,S128,748556,1,0 +Mk1348=Stimulus,S 54,750146,1,0 +Mk1349=Stimulus,S 11,750556,1,0 +Mk1350=Stimulus,S128,750559,1,0 +Mk1351=Stimulus,S 52,751779,1,0 +Mk1352=Stimulus,S128,752171,1,0 +Mk1353=Stimulus,S139,752173,1,0 +Mk1354=Stimulus,S128,752176,1,0 +Mk1355=Stimulus,S128,752381,1,0 +Mk1356=Stimulus,S 51,753336,1,0 +Mk1357=Stimulus,S139,753709,1,0 +Mk1358=Stimulus,S128,753712,1,0 +Mk1359=Stimulus,S 52,755011,1,0 +Mk1360=Stimulus,S128,755458,1,0 +Mk1361=Stimulus,S139,755463,1,0 +Mk1362=Stimulus,S128,755466,1,0 +Mk1363=Stimulus,S 54,756668,1,0 +Mk1364=Stimulus,S 11,757165,1,0 +Mk1365=Stimulus,S139,757166,1,0 +Mk1366=Stimulus,S128,757168,1,0 +Mk1367=Stimulus,S 53,758602,1,0 +Mk1368=Stimulus,S128,759057,1,0 +Mk1369=Stimulus,S139,759059,1,0 +Mk1370=Stimulus,S128,759062,1,0 +Mk1371=Stimulus,S 54,760416,1,0 +Mk1372=Stimulus,S128,761079,1,0 +Mk1373=Stimulus,S139,761083,1,0 +Mk1374=Stimulus,S128,761085,1,0 +Mk1375=Stimulus,S 52,762137,1,0 +Mk1376=Stimulus,S128,762584,1,0 +Mk1377=Stimulus,S139,762589,1,0 +Mk1378=Stimulus,S128,762592,1,0 +Mk1379=Stimulus,S 54,763923,1,0 +Mk1380=Stimulus,S128,764406,1,0 +Mk1381=Stimulus,S139,764410,1,0 +Mk1382=Stimulus,S128,764412,1,0 +Mk1383=Stimulus,S 51,765713,1,0 +Mk1384=Stimulus,S128,766148,1,0 +Mk1385=Stimulus,S139,766150,1,0 +Mk1386=Stimulus,S128,766154,1,0 +Mk1387=Stimulus,S 52,767332,1,0 +Mk1388=Stimulus,S128,767803,1,0 +Mk1389=Stimulus,S139,767808,1,0 +Mk1390=Stimulus,S128,767811,1,0 +Mk1391=Stimulus,S 54,768912,1,0 +Mk1392=Stimulus,S128,769398,1,0 +Mk1393=Stimulus,S139,769399,1,0 +Mk1394=Stimulus,S128,769402,1,0 +Mk1395=Stimulus,S 53,770939,1,0 +Mk1396=Stimulus,S128,771315,1,0 +Mk1397=Stimulus,S139,771318,1,0 +Mk1398=Stimulus,S128,771321,1,0 +Mk1399=Stimulus,S128,783176,1,0 +Mk1400=Stimulus,S128,784794,1,0 +Mk1401=Stimulus,S 54,787833,1,0 +Mk1402=Stimulus,S 11,788351,1,0 +Mk1403=Stimulus,S139,788352,1,0 +Mk1404=Stimulus,S128,788354,1,0 +Mk1405=Stimulus,S 54,789581,1,0 +Mk1406=Stimulus,S 11,790045,1,0 +Mk1407=Stimulus,S139,790046,1,0 +Mk1408=Stimulus,S128,790047,1,0 +Mk1409=Stimulus,S 54,791165,1,0 +Mk1410=Stimulus,S128,791622,1,0 +Mk1411=Stimulus,S139,791626,1,0 +Mk1412=Stimulus,S128,791628,1,0 +Mk1413=Stimulus,S 54,793146,1,0 +Mk1414=Stimulus,S128,793536,1,0 +Mk1415=Stimulus,S139,793537,1,0 +Mk1416=Stimulus,S128,793540,1,0 +Mk1417=Stimulus,S 54,795173,1,0 +Mk1418=Stimulus,S128,795589,1,0 +Mk1419=Stimulus,S139,795594,1,0 +Mk1420=Stimulus,S128,795597,1,0 +Mk1421=Stimulus,S 53,796920,1,0 +Mk1422=Stimulus,S128,797380,1,0 +Mk1423=Stimulus,S139,797384,1,0 +Mk1424=Stimulus,S128,797387,1,0 +Mk1425=Stimulus,S 52,798718,1,0 +Mk1426=Stimulus,S128,799144,1,0 +Mk1427=Stimulus,S139,799145,1,0 +Mk1428=Stimulus,S128,799148,1,0 +Mk1429=Stimulus,S 51,800534,1,0 +Mk1430=Stimulus,S128,800935,1,0 +Mk1431=Stimulus,S139,800940,1,0 +Mk1432=Stimulus,S128,800943,1,0 +Mk1433=Stimulus,S 52,802105,1,0 +Mk1434=Stimulus,S128,802518,1,0 +Mk1435=Stimulus,S139,802520,1,0 +Mk1436=Stimulus,S128,802522,1,0 +Mk1437=Stimulus,S 52,803962,1,0 +Mk1438=Stimulus,S128,804313,1,0 +Mk1439=Stimulus,S139,804316,1,0 +Mk1440=Stimulus,S128,804319,1,0 +Mk1441=Stimulus,S 53,805772,1,0 +Mk1442=Stimulus,S128,806152,1,0 +Mk1443=Stimulus,S139,806156,1,0 +Mk1444=Stimulus,S128,806159,1,0 +Mk1445=Stimulus,S 54,807677,1,0 +Mk1446=Stimulus,S139,808116,1,0 +Mk1447=Stimulus,S128,808119,1,0 +Mk1448=Stimulus,S 51,809591,1,0 +Mk1449=Stimulus,S139,809942,1,0 +Mk1450=Stimulus,S128,809944,1,0 +Mk1451=Stimulus,S 52,811269,1,0 +Mk1452=Stimulus,S139,811678,1,0 +Mk1453=Stimulus,S128,811681,1,0 +Mk1454=Stimulus,S 51,812846,1,0 +Mk1455=Stimulus,S 11,813310,1,0 +Mk1456=Stimulus,S 52,814643,1,0 +Mk1457=Stimulus,S139,814955,1,0 +Mk1458=Stimulus,S128,814958,1,0 +Mk1459=Stimulus,S128,815149,1,0 +Mk1460=Stimulus,S 52,816221,1,0 +Mk1461=Stimulus,S139,816623,1,0 +Mk1462=Stimulus,S128,816627,1,0 +Mk1463=Stimulus,S 54,818061,1,0 +Mk1464=Stimulus,S128,818501,1,0 +Mk1465=Stimulus,S139,818504,1,0 +Mk1466=Stimulus,S128,818507,1,0 +Mk1467=Stimulus,S128,818520,1,0 +Mk1468=Stimulus,S 53,820064,1,0 +Mk1469=Stimulus,S128,820517,1,0 +Mk1470=Stimulus,S139,820524,1,0 +Mk1471=Stimulus,S128,820527,1,0 +Mk1472=Stimulus,S 53,821644,1,0 +Mk1473=Stimulus,S128,822040,1,0 +Mk1474=Stimulus,S139,822041,1,0 +Mk1475=Stimulus,S128,822044,1,0 +Mk1476=Stimulus,S 52,823185,1,0 +Mk1477=Stimulus,S128,823584,1,0 +Mk1478=Stimulus,S139,823588,1,0 +Mk1479=Stimulus,S128,823591,1,0 +Mk1480=Stimulus,S 54,824862,1,0 +Mk1481=Stimulus,S139,825270,1,0 +Mk1482=Stimulus,S128,825273,1,0 +Mk1483=Stimulus,S 54,826562,1,0 +Mk1484=Stimulus,S128,827070,1,0 +Mk1485=Stimulus,S139,827074,1,0 +Mk1486=Stimulus,S128,827076,1,0 +Mk1487=Stimulus,S 51,828103,1,0 +Mk1488=Stimulus,S128,828540,1,0 +Mk1489=Stimulus,S139,828542,1,0 +Mk1490=Stimulus,S128,828545,1,0 +Mk1491=Stimulus,S 51,829682,1,0 +Mk1492=Stimulus,S128,830052,1,0 +Mk1493=Stimulus,S139,830054,1,0 +Mk1494=Stimulus,S128,830057,1,0 +Mk1495=Stimulus,S 54,831569,1,0 +Mk1496=Stimulus,S 11,831969,1,0 +Mk1497=Stimulus,S139,831970,1,0 +Mk1498=Stimulus,S128,831971,1,0 +Mk1499=Stimulus,S 53,833460,1,0 +Mk1500=Stimulus,S128,833778,1,0 +Mk1501=Stimulus,S139,833781,1,0 +Mk1502=Stimulus,S128,833784,1,0 +Mk1503=Stimulus,S 51,835479,1,0 +Mk1504=Stimulus,S128,835796,1,0 +Mk1505=Stimulus,S139,835803,1,0 +Mk1506=Stimulus,S128,835805,1,0 +Mk1507=Stimulus,S 51,837068,1,0 +Mk1508=Stimulus,S128,837409,1,0 +Mk1509=Stimulus,S139,837411,1,0 +Mk1510=Stimulus,S128,837413,1,0 +Mk1511=Stimulus,S 53,839017,1,0 +Mk1512=Stimulus,S128,839567,1,0 +Mk1513=Stimulus,S139,839569,1,0 +Mk1514=Stimulus,S128,839572,1,0 +Mk1515=Stimulus,S 51,840916,1,0 +Mk1516=Stimulus,S128,841283,1,0 +Mk1517=Stimulus,S139,841288,1,0 +Mk1518=Stimulus,S128,841290,1,0 +Mk1519=Stimulus,S 53,842493,1,0 +Mk1520=Stimulus,S128,842925,1,0 +Mk1521=Stimulus,S139,842932,1,0 +Mk1522=Stimulus,S128,842935,1,0 +Mk1523=Stimulus,S 52,844151,1,0 +Mk1524=Stimulus,S 11,844527,1,0 +Mk1525=Stimulus,S139,844528,1,0 +Mk1526=Stimulus,S128,844530,1,0 +Mk1527=Stimulus,S 52,845884,1,0 +Mk1528=Stimulus,S 11,846247,1,0 +Mk1529=Stimulus,S139,846249,1,0 +Mk1530=Stimulus,S128,846250,1,0 +Mk1531=Stimulus,S 53,847866,1,0 +Mk1532=Stimulus,S128,848304,1,0 +Mk1533=Stimulus,S139,848312,1,0 +Mk1534=Stimulus,S128,848315,1,0 +Mk1535=Stimulus,S 51,849705,1,0 +Mk1536=Stimulus,S128,850055,1,0 +Mk1537=Stimulus,S139,850062,1,0 +Mk1538=Stimulus,S128,850065,1,0 +Mk1539=Stimulus,S 51,851548,1,0 +Mk1540=Stimulus,S128,851899,1,0 +Mk1541=Stimulus,S139,851900,1,0 +Mk1542=Stimulus,S128,851902,1,0 +Mk1543=Stimulus,S 52,853348,1,0 +Mk1544=Stimulus,S128,853800,1,0 +Mk1545=Stimulus,S139,853805,1,0 +Mk1546=Stimulus,S128,853807,1,0 +Mk1547=Stimulus,S 53,855046,1,0 +Mk1548=Stimulus,S128,855475,1,0 +Mk1549=Stimulus,S139,855480,1,0 +Mk1550=Stimulus,S128,855483,1,0 +Mk1551=Stimulus,S 53,856897,1,0 +Mk1552=Stimulus,S128,857290,1,0 +Mk1553=Stimulus,S139,857291,1,0 +Mk1554=Stimulus,S128,857294,1,0 +Mk1555=Stimulus,S128,869618,1,0 +Mk1556=Stimulus,S128,870432,1,0 +Mk1557=Stimulus,S 53,873473,1,0 +Mk1558=Stimulus,S 11,873851,1,0 +Mk1559=Stimulus,S139,873853,1,0 +Mk1560=Stimulus,S128,873854,1,0 +Mk1561=Stimulus,S 52,875489,1,0 +Mk1562=Stimulus,S128,875910,1,0 +Mk1563=Stimulus,S139,875916,1,0 +Mk1564=Stimulus,S128,875918,1,0 +Mk1565=Stimulus,S 51,877170,1,0 +Mk1566=Stimulus,S128,877552,1,0 +Mk1567=Stimulus,S139,877553,1,0 +Mk1568=Stimulus,S128,877555,1,0 +Mk1569=Stimulus,S 54,879018,1,0 +Mk1570=Stimulus,S 11,879464,1,0 +Mk1571=Stimulus,S139,879465,1,0 +Mk1572=Stimulus,S128,879467,1,0 +Mk1573=Stimulus,S 51,881009,1,0 +Mk1574=Stimulus,S128,881382,1,0 +Mk1575=Stimulus,S139,881388,1,0 +Mk1576=Stimulus,S128,881390,1,0 +Mk1577=Stimulus,S 54,882545,1,0 +Mk1578=Stimulus,S139,882964,1,0 +Mk1579=Stimulus,S128,882967,1,0 +Mk1580=Stimulus,S 51,884206,1,0 +Mk1581=Stimulus,S128,884577,1,0 +Mk1582=Stimulus,S139,884583,1,0 +Mk1583=Stimulus,S128,884586,1,0 +Mk1584=Stimulus,S 52,885961,1,0 +Mk1585=Stimulus,S139,886345,1,0 +Mk1586=Stimulus,S128,886347,1,0 +Mk1587=Stimulus,S 53,887916,1,0 +Mk1588=Stimulus,S128,888272,1,0 +Mk1589=Stimulus,S139,888276,1,0 +Mk1590=Stimulus,S128,888278,1,0 +Mk1591=Stimulus,S 54,889790,1,0 +Mk1592=Stimulus,S128,890190,1,0 +Mk1593=Stimulus,S139,890191,1,0 +Mk1594=Stimulus,S128,890194,1,0 +Mk1595=Stimulus,S 52,891543,1,0 +Mk1596=Stimulus,S 11,891927,1,0 +Mk1597=Stimulus,S139,891928,1,0 +Mk1598=Stimulus,S128,891930,1,0 +Mk1599=Stimulus,S 52,893345,1,0 +Mk1600=Stimulus,S128,893771,1,0 +Mk1601=Stimulus,S139,893776,1,0 +Mk1602=Stimulus,S128,893778,1,0 +Mk1603=Stimulus,S 54,894896,1,0 +Mk1604=Stimulus,S 11,895287,1,0 +Mk1605=Stimulus,S139,895288,1,0 +Mk1606=Stimulus,S128,895289,1,0 +Mk1607=Stimulus,S 52,896693,1,0 +Mk1608=Stimulus,S128,897098,1,0 +Mk1609=Stimulus,S139,897102,1,0 +Mk1610=Stimulus,S128,897105,1,0 +Mk1611=Stimulus,S 52,898448,1,0 +Mk1612=Stimulus,S128,898791,1,0 +Mk1613=Stimulus,S139,898793,1,0 +Mk1614=Stimulus,S128,898796,1,0 +Mk1615=Stimulus,S128,898809,1,0 +Mk1616=Stimulus,S 52,900057,1,0 +Mk1617=Stimulus,S128,900391,1,0 +Mk1618=Stimulus,S139,900393,1,0 +Mk1619=Stimulus,S128,900397,1,0 +Mk1620=Stimulus,S 54,902011,1,0 +Mk1621=Stimulus,S128,902473,1,0 +Mk1622=Stimulus,S139,902475,1,0 +Mk1623=Stimulus,S128,902478,1,0 +Mk1624=Stimulus,S 51,903669,1,0 +Mk1625=Stimulus,S128,904026,1,0 +Mk1626=Stimulus,S139,904028,1,0 +Mk1627=Stimulus,S128,904030,1,0 +Mk1628=Stimulus,S 51,905598,1,0 +Mk1629=Stimulus,S128,905951,1,0 +Mk1630=Stimulus,S139,905953,1,0 +Mk1631=Stimulus,S128,905956,1,0 +Mk1632=Stimulus,S 53,907589,1,0 +Mk1633=Stimulus,S128,908022,1,0 +Mk1634=Stimulus,S139,908023,1,0 +Mk1635=Stimulus,S128,908026,1,0 +Mk1636=Stimulus,S 53,909149,1,0 +Mk1637=Stimulus,S139,909574,1,0 +Mk1638=Stimulus,S128,909577,1,0 +Mk1639=Stimulus,S 52,911168,1,0 +Mk1640=Stimulus,S 11,911522,1,0 +Mk1641=Stimulus,S139,911524,1,0 +Mk1642=Stimulus,S128,911525,1,0 +Mk1643=Stimulus,S 51,913092,1,0 +Mk1644=Stimulus,S128,913472,1,0 +Mk1645=Stimulus,S139,913474,1,0 +Mk1646=Stimulus,S128,913477,1,0 +Mk1647=Stimulus,S 51,915043,1,0 +Mk1648=Stimulus,S139,915380,1,0 +Mk1649=Stimulus,S128,915383,1,0 +Mk1650=Stimulus,S 53,916780,1,0 +Mk1651=Stimulus,S128,917182,1,0 +Mk1652=Stimulus,S139,917183,1,0 +Mk1653=Stimulus,S128,917186,1,0 +Mk1654=Stimulus,S 52,918645,1,0 +Mk1655=Stimulus,S128,919050,1,0 +Mk1656=Stimulus,S139,919052,1,0 +Mk1657=Stimulus,S128,919054,1,0 +Mk1658=Stimulus,S 54,920191,1,0 +Mk1659=Stimulus,S128,920730,1,0 +Mk1660=Stimulus,S139,920734,1,0 +Mk1661=Stimulus,S128,920737,1,0 +Mk1662=Stimulus,S128,920748,1,0 +Mk1663=Stimulus,S 54,922030,1,0 +Mk1664=Stimulus,S128,922475,1,0 +Mk1665=Stimulus,S139,922476,1,0 +Mk1666=Stimulus,S128,922479,1,0 +Mk1667=Stimulus,S 51,923591,1,0 +Mk1668=Stimulus,S128,924032,1,0 +Mk1669=Stimulus,S139,924035,1,0 +Mk1670=Stimulus,S128,924038,1,0 +Mk1671=Stimulus,S 54,925580,1,0 +Mk1672=Stimulus,S 11,926002,1,0 +Mk1673=Stimulus,S139,926003,1,0 +Mk1674=Stimulus,S128,926005,1,0 +Mk1675=Stimulus,S128,926020,1,0 +Mk1676=Stimulus,S 52,927329,1,0 +Mk1677=Stimulus,S128,927729,1,0 +Mk1678=Stimulus,S139,927732,1,0 +Mk1679=Stimulus,S128,927736,1,0 +Mk1680=Stimulus,S 54,929243,1,0 +Mk1681=Stimulus,S 11,929692,1,0 +Mk1682=Stimulus,S139,929693,1,0 +Mk1683=Stimulus,S128,929694,1,0 +Mk1684=Stimulus,S 51,931261,1,0 +Mk1685=Stimulus,S128,931754,1,0 +Mk1686=Stimulus,S139,931757,1,0 +Mk1687=Stimulus,S128,931759,1,0 +Mk1688=Stimulus,S 54,933229,1,0 +Mk1689=Stimulus,S128,933664,1,0 +Mk1690=Stimulus,S139,933668,1,0 +Mk1691=Stimulus,S128,933671,1,0 +Mk1692=Stimulus,S128,933841,1,0 +Mk1693=Stimulus,S 53,935172,1,0 +Mk1694=Stimulus,S128,935682,1,0 +Mk1695=Stimulus,S139,935685,1,0 +Mk1696=Stimulus,S128,935687,1,0 +Mk1697=Stimulus,S 51,937085,1,0 +Mk1698=Stimulus,S128,937506,1,0 +Mk1699=Stimulus,S139,937511,1,0 +Mk1700=Stimulus,S128,937513,1,0 +Mk1701=Stimulus,S 53,938881,1,0 +Mk1702=Stimulus,S128,939328,1,0 +Mk1703=Stimulus,S139,939335,1,0 +Mk1704=Stimulus,S128,939337,1,0 +Mk1705=Stimulus,S 53,940638,1,0 +Mk1706=Stimulus,S128,941096,1,0 +Mk1707=Stimulus,S139,941099,1,0 +Mk1708=Stimulus,S128,941102,1,0 +Mk1709=Stimulus,S 53,942651,1,0 +Mk1710=Stimulus,S128,943040,1,0 +Mk1711=Stimulus,S139,943045,1,0 +Mk1712=Stimulus,S128,943048,1,0 +Mk1713=Stimulus,S 53,944349,1,0 +Mk1714=Stimulus,S128,944804,1,0 +Mk1715=Stimulus,S139,944810,1,0 +Mk1716=Stimulus,S128,944813,1,0 +Mk1717=Stimulus,S128,962771,1,0 +Mk1718=Stimulus,S128,1051672,1,0 +Mk1719=Stimulus,S128,1079129,1,0 +Mk1720=Stimulus,S128,1090262,1,0 +Mk1721=Stimulus,S128,1095000,1,0 +Mk1722=Stimulus,S 44,1098049,1,0 +Mk1723=Stimulus,S128,1098605,1,0 +Mk1724=Stimulus,S139,1098610,1,0 +Mk1725=Stimulus,S128,1098613,1,0 +Mk1726=Stimulus,S128,1098749,1,0 +Mk1727=Stimulus,S 43,1099938,1,0 +Mk1728=Stimulus,S 12,1100374,1,0 +Mk1729=Stimulus,S 41,1101634,1,0 +Mk1730=Stimulus,S 11,1102047,1,0 +Mk1731=Stimulus,S139,1102049,1,0 +Mk1732=Stimulus,S128,1102050,1,0 +Mk1733=Stimulus,S 44,1103666,1,0 +Mk1734=Stimulus,S 11,1104075,1,0 +Mk1735=Stimulus,S128,1104081,1,0 +Mk1736=Stimulus,S 42,1105317,1,0 +Mk1737=Stimulus,S 11,1105720,1,0 +Mk1738=Stimulus,S139,1105722,1,0 +Mk1739=Stimulus,S128,1105723,1,0 +Mk1740=Stimulus,S 41,1107345,1,0 +Mk1741=Stimulus,S128,1107823,1,0 +Mk1742=Stimulus,S139,1107827,1,0 +Mk1743=Stimulus,S128,1107830,1,0 +Mk1744=Stimulus,S 42,1109378,1,0 +Mk1745=Stimulus,S128,1109758,1,0 +Mk1746=Stimulus,S139,1109761,1,0 +Mk1747=Stimulus,S128,1109764,1,0 +Mk1748=Stimulus,S128,1109936,1,0 +Mk1749=Stimulus,S 44,1111369,1,0 +Mk1750=Stimulus,S128,1111898,1,0 +Mk1751=Stimulus,S139,1111900,1,0 +Mk1752=Stimulus,S128,1111903,1,0 +Mk1753=Stimulus,S 43,1112918,1,0 +Mk1754=Stimulus,S128,1113483,1,0 +Mk1755=Stimulus,S139,1113490,1,0 +Mk1756=Stimulus,S128,1113493,1,0 +Mk1757=Stimulus,S 42,1114576,1,0 +Mk1758=Stimulus,S 11,1114985,1,0 +Mk1759=Stimulus,S128,1114989,1,0 +Mk1760=Stimulus,S 43,1116561,1,0 +Mk1761=Stimulus,S 11,1117102,1,0 +Mk1762=Stimulus,S 43,1118574,1,0 +Mk1763=Stimulus,S128,1119176,1,0 +Mk1764=Stimulus,S139,1119177,1,0 +Mk1765=Stimulus,S128,1119180,1,0 +Mk1766=Stimulus,S 43,1120407,1,0 +Mk1767=Stimulus,S 11,1120877,1,0 +Mk1768=Stimulus,S 43,1122161,1,0 +Mk1769=Stimulus,S 11,1122585,1,0 +Mk1770=Stimulus,S128,1122588,1,0 +Mk1771=Stimulus,S 41,1124027,1,0 +Mk1772=Stimulus,S128,1124354,1,0 +Mk1773=Stimulus,S139,1124356,1,0 +Mk1774=Stimulus,S128,1124359,1,0 +Mk1775=Stimulus,S128,1124484,1,0 +Mk1776=Stimulus,S 42,1125871,1,0 +Mk1777=Stimulus,S128,1126313,1,0 +Mk1778=Stimulus,S139,1126317,1,0 +Mk1779=Stimulus,S128,1126319,1,0 +Mk1780=Stimulus,S128,1126448,1,0 +Mk1781=Stimulus,S 42,1127492,1,0 +Mk1782=Stimulus,S128,1127978,1,0 +Mk1783=Stimulus,S139,1127984,1,0 +Mk1784=Stimulus,S128,1127986,1,0 +Mk1785=Stimulus,S128,1128102,1,0 +Mk1786=Stimulus,S 41,1129389,1,0 +Mk1787=Stimulus,S128,1129769,1,0 +Mk1788=Stimulus,S139,1129774,1,0 +Mk1789=Stimulus,S128,1129777,1,0 +Mk1790=Stimulus,S128,1129905,1,0 +Mk1791=Stimulus,S 44,1130950,1,0 +Mk1792=Stimulus,S128,1131416,1,0 +Mk1793=Stimulus,S139,1131418,1,0 +Mk1794=Stimulus,S128,1131421,1,0 +Mk1795=Stimulus,S 44,1132946,1,0 +Mk1796=Stimulus,S128,1133305,1,0 +Mk1797=Stimulus,S140,1133312,1,0 +Mk1798=Stimulus,S128,1133315,1,0 +Mk1799=Stimulus,S128,1133426,1,0 +Mk1800=Stimulus,S 41,1134687,1,0 +Mk1801=Stimulus,S139,1135368,1,0 +Mk1802=Stimulus,S128,1135371,1,0 +Mk1803=Stimulus,S128,1135505,1,0 +Mk1804=Stimulus,S 42,1136289,1,0 +Mk1805=Stimulus,S128,1136723,1,0 +Mk1806=Stimulus,S139,1136728,1,0 +Mk1807=Stimulus,S128,1136731,1,0 +Mk1808=Stimulus,S128,1136852,1,0 +Mk1809=Stimulus,S 44,1138062,1,0 +Mk1810=Stimulus,S128,1138523,1,0 +Mk1811=Stimulus,S139,1138525,1,0 +Mk1812=Stimulus,S128,1138528,1,0 +Mk1813=Stimulus,S 43,1139992,1,0 +Mk1814=Stimulus,S128,1140596,1,0 +Mk1815=Stimulus,S139,1140601,1,0 +Mk1816=Stimulus,S128,1140604,1,0 +Mk1817=Stimulus,S128,1140750,1,0 +Mk1818=Stimulus,S 43,1141566,1,0 +Mk1819=Stimulus,S128,1142036,1,0 +Mk1820=Stimulus,S139,1142039,1,0 +Mk1821=Stimulus,S128,1142042,1,0 +Mk1822=Stimulus,S128,1142179,1,0 +Mk1823=Stimulus,S 43,1143481,1,0 +Mk1824=Stimulus,S128,1143952,1,0 +Mk1825=Stimulus,S139,1143955,1,0 +Mk1826=Stimulus,S128,1143958,1,0 +Mk1827=Stimulus,S128,1144085,1,0 +Mk1828=Stimulus,S 41,1145075,1,0 +Mk1829=Stimulus,S128,1145574,1,0 +Mk1830=Stimulus,S139,1145576,1,0 +Mk1831=Stimulus,S128,1145578,1,0 +Mk1832=Stimulus,S 42,1146952,1,0 +Mk1833=Stimulus,S128,1147364,1,0 +Mk1834=Stimulus,S139,1147366,1,0 +Mk1835=Stimulus,S128,1147369,1,0 +Mk1836=Stimulus,S 42,1148772,1,0 +Mk1837=Stimulus,S128,1149297,1,0 +Mk1838=Stimulus,S139,1149303,1,0 +Mk1839=Stimulus,S128,1149305,1,0 +Mk1840=Stimulus,S128,1149409,1,0 +Mk1841=Stimulus,S 41,1150459,1,0 +Mk1842=Stimulus,S128,1150894,1,0 +Mk1843=Stimulus,S139,1150899,1,0 +Mk1844=Stimulus,S128,1150902,1,0 +Mk1845=Stimulus,S128,1151046,1,0 +Mk1846=Stimulus,S 41,1152481,1,0 +Mk1847=Stimulus,S128,1152889,1,0 +Mk1848=Stimulus,S139,1152893,1,0 +Mk1849=Stimulus,S128,1152896,1,0 +Mk1850=Stimulus,S 44,1154063,1,0 +Mk1851=Stimulus,S128,1154550,1,0 +Mk1852=Stimulus,S139,1154557,1,0 +Mk1853=Stimulus,S128,1154560,1,0 +Mk1854=Stimulus,S 44,1155926,1,0 +Mk1855=Stimulus,S128,1156384,1,0 +Mk1856=Stimulus,S139,1156387,1,0 +Mk1857=Stimulus,S128,1156390,1,0 +Mk1858=Stimulus,S128,1156480,1,0 +Mk1859=Stimulus,S 44,1157563,1,0 +Mk1860=Stimulus,S128,1158088,1,0 +Mk1861=Stimulus,S139,1158094,1,0 +Mk1862=Stimulus,S128,1158097,1,0 +Mk1863=Stimulus,S128,1158208,1,0 +Mk1864=Stimulus,S 43,1159554,1,0 +Mk1865=Stimulus,S128,1160027,1,0 +Mk1866=Stimulus,S139,1160035,1,0 +Mk1867=Stimulus,S128,1160038,1,0 +Mk1868=Stimulus,S128,1160178,1,0 +Mk1869=Stimulus,S 41,1161557,1,0 +Mk1870=Stimulus,S 11,1161947,1,0 +Mk1871=Stimulus,S139,1161948,1,0 +Mk1872=Stimulus,S128,1161950,1,0 +Mk1873=Stimulus,S 44,1163554,1,0 +Mk1874=Stimulus,S 12,1163961,1,0 +Mk1875=Stimulus,S 42,1165466,1,0 +Mk1876=Stimulus,S128,1165916,1,0 +Mk1877=Stimulus,S139,1165917,1,0 +Mk1878=Stimulus,S128,1165920,1,0 +Mk1879=Stimulus,S128,1166045,1,0 +Mk1880=Stimulus,S 42,1167269,1,0 +Mk1881=Stimulus,S128,1167656,1,0 +Mk1882=Stimulus,S139,1167658,1,0 +Mk1883=Stimulus,S128,1167661,1,0 +Mk1884=Stimulus,S128,1167779,1,0 +Mk1885=Stimulus,S 41,1168948,1,0 +Mk1886=Stimulus,S 11,1169393,1,0 +Mk1887=Stimulus,S128,1169532,1,0 +Mk1888=Stimulus,S128,1178033,1,0 +Mk1889=Stimulus,S128,1180935,1,0 +Mk1890=Stimulus,S128,1181070,1,0 +Mk1891=Stimulus,S128,1181783,1,0 +Mk1892=Stimulus,S128,1181927,1,0 +Mk1893=Stimulus,S 44,1184818,1,0 +Mk1894=Stimulus,S128,1185365,1,0 +Mk1895=Stimulus,S139,1185369,1,0 +Mk1896=Stimulus,S128,1185371,1,0 +Mk1897=Stimulus,S 44,1186435,1,0 +Mk1898=Stimulus,S128,1187001,1,0 +Mk1899=Stimulus,S139,1187002,1,0 +Mk1900=Stimulus,S128,1187005,1,0 +Mk1901=Stimulus,S 43,1188037,1,0 +Mk1902=Stimulus,S128,1188635,1,0 +Mk1903=Stimulus,S139,1188640,1,0 +Mk1904=Stimulus,S128,1188642,1,0 +Mk1905=Stimulus,S128,1188800,1,0 +Mk1906=Stimulus,S 43,1189754,1,0 +Mk1907=Stimulus,S128,1190255,1,0 +Mk1908=Stimulus,S139,1190257,1,0 +Mk1909=Stimulus,S128,1190260,1,0 +Mk1910=Stimulus,S128,1190412,1,0 +Mk1911=Stimulus,S 42,1191658,1,0 +Mk1912=Stimulus,S128,1192003,1,0 +Mk1913=Stimulus,S139,1192009,1,0 +Mk1914=Stimulus,S128,1192012,1,0 +Mk1915=Stimulus,S 44,1193245,1,0 +Mk1916=Stimulus,S128,1193698,1,0 +Mk1917=Stimulus,S139,1193701,1,0 +Mk1918=Stimulus,S128,1193704,1,0 +Mk1919=Stimulus,S 41,1194958,1,0 +Mk1920=Stimulus,S128,1195344,1,0 +Mk1921=Stimulus,S139,1195349,1,0 +Mk1922=Stimulus,S128,1195352,1,0 +Mk1923=Stimulus,S 41,1196585,1,0 +Mk1924=Stimulus,S128,1196950,1,0 +Mk1925=Stimulus,S139,1196958,1,0 +Mk1926=Stimulus,S128,1196961,1,0 +Mk1927=Stimulus,S 42,1198497,1,0 +Mk1928=Stimulus,S128,1198869,1,0 +Mk1929=Stimulus,S139,1198872,1,0 +Mk1930=Stimulus,S128,1198874,1,0 +Mk1931=Stimulus,S 43,1200242,1,0 +Mk1932=Stimulus,S128,1200726,1,0 +Mk1933=Stimulus,S139,1200729,1,0 +Mk1934=Stimulus,S128,1200732,1,0 +Mk1935=Stimulus,S 44,1201997,1,0 +Mk1936=Stimulus,S128,1202432,1,0 +Mk1937=Stimulus,S139,1202437,1,0 +Mk1938=Stimulus,S128,1202440,1,0 +Mk1939=Stimulus,S 42,1203581,1,0 +Mk1940=Stimulus,S128,1203951,1,0 +Mk1941=Stimulus,S139,1203953,1,0 +Mk1942=Stimulus,S128,1203955,1,0 +Mk1943=Stimulus,S128,1204104,1,0 +Mk1944=Stimulus,S 44,1205121,1,0 +Mk1945=Stimulus,S128,1205601,1,0 +Mk1946=Stimulus,S139,1205603,1,0 +Mk1947=Stimulus,S128,1205605,1,0 +Mk1948=Stimulus,S 41,1206894,1,0 +Mk1949=Stimulus,S128,1207334,1,0 +Mk1950=Stimulus,S139,1207341,1,0 +Mk1951=Stimulus,S128,1207344,1,0 +Mk1952=Stimulus,S128,1207473,1,0 +Mk1953=Stimulus,S 42,1208455,1,0 +Mk1954=Stimulus,S128,1208801,1,0 +Mk1955=Stimulus,S139,1208807,1,0 +Mk1956=Stimulus,S128,1208810,1,0 +Mk1957=Stimulus,S 43,1210437,1,0 +Mk1958=Stimulus,S 12,1210870,1,0 +Mk1959=Stimulus,S128,1210988,1,0 +Mk1960=Stimulus,S149,1210991,1,0 +Mk1961=Stimulus,S128,1210994,1,0 +Mk1962=Stimulus,S 41,1212342,1,0 +Mk1963=Stimulus,S128,1212725,1,0 +Mk1964=Stimulus,S139,1212727,1,0 +Mk1965=Stimulus,S128,1212729,1,0 +Mk1966=Stimulus,S128,1212872,1,0 +Mk1967=Stimulus,S 42,1214177,1,0 +Mk1968=Stimulus,S139,1214549,1,0 +Mk1969=Stimulus,S128,1214551,1,0 +Mk1970=Stimulus,S 43,1215885,1,0 +Mk1971=Stimulus,S128,1216324,1,0 +Mk1972=Stimulus,S139,1216327,1,0 +Mk1973=Stimulus,S128,1216329,1,0 +Mk1974=Stimulus,S 44,1217540,1,0 +Mk1975=Stimulus,S 11,1217978,1,0 +Mk1976=Stimulus,S128,1217981,1,0 +Mk1977=Stimulus,S 43,1219337,1,0 +Mk1978=Stimulus,S128,1219778,1,0 +Mk1979=Stimulus,S139,1219782,1,0 +Mk1980=Stimulus,S128,1219785,1,0 +Mk1981=Stimulus,S 41,1221238,1,0 +Mk1982=Stimulus,S128,1221670,1,0 +Mk1983=Stimulus,S139,1221674,1,0 +Mk1984=Stimulus,S128,1221676,1,0 +Mk1985=Stimulus,S 41,1222800,1,0 +Mk1986=Stimulus,S128,1223223,1,0 +Mk1987=Stimulus,S139,1223224,1,0 +Mk1988=Stimulus,S128,1223227,1,0 +Mk1989=Stimulus,S128,1223384,1,0 +Mk1990=Stimulus,S 42,1224641,1,0 +Mk1991=Stimulus,S128,1224986,1,0 +Mk1992=Stimulus,S139,1224989,1,0 +Mk1993=Stimulus,S128,1224992,1,0 +Mk1994=Stimulus,S 43,1226310,1,0 +Mk1995=Stimulus,S128,1226887,1,0 +Mk1996=Stimulus,S139,1226894,1,0 +Mk1997=Stimulus,S128,1226897,1,0 +Mk1998=Stimulus,S128,1227050,1,0 +Mk1999=Stimulus,S 42,1228125,1,0 +Mk2000=Stimulus,S139,1228583,1,0 +Mk2001=Stimulus,S128,1228586,1,0 +Mk2002=Stimulus,S 44,1230067,1,0 +Mk2003=Stimulus,S 11,1230592,1,0 +Mk2004=Stimulus,S128,1230595,1,0 +Mk2005=Stimulus,S 43,1231752,1,0 +Mk2006=Stimulus,S128,1232221,1,0 +Mk2007=Stimulus,S139,1232224,1,0 +Mk2008=Stimulus,S128,1232227,1,0 +Mk2009=Stimulus,S 44,1233399,1,0 +Mk2010=Stimulus,S 11,1233837,1,0 +Mk2011=Stimulus,S128,1233839,1,0 +Mk2012=Stimulus,S 42,1235249,1,0 +Mk2013=Stimulus,S 11,1235645,1,0 +Mk2014=Stimulus,S139,1235646,1,0 +Mk2015=Stimulus,S128,1235647,1,0 +Mk2016=Stimulus,S 41,1236888,1,0 +Mk2017=Stimulus,S128,1237294,1,0 +Mk2018=Stimulus,S139,1237302,1,0 +Mk2019=Stimulus,S128,1237305,1,0 +Mk2020=Stimulus,S128,1237461,1,0 +Mk2021=Stimulus,S 41,1238725,1,0 +Mk2022=Stimulus,S128,1239151,1,0 +Mk2023=Stimulus,S139,1239155,1,0 +Mk2024=Stimulus,S128,1239158,1,0 +Mk2025=Stimulus,S 43,1240494,1,0 +Mk2026=Stimulus,S128,1241027,1,0 +Mk2027=Stimulus,S139,1241030,1,0 +Mk2028=Stimulus,S128,1241032,1,0 +Mk2029=Stimulus,S 41,1242024,1,0 +Mk2030=Stimulus,S128,1242416,1,0 +Mk2031=Stimulus,S139,1242420,1,0 +Mk2032=Stimulus,S128,1242423,1,0 +Mk2033=Stimulus,S 41,1243723,1,0 +Mk2034=Stimulus,S128,1244105,1,0 +Mk2035=Stimulus,S139,1244107,1,0 +Mk2036=Stimulus,S128,1244110,1,0 +Mk2037=Stimulus,S128,1244245,1,0 +Mk2038=Stimulus,S 44,1245664,1,0 +Mk2039=Stimulus,S 11,1246176,1,0 +Mk2040=Stimulus,S139,1246177,1,0 +Mk2041=Stimulus,S128,1246179,1,0 +Mk2042=Stimulus,S 42,1247315,1,0 +Mk2043=Stimulus,S128,1247710,1,0 +Mk2044=Stimulus,S139,1247712,1,0 +Mk2045=Stimulus,S128,1247714,1,0 +Mk2046=Stimulus,S128,1247866,1,0 +Mk2047=Stimulus,S 43,1249142,1,0 +Mk2048=Stimulus,S128,1249612,1,0 +Mk2049=Stimulus,S139,1249615,1,0 +Mk2050=Stimulus,S128,1249617,1,0 +Mk2051=Stimulus,S 42,1251044,1,0 +Mk2052=Stimulus,S128,1251477,1,0 +Mk2053=Stimulus,S139,1251481,1,0 +Mk2054=Stimulus,S128,1251484,1,0 +Mk2055=Stimulus,S128,1251636,1,0 +Mk2056=Stimulus,S 44,1252699,1,0 +Mk2057=Stimulus,S 12,1253138,1,0 +Mk2058=Stimulus,S128,1264091,1,0 +Mk2059=Stimulus,S128,1266465,1,0 +Mk2060=Stimulus,S128,1267373,1,0 +Mk2061=Stimulus,S128,1267543,1,0 +Mk2062=Stimulus,S128,1268354,1,0 +Mk2063=Stimulus,S 44,1271396,1,0 +Mk2064=Stimulus,S128,1271868,1,0 +Mk2065=Stimulus,S139,1271870,1,0 +Mk2066=Stimulus,S128,1271873,1,0 +Mk2067=Stimulus,S128,1272046,1,0 +Mk2068=Stimulus,S 42,1273394,1,0 +Mk2069=Stimulus,S128,1273830,1,0 +Mk2070=Stimulus,S139,1273839,1,0 +Mk2071=Stimulus,S128,1273841,1,0 +Mk2072=Stimulus,S128,1274006,1,0 +Mk2073=Stimulus,S 44,1275361,1,0 +Mk2074=Stimulus,S128,1275832,1,0 +Mk2075=Stimulus,S139,1275837,1,0 +Mk2076=Stimulus,S128,1275840,1,0 +Mk2077=Stimulus,S 44,1277127,1,0 +Mk2078=Stimulus,S128,1277609,1,0 +Mk2079=Stimulus,S139,1277613,1,0 +Mk2080=Stimulus,S128,1277615,1,0 +Mk2081=Stimulus,S 44,1279056,1,0 +Mk2082=Stimulus,S128,1279481,1,0 +Mk2083=Stimulus,S139,1279483,1,0 +Mk2084=Stimulus,S128,1279485,1,0 +Mk2085=Stimulus,S128,1279650,1,0 +Mk2086=Stimulus,S 42,1281071,1,0 +Mk2087=Stimulus,S128,1281470,1,0 +Mk2088=Stimulus,S139,1281474,1,0 +Mk2089=Stimulus,S128,1281477,1,0 +Mk2090=Stimulus,S 43,1282941,1,0 +Mk2091=Stimulus,S128,1283497,1,0 +Mk2092=Stimulus,S139,1283502,1,0 +Mk2093=Stimulus,S128,1283504,1,0 +Mk2094=Stimulus,S128,1283690,1,0 +Mk2095=Stimulus,S 41,1284641,1,0 +Mk2096=Stimulus,S128,1285048,1,0 +Mk2097=Stimulus,S139,1285050,1,0 +Mk2098=Stimulus,S128,1285053,1,0 +Mk2099=Stimulus,S128,1285231,1,0 +Mk2100=Stimulus,S 44,1286238,1,0 +Mk2101=Stimulus,S 11,1286844,1,0 +Mk2102=Stimulus,S139,1286845,1,0 +Mk2103=Stimulus,S128,1286846,1,0 +Mk2104=Stimulus,S 42,1288028,1,0 +Mk2105=Stimulus,S128,1288441,1,0 +Mk2106=Stimulus,S139,1288449,1,0 +Mk2107=Stimulus,S128,1288452,1,0 +Mk2108=Stimulus,S 42,1289782,1,0 +Mk2109=Stimulus,S128,1290185,1,0 +Mk2110=Stimulus,S139,1290188,1,0 +Mk2111=Stimulus,S128,1290190,1,0 +Mk2112=Stimulus,S 43,1291662,1,0 +Mk2113=Stimulus,S128,1292115,1,0 +Mk2114=Stimulus,S139,1292119,1,0 +Mk2115=Stimulus,S128,1292122,1,0 +Mk2116=Stimulus,S128,1292277,1,0 +Mk2117=Stimulus,S 44,1293348,1,0 +Mk2118=Stimulus,S128,1293843,1,0 +Mk2119=Stimulus,S139,1293848,1,0 +Mk2120=Stimulus,S128,1293851,1,0 +Mk2121=Stimulus,S 41,1295309,1,0 +Mk2122=Stimulus,S128,1295726,1,0 +Mk2123=Stimulus,S139,1295727,1,0 +Mk2124=Stimulus,S128,1295730,1,0 +Mk2125=Stimulus,S 43,1297011,1,0 +Mk2126=Stimulus,S128,1297547,1,0 +Mk2127=Stimulus,S139,1297548,1,0 +Mk2128=Stimulus,S128,1297551,1,0 +Mk2129=Stimulus,S128,1297713,1,0 +Mk2130=Stimulus,S 41,1298875,1,0 +Mk2131=Stimulus,S128,1299297,1,0 +Mk2132=Stimulus,S139,1299299,1,0 +Mk2133=Stimulus,S128,1299302,1,0 +Mk2134=Stimulus,S 42,1300417,1,0 +Mk2135=Stimulus,S 11,1300923,1,0 +Mk2136=Stimulus,S139,1300924,1,0 +Mk2137=Stimulus,S128,1300926,1,0 +Mk2138=Stimulus,S 41,1302383,1,0 +Mk2139=Stimulus,S128,1302788,1,0 +Mk2140=Stimulus,S139,1302792,1,0 +Mk2141=Stimulus,S128,1302795,1,0 +Mk2142=Stimulus,S 42,1304416,1,0 +Mk2143=Stimulus,S128,1304807,1,0 +Mk2144=Stimulus,S139,1304810,1,0 +Mk2145=Stimulus,S128,1304813,1,0 +Mk2146=Stimulus,S128,1304964,1,0 +Mk2147=Stimulus,S 44,1306338,1,0 +Mk2148=Stimulus,S128,1306833,1,0 +Mk2149=Stimulus,S139,1306838,1,0 +Mk2150=Stimulus,S128,1306840,1,0 +Mk2151=Stimulus,S 41,1308092,1,0 +Mk2152=Stimulus,S128,1308584,1,0 +Mk2153=Stimulus,S139,1308587,1,0 +Mk2154=Stimulus,S128,1308589,1,0 +Mk2155=Stimulus,S128,1308750,1,0 +Mk2156=Stimulus,S 41,1309774,1,0 +Mk2157=Stimulus,S128,1310206,1,0 +Mk2158=Stimulus,S140,1310212,1,0 +Mk2159=Stimulus,S128,1310214,1,0 +Mk2160=Stimulus,S 43,1311443,1,0 +Mk2161=Stimulus,S128,1311966,1,0 +Mk2162=Stimulus,S139,1311967,1,0 +Mk2163=Stimulus,S128,1311969,1,0 +Mk2164=Stimulus,S128,1312127,1,0 +Mk2165=Stimulus,S 44,1313154,1,0 +Mk2166=Stimulus,S 11,1313660,1,0 +Mk2167=Stimulus,S128,1313666,1,0 +Mk2168=Stimulus,S 43,1314865,1,0 +Mk2169=Stimulus,S128,1315290,1,0 +Mk2170=Stimulus,S139,1315293,1,0 +Mk2171=Stimulus,S128,1315296,1,0 +Mk2172=Stimulus,S 44,1316711,1,0 +Mk2173=Stimulus,S128,1317251,1,0 +Mk2174=Stimulus,S139,1317254,1,0 +Mk2175=Stimulus,S128,1317256,1,0 +Mk2176=Stimulus,S 41,1318283,1,0 +Mk2177=Stimulus,S128,1318781,1,0 +Mk2178=Stimulus,S139,1318786,1,0 +Mk2179=Stimulus,S128,1318789,1,0 +Mk2180=Stimulus,S128,1318940,1,0 +Mk2181=Stimulus,S 42,1320204,1,0 +Mk2182=Stimulus,S 11,1320631,1,0 +Mk2183=Stimulus,S128,1320634,1,0 +Mk2184=Stimulus,S 42,1322111,1,0 +Mk2185=Stimulus,S128,1322525,1,0 +Mk2186=Stimulus,S139,1322526,1,0 +Mk2187=Stimulus,S128,1322529,1,0 +Mk2188=Stimulus,S128,1322695,1,0 +Mk2189=Stimulus,S 41,1323720,1,0 +Mk2190=Stimulus,S128,1324292,1,0 +Mk2191=Stimulus,S139,1324296,1,0 +Mk2192=Stimulus,S128,1324299,1,0 +Mk2193=Stimulus,S128,1324454,1,0 +Mk2194=Stimulus,S 43,1325356,1,0 +Mk2195=Stimulus,S128,1325817,1,0 +Mk2196=Stimulus,S139,1325823,1,0 +Mk2197=Stimulus,S128,1325826,1,0 +Mk2198=Stimulus,S128,1325970,1,0 +Mk2199=Stimulus,S 42,1326890,1,0 +Mk2200=Stimulus,S128,1327431,1,0 +Mk2201=Stimulus,S139,1327432,1,0 +Mk2202=Stimulus,S128,1327434,1,0 +Mk2203=Stimulus,S 41,1328838,1,0 +Mk2204=Stimulus,S128,1329298,1,0 +Mk2205=Stimulus,S139,1329300,1,0 +Mk2206=Stimulus,S128,1329303,1,0 +Mk2207=Stimulus,S128,1329463,1,0 +Mk2208=Stimulus,S 44,1330749,1,0 +Mk2209=Stimulus,S 11,1331189,1,0 +Mk2210=Stimulus,S139,1331191,1,0 +Mk2211=Stimulus,S128,1331192,1,0 +Mk2212=Stimulus,S 43,1332686,1,0 +Mk2213=Stimulus,S128,1333133,1,0 +Mk2214=Stimulus,S139,1333135,1,0 +Mk2215=Stimulus,S128,1333137,1,0 +Mk2216=Stimulus,S128,1333288,1,0 +Mk2217=Stimulus,S 43,1334511,1,0 +Mk2218=Stimulus,S128,1335027,1,0 +Mk2219=Stimulus,S139,1335030,1,0 +Mk2220=Stimulus,S128,1335032,1,0 +Mk2221=Stimulus,S128,1335154,1,0 +Mk2222=Stimulus,S 41,1336138,1,0 +Mk2223=Stimulus,S128,1336619,1,0 +Mk2224=Stimulus,S139,1336620,1,0 +Mk2225=Stimulus,S128,1336622,1,0 +Mk2226=Stimulus,S128,1336784,1,0 +Mk2227=Stimulus,S 42,1337844,1,0 +Mk2228=Stimulus,S 11,1338208,1,0 +Mk2229=Stimulus,S 43,1339633,1,0 +Mk2230=Stimulus,S128,1340164,1,0 +Mk2231=Stimulus,S139,1340169,1,0 +Mk2232=Stimulus,S128,1340172,1,0 +Mk2233=Stimulus,S128,1340331,1,0 +Mk2234=Stimulus,S 43,1341575,1,0 +Mk2235=Stimulus,S128,1342081,1,0 +Mk2236=Stimulus,S139,1342087,1,0 +Mk2237=Stimulus,S128,1342090,1,0 +Mk2238=Stimulus,S128,1342247,1,0 +Mk2239=Stimulus,S128,1354369,1,0 +Mk2240=Stimulus,S128,1355723,1,0 +Mk2241=Stimulus,S128,1355911,1,0 +Mk2242=Stimulus,S 41,1358762,1,0 +Mk2243=Stimulus,S128,1359214,1,0 +Mk2244=Stimulus,S139,1359220,1,0 +Mk2245=Stimulus,S128,1359223,1,0 +Mk2246=Stimulus,S128,1359360,1,0 +Mk2247=Stimulus,S 44,1360293,1,0 +Mk2248=Stimulus,S128,1360899,1,0 +Mk2249=Stimulus,S139,1360902,1,0 +Mk2250=Stimulus,S128,1360904,1,0 +Mk2251=Stimulus,S128,1361075,1,0 +Mk2252=Stimulus,S 44,1362222,1,0 +Mk2253=Stimulus,S128,1362762,1,0 +Mk2254=Stimulus,S139,1362764,1,0 +Mk2255=Stimulus,S128,1362767,1,0 +Mk2256=Stimulus,S128,1362906,1,0 +Mk2257=Stimulus,S 44,1363951,1,0 +Mk2258=Stimulus,S128,1364410,1,0 +Mk2259=Stimulus,S139,1364412,1,0 +Mk2260=Stimulus,S128,1364415,1,0 +Mk2261=Stimulus,S128,1364546,1,0 +Mk2262=Stimulus,S 42,1365708,1,0 +Mk2263=Stimulus,S128,1366176,1,0 +Mk2264=Stimulus,S139,1366182,1,0 +Mk2265=Stimulus,S128,1366185,1,0 +Mk2266=Stimulus,S128,1366327,1,0 +Mk2267=Stimulus,S 43,1367482,1,0 +Mk2268=Stimulus,S128,1368024,1,0 +Mk2269=Stimulus,S139,1368030,1,0 +Mk2270=Stimulus,S128,1368033,1,0 +Mk2271=Stimulus,S 42,1369318,1,0 +Mk2272=Stimulus,S128,1369720,1,0 +Mk2273=Stimulus,S139,1369726,1,0 +Mk2274=Stimulus,S128,1369729,1,0 +Mk2275=Stimulus,S128,1369873,1,0 +Mk2276=Stimulus,S 42,1370925,1,0 +Mk2277=Stimulus,S128,1371333,1,0 +Mk2278=Stimulus,S139,1371338,1,0 +Mk2279=Stimulus,S128,1371340,1,0 +Mk2280=Stimulus,S128,1371486,1,0 +Mk2281=Stimulus,S 43,1372749,1,0 +Mk2282=Stimulus,S128,1373214,1,0 +Mk2283=Stimulus,S139,1373218,1,0 +Mk2284=Stimulus,S128,1373221,1,0 +Mk2285=Stimulus,S128,1373400,1,0 +Mk2286=Stimulus,S 43,1374751,1,0 +Mk2287=Stimulus,S128,1375327,1,0 +Mk2288=Stimulus,S139,1375330,1,0 +Mk2289=Stimulus,S128,1375333,1,0 +Mk2290=Stimulus,S128,1375505,1,0 +Mk2291=Stimulus,S 41,1376663,1,0 +Mk2292=Stimulus,S128,1377079,1,0 +Mk2293=Stimulus,S139,1377087,1,0 +Mk2294=Stimulus,S128,1377090,1,0 +Mk2295=Stimulus,S128,1377254,1,0 +Mk2296=Stimulus,S 42,1378365,1,0 +Mk2297=Stimulus,S128,1378749,1,0 +Mk2298=Stimulus,S139,1378750,1,0 +Mk2299=Stimulus,S128,1378753,1,0 +Mk2300=Stimulus,S128,1378928,1,0 +Mk2301=Stimulus,S 44,1380126,1,0 +Mk2302=Stimulus,S128,1380569,1,0 +Mk2303=Stimulus,S139,1380570,1,0 +Mk2304=Stimulus,S128,1380573,1,0 +Mk2305=Stimulus,S128,1380736,1,0 +Mk2306=Stimulus,S 41,1381683,1,0 +Mk2307=Stimulus,S128,1382235,1,0 +Mk2308=Stimulus,S139,1382243,1,0 +Mk2309=Stimulus,S128,1382246,1,0 +Mk2310=Stimulus,S128,1382406,1,0 +Mk2311=Stimulus,S 44,1383389,1,0 +Mk2312=Stimulus,S128,1383876,1,0 +Mk2313=Stimulus,S139,1383880,1,0 +Mk2314=Stimulus,S128,1383882,1,0 +Mk2315=Stimulus,S128,1384034,1,0 +Mk2316=Stimulus,S 43,1385062,1,0 +Mk2317=Stimulus,S128,1385630,1,0 +Mk2318=Stimulus,S139,1385634,1,0 +Mk2319=Stimulus,S128,1385637,1,0 +Mk2320=Stimulus,S128,1385780,1,0 +Mk2321=Stimulus,S 41,1386979,1,0 +Mk2322=Stimulus,S128,1387498,1,0 +Mk2323=Stimulus,S139,1387503,1,0 +Mk2324=Stimulus,S128,1387506,1,0 +Mk2325=Stimulus,S128,1387645,1,0 +Mk2326=Stimulus,S 44,1388532,1,0 +Mk2327=Stimulus,S128,1389115,1,0 +Mk2328=Stimulus,S139,1389117,1,0 +Mk2329=Stimulus,S128,1389120,1,0 +Mk2330=Stimulus,S128,1389265,1,0 +Mk2331=Stimulus,S 44,1390397,1,0 +Mk2332=Stimulus,S128,1390862,1,0 +Mk2333=Stimulus,S139,1390863,1,0 +Mk2334=Stimulus,S128,1390866,1,0 +Mk2335=Stimulus,S128,1390991,1,0 +Mk2336=Stimulus,S 41,1392123,1,0 +Mk2337=Stimulus,S128,1392587,1,0 +Mk2338=Stimulus,S139,1392593,1,0 +Mk2339=Stimulus,S128,1392595,1,0 +Mk2340=Stimulus,S128,1392721,1,0 +Mk2341=Stimulus,S 43,1394072,1,0 +Mk2342=Stimulus,S128,1394547,1,0 +Mk2343=Stimulus,S139,1394550,1,0 +Mk2344=Stimulus,S128,1394553,1,0 +Mk2345=Stimulus,S128,1394688,1,0 +Mk2346=Stimulus,S 43,1395695,1,0 +Mk2347=Stimulus,S128,1396254,1,0 +Mk2348=Stimulus,S139,1396255,1,0 +Mk2349=Stimulus,S128,1396257,1,0 +Mk2350=Stimulus,S128,1396393,1,0 +Mk2351=Stimulus,S 42,1397600,1,0 +Mk2352=Stimulus,S128,1397961,1,0 +Mk2353=Stimulus,S140,1397967,1,0 +Mk2354=Stimulus,S128,1397970,1,0 +Mk2355=Stimulus,S128,1398123,1,0 +Mk2356=Stimulus,S 42,1399628,1,0 +Mk2357=Stimulus,S128,1400022,1,0 +Mk2358=Stimulus,S139,1400025,1,0 +Mk2359=Stimulus,S128,1400028,1,0 +Mk2360=Stimulus,S128,1400171,1,0 +Mk2361=Stimulus,S 42,1401521,1,0 +Mk2362=Stimulus,S128,1401971,1,0 +Mk2363=Stimulus,S139,1401973,1,0 +Mk2364=Stimulus,S128,1401975,1,0 +Mk2365=Stimulus,S128,1402102,1,0 +Mk2366=Stimulus,S 41,1403343,1,0 +Mk2367=Stimulus,S128,1404016,1,0 +Mk2368=Stimulus,S139,1404019,1,0 +Mk2369=Stimulus,S128,1404022,1,0 +Mk2370=Stimulus,S128,1404184,1,0 +Mk2371=Stimulus,S 43,1405311,1,0 +Mk2372=Stimulus,S128,1405906,1,0 +Mk2373=Stimulus,S139,1405913,1,0 +Mk2374=Stimulus,S128,1405917,1,0 +Mk2375=Stimulus,S128,1406047,1,0 +Mk2376=Stimulus,S 41,1407222,1,0 +Mk2377=Stimulus,S128,1407715,1,0 +Mk2378=Stimulus,S139,1407719,1,0 +Mk2379=Stimulus,S128,1407722,1,0 +Mk2380=Stimulus,S128,1407872,1,0 +Mk2381=Stimulus,S 41,1409197,1,0 +Mk2382=Stimulus,S128,1409943,1,0 +Mk2383=Stimulus,S139,1409949,1,0 +Mk2384=Stimulus,S128,1409953,1,0 +Mk2385=Stimulus,S128,1410094,1,0 +Mk2386=Stimulus,S 44,1411197,1,0 +Mk2387=Stimulus,S128,1411835,1,0 +Mk2388=Stimulus,S139,1411840,1,0 +Mk2389=Stimulus,S128,1411842,1,0 +Mk2390=Stimulus,S128,1411968,1,0 +Mk2391=Stimulus,S 21,1412125,1,0 +Mk2392=Stimulus,S 43,1412841,1,0 +Mk2393=Stimulus,S128,1413515,1,0 +Mk2394=Stimulus,S139,1413516,1,0 +Mk2395=Stimulus,S128,1413519,1,0 +Mk2396=Stimulus,S 44,1414818,1,0 +Mk2397=Stimulus,S128,1415390,1,0 +Mk2398=Stimulus,S139,1415392,1,0 +Mk2399=Stimulus,S128,1415395,1,0 +Mk2400=Stimulus,S128,1415527,1,0 +Mk2401=Stimulus,S 42,1416580,1,0 +Mk2402=Stimulus,S128,1417111,1,0 +Mk2403=Stimulus,S139,1417117,1,0 +Mk2404=Stimulus,S128,1417119,1,0 +Mk2405=Stimulus,S128,1417241,1,0 +Mk2406=Stimulus,S 41,1418578,1,0 +Mk2407=Stimulus,S139,1419093,1,0 +Mk2408=Stimulus,S128,1419096,1,0 +Mk2409=Stimulus,S128,1419212,1,0 +Mk2410=Stimulus,S 43,1420307,1,0 +Mk2411=Stimulus,S128,1420804,1,0 +Mk2412=Stimulus,S139,1420807,1,0 +Mk2413=Stimulus,S128,1420809,1,0 +Mk2414=Stimulus,S128,1420912,1,0 +Mk2415=Stimulus,S 42,1422292,1,0 +Mk2416=Stimulus,S128,1422768,1,0 +Mk2417=Stimulus,S139,1422774,1,0 +Mk2418=Stimulus,S128,1422777,1,0 +Mk2419=Stimulus,S128,1422909,1,0 +Mk2420=Stimulus,S 44,1423979,1,0 +Mk2421=Stimulus,S128,1424577,1,0 +Mk2422=Stimulus,S139,1424582,1,0 +Mk2423=Stimulus,S128,1424585,1,0 +Mk2424=Stimulus,S 42,1425702,1,0 +Mk2425=Stimulus,S128,1426148,1,0 +Mk2426=Stimulus,S139,1426154,1,0 +Mk2427=Stimulus,S128,1426157,1,0 +Mk2428=Stimulus,S128,1426277,1,0 +Mk2429=Stimulus,S 41,1427477,1,0 +Mk2430=Stimulus,S128,1427945,1,0 +Mk2431=Stimulus,S139,1427946,1,0 +Mk2432=Stimulus,S128,1427950,1,0 +Mk2433=Stimulus,S128,1428067,1,0 +Mk2434=Stimulus,S 43,1429054,1,0 +Mk2435=Stimulus,S 11,1429566,1,0 +Mk2436=Stimulus,S128,1442070,1,0 +Mk2437=Stimulus,S128,1442220,1,0 +Mk2438=Stimulus,S128,1445320,1,0 +Mk2439=Stimulus,S128,1445481,1,0 +Mk2440=Stimulus,S 43,1448356,1,0 +Mk2441=Stimulus,S128,1449037,1,0 +Mk2442=Stimulus,S139,1449038,1,0 +Mk2443=Stimulus,S128,1449041,1,0 +Mk2444=Stimulus,S128,1449150,1,0 +Mk2445=Stimulus,S 44,1449905,1,0 +Mk2446=Stimulus,S128,1450485,1,0 +Mk2447=Stimulus,S139,1450488,1,0 +Mk2448=Stimulus,S128,1450490,1,0 +Mk2449=Stimulus,S128,1450634,1,0 +Mk2450=Stimulus,S 43,1451767,1,0 +Mk2451=Stimulus,S128,1452322,1,0 +Mk2452=Stimulus,S139,1452328,1,0 +Mk2453=Stimulus,S128,1452331,1,0 +Mk2454=Stimulus,S128,1452429,1,0 +Mk2455=Stimulus,S 43,1453376,1,0 +Mk2456=Stimulus,S128,1454052,1,0 +Mk2457=Stimulus,S139,1454056,1,0 +Mk2458=Stimulus,S128,1454059,1,0 +Mk2459=Stimulus,S128,1454169,1,0 +Mk2460=Stimulus,S 41,1455341,1,0 +Mk2461=Stimulus,S128,1455880,1,0 +Mk2462=Stimulus,S139,1455885,1,0 +Mk2463=Stimulus,S128,1455887,1,0 +Mk2464=Stimulus,S128,1456015,1,0 +Mk2465=Stimulus,S 41,1457333,1,0 +Mk2466=Stimulus,S128,1457823,1,0 +Mk2467=Stimulus,S139,1457827,1,0 +Mk2468=Stimulus,S128,1457830,1,0 +Mk2469=Stimulus,S128,1457945,1,0 +Mk2470=Stimulus,S 41,1459021,1,0 +Mk2471=Stimulus,S128,1459528,1,0 +Mk2472=Stimulus,S139,1459533,1,0 +Mk2473=Stimulus,S128,1459536,1,0 +Mk2474=Stimulus,S128,1459644,1,0 +Mk2475=Stimulus,S 42,1460764,1,0 +Mk2476=Stimulus,S128,1461284,1,0 +Mk2477=Stimulus,S139,1461285,1,0 +Mk2478=Stimulus,S128,1461288,1,0 +Mk2479=Stimulus,S 41,1462703,1,0 +Mk2480=Stimulus,S128,1463429,1,0 +Mk2481=Stimulus,S139,1463433,1,0 +Mk2482=Stimulus,S128,1463436,1,0 +Mk2483=Stimulus,S128,1463564,1,0 +Mk2484=Stimulus,S 42,1464252,1,0 +Mk2485=Stimulus,S128,1464712,1,0 +Mk2486=Stimulus,S139,1464715,1,0 +Mk2487=Stimulus,S128,1464718,1,0 +Mk2488=Stimulus,S 43,1466171,1,0 +Mk2489=Stimulus,S128,1466863,1,0 +Mk2490=Stimulus,S139,1466865,1,0 +Mk2491=Stimulus,S128,1466868,1,0 +Mk2492=Stimulus,S128,1467005,1,0 +Mk2493=Stimulus,S 44,1467842,1,0 +Mk2494=Stimulus,S139,1468335,1,0 +Mk2495=Stimulus,S128,1468337,1,0 +Mk2496=Stimulus,S128,1468468,1,0 +Mk2497=Stimulus,S 42,1469425,1,0 +Mk2498=Stimulus,S128,1469892,1,0 +Mk2499=Stimulus,S139,1469894,1,0 +Mk2500=Stimulus,S128,1469896,1,0 +Mk2501=Stimulus,S128,1470009,1,0 +Mk2502=Stimulus,S 43,1471135,1,0 +Mk2503=Stimulus,S128,1471679,1,0 +Mk2504=Stimulus,S139,1471684,1,0 +Mk2505=Stimulus,S128,1471687,1,0 +Mk2506=Stimulus,S 43,1473164,1,0 +Mk2507=Stimulus,S128,1473679,1,0 +Mk2508=Stimulus,S139,1473682,1,0 +Mk2509=Stimulus,S128,1473685,1,0 +Mk2510=Stimulus,S128,1473816,1,0 +Mk2511=Stimulus,S 41,1474833,1,0 +Mk2512=Stimulus,S128,1475553,1,0 +Mk2513=Stimulus,S139,1475555,1,0 +Mk2514=Stimulus,S128,1475558,1,0 +Mk2515=Stimulus,S128,1475684,1,0 +Mk2516=Stimulus,S 44,1476751,1,0 +Mk2517=Stimulus,S128,1477329,1,0 +Mk2518=Stimulus,S139,1477330,1,0 +Mk2519=Stimulus,S128,1477333,1,0 +Mk2520=Stimulus,S128,1477455,1,0 +Mk2521=Stimulus,S 41,1478682,1,0 +Mk2522=Stimulus,S128,1479411,1,0 +Mk2523=Stimulus,S139,1479413,1,0 +Mk2524=Stimulus,S128,1479416,1,0 +Mk2525=Stimulus,S128,1479544,1,0 +Mk2526=Stimulus,S 44,1480624,1,0 +Mk2527=Stimulus,S128,1481173,1,0 +Mk2528=Stimulus,S139,1481179,1,0 +Mk2529=Stimulus,S128,1481182,1,0 +Mk2530=Stimulus,S128,1481303,1,0 +Mk2531=Stimulus,S 42,1482494,1,0 +Mk2532=Stimulus,S139,1482957,1,0 +Mk2533=Stimulus,S128,1482960,1,0 +Mk2534=Stimulus,S 41,1484273,1,0 +Mk2535=Stimulus,S 11,1484843,1,0 +Mk2536=Stimulus,S139,1484844,1,0 +Mk2537=Stimulus,S128,1484846,1,0 +Mk2538=Stimulus,S128,1484985,1,0 +Mk2539=Stimulus,S 41,1486231,1,0 +Mk2540=Stimulus,S128,1486674,1,0 +Mk2541=Stimulus,S139,1486676,1,0 +Mk2542=Stimulus,S128,1486679,1,0 +Mk2543=Stimulus,S128,1486826,1,0 +Mk2544=Stimulus,S 43,1487985,1,0 +Mk2545=Stimulus,S128,1488499,1,0 +Mk2546=Stimulus,S139,1488500,1,0 +Mk2547=Stimulus,S128,1488503,1,0 +Mk2548=Stimulus,S128,1488640,1,0 +Mk2549=Stimulus,S 44,1489714,1,0 +Mk2550=Stimulus,S128,1490281,1,0 +Mk2551=Stimulus,S139,1490287,1,0 +Mk2552=Stimulus,S128,1490289,1,0 +Mk2553=Stimulus,S 42,1491698,1,0 +Mk2554=Stimulus,S 11,1492135,1,0 +Mk2555=Stimulus,S139,1492136,1,0 +Mk2556=Stimulus,S128,1492138,1,0 +Mk2557=Stimulus,S 42,1493500,1,0 +Mk2558=Stimulus,S128,1493953,1,0 +Mk2559=Stimulus,S139,1493958,1,0 +Mk2560=Stimulus,S128,1493960,1,0 +Mk2561=Stimulus,S128,1494084,1,0 +Mk2562=Stimulus,S 43,1495187,1,0 +Mk2563=Stimulus,S128,1495636,1,0 +Mk2564=Stimulus,S140,1495639,1,0 +Mk2565=Stimulus,S128,1495642,1,0 +Mk2566=Stimulus,S 43,1496900,1,0 +Mk2567=Stimulus,S128,1497356,1,0 +Mk2568=Stimulus,S139,1497363,1,0 +Mk2569=Stimulus,S128,1497366,1,0 +Mk2570=Stimulus,S128,1497524,1,0 +Mk2571=Stimulus,S 41,1498678,1,0 +Mk2572=Stimulus,S128,1499220,1,0 +Mk2573=Stimulus,S139,1499225,1,0 +Mk2574=Stimulus,S128,1499228,1,0 +Mk2575=Stimulus,S 44,1500230,1,0 +Mk2576=Stimulus,S139,1500717,1,0 +Mk2577=Stimulus,S128,1500720,1,0 +Mk2578=Stimulus,S128,1500855,1,0 +Mk2579=Stimulus,S 44,1501875,1,0 +Mk2580=Stimulus,S128,1502365,1,0 +Mk2581=Stimulus,S139,1502369,1,0 +Mk2582=Stimulus,S128,1502372,1,0 +Mk2583=Stimulus,S128,1502497,1,0 +Mk2584=Stimulus,S 42,1503423,1,0 +Mk2585=Stimulus,S128,1504060,1,0 +Mk2586=Stimulus,S139,1504061,1,0 +Mk2587=Stimulus,S128,1504064,1,0 +Mk2588=Stimulus,S 42,1504993,1,0 +Mk2589=Stimulus,S128,1505406,1,0 +Mk2590=Stimulus,S139,1505408,1,0 +Mk2591=Stimulus,S128,1505410,1,0 +Mk2592=Stimulus,S 42,1506710,1,0 +Mk2593=Stimulus,S128,1507132,1,0 +Mk2594=Stimulus,S139,1507136,1,0 +Mk2595=Stimulus,S128,1507138,1,0 +Mk2596=Stimulus,S 44,1508409,1,0 +Mk2597=Stimulus,S 12,1508860,1,0 +Mk2598=Stimulus,S140,1508862,1,0 +Mk2599=Stimulus,S128,1508863,1,0 +Mk2600=Stimulus,S128,1508986,1,0 +Mk2601=Stimulus,S 42,1510072,1,0 +Mk2602=Stimulus,S128,1510547,1,0 +Mk2603=Stimulus,S139,1510548,1,0 +Mk2604=Stimulus,S128,1510551,1,0 +Mk2605=Stimulus,S 44,1511949,1,0 +Mk2606=Stimulus,S128,1512453,1,0 +Mk2607=Stimulus,S139,1512457,1,0 +Mk2608=Stimulus,S128,1512461,1,0 +Mk2609=Stimulus,S128,1512575,1,0 +Mk2610=Stimulus,S 43,1513626,1,0 +Mk2611=Stimulus,S128,1514184,1,0 +Mk2612=Stimulus,S139,1514187,1,0 +Mk2613=Stimulus,S128,1514190,1,0 +Mk2614=Stimulus,S128,1514349,1,0 +Mk2615=Stimulus,S 44,1515291,1,0 +Mk2616=Stimulus,S128,1515786,1,0 +Mk2617=Stimulus,S139,1515791,1,0 +Mk2618=Stimulus,S128,1515794,1,0 +Mk2619=Stimulus,S 41,1517167,1,0 +Mk2620=Stimulus,S128,1517650,1,0 +Mk2621=Stimulus,S139,1517653,1,0 +Mk2622=Stimulus,S128,1517657,1,0 +Mk2623=Stimulus,S128,1517800,1,0 +Mk2624=Stimulus,S128,1531067,1,0 +Mk2625=Stimulus,S128,1531248,1,0 +Mk2626=Stimulus,S128,1532834,1,0 +Mk2627=Stimulus,S128,1533008,1,0 +Mk2628=Stimulus,S128,1534137,1,0 +Mk2629=Stimulus,S 43,1535867,1,0 +Mk2630=Stimulus,S128,1536573,1,0 +Mk2631=Stimulus,S139,1536577,1,0 +Mk2632=Stimulus,S128,1536580,1,0 +Mk2633=Stimulus,S 43,1537485,1,0 +Mk2634=Stimulus,S139,1538118,1,0 +Mk2635=Stimulus,S128,1538122,1,0 +Mk2636=Stimulus,S 41,1539124,1,0 +Mk2637=Stimulus,S128,1539633,1,0 +Mk2638=Stimulus,S139,1539636,1,0 +Mk2639=Stimulus,S128,1539638,1,0 +Mk2640=Stimulus,S128,1539747,1,0 +Mk2641=Stimulus,S 42,1540708,1,0 +Mk2642=Stimulus,S128,1541166,1,0 +Mk2643=Stimulus,S139,1541169,1,0 +Mk2644=Stimulus,S128,1541171,1,0 +Mk2645=Stimulus,S 42,1542398,1,0 +Mk2646=Stimulus,S128,1542840,1,0 +Mk2647=Stimulus,S139,1542843,1,0 +Mk2648=Stimulus,S128,1542846,1,0 +Mk2649=Stimulus,S128,1542989,1,0 +Mk2650=Stimulus,S 42,1544299,1,0 +Mk2651=Stimulus,S128,1544675,1,0 +Mk2652=Stimulus,S139,1544680,1,0 +Mk2653=Stimulus,S128,1544683,1,0 +Mk2654=Stimulus,S 41,1545864,1,0 +Mk2655=Stimulus,S128,1546318,1,0 +Mk2656=Stimulus,S139,1546320,1,0 +Mk2657=Stimulus,S128,1546322,1,0 +Mk2658=Stimulus,S128,1546460,1,0 +Mk2659=Stimulus,S 43,1547526,1,0 +Mk2660=Stimulus,S128,1548120,1,0 +Mk2661=Stimulus,S139,1548122,1,0 +Mk2662=Stimulus,S128,1548125,1,0 +Mk2663=Stimulus,S128,1548247,1,0 +Mk2664=Stimulus,S 41,1549365,1,0 +Mk2665=Stimulus,S128,1549752,1,0 +Mk2666=Stimulus,S139,1549756,1,0 +Mk2667=Stimulus,S128,1549758,1,0 +Mk2668=Stimulus,S128,1549903,1,0 +Mk2669=Stimulus,S 44,1551052,1,0 +Mk2670=Stimulus,S128,1551525,1,0 +Mk2671=Stimulus,S139,1551533,1,0 +Mk2672=Stimulus,S128,1551536,1,0 +Mk2673=Stimulus,S 42,1552963,1,0 +Mk2674=Stimulus,S128,1553388,1,0 +Mk2675=Stimulus,S139,1553392,1,0 +Mk2676=Stimulus,S128,1553395,1,0 +Mk2677=Stimulus,S128,1553514,1,0 +Mk2678=Stimulus,S 42,1554835,1,0 +Mk2679=Stimulus,S128,1555235,1,0 +Mk2680=Stimulus,S139,1555237,1,0 +Mk2681=Stimulus,S128,1555240,1,0 +Mk2682=Stimulus,S 42,1556795,1,0 +Mk2683=Stimulus,S128,1557176,1,0 +Mk2684=Stimulus,S139,1557179,1,0 +Mk2685=Stimulus,S128,1557182,1,0 +Mk2686=Stimulus,S128,1557305,1,0 +Mk2687=Stimulus,S 43,1558433,1,0 +Mk2688=Stimulus,S128,1558968,1,0 +Mk2689=Stimulus,S139,1558971,1,0 +Mk2690=Stimulus,S128,1558974,1,0 +Mk2691=Stimulus,S128,1559120,1,0 +Mk2692=Stimulus,S 44,1560166,1,0 +Mk2693=Stimulus,S128,1560657,1,0 +Mk2694=Stimulus,S139,1560665,1,0 +Mk2695=Stimulus,S128,1560667,1,0 +Mk2696=Stimulus,S128,1560791,1,0 +Mk2697=Stimulus,S 42,1561730,1,0 +Mk2698=Stimulus,S128,1562136,1,0 +Mk2699=Stimulus,S139,1562138,1,0 +Mk2700=Stimulus,S128,1562141,1,0 +Mk2701=Stimulus,S 43,1563320,1,0 +Mk2702=Stimulus,S128,1563807,1,0 +Mk2703=Stimulus,S139,1563813,1,0 +Mk2704=Stimulus,S128,1563816,1,0 +Mk2705=Stimulus,S128,1563950,1,0 +Mk2706=Stimulus,S 44,1565128,1,0 +Mk2707=Stimulus,S128,1565626,1,0 +Mk2708=Stimulus,S139,1565627,1,0 +Mk2709=Stimulus,S128,1565631,1,0 +Mk2710=Stimulus,S 44,1566828,1,0 +Mk2711=Stimulus,S128,1567274,1,0 +Mk2712=Stimulus,S139,1567279,1,0 +Mk2713=Stimulus,S128,1567282,1,0 +Mk2714=Stimulus,S 42,1568723,1,0 +Mk2715=Stimulus,S 11,1569083,1,0 +Mk2716=Stimulus,S139,1569084,1,0 +Mk2717=Stimulus,S128,1569086,1,0 +Mk2718=Stimulus,S 44,1570677,1,0 +Mk2719=Stimulus,S139,1571147,1,0 +Mk2720=Stimulus,S128,1571149,1,0 +Mk2721=Stimulus,S 41,1572680,1,0 +Mk2722=Stimulus,S128,1573152,1,0 +Mk2723=Stimulus,S139,1573155,1,0 +Mk2724=Stimulus,S128,1573158,1,0 +Mk2725=Stimulus,S 43,1574610,1,0 +Mk2726=Stimulus,S128,1575216,1,0 +Mk2727=Stimulus,S139,1575219,1,0 +Mk2728=Stimulus,S128,1575222,1,0 +Mk2729=Stimulus,S128,1575372,1,0 +Mk2730=Stimulus,S 44,1576517,1,0 +Mk2731=Stimulus,S128,1577032,1,0 +Mk2732=Stimulus,S139,1577035,1,0 +Mk2733=Stimulus,S128,1577038,1,0 +Mk2734=Stimulus,S128,1577202,1,0 +Mk2735=Stimulus,S 44,1578384,1,0 +Mk2736=Stimulus,S128,1578791,1,0 +Mk2737=Stimulus,S139,1578795,1,0 +Mk2738=Stimulus,S128,1578798,1,0 +Mk2739=Stimulus,S 41,1580055,1,0 +Mk2740=Stimulus,S128,1580519,1,0 +Mk2741=Stimulus,S139,1580522,1,0 +Mk2742=Stimulus,S128,1580524,1,0 +Mk2743=Stimulus,S128,1580672,1,0 +Mk2744=Stimulus,S 41,1581900,1,0 +Mk2745=Stimulus,S128,1582296,1,0 +Mk2746=Stimulus,S139,1582300,1,0 +Mk2747=Stimulus,S128,1582302,1,0 +Mk2748=Stimulus,S128,1582440,1,0 +Mk2749=Stimulus,S 43,1583839,1,0 +Mk2750=Stimulus,S128,1584397,1,0 +Mk2751=Stimulus,S139,1584402,1,0 +Mk2752=Stimulus,S128,1584405,1,0 +Mk2753=Stimulus,S128,1584546,1,0 +Mk2754=Stimulus,S 42,1585621,1,0 +Mk2755=Stimulus,S139,1586057,1,0 +Mk2756=Stimulus,S128,1586060,1,0 +Mk2757=Stimulus,S 44,1587457,1,0 +Mk2758=Stimulus,S128,1587948,1,0 +Mk2759=Stimulus,S139,1587951,1,0 +Mk2760=Stimulus,S128,1587953,1,0 +Mk2761=Stimulus,S 42,1589199,1,0 +Mk2762=Stimulus,S 11,1589586,1,0 +Mk2763=Stimulus,S139,1589588,1,0 +Mk2764=Stimulus,S128,1589589,1,0 +Mk2765=Stimulus,S 44,1591217,1,0 +Mk2766=Stimulus,S128,1591738,1,0 +Mk2767=Stimulus,S139,1591741,1,0 +Mk2768=Stimulus,S128,1591744,1,0 +Mk2769=Stimulus,S128,1591884,1,0 +Mk2770=Stimulus,S 43,1592794,1,0 +Mk2771=Stimulus,S128,1593428,1,0 +Mk2772=Stimulus,S139,1593434,1,0 +Mk2773=Stimulus,S128,1593437,1,0 +Mk2774=Stimulus,S128,1593578,1,0 +Mk2775=Stimulus,S 41,1594659,1,0 +Mk2776=Stimulus,S128,1595111,1,0 +Mk2777=Stimulus,S139,1595113,1,0 +Mk2778=Stimulus,S128,1595116,1,0 +Mk2779=Stimulus,S128,1595236,1,0 +Mk2780=Stimulus,S 43,1596416,1,0 +Mk2781=Stimulus,S128,1596928,1,0 +Mk2782=Stimulus,S139,1596933,1,0 +Mk2783=Stimulus,S128,1596936,1,0 +Mk2784=Stimulus,S128,1597066,1,0 +Mk2785=Stimulus,S 41,1598090,1,0 +Mk2786=Stimulus,S128,1598534,1,0 +Mk2787=Stimulus,S139,1598541,1,0 +Mk2788=Stimulus,S128,1598544,1,0 +Mk2789=Stimulus,S128,1598664,1,0 +Mk2790=Stimulus,S 41,1599760,1,0 +Mk2791=Stimulus,S128,1600130,1,0 +Mk2792=Stimulus,S139,1600137,1,0 +Mk2793=Stimulus,S128,1600140,1,0 +Mk2794=Stimulus,S128,1600245,1,0 +Mk2795=Stimulus,S 41,1601633,1,0 +Mk2796=Stimulus,S128,1602039,1,0 +Mk2797=Stimulus,S139,1602041,1,0 +Mk2798=Stimulus,S128,1602045,1,0 +Mk2799=Stimulus,S128,1602164,1,0 +Mk2800=Stimulus,S 44,1603501,1,0 +Mk2801=Stimulus,S 11,1603928,1,0 +Mk2802=Stimulus,S139,1603929,1,0 +Mk2803=Stimulus,S128,1603930,1,0 +Mk2804=Stimulus,S128,1604065,1,0 +Mk2805=Stimulus,S 43,1605334,1,0 +Mk2806=Stimulus,S128,1605774,1,0 +Mk2807=Stimulus,S139,1605779,1,0 +Mk2808=Stimulus,S128,1605782,1,0 +Mk2809=Stimulus,S128,1605893,1,0 +Mk2810=Stimulus,S128,1617440,1,0 +Mk2811=Stimulus,S128,1617574,1,0 +Mk2812=Stimulus,S128,1618844,1,0 +Mk2813=Stimulus,S 41,1621886,1,0 +Mk2814=Stimulus,S128,1622457,1,0 +Mk2815=Stimulus,S139,1622462,1,0 +Mk2816=Stimulus,S128,1622465,1,0 +Mk2817=Stimulus,S 43,1623844,1,0 +Mk2818=Stimulus,S128,1624596,1,0 +Mk2819=Stimulus,S139,1624600,1,0 +Mk2820=Stimulus,S128,1624602,1,0 +Mk2821=Stimulus,S128,1624740,1,0 +Mk2822=Stimulus,S 44,1625880,1,0 +Mk2823=Stimulus,S128,1626367,1,0 +Mk2824=Stimulus,S139,1626371,1,0 +Mk2825=Stimulus,S128,1626375,1,0 +Mk2826=Stimulus,S128,1626521,1,0 +Mk2827=Stimulus,S 42,1627621,1,0 +Mk2828=Stimulus,S128,1628093,1,0 +Mk2829=Stimulus,S139,1628097,1,0 +Mk2830=Stimulus,S128,1628100,1,0 +Mk2831=Stimulus,S 44,1629237,1,0 +Mk2832=Stimulus,S128,1629778,1,0 +Mk2833=Stimulus,S139,1629780,1,0 +Mk2834=Stimulus,S128,1629783,1,0 +Mk2835=Stimulus,S 42,1631040,1,0 +Mk2836=Stimulus,S 11,1631422,1,0 +Mk2837=Stimulus,S139,1631423,1,0 +Mk2838=Stimulus,S128,1631425,1,0 +Mk2839=Stimulus,S 41,1632622,1,0 +Mk2840=Stimulus,S128,1633153,1,0 +Mk2841=Stimulus,S139,1633159,1,0 +Mk2842=Stimulus,S128,1633162,1,0 +Mk2843=Stimulus,S128,1633294,1,0 +Mk2844=Stimulus,S 41,1634317,1,0 +Mk2845=Stimulus,S128,1634697,1,0 +Mk2846=Stimulus,S139,1634699,1,0 +Mk2847=Stimulus,S128,1634702,1,0 +Mk2848=Stimulus,S128,1634809,1,0 +Mk2849=Stimulus,S 44,1635890,1,0 +Mk2850=Stimulus,S128,1636302,1,0 +Mk2851=Stimulus,S139,1636304,1,0 +Mk2852=Stimulus,S128,1636307,1,0 +Mk2853=Stimulus,S128,1636433,1,0 +Mk2854=Stimulus,S 41,1637610,1,0 +Mk2855=Stimulus,S128,1638018,1,0 +Mk2856=Stimulus,S139,1638022,1,0 +Mk2857=Stimulus,S128,1638025,1,0 +Mk2858=Stimulus,S128,1638133,1,0 +Mk2859=Stimulus,S 42,1639446,1,0 +Mk2860=Stimulus,S128,1639784,1,0 +Mk2861=Stimulus,S139,1639788,1,0 +Mk2862=Stimulus,S128,1639791,1,0 +Mk2863=Stimulus,S 42,1641262,1,0 +Mk2864=Stimulus,S128,1641610,1,0 +Mk2865=Stimulus,S139,1641614,1,0 +Mk2866=Stimulus,S128,1641616,1,0 +Mk2867=Stimulus,S 43,1643213,1,0 +Mk2868=Stimulus,S128,1643666,1,0 +Mk2869=Stimulus,S139,1643670,1,0 +Mk2870=Stimulus,S128,1643673,1,0 +Mk2871=Stimulus,S128,1643800,1,0 +Mk2872=Stimulus,S 42,1645058,1,0 +Mk2873=Stimulus,S 12,1645473,1,0 +Mk2874=Stimulus,S 43,1646672,1,0 +Mk2875=Stimulus,S128,1647220,1,0 +Mk2876=Stimulus,S139,1647221,1,0 +Mk2877=Stimulus,S128,1647224,1,0 +Mk2878=Stimulus,S 43,1648373,1,0 +Mk2879=Stimulus,S128,1648870,1,0 +Mk2880=Stimulus,S139,1648873,1,0 +Mk2881=Stimulus,S128,1648876,1,0 +Mk2882=Stimulus,S128,1648988,1,0 +Mk2883=Stimulus,S 43,1650149,1,0 +Mk2884=Stimulus,S128,1650650,1,0 +Mk2885=Stimulus,S139,1650655,1,0 +Mk2886=Stimulus,S128,1650658,1,0 +Mk2887=Stimulus,S128,1650774,1,0 +Mk2888=Stimulus,S 42,1652140,1,0 +Mk2889=Stimulus,S128,1652534,1,0 +Mk2890=Stimulus,S139,1652537,1,0 +Mk2891=Stimulus,S128,1652540,1,0 +Mk2892=Stimulus,S 42,1654143,1,0 +Mk2893=Stimulus,S139,1654535,1,0 +Mk2894=Stimulus,S128,1654537,1,0 +Mk2895=Stimulus,S128,1654660,1,0 +Mk2896=Stimulus,S 41,1655814,1,0 +Mk2897=Stimulus,S128,1656279,1,0 +Mk2898=Stimulus,S139,1656286,1,0 +Mk2899=Stimulus,S128,1656290,1,0 +Mk2900=Stimulus,S 44,1657480,1,0 +Mk2901=Stimulus,S128,1657886,1,0 +Mk2902=Stimulus,S139,1657889,1,0 +Mk2903=Stimulus,S128,1657892,1,0 +Mk2904=Stimulus,S 44,1659016,1,0 +Mk2905=Stimulus,S128,1659485,1,0 +Mk2906=Stimulus,S139,1659489,1,0 +Mk2907=Stimulus,S128,1659492,1,0 +Mk2908=Stimulus,S128,1659637,1,0 +Mk2909=Stimulus,S 42,1660998,1,0 +Mk2910=Stimulus,S128,1661366,1,0 +Mk2911=Stimulus,S139,1661372,1,0 +Mk2912=Stimulus,S128,1661374,1,0 +Mk2913=Stimulus,S 41,1662902,1,0 +Mk2914=Stimulus,S128,1663299,1,0 +Mk2915=Stimulus,S140,1663303,1,0 +Mk2916=Stimulus,S128,1663306,1,0 +Mk2917=Stimulus,S 41,1664933,1,0 +Mk2918=Stimulus,S128,1665613,1,0 +Mk2919=Stimulus,S139,1665614,1,0 +Mk2920=Stimulus,S128,1665617,1,0 +Mk2921=Stimulus,S 42,1666896,1,0 +Mk2922=Stimulus,S128,1667332,1,0 +Mk2923=Stimulus,S139,1667333,1,0 +Mk2924=Stimulus,S128,1667335,1,0 +Mk2925=Stimulus,S 43,1668671,1,0 +Mk2926=Stimulus,S128,1669355,1,0 +Mk2927=Stimulus,S139,1669360,1,0 +Mk2928=Stimulus,S128,1669363,1,0 +Mk2929=Stimulus,S 41,1670559,1,0 +Mk2930=Stimulus,S139,1671062,1,0 +Mk2931=Stimulus,S128,1671064,1,0 +Mk2932=Stimulus,S128,1671208,1,0 +Mk2933=Stimulus,S 43,1672231,1,0 +Mk2934=Stimulus,S128,1672762,1,0 +Mk2935=Stimulus,S139,1672765,1,0 +Mk2936=Stimulus,S128,1672767,1,0 +Mk2937=Stimulus,S128,1672907,1,0 +Mk2938=Stimulus,S 41,1673904,1,0 +Mk2939=Stimulus,S128,1674338,1,0 +Mk2940=Stimulus,S139,1674342,1,0 +Mk2941=Stimulus,S128,1674344,1,0 +Mk2942=Stimulus,S128,1674473,1,0 +Mk2943=Stimulus,S 41,1675566,1,0 +Mk2944=Stimulus,S128,1675997,1,0 +Mk2945=Stimulus,S139,1676000,1,0 +Mk2946=Stimulus,S128,1676003,1,0 +Mk2947=Stimulus,S 44,1677545,1,0 +Mk2948=Stimulus,S128,1678158,1,0 +Mk2949=Stimulus,S139,1678160,1,0 +Mk2950=Stimulus,S128,1678163,1,0 +Mk2951=Stimulus,S 43,1679578,1,0 +Mk2952=Stimulus,S128,1680091,1,0 +Mk2953=Stimulus,S139,1680094,1,0 +Mk2954=Stimulus,S128,1680096,1,0 +Mk2955=Stimulus,S128,1680237,1,0 +Mk2956=Stimulus,S 44,1681409,1,0 +Mk2957=Stimulus,S128,1681915,1,0 +Mk2958=Stimulus,S139,1681916,1,0 +Mk2959=Stimulus,S128,1681918,1,0 +Mk2960=Stimulus,S 44,1683188,1,0 +Mk2961=Stimulus,S128,1683682,1,0 +Mk2962=Stimulus,S139,1683686,1,0 +Mk2963=Stimulus,S128,1683689,1,0 +Mk2964=Stimulus,S 44,1684765,1,0 +Mk2965=Stimulus,S128,1685263,1,0 +Mk2966=Stimulus,S139,1685265,1,0 +Mk2967=Stimulus,S128,1685268,1,0 +Mk2968=Stimulus,S 43,1686320,1,0 +Mk2969=Stimulus,S128,1686845,1,0 +Mk2970=Stimulus,S139,1686851,1,0 +Mk2971=Stimulus,S128,1686854,1,0 +Mk2972=Stimulus,S 44,1688045,1,0 +Mk2973=Stimulus,S128,1688506,1,0 +Mk2974=Stimulus,S139,1688509,1,0 +Mk2975=Stimulus,S128,1688512,1,0 +Mk2976=Stimulus,S 43,1689759,1,0 +Mk2977=Stimulus,S128,1690303,1,0 +Mk2978=Stimulus,S139,1690307,1,0 +Mk2979=Stimulus,S128,1690310,1,0 +Mk2980=Stimulus,S 42,1691490,1,0 +Mk2981=Stimulus,S128,1691901,1,0 +Mk2982=Stimulus,S139,1691902,1,0 +Mk2983=Stimulus,S128,1691905,1,0 +Mk2984=Stimulus,S128,1703834,1,0 +Mk2985=Stimulus,S128,1705469,1,0 +Mk2986=Stimulus,S 44,1708509,1,0 +Mk2987=Stimulus,S 11,1709060,1,0 +Mk2988=Stimulus,S139,1709061,1,0 +Mk2989=Stimulus,S128,1709064,1,0 +Mk2990=Stimulus,S128,1709211,1,0 +Mk2991=Stimulus,S 42,1710274,1,0 +Mk2992=Stimulus,S128,1710788,1,0 +Mk2993=Stimulus,S139,1710792,1,0 +Mk2994=Stimulus,S128,1710794,1,0 +Mk2995=Stimulus,S 44,1712076,1,0 +Mk2996=Stimulus,S128,1712565,1,0 +Mk2997=Stimulus,S139,1712568,1,0 +Mk2998=Stimulus,S128,1712571,1,0 +Mk2999=Stimulus,S128,1712709,1,0 +Mk3000=Stimulus,S 44,1713707,1,0 +Mk3001=Stimulus,S128,1714172,1,0 +Mk3002=Stimulus,S139,1714177,1,0 +Mk3003=Stimulus,S128,1714179,1,0 +Mk3004=Stimulus,S 44,1715273,1,0 +Mk3005=Stimulus,S128,1715732,1,0 +Mk3006=Stimulus,S139,1715737,1,0 +Mk3007=Stimulus,S128,1715739,1,0 +Mk3008=Stimulus,S 41,1717094,1,0 +Mk3009=Stimulus,S128,1717605,1,0 +Mk3010=Stimulus,S139,1717606,1,0 +Mk3011=Stimulus,S128,1717609,1,0 +Mk3012=Stimulus,S 43,1718938,1,0 +Mk3013=Stimulus,S128,1719669,1,0 +Mk3014=Stimulus,S139,1719671,1,0 +Mk3015=Stimulus,S128,1719674,1,0 +Mk3016=Stimulus,S 43,1720890,1,0 +Mk3017=Stimulus,S128,1721518,1,0 +Mk3018=Stimulus,S139,1721520,1,0 +Mk3019=Stimulus,S128,1721523,1,0 +Mk3020=Stimulus,S128,1721666,1,0 +Mk3021=Stimulus,S 41,1722843,1,0 +Mk3022=Stimulus,S128,1723458,1,0 +Mk3023=Stimulus,S139,1723461,1,0 +Mk3024=Stimulus,S128,1723464,1,0 +Mk3025=Stimulus,S128,1723601,1,0 +Mk3026=Stimulus,S 41,1724460,1,0 +Mk3027=Stimulus,S128,1724979,1,0 +Mk3028=Stimulus,S139,1724984,1,0 +Mk3029=Stimulus,S128,1724987,1,0 +Mk3030=Stimulus,S128,1725135,1,0 +Mk3031=Stimulus,S 41,1726257,1,0 +Mk3032=Stimulus,S128,1726793,1,0 +Mk3033=Stimulus,S139,1726800,1,0 +Mk3034=Stimulus,S128,1726802,1,0 +Mk3035=Stimulus,S128,1726948,1,0 +Mk3036=Stimulus,S 41,1728168,1,0 +Mk3037=Stimulus,S128,1728685,1,0 +Mk3038=Stimulus,S139,1728690,1,0 +Mk3039=Stimulus,S128,1728693,1,0 +Mk3040=Stimulus,S 22,1728817,1,0 +Mk3041=Stimulus,S128,1728833,1,0 +Mk3042=Stimulus,S 42,1729763,1,0 +Mk3043=Stimulus,S128,1730354,1,0 +Mk3044=Stimulus,S139,1730360,1,0 +Mk3045=Stimulus,S128,1730362,1,0 +Mk3046=Stimulus,S128,1730510,1,0 +Mk3047=Stimulus,S 42,1731795,1,0 +Mk3048=Stimulus,S128,1732338,1,0 +Mk3049=Stimulus,S139,1732343,1,0 +Mk3050=Stimulus,S128,1732346,1,0 +Mk3051=Stimulus,S128,1732478,1,0 +Mk3052=Stimulus,S 43,1733355,1,0 +Mk3053=Stimulus,S128,1734246,1,0 +Mk3054=Stimulus,S139,1734250,1,0 +Mk3055=Stimulus,S128,1734253,1,0 +Mk3056=Stimulus,S128,1734389,1,0 +Mk3057=Stimulus,S 42,1735079,1,0 +Mk3058=Stimulus,S128,1735827,1,0 +Mk3059=Stimulus,S139,1735828,1,0 +Mk3060=Stimulus,S128,1735831,1,0 +Mk3061=Stimulus,S 43,1736645,1,0 +Mk3062=Stimulus,S128,1737288,1,0 +Mk3063=Stimulus,S139,1737291,1,0 +Mk3064=Stimulus,S128,1737294,1,0 +Mk3065=Stimulus,S128,1737452,1,0 +Mk3066=Stimulus,S 41,1738212,1,0 +Mk3067=Stimulus,S128,1738847,1,0 +Mk3068=Stimulus,S139,1738852,1,0 +Mk3069=Stimulus,S128,1738855,1,0 +Mk3070=Stimulus,S 44,1739942,1,0 +Mk3071=Stimulus,S128,1740518,1,0 +Mk3072=Stimulus,S139,1740523,1,0 +Mk3073=Stimulus,S128,1740526,1,0 +Mk3074=Stimulus,S 41,1741752,1,0 +Mk3075=Stimulus,S128,1742230,1,0 +Mk3076=Stimulus,S139,1742234,1,0 +Mk3077=Stimulus,S128,1742237,1,0 +Mk3078=Stimulus,S 43,1743592,1,0 +Mk3079=Stimulus,S139,1744131,1,0 +Mk3080=Stimulus,S128,1744134,1,0 +Mk3081=Stimulus,S 44,1745427,1,0 +Mk3082=Stimulus,S128,1745956,1,0 +Mk3083=Stimulus,S139,1745957,1,0 +Mk3084=Stimulus,S128,1745960,1,0 +Mk3085=Stimulus,S 41,1747368,1,0 +Mk3086=Stimulus,S 11,1747825,1,0 +Mk3087=Stimulus,S139,1747827,1,0 +Mk3088=Stimulus,S128,1747828,1,0 +Mk3089=Stimulus,S128,1747965,1,0 +Mk3090=Stimulus,S 44,1749061,1,0 +Mk3091=Stimulus,S128,1749517,1,0 +Mk3092=Stimulus,S139,1749522,1,0 +Mk3093=Stimulus,S128,1749524,1,0 +Mk3094=Stimulus,S 42,1750897,1,0 +Mk3095=Stimulus,S128,1751347,1,0 +Mk3096=Stimulus,S139,1751348,1,0 +Mk3097=Stimulus,S128,1751350,1,0 +Mk3098=Stimulus,S 43,1752669,1,0 +Mk3099=Stimulus,S128,1753348,1,0 +Mk3100=Stimulus,S139,1753351,1,0 +Mk3101=Stimulus,S128,1753354,1,0 +Mk3102=Stimulus,S 43,1754290,1,0 +Mk3103=Stimulus,S128,1754864,1,0 +Mk3104=Stimulus,S139,1754866,1,0 +Mk3105=Stimulus,S128,1754869,1,0 +Mk3106=Stimulus,S 41,1755938,1,0 +Mk3107=Stimulus,S128,1756524,1,0 +Mk3108=Stimulus,S139,1756525,1,0 +Mk3109=Stimulus,S128,1756528,1,0 +Mk3110=Stimulus,S 43,1757737,1,0 +Mk3111=Stimulus,S128,1758266,1,0 +Mk3112=Stimulus,S139,1758267,1,0 +Mk3113=Stimulus,S128,1758269,1,0 +Mk3114=Stimulus,S128,1758414,1,0 +Mk3115=Stimulus,S 42,1759605,1,0 +Mk3116=Stimulus,S128,1760249,1,0 +Mk3117=Stimulus,S139,1760251,1,0 +Mk3118=Stimulus,S128,1760254,1,0 +Mk3119=Stimulus,S 43,1761634,1,0 +Mk3120=Stimulus,S128,1762332,1,0 +Mk3121=Stimulus,S139,1762333,1,0 +Mk3122=Stimulus,S128,1762336,1,0 +Mk3123=Stimulus,S 42,1763271,1,0 +Mk3124=Stimulus,S 11,1763723,1,0 +Mk3125=Stimulus,S128,1763725,1,0 +Mk3126=Stimulus,S128,1763884,1,0 +Mk3127=Stimulus,S 44,1764941,1,0 +Mk3128=Stimulus,S128,1765397,1,0 +Mk3129=Stimulus,S139,1765401,1,0 +Mk3130=Stimulus,S128,1765404,1,0 +Mk3131=Stimulus,S128,1765554,1,0 +Mk3132=Stimulus,S 42,1766685,1,0 +Mk3133=Stimulus,S128,1767114,1,0 +Mk3134=Stimulus,S139,1767115,1,0 +Mk3135=Stimulus,S128,1767117,1,0 +Mk3136=Stimulus,S 41,1768650,1,0 +Mk3137=Stimulus,S128,1769259,1,0 +Mk3138=Stimulus,S139,1769265,1,0 +Mk3139=Stimulus,S128,1769268,1,0 +Mk3140=Stimulus,S128,1769407,1,0 +Mk3141=Stimulus,S 42,1770332,1,0 +Mk3142=Stimulus,S128,1770906,1,0 +Mk3143=Stimulus,S139,1770910,1,0 +Mk3144=Stimulus,S128,1770912,1,0 +Mk3145=Stimulus,S128,1771059,1,0 +Mk3146=Stimulus,S 44,1772207,1,0 +Mk3147=Stimulus,S128,1772712,1,0 +Mk3148=Stimulus,S139,1772713,1,0 +Mk3149=Stimulus,S128,1772716,1,0 +Mk3150=Stimulus,S 44,1774046,1,0 +Mk3151=Stimulus,S128,1774662,1,0 +Mk3152=Stimulus,S139,1774666,1,0 +Mk3153=Stimulus,S128,1774669,1,0 +Mk3154=Stimulus,S 43,1775610,1,0 +Mk3155=Stimulus,S128,1776152,1,0 +Mk3156=Stimulus,S139,1776153,1,0 +Mk3157=Stimulus,S128,1776155,1,0 +Mk3158=Stimulus,S 42,1777243,1,0 +Mk3159=Stimulus,S128,1777685,1,0 +Mk3160=Stimulus,S139,1777686,1,0 +Mk3161=Stimulus,S128,1777688,1,0 +Mk3162=Stimulus,S128,1777831,1,0 +Mk3163=Stimulus,S128,1790311,1,0 +Mk3164=Stimulus,S128,1791641,1,0 +Mk3165=Stimulus,S 41,1794674,1,0 +Mk3166=Stimulus,S128,1795277,1,0 +Mk3167=Stimulus,S139,1795281,1,0 +Mk3168=Stimulus,S128,1795284,1,0 +Mk3169=Stimulus,S 41,1796274,1,0 +Mk3170=Stimulus,S128,1796722,1,0 +Mk3171=Stimulus,S139,1796723,1,0 +Mk3172=Stimulus,S128,1796727,1,0 +Mk3173=Stimulus,S 42,1797991,1,0 +Mk3174=Stimulus,S128,1798481,1,0 +Mk3175=Stimulus,S139,1798485,1,0 +Mk3176=Stimulus,S128,1798488,1,0 +Mk3177=Stimulus,S128,1798639,1,0 +Mk3178=Stimulus,S 41,1799964,1,0 +Mk3179=Stimulus,S 11,1800449,1,0 +Mk3180=Stimulus,S139,1800450,1,0 +Mk3181=Stimulus,S128,1800452,1,0 +Mk3182=Stimulus,S 43,1801650,1,0 +Mk3183=Stimulus,S139,1802296,1,0 +Mk3184=Stimulus,S128,1802299,1,0 +Mk3185=Stimulus,S 42,1803473,1,0 +Mk3186=Stimulus,S128,1803860,1,0 +Mk3187=Stimulus,S139,1803864,1,0 +Mk3188=Stimulus,S128,1803866,1,0 +Mk3189=Stimulus,S 44,1805240,1,0 +Mk3190=Stimulus,S 11,1805713,1,0 +Mk3191=Stimulus,S139,1805715,1,0 +Mk3192=Stimulus,S128,1805716,1,0 +Mk3193=Stimulus,S 41,1806894,1,0 +Mk3194=Stimulus,S139,1807334,1,0 +Mk3195=Stimulus,S128,1807337,1,0 +Mk3196=Stimulus,S 42,1808791,1,0 +Mk3197=Stimulus,S 11,1809127,1,0 +Mk3198=Stimulus,S139,1809128,1,0 +Mk3199=Stimulus,S128,1809130,1,0 +Mk3200=Stimulus,S 43,1810638,1,0 +Mk3201=Stimulus,S128,1811228,1,0 +Mk3202=Stimulus,S139,1811229,1,0 +Mk3203=Stimulus,S128,1811232,1,0 +Mk3204=Stimulus,S 44,1812404,1,0 +Mk3205=Stimulus,S 11,1812962,1,0 +Mk3206=Stimulus,S139,1812963,1,0 +Mk3207=Stimulus,S128,1812965,1,0 +Mk3208=Stimulus,S 42,1813986,1,0 +Mk3209=Stimulus,S128,1814436,1,0 +Mk3210=Stimulus,S139,1814438,1,0 +Mk3211=Stimulus,S128,1814440,1,0 +Mk3212=Stimulus,S 44,1815687,1,0 +Mk3213=Stimulus,S140,1816156,1,0 +Mk3214=Stimulus,S128,1816159,1,0 +Mk3215=Stimulus,S 42,1817695,1,0 +Mk3216=Stimulus,S128,1818100,1,0 +Mk3217=Stimulus,S139,1818101,1,0 +Mk3218=Stimulus,S128,1818104,1,0 +Mk3219=Stimulus,S 44,1819702,1,0 +Mk3220=Stimulus,S 11,1820147,1,0 +Mk3221=Stimulus,S139,1820148,1,0 +Mk3222=Stimulus,S128,1820150,1,0 +Mk3223=Stimulus,S128,1820166,1,0 +Mk3224=Stimulus,S 43,1821565,1,0 +Mk3225=Stimulus,S128,1822023,1,0 +Mk3226=Stimulus,S139,1822028,1,0 +Mk3227=Stimulus,S128,1822031,1,0 +Mk3228=Stimulus,S 44,1823333,1,0 +Mk3229=Stimulus,S128,1823760,1,0 +Mk3230=Stimulus,S139,1823766,1,0 +Mk3231=Stimulus,S128,1823768,1,0 +Mk3232=Stimulus,S 42,1825287,1,0 +Mk3233=Stimulus,S128,1825719,1,0 +Mk3234=Stimulus,S139,1825720,1,0 +Mk3235=Stimulus,S128,1825722,1,0 +Mk3236=Stimulus,S 44,1827155,1,0 +Mk3237=Stimulus,S128,1827665,1,0 +Mk3238=Stimulus,S139,1827667,1,0 +Mk3239=Stimulus,S128,1827670,1,0 +Mk3240=Stimulus,S 41,1829104,1,0 +Mk3241=Stimulus,S128,1829532,1,0 +Mk3242=Stimulus,S139,1829535,1,0 +Mk3243=Stimulus,S128,1829538,1,0 +Mk3244=Stimulus,S 42,1831027,1,0 +Mk3245=Stimulus,S128,1831497,1,0 +Mk3246=Stimulus,S139,1831503,1,0 +Mk3247=Stimulus,S128,1831506,1,0 +Mk3248=Stimulus,S 41,1832710,1,0 +Mk3249=Stimulus,S 11,1833227,1,0 +Mk3250=Stimulus,S139,1833228,1,0 +Mk3251=Stimulus,S128,1833230,1,0 +Mk3252=Stimulus,S 43,1834536,1,0 +Mk3253=Stimulus,S128,1835021,1,0 +Mk3254=Stimulus,S139,1835023,1,0 +Mk3255=Stimulus,S128,1835026,1,0 +Mk3256=Stimulus,S 44,1836451,1,0 +Mk3257=Stimulus,S 12,1836897,1,0 +Mk3258=Stimulus,S140,1836899,1,0 +Mk3259=Stimulus,S128,1836900,1,0 +Mk3260=Stimulus,S 43,1838153,1,0 +Mk3261=Stimulus,S139,1838774,1,0 +Mk3262=Stimulus,S128,1838776,1,0 +Mk3263=Stimulus,S 41,1839979,1,0 +Mk3264=Stimulus,S 11,1840537,1,0 +Mk3265=Stimulus,S139,1840539,1,0 +Mk3266=Stimulus,S128,1840541,1,0 +Mk3267=Stimulus,S 43,1841756,1,0 +Mk3268=Stimulus,S128,1842347,1,0 +Mk3269=Stimulus,S139,1842348,1,0 +Mk3270=Stimulus,S128,1842351,1,0 +Mk3271=Stimulus,S 43,1843365,1,0 +Mk3272=Stimulus,S128,1843847,1,0 +Mk3273=Stimulus,S139,1843851,1,0 +Mk3274=Stimulus,S128,1843854,1,0 +Mk3275=Stimulus,S 43,1845312,1,0 +Mk3276=Stimulus,S 11,1845806,1,0 +Mk3277=Stimulus,S139,1845807,1,0 +Mk3278=Stimulus,S128,1845808,1,0 +Mk3279=Stimulus,S 43,1847333,1,0 +Mk3280=Stimulus,S 11,1847952,1,0 +Mk3281=Stimulus,S128,1847954,1,0 +Mk3282=Stimulus,S 42,1849152,1,0 +Mk3283=Stimulus,S 11,1849652,1,0 +Mk3284=Stimulus,S128,1849654,1,0 +Mk3285=Stimulus,S 42,1850998,1,0 +Mk3286=Stimulus,S128,1851392,1,0 +Mk3287=Stimulus,S139,1851394,1,0 +Mk3288=Stimulus,S128,1851397,1,0 +Mk3289=Stimulus,S 44,1852818,1,0 +Mk3290=Stimulus,S 11,1853367,1,0 +Mk3291=Stimulus,S139,1853369,1,0 +Mk3292=Stimulus,S128,1853370,1,0 +Mk3293=Stimulus,S 44,1854428,1,0 +Mk3294=Stimulus,S139,1854920,1,0 +Mk3295=Stimulus,S128,1854922,1,0 +Mk3296=Stimulus,S 42,1856163,1,0 +Mk3297=Stimulus,S128,1856604,1,0 +Mk3298=Stimulus,S139,1856607,1,0 +Mk3299=Stimulus,S128,1856610,1,0 +Mk3300=Stimulus,S 43,1857900,1,0 +Mk3301=Stimulus,S128,1858440,1,0 +Mk3302=Stimulus,S139,1858443,1,0 +Mk3303=Stimulus,S128,1858445,1,0 +Mk3304=Stimulus,S 41,1859860,1,0 +Mk3305=Stimulus,S128,1860305,1,0 +Mk3306=Stimulus,S139,1860309,1,0 +Mk3307=Stimulus,S128,1860312,1,0 +Mk3308=Stimulus,S 41,1861613,1,0 +Mk3309=Stimulus,S128,1862091,1,0 +Mk3310=Stimulus,S139,1862095,1,0 +Mk3311=Stimulus,S128,1862098,1,0 +Mk3312=Stimulus,S 41,1863149,1,0 +Mk3313=Stimulus,S128,1863633,1,0 +Mk3314=Stimulus,S139,1863635,1,0 +Mk3315=Stimulus,S128,1863637,1,0 +Mk3316=Stimulus,S 44,1865078,1,0 +Mk3317=Stimulus,S128,1865632,1,0 +Mk3318=Stimulus,S139,1865633,1,0 +Mk3319=Stimulus,S128,1865636,1,0 +Mk3320=Stimulus,S128,1877623,1,0 +Mk3321=Stimulus,S128,1880933,1,0 +Mk3322=Stimulus,S128,1880951,1,0 +Mk3323=Stimulus,S 44,1883969,1,0 +Mk3324=Stimulus,S139,1884704,1,0 +Mk3325=Stimulus,S128,1884707,1,0 +Mk3326=Stimulus,S 41,1885710,1,0 +Mk3327=Stimulus,S 11,1886253,1,0 +Mk3328=Stimulus,S139,1886254,1,0 +Mk3329=Stimulus,S128,1886255,1,0 +Mk3330=Stimulus,S 43,1887568,1,0 +Mk3331=Stimulus,S128,1888140,1,0 +Mk3332=Stimulus,S139,1888141,1,0 +Mk3333=Stimulus,S128,1888144,1,0 +Mk3334=Stimulus,S 41,1889597,1,0 +Mk3335=Stimulus,S139,1890036,1,0 +Mk3336=Stimulus,S128,1890039,1,0 +Mk3337=Stimulus,S 43,1891370,1,0 +Mk3338=Stimulus,S128,1891829,1,0 +Mk3339=Stimulus,S139,1891834,1,0 +Mk3340=Stimulus,S128,1891837,1,0 +Mk3341=Stimulus,S 41,1892956,1,0 +Mk3342=Stimulus,S128,1893341,1,0 +Mk3343=Stimulus,S139,1893344,1,0 +Mk3344=Stimulus,S128,1893346,1,0 +Mk3345=Stimulus,S 42,1894891,1,0 +Mk3346=Stimulus,S128,1895373,1,0 +Mk3347=Stimulus,S139,1895379,1,0 +Mk3348=Stimulus,S128,1895382,1,0 +Mk3349=Stimulus,S 41,1896731,1,0 +Mk3350=Stimulus,S128,1897116,1,0 +Mk3351=Stimulus,S139,1897120,1,0 +Mk3352=Stimulus,S128,1897122,1,0 +Mk3353=Stimulus,S 44,1898355,1,0 +Mk3354=Stimulus,S128,1898860,1,0 +Mk3355=Stimulus,S139,1898861,1,0 +Mk3356=Stimulus,S128,1898864,1,0 +Mk3357=Stimulus,S 43,1900291,1,0 +Mk3358=Stimulus,S128,1900804,1,0 +Mk3359=Stimulus,S139,1900807,1,0 +Mk3360=Stimulus,S128,1900809,1,0 +Mk3361=Stimulus,S 44,1901884,1,0 +Mk3362=Stimulus,S128,1902422,1,0 +Mk3363=Stimulus,S139,1902426,1,0 +Mk3364=Stimulus,S128,1902429,1,0 +Mk3365=Stimulus,S 43,1903438,1,0 +Mk3366=Stimulus,S139,1903998,1,0 +Mk3367=Stimulus,S128,1904001,1,0 +Mk3368=Stimulus,S 43,1905367,1,0 +Mk3369=Stimulus,S128,1905998,1,0 +Mk3370=Stimulus,S139,1906001,1,0 +Mk3371=Stimulus,S128,1906004,1,0 +Mk3372=Stimulus,S 44,1907360,1,0 +Mk3373=Stimulus,S 11,1907905,1,0 +Mk3374=Stimulus,S128,1907910,1,0 +Mk3375=Stimulus,S 44,1909389,1,0 +Mk3376=Stimulus,S128,1909952,1,0 +Mk3377=Stimulus,S139,1909956,1,0 +Mk3378=Stimulus,S128,1909959,1,0 +Mk3379=Stimulus,S128,1910117,1,0 +Mk3380=Stimulus,S 42,1911179,1,0 +Mk3381=Stimulus,S139,1911646,1,0 +Mk3382=Stimulus,S128,1911649,1,0 +Mk3383=Stimulus,S 44,1913028,1,0 +Mk3384=Stimulus,S139,1913522,1,0 +Mk3385=Stimulus,S128,1913525,1,0 +Mk3386=Stimulus,S 41,1914982,1,0 +Mk3387=Stimulus,S128,1915435,1,0 +Mk3388=Stimulus,S139,1915440,1,0 +Mk3389=Stimulus,S128,1915443,1,0 +Mk3390=Stimulus,S 42,1916681,1,0 +Mk3391=Stimulus,S128,1917058,1,0 +Mk3392=Stimulus,S139,1917061,1,0 +Mk3393=Stimulus,S128,1917063,1,0 +Mk3394=Stimulus,S 43,1918261,1,0 +Mk3395=Stimulus,S128,1918796,1,0 +Mk3396=Stimulus,S139,1918798,1,0 +Mk3397=Stimulus,S128,1918800,1,0 +Mk3398=Stimulus,S 42,1919834,1,0 +Mk3399=Stimulus,S139,1920253,1,0 +Mk3400=Stimulus,S128,1920256,1,0 +Mk3401=Stimulus,S128,1920397,1,0 +Mk3402=Stimulus,S 43,1921490,1,0 +Mk3403=Stimulus,S139,1921972,1,0 +Mk3404=Stimulus,S128,1921975,1,0 +Mk3405=Stimulus,S 44,1923395,1,0 +Mk3406=Stimulus,S128,1923827,1,0 +Mk3407=Stimulus,S139,1923829,1,0 +Mk3408=Stimulus,S128,1923832,1,0 +Mk3409=Stimulus,S 44,1925234,1,0 +Mk3410=Stimulus,S128,1925680,1,0 +Mk3411=Stimulus,S139,1925683,1,0 +Mk3412=Stimulus,S128,1925686,1,0 +Mk3413=Stimulus,S 42,1927119,1,0 +Mk3414=Stimulus,S128,1927582,1,0 +Mk3415=Stimulus,S139,1927583,1,0 +Mk3416=Stimulus,S128,1927586,1,0 +Mk3417=Stimulus,S 41,1928947,1,0 +Mk3418=Stimulus,S128,1929534,1,0 +Mk3419=Stimulus,S139,1929535,1,0 +Mk3420=Stimulus,S128,1929538,1,0 +Mk3421=Stimulus,S 42,1930760,1,0 +Mk3422=Stimulus,S128,1931232,1,0 +Mk3423=Stimulus,S139,1931236,1,0 +Mk3424=Stimulus,S128,1931239,1,0 +Mk3425=Stimulus,S128,1931378,1,0 +Mk3426=Stimulus,S 41,1932357,1,0 +Mk3427=Stimulus,S128,1933009,1,0 +Mk3428=Stimulus,S139,1933012,1,0 +Mk3429=Stimulus,S128,1933015,1,0 +Mk3430=Stimulus,S 43,1933969,1,0 +Mk3431=Stimulus,S139,1934515,1,0 +Mk3432=Stimulus,S128,1934518,1,0 +Mk3433=Stimulus,S 43,1935624,1,0 +Mk3434=Stimulus,S128,1936059,1,0 +Mk3435=Stimulus,S139,1936064,1,0 +Mk3436=Stimulus,S128,1936067,1,0 +Mk3437=Stimulus,S128,1936190,1,0 +Mk3438=Stimulus,S 42,1937208,1,0 +Mk3439=Stimulus,S128,1937690,1,0 +Mk3440=Stimulus,S139,1937694,1,0 +Mk3441=Stimulus,S128,1937696,1,0 +Mk3442=Stimulus,S 44,1938760,1,0 +Mk3443=Stimulus,S128,1939329,1,0 +Mk3444=Stimulus,S139,1939333,1,0 +Mk3445=Stimulus,S128,1939336,1,0 +Mk3446=Stimulus,S 43,1940558,1,0 +Mk3447=Stimulus,S128,1941177,1,0 +Mk3448=Stimulus,S139,1941180,1,0 +Mk3449=Stimulus,S128,1941182,1,0 +Mk3450=Stimulus,S 44,1942252,1,0 +Mk3451=Stimulus,S139,1942906,1,0 +Mk3452=Stimulus,S128,1942909,1,0 +Mk3453=Stimulus,S 42,1944178,1,0 +Mk3454=Stimulus,S 11,1944605,1,0 +Mk3455=Stimulus,S139,1944607,1,0 +Mk3456=Stimulus,S128,1944609,1,0 +Mk3457=Stimulus,S128,1944720,1,0 +Mk3458=Stimulus,S 41,1945799,1,0 +Mk3459=Stimulus,S 11,1946278,1,0 +Mk3460=Stimulus,S139,1946279,1,0 +Mk3461=Stimulus,S128,1946281,1,0 +Mk3462=Stimulus,S 42,1947689,1,0 +Mk3463=Stimulus,S128,1948197,1,0 +Mk3464=Stimulus,S139,1948202,1,0 +Mk3465=Stimulus,S128,1948205,1,0 +Mk3466=Stimulus,S 41,1949439,1,0 +Mk3467=Stimulus,S139,1949878,1,0 +Mk3468=Stimulus,S128,1949881,1,0 +Mk3469=Stimulus,S 42,1951382,1,0 +Mk3470=Stimulus,S128,1951800,1,0 +Mk3471=Stimulus,S139,1951804,1,0 +Mk3472=Stimulus,S128,1951807,1,0 +Mk3473=Stimulus,S 41,1953197,1,0 +Mk3474=Stimulus,S139,1953615,1,0 +Mk3475=Stimulus,S128,1953617,1,0 +Mk3476=Stimulus,S128,1965235,1,0 +Mk3477=Stimulus,S127,1971263,1,0 diff --git a/code/eeglab13_4_4b/1ST_README.txt b/code/eeglab13_4_4b/1ST_README.txt new file mode 100644 index 0000000..3223bde --- /dev/null +++ b/code/eeglab13_4_4b/1ST_README.txt @@ -0,0 +1,47 @@ + +This dir contains original Matlab functions from the EEGLAB (formerly ICA/EEG) +Matlab toolbox, all released under the Gnu public license (see eeglablicence.txt). +See the EEGLAB tutorial and reference paper (URLs given below) for more information. + +Sub-directories: + + /functions - All distributed EEGLAB functions (admin, sigproc, pop, misc) + /plugins - Directory to place all downloaded EEGLAB plug-ins. dipfit (1.0) + is present by default + /sample_data - Miscellaneous EEGLAB data using in tutorials and references + /sample_locs - Miscellaneous standard channel location files (10-10, 10-20) + See the EEGLAB web site http://sccn.ucsd.edu/eeglab/ for more. + +To use EEGLAB: + +1. Place the Matlab functions in a directory ($DIR) and add + $DIR/eeglab4.x to (Unix) your matlabpath environment variable. + Else, within Matlab + >> addpath('full_path_here') + +2. Optional: Edit file "icadefs.m" under the function directory to specify the location of + the faster binary "ica" function (equivalent to Matlab runica() and called from within + Matlab by binica()). This requires a (recommended) separate download from + http://sccn.ucsd.edu/eeglab/binica/ + Also add the path to the EEGLAB tutorial. This requires another (recommended) download. See + http://sccn.ucsd.edu/eeglab/ + File "icadefs.m" also specifies various limits and constants used in EEGLAB functions. + +3. Then start Matlab and type >> eeglab + +4. Open the main EEGLAB tutorial page (your downloaded "eeglabtut.html", + else browse http://sccn.ucsd.edu/eeglab/eeglabtut.html) + +5. Please send feedback and suggestions to: eeglab@sccn.ucsd.edu + +6. In publications, please reference: + +Delorme, A., Makeig, S. (in press) EEGLAB: An open source toolbox for analysis of single-trial +EEG dynamics including independent component analysis. Journal of Neuroscience Methods. + http://sccn.ucsd.edu/eeglab/download/eeglab_jnm03.pdf + +Enjoy using EEGLAB to explore and analyze your data. Consider contributing to your functions +and creativity to EEGLAB open source development (see http://sccn.ucsd.edu/eeglab for more details). + +Arno Delorme & Scott Makeig +Fri Sep 6 11:44:29 PDT 2002 diff --git a/code/eeglab13_4_4b/Contents.m b/code/eeglab13_4_4b/Contents.m new file mode 100644 index 0000000..b88f33b --- /dev/null +++ b/code/eeglab13_4_4b/Contents.m @@ -0,0 +1,26 @@ +% EEGLAB Toolbox to process EEG data +% Version 13.4.4b +% +% eeglab() - Matlab graphic user interface environment for +% electrophysiological data analysis incorporating the ICA/EEG toolbox +% (Makeig et al.) developed at CNL / The Salk Institute, 1997-2001. +% Released 11/2002- as EEGLAB (Delorme, Makeig, et al.) at the Swartz Center +% for Computational Neuroscience, Institute for Neural Computation, +% University of California San Diego (http://sccn.ucsd.edu/). +% User feedback welcome: email eeglab@sccn.ucsd.edu +% +% Authors: Arnaud Delorme, Scott Makeig, with substantial contributions +% from Colin Humphries, Sigurd Enghoff, Tzyy-Ping Jung, plus contributions +% from Tony Bell, Te-Won Lee, Luca Finelli and other contributors. +% +% Description: +% EEGLAB is Matlab software for processing continuous or event-related +% EEG or other physiological data. It is designed for use by both novice and +% expert Matlab users. In normal use, the EEGLAB graphic interface calls +% graphic functions via pop-up function windows. The EEGLAB history mechanism +% can save the resulting Matlab calls to disk for later incorporation into +% Matlab scripts. A single data structure ('EEG') containing all dataset +% parameters may be accessed and modified directly from the Matlab commandline. +% EEGLAB now recognizes "plugins," sets of EEGLAB functions linked to the EEGLAB +% main menu through an "eegplugin_[name].m" function (Ex. >> help eeplugin_besa.m). +% diff --git a/code/eeglab13_4_4b/eeglab.m b/code/eeglab13_4_4b/eeglab.m new file mode 100644 index 0000000..6213553 --- /dev/null +++ b/code/eeglab13_4_4b/eeglab.m @@ -0,0 +1,2089 @@ +% eeglab() - Matlab graphic user interface environment for +% electrophysiological data analysis incorporating the ICA/EEG toolbox +% (Makeig et al.) developed at CNL / The Salk Institute, 1997-2001. +% Released 11/2002- as EEGLAB (Delorme, Makeig, et al.) at the Swartz Center +% for Computational Neuroscience, Institute for Neural Computation, +% University of California San Diego (http://sccn.ucsd.edu/). +% User feedback welcome: email eeglab@sccn.ucsd.edu +% +% Authors: Arnaud Delorme and Scott Makeig, with substantial contributions +% from Colin Humphries, Sigurd Enghoff, Tzyy-Ping Jung, plus +% contributions +% from Tony Bell, Te-Won Lee, Luca Finelli and many other contributors. +% +% Description: +% EEGLAB is Matlab-based software for processing continuous or event-related +% EEG or other physiological data. It is designed for use by both novice and +% expert Matlab users. In normal use, the EEGLAB graphic interface calls +% graphic functions via pop-up function windows. The EEGLAB history mechanism +% can save the resulting Matlab calls to disk for later incorporation into +% Matlab scripts. A single data structure ('EEG') containing all dataset +% parameters may be accessed and modified directly from the Matlab commandline. +% EEGLAB now recognizes "plugins," sets of EEGLAB functions linked to the EEGLAB +% main menu through an "eegplugin_[name].m" function (Ex. >> help eeplugin_besa.m). +% +% Usage: 1) To (re)start EEGLAB, type +% >> eeglab % Ignores any loaded datasets +% 2) To redaw and update the EEGLAB interface, type +% >> eeglab redraw % Scans for non-empty datasets +% >> eeglab rebuild % Closes and rebuilds the EEGLAB window +% >> eeglab versions % State EEGLAB version number +% +% >> type "license.txt" % the GNU public license +% >> web http://sccn.ucsd.edu/eeglab/tutorial/ % the EEGLAB tutorial +% >> help eeg_checkset % the EEG dataset structure +% +% GUI Functions calling eponymous processing and plotting functions: +% ------------------------------------------------------------------ +% pop_eegfilt - bandpass filter data (eegfilt()) +% pop_eegplot - scrolling multichannel data viewer (eegplot()) +% pop_eegthresh - simple thresholding method (eegthresh()) +% pop_envtopo - plot ERP data and component contributions (envtopo()) +% pop_epoch - extract epochs from a continuous dataset (epoch()) +% pop_erpimage - plot single epochs as an image (erpimage()) +% pop_jointprob - reject epochs using joint probability (jointprob()) +% pop_loaddat - load Neuroscan .DAT info file (loaddat()) +% pop_loadcnt - load Neuroscan .CNT data (lndcnt()) +% pop_loadeeg - load Neuroscan .EEG data (loadeeg()) +% pop_loadbva - load Brain Vision Analyser matlab files +% pop_plotdata - plot data epochs in rectangular array (plotdata()) +% pop_readegi - load binary EGI data file (readegi()) +% pop_rejkurt - compute data kurtosis (rejkurt()) +% pop_rejtrend - reject EEG epochs showing linear trends (rejtrend()) +% pop_resample - change data sampling rate (resample()) +% pop_rmbase - remove epoch baseline (rmbase()) +% pop_runica - run infomax ICA decomposition (runica()) +% pop_newtimef - event-related time-frequency (newtimef()) +% pop_timtopo - plot ERP and scalp maps (timtopo()) +% pop_topoplot - plot scalp maps (topoplot()) +% pop_snapread - read Snapmaster .SMA files (snapread()) +% pop_newcrossf - event-related cross-coherence (newcrossf()) +% pop_spectopo - plot all channel spectra and scalp maps (spectopo()) +% pop_plottopo - plot a data epoch in a topographic array (plottopo()) +% pop_readedf - read .EDF EEG data format (readedf()) +% pop_headplot - plot a 3-D data scalp map (headplot()) +% pop_reref - re-reference data (reref()) +% pop_signalstat - plot signal or component statistic (signalstat()) +% +% Other GUI functions: +% ------------------- +% pop_chanevent - import events stored in data channel(s) +% pop_comments - edit dataset comment ('about') text +% pop_compareerps - compare two dataset ERPs using plottopo() +% pop_prop - plot channel or component properties (erpimage, spectra, map) +% pop_copyset - copy dataset +% pop_dispcomp - display component scalp maps with reject buttons +% pop_editeventfield - edit event fields +% pop_editeventvals - edit event values +% pop_editset - edit dataset information +% pop_export - export data or ica activity to ASCII file +% pop_expica - export ica weights or inverse matrix to ASCII file +% pop_icathresh - choose rejection thresholds (in development) +% pop_importepoch - import epoch info ASCII file +% pop_importevent - import event info ASCII file +% pop_importpres - import Presentation info file +% pop_importev2 - import Neuroscan ev2 file +% pop_loadset - load dataset +% pop_mergeset - merge two datasets +% pop_rejepoch - reject pre-identified epochs in a EEG dataset +% pop_rejspec - reject based on spectrum (computes spectrum -% eegthresh) +% pop_saveh - save EEGLAB command history +% pop_saveset - save dataset +% pop_select - select data (epochs, time points, channels ...) +% pop_selectevent - select events +% pop_subcomp - subtract components from data +% +% Non-GUI functions use for handling the EEG structure: +% ---------------------------------------------------- +% eeg_checkset - check dataset parameter consistency +% eeg_context - return info about events surrounding given events +% pop_delset - delete dataset +% pop_editoptions - edit the option file +% eeg_emptyset - empty dataset +% eeg_epochformat - convert epoch array to structure +% eeg_eventformat - convert event array to structure +% eeg_getepochevent - return event values for a subset of event types +% eeg_global - global variables +% eeg_multieegplot - plot several rejections (using different colors) +% eeg_options - option file +% eeg_rejsuperpose - use by rejmenu to superpose all rejections +% eeg_rejmacro - used by all rejection functions +% pop_rejmenu - rejection menu (with all rejection methods visible) +% eeg_retrieve - retrieve dataset from ALLEEG +% eeg_store - store dataset into ALLEEG +% +% Help functions: +% -------------- +% eeg_helpadmin - help on admin function +% eeg_helphelp - help on help +% eeg_helpmenu - EEG help menus +% eeg_helppop - help on pop_ and eeg_ functions +% eeg_helpsigproc - help on + +% Copyright (C) 2001 Arnaud Delorme and Scott Makeig, Salk Institute, +% arno@salk.edu, smakeig@ucsd.edu. +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function varargout = eeglab( onearg ) + +if nargout > 0 + varargout = { [] [] 0 {} [] }; + %[ALLEEG, EEG, CURRENTSET, ALLCOM] +end; + +% check Matlab version +% -------------------- +vers = version; +tmpv = which('version'); +if ~isempty(findstr(lower(tmpv), 'biosig')) + [tmpp tmp] = fileparts(tmpv); + rmpath(tmpp); +end; +if str2num(vers(1)) < 7 && str2num(vers(1)) >= 5 + tmpWarning = warning('backtrace'); + warning backtrace off; + warning('You are using a Matlab version older than 7.0'); + warning('This Matlab version is too old to run the current EEGLAB'); + warning('Download EEGLAB 4.3b at http://sccn.ucsd.edu/eeglab/eeglab4.5b.teaching.zip'); + warning('This version of EEGLAB is compatible with all Matlab version down to Matlab 5.3'); + warning(tmpWarning); + return; +end; + +% check Matlab version +% -------------------- +vers = version; +indp = find(vers == '.'); +if str2num(vers(indp(1)+1)) > 1, vers = [ vers(1:indp(1)) '0' vers(indp(1)+1:end) ]; end; +indp = find(vers == '.'); +vers = str2num(vers(1:indp(2)-1)); +if vers < 7.06 + tmpWarning = warning('backtrace'); + warning backtrace off; + warning('You are using a Matlab version older than 7.6 (2008a)'); + warning('Some of the EEGLAB functions might not be functional'); + warning('Download EEGLAB 4.3b at http://sccn.ucsd.edu/eeglab/eeglab4.5b.teaching.zip'); + warning('This version of EEGLAB is compatible with all Matlab version down to Matlab 5.3'); + warning(tmpWarning); +end; + +% check for duplicate versions of EEGLAB +% -------------------------------------- +eeglabpath = mywhich('eeglab.m'); +eeglabpath = eeglabpath(1:end-length('eeglab.m')); +if nargin < 1 + eeglabpath2 = ''; + if strcmpi(eeglabpath, pwd) || strcmpi(eeglabpath(1:end-1), pwd) + cd('functions'); + warning('off', 'MATLAB:rmpath:DirNotFound'); + rmpath(eeglabpath); + warning('on', 'MATLAB:rmpath:DirNotFound'); + eeglabpath2 = mywhich('eeglab.m'); + cd('..'); + else + try, rmpath(eeglabpath); catch, end; + eeglabpath2 = mywhich('eeglab.m'); + end; + if ~isempty(eeglabpath2) + evalin('base', 'clear classes updater;'); + eeglabpath2 = eeglabpath2(1:end-length('eeglab.m')); + tmpWarning = warning('backtrace'); + warning backtrace off; + disp('******************************************************'); + warning('There are at least two versions of EEGLAB in your path'); + warning(sprintf('One is at %s', eeglabpath)); + warning(sprintf('The other one is at %s', eeglabpath2)); + warning(tmpWarning); + end; + addpath(eeglabpath); +end; + +% add the paths +% ------------- +if strcmpi(eeglabpath, './') || strcmpi(eeglabpath, '.\'), eeglabpath = [ pwd filesep ]; end; + +% solve BIOSIG problem +% -------------------- +pathtmp = mywhich('wilcoxon_test'); +if ~isempty(pathtmp) + try, + rmpath(pathtmp(1:end-15)); + catch, end; +end; + +% test for local SCCN copy +% ------------------------ +if ~iseeglabdeployed2 + addpathifnotinlist(eeglabpath); + if exist( fullfile( eeglabpath, 'functions', 'adminfunc') ) ~= 7 + warning('EEGLAB subfolders not found'); + end; +end; + +% determine file format +% --------------------- +fileformat = 'maclinux'; +comp = computer; +try + if strcmpi(comp(1:3), 'GLN') | strcmpi(comp(1:3), 'MAC') | strcmpi(comp(1:3), 'SOL') + fileformat = 'maclinux'; + elseif strcmpi(comp(1:5), 'pcwin') + fileformat = 'pcwin'; + end; +end; + +% add paths +% --------- +if ~iseeglabdeployed2 + myaddpath( eeglabpath, 'eeg_checkset.m', [ 'functions' filesep 'adminfunc' ]); + myaddpath( eeglabpath, 'eeg_checkset.m', [ 'functions' filesep 'adminfunc' ]); + myaddpath( eeglabpath, ['@mmo' filesep 'mmo.m'], 'functions'); + myaddpath( eeglabpath, 'readeetraklocs.m', [ 'functions' filesep 'sigprocfunc' ]); + myaddpath( eeglabpath, 'supergui.m', [ 'functions' filesep 'guifunc' ]); + myaddpath( eeglabpath, 'pop_study.m', [ 'functions' filesep 'studyfunc' ]); + myaddpath( eeglabpath, 'pop_loadbci.m', [ 'functions' filesep 'popfunc' ]); + myaddpath( eeglabpath, 'statcond.m', [ 'functions' filesep 'statistics' ]); + myaddpath( eeglabpath, 'timefreq.m', [ 'functions' filesep 'timefreqfunc' ]); + myaddpath( eeglabpath, 'icademo.m', [ 'functions' filesep 'miscfunc' ]); + myaddpath( eeglabpath, 'eeglab1020.ced', [ 'functions' filesep 'resources' ]); + myaddpath( eeglabpath, 'startpane.m', [ 'functions' filesep 'javachatfunc' ]); + addpathifnotinlist(fullfile(eeglabpath, 'plugins')); + eeglab_options; + + % remove path to to fmrlab if neceecessary + path_runica = fileparts(mywhich('runica')); + if length(path_runica) > 6 && strcmpi(path_runica(end-5:end), 'fmrlab') + rmpath(path_runica); + end; + + % add path if toolboxes are missing + % --------------------------------- + signalpath = fullfile(eeglabpath, 'functions', 'octavefunc', 'signal'); + optimpath = fullfile(eeglabpath, 'functions', 'octavefunc', 'optim'); + if option_donotusetoolboxes + p1 = fileparts(mywhich('ttest')); + p2 = fileparts(mywhich('filtfilt')); + p3 = fileparts(mywhich('optimtool')); + p4 = fileparts(mywhich('gray2ind')); + if ~isempty(p1), rmpath(p1); end; + if ~isempty(p2), rmpath(p2); end; + if ~isempty(p3), rmpath(p3); end; + if ~isempty(p4), rmpath(p4); end; + end; + if ~license('test','signal_toolbox') || exist('pwelch') ~= 2 + warning('off', 'MATLAB:dispatcher:nameConflict'); + addpath( signalpath ); + else + warning('off', 'MATLAB:rmpath:DirNotFound'); + rmpathifpresent( signalpath ); + rmpathifpresent(optimpath); + warning('on', 'MATLAB:rmpath:DirNotFound'); + end; + if ~license('test','optim_toolbox') && ~ismatlab + addpath( optimpath ); + else + warning('off', 'MATLAB:rmpath:DirNotFound'); + rmpathifpresent( optimpath ); + warning('on', 'MATLAB:rmpath:DirNotFound'); + end; +else + eeglab_options; +end; + +if nargin == 1 && strcmp(onearg, 'redraw') + if evalin('base', 'exist(''EEG'')', '0') == 1 + evalin('base', 'eeg_global;'); + end; +end; +eeg_global; + +% remove empty datasets in ALLEEG +while ~isempty(ALLEEG) && isempty(ALLEEG(end).data) + ALLEEG(end) = []; +end; +if ~isempty(ALLEEG) && max(CURRENTSET) > length(ALLEEG) + CURRENTSET = 1; + EEG = eeg_retrieve(ALLEEG, CURRENTSET); +end; + +% for the history function +% ------------------------ +comtmp = 'warning off MATLAB:mir_warning_variable_used_as_function'; +evalin('base' , comtmp, ''); +evalin('caller', comtmp, ''); + +evalin('base', 'eeg_global;'); +if nargin < 1 | exist('EEG') ~= 1 + clear global EEG ALLEEG CURRENTSET ALLCOM LASTCOM STUDY; + CURRENTSTUDY = 0; + eeg_global; + EEG = eeg_emptyset; + eegh('[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;'); + if ismatlab && get(0, 'screendepth') <= 8 + disp('Warning: screen color depth too low, some colors will be inaccurate in time-frequency plots'); + end; +end; + +if nargin == 1 + if strcmp(onearg, 'versions') + disp( [ 'EEGLAB v' eeg_getversion ] ); + elseif strcmp(onearg, 'nogui') + if nargout < 1, clear ALLEEG; end; % do not return output var + return; + elseif strcmp(onearg, 'redraw') + if ~ismatlab,return; end; + W_MAIN = findobj('tag', 'EEGLAB'); + if ~isempty(W_MAIN) + updatemenu; + if nargout < 1, clear ALLEEG; end; % do not return output var + return; + else + eegh('eeglab(''redraw'');'); + end; + elseif strcmp(onearg, 'rebuild') + if ~ismatlab,return; end; + W_MAIN = findobj('tag', 'EEGLAB'); + close(W_MAIN); + eeglab; + return; + else + eegh('[ALLEEG EEG CURRENTSET ALLCOM] = eeglab(''rebuild'');'); + end; +else + onearg = 'rebuild'; +end; +ALLCOM = ALLCOM; +try, eval('colordef white;'); catch end; + +% default option folder +% --------------------- +if ~iseeglabdeployed2 + eeglab_options; + fprintf('eeglab: options file is %s%seeg_options.m\n', homefolder, filesep); +end; + +% checking strings +% ---------------- +e_try = 'try,'; +e_catch = 'catch, eeglab_error; LASTCOM= ''''; clear EEGTMP ALLEEGTMP STUDYTMP; end;'; +nocheck = e_try; +ret = 'if ~isempty(LASTCOM), if LASTCOM(1) == -1, LASTCOM = ''''; return; end; end;'; +check = ['[EEG LASTCOM] = eeg_checkset(EEG, ''data'');' ret ' eegh(LASTCOM);' e_try]; +checkcont = ['[EEG LASTCOM] = eeg_checkset(EEG, ''contdata'');' ret ' eegh(LASTCOM);' e_try]; +checkica = ['[EEG LASTCOM] = eeg_checkset(EEG, ''ica'');' ret ' eegh(LASTCOM);' e_try]; +checkepoch = ['[EEG LASTCOM] = eeg_checkset(EEG, ''epoch'');' ret ' eegh(LASTCOM);' e_try]; +checkevent = ['[EEG LASTCOM] = eeg_checkset(EEG, ''event'');' ret ' eegh(LASTCOM);' e_try]; +checkbesa = ['[EEG LASTCOM] = eeg_checkset(EEG, ''besa'');' ret ' eegh(''% no history yet for BESA dipole localization'');' e_try]; +checkepochica = ['[EEG LASTCOM] = eeg_checkset(EEG, ''epoch'', ''ica'');' ret ' eegh(LASTCOM);' e_try]; +checkplot = ['[EEG LASTCOM] = eeg_checkset(EEG, ''chanloc'');' ret ' eegh(LASTCOM);' e_try]; +checkicaplot = ['[EEG LASTCOM] = eeg_checkset(EEG, ''ica'', ''chanloc'');' ret ' eegh(LASTCOM);' e_try]; +checkepochplot = ['[EEG LASTCOM] = eeg_checkset(EEG, ''epoch'', ''chanloc'');' ret ' eegh(LASTCOM);' e_try]; +checkepochicaplot = ['[EEG LASTCOM] = eeg_checkset(EEG, ''epoch'', ''ica'', ''chanloc'');' ret ' eegh(LASTCOM);' e_try]; + +% check string and backup old dataset +% ----------------------------------- +backup = [ 'if CURRENTSET ~= 0,' ... + ' [ ALLEEG EEG ] = eeg_store(ALLEEG, EEG, CURRENTSET, ''savegui'');' ... + ' eegh(''[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET, ''''savedata'''');'');' ... + 'end;' ]; + +storecall = '[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); eegh(''[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);'');'; +storenewcall = '[ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET, ''study'', ~isempty(STUDY)+0); eegh(LASTCOM);'; +storeallcall = [ 'if ~isempty(ALLEEG) & ~isempty(ALLEEG(1).data), ALLEEG = eeg_checkset(ALLEEG);' ... + 'EEG = eeg_retrieve(ALLEEG, CURRENTSET); eegh(''ALLEEG = eeg_checkset(ALLEEG); EEG = eeg_retrieve(ALLEEG, CURRENTSET);''); end;' ]; + +testeegtmp = 'if exist(''EEGTMP'') == 1, EEG = EEGTMP; clear EEGTMP; end;'; % for backward compatibility +ifeeg = 'if ~isempty(LASTCOM) & ~isempty(EEG),'; +ifeegnh = 'if ~isempty(LASTCOM) & ~isempty(EEG) & ~isempty(findstr(''='',LASTCOM)),'; + +% nh = no dataset history +% ----------------------- +e_storeall_nh = [e_catch 'eegh(LASTCOM);' ifeeg storeallcall 'disp(''Done.''); end; eeglab(''redraw'');']; +e_hist_nh = [e_catch 'eegh(LASTCOM);']; + +% same as above but also save history in dataset +% ---------------------------------------------- +e_newset = [e_catch 'EEG = eegh(LASTCOM, EEG);' testeegtmp ifeeg storenewcall 'disp(''Done.''); end; eeglab(''redraw'');']; +e_store = [e_catch 'EEG = eegh(LASTCOM, EEG);' ifeegnh storecall 'disp(''Done.''); end; eeglab(''redraw'');']; +e_hist = [e_catch 'EEG = eegh(LASTCOM, EEG);']; +e_histdone = [e_catch 'EEG = eegh(LASTCOM, EEG); if ~isempty(LASTCOM), disp(''Done.''); end;' ]; + +% study checking +% -------------- +e_load_study = [e_catch 'if ~isempty(LASTCOM), STUDY = STUDYTMP; STUDY = eegh(LASTCOM, STUDY); ALLEEG = ALLEEGTMP; EEG = ALLEEG; CURRENTSET = [1:length(EEG)]; eegh(''CURRENTSTUDY = 1; EEG = ALLEEG; CURRENTSET = [1:length(EEG)];''); CURRENTSTUDY = 1; disp(''Done.''); end; clear ALLEEGTMP STUDYTMP; eeglab(''redraw'');']; +e_plot_study = [e_catch 'if ~isempty(LASTCOM), STUDY = STUDYTMP; STUDY = eegh(LASTCOM, STUDY); disp(''Done.''); end; clear ALLEEGTMP STUDYTMP; eeglab(''redraw'');']; % ALLEEG not modified + +% build structures for plugins +% ---------------------------- +trystrs.no_check = e_try; +trystrs.check_data = check; +trystrs.check_ica = checkica; +trystrs.check_cont = checkcont; +trystrs.check_epoch = checkepoch; +trystrs.check_event = checkevent; +trystrs.check_epoch_ica = checkepochica; +trystrs.check_chanlocs = checkplot; +trystrs.check_epoch_chanlocs = checkepochplot; +trystrs.check_epoch_ica_chanlocs = checkepochicaplot; +catchstrs.add_to_hist = e_hist; +catchstrs.store_and_hist = e_store; +catchstrs.new_and_hist = e_newset; +catchstrs.new_non_empty = e_newset; +catchstrs.update_study = e_plot_study; + +% create eeglab figure +% -------------------- +javaobj = eeg_mainfig(onearg); + +% detecting icalab +% ---------------- +if exist('icalab') + disp('ICALAB toolbox detected (algo. added to "run ICA" interface)'); +end; + +if ~iseeglabdeployed2 + % check for older version of Fieldtrip and presence of topoplot + % ------------------------------------------------------------- + if ismatlab + ptopoplot = fileparts(mywhich('cbar')); + ptopoplot2 = fileparts(mywhich('topoplot')); + if ~strcmpi(ptopoplot, ptopoplot2), + %disp(' Warning: duplicate function topoplot.m in Fieldtrip and EEGLAB'); + %disp(' EEGLAB function will prevail and call the Fieldtrip one when appropriate'); + addpath(ptopoplot); + end; + end; +end; + +cb_importdata = [ nocheck '[EEG LASTCOM] = pop_importdata;' e_newset ]; +cb_readegi = [ nocheck '[EEG LASTCOM] = pop_readegi;' e_newset ]; +cb_readsegegi = [ nocheck '[EEG LASTCOM] = pop_readsegegi;' e_newset ]; +cb_readegiepo = [ nocheck '[EEG LASTCOM] = pop_importegimat;' e_newset ]; +cb_loadbci = [ nocheck '[EEG LASTCOM] = pop_loadbci;' e_newset ]; +cb_snapread = [ nocheck '[EEG LASTCOM] = pop_snapread;' e_newset ]; +cb_loadcnt = [ nocheck '[EEG LASTCOM] = pop_loadcnt;' e_newset ]; +cb_loadeeg = [ nocheck '[EEG LASTCOM] = pop_loadeeg;' e_newset ]; +cb_biosig = [ nocheck '[EEG LASTCOM] = pop_biosig; ' e_newset ]; +cb_fileio = [ nocheck '[EEG LASTCOM] = pop_fileio; ' e_newset ]; +cb_fileio2 = [ nocheck '[EEG LASTCOM] = pop_fileiodir;' e_newset ]; + +cb_importepoch = [ checkepoch '[EEG LASTCOM] = pop_importepoch(EEG);' e_store ]; +cb_loaddat = [ checkepoch '[EEG LASTCOM]= pop_loaddat(EEG);' e_store ]; +cb_importevent = [ check '[EEG LASTCOM] = pop_importevent(EEG);' e_store ]; +cb_chanevent = [ check '[EEG LASTCOM]= pop_chanevent(EEG);' e_store ]; +cb_importpres = [ check '[EEG LASTCOM]= pop_importpres(EEG);' e_store ]; +cb_importev2 = [ check '[EEG LASTCOM]= pop_importev2(EEG);' e_store ]; +cb_export = [ check 'LASTCOM = pop_export(EEG);' e_histdone ]; +cb_expica1 = [ check 'LASTCOM = pop_expica(EEG, ''weights'');' e_histdone ]; +cb_expica2 = [ check 'LASTCOM = pop_expica(EEG, ''inv'');' e_histdone ]; +cb_expevents = [ check 'LASTCOM = pop_expevents(EEG);' e_histdone ]; +cb_expdata = [ check 'LASTCOM = pop_writeeeg(EEG);' e_histdone ]; + +cb_loadset = [ nocheck '[EEG LASTCOM] = pop_loadset;' e_newset]; +cb_saveset = [ check '[EEG LASTCOM] = pop_saveset(EEG, ''savemode'', ''resave'');' e_store ]; +cb_savesetas = [ check '[EEG LASTCOM] = pop_saveset(EEG);' e_store ]; +cb_delset = [ nocheck '[ALLEEG LASTCOM] = pop_delset(ALLEEG, -CURRENTSET);' e_hist_nh 'eeglab redraw;' ]; +cb_study1 = [ nocheck 'pop_stdwarn; [STUDYTMP ALLEEGTMP LASTCOM] = pop_study([], ALLEEG , ''gui'', ''on'');' e_load_study]; +cb_study2 = [ nocheck 'pop_stdwarn; [STUDYTMP ALLEEGTMP LASTCOM] = pop_study([], isempty(ALLEEG), ''gui'', ''on'');' e_load_study]; +cb_studyerp = [ nocheck 'pop_stdwarn; [STUDYTMP ALLEEGTMP LASTCOM] = pop_studyerp;' e_load_study]; +cb_loadstudy = [ nocheck 'pop_stdwarn; [STUDYTMP ALLEEGTMP LASTCOM] = pop_loadstudy; if ~isempty(LASTCOM), STUDYTMP = std_renamestudyfiles(STUDYTMP, ALLEEGTMP); end;' e_load_study]; +cb_savestudy1 = [ check '[STUDYTMP ALLEEGTMP LASTCOM] = pop_savestudy(STUDY, EEG, ''savemode'', ''resave'');' e_load_study]; +cb_savestudy2 = [ check '[STUDYTMP ALLEEGTMP LASTCOM] = pop_savestudy(STUDY, EEG);' e_load_study]; +cb_clearstudy = 'LASTCOM = ''STUDY = []; CURRENTSTUDY = 0; ALLEEG = []; EEG=[]; CURRENTSET=[];''; eval(LASTCOM); eegh( LASTCOM ); eeglab redraw;'; +cb_editoptions = [ nocheck 'if isfield(ALLEEG, ''nbchan''), LASTCOM = pop_editoptions(length([ ALLEEG.nbchan ]) >1);' ... + 'else LASTCOM = pop_editoptions(0); end;' e_storeall_nh]; +cb_plugin1 = [ nocheck 'if plugin_extract(''import'', PLUGINLIST) , close(findobj(''tag'', ''EEGLAB'')); eeglab redraw; end;' e_hist_nh ]; +cb_plugin2 = [ nocheck 'if plugin_extract(''process'', PLUGINLIST), close(findobj(''tag'', ''EEGLAB'')); eeglab redraw; end;' e_hist_nh ]; + +cb_saveh1 = [ nocheck 'LASTCOM = pop_saveh(EEG.history);' e_hist_nh]; +cb_saveh2 = [ nocheck 'LASTCOM = pop_saveh(ALLCOM);' e_hist_nh]; +cb_runsc = [ nocheck 'LASTCOM = pop_runscript;' e_hist ]; +cb_quit = [ 'close(gcf); disp(''To save the EEGLAB command history >> pop_saveh(ALLCOM);'');' ... + 'clear global EEG ALLEEG LASTCOM CURRENTSET;']; + +cb_editset = [ check '[EEG LASTCOM] = pop_editset(EEG);' e_store]; +cb_editeventf = [ checkevent '[EEG LASTCOM] = pop_editeventfield(EEG);' e_store]; +cb_editeventv = [ checkevent '[EEG LASTCOM] = pop_editeventvals(EEG);' e_store]; +cb_comments = [ check '[EEG.comments LASTCOM] =pop_comments(EEG.comments, ''About this dataset'');' e_store]; +cb_chanedit = [ 'disp(''IMPORTANT: After importing/modifying data channels, you must close'');' ... + 'disp(''the channel editing window for the changes to take effect in EEGLAB.'');' ... + 'disp(''TIP: Call this function directy from the prompt, ">> pop_chanedit([]);"'');' ... + 'disp('' to convert between channel location file formats'');' ... + '[EEG TMPINFO TMP LASTCOM] = pop_chanedit(EEG); if ~isempty(LASTCOM), EEG = eeg_checkset(EEG, ''chanlocsize'');' ... + 'clear TMPINFO TMP; EEG = eegh(LASTCOM, EEG);' storecall 'end; eeglab(''redraw'');']; +cb_select = [ check '[EEG LASTCOM] = pop_select(EEG);' e_newset]; +cb_rmdat = [ checkevent '[EEG LASTCOM] = pop_rmdat(EEG);' e_newset]; +cb_selectevent = [ checkevent '[EEG TMP LASTCOM] = pop_selectevent(EEG); clear TMP;' e_newset ]; +cb_copyset = [ check '[ALLEEG EEG CURRENTSET LASTCOM] = pop_copyset(ALLEEG, CURRENTSET); eeglab(''redraw'');' e_hist_nh]; +cb_mergeset = [ check '[EEG LASTCOM] = pop_mergeset(ALLEEG);' e_newset]; + +cb_resample = [ check '[EEG LASTCOM] = pop_resample(EEG);' e_newset]; +cb_eegfilt = [ check '[EEG LASTCOM] = pop_eegfilt(EEG);' e_newset]; +cb_interp = [ check '[EEG LASTCOM] = pop_interp(EEG); ' e_newset]; +cb_reref = [ check '[EEG LASTCOM] = pop_reref(EEG);' e_newset]; +cb_eegplot = [ checkcont '[LASTCOM] = pop_eegplot(EEG, 1);' e_hist]; +cb_epoch = [ check '[EEG tmp LASTCOM] = pop_epoch(EEG); clear tmp;' e_newset check '[EEG LASTCOM] = pop_rmbase(EEG);' e_newset]; +cb_rmbase = [ check '[EEG LASTCOM] = pop_rmbase(EEG);' e_store]; +cb_runica = [ check '[EEG LASTCOM] = pop_runica(EEG);' e_store]; +cb_subcomp = [ checkica '[EEG LASTCOM] = pop_subcomp(EEG);' e_newset]; +%cb_chanrej = [ check 'pop_rejchan(EEG); LASTCOM = '''';' e_hist]; +cb_chanrej = [ check '[EEG tmp1 tmp2 LASTCOM] = pop_rejchan(EEG); clear tmp1 tmp2;' e_hist]; +cb_autorej = [ checkepoch '[EEG tmpp LASTCOM] = pop_autorej(EEG); clear tmpp;' e_hist]; +cb_rejcont = [ check '[EEG tmp1 tmp2 LASTCOM] = pop_rejcont(EEG); clear tmp1 tmp2;' e_hist]; + +cb_rejmenu1 = [ check 'pop_rejmenu(EEG, 1); LASTCOM = '''';' e_hist]; +cb_eegplotrej1 = [ check '[LASTCOM] = pop_eegplot(EEG, 1);' e_hist]; +cb_eegthresh1 = [ checkepoch '[TMP LASTCOM] = pop_eegthresh(EEG, 1); clear TMP;' e_hist]; +cb_rejtrend1 = [ checkepoch '[EEG LASTCOM] = pop_rejtrend(EEG, 1);' e_store]; +cb_jointprob1 = [ checkepoch '[EEG LASTCOM] = pop_jointprob(EEG, 1);' e_store]; +cb_rejkurt1 = [ checkepoch '[EEG LASTCOM] = pop_rejkurt(EEG, 1);' e_store]; +cb_rejspec1 = [ checkepoch '[EEG Itmp LASTCOM] = pop_rejspec(EEG, 1); clear Itmp;' e_store]; +cb_rejsup1 = [ checkepochica '[EEG LASTCOM] = eeg_rejsuperpose(EEG, 1,1,1,1,1,1,1,1); eegh(LASTCOM);' ... + 'LASTCOM = ''EEG.reject.icarejmanual = EEG.reject.rejglobal;''; eval(LASTCOM);' e_store ]; +cb_rejsup2 = [ checkepoch '[EEG LASTCOM] = eeg_rejsuperpose(EEG, 1,1,1,1,1,1,1,1); EEG = eegh(LASTCOM, EEG);' ... + '[EEG LASTCOM] = pop_rejepoch(EEG);' e_newset]; + +cb_selectcomps = [ checkicaplot '[EEG LASTCOM] = pop_selectcomps(EEG);' e_store]; +cb_rejmenu2 = [ checkepochica 'pop_rejmenu(EEG, 0); LASTCOM ='''';' e_hist]; +cb_eegplotrej2 = [ checkica '[LASTCOM] = pop_eegplot(EEG, 0);' e_hist]; +cb_eegthresh2 = [ checkepochica '[TMP LASTCOM] = pop_eegthresh(EEG, 0); clear TMP;' e_hist]; +cb_rejtrend2 = [ checkepochica '[EEG LASTCOM] = pop_rejtrend(EEG, 0);' e_store]; +cb_jointprob2 = [ checkepochica '[EEG LASTCOM] = pop_jointprob(EEG, 0);' e_store]; +cb_rejkurt2 = [ checkepochica '[EEG LASTCOM] = pop_rejkurt(EEG, 0);' e_store]; +cb_rejspec2 = [ checkepochica '[EEG Itmp LASTCOM] = pop_rejspec(EEG, 1); clear Itmp;' e_store]; +cb_rejsup3 = [ checkepochica '[EEG LASTCOM] = eeg_rejsuperpose(EEG, 0,1,1,1,1,1,1,1); eegh(LASTCOM);' ... + 'LASTCOM = ''EEG.reject.rejmanual = EEG.reject.rejglobal;''; eval(LASTCOM);' e_store ]; +cb_rejsup4 = [ checkepochica '[EEG LASTCOM] = eeg_rejsuperpose(EEG, 0,1,1,1,1,1,1,1); EEG = eegh(LASTCOM, EEG);' ... + '[EEG LASTCOM] = pop_rejepoch(EEG);' e_newset ]; + +cb_topoblank1 = [ checkplot 'LASTCOM = [''figure; topoplot([],EEG.chanlocs, ''''style'''', ''''blank'''', ' ... + '''''electrodes'''', ''''labelpoint'''', ''''chaninfo'''', EEG.chaninfo);'']; eval(LASTCOM);' e_hist]; +cb_topoblank2 = [ checkplot 'LASTCOM = [''figure; topoplot([],EEG.chanlocs, ''''style'''', ''''blank'''', ' ... + '''''electrodes'''', ''''numpoint'''', ''''chaninfo'''', EEG.chaninfo);'']; eval(LASTCOM);' e_hist]; +cb_eegplot1 = [ check 'LASTCOM = pop_eegplot(EEG, 1, 1, 1);' e_hist]; +cb_spectopo1 = [ check 'LASTCOM = pop_spectopo(EEG, 1);' e_hist]; +cb_prop1 = [ checkplot 'LASTCOM = pop_prop(EEG,1);' e_hist]; +cb_erpimage1 = [ checkepoch 'LASTCOM = pop_erpimage(EEG, 1, eegh(''find'',''pop_erpimage(EEG,1''));' e_hist]; +cb_timtopo = [ checkplot 'LASTCOM = pop_timtopo(EEG);' e_hist]; +cb_plottopo = [ check 'LASTCOM = pop_plottopo(EEG);' e_hist]; +cb_topoplot1 = [ checkplot 'LASTCOM = pop_topoplot(EEG, 1);' e_hist]; +cb_headplot1 = [ checkplot '[EEG LASTCOM] = pop_headplot(EEG, 1);' e_store]; +cb_comperp1 = [ checkepoch 'LASTCOM = pop_comperp(ALLEEG);' e_hist]; + +cb_eegplot2 = [ checkica '[LASTCOM] = pop_eegplot(EEG, 0, 1, 1);' e_hist]; +cb_spectopo2 = [ checkicaplot 'LASTCOM = pop_spectopo(EEG, 0);' e_hist]; +cb_topoplot2 = [ checkicaplot 'LASTCOM = pop_topoplot(EEG, 0);' e_hist]; +cb_headplot2 = [ checkicaplot '[EEG LASTCOM] = pop_headplot(EEG, 0);' e_store]; +cb_prop2 = [ checkicaplot 'LASTCOM = pop_prop(EEG,0);' e_hist]; +cb_erpimage2 = [ checkepochica 'LASTCOM = pop_erpimage(EEG, 0, eegh(''find'',''pop_erpimage(EEG,0''));' e_hist]; +cb_envtopo1 = [ checkica 'LASTCOM = pop_envtopo(EEG);' e_hist]; +cb_envtopo2 = [ checkica 'if length(ALLEEG) == 1, error(''Need at least 2 datasets''); end; LASTCOM = pop_envtopo(ALLEEG);' e_hist]; +cb_plotdata2 = [ checkepochica '[tmpeeg LASTCOM] = pop_plotdata(EEG, 0); clear tmpeeg;' e_hist]; +cb_comperp2 = [ checkepochica 'LASTCOM = pop_comperp(ALLEEG, 0);' e_hist]; + +cb_signalstat1 = [ check 'LASTCOM = pop_signalstat(EEG, 1);' e_hist]; +cb_signalstat2 = [ checkica 'LASTCOM = pop_signalstat(EEG, 0);' e_hist]; +cb_eventstat = [ checkevent 'LASTCOM = pop_eventstat(EEG);' e_hist]; +cb_timef1 = [ check 'LASTCOM = pop_newtimef(EEG, 1, eegh(''find'',''pop_newtimef(EEG,1''));' e_hist]; +cb_crossf1 = [ check 'LASTCOM = pop_newcrossf(EEG, 1,eegh(''find'',''pop_newcrossf(EEG,1''));' e_hist]; +cb_timef2 = [ checkica 'LASTCOM = pop_newtimef(EEG, 0, eegh(''find'',''pop_newtimef(EEG,0''));' e_hist]; +cb_crossf2 = [ checkica 'LASTCOM = pop_newcrossf(EEG, 0,eegh(''find'',''pop_newcrossf(EEG,0''));' e_hist]; + +cb_study3 = [ nocheck '[STUDYTMP ALLEEGTMP LASTCOM] = pop_study(STUDY, ALLEEG, ''gui'', ''on'');' e_load_study]; +cb_studydesign = [ nocheck '[STUDYTMP LASTCOM] = pop_studydesign(STUDY, ALLEEG); ALLEEGTMP = ALLEEG;' e_plot_study]; +cb_precomp = [ nocheck '[STUDYTMP ALLEEGTMP LASTCOM] = pop_precomp(STUDY, ALLEEG);' e_plot_study]; +cb_chanplot = [ nocheck '[STUDYTMP LASTCOM] = pop_chanplot(STUDY, ALLEEG); ALLEEGTMP=ALLEEG;' e_plot_study]; +cb_precomp2 = [ nocheck '[STUDYTMP ALLEEGTMP LASTCOM] = pop_precomp(STUDY, ALLEEG, ''components'');' e_plot_study]; +cb_preclust = [ nocheck '[STUDYTMP ALLEEGTMP LASTCOM] = pop_preclust(STUDY, ALLEEG);' e_plot_study]; +cb_clust = [ nocheck '[STUDYTMP ALLEEGTMP LASTCOM] = pop_clust(STUDY, ALLEEG);' e_plot_study]; +cb_clustedit = [ nocheck 'ALLEEGTMP = ALLEEG; [STUDYTMP LASTCOM] = pop_clustedit(STUDY, ALLEEG);' e_plot_study]; +% +% % add STUDY plugin menus +% if exist('eegplugin_stderpimage') +% structure.uilist = { { } ... +% {'style' 'pushbutton' 'string' 'Plot ERPimage' 'Callback' 'stderpimageplugin_plot(''onecomp'', gcf);' } { } ... +% {'style' 'pushbutton' 'string' 'Plot ERPimage(s)' 'Callback' 'stderpimageplugin_plot(''oneclust'', gcf);' } }; +% structure.geometry = { [1] [1 0.3 1] }; +% arg = vararg2str( { structure } ); +% cb_clustedit = [ nocheck 'ALLEEGTMP = ALLEEG; [STUDYTMP LASTCOM] = pop_clustedit(STUDY, ALLEEG, [], ' arg ');' e_load_study]; +% end; + +% menu definition +% --------------- +if ismatlab + % defaults + % -------- + % startup:on + % study:off + % chanloc:off + % epoch:on + % continuous:on + + on = 'study:on'; + onnostudy = ''; + ondata = 'startup:off'; + onepoch = 'startup:off;continuous:off'; + ondatastudy = 'startup:off;study:on'; + onchannel = 'startup:off;chanloc:on'; + onepochchan = 'startup:off;continuous:off;chanloc:on'; + onstudy = 'startup:off;epoch:off;continuous:off;study:on'; + + W_MAIN = findobj('tag', 'EEGLAB'); + EEGUSERDAT = get(W_MAIN, 'userdata'); + set(W_MAIN, 'MenuBar', 'none'); + file_m = uimenu( W_MAIN, 'Label', 'File' , 'userdata', on); + import_m = uimenu( file_m, 'Label', 'Import data' , 'userdata', onnostudy); + neuro_m = uimenu( import_m, 'Label', 'Using EEGLAB functions and plugins' , 'tag', 'import data' , 'userdata', onnostudy); + epoch_m = uimenu( file_m, 'Label', 'Import epoch info', 'tag', 'import epoch', 'userdata', onepoch); + event_m = uimenu( file_m, 'Label', 'Import event info', 'tag', 'import event', 'userdata', ondata); + exportm = uimenu( file_m, 'Label', 'Export' , 'tag', 'export' , 'userdata', ondata); + edit_m = uimenu( W_MAIN, 'Label', 'Edit' , 'userdata', ondata); + tools_m = uimenu( W_MAIN, 'Label', 'Tools', 'tag', 'tools' , 'userdata', ondatastudy); + plot_m = uimenu( W_MAIN, 'Label', 'Plot', 'tag', 'plot' , 'userdata', ondata); + loc_m = uimenu( plot_m, 'Label', 'Channel locations' , 'userdata', onchannel); + std_m = uimenu( W_MAIN, 'Label', 'Study', 'tag', 'study' , 'userdata', onstudy); + set_m = uimenu( W_MAIN, 'Label', 'Datasets' , 'userdata', ondatastudy); + help_m = uimenu( W_MAIN, 'Label', 'Help' , 'userdata', on); + + uimenu( neuro_m, 'Label', 'From ASCII/float file or Matlab array' , 'CallBack', cb_importdata); + %uimenu( neuro_m, 'Label', 'From Netstation .mff (FILE-IO toolbox)', 'CallBack', cb_fileio2, 'Separator', 'on'); + uimenu( neuro_m, 'Label', 'From Netstation binary simple file' , 'CallBack', cb_readegi, 'Separator', 'on'); + uimenu( neuro_m, 'Label', 'From Multiple seg. Netstation files' , 'CallBack', cb_readsegegi); + uimenu( neuro_m, 'Label', 'From Netstation Matlab files' , 'CallBack', cb_readegiepo); + uimenu( neuro_m, 'Label', 'From BCI2000 ASCII file' , 'CallBack', cb_loadbci, 'Separator', 'on'); + uimenu( neuro_m, 'Label', 'From Snapmaster .SMA file' , 'CallBack', cb_snapread, 'Separator', 'on'); + uimenu( neuro_m, 'Label', 'From Neuroscan .CNT file' , 'CallBack', cb_loadcnt, 'Separator', 'on'); + uimenu( neuro_m, 'Label', 'From Neuroscan .EEG file' , 'CallBack', cb_loadeeg); + + % BIOSIG MENUS + % ------------ + uimenu( neuro_m, 'Label', 'From Biosemi BDF file (BIOSIG toolbox)', 'CallBack' , cb_biosig, 'Separator', 'on'); + uimenu( neuro_m, 'Label', 'From EDF/EDF+/GDF files (BIOSIG toolbox)', 'CallBack', cb_biosig); + + uimenu( epoch_m, 'Label', 'From Matlab array or ASCII file' , 'CallBack', cb_importepoch); + uimenu( epoch_m, 'Label', 'From Neuroscan .DAT file' , 'CallBack', cb_loaddat); + uimenu( event_m, 'Label', 'From Matlab array or ASCII file' , 'CallBack', cb_importevent); + uimenu( event_m, 'Label', 'From data channel' , 'CallBack', cb_chanevent); + uimenu( event_m, 'Label', 'From Presentation .LOG file' , 'CallBack', cb_importpres); + uimenu( event_m, 'Label', 'From E-Prime ASCII (text) file' , 'CallBack', cb_importevent); + uimenu( event_m, 'Label', 'From Neuroscan .ev2 file' , 'CallBack', cb_importev2); + uimenu( exportm, 'Label', 'Data and ICA activity to text file' , 'CallBack', cb_export); + uimenu( exportm, 'Label', 'Weight matrix to text file' , 'CallBack', cb_expica1); + uimenu( exportm, 'Label', 'Inverse weight matrix to text file' , 'CallBack', cb_expica2); + uimenu( exportm, 'Label', 'Events to text file' , 'CallBack', cb_expevents); + uimenu( exportm, 'Label', 'Data to EDF/BDF/GDF file' , 'CallBack', cb_expdata, 'separator', 'on'); + + uimenu( file_m, 'Label', 'Load existing dataset' , 'userdata', onnostudy, 'CallBack', cb_loadset, 'Separator', 'on'); + uimenu( file_m, 'Label', 'Save current dataset(s)' , 'userdata', ondatastudy, 'CallBack', cb_saveset); + uimenu( file_m, 'Label', 'Save current dataset as' , 'userdata', ondata, 'CallBack', cb_savesetas); + uimenu( file_m, 'Label', 'Clear dataset(s)' , 'userdata', ondata, 'CallBack', cb_delset); + + std2_m = uimenu( file_m, 'Label', 'Create study' , 'userdata', on , 'Separator', 'on'); + uimenu( std2_m, 'Label', 'Using all loaded datasets' , 'userdata', ondata , 'Callback', cb_study1); + uimenu( std2_m, 'Label', 'Browse for datasets' , 'userdata', on , 'Callback', cb_study2); + uimenu( std2_m, 'Label', 'Simple ERP STUDY' , 'userdata', on , 'Callback', cb_studyerp); + + uimenu( file_m, 'Label', 'Load existing study' , 'userdata', on , 'CallBack', cb_loadstudy,'Separator', 'on' ); + uimenu( file_m, 'Label', 'Save current study' , 'userdata', onstudy, 'CallBack', cb_savestudy1); + uimenu( file_m, 'Label', 'Save current study as' , 'userdata', onstudy, 'CallBack', cb_savestudy2); + uimenu( file_m, 'Label', 'Clear study / Clear all' , 'userdata', ondatastudy, 'CallBack', cb_clearstudy); + uimenu( file_m, 'Label', 'Memory and other options' , 'userdata', on , 'CallBack', cb_editoptions, 'Separator', 'on'); + + hist_m = uimenu( file_m, 'Label', 'History scripts' , 'userdata', on , 'Separator', 'on'); + uimenu( hist_m, 'Label', 'Save dataset history script' , 'userdata', ondata , 'CallBack', cb_saveh1); + uimenu( hist_m, 'Label', 'Save session history script' , 'userdata', ondatastudy, 'CallBack', cb_saveh2); + uimenu( hist_m, 'Label', 'Run script' , 'userdata', on , 'CallBack', cb_runsc); + + plugin_m = uimenu( file_m, 'Label', 'Manage EEGLAB extensions' , 'userdata', on); + uimenu( plugin_m, 'Label', 'Data import extensions' , 'userdata', on , 'CallBack', cb_plugin1); + uimenu( plugin_m, 'Label', 'Data processing extensions' , 'userdata', on , 'CallBack', cb_plugin2); + + uimenu( file_m, 'Label', 'Quit' , 'userdata', on , 'CallBack', cb_quit, 'Separator', 'on'); + + uimenu( edit_m, 'Label', 'Dataset info' , 'userdata', ondata, 'CallBack', cb_editset); + uimenu( edit_m, 'Label', 'Event fields' , 'userdata', ondata, 'CallBack', cb_editeventf); + uimenu( edit_m, 'Label', 'Event values' , 'userdata', ondata, 'CallBack', cb_editeventv); + uimenu( edit_m, 'Label', 'About this dataset' , 'userdata', ondata, 'CallBack', cb_comments); + uimenu( edit_m, 'Label', 'Channel locations' , 'userdata', ondata, 'CallBack', cb_chanedit); + uimenu( edit_m, 'Label', 'Select data' , 'userdata', ondata, 'CallBack', cb_select, 'Separator', 'on'); + uimenu( edit_m, 'Label', 'Select data using events' , 'userdata', ondata, 'CallBack', cb_rmdat); + uimenu( edit_m, 'Label', 'Select epochs or events' , 'userdata', ondata, 'CallBack', cb_selectevent); + uimenu( edit_m, 'Label', 'Copy current dataset' , 'userdata', ondata, 'CallBack', cb_copyset, 'Separator', 'on'); + uimenu( edit_m, 'Label', 'Append datasets' , 'userdata', ondata, 'CallBack', cb_mergeset); + uimenu( edit_m, 'Label', 'Delete dataset(s) from memory' , 'userdata', ondata, 'CallBack', cb_delset); + + uimenu( tools_m, 'Label', 'Change sampling rate' , 'userdata', ondatastudy, 'CallBack', cb_resample); + + filter_m = uimenu( tools_m, 'Label', 'Filter the data' , 'userdata', ondatastudy, 'tag', 'filter'); + uimenu( filter_m, 'Label', 'Basic FIR filter (legacy)' , 'userdata', ondatastudy, 'CallBack', cb_eegfilt); + + uimenu( tools_m, 'Label', 'Re-reference' , 'userdata', ondata, 'CallBack', cb_reref); + uimenu( tools_m, 'Label', 'Interpolate electrodes' , 'userdata', ondata, 'CallBack', cb_interp); + uimenu( tools_m, 'Label', 'Reject continuous data by eye' , 'userdata', ondata, 'CallBack', cb_eegplot); + uimenu( tools_m, 'Label', 'Extract epochs' , 'userdata', ondata, 'CallBack', cb_epoch, 'Separator', 'on'); + uimenu( tools_m, 'Label', 'Remove baseline' , 'userdata', ondatastudy, 'CallBack', cb_rmbase); + uimenu( tools_m, 'Label', 'Run ICA' , 'userdata', ondatastudy, 'CallBack', cb_runica, 'foregroundcolor', 'b', 'Separator', 'on'); + uimenu( tools_m, 'Label', 'Remove components' , 'userdata', ondata, 'CallBack', cb_subcomp); + uimenu( tools_m, 'Label', 'Automatic channel rejection' , 'userdata', ondata, 'CallBack', cb_chanrej, 'Separator', 'on'); + uimenu( tools_m, 'Label', 'Automatic continuous rejection' , 'userdata', ondata, 'CallBack', cb_rejcont); + uimenu( tools_m, 'Label', 'Automatic epoch rejection' , 'userdata', onepoch, 'CallBack', cb_autorej); + rej_m1 = uimenu( tools_m, 'Label', 'Reject data epochs' , 'userdata', onepoch); + rej_m2 = uimenu( tools_m, 'Label', 'Reject data using ICA' , 'userdata', ondata ); + + uimenu( rej_m1, 'Label', 'Reject data (all methods)' , 'userdata', onepoch, 'CallBack', cb_rejmenu1); + uimenu( rej_m1, 'Label', 'Reject by inspection' , 'userdata', onepoch, 'CallBack', cb_eegplotrej1); + uimenu( rej_m1, 'Label', 'Reject extreme values' , 'userdata', onepoch, 'CallBack', cb_eegthresh1); + uimenu( rej_m1, 'Label', 'Reject by linear trend/variance' , 'userdata', onepoch, 'CallBack', cb_rejtrend1); + uimenu( rej_m1, 'Label', 'Reject by probability' , 'userdata', onepoch, 'CallBack', cb_jointprob1); + uimenu( rej_m1, 'Label', 'Reject by kurtosis' , 'userdata', onepoch, 'CallBack', cb_rejkurt1); + uimenu( rej_m1, 'Label', 'Reject by spectra' , 'userdata', onepoch, 'CallBack', cb_rejspec1); + uimenu( rej_m1, 'Label', 'Export marks to ICA reject' , 'userdata', onepoch, 'CallBack', cb_rejsup1, 'separator', 'on'); + uimenu( rej_m1, 'Label', 'Reject marked epochs' , 'userdata', onepoch, 'CallBack', cb_rejsup2, 'separator', 'on', 'foregroundcolor', 'b'); + uimenu( rej_m2, 'Label', 'Reject components by map' , 'userdata', ondata , 'CallBack', cb_selectcomps); + uimenu( rej_m2, 'Label', 'Reject data (all methods)' , 'userdata', onepoch, 'CallBack', cb_rejmenu2, 'Separator', 'on'); + uimenu( rej_m2, 'Label', 'Reject by inspection' , 'userdata', onepoch, 'CallBack', cb_eegplotrej2); + uimenu( rej_m2, 'Label', 'Reject extreme values' , 'userdata', onepoch, 'CallBack', cb_eegthresh2); + uimenu( rej_m2, 'Label', 'Reject by linear trend/variance' , 'userdata', onepoch, 'CallBack', cb_rejtrend2); + uimenu( rej_m2, 'Label', 'Reject by probability' , 'userdata', onepoch, 'CallBack', cb_jointprob2); + uimenu( rej_m2, 'Label', 'Reject by kurtosis' , 'userdata', onepoch, 'CallBack', cb_rejkurt2); + uimenu( rej_m2, 'Label', 'Reject by spectra' , 'userdata', onepoch, 'CallBack', cb_rejspec2); + uimenu( rej_m2, 'Label', 'Export marks to data reject' , 'userdata', onepoch, 'CallBack', cb_rejsup3, 'separator', 'on'); + uimenu( rej_m2, 'Label', 'Reject marked epochs' , 'userdata', onepoch, 'CallBack', cb_rejsup4, 'separator', 'on', 'foregroundcolor', 'b'); + + uimenu( loc_m, 'Label', 'By name' , 'userdata', onchannel, 'CallBack', cb_topoblank1); + uimenu( loc_m, 'Label', 'By number' , 'userdata', onchannel, 'CallBack', cb_topoblank2); + uimenu( plot_m, 'Label', 'Channel data (scroll)' , 'userdata', ondata , 'CallBack', cb_eegplot1, 'Separator', 'on'); + uimenu( plot_m, 'Label', 'Channel spectra and maps' , 'userdata', ondata , 'CallBack', cb_spectopo1); + uimenu( plot_m, 'Label', 'Channel properties' , 'userdata', ondata , 'CallBack', cb_prop1); + uimenu( plot_m, 'Label', 'Channel ERP image' , 'userdata', onepoch, 'CallBack', cb_erpimage1); + + ERP_m = uimenu( plot_m, 'Label', 'Channel ERPs' , 'userdata', onepoch); + uimenu( ERP_m, 'Label', 'With scalp maps' , 'CallBack', cb_timtopo); + uimenu( ERP_m, 'Label', 'In scalp/rect. array' , 'CallBack', cb_plottopo); + + topo_m = uimenu( plot_m, 'Label', 'ERP map series' , 'userdata', onepochchan); + uimenu( topo_m, 'Label', 'In 2-D' , 'CallBack', cb_topoplot1); + uimenu( topo_m, 'Label', 'In 3-D' , 'CallBack', cb_headplot1); + uimenu( plot_m, 'Label', 'Sum/Compare ERPs' , 'userdata', onepoch, 'CallBack', cb_comperp1); + + uimenu( plot_m, 'Label', 'Component activations (scroll)' , 'userdata', ondata , 'CallBack', cb_eegplot2,'Separator', 'on'); + uimenu( plot_m, 'Label', 'Component spectra and maps' , 'userdata', ondata , 'CallBack', cb_spectopo2); + + tica_m = uimenu( plot_m, 'Label', 'Component maps' , 'userdata', onchannel); + uimenu( tica_m, 'Label', 'In 2-D' , 'CallBack', cb_topoplot2); + uimenu( tica_m, 'Label', 'In 3-D' , 'CallBack', cb_headplot2); + uimenu( plot_m, 'Label', 'Component properties' , 'userdata', ondata , 'CallBack', cb_prop2); + uimenu( plot_m, 'Label', 'Component ERP image' , 'userdata', onepoch, 'CallBack', cb_erpimage2); + + ERPC_m = uimenu( plot_m, 'Label', 'Component ERPs' , 'userdata', onepoch); + uimenu( ERPC_m, 'Label', 'With component maps' , 'CallBack', cb_envtopo1); + uimenu( ERPC_m, 'Label', 'With comp. maps (compare)' , 'CallBack', cb_envtopo2); + uimenu( ERPC_m, 'Label', 'In rectangular array' , 'CallBack', cb_plotdata2); + uimenu( plot_m, 'Label', 'Sum/Compare comp. ERPs' , 'userdata', onepoch, 'CallBack', cb_comperp2); + + stat_m = uimenu( plot_m, 'Label', 'Data statistics', 'Separator', 'on', 'userdata', ondata ); + uimenu( stat_m, 'Label', 'Channel statistics' , 'CallBack', cb_signalstat1); + uimenu( stat_m, 'Label', 'Component statistics' , 'CallBack', cb_signalstat2); + uimenu( stat_m, 'Label', 'Event statistics' , 'CallBack', cb_eventstat); + + spec_m = uimenu( plot_m, 'Label', 'Time-frequency transforms', 'Separator', 'on', 'userdata', ondata); + uimenu( spec_m, 'Label', 'Channel time-frequency' , 'CallBack', cb_timef1); + uimenu( spec_m, 'Label', 'Channel cross-coherence' , 'CallBack', cb_crossf1); + uimenu( spec_m, 'Label', 'Component time-frequency' , 'CallBack', cb_timef2,'Separator', 'on'); + uimenu( spec_m, 'Label', 'Component cross-coherence' , 'CallBack', cb_crossf2); + + uimenu( std_m, 'Label', 'Edit study info' , 'userdata', onstudy, 'CallBack', cb_study3); + uimenu( std_m, 'Label', 'Select/Edit study design(s)' , 'userdata', onstudy, 'CallBack', cb_studydesign); + uimenu( std_m, 'Label', 'Precompute channel measures' , 'userdata', onstudy, 'CallBack', cb_precomp, 'separator', 'on'); + uimenu( std_m, 'Label', 'Plot channel measures' , 'userdata', onstudy, 'CallBack', cb_chanplot); + uimenu( std_m, 'Label', 'Precompute component measures' , 'userdata', onstudy, 'CallBack', cb_precomp2, 'separator', 'on'); + clust_m = uimenu( std_m, 'Label', 'PCA clustering (original)' , 'userdata', onstudy); + uimenu( clust_m, 'Label', 'Build preclustering array' , 'userdata', onstudy, 'CallBack', cb_preclust); + uimenu( clust_m, 'Label', 'Cluster components' , 'userdata', onstudy, 'CallBack', cb_clust); + uimenu( std_m, 'Label', 'Edit/plot clusters' , 'userdata', onstudy, 'CallBack', cb_clustedit); + + if ~iseeglabdeployed2 + %newerVersionMenu = uimenu( help_m, 'Label', 'Upgrade to the Latest Version' , 'userdata', on, 'ForegroundColor', [0.6 0 0]); + uimenu( help_m, 'Label', 'About EEGLAB' , 'userdata', on, 'CallBack', 'pophelp(''eeglab'');'); + uimenu( help_m, 'Label', 'About EEGLAB help' , 'userdata', on, 'CallBack', 'pophelp(''eeg_helphelp'');'); + uimenu( help_m, 'Label', 'EEGLAB menus' , 'userdata', on, 'CallBack', 'pophelp(''eeg_helpmenu'');','separator','on'); + + help_1 = uimenu( help_m, 'Label', 'EEGLAB functions', 'userdata', on); + uimenu( help_1, 'Label', 'Admin. functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helpadmin'');'); + uimenu( help_1, 'Label', 'Interactive pop_ functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helppop'');'); + uimenu( help_1, 'Label', 'Signal processing functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helpsigproc'');'); + uimenu( help_1, 'Label', 'Group data (STUDY) functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helpstudy'');'); + uimenu( help_1, 'Label', 'Time-frequency functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helptimefreq'');'); + uimenu( help_1, 'Label', 'Statistical functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helpstatistics'');'); + uimenu( help_1, 'Label', 'Graphic interface builder functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helpgui'');'); + uimenu( help_1, 'Label', 'Misc. command line functions' , 'userdata', on, 'Callback', 'pophelp(''eeg_helpmisc'');'); + + uimenu( help_m, 'Label', 'EEGLAB license' , 'userdata', on, 'CallBack', 'pophelp(''eeglablicense.txt'', 1);'); + else + uimenu( help_m, 'Label', 'About EEGLAB' , 'userdata', on, 'CallBack', 'abouteeglab;'); + uimenu( help_m, 'Label', 'EEGLAB license' , 'userdata', on, 'CallBack', 'pophelp(''eeglablicense.txt'', 1);'); + end; + + uimenu( help_m, 'Label', 'EEGLAB tutorial' , 'userdata', on, 'CallBack', 'tutorial;', 'Separator', 'on'); + uimenu( help_m, 'Label', 'Email the EEGLAB team' , 'userdata', on, 'CallBack', 'web(''mailto:eeglab@sccn.ucsd.edu'');'); +end; + +if iseeglabdeployed2 + disp('Adding FIELDTRIP toolbox functions'); + disp('Adding BIOSIG toolbox functions'); + disp('Adding FILE-IO toolbox functions'); + funcname = { 'eegplugin_VisEd' ... + 'eegplugin_eepimport' ... + 'eegplugin_bdfimport' ... + 'eegplugin_brainmovie' ... + 'eegplugin_bva_io' ... + 'eegplugin_ctfimport' ... + 'eegplugin_dipfit' ... + 'eegplugin_erpssimport' ... + 'eegplugin_fmrib' ... + 'eegplugin_iirfilt' ... + 'eegplugin_ascinstep' ... + 'eegplugin_loreta' ... + 'eegplugin_miclust' ... + 'eegplugin_4dneuroimaging' }; + for indf = 1:length(funcname) + try + vers = feval(funcname{indf}, gcf, trystrs, catchstrs); + disp(['EEGLAB: adding "' vers '" plugin' ]); + catch + feval(funcname{indf}, gcf, trystrs, catchstrs); + disp(['EEGLAB: adding plugin function "' funcname{indf} '"' ]); + end; + end; +else + pluginlist = []; + plugincount = 1; + + p = mywhich('eeglab.m'); + p = p(1:findstr(p,'eeglab.m')-1); + if strcmpi(p, './') || strcmpi(p, '.\'), p = [ pwd filesep ]; end; + + % scan deactivated plugin folder + % ------------------------------ + dircontent = dir(fullfile(p, 'deactivatedplugins')); + dircontent = { dircontent.name }; + for index = 1:length(dircontent) + funcname = ''; + pluginVersion = ''; + if exist([p 'deactivatedplugins' filesep dircontent{index}]) == 7 + if ~strcmpi(dircontent{index}, '.') & ~strcmpi(dircontent{index}, '..') + tmpdir = dir([ p 'deactivatedplugins' filesep dircontent{index} filesep 'eegplugin*.m' ]); + [ pluginName pluginVersion ] = parsepluginname(dircontent{index}); + if ~isempty(tmpdir) + funcname = tmpdir(1).name(1:end-2); + end; + end; + else + if ~isempty(findstr(dircontent{index}, 'eegplugin')) && dircontent{index}(end) == 'm' + funcname = dircontent{index}(1:end-2); % remove .m + [ pluginName pluginVersion ] = parsepluginname(dircontent{index}(10:end-2)); + end; + end; + if ~isempty(pluginVersion) + pluginlist(plugincount).plugin = pluginName; + pluginlist(plugincount).version = pluginVersion; + pluginlist(plugincount).foldername = dircontent{index}; + if ~isempty(funcname) + pluginlist(plugincount).funcname = funcname(10:end); + else pluginlist(plugincount).funcname = ''; + end + if length(pluginlist(plugincount).funcname) > 1 && pluginlist(plugincount).funcname(1) == '_' + pluginlist(plugincount).funcname(1) = []; + end; + pluginlist(plugincount).status = 'deactivated'; + plugincount = plugincount+1; + end; + end; + + % scan plugin folder + % ------------------ + dircontent = dir(fullfile(p, 'plugins')); + dircontent = { dircontent.name }; + for index = 1:length(dircontent) + + % find function + % ------------- + funcname = ''; + pluginVersion = []; + if exist([p 'plugins' filesep dircontent{index}]) == 7 + if ~strcmpi(dircontent{index}, '.') & ~strcmpi(dircontent{index}, '..') + newpath = [ 'plugins' filesep dircontent{index} ]; + tmpdir = dir([ p 'plugins' filesep dircontent{index} filesep 'eegplugin*.m' ]); + + addpathifnotinlist(fullfile(eeglabpath, newpath)); + [ pluginName pluginVersion ] = parsepluginname(dircontent{index}); + if ~isempty(tmpdir) + %myaddpath(eeglabpath, tmpdir(1).name, newpath); + funcname = tmpdir(1).name(1:end-2); + end; + + % special case of subfolder for Fieldtrip + % --------------------------------------- + if ~isempty(findstr(lower(dircontent{index}), 'fieldtrip')) + addpathifnotexist( fullfile(eeglabpath, newpath, 'compat') , 'electrodenormalize' ); + addpathifnotexist( fullfile(eeglabpath, newpath, 'forward'), 'ft_sourcedepth.m'); + addpathifnotexist( fullfile(eeglabpath, newpath, 'utilities'), 'ft_datatype.m'); + ptopoplot = fileparts(mywhich('cbar')); + ptopoplot2 = fileparts(mywhich('topoplot')); + if ~isequal(ptopoplot, ptopoplot2) + addpath(ptopoplot); + end; + end; + + % special case of subfolder for BIOSIG + % ------------------------------------ + if ~isempty(findstr(lower(dircontent{index}), 'biosig')) && isempty(findstr(lower(dircontent{index}), 'biosigplot')) + addpathifnotexist( fullfile(eeglabpath, newpath, 'biosig', 't200_FileAccess'), 'sopen.m'); + addpathifnotexist( fullfile(eeglabpath, newpath, 'biosig', 't250_ArtifactPreProcessingQualityControl'), 'regress_eog.m' ); + addpathifnotexist( fullfile(eeglabpath, newpath, 'biosig', 'doc'), 'DecimalFactors.txt'); + end; + + end; + else + if ~isempty(findstr(dircontent{index}, 'eegplugin')) && dircontent{index}(end) == 'm' + funcname = dircontent{index}(1:end-2); % remove .m + [ pluginName pluginVersion ] = parsepluginname(dircontent{index}(10:end-2)); + end; + end; + + % execute function + % ---------------- + if ~isempty(pluginVersion) || ~isempty(funcname) + if isempty(funcname) + disp([ 'EEGLAB: adding "' pluginName '" to the path; subfolders (if any) might be missing from the path' ]); + pluginlist(plugincount).plugin = pluginName; + pluginlist(plugincount).version = pluginVersion; + pluginlist(plugincount).foldername = dircontent{index}; + pluginlist(plugincount).status = 'ok'; + plugincount = plugincount+1; + else + pluginlist(plugincount).plugin = pluginName; + pluginlist(plugincount).version = pluginVersion; + vers = pluginlist(plugincount).version; % version + vers2 = ''; + status = 'ok'; + try, + %eval( [ 'vers2 =' funcname '(gcf, trystrs, catchstrs);' ]); + vers2 = feval(funcname, gcf, trystrs, catchstrs); + catch + try, + eval( [ funcname '(gcf, trystrs, catchstrs)' ]); + catch + disp([ 'EEGLAB: error while adding plugin "' funcname '"' ] ); + disp([ ' ' lasterr] ); + status = 'error'; + end; + end; + pluginlist(plugincount).funcname = funcname(10:end); + pluginlist(plugincount).foldername = dircontent{index}; + [tmp pluginlist(plugincount).versionfunc] = parsepluginname(vers2); + if length(pluginlist(plugincount).funcname) > 1 && pluginlist(plugincount).funcname(1) == '_' + pluginlist(plugincount).funcname(1) = []; + end; + if strcmpi(status, 'ok') + if isempty(vers), vers = pluginlist(plugincount).versionfunc; end; + if isempty(vers), vers = '?'; end; + fprintf('EEGLAB: adding "%s" v%s (see >> help %s)\n', ... + pluginlist(plugincount).plugin, vers, funcname); + end; + pluginlist(plugincount).status = status; + plugincount = plugincount+1; + end; + end; + end; + global PLUGINLIST; + PLUGINLIST = pluginlist; +end; % iseeglabdeployed2 + +if ~ismatlab, return; end; +% add other import ... +% -------------------- +cb_others = [ 'pophelp(''troubleshooting_data_formats'');' ]; +uimenu( import_m, 'Label', 'Using the FILE-IO interface', 'CallBack', cb_fileio, 'separator', 'on'); +uimenu( import_m, 'Label', 'Using the BIOSIG interface' , 'CallBack', cb_biosig); +uimenu( import_m, 'Label', 'Troubleshooting data formats...', 'CallBack', cb_others); + +% changing plugin menu color +% -------------------------- +fourthsub_m = findobj('parent', tools_m); +plotsub_m = findobj('parent', plot_m); +importsub_m = findobj('parent', neuro_m); +epochsub_m = findobj('parent', epoch_m); +eventsub_m = findobj('parent', event_m); +editsub_m = findobj('parent', edit_m); +exportsub_m = findobj('parent', exportm); +filter_m = findobj('parent', filter_m); +icadefs; % containing PLUGINMENUCOLOR +if length(fourthsub_m) > 11, set(fourthsub_m(1:end-11), 'foregroundcolor', PLUGINMENUCOLOR); end; +if length(plotsub_m) > 17, set(plotsub_m (1:end-17), 'foregroundcolor', PLUGINMENUCOLOR); end; +if length(importsub_m) > 9, set(importsub_m(1:end-9) , 'foregroundcolor', PLUGINMENUCOLOR); end; +if length(epochsub_m ) > 3 , set(epochsub_m (1:end-3 ), 'foregroundcolor', PLUGINMENUCOLOR); end; +if length(eventsub_m ) > 4 , set(eventsub_m (1:end-4 ), 'foregroundcolor', PLUGINMENUCOLOR); end; +if length(exportsub_m) > 4 , set(exportsub_m(1:end-4 ), 'foregroundcolor', PLUGINMENUCOLOR); end; +if length(editsub_m) > 10, set(editsub_m( 1:end-10), 'foregroundcolor', PLUGINMENUCOLOR); end; +if length(filter_m) > 3 , set(filter_m (1:end-1 ), 'foregroundcolor', PLUGINMENUCOLOR); end; + +EEGMENU = uimenu( set_m, 'Label', '------', 'Enable', 'off'); +eval('set(W_MAIN, ''userdat'', { EEGUSERDAT{1} EEGMENU javaobj });'); +eeglab('redraw'); +if nargout < 1 + clear ALLEEG; +end; + +%% automatic updater +try + [dummy eeglabVersionNumber currentReleaseDateString] = eeg_getversion; + if isempty(eeglabVersionNumber) + eeglabVersionNumber = 'dev'; + end; + eeglabUpdater = up.updater(eeglabVersionNumber, 'http://sccn.ucsd.edu/eeglab/updater/latest_version.php', 'EEGLAB', currentReleaseDateString); + + % create a new GUI item (e.g. under Help) + %newerVersionMenu = uimenu(help_m, 'Label', 'Upgrade to the Latest Version', 'visible', 'off', 'userdata', 'startup:on;study:on'); + + % set the callback to bring up the updater GUI + icadefs; % for getting background color + eeglabFolder = fileparts(mywhich('eeglab.m')); + %eeglabUpdater.menuItemHandle = []; %newerVersionMenu; + %eeglabUpdater.menuItemCallback = {@command_on_update_menu_click, eeglabUpdater, eeglabFolder, true, BACKEEGLABCOLOR}; + + % place it in the base workspace. + assignin('base', 'eeglabUpdater', eeglabUpdater); + + % only start timer if the function is called from the command line + % (which means that the stack should only contain one element) + stackVar = dbstack; + if length(stackVar) == 1 + if option_checkversion + eeglabUpdater.checkForNewVersion({'eeglab_event' 'setup'}); + if strcmpi(eeglabVersionNumber, 'dev') + return; + end; + newMajorRevision = 0; + if ~isempty(eeglabUpdater.newMajorRevision) + fprintf('\nA new major version of EEGLAB (EEGLAB%s - beta) is now available.\n', eeglabUpdater.newMajorRevision); + newMajorRevision = 1; + end; + if eeglabUpdater.newerVersionIsAvailable + eeglabv = num2str(eeglabUpdater.latestVersionNumber); + posperiod = find(eeglabv == '.'); + if isempty(posperiod), posperiod = length(eeglabv)+1; eeglabv = [ eeglabv '.0' ]; end; + if length(eeglabv(posperiod+1:end)) < 2, eeglabv = [ eeglabv '0' ]; end; + %if length(eeglabv(posperiod+1:end)) < 3, eeglabv = [ eeglabv '0' ]; end; + eeglabv = [ eeglabv(1:posperiod+1) '.' eeglabv(posperiod+2) ]; %'.' eeglabv(posperiod+3) ]; + + stateWarning = warning('backtrace'); + warning('backtrace', 'off'); + if newMajorRevision + fprintf('\n'); + warning( sprintf(['\nA critical revision of EEGLAB%d (%s) is also available here\n' ... + 'See Release notes for more informations\n' ... + 'You may disable this message using the Option menu\n' ], ... + floor(eeglabVersionNumber), eeglabv, eeglabUpdater.downloadUrl, ... + [ 'http://sccn.ucsd.edu/wiki/EEGLAB_revision_history_version_13' ])); + else + warning( sprintf(['\nA newer version of EEGLAB (%s) is available here\n' ... + 'See Release notes for more informations\n' ... + 'You may disable this message using the Option menu\n' ], ... + eeglabv, eeglabUpdater.downloadUrl, ... + [ 'http://sccn.ucsd.edu/wiki/EEGLAB_revision_history_version_13' ])); + end; + warning('backtrace', stateWarning.state); + + % make the Help menu item dark red + set(help_m, 'foregroundColor', [0.6, 0 0]); + elseif isempty(eeglabUpdater.lastTimeChecked) + fprintf('Could not check for the latest EEGLAB version (internet may be disconnected).\n'); + fprintf('To prevent long startup time, disable checking for new EEGLAB version (FIle > Memory and other options).\n'); + else + if ~newMajorRevision + fprintf('You are using the latest version of EEGLAB.\n'); + else + fprintf('You are currently using the latest revision of EEGLAB%d (no critical update available).\n', floor(eeglabVersionNumber)); + end; + end; + else + eeglabtimers = timerfind('name', 'eeglabupdater'); + if ~isempty(eeglabtimers) + stop(eeglabtimers); + delete(eeglabtimers); + end; + % This is disabled because it cause Matlab to hang in case + % there is no connection or the connection is available but not + % usable + % start(timer('TimerFcn','try, eeglabUpdater.checkForNewVersion({''eeglab_event'' ''setup''}); catch, end; clear eeglabUpdater;', 'name', 'eeglabupdater', 'StartDelay', 20.0)); + end; + end; +catch + if option_checkversion + fprintf('Updater could not be initialized.\n'); + end; +end; + +% REMOVED MENUS + %uimenu( tools_m, 'Label', 'Automatic comp. reject', 'enable', 'off', 'CallBack', '[EEG LASTCOM] = pop_rejcomp(EEG); eegh(LASTCOM); if ~isempty(LASTCOM), eeg_store(CURRENTSET); end;'); + %uimenu( tools_m, 'Label', 'Reject (synthesis)' , 'Separator', 'on', 'CallBack', '[EEG LASTCOM] = pop_rejall(EEG); eegh(LASTCOM); if ~isempty(LASTCOM), eeg_store; end; eeglab(''redraw'');'); + + function command_on_update_menu_click(callerHandle, tmp, eeglabUpdater, installDirectory, goOneFolderLevelIn, backGroundColor) + postInstallCallbackString = 'clear all function functions; eeglab'; + eeglabUpdater.launchGui(installDirectory, goOneFolderLevelIn, backGroundColor, postInstallCallbackString); + +% +% -------------------- +% draw the main figure +% -------------------- + +function tb = eeg_mainfig(onearg); + +icadefs; +COLOR = BACKEEGLABCOLOR; +WINMINX = 17; +WINMAXX = 260; +WINYDEC = 13; +NBLINES = 16; +WINY = WINYDEC*NBLINES; +javaChatFlag = 1; + +BORDERINT = 4; +BORDEREXT = 10; +comp = computer; +if strcmpi(comp(1:3), 'GLN') || strcmpi(comp(1:3), 'MAC') || strcmpi(comp(1:3), 'PCW') + FONTNAME = 'courier'; + FONTSIZE = 8; + % Magnify figure under MATLAB 2012a + vers = version; + dotPos = find(vers == '.'); + vernum = str2num(vers(1:dotPos(1)-1)); + subvernum = str2num(vers(dotPos(1)+1:dotPos(2)-1)); + if vernum > 7 || (vernum >= 7 && subvernum >= 14) + FONTSIZE = FONTSIZE+2; + WINMAXX = WINMAXX*1.3; + WINY = WINY*1.3; + end; +else + FONTNAME = ''; + FONTSIZE = 11; +end; + +hh = findobj('tag', 'EEGLAB'); +if ~isempty(hh) + disp('EEGLAB warning: there can be only one EEGLAB window, closing old one'); + close(hh); +end; +if strcmpi(onearg, 'remote') + figure( 'name', [ 'EEGLAB v' eeg_getversion ], ... + 'numbertitle', 'off', ... + 'Position',[200 100 (WINMINX+WINMAXX+2*BORDERINT+2*BORDEREXT) 30 ], ... + 'color', COLOR, ... + 'Tag','EEGLAB', ... + 'Userdata', {[] []}); + %'resize', 'off', ... + return; +end; + +W_MAIN = figure('Units','points', ... +... % 'Colormap','gray', ... + 'PaperPosition',[18 180 576 432], ... + 'PaperUnits','points', ... + 'name', [ 'EEGLAB v' eeg_getversion ], ... + 'numbertitle', 'off', ... + 'Position',[200 100 (WINMINX+WINMAXX+2*BORDERINT+2*BORDEREXT) (WINY+2*BORDERINT+2*BORDEREXT) ], ... + 'color', COLOR, ... + 'Tag','EEGLAB', ... + 'visible', 'off', ... + 'Userdata', {[] []}); +% 'resize', 'off', ... + +% java chat +eeglab_options; +if option_chat == 1 + if is_sccn + disp('Starting chat...'); + tmpp = fileparts(mywhich('startpane.m')); + if isempty(tmpp) || ~ismatlab + disp('Cannot start chat'); + tb = []; + else + disp(' ----------------------------------- '); + disp('| EEGLAB chat 0.9 |'); + disp('| The chat currently only works |'); + disp('| at the University of CA San Diego |'); + disp(' ----------------------------------- '); + + javaaddpath(fullfile(tmpp, 'Chat_with_pane.jar')); + eval('import client.EEGLABchat.*;'); + eval('import client.VisualToolbar;'); + eval('import java.awt.*;'); + eval('import javax.swing.*;'); + + try + tb = VisualToolbar('137.110.244.26'); + F = W_MAIN; + tb.setPreferredSize(Dimension(0, 75)); + + javacomponent(tb,'South',F); + javaclose = ['userdat = get(gcbf, ''userdata'');' ... + 'try,'... + ' tb = userdat{3};' ... + 'clear userdat; delete(gcbf); tb.close; clear tb;'... + 'catch,end;']; + set(gcf, 'CloseRequestFcn',javaclose); + + refresh(F); + catch, + tb = []; + end; + end; + else + tb = []; + end; +else + tb = []; +end; + +try, + set(W_MAIN, 'NextPlot','new'); +catch, end; + +if ismatlab + BackgroundColor = get(gcf, 'color'); %[0.701960784313725 0.701960784313725 0.701960784313725]; + H_MAIN(1) = uicontrol('Parent',W_MAIN, ... + 'Units','points', ... + 'BackgroundColor',COLOR, ... + 'ListboxTop',0, ... + 'HorizontalAlignment', 'left',... + 'Position',[BORDEREXT BORDEREXT (WINMINX+WINMAXX+2*BORDERINT) (WINY)], ... + 'Style','frame', ... + 'Tag','Frame1'); + set(H_MAIN(1), 'unit', 'normalized'); + geometry = { [1] [1] [1] [1 1] [1 1] [1 1] [1 1] [1 1] [1 1] [1 1] [1 1] [1 1] [1 1] [1 1] [1] }; + listui = { { 'style', 'text', 'string', 'Parameters of the current set', 'tag', 'win0' } { } ... + { 'style', 'text', 'tag', 'win1', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win2', 'string', 'Channels per frame', 'userdata', 'datinfo'} ... + { 'style', 'text', 'tag', 'val2', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win3', 'string', 'Frames per epoch', 'userdata', 'datinfo'} ... + { 'style', 'text', 'tag', 'val3', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win4', 'string', 'Epochs', 'userdata', 'datinfo'} ... + { 'style', 'text', 'tag', 'val4', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win5', 'string', 'Events', 'userdata', 'datinfo'} ... + { 'style', 'text', 'tag', 'val5', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win6', 'string', 'Sampling rate (Hz)', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'val6', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win7', 'string', 'Epoch start (sec)', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'val7', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win8', 'string', 'Epoch end (sec)', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'val8', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win9', 'string', 'Average reference', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'val9', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win10', 'string', 'Channel locations', 'userdata', 'datinfo'} ... + { 'style', 'text', 'tag', 'val10', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win11', 'string', 'ICA weights', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'val11', 'string', ' ', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'win12', 'string', 'Dataset size (Mb)', 'userdata', 'datinfo' } ... + { 'style', 'text', 'tag', 'val12', 'string', ' ', 'userdata', 'datinfo' } {} }; + supergui(gcf, geometry, [], listui{:}); + geometry = { [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] }; + listui = { { } ... + { } ... + { 'style', 'text', 'tag', 'mainwin1', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin2', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin3', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin4', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin5', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin6', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin7', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin8', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin9', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin10', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin11', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin12', 'string', ' ', 'userdata', 'fullline' } ... + { 'style', 'text', 'tag', 'mainwin13', 'string', ' ', 'userdata', 'fullline' } {} }; + supergui(gcf, geometry, [], listui{:}); + + titleh = findobj('parent', gcf, 'tag', 'win0'); + alltexth = findobj('parent', gcf, 'style', 'text'); + alltexth = setdiff_bc(alltexth, titleh); + + set(gcf, 'Position',[200 100 (WINMINX+WINMAXX+2*BORDERINT+2*BORDEREXT) (WINY+2*BORDERINT+2*BORDEREXT) ]); + set(titleh, 'fontsize', 14, 'fontweight', 'bold'); + set(alltexth, 'fontname', FONTNAME, 'fontsize', FONTSIZE); + set(W_MAIN, 'visible', 'on'); +end; + +return; + +% eeglab(''redraw'')() - Update EEGLAB menus based on values of global variables. +% +% Usage: >> eeglab(''redraw'')( ); +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeg_global(), eeglab() + +% WHEN THIS FUNCTION WAS SEPARATED +% Revision 1.21 2002/04/23 19:09:25 arno +% adding automatic dataset search +% Revision 1.20 2002/04/18 20:02:23 arno +% retrIeve +% Revision 1.18 2002/04/18 16:28:28 scott +% EEG.averef printed as 'Yes' or 'No' -sm +% Revision 1.16 2002/04/18 16:03:15 scott +% editted "Events/epoch info (nb) -> Events -sm +% Revision 1.14 2002/04/18 14:46:58 scott +% editted main window help msg -sm +% Revision 1.10 2002/04/18 03:02:17 scott +% edited opening instructions -sm +% Revision 1.9 2002/04/11 18:23:33 arno +% Oups, typo which crashed EEGLAB +% Revision 1.8 2002/04/11 18:07:59 arno +% adding average reference variable +% Revision 1.7 2002/04/11 17:49:40 arno +% corrected operator precedence problem +% Revision 1.6 2002/04/11 15:36:55 scott +% added parentheses to final ( - & - ), line 84. ARNO PLEASE CHECK -sm +% Revision 1.5 2002/04/11 15:34:50 scott +% put isempty(CURRENTSET) first in line ~80 -sm +% Revision 1.4 2002/04/11 15:31:47 scott +% added test isempty(CURRENTSET) line 78 -sm +% Revision 1.3 2002/04/11 01:41:27 arno +% checking dataset ... and inteligent menu update +% Revision 1.2 2002/04/09 20:47:41 arno +% introducing event number into gui + +function updatemenu(); +eeg_global; + +W_MAIN = findobj('tag', 'EEGLAB'); +EEGUSERDAT = get(W_MAIN, 'userdata'); +H_MAIN = EEGUSERDAT{1}; +EEGMENU = EEGUSERDAT{2}; +if length(EEGUSERDAT) > 2 + tb = EEGUSERDAT{3}; +else tb = []; +end; +if ~isempty(tb) && ~isstr(tb) + eval('tb.RefreshToolbar();'); +end; +if exist('CURRENTSET') ~= 1, CURRENTSET = 0; end; +if isempty(ALLEEG), ALLEEG = []; end; +if isempty(EEG), EEG = []; end; + +% test if the menu is present +try + figure(W_MAIN); + set_m = findobj( 'parent', W_MAIN, 'Label', 'Datasets'); +catch, return; end; +index = 1; +indexmenu = 1; +MAX_SET = max(length( ALLEEG ), length(EEGMENU)-1); + +clear functions; +eeglab_options; +if isempty(ALLEEG) && ~isempty(EEG) && ~isempty(EEG.data) + ALLEEG = EEG; +end; + +% setting the dataset menu +% ------------------------ +while( index <= MAX_SET) + try + set( EEGMENU(index), 'Label', '------', 'checked', 'off'); + catch, + if mod(index, 30) == 0 + tag = [ 'More (' int2str(index/30) ') ->' ]; + tmp_m = findobj('label', tag); + if isempty(tmp_m) + set_m = uimenu( set_m, 'Label', tag, 'userdata', 'study:on'); + else set_m = tmp_m; + end; + end; + try + set( EEGMENU(index), 'Label', '------', 'checked', 'off'); + catch, EEGMENU(index) = uimenu( set_m, 'Label', '------', 'Enable', 'on'); end; + end; + set( EEGMENU(index), 'Enable', 'on', 'separator', 'off' ); + try, ALLEEG(index).data; + if ~isempty( ALLEEG(index).data) + + cb_retrieve = [ '[ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET, ''retrieve'', ' int2str(index) ', ''study'', ~isempty(STUDY)+0);' ... + 'if CURRENTSTUDY & ~isempty(LASTCOM), CURRENTSTUDY = 0; LASTCOM = [ ''CURRENTSTUDY = 0;'' LASTCOM ]; end; eegh(LASTCOM);' ... + 'eeglab(''redraw'');' ]; + + menutitle = sprintf('Dataset %d:%s', index, ALLEEG(index).setname); + set( EEGMENU(index), 'Label', menutitle, 'userdata', 'study:on'); + set( EEGMENU(index), 'CallBack', cb_retrieve ); + set( EEGMENU(index), 'Enable', 'on' ); + if any(index == CURRENTSET), set( EEGMENU(index), 'checked', 'on' ); end; + end; + catch, end; + index = index+1; +end; +hh = findobj( 'parent', set_m, 'Label', '------'); +set(hh, 'Enable', 'off'); + +% menu for selecting several datasets +% ----------------------------------- +if index ~= 0 + cb_select = [ 'nonempty = find(~cellfun(''isempty'', { ALLEEG.data } ));' ... + 'tmpind = pop_chansel({ ALLEEG(nonempty).setname }, ''withindex'', nonempty);' ... + 'if ~isempty(tmpind),' ... + ' [ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET, ''retrieve'', nonempty(tmpind), ''study'', ~isempty(STUDY)+0);' ... + ' eegh(LASTCOM);' ... + ' eeglab(''redraw'');' ... + 'end;' ... + 'clear tmpind nonempty;' ]; + if MAX_SET == length(EEGMENU), EEGMENU(end+1) = uimenu( set_m, 'Label', '------', 'Enable', 'on'); end; + + set(EEGMENU(end), 'enable', 'on', 'Label', 'Select multiple datasets', ... + 'callback', cb_select, 'separator', 'on', 'userdata', 'study:on'); +end; + +% STUDY consistency +% ----------------- +exist_study = 0; +if exist('STUDY') & exist('CURRENTSTUDY') + + % if study present, check study consistency with loaded datasets + % -------------------------------------------------------------- + if ~isempty(STUDY) + if length(ALLEEG) > length(STUDY.datasetinfo) || ~isfield(ALLEEG, 'data') || any(cellfun('isempty', {ALLEEG.data})) + if strcmpi(STUDY.saved, 'no') + res = questdlg2( strvcat('The study is not compatible with the datasets present in memory', ... + 'It is self consistent but EEGLAB is not be able to process it.', ... + 'Do you wish to save the study as it is (EEGLAB will prompt you to', ... + 'enter a file name) or do you wish to remove it'), 'Study inconsistency', 'Save and remove', 'Remove', 'Remove' ); + if strcmpi(res, 'Remove') + STUDY = []; + CURRENTSTUDY = 0; + else + pop_savestudy(STUDY, ALLEEG); + STUDY = []; + CURRENTSTUDY = 0; + end; + else + warndlg2( strvcat('The study was not compatible any more with the datasets present in memory.', ... + 'Since it had not changed since last saved, it was simply removed from', ... + 'memory.') ); + STUDY = []; + CURRENTSTUDY = 0; + end; + end; + end; + + if ~isempty(STUDY) + exist_study = 1; + end; +end; + +% menu for selecting STUDY set +% ---------------------------- +if exist_study + cb_select = [ '[ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET, ''retrieve'', [STUDY.datasetinfo.index], ''study'', 1);' ... + 'if ~isempty(LASTCOM), CURRENTSTUDY = 1; LASTCOM = [ LASTCOM ''CURRENTSTUDY = 1;'' ]; end;' ... + 'eegh(LASTCOM);' ... + 'eeglab(''redraw'');' ]; + tmp_m = findobj('label', 'Select the study set'); + delete(tmp_m); % in case it is not at the end + tmp_m = uimenu( set_m, 'Label', 'Select the study set', 'Enable', 'on', 'userdata', 'study:on'); + set(tmp_m, 'enable', 'on', 'callback', cb_select, 'separator', 'on'); +else + delete( findobj('label', 'Select the study set') ); +end; + +EEGUSERDAT{2} = EEGMENU; +set(W_MAIN, 'userdata', EEGUSERDAT); + +if (isempty(CURRENTSET) | length(ALLEEG) < CURRENTSET(1) | CURRENTSET(1) == 0 | isempty(ALLEEG(CURRENTSET(1)).data)) + CURRENTSET = 0; + for index = 1:length(ALLEEG) + if ~isempty(ALLEEG(index).data) + CURRENTSET = index; + break; + end; + end; + if CURRENTSET ~= 0 + eegh([ '[EEG ALLEEG CURRENTSET] = eeg_retrieve(ALLEEG,' int2str(CURRENTSET) ');' ]) + [EEG ALLEEG] = eeg_retrieve(ALLEEG, CURRENTSET); + else + EEG = eeg_emptyset; + end; +end; + +if (isempty(EEG) | isempty(EEG(1).data)) & CURRENTSET(1) ~= 0 + eegh([ '[EEG ALLEEG CURRENTSET] = eeg_retrieve(ALLEEG,' int2str(CURRENTSET) ');' ]) + [EEG ALLEEG] = eeg_retrieve(ALLEEG, CURRENTSET); +end; + +% test if dataset has changed +% --------------------------- +if length(EEG) == 1 + if ~isempty(ALLEEG) & CURRENTSET~= 0 & ~isequal(EEG.data, ALLEEG(CURRENTSET).data) & ~isnan(EEG.data(1)) + % the above comparison does not work for ome structures + %tmpanswer = questdlg2(strvcat('The current EEG dataset has changed. What should eeglab do with the changes?', ' '), ... + % 'Dataset change detected', ... + % 'Keep changes', 'Delete changes', 'New dataset', 'Make new dataset'); + disp('Warning: for some reason, the backup dataset in EEGLAB memory does not'); + disp(' match the current dataset. The dataset in memory has been overwritten'); + [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + eegh('[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);'); + + %if tmpanswer(1) == 'D' % delete changes + % [EEG ALLEEG] = eeg_retrieve(ALLEEG, CURRENTSET); + % eegh('[EEG ALLEEG] = eeg_retrieve( ALLEEG, CURRENTSET);'); + %elseif tmpanswer(1) == 'K' % keep changes + % [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + % eegh('[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);'); + %else % make new dataset + % [ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET); + % eegh(LASTCOM); + % MAX_SET = max(length( ALLEEG ), length(EEGMENU)); + %end; + end; +end; + +% print some information on the main figure +% ------------------------------------------ +g = myguihandles(gcf); +if ~isfield(g, 'win0') % no display + return; +end; + +study_selected = 0; +if exist('STUDY') & exist('CURRENTSTUDY') + if CURRENTSTUDY == 1, study_selected = 1; end; +end; + +menustatus = {}; +if study_selected + menustatus = { menustatus{:} 'study' }; + + hh = findobj('parent', gcf, 'userdata', 'fullline'); set(hh, 'visible', 'off'); + hh = findobj('parent', gcf, 'userdata', 'datinfo'); set(hh, 'visible', 'on'); + + % head string + % ----------- + set( g.win0, 'String', sprintf('STUDY set: %s', STUDY.name) ); + + % dataset type + % ------------ + datasettype = unique_bc( [ EEG.trials ] ); + if datasettype(1) == 1 & length(datasettype) == 1, datasettype = 'continuous'; + elseif datasettype(1) == 1, datasettype = 'epoched and continuous'; + else datasettype = 'epoched'; + end; + + % number of channels and channel locations + % ---------------------------------------- + chanlen = unique_bc( [ EEG.nbchan ] ); + chanlenstr = vararg2str( mattocell(chanlen) ); + anyempty = unique_bc( cellfun( 'isempty', { EEG.chanlocs }) ); + if length(anyempty) == 2, chanlocs = 'mixed, yes and no'; + elseif anyempty == 0, chanlocs = 'yes'; + else chanlocs = 'no'; + end; + + % ica weights + % ----------- + anyempty = unique_bc( cellfun( 'isempty', { EEG.icaweights }) ); + if length(anyempty) == 2, studystatus = 'Missing ICA dec.'; + elseif anyempty == 0, studystatus = 'Ready to precluster'; + else studystatus = 'Missing ICA dec.'; + end; + + % consistency & other parameters + % ------------------------------ + [EEG epochconsist] = eeg_checkset(EEG, 'epochconsist'); % epoch consistency + [EEG chanconsist ] = eeg_checkset(EEG, 'chanconsist'); % channel consistency + [EEG icaconsist ] = eeg_checkset(EEG, 'icaconsist'); % ICA consistency + totevents = num2str(sum( cellfun( 'length', { EEG.event }) )); % total number of events + totsize = whos('STUDY', 'ALLEEG'); % total size + if isempty(STUDY.session), sessionstr = ''; else sessionstr = vararg2str(STUDY.session); end; + if isempty(STUDY.condition), condstr = ''; else condstr = vararg2str(STUDY.condition); end; + + % determine study status + % ---------------------- + if isfield(STUDY.etc, 'preclust') + if ~isempty( STUDY.etc.preclust ) + studystatus = 'Pre-clustered'; + elseif length(STUDY.cluster) > 1 + studystatus = 'Clustered'; + end; + elseif length(STUDY.cluster) > 1 + studystatus = 'Clustered'; + end; + + % text + % ---- + set( g.win2, 'String', 'Study task name'); + set( g.win3, 'String', 'Nb of subjects'); + set( g.win4, 'String', 'Nb of conditions'); + set( g.win5, 'String', 'Nb of sessions'); + set( g.win6, 'String', 'Nb of groups'); + set( g.win7, 'String', 'Epoch consistency'); + set( g.win8, 'String', 'Channels per frame'); + set( g.win9, 'String', 'Channel locations'); + set( g.win10, 'String', 'Clusters'); + set( g.win11, 'String', 'Status'); + set( g.win12, 'String', 'Total size (Mb)'); + + % values + % ------ + fullfilename = fullfile( STUDY.filepath, STUDY.filename); + if length(fullfilename) > 26 + set( g.win1, 'String', sprintf('Study filename: ...%s\n', fullfilename(max(1,length(fullfilename)-26):end) )); + else + set( g.win1, 'String', sprintf('Study filename: %s\n' , fullfilename)); + end; + condconsist = std_checkconsist(STUDY, 'uniform', 'condition'); + groupconsist = std_checkconsist(STUDY, 'uniform', 'group'); + sessconsist = std_checkconsist(STUDY, 'uniform', 'session'); + txtcond = fastif(condconsist , ' per subject', ' (some missing)'); + txtgroup = fastif(groupconsist, ' per subject', ' (some missing)'); + txtsess = fastif(sessconsist , ' per subject', ' (some missing)'); + set( g.val2, 'String', STUDY.task); + set( g.val3, 'String', int2str(max(1, length(STUDY.subject)))); + set( g.val4, 'String', [ int2str(max(1, length(STUDY.condition))) txtcond ]); + set( g.val5, 'String', [ int2str(max(1, length(STUDY.session))) txtsess ]); + set( g.val6, 'String', [ int2str(max(1, length(STUDY.group))) txtgroup ]); + set( g.val7, 'String', epochconsist); + set( g.val8, 'String', chanlenstr); + set( g.val9, 'String', chanlocs); + set( g.val10, 'String', length(STUDY.cluster)); + set( g.val11, 'String', studystatus); + set( g.val12, 'String', num2str(round(sum( [ totsize.bytes] )/1E6*10)/10)); + +elseif (exist('EEG') == 1) & ~isnumeric(EEG) & ~isempty(EEG(1).data) + + hh = findobj('parent', gcf, 'userdata', 'fullline'); set(hh, 'visible', 'off'); + hh = findobj('parent', gcf, 'userdata', 'datinfo'); set(hh, 'visible', 'on'); + + if length(EEG) > 1 % several datasets + + menustatus = { menustatus{:} 'multiple_datasets' }; + + % head string + % ----------- + strsetnum = 'Datasets '; + for i = CURRENTSET + strsetnum = [ strsetnum int2str(i) ',' ]; + end; + strsetnum = strsetnum(1:end-1); + set( g.win0, 'String', strsetnum); + + % dataset type + % ------------ + datasettype = unique_bc( [ EEG.trials ] ); + if datasettype(1) == 1 & length(datasettype) == 1, datasettype = 'continuous'; + elseif datasettype(1) == 1, datasettype = 'epoched and continuous'; + else datasettype = 'epoched'; + end; + + % number of channels and channel locations + % ---------------------------------------- + chanlen = unique_bc( [ EEG.nbchan ] ); + chanlenstr = vararg2str( mattocell(chanlen) ); + anyempty = unique_bc( cellfun( 'isempty', { EEG.chanlocs }) ); + if length(anyempty) == 2, chanlocs = 'mixed, yes and no'; + elseif anyempty == 0, chanlocs = 'yes'; + else chanlocs = 'no'; + end; + + % ica weights + % ----------- + anyempty = unique_bc( cellfun( 'isempty', { EEG.icaweights }) ); + if length(anyempty) == 2, icaweights = 'mixed, yes and no'; + elseif anyempty == 0, icaweights = 'yes'; + else icaweights = 'no'; + end; + + % consistency & other parameters + % ------------------------------ + [EEG epochconsist] = eeg_checkset(EEG, 'epochconsist'); % epoch consistency + [EEG chanconsist ] = eeg_checkset(EEG, 'chanconsist'); % channel consistency + [EEG icaconsist ] = eeg_checkset(EEG, 'icaconsist'); % ICA consistency + totevents = num2str(sum( cellfun( 'length', { EEG.event }) )); % total number of events + srate = vararg2str( mattocell( unique( [ EEG.srate ] ) )); % sampling rate + totsize = whos('EEG'); % total size + + % text + % ---- + set( g.win2, 'String', 'Number of datasets'); + set( g.win3, 'String', 'Dataset type'); + set( g.win4, 'String', 'Epoch consistency'); + set( g.win5, 'String', 'Channels per frame'); + set( g.win6, 'String', 'Channel consistency'); + set( g.win7, 'String', 'Channel locations'); + set( g.win8, 'String', 'Events (total)'); + set( g.win9, 'String', 'Sampling rate (Hz)'); + set( g.win10, 'String', 'ICA weights'); + set( g.win11, 'String', 'Identical ICA'); + set( g.win12, 'String', 'Total size (Mb)'); + + % values + % ------ + set( g.win1, 'String', sprintf('Groupname: -(soon)-\n')); + set( g.val2, 'String', int2str(length(EEG))); + set( g.val3, 'String', datasettype); + set( g.val4, 'String', epochconsist); + set( g.val5, 'String', chanlenstr); + set( g.val6, 'String', chanconsist); + set( g.val7, 'String', chanlocs); + set( g.val8, 'String', totevents); + set( g.val9, 'String', srate); + set( g.val10, 'String', icaweights); + set( g.val11, 'String', icaconsist); + set( g.val12, 'String', num2str(round(totsize.bytes/1E6*10)/10)); + + else % one continous dataset selected + + menustatus = { menustatus{:} 'continuous_dataset' }; + + % text + % ---- + set( g.win2, 'String', 'Channels per frame'); + set( g.win3, 'String', 'Frames per epoch'); + set( g.win4, 'String', 'Epochs'); + set( g.win5, 'String', 'Events'); + set( g.win6, 'String', 'Sampling rate (Hz)'); + set( g.win7, 'String', 'Epoch start (sec)'); + set( g.win8, 'String', 'Epoch end (sec)'); + set( g.win9, 'String', 'Reference'); + set( g.win10, 'String', 'Channel locations'); + set( g.win11, 'String', 'ICA weights'); + set( g.win12, 'String', 'Dataset size (Mb)'); + + if CURRENTSET == 0, strsetnum = ''; + else strsetnum = ['#' int2str(CURRENTSET) ': ']; + end; + maxchar = 28; + if ~isempty( EEG.setname ) + if length(EEG.setname) > maxchar+2 + set( g.win0, 'String', [strsetnum EEG.setname(1:min(maxchar,length(EEG.setname))) '...' ]); + else set( g.win0, 'String', [strsetnum EEG.setname ]); + end; + else + set( g.win0, 'String', [strsetnum '(no dataset name)' ] ); + end; + + fullfilename = fullfile(EEG.filepath, EEG.filename); + if ~isempty(fullfilename) + if length(fullfilename) > 26 + set( g.win1, 'String', sprintf('Filename: ...%s\n', fullfilename(max(1,length(fullfilename)-26):end) )); + else + set( g.win1, 'String', sprintf('Filename: %s\n', fullfilename)); + end; + else + set( g.win1, 'String', sprintf('Filename: none\n')); + end; + + set( g.val2, 'String', int2str(fastif(isempty(EEG.data), 0, size(EEG.data,1)))); + set( g.val3, 'String', int2str(EEG.pnts)); + set( g.val4, 'String', int2str(EEG.trials)); + set( g.val5, 'String', fastif(isempty(EEG.event), 'none', int2str(length(EEG.event)))); + set( g.val6, 'String', int2str( round(EEG.srate)) ); + if round(EEG.xmin) == EEG.xmin & round(EEG.xmax) == EEG.xmax + set( g.val7, 'String', sprintf('%d\n', EEG.xmin)); + set( g.val8, 'String', sprintf('%d\n', EEG.xmax)); + else + set( g.val7, 'String', sprintf('%6.3f\n', EEG.xmin)); + set( g.val8, 'String', sprintf('%6.3f\n', EEG.xmax)); + end; + + % reference + if isfield(EEG(1).chanlocs, 'ref') + [curref tmp allinds] = unique_bc( { EEG(1).chanlocs.ref }); + maxind = 1; + for ind = unique_bc(allinds) + if length(find(allinds == ind)) > length(find(allinds == maxind)) + maxind = ind; + end; + end; + curref = curref{maxind}; + if isempty(curref), curref = 'unknown'; end; + else curref = 'unknown'; + end; + set( g.val9, 'String', curref); + if isempty(EEG.chanlocs) + set( g.val10, 'String', 'No'); + else + if ~isfield(EEG.chanlocs, 'theta') | all(cellfun('isempty', { EEG.chanlocs.theta })) + set( g.val10, 'String', 'No (labels only)'); + else + set( g.val10, 'String', 'Yes'); + end; + end; + + set( g.val11, 'String', fastif(isempty(EEG.icasphere), 'No', 'Yes')); + tmp = whos('EEG'); + if ~isa(EEG.data, 'memmapdata') && ~isa(EEG.data, 'mmo') + set( g.val12, 'String', num2str(round(tmp.bytes/1E6*10)/10)); + else + set( g.val12, 'String', [ num2str(round(tmp.bytes/1E6*10)/10) ' (file mapped)' ]); + end; + + if EEG.trials > 1 + menustatus = { menustatus{:} 'epoched_dataset' }; + else + menustatus = { menustatus{:} 'continuous_dataset' }; + end + if ~isfield(EEG.chanlocs, 'theta') + menustatus = { menustatus{:} 'chanloc_absent' }; + end; + if isempty(EEG.icaweights) + menustatus = { menustatus{:} 'ica_absent' }; + end; + end; +else + menustatus = { menustatus{:} 'startup' }; + + hh = findobj('parent', gcf, 'userdata', 'fullline'); set(hh, 'visible', 'on'); + hh = findobj('parent', gcf, 'userdata', 'datinfo'); set(hh, 'visible', 'off'); + set( g.win0, 'String', 'No current dataset'); + set( g.mainwin1, 'String', '- Create a new or load an existing dataset:'); + set( g.mainwin2, 'String', ' Use "File > Import data" (new)'); + set( g.mainwin3, 'String', ' Or "File > Load existing dataset" (old)'); + set( g.mainwin4, 'String', '- If new,'); + set( g.mainwin5, 'String', ' "File > Import epoch info" (data epochs) else'); + set( g.mainwin6, 'String', ' "File > Import event info" (continuous data)'); + set( g.mainwin7, 'String', ' "Edit > Dataset info" (add/edit dataset info)'); + set( g.mainwin8, 'String', ' "File > Save dataset" (save dataset)'); + set( g.mainwin9, 'String', '- Prune data: "Edit > Select data"'); + set( g.mainwin10,'String', '- Reject data: "Tools > Reject continuous data"'); + set( g.mainwin11,'String', '- Epoch data: "Tools > Extract epochs"'); + set( g.mainwin12,'String', '- Remove baseline: "Tools > Remove baseline"'); + set( g.mainwin13,'String', '- Run ICA: "Tools > Run ICA"'); +end; + +% ERPLAB +if exist('ALLERP') == 1 && ~isempty(ALLERP) + menustatus = { menustatus{:} 'erp_dataset' }; +end; + +% enable selected menu items +% -------------------------- +allmenus = findobj( W_MAIN, 'type', 'uimenu'); +allstrs = get(allmenus, 'userdata'); +if any(strcmp(menustatus, 'startup')) + + set(allmenus, 'enable', 'on'); + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''startup:off''))), allstrs);'); + set(allmenus(indmatchvar), 'enable', 'off'); + +elseif any(strcmp(menustatus, 'study')) + + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''study:on''))), allstrs);'); + set(allmenus , 'enable', 'off'); + set(allmenus(indmatchvar), 'enable', 'on'); + +elseif any(strcmp(menustatus, 'multiple_datasets')) + + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''study:on''))), allstrs);'); + set(allmenus , 'enable', 'off'); + set(allmenus(indmatchvar), 'enable', 'on'); + set(findobj('parent', W_MAIN, 'label', 'Study'), 'enable', 'off'); + +% -------------------------------- +% Javier Lopez-Calderon for ERPLAB +elseif any(strcmp(menustatus, 'epoched_dataset')) + + set(allmenus, 'enable', 'on'); + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''epoch:off''))), allstrs);'); + set(allmenus(indmatchvar), 'enable', 'off'); +% end, Javier Lopez-Calderon for ERPLAB +% -------------------------------- +elseif any(strcmp(menustatus, 'continuous_dataset')) + + set(allmenus, 'enable', 'on'); + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''continuous:off''))), allstrs);'); + set(allmenus(indmatchvar), 'enable', 'off'); + + +end; +if any(strcmp(menustatus, 'chanloc_absent')) + + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''chanloc:on''))), allstrs);'); + set(allmenus(indmatchvar), 'enable', 'off'); + +end; +if any(strcmp(menustatus, 'ica_absent')) + + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''ica:on''))), allstrs);'); + set(allmenus(indmatchvar), 'enable', 'off'); + +end; + +% -------------------------------- +% Javier Lopez-Calderon for ERPLAB +if any(strcmp(menustatus, 'erp_dataset')) + eval('indmatchvar = cellfun(@(x)(~isempty(findstr(num2str(x), ''erpset:on''))), allstrs);'); + set(allmenus(indmatchvar), 'enable', 'on'); +end +% end, Javier Lopez-Calderon for ERPLAB +% -------------------------------- + + +% adjust title extent +% ------------------- +poswin0 = get(g.win0, 'position'); +extwin0 = get(g.win0, 'extent'); +set(g.win0, 'position', [poswin0(1:2) extwin0(3) extwin0(4)]); + +% adjust all font sizes (RMC fix MATLAB 2014 compatibility) +% ------------------- +handlesname = fieldnames(g); +for i = 1:length(handlesname) + if isprop(eval(['g.' handlesname{i}]),'Style') & ~strcmp(handlesname{i},'win0') + propval = get(eval(['g.' handlesname{i}]), 'Style'); + if strcmp(propval,'text') + set(eval(['g.' handlesname{i}]),'FontSize',TEXT_FONTSIZE); + end + end +end + +return; + +function num = popask( text ) + ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); + switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; + end; + +function g = myguihandles(fig) + g = []; + hh = findobj('parent', gcf); + for index = 1:length(hh) + if ~isempty(get(hh(index), 'tag')) + g = setfield(g, get(hh(index), 'tag'), hh(index)); + end; + end; + + +function rmpathifpresent(newpath); + comp = computer; + if strcmpi(comp(1:2), 'PC') + newpath = [ newpath ';' ]; + else + newpath = [ newpath ':' ]; + end; + if ismatlab + p = matlabpath; + else p = path; + end; + ind = strfind(p, newpath); + if ~isempty(ind) + rmpath(newpath); + end; + +% add path only if it is not already in the list +% ---------------------------------------------- +function addpathifnotinlist(newpath); + + comp = computer; + if strcmpi(comp(1:2), 'PC') + newpathtest = [ newpath ';' ]; + else + newpathtest = [ newpath ':' ]; + end; + if ismatlab + p = matlabpath; + else p = path; + end; + ind = strfind(p, newpathtest); + if isempty(ind) + if exist(newpath) == 7 + addpath(newpath); + end; + end; + +function addpathifnotexist(newpath, functionname); + tmpp = mywhich(functionname); + + if isempty(tmpp) + addpath(newpath); + end; + +% find a function path and add path if not present +% ------------------------------------------------ +function myaddpath(eeglabpath, functionname, pathtoadd); + + tmpp = mywhich(functionname); + tmpnewpath = [ eeglabpath pathtoadd ]; + if ~isempty(tmpp) + tmpp = tmpp(1:end-length(functionname)); + if length(tmpp) > length(tmpnewpath), tmpp = tmpp(1:end-1); end; % remove trailing filesep + if length(tmpp) > length(tmpnewpath), tmpp = tmpp(1:end-1); end; % remove trailing filesep + %disp([ tmpp ' | ' tmpnewpath '(' num2str(~strcmpi(tmpnewpath, tmpp)) ')' ]); + if ~strcmpi(tmpnewpath, tmpp) + warning('off', 'MATLAB:dispatcher:nameConflict'); + addpath(tmpnewpath); + warning('on', 'MATLAB:dispatcher:nameConflict'); + end; + else + %disp([ 'Adding new path ' tmpnewpath ]); + addpathifnotinlist(tmpnewpath); + end; + +function val = iseeglabdeployed2; +%val = 1; return; +if exist('isdeployed') + val = isdeployed; +else val = 0; +end; + +function buildhelpmenu; + +% parse plugin function name +% -------------------------- +function [name, vers] = parsepluginname(dirName); + ind = find( dirName >= '0' & dirName <= '9' ); + if isempty(ind) + name = dirName; + vers = ''; + else + ind = length(dirName); + while ind > 0 && ((dirName(ind) >= '0' & dirName(ind) <= '9') || dirName(ind) == '.' || dirName(ind) == '_') + ind = ind - 1; + end; + name = dirName(1:ind); + vers = dirName(ind+1:end); + vers(find(vers == '_')) = '.'; + end; + +% required here because path not added yet +% to the admin folder +function res = ismatlab; + +v = version; +if v(1) > '4' + res = 1; +else + res = 0; +end; + +function res = mywhich(varargin); +try + res = which(varargin{:}); +catch + fprintf('Warning: permission error accesssing %s\n', varargin{1}); +end; + \ No newline at end of file diff --git a/code/eeglab13_4_4b/eeglablicense.txt b/code/eeglab13_4_4b/eeglablicense.txt new file mode 100644 index 0000000..2718c87 --- /dev/null +++ b/code/eeglab13_4_4b/eeglablicense.txt @@ -0,0 +1,236 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + ADDITIONAL NOTE + +EEGLAB is designed and distributed for research purposes only. EEGLAB should +not be used for medical purposes. The authors accept no responsibility for its +use in this manner. diff --git a/code/eeglab13_4_4b/external/README.txt b/code/eeglab13_4_4b/external/README.txt new file mode 100644 index 0000000..2a2aab5 --- /dev/null +++ b/code/eeglab13_4_4b/external/README.txt @@ -0,0 +1,7 @@ +This folder use to contain modules external to EEGLAB +Now all external modules are treated as EEGLAB extensions +and this folder is not longer needed. + +This folder will be removed in subsequent EEGLAB releases. + +A. Delorme - Nov 30, 2013 diff --git a/code/eeglab13_4_4b/functions/@eegobj/display.m b/code/eeglab13_4_4b/functions/@eegobj/display.m new file mode 100644 index 0000000..c997c67 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/display.m @@ -0,0 +1,16 @@ +function display(this); + + disp(inputname(1)); + if length(this) == 1 + struct(this.EEG) + else + TMP = struct(this); + + TMP2 = TMP(1).EEG; + fieldorder = fieldnames(TMP2); + for index = 2:length(TMP) + TMP2(index) = orderfields(TMP(index).EEG, fieldorder); + end; + TMP2 + end; + diff --git a/code/eeglab13_4_4b/functions/@eegobj/eegobj.m b/code/eeglab13_4_4b/functions/@eegobj/eegobj.m new file mode 100644 index 0000000..7f3ad61 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/eegobj.m @@ -0,0 +1,14 @@ +function this = eegobj(EEG); + + if nargin == 1 + if isa(EEG, 'eegobj') + this = EEG; + return; + end; + for index = 1:length(EEG) + TMP(index).EEG = EEG(index); + end; + else + TMP.EEG = eeg_emptyset; + end; + this = class(TMP, 'eegobj'); diff --git a/code/eeglab13_4_4b/functions/@eegobj/fieldnames.m b/code/eeglab13_4_4b/functions/@eegobj/fieldnames.m new file mode 100644 index 0000000..ca2a00a --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/fieldnames.m @@ -0,0 +1,3 @@ +function res = fieldnames(this); + + res = fieldnames(this(1).EEG); diff --git a/code/eeglab13_4_4b/functions/@eegobj/horzcat2.m b/code/eeglab13_4_4b/functions/@eegobj/horzcat2.m new file mode 100644 index 0000000..51b051b --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/horzcat2.m @@ -0,0 +1,5 @@ +function this = horzcat(varargin); + this = varargin{1}; + for index = 2:length(varargin) + this.EEG(index) = varargin{index}.EEG; + end; diff --git a/code/eeglab13_4_4b/functions/@eegobj/isfield.m b/code/eeglab13_4_4b/functions/@eegobj/isfield.m new file mode 100644 index 0000000..1341b8e --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/isfield.m @@ -0,0 +1,3 @@ +function res = isfield(this, vals); + + res = isfield(struct(this(1).EEG), vals); diff --git a/code/eeglab13_4_4b/functions/@eegobj/isstruct.m b/code/eeglab13_4_4b/functions/@eegobj/isstruct.m new file mode 100644 index 0000000..05cc0cf --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/isstruct.m @@ -0,0 +1,3 @@ +function res = isstruct(this); + + res = 1; diff --git a/code/eeglab13_4_4b/functions/@eegobj/length.m b/code/eeglab13_4_4b/functions/@eegobj/length.m new file mode 100644 index 0000000..08943fe --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/length.m @@ -0,0 +1,14 @@ +function res = length(this); + + tmp = struct(this); + %if any(cellfun(@length, { tmp.EEG }) > 1) + % error('EEG structure in object with more than 1 element') + %end; + try + res = length(tmp.EEG); + catch + res = length(tmp); + return; + end; + if res > 1, error('EEG structure in object with more than 1 element'); end; + res = length(tmp); diff --git a/code/eeglab13_4_4b/functions/@eegobj/orderfields.m b/code/eeglab13_4_4b/functions/@eegobj/orderfields.m new file mode 100644 index 0000000..ce9da6a --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/orderfields.m @@ -0,0 +1,5 @@ +function this = orderfields(this, vals); + + for index = 1:length(this) + this(index).EEG = orderfields(this(index).EEG, vals); + end; diff --git a/code/eeglab13_4_4b/functions/@eegobj/rmfield.m b/code/eeglab13_4_4b/functions/@eegobj/rmfield.m new file mode 100644 index 0000000..4ce7320 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/rmfield.m @@ -0,0 +1,4 @@ +function this = rmfield(this, vals); + + this.EEG = rmfield(this.EEG, vals); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@eegobj/simpletest.m b/code/eeglab13_4_4b/functions/@eegobj/simpletest.m new file mode 100644 index 0000000..ace35dc --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/simpletest.m @@ -0,0 +1,4 @@ +% simple dataset tests +p = fileparts(which('eeglab')); +EEG = pop_loadset('filename','eeglab_data_epochs_ica.set','filepath',fullfile(p, 'sample_data')); + diff --git a/code/eeglab13_4_4b/functions/@eegobj/subsasgn.m b/code/eeglab13_4_4b/functions/@eegobj/subsasgn.m new file mode 100644 index 0000000..18ec5c9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/subsasgn.m @@ -0,0 +1,68 @@ +function this = subsasgn(this,index,c) + + if isempty(this) + this = eegobj; + end; + + % mulitple dataset + if strcmpi(index(1).type, '()') && length(index) == 1 % dataset assignement + if isempty(c) % suppression + this(index.subs{1}) = []; + else + % create empty structures if necessary + % not optimized for speed but compatible Octave 3.4 and Matlab + allfieldsori = fieldnames( this ); + allSetIndices = [ [(length(this)+1):(min(index.subs{1})-1)] index.subs{1} ]; + this(max(index.subs{1})) = this(1); + for j = 1:length(allfieldsori) + for i = allSetIndices + this(i).EEG.(allfieldsori{j}) = []; + end; + end; + + % create empty structure, replaces the code above but + % only compatible under Matlab + %allfieldsori = fieldnames( this ); + %tmpfields = allfieldsori; + %tmpfields(:,2) = cell(size(tmpfields)); + %tmpfields = tmpfields'; + %tmp = struct(tmpfields{:}) + %this(index.subs{1}) = tmp; + + % dealing with input object and making it a compatible + % structure + if isa(c, 'eegobj') + c2 = struct(c); + c = c2(1).EEG; + fieldorder = fieldnames(c); + for cIndexe = 2:length(c2) + c(cIndexe) = orderfields(c2(cIndexe).EEG, fieldorder); + end; + end; + + allfields = fieldnames( c ); + for i=1:length( allfields ) + for j = 1:length(index.subs{1}) + this(index.subs{1}(j)).EEG.(allfields{i}) = c(min(j, length(c))).(allfields{i}); + end; + %this(index.subs(1)).EEG = setfield(this(index.subs(1)).EEG, getfield(c, allfields{i}), allfields{i}); + %eval( ['this(' int2str(index.subs{1}) ').' allfields{i} ' = c.' allfields{i} ';' ]); + end; + %if ~isfield(c, 'datfile') & isfield(this, 'datfile') + % this(index.subs{1}).datfile = ''; + %end; + end; + elseif strcmpi(index(1).type, '()') + if length(index(1).subs{1}) > 1 + error('Unsuported object feature - a.field or a([x y]).field is not supported for object arrays'); + elseif length(this) < index(1).subs{1} + this(index(1).subs{1}) = eegobj; + end; + this(index(1).subs{1}).EEG = builtin('subsasgn', this(index(1).subs{1}).EEG, index(2:end), c); + elseif strcmpi(index(1).type, '.') + if length(this) > 1 + error('Unsuported object feature - a.field or a([x y]).field is not supported for object arrays'); + else + this.EEG = builtin('subsasgn', this.EEG, index, c); + end; + end; diff --git a/code/eeglab13_4_4b/functions/@eegobj/subsref.m b/code/eeglab13_4_4b/functions/@eegobj/subsref.m new file mode 100644 index 0000000..d4ba37c --- /dev/null +++ b/code/eeglab13_4_4b/functions/@eegobj/subsref.m @@ -0,0 +1,45 @@ +function varargout = subsref(this,s) + +if strcmpi(s(1).type, '()') && length(this) > 1 + %if length(s(1).subs{1}) + % error('Unsuported object feature - a.field or a([x y]).field is not supported for object arrays'); + %end; + +% if length(s) == 1 +% b = this(s(1).subs{1}); +% else +% b = builtin('subsref', this(s(1).subs{1}).EEG, s(2:end)); +% end; + + if length(s) == 1 + varargout{1} = this(s(1).subs{1}); + elseif length(s(1).subs{1}) > 1 + for index = 1:length(s(1).subs{1}) + varargout{1}{index} = builtin('subsref', this(s(1).subs{1}(index)).EEG, s(2:end)); + end; + else + varargout{1} = builtin('subsref', this(s(1).subs{1}).EEG, s(2:end)); + end; +elseif strcmpi(s(1).type, '.') && length(this) > 1 + for index = 1:length(this) + varargout{index} = builtin('subsref', this(index).EEG, s); + end; + %if length(s) > 1 && iscell(s(2).subs) && length(s(2).subs{1}) + % error('Unsuported object feature - a.field or a([x y]).field is not supported for object arrays'); + %end; +else + varargout{1} = builtin('subsref', this.EEG, s); +end; + + +% return; +% +% % SUBSREF +% switch s.type +% case '()' +% b = getfield(a.rawbit, s.subs); +% case '.' +% b = getfield(struct(a), s.subs); +% otherwise +% error('Wrong class argument') +% end diff --git a/code/eeglab13_4_4b/functions/@memmapdata/display.m b/code/eeglab13_4_4b/functions/@memmapdata/display.m new file mode 100644 index 0000000..fc815ae --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/display.m @@ -0,0 +1,36 @@ +% display() - display an EEG data class underlying structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function b = display(a) + + i.type = '()'; + i.subs = { ':' ':' ':' }; + b = subsref(a, i); % note that subsref cannot be called directly + return; + + + %struct(a) + %return; + + if ~strcmpi(a.fileformat, 'transposed') + a.data.data.x; + else + permute(a, [3 1 2]); + end; diff --git a/code/eeglab13_4_4b/functions/@memmapdata/double.m b/code/eeglab13_4_4b/functions/@memmapdata/double.m new file mode 100644 index 0000000..36031d5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/double.m @@ -0,0 +1,3 @@ +function res = double(a); + +res = double(a.data.data.x); \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@memmapdata/end.m b/code/eeglab13_4_4b/functions/@memmapdata/end.m new file mode 100644 index 0000000..2e726d4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/end.m @@ -0,0 +1,23 @@ +% end() - last index to memmapdata array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function s = end(a, k, n); + + s = size(a, k); diff --git a/code/eeglab13_4_4b/functions/@memmapdata/isnumeric.m b/code/eeglab13_4_4b/functions/@memmapdata/isnumeric.m new file mode 100644 index 0000000..ffd3d74 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/isnumeric.m @@ -0,0 +1,23 @@ +% isnumeric() - returns 1 +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function r = isnumeric(a) + + r = 1; diff --git a/code/eeglab13_4_4b/functions/@memmapdata/length.m b/code/eeglab13_4_4b/functions/@memmapdata/length.m new file mode 100644 index 0000000..e8a3250 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/length.m @@ -0,0 +1,23 @@ +% length() - length of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function s = length(a) + + s = size(a,1); diff --git a/code/eeglab13_4_4b/functions/@memmapdata/memmapdata.m b/code/eeglab13_4_4b/functions/@memmapdata/memmapdata.m new file mode 100644 index 0000000..f7b22ef --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/memmapdata.m @@ -0,0 +1,58 @@ +% memmapdata() - create a memory-mapped data class +% +% Usage: +% >> data_class = memmapdata(data); +% +% Inputs: +% data - input data or data file +% +% Outputs: +% data_class - output dataset class +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function dataout = memmapdata(data, datadims); + + dataout.fileformat = 'normal'; + if isstr(data) + if length(data) > 3 + if strcmpi('.dat', data(end-3:end)) + dataout.fileformat = 'transposed'; + end; + end; + + % check that the file is not empty + % -------------------------------- + a = dir(data); + if isempty(a) + error([ 'Data file ''' data '''not found' ]); + elseif a(1).bytes == 0 + error([ 'Empty data file ''' data '''' ]); + end; + + if ~strcmpi(dataout.fileformat, 'transposed') + dataout.data = memmapfile(data, 'writable', false, 'format', { 'single' datadims 'x' }); + else + dataout.data = memmapfile(data, 'writable', false, 'format', { 'single' [ datadims(2:end) datadims(1) ] 'x' }); + end; + dataout = class(dataout,'memmapdata'); + else + dataout = data; + end; + diff --git a/code/eeglab13_4_4b/functions/@memmapdata/msize.m b/code/eeglab13_4_4b/functions/@memmapdata/msize.m new file mode 100644 index 0000000..8c4210f --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/msize.m @@ -0,0 +1,3 @@ +function s = msize(a); + + asdfdsa; diff --git a/code/eeglab13_4_4b/functions/@memmapdata/ndims.m b/code/eeglab13_4_4b/functions/@memmapdata/ndims.m new file mode 100644 index 0000000..f77b01c --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/ndims.m @@ -0,0 +1,31 @@ +% ndims() - number of dimension of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function s = ndims(a) + + if ~strcmpi(a.fileformat, 'transposed') + if a.data.Format{2}(3) == 1, s = 2; + else s = 3; + end; + else + if a.data.Format{2}(2) == 1, s = 2; + else s = 3; + end; + end; diff --git a/code/eeglab13_4_4b/functions/@memmapdata/reshape.m b/code/eeglab13_4_4b/functions/@memmapdata/reshape.m new file mode 100644 index 0000000..e5c07b1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/reshape.m @@ -0,0 +1,45 @@ +% reshape() - reshape of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function a = reshape(a,d1,d2,d3) + + % decode length + % ------------- + if nargin > 3 + d1 = [ d1 d2 d3 ]; + elseif nargin > 2 + d1 = [ d1 d2 ]; + end; + + if prod(size(a)) ~= prod(d1) + error('Wrong dimensions for reshaping'); + end; + + if ~strcmpi(a.fileformat, 'transposed') + a.data.format{2} = d1; + else + if length(d1) == 1 + a.data.format{2} = d1; + elseif length(d1) == 2 + a.data.format{2} = [d1(2) d1(1)]; + else + a.data.format{2} = d1([2 3 1]); + end; + end; diff --git a/code/eeglab13_4_4b/functions/@memmapdata/size.m b/code/eeglab13_4_4b/functions/@memmapdata/size.m new file mode 100644 index 0000000..1a28783 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/size.m @@ -0,0 +1,46 @@ +% size() - size of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [s s2 s3] = size(a,dim) + + if isnumeric(a.data), + s = size(a.data) + else + s = a.data.format{2}; + if strcmpi(a.fileformat, 'transposed') + if length(s) == 2, s = s([2 1]); + elseif length(s) == 3 + s = [s(3) s(1) s(2)]; + end; + end; + end; + + if nargin > 1 + s = [s 1]; + s = s(dim); + end; + + if nargout > 2 + s3 = s(3); + end; + if nargout > 1 + s2 = s(2); + s = s(1); + end; diff --git a/code/eeglab13_4_4b/functions/@memmapdata/subsasgn.m b/code/eeglab13_4_4b/functions/@memmapdata/subsasgn.m new file mode 100644 index 0000000..8c8e2a4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/subsasgn.m @@ -0,0 +1,48 @@ +% subsasgn() - define index assignment for eegdata objects +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function b = subsasgn(a,index,val) + + i.type = '()'; + i.subs = { ':' ':' ':' }; + b = subsref(a, i); % note that subsref cannot be called directly + c = subsref(val, i); + b = builtin('subsasgn', b, index, c); + return; + + +switch index.type + case '()' + switch length(index.subs) + case 1, a.data(index.subs{1}) = val; + case 2, a.data(index.subs{1}, index.subs{2}) = val; + case 3, a.data(index.subs{1}, index.subs{2}, index.subs{3}) = val; + case 4, a.data(index.subs{1}, index.subs{2}, index.subs{3}, index.subs{4}) = val; + end; + case '.' + switch index.subs + case 'srate' + a.srate = val; + case 'nbchan' + a.nbchan = val; + otherwise + error('Invalid field name') + end +end diff --git a/code/eeglab13_4_4b/functions/@memmapdata/subsref.m b/code/eeglab13_4_4b/functions/@memmapdata/subsref.m new file mode 100644 index 0000000..100f143 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/subsref.m @@ -0,0 +1,120 @@ +% subsref() - index eegdata class +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function b = subsref(a,s) + + if s(1).type == '.' + b = builtin('subsref', struct(a), s); return; + end; + + subs = s(1).subs; + finaldim = cellfun('length', subs); + + % one dimension input + % ------------------- + if length(s(1).subs) == 1 + if isstr(subs{1}) + subs{1} = [1:size(a,1)]; + subs{2} = [1:size(a,2)]; + if ndims(a) == 3, subs{3} = [1:size(a,3)]; end; + finaldim = prod(size(a)); + end; + + % two dimension input + % ------------------- + elseif length(s(1).subs) == 2 + if isstr(subs{1}), subs{1} = [1:size(a,1)]; end; + + if isstr(subs{2}), + subs{2} = [1:size(a,2)]; + if ndims(a) == 3, subs{3} = [1:size(a,3)]; end; + end; + if length(subs) == 3 + finaldim = [ length(subs{1}) length(subs{2})*length(subs{3}) ]; + else finaldim = [ length(subs{1}) length(subs{2}) ]; + end; + + % three dimension input + % --------------------- + elseif length(s(1).subs) == 3 + + if isstr(subs{1}), subs{1} = [1:size(a,1)]; end; + if isstr(subs{2}), subs{2} = [1:size(a,2)]; end; + if ndims(a) == 2, + subs(3) = []; + else + if isstr(subs{3}), subs{3} = [1:size(a,3)]; end; + end; + finaldim = cellfun('length', subs); + + end; + + % non-transposed data + % ------------------- + if ~strcmpi(a.fileformat, 'transposed') + if length(subs) == 1, b = a.data.data.x(subs{1}); end; + if length(subs) == 2, b = a.data.data.x(subs{1}, subs{2}); end; + if length(subs) == 3, b = a.data.data.x(subs{1}, subs{2}, subs{3}); end; + else + if ndims(a) == 2 + %if length(s) == 0, b = transpose(a.data.data.x); return; end; + if length(s(1).subs) == 1, b = a.data.data.x(s(1).subs{1})'; end; + if length(s(1).subs) == 2, b = a.data.data.x(s(1).subs{2}, s(1).subs{1})'; end; + if length(s(1).subs) == 3, b = a.data.data.x(s(1).subs{2}, s(1).subs{1})'; end; + else + %if length(s) == 0, b = permute(a.data.data.x, [3 1 2]); return; end; + if length(subs) == 1, + inds1 = mod(subs{1}-1, size(a,1))+1; + inds2 = mod((subs{1}-inds1)/size(a,1), size(a,2))+1; + inds3 = ((subs{1}-inds1)/size(a,1)-inds2+1)/size(a,2)+1; + inds = (inds1-1)*size(a,2)*size(a,3) + (inds3-1)*size(a,2) + inds2; + b = a.data.data.x(inds); + else + if length(subs) < 2, subs{3} = 1; end; + + % repmat if several indices in different dimensions + % ------------------------------------------------- + len = cellfun('length', subs); + subs{1} = repmat(reshape(subs{1}, [len(1) 1 1]), [1 len(2) len(3)]); + subs{2} = repmat(reshape(subs{2}, [1 len(2) 1]), [len(1) 1 len(3)]); + subs{3} = repmat(reshape(subs{3}, [1 1 len(3)]), [len(1) len(2) 1]); + + inds = (subs{1}-1)*a.data.Format{2}(1)*a.data.Format{2}(2) + (subs{3}-1)*a.data.Format{2}(1) + subs{2}; + inds = reshape(inds, [1 prod(size(inds))]); + b = a.data.data.x(inds); + end; + end; + end; + + if length(finaldim) == 1, finaldim(2) = 1; end; + b = reshape(b, finaldim); + +% 2 dims +%inds1 = mod(myinds-1, size(a,1))+1; +%inds2 = (myinds-inds1)/size(a,1)+1; +%inds = (inds2-1)*size(a,1) + inds1; + +% 3 dims +%inds1 = mod(myinds-1, size(a,1))+1; +%inds2 = mod((myinds-inds1)/size(a,1), size(a,2))+1; +%inds3 = ((myinds-inds1)/size(a,1)-inds2)/size(a,2)+1; +%inds = (inds3-1)*size(a,1)*size(a,2) + inds2*size(a,1) + inds1; + + diff --git a/code/eeglab13_4_4b/functions/@memmapdata/sum.m b/code/eeglab13_4_4b/functions/@memmapdata/sum.m new file mode 100644 index 0000000..d7a7af1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@memmapdata/sum.m @@ -0,0 +1,64 @@ +% sum() - sum of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [s] = sum(a,dim) + + if nargin < 2 + dim = 1; + end; + + %b = (:,:,:); + if ~strcmpi(a.fileformat, 'transposed') + s = sum(a.data.data.x, dim); + else + alldim = [3 1 2]; + if length(size(a)) == 3 + dim = alldim(dim); + s = sum(a.data.data.x, dim); + s = permute(s, [3 1 2]); + else + if dim == 1 + dim = 2; + else dim = 1; + end; + s = sum(a.data.data.x, dim)'; + end; + end; + return; + + % do pnts by pnts if dim = 1 +% if dim == 1 & length( +% +% s = zeros(size(a,2), size(a,3)); +% for i=1:size(a,2) +% s(i,:) = mean(a.data.data.x(:,i,:)); +% end; +% elseif dim == 1 +% s = zeros(size(a,1), size(a,1)); +% for i=1:size(a,1) +% s(i,:) = mean(a.data.data.x(:,:,:)); +% end; +% +% +% s = builtin('sum', rand(10,10), dim); + + %if length(size(a)) > 2 + %else s = sum(a(:,:,:), dim); + %end; diff --git a/code/eeglab13_4_4b/functions/@mmo/binaryopp.m b/code/eeglab13_4_4b/functions/@mmo/binaryopp.m new file mode 100644 index 0000000..c642f61 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/binaryopp.m @@ -0,0 +1,33 @@ +function obj3 = binaryopp(f, obj1, obj2) + + if isa(obj2, 'mmo'), tmpobj = obj2; obj2 = obj1; obj1 = tmpobj; clear tmpobj; end; + if ~isequal(size(obj1), size(obj2)) && prod(size(obj2)) ~= 1 + error('Matrix dimensions must agree.'); + end; + data1 = memmapfile(obj1.dataFile, 'writable', obj1.writable, 'format', { 'single' obj1.dimensions 'x' }); + if isa(obj2, 'mmo'), + data2 = memmapfile(obj2.dataFile, 'writable', obj2.writable, 'format', { 'single' obj2.dimensions 'x' }); + else data2 = obj2; + end; + + % make new memory mapped data file (blank) + % -------------------------------- + newFileName = mmo.getnewfilename; + fid = fopen(newFileName, 'w'); + s1 = size(obj1); + ss.type = '()'; + ss.subs(1:length(s1)-1) = { ':' }; + for index = 1:s1(end) + ss.subs{length(s1)} = index; + if prod(size(data2)) == 1 + tmpdata = f(subsref(data1.Data.x, ss), data2); + else tmpdata = f(subsref(data1.Data.x, ss), subsref(data2.Data.x, ss)); + end; + fwrite(fid, tmpdata, 'float'); + end; + fclose(fid); + + % create object + % ------------- + obj3 = mmo(newFileName, s1, true, obj1.transposed); + obj3 = updateWorkspace(obj3); diff --git a/code/eeglab13_4_4b/functions/@mmo/bsxfun.m b/code/eeglab13_4_4b/functions/@mmo/bsxfun.m new file mode 100644 index 0000000..4dc48ed --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/bsxfun.m @@ -0,0 +1,28 @@ +function obj3 = bsxfun(f, obj1, obj2) + + if isa(obj2, 'mmo'), error('bsxfun does not work yet with the second argument being a memory mapped object'); end; + data1 = memmapfile(obj1.dataFile, 'writable', obj1.writable, 'format', { 'single' obj1.dimensions 'x' }); + data2 = obj2; + + % make new memory mapped data file (blank) + % -------------------------------- + newFileName = mmo.getnewfilename; + fid = fopen(newFileName, 'w'); + s1 = size(obj1); + s2 = size(obj2); + ss.type = '()'; + ss.subs(1:length(s1)-1) = { ':' }; + if length(s1) == length(s2) && s1(end) == s2(end) + error('bsxfun does not work on the last dimension'); + end; + for index = 1:s1(end) % scan last dimension + ss.subs{length(s1)} = index; + tmpdata = bsxfun(f,subsref(data1.Data.x, ss), data2); + fwrite(fid, tmpdata, 'float'); + end; + fclose(fid); + + % create object + % ------------- + obj3 = mmo(newFileName, s1, true, obj1.transposed); + obj3 = updateWorkspace(obj3); diff --git a/code/eeglab13_4_4b/functions/@mmo/changefile.m b/code/eeglab13_4_4b/functions/@mmo/changefile.m new file mode 100644 index 0000000..d9fa2d6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/changefile.m @@ -0,0 +1,7 @@ +% this function is called when the file is being saved + +function obj = changefile(obj, newfile) + + movefile(obj.dataFile, newfile); + obj.dataFile = newfile; + obj.writable = false; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/checkcopies_local.m b/code/eeglab13_4_4b/functions/@mmo/checkcopies_local.m new file mode 100644 index 0000000..93e32ea --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/checkcopies_local.m @@ -0,0 +1,21 @@ +% subfunction checking the number of local copies +% ----------------------------------------------- +function ncopies = checkcopies_local(obj, arg); +ncopies = 0; +if isstruct(arg) + for ilen = 1:length(arg) + for index = fieldnames(arg)' + ncopies = ncopies + checkcopies_local(obj, arg(ilen).(index{1})); + if ncopies > 1, return; end; + end; + end; +elseif iscell(arg) + for index = 1:length(arg(:)) + ncopies = ncopies + checkcopies_local(obj, arg{index}); + if ncopies > 1, return; end; + end; +elseif isa(arg, 'mmo') && isequal(obj, arg) + ncopies = 1; +else + ncopies = 0; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/checkworkspace.m b/code/eeglab13_4_4b/functions/@mmo/checkworkspace.m new file mode 100644 index 0000000..8fb590d --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/checkworkspace.m @@ -0,0 +1,61 @@ +function ncopies = checkworkspace(obj); + +stack = dbstack; +stack(1:2) = []; +stack = rmfield(stack, 'line'); +ncopies = 0; +if ~isempty(stack) + % empty stack means the base workspace + % check if we are in a different workspace + if ~isequal(stack, obj.workspace) + % is the current stack a subset of the obj workspace? + % if yes, it means that the object was created in a subfunction + % and that it is OK to modify it (because it does not exist in the + % subfunction any more) + subFlag = false; + for index = 1:length(obj.workspace) + if isequal(obj.workspace(index), stack(1)) + subFlag = true; + if length(stack) > 1 + for index2 = 1:length(obj.workspace)-index + if length(stack) < index2+1 + subFlag = false; + elseif ~isequal(obj.workspace(index+index2), stack(index2+1)) + subFlag = false; + end; + end; + end; + if subFlag, return; end; + end; + end; + + % if subfunction, must be a copie + if ~isempty(obj.workspace) && strcmpi(stack(end).file, obj.workspace(end).file) && ... + ~strcmpi(stack(end).name, obj.workspace(end).name) + % We are within a subfunction. The MMO must have + % been passed as an argument (otherwise the current + % workspace and the workspace variable would be + % equal). + ncopies = 2; + else + if ~isscript(stack(1).file) + ncopies = 2; + % we are within a function. The MMO must have + % been passed as an argument (otherwise the current + % workspace and the workspace variable would be + % equal). + else + % we cannot be in a function with 0 argument + % (otherwise the current workspace and the workspace + % variable would be equal). We must assume that + % we are in a script. + while ~isempty(stack) && ~isequal(stack, obj.workspace) + stack(1) = []; + end; + if ~isequal(stack, obj.workspace) + ncopies = 2; + end; + end; + end; + end; +end; diff --git a/code/eeglab13_4_4b/functions/@mmo/ctranspose.m b/code/eeglab13_4_4b/functions/@mmo/ctranspose.m new file mode 100644 index 0000000..ebba206 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/ctranspose.m @@ -0,0 +1,40 @@ +function res = ctranspose(obj,useconj); + if nargin == 1 + useconj = 1; + end; + + if length(obj.dimensions) > 2 + error('Cannot transpose array'); + end; + + % make new memory mapped data file + % -------------------------------- + newFileName = mmo.getnewfilename; + copyfile(obj.dataFile, newFileName); + + res = obj; + res.dimensions = [ obj.dimensions(2) obj.dimensions(1) ]; + res.dataFile = newFileName; + tmpMMO1 = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + tmpMMO2 = memmapfile(res.dataFile, 'writable', true, 'format', { 'single' res.dimensions 'x' }); + + % copy the data + % ------------- + if length(obj.dimensions) == 1 || obj.dimensions(1) > obj.dimensions(2) + for index = 1:size(obj,2) + s.type = '()'; + s.subs = { ':' index }; + if useconj, tmpMMO2.Data.x(index,:) = conj(subsref(tmpMMO1.Data.x,s)); + else tmpMMO2.Data.x(:,index) = subsref(tmpMMO1.Data.x,s); + end; + end; + else + for index = 1:size(obj,1) + s.type = '()'; + s.subs = { index ':' }; + if useconj, tmpMMO2.Data.x(:,index) = conj(subsref(tmpMMO1.Data.x,s)); + else tmpMMO2.Data.x(:,index) = subsref(tmpMMO1.Data.x,s); + end; + end; + end; + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/display.m b/code/eeglab13_4_4b/functions/@mmo/display.m new file mode 100644 index 0000000..5355c3d --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/display.m @@ -0,0 +1,26 @@ +% display() - display an EEG data class underlying structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function display(obj); + + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + if obj.transposed, disp('Warning: data does not display properly for memory mapped file which have been transposed'); end; + disp(tmpMMO.data.x); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/double.m b/code/eeglab13_4_4b/functions/@mmo/double.m new file mode 100644 index 0000000..e5748b9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/double.m @@ -0,0 +1,3 @@ +function a = double(a); + +return; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/end.m b/code/eeglab13_4_4b/functions/@mmo/end.m new file mode 100644 index 0000000..2e726d4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/end.m @@ -0,0 +1,23 @@ +% end() - last index to memmapdata array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function s = end(a, k, n); + + s = size(a, k); diff --git a/code/eeglab13_4_4b/functions/@mmo/fft.m b/code/eeglab13_4_4b/functions/@mmo/fft.m new file mode 100644 index 0000000..d6b131f --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/fft.m @@ -0,0 +1,3 @@ +function obj2 = fft( obj1, varargin ) + +obj2 = unitaryopp(@fft, obj1, varargin{:}); diff --git a/code/eeglab13_4_4b/functions/@mmo/isnumeric.m b/code/eeglab13_4_4b/functions/@mmo/isnumeric.m new file mode 100644 index 0000000..ffd3d74 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/isnumeric.m @@ -0,0 +1,23 @@ +% isnumeric() - returns 1 +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function r = isnumeric(a) + + r = 1; diff --git a/code/eeglab13_4_4b/functions/@mmo/length.m b/code/eeglab13_4_4b/functions/@mmo/length.m new file mode 100644 index 0000000..e8a3250 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/length.m @@ -0,0 +1,23 @@ +% length() - length of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function s = length(a) + + s = size(a,1); diff --git a/code/eeglab13_4_4b/functions/@mmo/mmo.m b/code/eeglab13_4_4b/functions/@mmo/mmo.m new file mode 100644 index 0000000..d5470e4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/mmo.m @@ -0,0 +1,154 @@ +% mmo() - create a memory-mapped data class +% +% Usage: +% >> data_class = mmo(data); +% +% Inputs: +% data - input data or data file +% +% Outputs: +% data_class - output dataset class +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2012- + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +classdef mmo + properties + dataFile = []; + dimensions = []; + writable = true; % duplicate of the writable field of memmapfile + workspace = []; + type = 'mmo'; + transposed = false; + debug = false; + end + + methods + function dataout = mmo(dataFileIn, datadims, writableVal, transposedVal, debugVal) + if nargin < 3 + writableVal = true; + end; + if nargin < 4 + transposedVal = false; + end; + if nargin < 5 + debugVal = false; + end; + + % check that the file is not empty + % -------------------------------- + if ~isempty(dataFileIn) + if ~isstr(dataFileIn) + error('First input must be a file name'); + end; + + dirContent = dir(dataFileIn); + if isempty(dirContent) + error([ 'Data file ''' dataFileIn '''not found' ]); + elseif dirContent(1).bytes == 0 + error([ 'Empty data file ''' dataFileIn '''' ]); + end; + else + dataFileIn = mmo.getnewfilename; + fid = fopen(dataFileIn, 'w'); + if fid == -1, error('Cannot open new file'); end; + if length(datadims) == 1, datadims(2) = 1; end; + tmpdata = zeros(1, prod(datadims(2:end)), 'single'); + for index = 1:datadims(1) + fwrite(fid, tmpdata, 'float'); + end; + fclose(fid); + end; + + % test memory map but discards it + % ------------------------------- + test = memmapfile(dataFileIn, 'writable', writableVal, 'format', { 'single' datadims 'x' }); + clear test; + + % set fields + % ---------- + while datadims(end) == 1 && length(datadims) > 1 + datadims(end) = []; + end; + if transposedVal + if length(datadims) == 1, datadims = [1 datadims]; + else datadims = [datadims(2:end) datadims(1)]; + end; + end; + + dataout.dataFile = dataFileIn; + dataout.dimensions = datadims; + dataout.writable = writableVal; + dataout.transposed = transposedVal; + + % set workspace + % ------------- + dataout = updateWorkspace(dataout); +% stack = dbstack; +% stack(1) = []; +% stack = rmfield(stack, 'line'); +% dataout.workspace = stack; + dataout.debug = debugVal; + end + + % this function updates the function workspace + % -------------------------------------------- + function obj = updateWorkspace(obj); + stack = dbstack; + stack(1:2) = []; + stack = rmfield(stack, 'line'); + obj.workspace = stack; + end + + % function to check copies (only used for testing, + % implemented in subasign as well) + % -------------------------------- + function ncopies = checkcopies(obj); + ncopies = checkworkspace(obj); + if ncopies < 2 + s = evalin('caller', 'whos'); + for index = 1:length(s) + if strcmpi(s(index).class, 'struct') || strcmpi(s(index).class, 'cell') + tmpVar = evalin('caller', s(index).name); + ncopies = ncopies + checkcopies_local(obj, tmpVar); + elseif strcmpi(s(index).class, 'mmo') + if s(index).persistent || s(index).global + disp('Warning: mmo objects should not be made persistent or global. Behavior is unpredictable.'); + end; + tmpVar = evalin('caller', s(index).name); + if isequal(tmpVar, obj), ncopies = ncopies + 1; end; + if ncopies > 1, break; end; + end; + end; + end; + end + + % numerical implementations of basic functions + % -------------------------------------------- + function obj2 = log(obj1); obj2 = unitaryopp(@log, obj1); end + function val = mean(obj,dim); if nargin <1, dim=1; end; val = sum(obj,dim)/size(obj,dim); end + function val = std(varargin); val = sqrt(var(varargin{:})); end + function obj3 = minus(obj1, obj2); obj3 = binaryopp(@minus, obj1, obj2); end + function obj3 = plus(obj1, obj2); obj3 = binaryopp(@plus, obj1, obj2); end + function obj3 = time(obj1, obj2); obj3 = binaryopp(@time, obj1, obj2); end + end + + methods (Static) + function str = getnewfilename; str = fullfile(gettempfolder(true), sprintf('memapdata_%.9d%.9d.fdt', round(rand(1)*10^9), round(rand(1)*10^9))); end; + end +end diff --git a/code/eeglab13_4_4b/functions/@mmo/ndims.m b/code/eeglab13_4_4b/functions/@mmo/ndims.m new file mode 100644 index 0000000..055b0da --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/ndims.m @@ -0,0 +1,25 @@ +% ndims() - number of dimension of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function res = ndims(obj) + + if length(obj.dimensions) <= 2 || all(obj.dimensions(3:end) == 1), res = 2; + else res = length(obj.dimensions); + end; diff --git a/code/eeglab13_4_4b/functions/@mmo/permute.m b/code/eeglab13_4_4b/functions/@mmo/permute.m new file mode 100644 index 0000000..ea17d27 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/permute.m @@ -0,0 +1,65 @@ +function res = permute(obj, dims); + +if length(dims) > 3 + error('Max 3 dimensions for permutation'); +elseif length(dims) == 2 + error('Permutation with 2 dimensions: use transpose instead'); +end; + +newFileName = mmo.getnewfilename; +copyfile(obj.dataFile, newFileName); + +res = obj; +res.dimensions = obj.dimensions(dims); +res.dataFile = newFileName; +tmpMMO1 = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); +tmpMMO2 = memmapfile(res.dataFile, 'writable', true , 'format', { 'single' res.dimensions 'x' }); + +% copy the data +% ------------- +d = res.dimensions; +for i1 = 1:obj.dimensions(1) + s.type = '()'; + s.subs = { i1 ':' ':' }; + tmpdata = squeeze(subsref(tmpMMO1.Data.x,s)); + + if all(dims == [2 1 3]), tmpMMO2.Data.x( :,i1, :) = reshape(tmpdata , d(1), 1, d(3)); end; + if all(dims == [3 1 2]), tmpMMO2.Data.x( :,i1, :) = reshape(tmpdata', d(1), 1, d(3)); end; + + if all(dims == [2 3 1]), tmpMMO2.Data.x( :, :,i1) = reshape(tmpdata , d(1), d(2), 1); end; + if all(dims == [3 2 1]), tmpMMO2.Data.x( :, :,i1) = reshape(tmpdata', d(1), d(2), 1); end; + + if all(dims == [1 2 3]), tmpMMO2.Data.x(i1, :, :) = reshape(tmpdata , 1, d(2), d(3)); end; + if all(dims == [1 3 2]), tmpMMO2.Data.x(i1, :, :) = reshape(tmpdata', 1, d(2), d(3)); end; +end; + +% slower versions below +% for i1 = 1:obj.dimensions(1) +% for i2 = 1:obj.dimensions(3) +% s.type = '()'; +% s.subs = { i1 ':' i2 }; +% tmpdata = subsref(tmpMMO1.Data.x,s); +% if all(dims == [2 1 3]), tmpMMO2.Data.x( :,i1,i2) = tmpdata; end; +% if all(dims == [2 3 1]), tmpMMO2.Data.x( :,i2,i1) = tmpdata; end; +% +% if all(dims == [1 2 3]), tmpMMO2.Data.x(i1, :,i2) = tmpdata; end; +% if all(dims == [3 2 1]), tmpMMO2.Data.x(i2, :,i1) = tmpdata; end; +% +% if all(dims == [1 3 2]), tmpMMO2.Data.x(i1,i2, :) = tmpdata; end; +% if all(dims == [3 1 2]), tmpMMO2.Data.x(i2,i1, :) = tmpdata; end; +% end; +% end; +% +% for i1 = 1:obj.dimensions(2) +% for i2 = 1:obj.dimensions(3) +% s.type = '()'; +% s.subs = { ':' i1 i2 }; +% tmpdata = subsref(tmpMMO1.Data.x,s); +% if all(dims == [1 2 3]), tmpMMO2.Data.x( :,i1,i2) = tmpdata; end; +% if all(dims == [1 3 2]), tmpMMO2.Data.x( :,i2,i1) = tmpdata; end; +% if all(dims == [2 1 3]), tmpMMO2.Data.x(i1, :,i2) = tmpdata; end; +% if all(dims == [2 3 1]), tmpMMO2.Data.x(i1,i2, :) = tmpdata; end; +% if all(dims == [3 2 1]), tmpMMO2.Data.x(i2,i1, :) = tmpdata; end; +% if all(dims == [3 1 2]), tmpMMO2.Data.x(i2, :,i1) = tmpdata; end; +% end; +% end; diff --git a/code/eeglab13_4_4b/functions/@mmo/reshape.m b/code/eeglab13_4_4b/functions/@mmo/reshape.m new file mode 100644 index 0000000..f38a3dd --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/reshape.m @@ -0,0 +1,39 @@ +% reshape() - reshape of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function obj = reshape(obj,d1,d2,d3) + + % decode length + % ------------- + if nargin > 3 + d1 = [ d1 d2 d3 ]; + elseif nargin > 2 + d1 = [ d1 d2 ]; + end; + + if prod(size(obj)) ~= prod(d1) + error('Wrong dimensions for reshaping'); + end; + + if obj.transposed + d1 = [d1(2:end) d1(1)]; + end; + + obj.dimensions = d1; diff --git a/code/eeglab13_4_4b/functions/@mmo/size.m b/code/eeglab13_4_4b/functions/@mmo/size.m new file mode 100644 index 0000000..5d9cb6b --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/size.m @@ -0,0 +1,53 @@ +% size() - size of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [s varargout] = size(obj,dim) + + if obj.transposed + if length(obj.dimensions) ~= 2 && length(obj.dimensions) ~= 3 + error('Transposed array must be 2 or 3 dims'); + end; + if length(obj.dimensions) == 2 tmpdimensions = [obj.dimensions(2) obj.dimensions(1)]; + else tmpdimensions = [obj.dimensions(3) obj.dimensions(1:end-1)]; + end; + else + tmpdimensions = obj.dimensions; + end; + + s = tmpdimensions; + + if nargin > 1 + if dim >length(s) + s = 1; + else + s = s(dim); + end; + else + if nargout > 1 + s = [s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]; + alls = s; + s = s(1); + for index = 1:max(nargout,1)-1 + varargout{index} = alls(index+1); + end; + end; + end; + + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/subsasgn.m b/code/eeglab13_4_4b/functions/@mmo/subsasgn.m new file mode 100644 index 0000000..e8c09c2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/subsasgn.m @@ -0,0 +1,277 @@ +% subsasgn() - define index assignment for eegdata objects +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function obj = subsasgn(obj,ss,val) + +% check empty assignement +% ----------------------- +for index = 1:length(ss(1).subs) + if isempty(ss(1).subs{index}), return; end; +end; + +% remove useless ":" +% ------------------ +while length(obj.dimensions) < length(ss(1).subs) + if isequal(ss(1).subs{end}, ':') + ss(1).subs(end) = []; + else + break; + end; +end; + +% deal with transposed data +% ------------------------- +if obj.transposed, ss = transposeindices(obj, ss); end; + +% check stack and local variables +% --------------------- +ncopies = checkworkspace(obj); +if ncopies < 2 + if isempty(inputname(1)) + vers = version; + indp = find(vers == '.'); + if str2num(vers(indp(1)+1)) > 1, vers = [ vers(1:indp(1)) '0' vers(indp(1)+1:end) ]; end; + indp = find(vers == '.'); + vers = str2num(vers(1:indp(2)-1)); + if vers >= 7.13 + % the problem with Matlab 2012a/2011b is that if the object called is + % in a field of a structure (empty inputname), the evaluation + % in the caller of the object variable is empty in 2012a. A bug + % repport has been submitted to Matlab - Arno + ncopies = ncopies + 1; + end; + end; + s = evalin('caller', 'whos'); + for index = 1:length(s) + if strcmpi(s(index).class, 'struct') || strcmpi(s(index).class, 'cell') + tmpVar = evalin('caller', s(index).name); + ncopies = ncopies + checkcopies_local(obj, tmpVar); + elseif strcmpi(s(index).class, 'mmo') + if s(index).persistent || s(index).global + disp('Warning: mmo objects should not be made persistent or global. Behavior is unpredictable.'); + end; + tmpVar = evalin('caller', s(index).name); + if isequal(tmpVar, obj), ncopies = ncopies + 1; end; + if ncopies > 1, break; end; + end; + end; +end; + +% removing some entries +% --------------------- +if isempty(val) + newdim1 = obj.dimensions; + newdim2 = obj.dimensions; + + % create new array of new size + % ---------------------------- + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + newFileName = mmo.getnewfilename; + + % find non singleton dimension + % ---------------------------- + nonSingleton = []; + ss2 = ss; + for index = 1:length(ss(1).subs) + if ~isstr(ss(1).subs{index}) % can only be ":" + nonSingleton(end+1) = index; + ss2(1).subs{index} = setdiff_bc([1:newdim1(index)], ss(1).subs{index}); % invert selection + end; + end; + if length(nonSingleton) > 1, error('A null assignment can have only one non-colon index'); end; + if isempty(nonSingleton), obj = []; return; end; + + % compute new final dimension and copy data + % ----------------------------------------- + if length(ss(1).subs) == 1 + fid = fopen(newFileName, 'w'); + newdim2 = [ prod(newdim2)-length(ss(1).subs{1}) ]; + if ~(newdim1(1) > 1 && all(newdim1(2:end) == 1)), newdim2 = [1 newdim2]; + else newdim2 = [newdim2 1]; end; + newindices = setdiff_bc([1:prod(newdim1)], ss(1).subs{1}); + for index = newindices + fwrite(fid, tmpMMO.Data.x(index), 'float'); + end; + fclose(fid); + else + if length(ss(1).subs) < length(newdim2) + newdim2(length(ss(1).subs)) = prod(newdim2(length(ss(1).subs):end)); + newdim2(length(ss(1).subs)+1:end) = []; + if nonSingleton == length(ss(1).subs) + ss2(1).subs{end} = setdiff_bc([1:newdim2(end)], ss(1).subs{end}); + end; + end; + newdim2(nonSingleton) = newdim2(nonSingleton)-length(ss(1).subs{nonSingleton}); + if isstr(ss2.subs{end}) + ss2.subs{end} = [1:prod(newdim1(length(ss2.subs):end))]; + end; + ss3 = ss2; + fid = fopen(newFileName, 'w'); + + % copy large blocks + alllen = cellfun(@length, ss2.subs); + inc = ceil(250000/prod(alllen(1:end-1))); % 1Mb block + for index = 1:inc:length(ss2.subs{end}) + ss3.subs{end} = ss2.subs{end}(index:min(index+inc, length(ss2.subs{end}))); + tmpdata = subsref(tmpMMO.Data.x, ss3); + fwrite(fid, tmpdata, 'float'); + end; + fclose(fid); + end; + + % delete file if necessary + if ncopies == 1 && obj.writable + delete(obj.dataFile); + end; + + if obj.debug, disp('new copy created, old deleted (length 1)'); end; + obj.dimensions = newdim2; + obj.dataFile = newFileName; + obj.writable = true; + obj = updateWorkspace(obj); + clear tmpMMO; + return; + +else + % check size to see if it increases + % --------------------------------- + newdim1 = obj.dimensions; + newdim2 = newdim1; + if length(ss(1).subs) == 1 + if ~isstr(ss(1).subs{1}) && max(ss(1).subs{1}) > prod(newdim1) + if length(newdim1) > 2 + error('Attempt to grow array along ambiguous dimension.'); + end; + end; + if max(ss(1).subs{1}) > prod(newdim2) + notOneDim = find(newdim2 > 1); + if length(notOneDim) == 1 + newdim2(notOneDim) = max(ss(1).subs{1}); + end; + end; + else + if length(newdim1) == 3 && newdim1(3) == 1, newdim1(end) = []; end; + if length(ss(1).subs) == 2 && length(newdim1) == 3 + if ~isstr(ss(1).subs{2}) && max(ss(1).subs{2}) > prod(newdim1(2:end)) + error('Attempt to grow array along ambiguous dimension.'); + end; + if isnumeric(ss(1).subs{1}), newdim2(1) = max(max(ss(1).subs{1}), newdim2(1)); end; + else + for index = 1:length(ss(1).subs) + if isnumeric(ss(1).subs{index}) + if index > length(newdim2) + newdim2(index) = max(ss(1).subs{index}); + else newdim2(index) = max(max(ss(1).subs{index}), newdim2(index)); + end; + end; + end; + end; + end; + + % create new array of new size if necessary + % ----------------------------------------- + if ~isequal(newdim1, newdim2) + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + newFileName = mmo.getnewfilename; + + % copy file row by row + % -------------------- + fid = fopen(newFileName, 'w'); + dim1 = [ newdim1 1 1 1 1 ]; + dim2 = [ newdim2 1 1 1 1 ]; + tmpdata1 = zeros(prod(dim2(1:1)) - prod(dim1(1:1)), 1, 'single'); + tmpdata2 = zeros((dim2(2) - dim1(2))*dim2(1), 1, 'single'); + tmpdata3 = zeros((dim2(3) - dim1(3))*prod(dim2(1:2)), 1, 'single'); + + % copy new data (copy first array) + % ------------- + for index3 = 1:dim1(3) + if dim1(1) == dim2(1) && dim1(2) == dim2(2) + fwrite(fid, tmpMMO.Data.x(:,:,index3), 'float'); + else + for index2 = 1:dim1(2) + if dim1(1) == dim2(1) + fwrite(fid, tmpMMO.Data.x(:,index2,index3), 'float'); + else + for index1 = 1:dim1(1) + fwrite(fid, tmpMMO.Data.x(index1,index2,index3), 'float'); + end; + end; + fwrite(fid, tmpdata1, 'float'); + end; + end; + fwrite(fid, tmpdata2, 'float'); + end; + fwrite(fid, tmpdata3, 'float'); + fclose(fid); + + % delete file if necessary + if ncopies == 1 && obj.writable + delete(obj.dataFile); + end; + + if obj.debug, disp('new copy created, old deleted'); end; + obj.dimensions = newdim2; + obj.dataFile = newFileName; + obj.writable = true; + clear tmpMMO; + + % create copy if necessary + % ------------------------ + elseif ncopies > 1 || ~obj.writable + newFileName = mmo.getnewfilename; + copyfile(obj.dataFile, newFileName); + obj.dataFile = newFileName; + obj.writable = true; + if obj.debug, disp('new copy created'); end; + else + if obj.debug, disp('using same copy'); end; + end; + + % copy new data + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + if ~isa(val, 'mmo') + tmpMMO.Data.x = builtin('subsasgn', tmpMMO.Data.x, ss, val); + else + % copy memory mapped array + if ndims(val) == 2 && (size(val,1) == 1 || size(val,2) == 1) + % vector direct copy + ss2.type = '()'; + ss2.subs = { ':' ':' ':' }; + tmpMMO.Data.x = builtin('subsasgn', tmpMMO.Data.x, ss, subsref(val,ss2)); + else + ss2.type = '()'; + ss2.subs = { ':' ':' ':' }; + ss3 = ss; + % array, copy each channel + for index1 = 1:size(val,1) + ss2(1).subs{1} = index1; + if isstr(ss(1).subs{1}) ss3(1).subs{1} = index1; + else ss3(1).subs{1} = ss(1).subs{1}(index1); + end; + tmpMMO.Data.x = builtin('subsasgn', tmpMMO.Data.x, ss3, subsref(val,ss2)); + end; + end; + end; + + obj = updateWorkspace(obj); + +end; + diff --git a/code/eeglab13_4_4b/functions/@mmo/subsasgn_old.m b/code/eeglab13_4_4b/functions/@mmo/subsasgn_old.m new file mode 100644 index 0000000..018b4f5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/subsasgn_old.m @@ -0,0 +1,275 @@ +% subsasgn() - define index assignment for eegdata objects +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function obj = subsasgn(obj,ss,val) + +% check stack +% ----------- +stack = dbstack; +stack(1) = []; +stack = rmfield(stack, 'line'); +ncopies = 0; +if ~isempty(stack) + % check if we are in a different workspace + if ~isequal(stack, obj.workspace) + % if subfunction, must be a copie + if ~isempty(obj.workspace) && strcmpi(stack(end).file, obj.workspace(end).file) && ... + ~strcmpi(stack(end).name, obj.workspace(end).name) + % We are within a subfunction. The MMO must have + % been passed as an argument (otherwise the current + % workspace and the workspace variable would be + % equal). + ncopies = 2; + else + tmpVar = evalin('caller', 'nargin;'); % this does not work + if ~isscript(stack(1).file) + ncopies = 2; + % we are within a function. The MMO must have + % been passed as an argument (otherwise the current + % workspace and the workspace variable would be + % equal). + else + % we cannot be in a function with 0 argument + % (otherwise the current workspace and the workspace + % variable would be equal). We must assume that + % we are in a script. + while ~isempty(stack) && ~isequal(stack, obj.workspace) + stack(1) = []; + end; + if ~isequal(stack, obj.workspace) + ncopies = 2; + end; + end; + end; + end; +end; + +% check local variables +% --------------------- +if ncopies < 2 + s = evalin('caller', 'whos'); + for index = 1:length(s) + if strcmpi(s(index).class, 'struct') || strcmpi(s(index).class, 'cell') + tmpVar = evalin('caller', s(index).name); + ncopies = ncopies + checkcopies_local(obj, tmpVar); + elseif strcmpi(s(index).class, 'mmo') + if s(index).persistent || s(index).global + disp('Warning: mmo objects should not be made persistent or global. Behavior is unpredictable.'); + end; + tmpVar = evalin('caller', s(index).name); + if isequal(tmpVar, obj), ncopies = ncopies + 1; end; + if ncopies > 1, break; end; + end; + end; +end; + +% removing some entries +% --------------------- +if isempty(val) + newdim1 = obj.dimensions; + newdim2 = obj.dimensions; + + % create new array of new size + % ---------------------------- + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + newFileName = sprintf('memapdata_%.9d%.9d.fdt', round(rand(1)*10^9), round(rand(1)*10^9)); + + % find non singleton dimension + % ---------------------------- + nonSingleton = []; + for index = 1:length(subs) + if ~isstr(subs{index}) % can only be ":" + nonSingleton(end+1) = index; + subs2 = setdiff_bc([1:newdim1(index)], subs{index}); % invert selection + end; + end; + if length(nonSingleton) > 1, error('A null assignment can have only one non-colon index'); end; + if isempty(nonSingleton), obj = []; return; end; + + % compute new final dimension + % --------------------------- + if length(ss(1).subs) == 1 + fid = fopen(newFileName, 'w'); + newdim2 = prod(newdim2)-length(ss(1).subs{1}); + newindices = setdiff_bc([1:prod(newdim1)], ss(1).subs{1}); + for index = newindices + fwrite(fid, tmpMMO.Data.x(index), 'float'); + end; + fclose(fid); + else + newdim2(nonSingleton) = newdim2(nonSingleton)-length(subs{index}); + tmpdata = builtin('subsref', tmpMMO.Data.x, s); + fid = fopen(newFileName, 'w'); + fwrite(fid, tmpMMO.Data.x(index), 'float'); + fclose(fid); + end; + + % delete file if necessary + if ncopies == 1 && obj.writable + delete(obj.dataFile); + end; + + if obj.debug, disp('new copy created, old deleted (length 1)'); end; + obj.dimensions = [1 newdim2]; + obj.dataFile = newFileName; + obj.writable = true; + clear tmpMMO; + return; + +elseif ncopies == 1 && obj.writable + for index = 1:length(ss(1).subs) + newdim2(notOneDim) = newdim2(notOneDim)-length(ss(1).subs{1}); + if index > length(newdim2) + newdim2(index) = max(ss(1).subs{index}); + else newdim2(index) = max(max(ss(1).subs{index}), newdim2(index)); + end; + end; + + % create new array of new size + % ----------------------------------------- + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + newFileName = sprintf('memapdata_%.9d%.9d.fdt', round(rand(1)*10^9), round(rand(1)*10^9)); + + % copy file row by row + % -------------------- + fid = fopen(newFileName, 'w'); + tmpdata = zeros(prod(newdim2(1)) - prod(newdim1(1)), 1, 'single'); + for index = 1:prod(newdim1(2:end)) + fwrite(fid, tmpMMO.Data.x(:,index), 'float'); + fwrite(fid, tmpdata, 'float'); + end; + if prod(newadim1(2:end)) ~= prod(newdim2(2:end)) + tmpdata = zeros(newdim2(1), 1, 'single'); + for index = prod(newdim1(2:end))+1:prod(newdim2(2:end)) + fwrite(fid, tmpdata, 'float'); + end; + end; + fclose(fid); + + % delete file if necessary + if ncopies == 1 && obj.writable + delete(obj.dataFile); + end; + + if obj.debug, disp('new copy created, old deleted'); end; + obj.dimensions = newdim2; + obj.dataFile = newFileName; + obj.writable = true; + clear tmpMMO; + +else + % check size + % ---------- + newdim1 = obj.dimensions; + newdim2 = obj.dimensions; + if length(ss(1).subs) == 1 + if max(ss(1).subs{1}) > prod(newdim2) + notOneDim = find(newdim2 > 1); + if length(notOneDim) == 1 + newdim2(notOneDim) = max(ss(1).subs{1}); + end; + end; + else + for index = 1:length(ss(1).subs) + if index > length(newdim2) + newdim2(index) = max(ss(1).subs{index}); + else newdim2(index) = max(max(ss(1).subs{index}), newdim2(index)); + end; + end; + end; + + % create new array of new size if necessary + % ----------------------------------------- + if ~isequal(newdim1, newdim2) + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + newFileName = sprintf('memapdata_%.9d%.9d.fdt', round(rand(1)*10^9), round(rand(1)*10^9)); + + % copy file row by row + % -------------------- + fid = fopen(newFileName, 'w'); + tmpdata = zeros(prod(newdim2(1)) - prod(newdim1(1)), 1, 'single'); + for index = 1:prod(newdim1(2:end)) + fwrite(fid, tmpMMO.Data.x(:,index), 'float'); + fwrite(fid, tmpdata, 'float'); + end; + if prod(newdim1(2:end)) ~= prod(newdim2(2:end)) + tmpdata = zeros(newdim2(1), 1, 'single'); + for index = prod(newdim1(2:end))+1:prod(newdim2(2:end)) + fwrite(fid, tmpdata, 'float'); + end; + end; + fclose(fid); + + % delete file if necessary + if ncopies == 1 && obj.writable + delete(obj.dataFile); + end; + + if obj.debug, disp('new copy created, old deleted'); end; + obj.dimensions = newdim2; + obj.dataFile = newFileName; + obj.writable = true; + clear tmpMMO; + + % create copy if necessary + % ------------------------ + elseif ncopies > 1 || ~obj.writable + newFileName = sprintf('memapdata_%.9d%.9d.fdt', round(rand(1)*10^9), round(rand(1)*10^9)); + copyfile(obj.dataFile, newFileName); + obj.dataFile = newFileName; + obj.writable = true; + if obj.debug, disp('new copy created'); end; + else + if obj.debug, disp('using same copy'); end; + end; + + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + tmpMMO.Data.x = builtin('subsasgn', tmpMMO.Data.x, ss, val); + +end; + +return; + +% i.type = '()'; +% i.subs = { ':' ':' ':' }; +% res = subsref(obj, i); % note that subsref cannot be called directly + + +% subfunction checking the number of copies +% ----------------------------------------- +function ncopies = checkcopies_local(obj, arg); +ncopies = 0; +if isstruct(arg) + for ilen = 1:length(arg) + for index = fieldnames(arg)' + ncopies = ncopies + checkcopies_local(obj, arg(ilen).(index{1})); + if ncopies > 1, return; end; + end; + end; +elseif iscell(arg) + for index = 1:length(arg(:)) + ncopies = ncopies + checkcopies_local(obj, arg{index}); + if ncopies > 1, return; end; + end; +elseif isa(arg, 'mmo') && isequal(obj, arg) + ncopies = 1; +else + ncopies = 0; +end; diff --git a/code/eeglab13_4_4b/functions/@mmo/subsref.m b/code/eeglab13_4_4b/functions/@mmo/subsref.m new file mode 100644 index 0000000..54d7914 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/subsref.m @@ -0,0 +1,82 @@ +% subsref() - index eegdata class +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function res = subsref(obj,s) + + if strcmpi(s(1).type, '.') + res = builtin('subsref', obj, s); + return; + end; + + tmpMMO = memmapfile(obj.dataFile, 'writable', obj.writable, 'format', { 'single' obj.dimensions 'x' }); + + subs = s(1).subs; + finaldim = cellfun('length', subs); + + % one dimension input + % ------------------- + if length(s) > 1 || ~strcmpi(s(1).type, '()') + error('MMO can only map single array data files'); + end; + + % deal with transposed data + % ------------------------- + if obj.transposed, s = transposeindices(obj, s); end; + + % convert : to real sizes + % ----------------------- + lastdim = length(subs); + if isstr(subs{end}) && ndims(obj) > lastdim + for index = lastdim+1:ndims(obj) + if index > length(obj.dimensions) + subs{index} = 1; + else + subs{index} = [1:obj.dimensions(index)]; + end; + end; + end; + for index = 1:length(subs) + if isstr(subs{index}) % can only be ":" + if index > length(obj.dimensions) + subs{index} = 1; + else + subs{index} = [1:obj.dimensions(index)]; + end; + end; + end; + finaldim = cellfun(@length, subs); + finaldim(lastdim) = prod(finaldim(lastdim:end)); + finaldim(lastdim+1:end) = []; + + % non-transposed data + % ------------------- + res = tmpMMO.data.x(subs{:}); + if length(finaldim) == 1, finaldim(2) = 1; end; + res = reshape(res, finaldim); + if obj.transposed + if finaldim(end) == 1, finaldim(end) = []; end; + if length(finaldim) <= 2, res = res'; + else + res = reshape(res, [finaldim(1)*finaldim(2) finaldim(3)])'; + res = reshape(res, [finaldim(3) finaldim(1) finaldim(2)]); + end; + end; + + diff --git a/code/eeglab13_4_4b/functions/@mmo/sum.m b/code/eeglab13_4_4b/functions/@mmo/sum.m new file mode 100644 index 0000000..696fcdc --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/sum.m @@ -0,0 +1,36 @@ +% sum() - sum of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function sumval = sum(obj,dim) + + if nargin < 2 + dim = 1; + end; + + s1 = size(obj); + ss.type = '()'; + ss.subs(1:length(s1)) = { ':' }; + for index = 1:s1(dim) + ss.subs{dim} = index; + if index == 1 + sumval = subsref(obj, ss); + else sumval = sumval + subsref(obj, ss); + end; + end; diff --git a/code/eeglab13_4_4b/functions/@mmo/transpose.m b/code/eeglab13_4_4b/functions/@mmo/transpose.m new file mode 100644 index 0000000..b5be3f9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/transpose.m @@ -0,0 +1,5 @@ +function res = transpose(obj); + + res = ctranspose(obj, 0); + + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/unitaryopp.m b/code/eeglab13_4_4b/functions/@mmo/unitaryopp.m new file mode 100644 index 0000000..6ce170c --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/unitaryopp.m @@ -0,0 +1,22 @@ +function obj2 = unitaryopp(f, obj1, varargin); + + % make new memory mapped data file (blank) + % ---------------------------------------- + newFileName = mmo.getnewfilename; + data = memmapfile(obj1.dataFile, 'writable', obj1.writable, 'format', { 'single' obj1.dimensions 'x' }); + fid = fopen(newFileName, 'w'); + if obj1.dimensions(end) == 1, obj1.dimensions(end) = []; end; + ss.type = '()'; + ss.subs(1:length(obj1.dimensions)-1) = { ':' }; + for index = 1:obj1.dimensions(end) + ss.subs{length(obj1.dimensions)} = index; + tmpdata = f(subsref(data.Data.x, ss), varargin{:}); + fwrite(fid, tmpdata, 'float'); + end; + fclose(fid); + + % copy the data + % ------------- + obj2 = mmo(newFileName, obj1.dimensions, true, obj1.transposed); + obj2 = updateWorkspace(obj2); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/@mmo/var.m b/code/eeglab13_4_4b/functions/@mmo/var.m new file mode 100644 index 0000000..60eaff1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/@mmo/var.m @@ -0,0 +1,44 @@ +% var() - variance of memory mapped underlying array +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008 + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function sumval = var(obj,flag,dim) + + if nargin < 2 + flag = 0; + end; + if nargin < 3 + dim = 1; + end; + + meanvalsq = mean(obj,dim).^2; + + sumval = 0; + s1 = size(obj); + ss.type = '()'; + ss.subs(1:length(s1)) = { ':' }; + for index = 1:s1(dim) + ss.subs{dim} = index; + tmpdata = subsref(obj, ss); + sumval = sumval + tmpdata.*tmpdata - meanvalsq; + end; + if isempty(flag) || flag == 0 + sumval = sumval/(size(obj,dim)-1); + else sumval = sumval/size(obj,dim); + end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/+up/README.txt b/code/eeglab13_4_4b/functions/adminfunc/+up/README.txt new file mode 100644 index 0000000..58a8e7d --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/+up/README.txt @@ -0,0 +1,16 @@ +Information for when releasing a new EEGLAB version. +This message is for EEGLAB developpers only. + +This plugins allows to perform automatic updates. +To determine the current version, type in + +[dummy eeglabVersionNumber currentReleaseDateString] = eeg_getversion; +eeglabUpdater = up.updater(eeglabVersionNumber, 'http://sccn.ucsd.edu/eeglab/updater/latest_version.php', 'EEGLAB', currentReleaseDateString); +eeglabUpdater.checkForNewVersion({'eeglab_event' 'setup'}); +eeglabUpdater + +Copy the information about the new version to + +/home/www/eeglab/updater/latestRelease.xml + +Arnaud Delorme - April 23rd, 2012 diff --git a/code/eeglab13_4_4b/functions/adminfunc/+up/updater.m b/code/eeglab13_4_4b/functions/adminfunc/+up/updater.m new file mode 100644 index 0000000..c64963d --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/+up/updater.m @@ -0,0 +1,365 @@ +classdef updater < handle + % Web-based software updater class with download and installation capabilities. + % Copyright (C) 2012 by Nima Bigdely-Shamlo, Swartz Center for Computational Neuroscience, INC, + % UCSD. + % Usage is only allowed under the same (non-commercial) license as Measure Projection toolbox. + + properties + currentVersionNumber + currentVersionReleaseDate % a string containing time and date of the current release + latestVersionNumber + releaseDate + downloadUrl + releaseNotes % text about the release. + releaseNotesUrl % The URL in which more information about the release is provided. + newMajorRevision + xmlFileUrl + lastTimeChecked % a date vector returned by clock(). + menuItemHandle = nan; % handle to the menu item that becomes visible if a new version is available. + menuItemText = 'Upgrade to the Latest Version'; % text label for the item when a newer version is available. + menuItemCallback = []; + downloadedFileName % contains file name (and path) of the downloaded latest-version file. + guiHandle + softwareName % the name of the software package to be upadted (e.g. EEGLAB) + end + + methods (Static = true) + + function writeReleaseXml(xmlFileName, versionNumber, downloadUrl, releaseNotes, releaseNotesUrl, releaseDate) + % writeReleaseXml(xmlFileName, versionNumber, downloadUrl, releaseNotes, releaseNotesUrl, releaseDate) + % use this function to make the XML file to be placed somewhere which is accessible from + % the web. + + if nargin < 4 + releaseNotes = ''; + end; + + if nargin < 5 + releaseNotesUrl = ''; + end; + + if nargin < 6 + releaseDate = datestr(now); % e.g. '0-Jan-2012 11:54:10' + end; + + % make sure version number is a string as only strings can be set as attributes. + if isnumeric(versionNumber) + versionNumber = num2str(versionNumber); + end; + + docNode = com.mathworks.xml.XMLUtils.createDocument('latestVersion'); + docRootNode = docNode.getDocumentElement; + docRootNode.setAttribute('versionNumber', versionNumber); + docRootNode.setAttribute('releaseDate', releaseDate); + docRootNode.setAttribute('downloadUrl', downloadUrl); + docRootNode.setAttribute('releaseNotes', releaseNotes); + docRootNode.setAttribute('releaseNotesUrl', releaseNotesUrl); + docRootNode.setAttribute('newMajorRevision', releaseNotesUrl); + + xmlwrite(xmlFileName, docNode); + end + + function homeDir = getHomeDirectory + if ispc + homeDir= getenv('USERPROFILE'); + else + homeDir = getenv('HOME'); + end + end; + end + + methods + function obj = updater(currentVersionNumber, xmlFileUrl, softwareName, currentVersionReleaseDate) + % obj = updater(currentVersionNumber, xmlFileUrl, softwareName, currentVersionReleaseDate) + + obj.currentVersionNumber = currentVersionNumber; + obj.xmlFileUrl = xmlFileUrl; + + if nargin > 2 + obj.softwareName = softwareName; + end; + + if nargin > 3 + obj.currentVersionReleaseDate = currentVersionReleaseDate; + end; + end + + function obj = checkForNewVersion(obj, nameValuePairs) + % nameValuePairs is a cell array of name1, value1, name 2, value 2,... send along with + % the URL request. + + if nargin < 2 + nameValuePairs = {}; + end; + + % add current version number and some other basic setup info to request URL + if ispc + osType = 'pc'; + elseif isunix + osType = 'unix'; + elseif ismac + osType = 'max'; + else + osType = 'unknown'; + end; + + nameValuePairs = [{'currentVersionNumber' num2str(obj.currentVersionNumber) 'matlabVersion' version 'OS' osType} nameValuePairs]; + + try + [xmlString successfullRead] = plugin_urlread([obj.xmlFileUrl], 'get', nameValuePairs); + catch + successfullRead = false; + end; + + if successfullRead + + % write into a temp file + temporaryFileName = tempname; + fileId = fopen(temporaryFileName, 'w'); + fprintf(fileId, '%s', xmlString); + fclose(fileId); + + % read as xml into a doc + try + docNode = xmlread(temporaryFileName); + docRootNode = docNode.getDocumentElement; + catch + successfullRead = false; + return; + end; + + % delete temporary file afterwards + delete(temporaryFileName); + + obj.latestVersionNumber = str2double(char(docRootNode.getAttribute('versionNumber'))); + obj.releaseDate = char(docRootNode.getAttribute('releaseDate')); + obj.releaseNotes = char(docRootNode.getAttribute('releaseNotes')); + obj.releaseNotesUrl = char(docRootNode.getAttribute('releaseNotesUrl')); + obj.downloadUrl = char(docRootNode.getAttribute('downloadUrl')); + obj.newMajorRevision = char(docRootNode.getAttribute('newMajorRevision')); + + obj.lastTimeChecked = clock; + + % if a menu item handle is assigned, make it visible and set its label + % appropriately (show the menu if the version is up-to-date and hide it otherwise). + if ishandle(obj.menuItemHandle) + if obj.latestVersionNumber > obj.currentVersionNumber + set(obj.menuItemHandle, 'label', [obj.menuItemText ' (' num2str(obj.latestVersionNumber) ')']); + set(obj.menuItemHandle, 'Callback', obj.menuItemCallback); + set(obj.menuItemHandle, 'visible', 'on'); + else + set(obj.menuItemHandle, 'visible', 'off'); + end; + end; + end; + end; + + function answer = newerVersionIsAvailable(obj) + answer = obj.latestVersionNumber > obj.currentVersionNumber; + end; + + function timeAGo = howLongAgoChecked(obj) % how ago was the last version check, in seconds + if isempty(obj.lastTimeChecked) + timeAGo = Inf; + else + timeAGo = etime (clock, obj.lastTimeChecked); + end; + end; + + function obj = downloadLatestVersion(obj, folderToPlace) + + if usejava('jvm') + obj.downloadedFileName = fullfile(tempdir, ['latest_version' num2str(obj.latestVersionNumber) '_' strrep(char(java.util.UUID.randomUUID),'-','_')]); + else + obj.downloadedFileName = fullfile(tempdir ,['latest_version' num2str(obj.latestVersionNumber) '_' num2str(feature('timing','cpucount'))]); + end + + % make it a bit shoter + obj.downloadedFileName = obj.downloadedFileName(1:end-30); + + % get the file part fromthe download URL and add it to the end of temp file. + % One advantage of this is to preserve file type (e.g. zip) + segmentFromUrl = obj.downloadUrl(find(obj.downloadUrl == '/', 1, 'last')+1:end); + obj.downloadedFileName = [obj.downloadedFileName '_' segmentFromUrl]; + + fprintf('Downloading the latest version (%s)....\n', num2str(obj.latestVersionNumber)); + [filestr downloadWasSucessfull] = urlwrite(obj.downloadUrl, obj.downloadedFileName); + + if downloadWasSucessfull + fprintf(['Latest-version file successfully download and is located at: ' obj.downloadedFileName '\n']); + else + fprintf('Latest-version file could not be downloaded.\n'); + end; + end; + + function obj = installDownloadedFile(obj, installFolder, goOneFolderLevelIn) + + if nargin < 2 + error(' You must specy a folder to install the latest version'); + end; + + if nargin < 3 + goOneFolderLevelIn = false; + end; + + [pathstr, name, ext] = fileparts(obj.downloadedFileName); + + temporaryFolder = tempname; + fprintf('Unpacking downloaded file...\n'); + if strcmpi(ext, '.zip') + mkdir(temporaryFolder); + unzip(obj.downloadedFileName, temporaryFolder); + elseif strcmpi(ext, '.tar') + mkdir(temporaryFolder); + untar(obj.downloadedFileName, temporaryFolder); + else + fprintf('File type in unknown and cannot be unzipped.\n'); + return; + end; + + % remove all files from installation folder + if exist(installFolder) + fprintf('Removing all files from installation folder...\n'); + rmdir(installFolder,'s'); + end; + + if goOneFolderLevelIn + listing = dir(temporaryFolder); + insideFolderName = ''; + for i=1:length(listing) + if ~(strcmp(listing(i).name, '.') || strcmp(listing(i).name, '..')) + insideFolderName = listing(i).name; + break; + end; + end; + + temporaryFolder = [temporaryFolder filesep insideFolderName]; + end; + + % copy extracted files and folder into the install (destination) folder + fprintf('Copying files from the latest version into the installation folder...\n'); + movefile(temporaryFolder, installFolder, 'f'); + + fprintf('New version (%s) is now installed. You may need to clear functions and objects or exit Matlab in order to use it.\n', num2str(obj.latestVersionNumber)); + end; + + function numberOfDays = daysCurrentVersionIsOlder(obj) + % numberOfDays = daysCurrentVersionIsOlder(obj) + % return the number of days between current version release and the latest version + % release. (empty is current release date in unknown). + + if isempty(obj.currentVersionReleaseDate) + numberOfDays = []; % cannot be calculated + else + numberOfDays = round(etime(clock, datevec(datenum(obj.currentVersionReleaseDate))) / (3600*24) ); + end; + end; + + function downloadButtonCallBack(handle, event, obj) + % close the figure + close(get(handle, 'parent')); + drawnow; + + obj.downloadLatestVersion; + end; + + function installButtonCallBack(handle, event, obj, installDirectory, goOneFolderLevelIn) + + % get the tag ifnromation from figure GUI. + guiData = get(get(handle, 'parent'), 'userdata'); + + % close the figure + close(get(handle, 'parent')); + drawnow; + + % download the file if it has not been downloaded yet. + if isempty(obj.downloadedFileName) + obj.downloadLatestVersion; + end; + + obj.installDownloadedFile(installDirectory, goOneFolderLevelIn); + + % evaulate post-install callback (text) after installation. + if ~isempty(guiData.postInstallCallbackString) + evalin('base', guiData.postInstallCallbackString); + end; + end; + + function launchGui(obj, installDirectory, goOneFolderLevelIn, backGroundColor, postInstallCallbackString) + % launchGui(obj, installDirectory, goOneFolderLevelIn, backGroundColor, postInstallCallbackString) + % installDirectory: The directory into which the new version will nbe installed. + % All files in this directory will be deleted before installation. + % + % goOneFolderLevelIn: If set to true, the folder one level inside the unpakced + % (e.g. unzipped) file will be copied into the install directory. + % This is useful if the downloaded file contains one folder which + % is the actual software to be installed. + % backGroundColor GUI background color. {optional} + % + % postInstallCallbackString commands (callback as a string) to be executed after + % installation from the GUI. {optional} + + if nargin < 3 + goOneFolderLevelIn = false; + end; + + if nargin < 5 + postInstallCallbackString = []; + end; + + updaterFolder = fileparts(which('up.updater')); + obj.guiHandle = open([updaterFolder filesep 'updater_gui.fig']); + + % save some information in tag property of the figure GUI. + guiData = struct; + guiData.postInstallCallbackString = postInstallCallbackString; + set(obj.guiHandle, 'userData', guiData); + + if nargin > 3 + warningTextHandle = findobj(obj.guiHandle, 'tag', 'warningText'); + set(obj.guiHandle, 'color', backGroundColor); + set(warningTextHandle, 'backgroundColor', backGroundColor); + end; + + % full the texbox + textBoxHandle = findobj(obj.guiHandle, 'tag', 'textBox'); + + if isempty(obj.softwareName) + textBoxTextCell = {['A newer version is available and ready for download.']}; + else + textBoxTextCell = {['A newer version of ' obj.softwareName ' is available and ready for download.']}; + end; + + currentVersionString = ['You are currently using version (' num2str(obj.currentVersionNumber) ')']; + if isempty(obj.daysCurrentVersionIsOlder) + currentVersionString = [currentVersionString '.']; + else + currentVersionString = [currentVersionString ' which is ' num2str(obj.daysCurrentVersionIsOlder) ' days older.']; + end; + + textBoxTextCell = cat(1, textBoxTextCell, currentVersionString); + + % release notes + if ~isempty(obj.releaseNotes) && ~strcmp(obj.releaseNotes, ''); + textBoxTextCell = cat(1, textBoxTextCell, '------------------------------'); + textBoxTextCell = cat(1, textBoxTextCell, 'Release Notes:'); + textBoxTextCell = cat(1, textBoxTextCell, obj.releaseNotes); + end; + + set(textBoxHandle, 'string', textBoxTextCell); + + % set callbakcs for Install and Download buttonds + downloadButtonHandle = findobj(obj.guiHandle, 'tag', 'DownloadButton'); + set(downloadButtonHandle, 'callback', {@downloadButtonCallBack, obj}); + + installButtonHandle = findobj(obj.guiHandle, 'tag', 'installButton'); + if nargin<3 + % hide install button if install directory is not provided. + set(installButtonHandle, 'visible', 'off'); + else + set(installButtonHandle, 'callback', {@installButtonCallBack, obj, installDirectory, goOneFolderLevelIn}); + end; + + end; + end +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/+up/updater_gui.fig b/code/eeglab13_4_4b/functions/adminfunc/+up/updater_gui.fig new file mode 100644 index 0000000..6a615f8 Binary files /dev/null and b/code/eeglab13_4_4b/functions/adminfunc/+up/updater_gui.fig differ diff --git a/code/eeglab13_4_4b/functions/adminfunc/abouteeglab.m b/code/eeglab13_4_4b/functions/adminfunc/abouteeglab.m new file mode 100644 index 0000000..d7080a7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/abouteeglab.m @@ -0,0 +1,20 @@ +tmptmptext = strvcat(' EEGLAB 1997-2010 (compiled version)', ... + ' ', ... + ' ', ... + 'The EEGLAB electrophysiological data analysis software is an open source research', ... + 'project developped at the Swartz Center for Computational Neuroscience, Institute', ... + 'for Neural Computation at the University of California San Diego in collaboration', ... + 'with The Salk Institute (La Jolla) and the CERCO laboratory (Toulouse) where part', ... + 'of the core code was developped.', ... + ' ', ... + 'EEGLAB incorporates several third party suites of functions, Fieldtrip for source ', ... + 'localization, and BIOSIG for binary file import. A list of plugins is also included', ... + 'in this compiled release. See http://sccn.ucsd.edu/eeglab/plugins.html for more', ... + 'information.', ... + ' ', ... + 'The EEGLAB software, its source code, and the source code of all additional third', ... + 'party functions it includes is protected by the GNU GPL open source license.', ... + ' '); + +warndlg2(tmptmptext); +clear tmptmptext; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_checkchanlocs.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_checkchanlocs.m new file mode 100644 index 0000000..55fedf1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_checkchanlocs.m @@ -0,0 +1,244 @@ +% eeg_checkchanlocs() - Check the consistency of the channel locations structure +% of an EEGLAB dataset. +% +% Usage: +% >> EEG = eeg_checkchanlocs( EEG, 'key1', value1, 'key2', value2, ... ); +% >> [chanlocs chaninfo] = eeg_checkchanlocs( chanlocs, chaninfo, 'key1', value1, 'key2', value2, ... ); +% +% Inputs: +% EEG - EEG dataset +% chanlocs - EEG.chanlocs structure +% chaninfo - EEG.chaninfo structure +% +% Outputs: +% EEG - new EEGLAB dataset with updated channel location structures +% EEG.chanlocs, EEG.urchanlocs, EEG.chaninfo +% chanlocs - updated channel location structure +% chaninfo - updated chaninfo structure +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, March 2, 2011 + +% Copyright (C) SCCN/INC/UCSD, March 2, 2011, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Hey Arno -- this is a quick fix to make an analysis work for Makoto +% I think the old version had a bug... + +function [chans, chaninfo, chanedit]= eeg_checkchanlocs(chans, chaninfo); + +if nargin < 1 + help eeg_checkchanlocs; + return; +end; + +if nargin < 2 + chaninfo = []; +end; + +processingEEGstruct = 0; +if isfield(chans, 'data') + processingEEGstruct = 1; + tmpEEG = chans; + chans = tmpEEG.chanlocs; + chaninfo = tmpEEG.chaninfo; +end; + +if ~isfield(chans, 'datachan') + [chanedit,dummy,complicated] = insertchans(chans, chaninfo); +else + chanedit = chans; + complicated = true; +end; + +nosevals = { '+X' '-X' '+Y' '-Y' }; +if ~isfield(chaninfo, 'plotrad'), chaninfo.plotrad = []; end; +if ~isfield(chaninfo, 'shrink'), chaninfo.shrink = []; end; +if ~isfield(chaninfo, 'nosedir'), chaninfo.nosedir = nosevals{1}; end; + +% handles deprecated fields +% ------------------------- +plotrad = []; +if isfield(chanedit, 'plotrad'), + plotrad = chanedit(1).plotrad; + chanedit = rmfield(chanedit, 'plotrad'); + if isstr(plotrad) & ~isempty(str2num(plotrad)), plotrad = str2num(plotrad); end; + chaninfo.plotrad = plotrad; +end; +if isfield(chanedit, 'shrink') && ~isempty(chanedit(1).shrink) + shrinkorskirt = 1; + if ~isstr(chanedit(1).shrink) + plotrad = 0.5/(1-chanedit(1).shrink); % convert old values + end; + chanedit = rmfield(chanedit, 'shrink'); + chaninfo.plotrad = plotrad; +end; + +% set non-existent fields to [] +% ----------------------------- +fields = { 'labels' 'theta' 'radius' 'X' 'Y' 'Z' 'sph_theta' 'sph_phi' 'sph_radius' 'type' 'ref' 'urchan' }; +fieldtype = { 'str' 'num' 'num' 'num' 'num' 'num' 'num' 'num' 'num' 'str' 'str' 'num' }; +check_newfields = true; %length(fieldnames(chanedit)) < length(fields); +if ~isempty(chanedit) + for index = 1:length(fields) + if check_newfields && ~isfield(chanedit, fields{index}) + % new field + % --------- + if strcmpi(fieldtype{index}, 'num') + chanedit = setfield(chanedit, {1}, fields{index}, []); + else + for indchan = 1:length(chanedit) + chanedit = setfield(chanedit, {indchan}, fields{index}, ''); + end; + end; + else + % existing fields + % --------------- + allvals = {chanedit.(fields{index})}; + if strcmpi(fieldtype{index}, 'num') + if ~all(cellfun('isclass',allvals,'double')) + numok = cellfun(@isnumeric, allvals); + if any(numok == 0) + for indConvert = find(numok == 0) + chanedit = setfield(chanedit, {indConvert}, fields{index}, []); + end; + end; + end + else + strok = cellfun('isclass', allvals,'char'); + if strcmpi(fields{index}, 'labels'), prefix = 'E'; else prefix = ''; end; + if any(strok == 0) + for indConvert = find(strok == 0) + try + strval = [ prefix num2str(getfield(chanedit, {indConvert}, fields{index})) ]; + chanedit = setfield(chanedit, {indConvert}, fields{index}, strval); + catch + chanedit = setfield(chanedit, {indConvert}, fields{index}, ''); + end; + end; + end; + end; + end; + end; +end; +if ~isequal(fieldnames(chanedit)',fields) + try + chanedit = orderfields(chanedit, fields); + catch, end; +end + +% check if duplicate channel label +% -------------------------------- +if isfield(chanedit, 'labels') + tmp = sort({chanedit.labels}); + if any(strcmp(tmp(1:end-1),tmp(2:end))) + disp('Warning: some channels have the same label'); + end +end; + +% check for empty channel label +% ----------------------------- +if isfield(chanedit, 'labels') + indEmpty = find(cellfun(@isempty, {chanedit.labels})); + if ~isempty(indEmpty) + tmpWarning = warning('backtrace'); + warning backtrace off; + warning('channel labels should not be empty, creating unique labels'); + warning(tmpWarning); + for index = indEmpty + chanedit(index).labels = sprintf('E%d', index); + end; + end; +end; + +% remove fields +% ------------- +if isfield(chanedit, 'sph_phi_besa' ), chanedit = rmfield(chanedit, 'sph_phi_besa'); end; +if isfield(chanedit, 'sph_theta_besa'), chanedit = rmfield(chanedit, 'sph_theta_besa'); end; + +% reconstruct the chans structure +% ------------------------------- +if complicated + [chans chaninfo.nodatchans] = getnodatchan( chanedit ); + if ~isfield(chaninfo, 'nodatchans'), chaninfo.nodatchans = []; end; + if isempty(chanedit) + for iField = 1:length(fields) + chanedit = setfield(chanedit, fields{iField}, []); + end; + end; +else + chans = rmfield(chanedit,'datachan'); + chaninfo.nodatchans = []; +end + +if processingEEGstruct + tmpEEG.chanlocs = chans; + tmpEEG.chaninfo = chaninfo; + chans = tmpEEG; +end; + +% --------------------------------------------- +% separate data channels from non-data channels +% --------------------------------------------- +function [chans, fidsval] = getnodatchan(chans) +if isfield(chans,'datachan') + [chans(cellfun('isempty',{chans.datachan})).datachan] = deal(0); + fids = [chans.datachan] == 0; + fidsval = chans(fids); + chans = rmfield(chans(~fids),'datachan'); +else + fids = []; +end; + +% ---------------------------------------- +% fuse data channels and non-data channels +% ---------------------------------------- +function [chans, chaninfo,complicated] = insertchans(chans, chaninfo, nchans) +if nargin < 3, nchans = length(chans); end; +[chans.datachan] = deal(1); +complicated = false; % whether we need complicated treatment of datachans & co further down the road..... + +if isfield(chans,'type') + mask = strcmpi({chans.type},'FID') | strcmpi({chans.type},'IGNORE'); + if any(mask) + [chans(mask).datachan] = deal(0); + complicated = true; + end +end +if length(chans) > nchans & nchans ~= 0 % reference at the end of the structure + chans(end).datachan = 0; + complicated = true; +end; +if isfield(chaninfo, 'nodatchans') + if ~isempty(chaninfo.nodatchans) && isstruct(chaninfo.nodatchans) + chanlen = length(chans); + for index = 1:length(chaninfo.nodatchans) + fields = fieldnames( chaninfo.nodatchans ); + ind = chanlen+index; + for f = 1:length( fields ) + chans = setfield(chans, { ind }, fields{f}, getfield( chaninfo.nodatchans, { index }, fields{f})); + end; + chans(ind).datachan = 0; + complicated = true; + end; + chaninfo = rmfield(chaninfo, 'nodatchans'); + + % put these channels first + % ------------------------ + % tmp = chans(chanlen+1:end); + % chans(length(tmp)+1:end) = chans(1:end-length(tmp)); + % chans(1:length(tmp)) = tmp; + end; +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_checkset.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_checkset.m new file mode 100644 index 0000000..b7df880 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_checkset.m @@ -0,0 +1,1394 @@ +% eeg_checkset() - check the consistency of the fields of an EEG dataset +% Also: See EEG dataset structure field descriptions below. +% +% Usage: >> [EEGOUT,changes] = eeg_checkset(EEG); % perform all checks +% except 'makeur' +% >> [EEGOUT,changes] = eeg_checkset(EEG, 'keyword'); % perform 'keyword' check(s) +% +% Inputs: +% EEG - EEGLAB dataset structure or (ALLEEG) array of EEG structures +% +% Optional keywords: +% 'icaconsist' - if EEG contains several datasets, check whether they have +% the same ICA decomposition +% 'epochconsist' - if EEG contains several datasets, check whether they have +% identical epoch lengths and time limits. +% 'chanconsist' - if EEG contains several datasets, check whether they have +% the same number of channela and channel labels. +% 'data' - check whether EEG contains data (EEG.data) +% 'loaddata' - load data array (if necessary) +% 'savedata' - save data array (if necessary - see EEG.saved below) +% 'contdata' - check whether EEG contains continuous data +% 'epoch' - check whether EEG contains epoched or continuous data +% 'ica' - check whether EEG contains an ICA decomposition +% 'besa' - check whether EEG contains component dipole locations +% 'event' - check whether EEG contains an event array +% 'makeur' - remake the EEG.urevent structure +% 'checkur' - check whether the EEG.urevent structure is consistent +% with the EEG.event structure +% 'chanlocsize' - check the EEG.chanlocs structure length; show warning if +% necessary. +% 'chanlocs_homogeneous' - check whether EEG contains consistent channel +% information; if not, correct it. +% 'eventconsistency' - check whether EEG.event information are consistent; +% rebuild event* subfields of the 'EEG.epoch' structure +% (can be time consuming). +% Outputs: +% EEGOUT - output EEGLAB dataset or dataset array +% changes - change code: 'no' = no changes; 'yes' = the EEG +% structure was modified +% +% =========================================================== +% The structure of an EEG dataset under EEGLAB (as of v5.03): +% +% Basic dataset information: +% EEG.setname - descriptive name|title for the dataset +% EEG.filename - filename of the dataset file on disk +% EEG.filepath - filepath (directory/folder) of the dataset file(s) +% EEG.trials - number of epochs (or trials) in the dataset. +% If data are continuous, this number is 1. +% EEG.pnts - number of time points (or data frames) per trial (epoch). +% If data are continuous (trials=1), the total number +% of time points (frames) in the dataset +% EEG.nbchan - number of channels +% EEG.srate - data sampling rate (in Hz) +% EEG.xmin - epoch start latency|time (in sec. relative to the +% time-locking event at time 0) +% EEG.xmax - epoch end latency|time (in seconds) +% EEG.times - vector of latencies|times in seconds (one per time point) +% EEG.ref - ['common'|'averef'|integer] reference channel type or number +% EEG.history - cell array of ascii pop-window commands that created +% or modified the dataset +% EEG.comments - comments about the nature of the dataset (edit this via +% menu selection Edit > About this dataset) +% EEG.etc - miscellaneous (technical or temporary) dataset information +% EEG.saved - ['yes'|'no'] 'no' flags need to save dataset changes before exit +% +% The data: +% EEG.data - two-dimensional continuous data array (chans, frames) +% ELSE, three-dim. epoched data array (chans, frames, epochs) +% +% The channel locations sub-structures: +% EEG.chanlocs - structure array containing names and locations +% of the channels on the scalp +% EEG.urchanlocs - original (ur) dataset chanlocs structure containing +% all channels originally collected with these data +% (before channel rejection) +% EEG.chaninfo - structure containing additional channel info +% EEG.ref - type of channel reference ('common'|'averef'|+/-int] +% EEG.splinefile - location of the spline file used by headplot() to plot +% data scalp maps in 3-D +% +% The event and epoch sub-structures: +% EEG.event - event structure containing times and nature of experimental +% events recorded as occurring at data time points +% EEG.urevent - original (ur) event structure containing all experimental +% events recorded as occurring at the original data time points +% (before data rejection) +% EEG.epoch - epoch event information and epoch-associated data structure array (one per epoch) +% EEG.eventdescription - cell array of strings describing event fields. +% EEG.epochdescription - cell array of strings describing epoch fields. +% --> See the http://sccn.ucsd.edu/eeglab/maintut/eeglabscript.html for details +% +% ICA (or other linear) data components: +% EEG.icasphere - sphering array returned by linear (ICA) decomposition +% EEG.icaweights - unmixing weights array returned by linear (ICA) decomposition +% EEG.icawinv - inverse (ICA) weight matrix. Columns gives the projected +% topographies of the components to the electrodes. +% EEG.icaact - ICA activations matrix (components, frames, epochs) +% Note: [] here means that 'compute_ica' option has bee set +% to 0 under 'File > Memory options' In this case, +% component activations are computed only as needed. +% EEG.icasplinefile - location of the spline file used by headplot() to plot +% component scalp maps in 3-D +% EEG.chaninfo.icachansind - indices of channels used in the ICA decomposition +% EEG.dipfit - array of structures containing component map dipole models +% +% Variables indicating membership of the dataset in a studyset: +% EEG.subject - studyset subject code +% EEG.group - studyset group code +% EEG.condition - studyset experimental condition code +% EEG.session - studyset session number +% +% Variables used for manual and semi-automatic data rejection: +% EEG.specdata - data spectrum for every single trial +% EEG.specica - data spectrum for every single trial +% EEG.stats - statistics used for data rejection +% EEG.stats.kurtc - component kurtosis values +% EEG.stats.kurtg - global kurtosis of components +% EEG.stats.kurta - kurtosis of accepted epochs +% EEG.stats.kurtr - kurtosis of rejected epochs +% EEG.stats.kurtd - kurtosis of spatial distribution +% EEG.reject - statistics used for data rejection +% EEG.reject.entropy - entropy of epochs +% EEG.reject.entropyc - entropy of components +% EEG.reject.threshold - rejection thresholds +% EEG.reject.icareject - epochs rejected by ICA criteria +% EEG.reject.gcompreject - rejected ICA components +% EEG.reject.sigreject - epochs rejected by single-channel criteria +% EEG.reject.elecreject - epochs rejected by raw data criteria +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 01-26-02 chandeg events and trial condition format -ad +% 01-27-02 debug when trial condition is empty -ad +% 02-15-02 remove icawinv recompute for pop_epoch -ad & ja +% 02-16-02 remove last modification and test icawinv separatelly -ad +% 02-16-02 empty event and epoch check -ad +% 03-07-02 add the eeglab options -ad +% 03-07-02 corrected typos and rate/point calculation -ad & ja +% 03-15-02 add channel location reading & checking -ad +% 03-15-02 add checking of ICA and epochs with pop_up windows -ad +% 03-27-02 recorrected rate/point calculation -ad & sm + +function [EEG, res] = eeg_checkset( EEG, varargin ); +msg = ''; +res = 'no'; +com = sprintf('EEG = eeg_checkset( EEG );'); + +if nargin < 1 + help eeg_checkset; + return; +end; + +if isempty(EEG), return; end; +if ~isfield(EEG, 'data'), return; end; + +% checking multiple datasets +% -------------------------- +if length(EEG) > 1 + + if nargin > 1 + switch varargin{1} + case 'epochconsist', % test epoch consistency + % ---------------------- + res = 'no'; + datasettype = unique_bc( [ EEG.trials ] ); + if datasettype(1) == 1 & length(datasettype) == 1, return; % continuous data + elseif datasettype(1) == 1, return; % continuous and epoch data + end; + + allpnts = unique_bc( [ EEG.pnts ] ); + allxmin = unique_bc( [ EEG.xmin ] ); + if length(allpnts) == 1 & length(allxmin) == 1, res = 'yes'; end; + return; + + case 'chanconsist' % test channel number and name consistency + % ---------------------------------------- + res = 'yes'; + chanlen = unique_bc( [ EEG.nbchan ] ); + anyempty = unique_bc( cellfun( 'isempty', { EEG.chanlocs }) ); + if length(chanlen) == 1 & all(anyempty == 0) + tmpchanlocs = EEG(1).chanlocs; + channame1 = { tmpchanlocs.labels }; + for i = 2:length(EEG) + tmpchanlocs = EEG(i).chanlocs; + channame2 = { tmpchanlocs.labels }; + if length(intersect(channame1, channame2)) ~= length(channame1), res = 'no'; end; + end; + else res = 'no'; + end; + return; + + case 'icaconsist' % test ICA decomposition consistency + % ---------------------------------- + res = 'yes'; + anyempty = unique_bc( cellfun( 'isempty', { EEG.icaweights }) ); + if length(anyempty) == 1 & anyempty(1) == 0 + ica1 = EEG(1).icawinv; + for i = 2:length(EEG) + if ~isequal(EEG(1).icawinv, EEG(i).icawinv) + res = 'no'; + end; + end; + else res = 'no'; + end; + return; + + end; + end; + +end; + +% reading these option take time because +% of disk access +% -------------- +eeglab_options; + +% standard checking +% ----------------- +ALLEEG = EEG; +for inddataset = 1:length(ALLEEG) + + EEG = ALLEEG(inddataset); + + % additional checks + % ----------------- + res = -1; % error code + if ~isempty( varargin) + for index = 1:length( varargin ) + switch varargin{ index } + case 'data',; % already done at the top + case 'contdata',; + if EEG.trials > 1 + errordlg2(strvcat('Error: function only works on continuous data'), 'Error'); + return; + end; + case 'ica', + if isempty(EEG.icaweights) + errordlg2(strvcat('Error: no ICA decomposition. use menu "Tools > Run ICA" first.'), 'Error'); + return; + end; + case 'epoch', + if EEG.trials == 1 + errordlg2(strvcat('Extract epochs before running that function', 'Use Tools > Extract epochs'), 'Error'); + return + end; + case 'besa', + if ~isfield(EEG, 'sources') + errordlg2(strvcat('No dipole information', '1) Export component maps: Tools > Localize ... BESA > Export ...' ... + , '2) Run BESA to localize the equivalent dipoles', ... + '3) Import the BESA dipoles: Tools > Localize ... BESA > Import ...'), 'Error'); + return + end; + case 'event', + if isempty(EEG.event) + errordlg2(strvcat('Requires events. You need to add events first.', ... + 'Use "File > Import event info" or "File > Import epoch info"'), 'Error'); + return; + end; + case 'chanloc', + tmplocs = EEG.chanlocs; + if isempty(tmplocs) || ~isfield(tmplocs, 'theta') || all(cellfun('isempty', { tmplocs.theta })) + errordlg2( strvcat('This functionality requires channel location information.', ... + 'Enter the channel file name via "Edit > Edit dataset info".', ... + 'For channel file format, see ''>> help readlocs'' from the command line.'), 'Error'); + return; + end; + case 'chanlocs_homogeneous', + tmplocs = EEG.chanlocs; + if isempty(tmplocs) || ~isfield(tmplocs, 'theta') || all(cellfun('isempty', { tmplocs.theta })) + errordlg2( strvcat('This functionality requires channel location information.', ... + 'Enter the channel file name via "Edit > Edit dataset info".', ... + 'For channel file format, see ''>> help readlocs'' from the command line.'), 'Error'); + return; + end; + if ~isfield(EEG.chanlocs, 'X') || isempty(EEG.chanlocs(1).X) + EEG.chanlocs = convertlocs(EEG.chanlocs, 'topo2all'); + res = [ inputname(1) ' = eeg_checkset(' inputname(1) ', ''chanlocs_homogeneous'' ); ' ]; + end; + case 'chanlocsize', + if ~isempty(EEG.chanlocs) + if length(EEG.chanlocs) > EEG.nbchan + questdlg2(strvcat('Warning: there is one more electrode location than', ... + 'data channels. EEGLAB will consider the last electrode to be the', ... + 'common reference channel. If this is not the case, remove the', ... + 'extra channel'), 'Warning', 'Ok', 'Ok'); + end; + end; + case 'makeur', + if ~isempty(EEG.event) + if isfield(EEG.event, 'urevent'), + EEG.event = rmfield(EEG.event, 'urevent'); + disp('eeg_checkset note: re-creating the original event table (EEG.urevent)'); + else + disp('eeg_checkset note: creating the original event table (EEG.urevent)'); + end; + EEG.urevent = EEG.event; + for index = 1:length(EEG.event) + EEG.event(index).urevent = index; + end; + end; + case 'checkur', + if ~isempty(EEG.event) + if isfield(EEG.event, 'urevent') & ~isempty(EEG.urevent) + urlatencies = [ EEG.urevent.latency ]; + [newlat tmpind] = sort(urlatencies); + if ~isequal(newlat, urlatencies) + EEG.urevent = EEG.urevent(tmpind); + [tmp tmpind2] = sort(tmpind); + for index = 1:length(EEG.event) + EEG.event(index).urevent = tmpind2(EEG.event(index).urevent); + end; + end; + end; + end; + case 'eventconsistency', + [EEG res] = eeg_checkset(EEG); + if isempty(EEG.event), return; end; + + % check events (slow) + % ------------ + if isfield(EEG.event, 'type') + eventInds = arrayfun(@(x)isempty(x.type), EEG.event); + if any(eventInds) + if all(arrayfun(@(x)isnumeric(x.type), EEG.event)) + for ind = find(eventInds), EEG.event(ind).type = NaN; end; + else for ind = find(eventInds), EEG.event(ind).type = 'empty'; end; + end; + end; + if ~all(arrayfun(@(x)ischar(x.type), EEG.event)) && ~all(arrayfun(@(x)isnumeric(x.type), EEG.event)) + disp('Warning: converting all event types to strings'); + for ind = 1:length(EEG.event) + EEG.event(ind).type = num2str(EEG.event(ind).type); + end; + EEG = eeg_checkset(EEG, 'eventconsistency'); + end; + + end; + + % remove the events which latency are out of boundary + % --------------------------------------------------- + if isfield(EEG.event, 'latency') + if isfield(EEG.event, 'type') && ischar(EEG.event(1).type) + if strcmpi(EEG.event(1).type, 'boundary') & isfield(EEG.event, 'duration') + if EEG.event(1).duration < 1 + EEG.event(1) = []; + elseif EEG.event(1).latency > 0 & EEG.event(1).latency < 1 + EEG.event(1).latency = 0.5; + end; + end; + end; + + try, tmpevent = EEG.event; alllatencies = [ tmpevent.latency ]; + catch, error('Checkset: error empty latency entry for new events added by user'); + end; + I1 = find(alllatencies < 0.5); + I2 = find(alllatencies > EEG.pnts*EEG.trials+1); % The addition of 1 was included + % because, if data epochs are extracted from -1 to + % time 0, this allow to include the last event in + % the last epoch (otherwise all epochs have an + % event except the last one + if (length(I1) + length(I2)) > 0 + fprintf('eeg_checkset warning: %d/%d events had out-of-bounds latencies and were removed\n', ... + length(I1) + length(I2), length(EEG.event)); + EEG.event(union(I1, I2)) = []; + end; + end; + if isempty(EEG.event), return; end; + + % save information for non latency fields updates + % ----------------------------------------------- + difffield = []; + if ~isempty(EEG.event) && isfield(EEG.event, 'epoch') + % remove fields with empty epochs + % ------------------------------- + removeevent = []; + try, tmpevent = EEG.event; allepochs = [ tmpevent.epoch ]; + removeevent = find( allepochs < 1 | allepochs > EEG.trials); + if ~isempty(removeevent) + disp([ 'eeg_checkset warning: ' int2str(length(removeevent)) ' event had invalid epoch numbers and were removed']); + end; + catch, + for indexevent = 1:length(EEG.event) + if isempty( EEG.event(indexevent).epoch ) || ~isnumeric(EEG.event(indexevent).epoch) ... + | EEG.event(indexevent).epoch < 1 || EEG.event(indexevent).epoch > EEG.trials + removeevent = [removeevent indexevent]; + disp([ 'eeg_checkset warning: event ' int2str(indexevent) ' has an invalid epoch number: removed']); + end; + end; + end; + EEG.event(removeevent) = []; + tmpevent = EEG.event; + allepochs = [ tmpevent.epoch ]; + + % uniformize fields content for the different epochs + % -------------------------------------------------- + % THIS WAS REMOVED SINCE SOME FIELDS ARE ASSOCIATED WITH THE EVENT AND NOT WITH THE EPOCH + % I PUT IT BACK, BUT IT DOES NOT ERASE NON-EMPTY VALUES + difffield = fieldnames(EEG.event); + difffield = difffield(~(strcmp(difffield,'latency')|strcmp(difffield,'epoch')|strcmp(difffield,'type'))); + for index = 1:length(difffield) + tmpevent = EEG.event; + allvalues = { tmpevent.(difffield{index}) }; + try + valempt = cellfun('isempty', allvalues); + catch + valempt = mycellfun('isempty', allvalues); + end; + arraytmpinfo = cell(1,EEG.trials); + + % spetial case of duration + % ------------------------ + if strcmp( difffield{index}, 'duration') + if any(valempt) + fprintf(['eeg_checkset: found empty values for field ''' difffield{index} ... + ''' (filling with 0)\n']); + end; + for indexevent = find(valempt) + EEG.event(indexevent).duration = 0; + end; + else + + % get the field content + % --------------------- + indexevent = find(~valempt); + arraytmpinfo(allepochs(indexevent)) = allvalues(indexevent); + + % uniformize content for all epochs + % --------------------------------- + indexevent = find(valempt); + tmpevent = EEG.event; + [tmpevent(indexevent).(difffield{index})] = arraytmpinfo{allepochs(indexevent)}; + EEG.event = tmpevent; + if any(valempt) + fprintf(['eeg_checkset: found empty values for field ''' difffield{index} '''\n']); + fprintf([' filling with values of other events in the same epochs\n']); + end; + end; + end; + end; + if isempty(EEG.event), return; end; + + % uniformize fields (str or int) if necessary + % ------------------------------------------- + fnames = fieldnames(EEG.event); + for fidx = 1:length(fnames) + fname = fnames{fidx}; + tmpevent = EEG.event; + allvalues = { tmpevent.(fname) }; + try + % find indices of numeric values among values of this event property + valreal = ~cellfun('isclass', allvalues, 'char'); + catch + valreal = mycellfun('isclass', allvalues, 'double'); + end; + + format = 'ok'; + if ~all(valreal) % all valreal ok + format = 'str'; + if all(valreal == 0) % all valreal=0 ok + format = 'ok'; + end; + end; + if strcmp(format, 'str') + fprintf('eeg_checkset note: value format of event field ''%s'' made uniform\n', fname); + % get the field content + % --------------------- + for indexevent = 1:length(EEG.event) + if valreal(indexevent) + EEG.event = setfield(EEG.event, { indexevent }, fname, num2str(allvalues{indexevent}) ); + end; + end; + end; + end; + + % check boundary events + % --------------------- + tmpevent = EEG.event; + if isfield(tmpevent, 'type') && ~isnumeric(tmpevent(1).type) + allEventTypes = { tmpevent.type }; + boundsInd = strmatch('boundary', allEventTypes); + if ~isempty(boundsInd), + bounds = [ tmpevent(boundsInd).latency ]; + % remove last event if necessary + if EEG.trials==1;%this if block added by James Desjardins (Jan 13th, 2014) + if round(bounds(end)-0.5+1) >= size(EEG.data,2), EEG.event(boundsInd(end)) = []; bounds(end) = []; end; % remove final boundary if any + end + % The first boundary below need to be kept for + % urevent latency calculation + % if bounds(1) < 0, EEG.event(bounds(1)) = []; end; % remove initial boundary if any + indDoublet = find(bounds(2:end)-bounds(1:end-1)==0); + if ~isempty(indDoublet) + disp('Warning: duplicate boundary event removed'); + for indBound = 1:length(indDoublet) + EEG.event(boundsInd(indDoublet(indBound)+1)).duration = EEG.event(boundsInd(indDoublet(indBound)+1)).duration+EEG.event(boundsInd(indDoublet(indBound))).duration; + end; + EEG.event(boundsInd(indDoublet)) = []; + end; + end; + end; + if isempty(EEG.event), return; end; + + % check that numeric format is double (Matlab 7) + % ----------------------------------- + allfields = fieldnames(EEG.event); + if ~isempty(EEG.event) + for index = 1:length(allfields) + tmpval = EEG.event(1).(allfields{index}); + if isnumeric(tmpval) && ~isa(tmpval, 'double') + for indexevent = 1:length(EEG.event) + tmpval = getfield(EEG.event, { indexevent }, allfields{index} ); + EEG.event = setfield(EEG.event, { indexevent }, allfields{index}, double(tmpval)); + end; + end; + end; + end; + + % check duration field, replace empty by 0 + % ---------------------------------------- + if isfield(EEG.event, 'duration') + tmpevent = EEG.event; + try, valempt = cellfun('isempty' , { tmpevent.duration }); + catch, valempt = mycellfun('isempty', { tmpevent.duration }); + end; + if any(valempt), + for index = find(valempt) + EEG.event(index).duration = 0; + end; + end; + end; + + % resort events + % ------------- + if isfield(EEG.event, 'latency') + try, + if isfield(EEG.event, 'epoch') + TMPEEG = pop_editeventvals(EEG, 'sort', { 'epoch' 0 'latency' 0 }); + else + TMPEEG = pop_editeventvals(EEG, 'sort', { 'latency' 0 }); + end; + if ~isequal(TMPEEG.event, EEG.event) + EEG = TMPEEG; + disp('Event resorted by increasing latencies.'); + end; + catch, + disp('eeg_checkset: problem when attempting to resort event latencies.'); + end; + end; + + % check latency of first event + % ---------------------------- + if ~isempty(EEG.event) + if isfield(EEG.event, 'latency') + if EEG.event(1).latency < 0.5 + EEG.event(1).latency = 0.5; + end; + end; + end; + + % build epoch structure + % --------------------- + try, + if EEG.trials > 1 & ~isempty(EEG.event) + % erase existing event-related fields + % ------------------------------ + if ~isfield(EEG,'epoch') + EEG.epoch = []; + end + if ~isempty(EEG.epoch) + if length(EEG.epoch) ~= EEG.trials + disp('Warning: number of epoch entries does not match number of dataset trials;'); + disp(' user-defined epoch entries will be erased.'); + EEG.epoch = []; + else + fn = fieldnames(EEG.epoch); + EEG.epoch = rmfield(EEG.epoch,fn(strncmp('event',fn,5))); + end + end + + % set event field + % --------------- + tmpevent = EEG.event; + eventepoch = [tmpevent.epoch]; + epochevent = cell(1,EEG.trials); + destdata = epochevent; + EEG.epoch(length(epochevent)).event = []; + for k=1:length(epochevent) + epochevent{k} = find(eventepoch==k); + end + tmpepoch = EEG.epoch; + [tmpepoch.event] = epochevent{:}; + EEG.epoch = tmpepoch; + maxlen = max(cellfun(@length,epochevent)); + + % copy event information into the epoch array + % ------------------------------------------- + eventfields = fieldnames(EEG.event)'; + eventfields = eventfields(~strcmp(eventfields,'epoch')); + tmpevent = EEG.event; + for k = 1:length(eventfields) + fname = eventfields{k}; + switch fname + case 'latency' + sourcedata = round(eeg_point2lat([tmpevent.(fname)],[tmpevent.epoch],EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3) * 10^8 )/10^8; + sourcedata = num2cell(sourcedata); + case 'duration' + sourcedata = num2cell([tmpevent.(fname)]/EEG.srate*1000); + otherwise + sourcedata = {tmpevent.(fname)}; + end + if maxlen == 1 + destdata = cell(1,length(epochevent)); + destdata(~cellfun('isempty',epochevent)) = sourcedata([epochevent{:}]); + else + for l=1:length(epochevent) + destdata{l} = sourcedata(epochevent{l}); + end + end + tmpepoch = EEG.epoch; + [tmpepoch.(['event' fname])] = destdata{:}; + EEG.epoch = tmpepoch; + end + end; + catch, + errordlg2(['Warning: minor problem encountered when generating' 10 ... + 'the EEG.epoch structure (used only in user scripts)']); return; + end; + case { 'loaddata' 'savedata' 'chanconsist' 'icaconsist' 'epochconsist' }, res = ''; + otherwise, error('eeg_checkset: unknown option'); + end; + end; + end; + + res = []; + + % check name consistency + % ---------------------- + if ~isempty(EEG.setname) + if ~ischar(EEG.setname) + EEG.setname = ''; + else + if size(EEG.setname,1) > 1 + disp('eeg_checkset warning: invalid dataset name, removed'); + EEG.setname = ''; + end; + end; + else + EEG.setname = ''; + end; + + % checking history and convert if necessary + % ----------------------------------------- + if isfield(EEG, 'history') & size(EEG.history,1) > 1 + allcoms = cellstr(EEG.history); + EEG.history = deblank(allcoms{1}); + for index = 2:length(allcoms) + EEG.history = [ EEG.history 10 deblank(allcoms{index}) ]; + end; + end; + + % read data if necessary + % ---------------------- + if ischar(EEG.data) & nargin > 1 + if strcmpi(varargin{1}, 'loaddata') + + EEG.data = eeg_getdatact(EEG); + + end; + end; + + % save data if necessary + % ---------------------- + if nargin > 1 + + % datfile available? + % ------------------ + datfile = 0; + if isfield(EEG, 'datfile') + if ~isempty(EEG.datfile) + datfile = 1; + end; + end; + + % save data + % --------- + if strcmpi(varargin{1}, 'savedata') & option_storedisk + error('eeg_checkset: cannot call savedata any more'); + + % the code below is deprecated + if ~ischar(EEG.data) % not already saved + disp('Writing previous dataset to disk...'); + + if datfile + tmpdata = reshape(EEG.data, EEG.nbchan, EEG.pnts*EEG.trials); + floatwrite( tmpdata', fullfile(EEG.filepath, EEG.datfile), 'ieee-le'); + EEG.data = EEG.datfile; + end; + EEG.icaact = []; + + % saving dataset + % -------------- + filename = fullfile(EEG(1).filepath, EEG(1).filename); + if ~ischar(EEG.data) & option_single, EEG.data = single(EEG.data); end; + v = version; + if str2num(v(1)) >= 7, save( filename, '-v6', '-mat', 'EEG'); % Matlab 7 + else save( filename, '-mat', 'EEG'); + end; + if ~ischar(EEG.data), EEG.data = 'in set file'; end; + + res = sprintf('%s = eeg_checkset( %s, ''savedata'');', inputname(1), inputname(1)); + end; + end; + end; + + % numerical format + % ---------------- + if isnumeric(EEG.data) + v = version; + EEG.icawinv = double(EEG.icawinv); % required for dipole fitting, otherwise it crashes + EEG.icaweights = double(EEG.icaweights); + EEG.icasphere = double(EEG.icasphere); + if ~isempty(findstr(v, 'R11')) | ~isempty(findstr(v, 'R12')) | ~isempty(findstr(v, 'R13')) + EEG.data = double(EEG.data); + EEG.icaact = double(EEG.icaact); + else + try, + if isa(EEG.data, 'double') & option_single + EEG.data = single(EEG.data); + EEG.icaact = single(EEG.icaact); + end; + catch, + disp('WARNING: EEGLAB ran out of memory while converting dataset to single precision.'); + disp(' Save dataset (preferably saving data to a separate file; see File > Memory options).'); + disp(' Then reload it.'); + end; + end; + end; + + % verify the type of the variables + % -------------------------------- + % data dimensions ------------------------- + if isnumeric(EEG.data) && ~isempty(EEG.data) + if ~isequal(size(EEG.data,1), EEG.nbchan) + disp( [ 'eeg_checkset warning: number of columns in data (' int2str(size(EEG.data,1)) ... + ') does not match the number of channels (' int2str(EEG.nbchan) '): corrected' ]); + res = com; + EEG.nbchan = size(EEG.data,1); + end; + + if (ndims(EEG.data)) < 3 & (EEG.pnts > 1) + if mod(size(EEG.data,2), EEG.pnts) ~= 0 + if popask( [ 'eeg_checkset error: the number of frames does not divide the number of columns in the data.' 10 ... + 'Should EEGLAB attempt to abort operation ?' 10 '(press Cancel to fix the problem from the command line)']) + error('eeg_checkset error: user abort'); + %res = com; + %EEG.pnts = size(EEG.data,2); + %EEG = eeg_checkset(EEG); + %return; + else + res = com; + return; + %error( 'eeg_checkset error: number of points does not divide the number of columns in data'); + end; + else + if EEG.trials > 1 + disp( 'eeg_checkset note: data array made 3-D'); + res = com; + end; + if size(EEG.data,2) ~= EEG.pnts + EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts, size(EEG.data,2)/EEG.pnts); + end; + end; + end; + + % size of data ----------- + if size(EEG.data,3) ~= EEG.trials + disp( ['eeg_checkset warning: 3rd dimension size of data (' int2str(size(EEG.data,3)) ... + ') does not match the number of epochs (' int2str(EEG.trials) '), corrected' ]); + res = com; + EEG.trials = size(EEG.data,3); + end; + if size(EEG.data,2) ~= EEG.pnts + disp( [ 'eeg_checkset warning: number of columns in data (' int2str(size(EEG.data,2)) ... + ') does not match the number of points (' int2str(EEG.pnts) '): corrected' ]); + res = com; + EEG.pnts = size(EEG.data,2); + end; + end; + + % parameters consistency + % ------------------------- + if round(EEG.srate*(EEG.xmax-EEG.xmin)+1) ~= EEG.pnts + fprintf( 'eeg_checkset note: upper time limit (xmax) adjusted so (xmax-xmin)*srate+1 = number of frames\n'); + if EEG.srate == 0 + EEG.srate = 1; + end; + EEG.xmax = (EEG.pnts-1)/EEG.srate+EEG.xmin; + res = com; + end; + + % deal with event arrays + % ---------------------- + if ~isfield(EEG, 'event'), EEG.event = []; res = com; end; + if ~isempty(EEG.event) + if EEG.trials > 1 & ~isfield(EEG.event, 'epoch') + if popask( [ 'eeg_checkset error: the event info structure does not contain an ''epoch'' field.' ... + 'Should EEGLAB attempt to abort operation ?' 10 '(press Cancel to fix the problem from the commandline)']) + error('eeg_checkset error(): user abort'); + %res = com; + %EEG.event = []; + %EEG = eeg_checkset(EEG); + %return; + else + res = com; + return; + %error('eeg_checkset error: no epoch field in event structure'); + end; + end; + else + EEG.event = []; + end; + if isempty(EEG.event) + EEG.eventdescription = {}; + end; + if ~isfield(EEG, 'eventdescription') | ~iscell(EEG.eventdescription) + EEG.eventdescription = cell(1, length(fieldnames(EEG.event))); + res = com; + else + if ~isempty(EEG.event) + if length(EEG.eventdescription) > length( fieldnames(EEG.event)) + EEG.eventdescription = EEG.eventdescription(1:length( fieldnames(EEG.event))); + elseif length(EEG.eventdescription) < length( fieldnames(EEG.event)) + EEG.eventdescription(end+1:length( fieldnames(EEG.event))) = {''}; + end; + end; + end; + % create urevent if continuous data + % --------------------------------- + %if ~isempty(EEG.event) & ~isfield(EEG, 'urevent') + % EEG.urevent = EEG.event; + % disp('eeg_checkset note: creating the original event table (EEG.urevent)'); + % for index = 1:length(EEG.event) + % EEG.event(index).urevent = index; + % end; + %end; + if isfield(EEG, 'urevent') & isfield(EEG.urevent, 'urevent') + EEG.urevent = rmfield(EEG.urevent, 'urevent'); + end; + + % deal with epoch arrays + % ---------------------- + if ~isfield(EEG, 'epoch'), EEG.epoch = []; res = com; end; + + % check if only one epoch + % ----------------------- + if EEG.trials == 1 + if isfield(EEG.event, 'epoch') + EEG.event = rmfield(EEG.event, 'epoch'); res = com; + end; + if ~isempty(EEG.epoch) + EEG.epoch = []; res = com; + end; + end; + + if ~isfield(EEG, 'epochdescription'), EEG.epochdescription = {}; res = com; end; + if ~isempty(EEG.epoch) + if isstruct(EEG.epoch), l = length( EEG.epoch); + else l = size( EEG.epoch, 2); + end; + if l ~= EEG.trials + if popask( [ 'eeg_checkset error: the number of epoch indices in the epoch array/struct (' ... + int2str(l) ') is different from the number of epochs in the data (' int2str(EEG.trials) ').' 10 ... + 'Should EEGLAB attempt to abort operation ?' 10 '(press Cancel to fix the problem from the commandline)']) + error('eeg_checkset error: user abort'); + %res = com; + %EEG.epoch = []; + %EEG = eeg_checkset(EEG); + %return; + else + res = com; + return; + %error('eeg_checkset error: epoch structure size invalid'); + end; + end; + else + EEG.epoch = []; + end; + + % check ica + % --------- + if ~isfield(EEG, 'icachansind') + if isempty(EEG.icaweights) + EEG.icachansind = []; res = com; + else + EEG.icachansind = [1:EEG.nbchan]; res = com; + end; + elseif isempty(EEG.icachansind) + if isempty(EEG.icaweights) + EEG.icachansind = []; res = com; + else + EEG.icachansind = [1:EEG.nbchan]; res = com; + end; + end; + if ~isempty(EEG.icasphere) + if ~isempty(EEG.icaweights) + if size(EEG.icaweights,2) ~= size(EEG.icasphere,1) + if popask( [ 'eeg_checkset error: number of columns in weights array (' int2str(size(EEG.icaweights,2)) ')' 10 ... + 'does not match the number of rows in the sphere array (' int2str(size(EEG.icasphere,1)) ')' 10 ... + 'Should EEGLAB remove ICA information ?' 10 '(press Cancel to fix the problem from the commandline)']) + res = com; + EEG.icasphere = []; + EEG.icaweights = []; + EEG = eeg_checkset(EEG); + return; + else + error('eeg_checkset error: user abort'); + res = com; + return; + %error('eeg_checkset error: invalid weight and sphere array sizes'); + end; + end; + if isnumeric(EEG.data) + if length(EEG.icachansind) ~= size(EEG.icasphere,2) + if popask( [ 'eeg_checkset error: number of elements in ''icachansind'' (' int2str(length(EEG.icachansind)) ')' 10 ... + 'does not match the number of columns in the sphere array (' int2str(size(EEG.icasphere,2)) ')' 10 ... + 'Should EEGLAB remove ICA information ?' 10 '(press Cancel to fix the problem from the commandline)']) + res = com; + EEG.icasphere = []; + EEG.icaweights = []; + EEG = eeg_checkset(EEG); + return; + else + error('eeg_checkset error: user abort'); + res = com; + return; + %error('eeg_checkset error: invalid weight and sphere array sizes'); + end; + end; + if isempty(EEG.icaact) | (size(EEG.icaact,1) ~= size(EEG.icaweights,1)) | (size(EEG.icaact,2) ~= size(EEG.data,2)) + EEG.icaweights = double(EEG.icaweights); + EEG.icawinv = double(EEG.icawinv); + + % scale ICA components to RMS microvolt + if option_scaleicarms + if ~isempty(EEG.icawinv) + if mean(mean(abs(pinv(EEG.icaweights * EEG.icasphere)-EEG.icawinv))) < 0.0001 + disp('Scaling components to RMS microvolt'); + scaling = repmat(sqrt(mean(EEG(1).icawinv(:,:).^2))', [1 size(EEG.icaweights,2)]); + EEG.etc.icaweights_beforerms = EEG.icaweights; + EEG.etc.icasphere_beforerms = EEG.icasphere; + + EEG.icaweights = EEG.icaweights .* scaling; + EEG.icawinv = pinv(EEG.icaweights * EEG.icasphere); + end; + end; + end; + + if ~isempty(EEG.data) && option_computeica + fprintf('eeg_checkset: recomputing the ICA activation matrix ...\n'); + res = com; + % Make compatible with Matlab 7 + if any(isnan(EEG.data(:))) + tmpdata = EEG.data(EEG.icachansind,:); + fprintf('eeg_checkset: recomputing ICA ignoring NaN indices ...\n'); + tmpindices = find(~sum(isnan(tmpdata))); % was: tmpindices = find(~isnan(EEG.data(1,:))); + EEG.icaact = zeros(size(EEG.icaweights,1), size(tmpdata,2)); EEG.icaact(:) = NaN; + EEG.icaact(:,tmpindices) = (EEG.icaweights*EEG.icasphere)*tmpdata(:,tmpindices); + else + EEG.icaact = (EEG.icaweights*EEG.icasphere)*EEG.data(EEG.icachansind,:); % automatically does single or double + end; + EEG.icaact = reshape( EEG.icaact, size(EEG.icaact,1), EEG.pnts, EEG.trials); + end; + end; + end; + if isempty(EEG.icawinv) + EEG.icawinv = pinv(EEG.icaweights*EEG.icasphere); % a priori same result as inv + res = com; + end; + else + disp( [ 'eeg_checkset warning: weights matrix cannot be empty if sphere matrix is not, correcting ...' ]); + res = com; + EEG.icasphere = []; + end; + if option_computeica + if ~isempty(EEG.icaact) & ndims(EEG.icaact) < 3 & (EEG.trials > 1) + disp( [ 'eeg_checkset note: independent component made 3-D' ]); + res = com; + EEG.icaact = reshape(EEG.icaact, size(EEG.icaact,1), EEG.pnts, EEG.trials); + end; + else + if ~isempty(EEG.icaact) + fprintf('eeg_checkset: removing ICA activation matrix (as per edit options) ...\n'); + end; + EEG.icaact = []; + end; + else + if ~isempty( EEG.icaweights ), EEG.icaweights = []; res = com; end; + if ~isempty( EEG.icawinv ), EEG.icawinv = []; res = com; end; + if ~isempty( EEG.icaact ), EEG.icaact = []; res = com; end; + end; + if isempty(EEG.icaact) + EEG.icaact = []; + end; + + % ------------- + % check chanlocs + % ------------- + if ~isfield(EEG, 'chaninfo') + EEG.chaninfo = []; + end; + if ~isempty( EEG.chanlocs ) + + % reference (use EEG structure) + % --------- + if ~isfield(EEG, 'ref'), EEG.ref = ''; end; + if strcmpi(EEG.ref, 'averef') + ref = 'average'; + else ref = ''; + end; + if ~isfield( EEG.chanlocs, 'ref') + EEG.chanlocs(1).ref = ref; + end; + charrefs = cellfun('isclass',{EEG.chanlocs.ref},'char'); + if any(charrefs) ref = ''; end + for tmpind = find(~charrefs) + EEG.chanlocs(tmpind).ref = ref; + end + if ~isstruct( EEG.chanlocs) + if exist( EEG.chanlocs ) ~= 2 + disp( [ 'eeg_checkset warning: channel file does not exist or is not in Matlab path: filename removed from EEG struct' ]); + EEG.chanlocs = []; + res = com; + else + res = com; + try, EEG.chanlocs = readlocs( EEG.chanlocs ); + disp( [ 'eeg_checkset: channel file read' ]); + catch, EEG.chanlocs = []; end; + end; + else + if ~isfield(EEG.chanlocs,'labels') + disp('eeg_checkset warning: no field label in channel location structure, removing it'); + EEG.chanlocs = []; + res = com; + end; + end; + if isstruct( EEG.chanlocs) + if length( EEG.chanlocs) ~= EEG.nbchan && length( EEG.chanlocs) ~= EEG.nbchan+1 && ~isempty(EEG.data) + disp( [ 'eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed' ]); + EEG.chanlocs = []; + res = com; + end; + end; + + % force Nosedir to +X (done here because of DIPFIT) + % ------------------- + if isfield(EEG.chaninfo, 'nosedir') + if strcmpi(EEG.chaninfo.nosedir, '+x') + rotate = 0; + elseif all(isfield(EEG.chanlocs,{'X','Y','theta','sph_theta'})) + disp('EEG checkset note for expert users: Noze direction now set to default +X in EEG.chanlocs and EEG.dipfit.'); + if strcmpi(EEG.chaninfo.nosedir, '+y') + rotate = 270; + elseif strcmpi(EEG.chaninfo.nosedir, '-x') + rotate = 180; + else rotate = 90; + end; + for index = 1:length(EEG.chanlocs) + if ~isempty(EEG.chanlocs(index).theta) + rotategrad = rotate/180*pi; + coord = (EEG.chanlocs(index).Y + EEG.chanlocs(index).X*sqrt(-1))*exp(sqrt(-1)*-rotategrad); + EEG.chanlocs(index).Y = real(coord); + EEG.chanlocs(index).X = imag(coord); + + EEG.chanlocs(index).theta = EEG.chanlocs(index).theta -rotate; + EEG.chanlocs(index).sph_theta = EEG.chanlocs(index).sph_theta+rotate; + if EEG.chanlocs(index).theta <-180, EEG.chanlocs(index).theta =EEG.chanlocs(index).theta +360; end; + if EEG.chanlocs(index).sph_theta>180 , EEG.chanlocs(index).sph_theta=EEG.chanlocs(index).sph_theta-360; end; + end; + end; + + if isfield(EEG, 'dipfit') + if isfield(EEG.dipfit, 'coord_transform') + if isempty(EEG.dipfit.coord_transform) + EEG.dipfit.coord_transform = [0 0 0 0 0 0 1 1 1]; + end; + EEG.dipfit.coord_transform(6) = EEG.dipfit.coord_transform(6)+rotategrad; + end; + end; + + end; + EEG.chaninfo.nosedir = '+X'; + end; + + % general checking of channels + % ---------------------------- + EEG = eeg_checkchanlocs(EEG); + if EEG.nbchan ~= length(EEG.chanlocs) + EEG.chanlocs = []; + EEG.chaninfo = []; + disp('Warning: the size of the channel location structure does not match with'); + disp(' number of channels. Channel information have been removed.'); + end; + end; + EEG.chaninfo.icachansind = EEG.icachansind; % just a copy for programming convinience + + %if ~isfield(EEG, 'urchanlocs') + % EEG.urchanlocs = EEG.chanlocs; + % for index = 1:length(EEG.chanlocs) + % EEG.chanlocs(index).urchan = index; + % end; + % disp('eeg_checkset note: creating backup chanlocs structure (urchanlocs)'); + %end; + + % check reference + % --------------- + if ~isfield(EEG, 'ref') + EEG.ref = 'common'; + end; + if ischar(EEG.ref) & strcmpi(EEG.ref, 'common') + if length(EEG.chanlocs) > EEG.nbchan + disp('Extra common reference electrode location detected'); + EEG.ref = EEG.nbchan+1; + end; + end; + + % DIPFIT structure + % ---------------- + if ~isfield(EEG,'dipfit') || isempty(EEG.dipfit) + EEG.dipfit = []; res = com; + else + try + % check if dipfitdefs is present + dipfitdefs; + if isfield(EEG.dipfit, 'vol') & ~isfield(EEG.dipfit, 'hdmfile') + if exist('pop_dipfit_settings') + disp('Old DIPFIT structure detected: converting to DIPFIT 2 format'); + EEG.dipfit.hdmfile = template_models(1).hdmfile; + EEG.dipfit.coordformat = template_models(1).coordformat; + EEG.dipfit.mrifile = template_models(1).mrifile; + EEG.dipfit.chanfile = template_models(1).chanfile; + EEG.dipfit.coord_transform = []; + EEG.saved = 'no'; + res = com; + end; + end; + if isfield(EEG.dipfit, 'hdmfile') + if length(EEG.dipfit.hdmfile) > 8 + if strcmpi(EEG.dipfit.hdmfile(end-8), template_models(1).hdmfile(end-8)), EEG.dipfit.hdmfile = template_models(1).hdmfile; end; + if strcmpi(EEG.dipfit.hdmfile(end-8), template_models(2).hdmfile(end-8)), EEG.dipfit.hdmfile = template_models(2).hdmfile; end; + end; + if length(EEG.dipfit.mrifile) > 8 + if strcmpi(EEG.dipfit.mrifile(end-8), template_models(1).mrifile(end-8)), EEG.dipfit.mrifile = template_models(1).mrifile; end; + if strcmpi(EEG.dipfit.mrifile(end-8), template_models(2).mrifile(end-8)), EEG.dipfit.mrifile = template_models(2).mrifile; end; + end; + if length(EEG.dipfit.chanfile) > 8 + if strcmpi(EEG.dipfit.chanfile(end-8), template_models(1).chanfile(end-8)), EEG.dipfit.chanfile = template_models(1).chanfile; end; + if strcmpi(EEG.dipfit.chanfile(end-8), template_models(2).chanfile(end-8)), EEG.dipfit.chanfile = template_models(2).chanfile; end; + end; + end; + + if isfield(EEG.dipfit, 'coord_transform') + if isempty(EEG.dipfit.coord_transform) + EEG.dipfit.coord_transform = [0 0 0 0 0 0 1 1 1]; + end; + elseif ~isempty(EEG.dipfit) + EEG.dipfit.coord_transform = [0 0 0 0 0 0 1 1 1]; + end; + catch + e = lasterror; + if ~strcmp(e.identifier,'MATLAB:UndefinedFunction') + % if we got some error aside from dipfitdefs not being present, rethrow it + rethrow(e); + end + end + end; + + % check events (fast) + % ------------ + if isfield(EEG.event, 'type') + tmpevent = EEG.event(1:min(length(EEG.event), 100)); + if ~all(cellfun(@ischar, { tmpevent.type })) && ~all(cellfun(@isnumeric, { tmpevent.type })) + disp('Warning: converting all event types to strings'); + for ind = 1:length(EEG.event) + EEG.event(ind).type = num2str(EEG.event(ind).type); + end; + EEG = eeg_checkset(EEG, 'eventconsistency'); + end; + end; + + % EEG.times (only for epoched datasets) + % --------- + if ~isfield(EEG, 'times') || isempty(EEG.times) || length(EEG.times) ~= EEG.pnts + EEG.times = linspace(EEG.xmin*1000, EEG.xmax*1000, EEG.pnts); + end; + + if ~isfield(EEG, 'history') EEG.history = ''; res = com; end; + if ~isfield(EEG, 'splinefile') EEG.splinefile = ''; res = com; end; + if ~isfield(EEG, 'icasplinefile') EEG.icasplinefile = ''; res = com; end; + if ~isfield(EEG, 'saved') EEG.saved = 'no'; res = com; end; + if ~isfield(EEG, 'subject') EEG.subject = ''; res = com; end; + if ~isfield(EEG, 'condition') EEG.condition = ''; res = com; end; + if ~isfield(EEG, 'group') EEG.group = ''; res = com; end; + if ~isfield(EEG, 'session') EEG.session = []; res = com; end; + if ~isfield(EEG, 'urchanlocs') EEG.urchanlocs = []; res = com; end; + if ~isfield(EEG, 'specdata') EEG.specdata = []; res = com; end; + if ~isfield(EEG, 'specicaact') EEG.specicaact = []; res = com; end; + if ~isfield(EEG, 'comments') EEG.comments = ''; res = com; end; + if ~isfield(EEG, 'etc' ) EEG.etc = []; res = com; end; + if ~isfield(EEG, 'urevent' ) EEG.urevent = []; res = com; end; + if ~isfield(EEG, 'ref') | isempty(EEG.ref) EEG.ref = 'common'; res = com; end; + + % create fields if absent + % ----------------------- + if ~isfield(EEG, 'reject') EEG.reject.rejjp = []; res = com; end; + + listf = { 'rejjp' 'rejkurt' 'rejmanual' 'rejthresh' 'rejconst', 'rejfreq' ... + 'icarejjp' 'icarejkurt' 'icarejmanual' 'icarejthresh' 'icarejconst', 'icarejfreq'}; + for index = 1:length(listf) + name = listf{index}; + elecfield = [name 'E']; + if ~isfield(EEG.reject, elecfield), EEG.reject.(elecfield) = []; res = com; end; + if ~isfield(EEG.reject, name) + EEG.reject.(name) = []; + res = com; + elseif ~isempty(EEG.reject.(name)) && isempty(EEG.reject.(elecfield)) + % check if electrode array is empty with rejection array is not + nbchan = fastif(strcmp(name, 'ica'), size(EEG.icaweights,1), EEG.nbchan); + EEG.reject = setfield(EEG.reject, elecfield, zeros(nbchan, length(getfield(EEG.reject, name)))); res = com; + end; + end; + if ~isfield(EEG.reject, 'rejglobal') EEG.reject.rejglobal = []; res = com; end; + if ~isfield(EEG.reject, 'rejglobalE') EEG.reject.rejglobalE = []; res = com; end; + + % default colors for rejection + % ---------------------------- + if ~isfield(EEG.reject, 'rejmanualcol') EEG.reject.rejmanualcol = [1.0000 1 0.783]; res = com; end; + if ~isfield(EEG.reject, 'rejthreshcol') EEG.reject.rejthreshcol = [0.8487 1.0000 0.5008]; res = com; end; + if ~isfield(EEG.reject, 'rejconstcol') EEG.reject.rejconstcol = [0.6940 1.0000 0.7008]; res = com; end; + if ~isfield(EEG.reject, 'rejjpcol') EEG.reject.rejjpcol = [1.0000 0.6991 0.7537]; res = com; end; + if ~isfield(EEG.reject, 'rejkurtcol') EEG.reject.rejkurtcol = [0.6880 0.7042 1.0000]; res = com; end; + if ~isfield(EEG.reject, 'rejfreqcol') EEG.reject.rejfreqcol = [0.9596 0.7193 1.0000]; res = com; end; + if ~isfield(EEG.reject, 'disprej') EEG.reject.disprej = { }; end; + + if ~isfield(EEG, 'stats') EEG.stats.jp = []; res = com; end; + if ~isfield(EEG.stats, 'jp') EEG.stats.jp = []; res = com; end; + if ~isfield(EEG.stats, 'jpE') EEG.stats.jpE = []; res = com; end; + if ~isfield(EEG.stats, 'icajp') EEG.stats.icajp = []; res = com; end; + if ~isfield(EEG.stats, 'icajpE') EEG.stats.icajpE = []; res = com; end; + if ~isfield(EEG.stats, 'kurt') EEG.stats.kurt = []; res = com; end; + if ~isfield(EEG.stats, 'kurtE') EEG.stats.kurtE = []; res = com; end; + if ~isfield(EEG.stats, 'icakurt') EEG.stats.icakurt = []; res = com; end; + if ~isfield(EEG.stats, 'icakurtE') EEG.stats.icakurtE = []; res = com; end; + + % component rejection + % ------------------- + if ~isfield(EEG.stats, 'compenta') EEG.stats.compenta = []; res = com; end; + if ~isfield(EEG.stats, 'compentr') EEG.stats.compentr = []; res = com; end; + if ~isfield(EEG.stats, 'compkurta') EEG.stats.compkurta = []; res = com; end; + if ~isfield(EEG.stats, 'compkurtr') EEG.stats.compkurtr = []; res = com; end; + if ~isfield(EEG.stats, 'compkurtdist') EEG.stats.compkurtdist = []; res = com; end; + if ~isfield(EEG.reject, 'threshold') EEG.reject.threshold = [0.8 0.8 0.8]; res = com; end; + if ~isfield(EEG.reject, 'threshentropy') EEG.reject.threshentropy = 600; res = com; end; + if ~isfield(EEG.reject, 'threshkurtact') EEG.reject.threshkurtact = 600; res = com; end; + if ~isfield(EEG.reject, 'threshkurtdist') EEG.reject.threshkurtdist = 600; res = com; end; + if ~isfield(EEG.reject, 'gcompreject') EEG.reject.gcompreject = []; res = com; end; + if length(EEG.reject.gcompreject) ~= size(EEG.icaweights,1) + EEG.reject.gcompreject = zeros(1, size(EEG.icaweights,1)); + end; + + % remove old fields + % ----------------- + if isfield(EEG, 'averef'), EEG = rmfield(EEG, 'averef'); end; + if isfield(EEG, 'rt' ), EEG = rmfield(EEG, 'rt'); end; + + % store in new structure + % ---------------------- + if isstruct(EEG) + if ~exist('ALLEEGNEW','var') + ALLEEGNEW = EEG; + else + ALLEEGNEW(inddataset) = EEG; + end; + end; +end; + +% recorder fields +% --------------- +fieldorder = { 'setname' ... + 'filename' ... + 'filepath' ... + 'subject' ... + 'group' ... + 'condition' ... + 'session' ... + 'comments' ... + 'nbchan' ... + 'trials' ... + 'pnts' ... + 'srate' ... + 'xmin' ... + 'xmax' ... + 'times' ... + 'data' ... + 'icaact' ... + 'icawinv' ... + 'icasphere' ... + 'icaweights' ... + 'icachansind' ... + 'chanlocs' ... + 'urchanlocs' ... + 'chaninfo' ... + 'ref' ... + 'event' ... + 'urevent' ... + 'eventdescription' ... + 'epoch' ... + 'epochdescription' ... + 'reject' ... + 'stats' ... + 'specdata' ... + 'specicaact' ... + 'splinefile' ... + 'icasplinefile' ... + 'dipfit' ... + 'history' ... + 'saved' ... + 'etc' }; + +for fcell = fieldnames(EEG)' + fname = fcell{1}; + if ~any(strcmp(fieldorder,fname)) + fieldorder{end+1} = fname; + end +end + +try + ALLEEGNEW = orderfields(ALLEEGNEW, fieldorder); + EEG = ALLEEGNEW; +catch + disp('Couldn''t order data set fields properly.'); +end; + +if exist('ALLEEGNEW','var') + EEG = ALLEEGNEW; +end; + +if ~isa(EEG, 'eegobj') && option_eegobject + EEG = eegobj(EEG); +end; + +return; + +function num = popask( text ) +ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); +switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; +end; + +function res = mycellfun(com, vals, classtype); +res = zeros(1, length(vals)); +switch com + case 'isempty', + for index = 1:length(vals), res(index) = isempty(vals{index}); end; + case 'isclass' + if strcmp(classtype, 'double') + for index = 1:length(vals), res(index) = isnumeric(vals{index}); end; + else + error('unknown cellfun command'); + end; + otherwise error('unknown cellfun command'); +end; + + diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_eval.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_eval.m new file mode 100644 index 0000000..1ab1412 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_eval.m @@ -0,0 +1,116 @@ +% eeg_eval() - apply eeglab function to a collection of input datasets +% +% Usage: +% >> OUTEEG = eeg_eval(funcname, INEEG, 'key1', value1, 'key2', value2 ...); +% +% Inputs: +% funcname - [string] name of the function +% INEEG - EEGLAB input dataset(s) +% +% Optional inputs +% 'params' - [cell array] funcname parameters. +% 'warning' - ['on'|'off'] warning pop-up window if several dataset +% stored on disk that will be automatically overwritten. +% Default is 'on'. +% +% Outputs: +% OUTEEG - output dataset(s) +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2005 +% +% see also: eeglab() + +% Copyright (C) 2005 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = eeg_eval( funcname, EEG, varargin); + + com = ''; + if nargin < 2 + help eeg_eval; + return; + end; + + % check input parameters + % ---------------------- + g = finputcheck( varargin, { 'params' 'cell' {} {}; + 'warning' 'string' { 'on','off' } 'on' }, 'eeg_eval'); + if isstr(g), error(g); end; + + % warning pop up + % -------------- + eeglab_options; + if strcmpi(g.warning, 'on') + if ~option_storedisk + res = questdlg2(strvcat( 'When processing multiple datasets, it is not', ... + 'possible to enter new names for the newly created', ... + 'datasets and old datasets are overwritten.', ... + 'You may still cancel this operation though.'), ... + 'Multiple dataset warning', 'Cancel', 'Proceed', 'Proceed'); + else + res = questdlg2( [ 'Data files on disk will be automatically overwritten.' 10 ... + 'Are you sure you want to proceed with this operation?' ], ... + 'Confirmation', 'Cancel', 'Proceed', 'Proceed'); + end; + switch lower(res), + case 'cancel', return; + case 'proceed',; + end; + end; + + % execute function + % ---------------- + v = version; + if str2num(v(1)) == '5' % Matlab 5 + command = [ 'TMPEEG = ' funcname '( TMPEEG, ' vararg2str(g.params) ');' ]; + else + eval( [ 'func = @' funcname ';' ] ); + end; + + NEWEEG = []; + for i = 1:length(EEG) + fprintf('Processing group dataset %d of %d named: %s ****************\n', i, length(EEG), EEG(i).setname); + TMPEEG = eeg_retrieve(EEG, i); + if v(1) == '5', eval(command); % Matlab 5 + else TMPEEG = feval(func, TMPEEG, g.params{:}); % Matlab 6 and higher + end; + TMPEEG = eeg_checkset(TMPEEG); + TMPEEG.saved = 'no'; + if option_storedisk + TMPEEG = pop_saveset(TMPEEG, 'savemode', 'resave'); + TMPEEG = update_datafield(TMPEEG); + end; + NEWEEG = eeg_store(NEWEEG, TMPEEG, i); + if option_storedisk + NEWEEG(i).saved = 'yes'; % eeg_store by default set it to no + end; + end; + EEG = NEWEEG; + + % history + % ------- + if nargout > 1 + com = sprintf('%s = %s( %s,%s);', funcname, inputname(2), funcname, inputname(2), vararg2str(g.params)); + end; + +function EEG = update_datafield(EEG); + if ~isfield(EEG, 'datfile'), EEG.datfile = ''; end; + if ~isempty(EEG.datfile) + EEG.data = EEG.datfile; + else + EEG.data = 'in set file'; + end; + EEG.icaact = []; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_getdatact.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_getdatact.m new file mode 100644 index 0000000..66c113d --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_getdatact.m @@ -0,0 +1,321 @@ +% eeg_getdatact() - get EEG data from a specified dataset or +% component activity +% +% Usage: +% >> signal = eeg_getdatact( EEG ); +% >> signal = eeg_getdatact( EEG, 'key', 'val'); +% +% Inputs: +% EEG - Input dataset +% +% Optional input: +% 'channel' - [integer array] read only specific channels. +% Default is to read all data channels. +% 'component' - [integer array] read only specific components +% 'projchan' - [integer or cell array] channel(s) onto which the component +% should be projected. +% 'rmcomps' - [integer array] remove selected components from data +% channels. This is only to be used with channel data not +% when selecting components. +% 'trialindices' - [integer array] only read specific trials. Default is +% to read all trials. +% 'samples' - [integer array] only read specific samples. Default is +% to read all samples. +% 'reshape' - ['2d'|'3d'] reshape data. Default is '3d' when possible. +% 'verbose' - ['on'|'off'] verbose mode. Default is 'on'. +% +% Outputs: +% signal - EEG data or component activity +% +% Author: Arnaud Delorme, SCCN & CERCO, CNRS, 2008- +% +% See also: eeg_checkset() + +% Copyright (C) 15 Feb 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [data boundaries] = eeg_getdatact( EEG, varargin); + +data = []; +if nargin < 1 + help eeg_getdatact; + return; +end; + +% reading data from several datasets and concatening it +% ----------------------------------------------------- +if iscell(EEG) || (~isstr(EEG) && length(EEG) > 1) + % decode some arguments + % --------------------- + trials = cell(1,length(EEG)); + rmcomps = cell(1,length(EEG)); + for iArg = length(varargin)-1:-2:1 + if strcmpi(varargin{iArg}, 'trialindices') + trials = varargin{iArg+1}; + varargin(iArg:iArg+1) = []; + elseif strcmpi(varargin{iArg}, 'rmcomps') + rmcomps = varargin{iArg+1}; + varargin(iArg:iArg+1) = []; + end; + end; + if isnumeric(rmcomps), rmtmp = rmcomps; rmcomps = cell(1,length(EEG)); rmcomps(:) = { rmtmp }; end; + + % concatenate datasets + % -------------------- + data = []; + boundaries = []; + for dat = 1:length(EEG) + if iscell(EEG) + [tmpdata datboundaries] = eeg_getdatact(EEG{dat}, 'trialindices', trials{dat}, 'rmcomps', rmcomps{dat}, varargin{:} ); + else [tmpdata datboundaries] = eeg_getdatact(EEG(dat), 'trialindices', trials{dat}, 'rmcomps', rmcomps{dat}, varargin{:} ); + end; + if isempty(data), + data = tmpdata; + boundaries = datboundaries; + else + if all([ EEG.trials ] == 1) % continuous data + if size(data,1) ~= size(tmpdata,1), error('Datasets to be concatenated do not have the same number of channels'); end; + + % adding boundaries + if ~isempty(datboundaries) + boundaries = [boundaries datboundaries size(data,2)]; + else + boundaries = [boundaries size(data,2)]; + end; + data(:,end+1:end+size(tmpdata,2)) = tmpdata; % concatenating trials + else + if size(data,1) ~= size(tmpdata,1), error('Datasets to be concatenated do not have the same number of channels'); end; + if size(data,2) ~= size(tmpdata,2), error('Datasets to be concatenated do not have the same number of time points'); end; + data(:,:,end+1:end+size(tmpdata,3)) = tmpdata; % concatenating trials + end; + end; + end; + return; +end; + +% if string load dataset +% ---------------------- +if isstr(EEG) + EEG = pop_loadset('filename', EEG, 'loadmode', 'info'); +end; + +opt = finputcheck(varargin, { ... + 'channel' 'integer' {} []; + 'verbose' 'string' { 'on','off' } 'on'; + 'reshape' 'string' { '2d','3d' } '3d'; + 'projchan' {'integer','cell' } { {} {} } []; + 'component' 'integer' {} []; + 'samples' 'integer' {} []; + 'interp' 'struct' { } struct([]); + 'trialindices' {'integer','cell'} { {} {} } []; + 'rmcomps' {'integer','cell'} { {} {} } [] }, 'eeg_getdatact'); + +if isstr(opt), error(opt); end; +channelNotDefined = 0; +if isempty(opt.channel), opt.channel = [1:EEG.nbchan]; channelNotDefined = 1; +elseif isequal(opt.channel, [1:EEG.nbchan]) && ~isempty(opt.interp) channelNotDefined = 1; +end; +if isempty(opt.trialindices), opt.trialindices = [1:EEG.trials]; end; +if iscell( opt.trialindices), opt.trialindices = opt.trialindices{1}; end; +if iscell(opt.rmcomps ), opt.rmcomps = opt.rmcomps{1}; end; +if (~isempty(opt.rmcomps) | ~isempty(opt.component)) & isempty(EEG.icaweights) + error('No ICA weight in dataset'); +end; + +if strcmpi(EEG.data, 'in set file') + EEG = pop_loadset('filename', EEG.filename, 'filepath', EEG.filepath); +end; + +% get data boundaries if continuous data +% -------------------------------------- +boundaries = []; +if nargout > 1 && EEG.trials == 1 && ~isempty(EEG.event) && isfield(EEG.event, 'type') && isstr(EEG.event(1).type) + if ~isempty(opt.samples) + disp('WARNING: eeg_getdatact.m, boundaries are not accurate when selecting data samples'); + end; + tmpevent = EEG.event; + tmpbound = strmatch('boundary', lower({ tmpevent.type })); + if ~isempty(tmpbound) + boundaries = [tmpevent(tmpbound).latency ]-0.5; + end; +end; + +% getting channel or component activation +% --------------------------------------- +filename = fullfile(EEG.filepath, [ EEG.filename(1:end-4) '.icaact' ] ); +if ~isempty(opt.component) & ~isempty(EEG.icaact) + + data = EEG.icaact(opt.component,:,:); + +elseif ~isempty(opt.component) & exist(filename) + + % reading ICA file + % ---------------- + data = repmat(single(0), [ length(opt.component) EEG.pnts EEG.trials ]); + fid = fopen( filename, 'r', 'ieee-le'); %little endian (see also pop_saveset) + if fid == -1, error( ['file ' filename ' could not be open' ]); end; + for ind = 1:length(opt.component) + fseek(fid, (opt.component(ind)-1)*EEG.pnts*EEG.trials*4, -1); + data(ind,:) = fread(fid, [EEG.trials*EEG.pnts 1], 'float32')'; + end; + fclose(fid); + +elseif ~isempty(opt.component) + + if isempty(EEG.icaact) + data = eeg_getdatact( EEG ); + data = (EEG.icaweights(opt.component,:)*EEG.icasphere)*data(EEG.icachansind,:); + else + data = EEG.icaact(opt.component,:,:); + end; + +else + if isnumeric(EEG.data) % channel + + data = EEG.data; + + else % channel but no data loaded + + filename = fullfile(EEG.filepath, EEG.data); + fid = fopen( filename, 'r', 'ieee-le'); %little endian (see also pop_saveset) + if fid == -1 + error( ['file ' filename ' not found. If you have renamed/moved' 10 ... + 'the .set file, you must also rename/move the associated data file.' ]); + else + if strcmpi(opt.verbose, 'on') + fprintf('Reading float file ''%s''...\n', filename); + end; + end; + + % old format = .fdt; new format = .dat (transposed) + % ------------------------------------------------- + datformat = 0; + if length(filename) > 3 + if strcmpi(filename(end-2:end), 'dat') + datformat = 1; + end; + end; + EEG.datfile = EEG.data; + + % reading data file + % ----------------- + eeglab_options; + if length(opt.channel) == EEG.nbchan && option_memmapdata + fclose(fid); + data = mmo(filename, [EEG.nbchan EEG.pnts EEG.trials], false); + %data = memmapdata(filename, [EEG.nbchan EEG.pnts EEG.trials]); + else + if datformat + if length(opt.channel) == EEG.nbchan || ~isempty(opt.interp) + data = fread(fid, [EEG.trials*EEG.pnts EEG.nbchan], 'float32')'; + else + data = repmat(single(0), [ length(opt.channel) EEG.pnts EEG.trials ]); + for ind = 1:length(opt.channel) + fseek(fid, (opt.channel(ind)-1)*EEG.pnts*EEG.trials*4, -1); + data(ind,:) = fread(fid, [EEG.trials*EEG.pnts 1], 'float32')'; + end; + opt.channel = [1:size(data,1)]; + end; + else + data = fread(fid, [EEG.nbchan Inf], 'float32'); + end; + fclose(fid); + end; + + end; + + % subracting components from data + % ------------------------------- + if ~isempty(opt.rmcomps) + if strcmpi(opt.verbose, 'on') + fprintf('Removing %d artifactual components\n', length(opt.rmcomps)); + end; + rmcomps = eeg_getdatact( EEG, 'component', opt.rmcomps); % loaded from file + rmchan = []; + rmchanica = []; + for index = 1:length(opt.channel) + tmpicaind = find(opt.channel(index) == EEG.icachansind); + if ~isempty(tmpicaind) + rmchan = [ rmchan index ]; + rmchanica = [ rmchanica tmpicaind ]; + end; + end; + data(rmchan,:) = data(rmchan,:) - EEG.icawinv(rmchanica,opt.rmcomps)*rmcomps(:,:); + + %EEG = eeg_checkset(EEG, 'loaddata'); + %EEG = pop_subcomp(EEG, opt.rmcomps); + %data = EEG.data(opt.channel,:,:); + + %if strcmpi(EEG.subject, 'julien') & strcmpi(EEG.condition, 'oddball') & strcmpi(EEG.group, 'after') + % jjjjf + %end; + end; + + if ~isempty(opt.interp) + EEG.data = data; + EEG.event = []; + EEG.epoch = []; + EEG = eeg_interp(EEG, opt.interp, 'spherical'); + data = EEG.data; + if channelNotDefined, opt.channel = [1:EEG.nbchan]; end; + end; + + if ~isequal(opt.channel, [1:EEG.nbchan]) + data = data(intersect(opt.channel,[1:EEG.nbchan]),:,:); + end; +end; + + +% projecting components on data channels +% -------------------------------------- +if ~isempty(opt.projchan) + if iscell(opt.projchan) + opt.projchan = std_chaninds(EEG, opt.projchan); + end; + + finalChanInds = []; + for iChan = 1:length(opt.projchan) + tmpInd = find(EEG.icachansind == opt.projchan(iChan)); + if isempty(tmpInd) + error(sprintf('Warning: can not backproject component on channel %d (not used for ICA)\n', opt.projchan(iChan))); + end; + finalChanInds = [ finalChanInds tmpInd ]; + end; + + data = EEG.icawinv(finalChanInds, opt.component)*data(:,:); +end; + +if size(data,2)*size(data,3) ~= EEG.pnts*EEG.trials + disp('WARNING: The file size on disk does not correspond to the dataset, file has been truncated'); +end; +try, + if EEG.trials == 1, EEG.pnts = size(data,2); end; + if strcmpi(opt.reshape, '3d') + data = reshape(data, size(data,1), EEG.pnts, EEG.trials); + else data = reshape(data, size(data,1), EEG.pnts*EEG.trials); + end; +catch + error('The file size on disk does not correspond to the dataset information.'); +end; + +% select trials +% ------------- +if length(opt.trialindices) ~= EEG.trials + data = data(:,:,opt.trialindices); +end; +if ~isempty(opt.samples) + data = data(:,opt.samples,:); +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_getversion.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_getversion.m new file mode 100644 index 0000000..6811e90 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_getversion.m @@ -0,0 +1,49 @@ +% eeg_getversion() - obtain EEGLAB version number +% +% Usage: +% >> vers = eeg_getversion; +% >> [vers vnum] = eeg_getversion; +% +% Outputs: +% vers = [string] EEGLAB version number +% vnum = [float] numerical value for the version. For example 11.3.2.4b +% is converted to 11.324 +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, 2010 + +% Copyright (C) 2010 Arnaud Delorme, SCCN/INC/UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software + +function [vers, versnum, releaseDate] = eeg_getversion; + +vers = ''; +filepath = fileparts(which('eeglab.m')); +filename = dir(fullfile(filepath, 'Contents.m')); + +releaseDate = filename.date; + +if isempty(filename), return; end; + +fid = fopen(fullfile(filepath, filename.name), 'r'); +fgetl(fid); +versionline = fgetl(fid); +vers = versionline(11:end); +fclose(fid); + +tmpvers = vers; +if isempty(str2num(tmpvers(end))), tmpvers(end) = []; end; +indsDot = find(tmpvers == '.' ); +tmpvers(indsDot(2:end)) = []; +versnum = str2num(tmpvers); \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_global.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_global.m new file mode 100644 index 0000000..6b32dd6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_global.m @@ -0,0 +1,50 @@ +% eeg_global() - declare global EEGLAB variables. These variables are +% used only as global by the main function eeglab(), +% the function pop_rejmenu() and the history eegh() function. +% +% Global variables: +% EEG - structure containing the current dataset +% ALLEEG - array of structures containing all the loaded datasets +% CURRENTSET - index of the current dataset in the ALLEEG array +% LASTCOM - most recent command run by EEGLAB +% ALLCOM - cell array containing the EEGLAB session command history +% See the history (h) function for more details. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% global variables +% ---------------- +global EEG; % current dataset +global ALLEEG; % all datasets +global CURRENTSET; % current set index + +%global W_MAIN; % main window +%global H_MAIN; % main window +%global EEGMENU; % main menu +global ALLCOM; % all commands (history) +global LASTCOM; % last command +global STUDY; +global CURRENTSTUDY; +global PLUGINLIST; + +if exist('eegplugin_erplab.m') + global ALLERP; % Javier Lopez-Calderon for ERPLAB +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helpadmin.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpadmin.m new file mode 100644 index 0000000..dcbb54f --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpadmin.m @@ -0,0 +1,43 @@ +%Admin functions (adminfunc folder): +% abouteeglab - No help information +% eeg_checkchanlocs - Check the consistency of the channel locations structure... +% eeg_checkset - Check the consistency of the fields of an EEG dataset... +% eeg_eval - Apply eeglab function to a collection of input datasets... +% eeg_getdatact - Get EEG data from a specified dataset or... +% eeg_getversion - Obtain EEGLAB version number... +% eeg_global - Declare global EEGLAB variables. These variables are... +% eeg_helpadmin - Admin functions (adminfunc folder):... +% eeg_helpgui - EEGLAB HELP: Graphic interface builder functions (guifunc folder):... +% eeg_helphelp - How to use EEGLAB help. +% eeg_helpmenu - Call the help file for EEGLAB menus... +% eeg_helpmisc - EEGLAB HELP: Miscelaneous functions not used by EEGLAB graphic interface (miscfunc folder):... +% eeg_helppop - EEGLAB HELP: EEGLAB graphic interface functions (popfunc folder):... +% eeg_helpsigproc - EEGLAB HELP: EEGLAB signal processing functions (sigprocfunc folder):... +% eeg_helpstatistics - EEGLAB HELP: EEGLAB statistics functions (statistics folder):... +% eeg_helpstudy - EEGLAB HELP: EEGLAB group processing (STUDY) functions (studyfunc folder):... +% eeg_helptimefreq - Frequency functions (timefreqfunc folder):... +% eeg_hist - History for EEGLAB dataset. +% eeg_options - Eeglab option script... +% eeg_optionsbackup - Eeglab option script... +% eeg_readoptions - Read EEGLAB memory options file (eeg_options) into a... +% eeg_retrieve - Retrieve an EEG dataset from the variable... +% eeg_store - Store specified EEG dataset(s) in the ALLEG variable... +% eegh - History function. +% eeglab_error - Generate an eeglab error. +% eeglab_options - Handle EEGLAB options. This script (not function)... +% eeglabexefolder - Return the exe folder for EEGLAB. This function is only... +% gethelpvar - Convert a Matlab m-file help-message header... +% getkeyval - Get variable value from a 'key', 'val' sequence string. +% gettext - This function prints a dialog box on screen and waits for... +% is_sccn - Returns 1 if computer is located at SCCN (Swartz Center... +% iseeglabdeployed - True for EEGLAB compile version and false otherwise... +% ismatlab - No help information +% makehelpmatlab - No help information +% plugin_extract - No help information +% plugin_install - No help information +% plugin_remove - No help information +% pop_delset - Delete a dataset from the variable containing... +% pop_editoptions - Edit memory-saving eeglab() options. These are stored in... +% pop_rejmenu - Main menu for rejecting trials in an EEG dataset... +% pop_stdwarn - Check memory options and issue warning for studies. +% vararg2str - Transform arguments into string for evaluation... diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helpgui.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpgui.m new file mode 100644 index 0000000..b483917 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpgui.m @@ -0,0 +1,10 @@ +%Graphic interface builder functions (guifunc folder): +% errordlg2 - Makes a popup dialog box with the specified message and (optional)... +% finputcheck - Check Matlab function {'key','value'} input argument pairs... +% inputdlg2 - Inputdlg function clone with coloring and help for... +% inputgui - A comprehensive gui automatic builder. This function helps... +% listdlg2 - Listdlg function clone with coloring and help for... +% pophelp - Same as matlab HTHELP but does not crash under windows. +% questdlg2 - Questdlg function clone with coloring and help for... +% supergui - A comprehensive gui automatic builder. This function help... +% warndlg2 - Same as warndlg for eeglab()... diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helphelp.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helphelp.m new file mode 100644 index 0000000..f753b6a --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helphelp.m @@ -0,0 +1,47 @@ +% eeg_helphelp() - How to use EEGLAB help. +% +% EEGLAB MENU: +% Each EEGLAB menu item calls a Matlab function from the commandline. If this +% function pops up a graphic interface window, the figure title usually +% contains the name of the function that the window will call. EEGLAB help +% files are thus simply the collection of all the help files of the called +% functions. +% +% FUNCTION CALL CONVENTION: +% When the EEGLAB menu calls a function, it takes the EEG dataset as +% an argument, sometimes with additional parameters. The function then +% pops-up an interactive window asking for additional parameter values. +% The advantage of this process is that the same function can be called in +% two ways, either in interactive (pop_) mode or directly from the commandline. +% This trick allows EEGLAB to build a history of the commands run under an +% EEGLAB session. (See the eegh() function for details). The command history allows +% users to build their own EEGLAB macros by copying and pasting commands from +% the EEGLAB history (using eegh() and pop_saveh()) into new Matlab script files. +% +% EEGLAB HELP WINDOWS: +% The help message of any function may be called from from the EEGLAB menu +% by opening the 'Help > EEGLAB' menu window. The help message of each function +% is then displayed. Note that many EEGLAB functions do not actually process +% data (in particular, the 'pop_' functions). To understand their use, look +% at the help message for the (non-pop) function they call which actually +% processes the data. For example, the menu item % "Plot > Channel ERP image" +% calls the function 'pop_erpimage()'. This function in turn serves as a +% graphic user interface for the computing and plotting function 'erpimage()'. + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +help eeg_helphelp diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helpmenu.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpmenu.m new file mode 100644 index 0000000..e94b2c2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpmenu.m @@ -0,0 +1,204 @@ +% EEGLAB menus: +% File +% Import data +% Using EEGLAB functions and plugins +% From ASCII/float file or Matlab array - pop_importdata +% From Netstation binary simple file - pop_readegi +% From Netstation .MFF file - pop_readegimff +% From Multiple seg. Netstation files - pop_readsegegi +% From Netstation Matlab files - pop_importegimat +% From BCI2000 ASCII file - pop_loadbci +% From Snapmaster .SMA file - pop_snapread +% From Neuroscan .CNT file - pop_loadcnt +% From Neuroscan .EEG file - pop_loadeeg +% From Biosemi BDF file (BIOSIG toolbox) - pop_biosig +% From EDF/EDF+/GDF files (BIOSIG toolbox) - pop_biosig +% From Biosemi BDF and EDF files (BDF plugin) - pop_readbdf +% From BrainRT .SIG file - pop_readbrainrt +% Import EKG file and adjust latencies - pop_importekgtxtfile +% From ANT EEProbe .CNT file - pop_loadeep +% From ANT EEProbe .AVR file - pop_loadeep_avg +% From BCI2000 .DAT file - pop_loadBCI2000 +% From BIOPAC MATLAB files - pop_biopac +% From Brain Vis. Rec. .vhdr file - pop_loadbv +% From Brain Vis. Anal. Matlab file - pop_loadbva +% From CTF folder (MEG) - pop_ctf_read +% From ERPSS .RAW or .RDF file - pop_read_erpss +% From INStep .ASC file - pop_loadascinstep +% From 4D .m4d pdf file - pop_read4d +% From nihonkohden data files - pop_nihonkohden +% From Procom Infinity Text File - pop_importpi +% Using the FILE-IO interface - pop_fileio +% Using the BIOSIG interface - pop_biosig +% Troubleshooting data formats... +% Import epoch info +% From Matlab array or ASCII file - pop_importepoch +% From Neuroscan .DAT file - pop_loaddat +% Import event info +% From Matlab array or ASCII file - pop_importevent +% From data channel - pop_chanevent +% From Presentation .LOG file - pop_importpres +% From E-Prime ASCII (text) file - pop_importevent +% From Neuroscan .ev2 file - pop_importev2 +% Export +% Data and ICA activity to text file - pop_export +% Weight matrix to text file - pop_expica +% Inverse weight matrix to text file - pop_expica +% Events to text file - pop_expevents +% Data to EDF/BDF/GDF file - pop_writeeeg +% Write Brain Vis. exchange format file - pop_writebva +% Load existing dataset - pop_loadset +% Save current dataset(s) - pop_saveset +% Save current dataset as - pop_saveset +% Clear dataset(s) - pop_delset +% Create study +% Using all loaded datasets - pop_study +% Browse for datasets - pop_study +% Simple ERP STUDY - pop_studyerp +% Load existing study - pop_loadstudy +% Save current study - pop_savestudy +% Save current study as - pop_savestudy +% Clear study +% Memory and other options - pop_editoptions +% History scripts +% Save dataset history script - pop_saveh +% Save session history script - pop_saveh +% Run script - pop_runscript +% Quit - pop_saveh +% Edit +% Dataset info - pop_editset +% Event fields - pop_editeventfield +% Event values - pop_editeventvals +% About this dataset - pop_comments +% Channel locations - pop_chanedit +% Select data - pop_select +% Select data using events - pop_rmdat +% Select epochs or events - pop_selectevent +% Copy current dataset - pop_copyset +% Append datasets - pop_mergeset +% Delete dataset(s) from memory - pop_delset +% Edit events & mark bad channels - pop_VisEd +% Tools +% Change sampling rate - pop_resample +% Filter the data +% Basic FIR filter (new) - pop_eegfiltnew +% Windowed sinc FIR filter - pop_firws +% Parks-McClellan (equiripple) FIR filter - pop_firpm +% Moving average FIR filter - pop_firma +% Basic FIR filter (legacy) - pop_eegfilt +% Basic FIR filter (new) - pop_eegfiltnew +% Windowed sinc FIR filter - pop_firws +% Parks-McClellan (equiripple) FIR filter - pop_firpm +% Moving average FIR filter - pop_firma +% Short non-linear IIR filter - pop_iirfilt +% Re-reference - pop_reref +% Interpolate electrodes - pop_interp +% Reject continuous data by eye - pop_eegplot +% Extract epochs - pop_epoch +% Remove baseline - pop_rmbase +% Run ICA - pop_runica +% Remove components - pop_subcomp +% Automatic channel rejection - pop_rejchan +% Automatic continuous rejection - pop_rejcont +% Automatic epoch rejection - pop_autorej +% Reject data epochs +% Reject data (all methods) - pop_rejmenu +% Reject by inspection - pop_eegplot +% Reject extreme values - pop_eegthresh +% Reject by linear trend/variance - pop_rejtrend +% Reject by probability - pop_jointprob +% Reject by kurtosis - pop_rejkurt +% Reject by spectra - pop_rejspec +% Export marks to ICA reject - eeg_checkset +% Reject marked epochs - pop_rejepoch +% Reject data using ICA +% Reject components by map - pop_selectcomps +% Reject data (all methods) - pop_rejmenu +% Reject by inspection - pop_eegplot +% Reject extreme values - pop_eegthresh +% Reject by linear trend/variance - pop_rejtrend +% Reject by probability - pop_jointprob +% Reject by kurtosis - pop_rejkurt +% Reject by spectra - pop_rejspec +% Export marks to data reject - eeg_checkset +% Reject marked epochs - pop_rejepoch +% Locate dipoles using DIPFIT 2.x +% Head model and settings - pop_dipfit_settings +% Coarse fit (grid scan) - pop_dipfit_gridsearch +% Fine fit (iterative) - pop_dipfit_nonlinear +% Autofit (coarse fit, fine fit & plot) - pop_multifit +% Plot component dipoles - pop_dipplot +% Peak detection using EEG toolbox +% FMRIB Tools +% FASTR: Remove FMRI gradient artifacts - pop_fmrib_fastr +% Detect QRS events - pop_fmrib_qrsdetect +% Remove pulse artifacts - pop_fmrib_pas +% Locate dipoles using LORETA +% Export components to LORETA - pop_eeglab2loreta +% Plot +% Channel locations +% By name - topoplot +% By number - topoplot +% Channel data (scroll) - pop_eegplot +% Channel spectra and maps - pop_spectopo +% Channel properties - pop_prop +% Channel ERP image - pop_erpimage +% Channel ERPs +% With scalp maps - pop_timtopo +% In scalp/rect. array - pop_plottopo +% ERP map series +% In 2-D - pop_topoplot +% In 3-D - pop_headplot +% Sum/Compare ERPs - pop_comperp +% Component activations (scroll) - pop_eegplot +% Component spectra and maps - pop_spectopo +% Component maps +% In 2-D - pop_topoplot +% In 3-D - pop_headplot +% Component properties - pop_prop +% Component ERP image - pop_erpimage +% Component ERPs +% With component maps - pop_envtopo +% With comp. maps (compare) - pop_envtopo +% In rectangular array - pop_plotdata +% Sum/Compare comp. ERPs - pop_comperp +% Data statistics +% Channel statistics - pop_signalstat +% Component statistics - pop_signalstat +% Event statistics - pop_eventstat +% Time-frequency transforms +% Channel time-frequency - pop_newtimef +% Channel cross-coherence - pop_newcrossf +% Component time-frequency - pop_newtimef +% Component cross-coherence - pop_newcrossf +% Cluster dataset ICs - pop_miclust +% Study +% Edit study info - pop_study +% Select/Edit study design(s) - pop_studydesign +% Precompute channel measures - pop_precomp +% Plot channel measures - pop_chanplot +% Precompute component measures - pop_precomp +% PCA clustering (original) +% Build preclustering array - pop_preclust +% Cluster components - pop_clust +% Edit/plot clusters - pop_clustedit +% Cluster components by correlation (CORRMAP) - pop_corrmap +% Datasets +% Select multiple datasets - pop_chansel +% Help +% Upgrade to the Latest Version +% About EEGLAB +% About EEGLAB help - eeg_helphelp +% EEGLAB menus - eeg_helpmenu +% EEGLAB functions +% Admin functions - eeg_helpadmin +% Interactive pop_ functions - eeg_helppop +% Signal processing functions - eeg_helpsigproc +% Group processing (STUDY) functions - eeg_helpstudy +% Time-frequency functions - eeg_helptimefreq +% Statistics functions - eeg_helpstatistics +% Graphic interface builder functions - eeg_helpgui +% Misceleanous functions (command line only) - eeg_helpmisc +% EEGLAB license +% Web tutorial +% Email the EEGLAB team diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helpmisc.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpmisc.m new file mode 100644 index 0000000..05306eb --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpmisc.m @@ -0,0 +1,106 @@ +%Miscelaneous functions not used by EEGLAB graphic interface (miscfunc folder): +% abspeak - Find peak amps/latencies in each row of a single-epoch data matrix... +% arrow - Draw a line with an arrowhead. +% averef - Convert common-reference EEG data to average reference... +% caliper - Measure a set of spatial components of a given data epoch relative to... +% chanproj - Make a detailed plot of data returned from plotproj()... +% compdsp - Display standard info figures for a data decomposition... +% compheads - Plot multiple topoplot() maps of ICA component topographies... +% compile_eeglab - Platform compiling script... +% compmap - Plot multiple topoplot() maps of ICA component topographies... +% compplot - Plot a data epoch and maps its scalp topography at a given time... +% compsort - Reorder ICA components, first largest to smallest by the size... +% convolve - Convolve two matrices (normalize by the sum of convolved... +% corrimage - Compute correlation image between an event and amplitude... +% covary - For vectors, covary(X) returns the variance of X. +% crossfold - Returns estimates and plot of event-related coherence (ERC) changes... +% crossfreq - Compute cross-frequency coherences. Power of first input... +% datlim - Return min and max of a matrix... +% del2map - Compute the discrete laplacian of an EEG distribution. +% dendhier - DENDHIER: Recursive algorithm to find links and distance coordinates on a... +% dendplot - DENDPLOT: Plots a dendrogram given a topology matrix. +% difftopo - Compute and plot component decomposition for the difference ERP... +% dprime - Signal-detection theory sensitivity measure. +% eeg_ms2f - Convert epoch latency in ms to nearest epoch frame number... +% eeg_regepochs - Convert a continuous dataset into consecutive epochs of... +% eeg_time2prev - Returns a vector giving, for each event of specified ("target") type(s),... +% eegdraw - Subroutine used by eegplotold() to plot data. +% eegdrawg - Subroutine used by eegplotgold() to plot data. +% eegmovie - Compile and view a Matlab movie. +% eegplotgold - Display EEG data in a clinical format... +% eegplotold - Display data in a horizontal scrolling fashion... +% eegplotsold - Display data in a clinical format without scrolling... +% envproj - Plot envelopes of projections of selected ICA component... +% erpregout - Regress out the ERP from the data... +% erpregoutfunc - Sub function of erpregout() used to regress... +% eucl - EUCL: Calculates the euclidean distances among a set of points, or between a... +% fastregress - Perform fast regression and return p-value... +% fillcurves - Fill the space between 2 curves... +% gabor2d - Generate a two-dimensional gabor matrice. +% gauss - Return a smooth Gaussian window... +% gauss2d - Generate a 2-dimensional gaussian matrix... +% gauss3d - Generate a 3-dimensional gaussian matrix... +% getallmenus - Get all submenus of a window or a menu and return... +% getipsph - Compute "in place" (m by n) sphering or quasi-sphering matrix for an (n by t)... +% gradmap - Compute the gradient of an EEG spatial distribution. +% gradplot - Compute the gradient of EEG scalp map(s) on a square grid... +% headmovie - Record a Matlab movie of scalp data. +% help2html2 - Convert a Matlab m-file help-message header into an .html help file... +% helpforexe - Write help files for exe version... +% hist2 - Draw superimposed histograms... +% hungarian - Solve the assignment problem using the Hungarian method. +% icademo - A sample ICA analysis script using the ICA/ERP package... +% imagescloglog - Make an imagesc(0) plot with log y-axis and... +% imagesclogy - Make an imagesc(0) plot with log y-axis values (ala semilogy())... +% iscellnumeric - Return 1 if all elements of cell array are numeric... +% kmeans_st - Means clustering of n points into k clusters so that the... +% laplac2d - Generate a 2 dimensional gaussian matrice... +% lapplot - Compute the discrete laplacian of EEG scalp distribution(s)... +% loadelec - Load electrode names file for eegplot()... +% loc_subsets - Separate channels into maximally evenly-spaced subsets. +% logimagesc - Make an imagesc(0) plot with log y-axis values (ala semilogy())... +% loglike - Log likehood function to estimate dependence between components... +% logspec - Plot mean log power spectra of submitted data on loglog scale... +% make_timewarp - Select a subset of epochs containing a given event sequence, and return... +% makeelec - Subroutine to make electrode file in eegplot()... +% makehelpfiles - Generate function help pages... +% makehtml - Generate .html function-index page and function help pages... +% mapcorr - Find matching rows in two matrices and their corrs. +% matcorr - Find matching rows in two matrices and their corrs. +% matperm - Transpose and sign rows of x to match y (run after matcorr() )... +% means - MEANS: Means, standard errors and variances. For column vectors, means(x)... +% nan_std - Std, not considering NaN values... +% numdim - Estimate a lower bound on the (minimum) number of discrete sources... +% pcexpand - Expand data using Principal Component Analysis (PCA)... +% pcsquash - Compress data using Principal Component Analysis (PCA)... +% perminv - Returns the inverse permutation vector... +% plotproj - Plot projections of one or more ICA components along with... +% promax - Perform Promax oblique rotation after orthogonal Varimax... +% qrtimax - Perform Quartimax rotation of rows of a data matrix. +% read_rdf - Read RDF-formatted EEG files. +% readlocsold - Read electrode locations file in style of topoplot() or headplot(). +% rmart - Remove eye artifacts from EEG data using regression with... +% rmsave - Return the RMS in each channel, epoch... +% runicalowmem - Perform Independent Component Analysis (ICA) decomposition... +% runicatest - Perform Independent Component Analysis (ICA) decomposition... +% runpca - Perform principal component analysis (PCA) using singular value... +% runpca2 - Perform principal component analysis (PCA) using singular value... +% scanfold - Scan folder content... +% seemovie - See an EEG movie produced by eegmovie()... +% setfont - Change all the fonts properties of a figure. +% shortread - Read matrix from short file. +% show_events - Display events in epochs. Events selected by... +% testica - Test the runica() function's ability to separate synthetic sources. +% textgui - Make sliding vertical window. This window contain text... +% tftopo - Generate a figure showing a selected or representative image (e.g.,... +% timefrq - Progressive Power Spectral Density estimates on a single... +% topoimage - Plot concatenated multichannel time/frequency images... +% tree - Make a hierarchical (tree-diagram) component plot. Use... +% tutorial - Bring up the ICA / electrophysiology toolbox tutorial... +% uniqe_cell_string - Array containing only strings, ignores all... +% uniquef - UNIQUEF: Given a matrix containing group labels, returns a vector containing... +% upgma - Group hierarchical cluster analysis of a distance... +% varimax - Perform orthogonal Varimax rotation on rows of a data... +% varsort - Reorder ICA components, largest to smallest, by... +% vectdata - Vector data interpolation with optional moving... +% zica - Z-transform of ICA activations; useful for studying component SNR... diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helppop.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helppop.m new file mode 100644 index 0000000..68c5d85 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helppop.m @@ -0,0 +1,121 @@ +%EEGLAB graphic interface functions (popfunc folder): +% eeg_addnewevents - Eeg_addnewevents() Add new events to EEG structure. Both EEG.event and... +% eeg_amplitudearea - Resamples an ERP average using spline interpolation... +% eeg_chaninds - Look up channel indices in a EEG structure... +% eeg_chantype - Returns the channel indices of the desired channel type(s). +% eeg_context - Returns (in output 'delays') a matrix giving, for each event of specified... +% eeg_decodechan - Given an input EEG dataset structure, output a new EEG data structure... +% eeg_dipselect - Select componet dipoles from an EEG dataset with... +% eeg_eegrej - Reject porition of continuous data in an EEGLAB... +% eeg_emptyset - Initialize an EEG dataset structure with default values. +% eeg_epoch2continuous - Convert epoched dataset to continuous dataset... +% eeg_epochformat - Convert the epoch information of a dataset from struct... +% eeg_eventformat - Convert the event information of a dataset from struct... +% eeg_eventhist - Return or plot histogram of event or urevent field values. +% eeg_eventtable - Returns all events contained in the EEG structure (and... +% eeg_eventtypes - Return a list of event or urevent types in a dataset and... +% eeg_getepochevent - Return dataset event field values for all events... +% eeg_getica - Get ICA component activation. Recompute if necessary. +% eeg_insertbound - Insert boundary event in an EEG event structure. +% eeg_interp - Interpolate data channels... +% eeg_laplac - Gives the laplacian for the data contained in EEG... +% eeg_lat2point - Convert latencies in time units relative to the... +% eeg_latencyur - Transform latency of sample point in the continuous... +% eeg_matchchans - Find closest channels in a larger EEGLAB chanlocs structure... +% eeg_mergechan - Merge channel structure while preserving channel... +% eeg_mergelocs - Merge channel structure while preserving channel... +% eeg_mergelocs_diffstruct - Merge channel structure while preserving channel... +% eeg_multieegplot - Produce an eegplot() of a the average of an epoched dataset... +% eeg_oldica - Report, return or add to oldicaweights and oldicasphere... +% eeg_point2lat - Convert latency in data points to latency in ms relative... +% eeg_pv - Compute EEG.data 'percent variance ' (pv) of the whole EEG data versus the projections... +% eeg_pvaf - Compute EEG.data 'percent variance accounted for' (pvaf) by specified components. +% eeg_rejmacro - Internal EEGLAB macro for all pop_ functions that... +% eeg_rejsuperpose - Superpose rejections of a EEG dataset. +% eeg_timeinterp - Perform spline interpolation of a portion... +% eeg_topoplot - Plot scalp map... +% eeg_urlatency - Find the original (ur) latency of a time point in... +% getchanlist - Obtain indices of specified channel types. +% importevent - Import experimental events from data file or Matlab... +% pop_autorej - Perform automatic artifact epoch detection and rejection... +% pop_averef - Convert an EEG dataset to average reference. +% pop_biosig - Import data files into EEGLAB using BIOSIG toolbox... +% pop_biosig16 - Import data files into EEGLAB using BIOSIG toolbox... +% pop_biosig16ying - Import data files into EEGLAB using BIOSIG toolbox... +% pop_chancenter - Recenter cartesian X,Y,Z channel coordinates... +% pop_chancoresp - Define correspondances between two channel locations structures... +% pop_chanedit - Edit the channel locations structure of an EEGLAB dataset,... +% pop_chanevent - Import event latencies from the rising and/or falling 'edge'... +% pop_chansel - Pop up a graphic interface to select channels... +% pop_comments - Edit comments... +% pop_compareerps - Compare the (ERP) averages of two datasets. +% pop_comperp - Compute the grand average ERP waveforms of multiple datasets... +% pop_copyset - Copy the current EEG dataset into another dataset. +% pop_crossf - Return estimates and plots of event-related spectral coherence... +% pop_editeventfield - Add/remove/rename/modify a field in the event structure... +% pop_editeventvals - Edit events contained in an EEG dataset structure. +% pop_editset - Edit EEG dataset structure fields. +% pop_eegfilt - Interactively filter EEG dataset data using eegfilt()... +% pop_eegplot - Visually inspect EEG data using a scrolling display. +% pop_eegthresh - Reject artifacts by detecting outlier values. This has... +% pop_envtopo - Plot envelope of an averaged EEG epoch, plus scalp maps... +% pop_epoch - Convert a continuous EEG dataset to epoched data by extracting... +% pop_erpimage - Draw an ERP-image plot of a given EEG channel or independent... +% pop_eventstat - Computes and plots statistical characteristics of an EEG event,... +% pop_expevents - Export events to CSV file... +% pop_expica - Export ICA weights or inverse matrix... +% pop_export - Export EEG dataset... +% pop_fileio - Import data files into EEGLAB using FileIO... +% pop_fileiodir - Import directory into EEGLAB using FileIO... +% pop_headplot - Plot one or more spherically-splined EEG field maps... +% pop_icathresh - Main menu for choosing threshold for component... +% pop_importdata - Import data from a Matlab variable or disk file by calling... +% pop_importegimat - Import EGI Matlab segmented file... +% pop_importepoch - Export epoch and/or epoch event information to the event... +% pop_importev2 - Merge a neuroscan EV2 file with input dataset... +% pop_importevent - Import events into an EEG dataset. If the EEG dataset... +% pop_importpres - Append Presentation event file information into an EEGLAB dataset... +% pop_interp - Interpolate data channels... +% pop_jointprob - Reject artifacts in an EEG dataset using joint... +% pop_loadbci - Import a BCI2000 ascii file into EEGLAB... +% pop_loadcnt - Load a neuroscan CNT file (pop out window if no arguments). +% pop_loaddat - Merge a neuroscan DAT file with input dataset... +% pop_loadeeg - Load a Neuroscan .EEG file (via a pop-up window if no... +% pop_loadset - Load an EEG dataset. If no arguments, pop up an input window. +% pop_mergeset - Merge two or more datasets. If only one argument is given,... +% pop_newcrossf - Return estimates and plots of event-related spectral coherence... +% pop_newset - Edit/save EEG dataset structure information. +% pop_newtimef - Returns estimates and plots of event-related (log) spectral... +% pop_plotdata - Plot average of EEG channels or independent components in... +% pop_plottopo - Plot one or more concatenated multichannel data epochs... +% pop_prop - Plot the properties of a channel or of an independent... +% pop_readegi - Load a EGI EEG file (pop out window if no arguments). +% pop_readlocs - Load a EGI-format EEG file (pop up an interactive window if no arguments). +% pop_readsegegi - Load a segmented EGI EEG file. Pop up query... +% pop_rejchan - Reject artifacts channels in an EEG dataset using joint... +% pop_rejchanspec - Reject artifacts channels in an EEG dataset using... +% pop_rejcont - Reject continuous portions of data based on spectrum... +% pop_rejepoch - Reject pre-labeled trials in a EEG dataset. +% pop_rejkurt - Rejection of artifact in a dataset using kurtosis... +% pop_rejspec - Rejection of artifact in a dataset using... +% pop_rejtrend - Measure linear trends in EEG data; reject data epochs... +% pop_reref - Convert an EEG dataset to average reference or to a... +% pop_resample - Resample dataset (pop up window). +% pop_rmbase - Remove channel baseline means from an epoched or... +% pop_rmdat - Remove continuous data around specific events... +% pop_runica - Run an ICA decomposition of an EEG dataset using runica(),... +% pop_runscript - Run Matlab script... +% pop_saveh - Save the EEGLAB session command history stored in ALLCOM... +% pop_saveset - Save one or more EEG dataset structures... +% pop_select - Given an input EEG dataset structure, output a new EEG data structure... +% pop_selectcomps - Display components with button to vizualize their... +% pop_selectevent - Find events in an EEG dataset. If the dataset... +% pop_signalstat - Computes and plots statistical characteristics of a signal,... +% pop_snapread - Load an EEG SnapMaster file (pop out window if no arguments). +% pop_spectopo - Plot spectra of specified data channels or components. +% pop_subcomp - Remove specified components from an EEG dataset. +% pop_timef - Returns estimates and plots of event-related (log) spectral... +% pop_timtopo - Call the timtopo() function for epoched EEG datasets. +% pop_topoplot - Plot scalp map(s) in a figure window. If number of input... +% pop_writeeeg - Write EEGLAB dataset to disk in EDF/GDF or BDF format... +% pop_writelocs - Load a EGI EEG file (pop out window if no arguments). diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helpsigproc.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpsigproc.m new file mode 100644 index 0000000..fa6e5c2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpsigproc.m @@ -0,0 +1,126 @@ +%EEGLAB signal processing functions (sigprocfunc folder): +% acsobiro - A. Chickocki's robust Second-Order Blind Identification (SOBI)... +% adjustlocs - Read neuroscan polar location file (.asc)... +% angtimewarp - Given two event marker vectors, computes a... +% axcopy - Copy a Matlab figure axis and its graphic objects to a new pop-up window... +% binica - Run stand-alone binary version of runica() from the... +% biosig2eeglab - Convert BIOSIG structue to EEGLAB structure... +% biosig2eeglabevent - Convert biosig events to EEGLAB event structure... +% blockave - Make block average of concatenated data sets of same size... +% cart2topo - Convert xyz-cartesian channel coordinates... +% cbar - Display full or partial color bar... +% celltomat - Convert cell array to matrix... +% chancenter - Recenter cartesian X,Y,Z channel coordinates... +% changeunits - Takes one or more points in one axes and gives its position... +% compvar - Project selected components and compute the variance of... +% condstat - Accumulate surrogate data for comparing two data conditions... +% convertlocs - Convert electrode locations between coordinate systems... +% copyaxis - Helper function for axcopy()... +% coregister - Co-register measured or template electrode locations with a... +% dipoledensity - Compute and optionally plot a measure of the 3-D spatial... +% eegfilt - (high|low|band)-pass filter data using two-way least-squares... +% eegfiltfft - (high|low|band)-pass filter data using inverse fft... +% eegplot - Scroll (horizontally and/or vertically) through multichannel data. +% eegplot2event - Convert EEGPLOT rejections into events... +% eegplot2trial - Convert EEGPLOT rejections into trial and electrode... +% eegplot_readkey - Eegplot helper function to read key strokes... +% eegrej - Reject/excise arbitrary periods from continuous EEG data... +% eegthresh - Classical trial rejection rejection using a threshold on... +% entropy_rej - Calculation of entropy of a 1D, 2D or 3D array and... +% env - Return envelope of rows of a data matrix, or optionally... +% envtopo - No help information... +% epoch - Extract epochs time locked to specified events from continuous EEG data. +% erpimage - Plot a colored image of a collection of single-trial data epochs, optionally... +% eventalign - Function called by pop_importevent() to find the best... +% eventlock - DEPRECATED: Please use eegalign() instead. +% eyelike - Calculate a permutation matrix P and a scaling (diagonal) maxtrix S... +% fastif - Fast if function. +% floatread - Read matrix from float file ssuming four byte floating point number... +% floatwrite - Write data matrix to float file. +% forcelocs - Rotate location in 3-D so specified electrodes... +% gettempfolder - Return the temporary folder... +% headplot - Plot a spherically-splined EEG field map on a semi-realistic... +% icaact - Compute ICA activation waveforms = weights*sphere*(data-meandata)... +% icadefs - Function to read in a set of EEGLAB system-wide (i.e. lab-wide)... +% icaproj - Project ICA component activations through the... +% icavar - Project ICA component activations through the ICA weight matrices... +% imagesctc - DEPRECATED. never completed or documented. +% isscript - Function checking if a specific file is a script%... +% jader - Blind separation of real signals using JADE (v1.5, Dec. 1997). +% jointprob - Rejection of odd columns of a data array using... +% kmeanscluster - Simple k means clustering algorithm... +% kurt - Return kurtosis of input data distribution... +% loadavg - Loading eeg average data file from Neuroscan into... +% loadcnt - Load a Neuroscan continuous signal file. +% loaddat - Loading neuroscan format data file into matlab. +% loadeeg - Load a binary data file in Neuroscan .eeg file format. +% loadtxt - Load ascii text file into numeric or cell arrays... +% lookupchantemplate - Look up channel template. +% matsel - Select rows, columns, and epochs from given multi-epoch data matrix... +% mattocell - Convert matrix to cell array... +% metaplottopo - Plot concatenated multichannel data epochs in a topographic or... +% movav - Perform a moving average of data indexed by xvals. +% moveaxes - Move, resize, or copy Matlab axes using the mouse... +% mri3dplot - Plot 3-D density image translucently on top of the mean MR... +% nan_mean - Average, not considering NaN values... +% openbdf - Opens an BDF File (European Data Format for Biosignals) in MATLAB (R)... +% parsetxt - Parse text input into cell array... +% phasecoher - Implements inter-trial amp/coherence using Gaussian wavelets. +% plotchans3d - Plots the 3-D configuration from a Polhemus ELP... +% plotcurve - Plot curve(s) with optional significance highlighting. +% plotdata - Plot concatenated multichannel data epochs in two-column format... +% ploterp - Plot a selected multichannel data epoch on a common timebase... +% plotmesh - Plot mesh defined by faces and vertex... +% plotsphere - This function is used to plot a sphere and... +% plottopo - Plot concatenated multichannel data epochs in a topographic... +% posact - Make runica() activations all RMS-positive. +% projtopo - Plot projections of one or more ICA components along with... +% uisettxt - No help information +% qqdiagram - Empirical quantile-quantile diagram. +% quantile - Computes the quantiles of the data sample from a distribution X... +% readbdf - Loads selected Records of an EDF or BDF File (European Data Format... +% readedf - Read eeg data in EDF format. +% readeetraklocs - Read 3-D location files saved using the EETrak... +% readegi - Read EGI Simple Binary datafile (versions 2,3,4,5,6,7). +% readegihdr - Read header information from EGI (versions 2,3,4,5,6,7) data file. +% readegilocs - Look up locations for EGI EEG dataset. +% readelp - Read electrode locations from an .elp (electrode positions)... +% readlocs - Read electrode location coordinates and other information from a file. +% readneurodat - Read neuroscan location file (.dat)... +% readneurolocs - Read neuroscan polar location file (.asc)... +% readtxtfile - Read text file into a Matlab variable... +% realproba - Compute the effective probability of the value... +% rejkurt - Calculation of kutosis of a 1D, 2D or 3D array and... +% rejstatepoch - Reject bad eeg trials based a statistical measure. Can... +% rejtrend - Detect linear trends in EEG activity and reject the... +% reref - Convert common reference EEG data to some other common reference... +% rmbase - Subtract basevector channel means from multi-epoch data matrix... +% runica - Perform Independent Component Analysis (ICA) decomposition... +% runica_ml - Perform Independent Component Analysis (ICA) decomposition... +% runica_ml2 - Perform Independent Component Analysis (ICA) decomposition... +% runica_mlb - Perform Independent Component Analysis (ICA) decomposition... +% sbplot - Create axes in arbitrary subplot grid positions and sizes... +% shuffle - Shuffle a given dimension in an array... +% signalstat - Computes and plots statistical characteristics of a signal,... +% slider - Add slider to a figure... +% snapread - Read data in Snap-Master Standard Binary Data File Format... +% sobi - Second Order Blind Identification (SOBI) by joint diagonalization of... +% spec - Power spectrum. This function replaces psd() function if the signal... +% spectopo - Plot the mean log spectrum of a set of data epochs at all channels... +% sph2topo - Convert from a 3-column headplot file in spherical coordinates... +% spher - Return the sphering matrix for given input data... +% spherror - Chancenter() sub function to compute minimum distance... +% strmultiline - Format a long string as a multi-line string. +% textsc - Places text in screen coordinates and places... +% timefdetails - Details of the timef() function for time/frequency analysis... +% timtopo - Plot all channels of a data epoch on the same axis... +% topo2sph - Convert a topoplot() style 2-D polar-coordinate... +% topoplot - Plot a topographic map of a scalp data field in a 2-D circular view... +% transformcoords - Select nazion and inion in anatomical MRI images. +% trial2eegplot - Convert eeglab format to eeplot format of rejection window... +% uigetfile2 - Same as uigetfile but remember folder location. +% uiputfile2 - Same as uigputfile but remember folder location. +% voltype - VOLTYPE determines the type of volume conduction model... +% writecnt - Write a Neuroscan continuous signal file. +% writeeeg - Generating CNT/EDF/BDF/GDF-files using BIOSIG toolbox. Note... +% writelocs - Write a file containing channel location, type and gain information... diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helpstatistics.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpstatistics.m new file mode 100644 index 0000000..faa47d3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpstatistics.m @@ -0,0 +1,16 @@ +%EEGLAB statistics functions (statistics folder): +% anova1_cell - Compute F-values in cell array using ANOVA. +% anova1rm_cell - Compute F-values in cell array using repeated measure... +% anova2_cell - Compute F-values in cell array using ANOVA. +% anova2rm_cell - Compute F-values in cell array using repeated measure... +% concatdata - Concatenate data stored into a cell array into a single... +% corrcoef_cell - Compute pairwise correlations using arrays and... +% fdr - Compute false detection rate mask... +% stat_surrogate_ci - Vals under the null hypothesis that observed samples... +% stat_surrogate_pvals - Vals under the null hypothesis that observed samples... +% statcond - Compare two or more data conditions statistically using... +% statcondfieldtrip - Same as statcond except that it uses the fieldtrip... +% surrogdistrib - Build surrogate distribution... +% teststat - EEGLAB statistical testing function... +% ttest2_cell - Compute unpaired t-test. Allow fast computation of... +% ttest_cell - Compute paired t-test. Allow fast computation of... diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helpstudy.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpstudy.m new file mode 100644 index 0000000..7fc6a25 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helpstudy.m @@ -0,0 +1,102 @@ +%EEGLAB group processing (STUDY) functions (studyfunc folder): +% compute_ersp_times - Computes the widest possible ERSP/ITC time window,... +% neural_net - Computes clusters using Matlab Neural Net toolbox. +% pop_chanplot - Graphic user interface (GUI)-based function with plotting... +% pop_clust - Select and run a clustering algorithm on components from an EEGLAB STUDY... +% pop_clustedit - Graphic user interface (GUI)-based function with editing and plotting... +% pop_erpimparams - Set plotting and statistics parameters for... +% pop_erpparams - Set plotting and statistics parameters for cluster ERP... +% pop_erspparams - Set plotting and statistics parameters for... +% pop_loadstudy - Load an existing EEGLAB STUDY set of EEG datasets plus... +% pop_preclust - Prepare STUDY components' location and activity measures for later clustering. +% pop_precomp - Precompute measures (spectrum, ERP, ERSP) for a collection of data... +% pop_savestudy - Save a STUDY structure to a disk file... +% pop_specparams - Set plotting and statistics parameters for computing... +% pop_statparams - Helper function for pop_erspparams, pop_erpparams, and... +% pop_study - Create a new STUDY set structure defining a group of related EEG datasets. +% pop_studydesign - Create a STUDY design structure. +% pop_studyerp - Create a simple design for ERP analysis... +% robust_kmeans - An extension of Matlab kmeans() that removes outlier... +% std_cell2setcomps - Convert .sets and .comps to cell array. The .sets and... +% std_centroid - Compute cluster centroid in EEGLAB dataset STUDY. +% std_changroup - Create channel groups for plotting. +% std_chaninds - Look up channel indices in a STUDY... +% std_chantopo - Plot ERP/spectral/ERSP topoplot at a specific... +% std_checkconsist - Create channel groups for plotting. +% std_checkfiles - Check all STUDY files consistency... +% std_checkset - Check STUDY set consistency... +% std_clustmaxelec - Function to find the electrode with maximum absolute projection... +% std_clustread - This function has been replaced by std_readdata() for... +% std_comppol - Inverse component polarity in a component cluster... +% std_convertdesign - Temporary function converting STUDY design legacy... +% std_createclust - Dreate a new empty cluster. After creation, components... +% std_dipoleclusters - Plots clusters of ICs as colored dipoles in MRI... +% std_dipplot - Commandline function to plot cluster component dipoles. Dipoles for each... +% std_editset - Modify a STUDY set structure. +% std_erp - Constructs and returns channel or ICA activation ERPs for a dataset. +% std_erpimage - Compute ERP images and save them on disk. +% std_erpimageplot - Commandline function to plot cluster ERPimage or channel erpimage. +% std_erpplot - Command line function to plot STUDY cluster component ERPs. Either... +% std_ersp - Compute ERSP and/or ITC transforms for ICA components... +% std_erspplot - Plot STUDY cluster ERSPs. Displays either mean cluster ERSPs,... +% std_figtitle - Generate plotting figure titles in a cell array... +% std_filecheck - Check if ERSP or SPEC file contain specific parameters. +% std_fileinfo - Check uniform channel distribution accross datasets... +% std_findoutlierclust - Determine whether an outlier cluster already exists... +% std_findsameica - Find groups of datasets with identical ICA decomposiotions... +% std_getdataset - Constructs and returns EEG dataset from STUDY design. +% std_getindvar - Get independent variables of a STUDY... +% std_indvarmatch - Match independent variable value in a list of values... +% std_interp - Interpolate, if needed, a list of named data channels... +% std_itcplot - Commandline function to plot cluster ITCs. Either displays mean cluster... +% std_loadalleeg - Constructs an ALLEEG structure, given the paths and file names... +% std_makedesign - Create a new or edit an existing STUDY.design by... +% std_maketrialinfo - Create trial information structure using the... +% std_mergeclust - Commandline function, to merge several clusters. +% std_movecomp - Move ICA component(s) from one cluster to another. +% std_moveoutlier - Commandline function, to reassign specified outlier component(s)... +% std_movie - Make movie in the frequency domain... +% std_pac - Compute or read PAC data (Phase Amplitude Coupling). +% std_pacplot - Commandline function to plot cluster PAC... +% std_plot - This function is outdated. Use std_plottf() to plot time/... +% std_plotcurve - Plot ERP or spectral traces for a STUDY component... +% std_plottf - Plot ERSP/ITC images a component... +% std_preclust - Select measures to be included in computation of a preclustering array. +% std_precomp - Precompute measures (ERP, spectrum, ERSP, ITC) for channels in a... +% std_precomp_worker - Allow dispatching ERSP to be computed in parallel... +% std_prepare_neighbors - Prepare Fieldtrip channel neighbor structure. +% std_propplot - Command line function to plot component cluster... +% std_pvaf - Compute 'percent variance accounted for' (pvaf) by specified... +% std_readdata - LEGACY FUNCTION, SHOULD NOT BE USED ANYMORE. INSTEAD... +% std_readerp - Load ERP measures for data channels or... +% std_readerpimage - Load ERPimage measures for data channels or... +% std_readersp - Load ERSP measures for data channels or for all... +% std_readfile - Read data file containing STUDY measures. +% std_readitc - Load ITC measures for data channels or... +% std_readpac - Read phase-amplitude correlation... +% std_readspec - Load spectrum measures for data channels or... +% std_readspecgram - Returns the stored mean power spectrogram for an ICA component... +% std_readtopo - Returns the scalp map of a specified ICA component, assumed... +% std_readtopoclust - Compute and return cluster component scalp maps. +% std_rebuilddesign - Reduild design structure when datasets have been... +% std_rejectoutliers - Commandline function, to reject outlier component(s) from clusters. +% std_renameclust - Commandline function, to rename clusters using specified (mnemonic) names. +% std_renamestudyfiles - Rename files for design 1 if necessary. In design... +% std_reset - Remove all preloaded measures from STUDY... +% std_rmalldatafields - Remove all data fields from STUDY (before saving... +% std_savedat - Save measure for computed data... +% std_selcomp - Helper function for std_erpplot(), std_specplot()... +% std_selectdataset - Select datasets and trials for a given independent... +% std_selectdesign - Select an existing STUDY design. +% std_selsubject - Helper function for std_erpplot(), std_specplot()... +% std_setcomps2cell - Convert .sets and .comps to cell array. The .sets and... +% std_spec - Returns the ICA component spectra for a dataset. Updates the EEG structure... +% std_specgram - Returns the ICA component or channel spectrogram for a dataset. +% std_specplot - Plot STUDY component cluster spectra, either mean spectra... +% std_stat - Compute statistics for ERP/spectral traces or ERSP/ITC images... +% std_substudy - Create a sub-STUDY set by removing datasets, conditions, groups, or... +% std_topo - Uses topoplot() to get the interpolated Cartesian grid of the... +% std_topoplot - Command line function to plot cluster component and mean scalp maps. +% std_uniformfiles - Check uniform channel distribution accross data files... +% std_uniformsetinds - Check uniform channel distribution accross datasets... +% toporeplot - Re-plot a saved topoplot() output image (a square matrix)... diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_helptimefreq.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_helptimefreq.m new file mode 100644 index 0000000..e52a465 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_helptimefreq.m @@ -0,0 +1,21 @@ +%EEGLAB time-frequency functions (timefreqfunc folder): +% angTimeWarp - Given two event marker vectors, angTimeWarp computes a... +% bootstat - Accumulate surrogate data to assess significance by permutation of some... +% correct_mc - Compute an upper limit for the number of independant... +% correctfit - Correct fit using observed p-values. Use this function... +% crossf - Returns estimates and plots event-related coherence (ERCOH)... +% dftfilt - Discrete Fourier filter... +% dftfilt2 - Discrete complex wavelet filters... +% dftfilt3 - Discrete complex wavelet filters... +% newcrossf - Returns estimates and plots event-related coherence (ERCOH)... +% newtimef - Return estimates and plots of mean event-related (log) spectral... +% pac - Compute phase-amplitude coupling (power of first input... +% pac_cont - Compute phase-amplitude coupling (power of first input... +% rsadjust - Adjust l-values (Ramberg-Schmeiser distribution)... +% rsfit - Find p value for a given value in a given distribution... +% rsget - Get the p-value for a given collection of l-values... +% rspdfsolv - Sub-function used by rsfit() to searc for optimal... +% rspfunc - Sub-function used by rsget()... +% timef - Returns estimates and plots of mean event-related spectral... +% timefreq - Compute time/frequency decomposition of data trials. This... +% timewarp - Given two event marker vectors, computes a matrix... diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_hist.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_hist.m new file mode 100644 index 0000000..0d13eb9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_hist.m @@ -0,0 +1,49 @@ +% eeg_hist() - history for EEGLAB dataset. +% +% Usage: +% >> EEGOUT = eeg_hist( EEGIN, command ); +% +% Inputs: +% EEGIN - input dataset +% command - [string] eeglab command +% +% Global variables used: +% EEGOUT - output dataset with updated history field +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, Dec 2003 +% +% See also: eegh(), eeglab() + +% Copyright (C) 2003 Arnaud Delorme, SCCN/INC/UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = eeg_hist( EEG, command ); + +if nargin < 2 + help eeg_hist; +end; + +if ~isfield(EEG, 'history') + EEG.history = ''; +end; + +if ~isempty(command) + try + EEG.history = [ EEG.history 10 command ]; + catch + EEG.history = strvcat(EEG.history, command); + end; +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_options.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_options.m new file mode 100644 index 0000000..77f4188 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_options.m @@ -0,0 +1,16 @@ +% eeg_options() - eeglab option script +% +% Note: DO NOT EDIT, instead use pop_editoptions() or the menu +% /File/Maximize memory in EEGLAB gui + +% STUDY options (set these checkboxes if you intend to work with studies) +option_storedisk = 0 ; % If set, keep at most one dataset in memory. This allows processing hundreds of datasets within studies. +option_savetwofiles = 1 ; % If set, save not one but two files for each dataset (header and data). This allows faster data loading in studies. +% Memory options +option_single = 1 ; % If set, use single precision under Matlab 7.x. This saves RAM but can lead to rare numerical imprecisions. +option_memmapdata = 0 ; % If set, use memory mapped array under Matlab 7.x. This may slow down some computation. +% ICA options +option_computeica = 0 ; % If set, precompute ICA activations. This requires more RAM but allows faster plotting of component activations. +option_scaleicarms = 1 ; % If set, scale ICA component activities to RMS (Root Mean Square) in microvolt (recommended). +% Folder options +option_rememberfolder = 1 ; % If set, when browsing to open a new dataset assume the folder/directory of previous dataset. diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_optionsbackup.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_optionsbackup.m new file mode 100644 index 0000000..408ae76 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_optionsbackup.m @@ -0,0 +1,23 @@ +% eeg_options() - eeglab option script +% +% Note: DO NOT EDIT, instead use pop_editoptions() or the menu +% /File/Maximize memory in EEGLAB gui + +% STUDY and file options (set these checkboxes if you intend to work with studies) +option_storedisk = 0 ; % If set, keep at most one dataset in memory. This allows processing hundreds of datasets within studies. +option_savetwofiles = 1 ; % If set, save not one but two files for each dataset (header and data). This allows faster data loading in studies. +option_saveversion6 = 1 ; % If set, write Matlab files in Matlab v6.5 (max compatibility). If not, write files in Matlab v7.3 (larger than 2Gb). +% Memory options +option_single = 1 ; % If set, use single precision under Matlab 7.x. This saves RAM but can lead to rare numerical imprecisions. +option_memmapdata = 0 ; % If set, use memory mapped array under Matlab 7.x. This may slow down some computation (beta). +option_eegobject = 0 ; % If set, use the EEGLAB EEG object instead of the standard EEG structure (beta). +% ICA options +option_computeica = 1 ; % If set, precompute ICA activations. This requires more RAM but allows faster plotting of component activations. +option_scaleicarms = 1 ; % If set, scale ICA component activities to RMS (Root Mean Square) in microvolt (recommended). +% Folder options +option_rememberfolder = 1 ; % If set, when browsing to open a new dataset assume the folder/directory of previous dataset. +% Toolbox options +option_donotusetoolboxes = 0 ; % If set, do not use Matlab additional toolboxes functions even if they are present (need to restart EEGLAB). +% EEGLAB connectivity and support +option_checkversion = 1 ; % If set, check for new version of EEGLAB at startup. +option_chat = 0 ; % If set, enable EEGLAB chat - currently UCSD only - restart EEGLAB after changing that option. diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_readoptions.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_readoptions.m new file mode 100644 index 0000000..25596c0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_readoptions.m @@ -0,0 +1,101 @@ +% eeg_readoptions() - Read EEGLAB memory options file (eeg_options) into a +% structure variable (opt). +% +% Usage: +% [ header, opt ] = eeg_readoptions( filename, opt ); +% +% Input: +% filename - [string] name of the option file +% opt - [struct] option structure containing backup values +% +% Outputs: +% header - [string] file header. +% opt - [struct] option structure containing an array of 3 fields +% varname -> all variable names. +% value -> value for each variable name +% description -> all description associated with each variable +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2006- +% +% See also: eeg_options(), eeg_editoptions() + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2006- +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ header, opt ] = eeg_readoptions( filename, opt_backup ); + + if nargin < 1 + help eeg_readoptions; + return; + end; + + if nargin < 2 + opt_backup = []; + end; + + if isstr(filename) + fid = fopen(filename, 'r'); + else fid = filename; + end; + + % skip header + % ----------- + header = ''; + str = fgets( fid ); + while (str(1) == '%') + header = [ header str]; + str = fgets( fid ); + end; + + % read variables values and description + % -------------------------------------- + str = fgetl( fid ); % jump a line + index = 1; + opt = []; + while (str(1) ~= -1) + if str(1) == '%' + opt(index).description = str(3:end-1); + opt(index).value = []; + opt(index).varname = ''; + else + [ opt(index).varname str ] = strtok(str); % variable name + [ equal str ] = strtok(str); % = + [ opt(index).value str ] = strtok(str); % value + [ tmp str ] = strtok(str); % ; + [ tmp dsc ] = strtok(str); % comment + dsc = deblank( dsc(end:-1:1) ); + opt(index).description = deblank( dsc(end:-1:1) ); + opt(index).value = str2num( opt(index).value ); + end; + + str = fgets( fid ); % jump a line + index = index+1; + end; + fclose(fid); + + % replace in backup structure if any + % ---------------------------------- + if ~isempty(opt_backup) + if ~isempty(opt) + for index = 1:length(opt_backup) + ind = strmatch(opt_backup(index).varname, { opt.varname }, 'exact'); + if ~isempty(ind) & ~isempty(opt_backup(index).varname) + opt_backup(index).value = opt(ind).value; + end; + end; + end; + opt = opt_backup; + end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_retrieve.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_retrieve.m new file mode 100644 index 0000000..e24ee02 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_retrieve.m @@ -0,0 +1,85 @@ +% eeg_retrieve() - Retrieve an EEG dataset from the variable +% containing all datasets (standard: ALLEEG). +% +% Usage: >> EEG = eeg_retrieve( ALLEEG, index ); +% +% Inputs: +% ALLEEG - variable containing all datasets +% index - index of the dataset to retrieve +% +% Outputs: +% EEG - output dataset. The workspace variable EEG is also updated +% ALLEEG - updated ALLEEG structure +% CURRENTSET - workspace variable index of the current dataset +% +% Note: The function performs >> EEG = ALLEEG(index); +% It also runs eeg_checkset() on it. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeg_store(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, ALLEEG, CURRENTSET] = eeg_retrieve( ALLEEG, CURRENTSET); + +if nargin < 2 + help eeg_retrieve; + return; +end; + +%try + eeglab_options; + + try, % check whether recent changes to this dataset have been saved or not + %-------------------------------------------------------------------- + tmpsaved = { ALLEEG.saved }; + tmpsaved = tmpsaved(CURRENTSET); + catch, tmpsaved = 'no'; + end; + + if length(CURRENTSET) > 1 & option_storedisk + [ EEG tmpcom ] = eeg_checkset(ALLEEG(CURRENTSET)); % do not load data if several datasets + if length(CURRENTSET) ~= length(ALLEEG) + [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + else + ALLEEG = EEG; + end; + else + if CURRENTSET ~= 0 + [ EEG tmpcom ] = eeg_checkset(ALLEEG(CURRENTSET), 'loaddata'); + [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + else + EEG = eeg_emptyset; % empty dataset + return; + end; + end; + + % retain saved field + % ------------------ + for index = 1:length(CURRENTSET) + ALLEEG(CURRENTSET(index)).saved = tmpsaved{index}; + EEG(index).saved = tmpsaved{index}; + end; + +%catch +% fprintf('Warning: cannot retrieve dataset with index %d\n', CURRENTSET); +% return; +%end; + +return; + diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeg_store.m b/code/eeglab13_4_4b/functions/adminfunc/eeg_store.m new file mode 100644 index 0000000..363ea54 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeg_store.m @@ -0,0 +1,168 @@ +% eeg_store() - store specified EEG dataset(s) in the ALLEG variable +% containing all current datasets, after first checking +% dataset consistency using eeg_checkset(). +% +% Usage: >> [ALLEEG EEG index] = eeg_store(ALLEEG, EEG); +% >> [ALLEEG EEG index] = eeg_store(ALLEEG, EEG, index); +% +% Inputs: +% ALLEEG - variable containing all current EEGLAB datasets +% EEG - dataset(s) to store - usually the current dataset. +% May also be an array of datasets; these will be +% checked and stored separately in ALLEEG. +% index - (optional), ALLEEG index (or indices) to use to store +% the new dataset(s). If no index is given, eeg_store() +% uses the lowest empty slot(s) in the ALLEEG array. +% Outputs: +% ALLEEG - array of all current datasets +% EEG - EEG dataset (after syntax checking) +% index - index of the new dataset +% +% Note: When 3 arguments are given, after checking the consistency of +% the input dataset structures this function simply performs +% >> ALLEEG(index) = EEG; +% +% Typical use: +% >> [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG); +% creates a new dataset in variable ALLEEG. +% >> [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); +% overwrites the current dataset in variable ALLEEG. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab(), eeg_checkset(), eeg_retrieve() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% uses the global variable EEG ALLEEG CURRENTSET + +% store set +% ------------------ +function [ALLEEG, EEG, storeSetIndex] = eeg_store(ALLEEG, EEG, storeSetIndex, varargin); + +% check parameter consistency +% ------------------------------ +if nargin >= 3 + if length(EEG) ~= length(storeSetIndex) & storeSetIndex(1) ~= 0 + error('Length of input dataset structure must equal the length of the index array'); + end; +end; + +% considering multiple datasets +% ----------------------------- +if length(EEG) > 1 + TMPEEG = EEG; + if nargin >= 3 & storeSetIndex(1) ~= 0 + for index=1:length(TMPEEG) + EEG = TMPEEG(index); + tmpsaved = EEG.saved; + if strcmpi(tmpsaved, 'justloaded'), tmpsaved = 'yes'; end; + [ALLEEG, EEG] = eeg_store(ALLEEG, EEG, storeSetIndex(index), varargin{:}); + ALLEEG(storeSetIndex(index)).saved = tmpsaved; + TMPEEG(index).saved = tmpsaved; + end; + else + for index=1:length(TMPEEG) + EEG = TMPEEG(index); + tmpsaved = EEG.saved; + if strcmpi(tmpsaved, 'justloaded'), tmpsaved = 'yes'; end; + [ALLEEG, EEG, storeSetIndex(index)] = eeg_store(ALLEEG, EEG); + ALLEEG(storeSetIndex(index)).saved = tmpsaved; + TMPEEG(index).saved = tmpsaved; + end; + end; + EEG = TMPEEG; + return; +end; + +if nargin < 3 + % creating new dataset + % -> erasing file information + % --------------------------- + EEG.filename = ''; + EEG.filepath = ''; + EEG.datfile = ''; +end; + +if isempty(varargin) % no text output and no check (study loading) + [ EEG com ] = eeg_checkset(EEG); +else + com = ''; +end; +if nargin > 2, + if storeSetIndex == 0 || strcmpi(EEG.saved, 'justloaded') + EEG.saved = 'yes'; % just loaded + else + EEG.saved = 'no'; + end; +elseif strcmpi(EEG.saved, 'justloaded') + EEG.saved = 'yes'; +else + EEG.saved = 'no'; +end; +EEG = eeg_hist(EEG, com); + +% find first free index +% --------------------- +findindex = 0; +if nargin < 3, findindex = 1; +elseif storeSetIndex == 0, findindex = 1; +end; + +if findindex + i = 1; + while (i<2000) + try + if isempty(ALLEEG(i).data); + storeSetIndex = i; i = 2000; + end; + i = i+1; + catch + storeSetIndex = i; i = 2000; + end; + end; + if isempty(varargin) % no text output and no check + fprintf('Creating a new ALLEEG dataset %d\n', storeSetIndex); + end; +else + if isempty(storeSetIndex) | storeSetIndex == 0 + storeSetIndex = 1; + end; +end; + +if ~isempty( ALLEEG ) + try + ALLEEG(storeSetIndex) = EEG; + catch + allfields = fieldnames( EEG ); + for i=1:length( allfields ) + eval( ['ALLEEG(' int2str(storeSetIndex) ').' allfields{i} ' = EEG.' allfields{i} ';' ]); + end; + if ~isfield(EEG, 'datfile') & isfield(ALLEEG, 'datfile') + ALLEEG(storeSetIndex).datfile = ''; + end; + end; +else + ALLEEG = EEG; + if storeSetIndex ~= 1 + ALLEEG(storeSetIndex+1) = EEG; + ALLEEG(1) = ALLEEG(storeSetIndex); % empty + ALLEEG(storeSetIndex) = ALLEEG(storeSetIndex+1); + ALLEEG = ALLEEG(1:storeSetIndex); + end; +end; +return; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eegh.m b/code/eeglab13_4_4b/functions/adminfunc/eegh.m new file mode 100644 index 0000000..703783a --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eegh.m @@ -0,0 +1,136 @@ +% eegh() - history function. +% +% Usage: +% >> eegh( arg ); +% >> eegh( arg1, arg2 ); +% +% Inputs: +% - With no argument, it return the command history. +% - arg is a string: with a string argument it pulls the command +% onto the stack. +% - arg is a number>0: execute the element in the stack at the +% required position. +% - arg is a number<0: unstack the required number of elements +% - arg is 0 : clear stack +% - arg1 is 'find' and arg2 is a string, try to find the closest command +% in the stack containing the string +% - arg1 is a string and arg2 is a structure, also add the history to +% the structure in filed 'history'. +% +% Global variables used: +% LASTCOM - last command +% ALLCOM - all the commands +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, 2001 +% +% See also: +% eeglab() (a graphical interface for eeg plotting, space frequency +% decomposition, ICA, ... under Matlab for which this command +% was designed). + +% Copyright (C) 2001 Arnaud Delorme, SCCN/INC/UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% To increase/decrease the maximum depth of the stack, edit the eeg_consts file + +function str = eegh( command, str ); + +mode = 1; % mode = 1, full print, mode = 0, truncated print + +global ALLCOM; + +%if nargin == 2 +% fprintf('2: %s\n', command); +%elseif nargin == 1 +% fprintf('1: %s\n', command); +%end; + +if nargin < 1 + if isempty(ALLCOM) + fprintf('No history\n'); + else + for index = 1:length(ALLCOM) + if mode == 0, txt = ALLCOM{ index }; fprintf('%d: ', index); + else txt = ALLCOM{ length(ALLCOM)-index+1 }; + end; + if (length(txt) > 72) & (mode == 0) + fprintf('%s...\n', txt(1:70) ); + else + fprintf('%s\n', txt ); + end; + end; + end; + if nargout > 0 + str = strvcat(ALLCOM); + end; +elseif nargin == 1 + if isempty( command ) + return; + end; + if isstr( command ) + if ~isempty(ALLCOM) && isequal(ALLCOM{1}, command), return; end; + if isempty(ALLCOM) + ALLCOM = { command }; + else + ALLCOM = { command ALLCOM{:}}; + end; + global LASTCOM; + LASTCOM = command; + else + if command == 0 + ALLCOM = []; + else if command < 0 + ALLCOM = ALLCOM( -command+1:end ); % unstack elements + else + txt = ALLCOM{command}; + if length(txt) > 72 + fprintf('%s...\n', txt(1:70) ); + else + fprintf('%s\n', txt ); + end; + evalin( 'base', ALLCOM{command} ); % execute element + eegh( ALLCOM{command} ); % add to history + end; + end; + end; +else % nargin == 2 + if ~isstruct(str) + if strcmp(command, 'find') + for index = 1:length(ALLCOM) + if ~isempty(findstr(ALLCOM{index}, str)) + str = ALLCOM{index}; + return; + end; + end; + str = []; + end; + else + % warning also some code present in eeg_store and pop_newset + if ~isempty(ALLCOM) && isequal(ALLCOM{1}, command), return; end; + eegh(command); % add to history + if ~isempty(command) + if length(str) == 1 + str = eeg_hist(str, command); + else + for i = 1:length(str) + str(i) = eeg_hist(str(i), [ '% multiple datasets command: ' command ]); + end; + end; + end; + end; +end; + + diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeglab_error.m b/code/eeglab13_4_4b/functions/adminfunc/eeglab_error.m new file mode 100644 index 0000000..1a1ea3d --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeglab_error.m @@ -0,0 +1,74 @@ +% eeglab_error() - generate an eeglab error. +% +% Usage: >> eeglab_error; +% +% Inputs: none, simply capture the last error generated. +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2006- +% +% see also: eeglab() + +% Copyright (C) 2006 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function eeglab_error + + % handling errors + % ---------------- + tmplasterr = lasterr; + [iseeglaberror tmplasterr header] = testeeglaberror(tmplasterr); + ft_error = false; + if iseeglaberror + tmp = lasterror; % Add more information to eeglab errors JRI, RMC + tmplasterr = sprintf('%s,\n\n (Error occurred in function %s() at line %d)',... + tmplasterr, tmp.stack(1).name, tmp.stack(1).line); + errordlg2(tmplasterr, header); + else + try + tmp = lasterror; + if length(tmp.stack(1).name) && all(tmp.stack(1).name(1:3) == 'ft_') + ft_error = true; + end; + tmperr = [ 'EEGLAB error in function ' tmp.stack(1).name '() at line ' int2str(tmp.stack(1).line) ':' 10 10 lasterr ]; + catch % Matlab 5 and when the stack is empty + tmperr = [ 'EEGLAB error:' 10 10 tmplasterr ]; + end; + if ~ft_error + tmperr = [ tmperr 10 10 'If you think this is a bug, please submit a detailed ' 10 ... + 'description of how to reproduce the problem (and upload' 10 ... + 'a small dataset) at http://sccn.ucsd.edu/eeglab/bugzilla' ]; + else + tmperr = [ tmperr 10 10 'This is a problem with FIELDTRIP. The Fieldtrip version you downloaded' 10 ... + 'is corrupted. Please manually replace Fieldtrip with an earlier version' 10 ... + 'and/or email the Fieldtrip developpers so they can fix the issue.' ]; + end; + errordlg2(tmperr, header); + end; + + function [ val str header ] = testeeglaberror(str) + header = 'EEGLAB error'; + val = 0; + try, + if strcmp(str(1:5), 'Error'), + val = 1; + str = str(12:end); %Corrected extraction of function name, occurs after 'Error using ' JRI, RMC + indendofline = find(str == 10); + funcname = str(1:indendofline(1)-1); + str = str(indendofline(1)+1:end); + header = [ funcname ' error' ]; + end; + catch + end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeglab_options.m b/code/eeglab13_4_4b/functions/adminfunc/eeglab_options.m new file mode 100644 index 0000000..297358d --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeglab_options.m @@ -0,0 +1,67 @@ +% eeglab_options() - handle EEGLAB options. This script (not function) +% set the various options in the eeg_options() file. +% +% Usage: +% eeglab_options; +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2006- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2006- +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% load local file +% --------------- +homefolder = ''; +try, + %clear eeg_options; % note: we instead clear this function handle in pop_editoptions() + + if iseeglabdeployed + com1 = readtxtfile(fullfile(eeglabexefolder, 'eeg_optionsbackup.txt')); + com2 = readtxtfile(fullfile(eeglabexefolder, 'eeg_options.txt')); + eval( com1 ); + eval( com2 ); + else + eeg_optionsbackup; + icadefs; + + % folder for eeg_options file (also update the pop_editoptions) + if ~isempty(EEGOPTION_PATH) + homefolder = EEGOPTION_PATH; + elseif ispc + if ~exist('evalc'), eval('evalc = @(x)(eval(x));'); end; + homefolder = deblank(evalc('!echo %USERPROFILE%')); + else homefolder = '~'; + end; + + option_file = fullfile(homefolder, 'eeg_options.m'); + oldp = pwd; + try + if ~isempty(dir(option_file)) + cd(homefolder); + else + tmpp2 = fileparts(which('eeglab_options.m')); + cd(tmpp2); + end; + catch, end; + eeg_options; % default one with EEGLAB + cd(oldp); + end; + option_savematlab = ~option_savetwofiles; + +catch + lasterr + disp('Warning: could not access the local eeg_options file'); +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/eeglabexefolder.m b/code/eeglab13_4_4b/functions/adminfunc/eeglabexefolder.m new file mode 100644 index 0000000..54a0e44 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/eeglabexefolder.m @@ -0,0 +1,26 @@ +% eeglabexefolder - return the exe folder for EEGLAB. This function is only +% relevant for the compiled version of EEGLAB. +% +% Author: Arnaud Delorme, SCCN & CERCO, CNRS, 2008- + +% Copyright (C) 15 Feb 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function str = eeglabexefolder; + +str = ctfroot; +inds = find(str == filesep); +str = str(1:inds(end)-1); diff --git a/code/eeglab13_4_4b/functions/adminfunc/error_bc.m b/code/eeglab13_4_4b/functions/adminfunc/error_bc.m new file mode 100644 index 0000000..a4b77ba --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/error_bc.m @@ -0,0 +1,2 @@ +function res = error_bc +res = false; diff --git a/code/eeglab13_4_4b/functions/adminfunc/gethelpvar.m b/code/eeglab13_4_4b/functions/adminfunc/gethelpvar.m new file mode 100644 index 0000000..a42183d --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/gethelpvar.m @@ -0,0 +1,301 @@ +% gethelpvar() - convert a Matlab m-file help-message header +% into out variables +% Usage: +% >> [vartext, varnames] = gethelpvar( filein, varlist); +% +% Inputs: +% filein - input filename (with .m extension) +% varlist - optional list of variable to return. If absent +% retrun all variables. +% +% Outputs: +% vartext - variable text +% varnames - name of the varialbe returned; +% +% Notes: see help2html() for file format +% +% Example: >> gethelpvar( 'gethelpvar.m', 'filein') +% +% Author: Arnaud Delorme, Salk Institute 20 April 2002 +% +% See also: help2html() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [alltext, allvars] = gethelpvar( filename, varlist ) + +if nargin < 1 + help gethelpvar; + return; +end; + +% input file +% ---------- +fid = fopen( filename, 'r'); +if fid == -1 + error('File not found'); +end; + +cont = 1; +% scan file +% ----------- +str = fgets( fid ); +% if first line is the name of the function, reload +if str(1) ~= '%', str = fgets( fid ); end; + +% state variables +% ----------- +maindescription = 1; +varname = []; +oldvarname = []; +vartext = []; +newvar = 0; +allvars = {}; +alltext = {}; +indexout = 1; + +while (str(1) == '%') + str = deblank(str(2:end-1)); + + % --- DECODING INPUT + newvar = 0; + str = deblank2(str); + + if ~isempty(str) + + % find a title + % ------------ + i2d = findstr(str, ':'); + newtitle = 0; + if ~isempty(i2d) + i2d = i2d(1); + switch lower(str(1:i2d)) + case { 'usage:' 'authors:' 'author:' 'notes:' 'note:' 'input:' ... + 'inputs:' 'outputs:' 'output' 'example:' 'examples:' 'see also:' }, newtitle = 1; + end; + if (i2d == length(str)) & (str(1) ~= '%'), newtitle = 1; end; + end; + if newtitle + tilehtml = str(1:i2d); + newtitle = 1; + oldvarname = varname; + oldvartext = vartext; + if i2d < length(str) + %vartext = formatstr(str(i2d+1:end), g.refcall); + vartext = str(i2d+1:end); + else vartext = []; + end; + varname = []; + else + % not a title + % ------------ + % scan lines + [tok1 strrm] = strtok( str ); + [tok2 strrm] = strtok( strrm ); + + if ~isempty(tok2) & ( isequal(tok2,'-') | isequal(tok2,'=')) % new variable + newvar = 1; + oldvarname = varname; + oldvartext = vartext; + varname = tok1; + strrm = deblank(strrm); % remove tail blanks + strrm = deblank(strrm(end:-1:1)); % remove initial blanks + %strrm = formatstr( strrm(end:-1:1), g.refcall); + strrm = strrm(end:-1:1); + vartext = strrm; + else + % continue current text + str = deblank(str); % remove tail blanks + str = deblank(str(end:-1:1)); % remove initial blanks + %str = formatstr( str(end:-1:1), g.refcall ); + str = str(end:-1:1); + if isempty(vartext) + vartext = str; + else + if ~isempty(varname) + vartext = [ vartext 10 str]; % espace if in array + else + if length(vartext)>3 & all(vartext( end-2:end) == '.') + vartext = [ deblank2(vartext(1:end-3)) 10 str]; % espace if '...' + else + vartext = [ vartext 10 str]; % CR otherwise + end; + end; + end; + end; + newtitle = 0; + end; + % --- END OF DECODING + + str = fgets( fid ); + + % test if last entry + % ------------------ + if str(1) ~= '%' + if ~newtitle + if ~isempty(oldvarname) + allvars{indexout} = oldvarname; + alltext{indexout} = oldvartext; + indexout = indexout + 1; + %fprintf( fo, [ '' g.normrow g.normcol1 g.var '\n' ], oldvarname); + %fprintf( fo, [ g.normcol2 g.vartext '\n' ], oldvartext); + else + if ~isempty(oldvartext) + %fprintf( fo, [ g.normcol2 g.tabtext '\n' ], oldvartext); + end; + end; + newvar = 1; + oldvarname = varname; + oldvartext = vartext; + end; + end; + + % test if new input for an array + % ------------------------------ + if newvar | newtitle + if maindescription + if ~isempty(oldvartext) % FUNCTION TITLE + maintext = oldvartext; + maindescription = 0; + functioname = oldvarname( 1:findstr( oldvarname, '()' )-1); + %fprintf( fo, [g.normrow g.normcol1 g.functionname '\n'],upper(functioname)); + %fprintf( fo, [g.normcol2 g.description '\n'], [ upper(oldvartext(1)) oldvartext(2:end) ]); + + % INSERT IMAGE IF PRESENT + %imagename = [ htmlfile( 1:findstr( htmlfile, functioname )-1) functioname '.jpg' ]; + %if exist( imagename ) % do not make link if the file does not exist + %fprintf(fo, [ g.normrow g.doublecol ... + % '

' ]); + %end; + end; + elseif ~isempty(oldvarname) + allvars{indexout} = oldvarname; + alltext{indexout} = oldvartext; + indexout = indexout + 1; + %fprintf( fo, [ '' g.normrow g.normcol1 g.var '\n' ], oldvarname); + %fprintf( fo, [ g.normcol2 g.vartext '\n' ], oldvartext); + else + if ~isempty(oldvartext) + %fprintf( fo, [ g.normcol2 g.text '\n' ], oldvartext); + end; + end; + end; + + % print title + % ----------- + if newtitle + %fprintf( fo, [ g.normrow g.doublecol '
' g.normrow g.normcol1 g.title '\n' ], tilehtml); + if str(1) ~= '%' % last input + %fprintf( fo, [ g.normcol2 g.text '\n' ], vartext); + end; + oldvarname = []; + oldvartext = []; + end; + else + str = fgets( fid ); + end; +end; +fclose( fid ); + +% remove quotes of variables +% -------------------------- +for index = 1:length(allvars) + if allvars{index}(1) == '''', allvars{index} = eval( allvars{index} ); end; +end; + +if exist('varlist') == 1 + if ~iscell(varlist), varlist = { varlist }; end; + newtxt = mat2cell(zeros(length(varlist), 1), length(varlist), 1); % preallocation + for index = 1:length(varlist) + loc = strmatch( varlist{index}, allvars); + if ~isempty(loc) + newtxt{index} = alltext{loc(1)}; + else + disp([ 'warning: variable ''' varlist{index} ''' not found']); + newtxt{index} = ''; + end; + end; + alltext = newtxt; +end; + +return; + +% ----------------- +% sub-functions +% ----------------- +function str = deblank2( str ); % deblank two ways + str = deblank(str(end:-1:1)); % remove initial blanks + str = deblank(str(end:-1:1)); % remove tail blanks +return; + +function strout = formatstr( str, refcall ); + [tok1 strrm] = strtok( str ); + strout = []; + while ~isempty(tok1) + tokout = functionformat( tok1, refcall ); + if isempty( strout) + strout = tokout; + else + strout = [strout ' ' tokout ]; + end; + [tok1 strrm] = strtok( strrm ); + end; +return; + +function tokout = functionformat( tokin, refcall ); + tokout = tokin; % default + [test, realtokin, tail] = testfunc1( tokin ); + if ~test, [test, realtokin, tail] = testfunc2( tokin ); end; + if test + i1 = findstr( refcall, '%s'); + i2 = findstr( refcall(i1(1):end), ''''); + if isempty(i2) i2 = length( refcall(i1(1):end) )+1; end; + filename = [ realtokin refcall(i1+2:i1+i2-2)]; + if exist( filename ) % do not make link if the file does not exist + tokout = sprintf( [ '%s' tail ' ' ], realtokin, realtokin ); + end; + end; +return; + +function [test, realtokin, tail] = testfunc1( tokin ) % test if is string is 'function()[,]' + test = 0; realtokin = ''; tail = ''; + if ~isempty( findstr( tokin, '()' ) ) + realtokin = tokin( 1:findstr( tokin, '()' )-1); + if length(realtokin) < (length(tokin)-2) tail = tokin(end); else tail = []; end; + test = 1; + end; +return; + +function [test, realtokin, tail] = testfunc2( tokin ) % test if is string is 'FUNCTION[,]' + test = 0; realtokin = ''; tail = ''; + if all( upper(tokin) == tokin) + if tokin(end) == ',' + realtokin = tokin(1:end-1); + tail = ','; + else + realtokin = tokin; + end; + testokin = realtokin; + testokin(findstr(testokin, '_')) = 'A'; + testokin(findstr(testokin, '2')) = 'A'; + if all(double(testokin) > 64) & all(double(testokin) < 91) + test = 1; + end; + realtokin = lower(realtokin); + end; +return; diff --git a/code/eeglab13_4_4b/functions/adminfunc/getkeyval.m b/code/eeglab13_4_4b/functions/adminfunc/getkeyval.m new file mode 100644 index 0000000..16ee357 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/getkeyval.m @@ -0,0 +1,135 @@ +% getkeyval() - get variable value from a 'key', 'val' sequence string. +% +% Usage: +% >> val = getkeyval( keyvalstr, varname, mode, defaultval); +% +% Inputs: +% keyvalstr - string containing 'key', 'val' arguments +% varname - string for the name of the variable or index +% of the value to retrieve (assuming arguments are +% separated by comas). +% mode - if the value extracted is an integer array, the +% 'mode' variable can contain a subset of indexes to return. +% If mode is 'present', then either 0 or 1 is returned +% depending on wether the variable is present. +% defaultval - default value if the varible is not found +% +% Outputs: +% val - a value for the variable +% +% Note: this function is helpful for finding arguments in string commands +% stored in command history. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 29 July 2002 +% +% See also: gethelpvar() + +% Copyright (C) 2002 arno@salk.edu, Arnaud Delorme, CNL / Salk Institute +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function txt = getkeyval(lastcom, var, mode, default) + % mode can be present for 0 and 1 if the variable is present + if nargin < 1 + help getkeyval; + return; + end; + if nargin < 4 + default = ''; + end; + if isempty(lastcom) + txt = default; return; + end; + if nargin < 3 + mode = ''; + end; + if isstr(mode) & strcmp(mode, 'present') + if ~isempty(findstr(var, lastcom)) + txt = 1; return; + else + txt = 0; return; + end; + end; + if isnumeric(var) + comas = findstr(lastcom, ','); + if length(comas) >= var + txt = lastcom(comas(var-1)+1:comas(var)-1); + tmpval = eval( txt ); + if isempty(tmpval), txt = ''; + else txt = vararg2str( tmpval ); + end; + return; + +% txt = deblank(txt(end:-1:1)); +% txt = deblank(txt(end:-1:1)); +% +% if ~isempty(txt) & txt(end) == '}', txt = txt(2:end-1); end; +% if ~isempty(txt) +% txt = deblank(txt(end:-1:1)); +% txt = deblank(txt(end:-1:1)); +% end; +% if ~isempty(txt) & txt(end) == ']', txt = txt(2:end-1); end; +% if ~isempty(txt) +% txt = deblank(txt(end:-1:1)); +% txt = deblank(txt(end:-1:1)); +% end; +% if ~isempty(txt) & txt(end) == '''', txt = txt(2:end-1); end; + else + txt = default; + end; + %fprintf('%s:%s\n', var, txt); + return; + else + comas = findstr(lastcom, ','); % finding all comas + comas = [ comas findstr(lastcom, ');') ]; % and end of lines + varloc = findstr(lastcom, var); + if ~isempty(varloc) + % finding comas surrounding 'val' var in 'key', 'val' sequence + comas = comas(find(comas >varloc(end))); + txt = lastcom(comas(1)+1:comas(2)-1); + txt = deblank(txt(end:-1:1)); + txt = deblank(txt(end:-1:1)); + if strcmp(mode, 'full') + parent = findstr(lastcom, '}'); + if ~isempty(parent) + comas = comas(find(comas >parent(1))); + txt = lastcom(comas(1)+1:comas(2)-1); + end; + txt = [ '''' var ''', ' txt ]; + elseif isnumeric(mode) + txt = str2num(txt); + if ~isempty(mode) + if length(txt) >= max(mode) + if all(isnan(txt(mode))), txt = ''; + else txt = num2str(txt(mode)); + end; + elseif length(txt) >= mode(1) + if all(isnan(txt(mode(1)))), txt = ''; + else txt = num2str(txt(mode(1))); + end; + else + txt = default; + end; + else + txt = num2str(txt); + end; + elseif txt(1) == '''' + txt = txt(2:end-1); % remove quotes for text + end; + else + txt = default; + end; + end; + %fprintf('%s:%s\n', var, txt); diff --git a/code/eeglab13_4_4b/functions/adminfunc/gettext.m b/code/eeglab13_4_4b/functions/adminfunc/gettext.m new file mode 100644 index 0000000..16ea075 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/gettext.m @@ -0,0 +1,78 @@ +% gettext() - This function prints a dialog box on screen and waits for +% the user to enter a string. There is a cancel button which +% returns a value of []. +% Usage: +% >> out = gettext(label1,label2,...,label7); +% +% Author: Colin Humphries, CNL / Salk Institute, La Jolla, 1997 + +% Copyright (C) 1997 Colin Humphries, Salk Institute +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function out = gettext(label1,label2,label3,label4,label5,label6,label7); + +global is_text_entered +is_text_entered = 0; + +for i = 1:nargin + eval(['leng(i) = length(label',num2str(i),');']) +end +figurelength = 15*1.0*max(leng); + +if figurelength < 240 + figurelength = 290; +end + +figureheight = 80+nargin*18; +% Set figure + +figure('Position',[302 396 figurelength figureheight],'color',[.6 .6 .6],'NumberTitle','off') +f1 = gcf; + +ax = axes('Units','Pixels','Position',[0 0 figurelength figureheight],'Visible','off','XLim',[0 figurelength],'YLim',[0 figureheight]); + +for i = 1:nargin + + eval(['text(figurelength/2,',num2str(figureheight-(i-1)*18-20),',label',num2str(i),',''color'',''k'',''FontSize'',16,''HorizontalAlignment'',''center'')']) + +end +% Set up uicontrols + +TIMESTRING = ['global is_text_entered;is_text_entered = 1;clear is_text_entered']; + +u = uicontrol('Style','Edit','Units','Pixels','Position',[15 20 figurelength-95 25],'HorizontalAlignment','left','Callback',TIMESTRING); + +TIMESTRING = ['global is_text_entered;is_text_entered = 2;clear is_text_entered']; +v = uicontrol('Style','Pushbutton','Units','Pixels','Position',[figurelength-70 20 55 25],'String','Cancel','Callback',TIMESTRING); + + +while(is_text_entered == 0) + drawnow +end + + +if is_text_entered == 1 + out = get(u,'string'); +else + out = []; +end + + +clear is_text_entered +delete(f1) + diff --git a/code/eeglab13_4_4b/functions/adminfunc/hlp_argstruct2linearcell.m b/code/eeglab13_4_4b/functions/adminfunc/hlp_argstruct2linearcell.m new file mode 100644 index 0000000..353eeaf --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/hlp_argstruct2linearcell.m @@ -0,0 +1,56 @@ +% hlp_argstruct2linearcell() - Linearize configation output of arg_guipanel +% +% Usage: +% >> cellval = hlp_argstruct2linearcells( cfg ); +% +% Inputs: +% cfg - output configuration structure from arg_guipanel +% +% Output: +% cellval - cell array of output values +% +% Author: Arnaud Delorme, SCCN & CERCO, CNRS, 2013- + +% Copyright (C) 2013 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function cellval = hlp_argstruct2linearcell(cfg); + + cellval = {}; + if isstruct(cfg) + ff = fieldnames(cfg); + for iField = 1:length(ff) + if ~strcmpi(ff{iField}, 'arg_direct') + if strcmpi(ff{iField}, 'arg_selection') + cellval = { cfg.arg_selection cellval{:} }; + else + val = cfg.(ff{iField}); + if isstruct(val) + val = hlp_argstruct2linearcell(val); + cellval = { cellval{:} ff{iField} val{:} }; + elseif iscell(val) + cellval = { cellval{:} ff{iField} vararg2str(val) }; + else + cellval = { cellval{:} ff{iField} val }; + end; + end; + end; + end + else + cellval = cfg; + end; + + diff --git a/code/eeglab13_4_4b/functions/adminfunc/intersect_bc.m b/code/eeglab13_4_4b/functions/adminfunc/intersect_bc.m new file mode 100644 index 0000000..1a2a399 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/intersect_bc.m @@ -0,0 +1,29 @@ +% intersect_bc - intersect backward compatible with Matlab versions prior to 2013a + +function [C,IA,IB] = intersect_bc(A,B,varargin); + +errorFlag = error_bc; + +v = version; +indp = find(v == '.'); +v = str2num(v(1:indp(2)-1)); +if v > 7.19, v = floor(v) + rem(v,1)/10; end; + +if nargin > 2 + ind = strmatch('legacy', varargin); + if ~isempty(ind) + varargin(ind) = []; + end; +end; + +if v >= 7.14 + [C,IA,IB] = intersect(A,B,varargin{:},'legacy'); + if errorFlag + [C2,IA2,IB2] = intersect(A,B,varargin{:}); + if (~isequal(C, C2) || ~isequal(IA, IA2) || ~isequal(IB, IB2)) + warning('backward compatibility issue with call to intersect function'); + end; + end; +else + [C,IA,IB] = intersect(A,B,varargin{:}); +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/is_sccn.m b/code/eeglab13_4_4b/functions/adminfunc/is_sccn.m new file mode 100644 index 0000000..e6e6b98 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/is_sccn.m @@ -0,0 +1,14 @@ +% is_sccn() - returns 1 if computer is located at SCCN (Swartz Center +% for computational Neuroscience) and 0 otherwise + +function bool = is_sccn; + + bool = 0; + domnane = ' '; + try + eval([ 'if isunix, [tmp domname] = unix(''hostname -d'');' ... + 'end;' ... + 'bool = strcmpi(domname(1:end-1), ''ucsd.edu'');' ], ''); + catch, + end; + diff --git a/code/eeglab13_4_4b/functions/adminfunc/iseeglabdeployed.m b/code/eeglab13_4_4b/functions/adminfunc/iseeglabdeployed.m new file mode 100644 index 0000000..5ec7b36 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/iseeglabdeployed.m @@ -0,0 +1,7 @@ +% iseeglabdeployed - true for EEGLAB compile version and false otherwise +function val = iseeglabdeployed +try + val = isdeployed; +catch + val = 0; +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/ismatlab.m b/code/eeglab13_4_4b/functions/adminfunc/ismatlab.m new file mode 100644 index 0000000..3773b6b --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/ismatlab.m @@ -0,0 +1,8 @@ +function res = ismatlab; + +v = version; +if v(1) > '4' + res = 1; +else + res = 0; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/ismember_bc.m b/code/eeglab13_4_4b/functions/adminfunc/ismember_bc.m new file mode 100644 index 0000000..a6b5358 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/ismember_bc.m @@ -0,0 +1,29 @@ +% ismember_bc - ismember backward compatible with Matlab versions prior to 2013a + +function [C,IA] = ismember_bc(A,B,varargin); + +errorFlag = error_bc; + +v = version; +indp = find(v == '.'); +v = str2num(v(1:indp(2)-1)); +if v > 7.19, v = floor(v) + rem(v,1)/10; end; + +if nargin > 2 + ind = strmatch('legacy', varargin); + if ~isempty(ind) + varargin(ind) = []; + end; +end; + +if v >= 7.14 + [C,IA] = ismember(A,B,varargin{:},'legacy'); + if errorFlag + [C2,IA2] = ismember(A,B,varargin{:}); + if (~isequal(C, C2) || ~isequal(IA, IA2)) + warning('backward compatibility issue with call to ismember function'); + end; + end; +else + [C,IA] = ismember(A,B,varargin{:}); +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_askinstall.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_askinstall.m new file mode 100644 index 0000000..aca395c --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_askinstall.m @@ -0,0 +1,51 @@ +function installRes = plugin_askinstall(pluginName, pluginFunc, forceInstall) + +if nargin < 3, forceInstall = false; end; + +if nargin < 2 || ~exist(pluginFunc) + + if ~forceInstall + db = dbstack; + if length(db) > 2 && ~strcmpi(db(end).name, 'checkouteeglab.m'); + error([ 'Cannot find ' pluginName ' extension, use EEGLAB Extension Manager to install it' ]); + end; + + installRes = 0; + + % check is deactivated + try, PLUGINLIST = evalin('base', 'PLUGINLIST'); catch, PLUGINLIST = []; end; + if ~isempty(PLUGINLIST) && isfield(PLUGINLIST, 'plugin') + indPlugin = strmatch(lower(pluginName), lower({ PLUGINLIST.plugin }), 'exact'); + if ~isempty(indPlugin) && strcmpi(PLUGINLIST(indPlugin(1)).status, 'deactivated') + res = questdlg2( [ pluginName ' extension is de-activated. Do you want to reactivate it now?' ], [ pluginName ' extension installation' ], 'No', 'Yes', 'Yes' ); + if strcmpi(res, 'no'), return, end; + plugin_reactivate(PLUGINLIST(indPlugin(1)).foldername); + evalin('base', 'eeglab rebuild'); + installRes = 1; + return; + end; + end; + + % check for installing + res = questdlg2( [ pluginName ' extension is not installed. Do you want to download it now?' ], [ pluginName ' extension installation' ], 'No', 'Yes', 'Yes' ); + else + res = 'yes'; + end; + + if strcmpi(res, 'no'), return, end; + plugins = plugin_getweb('import', []); + indPlugin = strmatch(lower(pluginName), lower({ plugins.name }), 'exact'); + if isempty(indPlugin), + plugins = plugin_getweb('process', []); + indPlugin = strmatch(lower(pluginName), lower({ plugins.name })); + if isempty(indPlugin), + error([ pluginName ' extension not found' ]); + end; + end; + result = plugin_install(plugins(indPlugin(1)).zip, plugins(indPlugin(1)).name, plugins(indPlugin(1)).version, forceInstall); + if result == 1, installRes = 1; end; + + evalin('base', 'eeglab rebuild'); +else + installRes = 1; +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_convert.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_convert.m new file mode 100644 index 0000000..aa3084a --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_convert.m @@ -0,0 +1,9 @@ +function plugin = plugin_convert(pluginOri) + +for iRow = 1:length(pluginOri) + plugin(iRow).currentversion = pluginOri(iRow).version; + plugin(iRow).foldername = pluginOri(iRow).foldername; + plugin(iRow).status = pluginOri(iRow).status; + plugin(iRow).name = pluginOri(iRow).plugin; + plugin(iRow).installed = 1; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_deactivate.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_deactivate.m new file mode 100644 index 0000000..7e1afbb --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_deactivate.m @@ -0,0 +1,28 @@ +function plugin_deactivate(foldername); + + % get plugin path + % --------------- + fullpluginfolder = fullfile(fileparts(which('eeglab.m')), 'plugins', foldername); + if ~exist(fullpluginfolder) + error([ 'Could not find folder ' foldername 'in extension folder' ]); + end; + + disp('Removing extension from path'); + allPaths = path; + indSep = [0 find(allPaths == ':') length(allPaths)+1]; + for index = 1:length(indSep)-1 + tmpPath = allPaths(indSep(index)+1:indSep(index+1)-1); + if ~isempty(strfind(tmpPath, fullpluginfolder)) + rmpath(tmpPath); + fprintf('Removing path %s\n', tmpPath); + end; + end; + + disp([ 'Moving extension ' foldername ' to deactivatedplugins folder' ]); + fulldeactivatedpluginfolder = fullfile(fileparts(which('eeglab.m')), 'deactivatedplugins'); + if ~exist(fulldeactivatedpluginfolder), mkdir(fulldeactivatedpluginfolder); end; + try + movefile(fullpluginfolder, fulldeactivatedpluginfolder); + catch + eeglab_error; + end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_extract.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_extract.m new file mode 100644 index 0000000..c63f592 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_extract.m @@ -0,0 +1,274 @@ +function restartEeglabFlag = plugin_extract(type, pluginlist, page) + +if nargin < 3, page = 1; end; +% type may be 'import' or 'process' +restartEeglabFlag = false; +pluginsPerPage = 15; + +% check the presence of unzip +%str = evalc('!unzip'); +%if length(str) < 200 +% error([ '"unzip" could not be found. Instal unzip and make sure' 10 'it is accessible under Matlab by adding the program to' 10 'the path and typing "!unzip"' ]); +%end; + +if ~isstruct(type) + plugin = plugin_getweb(type, pluginlist, 'newlist'); + % sort plugins by download score + [tmp scoreOrder] = sort([ plugin.downloads ], 2, 'descend'); + plugin = plugin(scoreOrder); +else + plugin = type; +end; + +% select page +allPlugins = plugin; +numPlugin = length(plugin); +moreThanOnePage = 0; +if numPlugin > pluginsPerPage + plugin = plugin(pluginsPerPage*(page-1)+1:min(length(plugin),pluginsPerPage*page)); + moreThanOnePage = 1; +end; + +% find which menu to show +newInstallFlag = false; +installedFlag = false; +deactivatedFlag = false; +for iPlugin = length(plugin):-1:1 + if ~plugin(iPlugin).installed, newInstallFlag = true; end; + if plugin(iPlugin).installed && ~strcmpi(plugin(iPlugin).status, 'deactivated'), installedFlag = true; end; + if strcmpi(plugin(iPlugin).status, 'deactivated'), deactivatedFlag = true; end; +end; + +uilist = {}; +geom = {}; +geomvert = []; +pluginIndices = []; +callback = [ 'tmptag = get(gcbo, ''tag'');' ... + 'if tmptag(3) == ''1'', tmptag(3) = ''2''; else tmptag(3) = ''1''; end;' ... + 'if get(gcbo, ''value''), set(findobj(gcbf, ''tag'', tmptag), ''value'', 0); end; clear tmptag;' ]; + +% ------------------ +% plugins to install +% ------------------ +maxchar = 60; +geom = {}; +lineGeom = [ 0.28 0.28 0.95 0.6 0.6 3 0.35 ]; +if newInstallFlag + uilist = { {} { 'style' 'text' 'string' 'Extensions available for install on the internet' 'fontweight' 'bold' 'fontsize' 18 'tag' 'title' } }; + uilist = { uilist{:} { 'style' 'text' 'string' 'I' 'tag' 'install' } { } ... + { 'style' 'text' 'string' 'Plugin' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Vers.' 'tag' 'verweb' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Score' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Description' 'fontweight' 'bold' } {}}; + geom = { [1 5.5] lineGeom }; + geomvert = [1 1]; + for iRow = 1:length(plugin) + if ~plugin(iRow).installed && ~strcmpi(plugin(iRow).status, 'deactivated') + % text for description + description = plugin(iRow).description; + if length(description) > maxchar+2 + description = [ description(1:min(maxchar,length(description))) '...' ]; + end; + + enableWebDoc = fastif(isempty(plugin(iRow).webdoc), 'off', 'on'); + + userdata = ''; + if plugin(iRow).installed && plugin(iRow).installorupdate, userdata = 'colortored'; end; + uilist = { uilist{:}, ... + { 'style' 'checkbox' 'string' '' 'value' 0 'enable' 'on' }, ... + { 'style' 'checkbox' 'string' '' 'visible' 'off' }, ... + { 'style' 'text' 'string' plugin(iRow).name }, ... + { 'style' 'text' 'string' plugin(iRow).version 'tag' 'latestversion' 'userdata' userdata }, ... + { 'style' 'text' 'string' int2str(plugin(iRow).downloads) }, ... + { 'style' 'text' 'string' description }, ... + { 'style' 'pushbutton' 'string' 'Doc' 'enable' enableWebDoc 'callback' myweb(plugin(iRow).webdoc) } }; + geom = { geom{:}, lineGeom }; + geomvert = [ geomvert 1]; + pluginIndices = [ pluginIndices iRow ]; + end; + end; +end; + +% ----------------- +% installed plugins +% ----------------- +if installedFlag + uilist = { uilist{:} {} {} { 'style' 'text' 'string' 'Installed extensions' 'fontweight' 'bold' 'fontsize' 18 'tag' 'title' } }; + uilist = { uilist{:} { 'style' 'text' 'string' 'I' 'tag' 'update' } ... + { 'style' 'text' 'string' 'I' 'tag' 'deactivate' } ... + { 'style' 'text' 'string' 'Plugin' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Vers.' 'tag' 'verweb' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Score' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Description' 'fontweight' 'bold' } {}}; + + geom = { geom{:} 1 [1 5.5] lineGeom }; + geomvert = [geomvert 1 1 1]; + for iRow = 1:length(plugin) + if plugin(iRow).installed && ~strcmpi(plugin(iRow).status, 'deactivated') + % text for description + description = plugin(iRow).description; + if length(description) > maxchar+2 + description = [ description(1:min(maxchar,length(description))) '...' ]; + end; + + enableWebDoc = fastif(isempty(plugin(iRow).webdoc), 'off', 'on'); + + userdata = ''; + if plugin(iRow).installorupdate, + textnew = [ 'Click update to install version ' plugin(iRow).version ' now available on the web' ]; + userdata = 'colortored'; + else + textnew = description; + end; + uilist = { uilist{:}, ... + { 'style' 'checkbox' 'string' '' 'value' 0 'enable' fastif(plugin(iRow).installorupdate, 'on', 'off') 'tag' [ 'cb1' int2str(iRow) ] 'callback' callback }, ... + { 'style' 'checkbox' 'string' '' 'enable' 'on' 'tag' [ 'cb2' int2str(iRow) ] 'callback' callback }, ... + { 'style' 'text' 'string' plugin(iRow).name }, ... + { 'style' 'text' 'string' plugin(iRow).currentversion 'tag' 'latestversion'}, ... + { 'style' 'text' 'string' int2str(plugin(iRow).downloads) }, ... + { 'style' 'text' 'string' textnew 'userdata' userdata }, ... + { 'style' 'pushbutton' 'string' 'Doc' 'enable' enableWebDoc 'callback' myweb(plugin(iRow).webdoc) } }; + geom = { geom{:}, lineGeom }; + geomvert = [ geomvert 1]; + pluginIndices = [ pluginIndices iRow ]; + end; + end; +end; + +% ------------------- +% deactivated plugins +% ------------------- +%geom = { geom{:} 1 1 }; +%geomvert = [geomvert 0.5 1]; +%uilist = { uilist{:} {} { 'style' 'text' 'string' 'To manage deactivated plugins, use menu item File > Manage plugins > Manage deactivated plugins' } }; +if deactivatedFlag + uilist = { uilist{:} {} {} { 'style' 'text' 'string' 'List of deactivated extensions ' 'fontweight' 'bold' 'fontsize' 18 'tag' 'title' } }; + uilist = { uilist{:} ... + { 'style' 'text' 'string' 'I' 'tag' 'reactivate' } ... + { 'style' 'text' 'string' 'I' 'tag' 'remove1' } ... + { 'style' 'text' 'string' 'Plugin' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Vers.' 'tag' 'verweb' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Score' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Description' 'fontweight' 'bold' } {}}; + geom = { geom{:} 1 [1 5.5] lineGeom }; + geomvert = [geomvert 1 1 1]; + for iRow = 1:length(plugin) + if strcmpi(plugin(iRow).status, 'deactivated') + % text for description + description = plugin(iRow).description; + if length(description) > maxchar+2 + description = [ description(1:min(maxchar,length(description))) '...' ]; + end; + + userdata = ''; + enableWebDoc = fastif(isempty(plugin(iRow).webdoc), 'off', 'on'); + uilist = { uilist{:}, ... + { 'style' 'checkbox' 'string' '' 'tag' [ 'cb1' int2str(iRow) ] 'callback' callback }, ... + { 'style' 'checkbox' 'string' '' 'tag' [ 'cb2' int2str(iRow) ] 'callback' callback }, ... + { 'style' 'text' 'string' plugin(iRow).name }, ... + { 'style' 'text' 'string' plugin(iRow).version 'tag' 'latestversion' }, ... + { 'style' 'text' 'string' int2str(plugin(iRow).downloads) }, ... + { 'style' 'text' 'string' description }, ... + { 'style' 'pushbutton' 'string' 'Doc' 'enable' enableWebDoc 'callback' myweb(plugin(iRow).webdoc) } }; + geom = { geom{:}, lineGeom }; + geomvert = [ geomvert 1]; + pluginIndices = [ pluginIndices iRow ]; + end; + end; +end; + +evalStr = [ 'uisettxt(gcf, ''update'' , ''Update'' , ''rotation'', 90, ''fontsize'', 14);' ... + 'uisettxt(gcf, ''deactivate'' , ''Deactivate'' , ''rotation'', 90, ''fontsize'', 14);' ... + 'uisettxt(gcf, ''install'' , ''Install'' , ''rotation'', 90, ''fontsize'', 14);' ... + 'uisettxt(gcf, ''reactivate'' , ''Reactivate'' , ''rotation'', 90, ''fontsize'', 14);' ... + 'uisettxt(gcf, ''remove1'' , ''Remove'' , ''rotation'', 90, ''fontsize'', 14);' ... + 'set(findobj(gcf, ''tag'', ''title''), ''fontsize'', 16);' ... + 'tmpobj = findobj(gcf, ''userdata'', ''colortored'');' ... + 'set(tmpobj, ''Foregroundcolor'', [1 0 0]);' ... + 'tmppos = get(gcf, ''position'');' ... + 'set(gcf, ''position'', [tmppos(1:2) 800 tmppos(4)]);' ... + 'clear tmpobj tmppos;' ... + ]; + +if 1 + % version with button + if page == 1, enablePpage = 'off'; else enablePpage = 'on'; end; + if page*pluginsPerPage > numPlugin, enableNpage = 'off'; else enableNpage = 'on'; end; + callBackPpage = [ 'tmpobj = get(gcbf, ''userdata''); close gcbf; restartEeglabFlag = plugin_extract(tmpobj, [], ' int2str(page-1) '); clear tmpobj;' ]; + callBackNpage = [ 'tmpobj = get(gcbf, ''userdata''); close gcbf; restartEeglabFlag = plugin_extract(tmpobj, [], ' int2str(page+1) '); clear tmpobj;' ]; + + uilist = { uilist{:}, {} { 'width' 80 'align' 'left' 'Style', 'pushbutton', 'string', '< Prev. page', 'tag' 'ppage' 'callback', callBackPpage 'enable' enablePpage } }; + uilist = { uilist{:}, { 'width' 80 'align' 'left' 'stickto' 'on', 'Style', 'pushbutton', 'string', 'Next page >', 'tag' 'npage' 'callback', callBackNpage 'enable' enableNpage } }; + uilist = { uilist{:}, { 'width' 80 'align' 'right' 'Style', 'pushbutton', 'string', 'Cancel', 'tag' 'cancel' 'callback', 'close gcbf' } }; + uilist = { uilist{:}, { 'width' 80 'align' 'right' 'stickto' 'on' 'Style', 'pushbutton', 'tag', 'ok', 'string', 'OK', 'callback', 'set(gcbo, ''userdata'', ''retuninginputui'');' } }; + geom = { geom{:} [1] [1 1 1 1] }; + geomvert = [ geomvert 1 1]; + res = inputgui('uilist', uilist, 'geometry', geom, 'geomvert', geomvert, 'eval', evalStr, 'addbuttons', 'off', 'skipline', 'off', 'userdata', allPlugins); + + try, restartEeglabFlag = evalin('base', 'restartEeglabFlag;'); catch, end; + evalin('base', 'clear restartEeglabFlag;'); +else + % no buttons + res = inputgui('uilist', uilist, 'geometry', geom, 'geomvert', geomvert, 'eval', evalStr); +end; +if isempty(res), return; end; + +% decode inputs +% ------------- +for iRow = 1:length(pluginIndices) + plugin(pluginIndices(iRow)).install = res{(iRow-1)*2+1}; + plugin(pluginIndices(iRow)).remove = res{(iRow-1)*2+2}; +end; + +% install plugins +% --------------- +firstPlugin = 1; +for iRow = 1:length(plugin) + if plugin(iRow).install + restartEeglabFlag = true; + if ~firstPlugin, disp('---------------------------------'); end; firstPlugin = 0; + + if strcmpi(plugin(iRow).status, 'deactivated') + fprintf('Reactivating extension %s\n', plugin(iRow).name); + plugin_reactivate(plugin(iRow).foldername); + if plugin(iRow).installorupdate + res = questdlg2([ 'Extension ' plugin(iRow).foldername ' has been reactivated but' 10 'a new version is available. Do you want to install it?' ], 'Warning', 'No', 'Yes', 'Yes'); + if strcmpi(res, 'yes') + plugin_deactivate(plugin(iRow).foldername); + plugin_install(plugin(iRow).zip, plugin(iRow).name, plugin(iRow).version); + plugin_remove(plugin(iRow).foldername); + end; + end; + else + if plugin(iRow).installed + fprintf('Updating extension %s\n', plugin(iRow).name); + plugin_deactivate(plugin(iRow).foldername); + plugin_install(plugin(iRow).zip, plugin(iRow).name, plugin(iRow).version); + plugin_remove(plugin(iRow).foldername); + else + fprintf('Installing extension %s\n', plugin(iRow).name); + plugin_install(plugin(iRow).zip, plugin(iRow).name, plugin(iRow).version); + end; + end; + elseif plugin(iRow).remove + if ~firstPlugin, disp('---------------------------------'); end; firstPlugin = 0; + restartEeglabFlag = true; + + if strcmpi(plugin(iRow).status, 'deactivated') + fprintf('Removing extension %s\n', plugin(iRow).name); + plugin_remove(plugin(iRow).foldername); + else + fprintf('Deactivating extension %s\n', plugin(iRow).name); + plugin_deactivate(plugin(iRow).foldername); + end; + end; +end; + +function str = myweb(url); + + %if isempty(strfind(url, 'wiki')) + % str = [ 'web(''' url ''');' ]; + %else + str = [ 'web(''' url ''', ''-browser'');' ]; + %end; + diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_getweb.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_getweb.m new file mode 100644 index 0000000..7ca6000 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_getweb.m @@ -0,0 +1,184 @@ +function plugin = plugin_getweb(type, pluginOri, mode) + +if nargin < 1, help plugin_getweb; return; end; +if nargin < 2, pluginOri = []; end; +if nargin < 3, mode = 'merge'; end; % 'merge' or 'newlist' + +% convert plugin list format if necessary +if isfield(pluginOri, 'plugin'), pluginOri = plugin_convert(pluginOri); end; + +try + disp( [ 'Retreiving URL with ' type ' extensions...' ] ); + if strcmpi(type, 'import') + [tmp status] = plugin_urlread('http://sccn.ucsd.edu/wiki/Plugin_list_import'); + else + [tmp status] = plugin_urlread('http://sccn.ucsd.edu/wiki/Plugin_list_process'); + end; +catch, + error('Cannot connect to the Internet to retrieve extension list'); +end; + +% retreiving download statistics +try + disp( [ 'Retreiving download statistics...' ] ); + [stats status] = plugin_urlread('http://sccn.ucsd.edu/eeglab/plugin_uploader/plugin_getcountall.php'); + stats = textscan(stats, '%s%d%s%s'); +catch, + stats = {}; + disp('Cannot connect to the Internet to retrieve statistics for extensions'); +end; + +if status == 0 + error('Cannot connect to the Internet to retrieve extension list'); +end; + +% parse the web page +% ------------------ +try + plugin = parseTable(tmp); +catch + error('Cannot parse extension list - please contact eeglab@sccn.ucsd.edu'); +end; + +% find correspondance with plugin list +% ------------------------------------ +if ~isempty(pluginOri) + currentNames = lower({ pluginOri.name }); +else currentNames = {}; +end; +allMatch = []; +for iRow = 1:length(plugin) + % fix links + if isfield(plugin, 'zip'), plugin(iRow).zip = strrep(plugin(iRow).zip, '&', '&'); end; + + % get number of downloads + if ~isempty(stats) + indMatch = strmatch(plugin(iRow).name, stats{1}, 'exact'); + if ~isempty(indMatch) + plugin(iRow).downloads = stats{2}(indMatch(1)); + if length(stats) > 2 && ~isempty(stats{3}{indMatch(1)}) + plugin(iRow).version = stats{3}{indMatch(1)}; + plugin(iRow).zip = stats{4}{indMatch(1)}; + end; + else plugin(iRow).downloads = 0; + end; + else plugin(iRow).downloads = 0; + end; + + % match with existiting plugins + indMatch = strmatch(lower(plugin(iRow).name), currentNames, 'exact'); + if isempty(indMatch) + plugin(iRow).currentversion = '-'; + plugin(iRow).installed = 0; + plugin(iRow).installorupdate = 1; + plugin(iRow).status = 'notinstalled'; + else + if length(indMatch) > 1 + disp([ 'Warning: duplicate extension ' plugin(iRow).name ' instaled' ]); + end; + plugin(iRow).currentversion = pluginOri(indMatch).currentversion; + plugin(iRow).foldername = pluginOri(indMatch).foldername; + plugin(iRow).status = pluginOri(indMatch).status; + plugin(iRow).installed = 1; + if strcmpi(plugin(iRow).currentversion, plugin(iRow).version) + plugin(iRow).installorupdate = 0; + else + plugin(iRow).installorupdate = 1; + end; + allMatch = [ allMatch indMatch(:)' ]; + end; + +end; + +% put all the installed plugins first +% ----------------------------------- +if ~isempty(plugin) + [tmp reorder] = sort([plugin.installed], 'descend'); + plugin = plugin(reorder); +% plugin(1).currentversion = '0.9'; +% plugin(1).version = '1'; +% plugin(1).foldername = 'test'; +% plugin(1).installed = 1; +% plugin(1).installorupdate = 1; +% plugin(1).description = 'test'; +% plugin(1).webdoc = 'test'; +% plugin(1).name = 'test'; +end; + +if strcmpi(mode, 'merge') && ~isempty(pluginOri) + indices = setdiff([1:length(pluginOri)], allMatch); + fields = fieldnames(pluginOri); + lenPlugin = length(plugin); + + for indPlugin = 1:length(indices) + for indField = 1:length(fields) + value = getfield(pluginOri, { indices(indPlugin) }, fields{ indField }); + plugin = setfield(plugin , { lenPlugin+indPlugin }, fields{ indField }, value); + end; + end; +end; + +% parse the web table +% =================== +function plugin = parseTable(tmp); + +plugin = []; +if isempty(tmp), return; end; + +% get table content +% ----------------- +tableBeg = findstr('Plug-in name', tmp); +tableEnd = findstr('', tmp(tableBeg:end)); +tableContent = tmp(tableBeg:tableBeg+tableEnd-2); +endFirstLine = findstr('', tableContent); +tableContent = tableContent(endFirstLine(1)+5:end); + +% parse table entries +% ------------------- +posBegRow = findstr('' , tableContent); +posEndRow = findstr('', tableContent); +if length(posBegRow) ~= length(posEndRow) || isempty(posBegRow) + error('Cannot connect to the Internet to retrieve plugin list'); +end; +for iRow = 1:length(posBegRow) + rowContent = tableContent(posBegRow(iRow)+4:posEndRow(iRow)-1); + posBegCol = findstr('' , rowContent); + posEndCol = findstr('', rowContent); + for iCol = 1:length(posBegCol) + table{iRow,iCol} = rowContent(posBegCol(iCol)+4:posEndCol(iCol)-1); + end; +end; + +%% extract zip link and plugin name from first column +% -------------------------------------------------- +%href="http://www.unicog.org/pm/uploads/MEG/ADJUST_PLUGIN.zip" class="external text" title="http://www.unicog.org/pm/uploads/MEG/ADJUST_PLUGIN.zip" rel="nofollow">ADJUST PLUGIN 500000 && depth > 1 && ~forceInstall + res = questdlg2( [ 'Extension ' name ' size is ' pluginSizeStr 'MB. Are you sure' 10 ... + 'you want to download this extension?' ], 'Warning', 'No', 'Yes', 'Yes'); + if strcmpi(res, 'no'), fprintf([ 'Skipping ' name ' extension instalation\n' ]); result = -1; return; end; + end; + catch, + msg = [ 'Could not download extension. Host site might be' 10 'unavailable or you do not have permission' 10 'to write in the EEGLAB plugin folder. Try again' 10 'just in case.' ]; + if ~forceInstall + warndlg2(msg); + else + disp(msg); + end; + result = -1; + return; + end; + disp([ 'Downloading extension ' name '(' pluginSizeStr 'Mb)...' ]); + + try + plugin_urlread(['http://sccn.ucsd.edu/eeglab/plugin_uploader/plugin_increment.php?plugin=' name '&version=' version ]); + plugin_urlwrite( zipfilelink, fullfile(generalPluginPath, zipfile)); + catch, + msg = [ 'Could not download extension. Host site might be' 10 'unavailable or you do not have permission' 10 'to write in the EEGLAB plugin folder. Try again' 10 'just in case.' ]; + if ~forceInstall + warndlg2(msg); + else + disp(msg); + end; + result = -1; + return; + end; + + % unzip plugin + % ------------ + if ~exist(newPluginPath) + mkdir(newPluginPath); + else + msg = [ 'Extension folder already exist ' newPluginPath 10 'Remove it manually before installing extension' ]; + if ~forceInstall + warndlg2(msg); + else + disp(msg); + end; + result = -1; + return; + end; + disp([ 'Unzipping extension file... ']); + unzip(fullfile(generalPluginPath, zipfile), newPluginPath); + + disp('Cleaning up zip file...'); + delete(fullfile(generalPluginPath, zipfile)); + + % seeing what is in the plugin and moving files if necessary + % ---------------------------------------------------------- + pluginContent = dir(newPluginPath); + if length(pluginContent) > 3 + return; + end; + for index = 1:length(pluginContent) + if ~strcmpi(pluginContent(index).name, '.') && ~strcmpi(pluginContent(index).name, '..') + fullFolder = fullfile(newPluginPath, pluginContent(index).name); + if exist(fullFolder) == 7 % folder detected + % move files from folder + movefile(fullfile(fullFolder, '*'), newPluginPath); + rmdir(fullFolder, 's'); + end; + end; + end; + fprintf('Extension %s version %s now installed\n', name, version); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_installstartup.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_installstartup.m new file mode 100644 index 0000000..1547d41 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_installstartup.m @@ -0,0 +1,62 @@ +% plugin_installstartup() - install popular toolboxes when EEGLAB starts +% +% Usage: +% >> restartEeglabFlag = plugin_installstartup; % pop up window +% +% Outputs: +% restartEeglabFlag - [0|1] restart EEGLAB +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Oct. 29, 2013- + +% Copyright (C) 2013 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function restartEeglabFlag = plugin_installstartup + +% { 'style' 'checkbox' 'string' 'Neuroelectromagnetic Forward Head Modeling Toolbox (NFT): Advanced source localization tools - beta (Zeynep Akalin Acar, 100 Mb)' 'value' 1 'enable' 'on' } ... + + uilist = { { 'style' 'text' 'String' 'Download and install some popular third party EEGLAB plug-ins' 'fontweight', 'bold','tag', 'title'} ... + { } ... + { 'style' 'checkbox' 'string' 'Brain Vision Analyser data import plugin (40 Kb)' 'value' 1 'enable' 'on' } ... + { 'style' 'checkbox' 'string' 'ANT data import plugin (800 Kb)' 'value' 1 'enable' 'on' } ... + { 'style' 'checkbox' 'string' 'Measure Projection Toolbox (MPT) for ulti-subject ICA analysis (415 Mb)' 'value' 1 'enable' 'on' } ... + { 'style' 'checkbox' 'string' 'Source Information Flow Toolbox (SIFT) for causal analysis of EEG sources (600 Mb)' 'value' 1 'enable' 'on' } ... + { 'style' 'checkbox' 'string' 'BCILAB for real-time and offline BCI platform (200 Mb)' 'value' 1 'enable' 'on' } ... + { 'style' 'checkbox' 'string' 'LIMO for linear analysis of MEEG data using single trials (2.5 Mb)' 'value' 1 'enable' 'on' } ... + { } ... + { 'style' 'radiobutton' 'string' 'Do not show this query again' 'value' 0 } ... + {} ... + { 'style' 'text' 'String' 'Note: manage plug-in tools using EEGLAB menu item, "File > Plug-ins > Manage plug-ins"' } ... + {} ... + { 'Style', 'pushbutton', 'string', 'Do not install now', 'tag' 'cancel' 'callback', 'set(gcbf, ''userdata'', ''cancel'');' } { } ... + { 'Style', 'pushbutton', 'string', 'Install plugins now', 'tag', 'ok', 'callback', 'set(gcbf, ''userdata'', ''ok'');' } ... + }; + + geomline = [1]; + geom = { [1] [1] geomline geomline geomline geomline geomline geomline [1] geomline [1] [1] [1] [1 1 1]}; + geomvert = [ 1 0.5 1 1 1 1 1 1 0.3 1 0.3 1 1 1]; + + %result = inputgui( 'geometry', geom, 'uilist', uilist, 'helpcom', 'pophelp(''plugin_installstartup'')', 'title', 'Install popular plugins', 'geomvert', geomvert, 'eval', evalstr); + fig = figure('visible', 'off'); + [tmp1 tmp2 handles] = supergui( 'geomhoriz', geom, 'uilist', uilist, 'title', 'Install popular plugins', 'geomvert', geomvert, 'fig', fig); %, 'eval', evalstr); + set(findobj(fig, 'tag', 'title'), 'fontsize', 16); + waitfor( fig, 'userdata'); + + % decode inputs + handles + results = cellfun(@(x)(get + get(handles, 'value') + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_managedeactivated.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_managedeactivated.m new file mode 100644 index 0000000..957dc4c --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_managedeactivated.m @@ -0,0 +1,89 @@ +function restartEeglabFlag = plugin_managedeactivated(pluginlist) + +% type may be 'import' or 'process' +restartEeglabFlag = false; +plugin = plugin_getweb('import' , pluginlist); +plugin = plugin_getweb('process', plugin); + +for iRow = 1:length(plugin) + plugin(iRow).remove = 0; + plugin(iRow).reactivate = 0; +end; + +if isempty(strmatch('deactivated', { plugin.status }, 'exact')) + warndlg2('There are no deactivated plugins'); + return; +end; + +maxchar = 60; +uilist = { {} { 'style' 'text' 'string' ' List of deactivated plugins ' 'fontweight' 'bold' 'fontsize' 18 'tag' 'title' } }; +uilist = { uilist{:} ... + { 'style' 'text' 'string' 'I' 'tag' 'reactivate' } ... + { 'style' 'text' 'string' 'I' 'tag' 'remove1' } ... + { 'style' 'text' 'string' 'Plugin' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Version' 'tag' 'verweb' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Description' 'fontweight' 'bold' } {}}; +lineGeom = [ 0.28 0.28 0.95 0.8 3 0.35 ]; +geom = { [1 5.5] lineGeom }; +geomvert = [1 1]; +pluginIndices = []; +for iRow = 1:length(plugin) + if strcmpi(plugin(iRow).status, 'deactivated') + % text for description + description = plugin(iRow).description; + if length(description) > maxchar+2 + description = [ description(1:min(maxchar,length(description))) '...' ]; + end; + + cb = [ 'tmptag = get(gcbo, ''tag'');' ... + 'if tmptag(3) == ''1'', tmptag(3) = ''2''; else tmptag(3) = ''1''; end;' ... + 'set(findobj(gcbf, ''tag'', tmptag), ''value'', ~get(gcbo, ''value''));' ]; + userdata = ''; + enableWebDoc = fastif(isempty(plugin(iRow).webdoc), 'off', 'on'); + uilist = { uilist{:}, ... + { 'style' 'checkbox' 'string' '' 'tag' [ 'cb1' int2str(iRow) ] 'callback' cb }, ... + { 'style' 'checkbox' 'string' '' 'tag' [ 'cb2' int2str(iRow) ] 'callback' cb }, ... + { 'style' 'text' 'string' plugin(iRow).name }, ... + { 'style' 'text' 'string' plugin(iRow).version 'tag' 'latestversion' }, ... + { 'style' 'text' 'string' description }, ... + { 'style' 'pushbutton' 'string' 'Doc' 'enable' enableWebDoc 'callback' [ 'web(''' plugin(iRow).webdoc ''');' ] } }; + geom = { geom{:}, lineGeom }; + geomvert = [ geomvert 1]; + pluginIndices = [ pluginIndices iRow ]; + end; +end; + +evalStr = [ 'uisettxt(gcf, ''reactivate'' , ''Reactivate'' , ''rotation'', 90, ''fontsize'', 14);' ... + 'uisettxt(gcf, ''remove1'' , ''Remove'' , ''rotation'', 90, ''fontsize'', 14);' ... + 'tmppos = get(gcf, ''position''); set(gcf, ''position'', [tmppos(1:2) max(700, tmppos(3)) tmppos(4)]);' ... + 'set(findobj(gcf, ''tag'', ''title''), ''fontsize'', 16);' ... + 'tmpobj = findobj(gcf, ''userdata'', ''colortored'');' ... + 'set(tmpobj, ''Foregroundcolor'', [1 0 0]);' ... + 'clear tmppos tmpobj;']; + +res = inputgui('uilist', uilist, 'geometry', geom, 'geomvert', geomvert, 'eval', evalStr); +if isempty(res), return; end; + +% decode inputs +% ------------- +for iRow = 1:length(pluginIndices) + plugin(pluginIndices(iRow)).reactivate = res{(iRow-1)*2+1}; + plugin(pluginIndices(iRow)).remove = res{(iRow-1)*2+2}; +end; + +% install plugins +% --------------- +firstPlugin = 1; +for iRow = 1:length(plugin) + if plugin(iRow).remove + if ~firstPlugin, disp('---------------------------------'); end; firstPlugin = 0; + + fprintf('Removing plugin %s\n', plugin(iRow).name); + plugin_remove(plugin(iRow).foldername); + elseif plugin(iRow).reactivate + if ~firstPlugin, disp('---------------------------------'); end; firstPlugin = 0; + restartEeglabFlag = true; + fprintf('Reactivating plugin %s\n', plugin(iRow).name); + plugin_reactivate(plugin(iRow).foldername); + end; +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_reactivate.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_reactivate.m new file mode 100644 index 0000000..b4283cd --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_reactivate.m @@ -0,0 +1,16 @@ +function plugin_reactivate(foldername); + + % get plugin path + % --------------- + fullpluginfolder = fullfile(fileparts(which('eeglab.m')), 'deactivatedplugins', foldername); + if ~exist(fullpluginfolder) + error([ 'Could not find folder ' foldername 'in deactivatedplugins folder' ]); + end; + + disp([ 'Moving plugin ' foldername ' to plugins folder' ]); + fulldeactivatedpluginfolder = fullfile(fileparts(which('eeglab.m')), 'plugins'); + try + movefile(fullpluginfolder, fulldeactivatedpluginfolder); + catch + eeglab_error; + end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_remove.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_remove.m new file mode 100644 index 0000000..a39683f --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_remove.m @@ -0,0 +1,15 @@ +function plugin_remove(foldername); + + % get plugin path + % --------------- + fullpluginfolder = fullfile(fileparts(which('eeglab.m')), 'deactivatedplugins', foldername); + if ~exist(fullpluginfolder) + error([ 'Could not find folder ' foldername ' in deactivatedplugins folder' ]); + end; + + disp([ 'Removing plugin folder ' foldername ]); + try + rmdir(fullpluginfolder, 's'); + catch + eeglab_error; + end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_urlread.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlread.m new file mode 100644 index 0000000..e21d13b --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlread.m @@ -0,0 +1,114 @@ +function [output,status] = urlread(urlChar,method,params) +%URLREAD Returns the contents of a URL as a string. +% S = URLREAD('URL') reads the content at a URL into a string, S. If the +% server returns binary data, the string will contain garbage. +% +% S = URLREAD('URL','method',PARAMS) passes information to the server as +% part of the request. The 'method' can be 'get', or 'post' and PARAMS is a +% cell array of param/value pairs. +% +% [S,STATUS] = URLREAD(...) catches any errors and returns 1 if the file +% downloaded successfully and 0 otherwise. +% +% Examples: +% s = urlread('http://www.mathworks.com') +% s = urlread('ftp://ftp.mathworks.com/README') +% s = urlread(['file:///' fullfile(prefdir,'history.m')]) +% +% From behind a firewall, use the Preferences to set your proxy server. +% +% See also URLWRITE. + +% Matthew J. Simoneau, 13-Nov-2001 +% Copyright 1984-2011 The MathWorks, Inc. +% $Revision: 1.3.2.12 $ $Date: 2011/09/03 22:43:00 $ + +% This function requires Java. +if ~usejava('jvm') + error(message('MATLAB:urlread:NoJvm')); +end + +import com.mathworks.mlwidgets.io.InterruptibleStreamCopier; + +% Be sure the proxy settings are set. +com.mathworks.mlwidgets.html.HTMLPrefs.setProxySettings + +% Check number of inputs and outputs. +if ~ischar(urlChar) + error('MATLAB:urlread:InvalidInput','The first input, the URL, must be a character array.'); +end +if (nargin > 1) && ~strcmpi(method,'get') && ~strcmpi(method,'post') + error('MATLAB:urlread:InvalidInput','Second argument must be either "get" or "post".'); +end + +% Do we want to throw errors or catch them? +if nargout == 2 + catchErrors = true; +else + catchErrors = false; +end + +% Set default outputs. +output = ''; +status = 0; + +% GET method. Tack param/value to end of URL. +if (nargin > 1) && strcmpi(method,'get') + if mod(length(params),2) == 1 + error('MATLAB:urlread:InvalidInput','Invalid parameter/value pair arguments.'); + end + for i=1:2:length(params) + if (i == 1), separator = '?'; else separator = '&'; end + param = char(java.net.URLEncoder.encode(params{i})); + value = char(java.net.URLEncoder.encode(params{i+1})); + urlChar = [urlChar separator param '=' value]; + end +end + +% Create a urlConnection. +[urlConnection,errorid,errormsg] = plugin_urlreadwrite(mfilename,urlChar); +if isempty(urlConnection) + if catchErrors, return + else error(errorid,errormsg); + end +end +urlConnection.setReadTimeout(5000); % timeout in 5 seconds + +% POST method. Write param/values to server. +if (nargin > 1) && strcmpi(method,'post') + try + urlConnection.setDoOutput(true); + urlConnection.setRequestProperty( ... + 'Content-Type','application/x-www-form-urlencoded'); + printStream = java.io.PrintStream(urlConnection.getOutputStream); + for i=1:2:length(params) + if (i > 1), printStream.print('&'); end + param = char(java.net.URLEncoder.encode(params{i})); + value = char(java.net.URLEncoder.encode(params{i+1})); + printStream.print([param '=' value]); + end + printStream.close; + catch + if catchErrors, return + else error('MATLAB:urlread:ConnectionFailed','Could not POST to URL.'); + end + end +end + +% Read the data from the connection. +try + inputStream = urlConnection.getInputStream; + byteArrayOutputStream = java.io.ByteArrayOutputStream; + % This StreamCopier is unsupported and may change at any time. + isc = InterruptibleStreamCopier.getInterruptibleStreamCopier; + isc.copyStream(inputStream,byteArrayOutputStream); + inputStream.close; + byteArrayOutputStream.close; + output = native2unicode(typecast(byteArrayOutputStream.toByteArray','uint8'),'UTF-8'); +catch + if catchErrors, return + else error('MATLAB:urlread:ConnectionFailed','Error downloading URL. Your network connection may be down or your proxy settings improperly configured.'); + end +end + +status = 1; diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_urlreadwrite.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlreadwrite.m new file mode 100644 index 0000000..93a4569 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlreadwrite.m @@ -0,0 +1,54 @@ +function [urlConnection,errorid,errormsg] = urlreadwrite(fcn,urlChar) +%URLREADWRITE A helper function for URLREAD and URLWRITE. + +% Matthew J. Simoneau, June 2005 +% Copyright 1984-2011 The MathWorks, Inc. +% $Revision: 1.1.6.7 $ $Date: 2011/10/22 22:05:21 $ + +% Default output arguments. +urlConnection = []; +errorid = ''; +errormsg = ''; + +% Determine the protocol (before the ":"). +protocol = urlChar(1:min(find(urlChar==':'))-1); + +% Try to use the native handler, not the ice.* classes. +switch protocol + case 'http' + try + handler = sun.net.www.protocol.http.Handler; + catch exception %#ok + handler = []; + end + case 'https' + try + handler = sun.net.www.protocol.https.Handler; + catch exception %#ok + handler = []; + end + otherwise + handler = []; +end + +% Create the URL object. +try + if isempty(handler) + url = java.net.URL(urlChar); + else + url = java.net.URL([],urlChar,handler); + end +catch exception %#ok + errorid = ['MATLAB:' fcn ':InvalidUrl']; + errormsg = 'Either this URL could not be parsed or the protocol is not supported.'; + return +end + +% Open a connection to the URL. +urlConnection = url.openConnection; + +% build up the MATLAB User Agent +mlUserAgent = ['MATLAB R' version('-release') ' ' version('-description')]; + +% set User-Agent +urlConnection.setRequestProperty('User-Agent', mlUserAgent); diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_urlsize.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlsize.m new file mode 100644 index 0000000..28f4a53 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlsize.m @@ -0,0 +1,79 @@ +function res = plugin_urlsize(urlChar,method,params) +%URLREAD Returns the contents of a URL as a string. +% S = URLREAD('URL') reads the content at a URL into a string, S. If the +% server returns binary data, the string will contain garbage. +% +% S = URLREAD('URL','method',PARAMS) passes information to the server as +% part of the request. The 'method' can be 'get', or 'post' and PARAMS is a +% cell array of param/value pairs. +% +% [S,STATUS] = URLREAD(...) catches any errors and returns 1 if the file +% downloaded successfully and 0 otherwise. +% +% Examples: +% s = urlread('http://www.mathworks.com') +% s = urlread('ftp://ftp.mathworks.com/README') +% s = urlread(['file:///' fullfile(prefdir,'history.m')]) +% +% From behind a firewall, use the Preferences to set your proxy server. +% +% See also URLWRITE. + +% Matthew J. Simoneau, 13-Nov-2001 +% Copyright 1984-2011 The MathWorks, Inc. +% $Revision: 1.3.2.12 $ $Date: 2011/09/03 22:43:00 $ + +% This function requires Java. +if ~usejava('jvm') + error(message('MATLAB:urlread:NoJvm')); +end + +import com.mathworks.mlwidgets.io.InterruptibleStreamCopier; + +% Be sure the proxy settings are set. +com.mathworks.mlwidgets.html.HTMLPrefs.setProxySettings + +% Check number of inputs and outputs. +if ~ischar(urlChar) + error('MATLAB:urlread:InvalidInput','The first input, the URL, must be a character array.'); +end +if (nargin > 1) && ~strcmpi(method,'get') && ~strcmpi(method,'post') + error('MATLAB:urlread:InvalidInput','Second argument must be either "get" or "post".'); +end + +% Do we want to throw errors or catch them? +if nargout == 2 + catchErrors = true; +else + catchErrors = false; +end + +% Set default outputs. +output = ''; +status = 0; + +% GET method. Tack param/value to end of URL. +if (nargin > 1) && strcmpi(method,'get') + if mod(length(params),2) == 1 + error('MATLAB:urlread:InvalidInput','Invalid parameter/value pair arguments.'); + end + for i=1:2:length(params) + if (i == 1), separator = '?'; else separator = '&'; end + param = char(java.net.URLEncoder.encode(params{i})); + value = char(java.net.URLEncoder.encode(params{i+1})); + urlChar = [urlChar separator param '=' value]; + end +end + +% Create a urlConnection. +[urlConnection,errorid,errormsg] = plugin_urlreadwrite(mfilename,urlChar); +if isempty(urlConnection) + if catchErrors, return + else error(errorid,errormsg); + end +end +urlConnection.setReadTimeout(5000); % timeout in 5 seconds +urlConnection.setRequestMethod('HEAD'); +urlConnection.connect(); + +res = urlConnection.getContentLength(); diff --git a/code/eeglab13_4_4b/functions/adminfunc/plugin_urlwrite.m b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlwrite.m new file mode 100644 index 0000000..940f3a2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/plugin_urlwrite.m @@ -0,0 +1,143 @@ +function [output,status] = urlwrite(urlChar,location,method,params) +%URLWRITE Save the contents of a URL to a file. +% URLWRITE(URL,FILENAME) saves the contents of a URL to a file. FILENAME +% can specify the complete path to a file. If it is just the name, it will +% be created in the current directory. +% +% F = URLWRITE(...) returns the path to the file. +% +% F = URLWRITE(...,METHOD,PARAMS) passes information to the server as +% part of the request. The 'method' can be 'get', or 'post' and PARAMS is a +% cell array of param/value pairs. +% +% [F,STATUS] = URLWRITE(...) catches any errors and returns the error code. +% +% Examples: +% urlwrite('http://www.mathworks.com/',[tempname '.html']) +% urlwrite('ftp://ftp.mathworks.com/README','readme.txt') +% urlwrite(['file:///' fullfile(prefdir,'history.m')],'myhistory.m') +% +% From behind a firewall, use the Preferences to set your proxy server. +% +% See also URLREAD. + +% Matthew J. Simoneau, 13-Nov-2001 +% Copyright 1984-2011 The MathWorks, Inc. +% $Revision: 1.4.4.14 $ $Date: 2011/09/03 22:43:01 $ + +% This function requires Java. +if ~usejava('jvm') + error(message('MATLAB:urlwrite:NoJvm')); +end + +import com.mathworks.mlwidgets.io.InterruptibleStreamCopier; + +% Be sure the proxy settings are set. +com.mathworks.mlwidgets.html.HTMLPrefs.setProxySettings + +% Check number of inputs and outputs. +if ~ischar(urlChar) + error('MATLAB:urlwrite:InvalidInput','The first input, the URL, must be a character array.'); +end +if ~ischar(location) + error('MATLAB:urlwrite:InvalidInput','The second input, a filename, must be a character array.'); +end +if (nargin > 2) && ~strcmpi(method,'get') && ~strcmpi(method,'post') + error('MATLAB:urlwrite:InvalidInput','Second argument must be either "get" or "post".'); +end + +% Do we want to throw errors or catch them? +if nargout == 2 + catchErrors = true; +else + catchErrors = false; +end + +% Set default outputs. +output = ''; +status = 0; + +% GET method. Tack param/value to end of URL. +if (nargin > 2) && strcmpi(method,'get') + if mod(length(params),2) == 1 + error('MATLAB:urlwrite:InvalidInput','Invalid parameter/value pair arguments.'); + end + for i=1:2:length(params) + if (i == 1), separator = '?'; else separator = '&'; end + param = char(java.net.URLEncoder.encode(params{i})); + value = char(java.net.URLEncoder.encode(params{i+1})); + urlChar = [urlChar separator param '=' value]; + end +end + +% Create a urlConnection. +[urlConnection,errorid,errormsg] = plugin_urlreadwrite(mfilename,urlChar); +if isempty(urlConnection) + if catchErrors, return + else error(errorid,errormsg); + end +end +urlConnection.setReadTimeout(5000); % timeout in 5 seconds + +% POST method. Write param/values to server. +if (nargin > 2) && strcmpi(method,'post') + try + urlConnection.setDoOutput(true); + urlConnection.setRequestProperty( ... + 'Content-Type','application/x-www-form-urlencoded'); + printStream = java.io.PrintStream(urlConnection.getOutputStream); + for i=1:2:length(params) + if (i > 1), printStream.print('&'); end + param = char(java.net.URLEncoder.encode(params{i})); + value = char(java.net.URLEncoder.encode(params{i+1})); + printStream.print([param '=' value]); + end + printStream.close; + catch + if catchErrors, return + else error('MATLAB:urlwrite:ConnectionFailed','Could not POST to URL.'); + end + end +end + +% Specify the full path to the file so that getAbsolutePath will work when the +% current directory is not the startup directory and urlwrite is given a +% relative path. +file = java.io.File(location); +if ~file.isAbsolute + location = fullfile(pwd,location); + file = java.io.File(location); +end + +% Make sure the path isn't nonsense. +try + file = file.getCanonicalFile; +catch + error('MATLAB:urlwrite:InvalidOutputLocation','Could not resolve file "%s".',char(file.getAbsolutePath)); +end + +% Open the output file. +try + fileOutputStream = java.io.FileOutputStream(file); +catch + error('MATLAB:urlwrite:InvalidOutputLocation','Could not open output file "%s".',char(file.getAbsolutePath)); +end + +% Read the data from the connection. +try + inputStream = urlConnection.getInputStream; + % This StreamCopier is unsupported and may change at any time. + isc = InterruptibleStreamCopier.getInterruptibleStreamCopier; + isc.copyStream(inputStream,fileOutputStream); + inputStream.close; + fileOutputStream.close; + output = char(file.getAbsolutePath); +catch + fileOutputStream.close; + delete(file); + if catchErrors, return + else error('MATLAB:urlwrite:ConnectionFailed','Error downloading URL. Your network connection may be down or your proxy settings improperly configured.'); + end +end + +status = 1; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/pop_delset.m b/code/eeglab13_4_4b/functions/adminfunc/pop_delset.m new file mode 100644 index 0000000..96e6564 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/pop_delset.m @@ -0,0 +1,79 @@ +% pop_delset() - Delete a dataset from the variable containing +% all datasets. +% +% Usage: >> ALLEEG = pop_delset(ALLEEG, indices); +% +% Inputs: +% ALLEEG - array of EEG datasets +% indices - indices of datasets to delete. None -> a pop_up window asks +% the user to choose. Index < 0 -> it's positive is given as +% the default in the pop-up window (ex: -3 -> default 3). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_copyset(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% load a set and store it in the current set +% ------------------------------------------ +function [ALLSET, command] = pop_delset(ALLSET, set_in); + +command = ''; +if nargin < 1 + help pop_delset; + return; +end; +if isempty( ALLSET ) + error('Cannot delete dataset. Restart eeglab to clear all dataset information'); + return; +end; + +if nargin < 2 | set_in < 0 + % which set to delete + % ----------------- + promptstr = { 'Dataset(s) to delete:' }; + if nargin == 2 + inistr = { int2str(-set_in) }; + else + inistr = { '1' }; + end; + result = inputdlg2( promptstr, 'Delete dataset -- pop_delset()', 1, inistr, 'pop_delset'); + size_result = size( result ); + if size_result(1) == 0 return; end; + set_in = eval( [ '[' result{1} ']' ] ); +end; + +if isempty(set_in) + return; +end; + +A = fieldnames( ALLSET ); +A(:,2) = cell(size(A)); +A = A'; +for i = set_in + try + ALLSET(i) = struct(A{:}); + %ALLSET = setfield(ALLSET, {set_in}, A{:}, cell(size(A))); + catch + error('Error: no such dataset'); + return; + end; +end; + +command = sprintf('%s = pop_delset( %s, [%s] );', inputname(1), inputname(1), int2str(set_in)); +return; diff --git a/code/eeglab13_4_4b/functions/adminfunc/pop_editoptions.m b/code/eeglab13_4_4b/functions/adminfunc/pop_editoptions.m new file mode 100644 index 0000000..20fa181 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/pop_editoptions.m @@ -0,0 +1,282 @@ +% pop_editoptions() - Edit memory-saving eeglab() options. These are stored in +% a file 'eeg_options.m'. With no argument, pop up a window +% to allow the user to set/unset these options. Store +% user choices in a new 'eeg_options.m' file in the +% working directory. +% +% Usage: >> pop_editoptions; +% >> pop_editoptions( 'key1', value1, 'key2', value2, ...); +% +% Graphic interface inputs: +% "If set, keep at most one dataset in memory ..." - [checkbox] If set, EEGLAB will only retain the current +% dataset in memory. All other datasets will be automatically +% read and writen to disk. All EEGLAB functionalities are preserved +% even for dataset stored on disk. +% "If set, write data in same file as dataset ..." - [checkbox] Set -> dataset data (EEG.data) are +% saved in the EEG structure in the standard Matlab dataset (.set) file. +% Unset -> The EEG.data are saved as a transposed stream of 32-bit +% floats in a separate binary file. As of Matlab 4.51, the order +% of the data in the binary file is as in the transpose of EEG.data +% (i.e., as in EEG.data', frames by channels). This allows quick +% reading of single channels from the data, e.g. when comparing +% channels across datasets. The stored files have the extension +% .dat instead of the pre-4.51, non-transposed .fdt. Both file types +% are read by the dataset load function. Command line equivalent is +% option_savematlab. +% "Precompute ICA activations" - [checkbox] If set, all the ICA activation +% time courses are precomputed (this requires more RAM). +% Command line equivalent: option_computeica. +% "If set, remember old folder when reading dataset" - [checkbox] this option +% is convinient if the file you are working on are not in the +% current folder. +% +% Commandline keywords: +% 'option_computeica' - [0|1] If 1, compute the ICA component activitations and +% store them in a new variable. If 0, compute ICA activations +% only when needed (& only partially, if possible) and do not +% store the results). +% NOTE: Turn OFF the options above when working with very large datasets or on +% computers with limited memory. +% 'option_savematlab' - [0|1] If 1, datasets are saved as single Matlab .set files. +% If 0, dataset data are saved in separate 32-bit binary float +% .dat files. See the corresponding GUI option above for details. +% Outputs: +% In the output workspace, variables 'option_computeica', +% and 'option_savematlab' are updated, and a new 'eeg_options.m' file may be +% written to the working directory. The copy of 'eeg_options.m' placed in your +% working directory overwrites system defaults whenever EEGLAB operates in this +% directory (assuming your working directory is in your MATLABPATH - see path()). +% To adjust these options system-wide, edit the master "eeg_options.m" file in the +% EEGLAB directory heirarchy. +% +% Author: Arnaud Delorme, SCCN / INC / UCSD, March 2002 +% +% See also: eeg_options(), eeg_readoptions() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 09 March 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function com = pop_editoptions(varargin); + +com = ''; + +datasets_in_memory = 0; +if nargin > 0 + if ~isstr(varargin{1}) + datasets_in_memory = varargin{1}; + varargin = {}; + end; +end; + +% parse the eeg_options file +% ---------------------------- +eeglab_options; +if iseeglabdeployed + filename = fullfile(eeglabexefolder,'eeg_options.txt'); + eegoptionbackup = fullfile(eeglabexefolder,'eeg_optionsbackup.txt'); +else + % folder for eeg_options file (also update the eeglab_options) + if ~isempty(EEGOPTION_PATH) + homefolder = EEGOPTION_PATH; + elseif ispc + if ~exist('evalc'), eval('evalc = @(x)(eval(x));'); end; + homefolder = deblank(evalc('!echo %USERPROFILE%')); + else homefolder = '~'; + end; + filename = fullfile(homefolder, 'eeg_options.m'); + eegoptionbackup = which('eeg_optionsbackup.m'); +end; +fid = fopen( filename, 'r+'); % existing file +storelocal = 0; +if fid == -1 + filepath = homefolder; + filename = 'eeg_options.m'; + fid = fopen( fullfile(filepath, filename), 'w'); % new file possible? + if fid == -1 + error([ 'Cannot write into HOME folder: ' homefolder 10 'You may specify another folder for the eeg_option.m' 10 'file by editing the icadefs.m file' ]); + end; + fclose(fid); + delete(fullfile(filepath, filename)); + + % read variables values and description + % -------------------------------------- + [ header opt ] = eeg_readoptions( eegoptionbackup ); +else + [filepath filename ext] = fileparts(filename); + filename = [ filename ext ]; + fprintf('Using option file in directory %s\n', filepath); + + % read variables values and description + % -------------------------------------- + [ header opt ] = eeg_readoptions( eegoptionbackup ); + [ header opt ] = eeg_readoptions( fid, opt ); % use opt from above as default +end; + +if nargin < 2 + geometry = { [6 1] }; + tmpfile = fullfile(filepath, filename); + + cb_file = [ '[filename, filepath] = uiputfile(''eeg_options.txt'', ''Pick a folder to save option file'');' ... + 'if filename(1) ~= 0,' ... + ' filepath = fullfile(filepath, ''eeg_options.m'');' ... + ' set(gcf, ''userdata'', filepath);' ... + ' if length(filepath) > 100,' ... + ' filepath = [ ''...'' filepath(end-100:end) ];' ... + ' end;' ... + ' set(findobj(gcf, ''tag'', ''filename''), ''string'', filepath);' ... + 'end;' ... + 'clear filepath;' ]; + + uilist = { ... + { 'Style', 'text', 'string', '', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Set/Unset', 'fontweight', 'bold' } }; + + % add all fields to graphic interface + % ----------------------------------- + for index = 1:length(opt) + % format the description to fit a help box + % ---------------------------------------- + descrip = { 'string', opt(index).description }; % strmultiline(description{ index }, 80, 10) }; + + % create the gui for this variable + % -------------------------------- + geometry = { geometry{:} [4 0.3 0.1] }; + if strcmpi(opt(index).varname, 'option_storedisk') & datasets_in_memory + cb_nomodif = [ 'set(gcbo, ''value'', ~get(gcbo, ''value''));' ... + 'warndlg2(strvcat(''This option may only be modified when at most one dataset is stored in memory.''));' ]; + + elseif strcmpi(opt(index).varname, 'option_memmapdata') + cb_nomodif = [ 'if get(gcbo, ''value''), warndlg2(strvcat(''Matlab memory is beta, use at your own risk'')); end;' ]; + elseif strcmpi(opt(index).varname, 'option_donotusetoolboxes') + cb_nomodif = [ 'if get(gcbo, ''value''), warndlg2([''You have selected the option to disable'' 10 ''Matlab toolboxes. Use with caution.'' 10 ''Matlab toolboxes will be removed from'' 10 ''your path. Unlicking this option later will not'' 10 ''add back the toolboxes. You will need'' 10 ''to add them back manually. If you are unsure'' 10 ''if you want to disable Matlab toolboxes'' 10 ''deselect the option now.'' ]); end;' ]; + else + cb_nomodif = ''; + end; + + if ~isempty(opt(index).value) + uilist = { uilist{:}, { 'Style', 'text', descrip{:}, 'horizontalalignment', 'left' }, ... + { 'Style', 'checkbox', 'string', ' ', 'value', opt(index).value 'callback' cb_nomodif } { } }; + else + uilist = { uilist{:}, { 'Style', 'text', descrip{:}, 'fontweight' 'bold', 'horizontalalignment', 'left' }, ... + { } { } }; + end; + end; + + % change option file + uilist = { uilist{:} {} ... + { 'Style', 'text', 'string', 'Option file:' 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', tmpfile 'tag' 'filename' }, ... + {} { 'Style', 'pushbutton', 'string', '...' 'callback' cb_file } }; + geometry = { geometry{:} [1] [1 6 0.1 0.8] }; + [results userdat ] = inputgui( geometry, uilist, 'pophelp(''pop_editoptions'');', 'Memory options - pop_editoptions()', ... + [], 'normal'); + if ~isempty(userdat) + filepath = fileparts(userdat); + args = { 'filename' filename }; + end; + if length(results) == 0, return; end; + + % decode inputs + % ------------- + args = {}; + count = 1; + for index = 1:length(opt) + if ~isempty(opt(index).varname) + args = { args{:}, opt(index).varname, results{count} }; + count = count+1; + end; + end; +else + % no interactive inputs + % --------------------- + args = varargin; +end; + + +% change default folder option +% ---------------------------- +W_MAIN = findobj('tag', 'EEGLAB'); +if ~isempty(W_MAIN) + tmpuserdata = get(W_MAIN, 'userdata'); + tmpuserdata{3} = filepath; + set(W_MAIN, 'userdata', tmpuserdata); +end; + +% decode inputs +% ------------- +for index = 1:2:length(args) + ind = strmatch(args{index}, { opt.varname }, 'exact'); + if isempty(ind) + if strcmpi(args{index}, 'option_savematlab') + disp('pop_editoptions: option_savematlab is obsolete, use option_savetwofiles instead'); + ind = strmatch('option_savetwofiles', { opt.varname }, 'exact'); + opt(ind).value = ~args{index+1}; + else + error(['Variable name ''' args{index} ''' is invalid']); + end; + else + opt(ind).value = args{index+1}; + end; +end; + +% write to eeg_options file +% ------------------------- +fid = fopen( fullfile(filepath, filename), 'w'); +addpath(filepath); +if fid == -1 + error('File writing error, check writing permission'); +end; +fprintf(fid, '%s\n', header); +for index = 1:length(opt) + if isempty(opt(index).varname) + fprintf( fid, '%% %s\n', opt(index).description); + else + fprintf( fid, '%s = %d ; %% %s\n', opt(index).varname, opt(index).value, opt(index).description); + end; +end; +fclose(fid); +% clear it from the MATLAB function cache +clear(fullfile(filepath,filename)); + +% generate the output text command +% -------------------------------- +com = 'pop_editoptions('; +for index = 1:2:length(args) + com = sprintf( '%s ''%s'', %d,', com, args{index}, args{index+1}); +end; +com = [com(1:end-1) ');']; +clear functions + +% --------------------------- +function chopedtext = choptext( tmptext ) + chopedtext = ''; + while length(tmptext) > 30 + blanks = findstr( tmptext, ' '); + [tmp I] = min( abs(blanks - 30) ); + chopedtext = [ chopedtext ''' 10 ''' tmptext(1:blanks(I)) ]; + tmptext = tmptext(blanks(I)+1:end); + end; + chopedtext = [ chopedtext ''' 10 ''' tmptext]; + chopedtext = chopedtext(7:end); +return; + +function num = popask( text ) + ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); + switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; + end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/pop_rejmenu.m b/code/eeglab13_4_4b/functions/adminfunc/pop_rejmenu.m new file mode 100644 index 0000000..b3f5bc7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/pop_rejmenu.m @@ -0,0 +1,378 @@ +% pop_rejmenu() - Main menu for rejecting trials in an EEG dataset +% +% Usage: >> pop_rejmenu(INEEG, typerej); +% +% Inputs: +% INEEG - input dataset +% typerej - data to reject on (0 = component activations; +% 1 = raw electrode data). {Default: 1 = reject on raw data} +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab(), pop_eegplot(), pop_eegthresh, pop_rejtrend() +% pop_rejkurt(), pop_jointprob(), pop_rejspec() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function pop_rejmenu( EEG, icacomp ); + +if icacomp == 0 + if isempty( EEG.icasphere ) + disp('Error: you must first run ICA on the data'); return; + end; +end; + +if icacomp == 1 rejtitle = 'Reject trials using data statistics - pop_rejmenu()'; tagmenu = 'rejtrialraw'; +else rejtitle = 'Reject trials using component activity statistics - pop_rejmenu()'; tagmenu = 'rejtrialica'; +end; + +if ~isempty( findobj('tag', tagmenu)) + error('cannot open two identical windows; close the first one first'); +end; + +figure('visible', 'off', 'numbertitle', 'off', 'name', rejtitle, 'tag', tagmenu); + +% definition of callbacks +% ----------------------- +checkstatus = [ 'rejstatus = get( findobj(''parent'', gcbf, ''tag'', ''rejstatus''), ''value'');' ... + 'if rejstatus == 3,' ... + ' EEG.reject.disprej = {};' ... + ' if get( findobj(''parent'', gcbf, ''tag'', ''IManual''), ''value''), EEG.reject.disprej{1} = ''manual''; end;' ... + ' if get( findobj(''parent'', gcbf, ''tag'', ''IThresh''), ''value''), EEG.reject.disprej{2} = ''thresh''; end;' ... + ' if get( findobj(''parent'', gcbf, ''tag'', ''IConst''), ''value''), EEG.reject.disprej{3} = ''const''; end;' ... + ' if get( findobj(''parent'', gcbf, ''tag'', ''IEnt''), ''value''), EEG.reject.disprej{4} = ''jp''; end;' ... + ' if get( findobj(''parent'', gcbf, ''tag'', ''IKurt''), ''value''), EEG.reject.disprej{5} = ''kurt''; end;' ... + ' if get( findobj(''parent'', gcbf, ''tag'', ''IFreq''), ''value''), EEG.reject.disprej{6} = ''freq''; end;' ... + 'end;' ... + 'rejstatus = rejstatus-1;' ]; % from 1-3 range, go to 0-2 range + +if icacomp, ICAPREFIX = ''; +else ICAPREFIX = 'ica'; +end; +% tmp_comall is used when returning from eegplot +tmp_comall = [ 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... + '''''), ''''tag'''', ''''mantrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejmanual)));' ... + 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... + '''''), ''''tag'''', ''''threshtrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejthresh)));' ... + 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... + '''''), ''''tag'''', ''''freqtrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejfreq)));' ... + 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... + '''''), ''''tag'''', ''''consttrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejconst)));' ... + 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... + '''''), ''''tag'''', ''''enttrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejjp)));' ... + 'set(findobj(''''parent'''', findobj(''''tag'''', ''''' tagmenu ... + '''''), ''''tag'''', ''''kurttrial''''), ''''string'''', num2str(sum(EEG.reject.' ICAPREFIX 'rejkurt)));' ]; + +cb_manual = [ checkstatus ... + 'pop_eegplot( EEG, ' int2str( icacomp ) ', rejstatus, 0,''' tmp_comall ''');' ... + 'clear rejstatus;' ]; + +% ----------------------------------------------------- + +cb_compthresh = [ ' posthresh = get( findobj(''parent'', gcbf, ''tag'', ''threshpos''), ''string'' );' ... + ' negthresh = get( findobj(''parent'', gcbf, ''tag'', ''threshneg''), ''string'' );' ... + ' startime = get( findobj(''parent'', gcbf, ''tag'', ''threshstart''), ''string'' );' ... + ' endtime = get( findobj(''parent'', gcbf, ''tag'', ''threshend''), ''string'' );' ... + ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''threshelec''), ''string'' );' ... + checkstatus ... + '[EEG Itmp LASTCOM] = pop_eegthresh( EEG,' int2str(icacomp) ... + ', elecrange, negthresh, posthresh, str2num(startime)/1000, str2num(endtime)/1000, rejstatus, 0,''' tmp_comall ''');' ... + 'EEG = eegh(LASTCOM, EEG);' ... + 'clear com Itmp elecrange posthresh negthresh startime endtime rejstatus;' ]; + +% ' set(findobj(''parent'', gcbf, ''tag'', ''threshtrial''), ''string'', num2str(EEG.trials - length(Itmp)));' ... +% 'eegh(LASTCOM);' ... +% 'clear Itmp elecrange posthresh negthresh startime endtime rejstatus;' ]; + +% ----------------------------------------------------- +cb_compfreq = [ ' posthresh = get( findobj(''parent'', gcbf, ''tag'', ''freqpos''), ''string'' );' ... + ' negthresh = get( findobj(''parent'', gcbf, ''tag'', ''freqneg''), ''string'' );' ... + ' startfreq = get( findobj(''parent'', gcbf, ''tag'', ''freqstart''), ''string'' );' ... + ' endfreq = get( findobj(''parent'', gcbf, ''tag'', ''freqend''), ''string'' );' ... + ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''freqelec''), ''string'' );' ... + checkstatus ... + '[EEG Itmp LASTCOM] = pop_rejspec( EEG,' int2str(icacomp) ... + ', elecrange, negthresh, posthresh, startfreq, endfreq, rejstatus, 0,''' tmp_comall ''');' ... + 'EEG = eegh(LASTCOM, EEG);' ... + 'clear Itmp elecrange posthresh negthresh startfreq endfreq rejstatus;' ]; + +% ----------------------------------------------------- +cb_compconstrej = [ ' minslope = get( findobj(''parent'', gcbf, ''tag'', ''constpnts''), ''string'' );' ... + ' minstd = get( findobj(''parent'', gcbf, ''tag'', ''conststd''), ''string'' );' ... + ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''constelec''), ''string'' );' ... + checkstatus ... + '[rej LASTCOM] = pop_rejtrend(EEG,' int2str(icacomp) ', elecrange, ''' ... + int2str(EEG.pnts) ''', minslope, minstd, rejstatus, 0,''' tmp_comall ''');' ... + 'EEG = eegh(LASTCOM, EEG);' ... + 'clear rej elecrange minslope minstd rejstatus;' ]; + +% ----------------------------------------------------- +cb_compenthead = [ ' locthresh = get( findobj(''parent'', gcbf, ''tag'', ''entloc''), ''string'' );', ... + ' globthresh = get( findobj(''parent'', gcbf, ''tag'', ''entglob''), ''string'' );', ... + ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''entelec''), ''string'' );' ]; +cb_compenttail = [ ' set( findobj(''parent'', gcbf, ''tag'', ''entloc''), ''string'', num2str(locthresh) );', ... + ' set( findobj(''parent'', gcbf, ''tag'', ''entglob''), ''string'', num2str(globthresh) );', ... + ' set( findobj(''parent'', gcbf, ''tag'', ''enttrial''), ''string'', num2str(nrej) );' ... + 'EEG = eegh(LASTCOM, EEG);' ... + 'clear nrej elecrange locthresh globthresh rejstatus;' ]; +cb_compentplot = [ cb_compenthead ... + '[EEG locthresh globthresh nrej LASTCOM] = pop_jointprob( EEG, ' int2str(icacomp) ... + ', elecrange, locthresh, globthresh, 0, 0,''' tmp_comall ''');', ... + cb_compenttail ]; +cb_compentcalc = [ cb_compenthead ... + '[EEG locthresh globthresh nrej LASTCOM] = pop_jointprob( EEG, ' int2str(icacomp) ... + ', [ str2num(elecrange) ], str2num(locthresh), str2num(globthresh), 0, 0);', ... + cb_compenttail ]; +cb_compenteeg = [ cb_compenthead ... + checkstatus ... + '[EEG locthresh globthresh nrej LASTCOM] = pop_jointprob( EEG, ' int2str(icacomp) ... + ', elecrange, locthresh, globthresh, rejstatus, 0, 1,''' tmp_comall ''');', ... + cb_compenttail ]; + +% ----------------------------------------------------- +cb_compkurthead =[ ' locthresh = get( findobj(''parent'', gcbf, ''tag'', ''kurtloc''), ''string'' );', ... + ' globthresh = get( findobj(''parent'', gcbf, ''tag'', ''kurtglob''), ''string'' );', ... + ' elecrange = get( findobj(''parent'', gcbf, ''tag'', ''kurtelec''), ''string'' );' ]; +cb_compkurttail =[ ' set( findobj(''parent'', gcbf, ''tag'', ''kurtloc''), ''string'', num2str(locthresh) );', ... + ' set( findobj(''parent'', gcbf, ''tag'', ''kurtglob''), ''string'', num2str(globthresh) );', ... + ' set( findobj(''parent'', gcbf, ''tag'', ''kurttrial''), ''string'', num2str(nrej) );' ... + 'EEG = eegh(LASTCOM, EEG);' ... + 'clear nrej elecrange locthresh globthresh rejstatus;' ]; +cb_compkurtplot = [ cb_compkurthead ... + '[EEG locthresh globthresh nrej LASTCOM] = pop_rejkurt( EEG, ' int2str(icacomp) ... + ', elecrange, locthresh, globthresh, 0, 0,''' tmp_comall ''');', ... + cb_compkurttail ]; +cb_compkurtcalc = [ cb_compkurthead ... + '[EEG locthresh globthresh nrej LASTCOM] = pop_rejkurt( EEG, ' int2str(icacomp) ... + ', [ str2num(elecrange) ], str2num(locthresh), str2num(globthresh), 0, 0);', ... + cb_compkurttail ]; +cb_compkurteeg = [ cb_compkurthead ... + checkstatus ... + '[EEG locthresh globthresh nrej LASTCOM] = pop_rejkurt( EEG, ' int2str(icacomp) ... + ', elecrange, locthresh, globthresh, rejstatus, 0, 1,''' tmp_comall ''');', ... + cb_compkurttail ]; + +% ----------------------------------------------------- +cb_reject = [ 'set( findobj(''parent'', gcbf, ''tag'', ''rejstatus''), ''value'', 3);' ... % force status to 3 + checkstatus ... + '[EEG LASTCOM] = eeg_rejsuperpose(EEG,' int2str(icacomp) ',1,1,1,1,1,1,1); EEG = eegh(LASTCOM, EEG);' ... + 'if isempty(find(EEG.reject.rejglobal)),' ... + ' warndlg2(strvcat(''No epoch selected...'', ''When using thresholding, click update'',''marks in the EEG plotting window''));' ... + 'else,' ... + ' [EEG LASTCOM] = pop_rejepoch( EEG, EEG.reject.rejglobal, 1);' ... + ' if ~isempty(LASTCOM), ' ... + ' EEG = eegh(LASTCOM, EEG); [ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET); eegh(LASTCOM);' ... + ' end; eeglab redraw; close(gcbf);' ... + 'end;' ]; + +cb_clear = [ 'close gcbf; EEG = rmfield( EEG, ''reject''); EEG.reject.rejmanual = [];' ... + 'EEG=eeg_checkset(EEG); pop_rejmenu(' inputname(1) ',' int2str(icacomp) ');' ]; + +cb_close = [ 'close gcbf;' ... + 'disp(''Marks stored in dataset'');' ... + '[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);' ... + 'eegh(''[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);'');']; + +lisboxoptions = { 'string', [ 'Show only the new trials marked for rejection by the measure selected above|' ... + 'Show previous and new trials marked for rejection by the measure selected above|' ... + 'Show all trials marked for rejection by the measure selected above or checked below'], 'tag', 'rejstatus', 'value', 1, 'callback', ... + [ 'if get(gcbo, ''value'') == 3,' ... + ' set(findobj(''parent'', gcbf, ''style'', ''checkbox''), ''enable'', ''on'');' ... + 'else' ... + ' set(findobj(''parent'', gcbf, ''style'', ''checkbox''), ''enable'', ''off'');' ... + 'end;' ] }; + + chanliststr = [fastif(icacomp,'Electrode(s)','Component(s)') ]; + chanlistval = fastif(icacomp, [ '1:' int2str(EEG.nbchan) ], [ '1:' int2str(size(EEG.icaweights,1)) ]); + + % assess previous rejections + % -------------------------- + sizeman = 0; + sizethresh = 0; + sizetrend = 0; + sizejp = 0; + sizekurt = 0; + sizespec = 0; + if icacomp == 1 + if ~isempty(EEG.reject.rejmanual), sizeman = length(find(EEG.reject.rejmanual)); end; + if ~isempty(EEG.reject.rejconst), sizetrend = length(find(EEG.reject.rejconst)); end; + if ~isempty(EEG.reject.rejjp), sizejp = length(find(EEG.reject.rejjp)); end; + if ~isempty(EEG.reject.rejkurt), sizekurt = length(find(EEG.reject.rejkurt)); end; + if ~isempty(EEG.reject.rejfreq), sizespec = length(find(EEG.reject.rejfreq)); end; + else + if ~isempty(EEG.reject.icarejmanual), sizeman = length(find(EEG.reject.icarejmanual)); end; + if ~isempty(EEG.reject.icarejconst), sizetrend = length(find(EEG.reject.icarejconst)); end; + if ~isempty(EEG.reject.icarejjp), sizejp = length(find(EEG.reject.icarejjp)); end; + if ~isempty(EEG.reject.icarejkurt), sizekurt = length(find(EEG.reject.icarejkurt)); end; + if ~isempty(EEG.reject.icarejfreq), sizespec = length(find(EEG.reject.icarejfreq)); end; + end; + + stdl = [0.25 1.2 0.8 1.2 0.8]; % standard line + titl = [0.9 0.18 1.55]; % title line + geometry = { [0.883 0.195 .2 .45 .4 .4] ... + [1] titl stdl stdl stdl stdl ... + [1] titl stdl stdl stdl ... + [1] titl stdl stdl stdl ... + [1] titl stdl stdl stdl ... + [1] titl stdl stdl stdl stdl ... + [1] [1] [1] [1 1 1] [1 1 1] ... + [1] [1 1 1]}; + + listui = {{'Style', 'text', 'string', 'Mark trials by appearance', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', '', 'tag', 'butmanual', ... + 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejmanualcol); if length(tmpcolor) ~= 1,' ... + 'EEG.reject.rejmanualcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] },... + { } { 'Style', 'pushbutton', 'string', fastif(icacomp,'Scroll Data','Scroll Acts.'), 'callback', cb_manual }, ... + { 'Style', 'text', 'string', 'Marked trials' }, ... + { 'Style', 'text', 'string', int2str(sizeman), 'tag', 'mantrial' }, ... + { }, ... + ... % --------------------------------------------------------------------------- + { 'Style', 'text', 'string', 'Find abnormal values', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', '', 'tag', 'butthresh', ... + 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejthreshcol); if length(tmpcolor) ~= 1,' ... + 'EEG.reject.rejthreshcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... + ... + { }, { 'Style', 'text', 'string', ['Upper limit(s) ' fastif(icacomp,'(uV)', '(std. dev.)')] }, ... + { 'Style', 'edit', 'string', '25', 'tag', 'threshpos' }, ... + { 'Style', 'text', 'string', ['Lower limit(s) ' fastif(icacomp,'(uV)', '(std. dev.)')] }, ... + { 'Style', 'edit', 'string', '-25', 'tag', 'threshneg' }, ... + ... + { }, { 'Style', 'text', 'string', 'Start time(s) (ms)' }, ... + { 'Style', 'edit', 'string', int2str(EEG.xmin*1000), 'tag', 'threshstart' }, ... + { 'Style', 'text', 'string', 'Ending time(s) (ms)' }, ... + { 'Style', 'edit', 'string', int2str(EEG.xmax*1000), 'tag', 'threshend' }, ... + ... + { }, { 'Style', 'text', 'string', chanliststr }, ... + { 'Style', 'edit', 'string', chanlistval, 'tag', 'threshelec' }, ... + { 'Style', 'text', 'string', 'Currently marked trials' }, ... + { 'Style', 'text', 'string', int2str(sizethresh), 'tag', 'threshtrial' }, ... + ... + { }, { 'Style', 'pushbutton', 'string', 'Calc / Plot', 'callback', cb_compthresh }, ... + { }, { },{ 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_eegthresh'');' }, ... + ... % --------------------------------------------------------------------------- + { }, { 'Style', 'text', 'string', 'Find abnormal trends', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', '', 'tag', 'buttrend', ... + 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejconstcol); if length(tmpcolor) ~= 1,' ... + 'EEG.reject.rejconstcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... + ... + { }, { 'Style', 'text', 'string', ['Max slope ' fastif(icacomp, ... + '(uV/epoch)', ... + '(std. dev./epoch)') ] }, ... + { 'Style', 'edit', 'string', '50', 'tag', 'constpnts' }, ... + { 'Style', 'text', 'string', 'R-squared limit (0 to 1)' }, ... + { 'Style', 'edit', 'string', '0.3', 'tag', 'conststd' }, ... + ... + { }, { 'Style', 'text', 'string', chanliststr }, ... + { 'Style', 'edit', 'string', chanlistval, 'tag', 'constelec' }, ... + { 'Style', 'text', 'string', 'Currently marked trials' }, ... + { 'Style', 'text', 'string', int2str(sizetrend), 'tag', 'consttrial' }, ... + ... + { }, { 'Style', 'pushbutton', 'string', 'Calc / Plot', 'callback', cb_compconstrej }, ... + { }, { }, { 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_rejtrend'');' }, ... + ... % --------------------------------------------------------------------------- + { }, { 'Style', 'text', 'string', 'Find improbable data', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', '', 'tag', 'butjp', ... + 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejjpcol); if length(tmpcolor) ~= 1,' ... + 'EEG.reject.rejjpcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... + ... + { }, { 'Style', 'text', 'string', fastif(icacomp, 'Single-channel limit (std. dev.)', 'Single-comp. limit (std. dev.)') }, ... + { 'Style', 'edit', 'string', fastif(icacomp, '5', '20'), 'tag', 'entloc' }, ... + { 'Style', 'text', 'string', fastif(icacomp, 'All channels limit (std. dev.)', 'All comp. limit (std. dev.)') }, ... + { 'Style', 'edit', 'string', '5', 'tag', 'entglob' }, ... + ... + { }, { 'Style', 'text', 'string', chanliststr }, ... + { 'Style', 'edit', 'string', chanlistval, 'tag', 'entelec' }, ... + { 'Style', 'text', 'string', 'Currently marked trials' }, ... + { 'Style', 'text', 'string', int2str(sizejp), 'tag', 'enttrial' }, ... + ... + { }, { 'Style', 'pushbutton', 'string', 'Calculate', 'callback', cb_compentcalc }, ... + { 'Style', 'pushbutton', 'string', 'Scroll Data', 'callback', cb_compenteeg }, ... + { 'Style', 'pushbutton', 'string', 'PLOT', 'callback', cb_compentplot }, ... + { 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_jointprob'');' }, ... + ... % --------------------------------------------------------------------------- + { }, { 'Style', 'text', 'string', 'Find abnormal distributions', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', '', 'tag', 'butkurt', ... + 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejkurtcol); if length(tmpcolor) ~= 1,' ... + 'EEG.reject.rejkurtcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... + ... + { }, { 'Style', 'text', 'string', fastif(icacomp, 'Single-channel limit (std. dev.)', 'Single-comp. limit (std. dev.)') }, ... + { 'Style', 'edit', 'string', fastif(icacomp, '5', '20'), 'tag', 'kurtloc' }, ... + { 'Style', 'text', 'string', fastif(icacomp, 'All channels limit (std. dev.)', 'All comp. limit (std. dev.)') }, ... + { 'Style', 'edit', 'string', '5', 'tag', 'kurtglob' }, ... + ... + { }, { 'Style', 'text', 'string', chanliststr }, ... + { 'Style', 'edit', 'string', chanlistval, 'tag', 'kurtelec' }, ... + { 'Style', 'text', 'string', 'Currently marked trials' }, ... + { 'Style', 'text', 'string', int2str(sizekurt), 'tag', 'kurttrial' }, ... + ... + { }, { 'Style', 'pushbutton', 'string', 'Calculate', 'callback', cb_compkurtcalc }, ... + { 'Style', 'pushbutton', 'string', 'Scroll Data', 'callback', cb_compkurteeg }, ... + { 'Style', 'pushbutton', 'string', 'PLOT', 'callback', cb_compkurtplot }, ... + { 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_rejkurt'');' }, ... + ... % --------------------------------------------------------------------------- + { }, { 'Style', 'text', 'string', 'Find abnormal spectra (slow)', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', '', 'tag', 'butspec', ... + 'callback', [ 'tmpcolor = uisetcolor(EEG.reject.rejfreqcol); if length(tmpcolor) ~= 1,' ... + 'EEG.reject.rejfreqcol=tmpcolor; set(gcbo, ''backgroundcolor'', tmpcolor); end; clear tmpcolor;'] }, { },... + ... + { }, { 'Style', 'text', 'string', 'Upper limit(s) (dB)' }, ... + { 'Style', 'edit', 'string', '25', 'tag', 'freqpos' }, ... + { 'Style', 'text', 'string', 'Lower limit(s) (dB)' }, ... + { 'Style', 'edit', 'string', '-25', 'tag', 'freqneg' }, ... + ... + { }, { 'Style', 'text', 'string', 'Low frequency(s) (Hz)' }, ... + { 'Style', 'edit', 'string', '0', 'tag', 'freqstart' }, ... + { 'Style', 'text', 'string', 'High frequency(s) (Hz)' }, ... + { 'Style', 'edit', 'string', '50', 'tag', 'freqend' }, ... + ... + { }, { 'Style', 'text', 'string', chanliststr }, ... + { 'Style', 'edit', 'string', chanlistval, 'tag', 'freqelec' }, ... + { 'Style', 'text', 'string', 'Currently marked trials' }, ... + { 'Style', 'text', 'string', int2str(sizespec), 'tag', 'freqtrial' }, ... + ... + { }, { 'Style', 'pushbutton', 'string', 'Calc / Plot', 'callback', cb_compfreq }, ... + { }, { },{ 'Style', 'pushbutton', 'string', 'HELP', 'callback', 'pophelp(''pop_rejspec'');' }, ... + ... + {}, ... % --------------------------------------------------------------------------- + ... + { 'Style', 'text', 'string', 'Plotting options', 'fontweight', 'bold' }, ... + { 'style', 'listbox', lisboxoptions{:}, 'value', 3 }, ... + { 'style', 'checkbox', 'String', 'Abnormal appearance', 'tag', 'IManual', 'value', 1, ... + 'callback', 'set(gcbo, ''value'', 1); disp(''This checkbox must be set so that you may mark/unmark data epochs'');'}, ... + { 'style', 'checkbox', 'String', 'Abnormal values', 'tag', 'IThresh', 'value', 1}, ... + { 'style', 'checkbox', 'String', 'Abnormal trends', 'tag', 'IConst', 'value', 1}, ... + { 'style', 'checkbox', 'String', 'Improbable epochs', 'tag', 'IEnt', 'value', 1}, ... + { 'style', 'checkbox', 'String', 'Abnormal distributions', 'tag', 'IKurt', 'value', 1}, ... + { 'style', 'checkbox', 'String', 'Abnormal spectra', 'tag', 'IFreq', 'value', 1}, ... + ... + { }, ... + { 'Style', 'pushbutton', 'string', 'CLOSE (KEEP MARKS)', 'callback', cb_close }, ... + { 'Style', 'pushbutton', 'string', 'CLEAR ALL MARKS', 'callback', cb_clear }, ... + { 'Style', 'pushbutton', 'string', 'REJECT MARKED TRIALS', 'callback', cb_reject }}; + + allh = supergui( gcf, geometry, [], listui{:}); + +% { 'style', 'checkbox', 'String', ['Include ' fastif(icacomp, 'ica data', 'raw data')], 'tag', 'IOthertype', 'value', 1}, { }, ... +set(gcf, 'userdata', { allh }); +set(findobj('parent', gcf', 'tag', 'butmanual'), 'backgroundcolor', EEG.reject.rejmanualcol); +set(findobj('parent', gcf', 'tag', 'butthresh'), 'backgroundcolor', EEG.reject.rejthreshcol); +set(findobj('parent', gcf', 'tag', 'buttrend'), 'backgroundcolor', EEG.reject.rejconstcol); +set(findobj('parent', gcf', 'tag', 'butjp'), 'backgroundcolor', EEG.reject.rejjpcol); +set(findobj('parent', gcf', 'tag', 'butkurt'), 'backgroundcolor', EEG.reject.rejkurtcol); +set(findobj('parent', gcf', 'tag', 'butspec'), 'backgroundcolor', EEG.reject.rejfreqcol); +set( findobj('parent', gcf, 'tag', 'rejstatus'), 'style', 'popup'); + diff --git a/code/eeglab13_4_4b/functions/adminfunc/pop_stdwarn.m b/code/eeglab13_4_4b/functions/adminfunc/pop_stdwarn.m new file mode 100644 index 0000000..8e72377 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/pop_stdwarn.m @@ -0,0 +1,39 @@ +% pop_stdwarn() - check memory options and issue warning for studies. +% +% Usage: >> pop_stdwarn; +% +% Author: Arnaud Delorme, CERCO, 2007 +% +% See also: eeg_options() + +% Copyright (C) Arnaud Delorme, CERCO, 2007, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +res = 0; + +eeglab_options; +if ~option_storedisk + vartext = strvcat('Your memory options currently allow to store all datasets in memory (RAM)!', ' ', ... + 'If your study contains a large number of datasets, you should change the memory', ... + 'settings to allow EEGLAB to only read the dataset header (cancel next action and', ... + 'use menu item "File > Memory" - first checkbox to allow at most one dataset at a', ... + 'time in memory). Otherwise your computer might run out of memory.', ' ', ... + 'NOTE that this is a REQUIRED step to load the tutorial study since it does not', ... + 'contain the EEG data.', ' '); + + res = questdlg2(vartext, 'Study warning', 'Cancel', 'Ok', 'Ok'); + if strcmpi(res, 'Cancel'), break; return; end; +end; diff --git a/code/eeglab13_4_4b/functions/adminfunc/setdiff_bc.m b/code/eeglab13_4_4b/functions/adminfunc/setdiff_bc.m new file mode 100644 index 0000000..dc80d4b --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/setdiff_bc.m @@ -0,0 +1,29 @@ +% setdiff_bc - setdiff backward compatible with Matlab versions prior to 2013a + +function [C,IA] = setdiff_bc(A,B,varargin); + +errorFlag = error_bc; + +v = version; +indp = find(v == '.'); +v = str2num(v(1:indp(2)-1)); +if v > 7.19, v = floor(v) + rem(v,1)/10; end; + +if nargin > 2 + ind = strmatch('legacy', varargin); + if ~isempty(ind) + varargin(ind) = []; + end; +end; + +if v >= 7.14 + [C,IA] = setdiff(A,B,varargin{:},'legacy'); + if errorFlag + [C2,IA2] = setdiff(A,B,varargin{:}); + if (~isequal(C, C2) || ~isequal(IA, IA2)) + warning('backward compatibility issue with call to setdiff function'); + end; + end; +else + [C,IA] = setdiff(A,B,varargin{:}); +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/troubleshooting_data_formats.m b/code/eeglab13_4_4b/functions/adminfunc/troubleshooting_data_formats.m new file mode 100644 index 0000000..1be9824 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/troubleshooting_data_formats.m @@ -0,0 +1,16 @@ +%Several EEGLAB plugins (not included by default) are available to import +%specific data formats. To download these plugins use EEGLAB menu +% +%File > Manage Plugins > Manage data import plugins +% +%The FILEIO and BIOSIG toolboxes interface also allow to import in EEGLAB a wide variety +%of EEG/MEG data file formats -- including those imported using EEGLAB native menus +% +%For EEGLAB, FILE-IO and BIOSIG suported data formats +%http://sccn.ucsd.edu/wiki/A01:_Importing_Continuous_and_Epoched_Data +% +%For FILE-IO see in addition +%http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:dataformat +% +%For BIOSIG see in addition +%http://biosig.sourceforge.net/SupportedSystems.html diff --git a/code/eeglab13_4_4b/functions/adminfunc/union_bc.m b/code/eeglab13_4_4b/functions/adminfunc/union_bc.m new file mode 100644 index 0000000..5be4154 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/union_bc.m @@ -0,0 +1,29 @@ +% union_bc - union backward compatible with Matlab versions prior to 2013a + +function [C,IA,IB] = union_bc(A,B,varargin); + +errorFlag = error_bc; + +v = version; +indp = find(v == '.'); +v = str2num(v(1:indp(2)-1)); +if v > 7.19, v = floor(v) + rem(v,1)/10; end; + +if nargin > 2 + ind = strmatch('legacy', varargin); + if ~isempty(ind) + varargin(ind) = []; + end; +end; + +if v >= 7.14 + [C,IA,IB] = union(A,B,varargin{:},'legacy'); + if errorFlag + [C2,IA2,IB2] = union(A,B,varargin{:}); + if (~isequal(C, C2) || ~isequal(IA, IA2) || ~isequal(IB, IB2)) + warning('backward compatibility issue with call to union function'); + end; + end; +else + [C,IA,IB] = union(A,B,varargin{:}); +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/unique_bc.m b/code/eeglab13_4_4b/functions/adminfunc/unique_bc.m new file mode 100644 index 0000000..6256550 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/unique_bc.m @@ -0,0 +1,29 @@ +% unique_bc - unique backward compatible with Matlab versions prior to 2013a + +function [C,IA,IB] = unique_bc(A,varargin); + +errorFlag = error_bc; + +v = version; +indp = find(v == '.'); +v = str2num(v(1:indp(2)-1)); +if v > 7.19, v = floor(v) + rem(v,1)/10; end; + +if nargin > 2 + ind = strmatch('legacy', varargin); + if ~isempty(ind) + varargin(ind) = []; + end; +end; + +if v >= 7.14 + [C,IA,IB] = unique(A,varargin{:},'legacy'); + if errorFlag + [C2,IA2] = unique(A,varargin{:}); + if ~isequal(C, C2) || ~isequal(IA, IA2) || ~isequal(IB, IB2) + warning('backward compatibility issue with call to unique function'); + end; + end; +else + [C,IA,IB] = unique(A,varargin{:}); +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/adminfunc/vararg2str.m b/code/eeglab13_4_4b/functions/adminfunc/vararg2str.m new file mode 100644 index 0000000..9930703 --- /dev/null +++ b/code/eeglab13_4_4b/functions/adminfunc/vararg2str.m @@ -0,0 +1,230 @@ +% vararg2str() - transform arguments into string for evaluation +% using the eval() command +% +% Usage: +% >> strout = vararg2str( allargs ); +% >> strout = vararg2str( allargs, inputnames, inputnum, nostrconv ); +% +% Inputs: +% allargs - Cell array containing all arguments +% inputnames - Cell array of input names for these arguments, if any. +% inputnum - Vector of indices for all inputs. If present, the +% string output may by replaced by varargin{num}. +% Include NaN in the vector to avoid specific parameters +% being converted in this way. +% nostrconv - Vector of 0s and 1s indicating where the string +% should be not be converted. +% +% Outputs: +% strout - output string +% +% Author: Arnaud Delorme, CNL / Salk Institute, 9 April 2002 + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 9 April 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function strout = vararg2str(allargs, inputnam, inputnum, int2str ); + +if nargin < 1 + help vararg2str; + return; +end; +if isempty(allargs) + strout = ''; + return; +end; + +% default arguments +% ----------------- +if nargin < 2 + inputnam(1:length(allargs)) = {''}; +else + if length(inputnam) < length(allargs) + inputnam(end+1:length(allargs)) = {''}; + end; +end; +if nargin < 3 + inputnum(1:length(allargs)) = NaN; +else + if length(inputnum) < length(allargs) + inputnum(end+1:length(allargs)) = NaN; + end; +end; +if nargin < 4 + int2str(1:length(allargs)) = 0; +else + if length(int2str) < length(allargs) + int2str(end+1:length(allargs)) = 0; + end; +end; +if ~iscell( allargs ) + allargs = { allargs }; +end; + +% actual conversion +% ----------------- +strout = ''; +for index = 1:length(allargs) + tmpvar = allargs{index}; + if ~isempty(inputnam{index}) + strout = [ strout ',' inputnam{index} ]; + else + if isstr( tmpvar ) + if int2str(index) + strout = [ strout ',' tmpvar ]; + else + strout = [ strout ',' str2str( tmpvar ) ]; + end; + elseif isnumeric( tmpvar ) | islogical( tmpvar ) + strout = [ strout ',' array2str( tmpvar ) ]; + elseif iscell( tmpvar ) + tmpres = vararg2str( tmpvar ); + comas = find( tmpres == ',' ); + tmpres(comas) = ' '; + strout = [ strout ',{' tmpres '}' ]; + elseif isstruct(tmpvar) + strout = [ strout ',' struct2str( tmpvar ) ]; + else + error('Unrecognized input'); + end; + end; + +end; +if ~isempty(strout) + strout = strout(2:end); +end; + +% convert string to string +% ------------------------ +function str = str2str( array ) + if isempty( array), str = ''''''; return; end; + str = ''; + for index = 1:size(array,1) + tmparray = deblank(array(index,:)); + if isempty(tmparray) + str = [ str ','' ''' ]; + else + str = [ str ',''' doublequotes(tmparray) '''' ]; + end; + end; + if size(array,1) > 1 + str = [ 'strvcat(' str(2:end) ')']; + else + str = str(2:end); + end; +return; + +% convert array to string +% ----------------------- +function str = array2str( array ) + if isempty( array), str = '[]'; return; end; + if prod(size(array)) == 1, str = num2str(array); return; end; + if size(array,1) == 1, str = [ '[' contarray(array) '] ' ]; return; end; + if size(array,2) == 1, str = [ '[' contarray(array') ']'' ' ]; return; end; + str = ''; + for index = 1:size(array,1) + str = [ str ';' contarray(array(index,:)) ]; + end; + str = [ '[' str(2:end) ']' ]; +return; + +% convert struct to string +% ------------------------ +function str = struct2str( structure ) + if isempty( structure ) + str = 'struct([])'; return; + end; + str = ''; + allfields = fieldnames( structure ); + for index = 1:length( allfields ) + strtmp = ''; + eval( [ 'allcontent = { structure.' allfields{index} ' };' ] ); % getfield generates a bug + str = [ str, '''' allfields{index} ''',{' vararg2str( allcontent ) '},' ]; + end; + str = [ 'struct(' str(1:end-1) ')' ]; +return; + +% double the quotes in strings +% ---------------------------- +function str = doublequotes( str ) + quoteloc = union_bc(findstr( str, ''''), union(findstr(str, '%'), findstr(str, '\'))); + if ~isempty(quoteloc) + for index = length(quoteloc):-1:1 + str = [ str(1:quoteloc(index)) str(quoteloc(index):end) ]; + end; + end; +return; + +% test continuous arrays +% ---------------------- +function str = contarray( array ) + array = double(array); + tmpind = find( round(array) ~= array ); + if prod(size(array)) == 1 + str = num2str(array); + return; + end; + if size(array,1) == 1 & size(array,2) == 2 + str = [num2str(array(1)) ' ' num2str(array(2))]; + return; + end; + if isempty(tmpind) | all(isnan(array(tmpind))) + str = num2str(array(1)); + skip = 0; + indent = array(2) - array(1); + for index = 2:length(array) + if array(index) ~= array(index-1)+indent | indent == 0 + if skip <= 1 + if skip == 0 + str = [str ' ' num2str(array(index))]; + else + str = [str ' ' num2str(array(index-1)) ' ' num2str(array(index))]; + end; + else + if indent == 1 + str = [str ':' num2str(array(index-1)) ' ' num2str(array(index))]; + else + str = [str ':' num2str(indent) ':' num2str(array(index-1)) ' ' num2str(array(index))]; + end; + end; + skip = 0; + indent = array(index) - array(index-1); + else + skip = skip + 1; + end; + end; + if array(index) == array(index-1)+indent + if skip ~= 0 + if indent == 1 + str = [str ':' num2str(array(index)) ]; + elseif indent == 0 + str = [str ' ' num2str(array(index)) ]; + else + str = [str ':' num2str(indent) ':' num2str(array(index)) ]; + end; + end; + end; + else + if length(array) < 10 + str = num2str(array(1)); + for index = 2:length(array) + str = [str ' ' num2str(array(index)) ]; + end; + else + str = num2str(double(array)); + end; + end; + diff --git a/code/eeglab13_4_4b/functions/guifunc/README.txt b/code/eeglab13_4_4b/functions/guifunc/README.txt new file mode 100644 index 0000000..25d9bf5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/README.txt @@ -0,0 +1,65 @@ +Graphic Interface Toolkit +------------------------- +This package contains a set of function to easily create complex graphic +interface (see examples). This package is part of the EEGLAB public +software for electro-encephalography analysis (which is the leading +public software for processing electro-encephalography data with more than +70 000 download) and is distributed under the GNU GPL license. + +Requirements +------------ +Matlab version 7 is required. + +Quickstart +---------- +Complex graphic interface may be created with arbitrary uicontrols. A simple +example using the inputgui function is shown below + +[res userdat strhalt restag] = inputgui('geometry', { 1 1 }, 'uilist', ... + { { 'style' 'text' 'string' 'Enter a value' } ... + { 'style' 'edit' 'string' '' 'tag' 'editstr'} }); + +res contains a cell array of output and restag contains a structure with +a field for each output (in the example above res.editstr will contain the +edited string). + +Complex geometry for each control may be defined using the 'geom' input +that works in a way similar to the subplot function (see function help +message). For example: + +res = inputgui('geom', { {2 1 [0 0] [1 1]} {2 1 [1 0] [1 1]} }, 'uilist', ... + { { 'style' 'text' 'string' 'Enter a value' } ... + { 'style' 'edit' 'string' '' } }); + +In addition, use the functions questdlg2, errordlg2, warndlg2, listdlg2, +inputdlg2 to replace standard Matlab functions + +ButtonName = questdlg2('What is your favorite color?', 'Color Question', ... + 'Red', 'Green', 'Blue', 'Green'); + +GUI color may be customized for these graphic interfaces by defining a +file containing colors (see icadefs.m file in the EEGLAB software +distribution). + +For more information see the help message of each m function. + +Content +------- +inputgui - main function to create graphic interface +supergui - support function creating the actual figure +finputcheck - support function for checking function input validity +pophelp - shows a function code in the Matlab browser +warmdlg2 - uses inputgui to replace the Matlab warndlg function +errordlg2 - uses inputgui to replace the Matlab errordlg function +listdlg2 - uses inputgui to replace the Matlab listdlg function +inputdlg2 - uses inputgui to replace the Matlab inputdlg function +questdlg2 - uses inputgui to replace the Matlab questdlg function + +The latest revision of these function may be checked out using SVN at + +http://sccn.ucsd.edu/repos/software/eeglab/functions/guifunc/ + +Arnaud Delorme, PhD +June 19th 2010 +University of San Diego California, USA +CNRS, University of Toulouse Paul Sabatier, France diff --git a/code/eeglab13_4_4b/functions/guifunc/errordlg2.m b/code/eeglab13_4_4b/functions/guifunc/errordlg2.m new file mode 100644 index 0000000..ed9e9c1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/errordlg2.m @@ -0,0 +1,45 @@ +% errordlg2() - Makes a popup dialog box with the specified message and (optional) +% title. +% +% Usage: +% errordlg2(Prompt, Title); +% +% Example: +% errordlg2('Explanation of error','title of error'); +% +% Input: +% Prompt - A text string explaning why the user is seeing this error message. +% Title _ A text string that appears in the title bar of the error message. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 12 August 2002 +% +% See also: inputdlg2(), questdlg2() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function errordlg2(Prompt, Title); + +if exist('beep') == 5 + beep; +else + disp(char(7)); +end; +if nargin <2 + Title = 'Error'; +end; +if ~ismatlab, error(Prompt); end; +questdlg2(Prompt, Title, 'OK', 'OK'); diff --git a/code/eeglab13_4_4b/functions/guifunc/finputcheck.m b/code/eeglab13_4_4b/functions/guifunc/finputcheck.m new file mode 100644 index 0000000..d2ce131 --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/finputcheck.m @@ -0,0 +1,251 @@ +% finputcheck() - check Matlab function {'key','value'} input argument pairs +% +% Usage: >> result = finputcheck( varargin, fieldlist ); +% >> [result varargin] = finputcheck( varargin, fieldlist, ... +% callingfunc, mode, verbose ); +% Input: +% varargin - Cell array 'varargin' argument from a function call using 'key', +% 'value' argument pairs. See Matlab function 'varargin'. +% May also be a structure such as struct(varargin{:}) +% fieldlist - A 4-column cell array, one row per 'key'. The first +% column contains the key string, the second its type(s), +% the third the accepted value range, and the fourth the +% default value. Allowed types are 'boolean', 'integer', +% 'real', 'string', 'cell' or 'struct'. For example, +% {'key1' 'string' { 'string1' 'string2' } 'defaultval_key1'} +% {'key2' {'real' 'integer'} { minint maxint } 'defaultval_key2'} +% callingfunc - Calling function name for error messages. {default: none}. +% mode - ['ignore'|'error'] ignore keywords that are either not specified +% in the fieldlist cell array or generate an error. +% {default: 'error'}. +% verbose - ['verbose', 'quiet'] print information. Default: 'verbose'. +% +% Outputs: +% result - If no error, structure with 'key' as fields and 'value' as +% content. If error this output contain the string error. +% varargin - residual varagin containing unrecognized input arguments. +% Requires mode 'ignore' above. +% +% Note: In case of error, a string is returned containing the error message +% instead of a structure. +% +% Example (insert the following at the beginning of your function): +% result = finputcheck(varargin, ... +% { 'title' 'string' [] ''; ... +% 'percent' 'real' [0 1] 1 ; ... +% 'elecamp' 'integer' [1:10] [] }); +% if isstr(result) +% error(result); +% end +% +% Note: +% The 'title' argument should be a string. {no default value} +% The 'percent' argument should be a real number between 0 and 1. {default: 1} +% The 'elecamp' argument should be an integer between 1 and 10 (inclusive). +% +% Now 'g.title' will contain the title arg (if any, else the default ''), etc. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 10 July 2002 + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 10 July 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [g, varargnew] = finputcheck( vararg, fieldlist, callfunc, mode, verbose ) + + if nargin < 2 + help finputcheck; + return; + end; + if nargin < 3 + callfunc = ''; + else + callfunc = [callfunc ' ' ]; + end; + if nargin < 4 + mode = 'do not ignore'; + end; + if nargin < 5 + verbose = 'verbose'; + end; + NAME = 1; + TYPE = 2; + VALS = 3; + DEF = 4; + SIZE = 5; + + varargnew = {}; + % create structure + % ---------------- + if ~isempty(vararg) + if isstruct(vararg) + g = vararg; + else + for index=1:length(vararg) + if iscell(vararg{index}) + vararg{index} = {vararg{index}}; + end; + end; + try + g = struct(vararg{:}); + catch + vararg = removedup(vararg, verbose); + try + g = struct(vararg{:}); + catch + g = [ callfunc 'error: bad ''key'', ''val'' sequence' ]; return; + end; + end; + end; + else + g = []; + end; + + for index = 1:size(fieldlist,NAME) + % check if present + % ---------------- + if ~isfield(g, fieldlist{index, NAME}) + g = setfield( g, fieldlist{index, NAME}, fieldlist{index, DEF}); + end; + tmpval = getfield( g, {1}, fieldlist{index, NAME}); + + % check type + % ---------- + if ~iscell( fieldlist{index, TYPE} ) + res = fieldtest( fieldlist{index, NAME}, fieldlist{index, TYPE}, ... + fieldlist{index, VALS}, tmpval, callfunc ); + if isstr(res), g = res; return; end; + else + testres = 0; + tmplist = fieldlist; + for it = 1:length( fieldlist{index, TYPE} ) + if ~iscell(fieldlist{index, VALS}) + res{it} = fieldtest( fieldlist{index, NAME}, fieldlist{index, TYPE}{it}, ... + fieldlist{index, VALS}, tmpval, callfunc ); + else res{it} = fieldtest( fieldlist{index, NAME}, fieldlist{index, TYPE}{it}, ... + fieldlist{index, VALS}{it}, tmpval, callfunc ); + end; + if ~isstr(res{it}), testres = 1; end; + end; + if testres == 0, + g = res{1}; + for tmpi = 2:length(res) + g = [ g 10 'or ' res{tmpi} ]; + end; + return; + end; + end; + end; + + % check if fields are defined + % --------------------------- + allfields = fieldnames(g); + for index=1:length(allfields) + if isempty(strmatch(allfields{index}, fieldlist(:, 1)', 'exact')) + if ~strcmpi(mode, 'ignore') + g = [ callfunc 'error: undefined argument ''' allfields{index} '''']; return; + end; + varargnew{end+1} = allfields{index}; + varargnew{end+1} = getfield(g, {1}, allfields{index}); + end; + end; + + +function g = fieldtest( fieldname, fieldtype, fieldval, tmpval, callfunc ); + NAME = 1; + TYPE = 2; + VALS = 3; + DEF = 4; + SIZE = 5; + g = []; + + switch fieldtype + case { 'integer' 'real' 'boolean' 'float' }, + if ~isnumeric(tmpval) && ~islogical(tmpval) + g = [ callfunc 'error: argument ''' fieldname ''' must be numeric' ]; return; + end; + if strcmpi(fieldtype, 'boolean') + if tmpval ~=0 && tmpval ~= 1 + g = [ callfunc 'error: argument ''' fieldname ''' must be 0 or 1' ]; return; + end; + else + if strcmpi(fieldtype, 'integer') + if ~isempty(fieldval) + if (any(isnan(tmpval(:))) && ~any(isnan(fieldval))) ... + && (~ismember(tmpval, fieldval)) + g = [ callfunc 'error: wrong value for argument ''' fieldname '''' ]; return; + end; + end; + else % real or float + if ~isempty(fieldval) && ~isempty(tmpval) + if any(tmpval < fieldval(1)) || any(tmpval > fieldval(2)) + g = [ callfunc 'error: value out of range for argument ''' fieldname '''' ]; return; + end; + end; + end; + end; + + + case 'string' + if ~isstr(tmpval) + g = [ callfunc 'error: argument ''' fieldname ''' must be a string' ]; return; + end; + if ~isempty(fieldval) + if isempty(strmatch(lower(tmpval), lower(fieldval), 'exact')) + g = [ callfunc 'error: wrong value for argument ''' fieldname '''' ]; return; + end; + end; + + + case 'cell' + if ~iscell(tmpval) + g = [ callfunc 'error: argument ''' fieldname ''' must be a cell array' ]; return; + end; + + + case 'struct' + if ~isstruct(tmpval) + g = [ callfunc 'error: argument ''' fieldname ''' must be a structure' ]; return; + end; + + case 'function_handle' + if ~isa(tmpval, 'function_handle') + g = [ callfunc 'error: argument ''' fieldname ''' must be a function handle' ]; return; + end; + + case ''; + otherwise, error([ 'finputcheck error: unrecognized type ''' fieldname '''' ]); + end; + +% remove duplicates in the list of parameters +% ------------------------------------------- +function cella = removedup(cella, verbose) +% make sure if all the values passed to unique() are strings, if not, exist +%try + [tmp indices] = unique_bc(cella(1:2:end)); + if length(tmp) ~= length(cella)/2 + myfprintf(verbose,'Note: duplicate ''key'', ''val'' parameter(s), keeping the last one(s)\n'); + end; + cella = cella(sort(union(indices*2-1, indices*2))); +%catch + % some elements of cella were not string +% error('some ''key'' values are not string.'); +%end; + +function myfprintf(verbose, varargin) + +if strcmpi(verbose, 'verbose') + fprintf(varargin{:}); +end; diff --git a/code/eeglab13_4_4b/functions/guifunc/inputdlg2.m b/code/eeglab13_4_4b/functions/guifunc/inputdlg2.m new file mode 100644 index 0000000..c7b5880 --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/inputdlg2.m @@ -0,0 +1,77 @@ +% inputdlg2() - inputdlg function clone with coloring and help for +% eeglab(). +% +% Usage: +% >> Answer = inputdlg2(Prompt,Title,LineNo,DefAns,funcname); +% +% Inputs: +% Same as inputdlg. Using the optional additionnal funcname parameter +% the function will create a help button. The help message will be +% displayed using the pophelp() function. +% +% Output: +% Same as inputdlg +% +% Note: The advantage of this function is that the color of the window +% can be changed and that it displays an help button. Edit +% supergui to change window options. Also the parameter LineNo +% can only be one. +% +% Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 11 August 2002 +% +% See also: supergui(), inputgui() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [result] = inputdlg2(Prompt,Title,LineNo,DefAns,funcname); + +if nargin < 4 + help inputdlg2; + return; +end; +if nargin < 5 + funcname = ''; +end; + +if length(Prompt) ~= length(DefAns) + error('inputdlg2: prompt and default answer cell array must have the smae size'); +end; + +geometry = {}; +listgui = {}; + +% determine if vertical or horizontal +% ----------------------------------- +geomvert = []; +for index = 1:length(Prompt) + geomvert = [geomvert size(Prompt{index},1) 1]; % default is vertical geometry +end; +if all(geomvert == 1) & length(Prompt) > 1 + geomvert = []; % horizontal +end; + +for index = 1:length(Prompt) + if ~isempty(geomvert) % vertical + geometry = { geometry{:} [ 1] [1 ]}; + else + geometry = { geometry{:} [ 1 0.6 ]}; + end; + listgui = { listgui{:} { 'Style', 'text', 'string', Prompt{index}} ... + { 'Style', 'edit', 'string', DefAns{index} } }; +end; + +result = inputgui(geometry, listgui, ['pophelp(''' funcname ''');'], Title, [], 'normal', geomvert); diff --git a/code/eeglab13_4_4b/functions/guifunc/inputgui.m b/code/eeglab13_4_4b/functions/guifunc/inputgui.m new file mode 100644 index 0000000..9a91fee --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/inputgui.m @@ -0,0 +1,278 @@ +% inputgui() - A comprehensive gui automatic builder. This function helps +% to create GUI very quickly without bothering about the +% positions of the elements. After creating a geometry, +% elements just place themselves in the predefined +% locations. It is especially useful for figures in which +% you intend to put text buttons and descriptions. +% +% Usage: +% >> [ outparam ] = inputgui( 'key1', 'val1', 'key2', 'val2', ... ); +% >> [ outparam userdat strhalt outstruct] = ... +% inputgui( 'key1', 'val1', 'key2', 'val2', ... ); +% +% Inputs: +% 'geom' - cell array of cell array of integer vector. Each cell +% array defines the coordinate of a given input in the +% following manner: { nb_row nb_col [x_topcorner y_topcorner] +% [x_bottomcorner y_bottomcorner] }; +% 'geometry' - cell array describing horizontal geometry. This corresponds +% to the supergui function input 'geomhoriz' +% 'geomvert' - vertical geometry argument, this argument is passed on to +% the supergui function +% 'uilist' - list of uicontrol lists describing elements properties +% { { ui1 }, { ui2 }... }, { 'uiX' } being GUI matlab +% uicontrol arguments such as { 'style', 'radiobutton', +% 'String', 'hello' }. See Matlab function uicontrol() for details. +% 'helpcom' - optional help command +% 'helpbut' - text for help button +% 'title' - optional figure title +% 'userdata' - optional userdata input for the figure +% 'mode' - ['normal'|'noclose'|'plot' fignumber]. Either wait for +% user to press OK or CANCEL ('normal'), return without +% closing window input ('noclose'), only draw the gui ('plot') +% or process an existing window which number is given as +% input (fignumber). Default is 'normal'. +% 'eval' - [string] command to evaluate at the end of the creation +% of the GUI but before waiting for user input. +% 'screenpos' - see supergui.m help message. +% 'skipline' - ['on'|'off'] skip a row before the "OK" and "Cancel" +% button. Default is 'on'. +% +% Output: +% outparam - list of outputs. The function scans all lines and +% add up an output for each interactive uicontrol, i.e +% edit box, radio button, checkbox and listbox. +% userdat - 'userdata' value of the figure. +% strhalt - the function returns when the 'userdata' field of the +% button with the tag 'ok' is modified. This returns the +% new value of this field. +% outstruct - returns outputs as a structure (only tagged ui controls +% are considered). The field name of the structure is +% the tag of the ui and contain the ui value or string. +% +% Note: the function also adds three buttons at the bottom of each +% interactive windows: 'CANCEL', 'HELP' (if callback command +% is provided) and 'OK'. +% +% Example: +% res = inputgui('geometry', { 1 1 }, 'uilist', ... +% { { 'style' 'text' 'string' 'Enter a value' } ... +% { 'style' 'edit' 'string' '' } }); +% +% res = inputgui('geom', { {2 1 [0 0] [1 1]} {2 1 [1 0] [1 1]} }, 'uilist', ... +% { { 'style' 'text' 'string' 'Enter a value' } ... +% { 'style' 'edit' 'string' '' } }); +% +% Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 1 Feb 2002 +% +% See also: supergui(), eeglab() + +% Copyright (C) Arnaud Delorme, CNL/Salk Institute, 27 Jan 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [result, userdat, strhalt, resstruct] = inputgui( varargin); + +if nargin < 2 + help inputgui; + return; +end; + +% decoding input and backward compatibility +% ----------------------------------------- +if isstr(varargin{1}) + options = varargin; +else + options = { 'geometry' 'uilist' 'helpcom' 'title' 'userdata' 'mode' 'geomvert' }; + options = { options{1:length(varargin)}; varargin{:} }; + options = options(:)'; +end; + +% checking inputs +% --------------- +g = finputcheck(options, { 'geom' 'cell' [] {}; ... + 'geometry' {'cell','integer'} [] []; ... + 'uilist' 'cell' [] {}; ... + 'helpcom' { 'string','cell' } { [] [] } ''; ... + 'title' 'string' [] ''; ... + 'eval' 'string' [] ''; ... + 'helpbut' 'string' [] 'Help'; ... + 'skipline' 'string' { 'on' 'off' } 'on'; ... + 'addbuttons' 'string' { 'on' 'off' } 'on'; ... + 'userdata' '' [] []; ... + 'getresult' 'real' [] []; ... + 'minwidth' 'real' [] 200; ... + 'screenpos' '' [] []; ... + 'mode' '' [] 'normal'; ... + 'geomvert' 'real' [] [] ... + }, 'inputgui'); +if isstr(g), error(g); end; + +if isempty(g.getresult) + if isstr(g.mode) + fig = figure('visible', 'off'); + set(fig, 'name', g.title); + set(fig, 'userdata', g.userdata); + if ~iscell( g.geometry ) + oldgeom = g.geometry; + g.geometry = {}; + for row = 1:length(oldgeom) + g.geometry = { g.geometry{:} ones(1, oldgeom(row)) }; + end; + end + + % skip a line + if strcmpi(g.skipline, 'on'), + g.geometry = { g.geometry{:} [1] }; + if ~isempty(g.geom) + for ind = 1:length(g.geom) + g.geom{ind}{2} = g.geom{ind}{2}+1; % add one row + end; + g.geom = { g.geom{:} {1 g.geom{1}{2} [0 g.geom{1}{2}-2] [1 1] } }; + end; + g.uilist = { g.uilist{:}, {} }; + end; + + % add buttons + if strcmpi(g.addbuttons, 'on'), + g.geometry = { g.geometry{:} [1 1 1 1] }; + if ~isempty(g.geom) + for ind = 1:length(g.geom) + g.geom{ind}{2} = g.geom{ind}{2}+1; % add one row + end; + g.geom = { g.geom{:} ... + {4 g.geom{1}{2} [0 g.geom{1}{2}-1] [1 1] }, ... + {4 g.geom{1}{2} [1 g.geom{1}{2}-1] [1 1] }, ... + {4 g.geom{1}{2} [2 g.geom{1}{2}-1] [1 1] }, ... + {4 g.geom{1}{2} [3 g.geom{1}{2}-1] [1 1] } }; + end; + if ~isempty(g.helpcom) + if ~iscell(g.helpcom) + g.uilist = { g.uilist{:}, { 'width' 80 'align' 'left' 'Style', 'pushbutton', 'string', g.helpbut, 'tag', 'help', 'callback', g.helpcom } {} }; + else + g.uilist = { g.uilist{:}, { 'width' 80 'align' 'left' 'Style', 'pushbutton', 'string', 'Help gui', 'callback', g.helpcom{1} } }; + g.uilist = { g.uilist{:}, { 'width' 80 'align' 'left' 'Style', 'pushbutton', 'string', 'More help', 'callback', g.helpcom{2} } }; + end; + else + g.uilist = { g.uilist{:}, {} {} }; + end; + g.uilist = { g.uilist{:}, { 'width' 80 'align' 'right' 'Style', 'pushbutton', 'string', 'Cancel', 'tag' 'cancel' 'callback', 'close gcbf' } }; + g.uilist = { g.uilist{:}, { 'width' 80 'align' 'right' 'stickto' 'on' 'Style', 'pushbutton', 'tag', 'ok', 'string', 'OK', 'callback', 'set(gcbo, ''userdata'', ''retuninginputui'');' } }; + end; + + % add the three buttons (CANCEL HELP OK) at the bottom of the GUI + % --------------------------------------------------------------- + if ~isempty(g.geom) + [tmp tmp2 allobj] = supergui( 'fig', fig, 'minwidth', g.minwidth, 'geom', g.geom, 'uilist', g.uilist, 'screenpos', g.screenpos ); + elseif isempty(g.geomvert) + [tmp tmp2 allobj] = supergui( 'fig', fig, 'minwidth', g.minwidth, 'geomhoriz', g.geometry, 'uilist', g.uilist, 'screenpos', g.screenpos ); + else + if strcmpi(g.skipline, 'on'), g.geomvert = [g.geomvert(:)' 1]; end; + if strcmpi(g.addbuttons, 'on'),g.geomvert = [g.geomvert(:)' 1]; end; + [tmp tmp2 allobj] = supergui( 'fig', fig, 'minwidth', g.minwidth, 'geomhoriz', g.geometry, 'uilist', g.uilist, 'screenpos', g.screenpos, 'geomvert', g.geomvert(:)' ); + end; + else + fig = g.mode; + set(findobj('parent', fig, 'tag', 'ok'), 'userdata', []); + allobj = findobj('parent',fig); + allobj = allobj(end:-1:1); + end; + + % evaluate command before waiting? + % -------------------------------- + if ~isempty(g.eval), eval(g.eval); end; + + % create figure and wait for return + % --------------------------------- + if isstr(g.mode) & (strcmpi(g.mode, 'plot') | strcmpi(g.mode, 'return') ) + if strcmpi(g.mode, 'plot') + return; % only plot and returns + end; + else + waitfor( findobj('parent', fig, 'tag', 'ok'), 'userdata'); + end; +else + fig = g.getresult; + allobj = findobj('parent',fig); + allobj = allobj(end:-1:1); +end; + +result = {}; +userdat = []; +strhalt = ''; +resstruct = []; + +% Check if figure still exist (RMC) % try, findobj(fig);catch, return; end; + if ~(ishandle(fig)) + return; + end + +strhalt = get(findobj('parent', fig, 'tag', 'ok'), 'userdata'); + +% output parameters +% ----------------- +counter = 1; +resstruct = []; +for index=1:length(allobj) + if isnumeric(allobj), currentobj = allobj(index); + else currentobj = allobj{index}; + end; + if isnumeric(currentobj) | ~isprop(currentobj,'GetPropertySpecification') % To allow new object handles + try, + objstyle = get(currentobj, 'style'); + switch lower( objstyle ) + case { 'listbox', 'checkbox', 'radiobutton' 'popupmenu' 'radio' } + result{counter} = get( currentobj, 'value'); + if ~isempty(get(currentobj, 'tag')), resstruct = setfield(resstruct, get(currentobj, 'tag'), result{counter}); end; + counter = counter+1; + case 'edit' + result{counter} = get( currentobj, 'string'); + if ~isempty(get(currentobj, 'tag')), resstruct = setfield(resstruct, get(currentobj, 'tag'), result{counter}); end; + counter = counter+1; + end; + catch, end; + else + ps = currentobj.GetPropertySpecification; + result{counter} = arg_tovals(ps,false); + count = 1; + while isfield(resstruct, ['propgrid' int2str(count)]) + count = count + 1; + end; + resstruct = setfield(resstruct, ['propgrid' int2str(count)], arg_tovals(ps,false)); + end; +end; +userdat = get(fig, 'userdata'); +% if nargout >= 4 +% resstruct = myguihandles(fig, g); +% end; + +if isempty(g.getresult) && isstr(g.mode) && ( strcmp(g.mode, 'normal') || strcmp(g.mode, 'return') ) + close(fig); +end; +drawnow; % for windows + +% function for gui res (deprecated) +% -------------------- +% function g = myguihandles(fig, g) +% h = findobj('parent', fig); +% if ~isempty(get(h(index), 'tag')) +% try, +% switch get(h(index), 'style') +% case 'edit', g = setfield(g, get(h(index), 'tag'), get(h(index), 'string')); +% case { 'value' 'radio' 'checkbox' 'listbox' 'popupmenu' 'radiobutton' }, ... +% g = setfield(g, get(h(index), 'tag'), get(h(index), 'value')); +% end; +% catch, end; +% end; diff --git a/code/eeglab13_4_4b/functions/guifunc/listdlg2.m b/code/eeglab13_4_4b/functions/guifunc/listdlg2.m new file mode 100644 index 0000000..daa9100 --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/listdlg2.m @@ -0,0 +1,118 @@ +% listdlg2() - listdlg function clone with coloring and help for +% eeglab(). +% +% Usage: same as listdlg() +% +% Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 16 August 2002 +% +% See also: inputdlg2(), errordlg2(), supergui(), inputgui() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [vals, okornot, strval] = listdlg2(varargin); + +if nargin < 2 + help listdlg2; + return; +end; +for index = 1:length(varargin) + if iscell(varargin{index}), varargin{index} = { varargin{index} }; end; + if isstr(varargin{index}), varargin{index} = lower(varargin{index}); end; +end; +g = struct(varargin{:}); + +try, g.promptstring; catch, g.promptstring = ''; end; +try, g.liststring; catch, error('''liststring'' must be defined'); end; +try, g.selectionmode; catch, g.selectionmode = 'multiple'; end; +try, g.listsize; catch, g.listsize = []; end; +try, g.initialvalue; catch, g.initialvalue = []; end; +try, g.name; catch, g.name = ''; end; + +fig = figure('visible', 'off'); +set(gcf, 'name', g.name); +if isstr(g.liststring) + allstr = g.liststring; +else + allstr = ''; + for index = 1:length(g.liststring) + allstr = [ allstr '|' g.liststring{index} ]; + end; + allstr = allstr(2:end); +end; + +geometry = {[1] [1 1]}; +geomvert = [min(length(g.liststring), 10) 1]; +if ~strcmpi(g.selectionmode, 'multiple') | ... + (iscell(g.liststring) & length(g.liststring) == 1) | ... + (isstr (g.liststring) & size (g.liststring,1) == 1 & isempty(find(g.liststring == '|'))) + if isempty(g.initialvalue), g.initialvalue = 1; end; + minval = 1; + maxval = 1; +else + minval = 0; + maxval = 2; +end; +listui = {{ 'Style', 'listbox', 'tag', 'listboxvals', 'string', allstr, 'max', maxval, 'min', minval } ... + { 'Style', 'pushbutton', 'string', 'Cancel', 'callback', ['set(gcbf, ''userdata'', ''cancel'');'] } ... + { 'Style', 'pushbutton', 'string', 'Ok' , 'callback', ['set(gcbf, ''userdata'', ''ok'');'] } }; + +if ~isempty(g.promptstring) + geometry = {[1] geometry{:}}; + geomvert = [1 geomvert]; + listui = { { 'Style', 'text', 'string', g.promptstring } listui{:}}; +end; +[tmp tmp2 allobj] = supergui( fig, geometry, geomvert, listui{:} ); + +% assign value to listbox +% must be done after creating it +% ------------------------------ +lstbox = findobj(fig, 'tag', 'listboxvals'); +set(lstbox, 'value', g.initialvalue); + +if ~isempty(g.listsize) + pos = get(gcf, 'position'); + set(gcf, 'position', [ pos(1:2) g.listsize]); +end; +h = findobj( 'parent', fig, 'tag', 'listboxvals'); + +okornot = 0; +strval = ''; +vals = []; +figure(fig); +drawnow; +waitfor( fig, 'userdata'); +try, + vals = get(h, 'value'); + strval = ''; + if iscell(g.liststring) + for index = vals + strval = [ strval ' ' g.liststring{index} ]; + end; + else + for index = vals + strval = [ strval ' ' g.liststring(index,:) ]; + end; + end; + strval = strval(2:end); + if strcmp(get(fig, 'userdata'), 'cancel') + okornot = 0; + else + okornot = 1; + end; + close(fig); + drawnow; +end; diff --git a/code/eeglab13_4_4b/functions/guifunc/pophelp.m b/code/eeglab13_4_4b/functions/guifunc/pophelp.m new file mode 100644 index 0000000..236a9e9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/pophelp.m @@ -0,0 +1,134 @@ +% pophelp() - Same as matlab HTHELP but does not crash under windows. +% +% Usage: >> pophelp( function ); +% >> pophelp( function, nonmatlab ); +% +% Inputs: +% function - string for a Matlab function name +% (with or without the '.m' extension). +% nonmatlab - [0|1], 1 the file is not a Matlab file +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function pophelp( funct, nonmatlab ); + +if nargin <1 + help pophelp; + return; +end; +if nargin <2 + nonmatlab = 0; +end; + +if exist('help2html') + if length(funct) > 3 && strcmpi(funct(end-3:end), '.txt') + web(funct); + else + pathHelpHTML = fileparts(which('help2html')); + if ~isempty(findstr('NFT', pathHelpHTML)), rmpath(pathHelpHTML); end; + text1 = help2html(funct); + if length(funct) > 4 & strcmpi(funct(1:4), 'pop_') + try, + text2 = help2html(funct(5:end)); + text1 = [text1 '
___________________________________________________________________' 10 ...
+                               ' ' 10 ...
+                               ' The ''pop'' function above calls the eponymous Matlab function below' 10 ...
+                               ' and could use some of its optional parameters' 10 ...
+                               '___________________________________________________________________


' text2 ]; + catch, end; + end; + + web([ 'text://' text1 ]); + end; +else + if isempty(funct), return; end; + doc1 = readfunc(funct, nonmatlab); + if length(funct) > 4 & strcmpi(funct(1:4), 'pop_') + try, + doc2 = readfunc(funct(5:end), nonmatlab); + doc1 = { doc1{:} ' _________________________________________________________________ ' ... + ' ' ... + ' The ''pop'' function above calls the eponymous Matlab function below, ' ... + ' which may contain more information for some parameters. '... + ' ' ... + ' _________________________________________________________________ ' ... + ' ' ... + doc2{:} }; + catch, end; + end; + + textgui(doc1);1000 + h = findobj('parent', gcf, 'style', 'slider'); + try, icadefs; catch, + GUIBUTTONCOLOR = [0.8 0.8 0.8]; + GUITEXTCOLOR = 'k'; + end; + set(h, 'backgroundcolor', GUIBUTTONCOLOR); + h = findobj('parent', gcf, 'style', 'pushbutton'); + set(h, 'backgroundcolor', GUIBUTTONCOLOR); + h = findobj('parent', gca); + set(h, 'color', GUITEXTCOLOR); + set(gcf, 'color', BACKCOLOR); +end; +return; + +function [doc] = readfunc(funct, nonmatlab) + +doc = {}; +if iseeglabdeployed + if isempty(find(funct == '.')), funct = [ funct '.m' ]; end; + funct = fullfile(eeglabexefolder, 'help', funct); +end; +if nonmatlab + fid = fopen( funct, 'r'); +else + if findstr( funct, '.m') + fid = fopen( funct, 'r'); + else + fid = fopen( [funct '.m'], 'r'); + end; +end; + +if fid == -1 + error('File not found'); +end; + +sub = 1; +try, + if ~isunix, sub = 0; end; +catch, end; + +if nonmatlab + str = fgets( fid ); + while ~feof(fid) + str = deblank(str(1:end-sub)); + doc = { doc{:} str(1:end) }; + str = fgets( fid ); + end; +else + str = fgets( fid ); + while (str(1) == '%') + str = deblank(str(1:end-sub)); + doc = { doc{:} str(2:end) }; + str = fgets( fid ); + end; +end; +fclose(fid); diff --git a/code/eeglab13_4_4b/functions/guifunc/questdlg2.m b/code/eeglab13_4_4b/functions/guifunc/questdlg2.m new file mode 100644 index 0000000..f81647b --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/questdlg2.m @@ -0,0 +1,91 @@ +% questdlg2() - questdlg function clone with coloring and help for +% eeglab(). +% +% Usage: same as questdlg() +% +% Warning: +% Case of button text and result might be changed by the function +% +% Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 11 August 2002 +% +% See also: inputdlg2(), errordlg2(), supergui(), inputgui() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [result] = questdlg2(Prompt,Title,varargin); + +result = ''; +if nargin < 2 + help questdlg2; + return; +end; +if isempty(varargin) + varargin = { 'Yes' 'No' 'Cancel' 'Yes' }; +end; +result = varargin{end}; +if Prompt(end) == 10, Prompt(end) = []; end; +if Prompt(end) == 10, Prompt(end) = []; end; +if Prompt(end) == 10, Prompt(end) = []; end; +if Prompt(end) == 10, Prompt(end) = []; end; + +fig = figure('visible', 'off'); +set(gcf, 'name', Title); + +listui = {}; +geometry = {}; +if ~isempty(find(Prompt == 10)) + indlines = find(Prompt == 10); + if indlines(1) ~= 1, indlines = [ 0 indlines ]; end; + if indlines(end) ~= length(Prompt), indlines = [ indlines length(Prompt)+1 ]; end; + for index = 1:length(indlines)-1 + geometry{index} = [1]; + listui{index} = { 'Style', 'text', 'string' Prompt(indlines(index)+1:indlines(index+1)-1) }; + end; +else + for index = 1:size(Prompt,1) + geometry{index} = [1]; + listui{index} = { 'Style', 'text', 'string' Prompt(index,:) }; + end; +end; +listui{end+1} = {}; + +geometry = { geometry{:} 1 ones(1,length(varargin)-1) }; +for index = 1:length(varargin)-1 % ignoring default val + listui = {listui{:} { 'width',80,'align','center','Style', 'pushbutton', 'string', varargin{index}, 'callback', ['set(gcbf, ''userdata'', ''' varargin{index} ''');'] } }; + if strcmp(varargin{index}, varargin{end}) + listui{end}{end+1} = 'fontweight'; + listui{end}{end+1} = 'bold'; + end; +end; + +%cr = length(find(Prompt == char(10)))+1; +%if cr == 1 +% cr = size(Prompt,1); +%end; +%cr = cr^(7/); +%if cr >= 8, cr = cr-1; end; +%if cr >= 4, cr = cr-1; end; +%[tmp tmp2 allobj] = supergui( 'fig', fig, 'geomhoriz', geometry, 'geomvert', [cr 1 1], 'uilist', listui, ... +[tmp tmp2 allobj] = supergui( 'fig', fig, 'geomhoriz', geometry, 'uilist', listui, ... + 'borders', [0.02 0.015 0.08 0.06], 'spacing', [0 0], 'horizontalalignment', 'left', 'adjustbuttonwidth', 'on' ); + +waitfor( fig, 'userdata'); +try, + result = get(fig, 'userdata'); + close(fig); + drawnow; +end; diff --git a/code/eeglab13_4_4b/functions/guifunc/supergui.m b/code/eeglab13_4_4b/functions/guifunc/supergui.m new file mode 100644 index 0000000..718ea01 --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/supergui.m @@ -0,0 +1,529 @@ +% supergui() - a comprehensive gui automatic builder. This function help +% to create GUI very fast without bothering about the +% positions of the elements. After creating a geometry, +% elements just place themselves into the predefined +% locations. It is especially usefull for figure where you +% intend to put text button and descriptions. +% +% Usage: +% >> [handles, height, allhandles ] = ... +% supergui( 'key1', 'val1', 'key2', 'val2', ... ); +% +% Inputs: +% 'fig' - figure handler, if not given, create a new figure. +% 'geom' - cell array of cell array of integer vector. Each cell +% array defines the coordinate of a given input in the following +% manner: { nb_row nb_col [x_topcorner y_topcorner] +% [x_bottomcorner y_bottomcorner] }; +% 'geomhoriz' - integer vector or cell array of numerical vectors describing the +% geometry of the elements in the figure. +% - if integer vector, vector length is the number of rows and vector +% values are the number of 'uilist' elements in each row. +% For example, [2 3 2] means that the +% figures will have 3 rows, with 2 elements in the first +% and last row and 3 elements in the second row. +% - if cell array, each vector describes the relative widths +% of items in each row. For example, { [2 8] [1 2 3] } which means +% that figures will have 2 rows, the first one with 2 +% elements of relative width 2 and 8 (20% and 80%). The +% second row will have 3 elements of relative size 1, 2 +% and 3 (1/6 2/6 and 3/6). +% 'geomvert' - describting geometry for the rows. For instance +% [1 2 1] means that the second row will be twice the height +% of the other ones. If [], all the lines have the same height. +% 'uilist' - list of uicontrol lists describing elements properties +% { { ui1 }, { ui2 }... }, { 'uiX' } being GUI matlab +% uicontrol arguments such as { 'style', 'radiobutton', +% 'String', 'hello' }. See Matlab function uicontrol() for details. +% 'borders' - [left right top bottom] GUI internal borders in normalized +% units (0 to 1). Default values are +% 'title' - optional figure title +% 'userdata' - optional userdata input for the figure +% 'inseth' - horizontal space between elements. Default is 2% +% of window size. +% 'insetv' - vertical space between elements. Default is 2% +% of window height. +% 'spacing' - [horiz vert] spacing in normalized units. Default +% 'spacingtype' - ['absolute'|'proportional'] abolute means that the +% spacing values are fixed. Proportional means that they +% depend on the number of element in a line. +% 'minwidth' - [integer] minimal width in pixels. Default is none. +% 'screenpos' - [x y] position of the right top corner of the graphic +% interface. 'center' may also be used to center the GUI on +% the screen. +% 'adjustbuttonwidth' - ['on'|'off'] adjust button width in the GUI. +% Default is 'off'. +% +% Hint: +% use 'print -mfile filemane' to save a matlab file of the figure. +% +% Output: +% handles - all the handles of the elements (in the same order as the +% uilist input). +% height - adviced height for the figure (so the text look nice). +% allhandles - all the handles in object format +% +% Example: +% figure; +% supergui( 'geomhoriz', { 1 1 }, 'uilist', { ... +% { 'style', 'radiobutton', 'string', 'radio' }, ... +% { 'style', 'pushbutton' , 'string', 'push' } } ); +% +% Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 2001- +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [handlers, outheight, allhandlers] = supergui( varargin); + +% handlers cell format +% allhandlers linear format +handlers = {}; +outheight = 0; + +if nargin < 2 + help supergui; + return; +end; + +% get version and +% set additional parameters +% ------------------------- +v = version; +indDot = find(v == '.'); +versnum = str2num(v(1:indDot(2)-1)); +if versnum >= 7.14 + addParamFont = { 'fontsize' 12 }; +else addParamFont = { }; +end; + +warning off MATLAB:hg:uicontrol:ParameterValuesMustBeValid + +% decoding input and backward compatibility +% ----------------------------------------- +if isstr(varargin{1}) + options = varargin; +else + options = { 'fig' varargin{1} 'geomhoriz' varargin{2} ... + 'geomvert' varargin{3} 'uilist' varargin(4:end) }; +end +g = finputcheck(options, { 'geomhoriz' 'cell' [] {}; + 'fig' '' [] 0; + 'geom' 'cell' [] {}; + 'uilist' 'cell' [] {}; + 'title' 'string' [] ''; + 'userdata' '' [] []; + 'adjustbuttonwidth' 'string' { 'on' 'off' } 'off'; + 'geomvert' 'real' [] []; + 'screenpos' { 'real' 'string' } [] []; + 'horizontalalignment' 'string' { 'left','right','center' } 'left'; + 'minwidth' 'real' [] 10; + 'borders' 'real' [] [0.05 0.04 0.07 0.06]; + 'spacing' 'real' [] [0.02 0.01]; + 'inseth' 'real' [] 0.02; % x border absolute (5% of width) + 'insetv' 'real' [] 0.02 }, 'supergui'); +if isstr(g), error(g); end +if ~isempty(g.geomhoriz) + maxcount = sum(cellfun('length', g.geomhoriz)); + if maxcount ~= length(g.uilist) + warning('Wrong size for ''geomhoriz'' input'); + end; + if ~isempty(g.geomvert) + if length(g.geomvert) ~= length(g.geomhoriz) + warning('Wrong size for ''geomvert'' input'); + end; + end; + g.insetv = g.insetv/length(g.geomhoriz); +end; +if ~isempty(g.geom) + if length(g.geom) ~= length(g.uilist) + warning('Wrong size for ''geom'' input'); + end; + maxcount = length(g.geom); +end; + +% create new figure +% ----------------- +if g.fig == 0 + g.fig = figure('visible','off'); +end + +% converting the geometry formats +% ------------------------------- +if ~isempty(g.geomhoriz) & ~iscell( g.geomhoriz ) + oldgeom = g.geomhoriz; + g.geomhoriz = {}; + for row = 1:length(oldgeom) + g.geomhoriz = { g.geomhoriz{:} ones(1, oldgeom(row)) }; + end; +end +if isempty(g.geomvert) + g.geomvert = ones(1, length(g.geomhoriz)); +end + +% converting to the new format +% ---------------------------- +if isempty(g.geom) + count = 1; + incy = 0; + sumvert = sum(g.geomvert); + maxhoriz = 1; + for row = 1:length(g.geomhoriz) + incx = 0; + maxhoriz = max(maxhoriz, length(g.geomhoriz{row})); + ratio = length(g.geomhoriz{row})/sum(g.geomhoriz{row}); + for column = 1:length(g.geomhoriz{row}) + g.geom{count} = { length(g.geomhoriz{row}) sumvert [incx incy] [g.geomhoriz{row}(column)*ratio g.geomvert(row)] }; + incx = incx+g.geomhoriz{row}(column)*ratio; + count = count+1; + end; + incy = incy+g.geomvert(row); + end; + g.borders(1:2) = g.borders(1:2)/maxhoriz*5; + g.borders(3:4) = g.borders(3:4)/sumvert*10; + g.spacing(1) = g.spacing(1)/maxhoriz*5; + g.spacing(2) = g.spacing(2)/sumvert*10; +end; + +% disp new geometry +% ----------------- +if 0 + fprintf('{ ...\n'); + for index = 1:length(g.geom) + fprintf('{ %g %g [%g %g] [%g %g] } ...\n', g.geom{index}{1}, g.geom{index}{2}, ... + g.geom{index}{3}(1), g.geom{index}{3}(2), g.geom{index}{4}(1), g.geom{index}{3}(2)); + end; + fprintf('};\n'); +end; + +% get axis coordinates +% -------------------- +try + set(g.fig, 'menubar', 'none', 'numbertitle', 'off'); +catch +end + +pos = [0 0 1 1]; % plot relative to current axes +q = [pos(1) pos(2) 0 0]; +s = [pos(3) pos(4) pos(3) pos(4)]; % allow to use normalized position [0 100] for x and y +axis('off'); + +% creating guis +% ------------- +row = 1; % count the elements +column = 1; % count the elements +factmultx = 0; +factmulty = 0; %zeros(length(g.geomhoriz)); +for counter = 1:maxcount + + % init + clear rowhandle; + gm = g.geom{counter}; + [posx posy width height] = getcoord(gm{1}, gm{2}, gm{3}, gm{4}, g.borders, g.spacing); + + try + currentelem = g.uilist{ counter }; + catch + fprintf('Warning: not all boxes were filled\n'); + return; + end; + if ~isempty(currentelem) + % decode metadata + % --------------- + if strcmpi(currentelem{1}, 'link2lines'), + currentelem(1) = []; + hf1 = 3.6/2-0.3; + hf2 = 0.7/2-0.3; + allhandlers{counter} = uicontrol(g.fig, 'unit', 'normalized', 'position', ... + [posx-width/2 posy+hf1*height width/2 0.005].*s+q, 'style', 'pushbutton', 'string', ''); + allhandlers{counter} = uicontrol(g.fig, 'unit', 'normalized', 'position', ... + [posx-width/2 posy+hf2*height width/2 0.005].*s+q, 'style', 'pushbutton', 'string', ''); + allhandlers{counter} = uicontrol(g.fig, 'unit', 'normalized', 'position', ... + [posx posy+hf2*height 0.005 (hf1-hf2+0.1)*height].*s+q, 'style', 'pushbutton', 'string', ''); + allhandlers{counter} = uicontrol(g.fig, 'unit', 'normalized', 'position', ... + [posx posy+(hf1+hf2)/2*height width/2 0.005].*s+q, 'style', 'pushbutton', 'string', ''); + allhandlers{counter} = 0; + else + if strcmpi(currentelem{1}, 'width'), + curwidth = currentelem{2}; + currentelem(1:2) = []; + else curwidth = 0; + end; + if strcmpi(currentelem{1}, 'align'), + align = currentelem{2}; + currentelem(1:2) = []; + else align = 'right'; + end; + if strcmpi(currentelem{1}, 'stickto'), + stickto = currentelem{2}; + currentelem(1:2) = []; + else stickto = 'none'; + end; + if strcmpi(currentelem{1}, 'vertshift'), currentelem(1) = []; addvert = -height/2; + else addvert = 0; + end; + if strcmpi(currentelem{1}, 'vertexpand'), heightfactor = currentelem{2}; addvert = -(heightfactor-1)*height; currentelem(1:2) = []; + else heightfactor = 1; + end; + + % position adjustment depending on GUI type + if isstr(currentelem{2}) && strcmpi(currentelem{2}, 'popupmenu') + posy = posy-height/10; + end; + if isstr(currentelem{2}) && strcmpi(currentelem{2}, 'text') + posy = posy+height/5; + end; + + if strcmpi(currentelem{1}, 'function'), + % property grid argument + panel = uipanel('Title','','FontSize',12,'BackgroundColor','white','Position',[posx posy+addvert width height*heightfactor].*s+q); + allhandlers{counter} = arg_guipanel(panel, currentelem{:}); + else + allhandlers{counter} = uicontrol(g.fig, 'unit', 'normalized', 'position', ... + [posx posy+addvert width height*heightfactor].*s+q, currentelem{:}, addParamFont{:}); + + % this simply compute a factor so that all uicontrol will be visible + % ------------------------------------------------------------------ + style = get( allhandlers{counter}, 'style'); + set( allhandlers{counter}, 'units', 'pixels'); + curpos = get(allhandlers{counter}, 'position'); + curext = get(allhandlers{counter}, 'extent'); + if curwidth ~= 0 + curwidth = curwidth/((factmultx-1)/1.85+1); + if strcmpi(align, 'right') + curpos(1) = curpos(1)+curpos(3)-curwidth; + elseif strcmpi(align, 'center') + curpos(1) = curpos(1)+curpos(3)/2-curwidth/2; + end; + set(allhandlers{counter}, 'position', [ curpos(1) curpos(2) curwidth curpos(4) ]); + if strcmpi(stickto, 'on') + set( allhandlers{counter-1}, 'units', 'pixels'); + curpos2 = get(allhandlers{counter-1}, 'position'); + set(allhandlers{counter-1}, 'position', [ curpos(1)-curpos2(3)-10 curpos2(2) curpos2(3) curpos2(4) ]); + set( allhandlers{counter-1}, 'units', 'normalized'); + end; + curext(3) = curwidth; + end; + set( allhandlers{counter}, 'units', 'normalized'); + end; + + if ~strcmp(style, 'edit') && (~strcmp(style, 'pushbutton') || strcmpi(g.adjustbuttonwidth, 'on')) + %tmp = curext(3)/curpos(3); + %if tmp > 3*factmultx && factmultx > 0, adsfasd; end; + factmultx = max(factmultx, curext(3)/curpos(3)); + if strcmp(style, 'pushbutton'), factmultx = factmultx*1.1; end; + end; + if ~strcmp(style, 'listbox') + factmulty = max(factmulty, curext(4)/curpos(4)); + end; + + % Uniformize button text aspect (first letter must be upercase) + % ----------------------------- + if strcmp(style, 'pushbutton') + tmptext = get(allhandlers{counter}, 'string'); + if length(tmptext) > 1 + if upper(tmptext(1)) ~= tmptext(1) || lower(tmptext(2)) ~= tmptext(2) && ~strcmpi(tmptext, 'STATS') + tmptext = lower(tmptext); + try, tmptext(1) = upper(tmptext(1)); catch, end; + end; + end; + set(allhandlers{counter}, 'string', tmptext); + end; + end; + else + allhandlers{counter} = 0; + end; +end; + +% adjustments +% ----------- +factmultx = factmultx*1.02;% because some text was still hidden +%factmultx = factmultx*1.2; +if factmultx < 0.1 + factmultx = 0.1; +end; + +% for MAC (magnify figures that have edit fields) +% ------- +warning off; +try, + comp = computer; + if length(comp) > 2 && strcmpi(comp(1:3), 'MAC') + factmulty = factmulty*1.5; + elseif ~isunix % windows + factmulty = factmulty*1.08; + end; +catch, end; +factmulty = factmulty*0.9; % global shinking +warning on; + +% scale and replace the figure in the screen +% ----------------------------------------- +pos = get(g.fig, 'position'); +if factmulty > 1 + pos(2) = max(0,pos(2)+pos(4)-pos(4)*factmulty); +end; +pos(1) = pos(1)+pos(3)*(1-factmultx)/2; +pos(3) = max(pos(3)*factmultx, g.minwidth); +pos(4) = pos(4)*factmulty; +set(g.fig, 'position', pos); + +% vertical alignment to bottom for text (isnumeric by ishanlde was changed here) +% --------------------------------------- +for index = 1:length(allhandlers) + if allhandlers{index} ~= 0 && ishandle(allhandlers{index}) + if strcmp(get(allhandlers{index}, 'style'), 'text') + set(allhandlers{index}, 'unit', 'pixel'); + curpos = get(allhandlers{index}, 'position'); + curext = get(allhandlers{index}, 'extent'); + set(allhandlers{index}, 'position', [curpos(1) curpos(2)-4 curpos(3) curext(4)]); + set(allhandlers{index}, 'unit', 'normalized'); + end; + end; +end; + +% setting defaults colors +%------------------------ +try, icadefs; +catch, + GUIBACKCOLOR = [.8 .8 .8]; + GUIPOPBUTTONCOLOR = [.8 .8 .8]; + GUITEXTCOLOR = [0 0 0]; +end; + +numobjects = cellfun(@ishandle, allhandlers); % (isnumeric by ishanlde was changed here) +allhandlersnum = [ allhandlers{numobjects} ]; +hh = findobj(allhandlersnum, 'parent', g.fig, 'style', 'text'); +%set(hh, 'BackgroundColor', get(g.fig, 'color'), 'horizontalalignment', 'left'); +set(hh, 'Backgroundcolor', GUIBACKCOLOR); +set(hh, 'foregroundcolor', GUITEXTCOLOR); +try +set(g.fig, 'color',GUIBACKCOLOR ); +catch +end +set(hh, 'horizontalalignment', g.horizontalalignment); + +hh = findobj(allhandlersnum, 'style', 'edit'); +set(hh, 'BackgroundColor', [1 1 1]); %, 'horizontalalignment', 'right'); + +hh =findobj(allhandlersnum, 'parent', g.fig, 'style', 'pushbutton'); +comp = computer; +if length(comp) < 3 || ~strcmpi(comp(1:3), 'MAC') % this puts the wrong background on macs + set(hh, 'backgroundcolor', GUIPOPBUTTONCOLOR); + set(hh, 'foregroundcolor', GUITEXTCOLOR); +end; +hh =findobj(allhandlersnum, 'parent', g.fig, 'style', 'popupmenu'); +set(hh, 'backgroundcolor', GUIPOPBUTTONCOLOR); +set(hh, 'foregroundcolor', GUITEXTCOLOR); +hh =findobj(allhandlersnum, 'parent', g.fig, 'style', 'checkbox'); +set(hh, 'backgroundcolor', GUIBACKCOLOR); +set(hh, 'foregroundcolor', GUITEXTCOLOR); +hh =findobj(allhandlersnum, 'parent', g.fig, 'style', 'listbox'); +set(hh, 'backgroundcolor', GUIPOPBUTTONCOLOR); +set(hh, 'foregroundcolor', GUITEXTCOLOR); +hh =findobj(allhandlersnum, 'parent', g.fig, 'style', 'radio'); +set(hh, 'foregroundcolor', GUITEXTCOLOR); +set(hh, 'backgroundcolor', GUIPOPBUTTONCOLOR); +set(g.fig, 'visible', 'on'); + +% screen position +% --------------- +if ~isempty(g.screenpos) + pos = get(g.fig, 'position'); + if isnumeric(g.screenpos) + set(g.fig, 'position', [ g.screenpos pos(3) pos(4)]); + else + screenSize = get(0, 'screensize'); + pos(1) = (screenSize(3)-pos(3))/2; + pos(2) = (screenSize(4)-pos(4))/2+pos(4); + set(g.fig, 'position', pos); + end; +end; + +% set userdata and title +% ---------------------- +if ~isempty(g.userdata), set(g.fig, 'userdata', g.userdata); end; +if ~isempty(g.title ), set(g.fig, 'name', g.title ); end; + +return; + +function [posx posy width height] = getcoord(geom1, geom2, coord1, sz, borders, spacing); + + coord2 = coord1+sz; + borders(1:2) = borders(1:2)-spacing(1); + borders(3:4) = borders(3:4)-spacing(2); + + % absolute positions + posx = coord1(1)/geom1; + posy = coord1(2)/geom2; + posx2 = coord2(1)/geom1; + posy2 = coord2(2)/geom2; + width = posx2-posx; + height = posy2-posy; + + % add spacing + posx = posx+spacing(1)/2; + width = max(posx2-posx-spacing(1), 0.001); + height = max(posy2-posy-spacing(2), 0.001); + posy = max(0, 1-posy2)+spacing(2)/2; + + % add border + posx = posx*(1-borders(1)-borders(2))+borders(1); + posy = posy*(1-borders(3)-borders(4))+borders(4); + width = width*( 1-borders(1)-borders(2)); + height = height*(1-borders(3)-borders(4)); + +function [posx posy width height] = getcoordold(geom1, geom2, coord1, sz); + + coord2 = coord1+sz; + horiz_space = 0.05/geom1; + vert_space = 0.05/geom2; + horiz_border = min(0.1, 1/geom1)-horiz_space; + vert_border = min(0.2, 1.5/geom2)-vert_space; + + % absolute positions + posx = coord1(1)/geom1; + posy = coord1(2)/geom2; + posx2 = coord2(1)/geom1; + posy2 = coord2(2)/geom2; + width = posx2-posx; + height = posy2-posy; + + % add spacing + posx = posx+horiz_space/2; + width = max(posx2-posx-horiz_space, 0.001); + height = max(posy2-posy- vert_space, 0.001); + posy = max(0, 1-posy2)+vert_space/2; + + % add border + posx = posx*(1-horiz_border)+horiz_border/2; + posy = posy*(1- vert_border)+vert_border/2; + width = width*(1-horiz_border); + height = height*(1-vert_border); + + % posx = coord1(1)/geom1+horiz_border*1/geom1/2; +% posy = 1-(coord1(2)/geom2+vert_border*1/geom2/2)-1/geom2; +% +% posx2 = coord2(1)/geom1+horiz_border*1/geom1/2; +% posy2 = 1-(coord2(2)/geom2+vert_border*1/geom2/2)-1/geom2; +% +% width = posx2-posx; +% height = posy-posy2; + + %h = axes('unit', 'normalized', 'position', [ posx posy width height ]); + %h = axes('unit', 'normalized', 'position', [ coordx/geom1 1-coordy/geom2-1/geom2 1/geom1 1/geom2 ]); diff --git a/code/eeglab13_4_4b/functions/guifunc/warndlg2.m b/code/eeglab13_4_4b/functions/guifunc/warndlg2.m new file mode 100644 index 0000000..70f8f8a --- /dev/null +++ b/code/eeglab13_4_4b/functions/guifunc/warndlg2.m @@ -0,0 +1,28 @@ +% warndlg2() - same as warndlg for eeglab() +% +% Author: Arnaud Delorme, CNL / Salk Institute, 12 August 2002 +% +% See also: inputdlg2(), questdlg2() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function warndlg2(Prompt, Title); + +if nargin <2 + Title = 'Warning'; +end; +questdlg2(Prompt, Title, 'OK', 'OK'); diff --git a/code/eeglab13_4_4b/functions/javachatfunc/Chat_with_pane.jar b/code/eeglab13_4_4b/functions/javachatfunc/Chat_with_pane.jar new file mode 100644 index 0000000..423fef3 Binary files /dev/null and b/code/eeglab13_4_4b/functions/javachatfunc/Chat_with_pane.jar differ diff --git a/code/eeglab13_4_4b/functions/javachatfunc/startpane.m b/code/eeglab13_4_4b/functions/javachatfunc/startpane.m new file mode 100644 index 0000000..1bf214c --- /dev/null +++ b/code/eeglab13_4_4b/functions/javachatfunc/startpane.m @@ -0,0 +1,12 @@ +import client.EEGLABChat; +import client.VisualToolbar; +import java.awt.*; +import javax.swing.*; + +tb = VisualToolbar(); +F = gcf; +tb.setPreferredSize(Dimension(0, 75)); + +javacomponent(tb,'South',F); + +refresh(F); diff --git a/code/eeglab13_4_4b/functions/javachatfunc/update.m b/code/eeglab13_4_4b/functions/javachatfunc/update.m new file mode 100644 index 0000000..ee78d1d --- /dev/null +++ b/code/eeglab13_4_4b/functions/javachatfunc/update.m @@ -0,0 +1 @@ +tb.RefreshToolbar(); diff --git a/code/eeglab13_4_4b/functions/miscfunc/abspeak.m b/code/eeglab13_4_4b/functions/miscfunc/abspeak.m new file mode 100644 index 0000000..be5ae14 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/abspeak.m @@ -0,0 +1,69 @@ +% abspeak() - find peak amps/latencies in each row of a single-epoch data matrix +% +% Usage: +% >> [amps,frames,signs] = abspeak(data); +% >> [amps,frames,signs] = abspeak(data,frames); +% +% Inputs: +% data - single-epoch data matrix +% frames - frames per epoch in data {default|0 -> whole data} +% +% Outputs: +% amps - amplitude array +% frames - array of indexes +% sign - sign array +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 1998 + +% Copyright (C) 1998 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-9-98 added frames arg -sm +% 01-25-02 reformated help & license -ad + +function [amps,frames,signs]= abspeak(data,fepoch); + +if nargin < 1 + help abspeak + return +end + +[chans,ftot] = size(data); +if nargin < 2 + fepoch = 0; +end +if fepoch == 0 + fepoch = ftot; +end +epochs = floor(ftot/fepoch); +if fepoch*epochs ~= ftot + fprintf('abspeak(): frames arg does not divide data length.\n') + return +end + +amps = zeros(chans,epochs); +frames = zeros(chans,epochs); +signs = zeros(chans,epochs); + +for e=1:epochs + for c=1:chans + dat = abs(matsel(data,fepoch,0,c,e))'; + [sdat,si] = sort(dat); + amps(c,e) = dat(si(fepoch)); % abs value at peak + frames(c,e) = si(fepoch); % peak frame + signs(c,e) = sign(data(c,frames(c,e))); % sign at peak + end +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/arrow.m b/code/eeglab13_4_4b/functions/miscfunc/arrow.m new file mode 100644 index 0000000..bb16209 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/arrow.m @@ -0,0 +1,1191 @@ + +% arrow() - Draw a line with an arrowhead. +% +% Usage: +% >> arrow('Property1',PropVal1,'Property2',PropVal2,...) +% >> arrow(H,'Prop1',PropVal1,...) +% >> arrow(Start,Stop) +% >> arrow(Start,Stop,Length,BaseAngle,TipAngle,Width,Page,CrossDir) +% >> arrow demo %2-D demos of the capabilities of arrow() +% >> arrow demo2 %3-D demos of the capabilities of arrow() +% +% Inputs: +% H - vector of handles to previously created arrows and/or +% line objects, will update the previously-created +% arrows according to the current view and any specified +% properties, and will convert two-point line objects to +% corresponding arrows. Note that arrow(H) will update the +% arrows if the current view has changed. +% Start - vectors of length 2 or 3, or matrices with 2 or 3 columns +% Stop - same as Start +% 'Start' - The starting points. B +% 'Stop' - The end points. /|\ ^ +% 'Length' - Length of the arrowhead in pixels. /|||\ | +% 'BaseAngle' - Base angle in degrees (ADE). //|||\\ L| +% 'TipAngle' - Tip angle in degrees (ABC). ///|||\\\ e| +% 'Width' - Width of the base in pixels. ////|||\\\\ n| +% 'Page' - Use hardcopy proportions. /////|D|\\\\\ g| +% 'CrossDir' - Vector || to arrowhead plane. //// ||| \\\\ t| +% 'NormalDir' - Vector out of arrowhead plane. /// ||| \\\ h| +% 'Ends' - Which end has an arrowhead. //<----->|| \\ | +% 'ObjectHandles' - Vector of handles to update. / base ||| \ V +% 'LineStyle' - The linestyle of the arrow. E angle||<-------->C +% 'LineWidth' - Line thicknesses. |||tipangle +% 'FaceColor' - FaceColor of patch arrows. ||| +% 'EdgeColor' - EdgeColor/Color of patch/line arrows. ||| +% 'Color' - Set FaceColor & EdgeColor properties. -->|A|<-- width +% +% Notes: +% A property list can follow any specified normal argument list, e.g., +% ARROW([1 2 3],[0 0 0],36,'BaseAngle',60) creates an arrow from (1,2,3) to +% the origin, with an arrowhead of length 36 pixels and 60-degree base angle. +% +% The basic arguments or properties can generally be vectorized to create +% multiple arrows with the same call. This is done by passing a property +% with one row per arrow, or, if all arrows are to have the same property +% value, just one row may be specified. +% +% You may want to execute AXIS(AXIS) before calling ARROW so it doesn't change +% the axes on you; ARROW determines the sizes of arrow components BEFORE the +% arrow is plotted, so if ARROW changes axis limits, arrows may be malformed. +% +% ARROW uses features of Matlab 4.2c and later, so earlier versions may be +% incompatible; call ARROW VERSION for more details. +% +% Author: Erik A. Johnson , 1995 + +% Copyright (c)1995, Erik A. Johnson , 10/6/95 + +% Many thanks to Keith Rogers for his many excellent +% suggestions and beta testing. Check out his shareware package MATDRAW. +% He has permission to distribute ARROW with MATDRAW. + + +% $Log: arrow.m,v $ +% Revision 1.5 2009/10/20 22:19:56 dev +% +% added log to file +% + + +function [h,yy,zz] = arrow(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8, ... + arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16, ... + arg17,arg18,arg19,arg20,arg21,arg22,arg23,arg24) + +% Are we doing the demo? +c = sprintf('\n'); +if (nargin==1), + if (ischar(arg1)), + arg1 = lower([arg1 ' ']); + if (strcmp(arg1(1:4),'prop')), + disp([c ... + 'ARROW Properties: Default values are given in [square brackets], and other' c ... + ' acceptable equivalent property names are in (parenthesis).' c c ... + ' Start The starting points. For N arrows, B' c ... + ' this should be a Nx2 or Nx3 matrix. /|\ ^' c ... + ' Stop The end points. For N arrows, this /|||\ |' c ... + ' should be a Nx2 or Nx3 matrix. //|||\\ L|' c ... + ' Length Length of the arrowhead (in pixels on ///|||\\\ e|' c ... + ' screen, points on a page). [16] (Len) ////|||\\\\ n|' c ... + ' BaseAngle Angle (degrees) of the base angle /////|D|\\\\\ g|' c ... + ' ADE. For a simple stick arrow, use //// ||| \\\\ t|' c ... + ' BaseAngle=TipAngle. [90] (Base) /// ||| \\\ h|' c ... + ' TipAngle Angle (degrees) of tip angle ABC. //<----->|| \\ |' c ... + ' [16] (Tip) / base ||| \ V' c ... + ' Width Width of the base in pixels. Not E angle ||<-------->C' c ... + ' the ''LineWidth'' prop. [0] (Wid) |||tipangle' c ... + ' Page If provided, non-empty, and not NaN, |||' c ... + ' this causes ARROW to use hardcopy |||' c ... + ' rather than onscreen proportions. A' c ... + ' This is important if screen aspect --> <-- width' c ... + ' ratio and hardcopy aspect ratio are ----CrossDir---->' c ... + ' vastly different. []' c... + ' CrossDir A vector giving the direction towards which the fletches' c ... + ' on the arrow should go. [computed such that it is perpen-' c ... + ' dicular to both the arrow direction and the view direction' c ... + ' (i.e., as if it was pasted on a normal 2-D graph)] (Note' c ... + ' that CrossDir is a vector; if an axis is plotted on a log' c ... + ' scale, then the corresponding component of CrossDir must' c ... + ' also be set appropriately, i.e., to 1 for no change in' c ... + ' that direction, >1 for a positive change, >0 and <1 for' c ... + ' negative change.)' c ... + ' NormalDir A vector normal to the fletch direction (CrossDir is then' c ... + ' computed by the vector cross product {Line}x{NormalDir}). []' c ... + ' Ends Set which end has an arrowhead. Valid values are ''none'',' c ... + ' ''stop'', ''start'', and ''both''. [''stop''] (End)' c... + ' ObjectHandles Vector of handles to previously-created arrows to be' c ... + ' updated or line objects to be converted to arrows.' c ... + ' [] (Object,Handle)' c ... + ' LineStyle The linestyle of the arrow. If anything other than ''-'',' c ... + ' the arrow will be drawn with a line object, otherwise it' c ... + ' will be drawn with a patch. [''-''] (LineS)' c ... + ' LineWidth Same as used in SET commands, but may be passed a vector' c ... + ' for multiple arrows. [default of the line or patch]' c ... + ' FaceColor Set the FaceColor of patch arrows. May be one of' c ... + ' ''ymcrgbwkfn'' (f=flat,n=none) or a column-vector colorspec' c ... + ' (or Nx3 matrix for N arrows). [1 1 1] (FaceC)' c ... + ' EdgeColor Set the EdgeColor of patch arrows and Color of line' c ... + ' arrows. [1 1 1] (EdgeC)' c ... + ' Color Sets both FaceColor and EdgeColor properties.' c ... + ' Included for compatibility with line objects.' c c ... + ' ARROW(''Start'',P,''Stop'',[]) or ARROW(''Start'',[],''Stop'',P), with size(P)=[N 3]' c ... + ' will create N-1 arrows, just like ARROW(''Start'',P1,''Stop'',P2), where' c c ... + ' / x1 y1 z1 \ / x1 y1 z1 \ / x2 y2 z2 \' c ... + ' | . . . | | . . . | | . . . |' c ... + ' P = | . . . | P1 = | . . . | P2 = | . . . |' c ... + ' | . . . | | . . . | | . . . |' c ... + ' \ xN yN zN / \ xN-1 yN-1 zN-1 / \ xN yN zN /' c]); + elseif (strcmp(arg1(1:4),'vers')), + disp([c ... + 'ARROW Version: There are two compatibility problems for ARROW in Matlab' c ... + ' versions earlier than 4.2c:' c c c ... + ' 1) In Matlab <4.2, the ''Tag'' property does not exist. ARROW uses this' c ... + ' ''Tag'' to identify arrow objects for subsequent calls to ARROW.' c c ... + ' Solution: (a) delete all instances of the string' c c ... + ' ,''Tag'',ArrowTag' c c ... + ' (b) and replace all instances of the string' c c ... + ' strcmp(get(oh,''Tag''),ArrowTag)' c c ... + ' with the string' c c ... + ' all(size(ud)==[1 15])' c c c ... + ' 2) In Matlab <4.2c, FINDOBJ is buggy (it can cause Matlab to crash if' c ... + ' more than 100 objects are returned). ARROW uses FINDOBJ to make sure' c ... + ' that any handles it receives are truly handles to existing objects.' c c ... + ' Solution: replace the line' c c ... + ' objs = findobj;' c c ... + ' with the lines' c c ... + ' objs=0; k=1;' c ... + ' while (k<=length(objs)),' c ... + ' objs = [objs; get(objs(k),''Children'')];' c ... + ' if (strcmp(get(objs(k),''Type''),''axes'')),' c ... + ' objs=[objs;get(objs(k),''XLabel''); ...' c ... + ' get(objs(k),''YLabel''); ...' c ... + ' get(objs(k),''ZLabel''); ...' c ... + ' get(objs(k),''Title'')];' c ... + ' end;' c ... + ' k=k+1;' c ... + ' end;' c c]); + elseif (strcmp(arg1(1:4),'demo')), + % demo + % create the data + [x,y,z] = peaks; + [ddd,iii]=max(z(:)); + axlim = [min(x(:)) max(x(:)) min(y(:)) max(y(:)) min(z(:)) max(z(:))]; + + % modify it by inserting some NaN's + [m,n] = size(z); + m = floor(m/2); + n = floor(n/2); + z(1:m,1:n) = NaN*ones(m,n); + + % graph it + clf('reset'); + hs=surf(x,y,z); + xlabel('x'); ylabel('y'); + + if (~strcmp(arg1(1:5),'demo2')), + % set the view + axis(axlim); + zlabel('z'); + %shading('interp'); set(hs,'EdgeColor','k'); + view(viewmtx(-37.5,30,20)); + title('Demo of the capabilities of the ARROW function in 3-D'); + + % Normal yellow arrow + h1 = arrow([axlim(1) axlim(4) 4],[-.8 1.2 4], ... + 'EdgeColor','y','FaceColor','y'); + + % Normal white arrow, clipped by the surface + h2 = arrow(axlim([1 4 6]),[0 2 4]); + t=text(-2.4,2.7,7.7,'arrow clipped by surf'); + + % Baseangle<90 + h3 = arrow([3 .125 3.5],[1.375 0.125 3.5],30,50); + t2=text(3.1,.125,3.5,'local maximum'); + + % Baseangle<90, fill and edge colors different + h4 = arrow(axlim(1:2:5)*.5,[0 0 0],36,60,25, ... + 'EdgeColor','b','FaceColor','c'); + t3=text(axlim(1)*.5,axlim(3)*.5,axlim(5)*.5-.75,'origin'); + set(t3,'HorizontalAlignment','center'); + + % Baseangle>90, black fill + h5 = arrow([-2.9 2.9 3],[-1.3 .4 3.2],30,120,[],6, ... + 'EdgeColor','r','FaceColor','k','LineWidth',2); + + % Baseangle>90, no fill + h6 = arrow([-2.9 2.9 1.3],[-1.3 .4 1.5],30,120,[],6, ... + 'EdgeColor','r','FaceColor','none','LineWidth',2); + + % Stick arrow + h7 = arrow([-1.6 -1.65 -6.5],[0 -1.65 -6.5],[],16,16); + t4=text(-1.5,-1.65,-7.25,'global mininum'); + set(t4,'HorizontalAlignment','center'); + + % Normal, black fill + h8 = arrow([-1.4 0 -7.2],[-1.4 0 -3],'FaceColor','k'); + t5=text(-1.5,0,-7.75,'local minimum'); + set(t5,'HorizontalAlignment','center'); + + % Gray fill, crossdir specified + h9 = arrow([-3 2.2 -6],[-3 2.2 -.05],36,[],27,6,[],[0 -1 0], ... + 'EdgeColor','w','FaceColor',.2*[1 1 1]); + + % a series of normal arrows, linearly spaced, crossdir specified + h10y=(0:4)'/3; + h10 = arrow([-3*ones(size(h10y)) h10y -6.5*ones(size(h10y))], ... + [-3*ones(size(h10y)) h10y -.05*ones(size(h10y))], ... + 12,[],[],[],[],[0 -1 0]); + + % a series of normal arrows, linearly spaced + h11x=(1:.33:2.8)'; + h11 = arrow([h11x -3*ones(size(h11x)) 6.5*ones(size(h11x))], ... + [h11x -3*ones(size(h11x)) -.05*ones(size(h11x))]); + + % series of black-filled arrows, radially oriented, crossdir specified + h12x=2; h12y=-3; h12z=axlim(5)/2; h12xr=1; h12zr=h12z; ir=.15;or=.81; + h12t=(0:11)'/6*pi; + h12 = arrow([h12x+h12xr*cos(h12t)*ir h12y*ones(size(h12t)) ... + h12z+h12zr*sin(h12t)*ir],[h12x+h12xr*cos(h12t)*or ... + h12y*ones(size(h12t)) h12z+h12zr*sin(h12t)*or], ... + 10,[],[],[],[], ... + [-h12xr*sin(h12t) zeros(size(h12t)) h12zr*cos(h12t)],... + 'FaceColor','none','EdgeColor','m'); + + % series of normal arrows, tangentially oriented, crossdir specified + or13=.91; h13t=(0:.5:12)'/6*pi; + h13 = arrow([h12x+h12xr*cos(h13t)*or13 ... + h12y*ones(size(h13t)) ... + h12z+h12zr*sin(h13t)*or13],[],6); + + % arrow with no line ==> oriented upwards + h14 = arrow([3 3 3],[3 3 3],30); + t6=text(3,3,3.6,'no line'); set(t6,'HorizontalAlignment','center'); + + % arrow with -- linestyle + h15 = arrow([-.5 -3 -3],[1 -3 -3],'LineStyle','--','EdgeColor','g'); + + if (nargout>=1), h=[h1;h2;h3;h4;h5;h6;h7;h8;h9;h10;h11;h12;h13;h14;h15]; end; + else, + set(hs,'YData',10.^get(hs,'YData')); + shading('interp'); + view(2); + title('Demo of the capabilities of the ARROW function in 2-D'); + hold on; [C,H]=contour(x,y,z,20); hold off; + for k=H', set(k,'ZData',(axlim(6)+1)*ones(size(get(k,'XData'))),... + 'YData',10.^get(k,'YData'),'Color','k'); end; + set(gca,'YScale','log'); + axis([axlim(1:2) 10.^axlim(3:4)]); + + % Normal yellow arrow + h1 = arrow([axlim(1) 10^axlim(4) axlim(6)+2],[x(iii) 10^y(iii) axlim(6)+2], ... + 'EdgeColor','y','FaceColor','y'); + + % three arrows with varying fill, width, and baseangle + h2 = arrow([-3 10^(-3) 10; -3 10^(-1.5) 10; -1.5 10^(-3) 10], ... + [-.03 10^(-.03) 10; -.03 10^(-1.5) 10; -1.5 10^(-.03) 10], ... + 24,[90;60;120],[],[0;0;4]); + set(h2(2),'EdgeColor','g','FaceColor','c'); + set(h2(3),'EdgeColor','m','FaceColor','r'); + if (nargout>=1), h=[h1;h2]; end; + end; + else, + error(['ARROW got an unknown single-argument string ''' deblank(arg1) '''.']); + end; + return; + end; +end; + +% Check # of arguments +if (nargin==0), help arrow ; return; +elseif (nargout>3), error('ARROW produces at most 3 output arguments.'); +end; + +% find first property number +firstprop = nargin+1; +if (nargin<=3), % to speed things up a bit + if (nargin==1), + elseif (ischar(arg1)), firstprop=1; + elseif (ischar(arg2)), firstprop=2; + elseif (nargin==3), + if (ischar(arg3)), firstprop=3; end; + end; +else, + for k=1:nargin, + curarg = eval(['arg' num2str(k)]); + if (ischar(curarg)), + firstprop = k; + break; + end; + end; +end; + +% check property list +if (firstprop<=nargin), + for k=firstprop:2:nargin, + curarg = eval(['arg' num2str(k)]); + if ((~ischar(curarg))|(min(size(curarg))~=1)), + error('ARROW requires that a property name be a single string.'); + end; + end; + if (rem(nargin-firstprop,2)~=1), + error(['ARROW requires that the property ''' eval(['arg' num2str(nargin)]) ... + ''' be paired with a property value.']); + end; +end; + +% default output +if (nargout>0), h=[]; end; +if (nargout>1), yy=[]; end; +if (nargout>2), zz=[]; end; + +% set values to empty matrices +start = []; +stop = []; +len = []; +baseangle = []; +tipangle = []; +wid = []; +page = []; +crossdir = []; +ends = []; +linewidth = []; +linestyle = []; +edgecolor = []; +facecolor = []; +ax = []; +oldh = []; +defstart = [NaN NaN NaN]; +defstop = [NaN NaN NaN]; +deflen = 16; +defbaseangle = 90; +deftipangle = 16; +defwid = 0; +defpage = 0; +defcrossdir = [NaN NaN NaN]; +defends = 1; +deflinewidth = NaN; +deflinestyle = '- '; +defedgecolor = [1 1 1]; +deffacecolor = [1 1 1]; +defoldh = []; + +% The 'Tag' we'll put on our arrows +ArrowTag = 'Arrow'; + +% check for oldstyle arguments +if (firstprop>2), + % if old style arguments, get them + if (firstprop==3), start=arg1; stop=arg2; + elseif (firstprop==4), start=arg1; stop=arg2; len=arg3(:); + elseif (firstprop==5), start=arg1; stop=arg2; len=arg3(:); baseangle=arg4(:); + elseif (firstprop==6), start=arg1; stop=arg2; len=arg3(:); baseangle=arg4(:); tipangle=arg5(:); + elseif (firstprop==7), start=arg1; stop=arg2; len=arg3(:); baseangle=arg4(:); tipangle=arg5(:); wid=arg6(:); + elseif (firstprop==8), start=arg1; stop=arg2; len=arg3(:); baseangle=arg4(:); tipangle=arg5(:); wid=arg6(:); page=arg7(:); + elseif (firstprop==9), start=arg1; stop=arg2; len=arg3(:); baseangle=arg4(:); tipangle=arg5(:); wid=arg6(:); page=arg7(:); crossdir=arg8; + else, error('ARROW takes at most 8 non-property arguments.'); + end; +elseif (firstprop==2), + % assume arg1 is a set of handles + oldh = arg1(:); +end; + +% parse property pairs +extraprops=char([]); +for k=firstprop:2:nargin, + prop = eval(['arg' num2str(k)]); + val = eval(['arg' num2str(k+1)]); + prop = [lower(prop(:)') ' ']; + if (all(prop(1:5)=='start')), start = val; + elseif (all(prop(1:4)=='stop')), stop = val; + elseif (all(prop(1:3)=='len')), len = val(:); + elseif (all(prop(1:4)=='base')), baseangle = val(:); + elseif (all(prop(1:3)=='tip')), tipangle = val(:); + elseif (all(prop(1:3)=='wid')), wid = val(:); + elseif (all(prop(1:4)=='page')), page = val; + elseif (all(prop(1:5)=='cross')), crossdir = val; + elseif (all(prop(1:4)=='norm')), if (ischar(val)), crossdir=val; else, crossdir=val*sqrt(-1); end; + elseif (all(prop(1:3)=='end')), ends = val; + elseif (all(prop(1:5)=='linew')), linewidth = val(:); + elseif (all(prop(1:5)=='lines')), linestyle = val; + elseif (all(prop(1:5)=='color')), edgecolor = val; facecolor=val; + elseif (all(prop(1:5)=='edgec')), edgecolor = val; + elseif (all(prop(1:5)=='facec')), facecolor = val; + elseif (all(prop(1:6)=='object')), oldh = val(:); + elseif (all(prop(1:6)=='handle')), oldh = val(:); + elseif (all(prop(1:5)=='userd')), %ignore it + else, extraprops=[extraprops ',arg' num2str(k) ',arg' num2str(k+1)]; + end; +end; + +% Check if we got 'default' values +if (ischar(start )), s=lower([start(:)' ' ']); if (all(s(1:3)=='def')), start = defstart; else, error(['ARROW does not recognize ''' start(:)' ''' as a valid ''Start'' string.']); end; end; +if (ischar(stop )), s=lower([stop(:)' ' ']); if (all(s(1:3)=='def')), stop = defstop; else, error(['ARROW does not recognize ''' stop(:)' ''' as a valid ''Stop'' string.']); end; end; +if (ischar(len )), s=lower([len(:)' ' ']); if (all(s(1:3)=='def')), len = deflen; else, error(['ARROW does not recognize ''' len(:)' ''' as a valid ''Length'' string.']); end; end; +if (ischar(baseangle )), s=lower([baseangle(:)' ' ']); if (all(s(1:3)=='def')), baseangle = defbaseangle; else, error(['ARROW does not recognize ''' baseangle(:)' ''' as a valid ''BaseAngle'' string.']); end; end; +if (ischar(tipangle )), s=lower([tipangle(:)' ' ']); if (all(s(1:3)=='def')), tipangle = deftipangle; else, error(['ARROW does not recognize ''' tipangle(:)' ''' as a valid ''TipAngle'' string.']); end; end; +if (ischar(wid )), s=lower([wid(:)' ' ']); if (all(s(1:3)=='def')), wid = defwid; else, error(['ARROW does not recognize ''' wid(:)' ''' as a valid ''Width'' string.']); end; end; +if (ischar(crossdir )), s=lower([crossdir(:)' ' ']); if (all(s(1:3)=='def')), crossdir = defcrossdir; else, error(['ARROW does not recognize ''' crossdir(:)' ''' as a valid ''CrossDir'' or ''NormalDir'' string.']); end; end; +if (ischar(page )), s=lower([page(:)' ' ']); if (all(s(1:3)=='def')), page = defpage; else, error(['ARROW does not recognize ''' page(:)' ''' as a valid ''Page'' string.']); end; end; +if (ischar(ends )), s=lower([ends(:)' ' ']); if (all(s(1:3)=='def')), ends = defends; end; end; +if (ischar(linewidth )), s=lower([linewidth(:)' ' ']); if (all(s(1:3)=='def')), linewidth = deflinewidth; else, error(['ARROW does not recognize ''' linewidth(:)' ''' as a valid ''LineWidth'' string.']); end; end; +if (ischar(linestyle )), s=lower([linestyle(:)' ' ']); if (all(s(1:3)=='def')), linestyle = deflinestyle; end; end; +if (ischar(edgecolor )), s=lower([edgecolor(:)' ' ']); if (all(s(1:3)=='def')), edgecolor = defedgecolor; end; end; +if (ischar(facecolor )), s=lower([facecolor(:)' ' ']); if (all(s(1:3)=='def')), facecolor = deffacecolor; end; end; +if (ischar(oldh )), s=lower([oldh(:)' ' ']); if (all(s(1:3)=='def')), oldh = []; else, error(['ARROW does not recognize ''' oldh(:)' ''' as a valid ''ObjectHandles'' string.']); end; end; + +% check transpose on arguments; convert strings to numbers +if (((size(start ,1)==2)|(size(start ,1)==3))&((size(start ,2)==1)|(size(start ,2)>3))), start = start'; end; +if (((size(stop ,1)==2)|(size(stop ,1)==3))&((size(stop ,2)==1)|(size(stop ,2)>3))), stop = stop'; end; +if (((size(crossdir,1)==2)|(size(crossdir,1)==3))&((size(crossdir,2)==1)|(size(crossdir,2)>3))), crossdir = crossdir'; end; +if ((size(linestyle,2)>2)&(size(linestyle,1)<=2)), linestyle=linestyle'; end; +if (all(size(edgecolor))), + if (ischar(edgecolor)), + col = lower(edgecolor(:,1)); + edgecolor = zeros(length(col),3); + ii=find(col=='y'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[1 1 0]; end; + ii=find(col=='m'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[1 0 1]; end; + ii=find(col=='c'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[0 1 1]; end; + ii=find(col=='r'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[1 0 0]; end; + ii=find(col=='g'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[0 1 0]; end; + ii=find(col=='b'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[0 0 1]; end; + ii=find(col=='w'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[1 1 1]; end; + ii=find(col=='k'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[0 0 0]; end; + ii=find(col=='f'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[1 1 1]*inf; end; + ii=find(col=='n'); if (all(size(ii))), edgecolor(ii,:)=ones(length(ii),1)*[1 1 1]*(-inf); end; + elseif ((size(edgecolor,2)~=3)&(size(edgecolor,1)==3)), + edgecolor=edgecolor'; + elseif (size(edgecolor,2)~=3), + error('ARROW requires that color specifications must be a ?x3 RGB matrix.'); + end; +end; +if (all(size(facecolor))), + if (ischar(facecolor)), + col = lower(facecolor(:,1)); + facecolor = zeros(length(col),3); + ii=find(col=='y'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[1 1 0]; end; + ii=find(col=='m'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[1 0 1]; end; + ii=find(col=='c'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[0 1 1]; end; + ii=find(col=='r'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[1 0 0]; end; + ii=find(col=='g'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[0 1 0]; end; + ii=find(col=='b'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[0 0 1]; end; + ii=find(col=='w'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[1 1 1]; end; + ii=find(col=='k'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[0 0 0]; end; + ii=find(col=='f'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[1 1 1]*inf; end; + ii=find(col=='n'); if (all(size(ii))), facecolor(ii,:)=ones(length(ii),1)*[1 1 1]*(-inf); end; + elseif ((size(facecolor,2)~=3)&(size(facecolor,1)==3)), + facecolor=facecolor'; + elseif (size(facecolor,2)~=3), + error('ARROW requires that color specifications must be a ?x3 RGB matrix.'); + end; +end; +if (all(size(ends))), + if (ischar(ends)), + endsorig = ends; + col = lower([ends(:,1:min(3,size(ends,2))) ones(size(ends,1),max(0,3-size(ends,2)))*' ']); + ends = NaN*ones(size(ends,1),1); + oo = ones(1,size(ends,1)); + ii=find(all(col'==['non']'*oo)'); if (all(size(ii))), ends(ii)=ones(length(ii),1)*0; end; + ii=find(all(col'==['sto']'*oo)'); if (all(size(ii))), ends(ii)=ones(length(ii),1)*1; end; + ii=find(all(col'==['sta']'*oo)'); if (all(size(ii))), ends(ii)=ones(length(ii),1)*2; end; + ii=find(all(col'==['bot']'*oo)'); if (all(size(ii))), ends(ii)=ones(length(ii),1)*3; end; + if (any(isnan(ends))), + ii = min(find(isnan(ends))); + error(['ARROW does not recognize ''' deblank(endsorig(ii,:)) ''' as a valid ''Ends'' value.']); + end; + else, + ends = ends(:); + end; +end; +oldh = oldh(:); + +% check object handles +if (all(size(oldh))), + oldh = oldh.'; + objs = findobj; + if (length(objs)==0), error('ARROW found no graphics handles.'); + elseif (length(objs)==1), objs=[objs;objs]; end; + if (~all(any(objs(:,ones(1,length(oldh)))==oldh(ones(length(objs),1),:)))), + error('ARROW got invalid object handles.'); + end; + oldh = oldh.'; +end; + +% Check for an empty Start or Stop (but not both) with no object handles +if ((~all(size(oldh)))&(all(size(start))~=all(size(stop)))), + if (~all(size(start))), start=stop; end; + ii = find(all(diff(start)'==0)'); + if (size(start,1)==1), + stop = start; + elseif (length(ii)==size(start,1)-1) + stop = start(1,:); + start = stop; + else, + if (all(size(ii))), + jj = (1:size(start,1))'; + jj(ii) = zeros(length(ii),1); + jj = jj(find(jj>0)); + start = start(jj,:); + end; + stop = start(2:size(start,1),:); + start = start(1:size(start,1)-1,:); + end; +end; + +% largest argument length +argsizes = [length(oldh) size(start,1) size(stop,1) ... + length(len) length(baseangle) length(tipangle) ... + length(wid) length(page) size(crossdir,1) length(ends) ... + length(linewidth) size(edgecolor,1) size(facecolor,1)]; +args=['length(ObjectHandle) '; ... + '#rows(Start) '; ... + '#rows(Stop) '; ... + 'length(Length) '; ... + 'length(BaseAngle) '; ... + 'length(TipAngle) '; ... + 'length(Width) '; ... + 'length(Page) '; ... + '#rows(CrossDir) '; ... + '#rows(Ends) '; ... + 'length(LineWidth) '; ... + '#colors in EdgeColor '; ... + '#colors in FaceColor ']; +if (any(imag(crossdir(:))~=0)), + args(9,:) = '#rows(NormalDir) '; +end; +if (~all(size(oldh))), + narrows = max(argsizes); +else, + narrows = length(oldh); +end; + +% Check size of arguments +ii = find((argsizes~=0)&(argsizes~=1)&(argsizes~=narrows)); +if (all(size(ii))), + s = args(ii',:); + while ((size(s,2)>1)&((abs(s(:,size(s,2)))==0)|(abs(s(:,size(s,2)))==abs(' ')))), + s = s(:,1:size(s,2)-1); + end; + s = [ones(length(ii),1)*'ARROW requires that ' s ... + ones(length(ii),1)*[' equal the # of arrows (' num2str(narrows) ').' c]]; + s = s'; + s = s(:)'; + s = s(1:length(s)-1); + error(char(s)); +end; + +% check element length in Start, Stop, and CrossDir +if (all(size(start))), + if (size(start,2)==2), + start = [start NaN*ones(size(start,1),1)]; + elseif (size(start,2)~=3), + error('ARROW requires 2- or 3-element Start points.'); + end; +end; +if (all(size(stop))), + if (size(stop,2)==2), + stop = [stop NaN*ones(size(stop,1),1)]; + elseif (size(stop,2)~=3), + error('ARROW requires 2- or 3-element Stop points.'); + end; +end; +if (all(size(crossdir))), + if (size(crossdir,2)<3), + crossdir = [crossdir NaN*ones(size(crossdir,1),3-size(crossdir,2))]; + elseif (size(crossdir,2)~=3), + if (all(imag(crossdir(:))==0)), + error('ARROW requires 2- or 3-element CrossDir vectors.'); + else, + error('ARROW requires 2- or 3-element NormalDir vectors.'); + end; + end; +end; + +% fill empty arguments +if (~all(size(start ))), start = [NaN NaN NaN]; end; +if (~all(size(stop ))), stop = [NaN NaN NaN]; end; +if (~all(size(len ))), len = NaN; end; +if (~all(size(baseangle ))), baseangle = NaN; end; +if (~all(size(tipangle ))), tipangle = NaN; end; +if (~all(size(wid ))), wid = NaN; end; +if (~all(size(page ))), page = NaN; end; +if (~all(size(crossdir ))), crossdir = [NaN NaN NaN]; end; +if (~all(size(ends ))), ends = NaN; end; +if (~all(size(linewidth ))), linewidth = NaN; end; +if (~all(size(linestyle ))), linestyle = char(['-']); end; % was NaN +if (~all(size(edgecolor ))), edgecolor = [NaN NaN NaN]; end; +if (~all(size(facecolor ))), facecolor = [NaN NaN NaN]; end; + +% expand single-column arguments +o = ones(narrows,1); +if (size(start ,1)==1), start = o * start ; end; +if (size(stop ,1)==1), stop = o * stop ; end; +if (length(len )==1), len = o * len ; end; +if (length(baseangle )==1), baseangle = o * baseangle ; end; +if (length(tipangle )==1), tipangle = o * tipangle ; end; +if (length(wid )==1), wid = o * wid ; end; +if (length(page )==1), page = o * page ; end; +if (size(crossdir ,1)==1), crossdir = o * crossdir ; end; +if (length(ends )==1), ends = o * ends ; end; +if (length(linewidth )==1), linewidth = o * linewidth ; end; +if (size(linestyle ,1)==1), linestyle = o * linestyle ; end; +if (size(edgecolor ,1)==1), edgecolor = o * edgecolor ; end; +if (size(facecolor ,1)==1), facecolor = o * facecolor ; end; +ax = o * gca; +if (size(linestyle ,2)==1), linestyle = char([linestyle o*' ']); end; +linestyle = char(linestyle); + +% if we've got handles, get the defaults from the handles +oldlinewidth = NaN*ones(narrows,1); +oldlinestyle = char(zeros(narrows,2)); +oldedgecolor = NaN*ones(narrows,3); +oldfacecolor = NaN*ones(narrows,3); +if (all(size(oldh))), + fromline = zeros(narrows,1); + for k=1:narrows, + oh = oldh(k); + ud = get(oh,'UserData'); + isarrow = strcmp(get(oh,'Tag'),ArrowTag); + ohtype = get(oh,'Type'); + ispatch = strcmp(ohtype,'patch'); + isline = strcmp(ohtype,'line'); + if (isarrow|isline), + % arrow UserData format: [start' stop' len base tip wid page crossdir' ends] + if (isarrow), + start0 = ud(1:3); + stop0 = ud(4:6); + if (isnan(len(k))), len(k) = ud( 7); end; + if (isnan(baseangle(k))), baseangle(k) = ud( 8); end; + if (isnan(tipangle(k))), tipangle(k) = ud( 9); end; + if (isnan(wid(k))), wid(k) = ud(10); end; + if (isnan(page(k))), page(k) = ud(11); end; + if (isnan(crossdir(k,1))), crossdir(k,1) = ud(12); end; + if (isnan(crossdir(k,2))), crossdir(k,2) = ud(13); end; + if (isnan(crossdir(k,3))), crossdir(k,3) = ud(14); end; + if (isnan(ends(k))), ends(k) = ud(15); end; + end; + if (isline), + fromline(k) = 1; + if (isarrow), + fc = -inf*[1 1 1]; + else, + fc = get(oh,'Color'); + x = get(oh,'XData'); + y = get(oh,'YData'); + z = get(oh,'ZData'); + if (any(size(x)~=[1 2])|any(size(y)~=[1 2])), + error('ARROW only converts two-point lines.'); + end; + if (~all(size(z))), z=NaN*ones(size(x)); end; + start0 = [x(1) y(1) z(1)]; + stop0 = [x(2) y(2) z(2)]; + end; + ec = get(oh,'Color'); + ls = [get(oh,'LineStyle') ' ']; ls=char(ls(1:2)); + lw = get(oh,'LineWidth'); + else, % an arrow patch + fc = get(oh,'FaceColor');if (ischar(fc)), + if (strcmp(fc,'none')), fc=-inf*[1 1 1]; + elseif (strcmp(fc,'flat')), fc=inf*[1 1 1]; + else, fc=[1 1 1]; end; + end; + ec = get(oh,'EdgeColor');if (ischar(ec)), + if (strcmp(ec,'none')), ec=-inf*[1 1 1]; + elseif (strcmp(ec,'flat')), ec=inf*[1 1 1]; + else, ec=[1 1 1]; end; + end; + ls = char('- '); + lw = get(oh,'LineWidth'); + end; + ax(k) = get(oh,'Parent'); + else, + error(['ARROW cannot convert ' ohtype ' objects.']); + end; + oldlinewidth(k) = lw; + oldlinestyle(k,:) = ls; + oldedgecolor(k,:) = ec; + oldfacecolor(k,:) = fc; + ii=find(isnan(start(k,:))); if (all(size(ii))), start(k,ii)=start0(ii); end; + ii=find(isnan(stop( k,:))); if (all(size(ii))), stop( k,ii)=stop0( ii); end; + if (isnan(linewidth(k))), linewidth(k) = lw; end; + if (isnan(linestyle(k,1))), linestyle(k,1:2) = ls; end; + if (any(isnan(facecolor(k,:)))), facecolor(k,:) = fc; end; + if (any(isnan(edgecolor(k,:)))), edgecolor(k,:) = ec; end; + end; +else + fromline = []; +end; + +% set up the UserData data +% (do it here so it is not corrupted by log10's and such) +ud = [start stop len baseangle tipangle wid page crossdir ends]; + +% Set Page defaults +if isnan(page) + page = ~isnan(page); +end; + +% Get axes limits, range, min; correct for aspect ratio and log scale +axm = zeros(3,narrows); +axr = zeros(3,narrows); +ap = zeros(2,narrows); +xyzlog = zeros(3,narrows); +limmin = zeros(2,narrows); +limrange = zeros(2,narrows); +oneax = all(ax==ax(1)); +if (oneax), + T = zeros(4,4); + invT = zeros(4,4); +else, + T = zeros(16,narrows); + invT = zeros(16,narrows); +end; +axnotdone = ones(size(ax)); +while (any(axnotdone)), + ii = min(find(axnotdone)); + curax = ax(ii); + curpage = page(ii); + % get axes limits and aspect ratio + axl = [get(curax,'XLim'); get(curax,'YLim'); get(curax,'ZLim')]; + ar = get(curax,'DataAspectRatio'); + % get axes size in pixels (points) + u = get(curax,'Units'); + axposoldunits = get(curax,'Position'); + if (curpage), + curfig = get(curax,'Parent'); + pu = get(curfig,'PaperUnits'); + set(curfig,'PaperUnits','points'); + pp = get(curfig,'PaperPosition'); + set(curfig,'PaperUnits',pu); + set(curax,'Units','normalized'); + curap = get(curax,'Position'); + curap = pp.*curap; + else, + set(curax,'Units','pixels'); + curap = get(curax,'Position'); + end; + set(curax,'Units',u); + set(curax,'Position',axposoldunits); + % adjust limits for log scale on axes + curxyzlog = [strcmp(get(curax,'XScale'),'log'); ... + strcmp(get(curax,'YScale'),'log'); ... + strcmp(get(curax,'ZScale'),'log')]; + if (any(curxyzlog)), + ii = find([curxyzlog;curxyzlog]); + if (any(axl(ii)<=0)), + error('ARROW does not support non-positive limits on log-scaled axes.'); + else, + axl(ii) = log10(axl(ii)); + end; + end; + % correct for aspect ratio + if (~isnan(ar(1))), + if (curap(3) < ar(1)*curap(4)), + curap(2) = curap(2) + (curap(4)-curap(3)/ar(1))/2; + curap(4) = curap(3)/ar(1); + else, + curap(1) = curap(1) + (curap(3)-curap(4)*ar(1))/2; + curap(3) = curap(4)*ar(1); + end; + end; + % correct for 'equal' + % may only want to do this for 2-D views, but seems right for 3-D also + if (~isnan(ar(2))), + if ((curap(3)/(axl(1,2)-axl(1,1)))/(curap(4)/(axl(2,2)-axl(2,1)))>ar(2)), + incr = curap(3)*(axl(2,2)-axl(2,1))/(curap(4)*ar(2)) - (axl(1,2)-axl(1,1)); + axl(1,:) = axl(1,:) + incr/2*[-1 1]; + else, + incr = ar(2)*(axl(1,2)-axl(1,1))*curap(4)/curap(3) - (axl(2,2)-axl(2,1)); + axl(2,:) = axl(2,:) + incr/2*[-1 1]; + end; + end; + % compute the range of 2-D values + curT = get(curax,'Xform'); + lim = curT*[0 1 0 1 0 1 0 1;0 0 1 1 0 0 1 1;0 0 0 0 1 1 1 1;1 1 1 1 1 1 1 1]; + lim = lim(1:2,:)./([1;1]*lim(4,:)); + curlimmin = min(lim')'; + curlimrange = max(lim')' - curlimmin; + curinvT = inv(curT); + if (~oneax), + curT = curT.'; + curinvT = curinvT.'; + curT = curT(:); + curinvT = curinvT(:); + end; + % check which arrows to which cur corresponds + ii = find((ax==curax)&(page==curpage)); + oo = ones(1,length(ii)); + axr(:,ii) = diff(axl')' * oo; + axm(:,ii) = axl(:,1) * oo; + ap(:,ii) = curap(3:4)' * oo; + xyzlog(:,ii) = curxyzlog * oo; + limmin(:,ii) = curlimmin * oo; + limrange(:,ii) = curlimrange * oo; + if (oneax), + T = curT; + invT = curinvT; + else, + T(:,ii) = curT * oo; + invT(:,ii) = curinvT * oo; + end; + axnotdone(ii) = zeros(1,length(ii)); +end; + +% correct for log scales +curxyzlog = xyzlog.'; +ii = find(curxyzlog(:)); +if (all(size(ii))), + start( ii) = real(log10(start( ii))); + stop( ii) = real(log10(stop( ii))); + if (all(imag(crossdir(ii))==0)), + crossdir(ii) = real(log10(crossdir(ii))); + else, + jj = find(imag(crossdir(ii))==0); + if (all(size(jj))), crossdir(jj) = real(log10(crossdir(jj))); end; + jj = find(imag(crossdir(ii))~=0); + if (all(size(jj))), crossdir(jj) = real(log10(imag(crossdir(jj))))*sqrt(-1); end; + end; +end; + +% take care of defaults, page was done above +ii=find(isnan(start(:) )); if (all(size(ii))), start(ii) = axm(ii)+axr(ii)/2; end; +ii=find(isnan(stop(:) )); if (all(size(ii))), stop(ii) = axm(ii)+axr(ii)/2; end; +ii=find(isnan(crossdir(:) )); if (all(size(ii))), crossdir(ii) = zeros(length(ii),1); end; +ii=find(isnan(len )); if (all(size(ii))), len(ii) = ones(length(ii),1)*deflen; end; +ii=find(isnan(baseangle )); if (all(size(ii))), baseangle(ii) = ones(length(ii),1)*defbaseangle; end; +ii=find(isnan(tipangle )); if (all(size(ii))), tipangle(ii) = ones(length(ii),1)*deftipangle; end; +ii=find(isnan(wid )); if (all(size(ii))), wid(ii) = ones(length(ii),1)*defwid; end; +ii=find(isnan(ends )); if (all(size(ii))), ends(ii) = ones(length(ii),1)*defends; end; +ii=find(isnan(linewidth )); if (all(size(ii))), linewidth(ii) = ones(length(ii),1)*deflinewidth; end; +ii=find(any(isnan(edgecolor'))); if (all(size(ii))), edgecolor(ii,:) = ones(length(ii),1)*defedgecolor; end; +ii=find(any(isnan(facecolor'))); if (all(size(ii))), facecolor(ii,:) = ones(length(ii),1)*deffacecolor; end; +ii=find(isnan(linestyle(:,1) )); if (all(size(ii))), linestyle(ii,:) = ones(length(ii),1)*deflinestyle; end; +ii=find(isnan(linestyle(:,2) )); if (all(size(ii))), linestyle(ii,2) = ones(length(ii),1)*' '; end; %just in case + +% transpose all values +start = start.'; +stop = stop.'; +len = len.'; +baseangle = baseangle.'; +tipangle = tipangle.'; +wid = wid.'; +page = page.'; +crossdir = crossdir.'; +ends = ends.'; +linewidth = linewidth.'; +linestyle = linestyle.'; +facecolor = facecolor.'; +edgecolor = edgecolor.'; +fromline = fromline.'; +ax = ax.'; +oldlinewidth = oldlinewidth.'; +oldlinestyle = oldlinestyle.'; +oldedgecolor = oldedgecolor.'; +oldfacecolor = oldfacecolor.'; + +% given x, a 3xN matrix of points in 3-space; +% want to convert to X, the corresponding 4xN 2-space matrix +% +% tmp1=[(x-axm)./axr; ones(1,size(x,1))]; +% if (oneax), X=T*tmp1; +% else, tmp1=[tmp1;tmp1;tmp1;tmp1]; tmp1=T.*tmp1; +% tmp2=zeros(4,4*N); tmp2(:)=tmp1(:); +% X=zeros(4,N); X(:)=sum(tmp2)'; end; +% X = X ./ (X(:,4)*ones(1,4)); + +% for all points with start==stop, start=stop-(verysmallvalue)*(up-direction); +ii = find(all(start==stop)); +if (all(size(ii))), + % find an arrowdir vertical on screen and perpendicular to viewer + % transform to 2-D + tmp1 = [(stop(:,ii)-axm(:,ii))./axr(:,ii);ones(1,length(ii))]; + if (oneax), twoD=T*tmp1; + else, tmp1=[tmp1;tmp1;tmp1;tmp1]; tmp1=T(:,ii).*tmp1; + tmp2=zeros(4,4*length(ii)); tmp2(:)=tmp1(:); + twoD=zeros(4,length(ii)); twoD(:)=sum(tmp2)'; end; + twoD=twoD./(ones(4,1)*twoD(4,:)); + % move the start point down just slightly + tmp1 = twoD + [0;-1/1000;0;0]*(limrange(2,ii)./ap(2,ii)); + % transform back to 3-D + if (oneax), threeD=invT*tmp1; + else, tmp1=[tmp1;tmp1;tmp1;tmp1]; tmp1=invT(:,ii).*tmp1; + tmp2=zeros(4,4*length(ii)); tmp2(:)=tmp1(:); + threeD=zeros(4,length(ii)); threeD(:)=sum(tmp2)'; end; + start(:,ii) = (threeD(1:3,:)./(ones(3,1)*threeD(4,:))).*axr(:,ii)+axm(:,ii); +end; + +% compute along-arrow points +% transform Start points + tmp1=[(start-axm)./axr;ones(1,narrows)]; + if (oneax), X0=T*tmp1; + else, tmp1=[tmp1;tmp1;tmp1;tmp1]; tmp1=T.*tmp1; + tmp2=zeros(4,4*narrows); tmp2(:)=tmp1(:); + X0=zeros(4,narrows); X0(:)=sum(tmp2)'; end; + X0=X0./(ones(4,1)*X0(4,:)); +% transform Stop points + tmp1=[(stop-axm)./axr;ones(1,narrows)]; + if (oneax), Xf=T*tmp1; + else, tmp1=[tmp1;tmp1;tmp1;tmp1]; tmp1=T.*tmp1; + tmp2=zeros(4,4*narrows); tmp2(:)=tmp1(:); + Xf=zeros(4,narrows); Xf(:)=sum(tmp2)'; end; + Xf=Xf./(ones(4,1)*Xf(4,:)); +% compute pixel distance between points + D = sqrt(sum(((Xf(1:2,:)-X0(1:2,:)).*(ap./limrange)).^2)); +% compute and modify along-arrow distances + len1 = len; + len2 = len - (len.*tan(tipangle/180*pi)-wid/2).*tan((90-baseangle)/180*pi); + slen0 = zeros(1,narrows); + slen1 = len1 .* ((ends==2)|(ends==3)); + slen2 = len2 .* ((ends==2)|(ends==3)); + len0 = zeros(1,narrows); + len1 = len1 .* ((ends==1)|(ends==3)); + len2 = len2 .* ((ends==1)|(ends==3)); + % for no start arrowhead + ii=find((ends==1)&(D0), h=H; end; +else, + % don't create the patch, just return the data + h=x; + yy=y; + zz=z; +end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/averef.m b/code/eeglab13_4_4b/functions/miscfunc/averef.m new file mode 100644 index 0000000..f6d6cbf --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/averef.m @@ -0,0 +1,80 @@ +% averef() - convert common-reference EEG data to average reference +% Note that this old function is not being used in EEGLAB. The +% function used by EEGLAB is reref(). +% +% Usage: +% >> data = averef(data); +% >> [data_out W_out S_out meandata] = averef(data,W); +% +% Inputs: +% data - 2D data matrix (chans,frames*epochs) +% W - ICA weight matrix +% +% Outputs: +% data_out - Input data converted to average reference. +% W_out - ICA weight matrix converted to average reference +% S_out - ICA sphere matrix converted to eye() +% meandata - (1,dataframes) mean removed from each data frame (point) +% +% Note: If 2 args, also converts the weight matrix W to average reference: +% If ica_act = W*data, then data = inv(W)*ica_act; +% If R*data is the average-referenced data, +% R*data=(R*inv(W))*ica_act and W_out = inv(R*inv(W)); +% The average-reference ICA maps are the columns of inv(W_out). +% +% Authors: Scott Makeig and Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 1999 +% +% See also: reref() + +% Copyright (C) 1999 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 12/16/99 Corrected denomiator on the suggestion of Ian Nimmo-Smith, Cambridge UK +% 01-25-02 reformated help & license -ad + +function [data, W, S, meandata] = averef(data, W, S) + +if nargin<1 + help averef + return +end +chans = size(data,1); +if chans < 2 + help averef + return +end + +% avematrix = eye(chans)-ones(chans)*1/chans; +% data = avematrix*data; % implement as a matrix multiply +% else (faster?) + +meandata = sum(data)/chans; +data = data - ones(chans,1)*meandata; + +% treat optional ica parameters +if nargin == 2 + winv = pinv(W); + size1 = size(winv,1); + avematrix = eye(size1)-ones(size1)*1/size1; + W = pinv(avematrix*winv); +end; +if nargin >= 3 + winv = pinv(W*S); + size1 = size(winv,1); + avematrix = eye(size1)-ones(size1)*1/size1; + W = pinv(avematrix*winv); + S = eye(chans); +end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/caliper.m b/code/eeglab13_4_4b/functions/miscfunc/caliper.m new file mode 100644 index 0000000..8087c9d --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/caliper.m @@ -0,0 +1,192 @@ +% caliper() - Measure a set of spatial components of a given data epoch relative to +% a reference epoch and decomposition. +% Usage: +% >> [amp,window]=caliper(newepoch,refepoch,weights,compnums,filtnums,times,'noplot'); +% +% Inputs: +% newepoch = (nchannels,ntimes) new data epoch +% refepoch = a (nchannels,ntimes) reference data epoch +% weights = (nchannels,ncomponents) unmixing matrix (e.g., ICA weights*sphere) +% compnums = vector of component numbers to return amplitudes for {def|0: all} +% filtnums = [srate highpass lowpass] filter limits for refepoch {def|0: allpass} +% times = [start_ms end_ms] epoch latency limits, else latencies vector {def|0: 0:EEG.pnts-1} +% 'noplot' = produce no plots {default: plots windows for the first <=3 components} +% +% Outputs: +% amps = (1,length(compnums)) vector of mean signed component rms amplitudes +% windows = (length(compnums)),length(times)) matrix of tapering windows used +% +% Notes: +% Function caliper() works as follows: First the reference epoch is decomposed using +% the given weight matrix (may be ICA, PCA, or etc). Next, the time course of the +% main lobe of the activation in the reference epoch (from max to 1st min, forward +% and backward in time from abs max, optionally after bandpass filtering) is used +% to window the new epoch. Then, the windowed new epoch is decomposed by the same +% weight matrix, and signed rms amplitude (across the channels) is returned of the +% projection of each of the specified component numbers integrated across the windowed +% epoch. If not otherwise specified, plots the windows for the first <= 3 components listed. +% +% Example: Given a grand mean response epoch and weight matrix, it can be used +% to measure amps of grand mean components in single-subject averages. +% +% Authors: Scott Makeig & Marissa Westerfield, SCCN/INC/UCSD, La Jolla, 11/2000 + +% Copyright (C) 11/2000 Scott Makeig & Marissa Westerfield,, SCCN/INC/UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Edit History: +% 12/05/00 -- added fig showing data, ref activation, and window vector -mw +% 12/19/00 -- adjusted new icaproj() args -sm +% 01-25-02 reformated help & license -ad + +function [amps,windows] = caliper(newepoch,refepoch,weights,compnums,filtnums,times,noplot) + +if nargin < 3 + help caliper + return +end + +if nargin<4 + compnums = 0; +end + +nchans = size(newepoch,1); +ntimes = size(newepoch,2); + +if compnums(1) == 0 | isempty(compnums(1)) + compnums = 1:nchans; +end + +if min(compnums) < 1 | max(compnums) > size(weights,2) + help caliper + return +end + +if nargin<5 + filtnums = []; +else + if isempty(filtnums) + filtnums = []; + elseif length(filtnums)==1 & filtnums(1)==0 + filtnums = []; + elseif length(filtnums) ~= 3 + fprintf('\ncaliper(): filter parameters (filtnums) must have length 3.\n') + return + end +end + +if nargin< 6 | isempty(times) | (length(times)==1 & times(1)==0) + times = 0:ntimes-1; +else + if length(times) ~= ntimes + if length(times) ~= 2 + fprintf('caliper(): times argument should be [startms endms] or vector.\n') + return + else + times = times(1):(times(2)-times(1))/(ntimes-1):times(2); + times = times(1:ntimes); + end + end +end + +if nargin < 7 + noplot = 0; +else + noplot = 1; +end + +refact = weights(compnums,:)*refepoch; % size (length(compnums),ntimes) +newact = weights(compnums,:)*newepoch; + +if length(filtnums) == 3 + if ~exist('eegfilt') + fprintf('caliper(): function eegfilt() not found - not filtering refepoch.\n'); + else + try + refact = eegfilt(refact,filtnums(1),filtnums(2),filtnums(3)); + catch + fprintf('\n%s',lasterr) + return + end + end +end + +if size(weights,1) == size(weights,2) + winv = inv(weights); +else + winv = pinv(weights); +end +winvrms = sqrt(mean(winv.*winv)); % map rms amplitudes + +amps = []; +windows = []; +n = 1; % component index +for c=compnums + if floor(c) ~= c + help caliper + fprintf('\ncaliper(): component numbers must be integers.\n') + return + end + + [lobemax i] = max(abs(refact(n,:))); + f = i+1; + oldact = lobemax; + while f>0 & f<=ntimes & abs(refact(n,f)) < oldact + oldact = abs(refact(n,f)); + f = f+1; + end % f is now one past end of "main lobe" + lobeend = f-1; + + f = i-1; + oldact = lobemax; + while f>0 & f<=ntimes & abs(refact(n,f)) < oldact + oldact = abs(refact(n,f)); + f = f-1; + end % f is now one past start of "main lobe" + lobestart = f+1; + + refact(n,1:lobestart) = zeros(1,length(1:lobestart)); + refact(n,lobeend:end) = zeros(1,length(lobeend:ntimes)); + windows = [windows; refact(n,:)]; + + refnorm = sum(refact(n,:)); + if abs(refnorm)<1e-25 + fprintf('caliper(): near-zero activation for component %d - returning NaN amp.\n',c) + amps = [amps NaN]; + else + refact(n,:) = refact(n,:)/refnorm; % make reference epoch window sum to 1 + amps = [amps winvrms(c)*sum(refact(n,:).*newact(n,:))]; + end + n = n+1; + if ~noplot & n <= 4 %%% only plot out at most the first 3 components + refproj = icaproj(refepoch,weights,c); + refproj = env(refproj); + windproj = winv(:,c)*(refact(n-1,:)*refnorm); + windproj = env(windproj); + figure; plot(times,newepoch(2:nchans,:),'g'); + hold on;h=plot(times,newepoch(1,:),'g'); + hold on;h=plot(times,newepoch(1,:),'g',... + times,refproj(1,:),'b',... + times,windproj(1,:),'r','LineWidth',2); + hold on;plot(times,refproj(2,:),'b',times,windproj(2,:),'r','LineWidth',2); + set(h(1),'linewidth',1); + legend(h,'new data','comp. act.','window'); + title(['Component ',int2str(c),'; rms amplitude = ',num2str(amps(n-1))],... + 'FontSize',14); + ylabel('Potential (uV)'); + end; %% endif +end % c + diff --git a/code/eeglab13_4_4b/functions/miscfunc/chanproj.m b/code/eeglab13_4_4b/functions/miscfunc/chanproj.m new file mode 100644 index 0000000..5b31811 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/chanproj.m @@ -0,0 +1,233 @@ +% chanproj() - make a detailed plot of data returned from plotproj() +% for given channel. Returns the data plotted. +% Usage: +% >> [chandata] = chanproj(projdata,chan); +% >> [chandata] = chanproj(projdata,chan,ncomps,framelist,limits,title,colors); +% +% Inputs: +% projdata = data returned from plotproj() +% chan = single channel to plot +% ncomps = number of component projections in projdata +% +% Optional: +% framelist = data frames to plot per epoch Ex: [1:128] (0|def -> all) +% limits = [xmin xmax ymin ymax] (x's in msec) +% (0, or y's 0 -> data limits) +% title = fairly short single-quoted 'plot title' (0|def -> chan) +% colors = file of color codes, 3 chars per line (NB: '.' = space) +% (0|def -> white is original data) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 1996 + +% Copyright (C) 1996 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 11-30-96 Scott Makeig CNL / Salk Institute, La Jolla as plotprojchan.m +% 03-19-97 changed var() to diag(cov()) -sm +% 03-26-97 fix (== -> =) -sm +% 04-03-97 allow framelist to be a col vector, allow 32 traces, fix pvaf, made +% ncomps mandatory -sm +% 04-04-97 shortened name to chanproj() -sm +% 05-20-97 added read of icadefs.m -sm +% 11-05-97 disallowed white traces unless default axis color is white -sm & ch +% 11-13-97 rm'ed errcode variable -sm +% 12-08-97 added LineWidth 2 to data trace, changed whole plot color to BACKCOLOR -sm +% 01-25-02 reformated help & license -ad + +function [chandata] = chanproj(projdata,chan,ncomps,framelist,limits,titl,colorfile) + +icadefs; % read default MAXPLOTDATACHANS + +if nargin < 7, + colorfile =0; +end +if nargin < 6, + titl = 0; +end +if nargin < 5, + limits = 0; +end +if nargin < 4, + framelist = 0; +end + +if nargin < 3, + fprintf('chanproj(): requires at least three arguments.\n\n'); + help chanproj + return +end + +[chans,framestot] = size(projdata); +frames = fix(framestot/(ncomps+1)); + +if ncomps < 1 | frames*(ncomps+1) ~= framestot, + fprintf(... + 'chanproj(): data length (%d) not a multiple of ncomps (%d).\n',... + framestot,ncomps); + return +end; + +if chan> chans, + fprintf(... + 'chanproj(): specified channel (%d) cannot be > than nchans (%d).\n',... + chan,chans); + return +else + chandata = projdata(chan,:); + epochs = fix(length(chandata)/frames); +end; +if epochs > MAXPLOTDATACHANS + fprintf(... + 'chanproj(): maximum number of traces to plot is %d\n',... + MAXPLOTDATACHANS); + return +end +if framestot~=epochs*frames, + fprintf('chanproj(): projdata is wrong length.\n'); % exit + return +end + +% +%%%%%%%%%%%%%%%% Find or read plot limits %%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if limits==0, + xmin=0;xmax=0;ymin=0;ymax=0; +else + if length(limits)~=4, + fprintf( ... +'chanproj():^G limits should be 0 or an array [xmin xmax ymin ymax].\n'); + return + end; + xmin = limits(1); + xmax = limits(2); + ymin = limits(3); + ymax = limits(4); +end; + +if xmin == 0 & xmax == 0, + x = [0:frames-1]; + xmin = 0; + xmax = frames-1; +else + dx = (xmax-xmin)/(frames-1); + x=xmin*ones(1,frames)+dx*(0:frames-1); % construct x-values +end; + +if ymax == 0 & ymin == 0, + ymax=max(max(projdata(chan,:))); + ymin=min(min(projdata(chan,:))); +end +% +%%%%% Reshape the projdata for plotting and returning to user %%%%%%%%% +% +chandata=reshape(chandata,frames,epochs); +chandata=chandata'; + +if framelist ==0, + framelist = [1:frames]; % default +end +if size(framelist,2)==1, + if size(framelist,1)>1, + framelist = framelist'; + else + fprintf(... + 'chanproj(): framelist should be a vector of frames to plot per epoch.\n'); + return + end +end + +if framelist(1)<1 | framelist(length(framelist))>frames, + fprintf('chanproj(): framelist values must be between 1-%d.\n',frames); + return +else + chandata=chandata(:,framelist); +end +% +%%%%%%%%%%%%%%%%%%% Read the color names %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if colorfile ~=0, + if ~ischar(colorfile) + fprintf('chanproj(); color file name must be a string.\n'); + return + end + cid = fopen(colorfile,'r'); + if cid <3, + fprintf('chanproj(): cannot open file %s.\n',colorfile); + return + end; + colors = fscanf(cid,'%s',[3 MAXPLOTDATACHANS]); + colors = colors'; + [r c] = size(colors); + for i=1:r + for j=1:c + if colors(i,j)=='.', + colors(i,j)=' '; + end; + end; + end; +else % default color order - no yellow + colors =['w ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ']; +end; +% +% Make vector of x-values +% +x=[xmin:(xmax-xmin)/(frames-1):xmax+0.00001]; +xmin=x(framelist(1)); +xmax=x(framelist(length(framelist))); +x = x(framelist(1):framelist(length(framelist))); +% +%%%%%%%%% Compute percentage of variance accounted for %%%%%%%%%%%%%% +% +if epochs>1, + sumdata = zeros(1,length(framelist)); + for e=2:epochs + sumdata= sumdata + chandata(e,:); % sum the component projections + end + sigvar = diag(cov(chandata(1,:)')); + difvar = diag(cov(((chandata(1,:)-sumdata)'))); + % percent variance accounted for + pvaf = round(100.0*(1.0-difvar/sigvar)); +end +% +%%%%%%%%%%%%%%%%%%%%%% Plot traces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +fprintf('chanproj(): Drawing trace '); +for e=1:epochs, + fprintf ('%d ',e); + set(gcf,'Color',BACKCOLOR); % set the background color to grey + set(gca,'Color','none'); % set the axis color = figure color + if e==1 + plot(x,chandata(e,:),colors(e),'LineWidth',2); % plot it! + else + plot(x,chandata(e,:),colors(e),'LineWidth',1); % plot it! + end + hold on; +end; +fprintf('\n'); +% +%%%%%%%%%%%%%%%%%%%% Fix axis limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +axis([xmin xmax ymin-0.1*(ymax-ymin) ymax+0.1*(ymax-ymin)]); +% +%%%%%%%%%%%%%%%%%%% Add title and labels %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if titl==0, + titl = ['channel ' int2str(chan)]; +end +titl = [ titl ' (p.v.a.f. ' int2str(pvaf) '%)' ]; +title(titl); +xlabel('Time (msec)'); +ylabel('Potential (uV)'); diff --git a/code/eeglab13_4_4b/functions/miscfunc/compdsp.m b/code/eeglab13_4_4b/functions/miscfunc/compdsp.m new file mode 100644 index 0000000..a286384 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/compdsp.m @@ -0,0 +1,262 @@ +% compdsp() - Display standard info figures for a data decomposition +% Creates four figure windows showing: Component amplitudes, +% scalp maps, activations and activation spectra. +% Usage: +% >> compdsp(data,weights,locfile,[srate],[title],[compnums],[amps],[act]); +% +% Inputs: +% data = data matrix used to train the decomposition +% weights = the unmixing matrix (e.g., weights*sphere from runica()) +% +% Optional: +% locfile = 2-d electrode locations file (as in >> topoplot example) +% {default|[]: default locations file given in icadefs.m +% srate = sampling rate in Hz {default|[]: as in icadefs.m} +% title = optional figure title text +% {default|'': none} +% compnums = optional vector of component numbers to display +% {default|[] -> all} +% amps = all component amplitudes (from runica()) +% {default|[]->recompute} +% act = activations matrix (from runica()) +% {default|[]->recompute} +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 2000 + +% Copyright (C) 12/16/00 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 02-01-01 replaced std() with rms() -sm +% 02-10-01 made srate optional -sm +% 01-25-02 reformated help & license -ad + +function compdsp(data,unmix,locfile,srate,titl,compnums,amps,act) + +minHz = 2; % frequency display limits +maxHz = 40; +ACTS_PER_EEGPLOT = 32; + +% +%%%%%%%%%%%%%%%%%%%%%% Read and test arguments %%%%%%%%%%%%%%%%%%%%%%%% +% +icadefs % read BACKCOLOR, DEFAULT_SRATE + +if nargin<2 + help compdsp + return +end + +chans = size(data,1); +frames = size(data,2); +ncomps = size(unmix,1); + +if ncomps < 1 + error('Unmixing matrix must have at least one component'); +end +if chans < 2 + error('Data must have at least two channels'); +end +if frames < 2 + error('Data must have at least two frames'); +end +if size(unmix,2) ~= chans + error('Sizes of unmix and data do not match'); +end +if nargin<3 + locfile=[]; +end +if isempty(locfile) + locfile = DEFAULT_ELOC; % from icsdefs.m +end +if ~exist(locfile) + error('Cannot find electrode locations file'); +end + +if nargin<4 + srate = 0; % from icadefs +end +if isempty(srate) | srate==0 + srate = DEFAULT_SRATE; % from icadefs +end +if nargin<5 + titl = ''; % default - no title text +end +if isempty(titl) + titl = ''; +end +if nargin<6 + compnums = 0; % default - all components +end +if isempty(compnums) + compnums = 0; +end +if nargin<7 + amps = NaN; % default - recompute amps +end +if isempty(amps) + amps = NaN; +end +if ~isnan(amps) & length(amps) ~= ncomps + error('Supplied amps does not match the number of unmixed components'); +end + +if compnums(1) == 0 + compnums = 1:ncomps; +end +if min(compnums) < 1 + error('Compnums must be positive'); +end +if min(compnums) > ncomps + error('Some compnum > number of components in unmix'); +end + +if nargin<8 + act = NaN; % default - recompute act +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% Create plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if chans == ncomps + winv = inv(unmix); +elseif chans < ncomps + error('More components than channels?'); +else + winv = pinv(unmix); +end + +if isnan(act) + fprintf('Computing activations ...') + act = unmix(compnums,:)*data; + fprintf('\n'); +elseif size(act,2) ~= frames + error('Supplied activations do not match data length'); +elseif size(act,1) ~= ncomps & size(act,1) ~= length(compnums) + error('Number of supplied activations matrix does not match data or weights'); +elseif size(act,1) == ncomps + act = act(compnums,:); % cut down matrix to desired components +end + +% +%%%%%%%%%%%%%%%%%%%%% I. Plot component amps %%%%%%%%%%%%%%%%%%%%%%%%%%% +% +pos = [40,520,550,400]; figure('Position',pos); +if isnan(amps) + fprintf('Computing component rms amplitudes '); + amps = zeros(1,length(compnums)); + for j=1:length(compnums) + amps(j) = rms(winv(:,compnums(j)))*rms(act(j,:)'); + fprintf('.') + end + fprintf('\n'); +else + amps = amps(compnums); % truncate passed amps to desired compnums +end +plot(compnums,amps,'k'); +hold on +plot(compnums,amps,'r^'); +xl=xlabel('Component numbers'); +yl=ylabel('RMS Amplitudes'); +tl=title([titl ' Amplitudes']); +ax = axis; +axis([min(compnums)-1 max(compnums)+1 0 ax(4)]); + +% +%%%%%%%%%%%%%%%%%%%%%%%%% II. Plot component maps %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +pos = [40,40,550,400]; figure('Position',pos); + +fprintf('Plotting component scalp maps ...') % compmaps() may make multiple figures +compmap(winv,locfile,compnums,[titl ' Scalp Maps'],0,compnums); +fprintf('\n'); + +% +%%%%%%%%%%%%%%%%%%%%%% III. eegplot() activations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if frames/srate < 10 + dispsecs = ceil(frames/srate); +else + dispsecs = 10; % defaults - display 10s data per screen +end +range = 0.8*max(max(act')-min(act')); + +stact=1; +lact=ACTS_PER_EEGPLOT; +if lact>size(act,1) + lact = size(act,1); +end + +pos = [620,520,550,400]; figure('Position',pos); +while stact <= size(act,1) + % eegplot(data,srate,spacing,eloc_file,windowlength,title,posn) + eegplot(act(stact:lact,:),srate,range,compnums(stact:lact),... + dispsecs,[titl ' Activations'],pos); + pos = pos + [.02 .02 0 0]; + stact = stact+ACTS_PER_EEGPLOT; + lact = lact +ACTS_PER_EEGPLOT; + if lact>size(act,1) + lact = size(act,1); + end +end + +% +%%%%%%%%%%%%%%%%%%%%%%% IV. plotdata() spectra %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +pos = [620,40,550,400]; figure('Position',pos); + +if frames > 2048 + windw = 512; +elseif frames > 1024 + windw = 256; +else + windw = 128; +end +fprintf('Computing component spectra ') +for j = 1:length(compnums) + % [Pxx,F] = PSD(X,NFFT,Fs,WINDOW,NOVERLAP) + [spec,freqs] = psd(act(j,:),1024,srate,windw,ceil(windw*0.5)); + if ~exist('specs') + specs = zeros(length(compnums),length(freqs)); + end + specs(j,:) = spec'; + fprintf('.') +end +fprintf('\n'); +specs = 10*log10(specs); + +tmp = ceil(sqrt(length(compnums))); +tmp2 = ceil(length(compnums)/tmp); +for j=1:length(compnums) + sbplot(tmp2,tmp,j) + plot(freqs,specs(j,:)) + set(gca,'box','off') + set(gca,'color',BACKCOLOR); + ax=axis; + axis([minHz,maxHz,ax(3),ax(4)]); + tl = title(int2str(compnums(j))); +end +xl=xlabel('Frequency (Hz)'); +yl=ylabel('Power (dB)'); +set(gca,'YAxisLocation','right'); +txl=textsc([titl ' Activation Spectra'],'title'); +axcopy % pop-up axes on mouse click + +% plottopo(specs,[tmp2 tmp],0,[2,70 min(min(specs)) max(max(specs))],... +% [titl ' Activation Power Spectra']); + +function rmsval = rms(column) + rmsval = sqrt(mean(column.*column)); % don't remove mean diff --git a/code/eeglab13_4_4b/functions/miscfunc/compheads.m b/code/eeglab13_4_4b/functions/miscfunc/compheads.m new file mode 100644 index 0000000..899e91b --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/compheads.m @@ -0,0 +1,209 @@ +% compheads() - plot multiple topoplot() maps of ICA component topographies +% +% Usage: +% >> compheads(winv,'spline_file',compnos,'title',rowscols,labels,view) +% +% Inputs: +% winv - Inverse weight matrix = EEG scalp maps. Each column is a +% map; the rows correspond to the electrode positions +% defined in the eloc_file. Normally, winv = inv(weights*sphere). +% spline_file - Name of the eloctrode position file in BESA spherical coords. +% compnos - Vector telling which (order of) component maps to show +% Indices <0 tell compheads() to invert a map; = 0 leave blank subplot +% Example [1 0 -2 3 0 -6] {default|0 -> 1:columns_in_winv} +% 'title' - Title string for each page {default|0 -> 'ICA Component Maps'} +% rowscols - Vector of the form [m,n] where m is total vertical tiles and n +% is horizontal tiles per page. If the number of maps exceeds m*n, +% multiple figures will be produced {def|0 -> one near-square page}. +% labels - Vector of numbers or a matrix of strings to use as labels for +% each map {default|0 -> 1:ncolumns_in_winv} +% view - topoplot() view, either [az el] or keyword ('top',...) +% See >> help topoplot() for options. +% +% Note: Map scaling is to +/-max(abs(data); green = 0 +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 4-28-1998 +% +% See also: topoplot() + +% Copyright (C) 4-28-98 from compmap.m Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function compheads(Winv,eloc_file,compnos,titleval,pagesize,srclabels,view) + +if nargin<1 + help compheads + return +end + +[chans, frames] = size (Winv); + +DEFAULT_TITLE = 'ICA Component Maps'; +DEFAULT_EFILE = 'chan_file'; +NUMCONTOUR = 5; % topoplot() style settings +OUTPUT = 'screen'; % default: 'screen' for screen colors, + % 'printer' for printer colors +STYLE = 'both'; +INTERPLIMITS = 'head'; +MAPLIMITS = 'absmax'; +SQUARE = 1; % 1/0 flag making topoplot() asex square -> round heads + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% check inputs and set defaults +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +printlabel = OUTPUT; % default set above +if nargin < 7 + view = [-127 30]; +end + +if nargin < 6 + srclabels = 0; +end +if nargin < 5 + pagesize = 0; +end +if nargin < 4 + titleval = 0; +end +if nargin < 3 + compnos = 0; +end +if nargin < 2 + eloc_file = 0; +end + +if srclabels == 0 + srclabels = []; +end +if titleval == 0; + titleval = DEFAULT_TITLE; +end +if compnos == 0 + compnos = (1:frames); +end +if pagesize == 0 + numsources = length(compnos); + DEFAULT_PAGE_SIZE = ... +[floor(sqrt(numsources)) ceil(numsources/floor(sqrt(numsources)))]; + m = DEFAULT_PAGE_SIZE(1); + n = DEFAULT_PAGE_SIZE(2); +elseif length(pagesize) ==1 + help compheads + return +else + m = pagesize(1); + n = pagesize(2); +end +if eloc_file == 0 + eloc_file = DEFAULT_EFILE; +end + +totalsources = length(compnos); +if ~isempty(srclabels) + if ~ischar(srclabels(1,1)) % if numbers + if size(srclabels,1) == 1 + srclabels = srclabels'; + end + end + if size(srclabels,1) ~= totalsources, + fprintf('compheads(): numbers of components and component labels do not agree.\n'); + return + end +end +pages = ceil(totalsources/(m*n)); +if pages > 1 + fprintf('compheads(): will create %d figures of %d by %d maps: ',... + pages,m,n); +end + +pos = get(gcf,'Position'); +off = [ 25 -25 0 0]; % position offsets for multiple figures + +fid = fopen(eloc_file); +if fid<1, + fprintf('compheads()^G: cannot open eloc_file (%s).\n',eloc_file); + return +end +fclose(fid); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% plot the maps %%%%%%%%%%%%%%%%%%%%%%% + +for i = (1:pages) + if i > 1 + figure('Position',pos+(i-1)*off); % place figures in right-downward stack + end + set(gcf,'Color','w') %CJH - set background color to white + + if (totalsources > i*m*n) + sbreak = n*m; + else + sbreak = totalsources - (i-1)*m*n; + end + + for j = (1:sbreak) % maps on this page + comp = j+(i-1)*m*n; % compno index + if compnos(comp)~=0 + if compnos(comp)>0 + source_var = Winv(:,compnos(comp))'; % plot map + elseif compnos(comp)<0 + source_var = -1*Winv(:,-1*compnos(comp))'; % invert map + end + + subplot(m,n,j) + headplot(source_var,eloc_file,'electrodes','off','view',view); + %topoplot(source_var,eloc_file,'style',STYLE,... + % 'numcontour',NUMCONTOUR,'interplimits',INTERPLIMITS,... + % 'maplimits',MAPLIMITS); % draw map + if SQUARE, + axis('square'); + end + + if isempty(srclabels) + t=title(int2str(compnos(comp))); + set(t,'FontSize',16); + else + if ischar(srclabels) + t=title(srclabels(comp,:)); + set(t,'FontSize',16); + else + t=title(num2str(srclabels(comp))); + set(t,'FontSize',16); + end + end + drawnow % draw one map at a time + end + end + + ax = axes('Units','Normal','Position',[.5 .04 .32 .05],'Visible','Off'); + colorbar(ax) + axval = axis; + Xlim = get(ax,'Xlim'); + set(ax,'XTick',(Xlim(2)+Xlim(1))/2) + set(gca,'XTickLabel','0') + set(gca,'XTickMode','manual') + + axbig = axes('Units','Normalized','Position',[0 0 1 1],'Visible','off'); + t1 = text(.25,.070,titleval,'HorizontalAlignment','center','FontSize',14); + if pages > 1 + fprintf('%d ',i); + end +end +if pages > 1 + fprintf('\n'); +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/compile_eeglab.m b/code/eeglab13_4_4b/functions/miscfunc/compile_eeglab.m new file mode 100644 index 0000000..908d12c --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/compile_eeglab.m @@ -0,0 +1,197 @@ +% EEGLAB cross-platform compiling script +% should be run on a newly checked out EEGLAB version as +% some folder are temporarily modified +% +% Arnaud Delorme - August 3rd, 2009 + +% Copyright (C) 2009 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +disp('This function will compile EEGLAB in the output folder'); +disp('provided below. You may also enter a path relative to the EEGLAB'); +disp('folder: ../compiled_EEGLAB for instance'); +outputfolder = input('Enter output folder name:','s'); + +eeglab; close; +path_eeglab = fileparts(which('eeglab')); +cd(path_eeglab); + +% deal with VisEd plugin (VisEd is both the name of the folder and the +% function inside and this creates a problem +path_vised = fileparts(which('VisEd')) +try, movefile( path_vised, [ path_vised '2' ]); catch, end; +addpath([ path_vised '2' ]); + +path_fileio = fileparts(which('chantype')); +try, movefile( fullfile(path_fileio, '@uint64'), fullfile(path_fileio, 'uint64') ); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'buffer.m') , fullfile(path_fileio, 'private', 'bufferold.m') ); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'read_24bit.m') , fullfile(path_fileio, 'private', 'read_24bitold.m')); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'read_ctf_shm.m'), fullfile(path_fileio, 'private', 'read_ctf_shmold.m')); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'write_ctf_shm.m'), fullfile(path_fileio, 'private', 'write_ctf_shmold.m')); catch, end; +path_fileio = path_fileio(length(path_eeglab)+2:end); +files_fileio = fullfile(path_fileio, '*.m'); +files_fileio_private = fullfile(path_fileio, 'private', '*.m'); + +path_fieldtrip = fileparts(which('electroderealign')); +addpath(fullfile(path_fieldtrip, 'public')); +try, movefile( fullfile(path_fieldtrip, 'fileio', '@uint64'), fullfile(path_fieldtrip, 'fileio', 'uint64') ); catch, end; +try, movefile( fullfile(path_fieldtrip, '@uint64'), fullfile(path_fieldtrip, 'uint64') ); catch, end; +try, movefile( fullfile(path_fieldtrip, 'topoplot.m'), fullfile(path_fieldtrip, 'topoplotold.m') ); catch, end; +path_fieldtrip = path_fieldtrip(length(path_eeglab)+2:end); +files_fieldtrip = fullfile(path_fieldtrip, '*.m'); +files_public = fullfile(path_fieldtrip, 'public', '*.m'); +files_public_private = fullfile(path_fieldtrip, 'public', 'private', '*.m'); +files_fieldtrip_private = fullfile(path_fieldtrip, 'private', '*.m'); +files_forwinv = fullfile(path_fieldtrip, 'forward', '*.m'); +files_forwinv_private = fullfile(path_fieldtrip, 'forward', 'private', '*.m'); +files_inverse = fullfile(path_fieldtrip, 'inverse', '*.m'); +files_inverse_private = fullfile(path_fieldtrip, 'inverse', 'private', '*.m'); + +try + rmpath('C:\Documents and Settings\delorme\My Documents\eeglab\plugins\editevents_arno'); +catch, end; +path_biosig = fileparts(which('install')); +path_biosig = path_biosig(length(path_eeglab)+2:end); +biosig = ' sopen.m sclose.m sread.m '; +[allfiles3 fieldt] = scanfold('external/fieldtrip-partial'); +% note that the order is important if the two first folders are inverted, +% it does not work + +% fieldt = [ ' -a ' files_fieldtrip_private ... +% ' -a ' files_fieldtrip ... +% ' -a ' files_public ... +% ' -a ' files_forwinv ... +% ' -a ' files_forwinv_private ... +% ' -a ' files_inverse ... +% ' -a ' files_inverse_private ... +% ' -a ' files_fileio ... +% ' -a ' files_fileio_private ]; +%fieldt = [ ' -a external\fieldtrip-20090727\private\*.m -a external\fieldtrip-20090727\*.m ' ... +% ' -a external\fieldtrip-20090727\forwinv\*.m -a external\fieldtrip-20090727\forwinv\private\*.m ' ... +% ' -a external\fileio-20090511\*.m -a external\fileio-20090511\private\*.m ' ]; +% topoplot +% uint64 in fieldtrip and file-io +% other mex files in file-io private folder +[allfiles1 plugins] = scanfold('plugins/'); +[allfiles2 functions] = scanfold('functions/'); + +eval([ 'mcc -v -m eeglab' biosig plugins functions fieldt ]); +%eval([ 'mcc -v -C -m eeglab' biosig plugins functions fieldt ]); + +mkdir(fullfile(outputfolder)); +comp = computer; +if strcmpi(comp(1:2), 'PC') + copyfile( 'eeglab.exe', fullfile(outputfolder, 'eeglab.exe'), 'f'); + copyfile( 'eeglab.ctf', fullfile(outputfolder, 'eeglab.ctf'), 'f'); +else + copyfile( 'eeglab', fullfile(outputfolder, 'eeglab'), 'f'); + copyfile( 'eeglab', fullfile(outputfolder, 'eeglab'), 'f'); + copyfile( 'eeglab.ctf', fullfile(outputfolder, 'eeglab.ctf'), 'f'); +end; + +% copy BESA files etc +% ------------------- +dipfitdefs; +mkdir(fullfile(outputfolder, 'help')); +tmpf = which('eeglablicense.txt'); copyfile(tmpf, fullfile(outputfolder, 'help', 'eeglablicense.txt')); +tmpf = which('eeg_optionsbackup.m'); copyfile(tmpf, fullfile(outputfolder, 'eeg_optionsbackup.txt')); +tmpf = which('eeg_options.m'); copyfile(tmpf, fullfile(outputfolder, 'eeg_options.txt')); +tmpf = which('mheadnew.xyz'); copyfile(tmpf, fullfile(outputfolder, 'mheadnew.xyz')); +tmpf = which('mheadnew.mat'); copyfile(tmpf, fullfile(outputfolder, 'mheadnew.mat')); +tmpf = which('mheadnew.elp'); copyfile(tmpf, fullfile(outputfolder, 'mheadnew.elp')); +tmpf = which('mheadnew.transform'); copyfile(tmpf, fullfile(outputfolder, 'mheadnew.transform')); +mkdir(fullfile(outputfolder, 'standard_BEM')); +mkdir(fullfile(outputfolder, 'standard_BEM', 'elec')); +copyfile(template_models(2).hdmfile , fullfile(outputfolder, 'standard_BEM', 'standard_vol.mat')); +copyfile(template_models(2).mrifile , fullfile(outputfolder, 'standard_BEM', 'standard_mri.mat')); +copyfile(template_models(2).chanfile, fullfile(outputfolder, 'standard_BEM', 'elec', 'standard_1005.elc')); +mkdir(fullfile(outputfolder, 'standard_BESA')); +copyfile(template_models(1).hdmfile , fullfile(outputfolder, 'standard_BESA', 'standard_BESA.mat')); +copyfile(template_models(1).mrifile , fullfile(outputfolder, 'standard_BESA', 'avg152t1.mat')); +copyfile(template_models(1).chanfile, fullfile(outputfolder, 'standard_BESA', 'standard-10-5-cap385.elp')); +copyfile(fullfile(path_biosig, 'doc', 'units.csv'), fullfile(outputfolder, 'units.csv')); +copyfile(fullfile(path_biosig, 'doc', 'leadidtable_scpecg.txt'), fullfile(outputfolder, 'leadidtable_scpecg.txt')); +copyfile(fullfile(path_biosig, 'doc', 'elecpos.txt'), fullfile(outputfolder, 'elecpos.txt')); +copyfile(fullfile(path_biosig, 'doc', 'DecimalFactors.txt'), fullfile(outputfolder, 'DecimalFactors.txt')); +copyfile('sample_locs', fullfile(outputfolder, 'sample_locs')); +copyfile('sample_data', fullfile(outputfolder, 'sample_data')); + +% copy all files for help +% ----------------------- +disp('Copying help files'); +allfiles = { allfiles1{:} allfiles2{:} }; +for index = 1:length(allfiles) + tmpp = which(allfiles{index}); + copyfile(tmpp, fullfile(outputfolder, 'help', allfiles{index})); +end; + +% copy MCR file and visual C++ librairies +% --------------------------------------- +if strcmpi(comp(1:2), 'PC') + copyfile(fullfile(matlabroot, 'toolbox', 'compiler', 'deploy', 'win32', 'MCRInstaller.exe'), fullfile(outputfolder, 'MCRInstaller.exe')); + copyfile(fullfile(matlabroot, 'bin', 'win32', 'vcredist_x86.exe'), fullfile(outputfolder, 'vcredist_x86.exe')); + + fid = fopen(fullfile(outputfolder, 'setup.bat'), 'w'); + if fid == -1, disp('Error: cannot create setup file'); + else + fprintf(fid, 'echo off\r\n'); + fprintf(fid, 'echo Deploying EEGLAB project.\r\n'); + fprintf(fid, 'echo Running MCRInstaller\r\n'); + fprintf(fid, 'echo You may delete the MCRInstaller.exe and vcredist_x86.exe file after setup is complete\r\n'); + fprintf(fid, 'MCRInstaller.exe\r\n'); + fprintf(fid, 'echo Running Visual C++ deployment functions\r\n'); + fprintf(fid, 'vcredist_x86.exe\r\n'); + fprintf(fid, 'echo Installation complete.\r\n'); + fprintf(fid, 'echo Please refer to the documentation for any additional setup steps.\r\n'); + fprintf(fid, 'echo Now starting EEGLAB...\r\n'); + fprintf(fid, 'echo To start EEGLAB in the future, simply click on the EEGLAB.EXE file\r\n'); + fprintf(fid, 'eeglab.exe\r\n'); + fclose(fid); + end; + fid = fopen(fullfile(outputfolder, 'eeglab.exe.manifest'), 'w'); + if fid == -1, disp('Error: cannot create manifest file'); + else + fprintf(fid, '\r\n'); + fprintf(fid, '\r\n'); + fprintf(fid, ' \r\n'); + fprintf(fid, ' \r\n'); + fprintf(fid, ' \r\n'); + fprintf(fid, ' \r\n'); + fprintf(fid, ' \r\n'); + fprintf(fid, '\r\n'); + fclose(fid); + end; +end; + +% cleaning up +% ----------- +try, movefile( [ path_vised '2' ], path_vised); catch, end; +try, movefile( fullfile(path_fileio, 'uint64'), fullfile(path_fileio, '@uint64') ); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'bufferold.m') , fullfile(path_fileio, 'private', 'buffer.m') ); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'read_24bitold.m') , fullfile(path_fileio, 'private', 'read_24bit.m')); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'read_ctf_shmold.m'), fullfile(path_fileio, 'private', 'read_ctf_shm.m')); catch, end; +try, movefile( fullfile(path_fileio, 'private', 'write_ctf_shmold.m'), fullfile(path_fileio, 'private', 'write_ctf_shm.m')); catch, end; +try, movefile( fullfile(path_fieldtrip, 'fileio', 'uint64'), fullfile(path_fieldtrip, 'fileio', '@uint64') ); catch, end; +try, movefile( fullfile(path_fieldtrip, 'uint64'), fullfile(path_fieldtrip, '@uint64') ); catch, end; +try, movefile( fullfile(path_fieldtrip, 'topoplotold.m'), fullfile(path_fieldtrip, 'topoplot.m') ); catch, end; + +return + +%histforexe(allfiles1, 'help'); + +% help for lisence +% + diff --git a/code/eeglab13_4_4b/functions/miscfunc/compmap.m b/code/eeglab13_4_4b/functions/miscfunc/compmap.m new file mode 100644 index 0000000..b791af4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/compmap.m @@ -0,0 +1,287 @@ +% compmap() - Plot multiple topoplot() maps of ICA component topographies +% Click on an individual map to view separately. +% Usage: +% >> compmap (winv,'eloc_file',compnos,'title',rowscols,labels,printflag) +% +% Inputs: +% winv - Inverse weight matrix = EEG scalp maps. Each column is a +% map; the rows correspond to the electrode positions +% defined in the eloc_file. Normally, winv = inv(weights*sphere). +% 'eloc_file' - Name of the eloctrode position file in the style defined +% by >> topoplot example {default|0 ->'chan_file'} +% compnos - Vector telling which (order of) component maps to show +% Indices <0 tell compmap to invert a map; = 0 leave blank sbplot +% Example [1 0 -2 3 0 -6] {default|0 -> 1:columns_in_winv} +% 'title' - Title string for each page {default|0 -> 'ICA Component Maps'} +% rowscols - Vector of the form [m,n] where m is total vertical tiles and n +% is horizontal tiles per page. If the number of maps exceeds m*n, +% multiple figures will be produced {def|0 -> one near-square page}. +% labels - Vector of numbers or a matrix of strings to use as labels for +% each map, else ' ' -> no labels {default|0 -> 1:ncolumns_in_winv} +% printflag - 0= screen-plot colors {default} +% 1= printer-plot colors +% +% Note: Map scaling is to +/-max(abs(data); green = 0 +% +% Author: Colin Humphries, CNL / Salk Institute, Aug, 1996 +% +% See also: topoplot() + +% This function calls topoplot(). and cbar(). + +% Copyright (C) Colin Humphries & Scott Makeig, CNL / Salk Institute, Aug, 1996 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Colin Humphries, CNL / Salk Institute, Aug, 1996 +% 03-97 revised -CH +% 11-05-97 revised for Matlab 5.0.0.4064; added negative compnnos option +% improved help msg; added figure offsets -Scott Makeig & CH +% 11-13-97 fixed compnos<0 bug -sm +% 11-18-97 added test for labels=comps -sm +% 12-08-97 added test for colorbar_tp() -sm +% 12-15-97 added axis('square'), see SQUARE below -sm +% 03-09-98 added test for eloc_file, fixed size checking for labels -sm +% 02-09-00 added test for ' ' for srclabels(1,1) -sm +% 02-23-00 added srclabels==' ' -> no labels -sm +% 03-16-00 added axcopy() -sm & tpj +% 02-25-01 added test for max(compnos) -sm +% 05-24-01 added HEADPLOT logical flag below -sm +% 01-25-02 reformated help & license -ad + +% NOTE: +% There is a minor problem with the Matlab function colorbar(). +% Use the toolbox cbar() instead. + +function compmap(Winv,eloc_file,compnos,titleval,pagesize,srclabels,printlabel,caxis) + + +DEFAULT_TITLE = 'ICA Component Maps'; +DEFAULT_EFILE = 'chan_file'; +NUMCONTOUR = 5; % topoplot() style settings +OUTPUT = 'screen'; % default: 'screen' for screen colors, + % 'printer' for printer colors +STYLE = 'both'; +INTERPLIMITS = 'head'; +MAPLIMITS = 'absmax'; +SQUARE = 1; % 1/0 flag making topoplot() asex square -> round heads +ELECTRODES = 'on'; % default: 'on' or 'off' +ELECTRODESIZE = []; % defaults 1-10 set in topoplot text. +HEADPLOT = 0; % 1/0 plot 3-D headplots instead of 2-d topoplots. + +if nargin<1 + help compmap + return +end + +curaxes = gca; +curpos = get(curaxes,'Position'); +mapaxes = axes('Position',[curpos(1) curpos(2)+0.09 curpos(3) curpos(4)-0.09],... + 'Visible','off'); + % leave room for cbar +set(mapaxes,'visible','off'); +pos = get(mapaxes,'Position'); + +% delete(gca); +% ax = axes('Position',pos); + +[chans, frames] = size (Winv); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% check inputs and set defaults +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin==8 + if strcmp(caxis(1,1:2), 'mi') % min/max of data + MAPLIMITS = [min(min(Winv(:,compnos))) max(max(Winv(:,compnos)))]; + elseif caxis(1,1:2) == 'ab' % +/-max abs data + absmax = max([abs(min(min(Winv(:,compnos)))) abs(max(max(Winv(:,compnos))))]); + MAPLIMITS = [-absmax absmax]; + elseif size(caxis) == [1,2] % given color axis limits + MAPLIMITS = caxis; + end % else default +end +if nargin < 7 + printlabel = 0; +end +if printlabel == 0 + printlabel = OUTPUT; % default set above +else + printlabel = 'printer'; +end + +if nargin < 6 + srclabels = 0; +end +if nargin < 5 + pagesize = 0; +end +if nargin < 4 + titleval = 0; +end +if nargin < 3 + compnos = 0; +end +if nargin < 2 + eloc_file = 0; +end + +if srclabels == 0 + srclabels = []; +end +if titleval == 0; + titleval = DEFAULT_TITLE; +end +if compnos == 0 + compnos = (1:frames); +end +if max(compnos)>frames + fprintf('compmap(): Cannot show comp %d. Only %d components in inverse weights\n',... + max(compnos),frames); + return +end +if pagesize == 0 + numsources = length(compnos); + DEFAULT_PAGE_SIZE = ... +[floor(sqrt(numsources)) ceil(numsources/floor(sqrt(numsources)))]; + m = DEFAULT_PAGE_SIZE(1); + n = DEFAULT_PAGE_SIZE(2); +elseif length(pagesize) ==1 + help compmap + return +else + m = pagesize(1); + n = pagesize(2); +end +if eloc_file == 0 + eloc_file = DEFAULT_EFILE; +end + +totalsources = length(compnos); +if ~isempty(srclabels) + if ~ischar(srclabels(1,1)) | srclabels(1,1)==' ' % if numbers + if size(srclabels,1) == 1 + srclabels = srclabels'; + end + end + if size(srclabels,1)==1 & size(srclabels,2)==1 & srclabels==' ' + srclabels = repmat(srclabels,totalsources,1); + end + if size(srclabels,1) ~= totalsources, + fprintf('compmap(): numbers of components and component labels do not agree.\n'); + return + end +end +pages = ceil(totalsources/(m*n)); +if pages > 1 + fprintf('compmap(): will create %d figures of %d by %d maps: ',... + pages,m,n); +end + +off = [ 25 -25 0 0]; % position offsets for multiple figures + +fid = fopen(eloc_file); +if fid<1, + fprintf('compmap()^G: cannot open eloc_file (%s).\n',eloc_file); + return +end +fclose(fid); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% plot the maps %%%%%%%%%%%%%%%%%%%%%%% + +for i = (1:pages) + if i > 1 + figure('Position',pos+(i-1)*off); % place figures in right-downward stack + set(gca,'Color','w') %CJH - set background color to white + curaxes = gca; + curpos = get(curaxes,'Position'); % new whole-figure axes + end + + if (totalsources > i*m*n) + sbreak = n*m; + else + sbreak = totalsources - (i-1)*m*n; % change page/figure after this many + end + + for j = (1:sbreak) % maps on this page/figure + comp = j+(i-1)*m*n; % compno index + if compnos(comp)~=0 + if compnos(comp)>0 + source_var = Winv(:,compnos(comp))'; % plot map + elseif compnos(comp)<0 + source_var = -1*Winv(:,-1*compnos(comp))'; % invert map + end + + sbplot(m,n,j,'ax',mapaxes); + if HEADPLOT + headplot(source_var,eloc_file,'electrodes','off'); % 3-d image + else + topoplot(source_var,eloc_file,... + 'style',STYLE,... + 'electrodes',ELECTRODES,... + 'emarkersize',ELECTRODESIZE,... + 'numcontour',NUMCONTOUR,... + 'interplimits',INTERPLIMITS,... + 'maplimits',MAPLIMITS); % draw 2-d scalp map + end + if SQUARE, + axis('square'); + end + + if isempty(srclabels) + title(int2str(compnos(comp))) ; + else + if ischar(srclabels) + title(srclabels(comp,:)); + else + title(num2str(srclabels(comp))); + end + end + drawnow % draw one map at a time + end + end + + % ax = axes('Units','Normal','Position',[.5 .06 .32 .05],'Visible','Off'); + axes(curaxes); + set(gca,'Visible','off','Units','normalized'); + curpos = get(gca,'position'); + ax = axes('Units','Normalized','Position',... + [curpos(1)+0.5*curpos(3) curpos(2)+0.01*curpos(4) ... + 0.32*curpos(3) 0.05*curpos(4)],'Visible','Off'); + if exist('cbar') == 2 + cbar(ax); % Slightly altered Matlab colorbar() + % Write authors for further information. + else + colorbar(ax); % Note: there is a minor problem with this call. + end + axval = axis; + Xlim = get(ax,'Xlim'); + set(ax,'XTick',(Xlim(2)+Xlim(1))/2); + set(ax,'XTickMode','manual'); + set(ax,'XTickLabelMode','manual'); + set(ax,'XTickLabel','0'); + + axes(curaxes); + axis off; + % axbig = axes('Units','Normalized','Position',[0 0 1 1],'Visible','off'); + t1 = text(.25,.07,titleval,'HorizontalAlignment','center'); + if pages > 1 + fprintf('%d ',i); + end + axcopy(gcf); % allow popup window of single map with mouse click +end +if pages > 1 + fprintf('\n'); +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/compplot.m b/code/eeglab13_4_4b/functions/miscfunc/compplot.m new file mode 100644 index 0000000..4e296e2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/compplot.m @@ -0,0 +1,162 @@ +% compplot() - plot a data epoch and maps its scalp topography at a given time +% +% Usage: To plot the projection of an ICA component onto the scalp +% >> projdata = icaproj(data,weights,compindex); +% +% then >> compplot(projdata); +% +% else to plot an EEG epoch with a topoplot at one selected time point +% >> compplot(data,plotframe,chan_file,xstart,srate,title, splinefile); +% +% Inputs: +% data = data returned from icaproj() *ELSE* any EEG/ERP data epoch +% plotframe = frame to plot topographically {default|0 -> frame of max(var())} +% 'chan_file' = chan file, see >> topoplot example {def|0 -> 'chan_file'} +% xstart = start time in seconds {default|0 -> 0} +% srate = data sampling rate in Hz {default|0 -> 256 Hz} +% 'title' = plot title {default|0 -> none} +% splinefile = headplot spline file (optional) for 3-d head image {default: none} +% +% Authors: Colin Humphries & Scott Makeig, SCCN/INC/UCSD, CNL / Salk Institute, 1997 +% +% See also: icaproj() + +% Copyright (C) 2000 Colin Humphries & Scott Makeig, SCCN/INC/UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 6-07-97 changed order of args in icaproj above -sm +% Revised for Matlab 5.0.0.4064 11/97 -ch & sm +% 2-18-98 added undocumented headplot() option -sm +% 3-09-98 added check for chan_file -sm +% 3-18-98 use new eegplot('noui') -sm +% 7-25-98 make sure length(hkids) >= 3 on line 122 ff -sm +% 12-19-00 updated icaproj() call in help msg -sm +% 1-24-01 corrected input error in header -ad +% 01-25-02 reformated help & license, added links -ad + +function M = compplot(data,plotframe,chan_file,xstart,srate,titl,spline_file) + +if nargin < 1 + help compplot + return +end + +[chans,frames] = size(data); +icadefs; % read DEFAULT_SRATE + +if nargin < 7 + spline_file = nan; +end +if nargin < 6, + titl = ''; % DEFAULT TITLE +end +if nargin < 5 + srate = 0; +end +if nargin < 4 + xstart = 0; % DEFAULT START TIME +end +if nargin < 3 + chan_file = 'chan_file'; % DEFAULT CHAN_FILE +end +if chan_file == 0, + chan_file = 'chan_file'; % DEFAULT CHAN_FILE +end +if nargin < 2 + plotframe = 0; +end +if plotframe == 0 + [mx plotframe] = max(mean(data.*data)); + % default plotting frame has max variance +end +if plotframe > frames + fprintf('Plot frame %d is > frames in data (%d)\n',plotframe,frames); + return +end +fprintf('Topoplot will show frame %d\n',plotframe); +if nargin < 1 + help compplot +end + +if srate==0, + srate = DEFAULT_SRATE; +end + +clf % clear the current figure +set(gcf,'Color',BACKCOLOR); % set the background color +axe = axes('Units','Normalized','Position',[.75 .12 .2 .8]); +set(gca,'Color','none'); + +% >> eegplot('noui',data,srate,spacing,eloc_file,startsec,color) +eegplot('noui',-data(:,xstart*srate+1:end),srate,0,chan_file,0,'r') + +plottime = xstart + (plotframe-1)/srate; +timetext = num2str(plottime,'%4.3f'); +set(gca,'XTick',plotframe,'XtickLabel',timetext) %%CJH +set(gca,'Color','none'); + +limits = get(gca,'Ylim'); +set(gca,'GridLineStyle',':') +set(gca,'Xgrid','off') +set(gca,'Ygrid','on') + +% axes(axe) +plottime = xstart + (plotframe-1)/srate; +l1 = line([plotframe plotframe],limits,'color','b'); % was [plottime plottime] + +fid = fopen(chan_file); % check whether topoplot will find chan_fil +if fid<1, + fprintf('topoplot()^G: cannot open eloc_file (%s).\n',chan_file); + return +end + +axcolor = get(gcf,'Color'); +axt = axes('Units','Normalized','Position',[.00 .10 .75 .80],'Color',axcolor); +axes(axt) % topoplot axes +cla +if isnan(spline_file) + topoplot(data(:,plotframe),chan_file,'style','both'); +else + headplot(data(:,plotframe),spline_file); +end +text(0.00,0.70,titl,'FontSize',14,'HorizontalAlignment','Center'); + +axt = axes('Units','Normalized','Position',[.05 .05 .055 .18]); % colorbar axes +h=cbar(axt); + +% hkids=get(h,'children'); +% delno = 3; +% if delno > length(hkids) +% delno = length(hkids); +% end +% for i=1:delno +% delete(hkids(i)); +% end + +axis(axis) +set(h,'XTickLabel',[]); +HYLIM = get(h,'YLim'); %%CJH +set(h,'YTick',[HYLIM(1) (HYLIM(1)+HYLIM(2))/2 HYLIM(2)]) %%CJH +set(h,'YTickLabel',['-';'0';'+']); %%CJH +set(h,'YTickMode','manual'); + +axt = axes('Units','Normalized','Position',[0 0 1 1],... + 'Visible','Off','Fontsize',16); % topoplot axes +axes(axt) +timetext = [ 't = ',num2str(plottime) ' s']; +text(0.16,0.09,timetext,'FontSize',14); +text(0.85,0.04,'Time (sec)','FontSize',14,'HorizontalAlignment','Center'); + diff --git a/code/eeglab13_4_4b/functions/miscfunc/compsort.m b/code/eeglab13_4_4b/functions/miscfunc/compsort.m new file mode 100644 index 0000000..c96b07b --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/compsort.m @@ -0,0 +1,223 @@ +% compsort() - reorder ICA components, first largest to smallest by the size +% of their maximum variance in the single-component projections, +% then (if specified) the nlargest component projections are +% reordered by the (within-epoch) time point at which they reach +% their max variance. +% +% Usage: +% >> [windex,maxvar,maxframe,maxepoch,maxmap] ... +% = compsort(data,weights,sphere,datamean, ... +% frames,nlargest,chanlist); +% Inputs: +% data = (chans,frames*epochs) the input data set decomposed by runica() +% weights = ica weight matrix returned by runica() +% sphere = sphering matrix returned by runica() +% +% Optional: +% datamean = means removed from each row*epoch in runica() +% (Note: 0 -> input data means are distributed among components +% : 1 -> input data means are removed from the components (default)) +% frames = frames per epoch in data (0 -> all) +% nlargest = number of largest ICA components to order by latency to max var +% (other returned in reverse order of variance) (0 -> none) +% chanlist = list of channel numbers to sort on (0 -> all) +% +% Outputs: +% windex = permuted order of rows in output weights (1-chans) +% maxvar = maximum variance of projected components (in perm. order) +% maxframe = frame of maximum variance (1-frames) (in perm. order) +% maxepoch = epoch number of frame of maxvar (1-nepochs) (in perm. order) +% maxmap = projected scalp map at max (in perm. order) +% +% Authors: Scott Makeig, SCCN/INC/UCSD, La Jolla, 1996 +% +% See also: runica() + +% Copyright (C) 1996 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 11-30-96 as compsort.m +% 12-19-96 moved def of epochs below default frames def -sm +% 02-18-97 added chanlist -sm +% 03-11-97 added default chanlist=0 -> all chans, fixed datamean and var() -sm +% 03-17-97 made nlargest default -> nlargest=0 -sm +% 04-03-97 fixed problems and removed permweights, permcomps outputs -sm +% 04-04-97 shortened name to compsort() -sm +% 06-05-97 corrected variance computation -sm +% 06-07-97 changed order of args to conform to runica -sm +% 06-10-97 fixed recent bug in maxvar order -sm +% 07-23-97 made datamean==0 distribute means among components -sm +% 08-04-97 added datamean=1 option -sm +% 01-25-02 reformated help & license, added links -ad + +function [windex,maxvar,maxframe,maxepoch,maxmap] = compsort(data,weights,sphere,datamean,frames,nlargest,chanlist) + +if nargin<3, + fprintf('compsort(): needs at least three arguments.\n\n'); + help compsort + return +end + +[chans,framestot] = size(data); +if framestot==0, + fprintf('Gcompsort(): cannot process an empty data array.\n'); + return +end; +[srows,scols] = size(sphere); +[wrows,wcols] = size(weights); + +if nargin<7, + chanlist = [1:chans]; +end +if chanlist==0, + chanlist = [1:chans]; +end +if length(chanlist)~=chans & wrows1 + chanlist = chanlist'; % make a row vector +end +if size(chanlist,1)>1 + fprintf('compsort(): chanlist must be a vector.\n'); + return +end +if nargin<6, + nlargest=0; +end; +if nargin<5, + frames = 0; +end; +if nargin<4, + datamean = 1; +end; +if frames ==0, + frames = framestot; +end +epochs = framestot/frames; + +% activations = (wrows,wcols)x(srows,scols)x(chans,framestot) +if chans ~= scols | srows ~= wcols, + fprintf('compsort(): input data dimensions do not match.\n'); + fprintf(... + ' i.e., Either chans %d ~= sphere cols %d or sphere rows %d ~= weights cols %d\n',... + chans,scols,srows,wcols); + return +end +if wrows ~= chans & nlargest ~= 0 & nlargest ~= wrows, + fprintf(... + 'compsort(): cannot project components back to order by size - nchans ~= ncomponents.\n'); + return +end +if floor(framestot/frames)*frames ~= framestot + fprintf(... + 'compsort(): input data frames does not divide data length.\n'); + return +end + +if nlargest > wrows, + fprintf(... + 'compsort(): there are only %d rows in the weight matrix.\n',wrows); + return +end + +if epochs ~= floor(epochs), + fprintf(... + 'compsort(): input frames does not subdivide data length.\n'); + return +end + +% +%%%%%%%%%%%%%%%%%%%% Reorder weight matrix %%%%%%%%%%%%%%%%%%%%% +% +if datamean == 1, + data = data - mean(data')'*ones(1,framestot); % remove channel means + +elseif datamean~=0, % remove given means + if size(datamean,2) ~= epochs | size(datamean,1) ~= chans, + fprintf('compsort(): datamean must be 0, 1, or (chans,epochs)\n'); + return + end + for e=1:epochs + data(:,(e-1)*frames+1:e*frames) = data(:,(e-1)*frames+1:e*frames)... + - datamean(:,e)*ones(1,frames); + end +end % compute mean data matrix inherited from runica() + +comps = weights*sphere*data; % Note: distributes means if datamean==0 + +maxvar = zeros(wrows,1); % size of the projections +maxframe = zeros(wrows,1); % frame of the abs(max) projection +maxepoch = zeros(wrows,1); % epoch of the abs(max) projection + +maxmap = zeros(wrows,chans); % leave 0s unless weights is square +if chans==wrows, + icainv = inv(weights*sphere); + fprintf('Computing projected variance for all %d components:\n',wrows); + for s=1:wrows + fprintf('%d ',s); % construct single-component data matrix + % project to scalp + compproj = icainv(:,s)*comps(s,:); + compv = zeros(frames*epochs,1); + compv = (sum(compproj(chanlist,:).*compproj(chanlist,:)))' ... + /(length(chanlist)-1); + [m,mi] = max(compv); % find max variance + maxvar(s) = m; + maxframe(s)=rem(mi,frames); % count from beginning of each epoch! + maxepoch(s)=floor(mi/frames)+1;% record epoch number of max + if maxframe(s)==0, % if max var is in last frame . . . + maxframe(s) = frames; + maxepoch(s) = maxepoch(s)-1; + end + maxmap(:,s) = compproj(:,mi); % record scalp projection at max(var(proj)) + end + +else % weight matrix is non-square, sort components by latency only + fprintf('compsort() - non-square weights - finding max latencies.\n'); + for s=1:wrows + compv = comps(s).*comps(s,:)'; % get variance analogues at each time point + [m,mi] = max(abs(compv)'); % find abs(max)'s + maxvar(s) = m; + maxframe(s)=rem(mi,frames); % count from beginning of each epoch! + maxepoch(s)=floor(mi/frames)+1;% record epoch number of max + if maxframe(s)==0, % if max var is in last frame . . . + maxframe(s) = frames; + maxepoch(s) = maxepoch(s)-1; + end + end +end +fprintf('\n'); + +[maxvar windex] = sort(maxvar');% sort components by relative size +windex = windex(wrows:-1:1)'; % reverse order +maxvar = maxvar(wrows:-1:1)'; % make each returned vector a column vector + +% Note: maxvar reordered by sort() above +maxframe = maxframe(windex); % reorder maxframes +maxepoch = maxepoch(windex); % reorder maxepoch +maxmap = maxmap(:,windex); % reorder maxmap columns + +if nlargest>0, + fprintf('Ordering largest %d components by frame of abs(max): ',nlargest); + [m mfi] = sort(maxframe(1:nlargest)); % sort by frame order + windex(1:nlargest) = windex(mfi); + maxframe(1:nlargest) = m; + maxvar(1:nlargest) = maxvar(mfi); + maxepoch(1:nlargest) = maxepoch(mfi); + maxmap(:,1:nlargest) = maxmap(:,mfi); % reorder largest maxmap columns + fprintf('\n'); +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/convolve.m b/code/eeglab13_4_4b/functions/miscfunc/convolve.m new file mode 100644 index 0000000..1bda40a --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/convolve.m @@ -0,0 +1,54 @@ +% convolve() - convolve two matrices (normalize by the sum of convolved +% elements to compensate for border effects). +% +% Usage: +% >> r = convolve( a, b ); +% +% Inputs: +% a - first input vector +% b - second input vector +% +% Outputs: +% r - result of the convolution +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: conv2(), conv() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function R = convolve( A, B ) + +% size of B must be odd + +% convolve A and B (normalize by the sum of convolved elements) +% ------------------------------------------------------------- +R = zeros( size(A) ); +for index = 1:length(A) + sumconvo = 0; + for indexB = 1:length(B) + indexconvo = indexB-1-round(length(B)/2); + indexA = index + indexconvo+1; + if indexA > 0 & indexA <= length(A) + R(index) = R(index) + B(indexB)*A(indexA); + sumconvo = sumconvo + B(indexB); + end; + end; + R(index) = R(index) / sumconvo; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/corrimage.m b/code/eeglab13_4_4b/functions/miscfunc/corrimage.m new file mode 100644 index 0000000..3562c5f --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/corrimage.m @@ -0,0 +1,609 @@ +% corrimage() - compute correlation image between an event and amplitude +% and phase in the time-frequency domain. +% +% Usage: +% corrimage(data, sortvar, times); +% [times, freqs, alpha, sigout, limits ] = corrimage(data, sortvar, ... +% times, 'key1', val1, 'key2', val2, ...) +% +% Inputs: +% data - [float array] data of size (times,trials) +% sortvar - [float array] sorting variable of size (trials) +% times - [float array] time indices for every data point. Size of +% (times). Note: same input as the times vector for erpimage. +% +% Optional input: +% 'mode' - ['phase'|'amp'] compute correlation of event values with +% phase ('phase') or amplitude ('amp') of signal at the +% given time-frequency points. Default is 'amp'. +% 'freqs' - [min nfreqs max] build a frequency vector of size nfreqs +% with frequency spaced in a log scale. Then compute +% correlation at these frequency value. +% Default is 50 points in a log scale between 2.5Hz to 50Hz. +% 'times' - [float vector] compute correlation at these time value (ms). +% (uses closest times points in 'times' input and return +% them in the times output). +% Default is 100 steps between min time+5% of time range and +% max time-5%. Enter only 2 values [N X] to generate N +% time points and trim by X %. If N is negative, uses it as +% a subsampling factor [-3 5] trims times by 5% and subsample +% by 3 (by subsampling one obtains a regularly spaced times). +% 'trim' - [low high] low and high percentile of sorted sortvar values +% to retain. i.e. [5 95] remove the 5 lowest and highest +% percentile of sortvar values (and associated data) before +% computing statistics. Default is [0 100]. +% 'align' - [float] same as 'align' parameter of erpimage(). This +% parameter is used to contrain the 'times' parameter so +% correlation with data trials containing 0-values (as a +% result of data alignment) are avoided: computing these +% correlations would produce spurious significant results. +% Default is no alignment. +% 'method' - ['erpimage'|timefreq'] use either the erpimage() function +% of the timefreq() function to compute spectral decomposition. +% Default is 'timefreq' for speed reasons (note that both +% methods should return the same results). +% 'erpout' - [min max] regress out ERP using the selected time-window [min +% max] in ms (the ERP is subtracted from the whole time period +% but only regressed out in the selected time window). +% 'triallimit' - [integer array] specify trial boundaries for subjects. For +% instance [1 200 400] indicates 2 subjects, trials 1 to 199 +% for subject 1 and trials 200 to 399 for subject 2. This is +% currently only used for regressing erp out. +% +% Processing options: +% 'erpimopt' - [cell array] erpimage additional options (number of cycle ...). +% 'tfopt' - [cell array] timefreq additional options (number of cycle ...). +% +% Plotting options: +% 'plotvals' - [cell array of output values] enter output values here +% { times freqs alpha sigout} to replot them. +% 'nofig' - ['on'|'off'] do not create figure. +% 'cbar' - ['on'|'off'] plot color bar. Default: 'on'. +% 'smooth' - ['on'|'off'] smooth significance array. Default: 'on'. +% 'plot' - ['no'|'alpha'|'sigout'|'sigoutm'|'sigoutm2'] plot -10*log(alpha) +% values ('alpha'); output signal (slope or ITC) ('sigout'), +% output signal masked by significance ('sigoutm') or the last +% 2 option combined ('sigoutm2'). 'no' prevent the function +% from plotting. In addition, see pmask. Default is 'sigoutmasked'. +% 'pmask' - [real] maximum p value to show in plot. Default is 0.00001 +% (0.001 taking into account multiple comparisons (100)). Enter +% 0.9XXX to get the higher tail or a negative value (e.e., -0.001 +% to get both tails). +% 'vert' - [real array] time vector for vertivcal lines. +% 'limits' - [min max] plotting limits. +% +% Outputs: +% times - [float vector] vector of times (ms) +% freqs - [float vector] vector of frequencies (Hz) +% alpha - [float array] array (freqs,times) of p-values. +% sigout - [float array] array (freqs,times) of signal out (coherence +% for phase and slope for amplitude). +% +% Important note: the 'timefreq' method may truncate the time window to +% compute the spectral decomposition at the lowest freq. +% +% Author: Arnaud Delorme & Scott Makeig, SCCN UCSD, +% and CNL Salk Institute, 18 April 2003 +% +% See also: erpimage() + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2002 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [time, freq, alpha, sigout, limits, tf, sortvar] = corrimage(data, sortvar, timevect, varargin) + +if nargin < 3 + help corrimage; + return; +end; + +if isempty(timevect), timevect = [1 2]; end; + +% check inputs +% ------------ +g = finputcheck(varargin, { 'freqs' 'real' [0 Inf] [2.5 50 50]; + 'times' 'real' [] [100 5]; % see function at the end + 'mode' 'string' { 'phase','amp' } 'amp'; + 'vert' 'real' [] []; + 'align' { 'real','cell' } [] []; + 'plotvals' 'cell' [] {}; + 'pmask' 'real' [] 0.00001; + 'triallimit' 'integer' [] []; + 'trim' 'real' [0 100] [0 100]; + 'limits' 'real' [] []; + 'method' 'string' { 'erpimage','timefreq' } 'timefreq'; + 'plot' 'string' { 'no','alpha','sigout','sigoutm','sigoutp','sigoutm2' } 'sigoutm'; + 'nofig' 'string' { 'on','off' } 'off'; + 'cbar' 'string' { 'on','off' } 'on'; + 'smooth' 'string' { 'on','off' } 'off'; + 'erpout' 'real' [] []; + 'tfopt' 'cell' [] {}; + 'erpimopt' 'cell' [] {} }); +if isstr(g), error(g); end; + +fprintf('Generating %d frequencies in log scale (ignore message on linear scale)\n', g.freqs(2)); +g.freqs = logscale(g.freqs(1), g.freqs(3), g.freqs(2)); + +frames = length(timevect); +if size(data,1) == 1 + data = reshape(data, frames, size(data,2)*size(data,3)/frames); +end; + +% trim sortvar values +% ------------------- +[sortvar sortorder] = sort(sortvar); +data = data(:, sortorder); +len = length(sortvar); +lowindex = round(len*g.trim(1)/100)+1; +highindex = round(len*g.trim(2)/100); +sortvar = sortvar(lowindex:highindex); +data = data(:, lowindex:highindex); +if lowindex ~=1 | highindex ~= length(sortorder) + fprintf('Actual percentiles %1.2f-%1.2f (indices 1-%d -> %d-%d): event vals min %3.2f; max %3.2f\n', ... + 100*(lowindex-1)/len, 100*highindex/len, len, lowindex, highindex, min(sortvar), max(sortvar)); +end; + +% assign subject number for each trial +% ------------------------------------ +if ~isempty(g.triallimit) + alltrials = zeros(1,len); + for index = 1:length(g.triallimit)-1 + alltrials([g.triallimit(index):g.triallimit(index+1)-1]) = index; + end; + alltrials = alltrials(sortorder); + alltrials = alltrials(lowindex:highindex); +end; + +%figure; hist(sortvar) + +% constraining time values depending on data alignment +% ---------------------------------------------------- +srate = 1000*(length(timevect)-1)/(timevect(end)-timevect(1)); +if ~isempty(g.align) + + if iscell(g.align) + fprintf('Realigned sortvar plotted at %g ms.\n',g.align{1}); + shifts = round((g.align{1}-g.align{2})*srate/1000); % shifts can be positive or negative + g.align = g.align{1}; + else + if isinf(g.align) + g.align = median(sortvar); + end + fprintf('Realigned sortvar plotted at %g ms.\n',g.align); + + % compute shifts + % -------------- + shifts = round((g.align-sortvar)*srate/1000); % shifts can be positive or negative + end; + + %figure; hist(shifts) + minshift = min(shifts); % negative + maxshift = max(shifts); % positive + if minshift > 0, error('minshift has to be negative'); end; + if maxshift < 0, error('maxshift has to be positive'); end; + + % realign data for all trials + % --------------------------- + aligndata=zeros(size(data))+NaN; % begin with matrix of zeros() + for t=1:size(data,2), %%%%%%%%% foreach trial %%%%%%%%% + shft = shifts(t); + if shft>0, % shift right + aligndata(shft+1:frames,t)=data(1:frames-shft,t); + elseif shft < 0 % shift left + aligndata(1:frames+shft,t)=data(1-shft:frames,t); + else % shft == 0 + aligndata(:,t) = data(:,t); + end + end % end trial + data = aligndata(maxshift+1:frames+minshift,:); + if any(any(isnan(data))), error('NaNs remaining after data alignment'); end; + timevect = timevect(maxshift+1:frames+minshift); + + % take the time vector subset + % --------------------------- + if isempty(timevect), error('Shift too big, empty time vector'); + else fprintf('Time vector truncated for data alignment between %1.0f and %1.0f\n', ... + min(timevect), max(timevect)); + end; +end; + +% regress out the ERP from the data (4 times to have residual ERP close to 0) +% --------------------------------------------------------------------------- +if ~isempty(g.erpout) + %data = erpregout(data); + %data = erpregout(data); + %data = erpregout(data); + disp('Regressing out ERP'); + erpbeg = mean(data,2); + if ~isempty(g.triallimit) + for index = 1:length(g.triallimit)-1 + trials = find(alltrials == index); + %[data(:,trials) erp factors]= erpregout(data(:,trials), [timevect(1) timevect(end)], [300 400]); + erpstart = mean(data(:,trials),2); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + erpend = mean(data(:,trials),2); + fprintf([ '***********************************************\n' ... + 'Ratio in ERP after regression (compare to before) is %3.2f\n' ... + '***********************************************\n' ], mean(erpend./erpstart)); + end; + end; + erpend = mean(data,2); + fprintf([ '***********************************************\n' ... + 'Ratio in grand ERP after regression (compare to before) is %3.2f\n' ... + '***********************************************\n' ], mean(erpend./erpbeg)); + + if 0 + %trials = find(alltrials == 1); + data2 = data; + dasf + + [data(:,trials) erp factors]= erpregout(data(:,trials), [timevect(1) timevect(end)], [300 400]); + + figure; subplot(1,2,1); erpimage(data, sortvar, timevect, '', 300, 500, 'erp'); + + figure; + subplot(1,2,1); erpimage(data2, sortvar, timevect, '', 300, 500, 'erp'); + subplot(1,2,2); erpimage(data , sortvar, timevect, '', 300, 500, 'erp'); + + figure; + subplot(1,2,1); erpimage(data2(:,trials), sortvar(trials), timevect, '', 0, 0, 'erp'); + subplot(1,2,2); erpimage(data (:,trials), sortvar(trials), timevect, '', 0, 0, 'erp'); + + + figure; + for index = 1:length(g.triallimit)-1 + subplot(3,5,index); + trials = find(alltrials == index); + erpimage(data(:,trials), sortvar(trials), timevect, '', 50, 100, 'erp'); + end; + + disp('Regressing out ERP'); + if ~isempty(g.triallimit) + for index = 1:length(g.triallimit)-1 + trials = find(alltrials == index); + [data(:,trials) erp factors]= erpregout(data(:,trials), [timevect(1) timevect(end)], [300 400]); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + data(:,trials) = erpregout(data(:,trials)); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + %data(:,trials) = erpregout(data(:,trials), [timevect(1) timevect(end)], g.erpout); + end; + else + %data = erpregout(data, [timevect(1) timevect(end)], g.erpout); + end; + end; +end; + +% generate time points +% -------------------- +g.times = gettimes(timevect, g.times); +data = reshape(data, 1, size(data,2)*size(data,1)); + +% time frequency decomposition +% ---------------------------- +if strcmpi(g.method, 'timefreq') & isempty(g.plotvals) + data = reshape(data, length(data)/length(sortvar), length(sortvar)); + [tf, g.freqs, g.times] = timefreq(data, srate, 'freqs', g.freqs, 'timesout', g.times, ... + 'tlimits', [min(timevect) max(timevect)], 'wavelet', 3); + outvar = sortvar; +end; + +% compute correlation +% ------------------- +if strcmpi(g.mode, 'phase') & isempty(g.plotvals) + for freq = 1:length(g.freqs) + fprintf('Computing correlation with phase %3.2f Hz ----------------------\n', g.freqs(freq)); + for time = 1:length(g.times) + if strcmpi(g.method, 'erpimage') + [outdata,outvar,outtrials,limits,axhndls,erp, ... + amps,cohers,cohsig,ampsig,outamps,phsangls,phsamp,sortidx] =erpimage(data,sortvar,timevect, ... + '', 0,0,g.erpimopt{:}, 'phasesort', [g.times(time) 0 g.freqs(freq)], 'noshow', 'yes'); + else + phsangls = angle( squeeze(tf(freq, time, :))' ); + end; + + % computing ITCs + [ ITC(freq, time) alpha(freq, time) ] = ... + bootcircle(outvar/mean(outvar), exp(j*phsangls), 'naccu', 250); + + % accumulate 200 values, fitted with a normal distribution + % -------------------------------------------------------- + %cmplx = outvar .* exp(j*phsangls)/mean(outvar); + %ITC(freq, time) = mean(cmplx); + %alpha(freq,time) = bootstat(outvar/mean(outvar), exp(j*phsangls), 'res = mean(arg1 .* arg2)', ... + % 'naccu', 100, 'vals', abs(ITC(freq, time)), 'distfit', 'norm'); + end; + end; + sigout = ITC; +elseif isempty(g.plotvals) + for freq = 1:length(g.freqs) + fprintf('Computing correlation with amplitude %3.2f Hz ----------------------\n', g.freqs(freq)); + for time = 1:length(g.times) + if strcmpi(g.method, 'erpimage') + [outdata,outvar,outtrials,limits,axhndls,erp, ... + amps,cohers,cohsig,ampsig,outamps,phsangls,phsamp,sortidx] =erpimage(data,sortvar,timevect, ... + '', 0,0,g.erpimopt{:}, 'ampsort', [g.times(time) 0 g.freqs(freq)], 'noshow', 'yes'); + else + phsamp = abs(squeeze(tf(freq, time, :)))'; + end; + + % computing ITCs + [ypred alpha(freq, time) Rsq slope(freq, time)] = myregress(outvar, 20*log10(phsamp)); + end; + end; + sigout = slope; +else + g.times = g.plotvals{1}; + g.freqs = g.plotvals{2}; + alpha = g.plotvals{3}; + sigout = g.plotvals{4}; +end; + +% plot correlation +% ---------------- +if ~strcmp('plot', 'no') + if ~isreal(sigout), + if strcmpi(g.plot, 'sigoutp') + sigoutplot = angle(sigout); + else + sigoutplot = abs(sigout); + end; + else sigoutplot = sigout; + end; + sigouttmp = sigoutplot; + if strcmpi(g.smooth, 'on') + tmpfilt = gauss2d(3,3,.3,.3); + tmpfilt = tmpfilt/sum(sum(tmpfilt)); + alpha = conv2(alpha, tmpfilt, 'same'); + end; + + % mask signal out + if g.pmask > 0.5 + indices = find( alpha(:) < g.pmask); + sigouttmp = sigoutplot; + sigouttmp(indices) = 0; + elseif g.pmask < 0 % both sides, i.e. 0.01 + sigouttmp = sigoutplot; + indices = intersect_bc(find( alpha(:) > -g.pmask), find( alpha(:) < 1+g.pmask)); + sigouttmp(indices) = 0; + else + sigouttmp = sigoutplot; + indices = find( alpha(:) > g.pmask); + sigouttmp(indices) = 0; + end; + + if strcmpi(g.nofig, 'off'), figure; end; + switch g.plot + case 'alpha', limits = plotfig(g.times, g.freqs, -log10(alpha), g); + case 'sigout', limits = plotfigsim(g.times, g.freqs, sigoutplot, g); + case { 'sigoutm' 'sigoutp' }, limits = plotfigsim(g.times, g.freqs, sigouttmp, g); + case 'sigoutm2', limits = subplot(1,2,1); plotfigsim(g.times, g.freqs, sigoutplot, g); + limits = subplot(1,2,2); plotfigsim(g.times, g.freqs, sigouttmp, g); + end; +end; + +time = g.times; +freq = g.freqs; + +return; + +% formula for the normal distribution +% ----------------------------------- +function y = norm(mu, sigma, x); + +y = 1/sqrt(2) * exp( -(x-mu).^2/(sigma*sigma*2) ) / (sqrt(pi)*sigma); + +% get time points +% --------------- +function val = gettimes(timevect, timevar); + if length(timevar) == 2 + + if timevar(1) > 0 + % generate linearly space vector + % ------------------------------ + npoints = timevar(1); + trim = timevar(2); + if length(timevect)-2*round(trim/100*length(timevect)) < npoints + npoints = length(timevect)-round(trim/100*length(timevect)); + end; + fprintf('Generating %d times points trimmed by %1.1f percent\n', npoints, trim); + timer = max(timevect) - min(timevect); + maxt = max(timevect)-timer*trim/100; + mint = min(timevect)+timer*trim/100; + val = linspace(mint,maxt, npoints); + else + % subsample data + % -------------- + nsub = -timevar(1); + trim = timevar(2); + len = length(timevect); + trimtimevect = timevect(round(trim/100*len)+1:len-round(trim/100*len)); + fprintf('Subsampling by %d and triming data by %1.1f percent (%d points)\n', nsub, trim, round(trim/100*len)); + val = trimtimevect(1:nsub:end); + end; + else + val = timevar; + end; + + % find closet points in data + oldval = val; + for index = 1:length(val) + [dum ind] = min(abs(timevect-val(index))); + val(index) = timevect(ind); + end; + if length(val) < length(unique(val)) + disp('Warning: duplicate times, reduce the number of output times'); + end; + if all(oldval == val) + disp('Debug msg: Time value unchanged by finding closest in data'); + end; + +% get log scale (for frequency) +% ------------- +function val = logscale(a,b,n); + %val = [5 7 9]; return; + val = linspace(log(a), log(b), n); + val = exp(val); + +% plot figure +% ----------- +function limits = plotfig(times, freqs, vals, g) + icadefs; + imagesc(times, [1:size(vals,1)], vals); + + colormap(DEFAULT_COLORMAP); + ticks = linspace(1, size(vals,1), length(freqs)); + ticks = ticks(1:4:end); + set(gca, 'ytick', ticks); + set(gca, 'yticklabel', num2str(freqs(1:4:end)', 3)) + + xlabel('Time (ms)'); ylabel('Freq (Hz)'); + if ~isempty(g.limits), caxis(g.limits); end; + limits = caxis; + if ~isempty(g.vert) + for vert = g.vert(:)' + hold on; plot([vert vert], [0.001 500], 'k', 'linewidth', 2); + end; + end; + if strcmpi(g.cbar,'on') + cbar; + end; + +% plot figure with symetrical phase +% --------------------------------- +function limits = plotfigsim(times, freqs, vals, g) + icadefs; + imagesc(times, [1:size(vals,1)], vals); + + colormap(DEFAULT_COLORMAP); + ticks = linspace(1, size(vals,1), length(freqs)); + ticks = ticks(1:4:end); + set(gca, 'ytick', ticks); + set(gca, 'yticklabel', num2str(freqs(1:4:end)', 3)) + + if ~isempty(g.limits) + caxis(g.limits); + limits = g.limits; + else + clim = max(abs(caxis)); + limits = [-clim clim]; + caxis(limits); + end; + xlabel('Time (ms)'); ylabel('Freq (Hz)'); + if ~isempty(g.vert) + for vert = g.vert(:)' + hold on; plot([vert vert], [0.01 500], 'k', 'linewidth', 2); + end; + end; + if strcmpi(g.cbar,'on') + cbar; + end; + return; + + +% ----------------------------------------- +% plot time-freq point (when clicking on it +% ----------------------------------------- +function plotpoint(data, sortvar, timevect, freq, timepnts); + +figure; +subplot(2,2,1); +erpimage(act_all(:,:),sortvar_all,timepnts, ... + '', 300,10,'erp', 'erpstd', 'caxis',[-1.0 1.0], 'srate',256,'align',352, 'yerplabel', '', erpimopt{:}, ... + 'phasesort', [500 0 5]); % aligned to median rt + +% plot in polar coordinates phase versus RT +% ----------------------------------------- +phaseang2 = [phsangls phsangls-2*pi]; phaseang2 = movav(phaseang2,[], 100); +outvar2 = [outvar outvar]; outvar2 = movav(outvar2,[], 100); +phaseang2 = phaseang2(length(phsangls)/2-50:length(phsangls)+length(phsangls)/2-50); +outvar2 = outvar2 (length(phsangls)/2-50:length(phsangls)+length(phsangls)/2-50); +subplot(2,2,3); +polar(phsangls, outvar, '.'); +hold on; polar(phaseang2, outvar2, 'r'); + +% computing ITC +% ------------- +cmplx = outvar .* exp(j*phsangls); +ITCval = mean(cmplx); +angle(ITCval)/pi*180; +abs(ITCval)/mean(outvar); +text(-1300,-1400,sprintf('ITC value: amplitude %3.4f, angle %3.1f\n', abs(ITCval)/mean(outvar), angle(ITCval)/pi*180)); + +% accumulate 200 values +% --------------------- +alpha = 0.05; +if exist('accarray') ~= 1, accarray = NaN; end; +[sigval accarray] = bootstat(outvar/mean(outvar), phsangls, 'res = mean(arg1 .* exp(arg2*complex(0,1)))', ... + 'accarray', accarray, 'bootside', 'upper', 'alpha', alpha); +text(-1300,-1600,sprintf('Threshold for significance at %d percent(naccu=200): %3.4f\n', alpha*100, sigval)); +title(sprintf('Clust %d corr. theta phase at 500 ms and RT', clust)); + +% amplitude sorting +% ----------------- +figure; +[outdata,outvar,outtrials,limits,axhndls,erp, ... + amps,cohers,cohsig,ampsig,outamps,phsangls,phsamp,sortidx]=erpimage(act_all(:,:),sortvar_all,timepnts, ... + '', 0,0,'erp', 'erpstd', 'caxis', 0.5, 'cbar', ... + 'srate',256,'align',352, 'yerplabel', '', erpimopt{:}, 'ampsort', [500 0 5]); % aligned to median rt +close; +subplot(2,2,2); +erpimage(act_all(:,:),sortvar_all,timevect, ... + '', 300,10,'erp', 'erpstd', 'caxis', 0.5, 'cbar', ... + 'srate',256,'align',352, 'yerplabel', '', erpimopt{:}, 'ampsort', [500 0 5]); % aligned to median rt + +% compute correlation +% ------------------- +[ypred alpha Rsq] = myregress(outvar, phsamp); +subplot(2,2,4); +plot(outvar, phsamp, '.'); +hold on; +plot(outvar, ypred, 'r'); +xlabel('Reaction time'); +ylabel('Amplitude'); +title(sprintf('Theta amp. at 500 ms vs RT (p=%1.8f, R^2=%3.4f)', alpha, Rsq)); +set(gcf, 'position', [336 485 730 540], 'paperpositionmode', 'auto'); + +setfont(gcf, 'fontsize', 10); +eval(['print -djpeg clust' int2str(clust) 'corrthetart.jpg']); + + +% set up for command line call +% copy text from plotcorrthetaart +%timevect = times; +sortvar = sortvar_all; +data = act_all; +time = 1 +freq = 1 +g.times = 0; +g.freqs = 5; +g.erpimopt = {}; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/covary.m b/code/eeglab13_4_4b/functions/miscfunc/covary.m new file mode 100644 index 0000000..be1053d --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/covary.m @@ -0,0 +1,39 @@ +% covary() - For vectors, covary(X) returns the variance of X. +% For matrices, covary(X)is a row vector containing the +% variance of each column of X. +% +% Notes: +% covary(X) normalizes by N-1 where N is the sequence length. +% This makes covary(X) the best unbiased estimate of the +% covariance if X are from a normal distribution. +% Does not require the Matlab Signal Processing Toolbox +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 2000 + +% Copyright (C) 2000 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function covout = covary(data) + +data = data - mean(mean(data)); +if size(data,1) == 1 + data = data'; % make column vector +end +covout = sum(data.*data)/(size(data,1)-1); + + diff --git a/code/eeglab13_4_4b/functions/miscfunc/crossfold.m b/code/eeglab13_4_4b/functions/miscfunc/crossfold.m new file mode 100644 index 0000000..b4b94a9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/crossfold.m @@ -0,0 +1,536 @@ +% crossf() - Returns estimates and plot of event-related coherence (ERC) changes +% between data from two input channels. The lower panel gives the +% coherent phase difference between the processes. In this panel, for Ex. +% -90 degrees (blue) means xdata leads ydata by a quarter cycle. +% 90 degrees (orange) means ydata leads xdata by a quarter cycle. +% Click on each subplot to view separately and zoom in/out. +% +% Function description: +% Uses EITHER fixed-window, zero-padded FFTs (faster) OR constant-Q +% 0-padded DFTs (better sensitivity), both Hanning-tapered. Output +% frequency spacing is the lowest frequency (srate/winsize) divided +% by the padratio. +% +% If number of output arguments > 4, then bootstrap statistics are +% computed (from a distribution of 200 (NACCU) surrogate baseline +% data epochs) for the baseline epoch, and non-significant features +% of the output plots are zeroed (e.g., plotted in green). Baseline +% epoch is all windows with center times < 0 (MAX_BASELN) +% +% If number of output arguments > 5, coherency angles (lags) at +% significant coherency (time,frequency) points are plotted as well. +% +% Usage: +% >> [coh,mcoh,timesout,freqsout,cohboot,cohangles] = crossf(xdata,ydata,... +% frames,tlimits,titl, ... +% srate,cycles,winsize,timesout,... +% padratio,maxfreq,alpha,verts); +% +% Inputs: +% xdata = first single-channel (1,frames*nepochs) data {none} +% ydata = second single-channel (1,frames*nepochs) data {none} +% frames = frames per epoch {768} +% tlimits = epoch time limits (ms) [mintime maxtime]{-1000 2000} +% titl = figure title {none} +% srate = data sampling rate (Hz) {256} +% cycles = >0 -> number of cycles in each analysis window (slower) +% =0 -> use FFT (constant window length) {0} +% winsize = cycles==0: data subwindow length (2^k0: *longest* window length to use; +% determines the lowest output frequency {~frames/8} +% timesout = number of output times (int13 + COH_CAXIS_LIMIT = caxmax; +else + COH_CAXIS_LIMIT = 0; % 0 -> use data limits; else positive value +end + % giving symmetric +/- caxis limits. +AXES_FONT = 10; +LINEWIDTH = 2; +TITLE_FONT = 8; +ANGLEUNITS = 'deg'; % angle plotting units - 'ms' or 'deg' + +% Commandline arg defaults: +DEFAULT_EPOCH = 768; % Frames per epoch +DEFAULT_TIMELIM = [-1000 2000]; % Time range of epochs (ms) +DEFAULT_FS = 256; % Sampling frequency (Hz) +DEFAULT_NWIN = 200; % Number of windows = horizontal resolution +DEFAULT_VARWIN = 0; % Fixed window length or base on cycles. + % =0: fix window length to nwin + % >0: set window length equal varwin cycles + % bounded above by winsize, also determines + % the min. freq. to be computed. +DEFAULT_OVERSMP = 2; % Number of times to oversample = vertical resolution +DEFAULT_MAXFREQ = 50; % Maximum frequency to display (Hz) +DEFAULT_TITLE = ''; % Figure title +DEFAULT_ALPHA = 0.02; % Default two-sided significance probability threshold +MARGIN = 0.12; % width of marginal plots +DEFAULT_VERTS = []; % default no vertical lines + +if (nargin < 2) + help crossf + return +end + +if (min(size(X))~=1 | length(X)<2) + fprintf('crossf(): xdata must be a row or column vector.\n'); + return +elseif (min(size(Y))~=1 | length(Y)<2) + fprintf('crossf(): ydata must be a row or column vector.\n'); + return +elseif (length(X) ~= length(Y)) + fprintf('crossf(): xdata and ydata must have same length.\n'); + return +end + +if (nargin < 3) + epoch = DEFAULT_EPOCH; +elseif (~isnumeric(epoch) | length(epoch)~=1 | epoch~=round(epoch)) + fprintf('crossf(): Value of frames must be an integer.\n'); + return +elseif (epoch <= 0) + fprintf('crossf(): Value of frames must be positive.\n'); + return +elseif (rem(length(X),epoch) ~= 0) + fprintf('crossf(): Length of data vectors must be divisible by frames.\n'); + return +end + +if (nargin < 4) + timelim = DEFAULT_TIMELIM; +elseif (~isnumeric(timelim) | sum(size(timelim))~=3) + error('crossf(): Value of tlimits must be a vector containing two numbers.'); +elseif (timelim(1) >= timelim(2)) + error('crossf(): tlimits interval must be [min,max].'); +end + +if (nargin < 5) + ftitle = DEFAULT_TITLE; +elseif (~ischar(ftitle)) + error('crossf(): Plot title argument must be a quoted string.'); +end + +if (nargin < 6) + Fs = DEFAULT_FS; +elseif (~isnumeric(Fs) | length(Fs)~=1) + error('crossf(): Value of srate must be a number.'); +elseif (Fs <= 0) + error('crossf(): Value of srate must be positive.'); +end + +if (nargin < 7) + varwin = DEFAULT_VARWIN; +elseif (~isnumeric(varwin) | length(varwin)~=1) + error('crossf(): Value of cycles must be a number.'); +elseif (varwin < MAX_BASELN) + error('crossf(): Value of cycles must be either zero or positive.'); +end + +if (nargin < 8) + winsize = max(pow2(nextpow2(epoch)-3),4); +elseif (~isnumeric(winsize) | length(winsize)~=1 | winsize~=round(winsize)) + error('crossf(): Value of winsize must be an integer number.'); +elseif (winsize <= 0) + error('crossf(): Value of winsize must be positive.'); +elseif (varwin == 0 & pow2(nextpow2(winsize)) ~= winsize) + error('crossf(): Value of winsize must be an integer power of two [1,2,4,8,16,...]'); +elseif (winsize > epoch) + error('crossf(): Value of winsize must be less than epoch length.'); +end + +if (nargin < 9) + nwin = DEFAULT_NWIN; +elseif (~isnumeric(nwin) | length(nwin)~=1 | nwin~=round(nwin)) + error('crossf(): Value of nwin must be an integer number.'); +elseif (nwin <= 0) + error('crossf(): Value of nwin must be positive.'); +end +if (nwin > epoch-winsize) + error('crossf(): Value of nwin must be <= epoch-winsize.'); +end + +if (nargin < 10) + oversmp = DEFAULT_OVERSMP; +elseif (~isnumeric(oversmp) | length(oversmp)~=1 | oversmp~=round(oversmp)) + error('crossf(): Value of oversmp must be an integer number.'); +elseif (oversmp <= 0) + error('crossf(): Value of oversmp must be positive.'); +elseif (pow2(nextpow2(oversmp)) ~= oversmp) + error('crossf(): Value of oversmp must be an integer power of two [1,2,4,8,16,...]'); +end + +if (nargin < 11) + maxfreq = DEFAULT_MAXFREQ; +elseif (~isnumeric(maxfreq) | length(maxfreq)~=1) + error('crossf(): Value of maxfreq must be a number.'); +elseif (maxfreq <= 0) + error('crossf(): Value of maxfreq must be positive.'); +end + +if (nargin < 12) + alpha = DEFAULT_ALPHA; +elseif (~isnumeric(alpha) | length(alpha)~=1) + error('crossf(): Value of alpha must be a number.'); +elseif (round(NACCU*alpha) < 2 | alpha > .5) + fprintf('crossf(): Value of alpha must be in the range (~0,0.5]'); + return +else + if round(NACCU*alpha)<1, + alpha = 1/NACCU; + fprintf(... + 'Using alpha = %0.3f. To decrease, must raise NACCU in source code.\n',... + alpha); + end +end +if (nargin < 13) + verts = DEFAULT_VERTS; +end + +if (varwin == 0) % FFT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + freqs = Fs/winsize*[1:2/oversmp:winsize]/2; + win = hanning(winsize); + + R = zeros(oversmp*winsize/2,nwin); + RR = zeros(oversmp*winsize/2,nwin); + Rboot = zeros(oversmp*winsize/2,NACCU); + +else % wavelet DFT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + freqs = Fs*varwin/winsize*[2:2/oversmp:winsize]/2; + win = dftfilt(winsize,maxfreq/Fs,varwin,oversmp,1); + + R = zeros(size(win,2),nwin); + RR = zeros(size(win,2),nwin); + Rboot = zeros(size(win,2),NACCU); +end + +wintime = 500*winsize/Fs; +times = timelim(1)+wintime:(timelim(2)-timelim(1)-2*wintime)/(nwin-1):timelim(2)-wintime; + +baseln = find(times < 0); +dispf = find(freqs <= maxfreq); +stp = (epoch-winsize)/(nwin-1); +trials = length(X)/epoch; + +fprintf('\nComputing the Event-Related Cross-Coherence image\n'); +fprintf(' based on %d trials of %d frames sampled at %g Hz.\n',... + trials,epoch,Fs); +fprintf('Trial timebase is %d ms before to %d ms after the stimulus\n',... + timelim(1),timelim(2)); +fprintf('The frequency range displayed is %g-%g Hz.\n',min(dispf),maxfreq); +if varwin==0 + fprintf('The data window size is %d samples (%g ms).\n',winsize,2*wintime); + fprintf('The FFT length is %d samples\n',winsize*oversmp); +else + fprintf('The window size is %d cycles.\n',varwin); + fprintf('The maximum window size is %d samples (%g ms).\n',winsize,2*wintime); +end +fprintf('The window is applied %d times\n',nwin); +fprintf(' with an average step size of %g samples (%g ms).\n',... + stp,1000*stp/Fs); +fprintf('Results are oversampled %d times.\n',oversmp); +if nargout>4 + fprintf('Bootstrap confidence limits will be computed based on alpha = %g\n',... + alpha); +else + fprintf('Bootstrap confidence limits will NOT be computed.\n'); +end +if nargout>5 + fprintf(['Coherence angles will be imaged in ',ANGLEUNITS,' and saved.\n']); +end + +fprintf('\nProcessing trial (of %d):',trials); +firstboot = 1; +Rn=zeros(1,nwin); +X = X(:)'; % make X and Y column vectors +Y = Y(:)'; +for t=1:trials, + if (rem(t,10) == 0) + fprintf(' %d',t); + end + if rem(t,120) == 0 + fprintf('\n'); + end + + for j=1:nwin, % for each time window + tmpX = X([1:winsize]+floor((j-1)*stp)+(t-1)*epoch); + tmpY = Y([1:winsize]+floor((j-1)*stp)+(t-1)*epoch); + + if ~any(isnan(tmpX)) + tmpX = tmpX - mean(tmpX); + tmpY = tmpY - mean(tmpY); + + if varwin == 0 % use FFTs + tmpX = win .* tmpX(:); + tmpY = win .* tmpY(:); + tmpX = fft(tmpX,oversmp*winsize); + tmpY = fft(tmpY,oversmp*winsize); + tmpX = tmpX(2:oversmp*winsize/2+1); + tmpY = tmpY(2:oversmp*winsize/2+1); + else + tmpX = win' * tmpX(:); + tmpY = win' * tmpY(:); + end + + if nargout > 4 + if firstboot==1 + tmpsX = repmat(nan,length(tmpX),nwin); + tmpsY = repmat(nan,length(tmpY),nwin); + firstboot = 0; + end + tmpsX(:,j) = tmpX; + tmpsY(:,j) = tmpY; + end + + RR(:,j) = tmpX.*conj(tmpY) ./ (abs(tmpX).*abs(tmpY)); % complex coher. + R(:,j) = R(:,j) + RR(:,j); + Rn(j) = Rn(j)+1; + end % ~any(isnan()) + end % time window + + if (nargout > 4) % get NACCU bootstrap estimates for each trial + j=1; + while j<=NACCU + s = ceil(rand([1 2])*nwin); % random ints [1,nwin] + tmpX = tmpsX(:,s(1)); + tmpY = tmpsY(:,s(2)); + if ~any(isnan(tmpX)) & ~any(isnan(tmpY)) + RR = tmpX.*conj(tmpY) ./ (abs(tmpX).*abs(tmpY)); % complex coher. + Rboot(:,j) = Rboot(:,j) + RR; + j = j+1; + end + end + end + +end % t = trial + +fprintf('\nNow plotting...\n'); + +Rangle = angle(R); +if varwin ~= 0 + Rangle = -Rangle; % make lead/lag the same for FFT and wavelet analysis +end +R = abs(R) ./ (ones(size(R,1),1)*Rn); % coherence magnitude +Rraw = R; % raw coherence values +mbase = mean(R(:,baseln)'); % mean baseline coherence magnitude +% R = R - repmat(mbase',[1 nwin]);% remove baseline mean + +if (nargout > 4) % bootstrap + i = round(NACCU*alpha); + Rboot = abs(Rboot) / trials; % normalize bootstrap magnitude to [0,1] + Rboot = sort(Rboot'); + Rsignif = mean(Rboot(NACCU-i+1:NACCU,:)); % significance levels for Rraw +% Rboot = [mean(Rboot(1:i,:))-mbase ; mean(Rboot(NACCU-i+1:NACCU,:))-mbase]; + Rboot = [mean(Rboot(1:i,:)) ; mean(Rboot(NACCU-i+1:NACCU,:))]; +end % NOTE: above, mean ????? + +set(gcf,'DefaultAxesFontSize',AXES_FONT) +colormap(jet(256)); + +pos = get(gca,'position'); % plot relative to current axes +q = [pos(1) pos(2) 0 0]; +s = [pos(3) pos(4) pos(3) pos(4)]; +axis('off') + +if nargout>5 % image coherence lag as well as coherence magnitude + ybase = 0.5; + subheight = 0.4; + MARGIN = MARGIN*0.75; +else + ybase = 0.0; + subheight = 0.9; +end + +% +% Image the coherence [% perturbations] +% +RR = R; +if (nargout > 4) % zero out (and 'green out') nonsignif. R values + RR(find((RR > repmat(Rboot(1,:)',[1 nwin])) ... + & (RR < repmat(Rboot(2,:)',[1 nwin])))) = 0; +end +if (nargout > 5) % zero out nonsignif. Rraw values + Rraw(find(repmat(Rsignif',[1,size(Rraw,2)])>=Rraw))=0; +end + +if COH_CAXIS_LIMIT == 0 + coh_caxis = max(max(R(dispf,:)))*[-1 1]; +else + coh_caxis = COH_CAXIS_LIMIT*[-1 1]; +end + +h(6) = axes('Units','Normalized',... + 'Position',[MARGIN ybase+MARGIN 0.9-MARGIN subheight].*s+q); + +map=hsv(300); % install circular color map - green=0, yellow, orng, red, violet = max + % cyan, blue, violet = min +map = flipud([map(251:end,:);map(1:250,:)]); +map(151,:) = map(151,:)*0.9; % tone down the (0=) green! +colormap(map); + +imagesc(times,freqs(dispf),RR(dispf,:),coh_caxis); % plot the coherence image + +set(h(6),'Units','Normalized',... + 'Position',[MARGIN ybase+MARGIN 0.9-MARGIN subheight].*s+q); +hold on +plot([0 0],[0 freqs(max(dispf))],'--m','LineWidth',LINEWIDTH) +for i=1:length(verts) + plot([verts(i) verts(i)],[0 freqs(max(dispf))],'--m','LineWidth',LINEWIDTH); +end; +hold off +set(h(6),'YTickLabel',[],'YTick',[]) +set(h(6),'XTickLabel',[],'XTick',[]) +title('Event-Related Coherence') +h(8) = axes('Position',[.92 ybase+MARGIN .05 subheight].*s+q); +cbar(h(8),151:300,[0 coh_caxis(2)]); % use only positive colors (gyorv) +% for coherences +% +% Plot delta-mean min and max coherence at each time point on bottom of image +% +h(10) = axes('Units','Normalized','Position',[MARGIN ybase 0.9-MARGIN MARGIN].*s+q); +Emax = max(R(dispf,:)); % mean coherence at each time point +Emin = min(R(dispf,:)); % mean coherence at each time point +plot(times,Emax,'b'); +hold on +plot(times,Emin,'b'); +plot([times(1) times(length(times))],[0 0],'LineWidth',0.7); +plot([0 0],[-500 500],'--m','LineWidth',LINEWIDTH); +for i=1:length(verts) + plot([verts(i) verts(i)],[-500 500],'--m','LineWidth',LINEWIDTH); +end; +axis([min(times) max(times) 0 max(Emax)*1.2]) +tick = get(h(10),'YTick'); +set(h(10),'YTick',[tick(1) ; tick(length(tick))]) +set(h(10),'YAxisLocation','right') +midpos = get(h(10),'Position'); +if nargout<6 + xlabel('Time (ms)') +end +ylabel('coh.') + +% +% Plot mean baseline coherence at each freq on left side of image +% + +h(11) = axes('Units','Normalized','Position',[0 ybase+MARGIN MARGIN subheight].*s+q); +E = mbase(dispf); % baseline mean coherence at each frequency +if (nargout > 4) % plot bootstrap significance limits (base mean +/-) + plot(freqs(dispf),E,'m','LineWidth',LINEWIDTH); % plot mbase + hold on + % plot(freqs(dispf),Rboot(:,dispf)+[E;E],'g','LineWidth',LINEWIDTH); + plot(freqs(dispf),Rboot([1 2],dispf),'g','LineWidth',LINEWIDTH); + plot(freqs(dispf),Rsignif(dispf),'k:','LineWidth',LINEWIDTH); + axis([freqs(1) freqs(max(dispf)) 0 max([E Rsignif])*1.2]); +else % plot marginal mean coherence only + plot(freqs(dispf),E,'LineWidth',LINEWIDTH); + % axis([freqs(1) freqs(max(dispf)) min(E)-max(E)/3 max(E)+max(E)/3]); + if ~isnan(max(E)) + axis([freqs(1) freqs(max(dispf)) 0 max(E)*1.2]); + end; +end + +tick = get(h(11),'YTick'); +set(h(11),'YTick',[tick(1) ; tick(length(tick))]) +set(h(11),'View',[90 90]) +xlabel('Freq. (Hz)') +ylabel('coh.') + +if (length(ftitle) > 0) % plot title + axes('Position',pos,'Visible','Off'); + h(12) = text(-.05,1.01,ftitle); + set(h(12),'VerticalAlignment','bottom') + set(h(12),'HorizontalAlignment','left') + set(h(12),'FontSize',TITLE_FONT) +end +% +% Plot coherence time lags in bottom panel +% +if nargout>5 + h(13) = axes('Units','Normalized','Position',[MARGIN MARGIN 0.9-MARGIN subheight].*s+q); + if strcmp(ANGLEUNITS,'ms') % convert to ms + Rangle = (Rangle/(2*pi)).*repmat(1000./freqs(dispf)',1,length(times)); + maxangle = max(max(abs(Rangle))); + else + Rangle = Rangle*180/pi; % convert to degrees + maxangle = 180; % use full-cycle plotting + end + Rangle(find(Rraw==0)) = 0; % set angle at non-signif coher points to 0 + + imagesc(times,freqs(dispf),Rangle(dispf,:),[-maxangle maxangle]); % plot the + hold on % coherence phase angles + plot([0 0],[0 freqs(max(dispf))],'--m','LineWidth',LINEWIDTH); % zero-time line + for i=1:length(verts) + plot([verts(i) verts(i)],[0 freqs(max(dispf))],'--m','LineWidth',LINEWIDTH); + end; + + pos13 = get(h(13),'Position'); + set(h(13),'Position',[pos13(1) pos13(2) midpos(3) pos13(4)]); + ylabel('Freq. (Hz)') + xlabel('Time (ms)') + h(14)=axes('Position',[.92 MARGIN .05 subheight].*s+q); + cbar(h(14),0,[-maxangle maxangle]); % two-sided colorbar + + if (length(ftitle) > 0) % plot title + axes('Position',pos,'Visible','Off'); + h(13) = text(-.05,1.01,ftitle); + set(h(13),'VerticalAlignment','bottom') + set(h(13),'HorizontalAlignment','left') + set(h(13),'FontSize',TITLE_FONT) + end + end +axcopy(gcf); diff --git a/code/eeglab13_4_4b/functions/miscfunc/crossfreq.m b/code/eeglab13_4_4b/functions/miscfunc/crossfreq.m new file mode 100644 index 0000000..b236f91 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/crossfreq.m @@ -0,0 +1,280 @@ +% crossfreq() - compute cross-frequency coherences. Power of first input +% correlation with phase of second. +% +% Usage: +% >> crossfreq(x,y,srate); +% >> [coh,timesout,freqsout1,freqsout2,cohboot] ... +% = crossfreq(x,y,srate,'key1', 'val1', 'key2', val2' ...); +% Inputs: +% x = [float array] 2-D data array of size (times,trials) or +% 3-D (1,times,trials) +% y = [float array] 2-D or 3-d data array +% srate = data sampling rate (Hz) +% +% Most important optional inputs +% 'mode' = ['amp_amp'|'amp_phase'|'phase_phase'] correlation mode +% is either amplitude-amplitude ('amp_amp'), amplitude +% and phase ('amp_phase') and phase-phase ('phase_phase'). +% Default is 'amp_phase'. +% 'method' = ['mod'|'corrsin'|'corrcos'] modulation method ('mod') +% or correlation of amplitude with sine or cosine of +% angle (see ref). +% 'freqs' = [min max] frequency limits. Default [minfreq 50], +% minfreq being determined by the number of data points, +% cycles and sampling frequency. Use 0 for minimum frequency +% to compute default minfreq. You may also enter an +% array of frequencies for the spectral decomposition +% (for FFT, closest computed frequency will be returned; use +% 'padratio' to change FFT freq. resolution). +% 'freqs2' = [float array] array of frequencies for the second +% argument. 'freqs' is used for the first argument. +% By default it is the same as 'freqs'. +% 'wavelet' = 0 -> Use FFTs (with constant window length) { Default } +% = >0 -> Number of cycles in each analysis wavelet +% = [cycles expfactor] -> if 0 < expfactor < 1, the number +% of wavelet cycles expands with frequency from cycles +% If expfactor = 1, no expansion; if = 0, constant +% window length (as in FFT) {default wavelet: 0} +% = [cycles array] -> cycle for each frequency. Size of array +% must be the same as the number of frequencies +% {default cycles: 0} +% 'wavelet2' = same as 'wavelet' for the second argument. Default is +% same as cycles. Note that if the lowest frequency for X +% and Y are different and cycle is [cycles expfactor], it +% may result in discrepencies in the number of cycles at +% the same frequencies for X and Y. +% 'ntimesout' = Number of output times (int0: *longest* window length to use. This +% determines the lowest output frequency. Note that this +% parameter is overwritten if the minimum frequency has been set +% manually and requires a longer time window {~frames/8} +% 'padratio' = FFT-length/winframes (2^k) {2} +% Multiplies the number of output frequencies by dividing +% their spacing (standard FFT padding). When cycles~=0, +% frequency spacing is divided by padratio. +% 'nfreqs' = number of output frequencies. For FFT, closest computed +% frequency will be returned. Overwrite 'padratio' effects +% for wavelets. Default: use 'padratio'. +% 'freqscale' = ['log'|'linear'] frequency scale. Default is 'linear'. +% Note that for obtaining 'log' spaced freqs using FFT, +% closest correspondant frequencies in the 'linear' space +% are returned. +% 'subitc' = ['on'|'off'] subtract stimulus locked Inter-Trial Coherence +% (ITC) from x and y. This computes the 'intrinsic' coherence +% x and y not arising from common synchronization to +% experimental events. See notes. {default: 'off'} +% 'itctype' = ['coher'|'phasecoher'] For use with 'subitc', see timef() +% for more details {default: 'phasecoher'}. +% 'subwin' = [min max] sub time window in ms (this windowing is +% performed after the spectral decomposition). +% 'lowmem' = ['on'|'off'] compute frequency, by frequency to save +% memory. Default 'off'. +% +% Optional Bootstrap Parameters: +% 'alpha' = If non-0, compute two-tailed bootstrap significance prob. +% level. Show non-signif. output values as green. {0} +% 'naccu' = Number of bootstrap replications to accumulate. Note that +% naccu might be automatically increate depending on the +% value for 'alpha' {250} +% 'baseboot' = Bootstrap baseline subtract time window in ms. If only one +% is entered, baseline is from beginning of data to this +% value. Note: you must specify 'tlimits' for bootstrap {0} +% 'boottype' = ['times'|'timestrials'|'trials'] Bootstrap type: Either +% shuffle windows ('times') or windows and trials ('timestrials') +% or trials only using a separate bootstrap for each time window +% ('trials'). Option 'times' is not recommended but requires less +% memory {default 'timestrials'} +% 'rboot' = Input bootstrap coherence limits (e.g., from crossfreq()) +% The bootstrap type should be identical to that used +% to obtain the input limits. {default: compute from data} +% +% Optional Plotting Parameters: +% 'title' = Optional figure title {none} +% 'vert' = [times_vector] plot vertical dashed lines at specified +% times in ms. Can also be a cell array specifying line aspect. +% I.e. { { 0 'color' 'b' 'linewidth' 2 } {1000 'color' 'r' }} +% would draw two lines, one blue thick line at latency 0 and one +% thin red line at latency 1000. +% 'newfig' = ['on'|'off'] Create new figure for difference plots {'on'} +% +% Outputs: +% crossfcoh = Matrix (nfreqs1,nfreqs2,timesout) of coherence (complex). +% Use 20*log(abs(crossfcoh)) to vizualize log spectral diffs. +% timesout = Vector of output times (window centers) (ms). +% freqsout1 = Vector of frequency bin centers for first argument (Hz). +% freqsout2 = Vector of frequency bin centers for second argument (Hz). +% cohboot = Matrix (nfreqs1,nfreqs2,2) of p-value coher signif. +% values. if 'boottype' is 'trials', +% (nfreqs1,nfreqs2,timesout,2) +% alltfX = single trial spectral decomposition of X +% alltfY = single trial spectral decomposition of Y +% +% Author: Arnaud Delorme & Scott Makeig, SCCN/INC, UCSD 2003- +% +% Ref: Testing for Nested Oscilations (2008) J Neuro Methods 174(1):50-61 +% +% See also: timefreq(), crossf() + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [crossfcoh, timesout1, freqs1, freqs2, cohboot, alltfX, alltfY] = ... + crossfreq(X, Y, srate, varargin); + +if nargin < 1 + help crossfreq; + return; +end; + +% deal with 3-D inputs +% -------------------- +if ndims(X) == 3, X = reshape(X, size(X,2), size(X,3)); end; +if ndims(Y) == 3, Y = reshape(Y, size(Y,2), size(Y,3)); end; +frame = size(X,2); + +g = finputcheck(varargin, ... + { 'alpha' 'real' [0 0.2] []; + 'baseboot' 'float' [] 0; + 'boottype' 'string' {'times','trials','timestrials'} 'timestrials'; + 'detrend' 'string' {'on','off'} 'off'; + 'freqs' 'real' [0 Inf] [0 srate/2]; + 'freqs2' 'real' [0 Inf] []; + 'freqscale' 'string' { 'linear','log' } 'linear'; + 'itctype' 'string' {'phasecoher','phasecoher2','coher'} 'phasecoher'; + 'nfreqs' 'integer' [0 Inf] []; + 'lowmem' 'string' {'on','off'} 'off'; + 'mode' 'string' { 'amp_amp','amp_phase','phase_phase' } 'amp_phase'; + 'method' 'string' { 'mod','corrsin','corrcos' } 'mod'; + 'naccu' 'integer' [1 Inf] 250; + 'newfig' 'string' {'on','off'} 'on'; + 'padratio' 'integer' [1 Inf] 2; + 'rmerp' 'string' {'on','off'} 'off'; + 'rboot' 'real' [] []; + 'subitc' 'string' {'on','off'} 'off'; + 'subwin' 'real' [] []; ... + 'timesout' 'real' [] []; ... + 'ntimesout' 'integer' [] 200; ... + 'tlimits' 'real' [] [0 frame/srate]; + 'title' 'string' [] ''; + 'vert' { 'real','cell' } [] []; + 'wavelet' 'real' [0 Inf] 0; + 'wavelet2' 'real' [0 Inf] []; + 'winsize' 'integer' [0 Inf] max(pow2(nextpow2(frame)-3),4) }, 'crossfreq'); + +if isstr(g), error(g); end; + +% more defaults +% ------------- +if isempty(g.wavelet2), g.wavelet2 = g.wavelet; end; +if isempty(g.freqs2), g.freqs2 = g.freqs; end; + +% remove ERP if necessary +% ----------------------- +X = squeeze(X); +Y = squeeze(Y);X = squeeze(X); +trials = size(X,2); +if strcmpi(g.rmerp, 'on') + X = X - repmat(mean(X,2), [1 trials]); + Y = Y - repmat(mean(Y,2), [1 trials]); +end; + +% perform timefreq decomposition +% ------------------------------ +[alltfX freqs1 timesout1] = timefreq(X, srate, 'ntimesout', g.ntimesout, 'timesout', g.timesout, 'winsize', g.winsize, ... + 'tlimits', g.tlimits, 'detrend', g.detrend, 'itctype', g.itctype, ... + 'subitc', g.subitc, 'wavelet', g.wavelet, 'padratio', g.padratio, ... + 'freqs', g.freqs, 'freqscale', g.freqscale, 'nfreqs', g.nfreqs); +[alltfY freqs2 timesout2] = timefreq(Y, srate, 'ntimesout', g.ntimesout, 'timesout', g.timesout, 'winsize', g.winsize, ... + 'tlimits', g.tlimits, 'detrend', g.detrend, 'itctype', g.itctype, ... + 'subitc', g.subitc, 'wavelet', g.wavelet2, 'padratio', g.padratio, ... + 'freqs', g.freqs2, 'freqscale', g.freqscale, 'nfreqs', g.nfreqs); + +% check time limits +% ----------------- +if ~isempty(g.subwin) + ind1 = find(timesout1 > g.subwin(1) & timesout1 < g.subwin(2)); + ind2 = find(timesout2 > g.subwin(1) & timesout2 < g.subwin(2)); + alltfX = alltfX(:, ind1, :); + alltfY = alltfY(:, ind2, :); + timesout1 = timesout1(ind1); + timesout2 = timesout2(ind2); +end; +if length(timesout1) ~= length(timesout2) | any( timesout1 ~= timesout2) + disp('Warning: Time points are different for X and Y. Use ''timesout'' to specify common time points'); + disp('Searching for common points'); + [vals ind1 ind2 ] = intersect_bc(timesout1, timesout2); + if length(vals) < 10, error('Less than 10 common data points'); end; + timesout1 = vals; + timesout2 = vals; + alltfX = alltfX(:, ind1, :); + alltfY = alltfY(:, ind2, :); +end; + +% scan accross frequency and time +% ------------------------------- +if isempty(g.alpha) + disp('Warning: if significance mask is not applied, result might be slightly') + disp('different (since angle is not made uniform and amplitude interpolated)') +end; + +cohboot =[]; +for find1 = 1:length(freqs1) + for find2 = 1:length(freqs2) + for ti = 1:length(timesout1) + + % get data + % -------- + tmpalltfx = squeeze(alltfX(find1,ti,:)); + tmpalltfy = squeeze(alltfY(find2,ti,:)); + + if ~isempty(g.alpha) + tmpalltfy = angle(tmpalltfy); + tmpalltfx = abs( tmpalltfx); + [ tmp cohboot(find1,find2,ti,:) newamp newangle ] = ... + bootcircle(tmpalltfx, tmpalltfy, 'naccu', g.naccu); + crossfcoh(find1,find2,ti) = sum ( newamp .* exp(j*newangle) ); + else + tmpalltfy = angle(tmpalltfy); + tmpalltfx = abs( tmpalltfx); + if strcmpi(g.method, 'mod') + crossfcoh(find1,find2,ti) = sum( tmpalltfx .* exp(j*tmpalltfy) ); + elseif strcmpi(g.method, 'corrsin') + tmp = corrcoef( sin(tmpalltfy), tmpalltfx); + crossfcoh(find1,find2,ti) = tmp(2); + else + tmp = corrcoef( cos(tmpalltfy), tmpalltfx); + crossfcoh(find1,find2,ti) = tmp(2); + end; + end; + end; + end; +end; + + + diff --git a/code/eeglab13_4_4b/functions/miscfunc/datlim.m b/code/eeglab13_4_4b/functions/miscfunc/datlim.m new file mode 100644 index 0000000..293c321 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/datlim.m @@ -0,0 +1,28 @@ +% datlim() - return min and max of a matrix +% +% Usage: +% >> limits_vector = datlim(data); +% +% Input: +% data - numeric array +% Outputs: +% limits_vector = [minval maxval] +% +% Author: Scott Makeig, SCCN/INC/UCSD, May 28, 2005 + +function [limits_vector] = datlim(data) + +if ~isnumeric(data) + error('data must be a numeric array') + return +end + +limits_vector = [ min(data(:)) max(data(:)) ]; % thanks to Arno Delorme + +% minval = squeeze(min(data)); maxval = squeeze(max(data)); +% while numel(minval) > 1 +% minval = squeeze(min(minval)); maxval = squeeze(max(maxval)); +% end +% limits_vector = [minval maxval]; + + diff --git a/code/eeglab13_4_4b/functions/miscfunc/del2map.m b/code/eeglab13_4_4b/functions/miscfunc/del2map.m new file mode 100644 index 0000000..ce3fd87 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/del2map.m @@ -0,0 +1,112 @@ +% del2map() - compute the discrete laplacian of an EEG distribution. +% +% Usage: +% >> [ laplac ] = del2map( map, filename, draw ); +% +% Inputs: +% map - level of activity (size: nbChannel) +% filename - filename (.loc file) countaining the coordinates +% of the electrodes, or array countaining complex positions +% draw - integer, if not nul draw the gradient (default:0) +% +% Output: +% laplac - laplacian map. If the input values are in microV and the +% the sensors placement are in mm, the output values are +% returned in microV/mm^2. In order to use current density +% units like milliamps/mm2, you would need to know skin +% conductance information, which as far as we know is not +% really known with enough accuracy to be worthwhile. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% Thanks Ramesh Srinivasan and Tom Campbell for the discussion +% on laplacian output units. + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ laplac, sumLaplac2D ] = del2map( map, filename, draw ) + +if nargin < 2 + help del2map; + return; +end; + +% process several maps +if size(map,2) > 1 + if size(map,1) > 1 + for index = 1:size(map,2) + laplac(:,index) = del2map( map(:,index), filename); + end; + return; + else + map = map'; + end; +end; + +MAXCHANS = size(map,1); +GRID_SCALE = 2*MAXCHANS+5; + +% Read the channel file +% --------------------- +if ischar( filename ) | isstruct( filename ) + [tmp lb Th Rd] = readlocs(filename); + Th = pi/180*Th; % convert degrees to rads + [x,y] = pol2cart(Th,Rd); +else + x = real(filename); + y = imag(filename); + if exist('draw') == 1 & draw ~= 0 + line( [(x-0.01)' (x+0.01)']', [(y-0.01)' (y+0.01)']'); + line( [(x+0.01)' (x-0.01)']', [(y-0.01)' (y+0.01)']'); + end; +end; + +% locates nearest position of electrod in the grid +% ------------------------------------------------ +xi = linspace(-0.5,0.5,GRID_SCALE); % x-axis description (row vector) +yi = linspace(-0.5,0.5,GRID_SCALE); % y-axis description (row vector) +for i=1:MAXCHANS + [useless_var horizidx(i)] = min(abs(x(i) - xi)); % find pointers to electrode + [useless_var vertidx(i)] = min(abs(y(i) - yi)); % positions in Zi +end; + +% Compute gradient +% ---------------- +sumLaplac2D = zeros(GRID_SCALE, GRID_SCALE); +for i=1:size(map,2) + [Xi,Yi,Zi] = griddata(y,x,map(:,i),yi',xi, 'v4'); % interpolate data + laplac2D = del2(Zi); + positions = horizidx + (vertidx-1)*GRID_SCALE; + + laplac(:,i) = laplac2D(positions(:)); + sumLaplac2D = sumLaplac2D + laplac2D; + + % Draw gradient + % ------------- + if exist('draw') == 1 & draw ~= 0 + if size(map,2) > 1 + subplot(ceil(sqrt(size(map,2))), ceil(sqrt(size(map,2))), i); + end; + plot(y, x, 'x', 'Color', 'black', 'markersize', 5); hold on + contour(Xi, Yi, laplac2D); hold off; + %line( [(x-0.01)' (x+0.01)']', [(y-0.01)' (y+0.01)']', 'Color','black'); + %line( [(x+0.01)' (x-0.01)']', [(y-0.01)' (y+0.01)']', 'Color','black'); + title( int2str(i) ); + end; +end; % + +return; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/dendhier.m b/code/eeglab13_4_4b/functions/miscfunc/dendhier.m new file mode 100644 index 0000000..d86ff87 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/dendhier.m @@ -0,0 +1,41 @@ +% DENDHIER: Recursive algorithm to find links and distance coordinates on a +% dendrogram, given the topology matrix. +% +% Usage: [links,topology,node] = dendhier(links,topology,node) +% +% links = 4-col matrix of descendants, ancestors, descendant +% distances, and ancestor distances; pass to +% function as null vector [] +% topology = dendrogram topology matrix +% node = current node; pass as N-1 +% + +% RE Strauss, 7/13/95 + +function [links,topology,node] = dendhier(links,topology,node) + n = size(topology,1)+1; % Number of OTUs + + c1 = topology(node,1); + c2 = topology(node,2); + clst = topology(node,3); + dist = topology(node,4); + + if (c1 <= n) + links = [links; c1 clst 0 dist]; + else + prevnode = find(topology(:,3)==c1); + prevdist = topology(prevnode,4); + links = [links; c1 clst prevdist dist]; + [links,topology,node] = dendhier(links,topology,prevnode); + end; + + if (c2 <= n) + links = [links; c2 clst 0 dist]; + else + prevnode = find(topology(:,3)==c2); + prevdist = topology(prevnode,4); + links = [links; c2 clst prevdist dist]; + [links,topology,node] = dendhier(links,topology,prevnode); + end; + + return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/dendplot.m b/code/eeglab13_4_4b/functions/miscfunc/dendplot.m new file mode 100644 index 0000000..0283eed --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/dendplot.m @@ -0,0 +1,78 @@ +% DENDPLOT: Plots a dendrogram given a topology matrix. +% +% Usage: dendplot(topology,{labels},{fontsize}) +% +% topology = [(n-1) x 4] matrix summarizing dendrogram topology: +% col 1 = 1st OTU/cluster being grouped at current step +% col 2 = 2nd OTU/cluster +% col 3 = ID of cluster being produced +% col 4 = distance at node +% labels = optional [n x q] matrix of group labels for dendrogram. +% fontsize = optional font size for labels [default = 10]. +% + +% RE Strauss, 5/27/98 +% 8/20/99 - miscellaneous changes for Matlab v5 + +function dendplot(topology,labels,fontsize) + if (nargin<2) + labels = []; + end; + if (nargin < 3) + fontsize = []; + end; + + if (isempty(fontsize)) % Default font size for labels + fontsize = 10; + end; + + r = size(topology,1); + n = r+1; % Number of taxa + + links = dendhier([],topology,n-1); % Find dendrogram links (branches) + otu_indx = find(links(:,1)<=n); % Get sequence of OTUs + otus = links(otu_indx,1); + y = zeros(2*n-1,1); % Y-coords for plot + y(otus) = 0.5:(n-0.5); + for i = 1:(n-1) + y(topology(i,3)) = mean([y(topology(i,1)),y(topology(i,2))]); + end; + + clf; % Begin plot + hold on; + + for i = 1:(2*n-2) % Horizontal lines + desc = links(i,1); + anc = links(i,2); + X = [links(i,3) links(i,4)]; + Y = [y(desc) y(desc)]; + plot(X,Y,'k'); + end; + + for i = (n+1):(2*n-1) % Vertical lines + indx = find(links(:,2)==i); + X = [links(indx,4)]; + Y = [y(links(indx(1),1)) y(links(indx(2),1))]; + plot(X,Y,'k'); + end; + + maxdist = max(links(:,4)); + for i = 1:n % OTU labels + if (~isempty(labels)) + h = text(-.02*maxdist,y(i),labels(i,:)); % For OTUs on right + set(h,'fontsize',fontsize); + else + h = text(-.02*maxdist,y(i),num2str(i)); % For OTUs on right + set(h,'fontsize',fontsize); +% text(-.06*maxdist,y(i),num2str(i)); % For UTOs on left + end; + end; + + axis([0 maxdist+0.03*maxdist 0 n]); % Axes + axis('square'); + set(gca,'Ytick',[]); % Suppress y-axis labels and tick marks + set(gca,'Ycolor','w'); % Make y-axes invisible + set(gca,'Xdir','reverse'); % For OTUs on right + + hold off; + return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/detectmalware.m b/code/eeglab13_4_4b/functions/miscfunc/detectmalware.m new file mode 100644 index 0000000..2fd0b3e --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/detectmalware.m @@ -0,0 +1,47 @@ +% this function detects potential malware in the current folder and subfolders +% +% Author: A. Delorme, Cotober 2013 + +function detectmalware(currentFolder); + +if nargin < 1 + currentFolder = pwd; +end; + +folderContent = dir(currentFolder); +folderContent = { folderContent.name }; + +malwareStrings = { 'eval(' 'evalin(' 'evalc(' 'delete(' 'movefile(' 'rmdir' 'mkdir' 'copyfile' 'system(' '!' }; + +for iFile = 1:length(folderContent) + + currentFile = folderContent{iFile}; + if length(currentFile) > 2 && strcmpi(currentFile(end-1:end), '.m') + + fid = fopen(fullfile(currentFolder, currentFile), 'r'); + countLine = 0; + prevstr = ''; + while ~feof(fid) + str = fgetl(fid); + countLine = countLine+1; + + if length(str) > 1 && str(1) ~= '%' + res = cellfun(@(x)~isempty(findstr(x, str)), malwareStrings(1:end-1)); + if str(1) == '!', res(end+1) = 1; end; + if any(res) + pos = find(res); pos = pos(1); + disp('************************************') + fprintf('Potential malware command detected containing "%s" in\n %s line %d\n', malwareStrings{pos}, fullfile(currentFolder, currentFile), countLine); + fprintf('%d: %s\n%d: %s\n%d: %s\n', countLine-1, prevstr, countLine, str, countLine+1, fgetl(fid)); + countLine = countLine+1; + end; + end; + + prevstr = str; + end; + fclose(fid); + + elseif exist(currentFile) == 7 && ~strcmpi(currentFile, '..') && ~strcmpi(currentFile, '.') + detectmalware(fullfile(currentFolder, currentFile)); + end; +end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/difftopo.m b/code/eeglab13_4_4b/functions/miscfunc/difftopo.m new file mode 100644 index 0000000..0486381 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/difftopo.m @@ -0,0 +1,89 @@ +% difftopo - compute and plot component decomposition for the difference ERP +% between two EEG datasets. Plots into the current axis (gca); +% plot into a new empty figure as below. +% Usage: +% >> figure; difftopo(ALLEEG,eeg1,eeg2,interval); +% Inputs: +% ALLEEG - array of leaded EEG datasets +% eeg1 - index of subtrahend (+) dataset +% eeg2 - index of minuend (-) dataset +% interval - [minms maxms] latency interval in which to find +% and plot largest contributing components {default: whole epoch} +% limits - [stms endms] latenc plotting limits (in ms) {default|0: whole epoch} +% subcomps - array of component indices to remove from data +% (e.g. eye movement components) {default|0: none} +% +% Outputs: none +% +% Author: Scott Makeig, SCCN/INC/UCSD 3/28/05 + +% Copyright (C) Scott Makeig, SCCN/INC/UCSD 3/28/05 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +function difftopo(ALLEEG,eeg1,eeg2,interval,limits,subcomps); + +if nargin < 3 + help difftopo + return +end +if eeg1 < 1 | eeg1 > length(ALLEEG) + help difftopo + return +end +if eeg2 < 1 | eeg2 > length(ALLEEG) + help difftopo + return +end +if eeg1 == eeg2 + help difftopo + return +end +if ndims(ALLEEG(eeg1).data) ~=3 | ndims(ALLEEG(eeg2).data) ~=3 + error('EEG datasets must be epoched data'); +end + +if nargin < 4 + interval = [ALLEEG(eeg1).xmin*999.9 ALLEEG(eeg1).xmax*999.9]; +end +if nargin < 5 + limits = 0; % [ALLEEG(eeg1).xmin*1000 ALLEEG(eeg1).xmax*1000]; +end +if nargin < 6 + subcomps = []; +end + +if ~isfield(ALLEEG(eeg1),'icaweights') + error('EEG datasets must have icaweights'); +end +if length(interval) ~= 2 + help difftopo + return +end + +if ALLEEG(eeg1).pnts ~= ALLEEG(eeg1).pnts + error('EEG datasets must have the same number of frames per epoch'); +end + +set(gcf,'Name','difftopo()'); +diff = mean(ALLEEG(eeg1).data,3) - mean(ALLEEG(eeg2).data,3); + +plottitle = [ ALLEEG(eeg1).setname ' - ' ALLEEG(eeg2).setname]; +envtopo(diff,ALLEEG(eeg1).icaweights*ALLEEG(eeg1).icasphere,... + 'chanlocs',ALLEEG(eeg1).chanlocs, ... + 'timerange',[ALLEEG(eeg1).xmin*1000 ALLEEG(eeg1).xmax*1000],... + 'limits',limits,... + 'limcontrib',interval,... + 'title',plottitle, ... + 'subcomps',subcomps); diff --git a/code/eeglab13_4_4b/functions/miscfunc/dprime.m b/code/eeglab13_4_4b/functions/miscfunc/dprime.m new file mode 100644 index 0000000..fd8a47c --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/dprime.m @@ -0,0 +1,433 @@ +% DPRIME - Signal-detection theory sensitivity measure. +% +% d = dprime(pHit,pFA) +% [d,beta] = dprime(pHit,pFA) +% +% PHIT and PFA are numerical arrays of the same shape. +% PHIT is the proportion of "Hits": P(Yes|Signal) +% PFA is the proportion of "False Alarms": P(Yes|Noise) +% All numbers involved must be between 0 and 1. +% The function calculates the d-prime measure for each pair. +% The criterion value BETA can also be requested. +% Requires MATLAB's Statistical Toolbox. +% +% References: +% * Green, D. M. & Swets, J. A. (1974). Signal Detection Theory and +% Psychophysics (2nd Ed.). Huntington, NY: Robert Krieger Publ.Co. +% * Macmillan, Neil A. & Creelman, C. Douglas (2005). Detection Theory: +% A User's Guide (2nd Ed.). Lawrence Erlbaum Associates. +% +% See also NORMINV, NORMPDF. + +% Original coding by Alexander Petrov, Ohio State University. +% $Revision: 1.2 $ $Date: 2009-02-09 10:49:29 $ +% +% Part of the utils toolbox version 1.1 for MATLAB version 5 and up. +% http://alexpetrov.com/softw/utils/ +% Copyright (c) Alexander Petrov 1999-2006, http://alexpetrov.com +% Please read the LICENSE and NO WARRANTY statement: + +% GNU Public License for the UTILS Toolbox +% +% ============================================================================== +% +% IN BRIEF +% ======== +% +% This document refers to all Matlab scripts and documentation (referred +% to collectively here as "the software") contained in the "utils toolbox" +% by Alexander Petrov 1999-2006, http://alexpetrov.com/softw/utils/ +% +% The software is freely available and freely redistributable, according +% to the conditions of the Gnu General Public License (below). You may not +% distribute the software, in whole or in part, in conjunction with +% proprietary code. That means you ONLY have my permission to distribute a +% program that uses my code IF you also make freely available (under the +% terms of the Gnu GPL) the source code for your whole project. You may +% not pass on the software to another party in its current form or any +% altered, embellished or reduced form, without acknowledging the author +% and including a copy of this license. +% +% The software is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +% Public License (reproduced below), and the Free Software Foundation +% website (http://www.fsf.org) for more details. +% +% Please notify the author, via the website, of any bugs, notes, comments +% or suggested changes, particularly of any useful changes you may have +% made to your own copy of the software. +% +% Alex Petrov, December 2006 +% +% ============================================================================== +% +% GNU GENERAL PUBLIC LICENSE +% ========================== +% +% Version 2, June 1991 +% Copyright (C) 1989, 1991 Free Software Foundation, Inc. +% 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +% Everyone is permitted to copy and distribute verbatim copies +% of this license document, but changing it is not allowed. +% +% +% Preamble +% ======== +% +% The licenses for most software are designed to take away your +% freedom to share and change it. By contrast, the GNU General Public +% License is intended to guarantee your freedom to share and change free +% software--to make sure the software is free for all its users. This +% General Public License applies to most of the Free Software +% Foundation's software and to any other program whose authors commit to +% using it. (Some other Free Software Foundation software is covered by +% the GNU Library General Public License instead.) You can apply it to +% your programs, too. +% +% When we speak of free software, we are referring to freedom, not +% price. Our General Public Licenses are designed to make sure that you +% have the freedom to distribute copies of free software (and charge for +% this service if you wish), that you receive source code or can get it +% if you want it, that you can change the software or use pieces of it +% in new free programs; and that you know you can do these things. +% +% To protect your rights, we need to make restrictions that forbid +% anyone to deny you these rights or to ask you to surrender the rights. +% These restrictions translate to certain responsibilities for you if you +% distribute copies of the software, or if you modify it. +% +% For example, if you distribute copies of such a program, whether +% gratis or for a fee, you must give the recipients all the rights that +% you have. You must make sure that they, too, receive or can get the +% source code. And you must show them these terms so they know their +% rights. +% +% We protect your rights with two steps: (1) copyright the software, and +% (2) offer you this license which gives you legal permission to copy, +% distribute and/or modify the software. +% +% Also, for each author's protection and ours, we want to make certain +% that everyone understands that there is no warranty for this free +% software. If the software is modified by someone else and passed on, we +% want its recipients to know that what they have is not the original, so +% that any problems introduced by others will not reflect on the original +% authors' reputations. +% +% Finally, any free program is threatened constantly by software +% patents. We wish to avoid the danger that redistributors of a free +% program will individually obtain patent licenses, in effect making the +% program proprietary. To prevent this, we have made it clear that any +% patent must be licensed for everyone's free use or not licensed at all. +% +% The precise terms and conditions for copying, distribution and +% modification follow. +% +% +% GNU GENERAL PUBLIC LICENSE +% ========================== +% TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +% =============================================================== +% +% 0. This License applies to any program or other work which contains +% a notice placed by the copyright holder saying it may be distributed +% under the terms of this General Public License. The "Program", below, +% refers to any such program or work, and a "work based on the Program" +% means either the Program or any derivative work under copyright law: +% that is to say, a work containing the Program or a portion of it, +% either verbatim or with modifications and/or translated into another +% language. (Hereinafter, translation is included without limitation in +% the term "modification".) Each licensee is addressed as "you". +% +% Activities other than copying, distribution and modification are not +% covered by this License; they are outside its scope. The act of +% running the Program is not restricted, and the output from the Program +% is covered only if its contents constitute a work based on the +% Program (independent of having been made by running the Program). +% Whether that is true depends on what the Program does. +% +% 1. You may copy and distribute verbatim copies of the Program's +% source code as you receive it, in any medium, provided that you +% conspicuously and appropriately publish on each copy an appropriate +% copyright notice and disclaimer of warranty; keep intact all the +% notices that refer to this License and to the absence of any warranty; +% and give any other recipients of the Program a copy of this License +% along with the Program. +% +% You may charge a fee for the physical act of transferring a copy, and +% you may at your option offer warranty protection in exchange for a fee. +% +% 2. You may modify your copy or copies of the Program or any portion +% of it, thus forming a work based on the Program, and copy and +% distribute such modifications or work under the terms of Section 1 +% above, provided that you also meet all of these conditions: +% +% a) You must cause the modified files to carry prominent notices +% stating that you changed the files and the date of any change. +% +% b) You must cause any work that you distribute or publish, that in +% whole or in part contains or is derived from the Program or any +% part thereof, to be licensed as a whole at no charge to all third +% parties under the terms of this License. +% +% c) If the modified program normally reads commands interactively +% when run, you must cause it, when started running for such +% interactive use in the most ordinary way, to print or display an +% announcement including an appropriate copyright notice and a +% notice that there is no warranty (or else, saying that you provide +% a warranty) and that users may redistribute the program under +% these conditions, and telling the user how to view a copy of this +% License. (Exception: if the Program itself is interactive but +% does not normally print such an announcement, your work based on +% the Program is not required to print an announcement.) +% +% These requirements apply to the modified work as a whole. If +% identifiable sections of that work are not derived from the Program, +% and can be reasonably considered independent and separate works in +% themselves, then this License, and its terms, do not apply to those +% sections when you distribute them as separate works. But when you +% distribute the same sections as part of a whole which is a work based +% on the Program, the distribution of the whole must be on the terms of +% this License, whose permissions for other licensees extend to the +% entire whole, and thus to each and every part regardless of who wrote it. +% +% Thus, it is not the intent of this section to claim rights or contest +% your rights to work written entirely by you; rather, the intent is to +% exercise the right to control the distribution of derivative or +% collective works based on the Program. +% +% In addition, mere aggregation of another work not based on the Program +% with the Program (or with a work based on the Program) on a volume of +% a storage or distribution medium does not bring the other work under +% the scope of this License. +% +% 3. You may copy and distribute the Program (or a work based on it, +% under Section 2) in object code or executable form under the terms of +% Sections 1 and 2 above provided that you also do one of the following: +% +% a) Accompany it with the complete corresponding machine-readable +% source code, which must be distributed under the terms of Sections +% 1 and 2 above on a medium customarily used for software interchange; or, +% +% b) Accompany it with a written offer, valid for at least three +% years, to give any third party, for a charge no more than your +% cost of physically performing source distribution, a complete +% machine-readable copy of the corresponding source code, to be +% distributed under the terms of Sections 1 and 2 above on a medium +% customarily used for software interchange; or, +% +% c) Accompany it with the information you received as to the offer +% to distribute corresponding source code. (This alternative is +% allowed only for noncommercial distribution and only if you +% received the program in object code or executable form with such +% an offer, in accord with Subsection b above.) +% +% The source code for a work means the preferred form of the work for +% making modifications to it. For an executable work, complete source +% code means all the source code for all modules it contains, plus any +% associated interface definition files, plus the scripts used to +% control compilation and installation of the executable. However, as a +% special exception, the source code distributed need not include +% anything that is normally distributed (in either source or binary +% form) with the major components (compiler, kernel, and so on) of the +% operating system on which the executable runs, unless that component +% itself accompanies the executable. +% +% If distribution of executable or object code is made by offering +% access to copy from a designated place, then offering equivalent +% access to copy the source code from the same place counts as +% distribution of the source code, even though third parties are not +% compelled to copy the source along with the object code. +% +% 4. You may not copy, modify, sublicense, or distribute the Program +% except as expressly provided under this License. Any attempt +% otherwise to copy, modify, sublicense or distribute the Program is +% void, and will automatically terminate your rights under this License. +% However, parties who have received copies, or rights, from you under +% this License will not have their licenses terminated so long as such +% parties remain in full compliance. +% +% 5. You are not required to accept this License, since you have not +% signed it. However, nothing else grants you permission to modify or +% distribute the Program or its derivative works. These actions are +% prohibited by law if you do not accept this License. Therefore, by +% modifying or distributing the Program (or any work based on the +% Program), you indicate your acceptance of this License to do so, and +% all its terms and conditions for copying, distributing or modifying +% the Program or works based on it. +% +% 6. Each time you redistribute the Program (or any work based on the +% Program), the recipient automatically receives a license from the +% original licensor to copy, distribute or modify the Program subject to +% these terms and conditions. You may not impose any further +% restrictions on the recipients' exercise of the rights granted herein. +% You are not responsible for enforcing compliance by third parties to +% this License. +% +% 7. If, as a consequence of a court judgment or allegation of patent +% infringement or for any other reason (not limited to patent issues), +% conditions are imposed on you (whether by court order, agreement or +% otherwise) that contradict the conditions of this License, they do not +% excuse you from the conditions of this License. If you cannot +% distribute so as to satisfy simultaneously your obligations under this +% License and any other pertinent obligations, then as a consequence you +% may not distribute the Program at all. For example, if a patent +% license would not permit royalty-free redistribution of the Program by +% all those who receive copies directly or indirectly through you, then +% the only way you could satisfy both it and this License would be to +% refrain entirely from distribution of the Program. +% +% If any portion of this section is held invalid or unenforceable under +% any particular circumstance, the balance of the section is intended to +% apply and the section as a whole is intended to apply in other +% circumstances. +% +% It is not the purpose of this section to induce you to infringe any +% patents or other property right claims or to contest validity of any +% such claims; this section has the sole purpose of protecting the +% integrity of the free software distribution system, which is +% implemented by public license practices. Many people have made +% generous contributions to the wide range of software distributed +% through that system in reliance on consistent application of that +% system; it is up to the author/donor to decide if he or she is willing +% to distribute software through any other system and a licensee cannot +% impose that choice. +% +% This section is intended to make thoroughly clear what is believed to +% be a consequence of the rest of this License. +% +% 8. If the distribution and/or use of the Program is restricted in +% certain countries either by patents or by copyrighted interfaces, the +% original copyright holder who places the Program under this License +% may add an explicit geographical distribution limitation excluding +% those countries, so that distribution is permitted only in or among +% countries not thus excluded. In such case, this License incorporates +% the limitation as if written in the body of this License. +% +% 9. The Free Software Foundation may publish revised and/or new versions +% of the General Public License from time to time. Such new versions will +% be similar in spirit to the present version, but may differ in detail to +% address new problems or concerns. +% +% Each version is given a distinguishing version number. If the Program +% specifies a version number of this License which applies to it and "any +% later version", you have the option of following the terms and conditions +% either of that version or of any later version published by the Free +% Software Foundation. If the Program does not specify a version number of +% this License, you may choose any version ever published by the Free Software +% Foundation. +% +% 10. If you wish to incorporate parts of the Program into other free +% programs whose distribution conditions are different, write to the author +% to ask for permission. For software which is copyrighted by the Free +% Software Foundation, write to the Free Software Foundation; we sometimes +% make exceptions for this. Our decision will be guided by the two goals +% of preserving the free status of all derivatives of our free software and +% of promoting the sharing and reuse of software generally. +% +% NO WARRANTY: +% +% 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +% FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +% OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +% PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +% OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +% TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +% PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +% REPAIR OR CORRECTION. +% +% 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +% WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +% REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +% INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +% OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +% TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +% YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +% PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +% POSSIBILITY OF SUCH DAMAGES. +% +% END OF TERMS AND CONDITIONS +% +% +% How to Apply These Terms to Your New Programs +% ============================================= +% +% If you develop a new program, and you want it to be of the greatest +% possible use to the public, the best way to achieve this is to make it +% free software which everyone can redistribute and change under these terms. +% +% To do so, attach the following notices to the program. It is safest +% to attach them to the start of each source file to most effectively +% convey the exclusion of warranty; and each file should have at least +% the "copyright" line and a pointer to where the full notice is found. +% +% +% Copyright (C) +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +% +% +% Also add information on how to contact you by electronic and paper mail. +% +% If the program is interactive, make it output a short notice like this +% when it starts in an interactive mode: +% +% Gnomovision version 69, Copyright (C) year name of author +% Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +% This is free software, and you are welcome to redistribute it +% under certain conditions; type `show c' for details. +% +% The hypothetical commands `show w' and `show c' should show the appropriate +% parts of the General Public License. Of course, the commands you use may +% be called something other than `show w' and `show c'; they could even be +% mouse-clicks or menu items--whatever suits your program. +% +% You should also get your employer (if you work as a programmer) or your +% school, if any, to sign a "copyright disclaimer" for the program, if +% necessary. Here is a sample; alter the names: +% +% Yoyodyne, Inc., hereby disclaims all copyright interest in the program +% `Gnomovision' (which makes passes at compilers) written by James Hacker. +% +% , 1 April 1989 +% Ty Coon, President of Vice +% +% This General Public License does not permit incorporating your program into +% proprietary programs. If your program is a subroutine library, you may +% consider it more useful to permit linking proprietary applications with the +% library. If this is what you want to do, use the GNU Library General +% Public License instead of this License. +% +% ============================================================================== + +function [d,beta] = dprime(pHit,pFA) + +%-- Convert to Z scores, no error checking +zHit = norminv(pHit) ; +zFA = norminv(pFA) ; + +%-- Calculate d-prime +d = zHit - zFA ; + +%-- If requested, calculate BETA +if (nargout > 1) + yHit = normpdf(zHit) ; + yFA = normpdf(zFA) ; + beta = yHit ./ yFA ; +end + +%% Return DPRIME and possibly BETA +%%%%%% End of file DPRIME.M diff --git a/code/eeglab13_4_4b/functions/miscfunc/eeg_ms2f.m b/code/eeglab13_4_4b/functions/miscfunc/eeg_ms2f.m new file mode 100644 index 0000000..ddfa38c --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eeg_ms2f.m @@ -0,0 +1,20 @@ +% eeg_ms2f() - convert epoch latency in ms to nearest epoch frame number +% +% Usage: +% >> outf = eeg_ms2f(EEG,ms); +% Inputs: +% EEG - EEGLAB data set structure +% ms - epoch latency in milliseconds +% Output: +% outf - nearest epoch frame to the specified epoch latency +% +% Author: Scott Makeig, SCCN/INC, 12/05 + +function outf = eeg_ms2f(EEG,ms) + ms = ms/1000; + if ms < EEG.xmin | ms > EEG.xmax + error('time out of range'); + end + outf = 1+round((EEG.pnts-1)*(ms-EEG.xmin)/(EEG.xmax-EEG.xmin)); + % else + % [tmp outf] = min(abs(EEG.times-ms)); diff --git a/code/eeglab13_4_4b/functions/miscfunc/eeg_regepochs.m b/code/eeglab13_4_4b/functions/miscfunc/eeg_regepochs.m new file mode 100644 index 0000000..c891f3e --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eeg_regepochs.m @@ -0,0 +1,171 @@ +% eeg_regepochs() - Convert a continuous dataset into consecutive epochs of +% a specified regular length by adding dummy events of type +% and epoch the data around these events. Alternatively +% only insert events for extracting these epochs. +% May be used to split up continuous data for +% artifact rejection followed by ICA decomposition. +% The computed EEG.icaweights and EEG.icasphere matrices +% may then be exported to the continuous dataset and/or +% to its epoched descendents. +% Usage: +% >> EEGout = eeg_regepochs(EEG); % use defaults +% >> EEGout = eeg_regepochs(EEG, 'key', val, ...); +% +% Required input: +% EEG - EEG continuous data structure (EEG.trials = 1) +% +% Optional inputs: +% 'recurrence' - [in s] the regular recurrence interval of the dummy +% events used as time-locking events for the +% consecutive epochs {default: 1 s} +% 'limits' - [minsec maxsec] latencies relative to the time-locking +% events to use as epoch boundaries. Stated epoch length +% will be reduced by one data point to avoid overlaps +% {default: [0 recurrence_interval]} +% 'rmbase' - [NaN|latency] remove baseline (s). NaN does not remove +% baseline. 0 remove the pre-0 baseline. To +% remove the full epoch baseline, enter a value +% larger than the upper epoch limit. Default is 0. +% 'eventtype' - [string] name for the event type. Default is 'X' +% 'extractepochs' - ['on'|'off'] extract data epochs ('on') or simply +% insert events ('off'). Default is 'on'. +% +% Outputs: +% EEGout - the input EEG structure separated into consecutive +% epochs. +% +% See also: pop_editeventvals(), pop_epoch(), rmbase(); +% +% Authors: Hilit Serby, Arnaud Delorme & Scott Makeig, SCCN/INC/UCSD, Sep 02, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, Sep 02, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = eeg_regepochs(EEG, varargin) + +if nargin < 1 + help eeg_regepochs; + return; +end; + +if length(EEG) > 1 + EEG = pop_mergeset(EEG, [1:length(EEG)]); +end; + +% test input variables +% -------------------- +if ~isstruct(EEG) | ~isfield(EEG,'event') + error('first argument must be an EEG structure') +elseif EEG.trials > 1 + error('input dataset must be continuous data (1 epoch)'); +end + +if nargin > 1 && ~isstr(varargin{1}) + options = {}; + if nargin >= 2, options = { options{:} 'recurrence' varargin{1} }; end; + if nargin >= 3, options = { options{:} 'limits' varargin{2} }; end; + if nargin >= 4, options = { options{:} 'rmbase' varargin{3} }; end; +else + options = varargin; +end; +g = finputcheck(options, { 'recurrence' 'real' [] 1; + 'limits' 'real' [] [0 1]; + 'rmbase' 'real' [] 0; + 'eventtype' 'string' {} 'X'; + 'extractepochs' 'string' { 'on','off' } 'on' }, 'eeg_regepochs'); +if isstr(g), error(g); end; + +if g.recurrence < 0 | g.recurrence > EEG.xmax + error('recurrence_interval out of bounds'); +end + +if nargin < 3 + g.limits = [0 g.recurrence]; +end + +if length(g.limits) ~= 2 | g.limits(2) <= g.limits(1) + error('epoch limits must be a 2-vector [minsec maxsec]') +end + +% calculate number of events to add +% --------------------------------- +bg = 0; % beginning of data +en = EEG.xmax; % end of data in sec +nu = floor(EEG.xmax/g.recurrence); % number of type 'X' events to add and epoch on + +% bg = EEG.event(1).latency/EEG.srate; % time in sec of first event +% en = EEG.event(end).latency/EEG.srate; % time in sec of last event +% nu = length((bg+g.recurrence):g.recurrence:(en-g.recurrence)); % number of 'X' events, one every 'g.recurrence' sec + +if nu < 1 + error('specified recurrence_interval too long') +end + +% print info on commandline +% ------------------------- +eplength = g.limits(2)-g.limits(1); +fprintf('The input dataset will be split into %d epochs of %g s\n',nu,eplength); +fprintf('Epochs will overlap by %2.0f%%.\n',(eplength-g.recurrence)/eplength*100); + +% insert events and urevents at the end of the current (ur)event tables +% --------------------------------------------------------------------- +fprintf('Inserting %d type ''%s'' events: ', nu, g.eventtype); +nevents = length(EEG.event); +% convert all event types to strings +for k = 1:nevents + EEG.event(k).type = num2str(EEG.event(k).type); +end + +nurevents = length(EEG.urevent); +for k = 1:nu + if rem(k,40) + fprintf('.') + else + fprintf('%d',k) + end + if k==40 | ( k>40 & ~rem(k-40,70)) + fprintf('\n'); + end + + EEG.event(nevents+k).type = g.eventtype; + EEG.event(nevents+k).latency = g.recurrence*(k-1)*EEG.srate+1; + + EEG.urevent(nurevents+k).type = g.eventtype; + EEG.urevent(nurevents+k).latency = g.recurrence*(k-1)*EEG.srate+1; + EEG.event(nevents+k).urevent = nurevents+k; +end +fprintf('\n'); + +% sort the events based on their latency +% -------------------------------------- +fprintf('Sorting the event table.\n'); +EEG = pop_editeventvals( EEG, 'sort', {'latency' 0}); + +% split the dataset into epochs +% ------------------------------ +if strcmpi(g.extractepochs, 'on') + fprintf('Splitting the data into %d %2.2f-s epochs\n',nu,eplength); + setname = sprintf('%s - %g-s epochs', EEG.setname, g.recurrence); + EEG = pop_epoch( EEG, { g.eventtype }, g.limits, 'newname', ... + setname, 'epochinfo', 'yes'); + % baseline zero the epochs + % ------------------------ + if ~isnan(g.rmbase) && g.limits(1) < g.rmbase + fprintf('Removing the pre %3.2f second baseline mean of each epoch.\n', g.rmbase); + EEG = pop_rmbase( EEG, [g.limits(1) g.rmbase]*1000); + end +end; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/eeg_time2prev.m b/code/eeglab13_4_4b/functions/miscfunc/eeg_time2prev.m new file mode 100644 index 0000000..65f8318 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eeg_time2prev.m @@ -0,0 +1,165 @@ +% eeg_time2prev() - returns a vector giving, for each event of specified ("target") type(s), +% the delay (in ms) since the preceding event (if any) of specified +% ("previous") type(s). Requires the EEG.urevent structure, plus +% EEG.event().urevent pointers to it. +% +% NOW SUPERCEDED BY eeg_context() +% Usage: +% >> [delays,targets,urtargs,urprevs] = eeg_time2prev(EEG,{target},{previous}); +% Inputs: +% EEG - structure containing an EEGLAB dataset +% {target} - cell array of strings naming event type(s) of the specified target events +%{previous} - cell array of strings naming event type(s) of the specified previous events +% +% Outputs: +% delays - vector giving, for each event of a type listed in "target", the delay (in ms) +% since the last preceding event of a type listed in "previous" (0 if none such). +% targets - vector of indices of the "target" events in the event structure +% urtargs - vector of indices of the "target" events in the urevent structure +% urprevs - vector of indices of the "previous" events in the urevent structure (0 if none). +% +% Example: +% >> target = {'novel'}; % target event type 'novel' +% >> previous = {'novel', 'rare'}; % either 'novel' or 'rare' +% >> [delays,targets] = eeg_time2prev(EEG,target,previous); +%% Vector 'delays' now contains delays (in ms) from each 'novel' event to the previous +%% 'rare' OR 'novel' event, else 0 if none such. Vector 'targets' now contains the +%% 'novel' event indices. +%% +% Scott Makeig & Arnaud Delorme, SCCN/INC/UCSD, August 28, 2003 + +function [delays,targets,urtargets,urprevs] = eeg_time2prev(EEG,target,previous); + +verbose = 1; % FLAG (1=on|0=off) +nevents = length(EEG.event); + +% +%%%%%%%%%%%%%%%%%%%% Test input arguments %%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~iscell(target) + error('2nd argument "target" must be a {cell array} of event type strings.'); + return +end +for k=1:length(target) + if ~ischar([ target{k}{:} ]) + error('2nd argument "target" must be a {cell array} of event type strings.'); + end +end +if ~iscell(previous) + error('3rd argument "previous" must be a {cell array} of event types.'); + return +end +for k=1:length(target) % make all target types strings + if ~ischar(target{k}) + target{k} = num2str(target{k}); + end +end +for k=1:length(previous) % make all previous types strings + if ~ischar(previous{k}) + previous{k} = num2str(previous{k}); + end +end +if ~isfield(EEG,'urevent') + error('requires the urevent structure be present.'); + return +end +if length(EEG.urevent) < nevents + error('WARNING: In dataset, number of urevents < number of events!?'); + return +end + +% +%%%%%%%%%%%%%%%%%%%% Initialize output arrays %%%%%%%%%%%%%%%%%%%%%% +% +delays = zeros(1,nevents); % holds output times in ms +targets = zeros(1,nevents); % holds indxes of targets +urtargets = zeros(1,nevents); % holds indxes of targets +urprevs = zeros(1,nevents); % holds indxes of prevs + +targetcount = 0; % index of current target +% Below: +% idx = current event index +% uridx = current urevent index +% tidx = target type index +% uidx = previous urevent index +% pidx = previous type index +% +%%%%%%%%%%%for each event in the dataset %%%%%%%%%%%%%%%%%%%% +% +for idx = 1:nevents % for each event in the dataset + % + %%%%%%%%%%%%%%%%%%%%%%%% find target events %%%%%%%%%%%%%%%%% + % + uridx = EEG.event(idx).urevent; % find its urevent index + istarget = 0; % initialize target flag + tidx = 1; % initialize target type index + while ~istarget & tidx<=length(target) % for each potential target type + if strcmpi(num2str(EEG.urevent(uridx).type),target(tidx)) + istarget=1; % flag event as target + targetcount = targetcount+1; % increment target count + targets(targetcount) = idx; % save event index + urtargets(targetcount) = uridx; % save urevent index + break % stop target type checking + else + tidx = tidx+1; % else try next target type + end + end + + if istarget % if current event is a target type + % + %%%%%%%%%%%%%%%%%%% Find a 'previous' event %%%%%%%%%%%%%%%%%% + % + isprevious = 0; % initialize previous flag + uidx = uridx-1; % begin with the previous urevent + while uridx > 0 + pidx = 1; % initialize previous type index + while ~isprevious & pidx<=length(previous) % for each previous event type + if strcmpi(num2str(EEG.urevent(uidx).type),previous(pidx)) + isprevious=1; % flag 'previous' event + urprevs(targetcount) = uidx; % mark event as previous + break % stop previous type checking + else + pidx = pidx+1; % try next 'previous' event type + end + end % pidx + if isprevious + break % stop previous event checking + else + uidx = uidx-1; % keep checking for a 'previous' type event + end % isprevious + end % uidx + % + %%% Compute delay from current target to previous event %%%%% + % + if isprevious % if type 'previous' event found + delays(targetcount) = 1000/EEG.srate * ... + (-1)*(EEG.urevent(uridx).latency - EEG.urevent(urprevs(targetcount)).latency); + else + delays(targetcount) = 0; % mark no previous event with 0 + end + if verbose + fprintf('%4d. (targ %s) %4d - (prev %s) %4d = %4.1f ms\n',... + targetcount, targets(tidx),idx, ... + previous(pidx),urprevs(targetcount),... + delays(targetcount)); + end % verbose + end % istarget +end % event loop + +% +%%%%%%%%%%%%%% Truncate the output arrays %%%%%%%%%%%%%%%%%%%%%% +% +if targetcount > 0 + targets = targets(1:targetcount); + urtargets = urtargets(1:targetcount); + urprevs = urprevs(1:targetcount); + delays = delays(1:targetcount); +else + if verbose + fprintf('eeg_time2prev(): No target type events found.\n') + end + targets = []; + urtargets = []; + urprevs = []; + delays = []; +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/eegdraw.m b/code/eeglab13_4_4b/functions/miscfunc/eegdraw.m new file mode 100644 index 0000000..5453526 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eegdraw.m @@ -0,0 +1,122 @@ +% eegdraw() - subroutine used by eegplotold() to plot data. +% +% Author: Colin Humphries, CNL, Salk Institute, La Jolla, 7/96 + +% Copyright (C) Colin Humphries, CNL, Salk Institute 7/96 from eegplot() +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 11-07-97 fix incorrect start times -Scott Makeig +% 01-25-02 reformated help & license -ad + +function y = eegdraw(fighandle) + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Extract variables from figure and axes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +userdata = get(fighandle,'UserData'); +samplerate = userdata(1); +PLOT_TIME = userdata(2); +spacing_var = userdata(3); +time = userdata(4); +maxtime = userdata(5); +axhandle = userdata(6); +plotcolor = userdata(7); +disp_scale = userdata(12); + +colors = ['y','w']; + +data = get(axhandle,'UserData'); + +if samplerate <=0 + fprintf('Samplerate too small! Resetting it to 1.0.\n') + samplerate = 1.0; +end + +if PLOT_TIME < 2/samplerate + PLOT_TIME = 2/samplerate; + fprintf('Window width too small! Resetting it to 2 samples.\n'); +end + +if time >= maxtime % fix incorrect start time + time = max(maxtime-PLOT_TIME,0); + fprintf('Start time too large! Resetting it to %f.\n',time) +elseif time < 0 + time = 0; + fprintf('Start time cannot be negative! Resetting it to 0.\n') +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Define internal variables +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +[chans,frames] = size(data); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Label x-axis - relabel the x-axis based on +% the new value of time. +% Labels are placed at one-second intervals +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +cla % Clear figure + +Xlab = num2str(time); +for j = 1:1:PLOT_TIME + Q = num2str(time+j); + Xlab = str2mat(Xlab, Q); +end +set (gca, 'Ytick', 0:spacing_var:chans*spacing_var) + set (gca, 'XTickLabels', Xlab) % needs TickLabels with s in Matlab 4.2 +set (gca, 'XTick',(0:samplerate:PLOT_TIME*samplerate)) + +axis([0 PLOT_TIME*samplerate 0 (chans+1)*spacing_var]); + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot data +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +for i = 1:chans %repeat for each channel + if (maxtime-time>PLOT_TIME) + F = data(chans-i+1,(time*samplerate)+1:((time+PLOT_TIME)*samplerate)); + else + F = data(chans-i+1,(time*samplerate)+1:(maxtime*samplerate)); + end + F = F - mean(F) + i*spacing_var; + plot (F,'clipping','off','color',colors(plotcolor)) +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot scaling I +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if disp_scale == 1 + ps = PLOT_TIME*samplerate; + sv = spacing_var; + line([1.03*ps,1.03*ps],[1.5*sv 2.5*sv],'clipping','off','color','w') + line([1.01*ps,1.05*ps],[2.5*sv,2.5*sv],'clipping','off','color','w') + line([1.01*ps,1.05*ps],[1.5*sv,1.5*sv],'clipping','off','color','w') + text(1.05*ps,2*sv,num2str(round(sv)),'clipping','off') +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Set slider=edit - reset the value of +% the user controls so they agree. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +H = findobj(fighandle,'style','slider'); +D = findobj(fighandle,'style','edit'); +set (D, 'string', num2str(time)); diff --git a/code/eeglab13_4_4b/functions/miscfunc/eegdrawg.m b/code/eeglab13_4_4b/functions/miscfunc/eegdrawg.m new file mode 100644 index 0000000..5c32898 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eegdrawg.m @@ -0,0 +1,102 @@ +% eegdrawg() - subroutine used by eegplotgold() to plot data. +% +% Author: Colin Humphries, CNL, Salk Institute, La Jolla, 7/96 + +% Copyright (C) Colin Humphries, CNL, Salk Institute 7/96 from eegplot() +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 4-4-97 shortened name to eegdrawq() -sm +% 4-7-97 allowed data names other than 'data' -ch +% 01-25-02 reformated help & license -ad + +function y = eegdrawg(fighandle) + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Extract variables from figure and axes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +userdata = get(fighandle,'UserData'); +samplerate = userdata(1); +PLOT_TIME = userdata(2); +spacing_var = userdata(3); +time = userdata(4); +maxtime = userdata(5); +axhandle = userdata(6); +plotcolor = userdata(7); +disp_scale = userdata(12); +colors = ['y','w']; +dataname = get(axhandle,'UserData'); +eval(['global ',dataname]) + +cla % Clear figure + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Define internal variables +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +eval(['[chans,frames] = size(',dataname,');']); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Label x-axis +% This routine relabels the x-axis based on the new value of time. +% Labels are placed on one second intervals +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Xlab = num2str(time); +for j = 1:1:PLOT_TIME + Q = num2str(time+j); + Xlab = str2mat(Xlab, Q); +end +set (gca, 'Ytick', 0:spacing_var:chans*spacing_var) +set (gca, 'XTickLabels', Xlab) +set (gca, 'XTick',(0:samplerate:PLOT_TIME*samplerate)) + +axis([0 PLOT_TIME*samplerate 0 (chans+1)*spacing_var]); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% plotting routine +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +for i = 1:chans %repeat for each channel + if (maxtime-time>PLOT_TIME) + eval(['F = ',dataname,'(chans-i+1,(time*samplerate)+1:((time+PLOT_TIME)*samplerate));']) + else + eval(['F = ',dataname,'(chans-i+1,(time*samplerate)+1:(maxtime*samplerate));']) + end + F = F - mean(F) + i*spacing_var; + plot (F,'clipping','off','color',colors(plotcolor)) +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot Scaling I +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if disp_scale == 1 + line([(PLOT_TIME+.3)*samplerate,(PLOT_TIME+.3)*samplerate],[1.5*spacing_var 2.5*spacing_var],'clipping','off','color','w') + line([(PLOT_TIME+.3)*samplerate-10,(PLOT_TIME+.3)*samplerate+10],[2.5*spacing_var,2.5*spacing_var],'clipping','off','color','w') + line([(PLOT_TIME+.3)*samplerate-10,(PLOT_TIME+.3)*samplerate+10],[1.5*spacing_var,1.5*spacing_var],'clipping','off','color','w') + text((PLOT_TIME+.5)*samplerate,2*spacing_var,num2str(round(spacing_var)),'clipping','off') +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Set slider=edit +% This routine resets the value of the user controls so that +% they agree. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + H = findobj(fighandle,'style','slider'); + D = findobj(fighandle,'style','edit'); + set (D, 'string', num2str(time)); diff --git a/code/eeglab13_4_4b/functions/miscfunc/eegmovie.m b/code/eeglab13_4_4b/functions/miscfunc/eegmovie.m new file mode 100644 index 0000000..4720fae --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eegmovie.m @@ -0,0 +1,285 @@ +% eegmovie() - Compile and view a Matlab movie. +% Uses scripts eegplotold() and topoplot(). +% Use seemovie() to display the movie. +% Usage: +% >> [Movie,Colormap] = eegmovie(data,srate,elec_locs, 'key', val, ...); +% +% Or legacy call +% >> [Movie,Colormap] = eegmovie(data,srate,elec_locs,title,movieframes,minmax,startsec,...); +% +% Inputs: +% data = (chans,frames) EEG data set to plot +% srate = sampling rate in Hz +% elec_locs = electrode locations structure or file +% +% Optional inputs: +% 'mode' = ['2D'|'3D'] plot in 2D using topoplot or in 3D using +% headplot. Default is 2D. +% 'headplotopt' = [cell] optional inputs for headplot. Default is none. +% 'topoplotopt' = [cell] optional inputs for topoplot. Default is none. +% 'title' = plot title. Default is none. +% 'movieframes' = vector of frames indices to animate. Default is all. +% 'minmax' = [blue_lower_bound, red_upper_bound]. Default is +% +/-abs max of data. +% 'startsec' = starting time in seconds. Default is 0. +% 'timecourse' = ['on'|'off'] show time course for all electrodes. Default is 'on'. +% 'framenum' = ['on'|'off'] show frame number. Default is 'on'. +% 'time' = ['on'|'off'] show time in ms. Default is 'off'. +% 'vert' = [float] plot vertical lines at given latencies. Default is none. +% 'camerapath' = [az_start az_step el_start el_step] {default [-127 0 30 0]} +% Setting all four non-0 creates a spiral camera path +% Subsequent rows [movieframe az_step 0 el_step] adapt step +% sizes allowing starts/stops, panning back and forth, etc. +% +% Legacy inputs: +% data = (chans,frames) EEG data set to plot +% srate = sampling rate in Hz {0 -> 256 Hz} +% elec_locs = ascii file of electrode locations {0 -> 'chan_file'} +% title = 'plot title' {0 -> none} +% movieframes = vector of frames to animate {0 -> all} +% minmax = [blue_lower_bound, red_upper_bound] +% {0 -> +/-abs max of data} +% startsec = starting time in seconds {0 -> 0.0} +% additional options from topoplot are allowed +% +% Author: Arnaud Delorme, Colin Humphries & Scott Makeig, CNL, Salk Institute, La Jolla, 3/97 +% +% See also: seemovie(), eegplotold(), topoplot() + +% Copyright (C) 6/4/97 Colin Humphries & Scott Makeig, CNL / Salk Institute / La Jolla CA +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 6/6/97 added movieframes arg -sm +% 6/12/97 removed old 'startframes' var., fixed vertical line frame selection -sm +% 6/27/97 debugged vertical line position -sm +% 10/4/97 clarified order of srate and eloc_locs -sm +% 3/18/97 changed eegplots -> eegplot('noui') -sm +% 10/10/99 added newlines to frame print at suggestion of Ian Lee, Singapore -sm +% 01/05/01 debugged plot details -sm +% 01/24/02 updated eegplot to eegplotold -ad +% 01-25-02 reformated help & license, added links -ad + +function [Movie, Colormap] = eegmovie(data,srate,eloc_locs,varargin); +%titl,movieframes,minmax,startsec,varargin) + +if nargin<1 + help eegmovie + return +end + +clf +[chans,frames] = size(data); +icadefs; % read DEFAULT_SRATE; +if nargin <2 + srate = 0; +end +if nargin <3 + eloc_locs = 0; +end + +if nargin > 5 && ~ischar(varargin{3}) || nargin == 4 && ~ischar(varargin{2}) + % legacy mode + options = {}; + if nargin>=8, options = { options{:} 'topoplotopt' varargin(5:end) }; end + if nargin>=7, options = { options{:} 'startsec' varargin{4} }; end + if nargin>=6, options = { options{:} 'minmax' varargin{3} }; end + if nargin>=5, options = { options{:} 'movieframes' varargin{2} }; end + if nargin>=4, options = { options{:} 'title' varargin{1} }; end +else + options = varargin; +end; + +opt = finputcheck(options, { 'startsec' 'real' {} 0; + 'minmax' 'real' {} 0; + 'movieframes' 'integer' {} 0; + 'title' 'string' {} ''; + 'vert' 'real' {} []; + 'mode' 'string' { '2D' '3D' } '2D'; + 'timecourse' 'string' { 'on' 'off' } 'on'; + 'framenum' 'string' { 'on' 'off' } 'on'; + 'camerapath' 'real' [] 0; + 'time' 'string' { 'on' 'off' } 'off'; + 'topoplotopt' 'cell' {} {}; + 'headplotopt' 'cell' {} {} }, 'eegmovie'); +if isstr(opt), error(opt); end; +if opt.minmax ==0, + datamin = min(min(data)); + datamax = max(max(data)); + absmax = max([abs(datamin), abs(datamax)]); + fudge = 0.05*(datamax-datamin); % allow for slight extrapolation + datamin = -absmax-fudge; + datamax = absmax+fudge; + opt.minmax = [datamin datamax]; +end + +if opt.movieframes == 0 + opt.movieframes = 1:frames; +end +if opt.movieframes(1) < 1 || opt.movieframes(length(opt.movieframes))>frames + fprintf('eegmovie(): specified movieframes not in data!\n'); + return +end +if srate ==0, + srate = DEFAULT_SRATE; +end +if strcmpi(opt.time, 'on'), opt.framenum = 'off'; end; + +mframes = length(opt.movieframes); +fprintf('Making a movie of %d frames\n',mframes) +Movie = moviein(mframes,gcf); + +%%%%%%%%%%%%%%%%%%%%% eegplot() of data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if strcmpi(opt.timecourse, 'on') + axeegplot = axes('Units','Normalized','Position',[.75 .05 .2 .9]); + + % >> eegplotold('noui',data,srate,spacing,eloc_file,startsec,color) + if isstruct(eloc_locs) + fid = fopen('tmp_file.loc', 'w'); + adddots = '...'; + for iChan = 1:length(eloc_locs) + fprintf(fid, '0 0 0 %s\n', [ eloc_locs(iChan).labels adddots(length(eloc_locs(iChan).labels):end) ]); + end; + fclose(fid); + eegplotold('noui',-data,srate,0,'tmp_file.loc',opt.startsec,'r'); + else + eegplotold('noui',-data,srate,0,eloc_locs,opt.startsec,'r'); + end; + + % set(axeegplot,'XTick',[]) %%CJH + % plot negative up + limits = get(axeegplot,'Ylim'); % list channel numbers only + set(axeegplot,'GridLineStyle','none') + set(axeegplot,'Xgrid','off') + set(axeegplot,'Ygrid','on') + + for ind = 1:length(opt.vert) + frameind = (opt.vert(ind)-opt.startsec)*srate+1; + line([frameind frameind],limits,'color','k'); % draw vertical line at map timepoint + set(axeegplot,'Xtick',frameind,'XtickLabel',num2str(opt.vert(ind),'%4.3f')); + end; +end; + +%%%%%%%%%%%%%%%%%%%%% topoplot/headplot axis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +axcolor = get(gcf,'Color'); +axtopoplot = axes('Units','Normalized','Position',[0 .1 .72 .8],'Color',axcolor); +TPAXCOLOR = get(axtopoplot,'Color'); %%CJH +Colormap = [jet(64);TPAXCOLOR]; %%CJH +fprintf('Warning: do not resize plot window during movie creation ...\n '); +h = textsc(opt.title, 'title'); set(h,'FontSize',16) + +%%%%%%%%%%%%%%%%%%%%% headplot setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if strcmpi(opt.mode, '3d') + headplot('setup',eloc_locs, 'tmp.spl', opt.headplotopt{:}); + + if isequal(opt.camerapath, 0) + opt.camerapath = [-127 0 30 0]; + fprintf('Using default view [-127 0 30 0].'); + end; + if size(opt.camerapath,2)~=4 + error('Camerapath parameter must have exact 4 columns'); + end + + newpan = length(opt.movieframes)+1; + posrow = 2; + if size(opt.camerapath,1) > 1 + newpan = opt.camerapath(posrow,1); % pick up next frame to change camerapos step values + end + + azimuth = opt.camerapath(1,1); % initial camerapath variables + az_step = opt.camerapath(1,2); + elevation = opt.camerapath(1,3); + el_step = opt.camerapath(1,4); + +end; + +%%%%%%%%%%%%%%%%%%%%%%%%% "Roll'em!" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +for f = 1:length(opt.movieframes) % make the movie, frame by frame + indFrame = opt.movieframes(f); + + % show time course + if strcmpi(opt.timecourse, 'on') + axes(axeegplot) + x1 = opt.startsec+(indFrame-1)/srate; + l1 = line([indFrame indFrame],limits,'color','b'); % draw vertical line at map timepoint + set(axeegplot,'Xtick',indFrame,'XtickLabel',num2str(x1,'%4.3f')); + end; + + % plot headplot or topoplot + axes(axtopoplot) + cla + set(axtopoplot,'Color',axcolor); + if strcmpi(opt.mode, '2d') + topoplot(data(:,indFrame),eloc_locs,'maplimits',opt.minmax, opt.topoplotopt{:}); + else + headplot(data(:,indFrame),'tmp.spl','view',[azimuth elevation], opt.headplotopt{:}); + + % adapt camerapath step sizes + if indFrame == newpan + az_step = opt.camerapath(posrow,2); + el_step = opt.camerapath(posrow,4); + posrow = posrow+1; + if size(opt.camerapath,1)>=posrow + newpan = opt.camerapath(posrow,1); + else + newpan = length(opt.movieframes)+1; + end + end + + % update camera position + azimuth = azimuth+az_step; + elevation = elevation+el_step; + if elevation>=90 + fprintf('headplot(): warning -- elevation out of range!\n'); + elevation = 89.99; + end + if elevation<=-90 + fprintf('headplot(): warning -- elevation out of range!\n'); + elevation = -89.99; + end + + set(axtopoplot,'Units','pixels',... + 'CameraViewAngleMode','manual',... + 'YTickMode','manual','ZTickMode','manual',... + 'PlotBoxAspectRatioMode','manual',... + 'DataAspectRatioMode','manual'); % keep camera distance constant + + end; + + % show frame number + if strcmpi(opt.framenum, 'on') + txt = [ int2str(f)]; + text(-0.5,-0.5,txt,'FontSize',14); + elseif strcmpi(opt.time, 'on') + txt = sprintf('%3.3f s', opt.startsec+(indFrame-1)/srate); + text(-0.5,-0.5,txt,'FontSize',14); + end; + + Movie(:,f) = getframe(gcf); + drawnow + if strcmpi(opt.timecourse, 'on') + delete(l1) + end; + + % print advancement + fprintf('.',f); + if rem(indFrame,10) == 0, fprintf('%d',f); end; + if rem(indFrame,50) == 0, fprintf('\n'); end +end +fprintf('\nDone\n'); diff --git a/code/eeglab13_4_4b/functions/miscfunc/eegplotgold.m b/code/eeglab13_4_4b/functions/miscfunc/eegplotgold.m new file mode 100644 index 0000000..dbcb7fe --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eegplotgold.m @@ -0,0 +1,339 @@ +% eegplotgold() - display EEG data in a clinical format +% +% Usage: +% >> eegplotgold('dataname', samplerate, 'chanfile', 'title', yscaling, range) +% +% Inputs: +% 'dataname' - quoted name of a desktop global variable (see Ex. below) +% samplerate - EEG sampling rate in Hz (0 -> default 256 Hz) +% 'chanfile' - file of channel info in topoplot() style +% (0 -> channel numbers) +% 'title' - plot title string (0 -> 'eegplotgold()') +% yscaling - initial y scaling factor (0 - default is 300) +% range - how many seconds to display in window (0 -> 10) +% +% Note: this version of eegplotgold() reguires that your data matrix +% be defined as a global variable before running this routine. +% +% Example: >> global dataname +% >> eegplotgold('dataname') +% +% Author: Colin Humphries, CNL, Salk Institute, La Jolla, 3/97 +% +% See also: eegplot(), eegplotold(), eegplotsold() + +% Copyright (C) Colin Humphries, CNL, Salk Institute 3/97 from eegplotold() +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 4-4-97 shortened name to eegplotgold() -sm +% 5-20-97 added read of icadefs.m for MAXEEGPLOTCHANS -sm +% 8-10-97 Clarified chanfile type -sm +% 01-25-02 reformated help & license, added links -ad + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function y = eegplotold(dataname, samplerate, channamefile, titleval, yscaling, range) + +eval (['global ',dataname]) + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Define defaults +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +icadefs; + +% set initial spacing + +eval(['DEFAULT_SPACING = max(max(',dataname,''')-min(',dataname,'''));']) + +% spacing_var/20 = microvolts/millimeter with 21 channels +% for n channels: 21/n * spacing_var/20 = microvolts/mm +% for clinical data. + +DEFAULT_SAMPLERATE = 256; % default rate in Hz. +DEFAULT_PLOTTIME = 10; % default 10 second window +DEFAULT_TITLE = 'eegplotgold()'; +errorcode=0; % initialize error indicator + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Allow for different numbers of arguments +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin < 6 + PLOT_TIME = DEFAULT_PLOTTIME; +else + PLOT_TIME = range; +end +if nargin < 5 + spacing_var = DEFAULT_SPACING; +else + spacing_var = yscaling; +end +if spacing_var == 0 + spacing_var = DEFAULT_SPACING; +end + +if nargin < 4 + titleval = DEFAULT_TITLE; +end +if titleval == 0 + titleval = DEFAULT_TITLE; +end +if nargin < 3 + channamefile = 0; +end +if nargin < 2 + samplerate = DEFAULT_SAMPLERATE; +end +if samplerate == 0, + samplerate = DEFAULT_SAMPLERATE; +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Define internal variables +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SAMPLE_RATE = samplerate; +time = 0; +eval(['[chans,frames] = size(',dataname,');']) %size of data matrix + +maxtime = frames / samplerate; %size of matrix in seconds + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Read the channel names +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if channamefile ~=0, % read file of channel names + chid = fopen(channamefile,'r'); + if chid <3, + fprintf('plotdata: cannot open file %s.\n',channamefile); + errorcode=2; + channamefile = 0; + else + fprintf('Chan info file %s opened\n',channamefile); + end; + + icadefs; % read MAXEEGPLOTCHANS from icadefs.m + if errorcode==0, + channames = fscanf(chid,'%s',[6 MAXEEGPLOTCHANS]); + channames = channames'; + [r c] = size(channames); + for i=1:r + for j=1:c + if channames(i,j)=='.', + channames(i,j)=' '; + end; + end; + end; + % fprintf('%d channel names read from file.\n',r); + if (r>chans) + fprintf('Using first %d names.\n',chans); + channames = channames(1:chans,:); + end; + if (r= 8.04 + set(gcf,'Name',['EEGPLOTOLD #',num2str(fighandle.Number)]); + else + set(gcf,'Name',['EEGPLOTOLD #',num2str(gcf)]); + end + set (gca, 'xgrid', 'on') %Xaxis gridlines only + set (gca, 'GridLineStyle','-') %Solid grid lines + set (gca, 'XTickLabels', Xlab) %Use Xlab for tick labels + set (gca, 'Box', 'on') + set (gca, 'XTick', time*samplerate:1.0*samplerate:PLOT_TIME*samplerate) + set (gca, 'Ytick', 0:spacing_var:chans*spacing_var) % ytickspacing on channels + set (gca, 'TickLength', [0.001 0.001]) + title(titleval) % title is titleval + axis([0 PLOT_TIME*samplerate 0 (chans+1)*spacing_var]); % set axis values + set (gca, 'YTickLabels', flipud(channames)) % write channel names + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot the selected EEG data epoch +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +for i = 1:chans + if (maxtime-time>PLOT_TIME) + eval(['F = ',dataname,'(chans-i+1,(time*samplerate)+1:(time+PLOT_TIME*samplerate));']) + else + eval(['F = ',dataname,'(chans-i+1,(time*samplerate)+1:(maxtime*samplerate));']) + end + F = F - mean(F) + i*spacing_var; + plot (F,'clipping','off') +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot Scaling I +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +line([(PLOT_TIME+.3)*samplerate,(PLOT_TIME+.3)*samplerate],[1.5*spacing_var 2.5*spacing_var],'clipping','off','color','w') +line([(PLOT_TIME+.3)*samplerate-10,(PLOT_TIME+.3)*samplerate+10],[2.5*spacing_var,2.5*spacing_var],'clipping','off','color','w') +line([(PLOT_TIME+.3)*samplerate-10,(PLOT_TIME+.3)*samplerate+10],[1.5*spacing_var,1.5*spacing_var],'clipping','off','color','w') +text((PLOT_TIME+.5)*samplerate,2*spacing_var,num2str(round(spacing_var)),'clipping','off') + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% User Control Routines +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + slider_position = [.125 .030 .3 .024]; % position of user-controlled slider + edit_position = [.65 .025 .1 .05]; % position of edit box + slider_position2 = [.8 .03 .1 .024]; + b1_position = [.175 .022 .09 .047]; + b2_position = [.29 .022 .09 .047]; + b3_position = [.125 .022 .045 .047]; + b4_position = [.385 .022 .045 .047]; + + Max_Space = 1; + Min_Space = DEFAULT_SPACING*2; +% User_Data_Mat = [data;zeros(1,length(data))]; + +axhandle = gca; + User_Data_Mat(1) = samplerate; + User_Data_Mat(2) = PLOT_TIME; + User_Data_Mat(3) = spacing_var; + User_Data_Mat(4) = time; + User_Data_Mat(5) = maxtime; + User_Data_Mat(6) = axhandle; + User_Data_Mat(7) = 1; % color + User_Data_Mat(8) = frames; + User_Data_Mat(9) = chans; + User_Data_Mat(12) = 1; + + tstring1 = 'data1973 = get(gcf,''UserData'');'; + tstring2 = 'set(gcf,''UserData'',data1973);'; + tstring3 = 'eegdrawgv(gcf);'; + + TIMESTRING = [tstring1,'if (data1973(4)-data1973(2))<0;','data1973(4) = 0;','else;','data1973(4) = data1973(4) - data1973(2);','end;',tstring2,tstring3,'clear data1973']; + + hb = uicontrol('Style','PushButton','Units','Normalized','position',b1_position,'String','PREV','Callback',TIMESTRING); + + TIMESTRING = [tstring1,'if (data1973(4)+data1973(2))>=data1973(5);','data1973(4)=data1973(4);','else;','data1973(4) = data1973(4) + data1973(2);','end;',tstring2,tstring3,'clear data1973']; + + hf = uicontrol('Style','PushButton','Units','Normalized','position',b2_position,'String','NEXT','Callback',TIMESTRING); + + TIMESTRING = [tstring1,'if (data1973(4)-1)<0;','data1973(4) = 0;','else;','data1973(4) = data1973(4) - 1;','end;',tstring2,tstring3,'clear data1973']; + + hbos = uicontrol('Style','PushButton','Units','Normalized','position',b3_position,'String','<<','Callback',TIMESTRING); + + TIMESTRING = [tstring1,'if (data1973(4)+1)>=data1973(5);','data1973(4)=data1973(4);','else;','data1973(4) = data1973(4) + 1;','end;',tstring2,tstring3,'clear data1973']; + + hfos = uicontrol('Style','PushButton','Units','Normalized','position',b4_position,'String','>>','Callback',TIMESTRING); + + TIMESTRING = [tstring1,'time1973 = get(gco,''string'');','time1973 = str2num(time1973);','data1973(4) = time1973;',tstring2,tstring3,'clear time1973 data1973']; + + w=uicontrol('style','edit','units','normalized','HorizontalAlignment','left','position',edit_position,'UserData',axhandle,'callback',TIMESTRING); + +TIMESTRING = [tstring1,'data1973(3) = get(gco,''value'');',tstring2,tstring3,'clear time1973 data1973']; + +u=uicontrol('style','slider','units','normalized','position',slider_position2,'Max',Max_Space,'Min',Min_Space,'value',spacing_var,'UserData',axhandle,'callback',TIMESTRING); + +%%%%%%%%%%%%%%%%%%%%%%%%% +%Set up ui menus +%%%%%%%%%%%%%%%%%%%%%%%%% + +%Window menu: + +TIMESTRING = ['fighand1973 = gcf;','delete(fighand1973);','clear fighand1973;']; + +fm1 = uimenu('Label','Window'); +fm2 = uimenu(fm1,'Label','Close ','UserData',fighandle,'Callback',TIMESTRING); + +%Display menu: + +TIMESTRING = [tstring1,'out1973 = gettext(''Input new windowlength(sec).'');','if isempty(out1973);','out1973 = 0;','else;','data1973(2) = str2num(out1973);',tstring2,tstring3,'end;','clear data1973 out1973']; + +dm1 = uimenu('Label','Display'); +dm2 = uimenu(dm1,'Label',' Window Length','Interruptible','on','Callback',TIMESTRING); +dm3 = uimenu(dm1,'Label',' Color'); + +TIMESTRING = [tstring1,'data1973(7) = 1;',tstring2,tstring3,'clear data1973;']; + +dm4 = uimenu(dm3,'Label','Yellow ','UserData',axhandle,'Interruptible','on','Callback',TIMESTRING); + +TIMESTRING = [tstring1,'data1973(7) = 2;',tstring2,tstring3,'clear data1973;']; + +dm5 = uimenu(dm3,'Label','White ','UserData',axhandle,'Interruptible','on','Callback',TIMESTRING); + +TIMESTRING = ['label1973 = gettext(''Enter new title.'');','if isempty(label1973);','label1973 = 0;','else;','title(label1973);','end;','clear label1973;']; + +dm6 = uimenu(dm1,'Label','Title ','Interruptible','on','Callback',TIMESTRING); + +TIMESTRING = [tstring1,'Check1973 = get(data1973(10),''checked'');','if (Check1973(1:2) == ''on'');','set(data1973(10),''Checked'',''off'');','set(data1973(6),''XGrid'',''off'');','else;','set(data1973(10),''Checked'',''on'');','set(data1973(6),''XGrid'',''on'');','end;','clear data1973 Check1973;']; + +dm7 = uimenu(dm1,'Label','Grid','Checked','on','Callback',TIMESTRING); + +User_Data_Mat(10) = dm7; + +TIMESTRING = [tstring1,'Check1973 = get(data1973(11),''checked'');','if (Check1973(1:2) == ''on'');','set(data1973(11),''Checked'',''off'');','data1973(12)= 0;','else;','set(data1973(11),''Checked'',''on'');','data1973(12) = 1;','end;',tstring2,tstring3,'clear data1973 Check1973;']; + +dm8 = uimenu(dm1,'Label','Scaling I','Checked','on','Callback',TIMESTRING); + +User_Data_Mat(11) = dm8; + +%Settings menu: + +sm1 = uimenu('Label','Settings'); + +TIMESTRING = [tstring1,'Srate1973 = gettext(''Enter new samplerate'');','if isempty(Srate1973);','Srate1973 = 0;','else;','data1973(1) = str2num(Srate1973);','data1973(5) = data1973(8)/data1973(1);','data1973(4) = 0;',tstring2,tstring3,'end;','clear Srate1973 data1973']; + +sm2 = uimenu(sm1,'Label','Samplerate','Interruptible','on','Callback',TIMESTRING); + +%Electrodes menu: + +em1 = uimenu('Label','Electrodes'); + +TIMESTRING = [tstring1,'ChanNamefile1973 = gettext(''Enter Electrode file to load.'');','if isempty(ChanNamefile1973);','ChanNamefile1973=0;','else;','ChanNames1973 = loadelec(ChanNamefile1973);','set(data1973(6),''YTickLabels'',flipud(ChanNames1973));','end;','clear data1973 ChanNamefile1973 ChanNames1973']; + +em2 = uimenu(em1,'Label','Load Electrode File ','Interruptible','on','Callback',TIMESTRING); + +TIMESTRING = [tstring1,'ChanNames1973 = makeelec(data1973(9));','if isempty(ChanNames1973);','ChanNames1973=0;','else;','set(data1973(6),''YTickLabels'',flipud(ChanNames1973));','end;','clear data1973 ChanNames1973']; + +em3 = uimenu(em1,'Label','Make Electrode File ','Interruptible','on','Callback',TIMESTRING); + +set(axhandle,'UserData',dataname) +set(fighandle,'UserData',User_Data_Mat) diff --git a/code/eeglab13_4_4b/functions/miscfunc/eegplotold.m b/code/eeglab13_4_4b/functions/miscfunc/eegplotold.m new file mode 100644 index 0000000..45805ed --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eegplotold.m @@ -0,0 +1,1014 @@ +% eegplotold() - display data in a horizontal scrolling fashion +% with (optional) gui controls (version 2.3) +% Usage: +% >> eegplotold(data,srate,spacing,eloc_file,windowlength,title) +% >> eegplotold('noui',data,srate,spacing,eloc_file,startpoint,color) +% +% Inputs: +% data - Input data matrix (chans,timepoints) +% srate - Sampling rate in Hz {default|0: 256 Hz} +% spacing - Space between channels (default|0: max(data)-min(data)) +% eloc_file - Electrode filename as in >> topoplot example +% [] -> no labels; default|0 -> integers 1:nchans +% vector of integers -> channel numbers +% windowlength - Number of seconds of EEG displayed {default 10 s} +% color - EEG plot color {default black/white} +% 'noui' - Display eeg in current axes without user controls +% +% Author: Colin Humphries, CNL, Salk Institute, La Jolla, 5/98 +% +% See also: eegplot(), eegplotgold(), eegplotsold() + +% Copyright (C) Colin Humphries, CNL, Salk Institute 3/97 from eegplotold() +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Runs under Matlab 5.0+ (not supported for Matlab 4) +% +% RCS-recorded version number, date, editor and comments +% $Log: eegplotold.m,v $ +% Revision 1.3 2007/02/24 02:42:37 toby +% added auto-log line +% +% +% Edit History: +% 5-14-98 v2.1 fixed bug for small-variance data -ch +% 1-31-00 v2.2 exchanged meaning of > and >>, < and << -sm +% 8-15-00 v2.3 turned on SPACING_EYE and added int vector input for eloc_file -sm +% 12-16-00 added undocumented figure position arg (if not 'noui') -sm +% 01-25-02 reformated help & license, added links -ad + +function [outvar1] = eegplotold(data,p1,p2,p3,p4,p5,p6) + +% Defaults (can be re-defined): + +DEFAULT_ELOC_FILE = 0; % Default electrode name file + % [] - none, 0 - numbered, or filename +DEFAULT_SAMPLE_RATE = 256; % Samplerate +DEFAULT_PLOT_COLOR = 'k'; % EEG line color +DEFAULT_AXIS_BGCOLOR = [.8 .8 .8];% EEG Axes Background Color +DEFAULT_FIG_COLOR = [.8 .8 .8]; % Figure Background Color +DEFAULT_AXIS_COLOR = 'k'; % X-axis, Y-axis Color, text Color +DEFAULT_WINLENGTH = 10; % Number of seconds of EEG displayed +DEFAULT_GRID_SPACING = 1; % Grid lines every n seconds +DEFAULT_GRID_STYLE = '-'; % Grid line style +YAXIS_NEG = 'off'; % 'off' = positive up +DEFAULT_NOUI_PLOT_COLOR = 'k'; % EEG line color for noui option + % 0 - 1st color in AxesColorOrder +DEFAULT_TITLEVAL = 2; % Default title + % string, 2 - variable name, 0 - none +SPACING_EYE = 'on'; % spacing I on/off +SPACING_UNITS_STRING = '\muV'; % optional units for spacing I Ex. uV +DEFAULT_AXES_POSITION = [0.0964286 0.15 0.842 0.788095]; + % dimensions of main EEG axes +if nargin<1 + help eegplotold + return +end + +% %%%%%%%%%%%%%%%%%%%%%%%% +% Setup inputs +% %%%%%%%%%%%%%%%%%%%%%%%% + +if ~isstr(data) % If NOT a 'noui' call or a callback from uicontrols + + if nargin == 7 % undocumented feature - allows position to be specd. + posn = p6; + else + posn = NaN; + end + + % if strcmp(YAXIS_NEG,'on') + % data = -data; + % end + + if nargin < 6 + titleval = 0; + else + titleval = p5; + end + if nargin < 5 + winlength = 0; + else + winlength = p4; + end + if nargin < 4 + eloc_file = DEFAULT_ELOC_FILE; + else + eloc_file = p3; + end + if nargin < 3 + spacing = 0; + else + spacing = p2; + end + if nargin < 2 + Fs = 0; + else + Fs = p1; + end + if isempty(titleval) + titleval = 0; + end + if isempty(winlength) + winlength = 0; + end + if isempty(spacing) + spacing = 0; + end + if isempty(Fs) + Fs = 0; + end + + [chans,frames] = size(data); + + if winlength == 0 + winlength = DEFAULT_WINLENGTH; % Set window length + end + + if ischar(eloc_file) % Read in electrode names + fid = fopen(eloc_file); % Read file + if fid < 1 + error('error opening electrode file') + end + YLabels = fscanf(fid,'%d %f %f%s',[7 128]); + fclose(fid); + YLabels = char(YLabels(4:7,:)'); + ii = find(YLabels == '.'); + YLabels(ii) = ' '; + YLabels = flipud(str2mat(YLabels,' ')); + elseif length(eloc_file) == chans + YLabels = num2str(eloc_file'); + elseif length(eloc_file) == 1 & eloc_file(1) == 0 + YLabels = num2str((1:chans)'); % Use numbers + else + YLabels = []; % no labels used + end + YLabels = flipud(str2mat(YLabels,' ')); + + if spacing == 0 + spacing = (max(max(data')-min(data'))); % Set spacing to max/min data + if spacing > 10 + spacing = round(spacing); + end + end + + if titleval == 0 + titleval = DEFAULT_TITLEVAL; % Set title value + end + + if Fs == 0 + Fs = DEFAULT_SAMPLE_RATE; % Set samplerate + end + + % %%%%%%%%%%%%%%%%%%%%%%%% + % Prepare figure and axes + % %%%%%%%%%%%%%%%%%%%%%%%% + + if isnan(posn) % no user-supplied position vector + figh = figure('UserData',[winlength Fs],... + 'Color',DEFAULT_FIG_COLOR,... + 'MenuBar','none','tag','eegplotold'); + else + figh = figure('UserData',[winlength Fs],... + 'Color',DEFAULT_FIG_COLOR,... + 'MenuBar','none','tag','eegplotold','Position',posn); + end + %entry + ax1 = axes('tag','eegaxis','parent',figh,... + 'userdata',data,... + 'Position',DEFAULT_AXES_POSITION,... + 'Box','on','xgrid','on',... + 'gridlinestyle',DEFAULT_GRID_STYLE,... + 'Xlim',[0 winlength*Fs],... + 'xtick',[0:Fs*DEFAULT_GRID_SPACING:winlength*Fs],... + 'Ylim',[0 (chans+1)*spacing],... + 'YTick',[0:spacing:chans*spacing],... + 'YTickLabel',YLabels,... + 'XTickLabel',num2str((0:DEFAULT_GRID_SPACING:winlength)'),... + 'TickLength',[.005 .005],... + 'Color',DEFAULT_AXIS_BGCOLOR,... + 'XColor',DEFAULT_AXIS_COLOR,... + 'YColor',DEFAULT_AXIS_COLOR); + + if isstr(titleval) % plot title + title(titleval) + elseif titleval == 2 + title(inputname(1)) + end + + % %%%%%%%%%%%%%%%%%%%%%%%%% + % Set up uicontrols + % %%%%%%%%%%%%%%%%%%%%%%%%% + +% Four move buttons: << < > >> + + u(1) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'Position',[49.1294 12.7059 50.8235 16.9412], ... + 'Tag','Pushbutton1',... + 'string','<<',... + 'Callback','eegplotold(''drawp'',1)'); + u(2) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'Position',[105.953 12.7059 33.0353 16.9412], ... + 'Tag','Pushbutton2',... + 'string','<',... + 'Callback','eegplotold(''drawp'',2)'); + u(3) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'Position',[195.882 12.7059 33.8824 16.9412], ... + 'Tag','Pushbutton3',... + 'string','>',... + 'Callback','eegplotold(''drawp'',3)'); + u(4) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'Position',[235.765 12.7059 50.8235 16.9412], ... + 'Tag','Pushbutton4',... + 'string','>>',... + 'Callback','eegplotold(''drawp'',4)'); + +% Text edit fields: EPosition ESpacing + + u(5) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'BackgroundColor',[1 1 1], ... + 'Position',[144.988 10.1647 44.8941 19.4824], ... + 'Style','edit', ... + 'Tag','EPosition',... + 'string','0',... + 'Callback','eegplotold(''drawp'',0)'); + u(6) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'BackgroundColor',[1 1 1], ... + 'Position',[379.482-30 11.8 46.5882 19.5], ... + 'Style','edit', ... + 'Tag','ESpacing',... + 'string',num2str(spacing),... + 'Callback','eegplotold(''draws'',0)'); + +% ESpacing buttons: + - + + u(7) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'Position',[435-30 22.9 22 13.5], ... + 'Tag','Pushbutton5',... + 'string','+',... + 'FontSize',8,... + 'Callback','eegplotold(''draws'',1)'); + u(8) = uicontrol('Parent',figh, ... + 'Units','points', ... + 'Position',[435-30 6.7 22 13.5], ... + 'Tag','Pushbutton6',... + 'string','-',... + 'FontSize',8,... + 'Callback','eegplotold(''draws'',2)'); + + set(u,'Units','Normalized') + + % %%%%%%%%%%%%%%%%%%%%%%%%%%% + % Set up uimenus + % %%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Figure Menu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + m(7) = uimenu('Parent',figh,'Label','Figure'); + m(8) = uimenu('Parent',m(7),'Label','Orientation'); + uimenu('Parent',m(7),'Label','Close',... + 'Callback','delete(gcbf)') + + % Portrait %%%%%%%% + timestring = ['[OBJ1,FIG1] = gcbo;',... + 'PANT1 = get(OBJ1,''parent'');',... + 'OBJ2 = findobj(''tag'',''orient'',''parent'',PANT1);',... + 'set(OBJ2,''checked'',''off'');',... + 'set(OBJ1,''checked'',''on'');',... + 'set(FIG1,''PaperOrientation'',''portrait'');',... + 'clear OBJ1 FIG1 OBJ2 PANT1;']; + + uimenu('Parent',m(8),'Label','Portrait','checked',... + 'on','tag','orient','callback',timestring) + + % Landscape %%%%%%% + timestring = ['[OBJ1,FIG1] = gcbo;',... + 'PANT1 = get(OBJ1,''parent'');',... + 'OBJ2 = findobj(''tag'',''orient'',''parent'',PANT1);',... + 'set(OBJ2,''checked'',''off'');',... + 'set(OBJ1,''checked'',''on'');',... + 'set(FIG1,''PaperOrientation'',''landscape'');',... + 'clear OBJ1 FIG1 OBJ2 PANT1;']; + + uimenu('Parent',m(8),'Label','Landscape','checked',... + 'off','tag','orient','callback',timestring) + + % Display Menu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + m(1) = uimenu('Parent',figh,... + 'Label','Display'); + + % X grid %%%%%%%%%%%% + m(3) = uimenu('Parent',m(1),'Label','X Grid'); + + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''xgrid'',''on'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(3),'Label','on','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''xgrid'',''off'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(3),'Label','off','Callback',timestring) + + % Y grid %%%%%%%%%%%%% + m(4) = uimenu('Parent',m(1),'Label','Y Grid'); + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''ygrid'',''on'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(4),'Label','on','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''ygrid'',''off'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(4),'Label','off','Callback',timestring) + + % Grid Style %%%%%%%%% + m(5) = uimenu('Parent',m(1),'Label','Grid Style'); + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'',''--'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','- -','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'',''-.'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','_ .','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'','':'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','. .','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'',''-'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','__','Callback',timestring) + + % Scale Eye %%%%%%%%% + timestring = ['[OBJ1,FIG1] = gcbo;',... + 'eegplotold(''scaleeye'',OBJ1,FIG1);',... + 'clear OBJ1 FIG1;']; + m(7) = uimenu('Parent',m(1),'Label','Scale I','Callback',timestring); + + % Title %%%%%%%%%%%% + uimenu('Parent',m(1),'Label','Title','Callback','eegplotold(''title'')') + + % Settings Menu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + m(2) = uimenu('Parent',figh,... + 'Label','Settings'); + + % Window %%%%%%%%%%%% + uimenu('Parent',m(2),'Label','Window',... + 'Callback','eegplotold(''window'')') + + % Samplerate %%%%%%%% + uimenu('Parent',m(2),'Label','Samplerate',... + 'Callback','eegplotold(''samplerate'')') + + % Electrodes %%%%%%%% + m(6) = uimenu('Parent',m(2),'Label','Electrodes'); + + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''YTickLabel'',[]);',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(6),'Label','none','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'YTICK = get(AXESH,''YTick'');',... + 'YTICK = length(YTICK);',... + 'set(AXESH,''YTickLabel'',flipud(str2mat(num2str((1:YTICK-1)''),'' '')));',... + 'clear FIGH AXESH YTICK;']; + uimenu('Parent',m(6),'Label','numbered','Callback',timestring) + uimenu('Parent',m(6),'Label','load file',... + 'Callback','eegplotold(''loadelect'');') + + % %%%%%%%%%%%%%%%%%%%%%%%%%% + % Plot EEG Data + % %%%%%%%%%%%%%%%%%%%%%%%%%% + meandata = mean(data(:,1:round(min(frames,winlength*Fs)))'); + axes(ax1) + hold on + for i = 1:chans + plot(data(chans-i+1,... + 1:round(min(frames,winlength*Fs)))-meandata(chans-i+1)+i*spacing,... + 'color',DEFAULT_PLOT_COLOR) + end + + % %%%%%%%%%%%%%%%%%%%%%%%%%% + % Plot Spacing I + % %%%%%%%%%%%%%%%%%%%%%%%%%% + if strcmp(SPACING_EYE,'on') + + YLim = get(ax1,'Ylim'); + A = DEFAULT_AXES_POSITION; + axes('Position',[A(1)+A(3) A(2) 1-A(1)-A(3) A(4)],... + 'Visible','off','Ylim',YLim,'tag','eyeaxes') + axis manual + Xl = [.3 .6 .45 .45 .3 .6]; + Yl = [spacing*2 spacing*2 spacing*2 spacing*1 spacing*1 spacing*1]; + line(Xl,Yl,'color',DEFAULT_AXIS_COLOR,'clipping','off',... + 'tag','eyeline') + text(.5,YLim(2)/23+Yl(1),num2str(spacing,4),... + 'HorizontalAlignment','center','FontSize',10,... + 'tag','thescale') + if strcmp(YAXIS_NEG,'off') + text(Xl(2)+.1,Yl(1),'+','HorizontalAlignment','left',... + 'verticalalignment','middle') + text(Xl(2)+.1,Yl(4),'-','HorizontalAlignment','left',... + 'verticalalignment','middle') + else + text(Xl(2)+.1,Yl(4),'+','HorizontalAlignment','left',... + 'verticalalignment','middle') + text(Xl(2)+.1,Yl(1),'-','HorizontalAlignment','left',... + 'verticalalignment','middle') + end + if ~isempty(SPACING_UNITS_STRING) + text(.5,-YLim(2)/23+Yl(4),SPACING_UNITS_STRING,... + 'HorizontalAlignment','center','FontSize',10) + end + set(m(7),'checked','on') + + elseif strcmp(SPACING_EYE,'off') + YLim = get(ax1,'Ylim'); + A = DEFAULT_AXES_POSITION; + axes('Position',[A(1)+A(3) A(2) 1-A(1)-A(3) A(4)],... + 'Visible','off','Ylim',YLim,'tag','eyeaxes') + axis manual + set(m(7),'checked','off') + + end +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% End Main Function +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +else + switch data + case 'drawp' + % Redraw EEG and change position + figh = gcbf; % figure handle + if strcmp(get(figh,'tag'),'dialog') + figh = get(figh,'UserData'); + end + ax1 = findobj('tag','eegaxis','parent',figh); % axes handle + EPosition = findobj('tag','EPosition','parent',figh); % ui handle + ESpacing = findobj('tag','ESpacing','parent',figh); % ui handle + + data = get(ax1,'UserData'); % Data (Note: this could also be global) + timestr = get(EPosition,'string'); % current position + % if timestr == 'end' + % time = ceil(frames/Fs)-winlength; + % fprintf('timestr = %s\n',timestr); + % else + time = str2num(timestr); % current position + % end + spacing = str2num(get(ESpacing,'string')); % current spacing + winlength = get(figh,'UserData'); + Fs = winlength(2); % samplerate + winlength = winlength(1); % window length + + [chans,frames] = size(data); + + if p1 == 1 + time = time-winlength; % << subtract one window length + elseif p1 == 2 + time = time-1; % < subtract one second + elseif p1 == 3 + time = time+1; % > add one second + elseif p1 == 4 + time = time+winlength; % >> add one window length + end + + time = max(0,min(time,ceil(frames/Fs)-winlength)); + + set(EPosition,'string',num2str(time)) % Update edit box + % keyboard + % Plot data and update axes + meandata = mean(data(:,round(time*Fs+1):round(min((time+winlength)*Fs,... + frames)))'); + axes(ax1) + cla + for i = 1:chans + plot(data(chans-i+1,round(time*Fs+1):round(min((time+winlength)*Fs,... + frames)))-meandata(chans-i+1)+i*spacing,... + 'color',DEFAULT_PLOT_COLOR,'clipping','off') + end + set(ax1,'XTickLabel',... + num2str((time:DEFAULT_GRID_SPACING:time+winlength)'),... + 'Xlim',[0 winlength*Fs],... + 'XTick',[0:Fs*DEFAULT_GRID_SPACING:winlength*Fs]) + + case 'draws' + % Redraw EEG and change scale + figh = gcbf; % figure handle + ax1 = findobj('tag','eegaxis','parent',figh); % axes handle + EPosition = findobj('tag','EPosition','parent',figh); % ui handle + ESpacing = findobj('tag','ESpacing','parent',figh); % ui handle + + data = get(ax1,'UserData'); % data + time = str2num(get(EPosition,'string')); % current position + spacing = str2num(get(ESpacing,'string')); % current spacing + winlength = get(figh,'UserData'); + + if isempty(spacing) | isempty(time) + return % return if valid numbers are not in the edit boxes + end + + Fs = winlength(2); % samplerate + winlength = winlength(1); % window length + + orgspacing = round(max(max(data')-min(data'))); % original spacing + + [chans,frames] = size(data); + + if p1 == 1 + spacing = spacing + .05*orgspacing; % increase spacing (5%) + elseif p1 == 2 + spacing = max(0,spacing-.05*orgspacing); % decrease spacing (5%) + if spacing == 0 + spacing = spacing + .05*orgspacing; + end + end + + set(ESpacing,'string',num2str(spacing,4)) % update edit box + % plot data and update axes + meandata = mean(data(:,round(time*Fs+1):round(min((time+winlength)*Fs,... + frames)))'); + axes(ax1) + cla + for i = 1:chans + plot(data(chans-i+1,... + round(time*Fs+1):round(min((time+winlength)*Fs,... + frames)))-meandata(chans-i+1)+i*spacing,... + 'color',DEFAULT_PLOT_COLOR,'clipping','off') + end + set(ax1,'YLim',[0 (chans+1)*spacing],... + 'YTick',[0:spacing:chans*spacing]) + + % update scaling eye if it exists + eyeaxes = findobj('tag','eyeaxes','parent',figh); + if ~isempty(eyeaxes) + eyetext = findobj('type','text','parent',eyeaxes,'tag','thescale'); + set(eyetext,'string',num2str(spacing,4)) + end + + case 'window' + % get new window length with dialog box + fig = gcbf; + oldwinlen = get(fig,'UserData'); + pos = get(fig,'Position'); + figx = 400; + figy = 200; + fhand = figure('Units','pixels',... + 'Position',... + [pos(1)+pos(3)/2-figx/2 pos(2)+pos(4)/2-figy/2 figx figy],... + 'Resize','off','CloseRequestFcn','','menubar','none',... + 'numbertitle','off','tag','dialog','userdata',fig); + uicolor = get(fhand,'Color'); + + uicontrol('Style','Text','Units','Pixels',... + 'String','Enter new window length(secs):',... + 'Position',[20 figy-40 300 25],'HorizontalAlignment','left',... + 'BackgroundColor',uicolor,'FontSize',14) + + timestring = ['[OBJ1,FIGH1] = gcbo;',... + 'FIH0 = get(OBJ1,''UserData'');',... + 'AXH0 = findobj(''tag'',''eegaxis'',''parent'',FIH0);',... + 'WLEN = str2num(get(OBJ1,''String''));',... + 'if ~isempty(WLEN);',... + 'UDATA = get(FIH0,''UserData'');',... + 'UDATA(1) = WLEN;',... + 'set(FIH0,''UserData'',UDATA);',... + 'eegplotold(''drawp'',0);',... + 'delete(FIGH1);',... + 'end;',... + 'clear OBJ1 FIGH1 FIH0 AXH0 WLEN UDATA;']; + + + ui1 = uicontrol('Style','Edit','Units','Pixels',... + 'FontSize',12,... + 'Position',[120 figy-100 70 30],... + 'Callback',timestring,'UserData',fig,... + 'String',num2str(oldwinlen(1))); + + timestring = ['[OBJ1,FIGH1] = gcbo;',... + 'FIH0 = get(OBJ1,''UserData'');',... + 'AXH0 = findobj(''tag'',''eegaxis'',''parent'',FIH0(1));',... + 'SRAT = str2num(get(FIH0(2),''String''));',... + 'if ~isempty(SRAT);',... + 'UDATA = get(FIH0(1),''UserData'');',... + 'UDATA(2) = SRAT;',... + 'set(FIH0(1),''UserData'',UDATA);',... + 'eegplotold(''drawp'',0);',... + 'delete(FIGH1);',... + 'end;',... + 'clear OBJ1 FIGH1 FIH0 AXH0 SRAT UDATA;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','OK','FontSize',14,... + 'Position',[figx/4-20 10 65 30],... + 'Callback',timestring,'UserData',[fig,ui1]) + + TIMESTRING = ['[OBJ1,FIGH1] = gcbo;',... + 'delete(FIGH1);',... + 'clear OBJ1 FIGH1;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','Cancel','FontSize',14,... + 'Position',[3*figx/4-20 10 65 30],... + 'Callback',TIMESTRING) + + case 'samplerate' + % Get new samplerate + fig = gcbf; + oldsrate = get(fig,'UserData'); + pos = get(fig,'Position'); + figx = 400; + figy = 200; + fhand = figure('Units','pixels',... + 'Position',... + [pos(1)+pos(3)/2-figx/2 pos(2)+pos(4)/2-figy/2 figx figy],... + 'Resize','off','CloseRequestFcn','','menubar','none',... + 'numbertitle','off','tag','dialog','userdata',fig); + uicolor = get(fhand,'Color'); + + uicontrol('Style','Text','Units','Pixels',... + 'String','Enter new samplerate:',... + 'Position',[20 figy-40 300 25],'HorizontalAlignment','left',... + 'BackgroundColor',uicolor,'FontSize',14) + + timestring = ['[OBJ1,FIGH1] = gcbo;',... + 'FIH0 = get(OBJ1,''UserData'');',... + 'AXH0 = findobj(''tag'',''eegaxis'',''parent'',FIH0);',... + 'SRAT = str2num(get(OBJ1,''String''));',... + 'if ~isempty(SRAT);',... + 'UDATA = get(FIH0,''UserData'');',... + 'UDATA(2) = SRAT;',... + 'set(FIH0,''UserData'',UDATA);',... + 'eegplotold(''drawp'',0);',... + 'delete(FIGH1);',... + 'end;',... + 'clear OBJ1 FIGH1 FIH0 AXH0 SRAT UDATA;']; + + + ui1 = uicontrol('Style','Edit','Units','Pixels',... + 'FontSize',12,... + 'Position',[120 figy-100 70 30],... + 'Callback',timestring,'UserData',fig,... + 'String',num2str(oldsrate(2))); + + timestring = ['[OBJ1,FIGH1] = gcbo;',... + 'FIH0 = get(OBJ1,''UserData'');',... + 'AXH0 = findobj(''tag'',''eegaxis'',''parent'',FIH0(1));',... + 'SRAT = str2num(get(FIH0(2),''String''));',... + 'if ~isempty(SRAT);',... + 'UDATA = get(FIH0(1),''UserData'');',... + 'UDATA(2) = SRAT;',... + 'set(FIH0(1),''UserData'',UDATA);',... + 'eegplotold(''drawp'',0);',... + 'delete(FIGH1);',... + 'end;',... + 'clear OBJ1 FIGH1 FIH0 AXH0 SRAT UDATA;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','OK','FontSize',14,... + 'Position',[figx/4-20 10 65 30],... + 'Callback',timestring,'UserData',[fig,ui1]) + + + TIMESTRING = ['[OBJ1,FIGH1] = gcbo;',... + 'delete(FIGH1);',... + 'clear OBJ1 FIGH1;']; + uicontrol('Style','PushButton','Units','Pixels',... + 'String','Cancel','FontSize',14,... + 'Position',[3*figx/4-20 10 65 30],... + 'Callback',TIMESTRING) + + case 'loadelect' + % load electrode file + fig = gcbf; + pos = get(fig,'Position'); + figx = 400; + figy = 200; + fhand = figure('Units','pixels',... + 'Position',... + [pos(1)+pos(3)/2-figx/2 pos(2)+pos(4)/2-figy/2 figx figy],... + 'Resize','off','CloseRequestFcn','','menubar','none',... + 'numbertitle','off','tag','dialog','userdata',fig); + uicolor = get(fhand,'Color'); + + uicontrol('Style','Text','Units','Pixels',... + 'String','Enter electrode file name:',... + 'Position',[20 figy-40 300 25],'HorizontalAlignment','left',... + 'BackgroundColor',uicolor,'FontSize',14) + + + ui1 = uicontrol('Style','Edit','Units','Pixels',... + 'FontSize',12,... + 'HorizontalAlignment','left',... + 'Position',[120 figy-100 210 30],... + 'UserData',fig,'tag','electedit'); + + TIMESTRING = ['[OBJ1,FIGH1] = gcbo;',... + 'delete(FIGH1);',... + 'clear OBJ1 FIGH1;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','Cancel','FontSize',14,... + 'Position',[3*figx/4-20 10 65 30],... + 'Callback',TIMESTRING) + + timestring = ['[OBJ1,FIGH1] = gcbo;',... + 'OBJ2 = findobj(''tag'',''electedit'');',... + 'LAB1 = get(OBJ2,''string'');',... + 'FIH0 = get(OBJ1,''UserData'');',... + 'AXH0 = findobj(''tag'',''eegaxis'',''parent'',FIH0);',... + 'OUT1 = eegplotold(''setelect'',LAB1,AXH0);',... + 'if (OUT1);',... + 'delete(FIGH1);',... + 'end;',... + 'clear OBJ1 FIGH1 LAB1 OBJ2 FIH0 AXH0 OUT1;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','OK','FontSize',14,... + 'Position',[figx/4-20 10 65 30],... + 'Callback',timestring,'UserData',fig) + + timestring = ['OBJ2 = findobj(''tag'',''electedit'');',... + '[LAB1,LAB2] = uigetfile(''*'',''Electrode File'');',... + 'if (isstr(LAB1) & isstr(LAB2));',... + 'set(OBJ2,''string'',[LAB2,LAB1]);',... + 'end;',... + 'clear OBJ2 LAB1 LAB2;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','Browse','FontSize',14,... + 'Position',[figx/2-20 10 65 30],'UserData',fig,... + 'Callback',timestring) + + + case 'setelect' + % Set electrodes + eloc_file = p1; + axeshand = p2; + outvar1 = 1; + if isempty(eloc_file) + outvar1 = 0; + return + end + fid = fopen(eloc_file); + if fid < 1 + fprintf('Cannot open electrode file.\n\n') + outvar1 = 0; + return + end + YLabels = fscanf(fid,'%d %f %f %s',[7 128]); + if isempty(YLabels) + fprintf('Error reading electrode file.\n\n') + outvar1 = 0; + return + end + fclose(fid); + YLabels = char(YLabels(4:7,:)'); + ii = find(YLabels == '.'); + YLabels(ii) = ' '; + YLabels = flipud(str2mat(YLabels,' ')); + set(axeshand,'YTickLabel',YLabels) + + case 'title' + % Get new title + fig = gcbf; + % oldsrate = get(fig,'UserData'); + eegaxis = findobj('tag','eegaxis','parent',fig); + oldtitle = get(eegaxis,'title'); + oldtitle = get(oldtitle,'string'); + pos = get(fig,'Position'); + figx = 400; + figy = 200; + fhand = figure('Units','pixels',... + 'Position',... + [pos(1)+pos(3)/2-figx/2 pos(2)+pos(4)/2-figy/2 figx figy],... + 'Resize','off','CloseRequestFcn','','menubar','none',... + 'numbertitle','off','tag','dialog','userdata',fig); + uicolor = get(fhand,'Color'); + + uicontrol('Style','Text','Units','Pixels',... + 'String','Enter new title:',... + 'Position',[20 figy-40 300 25],'HorizontalAlignment','left',... + 'BackgroundColor',uicolor,'FontSize',14) + + timestring = ['[OBJ1,FIGH1] = gcbo;',... + 'FIH0 = get(OBJ1,''UserData'');',... + 'AXH0 = findobj(''tag'',''eegaxis'',''parent'',FIH0);',... + 'SRAT = get(OBJ1,''String'');',... + 'AXTH0 = get(AXH0,''title'');',... + 'if ~isempty(SRAT);',... + 'set(AXTH0,''string'',SRAT);',... + 'end;',... + 'delete(FIGH1);',... + 'clear OBJ1 AXTH0 FIGH1 FIH0 AXH0 SRAT UDATA;']; + + + ui1 = uicontrol('Style','Edit','Units','Pixels',... + 'FontSize',12,... + 'Position',[120 figy-100 3*70 30],... + 'Callback',timestring,'UserData',fig,... + 'String',oldtitle); + + timestring = ['[OBJ1,FIGH1] = gcbo;',... + 'FIH0 = get(OBJ1,''UserData'');',... + 'AXH0 = findobj(''tag'',''eegaxis'',''parent'',FIH0(1));',... + 'SRAT = get(FIH0(2),''String'');',... + 'AXTH0 = get(AXH0,''title'');',... + 'set(AXTH0,''string'',SRAT);',... + 'delete(FIGH1);',... + 'clear OBJ1 AXTH0 FIGH1 FIH0 AXH0 SRAT UDATA;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','OK','FontSize',14,... + 'Position',[figx/4-20 10 65 30],... + 'Callback',timestring,'UserData',[fig,ui1]) + + + TIMESTRING = ['[OBJ1,FIGH1] = gcbo;',... + 'delete(FIGH1);',... + 'clear OBJ1 FIGH1;']; + + uicontrol('Style','PushButton','Units','Pixels',... + 'String','Cancel','FontSize',14,... + 'Position',[3*figx/4-20 10 65 30],... + 'Callback',TIMESTRING) + + case 'scaleeye' + % Turn scale I on/off + obj = p1; + figh = p2; + % figh = get(obj,'Parent'); + toggle = get(obj,'checked'); + + if strcmp(toggle,'on') + eyeaxes = findobj('tag','eyeaxes','parent',figh); + children = get(eyeaxes,'children'); + delete(children) + set(obj,'checked','off') + elseif strcmp(toggle,'off') + eyeaxes = findobj('tag','eyeaxes','parent',figh); + + ESpacing = findobj('tag','ESpacing','parent',figh); + spacing = str2num(get(ESpacing,'string')); + + axes(eyeaxes) + YLim = get(eyeaxes,'Ylim'); + Xl = [.35 .65 .5 .5 .35 .65]; + Yl = [spacing*2 spacing*2 spacing*2 spacing*1 spacing*1 spacing*1]; + line(Xl,Yl,'color',DEFAULT_AXIS_COLOR,'clipping','off',... + 'tag','eyeline') + text(.5,YLim(2)/23+Yl(1),num2str(spacing,4),... + 'HorizontalAlignment','center','FontSize',10,... + 'tag','thescale') + if strcmp(YAXIS_NEG,'off') + text(Xl(2)+.1,Yl(1),'+','HorizontalAlignment','left',... + 'verticalalignment','middle') + text(Xl(2)+.1,Yl(4),'-','HorizontalAlignment','left',... + 'verticalalignment','middle') + else + text(Xl(2)+.1,Yl(4),'+','HorizontalAlignment','left',... + 'verticalalignment','middle') + text(Xl(2)+.1,Yl(1),'-','HorizontalAlignment','left',... + 'verticalalignment','middle') + end + if ~isempty(SPACING_UNITS_STRING) + text(.5,-YLim(2)/23+Yl(4),SPACING_UNITS_STRING,... + 'HorizontalAlignment','center','FontSize',10) + end + set(obj,'checked','on') + end + + case 'noui' + % Plott EEG without ui controls + data = p1; + % usage: eegplotold(data,Fs,spacing,eloc_file,startpoint,color) + + [chans,frames] = size(data); + nargs = nargin; + if nargs < 7 + plotcolor = 0; + else + plotcolor = p6; + end + if nargs < 6 + starts = 0; + else + starts = p5; + end + if nargs < 5 + eloc_file = DEFAULT_ELOC_FILE; + else + eloc_file = p4; + end + if nargs < 4 + spacing = 0; + else + spacing = p3; + end + if nargs < 3 + Fs = 0; + else + Fs = p2; + end + + if isempty(plotcolor) + plotcolor = 0; + end + if isempty(spacing) + spacing = 0; + end + if isempty(Fs) + Fs = 0; + end + if isempty(starts) + starts = 0; + end + if spacing == 0 + spacing = max(max(data')-min(data')); + end + if spacing == 0 + spacing = 1; + end; + if Fs == 0 + Fs = DEFAULT_SAMPLE_RATE; + end + + range = floor(frames/Fs); + axhandle = gca; + + if plotcolor == 0 + if DEFAULT_NOUI_PLOT_COLOR == 0 + colorord = get(axhandle,'ColorOrder'); + plotcolor = colorord(1,:); + else + plotcolor = DEFAULT_NOUI_PLOT_COLOR; + end + end + + if ~isempty(eloc_file) + if eloc_file == 0 + YLabels = num2str((1:chans)'); + elseif ischar('eloc_file') + fid = fopen(eloc_file); + if fid < 1 + error('error opening electrode file') + end + YLabels = fscanf(fid,'%d %f %f %s',[7 128]); + fclose(fid); + YLabels = char(YLabels(4:7,:)'); + ii = find(YLabels == '.'); + YLabels(ii) = ' '; + else + YLabels = num2str(eloc_file)'; + end + YLabels = flipud(str2mat(YLabels,' ')); + else + YLabels = []; + end + set(axhandle,'xgrid','on','GridLineStyle','-',... + 'Box','on','YTickLabel',YLabels,... + 'ytick',[0:spacing:chans*spacing],... + 'Ylim',[0 (chans+1)*spacing],... + 'xtick',[0:Fs:range*Fs],... + 'Xlim',[0 frames],... + 'XTickLabel',num2str((0:1:range)'+starts)) + + meandata = mean(data'); + axes(axhandle) + hold on + for i = 1:chans + plot(data(chans-i+1,:)-meandata(chans-i+1)+i*spacing,'color',plotcolor) + end + otherwise + error(['Error - invalid eegplotold() parameter: ',data]) + end +end + diff --git a/code/eeglab13_4_4b/functions/miscfunc/eegplotsold.m b/code/eeglab13_4_4b/functions/miscfunc/eegplotsold.m new file mode 100644 index 0000000..9c0044c --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eegplotsold.m @@ -0,0 +1,233 @@ +% eegplotsold() - display data in a clinical format without scrolling +% +% Usage: +% >> eegplotsold(data, srate, 'chanfile', 'title', ... +% yscaling, epoch, linecolor,xstart,vertmark) +% +% Inputs: +% data - data matrix (chans,frames) +% srate - EEG sampling rate in Hz (0 -> 256 Hz) +% 'chanfile' - file of channel info, topoplot() style, (0 -> chan nos) +% 'title' - plot title string {0 -> 'eegplotsold()'} +% yscaling - initial y scaling factor (0 -> 300) +% epoch - how many seconds to display in window (0 -> 10 sec) +% linecolor - color of eeg (0 -> 'y') +% xstart - start time of the data {0 -> 0} +% vertmark - vector of frames to mark with vertical lines {0 -> none} +% +% Author: Colin Humphries, CNL, Salk Institute, La Jolla, 3/97 +% +% See also: eegplot(), eegplotold(), eegplotgold() + +% Copyright (C) Colin Humphries, CNL, Salk Institute 3/97 from eegplotold() +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 05-01-97 added xstart argument -sm +% 05-20-97 added read of icadefs.m +% 06-12-97 EPOCH -> epoch line 71 below -sm +% 8-10-97 Clarified chanfile type -sm +% 12-08-97 Added isstr(titleval) test -sm +% 02-09-98 legnth(data)->size(data,2) -sm +% 01-25-02 reformated help & license, added links -ad + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function y = eegplotsold(data, srate, channamefile, titleval, yscaling, epoch, linecolor,xstart,vertmark) + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Define defaults +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +icadefs; % read MAXEEGPLOTCHANS, DEFAULT_SRATE, DEFAULT_EPOCH from icadefs.m + +if nargin < 1 + help eegplotsold % print usage message + PLOT_TIME = 10; + data = 0.5*randn(8,floor(DEFAULT_SRATE*PLOT_TIME*2)); + titleval = ['eegplotsold() example - random noise']; % show example plot +end + +[chans,frames] = size(data); %size of data matrix + +% set initial spacing +DEFAULT_SPACING = max(max(data')-min(data')); +% spacing_var/20 = microvolts/millimeter with 21 channels +% for n channels: 21/n * spacing_var/20 = microvolts/mm +% for clinical data. +DEFAULT_PLOTTIME = 10; % default 10 seconds per window +DEFAULT_TITLE = 'eegplotsold()'; +errorcode=0; % initialize error indicator + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Allow for different numbers of arguments +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin < 9, + vertmark = 0; +end +if nargin < 8, + xstart = 0; +end + +if nargin < 7 + linecolor = 'y'; % DEFAULT LINECOLOR +end +if linecolor == 0, + linecolor = 'y'; % DEFAULT LINECOLOR +end +if nargin < 6 + PLOT_TIME = 0; +else + PLOT_TIME = epoch; +end +if nargin < 5 + spacing_var = 0; +else + spacing_var = yscaling; +end +if spacing_var == 0 + spacing_var = DEFAULT_SPACING; +end + +if nargin < 4 + titleval = DEFAULT_TITLE; +end +if ~isstr(titleval) + if titleval == 0 + titleval = DEFAULT_TITLE; + else + help eegplotsold + return + end +end +if nargin < 3 + channamefile = 0; +end +if nargin < 2 + srate = DEFAULT_SRATE; +end +if srate == 0, + srate = DEFAULT_SRATE; +end; +if PLOT_TIME == 0 + PLOT_TIME = ceil(frames/srate); + if PLOT_TIME > DEFAULT_EPOCH + PLOT_TIME = DEFAULT_EPOCH; + end +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Define internal variables +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +maxtime = frames / srate; %size of matrix in seconds + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Read the channel names +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if channamefile ~=0, % read file of channel names + chid = fopen(channamefile,'r'); + if chid <3, + fprintf('plotdata: cannot open file %s.\n',channamefile); + errorcode=2; + channamefile = 0; + else + % fprintf('Chan info file %s opened\n',channamefile); + end; + if errorcode==0, + channames = fscanf(chid,'%d %f %f %s',[7 MAXEEGPLOTCHANS]); + channames = channames'; + channames = setstr(channames(:,4:7)); % convert ints to chars + [r c] = size(channames); + for i=1:r + for j=1:c + if channames(i,j)=='.', + channames(i,j)=' '; % convert dots to spaces + end; + end; + end; + % fprintf('%d channel names read from file.\n',r); + if (r>chans) + fprintf('Using first %d names.\n',chans); + channames = channames(1:chans,:); + end; + if (r 0 + linetime = round(-xstart/srate); + line ([linetime linetime],[1e10,-1e10]); +end + +if vertmark ~= 0, + for mark = vertmark, + linetime = xstart + (mark-1)/srate; + line ([linetime linetime],[-1e10,1e10],'Color','y','LineStyle',':'); + end +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/envproj.col b/code/eeglab13_4_4b/functions/miscfunc/envproj.col new file mode 100644 index 0000000..0663624 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/envproj.col @@ -0,0 +1,64 @@ +w.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. diff --git a/code/eeglab13_4_4b/functions/miscfunc/envproj.m b/code/eeglab13_4_4b/functions/miscfunc/envproj.m new file mode 100644 index 0000000..8c92079 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/envproj.m @@ -0,0 +1,387 @@ +% envproj() - plot envelopes of projections of selected ICA component +% projections against envelope of the original data +% +% Usage: >> [envdata] = envproj(data,weights,compnums); +% >> [envdata] = envproj(data,weights,compnums, ... +% title,limits,chanlist,compnames,colors); +% Inputs: +% data = runica() input data (chans,frames) <- best one epoch only! +% weights = unmixing weight matrix (runica() weights*sphere) +% compnums = list of component numbers to project and plot +% +% Optional inputs: +% title = 'fairly short plot title' (in quotes) (0 -> none) +% limits = [xmin xmax ymin ymax] (x's in msec) +% (0 or both y's 0 -> [min max]) +% chanlist = list of data channels to use for max/min (0 -> all) +% compnames = file of component labels (exactly 5 chars per line, +% trailing '.' = space) (default|0 -> compnums) +% colors = file of color codes, 3 chars per line ('.' = space) +% (0 -> default color order (black/white first)) +% +% Output: +% envdata = [2,(frames*length(compnums)+1)] envelopes of data, comps. +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 1/1997 +% +% See also: envtopo() + +% Copyright (C) 01-23-97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-19-97 use datamean instead of frames/baseframes, diag(cov()) for var() -sm +% 04-03-97 changed name to envproj() -sm +% 05-20-97 used sum-of-squares for var instead of diag() to allow long data +% read MAXPLOTDATACHANS from icadefs.m -sm +% 06-07-97 changed order of args to conform to runica -sm +% 06-18-97 read MAXENVPLOTCHANS instead of MAXPLOTDATACHANS -sm +% 07-23-97 dropped datamean from args; mean is distributed among components -sm +% 10-11-97 range of max/min for default ylimits over chanlist only! -sm +% 11-05-97 disallowed white lines unless axis color is white -sm & ch +% 11-13-97 rm'd errorcode variable to improve limits handling -sm +% 11-18-97 added legend to plot; varied line types -sm +% 11-30-97 added f=figure below to keep previous plot from being altered -sm +% 12-01-97 added thicker lines for data envelope -sm +% 12-08-97 debugged thicker lines for data envelope -sm +% 12-10-97 changed f=figure below to f=gcf to avoid matlab bug (gcf confusion) -sm +% 12-10-97 implemented compnames arg -sm +% 12-13-97 took out compnames=compnames'; bug -sm +% 02-06-98 added 'show-largest' feature to legend when numcomps > 7 -sm +% 02-09-98 fixed numcomps bug -sm +% 02-12-98 test for outofbounds compnums early -sm +% 04-28-98 made to work for rectangular weights -sm +% 06-05-98 made NEG_UP optional -sm +% 02-22-99 added FILL mode default when numcomps==1 -sm +% 03-14-99 made envelope finding code more efficient -sm +% 12-19-00 updated icaproj() args -sm +% 01-25-02 reformated help & license, added links -ad + +function [envdata] = envproj(data,weights,compnums,titl,limits,chanlist,compnames,colors) + +FILL = 1; % 1; % 1 = fill in component envelope unless ncomps>1 +DATA_LINEWIDTH = 1.5; % 2 +COMP_LINEWIDTH = 1.5; % 1 +MAXENVPLOTCHANS = 256; + +if nargin < 3, + help envproj + fprintf('envproj(): must have at least three arguments.\n'); + return +end + +icadefs % load ENVCOLORS & MAXENVPLOTCHANS default variables +MAX_LEG = 7; % maximum number of component line types to label in legend +NEG_UP = 0; % 1 = plot negative up + +% +%%%%%%%%%%%% Substitute for omitted arguments %%%%%%%%%%%%%%%%%%%%%%%% +% +if nargin < 8, + colors = 'envproj.col'; +elseif colors(1)==0, + colors = 'envproj.col'; +end + +[chans,frames] = size(data); + +if nargin < 7 + compnames = 0; +end + +if nargin < 6 + chanlist = 0; +end +if nargin < 5, + limits = 0; +end +if nargin < 4, + titl = 0; +end +% +%%%%%%%%%%%%%%%%%%%%%%%% Test data size %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +[wr,wc] = size(weights); +% +%%%%%%%%%%%%%%%% Substitute for zero arguments %%%%%%%%%%%%%%%%%%%%%%%%% +% +if chanlist == 0, + chanlist = [1:chans]; +end; +if compnums == 0, + compnums = [1:wr]; +end; +if size(compnums,1)>1, % handle column of compnums ! + compnums = compnums'; +end; +numcomps = length(compnums); +if numcomps > MAXENVPLOTCHANS, + fprintf(... +'envproj(): cannot plot more than %d channels of data at once.\n',... + MAXENVPLOTCHANS); + return +end; + +if max(compnums)>wr + fprintf('\nenvproj(): Component index %d out of bounds (1:%d).\n',... + max(compnums),wr); + return +end + +if min(compnums)<1, + fprintf('\nenvproj(): Component index %d out of bounds (1:%d).\n',... + min(compnums),wr); + return +end + +if FILL>0 & numcomps == 1 + FILL = 1; +else + FILL = 0; +end +% +%%%%%%%%%%%%%%%%%%%% Read and adjust limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if limits==0, + xmin=0;xmax=1; + ymin=min(min(data(chanlist,:))); + ymax=max(max(data(chanlist,:))); + else + if length(limits)~=4, + fprintf( ... + 'envproj(): limits should be 0 or an array [xmin xmax ymin ymax].\n'); + return + end; + if limits(1,1) == 0 & limits(1,2) ==0, + xmin=0; + xmax=0; + else + xmin = limits(1,1); + xmax = limits(1,2); + end; + if limits(1,3) == 0 & limits(1,4) ==0, + ymin=0; + ymax=0; + else + ymin = limits(1,3); + ymax = limits(1,4); + end; + end; + + if xmax == 0 & xmin == 0, + x = (0:1:frames-1); + xmin = 0; + xmax = frames-1; + else + dx = (xmax-xmin)/(frames-1); + x=xmin*ones(1,frames)+dx*(0:frames-1); % construct x-values + end; + + if ymax == 0 & ymin == 0, + ymax=max(max(data(chanlist,:))); + ymin=min(min(data(chanlist,:))); + end + +% +%%%%%%%%%%%%%%%%%%%% Read the color names %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if ~isstr(colors) + fprintf('envproj(): color file name must be a string.\n'); + return + end + cid = fopen(colors,'r'); + if cid <3, + fprintf('envproj(): cannot open file %s.\n',colors); + return + else + colors = fscanf(cid,'%s',[3 MAXENVPLOTCHANS]); + colors = colors'; + [r c] = size(colors); + for i=1:r + for j=1:c + if colors(i,j)=='.', + colors(i,j)=' '; + end; + end; + end; + end; +[rr cc] = size(colors); + +% +%%%%%%%%%%%% Compute projected data for single components %%%%%%%%%%%%% +% +projdata = [data(chanlist,:)]; +envdata = [min(projdata); max(projdata)]; % begin with envelope of data +fprintf('envproj(): Projecting component(s) '); +maxvars = zeros(1,length(compnums)); +n=1; +for c=compnums, % for each component + fprintf('%d ',c); + % [icaproj] = icaproj(data,weights,compindex); % new arg order 12/00 + proj = icaproj(data,weights,c); % let offsets be + % distributed among comps. + [val,i] = max(sum(proj.*proj)); % find max variance + maxvars(n) = val; + proj = proj(chanlist,:); + projdata = [projdata proj]; + envtmp = [ min(proj) ; max(proj)]; + envdata = [envdata envtmp]; + % append envelope of projected data sets onto envdata + % Note: size(envdata) = [length(chanlist) frames*(numcomps+1)] + n = n+1; +end; +fprintf('\n'); +% +%%%%%%%%%%%%%%%%%%%%%%%% Make the plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isstr(titl) + if titl==0, + titl = ' '; + else + fprintf('envproj(): titl unrecognized.\n'); + return + end +end + +set(gcf,'Color',BACKCOLOR); % set the background color +set(gca,'Color','none'); % set the axis color to the background color +if NEG_UP + set(gca,'Ydir','reverse'); +end +n = 1; +H = zeros(1,numcomps+1); + +for c=1:numcomps+1; + % + % Plot envelopes + % + if n <= 6 + if n == 1 % thick lines, store H for legend() + H(n)=plot(x,envdata(1,(c-1)*frames+1:c*frames)',... + colors(c),'Linewidth',DATA_LINEWIDTH); + hold on; + plot(x,envdata(2,(c-1)*frames+1:c*frames)',... + colors(c),'Linewidth',DATA_LINEWIDTH); + else + if FILL + fillx = [x x(frames:-1:1)]; + filly = [envdata(1,(c-1)*frames+1:c*frames) ... + envdata(2,c*frames:-1:(c-1)*frames+1)]; + i = find(isnan(filly)==1); + if ~isempty(i) + fprintf('Replacing %d NaNs in envelope with 0s.\n',length(i)/2); + filly(i)=0; + end + H(n) = fill(fillx,filly,colors(c)); + else + H(n)= plot(x,envdata(1,(c-1)*frames+1:c*frames)',... + colors(c),'Linewidth',COMP_LINEWIDTH); + hold on; + plot(x,envdata(2,(c-1)*frames+1:c*frames)',... + colors(c),'Linewidth',COMP_LINEWIDTH); + end + end + else + H(n)= plot(x,envdata(1,(c-1)*frames+1:c*frames)',... + colors(c),'LineStyle',':','LineWidth',DATA_LINEWIDTH); + hold on; + plot(x,envdata(2,(c-1)*frames+1:c*frames)',... + colors(c),'LineStyle',':','LineWidth',DATA_LINEWIDTH); + end + n = n+1; +end +set(gca,'Color','none'); % set the axis color to the background color + +l=xlabel('Time (ms)'); % xaxis label +set(l,'FontSize',14); + +l=ylabel('Potential (uV)'); % yaxis label +set(l,'FontSize',14); + +if xmax > 0 & xmin < 0 + plot([0 0],[ymin ymax],'k','linewidth',1.5); % plot vertical line at time 0 +end + +if ymax ~= 0 |ymin~= 0, + axis([min(x),max(x),ymin,ymax]); +else + axis([min(x),max(x),min(envdata(1,:)'),max(envdata(2,:)')]); +end +legtext = [ 'Data ' ]; +if compnames(1) ~= 0 + pid = fopen(compnames,'r'); + if pid < 3 + fprintf('envproj(): file %s not found.\n',compnames); + return + end + compnames = fscanf(pid,'%s',[5 numcomps]); + compnames = [ ['Data.']' compnames]; + compnames = compnames'; + if size(compnames,1) ~= numcomps+1 + fprintf('envproj(): no. of compnames must equal no. of compnums.\n'); + return + end + for c=1:5 % remove padding with .'s + for r = 1:size(compnames,1) + if compnames(r,c) == '.' + compnames(r,c) = ' '; + end + end + end + legtext = compnames; +else + legtext = ['Data']; + for c = compnums + legtext = strvcat(legtext,int2str(c)); + end +end + +if numcomps> delete(legend).\n'); + +% +%%%%%%%%%%%%% Compute percentage of variance accounted for %%%%%%%%%%%% +% +sumdata = zeros(length(chanlist),frames); +for e=2:numcomps+1, % sum the component activities + sumdata = sumdata + projdata(:,(e-1)*frames+1:e*frames); +end + +sigssqr = sum(data(chanlist,:).*data(chanlist,:))/(length(chanlist)-1); +dif = data(chanlist,:)-sumdata; +difssqr = sum(dif.*dif)/(length(chanlist)-1); +pvaf = round(100.0*(1.0-difssqr/sigssqr)); % % variance accounted for +rtitl = ['(' int2str(pvaf) '%)']; +%titl = [titl ' ' rtitl]; + +t=title(titl); % plot title +set(t,'FontSize',14); + diff --git a/code/eeglab13_4_4b/functions/miscfunc/erpregout.m b/code/eeglab13_4_4b/functions/miscfunc/erpregout.m new file mode 100644 index 0000000..4a64b7c --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/erpregout.m @@ -0,0 +1,87 @@ +% erpregout() - regress out the ERP from the data +% +% Usage: +% newdata = erpregout(data); +% [newdata erp factors] = erpregout(data, tlim, reglim); +% +% Inputs: +% data - [float] 2-D data (times x trials) or 3-D data +% (channels x times x trials). +% +% Optional inputs: +% tlim - [min max] time limits in ms. +% reglim - [min max] regression time window in ms (by default +% the whole time period is used +% Outputs: +% newdata - data with ERP regressed out +% erp - data ERP +% factors - factors used for regressing out the ERP (size is the same +% as the number of trials or (channels x trials) +% +% Note: it is better to regress out the ERP about 4 times (launch the +% function 4 times in a row) to really be able to regress out the +% ERP and have a residual ERP close to 0. +% +% Author: Arnaud Delorme, Salk, SCCN, UCSD, CA, April 29, 2004 + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2004 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [data, erp, factors] = erpregout(data, tlim, reglim); + + if nargin < 1 + help erpregout; + return; + end; + if nargin < 2 + tlim = [0 1]; + end; + if nargin < 3 + reglim = tlim; + end; + if ndims(data) == 2 + data = reshape(data, 1, size(data,1), size(data,2)); + redim = 1; + else + redim = 0; + end; + + % find closest points + % ------------------- + timevect = linspace(tlim(1), tlim(2), size(data,2)); + [tmp begpoint] = min( abs(timevect-reglim(1)) ); + [tmp endpoint] = min( abs(timevect-reglim(2)) ); + erp = mean(data, 3); + + % regressing out erp in channels and trials + % ----------------------------------------- + for chan = 1:size(data,1) + fprintf('Channel %d (trials out of %d):', chan, size(data,3)); + for trial = 1:size(data,3) + if ~mod(trial, 10) , fprintf('%d ', trial); end; + if ~mod(trial, 200), fprintf('\n', trial); end; + [factors(chan, trial) tmpf exitflag] = fminbnd('erpregoutfunc', 0, 10, [], ... + data(chan, begpoint:endpoint, trial), erp(chan, begpoint:endpoint)); + data(chan,:,trial) = data(chan,:,trial) - factors(chan, trial)*erp(chan, :); + end; + fprintf('\n'); + end; + + if redim + data = squeeze(data); + end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/miscfunc/erpregoutfunc.m b/code/eeglab13_4_4b/functions/miscfunc/erpregoutfunc.m new file mode 100644 index 0000000..b9e7b50 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/erpregoutfunc.m @@ -0,0 +1,38 @@ +% erpregoutfunc() - sub function of erpregout() used to regress +% out the ERP from the data +% +% Usage: +% totdiff = erpregout(fact, data, erp); +% +% Inputs: +% fact - factor +% data - [float] 1-D data (time points). +% erp - [float] 1-D data (time points). +% +% Outputs: +% totdif - residual difference +% +% Author: Arnaud Delorme, Salk, SCCN, UCSD, CA, April 29, 2004 + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2004 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function totdiff = erpregoutfunc(fact, data, erp); + + totdiff = mean(abs(data - fact*erp)); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/miscfunc/eucl.m b/code/eeglab13_4_4b/functions/miscfunc/eucl.m new file mode 100644 index 0000000..748a8d4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/eucl.m @@ -0,0 +1,110 @@ +% EUCL: Calculates the euclidean distances among a set of points, or between a +% reference point and a set of points, or among all possible pairs of two +% sets of points, in P dimensions. Returns a single distance for two points. +% +% Syntax: dists = eucl(crds1,crds2) +% +% crds1 = [N1 x P] matrix of point coordinates. If N=1, it is taken to +% be the reference point. +% crds2 = [N2 x P] matrix of point coordinates. If N=1, it is taken to +% be the reference point. +% ----------------------------------------------------------------------- +% dists = [N1 x N1] symmetric matrix of pairwise distances (if only crds1 +% is specified); +% [N1 x 1] col vector of euclidean distances (if crds1 & ref +% are specified); +% [1 x N2] row vector of euclidean distances (if ref & crds2 +% are specified); +% [N1 x N2] rectangular matrix of pairwise distances (if crds1 +% & crds2 are specified); +% [1 x 1] scalar (if crds1 is a [2 x P] matrix or ref1 & ref2 +% are specified); +% + +% RE Strauss, 5/4/94 +% 10/28/95 - output row (rather than column) vector for the (reference +% point)-(set of points) case; still outputs column vector for the +% (set of points)-(reference point) case. +% 10/30/95 - for double for-loops, put one matrix-col access in outer loop +% to increase speed. +% 10/12/96 - vectorize inner loop to increase speed. +% 6/12/98 - allow for P=1. +% 11/11/03 - initialize dists to NaN for error return. + +function dists = eucl(crds1,crds2) + if nargin == 0, help eucl; return; end; + dists = NaN; + + if (nargin < 2) % If only crds1 provided, + [N,P] = size(crds1); + if (N<2) + error(' EUCL: need at least two points'); + end; + + crds1 = crds1'; % Transpose crds + dists = zeros(N,N); % Calculate pairwise distances + + for i = 1:N-1 + c1 = crds1(:,i) * ones(1,N-i); + if (P>1) + d = sqrt(sum((c1-crds1(:,(i+1:N))).^2)); + else + d = abs(c1-crds1(:,(i+1:N))); + end; + dists(i,(i+1:N)) = d; + dists((i+1:N),i) = d'; + end; + if (N==2) % Single distance for two points + dists = dists(1,2); + end; + + else % If crds1 & crds2 provided, + [N1,P1] = size(crds1); + [N2,P2] = size(crds2); + if (P1~=P2) + error(' EUCL: sets of coordinates must be of same dimension'); + else + P = P1; + end; + + crds1 = crds1'; % Transpose crds + crds2 = crds2'; + + if (N1>1 & N2>1) % If two matrices provided, + dists = zeros(N1,N2); % Calc all pairwise distances between them + for i = 1:N1 + c1 = crds1(:,i) * ones(1,N2); + if (P>1) + d = sqrt(sum((c1-crds2).^2)); + else + d = abs(c1-crds2); + end; + dists(i,:) = d; + end; + end; + + if (N1==1 & N2==1) % If two vectors provided, + dists = sqrt(sum((crds1-crds2).^2)); % Calc scalar + end; + + if (N1>1 & N2==1) % If matrix & reference point provided, + crds1 = crds1 - (ones(N1,1)*crds2')'; % Center points on reference point + if (P>1) % Calc euclidean distances in P-space + dists = sqrt(sum(crds1.^2))'; + else + dists = abs(crds1)'; + end; + end; % Return column vector + + if (N1==1 & N2>1) % If reference point & matrix provided, + crds2 = crds2 - (ones(N2,1)*crds1')'; % Center points on reference point + if (P>1) % Calc euclidean distances in P-space + dists = sqrt(sum(crds2.^2)); + else + dists = abs(crds2); + end; + end; % Return row vector + end; + + return; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/fastregress.m b/code/eeglab13_4_4b/functions/miscfunc/fastregress.m new file mode 100644 index 0000000..71090e1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/fastregress.m @@ -0,0 +1,52 @@ +% fastregress - perform fast regression and return p-value +% +% Usage: +% [ypred, alpha, rsq, B] = myregress(x, y, plotflag); +% +% Inputs +% y - y values +% x - x values +% plotflag - [0|1] plot regression +% +% Outputs +% ypred - y prediction +% alpha - significance level +% R^2 - r square +% slope - slope of the fit +% +% Arnaud Delorme, 25 Feb 2003 + +function [ypred, alpha, rsq, B] = fastregress(x, y, ploting); + + if nargin < 1 + help fastregress; return; + end; + + % this part is useless but still works + %B=polyfit(x, y, 1); % B is the slope + %ypred = polyval(B,x); % predictions + %dev = y - mean(y); % deviations - measure of spread + %SST = sum(dev.^2); % total variation to be accounted for + %resid = y - ypred; % residuals - measure of mismatch + %SSE = sum(resid.^2); % variation NOT accounted for + %rsq = 1 - SSE/SST; % percent of error explained + % see the page http://www.facstaff.bucknell.edu/maneval/help211/fitting.html + + [B,BINT,R,RINT,STATS] = regress(y(:), [ones(length(x),1) x(:)]); + alpha = STATS(3); + rsq = STATS(1); + + %note that we also have + %ypred = [ones(size(x,2),1) x(:)]*B; + ypred = x*B(2) + B(1); + + % B(1) contain the offset, B(2) the slope + B = B(2); + + if nargin > 2 + hold on; + [ynew tmp] = sort(ypred); + xnew = x(tmp); + plot(xnew, ynew, 'r'); + legend(sprintf('R^2=%f', rsq), sprintf('p =%f', alpha)); + end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/miscfunc/fieldtrip2eeglab.m b/code/eeglab13_4_4b/functions/miscfunc/fieldtrip2eeglab.m new file mode 100644 index 0000000..77c1acb --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/fieldtrip2eeglab.m @@ -0,0 +1,52 @@ +% load data file ('dataf') preprocessed with fieldtrip +% and show in eeglab viewer +% +% This function is provided as is. It only works for some specific type of +% data. This is a simple function to help the developer and by no mean +% an all purpose function. + +function [EEG] = fieldtrip2eeglab(dataf) + +[ALLEEG EEG CURRENTSET ALLCOM] = eeglab; + +if exist(dataf,'file') + load(dataf) +end + +% load chanlocs.mat +% EEG.chanlocs = chanlocs; +EEG.chanlocs = []; + +for i=1:size(data.trial,2) + EEG.data(:,:,i) = single(data.trial{i}); +end + +EEG.setname = dataf; %data.cfg.dataset; +EEG.filename = ''; +EEG.filepath = ''; +EEG.subject = ''; +EEG.group = ''; +EEG.condition = ''; +EEG.session = []; +EEG.comments = 'preprocessed with fieldtrip'; +EEG.nbchan = size(data.trial{1},1); +EEG.trials = size(data.trial,2); +EEG.pnts = size(data.trial{1},2); +EEG.srate = data.fsample; +EEG.xmin = data.time{1}(1); +EEG.xmax = data.time{1}(end); +EEG.times = data.time{1}; +EEG.ref = []; %'common'; +EEG.event = []; +EEG.epoch = []; +EEG.icawinv = []; +EEG.icasphere = []; +EEG.icaweights = []; +EEG.icaact = []; +EEG.saved = 'no'; + +[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG); +eeglab redraw +pop_eegplot( EEG, 1, 1, 1); + + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/miscfunc/fillcurves.m b/code/eeglab13_4_4b/functions/miscfunc/fillcurves.m new file mode 100644 index 0000000..c7fa2d0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/fillcurves.m @@ -0,0 +1,115 @@ +% fillcurves() - fill the space between 2 curves +% +% Usage: +% h=fillcurves( Y1, Y2); +% h=fillcurves( X, Y1, Y2, color, transparent[0 to 1]); +% +% Example: +% a = rand(1, 50); +% b = rand(1, 50)+2; b(10) = NaN; +% figure; fillcurves([51:100], a, b); +% +% Author: A. Delorme, SCCN, INC, UCSD/CERCO, CNRS + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function h = fillcurves(X, Y1, Y2, color, transparent, legends) + + if nargin < 2 + help fillcurves; + return; + end; + + if nargin < 3 + Y2 = Y1; + Y1 = X; + X = [1:length(Y1)]; + end; + if nargin < 4 || isempty(color) + color = { 'r' 'b' 'g' 'c' }; + elseif ~iscell(color) + color = { color }; + end; + if nargin < 5 + transparent = 0.5; + end; + X1 = X(:)'; + X2 = X(:)'; + + % remove NaNs + tmpnan1 = find(isnan(Y1)); + tmpnan2 = find(isnan(Y2)); + Y1(tmpnan1) = []; X1(tmpnan1) = []; + Y2(tmpnan2) = []; X2(tmpnan2) = []; + + % remove 0s if log scale + if strcmpi(get(gca, 'yscale'), 'log') + tmp1 = find(~Y1); + tmp2 = find(~Y2); + Y1(tmp1) = []; X1(tmp1) = []; + Y2(tmp2) = []; X2(tmp2) = []; + end; + + % multiple curve plot + % ------------------- + if size(Y1,1) ~= 1 && size(Y1,2) ~= 1 + for index = 1:size(Y1,2) + fillcurves(X, Y1(:,index)', Y2(:,index)', color{index}, transparent); + hold on; + end; + yl = ylim; + xl = xlim; + line([xl(1) xl(1)]+(xl(2)-xl(1))/2000, yl, 'color', 'k'); + line(xl, [yl(1) yl(1)]+(yl(2)-yl(1))/2000, 'color', 'k'); + + % write legend and add transparency to it + % --------------------------------------- + if nargin > 5 + h = legend(legends); + hh = get(h, 'children'); + for index = 1:length(hh) + fields = get(hh(index)); + if isfield(fields, 'FaceAlpha'); + numfaces = size(get(hh(index), 'Vertices'),1); + set(hh(index), 'FaceVertexCData', repmat([1 1 1], [numfaces 1]), 'Cdatamapping', 'direct', 'facealpha', transparent, 'edgecolor', 'none'); + end; + end; + end; + return; + end; + + % plot + % ---- + allpointsx = [X1 X2(end:-1:1)]'; + allpointsy = [Y1 Y2(end:-1:1)]'; + h = fill(allpointsx, allpointsy, color{1}); + set(h, 'edgecolor', color{1}); + xlim([ X(1) X(end) ]); + if transparent + numfaces = size(get(h, 'Vertices'),1); + set(h, 'FaceVertexCData', repmat([1 1 1], [numfaces 1]), 'Cdatamapping', 'direct', 'facealpha', transparent, 'edgecolor', 'none'); + end; + + % replot lines at boundaries + % -------------------------- + parent = dbstack; + if length(parent) == 1 || ~strcmpi(parent(2).name, 'fillcurves') + yl = ylim; + xl = xlim; + line([xl(1) xl(1)]+(xl(2)-xl(1))/2000, yl, 'color', 'k'); + line(xl, [yl(1) yl(1)]+(yl(2)-yl(1))/2000, 'color', 'k'); + end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/findduplicatefunctions.m b/code/eeglab13_4_4b/functions/miscfunc/findduplicatefunctions.m new file mode 100644 index 0000000..840fb65 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/findduplicatefunctions.m @@ -0,0 +1,37 @@ +% find potential conflict between Matlab functions +% +% A. Delorme, May 25th, 2012 + +matlabRoot = fileparts(fileparts(fileparts(fileparts(which('ispc'))))); +folders = path; +delim = find(folders == ':'); +delim = [ 0 delim length(folders)+1 ]; + +for iFolder = 1:length(delim)-1 + currentFolder = folders(delim(iFolder)+1:delim(iFolder+1)-1); + + folderContent = dir(currentFolder); + + if isempty(findstr(matlabRoot, currentFolder)) + + rmpath(currentFolder); + folderContent = { folderContent.name }; + + for iFile = 1:length(folderContent) + + currentFile = folderContent{iFile}; + if length(currentFile) > 2 && strcmpi(currentFile(end-1:end), '.m') + + if ~strcmpi(currentFile, 'Contents.m') + if ~isempty(which(currentFile)) + fullFileName1 = fullfile(currentFolder, currentFile); + fullFileName2 = which(currentFile); + fprintf('Potential conflict between %s and %s\n', fullFileName1, fullFileName2); + end; + end; + end; + end; + addpath(currentFolder); + + end; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/miscfunc/formatsvnrevision.m b/code/eeglab13_4_4b/functions/miscfunc/formatsvnrevision.m new file mode 100644 index 0000000..613e5c6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/formatsvnrevision.m @@ -0,0 +1,44 @@ +function formatsvnrevision(v1, v2) + +disp('Getting revision information...'); +system(sprintf('svn log --verbose -r%d:%d > tmprev.txt', v1, v2)); + +oldpwd = pwd; +newpwd = fileparts(which('eeglab.m')); +cd(newpwd); + +fid = fopen('tmprev.txt', 'r'); + +state = 1; +while ~feof(fid) + txt = fgetl(fid); + if length(txt) > 4 && strcmpi(txt(1:4), '----') + state = 1; + if feof(fid), return; end; + end; + if state == 1, + % get rev number + txt = fgetl(fid); + rev = strtok(txt); + revnum = rev(2:end); + + % get function name + txt = fgetl(fid); + txt = fgetl(fid); + [tmp file] = strtok(txt); + file = deblank(file); + [tmp file ext] = fileparts(file); + file = [ file ext ]; + state = 2; + end; + if isempty(txt) + state = 3; + end; + if state == 3 + revinfo = fgetl(fid); + revinfo = revinfo(1:end); + state = 1; + fprintf('** %s, %s (SVN %s - Arno)\n', file, revinfo, revnum); + end; +end; +cd(oldpwd); diff --git a/code/eeglab13_4_4b/functions/miscfunc/gabor2d.m b/code/eeglab13_4_4b/functions/miscfunc/gabor2d.m new file mode 100644 index 0000000..3436ea6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/gabor2d.m @@ -0,0 +1,109 @@ +% gabor2d() - generate a two-dimensional gabor matrice. +% +% Usage: +% >> [ matrix ] = gabor2d(rows, columns); +% >> [ matrix ] = gabor2d( rows, columns, freq, ... +% angle, sigmaR, sigmaC, meanR, meanC, dephase, cut) +% Example : +% >> imagesc(gabor2d( 50, 50)) +% +% Inputs: +% rows - number of rows +% columns - number of columns +% freq - frequency of the sinusoidal function in degrees (default: 360/rows) +% angle - angle of rotation of the resulting 2-D array in +% degrees of angle {default: 0}. +% sigmaR - standard deviation for rows {default: rows/5} +% sigmaC - standard deviation for columns {default: columns/5} +% meanR - mean for rows {default: center of the row} +% meanC - mean for columns {default: center of the column} +% dephase - phase offset in degrees {default: 0}. A complex Gabor wavelet +% can be build using gabor2dd(...., 0) + i*gabor2d(...., 90), +% 0 and 90 being the phase offset of the real and imaginary parts +% cut - percentage (0->1) of maximum value below which to remove values +% from the matrix {default: 0} +% Ouput: +% matrix - output gabor matrix +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function mat = gabor2d( sizeX, sizeY, freq, angle, sigmaX, sigmaY, meanX, ... +meanY, dephase, cut); + +if nargin < 2 + help gabor2d + return; +end; +if nargin < 3 + freq = 360/sizeX; +end; +if nargin < 4 + angle = 0; +end; +if nargin < 5 + sigmaX = sizeX/5; +end; +if nargin < 6 + sigmaY = sizeY/5; +end; +if nargin < 7 + meanX = (sizeX+1)/2; +end; +if nargin < 8 + meanY = (sizeY+1)/2; +end; +if nargin < 9 + dephase = 0; +end; +if nargin < 10 + cut = 0; +end; +freq = freq/180*pi; + +X = linspace(1, sizeX, sizeX)'* ones(1,sizeY); +Y = ones(1,sizeX)' * linspace(1, sizeY, sizeY); +%[-sizeX/2:sizeX/2]'*ones(1,sizeX+1); +%Y = ones(1,sizeY+1)' *[-sizeY/2:sizeY/2]; + +rotatedmat = ((X-meanX)+i*(Y-meanY)) * exp(i*angle/180*pi); +mat = sin(real(rotatedmat)*freq + dephase/180*pi).*exp(-0.5*( ((X-meanX)/sigmaX).*((X-meanX)/sigmaX)... + +((Y-meanY)/sigmaY).*((Y-meanY)/sigmaY)))... + /((sigmaX*sigmaY)^(0.5)*pi); + +if cut > 0 + maximun = max(max(mat))*cut; + I = find(mat < maximun); + mat(I) = 0; +end; + +return; + +% other solution +% -------------- + +for X = 1:sizeX + for Y = 1:sizeY + mat(X,Y) = sin(real((X-meanX+j*(Y-meanY))*exp(i*angle/180*pi))*freq + dephase/180*pi) ... + .*exp(-0.5*( ((X-meanX)/sigmaX).*((X-meanX)/sigmaX)... + +((Y-meanY)/sigmaY).*((Y-meanY)/sigmaY)))... + /((sigmaX*sigmaY)^(0.5)*pi); + end; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/gauss.m b/code/eeglab13_4_4b/functions/miscfunc/gauss.m new file mode 100644 index 0000000..00d1e26 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/gauss.m @@ -0,0 +1,24 @@ +% gauss() - return a smooth Gaussian window +% +% Usage: +% >> outvector = gauss(frames,sds); +% +% Inputs: +% frames = window length +% sds = number of +/-std. deviations = steepness +% (~0+ -> flat; >>10 -> spike) + +function outvec = gauss(frames,sds) + +outvec = []; +if nargin < 2 + help gauss + return +end +if sds <=0 | frames < 1 + help gauss + return +end + +incr = 2*sds/(frames-1); +outvec = exp(-(-sds:incr:sds).^2); diff --git a/code/eeglab13_4_4b/functions/miscfunc/gauss2d.m b/code/eeglab13_4_4b/functions/miscfunc/gauss2d.m new file mode 100644 index 0000000..7ddcca1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/gauss2d.m @@ -0,0 +1,78 @@ +% gauss2d() - generate a 2-dimensional gaussian matrix +% +% Usage: +% >> [ gaussmatrix ] = gauss2d( rows, columns, ... +% sigmaR, sigmaC, peakR, peakC, mask) +% +% Example: +% >> imagesc(gauss2d(50, 50)); % image a size (50,50) 2-D gaussian matrix +% +% Inputs: +% rows - number of rows in matrix +% columns - number of columns in matrix +% sigmaR - width of standard deviation in rows (default: rows/5) +% sigmaC - width of standard deviation in columns (default: columns/5) +% peakR - location of the peak in each row (default: rows/2) +% peakC - location of the peak in each column (default: columns/2) +% mask - (0->1) portion of the matrix to mask with zeros (default: 0) +% +% Ouput: +% gaussmatrix - 2-D gaussian matrix +% +% Author: Arnaud Delorme, CNL/Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function mat = gauss2d( sizeX, sizeY, sigmaX, sigmaY, meanX, meanY, cut); + +if nargin < 2 + help gauss2d + return; +end; +if nargin < 3 + sigmaX = sizeX/5; +end; +if nargin < 4 + sigmaY = sizeY/5; +end; +if nargin < 5 + meanX = (sizeX+1)/2; +end; +if nargin < 6 + meanY = (sizeY+1)/2; +end; +if nargin < 7 + cut = 0; +end; + +X = linspace(1, sizeX, sizeX)'* ones(1,sizeY); +Y = ones(1,sizeX)' * linspace(1, sizeY, sizeY); +%[-sizeX/2:sizeX/2]'*ones(1,sizeX+1); +%Y = ones(1,sizeY+1)' *[-sizeY/2:sizeY/2]; + +mat = exp(-0.5*( ((X-meanX)/sigmaX).*((X-meanX)/sigmaX)... + +((Y-meanY)/sigmaY).*((Y-meanY)/sigmaY)))... + /((sigmaX*sigmaY)^(0.5)*pi); + +if cut > 0 + maximun = max(max(mat))*cut; + I = find(mat < maximun); + mat(I) = 0; +end; + +return; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/gauss3d.m b/code/eeglab13_4_4b/functions/miscfunc/gauss3d.m new file mode 100644 index 0000000..c297449 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/gauss3d.m @@ -0,0 +1,88 @@ +% gauss3d() - generate a 3-dimensional gaussian matrix +% +% Usage: +% >> [ gaussmatrix ] = gauss2d( nX, nY, nZ); +% >> [ gaussmatrix ] = gauss2d( nX, nY, nZ, ... +% sigmaX, sigmaY, sigmaZ, ... +% centerX, centerY, centerZ, mask) +% +% Example: +% >> gauss3d(3,3,3); % generate a 3x3x3 gaussian matrix +% +% Inputs: +% nX - number of values in first dimension +% nY - number of values in second dimension +% nZ - number of values in third dimension +% sigmaX - width of standard deviation in first dim (default: nX/5) +% sigmaY - width of standard deviation in second dim (default: nY/5) +% sigmaZ - width of standard deviation in third dim (default: nZ/5) +% centerX - location of center (default: nX/2) +% centerY - location of center (default: nY/2) +% centerZ - location of center (default: nZ/2) +% mask - (0->1) percentage of low values in the matrix to mask +% with zeros (default: 0 or none) +% +% Ouput: +% gaussmatrix - 3-D gaussian matrix +% +% Author: Arnaud Delorme, 2009 + +% Copyright (C) 2009 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function mat = gauss3d( sizeX, sizeY, sizeZ, sigmaX, sigmaY, sigmaZ, meanX, meanY, meanZ, cut); + +if nargin < 2 + help gauss2d + return; +end; +if nargin < 4 + sigmaX = sizeX/5; +end; +if nargin < 5 + sigmaY = sizeY/5; +end; +if nargin < 6 + sigmaZ = sizeZ/5; +end; +if nargin < 7 + meanX = (sizeX+1)/2; +end; +if nargin < 8 + meanY = (sizeY+1)/2; +end; +if nargin < 9 + meanZ = (sizeZ+1)/2; +end; +if nargin < 10 + cut = 0; +end; + +[X,Y,Z] = ndgrid(1:sizeX,1:sizeY,1:sizeZ); + +mat = exp(-0.5*( ((X-meanX)/sigmaX).*((X-meanX)/sigmaX)... + +((Y-meanY)/sigmaY).*((Y-meanY)/sigmaY)... + +((Z-meanZ)/sigmaZ).*((Z-meanZ)/sigmaZ)))... + /((sigmaX*sigmaY*sigmaZ)^(0.5)*pi); + +if cut > 0 + maximun = max(mat(:))*cut; + I = find(mat < maximun); + mat(I) = 0; +end; + +return; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/getallmenus.m b/code/eeglab13_4_4b/functions/miscfunc/getallmenus.m new file mode 100644 index 0000000..d5f2331 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/getallmenus.m @@ -0,0 +1,80 @@ +% getallmenus() - get all submenus of a window or a menu and return +% a tree. +% +% Usage: +% >> [tree nb] = getallmenus( handler ); +% +% Inputs: +% handler - handler of the window or of a menu +% +% Outputs: +% tree - text output +% nb - number of elements in the tree +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [txt, nb, labels] = getallmenus( handler, level ) + +NBBLANK = 6; % number of blank for each submenu input + + if nargin < 1 + help getallmenus; + return; + end; + if nargin < 2 + level = 0; + end; + + txt = ''; + nb = 0; + labels = {}; + allmenu = findobj('parent', handler, 'type', 'uimenu'); + allmenu = allmenu(end:-1:1); + if ~isempty(allmenu) + for i=1:length( allmenu ); + [txtmp nbtmp tmplab] = getallmenus(allmenu(i), level+1); + txtmp = [ blanks(level*NBBLANK) txtmp ]; + txt = [ txtmp txt ]; + labels = { tmplab labels{:} }; + nb = nb+nbtmp; + end; + end; + try + txt = [ get(handler, 'Label') 10 txt ]; + nb = nb+1; + catch, end; + if isempty(labels) + labels = { nb }; + end; + +% transform into array of text +% ---------------------------- +if nargin < 2 + txt = [10 txt]; + newtext = zeros(1000, 1000); + maxlength = 0; + lines = find( txt == 10 ); + for index = 1:length(lines)-1 + tmptext = txt(lines(index)+1:lines(index+1)-1); + if maxlength < length( tmptext ), maxlength = length( tmptext ); end; + newtext(index, 1:length(tmptext)) = tmptext; + end; + txt = char( newtext(1:index+1, 1:maxlength) ); +end; +return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/getallmenuseeglab.m b/code/eeglab13_4_4b/functions/miscfunc/getallmenuseeglab.m new file mode 100644 index 0000000..2c82587 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/getallmenuseeglab.m @@ -0,0 +1,121 @@ +% getallmenuseeglab() - get all submenus of a window or a menu and return +% a tree. The function will also look for callback. +% +% Usage: +% >> [tree nb] = getallmenuseeglab( handler ); +% +% Inputs: +% handler - handler of the window or of a menu +% +% Outputs: +% tree - text output +% nb - number of elements in the tree +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [txt, nb, labels] = getallmenuseeglab( handler, level ) + + NBBLANK = 6; % number of blank for each submenu input + + if nargin < 1 + help getallmenuseeglab; + return; + end; + if nargin < 2 + level = 0; + end; + + txt = ''; + nb = 0; + labels = {}; + allmenu = findobj('parent', handler, 'type', 'uimenu'); + allmenu = allmenu(end:-1:1); + if ~isempty(allmenu) + for i=length(allmenu):-1:1 + [txtmp nbtmp tmplab] = getallmenuseeglab(allmenu(i), level+1); + txtmp = [ '% ' blanks(level*NBBLANK) txtmp ]; + txt = [ txtmp txt ]; + labels = { tmplab labels{:} }; + nb = nb+nbtmp; + end; + end; + try + lab = get(handler, 'Label'); + cb = get(handler, 'Callback'); + cb = extract_callback(cb); + if ~isempty(cb) + newtxt = [ lab ' - ' cb '']; + else newtxt = [ lab ]; + end; + txt = [ newtxt 10 txt ]; + %txt = [ get(handler, 'Label') 10 txt ]; + nb = nb+1; + catch, end; + if isempty(labels) + labels = { nb }; + end; + if level == 0 + fid = fopen('tmpfile.m', 'w'); + fprintf(fid, '%s', txt); + fclose(fid); + disp(' '); + disp('Results saved in tmpfile.m'); + end; + +% transform into array of text +% ---------------------------- +if nargin < 2 + txt = [10 txt]; + newtext = zeros(1000, 1000); + maxlength = 0; + lines = find( txt == 10 ); + for index = 1:length(lines)-1 + tmptext = txt(lines(index)+1:lines(index+1)-1); + if maxlength < length( tmptext ), maxlength = length( tmptext ); end; + newtext(index, 1:length(tmptext)) = tmptext; + end; + txt = char( newtext(1:index+1, 1:maxlength) ); +end; + +% extract plugin name +% ------------------- +function cbout = extract_callback(cbin); + +funcList = { 'pop_' 'topoplot' 'eeg_' }; +for iList = 1:3 + indList = findstr(funcList{iList}, cbin); + if ~isempty(indList), + if strcmpi(cbin(indList(1):indList(1)+length('pop_stdwarn')-1), 'pop_stdwarn') + indList = findstr(funcList{iList}, cbin(indList(1)+1:end))+indList(1); + end; + break; + end; +end; +if ~isempty(indList) + indEndList = find( cbin(indList(1):end) == '(' ); + if isempty(indEndList) || indEndList(1) > 25 + indEndList = find( cbin(indList(1):end) == ';' ); + if cbin(indList(1)+indEndList(1)-2) == ')' + indEndList = indEndList-2; + end; + end; + cbout = cbin(indList(1):indList(1)+indEndList(1)-2); +else + cbout = ''; +end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/getipsph.m b/code/eeglab13_4_4b/functions/miscfunc/getipsph.m new file mode 100644 index 0000000..2a6b081 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/getipsph.m @@ -0,0 +1,77 @@ +% getipsph() - Compute "in place" (m by n) sphering or quasi-sphering matrix for an (n by t) +% input data matrix. Quasi-sphering reduces dimensionality of the data, while +% maintaining approximately the "original" positions of the axes. That is, +% quasi-sphering "rotates back" as much as possible into the original channel +% axes, versus simple PCA reduction to the principal subspace (i.e., projecting +% the data onto a largest eigenvector basis). +% Usage: +% >> S = getipsph(x,m) +% +% Input: +% x size [n,t] input n-channel data matrix +% +% Optional input: +% m (int <= n) Reduce output dimensions to [n,m]. If m is not present, or m==n, +% then the usual sphering matrix (the symmetric square root of the data +% covariance matrix) is returned. {default: [], return usual sphering matrix). +% Output: +% +% S size [m,n] (if m==n) sphering matrix, or (if m < n) quasi-sphering matrix +% Example: +% >> x = nrand(10,1000); % random (10,1000) matrix +% >> S = getipsph(x,8); % return quasi-sphering matrix reducing dimension to 8 +% >> d = S*x; % d is the quasi-sphered 8-dimensional data +% % +% % If ICA decomposition is performed on d, as >> [w] = runica(d,'sphering','off'); +% % then the mixing matrix containing the 8 component maps in original channel +% % coordinates is >> A = pinv(W*S); % where A is size [n,m] +% + +% Author: Jason Palmer, SCCN / INC / UCSD, 2008 + +% Copyright (C) Jason Palmer, SCCN / INC / UCSD , La Jolla 2008 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function S = getipsph(x,m) + +[n,N] = size(x); +if nargin < 2 + m = n; +end + +if m>n + help getipsph + return +end + +mn = mean(x,2); +for i = 1:n + x(i,:) = x(i,:) - mn(i); +end +Sxx = x*x'/N; Sxx = (Sxx+Sxx')/2; +[U,D,V] = svd(Sxx); +ds = diag(D); + +if m == n + S = U * pinv(diag(sqrt(ds))) * U'; +elseif m < n + [sd,so] = sort(diag(Sxx),1,'descend'); + [uv,sv,vv] = svd(U(so(1:m),1:m)); + S = uv * vv' * pinv(diag(sqrt(ds(1:m)))) * U(:,1:m)'; +else + error('m must be less than or equal to n'); +end + diff --git a/code/eeglab13_4_4b/functions/miscfunc/gradmap.m b/code/eeglab13_4_4b/functions/miscfunc/gradmap.m new file mode 100644 index 0000000..a291ee9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/gradmap.m @@ -0,0 +1,99 @@ +% gradmap() - compute the gradient of an EEG spatial distribution. +% +% Usage: +% >> [gradX, gradY ] = gradmap( map, filename, draw ) +% +% Inputs: +% map - level of activity (size: nbelectrodes x nbChannel) +% filename - filename (.loc file) countaining the coordinates +% of the electrodes, or array countaining complex positions +% Can also be a EEGLAB channel structure. +% draw - integer, if not nul draw the gradient (default:0) +% +% Output: +% gradX - gradient over X +% gradY - gradient over Y (use cart2pol to get polar coordinates) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% This section bastardizes topoplot.m in order to get gradient maps +% for all of the component maps brought back from ClusMapSpec.m +% This is done to improve the clustering results. + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [gradx, grady] = gradmap( map, filename, draw ) + +if nargin < 2 + help gradmap; + return; +end; + +MAXCHANS = size(map,1); +GRID_SCALE = 2*MAXCHANS+5; + +% Read the channel file +% --------------------- +if isnumeric( filename ) + x = real(filename); + y = imag(filename); +else + tmploc = readlocs( filename); + fe = find(cellfun('isempty', { tmploc.theta })); + tmploc(fe) = []; + map(fe,:) = []; + [x,y] = pol2cart( [ tmploc.theta ]/180*pi , [ tmploc.radius ] ); +end; + +% locates nearest position of electrod in the grid +% ------------------------------------------------ +xi = linspace(-0.5,0.5,GRID_SCALE); % x-axis description (row vector) +yi = linspace(-0.5,0.5,GRID_SCALE); % y-axis description (row vector) +horizidx=zeros(1, MAXCHANS); %preallocation +vertidx=zeros(1, MAXCHANS); % preallocation +for i=1:MAXCHANS + [useless_var horizidx(i)] = min(abs(y(i) - xi)); % find pointers to electrode + [useless_var vertidx(i)] = min(abs(x(i) - yi)); % positions in Zi +end; + +draw = 1; + +% Compute gradient +% ---------------- +for i=1:size(map,2) + [Xi,Yi,Zi] = griddata(y,x,map(:,i),yi',xi, 'v4'); % interpolate data + [FX,FY] = gradient(Zi); + positions = horizidx + (vertidx-1)*GRID_SCALE; + + gradx(:,i) = FX(positions(:)); + grady(:,i) = FY(positions(:)); + + % Draw gradient + % ------------- + if exist('draw') + if exist('imresize') + subplot(ceil(sqrt(size(map,2))), ceil(sqrt(size(map,2))), i); + contour(imresize(Zi,0.5)); hold on + quiver(imresize(FX, 0.5), imresize(FY, 0.5)); hold off + else + disp('Warning: cannot plot because imresize function is missing (image processing toolbox)'); + end; + end; +end; + +return; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/gradplot.m b/code/eeglab13_4_4b/functions/miscfunc/gradplot.m new file mode 100644 index 0000000..70a7b17 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/gradplot.m @@ -0,0 +1,166 @@ +% gradplot() - Compute the gradient of EEG scalp map(s) on a square grid +% +% Usage: +% >> [gradX, gradY] = gradplot(maps,eloc_file,draw) +% Inputs: +% maps - Activity levels, size (nelectrodes,nmaps) +% eloc_file - Electrode location filename (.loc file) containing electrode +% - coordinates (For format, see >> topoplot example) +% draw - If defined, draw the gradient map(s) {default: no} +% +% Outputs: +% gradX - Gradients in X direction +% gradY - Gradients in Y directions +% +% Note: Use cart2pol() to convert to polar (amp, direction) coordinates). +% +% Authors: Marissa Westerfield & Arnaud Delorme, CNL/Salk Institute, La Jolla 3/10/01 +% +% See also: topoplot(), lapplot() + +% Copyright (C) 3/10/01 Marissa Westerfield & Arnaud Delorme, CNL/Salk Institute, La Jolla +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function [gradx, grady] = gradplot( map, locs_file, draw ) + +if nargin < 2 + help gradplot; + return; +end; + +NCHANS = size(map,1); +GRID_SCALE = 2*NCHANS+5; +MAX_RADIUS = 0.5; + +% -------------------------------- +% Read the electrode location file +% -------------------------------- +if isstr(locs_file) % a locs file + [tmpeloc labels Th Rd ind] = readlocs(locs_file,'filetype', ... + 'loc'); + [x,y] = pol2cart(Th/180*pi,Rd); % See Bug 149 + % [x,y] = pol2cart(Th,Rd); +elseif isstruct(locs_file) % a locs struct + [tmpeloc labels Th Rd ind] = readlocs(locs_file); + if max(abs(Rd))>0.5 + fprintf('gradplot(): Shrinking electrode arc_lengths from (max) %4.3f to (max) 0.5\n',... + max(abs(Rd))); + Rd = Rd/(2*max(abs(Rd))); % shrink to max radius = 0.5 + end + [x,y] = pol2cart(Th,Rd); + if length(x) ~= NCHANS + fprintf(... + 'gradplot(): channels in locs file (%d) ~= channels in maps (%d)\n', ... + length(x), NCHANS); + return + end +else % what is this complex number format ??? -sm + x = real(locs_file); + y = imag(locs_file); +end; + +% ------------------------------------------------ +% Locate nearest position of electrode in the grid +% ------------------------------------------------ +xi = linspace(-0.5,0.5,GRID_SCALE); % x-axis description (row vector) +yi = linspace(-0.5,0.5,GRID_SCALE); % y-axis description (row vector) +delta = xi(2)-xi(1); % length of grid entry +horizidx=zeros(1, NCHANS); %preallocation +vertidx=zeros(1, NCHANS); % preallocation + +for c=1:NCHANS + [useless_var horizidx(c)] = min(abs(y(c) - xi)); % find pointers to electrode + [useless_var vertidx(c)] = min(abs(x(c) - yi)); % positions in Zi +end; + +% ------------------- +% Compute gradient(s) +% ------------------- +for m=1:size(map,2) + [Xi,Yi,Zi] = griddata(y,x,map(:,m),yi',xi, 'v4'); % interpolate data + [FX,FY] = gradient(Zi); + positions = horizidx + (vertidx-1)*GRID_SCALE; + + gradx(:,m) = FX(positions(:)); + grady(:,m) = FY(positions(:)); + + % ---------------- + % Draw gradient(s) + % ---------------- + if exist('draw') + + % Take data within head + mask = (sqrt(Xi.^2+Yi.^2) <= MAX_RADIUS); + mask = find(mask==0); + Zi(mask) = NaN; + FX(mask) = NaN; + FY(mask) = NaN; + width = max(Xi)-min(Xi); + + subplot(ceil(sqrt(size(map,2))), ceil(sqrt(size(map,2))), m); + +% surface(1+width*(0.5+Xi-delta/2),... +% 1+width*(0.5+Yi-delta/2),... +% zeros(size(Zi)),Zi,'EdgeColor','none',... +% 'FaceColor','flat'); hold on + + contour(imresize(Zi,0.5)); hold on + quiver(imresize(FX, 0.5), imresize(FY, 0.5)); + title(['Map ' int2str(m)]); + + +% %%% Draw Head %%%% +ax = axis; +width = ax(2)-ax(1); +expansion = 0.3; +axis([ax(1)-expansion ax(2)+expansion ax(3)-expansion ax(4)+expansion]) +steps = 0:2*pi/100:2*pi; +basex = .18*MAX_RADIUS; +tip = MAX_RADIUS*1.15; +base = MAX_RADIUS-.004; +EarX = [.497 .510 .518 .5299 .5419 .54 .547 .532 .510 .489]; +EarY = [.0555 .0775 .0783 .0746 .0555 -.0055 -.0932 -.1313 -.1384 -.1199]; + +HCOLOR = 'k'; +HLINEWIDTH = 1.8; + +% Plot Head, Ears, Nose +hold on +plot(1+width/2+cos(steps).*MAX_RADIUS*width,... + 1+width/2+sin(steps).*MAX_RADIUS*width,... + 'color',HCOLOR,'Linestyle','-','LineWidth',HLINEWIDTH); % head + +plot(1+width/2+[.18*MAX_RADIUS*width;0;-.18*MAX_RADIUS*width],... + 1+width/2+[base;tip;base]*width,... + 'Color',HCOLOR,'LineWidth',HLINEWIDTH); % nose + +plot(1+width/2+EarX*width,... + 1+width/2+EarY*width,... + 'color',HCOLOR,'LineWidth',HLINEWIDTH) % l ear +plot(1+width/2-EarX*width,... + 1+width/2+EarY*width,... + 'color',HCOLOR,'LineWidth',HLINEWIDTH) % r ear + +hold off +axis off + + + end; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/headmovie.m b/code/eeglab13_4_4b/functions/miscfunc/headmovie.m new file mode 100644 index 0000000..85d1e9e --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/headmovie.m @@ -0,0 +1,272 @@ +% ########## This function is deprecated. Use eegmovie instead. ########## +% +% headmovie() - Record a Matlab movie of scalp data. +% Use seemovie() to display the movie. +% +% Usage: >> [Movie,Colormap] = headmovie(data,elec_loc,spline_file); +% >> [Movie,Colormap,minc,maxc] = headmovie(data,elec_loc,spline_file,... +% srate,title,camerapath,movieframes,minmax,startsec); +% Inputs: +% data = (chans,frames) EEG data set to plot +% elec_loc = electrode locations file for eegplot {default 'chan.loc'} +% spline_file = headplot() produced spline 'filename' {default 'chan.spline'} +% srate = sampling rate in Hz {default|0 -> 256 Hz} +% title = 'plot title' {default|0 -> none} +% camerapath = [az_start az_step el_start el_step] {default [-127 0 30 0]} +% Setting all four non-0 creates a spiral camera path +% Partial entries allowed, e.g. [az_start] +% Subsequent rows [movieframe az_step 0 el_step] adapt step +% sizes allowing starts/stops, panning back and forth, etc. +% movieframes = vector of data frames to animate {default|0 -> all} +% minmax = Data [lower_bound, upper_bound] Lower->blue, upper->red +% {default|0 -> +/-abs max of data} +% startsec = starting time in seconds {default|0 -> 0.0} +% +% Note: BUG IN MATLAB 5.0-5.1 -- CANT SHOW MOVIES IN CORRECT COLORS +% +% Authors: Scott Makeig & Colin Humphries, SCCN/INC/UCSD, La Jolla, 2/1998 +% +% See also: seemovie(), eegmovie(), headplot() + +% Copyright (C) 2.6.98 Scott Makeig & Colin Humphries, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function [Movie, Colormap, minc, maxc] = headmovie(data,eloc_file,spline_file,srate,titl,camerapath,movieframes,minmax,startsec,varargin) + +if nargin<1 + help headmovie + return +end + +clf +[chans,frames] = size(data); + +icadefs; % read DEFAULT_SRATE; + +if nargin<9 + startsec = 0; +end +if nargin<8 + minmax = 0; +end +if size(minmax)==[1 1] & minmax ~= 0 + minmax = [-minmax minmax]; +end +if minmax ==0, + minc = min(min(data)); + maxc = max(max(data)); + absmax = max([abs(minc), abs(maxc)]); + fudge = 0.05*(maxc-minc); % allow for slight extrapolation + minc = -absmax-fudge; + maxc = absmax+fudge; + minmax = [minc maxc]; +end + +if nargin <7 + movieframes = 0; +end +if nargin<6 + camerapath = 0; +end +if movieframes == 0 + movieframes = 1:frames; % default +end +if nargin <5 + titl = ''; +end +if titl == 0 + titl = ''; +end +if nargin <4 + srate = 0; +end +if nargin <3 + spline_file = 0; +end +if nargin <2 + eloc_file = 0; +end + +if movieframes(1) < 1 | movieframes(length(movieframes))>frames + fprintf('headmovie(): specified movieframes not in data!\n'); + return +end + +if srate ==0, + srate = DEFAULT_SRATE; +end + +mframes = length(movieframes); +fprintf('Making a movie of %d frames\n',mframes) +Movie = moviein(mframes,gcf); + +if size(camerapath) == [1,1] + if camerapath==0 + camerapath = [-127 0 30 0]; + fprintf('Using default view [-127 0 30 0].'); + else + camerapath = [camerapath 0 30 0]; + end +elseif size(camerapath,2) == 2 + camerapath(1,:) = [camerapath(1,1) camerapath(1,2) 30 0] +elseif size(camerapath,2) == 3 + camerapath(1,:) = [camerapath(1,1) camerapath(1,2) camerapath(1,3) 0] +elseif size(camerapath,2) > 4 + help headmovie + return +end +if size(camerapath,1) > 1 & size(camerapath,2)~=4 + help headmovie + return +end + +azimuth = camerapath(1,1); % initial camerapath variables +az_step = camerapath(1,2); +elevation = camerapath(1,3); +el_step = camerapath(1,4); + +if ~isstruct(eloc_file) && eloc_file(1) == 0 + eloc_file = 'chan.angles'; +end +if spline_file(1) == 0 + spline_file = 'chan.spline'; +end + +figure(gcf); % bring figure to front +clf % clear figure + +%%%%%%%%%%%%%%%%%%%%% eegplot() of data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +axeegplot = axes('Units','Normalized','Position',[.75 .05 .2 .9]); +if isstruct(eloc_file) + eegplotold('noui',-data,srate,0,[],startsec,'r'); + %eegplotsold(-data,srate,[],' ',0,frames/srate,'r',startsec); %CJH +else + eegplotold('noui',-data,srate,0,eloc_file,startsec,'r'); + %eegplotsold(-data,srate,eloc_file,' ',0,frames/srate,'r',startsec); %CJH +end; +set(axeegplot,'XTick',[]) %%CJH + % plot negative up +limits = get(axeegplot,'Ylim'); % list channel numbers only +set(axeegplot,'GridLineStyle',':') +set(axeegplot,'Xgrid','off') +set(axeegplot,'Ygrid','on') +axcolor = get(gcf,'Color'); + +%%%%%%%%%%%%%%%%%%%%%%% print title text %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +axtitle = axes('Units','Normalized','Position',[0 .9 .72 .1],'Color',axcolor); + axes(axtitle) + text(0.5,0.5,titl,'FontSize',16,'horizontalalignment','center') + axis('off') + +%%%%%%%%%%%%%%%%%%%%%%% display colorbar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +axcolorbar = axes('Units','Normalized','Position',[.05 .05 .055 .18]); + axes(axcolorbar) + if exist('colorbar_tp')==2 + h=colorbar_tp(axcolorbar); % Slightly altered Matlab colorbar() routine + else + h=colorbar(axcolorbar); % Note: there is a minor problem with this call. + end % Write authors for further information. + hkids=get(h,'children'); + for k=1:1 + delete(hkids(k)); + end + set(axcolorbar,'Ytick',[0 0.5 1.0],'Yticklabel',[' - ';' 0 ';' + '],'FontSize',16); + axis('off') + +%%%%%%%%%%%%%%%%%%%%%%%%%%%% "Roll'em!" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +axheadplot = axes('Units','Normalized','Position',[0 .1 .72 .8],'Color',axcolor); +TPAXCOLOR = get(axheadplot,'Color'); +Colormap = [jet(64);TPAXCOLOR]; + +fprintf('Warning: do not resize plot window during movie creation ...\n '); + +newpan = length(movieframes)+1; +posrow = 2; +if size(camerapath,1) > 1 + newpan = camerapath(posrow,1); % pick up next frame to change camerapos step values +end +for i = movieframes % make the movie, frame by frame + fprintf('%d ',i-movieframes(1)+1); + + axes(axeegplot) + x1 = startsec+(i-1)/srate; + l1 = line([x1 x1],limits,'color','b'); % draw vertical line at data frame + timetext = num2str(x1,3); % Note: Matlab4 doesn't take '%4.3f' + set(axeegplot,'Xtick',x1,'XtickLabel',num2str(x1,'%4.3f')); + + axes(axheadplot) + cla + set(axheadplot,'Color',axcolor); + + headplot(data(:,i),spline_file,'maplimits',minmax,... + 'view',[azimuth elevation],'verbose','off', varargin{:}); + + if i== newpan % adapt camerapath step sizes + az_step = camerapath(posrow,2); + el_step = camerapath(posrow,4); + posrow = posrow+1; + if size(camerapath,1)>=posrow + newpan = camerapath(posrow,1); + else + newpan = length(movieframes)+1; + end + end + + azimuth = azimuth+az_step; % update camera position + elevation = elevation+el_step; + + if elevation>=90 + fprintf('headplot(): warning -- elevation out of range!\n'); + elevation = 89.99; + end + if elevation<=-90 + fprintf('headplot(): warning -- elevation out of range!\n'); + elevation = -89.99; + end + + set(axheadplot,'Units','pixels',... + 'CameraViewAngleMode','manual',... + 'YTickMode','manual','ZTickMode','manual',... + 'PlotBoxAspectRatioMode','manual',... + 'DataAspectRatioMode','manual'); % keep camera distance constant + + txt = [int2str(i-movieframes(1)+1)]; + text(0.45,-0.45,txt,'Color','k','FontSize',14); % show frame number + + [Movie(:,i+1-movieframes(1))] = getframe(gcf); % can't show this - colors wrong! + % known Matlab 5.0-5.1 bug! + % [M,Cmap] = getframe(gcf); + % if i==1 + % [m,n] = size(M); + % Movie = zeros(m,n*length(movieframes)); + % whos Movie + % end + % Movie((i-1)*m+1:i*m,(i-1)*n+1:i*n) = M; + drawnow + delete(l1) +end +% colormap(Cmap); +% montage(Movie) +% Movie = immovie(Movie,[m n length(movieframes)]); +% whos Movie +fprintf('\nDone!\n'); + diff --git a/code/eeglab13_4_4b/functions/miscfunc/help2html2.m b/code/eeglab13_4_4b/functions/miscfunc/help2html2.m new file mode 100644 index 0000000..a7e469e --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/help2html2.m @@ -0,0 +1,446 @@ +% help2html() - Convert a Matlab m-file help-message header into an .html help file +% +% Usage: +% >> linktext = help2html( filein, fileout, 'key1', val1, 'key2', val2 ...); +% +% Inputs: +% filein - input filename (with .m extension) +% fileout - output filename (if empty, generated automatically) +% +% Optional inputs: +% 'header' - command to insert in the header (i.e. javascript +% declaration or meta-tags). {default: none}. +% 'footer' - command to insert at the end of the .html file (e.g., +% back button). {default: none}. +% 'refcall' - syntax to call references. {default: '%s.html'} For +% javascript function uses 'javascript:funcname(''%s.js'')' +% 'font' - font name +% 'background' - background tag (i.e. ''). +% {default: none}. +% 'outputlink' - html command text to link to the generated .html page. +% Must contain two '%s' symbols to the function title +% and to the function link. +% Ex: ... href="%s.html" ... {default: standard .html href}. +% 'outputtext' - Text used in the outputlink. {default: the function +% name} +% 'outputonly' - ['on'|'off'] Only generate the linktext {default: 'off'} +% +% Output: +% fileout - .html file written to disk +% linktext - html-text link to the output file +% +% M-file format: +% The following lines describe the header format of an m-file function +% to allow .html help file generation. Characters '-' and ':' are used +% explicitly by the function for parsing. +% +%% function_name() - description line 1 +%% description line 2 +%% etc. +%% +%% Title1: +%% descriptor1 - text line 1 +%% text line 2 +%% descriptor2 - [type] text line 1 +%% "descriptor 3" - text line 1 (see notes) +%% etc. +%% +%% Title2: +%% text line 1 [...](see notes) +%% text line 2 +%% +%% See also: +%% function1(), function2() +% +% Author: Arnaud Delorme, Salk Institute 2001 +% +% Notes: 1) The text lines below Title2 are considered as is (i.e., +% preserving Matlab carriage returns) unless there is a +% Matlab continuation cue ('...'). In this case, lines are +% contcatenated. As below 'Title1', all text lines following +% each descriptor (i.e., single_word followed by '-' or '=' +% or multiple quoted words followed by a '-' or '=') +% are concatenated. +% 2) The pattern 'function()' is detected and is printed in bold +% if it is the first function descriptor. Otherwise, +% it is used as a web link to the .html function file +% 'function.html' if this exists. +% 3) If a 'function.jpg' image file (with same 'function' name) exists, +% the image is inserted into the function .html file following +% the function description. If the .jpg file is absent, the function +% checks for the presence of a .gif file. +% 4) Lines beginning by '%%' are not interpreted and will be printed as is. +% 5) if [type] is present in a "descriptor2 - [type] text line 1" +% type is bolded. + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [linktext,allvars,alltext] = help2html( filename, htmlfile, varargin) + +if nargin < 1 + help help2html; + return; +end; +if nargin <3 + g = []; +else + g = struct( varargin{:});; +end; + +try, g.font; catch, g.font = 'Helvetica'; end; + +g.functionname = [ '%s' ]; +g.description = [ '%s' ]; +g.title = [ '%s' ]; +g.var = [ '
%s   
' ]; +g.vartext = [ '%s' ]; +g.text = [ '%s' ]; + +g.normrow = ''; +g.normcol1 = ''; +g.normcol2 = ''; +g.doublecol = ''; +g.seefile = [ 'See the matlab file %s (may require other functions)

' ]; + +try, g.outputonly; catch, g.outputonly = 'off'; end; +try, g.background; catch, g.background = ''; end; +try, g.header; catch, g.header = ''; end; +try, g.footer; catch, g.footer = ''; end; +try, g.refcall; catch, g.refcall = '%s.html'; end; +try, g.outputlink; catch, g.outputlink = [ g.normrow g.normcol1 '%s.html' g.normcol2 '%s' ]; end; + +g.footer = [ '' g.footer '' ]; + +if nargin < 1 + help help2html; + return; +end; + +% output file +% ----------- +if nargin < 2 | isempty(htmlfile); + indexdot = findstr( filename, '.'); + if isempty(indexdot), indexdot = length(filename)+1; end; + htmlfile = [ filename(1:indexdot(end)-1) '.html' ]; +else + indexdot = findstr( filename, '.'); +end; + +% open files +% ---------- +fid = fopen( filename, 'r'); +if fid == -1 + error('Input file not found'); +end; +if ~strcmp(g.outputonly, 'on') + fo = fopen(htmlfile, 'w'); + if fo == -1 + error('Cannot open output file'); + end; + % write header + % ------------ + fprintf(fo, '%s\n%s\n\n', g.header, g.background); +end; + + +cont = 1; +% scan file +% ----------- +str = fgets( fid ); +% if first line is the name of the function, reload +if str(1) ~= '%', str = fgets( fid ); end; + +% state variables +% ----------- +maindescription = 1; +varname = []; +oldvarname = []; +vartext = []; +newvar = 0; +allvars = {}; +alltext = {}; +indexout = 1; + +while (str(1) == '%') + str = deblank(str(2:end-1)); + + % --- DECODING INPUT + newvar = 0; + str = deblank2(str); + + if ~isempty(str) + + % find a title + % ------------ + i2d = findstr(str, ':'); + newtitle = 0; + if ~isempty(i2d) + i2d = i2d(1); + switch lower(str(1:i2d)) + case { 'usage:' 'authors:' 'author:' 'notes:' 'note:' 'input:' ... + 'inputs:' 'outputs:' 'output:' 'example:' 'examples:' 'see also:' }, newtitle = 1; + end; + if (i2d == length(str)) & (str(1) ~= '%'), newtitle = 1; end; + end; + if newtitle + tilehtml = str(1:i2d); + newtitle = 1; + oldvarname = varname; + oldvartext = vartext; + if i2d < length(str) + vartext = formatstr(str(i2d+1:end), g.refcall); + else vartext = []; + end; + varname = []; + else + % not a title + % ------------ + % scan lines + [tok1 strrm] = mystrtok( str ); + [tok2 strrm] = strtok( strrm ); + + if ~isempty(tok2) & ( tok2 == '-' | tok2 == '=') % new variable + newvar = 1; + oldvarname = varname; + oldvartext = vartext; + if ~maindescription + varname = formatstr( tok1, g.refcall); + else + varname = tok1; + end; + strrm = deblank(strrm); % remove tail blanks + strrm = deblank(strrm(end:-1:1)); % remove initial blanks + strrm = formatstr( strrm(end:-1:1), g.refcall); + vartext = strrm; + else + % continue current text + str = deblank(str); % remove tail blanks + str = deblank(str(end:-1:1)); % remove initial blanks + str = formatstr( str(end:-1:1), g.refcall ); + if isempty(vartext) + vartext = str; + else + if ~isempty(varname) + vartext = [ vartext ' ' str]; % espace if in array + else + if all(vartext( end-2:end) == '.') + vartext = [ deblank2(vartext(1:end-3)) ' ' str]; % espace if '...' + else + vartext = [ vartext '
' str]; % CR otherwise + end; + end; + end; + end; + newtitle = 0; + end; + % --- END OF DECODING + + str = fgets( fid ); + + % test if last entry + % ------------------ + if str(1) ~= '%' + if ~newtitle + if ~isempty(oldvarname) + allvars{indexout} = oldvarname; + alltext{indexout} = oldvartext; + indexout = indexout + 1; + fprintf( fo, [ '' g.normrow g.normcol1 g.var '\n' ], oldvarname); + fprintf( fo, [ g.normcol2 g.vartext '\n' ], finalformat(oldvartext)); + else + if ~isempty(oldvartext) + fprintf( fo, [ g.normcol2 g.text '\n' ], finalformat(oldvartext)); + end; + end; + newvar = 1; + oldvarname = varname; + oldvartext = vartext; + end; + end; + + % test if new input for an array + % ------------------------------ + if newvar | newtitle + if maindescription + if ~isempty(oldvartext) % FUNCTION TITLE + maintext = oldvartext; + + % generate the output command + % --------------------------- + try, g.outputtext; catch, g.outputtext = ''; end; + if isempty(g.outputtext), g.outputtext = filename(1:indexdot(end)-1); end; + linktext = sprintf( g.outputlink, g.outputtext, filename(1:indexdot(end)-1), maintext ); + if strcmp(g.outputonly, 'on') + fclose(fid); + return; + end; + + maindescription = 0; + functioname = oldvarname( 1:findstr( oldvarname, '()' )-1); + fprintf( fo, [g.normrow g.normcol1 g.functionname '\n'],upper(functioname)); + fprintf( fo, [g.normcol2 g.description '\n'], [ upper(oldvartext(1)) oldvartext(2:end) ]); + + % INSERT IMAGE IF PRESENT + imagename = []; + imagename1 = [ htmlfile( 1:findstr( htmlfile, functioname )-1) functioname '.jpg' ]; + imagename2 = [ htmlfile( 1:findstr( htmlfile, functioname )-1) functioname '.gif' ]; + if exist( imagename2 ), imagename = imagename2; end; + if exist( imagename1 ), imagename = imagename1; end; + if ~isempty(imagename) % do not make link if the file does not exist + imageinfo = imfinfo(imagename); + if imageinfo.Width < 600 + fprintf(fo, [ g.normrow g.doublecol ... + '

' ]); + else + fprintf(fo, [ g.normrow g.doublecol ... + '

' ]); + end; + + end; + end; + elseif ~isempty(oldvarname) + allvars{indexout} = oldvarname; + alltext{indexout} = oldvartext; + indexout = indexout + 1; + fprintf( fo, [ '' g.normrow g.normcol1 g.var '\n' ], oldvarname); + fprintf( fo, [ g.normcol2 g.vartext '\n' ], finalformat(oldvartext)); + else + if ~isempty(oldvartext) + fprintf( fo, [ g.normcol2 g.text '\n' ], finalformat(oldvartext)); + end; + end; + end; + + % print title + % ----------- + if newtitle + fprintf( fo, [ g.normrow g.doublecol '
' g.normrow g.normcol1 g.title '\n' ], tilehtml); + if str(1) ~= '%' % last input + fprintf( fo, [ g.normcol2 g.text '\n' ], vartext); + end; + oldvarname = []; + oldvartext = []; + end; + else + str = fgets( fid ); + end; +end; +fprintf( fo, [ '
\n
' g.seefile '%s'], lower(filename), filename, g.footer); +fclose( fid ); +fclose( fo ); + +return; + +% ----------------- +% sub-functions +% ----------------- +function str = deblank2( str ); % deblank two ways + str = deblank(str(end:-1:1)); % remove initial blanks + str = deblank(str(end:-1:1)); % remove tail blanks +return; + +function strout = formatstr( str, refcall ); + [tok1 strrm] = strtok( str ); + strout = []; + while ~isempty(tok1) + tokout = functionformat( tok1, refcall ); + if isempty( strout) + strout = tokout; + else + strout = [strout ' ' tokout ]; + end; + [tok1 strrm] = strtok( strrm ); + end; +return; + +% final formating +function str = finalformat(str); % bold text in bracket if just in the beginning + tmploc = sort(union(find(str == '['), find(str == ']'))); + if ~isempty(tmploc) & str(1) == '[' + if mod(length(tmploc),2) ~= 0, str, error('Opening but no closing bracket'); end; + tmploc = tmploc(1:2); + str = [ str(1:tmploc(1)) '' str(tmploc(1)+1:tmploc(2)-1) '' str(tmploc(2):end) ]; + end; + + %tmploc = find(str == '"'); + %if ~isempty(tmploc) + % if mod(length(tmploc),2) ~= 0, str, error('Opening but no closing parenthesis'); end; + % for index = length(tmploc):-2:1 + % str = [ str(1:tmploc(index-1)-1) '' str(tmploc(index-1)+1:tmploc(index)-1) '' str(tmploc(index)+1:end) ]; + % end; + %end; + +function tokout = functionformat( tokin, refcall ); + tokout = tokin; % default + [test, realtokin, tail, beg] = testfunc1( tokin ); + if ~test, [test, realtokin, tail] = testfunc2( tokin ); end; + if test + i1 = findstr( refcall, '%s'); + i2 = findstr( refcall(i1(1):end), ''''); + if isempty(i2) i2 = length( refcall(i1(1):end) )+1; end; + filename = [ realtokin refcall(i1+2:i1+i2-2)]; % concatenate filename and extension + %disp(filename) + if exist( filename ) % do not make link if the file does not exist + tokout = sprintf( [ beg '%s' tail ' ' ], realtokin, realtokin ); + end; + end; +return; + +function [test, realtokin, tail, beg] = testfunc1( tokin ) % test if is string is 'function()[,]' + test = 0; realtokin = ''; tail = ''; beg = ''; + if ~isempty( findstr( tokin, '()' ) ) + if length(tokin)<3, return; end; + realtokin = tokin( 1:findstr( tokin, '()' )-1); + if length(realtokin) < (length(tokin)-2) tail = tokin(end); else tail = []; end; + test = 1; + if realtokin(1) == '(', realtokin = realtokin(2:end); beg = '('; end; + if realtokin(1) == ',', realtokin = realtokin(2:end); beg = ','; end; + end; +return; + +function [test, realtokin, tail] = testfunc2( tokin ) % test if is string is 'FUNCTION[,]' + test = 0; realtokin = ''; tail = ''; + if all( upper(tokin) == tokin) + if tokin(end) == ',' + realtokin = tokin(1:end-1); + tail = ','; + else + realtokin = tokin; + end; + testokin = realtokin; + testokin(findstr(testokin, '_')) = 'A'; + testokin(findstr(testokin, '2')) = 'A'; + if all(double(testokin) > 64) & all(double(testokin) < 91) + test = 1; + end; + realtokin = lower(realtokin); + end; +return; + +function [tok, str] = mystrtok(str) + + [tok str] = strtok(str); + if tok(1) == '"' + while tok(end) ~= '"' + [tok2 str] = strtok(str); + if isempty(tok2), tok, error('can not find closing quote ''"'' in previous text'); end; + tok = [tok ' ' tok2]; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/helpforexe.m b/code/eeglab13_4_4b/functions/miscfunc/helpforexe.m new file mode 100644 index 0000000..06df583 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/helpforexe.m @@ -0,0 +1,104 @@ +% helpforexe() - Write help files for exe version +% +% Usage: +% histtoexe( mfile, folder) +% +% Inputs: +% mfile - [cell of string] Matlab files with help message +% folder - [string] Output folder +% +% Output: +% text files name help_"mfile".m +% +% Author: Arnaud Delorme, 2006 +% +% See also: eeglab() + +% Copyright (C) 2006 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function helpforexe( funct, fold ); + +if nargin <1 + help histforexe; + return; +end; +nonmatlab = 0; + +% write all files +% --------------- +for index = 1:length(funct) + doc1 = readfunc(funct{index}, nonmatlab); + + fid = fopen( fullfile(fold, [ 'help_' funct{index} ]), 'w'); + for ind2 = 1:length(doc1) + if isempty(doc1{ind2}) fprintf(fid, [ 'disp('' '');\n' ]); + else fprintf(fid, [ 'disp(' vararg2str({ doc1{ind2} }) ');\n' ]); + end; + end; + fclose(fid); + %fprintf(fid, 'for tmpind = 1:length(tmptxt), if isempty(tmptxt{tmpind}), disp('' ''); else disp(tmptxt{tmpind}); end; end; clear tmpind tmptxt;\n' ); +end; + +% try all functions +% ----------------- +tmppath = pwd; +cd(fold); +for index = 1:length(funct) + evalc([ 'help_' funct{index}(1:end-2) ]); +end; +cd(tmppath); +return; + +%------------------------------------- +function [doc] = readfunc(funct, nonmatlab) + +doc = {}; +if nonmatlab + fid = fopen( funct, 'r'); +else + if findstr( funct, '.m') + fid = fopen( funct, 'r'); + else + fid = fopen( [funct '.m'], 'r'); + end; +end; + +if fid == -1 + error('File not found'); +end; + +sub = 1; +try, + if ~isunix, sub = 0; end; +catch, end; + +if nonmatlab + str = fgets( fid ); + while ~feof(fid) + str = deblank(str(1:end-sub)); + doc = { doc{:} str(1:end) }; + str = fgets( fid ); + end; +else + str = fgets( fid ); + while (str(1) == '%') + str = deblank(str(1:end-sub)); + doc = { doc{:} str(2:end) }; + str = fgets( fid ); + end; +end; +fclose(fid); diff --git a/code/eeglab13_4_4b/functions/miscfunc/hist2.m b/code/eeglab13_4_4b/functions/miscfunc/hist2.m new file mode 100644 index 0000000..7d97c73 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/hist2.m @@ -0,0 +1,63 @@ +% hist2() - draw superimposed histograms +% +% Usage: +% >> hist2(data1, data2, bins); +% +% Inputs: +% data1 - data to plot first process +% data2 - data to plot second process +% +% Optional inputs: +% bins - vector of bin center +% +% Author: Arnaud Delorme (SCCN, UCSD) + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +% draw superimposed histograms +% --------------- +function hist2(data1, data2, bins); + +if nargin < 1 + help hist2; + return; +end; +if nargin < 3 + bins = linspace(min(min(data1), min(data2)), max(max(data1), max(data2)), 100); +elseif length(bins) == 1 + bins = linspace(min(min(data1), min(data2)), max(max(data1), max(data2)), bins); +end; + +hist(data1, bins); +hold on; hist(data2, bins); +%figure; hist( [ measure{:,5} ], 20); +%hold on; hist([ measure{:,2} ], 20); +c = get(gca, 'children'); +numfaces = size(get(c(1), 'Vertices'),1); +set(c(1), 'FaceVertexCData', repmat([1 0 0], [numfaces 1]), 'Cdatamapping', 'direct', 'facealpha', 0.5, 'edgecolor', 'none'); +numfaces = size(get(c(2), 'Vertices'),1); +set(c(2), 'FaceVertexCData', repmat([0 0 1], [numfaces 1]), 'Cdatamapping', 'direct', 'facealpha', 0.5, 'edgecolor', 'none'); +ylabel('Number of values'); +xlim([bins(1) bins(end)]); + +yl = ylim; +xl = xlim; +line([xl(1) xl(1)]+(xl(2)-xl(1))/2000, yl, 'color', 'k'); +line(xl, [yl(1) yl(1)]+(yl(2)-yl(1))/2000, 'color', 'k'); + + diff --git a/code/eeglab13_4_4b/functions/miscfunc/hungarian.m b/code/eeglab13_4_4b/functions/miscfunc/hungarian.m new file mode 100644 index 0000000..5713ff4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/hungarian.m @@ -0,0 +1,468 @@ +% hungarian() - Solve the assignment problem using the Hungarian method. +% +% Usage: >> [C,T]=hungarian(A) +% +% Inputs: +% A - a square (correlation/distance/cost) matrix. +% C - the optimal assignment (closest row/col pairs) +% T - the total (minimized) cost of the optimal assignment. +% +% Author: Niclas Borlin, 1996 + +% Adapted from the FORTRAN IV code in Carpaneto and Toth, "Algorithm 548: +% Solution of the assignment problem [H]", ACM Transactions on +% Mathematical Software, 6(1):104-111, 1980. +% +% v1.0 96-06-14. Niclas Borlin, niclas@cs.umu.se. +% Department of Computing Science, Umeå University, +% Sweden. +% +% NOTE: A substantial effort was put into this code. If you use it for a +% publication or otherwise, please include an acknowledgement and notify +% me by email. /Niclas + +function [C,T]=hungarian(A) + +[m,n]=size(A); + +if (m~=n) + error('HUNGARIAN: Cost matrix must be square!'); +end + +% Save original cost matrix. +orig=A; + +% Reduce matrix. +A=hminired(A); + +% Do an initial assignment. +[A,C,U]=hminiass(A); + +% Repeat while we have unassigned rows. +while (U(n+1)) + % Start with no path, no unchecked zeros, and no unexplored rows. + LR=zeros(1,n); + LC=zeros(1,n); + CH=zeros(1,n); + RH=[zeros(1,n) -1]; + + % No labelled columns. + SLC=[]; + + % Start path in first unassigned row. + r=U(n+1); + % Mark row with end-of-path label. + LR(r)=-1; + % Insert row first in labelled row set. + SLR=r; + + % Repeat until we manage to find an assignable zero. + while (1) + % If there are free zeros in row r + if (A(r,n+1)~=0) + % ...get column of first free zero. + l=-A(r,n+1); + + % If there are more free zeros in row r and row r in not + % yet marked as unexplored.. + if (A(r,l)~=0 & RH(r)==0) + % Insert row r first in unexplored list. + RH(r)=RH(n+1); + RH(n+1)=r; + + % Mark in which column the next unexplored zero in this row + % is. + CH(r)=-A(r,l); + end + else + % If all rows are explored.. + if (RH(n+1)<=0) + % Reduce matrix. + [A,CH,RH]=hmreduce(A,CH,RH,LC,LR,SLC,SLR); + end + + % Re-start with first unexplored row. + r=RH(n+1); + % Get column of next free zero in row r. + l=CH(r); + % Advance "column of next free zero". + CH(r)=-A(r,l); + % If this zero is last in the list.. + if (A(r,l)==0) + % ...remove row r from unexplored list. + RH(n+1)=RH(r); + RH(r)=0; + end + end + + % While the column l is labelled, i.e. in path. + while (LC(l)~=0) + % If row r is explored.. + if (RH(r)==0) + % If all rows are explored.. + if (RH(n+1)<=0) + % Reduce cost matrix. + [A,CH,RH]=hmreduce(A,CH,RH,LC,LR,SLC,SLR); + end + + % Re-start with first unexplored row. + r=RH(n+1); + end + + % Get column of next free zero in row r. + l=CH(r); + + % Advance "column of next free zero". + CH(r)=-A(r,l); + + % If this zero is last in list.. + if(A(r,l)==0) + % ...remove row r from unexplored list. + RH(n+1)=RH(r); + RH(r)=0; + end + end + + % If the column found is unassigned.. + if (C(l)==0) + % Flip all zeros along the path in LR,LC. + [A,C,U]=hmflip(A,C,LC,LR,U,l,r); + % ...and exit to continue with next unassigned row. + break; + else + % ...else add zero to path. + + % Label column l with row r. + LC(l)=r; + + % Add l to the set of labelled columns. + SLC=[SLC l]; + + % Continue with the row assigned to column l. + r=C(l); + + % Label row r with column l. + LR(r)=l; + + % Add r to the set of labelled rows. + SLR=[SLR r]; + end + end +end + +% Calculate the total cost. +T=sum(orig(logical(sparse(C,1:size(orig,2),1)))); + + +function A=hminired(A) +%HMINIRED Initial reduction of cost matrix for the Hungarian method. +% +%B=assredin(A) +%A - the unreduced cost matris. +%B - the reduced cost matrix with linked zeros in each row. + +% v1.0 96-06-13. Niclas Borlin, niclas@cs.umu.se. + +[m,n]=size(A); + +% Subtract column-minimum values from each column. +colMin=min(A); +A=A-colMin(ones(n,1),:); + +% Subtract row-minimum values from each row. +rowMin=min(A')'; +A=A-rowMin(:,ones(1,n)); + +% Get positions of all zeros. +[i,j]=find(A==0); + +% Extend A to give room for row zero list header column. +A(1,n+1)=0; +for k=1:n + % Get all column in this row. + cols=j(k==i)'; + % Insert pointers in matrix. + A(k,[n+1 cols])=[-cols 0]; +end + + +function [A,C,U]=hminiass(A) +%HMINIASS Initial assignment of the Hungarian method. +% +%[B,C,U]=hminiass(A) +%A - the reduced cost matrix. +%B - the reduced cost matrix, with assigned zeros removed from lists. +%C - a vector. C(J)=I means row I is assigned to column J, +% i.e. there is an assigned zero in position I,J. +%U - a vector with a linked list of unassigned rows. + +% v1.0 96-06-14. Niclas Borlin, niclas@cs.umu.se. + +[n,np1]=size(A); + +% Initalize return vectors. +C=zeros(1,n); +U=zeros(1,n+1); + +% Initialize last/next zero "pointers". +LZ=zeros(1,n); +NZ=zeros(1,n); + +for i=1:n + % Set j to first unassigned zero in row i. + lj=n+1; + j=-A(i,lj); + + % Repeat until we have no more zeros (j==0) or we find a zero + % in an unassigned column (c(j)==0). + + while (C(j)~=0) + % Advance lj and j in zero list. + lj=j; + j=-A(i,lj); + + % Stop if we hit end of list. + if (j==0) + break; + end + end + + if (j~=0) + % We found a zero in an unassigned column. + + % Assign row i to column j. + C(j)=i; + + % Remove A(i,j) from unassigned zero list. + A(i,lj)=A(i,j); + + % Update next/last unassigned zero pointers. + NZ(i)=-A(i,j); + LZ(i)=lj; + + % Indicate A(i,j) is an assigned zero. + A(i,j)=0; + else + % We found no zero in an unassigned column. + + % Check all zeros in this row. + + lj=n+1; + j=-A(i,lj); + + % Check all zeros in this row for a suitable zero in another row. + while (j~=0) + % Check the in the row assigned to this column. + r=C(j); + + % Pick up last/next pointers. + lm=LZ(r); + m=NZ(r); + + % Check all unchecked zeros in free list of this row. + while (m~=0) + % Stop if we find an unassigned column. + if (C(m)==0) + break; + end + + % Advance one step in list. + lm=m; + m=-A(r,lm); + end + + if (m==0) + % We failed on row r. Continue with next zero on row i. + lj=j; + j=-A(i,lj); + else + % We found a zero in an unassigned column. + + % Replace zero at (r,m) in unassigned list with zero at (r,j) + A(r,lm)=-j; + A(r,j)=A(r,m); + + % Update last/next pointers in row r. + NZ(r)=-A(r,m); + LZ(r)=j; + + % Mark A(r,m) as an assigned zero in the matrix . . . + A(r,m)=0; + + % ...and in the assignment vector. + C(m)=r; + + % Remove A(i,j) from unassigned list. + A(i,lj)=A(i,j); + + % Update last/next pointers in row r. + NZ(i)=-A(i,j); + LZ(i)=lj; + + % Mark A(r,m) as an assigned zero in the matrix . . . + A(i,j)=0; + + % ...and in the assignment vector. + C(j)=i; + + % Stop search. + break; + end + end + end +end + +% Create vector with list of unassigned rows. + +% Mark all rows have assignment. +r=zeros(1,n); +rows=C(C~=0); +r(rows)=rows; +empty=find(r==0); + +% Create vector with linked list of unassigned rows. +U=zeros(1,n+1); +U([n+1 empty])=[empty 0]; + + +function [A,C,U]=hmflip(A,C,LC,LR,U,l,r) +%HMFLIP Flip assignment state of all zeros along a path. +% +%[A,C,U]=hmflip(A,C,LC,LR,U,l,r) +%Input: +%A - the cost matrix. +%C - the assignment vector. +%LC - the column label vector. +%LR - the row label vector. +%U - the +%r,l - position of last zero in path. +%Output: +%A - updated cost matrix. +%C - updated assignment vector. +%U - updated unassigned row list vector. + +% v1.0 96-06-14. Niclas Borlin, niclas@cs.umu.se. + +n=size(A,1); + +while (1) + % Move assignment in column l to row r. + C(l)=r; + + % Find zero to be removed from zero list.. + + % Find zero before this. + m=find(A(r,:)==-l); + + % Link past this zero. + A(r,m)=A(r,l); + + A(r,l)=0; + + % If this was the first zero of the path.. + if (LR(r)<0) + % remove row from unassigned row list and return. + U(n+1)=U(r); + U(r)=0; + return; + else + + % Move back in this row along the path and get column of next zero. + l=LR(r); + + % Insert zero at (r,l) first in zero list. + A(r,l)=A(r,n+1); + A(r,n+1)=-l; + + % Continue back along the column to get row of next zero in path. + r=LC(l); + end +end + + +function [A,CH,RH]=hmreduce(A,CH,RH,LC,LR,SLC,SLR) +%HMREDUCE Reduce parts of cost matrix in the Hungerian method. +% +%[A,CH,RH]=hmreduce(A,CH,RH,LC,LR,SLC,SLR) +%Input: +%A - Cost matrix. +%CH - vector of column of 'next zeros' in each row. +%RH - vector with list of unexplored rows. +%LC - column labels. +%RC - row labels. +%SLC - set of column labels. +%SLR - set of row labels. +% +%Output: +%A - Reduced cost matrix. +%CH - Updated vector of 'next zeros' in each row. +%RH - Updated vector of unexplored rows. + +% v1.0 96-06-14. Niclas Borlin, niclas@cs.umu.se. + +n=size(A,1); + +% Find which rows are covered, i.e. unlabelled. +coveredRows=LR==0; + +% Find which columns are covered, i.e. labelled. +coveredCols=LC~=0; + +r=find(~coveredRows); +c=find(~coveredCols); + +% Get minimum of uncovered elements. +m=min(min(A(r,c))); + +% Subtract minimum from all uncovered elements. +A(r,c)=A(r,c)-m; + +% Check all uncovered columns.. +for j=c + % ...and uncovered rows in path order.. + for i=SLR + % If this is a (new) zero.. + if (A(i,j)==0) + % If the row is not in unexplored list.. + if (RH(i)==0) + % ...insert it first in unexplored list. + RH(i)=RH(n+1); + RH(n+1)=i; + % Mark this zero as "next free" in this row. + CH(i)=j; + end + % Find last unassigned zero on row I. + row=A(i,:); + colsInList=-row(row<0); + if (length(colsInList)==0) + % No zeros in the list. + l=n+1; + else + l=colsInList(row(colsInList)==0); + end + % Append this zero to end of list. + A(i,l)=-j; + end + end +end + +% Add minimum to all doubly covered elements. +r=find(coveredRows); +c=find(coveredCols); + +% Take care of the zeros we will remove. +[i,j]=find(A(r,c)<=0); + +i=r(i); +j=c(j); + +for k=1:length(i) + % Find zero before this in this row. + lj=find(A(i(k),:)==-j(k)); + % Link past it. + A(i(k),lj)=A(i(k),j(k)); + % Mark it as assigned. + A(i(k),j(k))=0; +end + +A(r,c)=A(r,c)+m; diff --git a/code/eeglab13_4_4b/functions/miscfunc/icademo.m b/code/eeglab13_4_4b/functions/miscfunc/icademo.m new file mode 100644 index 0000000..ed102eb --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/icademo.m @@ -0,0 +1,478 @@ +% icademo() - a sample ICA analysis script using the ICA/ERP package +% of Matlab functions distributed via +% http://www.sccn.ucsd.edu/eeglab +% +% Notes: +% Reads ascii ERP data file: pnas.adt +% Reads example ascii ERP data files: chan.nam chan14.locs (=chan_locs) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 5-18-97 +% +% See also: runica(), icavar(), icaproj(), icaact() + +% Copyright (C) 5-18-97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% This version tested on package version +% Added envproj(), used maxmap in compplot() 6-18-97 -sm +% Reworked to use actual sample ERP data 6-27-97 -sm +% Pruned again 7/18/97 -sm +% Adjusted envproj, plotproj, icaproj to remove datamean, distributing +% mean offset (if any) among component projections 7/23/97 -sm +% Fixed plotproj() call - it can't label arbitrry channel lists -sm +% Adjusted envproj etc. 12/08/97 -sm +% Added timtopo() 1-16-98 -sm +% Added more formatting, fixed compplot and eegmovie plotting 10-9-99 -sm +% 12-19-00 revised icaproj args -sm +% 01-05-01 advertised the web tutorial, fixed chanproj(), improved eegmovie() -sm +% 01-12-01 removed 'sphere' arg from plotproj(), icaact() -sm +% 01-25-02 reformated help & license, added links -ad + + chans = 14; % data channels (rows in data matrix) + frames = 312; % frames per data epoch (columns in data submatrix) + epochs = 2; % epochs in simulated data + srate = 312.5; % data sampling rate in Hz + limits = [0 995 0 0]; % epoch time limits in msec, y limits unspecified + off = [25 -25 0 0]; % successive figure offset in pixels + icadefs % run icadefs to see whether the user has changed the XXX reference. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Begin +% +fprintf('\n *************************************************************\n'); + fprintf(' * Demonstration script showing several ICA package analysis *\n') + fprintf(' * and plotting routines applied to sample lowpass ERP data *\n'); + fprintf(' * *\n'); + fprintf(' * Note: Use of these and other toolbox functions is now *\n'); + fprintf(' * documented in an online tutorial at: *\n'); + fprintf(' * http://www.cnl.salk.edu/~scott/tutorial/ *\n'); +fprintf(' *************************************************************\n\n'); + +v=version; +if v(1) < '5' + fprintf('Not all segments may work for Matlab version 4.\n') +end + +% add path to access +if ~exist('pnas.flt') + p = which('eeglab'); + p = p(1:findstr(p,'eeglab.m')-1); + addpath([ p 'sample_data' ] ); +end; + +% name of channel locations file +chan_locs = 'pnas_chan14.locs'; +chan_locs2 = 'pnas_chan.locs'; + + +figure +set(gcf,'Color',BACKCOLOR); +plot([-4 -4 4 4 -4],[-4.5 3 3 -4.5 -4.5],'w','Linewidth',3);hold on; +axis([-4 4 -5 5]); +t=text(0,2,'icademo()'); +set(t,'FontSize',14,'HorizontalAlignment','center'); +t=text(0,1,' Demonstration script showing several ICA toolbox '); +set(t,'FontSize',14,'HorizontalAlignment','center'); +t=text(0,0,'analysis and plotting routines'); +set(t,'FontSize',14,'HorizontalAlignment','center'); +t=text(0,-1,'applied to sample lowpass ERP data'); +set(t,'FontSize',14,'HorizontalAlignment','center'); +t=text(0,-2.5,'See http://www.cnl.salk.edu/~scott/tutorial/'); +set(t,'FontSize',14,'HorizontalAlignment','center'); +t=text(0,-3.5,'for more details.'); +set(t,'FontSize',14,'HorizontalAlignment','center'); +axis('off') + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Load an ascii ERP data matrix +% +fprintf('Loading sample data...\n'); + load pnas.adt -ascii +fprintf('Reshaping sample data...\n'); + data = [pnas(15:28,:) pnas(1:14,:)]; % lapses (will plot red), hits (blue) + clear pnas +% Scale to uV +data = data/24.2; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Lowpass filter (if available) +% +lowpass = 30; % filter band lowpass freq in Hz +if exist('firls') % if signal processing toolbox is installed . . . + fprintf('Lowpass filtering the data using eegfilt()...\n'); + % data = eegfilt(data,srate,lowpassHz,highpassHz,frames); + [data,filtwts] = eegfilt(data,srate,0,lowpass,frames); + % lowpass filter below 30 Hz +else % filter each epoch similarly + fprintf('Script eegfilt() requires the Matlab signal processing toolbox.\n'); +end +pos = get(gcf,'Position'); % record figure position to use as a base for later figures + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Overplot the 2 312-point data epochs at each channel using plotdata.m +% Assume that the epoch timebase is 0 to 995 msec. +% Read 4-character channel identifiers from the file 'chan.nam' +% Use the default color order. +% +fprintf('\nOverplotting the two sample auditory ERP target responses\n') +fprintf(' of %d chans by %d frames using plotdata()...\n\n', ... + size(data,1),size(data,2)); +figure('Position',pos+off/2); % #2a + +plotdata(data,frames,[0 995 -10 10],'ERP Data', chan_locs2 ,0,'(2 conditions)'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +fprintf('\nOverplotting the two sample auditory ERP target responses\n') +fprintf(' of %d chans by %d frames using plottopo()...\n\n', ... + size(data,1),size(data,2)); +% +figure('Position',pos+off); % #2b + +% plotttopo(data,chan_locs,frames,limits,title,axsize,colors) + +plottopo(data,chan_locs,frames,[0 995 -10 10],'ERP Data'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% run timtopo.m +% +fprintf('\nPlotting the Hit responses with topo maps at specified times ...\n') +figure('Position',pos+off*3/2); % #2c + +% timtopo(data,chan_locs,[limits],[plottimes]','title',[plotchans],[voffsets]); + +timtopo(data(:,1:frames),chan_locs,[0 995 -10 10],[250 320 390 500],'Target Hits'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% run eegplot.m +% +fprintf(... +'Plotting the same data as two consecutive 1-sec epochs using eegplot().\n'); +fprintf('Try using the on-screen and menu control elements...\n') + +% >> eegplot(data,srate,spacing,eloc_file,windowlength,title) + + %eegplotold(data,srate,0,chan_locs,1,'Two data epochs using eegplot()') + eegplot(data,'srate',srate, 'spacing', 0,'eloc_file',readlocs(chan_locs), ... + 'winlength',1,'title','Two data epochs using eegplot()') + %set(gcf,'Position',pos+2*off); % #3 - eegplot() makes its own figure + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +fprintf(... +'Plotting the same data as two consecutive 1-sec epochs using eegplotold()...\n'); +fprintf('Thus, eegplotold() can be used to embed plots in larger figures.\n') +% +% >> eegplot('noui',data,srate,spacing,eloc_file,startsec,color) +% +figure('Position',pos+2.5*off); +subplot(1,2,1) + %eegplot('noui',data(:,1:312),'srate',srate,'spacing', 0,'eloc_file', chan_locs, 'color', {{'b'}} ); + eegplotold('noui',data(:,1:312),srate,0,chan_locs,0,'b'); + title('Lapses') +subplot(1,2,2) + %eegplot('noui',data(:,1:313:624),'srate',srate,'spacing', 0,'eloc_file', chan_locs, 'color', {{'b'}} ); + eegplotold('noui',data(:,313:624),srate,0,chan_locs,0,'r'); + title('Hits') + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% run the ICA decomposition using runica.m +% +% Decompose the data using the ICA algorithm +% Specify the baseline vector to be sure that the baselines are zeroed. +% data = input data (size(data) = [chans,frames*epochs]) +% frames = number of data points in each data epoch +% basevector = data point vector to use in zeroing baseline +% +fprintf('Now decompose both epochs at once using the ICA algorithm, runica() ...\n\n'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +[weights,sphere,activations,bias,signs,lrates] = runica(data); + +fprintf('\nDone!\n'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Compute the activation waveforms for the resulting ICA components using icaact.m +% + datamean = mean(data')'; + activations = icaact(data,weights*sphere,datamean); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Reorder the first 10 components by increasing in-epoch latency to the +% point of maximum variance accounted for. Do not take into account +% channel 14 in the variance calculation; only use channels 1:13. +% +fprintf('Re-sorting the resulting components by LATENCY ') +fprintf(' using compsort() ...\n\n'); +fprintf('Note: runica() orders components by size - comport() not commonly needed!!\n') + +% [windex,maxvar,maxframe,maxepoch,maxmap] ... +% = compsort(data,weights,sphere,datamean, ... +% frames,nlargest,chanlist); + + [windex,maxvar,maxframe,maxepoch,maxmap] = ... + compsort(data,weights,sphere,1,... + frames,10,[1:13]); + +fprintf('\nDone!\n'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Plot the activation waveforms of all the components +% as reordered by compsort() +% Identify the components using the original component numbers. +% +fprintf('Plotting the component activation waveforms using plotdata()') +fprintf('using plotdata() ....\n\n'); +figure('Position',pos+3*off); + + plotdata(activations(windex,:),frames,limits,... + 'ICA Component Activations', ... + windex,0,'(2 conditions)'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Plot the contributions to the first epoch of data by the first reordered +% 10 ICA components. Superimpose their projections on the original data. +% +fprintf('Plotting contributions of the 1st 10 ICA components '); +fprintf('using plotproj()...\n\n'); +figure('Position',pos+4*off); + +% [projdata] = plotproj(data,weights,compnums, ... +% title,limits,chanlist,channames,colors); + [projdata] = plotproj(data(:,1:frames),weights*sphere,windex(1:10), ... + 'First epoch (comps. 1-10)',limits,[1:10], chan_locs2 ); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Plot the contributions to the first epoch of data by the 5 largest +% ICA components. Superimpose their projections on the original data. +% +fprintf('Plotting contributions of the 5 largest ICA components '); +fprintf('(windex order) using projtopo()...\n\n'); +figure('Position',pos+4*off); + +% >> [projdata] = projtopo(data,weights,[compnums],chan_locs,... +% 'title',[limits],colors,chans); + + [projdata] = projtopo(data(:,1:frames),weights*sphere,1:5,chan_locs,... + 'First epoch',limits); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Plot the envelopes of the data epoch 1 and the first 10 components +% +fprintf('Plotting the [min,max] "envelopes" of the data '); +fprintf('and largest 6 components using envproj().\n(Data envelope is in white).\n\n'); +figure('Position',pos+5*off); + +% >> [envdata] = envproj(data,weights,compnums, ... +% title,limits,chanlist,compnames,colors); + [envdata] = envproj(data(:,1:floor(0.6*frames)),weights*sphere,1:6, ... + 'Envelopes of data and largest 6 components (cond. 1)',... + [0 995*0.6 0 0]); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +fprintf('Now plotting envelopes PLUS scalp maps using envtopo().\n'); +figure('Position',pos+5.5*off); +% +% >> envtopo(data,weights,chan_locs,[limits],[compnums],... +% 'title',[plotchans],[voffsets]); + + envtopo(data(:,1:floor(0.6*frames)),weights*sphere,'chanlocs',readlocs(chan_locs),... + 'limits', [0 995*0.6],'compnums',[2 3 4 6],'title', 'Largest Components'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Plot a close-up of the decomposition of epoch 2, channel 2. +% Focus on the time interval 250 to 400 msec. +% + startframe = fix(0.250*srate)+1; % start 250 msec after epoch start + endframe = fix(0.400*srate); % end 400 msec after epoch start + +fprintf('Plotting contributions of the 1st 5 ICA components '); +fprintf('at Cz using chanproj().\nData is in white.\n\n'); +figure('Position',pos+6*off); + +% [chandata] = chanproj(projdata,chan,ncomps,framelist,limits,titl,clrs); + + [chandata] = chanproj(projdata,1,5,startframe:endframe,... + [0 995 0 0],'Epoch 1, channel Fz',0); +fprintf('\n Note that two components make up most of the response peak.\n'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Plot the scalp maps of the first four reordered components +% Read the electrode location file chan_locs +% +fprintf('Plotting 1st 4 ICA component scalp maps using compmap()...\n'); +figure('Position',pos+7*off); + +% compmap (winv,eloc_file,index,title,pagesize,labels,printflag) + compmap(maxmap,chan_locs,1:4,'Maps of 1st 4 ICA Components',... + [2 2],windex(1:4)); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Display the projected epoch-1 data for reordered ICA component windex(7) +% together with a scalp map at its point of max variance +% +fprintf('Plotting the scalp maps and 1st-epoch projection of\n'); +fprintf(' the button press component using compplot()...\n\n'); +figure('Position',pos+8*off); + +% compplot(data,plotframe,chan_file,xstart,srate,title); + + frame = maxframe(7); + projp3 = icaproj(data(:,frames+1:2*frames),weights*sphere,windex(7)); + + compplot(projp3,frame,chan_locs,0,srate,'ICA Button Press Component'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Make and display a brief movie of a small segment of the first data epoch +% +fprintf('Making a brief movie of an N200 portion of the 1st data epoch\n') +fprintf(' using eegmovie() & seemovie()...\n\n'); +figure('Position',pos+9*off); + +% [Movie,Colormap] = eegmovie(data,srate,elec_locs,title,movieframes,minmax); + +try, + [Movie,Colormap] = eegmovie(data(:,313:412),srate,chan_locs,... + 'Demo of eegmovie()',75:85,0); +% Display the movie slowly, then 5 times forward/back +% + seemovie(Movie,-5,Colormap); +catch, + disp('Problem generating movie'); +end; + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Run testica script using optimum parameters +% (nsources = ncomponents to separate) +% Sources are super-Gaussian +% +fprintf('Last, running testica() - a simulation script for estimating the accuracy\n') +fprintf(' of ICA separation for a given data size and source distribution ...\n\n'); + +fprintf('Perfect separation would produce an identity matrix.\n'); +fprintf('This is not possible here, since 14 sources are mixed into only 6 channels.\n'); +fprintf('The figure will show that the 6 largest sources are still recovered clearly ...\n'); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% + testica(chans,epochs*frames,14,-0.05,1.4); +else + [testresult] = testica(chans,epochs*frames,14,-0.05,1.4); +end; + +% model 14 sources with a wide range of sizes & positive kurtosis + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +set(gcf,'Position',pos+10*off); + +if ~exist('icademoauto') + fprintf('\n****> Hit any key to continue: '); pause; fprintf('\n\n'); %%% +end; +fprintf('\n *************************************************************\n'); +fprintf(' * For a tutorial on the toolbox: *\n'); +fprintf(' * *\n'); +fprintf(' * http://www.cnl.salk.edu/~scott/tutorial/ *\n'); +fprintf(' * *\n'); +fprintf(' * For an overview of available scripts >> help ica *\n'); +fprintf(' * For information about using ICA, see icafaq.html *\n'); +fprintf(' * For further details and examples, see icabib.html *\n'); +fprintf(' *************************************************************\n\n') + +return diff --git a/code/eeglab13_4_4b/functions/miscfunc/imagescloglog.m b/code/eeglab13_4_4b/functions/miscfunc/imagescloglog.m new file mode 100644 index 0000000..5d09fa8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/imagescloglog.m @@ -0,0 +1,116 @@ +% imagescloglog() - make an imagesc(0) plot with log y-axis and +% x-axis values +% +% Usage: >> imagescloglog(times,freqs,data); +% Usage: >> imagescloglog(times,freqs,data,clim,xticks,yticks,'key','val',...); +% +% Inputs: +% times = vector of x-axis values (LOG spaced) +% freqs = vector of y-axis values (LOG spaced) +% data = matrix of size (freqs,times) +% +% Optional inputs: +% clim = optional color limit +% xticks = graduation for x axis +% yticks = graduation for y axis +% ... = 'key', 'val' properties for figure +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 4/2003 + +% Copyright (C) 4/2003 Arnaud Delorme, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function imagescloglog(times,freqs,data,clim, xticks, yticks, varargin) + + if size(data,1) ~= length(freqs) + fprintf('logfreq(): data matrix must have %d rows!\n',length(freqs)); + return + end + if size(data,2) ~= length(times) + fprintf('logfreq(): data matrix must have %d columns!\n',length(times)); + return + end + if min(freqs)<= 0 + fprintf('logfreq(): frequencies must be > 0!\n'); + return + end + try, icadefs; catch, warning('Using MATLAB default colormap'); end + + steplog = log(times(2))-log(times(1)); % same for all points + realborders = [exp(log(times(1))-steplog/2) exp(log(times(end))+steplog/2)]; + newtimes = linspace(realborders(1), realborders(2), length(times)); + + % regressing 3 times + border = mean(newtimes(2:end)-newtimes(1:end-1))/2; % automatically added to the borders in imagesc + newtimes = linspace(realborders(1)+border, realborders(2)-border, length(times)); + border = mean(newtimes(2:end)-newtimes(1:end-1))/2; % automatically added to the borders in imagesc + newtimes = linspace(realborders(1)+border, realborders(2)-border, length(times)); + border = mean(newtimes(2:end)-newtimes(1:end-1))/2; % automatically added to the borders in imagesc + newtimes = linspace(realborders(1)+border, realborders(2)-border, length(times)); + + % problem with log images in Matlab: border are automatically added + % to account for half of the width of a line: but they are added as + % if the data was linear. The commands below compensate for this effect + + steplog = log(freqs(2))-log(freqs(1)); % same for all points + realborders = [exp(log(freqs(1))-steplog/2) exp(log(freqs(end))+steplog/2)]; + newfreqs = linspace(realborders(1), realborders(2), length(freqs)); + + % regressing 3 times + border = mean(newfreqs(2:end)-newfreqs(1:end-1))/2; % automatically added to the borders in imagesc + newfreqs = linspace(realborders(1)+border, realborders(2)-border, length(freqs)); + border = mean(newfreqs(2:end)-newfreqs(1:end-1))/2; % automatically added to the borders in imagesc + newfreqs = linspace(realborders(1)+border, realborders(2)-border, length(freqs)); + border = mean(newfreqs(2:end)-newfreqs(1:end-1))/2; % automatically added to the borders in imagesc + newfreqs = linspace(realborders(1)+border, realborders(2)-border, length(freqs)); + + if nargin == 4 & ~isempty(clim) + imagesc(newtimes,newfreqs,data,clim); + else + imagesc(newtimes,newfreqs,data); + end; + + set(gca, 'yscale', 'log', 'xscale', 'log'); + try colormap(DEFAULT_COLORMAP); catch, end; + + % puting ticks + % ------------ + if nargin >= 5 + divs = xticks; + else + divs = linspace(log(times(1)), log(times(end)), 10); + divs = ceil(exp(divs)); divs = unique_bc(divs); % ceil is critical here, round might misalign + % out-of border label with within border ticks + end; + set(gca, 'xtickmode', 'manual'); + set(gca, 'xtick', divs); + if nargin >= 6 + divs = yticks; + else + divs = linspace(log(freqs(1)), log(freqs(end)), 10); + divs = ceil(exp(divs)); divs = unique_bc(divs); % ceil is critical here, round might misalign + % out-of border label with within border ticks + end; + set(gca, 'ytickmode', 'manual'); + set(gca, 'ytick', divs); + + % additional properties + % --------------------- + set(gca, 'yminortick', 'off', 'xaxislocation', 'bottom', 'box', 'off', 'ticklength', [0.03 0], 'tickdir','out', 'color', 'none'); + if ~isempty(varargin) + set(gca, varargin{:}); + end; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/imagesclogy.m b/code/eeglab13_4_4b/functions/miscfunc/imagesclogy.m new file mode 100644 index 0000000..8ce9015 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/imagesclogy.m @@ -0,0 +1,92 @@ +% imagesclogy() - make an imagesc(0) plot with log y-axis values (ala semilogy()) +% +% Usage: >> imagesclogy(times,freqs,data); +% Usage: >> imagesclogy(times,freqs,data,clim,xticks,yticks,'key','val',...); +% +% Inputs: +% times = vector of x-axis values +% freqs = vector of y-axis values (LOG spaced) +% data = matrix of size (freqs,times) +% +% Optional inputs: +% clim = optional color limit +% xticks = graduation for x axis +% yticks = graduation for y axis +% ... = 'key', 'val' properties for figure +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 4/2003 + +% Copyright (C) 4/2003 Arnaud Delorme, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function imagesclogy(times,freqs,data,clim, xticks, yticks, varargin) + + if size(data,1) ~= length(freqs) + fprintf('imagesclogy(): data matrix must have %d rows!\n',length(freqs)); + return + end + if size(data,2) ~= length(times) + fprintf('imagesclogy(): data matrix must have %d columns!\n',length(times)); + return + end + if min(freqs)<= 0 + fprintf('imagesclogy(): frequencies must be > 0!\n'); + return + end + + % problem with log images in Matlab: border are automatically added + % to account for half of the width of a line: but they are added as + % if the data was linear. The commands below compensate for this effect + + steplog = log(freqs(2))-log(freqs(1)); % same for all points + realborders = [exp(log(freqs(1))-steplog/2) exp(log(freqs(end))+steplog/2)]; + newfreqs = linspace(realborders(1), realborders(2), length(freqs)); + + % regressing 3 times + border = mean(newfreqs(2:end)-newfreqs(1:end-1))/2; % automatically added to the borders in imagesc + newfreqs = linspace(realborders(1)+border, realborders(2)-border, length(freqs)); + border = mean(newfreqs(2:end)-newfreqs(1:end-1))/2; % automatically added to the borders in imagesc + newfreqs = linspace(realborders(1)+border, realborders(2)-border, length(freqs)); + border = mean(newfreqs(2:end)-newfreqs(1:end-1))/2; % automatically added to the borders in imagesc + newfreqs = linspace(realborders(1)+border, realborders(2)-border, length(freqs)); + + if nargin == 4 & ~isempty(clim) + imagesc(times,newfreqs,data,clim); + else + imagesc(times,newfreqs,data); + end; + set(gca, 'yscale', 'log'); + + % puting ticks + % ------------ + if nargin >= 5, set(gca, 'xtick', xticks); end; + if nargin >= 6 + divs = yticks; + else + divs = linspace(log(freqs(1)), log(freqs(end)), 10); + divs = ceil(exp(divs)); divs = unique_bc(divs); % ceil is critical here, round might misalign + % out-of border label with within border ticks + end; + set(gca, 'ytickmode', 'manual'); + set(gca, 'ytick', divs); + + % additional properties + % --------------------- + set(gca, 'yminortick', 'off', 'xaxislocation', 'bottom', 'box', 'off', 'ticklength', [0.03 0], 'tickdir','out', 'color', 'none'); + if ~isempty(varargin) + set(gca, varargin{:}); + end; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/iscellnumeric.m b/code/eeglab13_4_4b/functions/miscfunc/iscellnumeric.m new file mode 100644 index 0000000..724cb79 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/iscellnumeric.m @@ -0,0 +1,6 @@ +function b = iscellnumeric(C) +% Return 1 if all elements of cell array are numeric +% +% Tim Mullen, 2011, SCCN/INC, UCSD + +b = all(cellfun(@(x) isnumeric(x),C)); diff --git a/code/eeglab13_4_4b/functions/miscfunc/kmeans_st.m b/code/eeglab13_4_4b/functions/miscfunc/kmeans_st.m new file mode 100644 index 0000000..bc51ef4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/kmeans_st.m @@ -0,0 +1,243 @@ +% KMEANS: K-means clustering of n points into k clusters so that the +% within-cluster sum of squares is minimized. Based on Algorithm +% AS136, which seeks a local optimum such that no movement of a +% point from one cluster to another will reduced the within-cluster +% sum of squares. Tends to find spherical clusters. +% Not globally optimal against all partitions, which is an NP-complete +% problem; thus allows for multiple restarts. +% +% Usage: [centr,clst,sse] = kmeans(X,k,restarts) +% +% X = [n x p] data matrix. +% k = number of desired clusters. +% restarts = optional number of restarts, after finding a new minimum +% sse, needed to end search [default=0]. +% -------------------------------------------------------------------- +% centr = [k x p] matrix of cluster centroids. +% clst = [n x 1] vector of cluster memberships. +% sse = total within-cluster sum of squared deviations. +% + +% Hartigan,JA & MA Wong. 1979. Algorithm AS 136: A k-means clustering +% algorithm. Appl. Stat. 200:100-108. +% Milligan,G.W. & L. Sokol. 1980. A two-stage clustering algorithm with +% robustness recovery characteristics. Educational and Psychological +% Measurement 40:755-759. + +% RE Strauss, 8/26/98 +% 8/21/99 - changed misc statements for Matlab v5. +% 10/14/00 - use means() rather than mean() to update cluster centers; +% remove references to TRUE and FALSE. + +function [centr,clst,sse] = kmeans_st(X,k,restarts) + if (nargin<3) restarts = []; end; + + if (isempty(restarts)) + restarts = 0; + end; + + [n,p] = size(X); + if (k<1 | k>n) + error('KMEANS: k out of range 1-N'); + end; + + max_iter = 50; + highval = 10e8; + upgma_flag = 1; % Do UPGMA first time thru + + % Repeat optimization until have 'restart' attempts with no better solution + restart_iter = restarts + 1; + best_sse = highval; + + while (restart_iter > 0) + restart_iter = restart_iter - 1; + + c1 = zeros(n,1); + c2 = c1; + clst = c1; + nclst = zeros(k,1); + + % Estimate initial cluster centers via UPGMA the first time, and randomly + % thereafter. + + if (upgma_flag) % If UPGMA, + upgma_flag = 0; + dist = eucl(X); % All interpoint distances + topo = upgma(dist,[],0); % UPGMA dendrogram topology + + grp = [1:n]'; % Identify obs in each of k grps + for step = 1:(n-k) + t1 = topo(step,1); + t2 = topo(step,2); + t3 = topo(step,3); + indx = find(grp==t1); + grp(indx) = t3 * ones(length(indx),1); + indx = find(grp==t2); + grp(indx) = t3 * ones(length(indx),1); + end; + + grpid = uniquef(grp); % Unique group identifiers + centr = zeros(k,p); + for kk = 1:length(grpid); % Calculate group centroids + g = grpid(kk); + indx = find(grp == g); + Xk = X(indx,:); + if (size(Xk,1)>1) + centr(kk,:) = mean(Xk); + else + centr(kk,:) = Xk; + end; + end; + + else % Else if randomized, + rndprm = randperm(n); % Pull out random set of points + centr = X(rndprm(1:k),:); + end; + + % For each point i, find its two closest centers, c1(i) and c2(i), and + % assign it to c1(i) + + dist = zeros(n,k); + for kk = 1:k % Dists to centers of all clusters + dist(:,kk) = eucl(X,centr(kk,:)); + end; + [d,indx] = sort(dist'); % Sort points separately + + c1 = indx(1,:)'; + c2 = indx(2,:)'; + + % Update cluster centers to be the centroids of points contained within them + + for kk = 1:k + indx = find(c1==kk); + len_indx = length(indx); +% if (len_indx>1) +% centr(kk,:) = mean(X(indx,:)); +% else +% centr(kk,:) = X(indx,:); +% end; + centr(kk,:) = means(X(indx,:)); + nclst(kk) = len_indx; + end; + + % Initialize working matrices + + live = ones(k,1); + R1 = zeros(n,1); + R2 = zeros(k,1); + adj1 = nclst ./ (nclst+1); + adj2 = nclst ./ (nclst-1+eps); + update = n * ones(k,1); + + for i = 1:n % Adjusted dist from each pt to own cluster center + R1(i) = adj2(c1(i)) * eucl(X(i,:),centr(c1(i),:))^2; + end; + + % Iterate + + iter = 0; + while ((iter < max_iter) & (any(live))) + iter = iter+1; + + % Optimal-transfer stage + + i = 0; + while ((i1) % If point i is not sole member of L1, + R2 = adj1(L1) .* eucl(centr,X(i,:)).^2; % Dists from pt to cluster centers + + if (live(L1)) % If L1 is in live set, + R2(L1) = highval; % find min R2 over all clusters + [r2min,L2] = min(R2); + else % If L1 is not in live set, + indx = find(~live); % find min R2 over live clusters only + R2([L1;indx]) = highval * ones(length(indx)+1,1); + [r2min,L2] = min(R2); + end; + + if (r2min >= R1(i)) % No reallocation necessary + c2(i) = L2; + else % Else reallocate pt to new cluster + c1(i) = L2; + c2(i) = L1; + + for kk = [L1,L2] % Recalc cluster centers and sizes + indx = find(c1==kk); + len_indx = length(indx); + if (len_indx>1) + centr(kk,:) = mean(X(indx,:)); + else + centr(kk,:) = X(indx,:); + end; + nclst(kk) = len_indx; + end; + + adj1([L1,L2]) = nclst([L1,L2]) ./ (nclst([L1,L2])+1); + adj2([L1,L2]) = nclst([L1,L2]) ./ (nclst([L1,L2])-1+eps); + R1(i) = adj2(c1(i)) * eucl(X(i,:),centr(c1(i),:))^2; + + live([L1,L2]) = [1,1]; % Put into live set + update([L1,L2]) = [n,n]; % Reinitialize update counters + end; + end; % if nclst(L1)>1 + + indx = find(update<1); % Remove clusters from live set + if (~isempty(indx)) % that haven't been recently updated + live(indx) = zeros(length(indx),1); + end; + end; % while (i1) + R2 = adj1(L2) .* eucl(centr(L2,:),X(i,:)).^2; % Dists from pt to L2 center + if (R1>=R2) + temp = c1(i); % Switch L1 & L2 + c1(i) = c2(i); + c2(i) = temp; + + for kk = [L1,L2] % Recalc cluster centers and sizes + indx = find(c1==kk); + centr(kk,:) = mean(X(indx,:)); + nclst(kk) = length(indx); + end; + + adj1([L1,L2]) = nclst([L1,L2]) ./ (nclst([L1,L2])+1); + adj2([L1,L2]) = nclst([L1,L2]) ./ (nclst([L1,L2])-1+eps); + R1(i) = adj2(c1(i)) * eucl(X(i,:),centr(c1(i),:))^2; + + live([L1,L2]) = [1,1]; % Put into live set + update([L1,L2]) = [n,n]; % Reinitialize update counters + end; + end; + end; + end; % if any(live) + end; % while iter 0) + + clst = best_c1; + centr = best_centr; + sse = best_sse; + + return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/laplac2d.m b/code/eeglab13_4_4b/functions/miscfunc/laplac2d.m new file mode 100644 index 0000000..43417bd --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/laplac2d.m @@ -0,0 +1,79 @@ +% laplac2d() - generate a 2 dimensional gaussian matrice +% +% Usage : +% >> [ gaussmatrix ] = laplac2d( rows, columns, sigma, ... +% meanR, meanC, cut) +% +% Example : +% >> laplac2d( 5, 5) +% +% Inputs: +% rows - number of rows +% columns - number of columns +% sigma - standart deviation (default: rows/5) +% meanR - mean for rows (default: center of the row) +% meanC - mean for columns (default: center of the column) +% cut - percentage (0->1) of the maximum value for removing +% values in the matrix (default: 0) +% +% Note: this function implements a simple laplacian for exploratory +% research. For a more rigorous validated approach use the freely +% available Current Source Density Matlab toolbox. +% +% See also: eeg_laplac() +% +% Author: Arnaud Delorme, CNL, Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function mat = laplac2d( sizeX, sizeY, sigma, meanX, meanY, cut); + +if nargin < 2 + help laplac2d + return; +end; +if nargin < 3 + sigma = sizeX/5; +end; +if nargin < 4 + meanX = (sizeX+1)/2; +end; +if nargin < 5 + meanY = (sizeY+1)/2; +end; +if nargin < 6 + cut = 0; +end; + +X = linspace(1, sizeX, sizeX)'* ones(1,sizeY); +Y = ones(1,sizeX)' * linspace(1, sizeY, sizeY); +%[-sizeX/2:sizeX/2]'*ones(1,sizeX+1); +%Y = ones(1,sizeY+1)' *[-sizeY/2:sizeY/2]; + +r2 = (X-meanX).*(X-meanX) + (Y-meanY).*(Y-meanY); +sigma2 = sigma*sigma; + +mat = - exp(-0.5*r2/sigma2) .* ((r2 - sigma2)/(sigma2*sigma2)); +% zeros crossing at r = -/+ sigma; +% mat = r2; +if cut > 0 + maximun = max(max(mat))*cut; + I = find(mat < maximun); + mat(I) = 0; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/lapplot.m b/code/eeglab13_4_4b/functions/miscfunc/lapplot.m new file mode 100644 index 0000000..fb98d27 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/lapplot.m @@ -0,0 +1,137 @@ +% lapplot() - Compute the discrete laplacian of EEG scalp distribution(s) +% +% Usage: +% >> laplace = lapplot(map,eloc_file,draw) +% +% Inputs: +% map - Activity levels, size (nelectrodes,nmaps) +% eloc_file - Electrode location filename (.loc file) +% For format, see >> topoplot example +% draw - If defined, draw the map(s) {default: no} +% +% Output: +% laplace - Laplacian map, size (nelectrodes,nmaps) +% +% Note: uses del2() +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 1998 +% +% See also: topoplot(), gradplot() + +% Copyright (C) Scott Makeig, SCCN/INC/UCSD, La Jolla, 1998 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function [laplac] = lapplot(map,filename,draw) + +if nargin < 2 + help lapplot; + return; +end; + +MAXCHANS = size(map,1); +GRID_SCALE = 2*MAXCHANS+5; +MAX_RADIUS = 0.5; + +% --------------------- +% Read the channel file +% --------------------- +if isstr( filename ) + fid = fopen(filename); + locations = fscanf(fid,'%d %f %f %s',[7 MAXCHANS]); + fclose(fid); + locations = locations'; + Th = pi/180*locations(:,2); % convert degrees to rads + Rd = locations(:,3); + ii = find(Rd <= MAX_RADIUS); % interpolate on-scalp channels only + Th = Th(ii); + Rd = Rd(ii); + [x,y] = pol2cart(Th,Rd); +else + x = real(filename); + y = imag(filename); +end; + +% --------------------------------------------------- +% Locate nearest position of an electrode in the grid +% --------------------------------------------------- +xi = linspace(-0.5,0.5,GRID_SCALE); % x-axis description (row vector) +yi = linspace(-0.5,0.5,GRID_SCALE); % y-axis description (row vector) +for i=1:MAXCHANS + [useless_var horizidx(i)] = min(abs(y(i) - xi)); % find pointers to electrode + [useless_var vertidx(i)] = min(abs(x(i) - yi)); % positions in Zi +end; + +% ----------------- +% Compute laplacian +% ----------------- +for i=1:size(map,2) + [Xi,Yi,Zi] = griddata(y,x,map(:,i),yi',xi, 'v4'); % interpolate data + + laplac2D = del2(Zi); + positions = horizidx + (vertidx-1)*GRID_SCALE; + laplac(:,i) = laplac2D(positions(:)); + + % ------------------ + % Draw laplacian map + % ------------------ + if exist('draw'); + mask = (sqrt(Xi.^2+Yi.^2) <= MAX_RADIUS); + laplac2D(find(mask==0)) = NaN; + + subplot(ceil(sqrt(size(map,2))), ceil(sqrt(size(map,2))), i); + contour(laplac2D); + title( int2str(i) ); + +% %%% Draw Head %%%% +ax = axis; +width = ax(2)-ax(1); +axis([ax(1)-width/3 ax(2)+width/3 ax(3)-width/3 ax(4)+width/3]) +steps = 0:2*pi/100:2*pi; +basex = .18*MAX_RADIUS; +tip = MAX_RADIUS*1.15; +base = MAX_RADIUS-.004; +EarX = [.497 .510 .518 .5299 .5419 .54 .547 .532 .510 .489]; +EarY = [.0555 .0775 .0783 .0746 .0555 -.0055 -.0932 -.1313 -.1384 -.1199]; + +HCOLOR = 'k'; +HLINEWIDTH = 1.8; + +% Plot Head, Ears, Nose +hold on +plot(1+width/2+cos(steps).*MAX_RADIUS*width,... + 1+width/2+sin(steps).*MAX_RADIUS*width,... + 'color',HCOLOR,'Linestyle','-','LineWidth',HLINEWIDTH); % head + +plot(1+width/2+[.18*MAX_RADIUS*width;0;-.18*MAX_RADIUS*width],... + 1+width/2+[base;tip;base]*width,... + 'Color',HCOLOR,'LineWidth',HLINEWIDTH); % nose + +plot(1+width/2+EarX*width,... + 1+width/2+EarY*width,... + 'color',HCOLOR,'LineWidth',HLINEWIDTH) % l ear +plot(1+width/2-EarX*width,... + 1+width/2+EarY*width,... + 'color',HCOLOR,'LineWidth',HLINEWIDTH) % r ear + +hold off +axis off + + end; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/loadelec.m b/code/eeglab13_4_4b/functions/miscfunc/loadelec.m new file mode 100644 index 0000000..eb80228 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/loadelec.m @@ -0,0 +1,82 @@ +% loadelec() - Load electrode names file for eegplot() +% +% Usage: >> labelmatrix = loadelec('elec_file'); +% +% Author: Colin Humprhies, CNL / Salk Institute, 1996 +% +% See also: eegplot() + +% Copyright (C) Colin Humphries, CNL / Salk Institute, Aug, 1996 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function channames = loadelec(channamefile) + +MAXCHANS = 256; +chans = MAXCHANS; +errorcode = 0; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Read the channel names +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if channamefile ~= 0 & channamefile ~= '0' % read file of channel names + chid = fopen(channamefile,'r'); + if chid <3, + fprintf('cannot open file %s.\n',channamefile); + errorcode=2; + channamefile = 0; + else + fprintf('Channamefile %s opened\n',channamefile); + end; + if errorcode==0, + channames = fscanf(chid,'%s',[6 MAXCHANS]); + channames = channames'; + [r c] = size(channames); + for i=1:r + for j=1:c + if channames(i,j)=='.', + channames(i,j)=' '; + end; + end; + end; + % fprintf('%d channel names read from file.\n',r); + if (r>chans) + fprintf('Using first %d names.\n',chans); + channames = channames(1:chans,:); + end; + if (r> subset = loc_subsets(chanlocs, nchans); % select an evenly spaced nchans +% >> [subsets subidx pos] = loc_subsets(chanlocs, nchans, plotobj, plotchans, keepchans); +% +% Inputs: +% +% chanlocs - EEGLAB dataset channel locations structure (e.g., EEG.chanlocs) +% +% nchans - (1,N) matrix containing number of channels that should be in each +% of N channel subsets respectively. if total number of channels in +% all subsets is less than the number of EEG channels in the chanlocs +% structure, N+1 subsets are created. The last subset includes the +% remaining channels. +% +% Optional inputs: +% +% plotobj - (true|false|1|0) plot the time course of the objective function +% {default: false|0) +% plotchans - (true|false|1|0) make 3-D plots showing the channel locations of +% the subsets {default: false|0) +% keepchans - (cell array) channels that has to be kept in each set and +% not undergo optimization. You can use this option to make +% sure certain channels will be assigned to each set. For +% example, to keep channels 1:10 to the first subset and +% channels 20:30 to the second, use keepchans = {[1:10], [20:30]}. +% To only keeps channels 1:5 in the first set, use +% keepchans = {1:5}. {default: {}} +% +% Outputs: +% +% subsets - {1,N} or {1,N+1} cell array containing channel indices for each +% requested channel subset. +% subidx - (1, EEG.nbchans) vector giving the index of the subset associated +% with each channel. +% pos - (3,N) matrix, columns containing the cartesian (x,y,z) channel +% positions plotted. +% Example: +% +% % Create three sub-montages of a 256-channel montage containing 32, 60, and 100 +% % channels respectively.The 64 remaining channels will be put into a fourth subset. +% % Also visualize time course of optimization and the channel subset head locations. +% +% >> subset = loc_subsets(EEG.chanlocs, [32 60 100], true, true); +% +% Author: Nima Bigdely Shamlo, SCCN/INC/UCSD, 2007 + +% Copyright (C) 2007 Nima Bigdely Shamlo, SCCN/INC/UCSD, nima@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% if plotOptimization|plotSubsets in line 130 removed by nima 3/6/2007 +% line 133, removed num2str removed by nima 3/6/2007 + +function [subset idx pos] = loc_subsets(chanlocs, numberOfChannelsInSubset, plotOptimization, plotSubsets, mandatoryChannelsForSet); + +if sum(numberOfChannelsInSubset)> length(chanlocs) + error('Total channels in requested subsets larger than number of EEG channels.'); +end; +if min(numberOfChannelsInSubset) < 2 + error('Number of channels in the requested subsets must be >= 2.'); +end; + +rand('state',0); +if nargin < 5 + mandatoryChannelsForSet = {}; +end; + +if nargin < 4 + plotSubsets = false; +end; + +if nargin < 3 + plotOptimization = false; +end; + +pos=[cell2mat({chanlocs.X}); cell2mat({chanlocs.Y}); cell2mat({chanlocs.Z});]; +dist = squareform(pdist(pos')); + +nChans = length(chanlocs); +idx = ones(nChans,1); +setId = cell(1, length(numberOfChannelsInSubset)); % cell array containing channels in each set + +remainingChannels = 1:nChans; % channles that are to be assigned to subsets + +% channels that have to stay in their original subset (as in +% mandatoryChannelsForSet) and should not be re-assigned +allMandatoryChannels = cell2mat(mandatoryChannelsForSet); + +% assign requested mandatory channels to subset +for i=1:length(mandatoryChannelsForSet) + setId{i} = mandatoryChannelsForSet{i}; + remainingChannels(mandatoryChannelsForSet{i}) = NaN; % flag with Nan so they can be deleted later, this is to keep indexing simple +end; +remainingChannels(isnan(remainingChannels)) = []; + +r = remainingChannels(randperm(length(remainingChannels))); + +% randomly assign remaining channels to subsets +for i=1:length(numberOfChannelsInSubset) + numberOfChannelsTobeAddedToSubset = numberOfChannelsInSubset(i) - length(setId{i}) + setId{i} = [setId{i} r(1:numberOfChannelsTobeAddedToSubset)]; + r(1:numberOfChannelsTobeAddedToSubset) = []; +end; + +if length(r) > 0 + setId{length(numberOfChannelsInSubset) + 1} = r; % last set gets remaining channels +end; + +if plotOptimization|plotSubsets +fprintf(['Creating total of ' num2str(length(setId)) ' channel subsets:\n']); +end + +if plotOptimization + figure; + xp = floor(sqrt(length(setId))); + yp = ceil(length(setId)/xp); +end; + counter = 1; +exchangeHappened = true; + + +while exchangeHappened + exchangeHappened = false; + for set1 = 1:length(setId) + for set2 = (set1 + 1):length(setId) + for i = 1:length(setId{set1}) + for j = 1:length(setId{set2}) + chan(1) = setId{set1}(i); + chan(2) = setId{set2}(j); + if cost_of_exchanging_channels(chan,[set1 set2], setId, dist) < 0 & ~ismember(chan, allMandatoryChannels) + setId{set1}(find(setId{set1} == chan(1))) = chan(2); + setId{set2}(find(setId{set2} == chan(2))) = chan(1); + sumDistances(counter) = 0; + for s = 1:length(setId) + sumDistances(counter) = sumDistances(counter) ... + + (sum(sum(dist(setId{s},setId{s}))) / length(setId{s})); + end; + if plotOptimization + plot(1:counter,sumDistances,'-b'); + xlabel('number of exchanges'); + ylabel('sum mean distances within each channel subset'); + drawnow; + else + if mod(counter, 20) ==0 + fprintf('number of exchanges = %d\nsum of mean distances = %g\n',... + counter, sumDistances(counter)); + end; + end + counter = counter + 1; + exchangeHappened = true; + end; + end; + end; + end; + end; +end; + +for set = 1:length(setId) + idx(setId{set}) = set; +% legendTitle{set} = ['subset ' num2str(set)]; +end; + +subset = setId; + +if plotSubsets + FIG_OFFSET = 40; + fpos = get(gcf,'position'); + figure('position',[fpos(1)+FIG_OFFSET,fpos(2)-FIG_OFFSET,fpos(3),fpos(4)]); + scatter3(pos(1,:), pos(2,:), pos(3,:),100,idx,'fill'); + axis equal; + %legend(legendTitle); it does not work propr + th=title('Channel Subsets'); + %set(th,'fontsize',14) +end; + +if length(r)>0 & (plotOptimization|plotSubsets) + fprintf('The last subset returned contains the %d unused channels.\n',... + length(r)); +end + +function cost = cost_of_exchanging_channels(chan, betweenSets, setId, dist); + +mirrorChan(1) = 2; +mirrorChan(2) = 1; + +for i=1:2 + newSetId{betweenSets(i)} = setId{betweenSets(i)}; + newSetId{betweenSets(i)}(find(newSetId{betweenSets(i)} == chan(i))) = chan(mirrorChan(i)); +end; + +cost = 0; +for i=betweenSets + distSumBefore{i} = sum(sum(dist(setId{i},setId{i}))); + distSumAfter{i} = sum(sum(dist(newSetId{i},newSetId{i}))); + cost = cost + (distSumBefore{i} - distSumAfter{i}) / length(setId{i}); +end; + + +%cost = (distSumAfter{1} > distSumBefore{1}) && (distSumAfter{2} > distSumBefore{2}); + diff --git a/code/eeglab13_4_4b/functions/miscfunc/logimagesc.m b/code/eeglab13_4_4b/functions/miscfunc/logimagesc.m new file mode 100644 index 0000000..0f5f370 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/logimagesc.m @@ -0,0 +1,119 @@ +% logimagesc() - make an imagesc(0) plot with log y-axis values (ala semilogy()) +% +% Usage: >> [logfreqs,dataout] = logimagesc(times,freqs,data); +% +% Input: +% times = vector of x-axis values +% freqs = vector of y-axis values +% data = matrix of size (freqs,times) +% +% Optional Input: +% plot = ['on'|'off'] plot image or return output (default 'on'). +% +% Note: Entering text() onto the image requires specifying (x,log(y)). + +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 4/2000 + +% Copyright (C) 4/2000 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 08-07-00 made ydir normal -sm +% 01-25-02 reformated help & license -ad + +function [lgfreqs,datout, h, yt, yl] = logimagesc(times,freqs,data,varargin) + + if nargin < 1 + help logimagesc; + return + end; + if size(data,1) ~= length(freqs) + fprintf('logfreq(): data matrix must have %d rows!\n',length(freqs)); + datout = data; + return + end + if size(data,2) ~= length(times) + fprintf('logfreq(): data matrix must have %d columns!\n',length(times)); + datout = data; + return + end + if min(freqs)<= 0 + fprintf('logfreq(): frequencies must be > 0!\n'); + datout = data; + return + end + + try, icadefs; catch, warning('Using MATLAB default colormap'); end + + lfreqs = log(freqs); + lgfreqs = linspace(lfreqs(1),lfreqs(end),length(lfreqs)); + lgfreqs = lgfreqs(:); + lfreqs = lfreqs(:); + [mesht meshf] = meshgrid(times,lfreqs); + try + datout = griddata(mesht,meshf,double(data),times,lgfreqs); + catch + fprintf('error in logimagesc.m calling griddata.m, trying v4 method.'); + datout = griddata(mesht,meshf,data,times,lgfreqs,'v4'); + end + datout(find(isnan(datout(:)))) = 0; + + if ~isempty(varargin) + plot = varargin{2}; + else + plot = 'on'; + end + + if strcmp(plot, 'on') + imagesc(times,freqs,data); + try colormap(DEFAULT_COLORMAP); catch, end; + nt = ceil(min(freqs)); % new tick - round up min y to int + ht = floor(max(freqs)); % high freq - round down + + yt=get(gca,'ytick'); + yl=get(gca,'yticklabel'); + + h=imagesc(times,lgfreqs,datout); % plot the image + set(gca,'ydir','normal') + + i = 0; yt = []; + yl = cell(1,100); + + tickscale = 1.618; % log scaling power for frequency ticks + while (nt*tickscale^i < ht ) + yt = [yt log(round(nt*tickscale^i))]; + yl{i+1}=int2str(round(nt*tickscale^i)); + i=i+1; + end + + if ht/(nt*tickscale^(i-1)) > 1.35 + yt = [yt log(ht)]; + yl{i+1} = ht; + else + i=i-1; + end + yl = {yl{1:i+1}}; + set(gca,'ytick',yt); + set(gca,'yticklabel',yl); + +% if nt > min(yt), +% set(gca,'ytick',log([nt yt])); +% set(gca,'yticklabel',{int2str(nt) yl}); +% else +% set(gca,'ytick',log([yt])); +% set(gca,'yticklabel',{yl}); +% end + + end diff --git a/code/eeglab13_4_4b/functions/miscfunc/loglike.m b/code/eeglab13_4_4b/functions/miscfunc/loglike.m new file mode 100644 index 0000000..db4d0af --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/loglike.m @@ -0,0 +1,43 @@ +% loglike() - log likehood function to estimate dependence between components +% +% Usage: f = loglike(W, S); +% +% Computation of the log-likelihood function under the model +% that the ICs are 1/cosh(s) distributed (according to the tanh +% nonlinearity in ICA). It does not exactly match for the logistic +% nonlinearity, but should be a decent approximation +% +% negative log likelihood function +% f = -( log(abs(det(W))) - sum(sum(log( cosh(S) )))/N - M*log(pi) ); +% +% With these meanings: +% W: total unmixing matrix, ie, icaweights*icasphere +% S: 2-dim Matrix of source estimates +% N: number of time points +% M: number of components +% +% Author: Arnaud Delorme and Jorn Anemuller + +function f=loglike(W, S); + + W = double(W); + S = double(S); + % normalize activities + stds = std(S, [], 2); + S = S./repmat(stds, [1 size(S,2)]); + W = W./repmat(stds, [1 size(W,2)]); + + M = size(W,1); + if ndims(S) == 3 + S = reshape(S, size(S,1), size(S,3)*size(S,2)); + end; + N = size(S,2); + + % detect infinite and remove them + tmpcoh = log( cosh(S) ); + tmpinf = find(isinf(tmpcoh)); + tmpcoh(tmpinf) = []; + N = (N*M-length(tmpinf))/M; + + f=-( log(abs(det(W))) - sum(sum(tmpcoh))/N - M*log(pi) ); + diff --git a/code/eeglab13_4_4b/functions/miscfunc/logspec.m b/code/eeglab13_4_4b/functions/miscfunc/logspec.m new file mode 100644 index 0000000..2d98c8b --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/logspec.m @@ -0,0 +1,156 @@ +% logspec() - plot mean log power spectra of submitted data on loglog scale +% using plotdata() or plottopo() formats +% +% Usage: +% >> [spectra,freqs] = logspec(data,frames,srate); +% >> [spectra,freqs] = logspec(data,frames,srate,'title',... +% [loHz-hiHz],'chan_locs',rm_mean); +% Inputs: +% data = input data (chans,frames*epochs) +% frames = data samples per epoch {default length(data)} +% srate = data sampling rate in Hz {default 256 Hz}; +% 'title' = plot title {default: none} +% [loHz-hiHz] = [loHz hiHz] plotting limits +% {default: [srate/fftlength srate/2]} +% 'chan_locs' = channel location file (ala topoplot()) +% Else [rows cols] to plot data in a grid array +% rm_mean = [0/1] 1 -> remove log mean spectrum from all +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 11-07-97 +% +% See also: plotdata(), plottopo() + +% Copyright (C) 11-07-97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Changed plotdata() below to plottopo() 11/12/99 -sm +% Mentioned new grid array option 12/22/99 -sm +% 01-25-02 reformated help & license, added links -ad + +function [spectra,freqs] = logspec(data,frames,srate,titl,Hzlimits,chanlocs,rmmean) + +if nargin < 1 + help logspec + return +end +[rows,cols] = size(data); + +icadefs % read plotdata chan limit + +if rows > MAXPLOTDATACHANS + fprintf('logspec(): max plotdata() channels is %d.\n',MAXPLOTDATACHANS); + return +end +if rows < 2 + fprintf('logspec(): min plotdata() channels is %d.\n',2); + return +end +if nargin<7 + rmmean = 0; % default +end + +if nargin < 5 + Hzlimits = 0; +end + +if nargin < 4 + titl = ' '; +end + +if nargin < 3 + srate = 256; +end + +if nargin < 2, + frames = cols; +end + +epochs = fix(cols/frames); +if epochs*frames ~= cols + fprintf('logspec() - frames does not divide data length.\n'); + return +end + +fftlength = 2^floor(log(frames)/log(2)); + +spectra = zeros(rows,epochs*fftlength/2); +f2 = fftlength/2; +dB = 10/log(10); + +if length(Hzlimits) < 2 + Hzlimits = [srate/fftlength srate/2]; +end +if Hzlimits(2) <= Hzlimits(1) + help logspec + return +end + +for e=1:epochs + for r=1:rows, + [Pxx,freqs] = psd(data(r,(e-1)*frames+1:e*frames),fftlength,srate,... + fftlength,fftlength/4); + spectra(r,(e-1)*f2+1:e*f2) = Pxx(2:f2+1)'; % omit DC bin + end +end + +clf +freqs = freqs(2:f2+1); +fsi = find(freqs >= Hzlimits(1) & freqs <= Hzlimits(2)); +minf = freqs(fsi(1)); +maxf = freqs(fsi(length(fsi))); +nfs = length(fsi); + +showspec = zeros(rows,length(fsi)*epochs); +for e = 1:epochs + showspec(:,(e-1)*nfs+1:e*nfs) = dB*log(spectra(:,(e-1)*f2+fsi)); +end +% minspec = min(min(showspec)); +% showspec = showspec-minspec; % make minimum 0 dB + +showspec = blockave(showspec,nfs); + +% meanspec = mean(showspec); +% showspec = showspec - ones(rows,1)*meanspec; + +% >> plotdata(data,frames,limits,title,channames,colors,rtitle) +% diff = 0; +% MINUEND = 6; +% for r=1:rows +% diff = diff - MINUEND; +% showspec(r,:) = showspec(r<:)-diff; +% end +% semilogx(freqs(fsi),showspec'); +% ax = axis; +% axis([minf maxf ax(3) ax(4)]); +% title(titl); + +if nargin<6 +% >> plotdata(data,frames,limits,title,channames,colors,rtitle,ydir) + if rmmean + showspec = showspec - ones(rows,1)*mean(showspec); + end + plotdata(showspec,nfs,[minf maxf 0 0],titl); +else +% >> plottopo(data,'chan_locs',frames,limits,title,channels,axsize,colors,ydir) + if rmmean + showspec = showspec - ones(rows,1)*mean(showspec); + end + plottopo(showspec,chanlocs,nfs,[minf maxf 0 0],titl); +end +ax = get(gcf,'children'); +for a = ax + set(a,'XScale','log') +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/make_timewarp.m b/code/eeglab13_4_4b/functions/miscfunc/make_timewarp.m new file mode 100644 index 0000000..ac2b951 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/make_timewarp.m @@ -0,0 +1,199 @@ +% make_timewarp() - Select a subset of epochs containing a given event sequence, and return +% a matrix of latencies for time warping the selected epochs to a common +% timebase in newtimef(). Events in the given sequence may be further +% restricted to those with specified event field values. +% Usage: +% >> timeWarp = make_timewarp(EEG, eventSequence, 'key1',value1, +% 'key2',value2,...); +% +% Inputs: +% EEG - dataset structure +% eventSequence - cell array containing a sequence of event type strings. +% For example, to select epochs containing a 'movement Onset' +% event followed by a 'movement peak', use +% {'movement Onset' 'movement peak'} +% The output timeWarp matrix will contain the epoch latencies +% of the two events for each selected epoch. +% +% Optional inputs (in 'key', value format): +% 'baselineLatency' - (ms) the minimum acceptable epoch latency for the first +% event in the sequence {default: 0} +% 'eventConditions' - cell array specifying conditions on event fields. +% For example, for a sequence consisting of two +% events with (velocity) fields vx and vy, use +% {vx>0' 'vx>0 && vy<1'} +% To accept events unconditionally, use empty strings, +% for example {'vx>0','',''} {default: no conditions} +% 'maxSTDForAbsolute' - (positive number of std. devs.) Remove epochs containing events +% whose latencies are more than this number of standard deviations +% from the mean in the selected epochs. {default: Inf -> no removal} +% 'maxSTDForRelative' - (positive number of std. devs.) Remove epochs containing inter-event +% latency differences larger or smaller than this number of standard deviations +% from the mean in the selected epochs. {default: Inf -> no removal} +% Outputs: +% timeWarp - a structure with latencies (time-warp matrix with fields +% timeWarp.latencies - an (N, M) timewarp matrix for use in newtimef() +% where N = number of selected epochs containing the specified sequence, +% M = number of events in specified event sequence. +% timeWarp.epochs - a (1, M) vector giving the index of epochs with the +% specified sequence. Only these epochs should be passed to newtimef(). +% timeWarp.eventSequence - same as the 'eventSequence' input variable. +% Example: +% % Create a timewarp matrix for a sequence of events, first an event of type 'movement Onset' followed by +% % a 'movement peak' event, with event fields vx and vy: +% +% >> timeWarp = make_timewarp(EEG, {'movement Onset' 'movement% peak'},'baselineLatency', 0 ... +% ,'eventConditions', {'vx>0' 'vx>0 && vy<1'}); +% +% % To remove events with latencies more than 3 standard deviations from the mean OR 2 std. devs. +% % from the mean inter-event difference: +% +% >> timeWarp = make_timewarp(EEG, {'movement Onset' 'movement peak'},'baselineLatency', 0, ... +% 'eventConditions', {'vx>0' 'vx>0 && vy<1'},'maxSTDForAbsolute', 3,'maxSTDForRelative', 2); +% +% Author: Nima Bigdely Shamlo, SCCN/INC/UCSD, 2008 +% See also: show_events(), newtimef() + +function timeWarpStructure = make_timewarp(EEG, eventSequence, varargin) + +inputKeyValues = finputcheck(varargin, ... + {'baselineLatency' 'real' [] 0; ... + 'eventConditions' 'cell' {} {} ; ... + 'maxSTDForAbsolute' 'real' [0 Inf] Inf; ... + 'maxSTDForRelative' 'real' [0 Inf] Inf... + }); + +baselineLatency = []; +maxSTDForAbsolute = 0; +maxSTDForRelative = 0; +eventConditions = []; + +% place key values into function workspace variables +inputKeyValuesFields = fieldnames(inputKeyValues); +for i=1:length(inputKeyValuesFields) + eval([inputKeyValuesFields{i} '= inputKeyValues.' inputKeyValuesFields{i} ';']); +end; + + +if length(eventConditions) < length(eventSequence) + for i = (length(eventConditions)+1):length(eventSequence) + eventConditions{i} = ''; + end; +end; + +epochsIsAcceptable = ones(1, length(EEG.epoch)); +for epochNumber = 1:length(EEG.epoch) + eventNameID = 1; + minimumLatency = baselineLatency; + timeWarp{epochNumber} = []; + while eventNameID <= length(eventSequence) % go tthrought event names and find the event that comes after a certain event with correct type and higher latency + + firstLatency = eventsOfCertainTypeAfterCertainLatencyInEpoch(EEG.epoch(epochNumber), eventSequence{eventNameID}, minimumLatency, eventConditions{eventNameID}); + if isempty(firstLatency) % means there were no events, so the epoch is not acceptable + break; + else + timeWarp{epochNumber} = [timeWarp{epochNumber}; firstLatency]; + minimumLatency = firstLatency; + eventNameID = eventNameID + 1; + end; + end; + + if length(timeWarp{epochNumber}) < length(eventSequence) + epochsIsAcceptable(epochNumber) = false; + end; +end; + + +acceptableEpochs = find(epochsIsAcceptable); + +if isempty(acceptableEpochs) + timeWarp = {}; % no epoch meet the criteria +else + timeWarp = cell2mat(timeWarp(acceptableEpochs)); + + rejectedEpochesBasedOnLateny = union_bc(rejectEventsBasedOnAbsoluteLatency(timeWarp), rejectEventsBasedOnRelativeLatency(timeWarp)); + timeWarp(:,rejectedEpochesBasedOnLateny) = []; + acceptableEpochs(rejectedEpochesBasedOnLateny) = []; + +end; + +% since latencies and accepted epochs always have to be together, we put them in one structure +timeWarpStructure.latencies = timeWarp'; % make it suitable for newtimef() + +if isempty(timeWarpStructure.latencies) % when empty, it becomes a {} instead of [], so we change it to [] + timeWarpStructure.latencies = []; +end; + +timeWarpStructure.epochs = acceptableEpochs; +timeWarpStructure.eventSequence = eventSequence; + + function rejectedBasedOnLateny = rejectEventsBasedOnRelativeLatency(timeWarp) + % remeve epochs in which the time warped event is further than n + % standard deviations to mean of latency distance between events + timeWarpDiff = diff(timeWarp); + rejectedBasedOnLateny = []; + for eventNumber = 1:size(timeWarpDiff, 1) + rejectedBasedOnLateny = [rejectedBasedOnLateny find(abs(timeWarpDiff(eventNumber, :)- mean(timeWarpDiff(eventNumber, :))) > maxSTDForRelative * std(timeWarpDiff(eventNumber, :)))]; + end; + rejectedEpochesBasedOnLateny = unique_bc(rejectedBasedOnLateny); + end + + function rejectedBasedOnLateny = rejectEventsBasedOnAbsoluteLatency(timeWarp) + % remeve instances in which the time warped event is further than n + % standard deviations to mean + rejectedBasedOnLateny = []; + for eventNumber = 1:size(timeWarp, 1) + rejectedBasedOnLateny = [rejectedBasedOnLateny find(abs(timeWarp(eventNumber, :)- mean(timeWarp(eventNumber, :))) > maxSTDForAbsolute* std(timeWarp(eventNumber, :)))]; + end; + rejectedEpochesBasedOnLateny = unique_bc(rejectedBasedOnLateny); + end + + function [firstLatency resultEventNumbers] = eventsOfCertainTypeAfterCertainLatencyInEpoch(epoch, certainEventType, certainLatency, certainCondition) + resultEventNumbers = []; + firstLatency = []; % first event latency that meets the critria + for eventNumber = 1:length(epoch.eventtype) +% if strcmp(certainEventType, epoch.eventtype(eventNumber)) && epoch.eventlatency{eventNumber} >= certainLatency && eventMeetsCondition(epoch, eventNumber, certainCondition) + if eventIsOfType(epoch.eventtype(eventNumber), certainEventType) && epoch.eventlatency{eventNumber} >= certainLatency && eventMeetsCondition(epoch, eventNumber, certainCondition) + resultEventNumbers = [resultEventNumbers eventNumber]; + + if isempty(firstLatency) + firstLatency = epoch.eventlatency{eventNumber}; + end; + end; + end; + end + + function result = eventMeetsCondition(epoch, eventNumber, condition) + if strcmp(condition,'') || strcmp(condition,'true') + result = true; + else + + % get the name thatis before themfor field in the epoch, then remove 'event' name + epochField = fieldnames(epoch); + for i=1:length(epochField) + epochField{i} = strrep(epochField{i},'event',''); % remove event from the beginning of field names + condition = strrep(condition, epochField{i}, ['cell2mat(epoch.event' epochField{i} '(' num2str(eventNumber) '))' ]); + end; + + result = eval(condition); + end; + + end + + function result = eventIsOfType(eventStr, types) + % if events are numbers, turn them into strings before comparison + if ischar(types) + if iscell(eventStr) && isnumeric(cell2mat(eventStr)) + eventStr = num2str(cell2mat(eventStr)); + end; + + result = strcmp(eventStr, types); + else % it must be a cell of strs + result = false; + for i=1:length(types) + result = result || strcmp(eventStr, types{i}); + end; + end; + end + +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/makeelec.m b/code/eeglab13_4_4b/functions/miscfunc/makeelec.m new file mode 100644 index 0000000..255dce8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/makeelec.m @@ -0,0 +1,101 @@ +% makeelec() - subroutine to make electrode file in eegplot() +% +% Usage: >> makeelec(chans) +% >> [channames] = makeelec(chans) +% +% Inputs: +% chans - number of channels +% +% Author: Colin Humprhies, CNL / Salk Institute, 1996 +% +% See also: eegplot() + +% Copyright (C) Colin Humphries, CNL / Salk Institute, Aug, 1996 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function channames = makeelec(chans); + +global is_done_pressed +is_done_pressed = 0; + +lines = ceil(chans/2); + +fh = 180 + chans*12; +fl = 400; + +figure('Units','Pixels','Position',[400 200 fl fh]) + +fighandle = gcf; + +axes('Units','Pixels','Position',[0 0 fl fh],'Visible','off','Xlim',[0 fl],'Ylim',[0 fh]); + +text(fl/2,fh-20,'Make Electrode-File','HorizontalAlignment','Center','Fontsize',14) + +titleb = uicontrol('Units','Pixels','Style','Edit','Position',... + [fl/2 fh-60 .4*fl 20],'UserData',0,'HorizontalAlignment','left'); +text(fl/2-20,fh-50,'Filename:','HorizontalAlignment','Right') + +text(fl/2,fh-75,'Electrodes','HorizontalAlignment','center') +%line([fl*.2 fl*.8],[fh-85 fh-85],'color','w') + +for i = 1:chans + + k = 2*ceil(i/2); + + if (i==k) + ede(i,:) = uicontrol('Units','Pixels','Style','Edit',... +'Position',[fl*.65 fh-90-k*12 fl*.15 20],'UserData',i,'HorizontalAlignment','left'); + text(fl*.65-15,fh-90-k*12+10,num2str(i),'HorizontalAlignment','right') + else + ede(i,:) = uicontrol('Units','Pixels','Style','Edit',... +'Position',[fl*.2 fh-90-k*12 fl*.15 20],'UserData',i,'HorizontalAlignment','left'); + text(fl*.2-15,fh-90-k*12+10,num2str(i),'HorizontalAlignment','right') + end + +end + +TIMESTRING = ['chans1973 = get(gco,''UserData'');','OH1973 = findobj(''Style'',''edit'',''UserData'',0);','FILENAME1973 = get(OH1973,''string'');','if isempty(FILENAME1973);','fprintf(''Filename Missing'');','else;','channames1973 = zeros(chans1973,6);','for i1973 = 1:chans1973;','Aa1973 = findobj(''Style'',''edit'',''UserData'',i1973);','elabel1973 = get(Aa1973,''string'');','channames1973(i1973,6-length(elabel1973)+1:6) = elabel1973;','end;','for i1973 = 1:length(channames1973(:));','if channames1973(i1973) == 0;','channames1973(i1973) = ''.'';','end;','end;','FID1973 = fopen(FILENAME1973,''w'');','fprintf(FID1973,''%s'',channames1973'');','fclose(FID1973);','fprintf(''Saving file'');','end;','clear chans1973 OH1973 FILENAME1973 Aa1973 elabel1973 ii1973 FID1973 channames1973 i1973;']; +saveb = uicontrol('Units','Pixels','Style','PushButton','Position',[fl/10 20 fl*.15 25],'String','Save','UserData',chans,'Callback',TIMESTRING); + +TIMESTRING = ['global is_done_pressed;','is_done_pressed = 1;','clear is_done_pressed']; +closeb = uicontrol('Units','Pixels','Style','PushButton','Position',... + [fl*.45 20 fl*.15 25],'String','Done','Callback',TIMESTRING); + +TIMESTRING = ['global is_done_pressed;','is_done_pressed = 2;','clear is_done_pressed']; +cancelb = uicontrol('Units','Pixels','Style','PushButton','Position',... + [fl*.75 20 fl*.15 25],'String','Cancel','Callback',TIMESTRING); + +while(is_done_pressed == 0) + drawnow; +end + +if is_done_pressed == 1 + channames = []; + for i = 1:chans + a = findobj('Style','edit','UserData',i); + elabel = get(a,'string'); + channames = str2mat(channames,elabel); + end + channames = str2mat(channames,' '); +else + + channames = []; +end + +delete(fighandle) +clear is_done_pressed diff --git a/code/eeglab13_4_4b/functions/miscfunc/makehelpfiles.m b/code/eeglab13_4_4b/functions/miscfunc/makehelpfiles.m new file mode 100644 index 0000000..3c8d70e --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/makehelpfiles.m @@ -0,0 +1,90 @@ +% makehelpfiles() - generate function help pages +% +% Usage: +% >> makehelpfiles(list); +% +% Input: +% 'folder' - [string] folder name to process +% 'outputfile' - [string] file in which to write the help +% 'title' - [string] title for the help +% +% Author: Arnaud Delorme, UCSD, 2013 +% +% Example: Generate EEGLAB help menus for adminfunc folder +% makehelpfiles('folder', 'adminfunc' ,'title', 'Admin functions', 'outputfile','adminfunc/eeg_helpadmin.m' ); +% makehelpfiles('folder', 'guifunc' ,'title', 'Graphic interface builder functions', 'outputfile','adminfunc/eeg_helpgui.m' ); +% makehelpfiles('folder', 'miscfunc' ,'title', 'Miscelaneous functions not used by EEGLAB graphic interface', 'outputfile','adminfunc/eeg_helpmisc.m' ); +% makehelpfiles('folder', 'popfunc' ,'title', 'EEGLAB graphic interface functions', 'outputfile','adminfunc/eeg_helppop.m' ); +% makehelpfiles('folder', 'sigprocfunc' ,'title', 'EEGLAB signal processing functions', 'outputfile','adminfunc/eeg_helpsigproc.m' ); +% makehelpfiles('folder', 'statistics' ,'title', 'EEGLAB statistics functions', 'outputfile','adminfunc/eeg_helpstatistics.m' ); +% makehelpfiles('folder', 'studyfunc' ,'title', 'EEGLAB group processing (STUDY) functions', 'outputfile','adminfunc/eeg_helpstudy.m' ); +% makehelpfiles('folder', 'timefreqfunc','title', 'EEGLAB time-frequency functions', 'outputfile','adminfunc/eeg_helptimefreq.m' ); + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function makehelpfiles( varargin ); + +if nargin < 1 + help makehelpfiles; + return; +end; + +opt = finputcheck( varargin, { 'folder' 'string' { } ''; + 'outputfile' 'string' { } ''; + 'title' 'string' { } '' }, 'makehelpfiles'); +if isstr(opt), error(opt); end; +if isempty(opt.folder), error('You need to specify a folder'); end; +if isempty(opt.outputfile), error('You need to specify an output file'); end; + +fo = fopen( opt.outputfile, 'w'); +if ~isempty(opt.title) + fprintf(fo, '%%%s (%s folder):\n', opt.title, opt.folder); +else fprintf(fo, '%% *Content of %s folder:*\n', opt.folder); +end; +dirContent = dir(fullfile(opt.folder, '*.m')); +dirContent = { dirContent.name }; +for iFile = 1:length(dirContent) + fileName = dirContent{iFile}; + fidTmp = fopen(fullfile(opt.folder, fileName), 'r'); + firstLine = fgetl(fidTmp); + + % get help from the first line + if isempty(firstLine) || firstLine(1) ~= '%' + firstLine = fgetl(fidTmp); + end; + fclose(fidTmp); + + if isempty(firstLine) || firstLine(1) ~= '%' + firstLineText = 'No help information'; + else + indexMinus = find(firstLine == '-'); + if ~isempty(indexMinus) + firstLineText = deblank(firstLine(indexMinus(1)+1:end)); + else firstLineText = deblank(firstLine(2:end)); + end; + if isempty(firstLineText), firstLineText = 'No help information'; end; + if firstLineText(1) == ' ', firstLineText(1) = []; end; + if firstLineText(1) == ' ', firstLineText(1) = []; end; + if firstLineText(1) == ' ', firstLineText(1) = []; end; + firstLineText(1) = upper(firstLineText(1)); + if firstLineText(end) ~= '.', firstLineText = [ firstLineText '...' ]; end; + end; + + refFunction = sprintf('%s', fileName(1:end-2), fileName(1:end-2)); + fprintf(fo, '%% %-*s - %s\n', 50+length(fileName(1:end-2)), refFunction, firstLineText); +end; +fclose( fo ); diff --git a/code/eeglab13_4_4b/functions/miscfunc/makehtml.m b/code/eeglab13_4_4b/functions/miscfunc/makehtml.m new file mode 100644 index 0000000..9fb08c5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/makehtml.m @@ -0,0 +1,320 @@ +% makehtml() - generate .html function-index page and function help pages +% composed automatically from formatted Matlab function help messages +% +% Usage: +% >> makehtml(list, outputdir); +% >> makehtml(list, outputdir, 'key1', val1, 'key2', val2, ...); +% +% Input: +% list - (1) List (cell array) of filenames to convert. +% Ex: {'filename1' 'filename2' 'filename3'} +% By default, the filename extension .m is understood. +% (2) Cell array of filenames to convert and the text link +% on the summary page for them. +% {{'filename1' 'link1'} {'filename2' 'link2'}} ... +% Ex: 'link1' = 'Reject by kurtosis'. +% (3) Cell array of 2 or 3 cell array elements containing +% info to generate .html function-index and help pages. +% Ex: { {'directory1' 'heading1' 'dirindexfunc1'} ... +% {'directory2' 'heading2' 'dirindexfunc2'} } +% - 'directory': Function file directory name +% - 'heading': Index-file heading for the directory functions +% - 'dirindexfunc': A optional Matlab pop-up help function for +% referencing the directory functions {default: none} +% (4) To scan several directories under the same heading, use +% {{{'directory1' 'directory2'} 'heading1' 'dirindexfunc1' ... } +% outputdir - Directory for output .html help files +% +% Optional inputs: +% 'outputfile' - Output file name. {default: 'index.html'} +% 'header' - Command to insert in the header of all .html files (e.g., javascript +% declaration or meta-tag). {default: javascript 'openhelp()' +% function. See help2htm() code for details.} +% 'footer' - Command to insert at the end of all .html files (e.g., back +% button. {default: reference back to the function-index file} +% 'refcall' - Syntax format to call references. {default is +% 'javascript:openhelp(''%s.js'')'} Use '%s.html' for an .html link. +% 'font' - Font name (default: 'Helvetica') +% 'background' - Background HTML body section. Include "<" and ">". +% 'outputlink' - Help page calling command for the function index page. {default is +% 'javascript:openhelp(''%s.js'')'. Use '%s.html' to use a +% standard .html page link instead.} +% 'fontindex' - Font for the .html index file (default: 'Helvetica') +% 'backindex' - Background tag for the index file (c.f. 'background') +% 'mainheader' - Text file to insert at the beggining of the index page. Default is +% none. +% 'mainonly' - ['on'|'off'] 'on' -> Generate the index page only. +% {default: 'off' -> generate both the index and help pages} +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2002 +% +% Example: Generate EEGLAB help menus at SCCN: +% makehtml({ { 'adminfunc' 'Admin functions' 'adminfunc/eeg_helpadmin.m' } ... +% { 'popfunc', 'Interactive pop_functions' 'adminfunc/eeg_helppop.m' } ... +% { { 'toolbox', 'toolbox2' } 'Signal processing functions' 'adminfunc/eeg_helpsigproc.m' }}, ... +% '/home/www/eeglab/allfunctions', 'mainheader', '/data/common/matlab/indexfunchdr.txt'); +% +% See also: help2html2() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function makehtml( directorylist, outputdir, varargin ); + +if nargin < 2 + help makehtml; + return; +end; + +if outputdir(end) ~= '/', outputdir(end+1) = '/'; end; + +if ~isempty( varargin ) + g = struct( varargin{:} ); +else + g = []; +end; + +try, g.mainonly; catch, g.mainonly = 'off'; end; +try, g.mainheader; catch, g.mainheader = ''; end; +try, g.outputfile; catch, g.outputfile = 'index.html'; end; +try, g.fontindex; catch, g.fontindex = 'Helvetica'; end; +try, g.backindex; catch, g.backindex = ''; end; +try, g.header; catch, g.header = [ '' ]; end; +try, g.background; catch, g.background = ''; end; +%try, g.background; catch, g.background = ''; end; +try, g.refcall; catch, g.refcall = 'javascript:openhelp(''%s.html'')'; end; +try, g.font; catch, g.font = 'Helvetica'; end; +try, g.footer; catch, g.footer = 'Back to functions'; end; +try, g.outputlink; catch, g.outputlink = [ '%s%s' ]; end; + +% read header text file +% --------------------- +if ~isempty(g.mainheader) + doc = []; + fid = fopen(g.mainheader , 'r'); + if (fid == -1), error(['Can not open file ''' g.mainheader '''' ]); end; + str = fgets( fid ); + while ~feof(fid) + str = deblank(str(1:end-1)); + doc = [ doc str(1:end) ]; + str = fgets( fid ); + end; + g.backindex = [ g.backindex doc ]; +end; + +options = { 'footer', g.footer, 'background', g.background, ... + 'refcall', g.refcall, 'font', g.font, 'header', g.header, 'outputlink', g.outputlink}; +if strcmpi( g.mainonly, 'on') + options = { options{:}, 'outputonly', g.mainonly }; +end; + +% ------------------------------------------- +% scrips which generate a web page for eeglab +% ------------------------------------------- +STYLEHEADER = '

%s

\n'; +OPENWIN = [ '']; +ORIGIN = pwd; + +% determine mode +% -------------- +if iscell(directorylist{1}) & exist(directorylist{1}{1}) == 7 + fprintf('First cell array element is not a file\n'); + fprintf('Scanning directories...\n'); + mode = 'dir'; + % scan directories + % ---------------- + for index = 1:length( directorylist ) + direct{ index } = scandir( directorylist{index}{1} ); + end; +else + fprintf('First cell array element has been identified as a file\n'); + fprintf('Scanning all files...\n'); + mode = 'files'; +end; + +% remove . directory +% ------------------ +rmpath('.'); + +% write .html file +% ---------------- +fo = fopen([ outputdir g.outputfile], 'w'); +if fo == -1, error(['cannot open file ''' [ outputdir g.outputfile] '''']); end; + +fprintf(fo, '%s%s\n', OPENWIN, g.backindex, g.fontindex); + +if strcmp(mode, 'files') + makehelphtml( directorylist, fo, 'MAIN TITLE', STYLEHEADER, outputdir, mode, options, g.mainonly ); +else % direcotry + for index = 1:length( directorylist ) + makehelphtml( direct{ index }, fo, directorylist{index}{2}, STYLEHEADER, outputdir, mode, options, g.mainonly ); + end; +end; +fprintf( fo, ''); +fclose( fo ); +if isunix + chmodcom = sprintf('!chmod 777 %s*', outputdir); + eval(chmodcom); +end; + +% ------------------------------ +% Generate help files for EEGLAB +% ------------------------------ +if strcmp(mode, 'dir') + for index = 1:length( directorylist ) + if length(directorylist{index}) > 2 + makehelpmatlab( directorylist{index}{3}, direct{ index },directorylist{index}{2}); + end; + end; +end; +addpath('.'); + + +return; + +% scan directory list or directory +% -------------------------------- +function filelist = scandir( dirlist ) + filelist = {}; + if iscell( dirlist ) + for index = 1:length( dirlist ) + tmplist = scandir( dirlist{index} ); + filelist = { filelist{:} tmplist{:} }; + end; + else + if dirlist(end) ~= '/', dirlist(end+1) = '/'; end; + if exist(dirlist) ~= 7 + error([ dirlist ' is not a directory']); + end; + tmpdir = dir([dirlist '*.m']); + filelist = { tmpdir(:).name }; + end; + filelist = sort( filelist ); +return; + +% ------------------------------ Function to generate help for a bunch of files - +function makehelphtml( files, fo, title, STYLEHEADER, DEST, mode, options, mainonly); +% files = cell array of string containing file names or +% cell array of 2-strings cell array containing titles and filenames +% fo = output file +% title = title of the page or section + tmpdir = pwd; + if strcmp(mode, 'files') % processing subtitle and File + fprintf(fo, '
    ' ); + for index = 1:length(files) + if iscell(files{index}) + filename = files{index}{1}; + filelink = files{index}{2}; + else + filename = files{index}; + filelink = ''; + end; + fprintf('Processing (mode file) %s:%s\n', filename, filelink ); + if ~isempty(filename) + if ~exist(fullfile(DEST, [ filename(1:end-1) 'html' ])) + cd(DEST); + try, delete([ DEST filename ]); + catch, end; + help2html2( filename, [], 'outputtext', filelink, options{:}); cd(tmpdir); + + if strcmp(mainonly,'off') + inputfile = which( filename); + try, copyfile( inputfile, [ DEST filename ]); % asuming the file is in the path + catch, fprintf('Cannot copy file %s\n', inputfile); end; + end; + + indexdot = find(filename == '.'); + end; + if ~isempty(filelink) + com = [ space2html(filelink) ' -- ' space2html([ filename(1:indexdot(end)-1) '()'], ... + [ '' ], '
    ')]; + else + com = [ space2html([ filename(1:indexdot(end)-1) '()'], ... + [ '' ], '
    ')]; + end; + else + com = space2html(filelink, '', '
    '); + end; + fprintf( fo, '%s', com); + end; + fprintf(fo, '
' ); + else + fprintf(fo, STYLEHEADER, title, title ); + fprintf(fo, '' ); + for index = 1:length(files) + % Processing file only + if ~exist(fullfile(DEST, [ files{index}(1:end-1) 'html' ])) + fprintf('Processing %s\n', files{index}); + cd(DEST); com = help2html2( files{index}, [], options{:}); cd(tmpdir); + fprintf( fo, '%s', com); + if strcmp(mainonly,'off') + inputfile = which( files{index}); + try, copyfile( inputfile, [ DEST files{index} ]); % asuming the file is in the path + catch, fprintf('Cannot copy file %s\n', inputfile); end; + end; + else + fprintf('Skipping %s\n', files{index}); + cd(DEST); + com = help2html2( files{index}, [], options{:}, ... + 'outputonly','on'); + fprintf( fo, '%s', com); + cd(tmpdir); + end + end; + fprintf(fo, '
' ); + end; +return; + +% ------------------------------ Function to pop-out a Matlab help window -------- +function makehelpmatlab( filename, directory, titlewindow); + fo = fopen( filename, 'w'); + fprintf(fo, '%%%s() - Help file for EEGLAB\n\n', filename); + fprintf(fo, 'function noname();\n\n'); + fprintf(fo, 'command = { ...\n'); + for index = 1:length(directory) + fprintf(fo, '''pophelp(''''%s'''');'' ...\n', directory{index}); + end; + fprintf(fo, '};\n'); + fprintf(fo, 'text = { ...\n'); + for index = 1:length(directory) + fprintf(fo, '''%s'' ...\n', directory{index}); + end; + fprintf(fo, '};\n'); + fprintf(fo, ['textgui( text, command,' ... + '''fontsize'', 15, ''fontname'', ''times'', ''linesperpage'', 18, ', ... + '''title'',strvcat( ''%s'', ''(Click on blue text for help)''));\n'], titlewindow); + fprintf(fo, 'icadefs; set(gcf, ''COLOR'', BACKCOLOR);'); + fprintf(fo, 'h = findobj(''parent'', gcf, ''style'', ''slider'');'); + fprintf(fo, 'set(h, ''backgroundcolor'', GUIBACKCOLOR);'); + fprintf(fo, 'return;\n'); + fclose( fo ); +return + +% convert spaces for .html +function strout = space2html(strin, linkb, linke) + strout = []; + index = 1; + while strin(index) == ' ' + strout = [ strout '  ']; + index = index+1; + end; + if nargin == 3 + strout = [strout linkb strin(index:end) linke]; + else + strout = [strout strin(index:end)]; + end; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/mapcorr.m b/code/eeglab13_4_4b/functions/miscfunc/mapcorr.m new file mode 100644 index 0000000..7ff47af --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/mapcorr.m @@ -0,0 +1,224 @@ +% mapcorr() - Find matching rows in two matrices and their corrs. +% Uses the Hungarian (default), VAM, or maxcorr assignment methods. +% (Follow with matperm() to permute and sign x -> y). +% +% Finds correlation of maximum common subset of channels (using +% channel location files to match channel labels.) Thus, number +% of channels can differ in x and y. +% +% Usage: +% >> [corr,indx,indy,corrs] = matcorr(x,y,ch1,ch2); +% >> [corr,indx,indy,corrs] = matcorr(x,y,ch1,ch2,rmmean,method,weighting); +% +% Inputs: +% x = first input matrix. Row are difference components and columns +% the channels for these components. +% y = matrix with same number of columns (channels) as x +% ch1 = channel locations file for x +% ch2 = channel locations file for y +% +% Optional inputs: +% rmmean = When present and non-zero, remove row means prior to correlation +% {default: 0} +% method = Method used to find assignments. +% 0= Hungarian Method - maximize sum of abs corrs {default: 2} +% 1= Vogel's Assignment Method -find pairs in order of max contrast +% 2= Max Abs Corr Method - find pairs in order of max abs corr +% Note that the methods 0 and 1 require matrices to be square. +% weighting = An optional weighting matrix size(weighting) = size(corrs) that +% weights the corrs matrix before pair assignment {def: 0/[]->ones()} +% Outputs: +% corr = a column vector of correlation coefficients between +% best-correlating rows of matrice x and y +% indx = a column vector containing the index of the maximum +% abs-correlated x row in descending order of abs corr +% (no duplications) +% indy = a column vector containing the index of the maximum +% abs-correlated row of y in descending order of abs corr +% (no duplications) +% corrs = an optional square matrix of row-correlation coefficients +% between matrices x and y +% +% Note: outputs are sorted by abs(corr) +% +% Authors: Scott Makeig & Sigurd Enghoff, SCCN/INC/UCSD, La Jolla, 11-30-96 + +% Copyright (C) 11-30-96 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 2007/03/20 02:33:48 arno, Andreas fix +% 2003/09/04 23:21:06 scott, changed default matching method to Max Abs Corr +% 04-22-99 Re-written using VAM by Sigurd Enghoff, CNL/Salk +% 04-30-99 Added revision of algorthm loop by SE -sm +% 05-25-99 Added Hungarian method assignment by SE +% 06-15-99 Maximum correlation method reinstated by SE +% 08-02-99 Made order of outpus match help msg -sm +% 02-16-00 Fixed order of corr output under VAM added method explanations, +% and returned corr signs in abs max method -sm +% 01-25-02 reformated help & license, added links -ad + +% Uses function hungarian.m + +function [corr,indx,indy,corrs] = mapcorr(x,y,ch1,ch2,rmmean,method,weighting) +% +if nargin < 4 + help matcorr + return +end + +if nargin < 6 + method = 2; % default: Max Abs Corr - select successive best abs(corr) pairs +end + +[m,n] = size(x); +[p,q] = size(y); +m = min(m,p); + +if m~=n | p~=q + if nargin>5 & method~=2 + fprintf('matcorr(): Matrices are not square: using max abs corr method (2).\n'); + end + method = 2; % Can accept non-square matrices +end + + +if nargin < 5 | isempty(rmmean) + rmmean = 0; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if rmmean + x = x - mean(x')'*ones(1,n); % optionally remove means + y = y - mean(y')'*ones(1,n); +end + +for i = 1:m + for j = 1:p + corrs(i,j) = compcorr(x(i,:)',ch1,y(j,:)',ch2); + end +end + +%dx = sum(x'.^2); +%dy = sum(y'.^2); +%dx(find(dx==0)) = 1; +%dy(find(dy==0)) = 1; +%corrs = x*y'./sqrt(dx'*dy); + + + +if nargin > 6 & ~isempty(weighting) & norm(weighting) > 0, + if any(size(corrs) ~= size(weighting)) + fprintf('matcorr(): weighting matrix size must match that of corrs\n.') + return + else + corrs = corrs.*weighting; + end +end + +cc = abs(corrs); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +switch method +case 0 + ass = hungarian(-cc); % Performs Hungarian algorithm matching + + idx1 = sub2ind(size(cc),ass,1:m); + [dummy idx2] = sort(-cc(idx1)); + corr = corrs(idx1); + corr = corr(idx2)'; + indy = [1:m]'; + indx = ass(idx2)'; + indy = indy(idx2); + +case 1 % Implements the VAM assignment method + indx = zeros(m,1); + indy = zeros(m,1); + corr = zeros(m,1); + + for i=1:m, + [sx ix] = sort(cc); % Looks for maximum salience along a row/column + [sy iy] = sort(cc'); % rather than maximum correlation. + [sxx ixx] = max(sx(end,:)-sx(end-1,:)); + [syy iyy] = max(sy(end,:)-sy(end-1,:)); + + if sxx == syy + if sxx == 0 & syy == 0 + [sxx ixx] = max((sx(end,:)-sx(end-1,:)) .* sx(end,:)); + [syy iyy] = max((sy(end,:)-sy(end-1,:)) .* sy(end,:)); + else + sxx = sx(end,ixx); % takes care of identical vectors + syy = sy(end,iyy); % and zero vectors + end + end + + if sxx > syy + indx(i) = ix(end,ixx); + indy(i) = ixx; + else + indx(i) = iyy; + indy(i) = iy(end,iyy); + end + cc(indx(i),:) = -1; + cc(:,indy(i)) = -1; + end + + i = sub2ind(size(corrs),indx,indy); + corr = corrs(i); + + [tmp j] = sort(-abs(corr)); % re-sort by abs(correlation) + corr = corr(j); + indx = indx(j); + indy = indy(j); + +case 2 % match successive max(abs(corr)) pairs + indx = zeros(size(cc,1),1); + indy = zeros(size(cc,1),1); + corr = zeros(size(cc,1),1); + + for i = 1:size(cc,1) + [tmp j] = max(cc(:)); + % [corr(i) j] = max(cc(:)); + [indx(i) indy(i)] = ind2sub(size(cc),j); + corr(i) = corrs(indx(i),indy(i)); + cc(indx(i),:) = -1; % remove from contention + cc(:,indy(i)) = -1; + end + +otherwise + error('Unknown method'); +end + + +function corr = compcorr(a1,ch1,a2,ch2) + +n1 = length(a1); +n2 = length(a2); + +%if n1 < n2 + cnt = 0; + corr = 0; + for i = 1:n1 + for j = 1:n2 + if strcmp(ch1(i).labels,ch2(j).labels) + cnt = cnt+1; + b1(cnt,1) = a1(i); + b2(cnt,1) = a2(j); + end + end + end + b1 = b1 / norm(b1); + b2 = b2 / norm(b2); + corr = b1'*b2; diff --git a/code/eeglab13_4_4b/functions/miscfunc/matcorr.m b/code/eeglab13_4_4b/functions/miscfunc/matcorr.m new file mode 100644 index 0000000..43eb047 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/matcorr.m @@ -0,0 +1,185 @@ +% matcorr() - Find matching rows in two matrices and their corrs. +% Uses the Hungarian (default), VAM, or maxcorr assignment methods. +% (Follow with matperm() to permute and sign x -> y). +% +% Usage: >> [corr,indx,indy,corrs] = matcorr(x,y,rmmean,method,weighting); +% +% Inputs: +% x = first input matrix +% y = matrix with same number of columns as x +% +% Optional inputs: +% rmmean = When present and non-zero, remove row means prior to correlation +% {default: 0} +% method = Method used to find assignments. +% 0= Hungarian Method - maximize sum of abs corrs {default: 2} +% 1= Vogel's Assignment Method -find pairs in order of max contrast +% 2= Max Abs Corr Method - find pairs in order of max abs corr +% Note that the methods 0 and 1 require matrices to be square. +% weighting = An optional weighting matrix size(weighting) = size(corrs) that +% weights the corrs matrix before pair assignment {def: 0/[]->ones()} +% Outputs: +% corr = a column vector of correlation coefficients between +% best-correlating rows of matrice x and y +% indx = a column vector containing the index of the maximum +% abs-correlated x row in descending order of abs corr +% (no duplications) +% indy = a column vector containing the index of the maximum +% abs-correlated row of y in descending order of abs corr +% (no duplications) +% corrs = an optional square matrix of row-correlation coefficients +% between matrices x and y +% +% Note: outputs are sorted by abs(corr) +% +% Authors: Scott Makeig & Sigurd Enghoff, SCCN/INC/UCSD, La Jolla, 11-30-96 + +% Copyright (C) 11-30-96 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 04-22-99 Re-written using VAM by Sigurd Enghoff, CNL/Salk +% 04-30-99 Added revision of algorthm loop by SE -sm +% 05-25-99 Added Hungarian method assignment by SE +% 06-15-99 Maximum correlation method reinstated by SE +% 08-02-99 Made order of outpus match help msg -sm +% 02-16-00 Fixed order of corr output under VAM added method explanations, +% and returned corr signs in abs max method -sm +% 01-25-02 reformated help & license, added links -ad + +% Uses function hungarian.m + +function [corr,indx,indy,corrs] = matcorr(x,y,rmmean,method,weighting) +% +if nargin < 2 | nargin > 5 + help matcorr + return +end + +if nargin < 4 + method = 2; % default: Max Abs Corr - select successive best abs(corr) pairs +end + +[m,n] = size(x); +[p,q] = size(y); +m = min(m,p); + +if m~=n | p~=q + if nargin>3 & method~=2 + fprintf('matcorr(): Matrices are not square: using max abs corr method (2).\n'); + end + method = 2; % Can accept non-square matrices +end + +if n~=q + error('Rows in the two input matrices must be the same length.'); +end + +if nargin < 3 | isempty(rmmean) + rmmean = 0; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if rmmean + x = x - mean(x')'*ones(1,n); % optionally remove means + y = y - mean(y')'*ones(1,n); +end +dx = sum(x'.^2); +dy = sum(y'.^2); +dx(find(dx==0)) = 1; +dy(find(dy==0)) = 1; +corrs = x*y'./sqrt(dx'*dy); + +if nargin > 4 && ~isempty(weighting) && norm(weighting) > 0, + if any(size(corrs) ~= size(weighting)) + fprintf('matcorr(): weighting matrix size must match that of corrs\n.') + return + else + corrs = corrs.*weighting; + end +end + +cc = abs(corrs); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +switch method +case 0 + ass = hungarian(-cc); % Performs Hungarian algorithm matching + + idx1 = sub2ind(size(cc),ass,1:m); + [dummy idx2] = sort(-cc(idx1)); + corr = corrs(idx1); + corr = corr(idx2)'; + indy = [1:m]'; + indx = ass(idx2)'; + indy = indy(idx2); + +case 1 % Implements the VAM assignment method + indx = zeros(m,1); + indy = zeros(m,1); + corr = zeros(m,1); + + for i=1:m, + [sx ix] = sort(cc); % Looks for maximum salience along a row/column + [sy iy] = sort(cc'); % rather than maximum correlation. + [sxx ixx] = max(sx(end,:)-sx(end-1,:)); + [syy iyy] = max(sy(end,:)-sy(end-1,:)); + + if sxx == syy + if sxx == 0 & syy == 0 + [sxx ixx] = max((sx(end,:)-sx(end-1,:)) .* sx(end,:)); + [syy iyy] = max((sy(end,:)-sy(end-1,:)) .* sy(end,:)); + else + sxx = sx(end,ixx); % takes care of identical vectors + syy = sy(end,iyy); % and zero vectors + end + end + + if sxx > syy + indx(i) = ix(end,ixx); + indy(i) = ixx; + else + indx(i) = iyy; + indy(i) = iy(end,iyy); + end + cc(indx(i),:) = -1; + cc(:,indy(i)) = -1; + end + + i = sub2ind(size(corrs),indx,indy); + corr = corrs(i); + + [tmp j] = sort(-abs(corr)); % re-sort by abs(correlation) + corr = corr(j); + indx = indx(j); + indy = indy(j); + +case 2 % match successive max(abs(corr)) pairs + indx = zeros(size(cc,1),1); + indy = zeros(size(cc,1),1); + corr = zeros(size(cc,1),1); + + for i = 1:size(cc,1) + [tmp j] = max(cc(:)); + % [corr(i) j] = max(cc(:)); + [indx(i) indy(i)] = ind2sub(size(cc),j); + corr(i) = corrs(indx(i),indy(i)); + cc(indx(i),:) = -1; % remove from contention + cc(:,indy(i)) = -1; + end + +otherwise + error('Unknown method'); +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/matperm.m b/code/eeglab13_4_4b/functions/miscfunc/matperm.m new file mode 100644 index 0000000..124f229 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/matperm.m @@ -0,0 +1,89 @@ +% matperm() - transpose and sign rows of x to match y (run after matcorr() ) +% +% Usage: >> [permx indperm] = matperm(x,y,indx,indy,corr); +% +% Inputs: +% x = first input matrix +% y = matrix with same number of columns as x +% indx = column containing row indices for x (from matcorr()) +% indy = column containing row indices for y (from matcorr()) +% corr = column of correlations between indexed rows of x,y (from matcorr()) +% (used only for its signs, +/-) +% Outputs: +% permx = the matrix x permuted and signed according to (indx, indy,corr) +% to best match y. Rows of 0s added to x to match size of y if nec. +% indperm = permutation index turning x into y; +% +% Authors: Scott Makeig, Sigurd Enghoff & Tzyy-Ping Jung +% SCCN/INC/UCSD, La Jolla, 2000 + +% Copyright (C) 1996 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 04-22-99 Adjusted for fixes and speed by Sigurd Enghoff & Tzyy-Ping Jung +% 01-25-02 Reformated help & license, added links -ad + +function [permx,indperm]= matperm(x,y,indx,indy,corr) + +[m,n] = size(x); +[p,q] = size(y); +[ix,z] = size(indx); +[iy,z] = size(indy); +oldm = m; + +errcode=0; +if ix ~= iy | p ~= iy, + fprintf('matperm: indx and indy must be column vectors, same height as y.\n'); + errcode=1 +end; + +if n~=q, + fprintf('matperm(): two matrices must be same number of columns.\n'); + errcode=2; +else + if m=0)-1; + +return diff --git a/code/eeglab13_4_4b/functions/miscfunc/means.m b/code/eeglab13_4_4b/functions/miscfunc/means.m new file mode 100644 index 0000000..8b15052 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/means.m @@ -0,0 +1,68 @@ +% MEANS: Means, standard errors and variances. For column vectors, means(x) +% returns the mean value. For matrices or row vectors, means(x) is a +% row vector containing the mean value of each column. The basic +% difference from the Matlab functions mean() and var() is for a row vector, +% where means() returns the row vector instead of the mean value of the +% elements of the row. Also allows for missing data, passed as NaNs. +% +% If an optional grouping vector is supplied, returns a vector of means +% for each group in collating sequence. +% +% Usage: [M,stderr,V,grpids] = means(X,{grps}) +% +% X = [n x p] data matrix. +% grps = optional [n x 1] grouping vector for k groups. +% ----------------------------------------------------------------------- +% M = [k x p] matrix of group means. +% stderr = corresponding [k x 1] vector of standard errors of the means. +% V = corresponding vector of variances. +% grpids = corresponding vector of group identifiers, for multiple +% groups. +% + +% RE Strauss, 2/2/99 +% 12/26/99 - added standard errors. +% 10/19/00 - sort group-identifiers into collating sequence. +% 12/21/00 - corrected problem with uninitialized 'fg' for single group. +% 2/24/02 - added estimation of variances. +% 10/15/02 - corrected documentation. + +function [M,stderr,V,grpids] = means(X,grps) + if nargin == 0, help means; return; end; + + if (nargin < 2) grps = []; end; + + [n,p] = size(X); + + if (isempty(grps)) + grps = ones(n,1); + ug = 1; + fg = n; + k = 1; + else + [ug,fg] = uniquef(grps,1); + k = length(ug); + end; + + grpids = ug; + M = zeros(k,p); + stderr = zeros(k,p); + + for ik = 1:k + ir = find(grps==ug(ik)); + for c = 1:p + x = X(ir,c); + ic = find(isfinite(x)); + if (isempty(ic)) + M(ik,c) = NaN; + stderr(ik,c) = NaN; + else + M(ik,c) = mean(x(ic)); + s = std(x(ic)); + stderr(ik,c) = s./sqrt(fg(ik)); + V(ik,c) = s.^2; + end; + end; + end; + + return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/nan_std.m b/code/eeglab13_4_4b/functions/miscfunc/nan_std.m new file mode 100644 index 0000000..c56425c --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/nan_std.m @@ -0,0 +1,40 @@ +% nan_std() - std, not considering NaN values +% +% Usage: std across the first dimension + +% Author: Arnaud Delorme, CNL / Salk Institute, Sept 2003 + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function out = nan_std(in) + + if nargin < 1 + help nan_std; + return; + end; + + nans = find(isnan(in)); + in(nans) = 0; + + nonnans = ones(size(in)); + nonnans(nans) = 0; + nonnans = sum(nonnans); + nononnans = find(nonnans==0); + nonnans(nononnans) = NaN; + + out = sqrt((sum(in.^2)-sum(in).^2./nonnans)./(nonnans-1)); + out(nononnans) = NaN; diff --git a/code/eeglab13_4_4b/functions/miscfunc/numdim.m b/code/eeglab13_4_4b/functions/miscfunc/numdim.m new file mode 100644 index 0000000..379b156 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/numdim.m @@ -0,0 +1,63 @@ +% numdim() - estimate a lower bound on the (minimum) number of discrete sources +% in the data via their second-order statistics. +% Usage: +% >> num = numdim( data ); +% +% Inputs: +% data - 2-D data (nchannel x npoints) +% +% Outputs: +% num - number of sources (estimated from second order measures) +% +% References: +% WACKERMANN, J. 1996. Beyond mapping: estimating complexity +% of multichannel EEG recordings. Acta Neurobiologiae +% Experimentalis, 56, 197-208. +% WACKERMANN, J. 1999. Towards a quantitative characterization +% of functional states of the brain: from non-linear methodology +% to the global linear description. International Journal of +% Psychophysiology, 34, 65-80. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 23 January 2003 + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function lambda = numdim( a ) + + if nargin < 1 + help numdim; + return; + end; + +% Akaike, Identification toolbox (linear identification) + + a = a'; + b = a'*a/100; % correlation + [v d] = eig(b); + %det(d-b); % checking + + l = diag(d); + l = l/sum(l); + lambda = real(exp(-sum(l.*log(l)))); + + return; + + + % testing by duplicating columns + a = rand(100,5)*2-1; + a = [a a]; + numdim( a ) diff --git a/code/eeglab13_4_4b/functions/miscfunc/pcexpand.m b/code/eeglab13_4_4b/functions/miscfunc/pcexpand.m new file mode 100644 index 0000000..2756923 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/pcexpand.m @@ -0,0 +1,62 @@ +% pcexpand() - expand data using Principal Component Analysis (PCA) +% returns data expanded from a principal component subspace +% [compare pcsquash()] +% Usage: +% After >> [eigenvectors,eigenvalues,projections] = pcsquash(data,ncomps); +% then >> [expanded_data] = pcexpand(projections,eigenvectors,mean(data')); +% +% Inputs: +% projections = (comps,frames) each row is a component, each column a time point +% eigenvectors = square matrix of (column) eigenvectors +% datameans = vector of original data channel means +% +% Outputs: +% projections = data projected back into the original data space +% size (chans=eigenvector_rows,frames) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 2000 +% +% See also: pcsquash(), svd() + +% Copyright (C) 6-97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 4-15-98 debugged -sm & t-pj +% 01-25-02 reformated help & license, added links -ad + +function [expanded_data]=pcexpand(PCAproj,EigenVectors,Datameans) + +if nargin < 2 + help pcexpand + return; +end + +[ncomps,frames]=size(PCAproj); +[j,k]=size(EigenVectors); + +if j ~= k + error('Wrong array input size (eigenvectors matrix not square'); +end + +if j < ncomps + error('Wrong array input size (eigenvectors rows must be equal to projection matrix rows'); +end + +if size(Datameans,1) == 1, + Datameans = Datameans'; % make a column vector +end +expanded_data = EigenVectors(:,1:ncomps)*PCAproj; + Datameans*ones(1,frames); + diff --git a/code/eeglab13_4_4b/functions/miscfunc/pcsquash.m b/code/eeglab13_4_4b/functions/miscfunc/pcsquash.m new file mode 100644 index 0000000..fffa72a --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/pcsquash.m @@ -0,0 +1,81 @@ +% pcsquash() - compress data using Principal Component Analysis (PCA) +% into a principal component subspace. To project back +% into the original channel space, use pcexpand() +% +% Usage: +% >> [eigenvectors,eigenvalues] = pcsquash(data,ncomps); +% >> [eigenvectors,eigenvalues,compressed,datamean] ... +% = pcsquash(data,ncomps); +% +% Inputs: +% data = (chans,frames) each row is a channel, each column a time point +% ncomps = numbers of components to retain +% +% Outputs: +% eigenvectors = square matrix of (column) eigenvectors +% eigenvalues = vector of associated eigenvalues +% compressed = data compressed into space of the ncomps eigenvectors +% with largest eigenvalues (ncomps,frames) +% Note that >> compressed = eigenvectors(:,1:ncomps)'*data; +% datamean = input data channel (row) means (used internally) +% +% Author: Tzyy-Ping Jung & Scott Makeig, SCCN/INC/UCSD, La Jolla, 6-97 +% +% See also: pcexpand(), svd() + +% Copyright (C) 2000 Tzyy-Ping Jung & Scott Makeig, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function [EigenVectors,EigenValues,Compressed,Datamean]=pcsquash(matrix,ncomps) + +if nargin < 1 + help pcsquash + return +end +if nargin < 2 + ncomps = 0; +end +if ncomps == 0 + ncomps = size(matrix,1); +end +if ncomps < 1 + help pcsquash + return +end + +data = matrix'; % transpose data +[n,p]=size(data); % now p chans,n time points +if ncomps > p + fprintf('pcsquash(): components must be <= number of data rows (%d).\n',p); + return; +end + +Datamean = mean(data,1); % remove column (channel) means +data = data-ones(n,1)*Datamean; % remove column (channel) means +out=data'*data/n; +[V,D] = eig(out); % get eigenvectors/eigenvalues +diag(D); +[eigenval,index] = sort(diag(D)); +index=rot90(rot90(index)); +EigenValues=rot90(rot90(eigenval))'; +EigenVectors=V(:,index); + +if nargout >= 3 + Compressed = EigenVectors(:,1:ncomps)'*data'; +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/perminv.m b/code/eeglab13_4_4b/functions/miscfunc/perminv.m new file mode 100644 index 0000000..d267134 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/perminv.m @@ -0,0 +1,47 @@ +% perminv() - returns the inverse permutation vector +% +% Usage: >> [invvec] = perminverse(vector); +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 11-30-96 + +% Copyright (C) 11-30-96 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 4-4-97 shortened name to perminv() -sm +% 4-7-97 allowed row vector, added tests -sm +% 01-25-02 reformated help & license -ad + +function [invvec]=perminv(vector) + +[n,c] = size(vector); +if n>1 & c>1, + fprintf('perminv(): input must be a vector.\n'); + return +end +transpose=0; +if c>1 + vector = vector'; + transpose =1; +end + +invvec = zeros(size(vector)); +for i=1:length(vector) + invvec(vector(i)) = i; +end; + +if transpose==1, + invvec = invvec'; +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/plotproj.m b/code/eeglab13_4_4b/functions/miscfunc/plotproj.m new file mode 100644 index 0000000..f3aac1e --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/plotproj.m @@ -0,0 +1,177 @@ +% plotproj() - plot projections of one or more ICA components along with +% the original data (returns the data plotted) +% +% Usage: +% >> [projdata] = plotproj(data,weights,compnums); +% >> [projdata] = plotproj(data,weights,compnums, ... +% title,limits,chanlist,channames,colors); +% +% Inputs: +% data = single epoch of runica() input data (chans,frames) +% weights = unmixing matrix (=weights*sphere) +% compnums = vector of component numbers to project and plot +% +% Optional inputs: +% title = 'fairly short plot title' {0 -> 'plotproj()'} +% limits = [xmin xmax ymin ymax] (x's in msec) +% {0, or both y's 0 -> data limits} +% chanlist = list of data channels to plot {0 -> all} +% channames = channel location file or structure (see readlocs()) +% colors = file of color codes, 3 chars per line ('.' = space) +% {0 -> default color order (black/white first)} +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 05-01-96 +% +% See also: plotdata() + +% Without color arg, reads filename for PROJCOLORS from icadefs.m + +% Copyright (C) 05-01-96 from plotdata() Scott Makeig, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 05-25-96 added chanlist, nargin tests, rearranged variable order -sm +% 07-29-96 debugged, added chanlist channames option -sm +% 10-26-96 added test for column of compnums -sm +% 02-18-97 improved usage message -sm +% 02-19-97 merged versions -sm +% 03-19-97 changed var() to diag(cov()), use datamean arg instead of frames/baseframes -sm +% 04-24-97 tested datamean for 1-epoch; replaced cov() with mean-squares -sm +% 05-20-97 read icadefs for PROJCOLORS & MAXPLOTDATACHANS -sm +% 06-05-97 use arbitrary chanlist as default channames -sm +% 06-07-97 changed order of args to conform to runica -sm +% 06-12-97 made sumdata(chanlist in line 159 below -sm +% 07-23-97 removed datamean from args; let mean distribut4e over components -sm +% 09-09-97 corrected write out line " summing " -sm +% 10-31-97 removed errcode var -sm +% 11-05-97 added test for channames when chanlist ~= 1:length(chanlist) -sm & ch +% 12-19-00 adjusted new icaproj() args -sm +% 01-12-01 removed sphere arg -sm +% 01-25-02 reformated help & license, added links -ad + +function [projdata] = plotproj(data,weights,compnums,titl,limits,chanlist,channels,colors); + +icadefs % read default PROJCOLORS & MAXPLOTDATACHANS variables from icadefs.m +DEFAULT_TITLE = 'plotproj()'; + +% +% Substitute for missing arguments +% + +if nargin < 8, + colors = 'white1st.col'; +elseif colors==0, + colors = 'white1st.col'; +end + +if nargin < 7, + channels = 0; +end +if nargin < 6 + chanlist = 0; +end +if nargin < 5, + limits = 0; +end +if nargin < 4, + titl = 0; +end +if titl==0, + titl = DEFAULT_TITLE; +end + +if nargin < 3, + fprintf('plotproj(): must have at least four arguments.\n\n'); + help plotproj + return +end +% +% Test data size +% +[chans,framestot] = size(data); + +frames = framestot; % assume one epoch + +[wr,wc] = size(weights); + +if wc ~= chans + fprintf('plotproj(): sizes of weights and data incompatible.\n\n'); + return +end +% +% Substitute for 0 arguments +% +if chanlist == 0, + chanlist = [1:chans]; +end; +if compnums == 0, + compnums = [1:wr]; +end; +if size(compnums,1)>1, % handle column of compnums ! + compnums = compnums'; +end; +if length(compnums) > 256, + fprintf('plotproj(): cannot plot more than %d channels of data at once.\n',256); + return +end; + +if channels ~= 0 % if chan name file given + if ~all(chanlist == [1:length(chanlist)]) + fprintf('plotproj(): Cannot read an arbitrary chanlist of channel names.\n'); + return + end +end +if channels==0, + channels = chanlist; +end + +if max(compnums)>wr, + fprintf(... + '\n plotproj(): Component index (%d) > number of components (%d).\n', ... + max(compnums),wr); + return +end + +fprintf('Reconstructing (%d chan, %d frame) data summing %d components.\n', ... + chans,frames,length(compnums)); +% +% Compute projected data for single components +% +projdata = data(chanlist,:); +fprintf('plotproj(): Projecting component(s) '); +for s=compnums, % for each component + fprintf('%d ',s); + proj = icaproj(data,weights,s); % let offsets distribute + projdata = [projdata proj(chanlist,:)]; % append projected data onto projdata + % size(projdata) = [length(chanlist) framestot*(length(compnums)+1)] +end; +fprintf('\n'); +% +% Compute percentage of variance accounted for +% +sumdata = icaproj(data,weights,compnums);% let offsets distribute +sigmssq = mean(sum(data(chanlist,:).*data(chanlist,:))); + data(chanlist,:) = data(chanlist,:) - sumdata(chanlist,:); +difmssq = mean(sum(data(chanlist,:).*data(chanlist,:))); + +pvaf = round(100.0*(1.0-difmssq/sigmssq)); % percent variance accounted for + +rtitl = ['(p.v.a.f. ' int2str(pvaf) '%)']; +% +% Make the plot +% +plotdata(projdata,length(data),limits,titl,channels,colors,rtitl); + % make the plot diff --git a/code/eeglab13_4_4b/functions/miscfunc/promax.m b/code/eeglab13_4_4b/functions/miscfunc/promax.m new file mode 100644 index 0000000..65bea37 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/promax.m @@ -0,0 +1,155 @@ +% promax() - perform Promax oblique rotation after orthogonal Varimax +% rotation of the rows of the input data. A method for +% linear decomposition by "rotating to simple structure." +% Usage: +% >> [R] = promax(data,ncomps); +% >> [R,V] = promax(data,ncomps,maxit); +% +% Inputs: +% data - Promax operates on rows of the input data matrix +% ncomps - operate on the N largest PCA components (default|0 -> all) +% maxit - maximum number of iterations {default|0 -> 5} +% +% Outputs: +% R - is the non-orthogonal Promax rotation matrix +% i.e., >> promax_rotated_data = R*data; +% V - is the orthogonal Varimax rotation matrix +% i.e., >> varimax_rotated_data = V*data; +% +% Author: Colin Humphries, CNL / Salk Institute, 1998 +% +% See also: runica() + +% Copyright (C) Colin Humphries, CNL / Salk Institute, June 1998 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% formatted and modified to return V by Scott Makeig, 6/23/98 +% reset maxit default to 5, added ncomps -sm 7/8/98 +% 01-25-02 reformated help & license, added links -ad +% +% Reference: +% +% Hendrickson AE and White PO (1964) Promax: A quick method for rotation +% to oblique simple structure, Br J of Stat Psych, X:xxx-xxx. + +function [R,V] = promax(data,ncomps,maxit) + +v = version; +indp = find(v == '.'); +v = str2num(v(1:indp(2)-1)); +if v >= 8.1 + disp('Note: for some unknown reason, this function does not return') + disp(' NaN for a singular matrix under Matlab 2013a and later versions.') + disp(' Promax on other matrices seems to as in previous revisions though.'); +end; + +DEFAULT_POWER = 4; +DEFAULT_TOLERANCE = 1e-5; +MAX_ITERATIONS = 5; +NEAR_ZERO = 1e-8; + +powr = DEFAULT_POWER; +tol = DEFAULT_TOLERANCE; + +if nargin < 1 + help promax + return +end +if isempty(data) + help promax + return +end + +if nargin < 2 + ncomps = 0; +end +chans = size(data,1) +if ncomps == 0 + ncomps = chans +end +if ncomps > chans + error(sprintf('promax(): components must be <= number of data rows (%d).\n',chans)); +end +if nargin < 3 + maxit = 0; +end +if maxit == 0 + maxit = MAX_ITERATIONS; +end + +if ncomps < chans + [eigenvectors,eigenvalues,compressed,datamean] = pcsquash(data,ncomps); + data = compressed; + clear compressed; + eigenvectors = eigenvectors(:,1:ncomps); % make non-square + eigenwts = pinv(eigenvectors); % find forward (non-square) weight matrix +end + +R = varimax(data); % run Varimax on the (projected) data +B = R*data; % compute rotated data +V = R; % save Varimax matrix as V +if ncomps < chans + V = V*eigenwts; % include PCA reduction matrix +end +B = B'; % transpose +R = R'; +cont = 1; +fprintf(... + 'Finding oblique Promax rotation using exponent %g and tolerance %g\n',... + powr,tol) +it = 1; +Pz = zeros(size(B)); +while cont & it <= maxit + P = Pz; + ii = find(abs(B) > NEAR_ZERO); % avoid division by 0 + P(ii) = (abs(B(ii).^(powr+1)))./B(ii); + tmp = inv(B'*B)*B'*P; + tmp = normalcol(tmp); + Rn = R*tmp; + B = B*tmp; + distnew = dot(Rn(:),R(:)); + if it > 1 + delta = abs(distnew-distold); + if delta < tol + cont = 0; + end + fprintf('#%d delta %f\n',it,delta) + if isnan(delta) + cont = 0; + end + end + R = Rn; + distold = distnew; + it = it+1; +end +B = B'; +R = R'; +if ncomps < chans + R = R*eigenwts; % include the pcsquash() compression +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function n=normalcol(m) + +if isempty(m) + fprintf('normalcol() has empty input!\n'); + return +end +[mr,mc] = size(m); +n = sqrt(ones./sum(m.*m)); +n = ones(mr,1)*n; +n = n.*m; diff --git a/code/eeglab13_4_4b/functions/miscfunc/qrtimax.m b/code/eeglab13_4_4b/functions/miscfunc/qrtimax.m new file mode 100644 index 0000000..d3c5f8c --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/qrtimax.m @@ -0,0 +1,185 @@ +% qrtimax() - perform Quartimax rotation of rows of a data matrix. +% +% Usage: >> [Q,B] = qrtimax(data); +% >> [Q,B] = qrtimax(data,tol,'[no]reorder'); +% +% Inputs: +% data - input matrix +% tol - the termination tolerance {default: 1e-4} +% noreorder - rotate without negation/reordering +% +% Outputs: +% B - B=Q*A the Quartimax rotation of A +% Q - the orthogonal rotation matrix +% +% Author: Sigurd Enghoff, CNL / Salk Institute, 6/18/98 + +% Copyright (C) Sigurd Enghoff - CNL / Salk Institute, La Jolla 6/18/98 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Reference: Jack O. Nehaus and Charles Wrigley (1954) +% The Quartimax Method: an analytic approach to orthogonal +% simple structure, Br J Stat Psychol, 7:81-91. + +% 01-25-02 reformated help & license -ad + +function [Q,B] = qrtimax(A,tol,reorder) + +if nargin < 1 + help qrtimax + return +end + +DEFAULT_TOL = 1e-4; +MAX_ITERATIONS = 50; + +if nargin < 3 + reorder = 1; +elseif isempty(reorder) | reorder == 0 + reorder = 1; % set default +else + reorder = strcmp('reorder',reorder); +end + +if nargin < 2 + eps1 = DEFAULT_TOL; + eps2 = DEFAULT_TOL; +else + eps1 = tol; + eps2 = tol; +end + +% Do unto 'Q' what is done to A + +Q = eye(size(A,1)); + +% Compute the cross-products of the rows of the squared loadings, +% i.e. the cost function. +% +% --- --- +% \ \ 2 2 +% / / f f +% --- --- ij ik +% i j eps1 * abs(fden) + iflip = 1; + angl = atan2(fnum, fden); + +% Set angle of rotation according to Table I + + if fnum > 0 + if fden > 0 + angl = .25 * angl; + else + angl = .25 * (pi - angl); + end + else + if fden > 0 + angl = .25 * (2 * pi - angl); + else + angl = .25 * (pi + angl); + end + end + +% Perform rotation + + tmp = cos(angl) * Q(j,:) + sin(angl) * Q(k,:); + Q(k,:) = -sin(angl) * Q(j,:) + cos(angl) * Q(k,:); + Q(j,:) = tmp; + + tmp = cos(angl) * A(j,:) + sin(angl) * A(k,:); + A(k,:) = -sin(angl) * A(j,:) + cos(angl) * A(k,:); + A(j,:) = tmp; + end + end + end + +% Compute cost function. + + B = tril((A.^2)*(A.^2)'); + crit = [sum(sum(B)) - trace(B) , crit(1)]; + + inoim = inoim + 1; + ict = ict + 1; + + fprintf('#%d - crit = %g\n',ict,(crit(1)-crit(2))/crit(1)); + +% Check relative change of cost function (termination criterion). + + if (crit(1) - crit(2)) / crit(1) > eps2 + inoim = 0; + end +end + +% Reorder and negate if required. Determine new row order based on +% row norms and reorder accordingly. Negate those rows in which the +% accumulated sum is negative. + +if reorder + fprintf('Reordering rows...'); + [fnorm index] = sort(sum(A'.^2)); + Q = Q .* ((2 * (sum(A') > 0) - 1)' * ones(1, size(Q,2))); + A = A .* ((2 * (sum(A') > 0) - 1)' * ones(1, size(A,2))); + Q = Q(fliplr(index),:); + A = A(fliplr(index),:); + fprintf('\n'); +else + fprintf('Not reordering rows.\n'); +end + +B=A; diff --git a/code/eeglab13_4_4b/functions/miscfunc/read_rdf.m b/code/eeglab13_4_4b/functions/miscfunc/read_rdf.m new file mode 100644 index 0000000..032285d --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/read_rdf.m @@ -0,0 +1,77 @@ +% read_rdf() - read RDF-formatted EEG files. +% +% Usage: +% >> [eeg,ev,header] = read_rdf(filename); +% +% Inputs: +% filename - EEG data file in RDF format +% +% Outputs: +% eeg - eeg data (array in size of [chan_no timepoint]; +% ev - event structure +% ev.sample_offset[] - event offsets in samples +% from the first sample (0) +% ev.event_code[] - event codes (integers) +% header - data structure for header information +% header.ch_no - number of channels +% header.sample_no - number of samples + +% Notes: +% +% Authors: Jeng-Ren Duann, CNL/Salk & INC/UCSD, 2002-12-12 +% with help from Andrey Vankov, creator of the RDF file format. + +function [eeg,ev,header] = read_rdf(filename) + + if nargin < 1 + help read_rdf; + return; + end; + + eeg = []; + ev = []; + header = []; + + fp = fopen(filename,'rb','ieee-le'); + if fp == -1, + disp('read_RDF(): Cannot open data file...!'); + return; + end + + fseek(fp,6,-1); + header.ch_no = fread(fp,1,'uint16'); + + cnt = 0; + ev_cnt = 0; + while(~feof(fp)), + tag = fread(fp,1,'uint32'); + if length(tag) == 0, + break; + end + if tag == hex2dec('f0aa55'), + cnt = cnt + 1; + disp(['block ' num2str(cnt) ' found']); + % read ch_no and block length + fseek(fp,2,0); + ch_no = fread(fp,1,'uint16'); + block_size = power(2,fread(fp,1,'uint16')); + % read events + fseek(fp,62,0); + for i=1:110, + samp_off = fread(fp,1,'char'); + cond_code = fread(fp,1,'char'); + ev_code = fread(fp,1,'uint16'); + if samp_off ~= 0, + ev_cnt = ev_cnt + 1; + ev(ev_cnt).sample_offset = samp_off + (cnt-1)*128; + ev(ev_cnt).event_code = ev_code; + end + end + data = fread(fp,ch_no*block_size,'int16'); + data = reshape(data,ch_no,block_size); + eeg = [eeg data]; + end + end + + fclose(fp); + header.sample_no = size(eeg,2); diff --git a/code/eeglab13_4_4b/functions/miscfunc/readlocsold.m b/code/eeglab13_4_4b/functions/miscfunc/readlocsold.m new file mode 100644 index 0000000..bfe4e53 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/readlocsold.m @@ -0,0 +1,117 @@ +% readlocsold() - Read electrode locations file in style of topoplot() or headplot(). +% Output channel information is ordered by channel numbers. +% +% Usage: >> [nums labels th r x y] = readlocsold(locfile);% {default, polar 2-D} +% >> [nums labels th r x y] = readlocsold(locfile,'polar'); % 2-D +% >> [nums labels x y z] = readlocsold(locfile,'spherical'); % 3-D +% >> [nums labels x y z] = readlocsold(locfile,'cartesian'); % 3-D +% Input: +% locfile = 'filename' of electrode location file. +% loctype = File type:'polar' 2-D {default}. See >> topoplot example +% 'spherical' 3-D. See >> headplot example +% 'cartesian' 3-D. See >> headplot cartesian +% Outputs: +% nums = ordered channel numbers (from locfile) +% labels = Matrix of 4-char channel labels (nchannels,4) +% 2-D: r,th = polar coordinates of each electrode (th in radians) +% x,y = 2-D Cartesian coordinates (from pol2cart()) +% 3-D: x,y,z = 3-D Cartesian coordinates (normalized, |x,y,z| = 1) + +% Scott Makeig, CNL / Salk Institute, La Jolla CA 3/01 +% code from topoplot() + +function [channums,labels,o1,o2,o3,o4] = readlocsold(loc_file,loctype) + +verbose = 0; + +if nargin<2 + loctype = 'polar'; % default file type +end +icadefs +if nargin<1 + loc_file = DEFAULT_ELOC; +end + +fid = fopen(loc_file); +if fid<1, + fprintf('readlocsold(): cannot open electrode location file (%s).\n',loc_file); + return +end +if strcmp(loctype,'spherical')| strcmp(loctype,'polar') + A = fscanf(fid,'%d %f %f %s',[7 Inf]); +elseif strcmp(loctype,'cartesian') + A = fscanf(fid,'%d %f %f %f %s',[8 Inf]); +else + fprintf('readlocsold(): unknown electrode location file type %s.\n',loctype); + return +end + +fclose(fid); + +A = A'; +channums = A(:,1); +[channums csi] = sort(channums); + +if strcmp(loctype,'cartesian') + labels = setstr(A(csi,5:8)); +else + labels = setstr(A(csi,4:7)); +end +idx = find(labels == '.'); % some labels have dots +labels(idx) = setstr(abs(' ')*ones(size(idx))); % replace them with spaces + +badchars = find(double(labels)<32|double(labels)>127); +if ~isempty(badchars) + fprintf(... + 'readlocsold(): Bad label(s) read - Each label must have 4 chars (. => space)\n'); + return +end + +for c=1:length(channums) + if labels(c,3)== ' ' & labels(c,4)== ' ' + labels(c,[2 3]) = labels(c,[1 2]); + labels(c,1) = ' '; % move 1|2-letter labels to middle of string + end +end + +if strcmp(loctype,'polar') + th = pi/180*A(csi,2); % convert degrees to radians + rad = A(csi,3); + o2 = rad; o1 = th; + [x,y] = pol2cart(th,rad); % transform from polar to cartesian coordinates + o3 = x; o4 = y; +elseif strcmp(loctype,'spherical') + th = pi/180*A(csi,2); + phi = pi/180*A(csi,3); + x = sin(th).*cos(phi); + y = sin(th).*sin(phi); + z = cos(th); + o1 = x; o2 =y; o3 = z; +elseif strcmp(loctype,'cartesian') + x = A(csi,2); + y = A(csi,3); + z = A(csi,4); + dists = sqrt(x.^2+y.^2+z.^2); + x = y./dists; % normalize [x y z] vector lengths to 1 + y = y./dists; + z = z./dists; + o1 = x; o2 =y; o3 = z; +end + +if verbose + fprintf('Location data for %d electrodes read from file %s.\n',... + size(A,1),loc_file); +end + +if nargout<1 + fprintf('\n'); + for c=1:length(channums) + if strcmp(loctype,'polar') + fprintf(' %d %s %4.3f %4.3f %4.3f %4.3f\n',... + channums(c),labels(c,:),rad(c),th(c),x(c),y(c)); + end + end + fprintf('\n'); + o1 = []; o2=[]; o3=[]; o4=[]; + labels = []; +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/rmart.m b/code/eeglab13_4_4b/functions/miscfunc/rmart.m new file mode 100644 index 0000000..2eca120 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/rmart.m @@ -0,0 +1,202 @@ +% rmart() - Remove eye artifacts from EEG data using regression with +% multiple time lags. Each channel is first made mean-zero. +% After JL Kenemans et al., Psychophysiology 28:114-21, 1991. +% +% Usage: >> rmart('datafile','outfile',nchans,chanlist,eogchan,[threshold]) +% Example: >> rmart('noisy.floats','clean.floats',31,[2:31],7) +% +% Input: datafile - input float data file, multiplexed by channel +% outfile - name of output float data file +% nchans - number of channels in datafile +% chanlist - indices of EEG channel(s) to process (1,...,nchans) +% eogchan - regressing channel indices(s) (1,...,nchans) +% threshold- abs threshold value to trigger regression {def|0 -> 80} +% +% Output: Writes [length(chanlist),size(data,2)] floats to 'outfile' +% +% Note: Regression epoch length and number of lags are set in the script. +% Some machines may require a new byte_order value in the script. +% note that runica() -> icaproj() should give better results! See +% Jung et al., Psychophysiology 111:1745-58, 2000. +% +% Author: Tzyy-Ping Jung, SCCN/INC/UCSD, La Jolla, 1997 + +% Copyright (C) 1997 Tzyy-Ping Jung, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 2-22-97 Tzyy-Ping Jung CNL/Salk Institute, La Jolla, CA +% 2-24-97 Formatted for ICA package release -Scott Makeig +% 12-10-97 Changed name from rmartifact to rmart for toolbox inclusion -sm +% 12-11-97 Adapted to read/write a float matrix -sm & sw +% 09-14-00 Added comments and help -sm +% 01-25-02 reformated help & license -ad + +function rmart(datafile,outfile,nchans,chanlist,eogchan,threshold) + +if nargin < 5 + help rmart + return +end + +% +% The following parameters may be fine-tuned for a data set +% +DEF_THRESHOLD = 80; % trigger regression on blocks exceeding this (default) +epoch = 80; % remove artifacts in successive blocks of this length +nlags = 40; % perform multiple regression filtering of this length + +byte_order = 'b';% (machine-dependent) byte order code for fopen(); +MAKE_MEAN_ZERO = 1 % 1/0 flag removing mean offset from each channel + +fprintf('Performing artifact regression on data in %s.\n',datafile); + +if nargin<6 + threshold = 0; +end +if threshold == 0, + threshold = DEF_THRESHOLD; +end +fprintf('Regression threshold %g.\n',threshold); + +% +% Read the input data +% +[fid,msg]=fopen(datafile,'r',byte_order); % open datafile +if fid < 3, + fprintf('rmart() - could not open data file: %s\n',msg); + exit 1 +end +data=(fread(fid,'float'))'; +status=fclose('all'); +if rem(length(data),nchans) == 0 % check length + fprintf('rmart() - data length not divisible by %d chans.\n',nchans); + return +end + +data = reshape(data,nchans,length(data)/nchans); +[chans,frames] = size(data); +fprintf('Data of size [%d,%d] read.\n',chans,frames); +eog = data(eogchan,:); +data = data(chanlist,:); +procchans = length(chanlist); + +fprintf('Regression epoch length %d frames.\n',epoch); +fprintf('Using %d regression lags.\n',nlags); +if length(eogchan)> 1 + fprintf('Processing %d of %d channels using %d EOG channels.\n',... + procchans,chans,length(eogchan)); +else + fprintf('Processing %d of %d channels using EOG channel %d.\n',... + procchans,chans,eogchan); +end + +% +% Process the data +% +for i=1:procchans + chan = chanlist(i); + idx=[]; + frame=1+epoch/2+nlags/2; + if MAKE_MEAN_ZERO + data(chan,:) = data(chan,:) - mean(data(chan,:)); % make mean-zero + end + + % Search the EOG & EEG records for values above threshold, + % Selected frame numbers are registered in the variable "idx". + % The entries in "idx" are at least epoch apart to avoid double + % compensation (regression) on the same portion of the EEG data. + + while frame <= length(eog)-epoch/2-nlags/2, % foreach epoch in channel + stop = min(frame+epoch-1,eogframes); + tmp= ... + find( abs(eog(frame:stop)) >= threshold ... + | abs(data(chan,frame:stop)) >= threshold); + % find beyond-threshold values + if length(tmp) ~= 0 + mark = tmp(1)+frame-1; + if length(idx) ~= 0 + if mark-idx(length(idx)) < epoch, + idx=[idx idx(length(idx))+epoch]; % To guarantee idx(i) & idx(i-1) + % are at least EPOCH points apart + frame = idx(length(idx))+epoch/2; + else + idx=[idx mark]; + frame = mark + epoch/2; + end + else + idx=[idx mark]; + frame = mark + epoch/2; + end + else + frame=frame+epoch; + end + end % while + + % For each registered frame, take "epoch" points + % surrounding it from the EEG, and "epoch + lag" points + % from the EOG channel. Then perform multivariate + % linear regression on EEG channel. + + for j=1:length(idx); + art=ones(1,epoch); + eogtmp=eog(idx(j)-epoch/2-nlags/2:idx(j)+epoch/2-1+nlags/2); + + % Collect EOG data from lag/2 points before to lag/2 points + % after the regression window. + for J=nlags:-1:1, + art=[art ; eogtmp(J:J+epoch-1)]; + end + eegtmp=data(chan,idx(j)-epoch/2:idx(j)+epoch/2-1); + + eegeog=eegtmp*art'; % perform the regression here + eogeog=art*art'; + b=eegeog/eogeog; + eegtmp=eegtmp-b*art; + data(chan,idx(j)-epoch/2:idx(j)+epoch/2-1)=eegtmp; + end % j +end % i + +% +% Write output file +% +[fid,msg]=fopen(outfile,'w',byte_order); +if fid < 3 + fprintf('rmart() - could not open output file: %s\n',msg); + return +end +count = fwrite(fid,data,'float'); +if count == procchans*frames, + fprintf('Output file "%s" written, size = [%d,%d] \n\n',... + outfile,procchans,frames); +else + fprintf('rmart(): Output file "%s" written, SIZE ONLY [%d,%g]\n',... + outfile,procchans,count/procchans); +end +fclose('all'); + + + + + + + + + + + + + + diff --git a/code/eeglab13_4_4b/functions/miscfunc/rmsave.m b/code/eeglab13_4_4b/functions/miscfunc/rmsave.m new file mode 100644 index 0000000..31dfede --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/rmsave.m @@ -0,0 +1,39 @@ +% rmsave() - return the RMS in each channel, epoch +% +% Usage: +% >> ave = rmsave(data,frames); + +% Scott Makeig, CNL/Salk Institute, La Jolla, 9/98 + +function ave = rmsave(data,frames) + +if nargin<1 + help rmsave + return +end +if nargin<2 + frames = size(data,2); + data = reshape(data, size(data,1), size(data,2)*size(data,3)); +end; + +chans = size(data,1); +datalength = size(data,2); +if rem(datalength,frames) + fprintf('frames should divide data length.\n'); + return +end +if frames < 1 + fprintf('frames should be > 1.\n'); + return +end + +epochs = datalength/frames; +ave = zeros(chans,epochs); +i=1; +while i<= epochs + dat = matsel(data,frames,0,0,i); + dat = dat.*dat; + ave(:,i) = sqrt(mean(dat'))'; + i = i+1; +end + diff --git a/code/eeglab13_4_4b/functions/miscfunc/rotatematlab.m b/code/eeglab13_4_4b/functions/miscfunc/rotatematlab.m new file mode 100644 index 0000000..ebd0a77 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/rotatematlab.m @@ -0,0 +1,6 @@ +% This function calls the Matlab rotate function +% This prevents the issue with the function in the private folder of Dipfit + +function rotatematlab(varargin) + +rotate(varargin{:}); diff --git a/code/eeglab13_4_4b/functions/miscfunc/runicalowmem.m b/code/eeglab13_4_4b/functions/miscfunc/runicalowmem.m new file mode 100644 index 0000000..61dacc2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/runicalowmem.m @@ -0,0 +1,1492 @@ +% runica() - Perform Independent Component Analysis (ICA) decomposition +% of input data using the logistic infomax ICA algorithm of +% Bell & Sejnowski (1995) with the natural gradient feature +% of Amari, Cichocki & Yang, or optionally the extended-ICA +% algorithm of Lee, Girolami & Sejnowski, with optional PCA +% dimension reduction. Annealing based on weight changes is +% used to automate the separation process. +% Usage: +% >> [weights,sphere] = runica(data); % train using defaults +% else +% >> [weights,sphere,compvars,bias,signs,lrates,activations] ... +% = runica(data,'Key1',Value1',...); +% Input: +% data = input data (chans,frames*epochs). +% Note that if data consists of multiple discontinuous epochs, +% each epoch should be separately baseline-zero'd using +% >> data = rmbase(data,frames,basevector); +% +% Optional keywords [argument]: +% 'extended' = [N] perform tanh() "extended-ICA" with sign estimation +% N training blocks. If N > 0, automatically estimate the +% number of sub-Gaussian sources. If N < 0, fix number of +% sub-Gaussian comps to -N [faster than N>0] (default|0 -> off) +% 'pca' = [N] decompose a principal component (default -> 0=off) +% subspace of the data. Value is the number of PCs to retain. +% 'sphering' = ['on'/'off'] flag sphering of data (default -> 'on') +% 'weights' = [W] initial weight matrix (default -> eye()) +% (Note: if 'sphering' 'off', default -> spher()) +% 'lrate' = [rate] initial ICA learning rate (<< 1) (default -> heuristic) +% 'block' = [N] ICA block size (<< datalength) (default -> heuristic) +% 'anneal' = annealing constant (0,1] (defaults -> 0.90, or 0.98, extended) +% controls speed of convergence +% 'annealdeg' = [N] degrees weight change for annealing (default -> 70) +% 'stop' = [f] stop training when weight-change < this (default -> 1e-6 +% if less than 33 channel and 1E-7 otherwise) +% 'maxsteps' = [N] max number of ICA training steps (default -> 512) +% 'bias' = ['on'/'off'] perform bias adjustment (default -> 'on') +% 'momentum' = [0 0) +% 'specgram' = [srate loHz hiHz frames winframes] decompose a complex time/frequency +% transform of the data - though not optimally. (Note: winframes must +% divide frames) (defaults [srate 0 srate/2 size(data,2) size(data,2)]) +% 'posact' = make all component activations net-positive(default 'off'} +% Requires time and memory; posact() may be applied separately. +% 'ncomps' = [N] number of ICA components to compute (default -> chans or 'pca' arg) +% using rectangular ICA decomposition. This parameter may return +% strange results. This is because the weight matrix is rectangular +% instead of being square. Do not use except to try to fix the problem. +% 'verbose' = give ascii messages ('on'/'off') (default -> 'on') +% 'submean' = ['on'|'off'] subtract mean from each channel (default -> 'on') +% 'logfile' = [filename] save all message in a log file in addition to showing them +% on screen (default -> none) +% +% Outputs: [Note: RO means output in reverse order of projected mean variance +% unless starting weight matrix passed ('weights' above)] +% weights = ICA weight matrix (comps,chans) [RO] +% sphere = data sphering matrix (chans,chans) = spher(data) +% Note that unmixing_matrix = weights*sphere {if sphering off -> eye(chans)} +% compvars = back-projected component variances [RO] +% bias = vector of final (ncomps) online bias [RO] (default = zeros()) +% signs = extended-ICA signs for components [RO] (default = ones()) +% [ -1 = sub-Gaussian; 1 = super-Gaussian] +% lrates = vector of learning rates used at each training step [RO] +% activations = activation time courses of the output components (ncomps,frames*epochs) +% +% Authors: Scott Makeig with contributions from Tony Bell, Te-Won Lee, +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky, Delorme Arnaud, +% CNL/The Salk Institute, La Jolla, 1996- + +% Reference (please cite): +% +% Makeig, S., Bell, A.J., Jung, T-P and Sejnowski, T.J., +% "Independent component analysis of electroencephalographic data," +% In: D. Touretzky, M. Mozer and M. Hasselmo (Eds). Advances in Neural +% Information Processing Systems 8:145-151, MIT Press, Cambridge, MA (1996). +% +% Toolbox Citation: +% +% Makeig, Scott et al. "EEGLAB: ICA Toolbox for Psychophysiological Research". +% WWW Site, Swartz Center for Computational Neuroscience, Institute of Neural +% Computation, University of San Diego California +% , 2000. [World Wide Web Publication]. +% +% For more information: +% http://www.sccn.ucsd.edu/eeglab/icafaq.html - FAQ on ICA/EEG +% http://www.sccn.ucsd.edu/eeglab/icabib.html - mss. on ICA & biosignals +% http://www.cnl.salk.edu/~tony/ica.html - math. mss. on ICA + +% Copyright (C) 1996 Scott Makeig et al, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Edit history %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% runica() - by Scott Makeig with contributions from Tony Bell, Te-Won Lee +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky et al. +% CNL / Salk Institute 1996-00 +% 04-30-96 built from icatest.m and ~jung/.../wtwpwica.m -sm +% 07-28-97 new runica(), adds bias (default on), momentum (default off), +% extended-ICA (Lee & Sejnowski, 1997), cumulative angledelta +% (until lrate drops), keywords, signcount for speeding extended-ICA +% 10-07-97 put acos() outside verbose loop; verbose 'off' wasn't stopping -sm +% 11-11-97 adjusted help msg -sm +% 11-30-97 return eye(chans) if sphering 'off' or 'none' (undocumented option) -sm +% 02-27-98 use pinv() instead of inv() to rank order comps if ncomps < chans -sm +% 04-28-98 added 'posact' and 'pca' flags -sm +% 07-16-98 reduced length of randperm() for kurtosis subset calc. -se & sm +% 07-19-98 fixed typo in weights def. above -tl & sm +% 12-21-99 added 'specgram' option suggested by Michael Zibulevsky, UNM -sm +% 12-22-99 fixed rand() sizing inefficiency on suggestion of Mike Spratling, UK -sm +% 01-11-00 fixed rand() sizing bug on suggestion of Jack Foucher, Strasbourg -sm +% 12-18-00 test for existence of Sig Proc Tlbx function 'specgram'; improve +% 'specgram' option arguments -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 lowered default lrate and block -ad +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [weights,sphere,meanvar,bias,signs,lrates,data,y] = runica(data,varargin) % NB: Now optionally returns activations as variable 'data' -sm 7/05 + +if nargin < 1 + help runica + return +end + +[chans frames] = size(data); % determine the data size +urchans = chans; % remember original data channels +datalength = frames; +if chans<2 + fprintf('\nrunica() - data size (%d,%d) too small.\n\n', chans,frames); + return +end +% +%%%%%%%%%%%%%%%%%%%%%% Declare defaults used below %%%%%%%%%%%%%%%%%%%%%%%% +% +MAX_WEIGHT = 1e8; % guess that weights larger than this have blown up +DEFAULT_STOP = 0.000001; % stop training if weight changes below this +DEFAULT_ANNEALDEG = 60; % when angle change reaches this value, +DEFAULT_ANNEALSTEP = 0.90; % anneal by multiplying lrate by this +DEFAULT_EXTANNEAL = 0.98; % or this if extended-ICA +DEFAULT_MAXSTEPS = 512; % ]top training after this many steps +DEFAULT_MOMENTUM = 0.0; % default momentum weight + +DEFAULT_BLOWUP = 1000000000.0; % = learning rate has 'blown up' +DEFAULT_BLOWUP_FAC = 0.8; % when lrate 'blows up,' anneal by this fac +DEFAULT_RESTART_FAC = 0.9; % if weights blowup, restart with lrate + % lower by this factor +MIN_LRATE = 0.000001; % if weight blowups make lrate < this, quit +MAX_LRATE = 0.1; % guard against uselessly high learning rate +DEFAULT_LRATE = 0.00065/log(chans); + % heuristic default - may need adjustment + % for large or tiny data sets! +% DEFAULT_BLOCK = floor(sqrt(frames/4)); % heuristic default +DEFAULT_BLOCK = ceil(min(5*log(frames),0.3*frames)); % heuristic + % - may need adjustment! +% Extended-ICA option: +DEFAULT_EXTENDED = 0; % default off +DEFAULT_EXTBLOCKS = 1; % number of blocks per kurtosis calculation +DEFAULT_NSUB = 1; % initial default number of assumed sub-Gaussians + % for extended-ICA +DEFAULT_EXTMOMENTUM = 0.5; % momentum term for computing extended-ICA kurtosis +MAX_KURTSIZE = 6000; % max points to use in kurtosis calculation +MIN_KURTSIZE = 2000; % minimum good kurtosis size (flag warning) +SIGNCOUNT_THRESHOLD = 25; % raise extblocks when sign vector unchanged + % after this many steps +SIGNCOUNT_STEP = 2; % extblocks increment factor + +DEFAULT_SPHEREFLAG = 'on'; % use the sphere matrix as the default + % starting weight matrix +DEFAULT_PCAFLAG = 'off'; % don't use PCA reduction +DEFAULT_POSACTFLAG = 'off'; % don't use posact(), to save space -sm 7/05 +DEFAULT_SUBMEAN = 'on'; +DEFAULT_VERBOSE = 1; % write ascii info to calling screen +DEFAULT_BIASFLAG = 1; % default to using bias in the ICA update rule +% +%%%%%%%%%%%%%%%%%%%%%%% Set up keyword default values %%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargout < 2, + fprintf('runica() - needs at least two output arguments.\n'); + return +end +epochs = 1; % do not care how many epochs in data + +pcaflag = DEFAULT_PCAFLAG; +sphering = DEFAULT_SPHEREFLAG; % default flags +posactflag = DEFAULT_POSACTFLAG; +verbose = DEFAULT_VERBOSE; +logfile = []; + +block = DEFAULT_BLOCK; % heuristic default - may need adjustment! +lrate = DEFAULT_LRATE; +annealdeg = DEFAULT_ANNEALDEG; +annealstep = 0; % defaults declared below +nochange = NaN; +momentum = DEFAULT_MOMENTUM; +maxsteps = DEFAULT_MAXSTEPS; + +weights = 0; % defaults defined below +ncomps = chans; +biasflag = DEFAULT_BIASFLAG; + +extended = DEFAULT_EXTENDED; +extblocks = DEFAULT_EXTBLOCKS; +kurtsize = MAX_KURTSIZE; +signsbias = 0.02; % bias towards super-Gaussian components +extmomentum= DEFAULT_EXTMOMENTUM; % exp. average the kurtosis estimates +nsub = DEFAULT_NSUB; +wts_blowup = 0; % flag =1 when weights too large +wts_passed = 0; % flag weights passed as argument +submean = DEFAULT_SUBMEAN; + +% +%%%%%%%%%% Collect keywords and values from argument list %%%%%%%%%%%%%%% +% + if (nargin> 1 & rem(nargin,2) == 0) + fprintf('runica(): Even number of input arguments???') + return + end + for i = 1:2:length(varargin) % for each Keyword + Keyword = varargin{i}; + Value = varargin{i+1}; + if ~isstr(Keyword) + fprintf('runica(): keywords must be strings') + return + end + Keyword = lower(Keyword); % convert upper or mixed case to lower + + if strcmp(Keyword,'weights') | strcmp(Keyword,'weight') + if isstr(Value) + fprintf(... + 'runica(): weights value must be a weight matrix or sphere') + return + else + weights = Value; + wts_passed =1; + end + elseif strcmp(Keyword,'ncomps') + if isstr(Value) + fprintf('runica(): ncomps value must be an integer') + return + end + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + fprintf('*****************************************************************************************'); + fprintf('************** WARNING: NCOMPS OPTION OFTEN DOES NOT RETURN ACCURATE RESULTS ************'); + fprintf('************** WARNING: IF YOU FIND THE PROBLEM, PLEASE LET US KNOW ************'); + fprintf('*****************************************************************************************'); + ncomps = Value; + if ~ncomps, + ncomps = chans; + end + elseif strcmp(Keyword,'pca') + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + if isstr(Value) + fprintf(... +'runica(): pca value should be the number of principal components to retain') + return + end + pcaflag = 'on'; + ncomps = Value; + if ncomps > chans | ncomps < 1, + fprintf('runica(): pca value must be in range [1,%d]\n',chans) + return + end + chans = ncomps; + elseif strcmp(Keyword,'posact') + if ~isstr(Value) + fprintf('runica(): posact value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): posact value must be on or off') + return + end + posactflag = Value; + end + elseif strcmp(Keyword,'submean') + if ~isstr(Value) + fprintf('runica(): submean value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): submean value must be on or off') + return + end + submean = Value; + end + elseif strcmp(Keyword,'lrate') + if isstr(Value) + fprintf('runica(): lrate value must be a number') + return + end + lrate = Value; + if lrate>MAX_LRATE | lrate <0, + fprintf('runica(): lrate value is out of bounds'); + return + end + if ~lrate, + lrate = DEFAULT_LRATE; + end + elseif strcmp(Keyword,'block') | strcmp(Keyword,'blocksize') + if isstr(Value) + fprintf('runica(): block size value must be a number') + return + end + block = floor(Value); + if ~block, + block = DEFAULT_BLOCK; + end + elseif strcmp(Keyword,'stop') | strcmp(Keyword,'nochange') ... + | strcmp(Keyword,'stopping') + if isstr(Value) + fprintf('runica(): stop wchange value must be a number') + return + end + nochange = Value; + elseif strcmp(Keyword,'logfile') + if ~isstr(Value) + fprintf('runica(): logfile value must be a string') + return + end + logfile = Value; + elseif strcmp(Keyword,'maxsteps') | strcmp(Keyword,'steps') + if isstr(Value) + fprintf('runica(): maxsteps value must be an integer') + return + end + maxsteps = Value; + if ~maxsteps, + maxsteps = DEFAULT_MAXSTEPS; + end + if maxsteps < 0 + fprintf('runica(): maxsteps value (%d) must be a positive integer',maxsteps) + return + end + elseif strcmp(Keyword,'anneal') | strcmp(Keyword,'annealstep') + if isstr(Value) + fprintf('runica(): anneal step value (%2.4f) must be a number (0,1)',Value) + return + end + annealstep = Value; + if annealstep <=0 | annealstep > 1, + fprintf('runica(): anneal step value (%2.4f) must be (0,1]',annealstep) + return + end + elseif strcmp(Keyword,'annealdeg') | strcmp(Keyword,'degrees') + if isstr(Value) + fprintf('runica(): annealdeg value must be a number') + return + end + annealdeg = Value; + if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG; + elseif annealdeg > 180 | annealdeg < 0 + fprintf('runica(): annealdeg (%3.1f) is out of bounds [0,180]',... + annealdeg); + return + + end + elseif strcmp(Keyword,'momentum') + if isstr(Value) + fprintf('runica(): momentum value must be a number') + return + end + momentum = Value; + if momentum > 1.0 | momentum < 0 + fprintf('runica(): momentum value is out of bounds [0,1]') + return + end + elseif strcmp(Keyword,'sphering') | strcmp(Keyword,'sphereing') ... + | strcmp(Keyword,'sphere') + if ~isstr(Value) + fprintf('runica(): sphering value must be on, off, or none') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off') & ~strcmp(Value,'none'), + fprintf('runica(): sphering value must be on or off') + return + end + sphering = Value; + end + elseif strcmp(Keyword,'bias') + if ~isstr(Value) + fprintf('runica(): bias value must be on or off') + return + else + Value = lower(Value); + if strcmp(Value,'on') + biasflag = 1; + elseif strcmp(Value,'off'), + biasflag = 0; + else + fprintf('runica(): bias value must be on or off') + return + end + end + elseif strcmp(Keyword,'specgram') | strcmp(Keyword,'spec') + + if ~exist('specgram') < 2 % if ~exist or defined workspace variable + fprintf(... + 'runica(): MATLAB Sig. Proc. Toolbox function "specgram" not found.\n') + return + end + if isstr(Value) + fprintf('runica(): specgram argument must be a vector') + return + end + srate = Value(1); + if (srate < 0) + fprintf('runica(): specgram srate (%4.1f) must be >=0',srate) + return + end + if length(Value)>1 + loHz = Value(2); + if (loHz < 0 | loHz > srate/2) + fprintf('runica(): specgram loHz must be >=0 and <= srate/2 (%4.1f)',srate/2) + return + end + else + loHz = 0; % default + end + if length(Value)>2 + hiHz = Value(3); + if (hiHz < loHz | hiHz > srate/2) + fprintf('runica(): specgram hiHz must be >=loHz (%4.1f) and <= srate/2 (%4.1f)',loHz,srate/2) + return + end + else + hiHz = srate/2; % default + end + if length(Value)>3 + Hzframes = Value(5); + if (Hzframes<0 | Hzframes > size(data,2)) + fprintf('runica(): specgram frames must be >=0 and <= data length (%d)',size(data,2)) + return + end + else + Hzframes = size(data,2); % default + end + if length(Value)>4 + Hzwinlen = Value(4); + if rem(Hzframes,Hzwinlen) % if winlen doesn't divide frames + fprintf('runica(): specgram Hzinc must divide frames (%d)',Hzframes) + return + end + else + Hzwinlen = Hzframes; % default + end + Specgramflag = 1; % set flag to perform specgram() + + elseif strcmp(Keyword,'extended') | strcmp(Keyword,'extend') + if isstr(Value) + fprintf('runica(): extended value must be an integer (+/-)') + return + else + extended = 1; % turn on extended-ICA + extblocks = fix(Value); % number of blocks per kurt() compute + if extblocks < 0 + nsub = -1*fix(extblocks); % fix this many sub-Gauss comps + elseif ~extblocks, + extended = 0; % turn extended-ICA off + elseif kurtsize>frames, % length of kurtosis calculation + kurtsize = frames; + if kurtsize < MIN_KURTSIZE + fprintf(... + 'runica() warning: kurtosis values inexact for << %d points.\n',... + MIN_KURTSIZE); + end + end + end + elseif strcmp(Keyword,'verbose') + if ~isstr(Value) + fprintf('runica(): verbose flag value must be on or off') + return + elseif strcmp(Value,'on'), + verbose = 1; + elseif strcmp(Value,'off'), + verbose = 0; + else + fprintf('runica(): verbose flag value must be on or off') + return + end + else + fprintf('runica(): unknown flag') + return + end + end + +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize weights, etc. %%%%%%%%%%%%%%%%%%%%%%%% +% +if ~annealstep, + if ~extended, + annealstep = DEFAULT_ANNEALSTEP; % defaults defined above + else + annealstep = DEFAULT_EXTANNEAL; % defaults defined above + end +end % else use annealstep from commandline + +if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG - momentum*90; % heuristic + if annealdeg < 0, + annealdeg = 0; + end +end +if ncomps > chans | ncomps < 1 + fprintf('runica(): number of components must be 1 to %d.\n',chans); + return +end +% +%%%%%%%%%%%%%%%%%%%%% Check keyword values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if frames frames, + fprintf('runica(): block size exceeds data length!\n'); + return +elseif floor(epochs) ~= epochs, + fprintf('runica(): data length is not a multiple of the epoch length!\n'); + return +elseif nsub > ncomps + fprintf('runica(): there can be at most %d sub-Gaussian components!\n',ncomps); + return +end; + +if ~isempty(logfile) + fid = fopen(logfile, 'w'); + if fid == -1, error('Cannot open logfile for writing'); end; +else + fid = []; +end; +verb = verbose; + +if weights ~= 0, % initialize weights + % starting weights are being passed to runica() from the commandline + if chans>ncomps & weights ~=0, + [r,c]=size(weights); + if r~=ncomps | c~=chans, + fprintf('runica(): weight matrix must have %d rows, %d columns.\n', ... + chans,ncomps); + return; + end + end + icaprintf(verb,fid,'Using starting weight matrix named in argument list ...\n'); +end; + +% +% adjust nochange if necessary +% +if isnan(nochange) + if ncomps > 32 + nochange = 1E-7; + nochangeupdated = 1; % for fprinting purposes + else + nochangeupdated = 1; % for fprinting purposes + nochange = DEFAULT_STOP; + end; +else + nochangeupdated = 0; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Process the data %%%%%%%%%%%%%%%%%%%%%%%%%% +% +icaprintf(verb,fid,'\nInput data size [%d,%d] = %d channels, %d frames\n', ... + chans,frames,chans,frames); + +if strcmp(pcaflag,'on') + icaprintf(verb,fid,'After PCA dimension reduction,\n finding '); +else + icaprintf(verb,fid,'Finding '); +end +if ~extended + icaprintf(verb,fid,'%d ICA components using logistic ICA.\n',ncomps); +else % if extended +icaprintf(verb,fid,'%d ICA components using extended ICA.\n',ncomps); +if extblocks > 0 + icaprintf(verb,fid,'Kurtosis will be calculated initially every %d blocks using %d data points.\n',... + extblocks, kurtsize); +else + icaprintf(verb,fid,'Kurtosis will not be calculated. Exactly %d sub-Gaussian components assumed.\n',nsub); +end +end +icaprintf(verb,fid,'Decomposing %d frames per ICA weight ((%d)^2 = %d weights, %d frames)\n',... + floor(frames/ncomps.^2),ncomps.^2,frames); +icaprintf(verb,fid,'Initial learning rate will be %g, block size %d.\n',... + lrate,block); +if momentum>0, + icaprintf(verb,fid,'Momentum will be %g.\n',momentum); +end +icaprintf(verb,fid,'Learning rate will be multiplied by %g whenever angledelta >= %g deg.\n', ... + annealstep,annealdeg); + +if nochangeupdated + icaprintf(verb,fid,'More than 32 channels: default stopping weight change 1E-7\n'); +end; +icaprintf(verb,fid,'Training will end when wchange < %g or after %d steps.\n', nochange,maxsteps); +if biasflag, + icaprintf(verb,fid,'Online bias adjustment will be used.\n'); +else + icaprintf(verb,fid,'Online bias adjustment will not be used.\n'); +end + +% +%%%%%%%%%%%%%%%%% Remove overall row means of data %%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(submean, 'on') + icaprintf(verb,fid,'Removing mean of each channel ...\n'); + rowmeans = mean(data,2); + for index = 1:size(data,1) + data(index,:) = data(index,:) - rowmeans(index); % subtract row means + end; +end; +icaprintf(verb,fid,'Final training data range: %g to %g\n', min(min(data,[],2)),max(max(data,[],2))); + +% +%%%%%%%%%%%%%%%%%%% Perform PCA reduction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + icaprintf(verb,fid,'Reducing the data to %d principal dimensions...\n',ncomps); + [eigenvectors,eigenvalues,data] = pcsquash(data,ncomps); + % make data its projection onto the ncomps-dim principal subspace +end + +% +%%%%%%%%%%%%%%%%%%% Perform specgram transformation %%%%%%%%%%%%%%%%%%%%%%% +% +if exist('Specgramflag') == 1 + % [P F T] = SPECGRAM(A,NFFT,Fs,WINDOW,NOVERLAP) % MATLAB Sig Proc Toolbox + % Hzwinlen = fix(srate/Hzinc); % CHANGED FROM THIS 12/18/00 -sm + + Hzfftlen = 2^(ceil(log(Hzwinlen)/log(2))); % make FFT length next higher 2^k + Hzoverlap = 0; % use sequential windows + % + % Get freqs and times from 1st channel analysis + % + [tmp,freqs,tms] = specgram(data(1,:),Hzfftlen,srate,Hzwinlen,Hzoverlap); + + fs = find(freqs>=loHz & freqs <= hiHz); + icaprintf(verb,fid,'runica(): specified frequency range too narrow, exiting!\n'); + + specdata = reshape(tmp(fs,:),1,length(fs)*size(tmp,2)); + specdata = [real(specdata) imag(specdata)]; + % fprintf(' size(fs) = %d,%d\n',size(fs,1),size(fs,2)); + % fprintf(' size(tmp) = %d,%d\n',size(tmp,1),size(tmp,2)); + % + % Loop through remaining channels + % + for ch=2:chans + [tmp] = specgram(data(ch,:),Hzwinlen,srate,Hzwinlen,Hzoverlap); + tmp = reshape((tmp(fs,:)),1,length(fs)*size(tmp,2)); + specdata = [specdata;[real(tmp) imag(tmp)]]; % channels are rows + end + % + % Print specgram confirmation and details + % + icaprintf(verb,fid,'Converted data to %d channels by %d=2*%dx%d points spectrogram data.\n',... + chans,2*length(fs)*length(tms),length(fs),length(tms)); + if length(fs) > 1 + icaprintf(verb,fid,' Low Hz %g, high Hz %g, Hz incr %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),freqs(fs(2))-freqs(fs(1)),Hzwinlen); + else + icaprintf(verb,fid,' Low Hz %g, high Hz %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),Hzwinlen); + end + % + % Replace data with specdata + % + data = specdata; + datalength=size(data,2); +end +% +%%%%%%%%%%%%%%%%%%% Perform sphering %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmp(sphering,'on'), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + icaprintf(verb,fid,'Computing the sphering matrix...\n'); + sphere = 2.0*inv(sqrtm(double(mycov(data)))); % find the "sphering" matrix = spher() + if ~weights, + icaprintf(verb,fid,'Starting weights are the identity matrix ...\n'); + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights given on commandline + icaprintf(verb,fid,'Using starting weights named on commandline ...\n'); + end + icaprintf(verb,fid,'Sphering the data ...\n'); + +elseif strcmp(sphering,'off') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~weights % is starting weights not given + icaprintf(verb,fid,'Using the sphering matrix as the starting weight matrix ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + sphere = 2.0*inv(sqrtm(mycov(data))); % find the "sphering" matrix = spher() + weights = eye(ncomps,chans)*sphere; % begin with the identity matrix + sphere = eye(chans); % return the identity matrix + else % weights ~= 0 + icaprintf(verb,fid,'Using starting weights from commandline ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + sphere = eye(chans); % return the identity matrix + end +elseif strcmp(sphering,'none') + sphere = eye(chans,chans);% return the identity matrix + if ~weights + icaprintf(verb,fid,'Starting weights are the identity matrix ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights ~= 0 + icaprintf(verb,fid,'Using starting weights named on commandline ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + end + icaprintf(verb,fid,'Returned variable "sphere" will be the identity matrix.\n'); +end +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize ICA training %%%%%%%%%%%%%%%%%%%%%%%%% +% +lastt=fix((datalength/block-1)*block+1); +BI=block*eye(ncomps,ncomps); +delta=zeros(1,chans*ncomps); +changes = []; +degconst = 180./pi; +startweights = weights; +prevweights = startweights; +oldweights = startweights; +prevwtchange = zeros(chans,ncomps); +oldwtchange = zeros(chans,ncomps); +lrates = zeros(1,maxsteps); +onesrow = ones(1,block); +bias = zeros(ncomps,1); +signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 +for k=1:nsub + signs(k) = -1; +end +if extended & extblocks < 0, + icaprintf(verb,fid,'Fixed extended-ICA sign assignments: '); + for k=1:ncomps + icaprintf(verb,fid,'%d ',signs(k)); + end; icaprintf(verb,fid,'\n'); +end +signs = diag(signs); % make a diagonal matrix +oldsigns = zeros(size(signs));; +signcount = 0; % counter for same-signs +signcounts = []; +urextblocks = extblocks; % original value, for resets +old_kk = zeros(1,ncomps); % for kurtosis momemtum + +% +%%%%%%%% ICA training loop using the logistic sigmoid %%%%%%%%%%%%%%%%%%% +% +icaprintf(verb,fid,'Beginning ICA training ...'); +if extended, + icaprintf(verb,fid,' first training step may be slow ...\n'); +else + icaprintf(verb,fid,'\n'); +end +step=0; +laststep=0; +blockno = 1; % running block counter for kurtosis interrupts + +rand('state',sum(100*clock)); % set the random number generator state to + % a position dependent on the system clock +%% Compute ICA Weights +if biasflag & extended + while step < maxsteps, %%% ICA step = pass through all the data %%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) % look for user abort + if strcmp(get(gcf, 'tag'), 'stop') + if ~isempty(fid), fclose(fid); end; + close; error('USER ABORT'); + end; + end + + %% promote data block (only) to double to keep u and weights double + u=(weights*sphere)*double(data(:,timeperm(t:t+block-1))) + bias*onesrow; + + y=tanh(u); + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; + bias = bias + lrate*sum((-2*y)')'; % for tanh() nonlin. + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + %while step < maxsteps + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=(weights*sphere)*double(data(:,rp(1:kurtsize))); + else % for small data sets, + partact=(weights*sphere)*double(data); % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if extended & ~wts_blowup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs));; + + if lrate> MIN_LRATE + r = rank(double(data(:,1:min(10000,size(data,2))))); % determine if data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +end +%% Compute ICA Weights +if biasflag & ~extended + while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) & strcmp(get(gcf, 'tag'), 'stop') + close; error('USER ABORT'); + end; + + u=(weights*sphere)*double(data(:,timeperm(t:t+block-1))) + bias*onesrow; + y=1./(1+exp(-u)); + weights = weights + lrate*(BI+(1-2*y)*u')*weights; + bias = bias + lrate*sum((1-2*y)')'; % for logistic nonlin. % + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + if lrate> MIN_LRATE + r = rank(double(data(:,1:min(10000,size(data,2))))); % determine if data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +end +%% Compute ICA Weights +if ~biasflag & extended + while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step through data + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) & strcmp(get(gcf, 'tag'), 'stop') + close; error('USER ABORT'); % detect user abort + end + + u=(weights*sphere)*double(data(:,timeperm(t:t+block-1))); % promote block to dbl + y=tanh(u); % + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + %while step < maxsteps + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=(weights*sphere)*double(data(:,rp(1:kurtsize))); + else % for small data sets, + partact=(weights*sphere)*double(data); % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if ~wts_blowup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs)); + if lrate> MIN_LRATE + r = rank(data); % find whether data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Compute ICA Weights +if ~biasflag & ~extended + while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) & strcmp(get(gcf, 'tag'), 'stop') + close; error('USER ABORT'); + end; + u=(weights*sphere)*double(data(:,timeperm(t:t+block-1))); + y=1./(1+exp(-u)); % + weights = weights + lrate*(BI+(1-2*y)*u')*weights; + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + + if lrate> MIN_LRATE + r = rank(data); % find whether data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +end +%% Finalize Computed Data for Output + + if ~laststep + laststep = step; + end; + lrates = lrates(1,1:laststep); % truncate lrate history vector + + % + %%%%%%%%%%%%%% Orient components towards max positive activation %%%%%% + % + if nargout > 6 | strcmp(posactflag,'on') + % make activations from sphered and pca'd data; -sm 7/05 + % add back the row means removed from data before sphering + if strcmp(pcaflag,'off') + sr = sphere * rowmeans'; + for r = 1:ncomps + data(r,:) = data(r,:)+sr(r); % add back row means + end + data = (weights*sphere)*data; % OK in single + else + ser = sphere*eigenvectors(:,1:ncomps)'*rowmeans'; + for r = 1:ncomps + data(r,:) = data(r,:)+ser(r); % add back row means + end + data = (weights*sphere)*data; % OK in single + end; + end + % + % NOTE: Now 'data' are the component activations = weights*sphere*raw_data + % + % + %%%%%%%%%%%%%% If pcaflag, compose PCA and ICA matrices %%%%%%%%%%%%%%% + % + if strcmp(pcaflag,'on') + icaprintf(verb,fid,'Composing the eigenvector, weights, and sphere matrices\n'); + icaprintf(verb,fid,' into a single rectangular weights matrix; sphere=eye(%d)\n'... + ,chans); + weights= weights*sphere*eigenvectors(:,1:ncomps)'; + sphere = eye(urchans); + end + % + %%%%%% Sort components in descending order of max projected variance %%%% + % + icaprintf(verb,fid,'Sorting components in descending order of mean projected variance ...\n'); + % + %%%%%%%%%%%%%%%%%%%% Find mean variances %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % meanvar = zeros(ncomps,1); % size of the projections + if ncomps == urchans % if weights are square . . . + winv = inv(weights*sphere); + else + icaprintf(verb,fid,'Using pseudo-inverse of weight matrix to rank order component projections.\n'); + winv = pinv(weights*sphere); + end + % + % compute variances without backprojecting to save time and memory -sm 7/05 + % + for index = 1:size(data,1) + meanvar(index) = sum(winv(:,index).^2).*sum(double(data(index,:)).^2)/((chans*frames)-1); % from Rey Ramirez 8/07 + end; + + % + %%%%%%%%%%%%%% Sort components by mean variance %%%%%%%%%%%%%%%%%%%%%%%% + % + [sortvar, windex] = sort(meanvar); + windex = windex(ncomps:-1:1); % order large to small + meanvar = meanvar(windex); + % + %%%%%%%%%%%% re-orient max(abs(activations)) to >=0 ('posact') %%%%%%%% + % + if strcmp(posactflag,'on') % default is now off to save processing and memory + icaprintf(verb,fid,'Making the max(abs(activations)) positive ...\n'); + for index = 1:ize(data,2) + [tmp ix(index)] = max(abs(data(index,:))); % = max abs activations + end; + signsflipped = 0; + for r=1:ncomps + if sign(data(r,ix(r))) < 0 + if nargout>6 % if activations are to be returned (only) + data(r,:) = -1*data(r,:); % flip activations so max(abs()) is >= 0 + end + winv(:,r) = -1*winv(:,r); % flip component maps + signsflipped = 1; + end + end + if signsflipped == 1 + weights = pinv(winv)*inv(sphere); % re-invert the component maps + end + + % [data,winvout,weights] = posact(data,weights); % overwrite data with activations + % changes signs of activations (now = data) and weights + % to make activations (data) net rms-positive + % can call this outside of runica() - though it is inefficient! + end + % + %%%%%%%%%%%%%%%%%%%%% Filter data using final weights %%%%%%%%%%%%%%%%%% + % + if nargout>6, % if activations are to be returned + icaprintf(verb,fid,'Permuting the activation wave forms ...\n'); + data = data(windex,:); % data is now activations -sm 7/05 + else + clear data + end + weights = weights(windex,:);% reorder the weight matrix + bias = bias(windex); % reorder them + signs = diag(signs); % vectorize the signs matrix + signs = signs(windex); % reorder them + + if ~isempty(fid), fclose(fid); end; % close logfile + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +return + +% printing functions +% ------------------ +function icaprintf(verb,fid, varargin); + if verb + if ~isempty(fid) + fprintf(fid, varargin{:}); + end; + fprintf(varargin{:}); + end; + + +% this function compute covariance +% without using much memory (no need to transpose a) +% -------------------------------- +function c = mycov(a) % same as cov(a') + +try + c = cov(a'); +catch, + c = zeros(size(a,1), size(a,1)); + for i1=1:size(a,1) + for i2=1:size(a,1) + %c(i1,i2) = sum(double((a(i1,:)-mean(a(i1,:)))).*(double(a(i2,:)-mean(a(i2,:)))))/(size(a,2)-1); + c(i1,i2) = sum(double(a(i1,:).*a(i2,:)))/(size(a,2)-1); % mean has already been subtracted + end; + end; +end; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/runicatest.m b/code/eeglab13_4_4b/functions/miscfunc/runicatest.m new file mode 100644 index 0000000..e9b3216 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/runicatest.m @@ -0,0 +1,1050 @@ +% runicatest() - Perform Independent Component Analysis (ICA) decomposition +% using natural-gradient infomax - the infomax ICA algorithm of +% Bell & Sejnowski (1995) with the natural gradient method +% of Amari, Cichocki & Yang, the extended-ICA algorithm +% of Lee, Girolami & Sejnowski, PCA dimension reduction, +% and/or specgram() preprocessing (suggested by M. Zibulevsky). +% Usage: +% >> [weights,sphere] = runica(data); +% >> [weights,sphere,activations,bias,signs,lrates] ... +% = runica(data,'Key1',Value1',...); +% Input: +% data = input data (chans,frames*epochs). +% Note that if data consists of multiple discontinuous epochs, +% each epoch should be separately baseline-zero'd using +% >> data = rmbase(data,frames,basevector); +% +% Optional keywords: +% 'ncomps' = [N] number of ICA components to compute (default -> chans) +% using rectangular ICA decomposition +% 'pca' = [N] decompose a principal component (default -> 0=off) +% subspace of the data. Value is the number of PCs to retain. +% 'sphering' = ['on'/'off'] flag sphering of data (default -> 'on') +% 'weights' = [W] initial weight matrix (default -> eye()) +% (Note: if 'sphering' 'off', default -> spher()) +% 'lrate' = [rate] initial ICA learning rate (<< 1) (default -> heuristic) +% 'block' = [N] ICA block size (<< datalength) (default -> heuristic) +% 'anneal' = annealing constant (0,1] (defaults -> 0.90, or 0.98, extended) +% controls speed of convergence +% 'annealdeg' = [N] degrees weight change for annealing (default -> 70) +% 'stop' = [f] stop training when weight-change < this (default -> 1e-6) +% 'maxsteps' = [N] max number of ICA training steps (default -> 512) +% 'bias' = ['on'/'off'] perform bias adjustment (default -> 'on') +% 'momentum' = [0 0) +% 'extended' = [N] perform tanh() "extended-ICA" with sign estimation +% every N training blocks. If N > 0, automatically estimate the +% number of sub-Gaussian sources. If N < 0, fix number of sub-Gaussian +% components to -N [faster than N>0] (default|0 -> off) +% 'specgram' = [srate loHz hiHz frames winframes] decompose a complex time/frequency +% transform of the data (Note: winframes must divide frames) +% (defaults [srate 0 srate/2 size(data,2) size(data,2)]) +% 'posact' = make all component activations net-positive(default 'on'} +% 'verbose' = give ascii messages ('on'/'off') (default -> 'on') +% +% Outputs: [RO: output in reverse order of projected mean variance +% unless starting weight matrix passed ('weights' above)] +% weights = ICA weight matrix (comps,chans) [RO] +% sphere = data sphering matrix (chans,chans) = spher(data) +% Note that unmixing_matrix = weights*sphere {sphering off -> eye(chans)} +% activations = activation time courses of the output components (ncomps,frames*epochs) +% bias = vector of final (ncomps) online bias [RO] (default = zeros()) +% signs = extended-ICA signs for components [RO] (default = ones()) +% [ -1 = sub-Gaussian; 1 = super-Gaussian] +% lrates = vector of learning rates used at each training step +% +% Authors: Scott Makeig with contributions from Tony Bell, Te-Won Lee, +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky, CNL/The Salk Institute, +% La Jolla, 1996- + +% Uses: posact() + +% Reference (please cite): +% +% Makeig, S., Bell, A.J., Jung, T-P and Sejnowski, T.J., +% "Independent component analysis of electroencephalographic data," +% In: D. Touretzky, M. Mozer and M. Hasselmo (Eds). Advances in Neural +% Information Processing Systems 8:145-151, MIT Press, Cambridge, MA (1996). +% +% Toolbox Citation: +% +% Makeig, Scott et al. "EEGLAB: Matlab ICA Toolbox for Psychophysiological Research". +% WWW Site, Swartz Center for Computational Neuroscience, Institute of Neural +% Computation, University of San Diego California +% , 2000. [World Wide Web Publication]. +% +% For more information: +% http://www.sccn.ucsd.edu/eeglab/icafaq.html - FAQ on ICA/EEG +% http://www.sccn.ucsd.edu/eeglab/icabib.html - mss. on ICA & biosignals +% http://www.cnl.salk.edu/~tony/ica.html - math. mss. on ICA + +% Copyright (C) 1996 Scott Makeig et al, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Edit history %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% runica() - by Scott Makeig with contributions from Tony Bell, Te-Won Lee +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky et al. +% CNL / Salk Institute 1996-00 +% 04-30-96 built from icatest.m and ~jung/.../wtwpwica.m -sm +% 07-28-97 new runica(), adds bias (default on), momentum (default off), +% extended-ICA (Lee & Sejnowski, 1997), cumulative angledelta +% (until lrate drops), keywords, signcount for speeding extended-ICA +% 10-07-97 put acos() outside verbose loop; verbose 'off' wasn't stopping -sm +% 11-11-97 adjusted help msg -sm +% 11-30-97 return eye(chans) if sphering 'off' or 'none' (undocumented option) -sm +% 02-27-98 use pinv() instead of inv() to rank order comps if ncomps < chans -sm +% 04-28-98 added 'posact' and 'pca' flags -sm +% 07-16-98 reduced length of randperm() for kurtosis subset calc. -se & sm +% 07-19-98 fixed typo in weights def. above -tl & sm +% 12-21-99 added 'specgram' option suggested by Michael Zibulevsky, UNM -sm +% 12-22-99 fixed rand() sizing inefficiency on suggestion of Mike Spratling, UK -sm +% 01-11-00 fixed rand() sizing bug on suggestion of Jack Foucher, Strasbourg -sm +% 12-18-00 test for existence of Sig Proc Tlbx function 'specgram'; improve +% 'specgram' option arguments -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 lowered default lrate and block -ad +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [weights,sphere,activations,bias,signs,lrates,y] = runica(data,p1,v1,p2,v2,p3,v3,p4,v4,p5,v5,p6,v6,p7,v7,p8,v8,p9,v9,p10,v10,p11,v11,p12,v12,p13,v13,p14,v14) + +if nargin < 1 + help runica + return +end + +if ndims(data) > 2 + data = data(:,:); % make data two-dimensional +elseif ndims(data) < 2 + help runica + return +end + +[chans frames] = size(data); % determine the data size +urchans = chans; % remember original data channels +datalength = frames; +if chans<2 + fprintf('\nrunica() - data size (%d,%d) too small.\n\n', chans,frames); + return +end +% +%%%%%%%%%%%%%%%%%%%%%% Declare defaults used below %%%%%%%%%%%%%%%%%%%%%%%% +% +MAX_WEIGHT = 1e8; % guess that weights larger than this have blown up +DEFAULT_STOP = 0.000001; % stop training if weight changes below this +DEFAULT_ANNEALDEG = 60; % when angle change reaches this value, +DEFAULT_ANNEALSTEP = 0.90; % anneal by multiplying lrate by this +DEFAULT_EXTANNEAL = 0.98; % or this if extended-ICA +DEFAULT_MAXSTEPS = 512; % ]top training after this many steps +DEFAULT_MOMENTUM = 0.0; % default momentum weight + +DEFAULT_BLOWUP = 1000000000.0; % = learning rate has 'blown up' +DEFAULT_BLOWUP_FAC = 0.8; % when lrate 'blows up,' anneal by this fac +DEFAULT_RESTART_FAC = 0.9; % if weights blowup, restart with lrate + % lower by this factor +MIN_LRATE = 0.000001; % if weight blowups make lrate < this, quit +MAX_LRATE = 0.1; % guard against uselessly high learning rate +DEFAULT_LRATE = 0.00065/log(chans); + % heuristic default - may need adjustment + % for large or tiny data sets! +% DEFAULT_BLOCK = floor(sqrt(frames/4)); % heuristic default +DEFAULT_BLOCK = min(floor(5*log(frames)),0.3*frames); % heuristic + % - may need adjustment! +% Extended-ICA option: +DEFAULT_EXTENDED = 0; % default off +DEFAULT_EXTBLOCKS = 1; % number of blocks per kurtosis calculation +DEFAULT_NSUB = 1; % initial default number of assumed sub-Gaussians + % for extended-ICA +DEFAULT_EXTMOMENTUM = 0.5; % momentum term for computing extended-ICA kurtosis +MAX_KURTSIZE = 6000; % max points to use in kurtosis calculation +MIN_KURTSIZE = 2000; % minimum good kurtosis size (flag warning) +SIGNCOUNT_THRESHOLD = 25; % raise extblocks when sign vector unchanged + % after this many steps +SIGNCOUNT_STEP = 2; % extblocks increment factor + +DEFAULT_SPHEREFLAG = 'on'; % use the sphere matrix as the default + % starting weight matrix +DEFAULT_PCAFLAG = 'off'; % don't use PCA reduction +DEFAULT_POSACTFLAG = 'on'; % use posact() +DEFAULT_VERBOSE = 1; % write ascii info to calling screen +DEFAULT_BIASFLAG = 1; % default to using bias in the ICA update rule +% +%%%%%%%%%%%%%%%%%%%%%%% Set up keyword default values %%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargout < 2, + fprintf('runica() - needs at least two output arguments.\n'); + return +end +epochs = 1; % do not care how many epochs in data + +pcaflag = DEFAULT_PCAFLAG; +sphering = DEFAULT_SPHEREFLAG; % default flags +posactflag = DEFAULT_POSACTFLAG; +verbose = DEFAULT_VERBOSE; + +block = DEFAULT_BLOCK; % heuristic default - may need adjustment! +lrate = DEFAULT_LRATE; +annealdeg = DEFAULT_ANNEALDEG; +annealstep = 0; % defaults declared below +nochange = DEFAULT_STOP; +momentum = DEFAULT_MOMENTUM; +maxsteps = DEFAULT_MAXSTEPS; + +weights = 0; % defaults defined below +ncomps = chans; +biasflag = DEFAULT_BIASFLAG; + +extended = DEFAULT_EXTENDED; +extblocks = DEFAULT_EXTBLOCKS; +kurtsize = MAX_KURTSIZE; +signsbias = 0.02; % bias towards super-Gaussian components +extmomentum= DEFAULT_EXTMOMENTUM; % exp. average the kurtosis estimates +nsub = DEFAULT_NSUB; +wts_blowup = 0; % flag =1 when weights too large +wts_passed = 0; % flag weights passed as argument +% +%%%%%%%%%% Collect keywords and values from argument list %%%%%%%%%%%%%%% +% + if (nargin> 1 & rem(nargin,2) == 0) + fprintf('runica(): Even number of input arguments???') + return + end + for i = 3:2:nargin % for each Keyword + Keyword = eval(['p',int2str((i-3)/2 +1)]); + Value = eval(['v',int2str((i-3)/2 +1)]); + if ~isstr(Keyword) + fprintf('runica(): keywords must be strings') + return + end + Keyword = lower(Keyword); % convert upper or mixed case to lower + + if strcmp(Keyword,'weights') | strcmp(Keyword,'weight') + if isstr(Value) + fprintf(... + 'runica(): weights value must be a weight matrix or sphere') + return + else + weights = Value; + wts_passed =1; + end + elseif strcmp(Keyword,'ncomps') + if isstr(Value) + fprintf('runica(): ncomps value must be an integer') + return + end + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + ncomps = Value; + if ~ncomps, + ncomps = chans; + end + elseif strcmp(Keyword,'pca') + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + if isstr(Value) + fprintf(... +'runica(): pca value should be the number of principal components to retain') + return + end + pcaflag = 'on'; + ncomps = Value; + if ncomps >= chans | ncomps < 1, + fprintf('runica(): pca value must be in range [1,%d]\n',chans-1) + return + end + chans = ncomps; + elseif strcmp(Keyword,'posact') + if ~isstr(Value) + fprintf('runica(): posact value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): posact value must be on or off') + return + end + posactflag = Value; + end + elseif strcmp(Keyword,'lrate') + if isstr(Value) + fprintf('runica(): lrate value must be a number') + return + end + lrate = Value; + if lrate>MAX_LRATE | lrate <0, + fprintf('runica(): lrate value is out of bounds'); + return + end + if ~lrate, + lrate = DEFAULT_LRATE; + end + elseif strcmp(Keyword,'block') | strcmp(Keyword,'blocksize') + if isstr(Value) + fprintf('runica(): block size value must be a number') + return + end + block = Value; + if ~block, + block = DEFAULT_BLOCK; + end + elseif strcmp(Keyword,'stop') | strcmp(Keyword,'nochange') ... + | strcmp(Keyword,'stopping') + if isstr(Value) + fprintf('runica(): stop wchange value must be a number') + return + end + nochange = Value; + elseif strcmp(Keyword,'maxsteps') | strcmp(Keyword,'steps') + if isstr(Value) + fprintf('runica(): maxsteps value must be an integer') + return + end + maxsteps = Value; + if ~maxsteps, + maxsteps = DEFAULT_MAXSTEPS; + end + if maxsteps < 0 + fprintf('runica(): maxsteps value (%d) must be a positive integer',maxsteps) + return + end + elseif strcmp(Keyword,'anneal') | strcmp(Keyword,'annealstep') + if isstr(Value) + fprintf('runica(): anneal step value (%2.4f) must be a number (0,1)',Value) + return + end + annealstep = Value; + if annealstep <=0 | annealstep > 1, + fprintf('runica(): anneal step value (%2.4f) must be (0,1]',annealstep) + return + end + elseif strcmp(Keyword,'annealdeg') | strcmp(Keyword,'degrees') + if isstr(Value) + fprintf('runica(): annealdeg value must be a number') + return + end + annealdeg = Value; + if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG; + elseif annealdeg > 180 | annealdeg < 0 + fprintf('runica(): annealdeg (%3.1f) is out of bounds [0,180]',... + annealdeg); + return + + end + elseif strcmp(Keyword,'momentum') + if isstr(Value) + fprintf('runica(): momentum value must be a number') + return + end + momentum = Value; + if momentum > 1.0 | momentum < 0 + fprintf('runica(): momentum value is out of bounds [0,1]') + return + end + elseif strcmp(Keyword,'sphering') | strcmp(Keyword,'sphereing') ... + | strcmp(Keyword,'sphere') + if ~isstr(Value) + fprintf('runica(): sphering value must be on, off, or none') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off') & ~strcmp(Value,'none'), + fprintf('runica(): sphering value must be on or off') + return + end + sphering = Value; + end + elseif strcmp(Keyword,'bias') + if ~isstr(Value) + fprintf('runica(): bias value must be on or off') + return + else + Value = lower(Value); + if strcmp(Value,'on') + biasflag = 1; + elseif strcmp(Value,'off'), + biasflag = 0; + else + fprintf('runica(): bias value must be on or off') + return + end + end + elseif strcmp(Keyword,'specgram') | strcmp(Keyword,'spec') + + if ~exist('specgram') < 2 % if ~exist or defined workspace variable + fprintf(... + 'runica(): MATLAB Sig. Proc. Toolbox function "specgram" not found.\n') + return + end + if isstr(Value) + fprintf('runica(): specgram argument must be a vector') + return + end + srate = Value(1); + if (srate < 0) + fprintf('runica(): specgram srate (%4.1f) must be >=0',srate) + return + end + if length(Value)>1 + loHz = Value(2); + if (loHz < 0 | loHz > srate/2) + fprintf('runica(): specgram loHz must be >=0 and <= srate/2 (%4.1f)',srate/2) + return + end + else + loHz = 0; % default + end + if length(Value)>2 + hiHz = Value(3); + if (hiHz < loHz | hiHz > srate/2) + fprintf('runica(): specgram hiHz must be >=loHz (%4.1f) and <= srate/2 (%4.1f)',loHz,srate/2) + return + end + else + hiHz = srate/2; % default + end + if length(Value)>3 + Hzframes = Value(5); + if (Hzframes<0 | Hzframes > size(data,2)) + fprintf('runica(): specgram frames must be >=0 and <= data length (%d)',size(data,2)) + return + end + else + Hzframes = size(data,2); % default + end + if length(Value)>4 + Hzwinlen = Value(4); + if rem(Hzframes,Hzwinlen) % if winlen doesn't divide frames + fprintf('runica(): specgram Hzinc must divide frames (%d)',Hzframes) + return + end + else + Hzwinlen = Hzframes; % default + end + Specgramflag = 1; % set flag to perform specgram() + + elseif strcmp(Keyword,'extended') | strcmp(Keyword,'extend') + if isstr(Value) + fprintf('runica(): extended value must be an integer (+/-)') + return + else + extended = 1; % turn on extended-ICA + extblocks = fix(Value); % number of blocks per kurt() compute + if extblocks < 0 + nsub = -1*fix(extblocks); % fix this many sub-Gauss comps + elseif ~extblocks, + extended = 0; % turn extended-ICA off + elseif kurtsize>frames, % length of kurtosis calculation + kurtsize = frames; + if kurtsize < MIN_KURTSIZE + fprintf(... + 'runica() warning: kurtosis values inexact for << %d points.\n',... + MIN_KURTSIZE); + end + end + end + elseif strcmp(Keyword,'verbose') + if ~isstr(Value) + fprintf('runica(): verbose flag value must be on or off') + return + elseif strcmp(Value,'on'), + verbose = 1; + elseif strcmp(Value,'off'), + verbose = 0; + else + fprintf('runica(): verbose flag value must be on or off') + return + end + else + fprintf('runica(): unknown flag') + return + end + end +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize weights, etc. %%%%%%%%%%%%%%%%%%%%%%%% +% +if ~annealstep, + if ~extended, + annealstep = DEFAULT_ANNEALSTEP; % defaults defined above + else + annealstep = DEFAULT_EXTANNEAL; % defaults defined above + end +end % else use annealstep from commandline + +if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG - momentum*90; % heuristic + if annealdeg < 0, + annealdeg = 0; + end +end +if ncomps > chans | ncomps < 1 + fprintf('runica(): number of components must be 1 to %d.\n',chans); + return +end + +if weights ~= 0, % initialize weights + % starting weights are being passed to runica() from the commandline + if verbose, + fprintf('Using starting weight matrix named in argument list ...\n') + end + if chans>ncomps & weights ~=0, + [r,c]=size(weights); + if r~=ncomps | c~=chans, + fprintf(... + 'runica(): weight matrix must have %d rows, %d columns.\n', ... + chans,ncomps); + return; + end + end +end; +% +%%%%%%%%%%%%%%%%%%%%% Check keyword values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if frames frames, + fprintf('runica(): block size exceeds data length!\n'); + return +elseif floor(epochs) ~= epochs, + fprintf('runica(): data length is not a multiple of the epoch length!\n'); + return +elseif nsub > ncomps + fprintf('runica(): there can be at most %d sub-Gaussian components!\n',ncomps); + return +end; +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Process the data %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf( ... + '\nInput data size [%d,%d] = %d channels, %d frames.\n', ... + chans,frames,chans,frames); + if strcmp(pcaflag,'on') + fprintf('After PCA dimension reduction,\n finding '); + else + fprintf('Finding '); + end + if ~extended + fprintf('%d ICA components using logistic ICA.\n',ncomps); + else % if extended + fprintf('%d ICA components using extended ICA.\n',ncomps); + if extblocks > 0 + fprintf(... + 'Kurtosis will be calculated initially every %d blocks using %d data points.\n',... + extblocks, kurtsize); + else + fprintf(... + 'Kurtosis will not be calculated. Exactly %d sub-Gaussian components assumed.\n',... + nsub); + end + end + fprintf('Initial learning rate will be %g, block size %d.\n',lrate,block); + if momentum>0, + fprintf('Momentum will be %g.\n',momentum); + end + fprintf( ... +'Learning rate will be multiplied by %g whenever angledelta >= %g deg.\n', ... + annealstep,annealdeg); + fprintf('Training will end when wchange < %g or after %d steps.\n', ... + nochange,maxsteps); + if biasflag, + fprintf('Online bias adjustment will be used.\n'); + else + fprintf('Online bias adjustment will not be used.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%%% Remove overall row means %%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Removing mean of each channel ...\n'); +end +data = data - mean(data')'*ones(1,frames); % subtract row means + +if verbose, + fprintf('Final training data range: %g to %g\n', ... + min(min(data)),max(max(data))); +end +% +%%%%%%%%%%%%%%%%%%% Perform PCA reduction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + fprintf('Reducing the data to %d principal dimensions...\n',ncomps); + [eigenvectors,eigenvalues,data] = pcsquash(data,ncomps); + % make data its projection onto the ncomps-dim principal subspace +end +% +%%%%%%%%%%%%%%%%%%% Perform specgram transformation %%%%%%%%%%%%%%%%%%%%%%% +% +if exist('Specgramflag') == 1 + % [P F T] = SPECGRAM(A,NFFT,Fs,WINDOW,NOVERLAP) % MATLAB Sig Proc Toolbox + % Hzwinlen = fix(srate/Hzinc); % CHANGED FROM THIS 12/18/00 -sm + + Hzfftlen = 2^(ceil(log(Hzwinlen)/log(2))); % make FFT length next higher 2^k + Hzoverlap = 0; % use sequential windows + % + % Get freqs and times from 1st channel analysis + % + [tmp,freqs,tms] = specgram(data(1,:),Hzfftlen,srate,Hzwinlen,Hzoverlap); + + fs = find(freqs>=loHz & freqs <= hiHz); + if isempty(fs) + fprintf('runica(): specified frequency range too narrow!\n'); + return + end; + + specdata = reshape(tmp(fs,:),1,length(fs)*size(tmp,2)); + specdata = [real(specdata) imag(specdata)]; + % fprintf(' size(fs) = %d,%d\n',size(fs,1),size(fs,2)); + % fprintf(' size(tmp) = %d,%d\n',size(tmp,1),size(tmp,2)); + % + % Loop through remaining channels + % + for ch=2:chans + [tmp] = specgram(data(ch,:),Hzwinlen,srate,Hzwinlen,Hzoverlap); + tmp = reshape((tmp(fs,:)),1,length(fs)*size(tmp,2)); + specdata = [specdata;[real(tmp) imag(tmp)]]; % channels are rows + end + % + % Print specgram confirmation and details + % + fprintf(... + 'Converted data to %d channels by %d=2*%dx%d points spectrogram data.\n',... + chans,2*length(fs)*length(tms),length(fs),length(tms)); + if length(fs) > 1 + fprintf(... + ' Low Hz %g, high Hz %g, Hz incr %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),freqs(fs(2))-freqs(fs(1)),Hzwinlen); + else + fprintf(... + ' Low Hz %g, high Hz %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),Hzwinlen); + end + % + % Replace data with specdata + % + data = specdata; + datalength=size(data,2); +end +% +%%%%%%%%%%%%%%%%%%% Perform sphering %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmp(sphering,'on'), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if verbose, + fprintf('Computing the sphering matrix...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + if ~weights, + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights given on commandline + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + end + end + if verbose, + fprintf('Sphering the data ...\n'); + end + data = sphere*data; % actually decorrelate the electrode signals + +elseif strcmp(sphering,'off') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~weights + if verbose, + fprintf('Using the sphering matrix as the starting weight matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + weights = eye(ncomps,chans)*sphere; % begin with the identity matrix + sphere = eye(chans); % return the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = eye(chans); % return the identity matrix + end +elseif strcmp(sphering,'none') + sphere = eye(chans); % return the identity matrix + if ~weights + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + end + sphere = eye(chans,chans); + if verbose, + fprintf('Returned variable "sphere" will be the identity matrix.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize ICA training %%%%%%%%%%%%%%%%%%%%%%%%% +% + lastt=fix((datalength/block-1)*block+1); + BI=block*eye(ncomps,ncomps); + delta=zeros(1,chans*ncomps); + changes = []; + degconst = 180./pi; + startweights = weights; + prevweights = startweights; + oldweights = startweights; + prevwtchange = zeros(chans,ncomps); + oldwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + onesrow = ones(1,block); + bias = zeros(ncomps,1); + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + if extended & extblocks < 0 & verbose, + fprintf('Fixed extended-ICA sign assignments: '); + for k=1:ncomps + fprintf('%d ',signs(k)); + end; fprintf('\n'); + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs));; + signcount = 0; % counter for same-signs + signcounts = []; + urextblocks = extblocks; % original value, for resets + old_kk = zeros(1,ncomps); % for kurtosis momemtum +% +%%%%%%%% ICA training loop using the logistic sigmoid %%%%%%%%%%%%%%%%%%% +% + if verbose, + fprintf('Beginning ICA training ...'); + if extended, + fprintf(' first training step may be slow ...\n'); + else + fprintf('\n'); + end + end + step=0; + laststep=0; + blockno = 1; % running block counter for kurtosis interrupts + + while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % permute=randperm(datalength); % shuffle data order at each step + bootstrap = round(datalength*rand(1,datalength)+0.5); % draw a new bootstrap dataset at each step + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) & strcmp(get(gcf, 'tag'), 'stop') + close; error('USER ABORT'); + end; + if biasflag + u=weights*data(:,bootstrap(t:t+block-1)) + bias*onesrow; + else + u=weights*data(:,bootstrap(t:t+block-1)); + end + if ~extended + %%%%%%%%%%%%%%%%%%% Logistic ICA weight update %%%%%%%%%%%%%%%%%%% + y=1./(1+exp(-u)); % + weights=weights+lrate*(BI+(1-2*y)*u')*weights; % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % extended-ICA + %%%%%%%%%%%%%%%%%%% Extended-ICA weight update %%%%%%%%%%%%%%%%%%% + y=tanh(u); % + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + if biasflag + if ~extended + %%%%%%%%%%%%%%%%%%%%%%%% Logistic ICA bias %%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((1-2*y)')'; % for logistic nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % extended + %%%%%%%%%%%%%%%%%%% Extended-ICA bias %%%%%%%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((-2*y)')'; % for tanh() nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + end + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if extended & ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + % + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=weights*data(:,rp(1:kurtsize)); + else % for small data sets, + partact=weights*data; % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if extended %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + end % training block %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + fprintf(''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + if extended + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs));; + end + if lrate> MIN_LRATE + r = rank(data); + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + if verbose, + if step > 2, + if ~extended, + fprintf(... + 'step %d - lrate %5f, wchange %7.6f, angledelta %4.1f deg\n', ... + step,lrate,change,degconst*angledelta); + else + fprintf(... +'step %d - lrate %5f, wchange %7.6f, angledelta %4.1f deg, %d subgauss\n',... + step,lrate,change,degconst*angledelta,(ncomps-sum(diag(signs)))/2); + end + elseif ~extended + fprintf(... + 'step %d - lrate %5f, wchange %7.6f\n',step,lrate,change); + else + fprintf(... + 'step %d - lrate %5f, wchange %7.6f, %d subgauss\n',... + step,lrate,change,(ncomps-sum(diag(signs)))/2); + end % step > 2 + end; % if verbose +% +%%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + changes = [changes change]; + oldweights = weights; +% +%%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end +% +%%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end training %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~laststep + laststep = step; + end; + lrates = lrates(1,1:laststep); % truncate lrate history vector + % + %%%%%%%%%%%%%% Orient components towards max positive activation %%%%%% + % + if strcmp(posactflag,'on') + [activations,winvout,weights] = posact(data,weights); + % changes signs of activations and weights to make activations + % net rms-positive + else + activations = weights*data; + end + % + %%%%%%%%%%%%%% If pcaflag, compose PCA and ICA matrices %%%%%%%%%%%%%%% + % + if strcmp(pcaflag,'on') + fprintf('Composing the eigenvector, weights, and sphere matrices\n'); + fprintf(' into a single rectangular weights matrix; sphere=eye(%d)\n'... + ,chans); + weights= weights*sphere*eigenvectors(:,1:ncomps)'; + sphere = eye(urchans); + end + % + %%%%%% Sort components in descending order of max projected variance %%%% + % + if verbose, + fprintf(... + 'Sorting components in descending order of mean projected variance ...\n'); + end + if wts_passed == 0 + % + %%%%%%%%%%%%%%%%%%%% Find mean variances %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + meanvar = zeros(ncomps,1); % size of the projections + if ncomps == urchans % if weights are square . . . + winv = inv(weights*sphere); + else + fprintf('Using pseudo-inverse of weight matrix to rank order component projections.\n'); + winv = pinv(weights*sphere); + end + for s=1:ncomps + if verbose, + fprintf('%d ',s); % construct single-component data matrix + end + % project to scalp, then add row means + compproj = winv(:,s)*activations(s,:); + meanvar(s) = mean(sum(compproj.*compproj)/(size(compproj,1)-1)); + % compute mean variance + end % at all scalp channels + if verbose, + fprintf('\n'); + end + % + %%%%%%%%%%%%%% Sort components by mean variance %%%%%%%%%%%%%%%%%%%%%%%% + % + [sortvar, windex] = sort(meanvar); + windex = windex(ncomps:-1:1); % order large to small + meanvar = meanvar(windex); + % + %%%%%%%%%%%%%%%%%%%%% Filter data using final weights %%%%%%%%%%%%%%%%%% + % + if nargout>2, % if activations are to be returned + if verbose, + fprintf('Permuting the activation wave forms ...\n'); + end + activations = activations(windex,:); + else + clear activations + end + weights = weights(windex,:);% reorder the weight matrix + bias = bias(windex); % reorder them + signs = diag(signs); % vectorize the signs matrix + signs = signs(windex); % reorder them +else + fprintf('Components not ordered by variance.\n'); +end +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +return + +if nargout > 6 + u=weights*data + bias*ones(1,frames); + y = zeros(size(u)); + for c=1:chans + for f=1:frames + y(c,f) = 1/(1+exp(-u(c,f))); + end + end +end + diff --git a/code/eeglab13_4_4b/functions/miscfunc/runpca.m b/code/eeglab13_4_4b/functions/miscfunc/runpca.m new file mode 100644 index 0000000..3550e12 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/runpca.m @@ -0,0 +1,102 @@ +% runpca() - perform principal component analysis (PCA) using singular value +% decomposition (SVD) using Matlab svd() or svds() +% >> inv(eigvec)*data = pc; +% Usage: +% >> [pc,eigvec,sv] = runpca(data); +% >> [pc,eigvec,sv] = runpca(data,num,norm) +% +% Inputs: +% data - input data matrix (rows are variables, columns observations) +% num - number of principal comps to return {def|0|[] -> rows in data} +% norm - 1/0 = do/don't normalize the eigvec's to be equivariant +% {def|0 -> no normalization} +% Outputs: +% pc - the principal components, i.e. >> inv(eigvec)*data = pc; +% eigvec - the inverse weight matrix (=eigenvectors). >> data = eigvec*pc; +% sv - the singular values (=eigenvalues) +% +% Author: Colin Humphries, CNL / Salk Institute, 1997 +% +% See also: runica() + +% Copyright (C) Colin Humphries, CNL / Salk Institute, Aug, 1997 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01/31/00 renamed runpca() and improved usage message -sm +% 01-25-02 reformated help & license, added links -ad + +function [pc,M,S] = runpca(data,N,norm) + +BIG_N = 50; % for efficiency, switch to sdvs() when BIG_N<=N or N==rows + +if nargin < 1 + help runpca + return +end + +rows = size(data,1); + +% remove the mean +for i = 1:rows + data(i,:) = data(i,:) - mean(data(i,:)); +end + +if nargin < 3 + norm = 0; +elseif isempty(norm) + norm = 0; +end + +if nargin < 2 + N = 0; +end +if isempty(N) + N = 0; +end + + +if N == 0 | N == rows + N = rows; + [U,S,V] = svd(data',0); % performa SVD + if norm == 0 + pc = U'; + M = (S*V')'; + else % norm + pc = (U*S)'; + M = V; + end +else + if N > size(data,1) + error('N must be <= the number of rows in data.') + end + %if N <= BIG_N | N == rows + %[U,S,V] = svd(data',0); + %else + [U,S,V] = svds(data',N); + %end + if norm == 0 + pc = U'; + M = (S*V')'; + else % norm + pc = (U*S)'; + M = V; + end + %if N > BIG_N & N < rows + %pc = pc(1:N,:); + %M = M(:,1:N); + %end +end +%S = diag(S(1:N,1:N)); diff --git a/code/eeglab13_4_4b/functions/miscfunc/runpca2.m b/code/eeglab13_4_4b/functions/miscfunc/runpca2.m new file mode 100644 index 0000000..347d9eb --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/runpca2.m @@ -0,0 +1,70 @@ +% runpca() - perform principal component analysis (PCA) using singular value +% decomposition (SVD) using Matlab svd() or svds() +% >> inv(eigvec)*data = pc; +% Usage: +% >> [pc,eigvec,sv] = runpca(data); +% >> [pc,eigvec,sv] = runpca(data,num,norm) +% +% Inputs: +% data - input data matrix (rows are variables, columns observations) +% num - number of principal comps to return {def|0|[] -> rows in data} +% norm - 1/0 = do/don't normalize the eigvec's to be equivariant +% {def|0 -> no normalization} +% Outputs: +% pc - the principal components, i.e. >> inv(eigvec)*data = pc; +% eigvec - the inverse weight matrix (=eigenvectors). >> data = eigvec*pc; +% sv - the singular values (=eigenvalues) +% +% Author: Colin Humphries, CNL / Salk Institute, 1997 +% +% See also: runica() + +% Copyright (C) Colin Humphries, CNL / Salk Institute, Aug, 1997 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01/31/00 renamed runpca() and improved usage message -sm +% 01-25-02 reformated help & license, added links -ad + +function [pc,A,sv]= runpca2(data,K,dosym) +[chans,frames] = size(data); + +if nargin < 3 || K < chans + dosym = 1; +end +if nargin < 2 + K = chans; +end +if nargin < 1 + help runpca + return +end + +% remove the mean +for i = 1:chans + data(i,:) = data(i,:) - mean(data(i,:)); +end + +% do svd +[U,S,V] = svd(data*data'/frames); % U and V should be the same since data*data' is symmetric + +sv = sqrt(diag(S)); +if dosym == 1 + pc = pinv(diag(sv(1:K))) * V(:,1:K)' * data; + A = U(:,1:K) * diag(sv(1:K)); +else + pc = U * pinv(diag(sv)) * V' * data; + A = U * diag(sv) * V'; +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/scanfold.m b/code/eeglab13_4_4b/functions/miscfunc/scanfold.m new file mode 100644 index 0000000..0bba0f5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/scanfold.m @@ -0,0 +1,59 @@ +% scanfold() - scan folder content +% +% Usage: +% >> [cellres textres] = scanfold(foldname); +% >> [cellres textres] = scanfold(foldname, ignorelist, maxdepth); +% +% Inputs: +% foldname - [string] name of the folder +% ignorelist - [cell] list of folders to ignore +% maxdepth - [integer] maximum folder depth +% +% Outputs: +% cellres - cell array containing all the files +% textres - string array containing all the names preceeded by "-a" +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, 2009 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ cellres, textres ] = scanfold(foldname, ignorelist, maxdepth) + +if nargin < 2, ignorelist = {}; end; +if nargin < 3, maxdepth = 100; end; +foldcontent = dir(foldname); +textres = ''; +cellres = {}; +if maxdepth == 0, return; end; +for i = 1:length(foldcontent) + if (exist(foldcontent(i).name) == 7 || strcmpi(foldcontent(i).name, 'functions')) && ~ismember(foldcontent(i).name, ignorelist) + if ~strcmpi(foldcontent(i).name, '..') && ~strcmpi(foldcontent(i).name, '.') + disp(fullfile(foldname, foldcontent(i).name)); + [tmpcellres tmpres] = scanfold(fullfile(foldname, foldcontent(i).name), ignorelist, maxdepth-1); + textres = [ textres tmpres ]; + cellres = { cellres{:} tmpcellres{:} }; + end; + elseif length(foldcontent(i).name) > 2 + if strcmpi(foldcontent(i).name(end-1:end), '.m') + textres = [ textres ' -a ' foldcontent(i).name ]; + cellres = { cellres{:} foldcontent(i).name }; + end; + else + disp( [ 'Skipping ' fullfile(foldname, foldcontent(i).name) ]); + end; +end; +return; diff --git a/code/eeglab13_4_4b/functions/miscfunc/seemovie.m b/code/eeglab13_4_4b/functions/miscfunc/seemovie.m new file mode 100644 index 0000000..be824bb --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/seemovie.m @@ -0,0 +1,78 @@ +% seemovie() - see an EEG movie produced by eegmovie() +% +% Usage: >> seemovie(Movie,ntimes,Colormap) +% +% Inputs: +% Movie = Movie matrix returned by eegmovie() +% ntimes = Number of times to display {0 -> -10} +% If ntimes < 0, movie will play forward|backward +% Colormap = Color map returned by eegmovie() {0 -> default} +% +% Author: Scott Makeig & Colin Humphries, CNL / Salk Institute, 6/3/97 +% +% See also: eegmovie() + +% Copyright (C) 6/3/97 Scott Makeig & Colin Humphries, CNL / Salk Institute, La Jolla CA +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 10-31-97 changed test for user-defined colormap -ch & sm +% 1-8-98 added '\n' at end, improved help msg -sm +% 01-25-02 reformated help, added link -ad + +function seemovie(Movie,ntimes,Colormap) + +fps = 10; % projetion speed (requested frames per second) + +if nargin<1 + help seemovie + return +end +if nargin<3 + Colormap = 0; +end +if nargin<2 + ntimes = -10; % default to playing foward|backward endlessly +end +if ntimes == 0 + ntimes = -10; +end + +clf +axes('Position',[0 0 1 1]); +if size(Colormap,2) == 3 % if colormap user-defined + colormap(Colormap) +else + colormap([jet(64);0 0 0]); % set up the default topoplot color map +end + +if ntimes > 0, + fprintf('Movie will play slowly once, then %d times faster.\n',ntimes); +else + fprintf('Movie will play slowly once, then %d times faster forwards and backwards.\n',-ntimes); +end +if abs(ntimes) > 7 + fprintf(' Close figure to abort: '); +end + +%%%%%%%%%%%%%%%%%%%%%%%% Show the movie %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +movie(Movie,ntimes,fps); + +%%%%%%%%%%%%%%%%%%%%%%%% The End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if abs(ntimes) > 7 + fprintf('\n'); +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/setfont.m b/code/eeglab13_4_4b/functions/miscfunc/setfont.m new file mode 100644 index 0000000..8b670f8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/setfont.m @@ -0,0 +1,101 @@ +% setfont() - Change all the fonts properties of a figure. +% +% Usage: +% >> newdata = setfont( handle, 'key', 'val'); +% >> [newdata chlab] = setfont( handle, 'key' , 'val', ... ); +% >> [newdata chlab] = setfont( handle, 'handletype', handletypevalue, 'key' , 'val', ... ); +% +% Inputs: +% handle - [gcf,gca] figure or plot handle +% 'handletype' - ['xlabels'|'ylabels'|'titles'|'axis'|'strings'] only apply +% formating to selected category. Note that this has to be the +% first optional input. +% properties - 'key', 'val' properties for the figure +% +% Exemple: +% setfont(gcf, 'fontweight', 'normal', 'fontsize', 14); +% +% Author: Arnaud Delorme, CNL / Salk Institute - SCCN, 25 Oct 2002 + +% Copyright (C) 2003 Arnaud Delorme, CNL / Salk Institute - SCCN, La Jolla +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function setfont(fig, varargin); + + if nargin < 1 + help setfont; + return; + end; + + if strcmpi(varargin{1}, 'handletype') + label = varargin{2}; + varargin = varargin(3:end); + else + label = ''; + end; + [hx, hy, hti, hgca, hstr] = findallobjects(fig); + + % select a specified category + % --------------------------- + if isempty(label) + h = [hx, hy, hti, hgca, hstr]; + else + switch lower(label), + case 'xlabels', h =hx; + case 'ylabels', h =hy; + case 'titles', h =hti; + case 'axis', h =hgca; + case 'strings', h =hstr; + otherwise, error('Unrecognized ''labels'''); + end; + end; + + % apply formating + % --------------- + for index = 1:length(h) + isaxis = 0; + try, get(h(index), 'xtick'); isaxis = 1; catch, end; + if isaxis + set(h(index), 'XTickLabelMode', 'manual', 'XTickMode', 'manual'); + set(h(index), 'YTickLabelMode', 'manual', 'YTickMode', 'manual'); + end; + for tmpprop = 1:2:length(varargin) + if strcmpi(varargin{tmpprop}, 'color') & isaxis + set(h(index), 'xcolor', varargin{tmpprop+1}, ... + 'ycolor', varargin{tmpprop+1}, ... + 'zcolor', varargin{tmpprop+1}); + else + try, + set(h(index), varargin{tmpprop}, varargin{tmpprop+1}); + catch, end; + end; + end; + end; + +function [hx, hy, hti, hgca, hstr] = findallobjects(fig); + handles = findobj(fig)'; + hx = []; + hy = []; + hti = []; + hgca = []; + hstr = []; + for index = 1:length(handles) + try, hx = [ hx get(handles(index), 'xlabel') ]; catch, end; + try, hy = [ hy get(handles(index), 'ylabel') ]; catch, end; + try, hti = [ hti get(handles(index), 'title') ]; catch, end; + try, get(handles(index), 'xtick'); hgca = [ hgca handles(index) ]; catch, end; + try, get(handles(index), 'string'); hstr = [ hstr handles(index) ]; catch, end; + end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/shortread.m b/code/eeglab13_4_4b/functions/miscfunc/shortread.m new file mode 100644 index 0000000..d29e4a6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/shortread.m @@ -0,0 +1,77 @@ +% shortread() - Read matrix from short file. +% +% Usage: +% >> A = shortread(filename,size,'format',offset) +% +% Inputs: +% filename - Read matrix a from specified file while assuming four byte +% short integers. +% size - The vector SIZE determine the number of short elements to be +% read and the dimensions of the resulting matrix. If the last +% element of SIZE is INF the size of the last dimension is determined +% by the file length. +% +% Optional inputs: +% 'format' - The option FORMAT argument specifies the storage format as +% defined by fopen(). Default format ([]) is 'native'. +% offset - The option OFFSET is offset in shorts from the beginning of file (=0) +% to start reading (2-byte shorts assumed). +% It uses fseek to read a portion of a large data file. +% +% Author: Sigurd Enghoff, CNL / Salk Institute, La Jolla, 7/1998 +% +% See also: floatread(), floatwrite(), fopen() + +% Copyright (C) Sigurd Enghoff, CNL / Salk Institute, La Jolla, 7/1998 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% xx-07-98 written by Sigurd Enghoff, Salk Institute +% 04-26-99 modified by Sigurd Enghoff to handle variable-sized and +% multi-dimensional data. +% 07-08-99 modified by Sigurd Enghoff, FORMAT argument added. +% 02-08-00 help updated for toolbox inclusion -sm +% 02-14-00 added segment arg -sm + +function A = shortread(fname,Asize,fform,offset) + +if ~exist('fform') | isempty(fform)|fform==0 + fform = 'native'; +end + +fid = fopen(fname,'rb',fform); +if fid>0 + if exist('offset') + stts = fseek(fid,2*offset,'bof'); + if stts ~= 0 + error('shortread(): fseek() error.'); + return + end + end + A = fread(fid,prod(Asize),'short'); +else + error('shortread(): fopen() error.'); + return +end +fprintf(' %d shorts read\n',prod(size(A))); + +if Asize(end) == Inf + Asize = Asize(1:end-1); + A = reshape(A,[Asize length(A)/prod(Asize)]); +else + A = reshape(A,Asize); +end + +fclose(fid); diff --git a/code/eeglab13_4_4b/functions/miscfunc/show_events.m b/code/eeglab13_4_4b/functions/miscfunc/show_events.m new file mode 100644 index 0000000..ad6ca95 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/show_events.m @@ -0,0 +1,197 @@ +% show_events() - Display events in epochs. Events selected by +% make_timewarp() function can be optionally highlighted. +% Each epoch is visualized as a row in the output image with +% events marked by colored rectangles. +% +% Usage: +% >> im = show_events(EEG, 'key1',value1,'key2',value2,...); +% +% Inputs: +% +% EEG - dataset structure. +% +% +% Optional inputs (in 'key', value format): +% +% 'eventThicknessCoef' - (positive number) adjust the thickness of event +% markers in the image. The default value is 1. +% Lower values reduce thickness and higher values +% increase it. For example, to decrease event +% rectangle width by half, set this parameter to +% 0.5. {default: 1} +% 'eventNames' - a cell array containing names of events to be +% displayed. Order and repetition are ignored. +% {default: all events if timeWarp is not provided) +% +% 'timeWarp' - a structure with latencies (time-warp matrix +% for newtimef function) and epochs with correct +% sequence created by make_timewarp() function. +% the subsets {default: false|0) +% Outputs: +% +% im - color (RGB) image showing events of interest in +% epochs. +% +% Example: +% +% % To display all events in data structure EEG +% >> show_events(EEG); +% +% % To highlight events selected by make_timewarp() function with thin +% % event markers +% >> show_events(EEG, 'eventThicknessCoef', 0.5, 'eventNames', timeWarp.eventSequence, +% 'timeWarp', timeWarp); +% +% Version 1.1 +% Author: Nima Bigdely Shamlo, SCCN/INC/UCSD, 2008 +% See also: make_timewarp(), newtimef() +function im = show_events(EEG, varargin) + + +%% check inputs +EEG = change_events_to_string(EEG); + +inputKeyValues = finputcheck(varargin, ... + {'eventThicknessCoef' 'real' [0 Inf] 1; ... + 'eventNames' 'cell' {} {} ; ... + 'timeWarp' 'struct' [] struct([]); ... + }); + +eventThicknessCoef = 0; +eventNames = {}; +timeWarp=[]; + +% place key values into function workspace variables +inputKeyValuesFields = fieldnames(inputKeyValues); +for i=1:length(inputKeyValuesFields) + eval([inputKeyValuesFields{i} '= inputKeyValues.' inputKeyValuesFields{i} ';']); +end; + +if length(eventNames) == 0 + if length(timeWarp) == 0 + eventNames = []; + for i=1:length(EEG.epoch) + eventNames = [eventNames EEG.epoch(i).eventtype]; + end; + else + for i=1:length(timeWarp.eventSequence) + if ischar(timeWarp.eventSequence{i}) + eventNames = [eventNames timeWarp.eventSequence{i}]; + else % in case it is a cell of strings + for j=1:length(timeWarp.eventSequence{i}) + eventNames = [eventNames timeWarp.eventSequence{i}{j}]; + end; + end + end; + % eventNames = timeWarp.eventSequence; % if event names is not provided only show timeWarp events + end +end; + +if length(timeWarp) == 0 + timeWarp=[]; + timeWarp.latencies = []; + timeWarp.epochs = 1:length(EEG.epoch); +end; +%% set image parameters + +imWidth = 300*4; +imHeight = 240*4; +im = double(zeros(imHeight, imWidth, 3)); + +%% find latencies for events of interest in each epoch + +uniqueEventNames = uniqe_cell_string(eventNames); +for epochNumber = 1:length(EEG.epoch) + for eventNumber = 1:length(uniqueEventNames) + ids = find(strcmp(EEG.epoch(epochNumber).eventtype,uniqueEventNames{eventNumber})); % index for events with this type in the current epoch + latency{epochNumber, eventNumber} = cell2mat(EEG.epoch(epochNumber).eventlatency(ids)); + end; +end; + +%% find a good default value for event marker width based on quantiles +% of inter-event latencies. + +intervals = []; +for i=1:size(latency,1) + intervals = [intervals diff(sort(cell2mat(latency(i,:)),'ascend'))]; %#ok +end; + +if isempty(intervals) + eventLineWidth = 0.05*eventThicknessCoef; +else + eventLineWidth = round(eventThicknessCoef * 0.5 * imWidth * -quantile(-intervals,0.8) / ((EEG.xmax - EEG.xmin)*1000)); +end; + + +%% place colored rectangle block o image to display events +eventColors = lines(length(uniqueEventNames)); +for epochNumber = 1:length(EEG.epoch) + for eventNumber = 1:length(uniqueEventNames) + for eventInstanceNumber = 1:length(latency{epochNumber, eventNumber}) + startHeight = max(1,round((epochNumber - 1) * imHeight/ length(EEG.epoch))); + endHeight = min(imHeight, round((epochNumber) * imHeight/ length(EEG.epoch))); + startWidth = max(1,round(-eventLineWidth/2 + imWidth * (latency{epochNumber, eventNumber}(eventInstanceNumber) - (EEG.xmin*1000))/ ((EEG.xmax - EEG.xmin)*1000))); + endWidth = min(imWidth,startWidth + eventLineWidth); + colorForEvent = eventColorBasedOnTypeAndAcceptance(eventColors, eventNumber, epochNumber, latency{epochNumber, eventNumber}(eventInstanceNumber), timeWarp); + for c = 1:3 % to make sure the highlighted events are not overwritten by other events in the image, we use 'max' and give the brightest color priority + im(startHeight:endHeight,startWidth:endWidth,c) = max(im(startHeight:endHeight,startWidth:endWidth,c), colorForEvent(c)); + end; + end; + end; +end; + +%% plot image with legend and axis labels + +figure; +hold on; +for i=1:length(uniqueEventNames) + plot([0 0],rand * [0 0],'Color',eventColors(i,:),'linewidth',10); + uniqueEventNames{i} = strrep(uniqueEventNames{i},'_','-'); % replace _ with - so it is displayed correctly in the legend +end; + +legend(uniqueEventNames, 'Location', 'NorthWest'); + + +image(round([EEG.xmin*1000 EEG.xmax*1000 ]), [1 length(EEG.epoch)],im); +xlim(round([EEG.xmin*1000 EEG.xmax*1000 ])) +ylim([1 length(EEG.epoch)]) +axis normal; +xlabel('Latency', 'fontsize',16); +xlabel('Latency', 'fontsize',16); +ylabel('Epochs', 'fontsize',16); + +if nargout == 0 % supress output if not requested + clear im ; +end; + + + +function color = eventColorBasedOnTypeAndAcceptance(eventColors, eventNumber, epochNumber, eventLatency,timeWarp) +accepted = ismember_bc(epochNumber, timeWarp.epochs); +if ~isempty(timeWarp.latencies) + matchedEpoch = find(timeWarp.epochs == epochNumber); + accepted = accepted && ~isempty(find(timeWarp.latencies(matchedEpoch,:) == eventLatency, 1)); +end; + +color = eventColors(eventNumber,:); + +if ~accepted + color = color*0.3; % dim the color of unaccepted events. +end; + +function EEG = change_events_to_string(EEG) +needChange = false; +for i=1:length(EEG.event) + if ~ischar(EEG.event(i).type) + EEG.event(i).type = num2str( EEG.event(i).type ); + needChange = true; + end; +end; + +if needChange + for e=1:length(EEG.epoch) + for i=1:length(EEG.epoch(e).eventtype) + EEG.epoch(e).eventtype(i) = {num2str(cell2mat(EEG.epoch(e).eventtype(i)))}; + end; + end; +end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/testica.m b/code/eeglab13_4_4b/functions/miscfunc/testica.m new file mode 100644 index 0000000..1bd4831 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/testica.m @@ -0,0 +1,256 @@ +% testica() - Test the runica() function's ability to separate synthetic sources. +% Use the input variables to estimate the (best) decomposition accuracy +% for a given data set size. +% Usage: +% >> testica(channels,frames); % No return variable -> plot results +% >> [testresult] = testica(channels,frames,sources,exppow,shape); +% % Return variable -> return results with no plots +% Inputs: +% channels = number of simulated data channels {no default} +% frames = number of simulated time points {no default} +% sources = number of simulated quasi-independent sources {default: =channels} +% exppow = exponential power for scaling size of the sources (0->all equal) +% {default: -0.05 -> Ex: 14 sources scaled between 1.0 and 0.24} +% shape = varies monotonically with kurtosis of the simulated sources +% {default: 1.2 -> source kurtosis near 1 (super-Gaussian>0)} +% +% Authors: Scott Makeig & Te-Won Lee, SCCN/INC/UCSD, La Jolla, 2-27-1997 +% +% See also: runica() + +% Copyright (C) 2-27-97 Scott Makeig & Te-Won Lee, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 2-28-97 added source, shape and exppow parameters, kurtosis -sm +% 4-03-97 shortened name to testica() -sm +% 4-14-97 changed call to runica() to use new variable order -sm +% 4-16-97 prints max and min abs corr -sm +% 7-10-97 changed to newrunica(), added surf() plot -sm +% 7-30-97 altered runica() call to fit version 3.0 -sm +% 3-02-00 replaced idit() call with call to Benjamin Blankertz' eyeLike() -sm +% 3-08-00 added kurt and exppow plots, changed defaults, added plot labels -sm +% 01-25-02 reformated help & license, added links -ad + +function [testresult] = testica(channels,frames,sources,exppow,shape) + +icadefs; % read BACKCOLOR + +% Default runica() parameter values: + +block = 0; % default block size +lrate = 0; % default starting lrate +adeg = 0; % default annealing threshold +maxsteps = 0; % default +sphereflag = 'on'; % default yes, perform sphering +stop = 0.000001; % default stopping wchange + +% Defaults: + +default_chans = 31; +default_frames = 10000; +% default sources = channels +default_exppow = -0.05; +default_shape = 1.2; +plotflag = 1; +try, plotflag = ismatlab; catch, end; + +if nargin<2 + help testica + return +end +if nargin<5 + shape = default_shape; +end +if nargin<4 + exppow = default_exppow; +end +if nargin<3, + sources = 0; +end +if nargin<2 + frames = 0; +end +if nargin < 1 + channels = 0; +end +if frames == 0, + frames = default_frames; +end +if channels == 0, + channels = default_chans; +end +if sources == 0, + sources = channels; +end + +if sources < channels, + fprintf('testica() - sources must be >= channels.\n'); + exit 1 +end + +% Generate artificial super-Gaussian sources: + +fprintf('\n Testing runica() using %d simulated sources.\n\n',sources); +fprintf('Computing %d simulated source activations of length %d ...\n', ... + sources,frames); +fprintf('Simulated source strengths: %4.3f to %4.3f.\n', ... + 1.0, exp(exppow*(channels-1))); +exppowers = zeros(1,channels); +exppowers(1) = 1.0; +for s=1:sources + exppowers(s) = exp(exppow*(s-1)); +end + +% Synthesize random source activations + +super=randn(sources,frames).*(exppowers'*ones(1,frames)); +super=sign(super).*abs(super.^shape); % make super-Gaussian if shape > 1 +% fprintf('Size of super = %d,%d\n',size(super,1),size(super,2)); + +if frames > 40 && plotflag + figure + pos = get(gcf,'position'); + off = [40 -40 0 0]; % succeeding figure screen position offsets + + hist(super(1,:),round(frames/20)); + tt=title('Amplitude distribution of source 1'); + set(tt,'fontsize',14); + xlm=get(gca,'xlim'); + ylm=get(gca,'ylim'); + kurttext = ['Kurtosis = ' num2str(kurt(super(1,:)),3)]; + tp=[xlm;ylm]*[0.25;0.75]; + kt=text(tp(1),tp(2),kurttext); + set(kt,'fontsize',13); + set(kt,'horizontalalignment','center'); +else + fprintf('Not plotting source amplitude histogram: data length too small.\n') +end + +if nargout == 0 && plotflag + input('Hit enter to view source strengths: '); + fprintf('\n') + if frames <= 40 + figure + pos = get(gcf,'position'); + else + figure('position',pos+off); + end + plot(1:sources,exppowers); + hold on;plot(1:sources,exppowers,'r^'); + set(gca,'xlim',[0 sources+1]); + set(gca,'ylim',[0 1]); + xt=title(['Relative source amplitudes (exppow = ' num2str(exppow,3) ')']); + set(xt,'fontsize',14); + axl=xlabel('Source Number'); + ayl=ylabel('Relative Amplitude'); + set(axl,'fontsize',14); + set(ayl,'fontsize',14); +end + +k = kurt(super'); % find kurtosis of rows of super +maxkurt = max(k); minkurt=min(k); +fprintf('Simulated source kurtosis: %4.3f to %4.3f.\n',minkurt,maxkurt); + +tmp = corrcoef(super'); +i = find(tmp<1); +minoff = min(abs(tmp(i))); +maxoff = max(abs(tmp(i))); +fprintf('Absolute correlations between sources range from %5.4f to %5.4f\n', ... + minoff,maxoff); + +fprintf('Mixing the simulated sources into %d channels ...\n',channels); +forward = randn(channels,sources); % random forward mixing matrix +data = forward*super; % these are the simulated observed data +if nargout == 0 + input('Hit enter to start ICA decomposition: ') + fprintf('\n') +end + +fprintf('Decomposing the resulting simulated data using runica() ...\n'); + [weights,sphere,compvars,bias,signs,lrates,activations] = runica(data, ... + 'block',block, ... + 'lrate',lrate, ... + 'nochange',stop, ... + 'annealdeg',adeg, ... + 'maxsteps',maxsteps, ... + 'sphering',sphereflag, 'weights',eye(channels)); + +fprintf('ICA decomposition complete.\n'); + +% Alternatively, activations = icaact(data,weights,sphere,datamean); + +fprintf('\nScaling and row-permuting the resulting performance matrix ...\n') +testid = weights*sphere*forward(:,1:channels); + % if separation were complete, this + % would be a scaled and row-permuted + % identity matrix +testresult = eyelike(testid); % permute output matrix rows to rememble eye() + % using Benjamin Blankertz eyeLike() - 3/2/00 +% testresult = idit(testid); % permute output matrix rows to rememble eye() + % scale to make max column elements all = 1 + +tmp = corrcoef(activations'); +i = find(tmp<1); +maxoff = max(abs(tmp(i))); +minoff = min(abs(tmp(i))); +fprintf('Absolute activation correlations between %5.4f and %5.4f\n',minoff,maxoff); + +i = find(testresult<1); % find maximum abs off-diagonal value +maxoff = max(abs(testresult(i))); +meanoff = mean(abs(testresult(i))); +if sources > channels, + fprintf('The returned matrix measures the separation'); + fprintf('of the largest %d simulated sources,\n',channels); +end + +fprintf('Perfect separation would return an identity matrix.\n'); +fprintf('Max absolute off-diagonal value in the returned matrix: %f\n',maxoff); +fprintf('Mean absolute off-diagonal value in the returned matrix: %f\n',meanoff); + + [corr,indx,indy,corrs] = matcorr(activations,super); + +fprintf('Absolute corrs between best-matching source and activation\n'); +fprintf(' component pairs range from %5.4f to %5.4f\n', ... + abs(corr(1)),abs(corr(length(corr)))); + +if nargout == 0 + fprintf('\nView the results:\n'); + fprintf('Use mouse to rotate the image.\n'); +end +if ~plotflag, return; end; +figure('Position',pos+2*off); +set(gcf,'Color',BACKCOLOR); +surf(testresult); % plot the resulting ~identity matrix +st=title('Results: Test of ICA Separation'); +set(st,'fontsize',14) +sxl=xlabel('Source Out'); +set(sxl,'fontsize',14); +syl=ylabel('Source In'); +set(syl,'fontsize',14); +szl=zlabel('Relative Recovery'); +set(szl,'fontsize',14); +view(-52,50); +axis('auto'); +if max(max(abs(testresult)))>1 + fprintf('NOTE: Some sources not recovered well.\n'); + fprintf('Restricting plot z-limits to: [-1,1]\n'); + set(gca,'zlim',[-1 1]); +end +rotate3d + +if nargout == 0 + testresult = []; +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/textgui.m b/code/eeglab13_4_4b/functions/miscfunc/textgui.m new file mode 100644 index 0000000..6e18787 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/textgui.m @@ -0,0 +1,168 @@ +% textgui() - make sliding vertical window. This window contain text +% with optional function calls at each line. +% +% Usage: +% >> textgui( commandnames, helparray, 'key', 'val' ...); +% +% Inputs: +% commandnames - name of the commands. Either char array or cell +% array of char. All style are 'pushbuttons' exept +% for empty commands. +% helparray - cell array of commands to execute for each menu +% (default is empty) +% +% Optional inputs: +% 'title' - window title +% 'fontweight' - font weight. Single value or cell array of value for each line. +% 'fontsize' - font size. Single value or cell array of value for each line. +% 'fontname' - font name. Single value or cell array of value for each line. +% 'linesperpage' - number of line per page. Default is 20. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% Example: +% textgui({ 'function1' 'function2' }, {'hthelp(''function1'')' []}); +% % this function will call a pop_up window with one button on +% % 'function1' which will call the help of this function. +% + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function tmp = textgui( textmenu, helparray, varargin); + +XBORDERS = 0; % pixels +TOPORDINATE = 1.09; +TOPLINES = 2; + +if nargin < 1 + help textgui; + return; +end; +if nargin <2 + helparray = cell(1, length( textmenu )); +end; + +% optional parameters +% ------------------- +if nargin >2 + for i = 1:length(varargin) + if iscell(varargin{i}), varargin(i) = { varargin(i) }; end; + end; + g=struct(varargin{:}); +else + g = []; +end; +try, g.title; catch, g.title = ''; end; +try, g.fontname; catch, g.fontname = 'courier'; end; +try, g.fontsize; catch, g.fontsize = 12; end; +try, g.fontweight; catch, g.fontweight = 'normal'; end; +try, g.linesperpage; catch, g.linesperpage = 20; end; + +if isempty( helparray ) + helparray = cell(1,200); +else + tmpcell = cell(1,200); + helparray = { helparray{:} tmpcell{:} }; +end; + +% number of elements +% ------------------ +if iscell(textmenu) nblines = length(textmenu); +else nblines = size(textmenu,1); +end; + +% generating the main figure +% -------------------------- +fig = figure('position', [100 100 800 25*15], 'menubar', 'none', 'numbertitle', 'off', 'name', 'Help', 'color', 'w'); +pos = get(gca,'position'); % plot relative to current axes +q = [pos(1) pos(2) 0 0]; +s = [pos(3) pos(4) pos(3) pos(4)]./100; + +% generating cell arrays +% ---------------------- +if isstr(g.fontname), tmp1(1:nblines) = {g.fontname}; g.fontname = tmp1; end; +if isnumeric(g.fontsize), tmp2(1:nblines) = {g.fontsize}; g.fontsize = tmp2; end; +if isstr(g.fontweight), tmp3(1:nblines) = {g.fontweight}; g.fontweight = tmp3; end; +switch g.fontname{1} + case 'courrier', CHAR_WIDTH = 11; % pixels + case 'times', CHAR_WIDTH = 11; % pixels + otherwise, CHAR_WIDTH = 11; +end; + +topordi = TOPORDINATE; +if ~isempty(g.title) + addlines = size(g.title,1)+1+TOPLINES; + if nblines+addlines < g.linesperpage + divider = g.linesperpage; + else + divider = nblines+addlines; + end; + ordinate = topordi-topordi*TOPLINES/divider; + currentheight = topordi/divider; + + for index=1:size(g.title,1) + ordinate = topordi-topordi*(TOPLINES+index-1)/divider; + h = text( -0.1, ordinate, g.title(index,:), 'unit', 'normalized', 'horizontalalignment', 'left', ... + 'fontname', g.fontname{1}, 'fontsize', g.fontsize{1},'fontweight', fastif(index ==1, 'bold', ... + 'normal'), 'interpreter', 'none' ); + end; + %h = uicontrol( gcf, 'unit', 'normalized', 'style', 'text', 'backgroundcolor', get(gcf, 'color'), 'horizontalalignment', 'left', ... + % 'position', [-0.1 ordinate 1.1 currentheight].*s*100+q, 'string', g.title, ... + % 'fontsize', g.fontsize{1}+1, 'fontweight', 'bold', 'fontname', g.fontname{1}); + else + addlines = TOPLINES; + if nblines+addlines < g.linesperpage + divider = g.linesperpage; + else + divider = nblines+addlines; + end; +end; + +maxlen = size(g.title,2); +for i=1:nblines + if iscell(textmenu) tmptext = textmenu{i}; + else tmptext = textmenu(i,:); + end; + ordinate = topordi-topordi*(i-1+addlines)/divider; + currentheight = topordi/divider; + + if isempty(helparray{i}) + h = text( -0.1, ordinate, tmptext, 'unit', 'normalized', 'horizontalalignment', 'left', ... + 'fontname', g.fontname{i}, 'fontsize', g.fontsize{i},'fontweight', g.fontweight{i}, 'interpreter', 'none' ); +% h = uicontrol( gcf, 'unit', 'normalized', 'style', 'text', 'backgroundcolor', get(gcf, 'color'), 'horizontalalignment', 'left', ... +% 'position', [-0.1 ordinate 1.1 currentheight].*s*100+q, 'string', tmptext, 'fontname', g.fontname{i}, 'fontsize', g.fontsize{i},'fontweight', g.fontweight{i} ); + else + h = text( -0.1, ordinate, tmptext, 'unit', 'normalized', 'color', 'b', 'horizontalalignment', 'left', ... + 'fontname', g.fontname{i}, 'buttondownfcn', helparray{i}, 'fontsize', g.fontsize{i},'fontweight', g.fontweight{i}, 'interpreter', 'none' ); +% h = uicontrol( gcf, 'callback', helparray{i}, 'unit','normalized', 'style', 'pushbutton', 'horizontalalignment', 'left', ... +% 'position', [-0.1 ordinate 1.1 currentheight].*s*100+q, 'string', tmptext, 'fontname', g.fontname{i}, 'fontsize', g.fontsize{i},'fontweight', g.fontweight{i}); + end; + maxlen = max(maxlen, length(tmptext)); +end; +pos = get(gcf, 'position'); +set(gcf, 'position', [pos(1:2) maxlen*CHAR_WIDTH+2*XBORDERS 400]); +% = findobj('parent', gcf); +%set(h, 'fontname', 'courier'); + +if nblines+addlines < g.linesperpage + zooming = 1; +else + zooming = (nblines+addlines)/g.linesperpage; +end; + +slider(gcf, 0, 1, 1, zooming, 0); +axis off; diff --git a/code/eeglab13_4_4b/functions/miscfunc/tftopo.m b/code/eeglab13_4_4b/functions/miscfunc/tftopo.m new file mode 100644 index 0000000..728b8d9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/tftopo.m @@ -0,0 +1,651 @@ +% tftopo() - Generate a figure showing a selected or representative image (e.g., +% an ERSP, ITC or ERP-image) from a supplied set of images, one for each +% scalp channel. Then, plot topoplot() scalp maps of value distributions +% at specified (time, frequency) image points. Else, image the signed +% (selected) between-channel std(). Inputs may be outputs of +% timef(), crossf(), or erpimage(). +% Usage: +% >> tftopo(tfdata,times,freqs, 'key1', 'val1', 'key2', val2' ...) +% Inputs: +% tfdata = Set of time/freq images, one for each channel. Matrix dims: +% (time,freq,chans). Else, (time,freq,chans,subjects) for grand mean +% RMS plotting. +% times = Vector of image (x-value) times in msec, from timef()). +% freqs = Vector of image (y-value) frequencies in Hz, from timef()). +% +% Optional inputs: +% 'timefreqs' = Array of time/frequency points at which to plot topoplot() maps. +% Size: (nrows,2), each row given the [ms Hz] location +% of one point. Or size (nrows,4), each row given [min_ms +% max_ms min_hz max_hz]. +% 'showchan' = [integer] Channel number of the tfdata to image. Else 0 to image +% the (median-signed) RMS values across channels. {default: 0} +% 'chanlocs' = ['string'|structure] Electrode locations file (for format, see +% >> topoplot example) or EEG.chanlocs structure {default: none} +% 'limits' = Vector of plotting limits [minms maxms minhz maxhz mincaxis maxcaxis] +% May omit final vales, or use NaN's to use the input data limits. +% Ex: [nan nan -100 400]; +% 'signifs' = (times,freqs) Matrix of significance level(s) (e.g., from timef()) +% to zero out non-signif. tfdata points. Matrix size must be +% ([1|2], freqs, chans, subjects) +% if using the same threshold for all time points at each frequency, or +% ([1|2], freqs, times, chans, subjects). +% If first dimension is of size 1, data are assumed to contain +% positive values only {default: none} +% 'sigthresh' = [K L] After masking time-frequency decomposition using the 'signifs' +% array (above), concatenate (time,freq) values for which no more than +% K electrodes have non-0 (significant) values. If several subjects, +% the second value L is used to concatenate subjects in the same way. +% {default: [1 1]} +% 'selchans' = Channels to include in the topoplot() scalp maps (and image values) +% {default: all} +% 'smooth' = [pow2] magnification and smoothing factor. power of 2 (default: 1}. +% 'mode' = ['rms'|'ave'] ('rms') return root-mean-square, else ('ave') average +% power {default: 'rms' } +% 'logfreq' = ['on'|'off'|'native'] plot log frequencies {default: 'off'} +% 'native' means that the input is already in log frequencies +% 'vert' = [times vector] (in msec) plot vertical dashed lines at specified times +% {default: 0} +% 'ylabel' = [string] label for the ordinate axis. Default is +% "Frequency (Hz)" +% 'shiftimgs' = [response_times_vector] shift time/frequency images from several +% subjects by each subject's response time {default: no shift} +% 'title' = [quoted_string] plot title (default: provided_string). +% 'cbar' = ['on'|'off'] plot color bar {default: 'on'} +% 'cmode' = ['common'|'separate'] 'common' or 'separate' color axis for each +% topoplot {default: 'common'} +% 'plotscalponly' = [x,y] location (e.g. msec,hz). Plot one scalp map only; no +% time-frequency image. +% 'events' = [real array] plot event latencies. The number of event +% must be the same as the number of "frequecies". +% 'verbose' = ['on'|'off'] comment on operations on command line {default: 'on'}. +% 'axcopy' = ['on'|'off'] creates a copy of the figure axis and its graphic objects in a new pop-up window +% using the left mouse button {default: 'on'}.. +% 'denseLogTicks' = ['on'|'off'] creates denser labels on log freuqncy axis {default: 'off'} +% +% Notes: +% 1) Additional topoplot() optional arguments can be used. +% 2) In the topoplot maps, average power (not masked by significance) is used +% instead of the (signed and masked) root-mean-square (RMS) values used in the image. +% 3) If tfdata from several subjects is used (via a 4-D tfdata input), RMS power is first +% computed across electrodes, then across the subjects. +% +% Authors: Scott Makeig, Arnaud Delorme & Marissa Westerfield, SCCN/INC/UCSD, La Jolla, 3/01 +% +% See also: timef(), topoplot(), spectopo(), timtopo(), envtopo(), changeunits() + +% hidden parameter: 'shiftimgs' = array with one value per subject for shifting in time the +% time/freq images. Had to be inserted in tftopo because +% the shift happen after the smoothing + +% Copyright (C) Scott Makeig, Arnaud Delorme & Marissa Westerfield, SCCN/INC/UCSD, +% La Jolla, 3/01 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function tfave = tftopo(tfdata,times,freqs,varargin); + %timefreqs,showchan,chanlocs,limits,signifs,selchans) + +LINECOLOR= 'k'; +LINEWIDTH = 2; +ZEROLINEWIDTH = 2.8; + +if nargin<3 + help tftopo + return +end +icadefs_flag = 1; +try + icadefs; +catch + warning('icadefs.m can not be located in the path'); + icadefs_flag = 0 ; +end +if ~icadefs_flag + AXES_FONTSIZE = 10; + PLOT_LINEWIDTH = 2; +end + +% reshape tfdata +% -------------- +if length(size(tfdata))==2 + if size(tfdata,1) ~= length(freqs), tfdata = tfdata'; end; + nchans = round(size(tfdata,2)/length(times)); + tfdata = reshape(tfdata, size(tfdata,1), length(times), nchans); +elseif length(size(tfdata))>=3 + nchans = size(tfdata,3); +else + help tftopo + return +end +tfdataori = mean(tfdata,4); % for topoplot + +% test inputs +% ----------- +% 'key' 'val' sequence +fieldlist = { 'chanlocs' { 'string','struct' } [] '' ; + 'limits' 'real' [] [nan nan nan nan nan nan]; + 'logfreq' 'string' {'on','off','native'} 'off'; + 'cbar' 'string' {'on','off' } 'on'; + 'mode' 'string' { 'ave','rms' } 'rms'; + 'title' 'string' [] ''; + 'verbose' 'string' {'on','off' } 'on'; + 'axcopy' 'string' {'on','off' } 'on'; + 'cmode' 'string' {'common','separate' } 'common'; + 'selchans' 'integer' [1 nchans] [1:nchans]; + 'shiftimgs' 'real' [] []; + 'plotscalponly' 'real' [] []; + 'events' 'real' [] []; + 'showchan' 'integer' [0 nchans] 0 ; + 'signifs' 'real' [] []; + 'sigthresh' 'integer' [1 Inf] [1 1]; + 'smooth' 'real' [0 Inf] 1; + 'timefreqs' 'real' [] []; + 'ylabel' 'string' {} 'Frequency (Hz)'; + 'vert' 'real' [times(1) times(end)] [min(max(0, times(1)), times(end))]; + 'denseLogTicks' 'string' {'on','off'} 'off' + }; + +[g varargin] = finputcheck( varargin, fieldlist, 'tftopo', 'ignore'); +if isstr(g), error(g); end; + +% setting more defaults +% --------------------- +if length(times) ~= size(tfdata,2) + fprintf('tftopo(): tfdata columns must be a multiple of the length of times (%d)\n',... + length(times)); + return +end +if length(g.showchan) > 1 + error('tftopo(): showchan must be a single number'); +end; +if length(g.limits)<1 | isnan(g.limits(1)) + g.limits(1) = times(1); +end +if length(g.limits)<2 | isnan(g.limits(2)) + g.limits(2) = times(end); +end +if length(g.limits)<3 | isnan(g.limits(3)) + g.limits(3) = freqs(1); +end +if length(g.limits)<4 | isnan(g.limits(4)) + g.limits(4) = freqs(end); +end +if length(g.limits)<5 | isnan(g.limits(5)) % default caxis plotting limits + g.limits(5) = -max(abs(tfdata(:))); + mincax = g.limits(5); +end +if length(g.limits)<6 | isnan(g.limits(6)) + defaultlim = 1; + if exist('mincax') + g.limits(6) = -mincax; % avoid recalculation + else + g.limits(6) = max(abs(tfdata(:))); + end +else + defaultlim = 0; +end +if length(g.sigthresh) == 1 + g.sigthresh(2) = 1; +end; +if g.sigthresh(1) > nchans + error('tftopo(): ''sigthresh'' first number must be less than or equal to the number of channels'); +end; +if g.sigthresh(2) > size(tfdata,4) + error('tftopo(): ''sigthresh'' second number must be less than or equal to the number of subjects'); +end; +if ~isempty(g.signifs) + if size(g.signifs,1) > 2 | size(g.signifs,2) ~= size(tfdata,1)| ... + (size(g.signifs,3) ~= size(tfdata,3) & size(g.signifs,4) ~= size(tfdata,3)) + fprintf('tftopo(): error in ''signifs'' array size not compatible with data size, trying to transpose.\n'); + g.signifs = permute(g.signifs, [2 1 3 4]); + if size(g.signifs,1) > 2 | size(g.signifs,2) ~= size(tfdata,1)| ... + (size(g.signifs,3) ~= size(tfdata,3) & size(g.signifs,4) ~= size(tfdata,3)) + fprintf('tftopo(): ''signifs'' still the wrong size.\n'); + return + end; + end +end; +if length(g.selchans) ~= nchans, + selchans_opt = { 'plotchans' g.selchans }; +else selchans_opt = { }; +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% process time/freq data points +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if ~isempty(g.timefreqs) + if size(g.timefreqs,2) == 2 + g.timefreqs(:,3) = g.timefreqs(:,2); + g.timefreqs(:,4) = g.timefreqs(:,2); + g.timefreqs(:,2) = g.timefreqs(:,1); + end; + if isempty(g.chanlocs) + error('tftopo(): ''chanlocs'' must be defined to plot time/freq points'); + end; + if min(min(g.timefreqs(:,[3 4])))max(freqs) + fprintf('tftopo(): selected plotting frequency %g out of range.\n',max(max(g.timefreqs(:,[3 4])))); + return + end + if min(min(g.timefreqs(:,[1 2])))max(times) + fprintf('tftopo(): selected plotting time %g out of range.\n',max(max(g.timefreqs(:,[1 2])))); + return + end + + if 0 % USE USER-SUPPLIED SCALP MAP ORDER. A GOOD ALGORITHM FOR SELECTING + % g.timefreqs POINT ORDER GIVING MAX UNCROSSED LINES IS DIFFICULT! + [tmp tfi] = sort(g.timefreqs(:,1)); % sort on times + tmp = g.timefreqs; + for t=1:size(g.timefreqs,1) + g.timefreqs(t,:) = tmp(tfi(t),:); + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Compute timefreqs point indices + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + tfpoints = size(g.timefreqs,1); + for f=1:tfpoints + [tmp fi1] = min(abs(freqs-g.timefreqs(f,3))); + [tmp fi2] = min(abs(freqs-g.timefreqs(f,4))); + freqidx{f}=[fi1:fi2]; + end + for f=1:tfpoints + [tmp fi1] = min(abs(times-g.timefreqs(f,1))); + [tmp fi2] = min(abs(times-g.timefreqs(f,2))); + timeidx{f}=[fi1:fi2]; + end +else + tfpoints = 0; +end; + +% only plot one scalp map +% ----------------------- +if ~isempty(g.plotscalponly) + [tmp fi] = min(abs(freqs-g.plotscalponly(2))); + [tmp ti] = min(abs(times-g.plotscalponly(1))); + scalpmap = squeeze(tfdataori(fi, ti, :)); + + if ~isempty(varargin) + topoplot(scalpmap,g.chanlocs,'electrodes','on', selchans_opt{:}, varargin{:}); + else + topoplot(scalpmap,g.chanlocs,'electrodes','on', selchans_opt{:}); + end; + % 'interlimits','electrodes') + axis square; + hold on + tl=title([int2str(g.plotscalponly(2)),' ms, ',int2str(g.plotscalponly(1)),' Hz']); + set(tl,'fontsize',AXES_FONTSIZE+3); % 13 + return; +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Zero out non-significant image features +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +range = g.limits(6)-g.limits(5); +cc = jet(256); +if ~isempty(g.signifs) + if strcmpi(g.verbose, 'on') + fprintf('Applying ''signifs'' mask by zeroing non-significant values\n'); + end + for subject = 1:size(tfdata,4) + for elec = 1:size(tfdata,3) + + if size(g.signifs,1) == 2 + if ndims(g.signifs) > ndims(tfdata) + tmpfilt = (tfdata(:,:,elec,subject) >= squeeze(g.signifs(2,:,:,elec, subject))') | ... + (tfdata(:,:,elec,subject) <= squeeze(g.signifs(1,:,:,elec, subject))'); + else + tmpfilt = (tfdata(:,:,elec,subject) >= repmat(g.signifs(2,:,elec, subject)', [1 size(tfdata,2)])) | ... + (tfdata(:,:,elec,subject) <= repmat(g.signifs(1,:,elec, subject)', [1 size(tfdata,2)])); + end; + else + if ndims(g.signifs) > ndims(tfdata) + tmpfilt = (tfdata(:,:,elec,subject) >= squeeze(g.signifs(1,:,:,elec, subject))'); + else + tmpfilt = (tfdata(:,:,elec,subject) >= repmat(g.signifs(1,:,elec, subject)', [1 size(tfdata,2)])); + end; + end; + tfdata(:,:,elec,subject) = tfdata(:,:,elec,subject) .* tmpfilt; + end; + end; +end; + +%%%%%%%%%%%%%%%% +% magnify inputs +%%%%%%%%%%%%%%%% +if g.smooth ~= 1 + if strcmpi(g.verbose, 'on'), + fprintf('Smoothing...\n'); + end + for index = 1:round(log2(g.smooth)) + [tfdata times freqs] = magnifytwice(tfdata, times, freqs); + end; +end; + +%%%%%%%%%%%%%%%%%%%%%%%% +% Shift time/freq images +%%%%%%%%%%%%%%%%%%%%%%%% +if ~isempty(g.shiftimgs) + timestep = times(2) - times(1); + for S = 1:size(tfdata,4) + nbsteps = round(g.shiftimgs(S)/timestep); + if strcmpi(g.verbose, 'on'), + fprintf('Shifing images of subect %d by %3.3f ms or %d time steps\n', S, g.shiftimgs(S), nbsteps); + end + if nbsteps < 0, tfdata(:,-nbsteps+1:end,:,S) = tfdata(:,1:end+nbsteps,:,S); + else tfdata(:,1:end-nbsteps,:,S) = tfdata(:,nbsteps+1:end,:,S); + end; + end; +end; + +%%%%%%%%%%%%%%%%%%%%%%%%% +% Adjust plotting limits +%%%%%%%%%%%%%%%%%%%%%%%%% +[tmp minfreqidx] = min(abs(g.limits(3)-freqs)); % adjust min frequency + g.limits(3) = freqs(minfreqidx); +[tmp maxfreqidx] = min(abs(g.limits(4)-freqs)); % adjust max frequency + g.limits(4) = freqs(maxfreqidx); + +[tmp mintimeidx] = min(abs(g.limits(1)-times)); % adjust min time + g.limits(1) = times(mintimeidx); +[tmp maxtimeidx] = min(abs(g.limits(2)-times)); % adjust max time + g.limits(2) = times(maxtimeidx); + +mmidx = [mintimeidx maxtimeidx minfreqidx maxfreqidx]; + +%colormap('jet'); +%c = colormap; +%cc = zeros(256,3); +%if size(c,1)==64 +% for i=1:3 +% cc(:,i) = interp(c(:,i),4); +% end +%else +% cc=c; +%nd +%cc(find(cc<0))=0; +%cc(find(cc>1))=1; + +%if exist('g.signif') +% minnull = round(256*(g.signif(1)-g.limits(5))/range); +% if minnull<1 +% minnull = 1; +% end +% maxnull = round(256*(g.signif(2)-g.limits(5))/range); +% if maxnull>256 +% maxnull = 256; +% end +% nullrange = minnull:maxnull; +% cc(nullrange,:) = repmat(cc(128,:),length(nullrange),1); +%end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot tfdata image for specified channel or selchans std() +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +axis off; +colormap(cc); +curax = gca; % current plot axes to plot into +if tfpoints ~= 0 + plotdim = max(1+floor(tfpoints/2),4); % number of topoplots on top of image + imgax = sbplot(plotdim,plotdim,[plotdim*(plotdim-1)+1,2*plotdim-1],'ax',curax); +else + imgax = curax; +end; +tftimes = mmidx(1):mmidx(2); +tffreqs = mmidx(3):mmidx(4); +if g.showchan>0 % -> image showchan data + tfave = tfdata(tffreqs, tftimes,g.showchan); +else % g.showchan==0 -> image std() of selchans + tfdat = tfdata(tffreqs,tftimes,g.selchans,:); + + % average across electrodes + if strcmpi(g.verbose, 'on'), + fprintf('Applying RMS across channels (mask for at least %d non-zeros values at each time/freq)\n', g.sigthresh(1)); + end + tfdat = avedata(tfdat, 3, g.sigthresh(1), g.mode); + + % if several subject, first (RMS) averaging across subjects + if size(tfdata,4) > 1 + if strcmpi(g.verbose, 'on'), + fprintf('Applying RMS across subjects (mask for at least %d non-zeros values at each time/freq)\n', g.sigthresh(2)); + end + tfdat = avedata(tfdat, 4, g.sigthresh(2), g.mode); + end; + tfave = tfdat; + + if defaultlim + g.limits(6) = max(max(abs(tfave))); + g.limits(5) = -g.limits(6); % make symmetrical + end; +end + +if ~isreal(tfave(1)), tfave = abs(tfave); end; +if strcmpi(g.logfreq, 'on'), + logimagesc(times(tftimes),freqs(tffreqs),tfave); + axis([g.limits(1) g.limits(2) log(g.limits(3)), log(g.limits(4))]); +elseif strcmpi(g.logfreq, 'native'), + imagesc(times(tftimes),log(freqs(tffreqs)),tfave); + axis([g.limits(1:2) log(g.limits(3:4))]); + + if g.denseLogTicks + minTick = min(ylim); + maxTick = max(ylim); + set(gca,'ytick',linspace(minTick, maxTick,50)); + end; + + tmpval = get(gca,'yticklabel'); + if iscell(tmpval) + ft = str2num(cell2mat(tmpval)); % MATLAB version >= 8.04 + else + ft = str2num(tmpval); % MATLAB version < 8.04 + end + + ft = exp(1).^ft; + ft = unique_bc(round(ft)); + ftick = get(gca,'ytick'); + ftick = exp(1).^ftick; + ftick = unique_bc(round(ftick)); + ftick = log(ftick); + inds = unique_bc(round(exp(linspace(log(1), log(length(ft)))))); + set(gca,'ytick',ftick(inds(1:2:end))); + set(gca,'yticklabel', num2str(ft(inds(1:2:end)))); +else + imagesc(times(tftimes),freqs(tffreqs),tfave); + axis([g.limits(1:4)]); +end; +caxis([g.limits(5:6)]); +hold on; + +%%%%%%%%%%%%%%%%%%%%%%%%%% +% Title and vertical lines +%%%%%%%%%%%%%%%%%%%%%%%%%% +axes(imgax) +xl=xlabel('Time (ms)'); +set(xl,'fontsize',AXES_FONTSIZE+2);%12 +set(gca,'yaxislocation','left') +if g.showchan>0 + % tl=title(['Channel ',int2str(g.showchan)]); + % set(tl,'fontsize',14); +else + if isempty(g.title) + if strcmpi(g.mode, 'rms') + tl=title(['Signed channel rms']); + else + tl=title(['Signed channel average']); + end; + else + tl = title(g.title); + end + set(tl,'fontsize',AXES_FONTSIZE + 2); %12 + set(tl,'fontweigh','normal'); +end + +yl=ylabel(g.ylabel); +set(yl,'fontsize',AXES_FONTSIZE + 2); %12 + +set(gca,'fontsize',AXES_FONTSIZE + 2); %12 +set(gca,'ydir','normal'); + +for indtime = g.vert + tmpy = ylim; + htmp = plot([indtime indtime],tmpy,[LINECOLOR ':']); + set(htmp,'linewidth',PLOT_LINEWIDTH) +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot topoplot maps at specified timefreqs points +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if ~isempty(g.events) + tmpy = ylim; + yvals = linspace(tmpy(1), tmpy(2), length(g.events)); + plot(g.events, yvals, 'k', 'linewidth', 2); +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Plot topoplot maps at specified timefreqs points +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if ~isempty(g.timefreqs) + wholeax = sbplot(1,1,1,'ax',curax); + topoaxes = zeros(1,tfpoints); + for n=1:tfpoints + if n<=plotdim + topoaxes(n)=sbplot(plotdim,plotdim,n,'ax',curax); + else + topoaxes(n)=sbplot(plotdim,plotdim,plotdim*(n+1-plotdim),'ax',curax); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Plot connecting lines using changeunits() + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + tmptimefreq = [ mean(g.timefreqs(n,[1 2])) mean(g.timefreqs(n,[3 4])) ]; + if strcmpi(g.logfreq, 'off') + from = changeunits(tmptimefreq,imgax,wholeax); + else + from = changeunits([tmptimefreq(1) log(tmptimefreq(2))],imgax,wholeax); + end; + to = changeunits([0.5,0.5],topoaxes(n),wholeax); + axes(wholeax); + plot([from(1) to(1)],[from(2) to(2)],LINECOLOR,'linewidth',LINEWIDTH); + hold on + mk=plot(from(1),from(2),[LINECOLOR 'o'],'markersize',9); + set(mk,'markerfacecolor',LINECOLOR); + axis([0 1 0 1]); + axis off; + end + + endcaxis = 0; + for n=1:tfpoints + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Plot scalp map using topoplot() + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + axes(topoaxes(n)); + scalpmap = squeeze(mean(mean(tfdataori(freqidx{n},timeidx{n},:),1),2)); + + %topoplot(scalpmap,g.chanlocs,'maplimits',[g.limits(5) g.limits(6)],... + % 'electrodes','on'); + + if ~isempty(varargin) + topoplot(scalpmap,g.chanlocs,'electrodes','on', selchans_opt{:}, varargin{:}); + else + topoplot(scalpmap,g.chanlocs,'electrodes','on', selchans_opt{:}); + end; + % 'interlimits','electrodes') + axis square; + hold on + if g.timefreqs(n,1) == g.timefreqs(n,2) + tl=title([int2str(g.timefreqs(n,1)),' ms, ',int2str(g.timefreqs(n,3)),' Hz']); + else + tl=title([int2str(g.timefreqs(n,1)) '-' int2str(g.timefreqs(n,2)) 'ms, ' ... + int2str(g.timefreqs(n,3)) '-' int2str(g.timefreqs(n,4)) ' Hz']); + end; + set(tl,'fontsize',AXES_FONTSIZE + 3); %13 + endcaxis = max(endcaxis,max(abs(caxis))); + %caxis([g.limits(5:6)]); + end; + if strcmpi(g.cmode, 'common') + for n=1:tfpoints + axes(topoaxes(n)); + caxis([-endcaxis endcaxis]); + if n==tfpoints & strcmpi(g.cbar, 'on') % & (mod(tfpoints,2)~=0) % image color bar by last map + cb=cbar; + pos = get(cb,'position'); + set(cb,'position',[pos(1:2) 0.023 pos(4)]); + end + drawnow + end + end; +end; + +if g.showchan>0 & ~isempty(g.chanlocs) + sbplot(4,4,1,'ax',imgax); + topoplot(g.showchan,g.chanlocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10 ); + axis('square'); +end +if strcmpi(g.axcopy, 'on') + if strcmpi(g.logfreq, 'native'), + com = [ 'ft = str2num(get(gca,''''yticklabel''''));' ... + 'ft = exp(1).^ft;' ... + 'ft = unique_bc(round(ft));' ... + 'ftick = get(gca,''''ytick'''');' ... + 'ftick = exp(1).^ftick;' ... + 'ftick = unique_bc(round(ftick));' ... + 'ftick = log(ftick);' ... + 'set(gca,''''ytick'''',ftick);' ... + 'set(gca,''''yticklabel'''', num2str(ft));' ]; + axcopy(gcf, com); % turn on axis copying on mouse click + else + axcopy; % turn on axis copying on mouse click + end; +end + +%%%%%%%%%%%%%%%%%%%%%%%% embedded functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function tfdat = avedata(tfdat, dim, thresh, mode) + tfsign = sign(mean(tfdat,dim)); + tfmask = sum(tfdat ~= 0,dim) >= thresh; + if strcmpi(mode, 'rms') + tfdat = tfmask.*tfsign.*sqrt(mean(tfdat.*tfdat,dim)); % std of all channels + else + tfdat = tfmask.*mean(tfdat,dim); % std of all channels + end; + + +function [tfdatnew, times, freqs] = magnifytwice(tfdat, times, freqs); + indicetimes = [floor(1:0.5:size(tfdat,1)) size(tfdat,1)]; + indicefreqs = [floor(1:0.5:size(tfdat,2)) size(tfdat,2)]; + tfdatnew = tfdat(indicetimes, indicefreqs, :, :); + times = linspace(times(1), times(end), size(tfdat,2)*2); + freqs = linspace(freqs(1), freqs(end), size(tfdat,1)*2); + + % smoothing + gauss2 = gauss2d(3,3); + for S = 1:size(tfdat,4) + for elec = 1:size(tfdat,3) + tfdatnew(:,:,elec,S) = conv2(tfdatnew(:,:,elec,S), gauss2, 'same'); + end; + end; + %tfdatnew = convn(tfdatnew, gauss2, 'same'); % is equivalent to the loop for slowlier diff --git a/code/eeglab13_4_4b/functions/miscfunc/timefrq.m b/code/eeglab13_4_4b/functions/miscfunc/timefrq.m new file mode 100644 index 0000000..4c5ca82 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/timefrq.m @@ -0,0 +1,404 @@ +% timefrq() - progressive Power Spectral Density estimates on a single +% EEG channel using out-of-bounds and muscle activity rejection +% tests. Uses Matlab FFT-based psd(). +% Usage: +% >> [Power,frqs,times,rejections] = timefrq(data,srate,subwindow); +% >> [Power,frqs,times,rejections] = ... +% timefrq(data,subwindow,fftwindow,substep, ... +% epochstep,overlap,srate,nfreqs, ... +% rejthresh,minmuscle,maxmuscle,musthresh); +% +% Inputs: +% data = single-channel (1,frames) EEG data {none} +% srate = data sampling rate (Hz) {256 Hz} +% subwindow = subepoch data length per psd() {<=256} +% +% fftwindow = subepoch FFT window length after zero-padding +% (determines freq bin width) {subwindow} +% substep = subepoch step interval in frames {subwindow/4} +% epochstep = output epoch step in frames {subwindow*2} +% overlap = overlap between output epochs in frames {subwindow*2} +% total epoch length is (overlap+epochstep) +% nfreqs = nfreqs to output (2:nfreqs+1), no DC {fftwindow/4} +% rejthresh = abs() rejection threshold for subepochs {off} +% If in (0,1) == percentage of data to reject; else +% reject subepochs reaching > the given abs value. +% minmuscle = lower bound of muscle band (Hz) {30 Hz} +% maxmuscle = upper bound of muscle band (Hz) {50 Hz} +% musthresh = mean muscle-band power rejection threshold +% (no percentile option) {off} +% +% Note: frequency of resulting rejections in tty output +% ('o'=out-of-bounds rejection;'+' = muscle band rejection) +% +% Outputs: +% Power - time-frequency transform of data (nfreqs,data_epochs) +% frqs - frequency bin centers (in Hz) [DC bin not returned] +% times - midpoints of the output analysis epochs (in sec.) +% rejections - 8-element vector of rejection statistics = +% [rejthresh,musthresh,goodepochs,badepochs,subacc,subrej,oobrej,musrej] +% * rejthresh = out-of-bounds abs rejection threshold +% * musthresh = muscle-band power rejection threshold +% * goodepochs,badepochs = numbers of epochs accepted/rejected +% * subacc,subrej = numbers of subepochs accepted/rejected +% * oobrej,musrej = numbers of subepochs rejected for oob/muscle +% +% Authors: Tzyy-Ping Jung & Scott Makeig, SCCN/INC/UCSD, La Jolla, 10/1/97 +% +% See also: timef() + +% Copyright (C) 10/1/97 Tzyy-Ping Jung & Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 11-17-97 added rejections vector output -sm +% 01-25-02 reformated help & license, added links -ad + +function [Power,frqs,times,rejections] = timefrq(data,subwindow,fftwindow,substep,epochstep,overlap,srate,nfreqs,rejthresh,minmuscle,maxmuscle,musclethresh); + +MINMUSCLE = 30; % Hz +MAXMUSCLE = 50; % Hz +DEFAULT_SRATE = 256; % Hz +MIN_SUBWINDOW = 8; +MAX_SUBWINDOW = 256; +MINSUBEPOCHS = 3; % min number of non-rejected subepochs to median-average +SURFPLOT = 1; % flag to make a surf(|) plot of the time*freq results +HISTPLOT = 0; % flag to plot the EEG histogram +OOB = 1e22; % out-of-bounds large number + +if nargin<1 + help timefrq + return +end +[chans,frames] = size(data); +if chans>1, + fprintf('timefrq(): data must be one-channel.\n'); + help timefrq + return +end + +if nargin < 12 + musclethresh = 0; +end +if musclethresh==0, + musclethresh = OOB; % DEFAULT +end + +if nargin < 11 + maxmuscle = 0; +end +if maxmuscle==0, + maxmuscle = MAXMUSCLE; % DEFAULT +end + +if nargin < 10 + minmuscle = 0; +end +if minmuscle==0, + minmuscle = MINMUSCLE; % DEFAULT +end + +if nargin < 9 + rejthresh = 0; +end +if rejthresh==0, + rejthresh = OOB; % DEFAULT +end + +if nargin < 8 + nfreqs = 0; +end +if nargin < 7 + srate = 0; +end +if srate==0, + srate = DEFAULT_SRATE; +end + +if nargin < 6 + overlap = 0; +end +if nargin < 5, + epochstep =0; +end +if nargin < 4, + substep =0; +end +if nargin < 3 + fftwindow =0; +end +if nargin < 2, + subwindow = 0; +end +if subwindow==0, + subwindow = 2^round((log(frames/64)/log(2))); % DEFAULT + if subwindow > MAX_SUBWINDOW, + fprintf('timefrq() - reducing subwindow length to %d.\n',subwindow); + subwindow = MAX_SUBWINDOW; + end +end +if subwindow < MIN_SUBWINDOW + fprintf('timefrq() - subwindow length (%d) too short.\n',subwindow); + return +end + +if fftwindow==0, + fftwindow=subwindow; % DEFAULT +end +if fftwindow < subwindow + fprintf('timefrq() - fftwindow length (%d) too short.\n',fftwindow); + return +end + +if substep==0, + substep=round(subwindow/4); % DEFAULT +end +if substep < 1 + fprintf('timefrq() - substep length (%d) too short.\n',substep); + return +end + +if epochstep==0, + epochstep=subwindow*2; % DEFAULT +end +if epochstep < 1 + fprintf('timefrq() - epochstep length (%d) too short.\n',epochstep); + return +end + +if overlap==0, + overlap=subwindow*2; % DEFAULT +end +if overlap > epochstep + fprintf('timefrq() - overlap (%d) too large.\n',overlap); + return +end + +if nfreqs==0, + nfreqs=floor(fftwindow/2); % DEFAULT +end +if nfreqs > floor(fftwindow/2) + fprintf('timefrq() - nfreqs (%d) too large.\n',nfreqs); + return +end +% +%%%%%%%%%%%%%%% Compute rejection threshold from percentile %%%%%%%%%%%%%%% +% +if rejthresh > 0 & rejthresh < 1.0, +disp yes + data = data - mean(data); % make data mean-zero + fprintf('Sorting mean-zeroed data to compute rejection threshold...\n'); + sortdat = sort(abs(data)); + rejpc = 1.0-rejthresh; + idx = max(1,round(rejpc*frames)); + rejthresh = sortdat(idx); + titl = [ 'Out-of-bounds rejection threshold is +/-' ... + num2str(rejthresh) ... + ' (' num2str(100*rejpc) ' %ile)']; + if HISTPLOT + % + %%%%%%%%%%%%%% Plot data histogram %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + figure; % plot figure for reference + hist(data,50); % histogram with 50 bins + hold on; + ax = axis; % get current axis limits + axis([ax(1) ax(2) ax(3) frames/50]); % see side bins clearly + plot([rejthresh rejthresh],[0 1e10],'g'); + plot([-rejthresh -rejthresh],[0 1e10],'g'); + title(titl); + else + fprintf('%s\n',titl); + fprintf('timefrq(): data histogram plotting disabled.\n'); + end +end +if nfreqs > fftwindow/2 + fprintf('fftwindow of %d will output only %d frequencies.\n',... + fftwindow,fftwindow/2); + return +elseif nfreqs<1 + help timefrq + fprintf('Number of output frequencies must be >=1.\n'); + return +end +Power=zeros(nfreqs+1,floor(frames/epochstep)); + % don't use a final partial epoch +badepochs=0; % epochs rejected +totacc = 0; % subepochs accepted +totrej = 0; % subepochs rejected +musrej = 0; % subepochs rejected for muscle artifact +oobrej = 0; % subepochs rejected for out-of-bounds values +firstpsd = 1; % logical variable +zcol = zeros(fftwindow/2+1,1); % column of zeros +% +%%%%%%%%%%%%%%%%%%%%%%%% Print header info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +start = 1; +stop=min(epochstep,frames); + +fprintf('\nMoving power spectrum will use epochs of %d frames\n',... + epochstep+overlap) +fprintf('output at intervals of %d frames.\n',epochstep); +fprintf('Each epoch is composed of %d subepochs of %d frames\n',... + floor((epochstep+overlap+1-subwindow)/substep), subwindow); +fprintf('starting at %d-frame intervals', substep); +if fftwindow>subwindow, + fprintf(' and zero-padded to %d frames\n',fftwindow); +else + fprintf('.\n') +end +fprintf(... +'Rejection criteria: "o" out-of-bounds (>%g), "+" muscle activity (>%g)\n',... + rejthresh,musclethresh); +% +%%%%%%%%%%%%%%%%%%%%% Process data epochs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +times = zeros(1,1+floor((frames-subwindow)/epochstep)); +frqs = zeros(1,nfreqs+1); % initialize in case no valid psd returns +ptmpzeros=zeros(fftwindow/2+1,ceil((stop-start+1)/substep)); +epoch = 0; % epoch counter + +for I=1:epochstep:frames-subwindow ; % for each epoch . . . + epoch=epoch+1; + start=max(1,I-overlap); + stop=min(I+epochstep+overlap-1,frames); + times(epoch) = round((stop+start)/2); % midpoint of data epoch + % + %%%%%%%%%%%%%%%%%%%%%%%%%% Process subepochs %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + tmp=data(start:stop); % copy data subepoch + subepoch=0; % subepoch counter + rej = 0; % initialize subepoch rejections counter + ptmp=ptmpzeros; % start with zeros + + for j=1:substep:stop-start+1-subwindow , % for each subepoch . . . + subepoch=subepoch+1; + + % idx=find(abs(tmp(j:min(j+subwindow-1,stop-start+1))) <= rejthresh); + % if length(idx) > subwindow/2 | subepoch == 1 + + idx=find(abs(tmp(j:min(j+subwindow-1,stop-start+1))) > rejthresh); + if length(idx) == 0 % If no point in subepoch out of bounds + datwin = tmp(j:j+subwindow-1)-mean(tmp(j:j+subwindow-1)); + % get 1 power est. for subepoch. + [ptmp(:,subepoch),frqs]=psd(datwin,fftwindow,srate,hanning(subwindow),0); + + if firstpsd > 0 % On very first subepoch + muscle = find(frqs>=minmuscle & frqs<=maxmuscle); + firstpsd = 0; % compute muscle band frequency bins. + end + if mean(ptmp(muscle,subepoch))>musclethresh + rej = rej+1; fprintf('+') % If muscle-band out of bounds + musrej = musrej+1; + if subepoch > 1 + ptmp(:,subepoch)=ptmp(:,subepoch-1); % reject for muscle noise. + else + ptmp(:,subepoch)=zcol; % set back to zeros + end + end + else % some data value out of bounds + rej = rej+1;fprintf('o') % so reject for out of bounds + oobrej = oobrej+1; + if subepoch > 1 + ptmp(:,subepoch)=ptmp(:,subepoch-1); + end + end + end % end of subepochs + + k = 1; + while ptmp(:,k) == zcol % while subepoch power values all zeros . . . + % sum(ptmp(:,k)) + k = k+1; + if k > subepoch, + break + end + end + if rej>0, + fprintf('\n'); + fprintf(' epoch %d: %d of %d subepochs rejected ',epoch,rej,subepoch); + totrej = totrej+rej; + totacc = totacc+(subepoch-rej); + else + fprintf('.'); + end + if k>subepoch + fprintf('(no non-zero subepochs)\n',k); + elseif k>1 + fprintf('(first non-zero subepoch %d)\n',k); + elseif rej>0 + fprintf('\n') + end + if k<= subepoch & subepoch-rej >= MINSUBEPOCHS + Power(:,epoch)=[median(ptmp(1:nfreqs+1,k:subepoch)')]'; + % omit initial zero cols + elseif epoch > 1 + Power(:,epoch) = Power(:,epoch-1); + fprintf ('') + badepochs = badepochs+1; + end +end % end epochs + +Power = Power(2:nfreqs+1,:); % omit DC power bin +frqs = frqs(2:nfreqs+1); % omit DC power bin +times = times/srate; % convert to seconds +if length(times)>1 + time_interval = times(2)-times(1); +else + time_interval = 0; +end +if nargout>3, + rejections = [rejthresh,musclethresh,epoch-badepochs,badepochs,... + totacc,totrej,oobrej,musrej]; +end +if epoch<1 + fprintf('No epochs processed: too little data.\n'); + return +end +% +%%%%%%%%%%%%%%%% Print trailer info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +fprintf('\nTotal of %d epochs processed (%d rejected).\n',... + epoch,badepochs); +fprintf('Output is %d freqs by %d epochs.\n',... + nfreqs,length(times)); +fprintf('Output epoch length %d frames (%g secs).\n', ... + epochstep+overlap,(epochstep+overlap)/srate); +fprintf('Output interval %d frames (%g secs).\n', ... + epochstep,time_interval); +fprintf('First and last time points: %g and %g secs.\n',... + times(1),times(length(times))); +% +%%%%%%%%%%%%%%% Make surf() plot of time-frequency distribution %%%%%% +% +if nfreqs>1 & epoch>1 & SURFPLOT + if min(min(Power))>0 + fprintf('Plot shows dB log(Power) - Power output is not log scaled.\n'); + off = [50 -50 0 0]; % successive figure offset in pixels + pos = get(gcf,'Position'); + figure('Position',pos+off); % make the 2nd plot offset from the 1st + + surf(times,frqs,10*log(Power)/log(10)) + view([0 90]); % top view + xlabel('Time (sec)') + ylabel('Frequency (Hz)') + shading interp + title('timefrq()'); + c=colorbar; + t=axes('Position',[0 0 1 1],'Visible','off'); + text(0.85,0.08,'dB','Parent',t); + else + fprintf('Some or all output Power estimates were zero - too many rejections?\n'); + end +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/topoimage.m b/code/eeglab13_4_4b/functions/miscfunc/topoimage.m new file mode 100644 index 0000000..3c2d3ce --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/topoimage.m @@ -0,0 +1,673 @@ +% topoimage() - plot concatenated multichannel time/frequency images +% in a topographic format +% Uses a channel location file with the same format as topoplot() +% or else plots data on a rectangular grid of axes. +% Click on individual images to examine separately. +% +% Usage: +% >> topoimage(data,'chan_locs',ntimes,limits); +% >> topoimage(data,[rows cols],ntimes,limits); +% >> topoimage(data,'chan_locs',ntimes,limits,title,... +% channels,axsize,colors,ydir,rmbase) +% +% Inputs: +% data = data consisting of nchans images, each size (rows,ntimes*chans) +% 'chan_locs' = file of channel locations as in >> topoplot example +% Else [rows cols] matrix of locations. Example: [6 4] +% ntimes = columns per image +% [limits] = [mintime maxtime minfreq maxfreq mincaxis maxcaxis] +% Give times in msec {default|0 (|both caxis 0) -> use data limits) +% 'title' = plot title {0 -> none} +% channels = vector of channel numbers to plot & label {0 -> all} +% axsize = [x y] axis size {default [.08 .07]} +% 'colors' = file of color codes, 3 chars per line +% ( '.' = space) {0 -> default color order} +% ydir = y-axis polarity (pos-up = 1; neg-up = -1) {def -> pos-up} +% rmbase = if ~=0, remove the mean value for times<=0 for each freq {def -> no} +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 12-10-1999 +% +% See also: topoplot(), timef() + +% Copyright (C) 12-10-99 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 1-16-00 debugged help msg and improved presentation -sm +% 3-16-00 added axcopy() -sm +% 8-07-00 added logimagesc() via 'LOGIT' -sm +% 9-02-00 added RMBASE option below, plus colorbar to key image -sm ??? +% 1-25-02 reformated help & license, added link -ad + +function topoimage(data,loc_file,times,limits,plottitle,channels,axsize,colors,ydr,rmbas) + +% Options: +% LOGIT = 1; % comment out for non-log imaging +% YVAL = 10; % plot horizontal lines at 10 Hz (comment to omit) +% RMBASE = 0; % remove <0 mean for each image row + +MAXCHANS = 256; +DEFAULT_AXWIDTH = 0.08; +DEFAULT_AXHEIGHT = 0.07; +DEFAULT_SIGN = 1; % Default - plot positive-up +LINEWIDTH = 2.0; +FONTSIZE = 14; % font size to use for labels +CHANFONTSIZE = 10; % font size to use for channel names +TICKFONTSIZE=10; % font size to use for axis labels +TITLEFONTSIZE = 16; + +PLOT_WIDTH = 0.75; % width and height of plot array on figure! +PLOT_HEIGHT = 0.81; +ISRECT = 0; % default + +if nargin < 1, + help topoimage + return +end + +if nargin < 4, + help topoimage + error('topoimage(): needs four arguments'); +end + +if times <0, + help topoimage + return +elseif times==1, + fprintf('topoimage: cannot plot less than 2 times per image.\n'); + return +else + freqs = 0; +end; + +axcolor= get(0,'DefaultAxesXcolor'); % find what the default x-axis color is +plotfile = 'topoimage.ps'; +ls_plotfile = 'ls -l topoimage.ps'; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Substitute defaults for missing parameters %%%%% +% +SIGN = DEFAULT_SIGN; +if nargin < 10 + rmbas = 0; +end +if nargin < 9 + ydr = 0; +end +if ydr == -1 + SIGN = -1; +end + +if nargin < 8 + colors = 0; +end + +if nargin < 7, + axwidth = DEFAULT_AXWIDTH; + axheight = DEFAULT_AXHEIGHT; +elseif size(axsize) == [1 1] & axsize(1) == 0 + axwidth = DEFAULT_AXWIDTH; + axheight = DEFAULT_AXHEIGHT; +elseif size(axsize) == [1 2] + axwidth = axsize(1); + axheight = axsize(2); + if axwidth > 1 | axwidth < 0 | axheight > 1 | axwidth < 0 + help topoimage + return + end +else + help topoimage + return +end + +[freqs,framestotal]=size(data); % data size +chans = framestotal/times; + +fprintf('\nPlotting data using axis size [%g,%g]\n',axwidth,axheight); +if nargin < 6 + channels = 0; +end +if channels == 0 + channels = 1:chans; +end +if nargin < 5 + plottitle = 0; %CJH +end +limitset = 0; +if nargin < 4, + limits = 0; +elseif length(limits)>1 + limitset = 1; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Test parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + icadefs; % read MAXPLOTDATACHANS constant from icadefs.m + + if max(channels) > chans + fprintf('topoimage(): max channel index > %d channels in data.\n',... + chans); + return + end + if min(channels) < 1 + fprintf('topoimage(): min channel index (%g) < 1.\n',... + min(channels)); + return + end; + if length(channels)>MAXPLOTDATACHANS, + fprintf('topoimage(): not set up to plot more than %d channels.\n',... + MAXPLOTDATACHANS); + return + end; +% +%%%%%%%%%%%%% Extend the size of the plotting area in the window %%%%%%%%%%%% +% + curfig = gcf; + h=figure(curfig); + set(h,'Color',BACKCOLOR); % set the background color + set(h,'PaperUnits','normalized'); % use percentages to avoid US/A4 difference + set(h,'PaperPosition',[0.0235308 0.0272775 0.894169 0.909249]); % equivalent + % orient portrait + axis('normal'); +% +%%%%%%%%%%%%%%%%%%%% Read the channel names %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if isstr(channels) == 0, + % channames = zeros(MAXPLOTDATACHANS,4); + % for c=1:length(channels), + % channames(c,:)= sprintf('%4d',channels(c)); + % end; + channames = num2str(channels(:)); %%CJH + else, + if ~isstr(channels) + fprintf('topoimage(): channel file name must be a string.\n'); + return + end + chid = fopen(channels,'r'); + if chid <3, + fprintf('topoimage(): cannot open file %s.\n',channels); + return + end; + channames = fscanf(chid,'%s',[4 MAXPLOTDATACHANS]); + channames = channames'; + [r c] = size(channames); + for i=1:r + for j=1:c + if channames(i,j)=='.', + channames(i,j)=' '; + end; + end; + end; + end; % setting channames +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot and label specified channels %%%%%%%%%%%%%%%%%% +% +data = matsel(data,times,0,0,channels); +chans = length(channels); +% +%%%%%%%%%%%%%%%%%%%%%%%%% Read the color names %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if colors ~=0, + if ~isstr(colors) + fprintf('topoimage(): color file name must be a string.\n'); + return + end + cid = fopen(colors,'r'); + % fprintf('cid = %d\n',cid); + if cid <3, + fprintf('topoimage: cannot open file %s.\n',colors); + return + end; + colors = fscanf(cid,'%s',[3 MAXPLOTDATAEPOCHS]); + colors = colors'; + [r c] = size(colors); + for i=1:r + for j=1:c + if colors(i,j)=='.', + colors(i,j)=' '; + end; + end; + end; + else % use default color order (no yellow!) + colors =['r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ']; + colors = [colors; colors]; % make > 64 available + end; + for c=1:length(colors) % make white traces black unless axis color is white + if colors(c,1)=='w' & axcolor~=[1 1 1] + colors(c,1)='k'; + end + end +% +%%%%%%%%%%%%%%%%%%%%%%% Read and adjust limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if limits==0, % == 0 or [0 0 0 0] + xmin=min(times); + xmax=max(times); + ymin=min(freqs); + ymax=max(freqs); + else + if length(limits)~=6, + fprintf( ... + 'topoimage: limits should be 0 or an array [xmin xmax ymin ymax zmin zmax].\n'); + return + end; + xmin = limits(1); + xmax = limits(2); + ymin = limits(3); + ymax = limits(4); + zmin = limits(5); + zmax = limits(6); + end; + + if xmax == 0 & xmin == 0, + x = [0:1:times-1]; + xmin = min(x); + xmax = max(x); + else + dx = (xmax-xmin)/(times-1); + x=xmin*ones(1,times)+dx*(0:times-1); % compute x-values + xmax = xmax*times/times; + end; + if xmax<=xmin, + fprintf('topoimage() - xmax must be > xmin.\n') + return + end + + if ymax == 0 & ymin == 0, + y=[1:1:freqs]; + ymax=freqs; + ymin=1; + else + dy = (ymax-ymin)/(freqs-1); + y=ymin*ones(1,freqs)+dy*(0:freqs-1); % compute y-values + ymax = max(y); + end + if ymax<=ymin, + fprintf('topoimage() - ymax must be > ymin.\n') + return + end + + if zmax == 0 & zmin == 0, + zmax=max(max(data)); + zmin=min(min(data)); + fprintf('Color axis limits [%g,%g]\n',zmin,zmax); + end + if zmax<=zmin, + fprintf('topoimage() - zmax must be > zmin.\n') + return + end + + xlabel = 'Time (ms)'; + ylabel = 'Hz'; + +% +%%%%%%%%%%%%%%%%%%%%%%%% Set up plotting environment %%%%%%%%%%%%%%%%%%%%%%%%% +% + h = gcf; + % set(h,'YLim',[ymin ymax]); % set default plotting parameters + % set(h,'XLim',[xmin xmax]); + % set(h,'FontSize',18); + % set(h,'DefaultLineLineWidth',1); % for thinner postscript lines +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Print plot info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + % clf; % clear the current figure + + % print plottitle over (left) subplot 1 + if plottitle==0, + plottitle = ''; + end + h=gca;title(plottitle,'FontSize',TITLEFONTSIZE); % title plot and + hold on + msg = ['\nPlotting %d traces of %d frames with colors: ']; + + msg = [msg ' -> \n']; % print starting info on screen . . . + fprintf(... + '\nlimits: [xmin,xmax,ymin,ymax] = [%4.1f %4.1f %4.2f %4.2f]\n',... + xmin,xmax,ymin,ymax); + + set(h,'YLim',[ymin ymax]); % set default plotting parameters + set(h,'XLim',[xmin xmax]); + set(h,'FontSize',FONTSIZE); % choose font size + + set(h,'FontSize',FONTSIZE); % choose font size + set(h,'YLim',[ymin ymax]); % set default plotting parameters + set(h,'XLim',[xmin xmax]); + + axis('off') + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Read chan_locs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if size(loc_file,2) == 2 % plot in a rectangular grid + ISRECT = 1; + ht = loc_file(1); + wd = loc_file(2); + if chans > ht*wd + fprintf(... + '\ntopoimage(): (d%) channels to be plotted > grid size [%d %d]\n\n',... + chans,ht,wd); + return + end + hht = (ht-1)/2; + hwd = (wd-1)/2; + xvals = zeros(ht*wd,1); + yvals = zeros(ht*wd,1); + dist = zeros(ht*wd,1); + for i=1:wd + for j=1:ht + xvals(i+(j-1)*wd) = -hwd+(i-1); + yvals(i+(j-1)*wd) = hht-(j-1); + dist(i+(j-1)*wd) = sqrt(xvals(j+(i-1)*ht).^2+yvals(j+(i-1)*ht).^2); + end + end + maxdist = max(dist); + for i=1:wd + for j=1:ht + xvals(i+(j-1)*wd) = 0.499*xvals(i+(j-1)*wd)/maxdist; + yvals(i+(j-1)*wd) = 0.499*yvals(i+(j-1)*wd)/maxdist; + end + end + channames = repmat(' ',ht*wd,4); + for i=1:ht*wd + channum = num2str(i); + channames(i,1:length(channum)) = channum; + end + +else % read chan_locs file + fid = fopen(loc_file); + if fid<1, + fprintf('topoimage(): cannot open eloc_file "%s"\n',loc_file) + return + end + A = fscanf(fid,'%d %f %f %s',[7 MAXCHANS]); + fclose(fid); + A = A'; + + if length(channels) > size(A,1), + error('topoimage(): data channels must be <= chan_locs channels') + end + + channames = setstr(A(channels,4:7)); + idx = find(channames == '.'); % some labels have dots + channames(idx) = setstr(abs(' ')*ones(size(idx))); % replace them with spaces + + Th = pi/180*A(channels,2); % convert degrees to rads + Rd = A(channels,3); + % ii = find(Rd <= 0.5); % interpolate on-head channels only + % Th = Th(ii); + % Rd = Rd(ii); + + [yvals,xvals] = pol2cart(Th,Rd); +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +xvals = 0.5+PLOT_WIDTH*xvals; % controls width of plot array on page! +yvals = 0.5+PLOT_HEIGHT*yvals; % controls height of plot array on page! +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot traces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + xdiff=xmax-xmin; + rightmost = max(xvals); + basetimes = find(x<=0); +P=0; + Axes = []; + fprintf('\ntrace %d: ',P+1); + for I=1:chans,%%%%%%%%%% for each data channel %%%%%%%%%%%%%%%%%%%%%%%%%% + if P>0 + axes(Axes(I)) + hold on; % plot down left side of page first + axis('off') + + else % P <= 0 + + % + %%%%%%%%%%%%%%%%%%%%%%% Plot data images %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + xcenter = xvals(I); + ycenter = yvals(I); + Axes = [Axes axes('Units','Normal','Position', ... + [xcenter-axwidth/2 ycenter-axheight/2 axwidth axheight])]; + axes(Axes(I)) + imageaxes = gca; + axislcolor = get(gca,'Xcolor'); %%CJH + + dataimage = matsel(data,times,0,0,I); + if rmbas~=0 % rm baseline + dataimage = dataimage ... + - repmat(mean(matsel(data,times,basetimes,0,I)')',1,times); + end + + if exist('LOGIT') + logimagesc(x,y,dataimage); % <---- plot logfreq image + if exist('YVAL') + YVAL = log(YVAL); + end + else + imagesc(x,y,dataimage); % <---- plot image + end + hold on + + curax = axis; + xtk = get(gca,'xtick'); % use these for cal axes below + xtkl = get(gca,'xticklabel'); + ytk = get(gca,'ytick'); + ytkl = get(gca,'yticklabel'); + + set(gca,'tickdir','out'); + set(gca,'ticklength',[0.02 0.05]); + set(gca,'xticklabel',[]); + set(gca,'yticklabel',[]); + set(gca,'ydir','normal'); + caxis([zmin zmax]); + + if exist('YVAL') & YVAL>=curax(3) & YVAL<=curax(4) + hold on + hp=plot([xmin xmax],[YVAL YVAL],'r-');%,'color',axislcolor); + % draw horizontal axis + set(hp,'Linewidth',1.0) + end + + if xmin<0 & xmax>0 + hold on + vl= plot([0 0],[curax(3) curax(4)],'color',axislcolor); % draw vert axis + set(vl,'linewidth',2); + end + + % if xcenter == rightmost + % colorbar + % rightmost = Inf; + % end + + % secondx = 200; % draw second vert axis + % axis('off');plot([secondx secondx],[ymin ymax],'color',axislcolor); + + % + %%%%%%%%%%%%%%%%%%%%%%% Print channel names %%%%%%%%%%%%%%%%%%%%%%%%%% + % + NAME_OFFSET = 0.01; + if channels~=0, % print channames + if ~ISRECT % print before topographically arrayed image + + % axis('off'); + hold on + h=text(xmin-NAME_OFFSET*xdiff,(curax(4)+curax(3))*0.5,[channames(I,:)]); + set(h,'HorizontalAlignment','right'); + set(h,'FontSize',CHANFONTSIZE); % choose font size + + else % print before rectangularly arrayed image + if xmin<0 + xmn = 0; + else + xmn = xmin; + end + % axis('off'); + h=text(xmin-NAME_OFFSET*xdiff,ymax,[channames(I,:)]); + set(h,'HorizontalAlignment','right'); + set(h,'FontSize',TICKFONTSIZE); % choose font size + end + end; % channels + end; % P=0 + + % if xcenter == rightmost + % colorbar + % rightmost = Inf; + % end + + % if xmin<0 & xmax>0 + % axes(imageaxes); + % hold on; plot([0 0],[curax(3) curax(4)],'k','linewidth',2); + % end + + drawnow + fprintf(' %d',I); + end; % %%%%%%%%%%%%%%% chan I %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + fprintf('\n'); + +% +%%%%%%%%%%%%%%%%%%%%% Make time and freq cal axis %%%%%%%%%%%%%%%%%%%%%%%%% +% + ax = axes('Units','Normal','Position', ... + [0.80 0.1 axwidth axheight]); + axes(ax) + axis('off'); + imagesc(x,y,zeros(size(dataimage))); hold on % <---- plot green + caxis([zmin zmax]); + set(gca,'ydir','normal'); + if xmin <=0 + py=plot([0 0],[curax(3) curax(4)],'color','k'); % draw vert axis at time zero + else + py=plot([xmin xmin],[curax(3) curax(4)],'color','k'); % vert axis at xmin + end + hold on + if exist('YVAL') & YVAL>=curax(3) + px=plot([xmin xmax],[YVAL YVAL],'color',axislcolor); + % draw horiz axis at YVAL + else + px=plot([xmin xmax],[curax(3) curax(4)],'color',axislcolor); + % draw horiz axis at ymin + end + + axis(curax); + set(gca,'xtick',xtk); % use these for cal axes + set(gca,'xticklabel',xtkl); + set(gca,'ytick',ytk); + set(gca,'yticklabel',ytkl); + set(gca,'ticklength',[0.02 0.05]); + set(gca,'tickdir','out'); + h = colorbar; + cbp = get(h,'position'); + set(h,'position',[cbp(1) cbp(2) 2*cbp(3) cbp(4)]); + caxis([zmin zmax]); + + % secondx = 200; % draw second vert axis + % axis('off');plot([secondx secondx],[curax(3) curax(4)],'color',axislcolor); + + % + %%%%%%%%%%%%%%%%%%%%% Plot axis values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + if 0 % DETOUR + signx = xmin-0.15*xdiff; + axis('off');h=text(signx,SIGN*curax(3),num2str(curax(3),3)); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','right','Clipping','off'); + + textx = xmin-0.6*xdiff; + axis('off');h=text(textx,(curax(3)+curax(4))/2,ylabel); % text Hz + set(h,'Rotation',90); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center','Clipping','off'); + + % axis('off');h=text(signx,SIGN*ymax,['+' num2str(ymax,3)]); % text +ymax + axis('off');h=text(signx,SIGN*ymax,[ num2str(ymax,3)]); % text ymax + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','right','Clipping','off'); + + ytick = curax(3)-0.3*(curax(4)-curax(3)); + tick = [int2str(xmin)]; h=text(xmin,ytick,tick); % text xmin + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + h=text(xmin+xdiff/2,ytick-0.5*(curax(4)-curax(3)),xlabel);% text Times + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + tick = [int2str(xmax)]; h=text(xmax,ytick,tick); % text xmax + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + axis on + set(ax,'xticklabel',''); + set(ax,'yticklabel',''); + set(ax,'ticklength',[0.02 0.05]); + set(ax,'tickdir','out'); + caxis([zmin zmax]); + hc=colorbar; + cmapsize = size(colormap,1); + set(hc,'ytick',[1 cmapsize]); % + + minlabel = num2str(zmin,3); + while (length(minlabel)<4) + if ~contains(minlabel,'.') + minlabel = [minlabel '.']; + else + minlabel = [minlabel '0']; + end + end + maxlabel = num2str(zmax,3); + if zmin<0 & zmax>0 + maxlabel = ['+' maxlabel]; + end + while (length(maxlabel)length(minlabel)) + if ~contains(minlabel,'.') + minlabel = [minlabel '.']; + else + minlabel = [minlabel '0']; + end + end + set(hc,'yticklabel',[minlabel;maxlabel]); + set(hc,'Color',BACKCOLOR); + set(hc,'Zcolor',BACKCOLOR); + end % DETOUR + +axcopy(gcf); % turn on pop-up axes +% +%%%%%%%%%%%%%%%%%% Make printed figure fill page %%%%%%%%%%%%%%%%%%%%%%%%%%% +% + % orient tall + % curfig = gcf; + % h=figure(curfig); + % set(h,'PaperPosition',[0.2 0.3 7.6 10]); % stretch out the plot on the page + +function [returnval] = contains(strng,chr) + returnval=0; + for i=1:length(strng) + if strng(i)==chr + returnval=1; + break + end + end diff --git a/code/eeglab13_4_4b/functions/miscfunc/tutorial.m b/code/eeglab13_4_4b/functions/miscfunc/tutorial.m new file mode 100644 index 0000000..a210950 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/tutorial.m @@ -0,0 +1,39 @@ +% tutorial() - Bring up the ICA / electrophysiology toolbox tutorial +% in a browser window (see docopt.m in the toolbox dir). +% Tutorial URL: http://www.sccn.ucsd.edu/tutorial/ +% Download: See http://www.sccn.ucsd.edu/ica.html +% +% Authors: Scott Makeig & Tzyy-Ping Jung, SCCN/INC/UCSD, 12/29/00 + +% Copyright (C) 12/29/00 Scott Makeig & Tzyy-Ping Jung, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +icadefs % load icadefs.m globals including TUTDIR + +%TUTDIR = which('eeglab'); +%TUTDIR = TUTDIR(1:findstr(TUTDIR, 'eeglab')-1); + +%if exist([TUTDIR 'index.html']) +% eval(['web file://' TUTDIR 'index.html' ]); +%else +% fprintf('ICA Matlab Toolbox Tutorial not found in the toolbox directory.\n'); + fprintf('Opening the toolbox www site ...\n\n'); + web(TUTORIAL_URL, '-browser'); +%end + diff --git a/code/eeglab13_4_4b/functions/miscfunc/uniqe_cell_string.m b/code/eeglab13_4_4b/functions/miscfunc/uniqe_cell_string.m new file mode 100644 index 0000000..7c7ad98 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/uniqe_cell_string.m @@ -0,0 +1,28 @@ +function uniqueStrings = uniqe_cell_string(c) +% uniqe string from a cell-array containing only strings, ignores all +% non-strings. + +nonStringCells = []; +for i=1:length(c) % remove non-string cells + if ~strcmp(class(c{i}),'char') + nonStringCells = [nonStringCells i]; + end; +end; +c(nonStringCells) = []; + +uniqueStrings = {}; +for i=1:length(c) % remove non-string cells + if ~isAlreadyEncountered(c{i}, uniqueStrings); + uniqueStrings{end+1} = c{i}; + end; +end; + +function result = isAlreadyEncountered(s, u) +result = false; +for i=1:length(u) + if strcmp(u{i}, s) + result = true; + end; +end; + + diff --git a/code/eeglab13_4_4b/functions/miscfunc/uniquef.m b/code/eeglab13_4_4b/functions/miscfunc/uniquef.m new file mode 100644 index 0000000..54791c1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/uniquef.m @@ -0,0 +1,82 @@ +% UNIQUEF: Given a matrix containing group labels, returns a vector containing +% a list of unique group labels, in the sequence found, and a +% vector of corresponding frequencies of each group. +% Optionally sorts the indices into ascending sequence. +% +% Note: it might be necessary to truncate ('de-fuzz') real numbers to +% some arbitrary number of decimal positions (see TRUNCATE) before +% finding unique values. +% +% Syntax: [value,freq,index] = uniquef(grp,sortflag) +% +% grp - matrix of a set of labels. +% sortflag - boolean flag indicating that list of labels, and +% corresponding frequencies, are to be so sorted +% [default=0, =FALSE]. +% ------------------------------------------------------------ +% value - column vector of unique labels. +% freq - corresponding absolute frequencies. +% index - indices of the first observation having each value. +% + +% RE Strauss, 6/5/95 +% 6/29/98 - modified to return indices. +% 1/25/00 - changed name from unique to uniquef to avoid conflict with +% Matlab v5 function. + +function [value,freq,index] = uniquef(grp,sortflag) + if (nargin < 2) sortflag = []; end; + + get_index = 0; + if (nargout > 2) + get_index = 1; + end; + + if (isempty(sortflag)) + sortflag = 0; + end; + + tol = eps * 10.^4; + grp = grp(:); % Convert input matrix to vector + + if (get_index) % Create vector of indices + ind = [1:length(grp)]'; + end; + + if (any([~isfinite(grp)])) % Remove NaN's and infinite values + i = find(~isfinite(grp)); % from input vector and index vector + grp(i) = []; + if (get_index) + ind(i) = []; + end; + end; + + value = []; + freq = []; + + for i = 1:length(grp) % For each element of grp, + b = (abs(value-grp(i)) < tol); % check if already in value list + if (sum(b) > 0) % If so, + freq(b) = freq(b) + 1; % increment frequency counter + else % If not, + value = [value; grp(i)]; % add to value list + freq = [freq; 1]; % and initialize frequency counter + end; + end; + + if (sortflag) + [value,i] = sort(value); + freq = freq(i); + end; + + if (get_index) + nval = length(value); % Number of unique values + index = zeros(nval,1); % Allocate vector of indices + for v = 1:nval % For each unique value, + i = find(grp == value(v)); % Find observations having value + index(v) = ind(i(1)); % Save first + end; + end; + + return; + diff --git a/code/eeglab13_4_4b/functions/miscfunc/upgma.m b/code/eeglab13_4_4b/functions/miscfunc/upgma.m new file mode 100644 index 0000000..b098b46 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/upgma.m @@ -0,0 +1,100 @@ +% UPGMA: Unweighted pair-group hierarchical cluster analysis of a distance +% matrix. Produces plot of dendrogram. To bootstrap cluster support, +% see cluster(). +% +% Usage: [topology,support] = upgma(dist,{labels},{doplot},{fontsize}) +% +% dist = [n x n] symmetric distance matrix. +% labels = optional [n x q] matrix of group labels for dendrogram. +% doplot = optional boolean flag indicating, if present and true, that +% graphical dendrogram output is to be produced +% [default = true]. +% fontsize = optional font size for labels [default = 10]. +% ----------------------------------------------------------------------- +% topology = [(n-1) x 4] matrix summarizing dendrogram topology: +% col 1 = 1st OTU/cluster being grouped at current step +% col 2 = 2nd OTU/cluster +% col 3 = ID of cluster being produced +% col 4 = distance at node +% support = [(n-2) x (n-1)] matrix, with one row for all but the base +% node, specifying group membership (support) at each node. +% + +% To boostrap cluster support, see cluster(). + +% RE Strauss, 5/27/96 +% 9/7/99 - miscellaneous changes for Matlab v5. +% 9/24/01 - check diagonal elements against eps rather than zero. +% 3/14/04 - changed 'suppress' flag to 'doplot'. + +function [topology,support] = upgma(dist,labels,doplot,fontsize) + if (nargin < 2) labels = []; end; + if (nargin < 3) doplot = []; end; + if (nargin < 4) fontsize = []; end; + + suprt = 0; + if (nargout > 1) suprt = 1; end; + if (isempty(doplot)) doplot = 1; end; + + [n,p] = size(dist); + if (n~=p | any(diag(dist)>eps)) + dist + error(' UPGMA: input matrix is not a distance matrix.'); + end; + + if (~isempty(labels)) + if (size(labels,1)~=n) + error(' UPGMA: numbers of taxa and taxon labels do not match.'); + end; + end; + + clstsize = ones(1,n); % Number of elements in clusters/otus + id = 1:n; % Cluster IDs + topology = zeros(n-1,4); % Output dendrogram-topology matrix + + plug = 10e6; + dist = dist + eye(n)*plug; % Replace diagonal with plugs + + for step = 1:(n-1) % Clustering steps + min_dist = min(dist(:)); % Find minimum pairwise distance + [ii,jj] = find(dist==min_dist); % Find location of minimum + k = 1; % Use first identified minimum + while (ii(k)>jj(k)) % for which i length(ii) ,keyboard;end; + end; + i = ii(k); + j = jj(k); + if (id(i)> V = varimax(data); +% >> [V,rotdata] = varimax(data,tol); +% >> [V,rotdata] = varimax(data,tol,'noreorder') +% +% Inputs: +% data - data matrix +% tol - set the termination tolerance to tol {default: 1e-4} +% 'noreorder' - Perform the rotation without component reorientation +% or reordering by size. This suppression is desirable +% when doing a q-mode analysis. {default|0|[] -> reorder} +% Outputs: +% V - orthogonal rotation matrix, hence +% rotdata - rotated matrix, rotdata = V*data; +% +% Author: Sigurd Enghoff - CNL / Salk Institute, La Jolla 6/18/98 +% +% See also: runica(), pcasvd(), promax() + +% Copyright (C) Sigurd Enghoff - CNL / Salk Institute, La Jolla 6/18/98 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Reference: % Henry F. Kaiser (1958) The Varimx criterion for +% analytic rotation in factor analysis. Pychometrika 23:187-200. +% +% modified to return V alone by Scott Makeig, 6/23/98 +% 01-25-02 reformated help & license, added link -ad + +function [V,data] = varimax(data,tol,reorder) + +if nargin < 1 + help varimax + return +end + +DEFAULT_TOL = 1e-4; % default tolerance, for use in stopping the iteration +DEFAULT_REORDER = 1; % default to reordering the output rows by size + % and adjusting their sign to be rms positive. +MAX_ITERATIONS = 50; % Default +qrtr = .25; % fixed value + +if nargin < 3 + reorder = DEFAULT_REORDER; +elseif isempty(reorder) | reorder == 0 + reorder = 1; % set default +else + reorder = strcmp('reorder',reorder); +end + +if nargin < 2 + tol = 0; +end +if tol == 0 + tol = DEFAULT_TOL; +end +if ischar(tol) + fprintf('varimax(): tol must be a number > 0\n'); + help varimax + return +end + +eps1 = tol; % varimax toler +eps2 = tol; + +V = eye(size(data,1)); % do unto 'V' what is done to data +crit = [sum(sum(data'.^4)-sum(data'.^2).^2/size(data,2)) 0]; +inoim = 0; +iflip = 1; +ict = 0; + +fprintf(... + 'Finding the orthogonal Varimax rotation using delta tolerance %d...\n',... + eps1); +while inoim < 2 & ict < MAX_ITERATIONS & iflip, + iflip = 0; + for j = 1:size(data,1)-1, + for k = j+1:size(data,1), + u = data(j,:).^2-data(k,:).^2; + v = 2*data(j,:).*data(k,:); + a = sum(u); + b = sum(v); + c = sum(u.^2-v.^2); + d = sum(u.*v); + + fden = size(data,2)*c + b^2 - a^2; + fnum = 2 * (size(data,2)*d - a*b); + + if abs(fnum) > eps1*abs(fden) + iflip = 1; + angl = qrtr*atan2(fnum,fden); + tmp = cos(angl)*V(j,:)+sin(angl)*V(k,:); + V(k,:) = -sin(angl)*V(j,:)+cos(angl)*V(k,:); + V(j,:) = tmp; + + tmp = cos(angl)*data(j,:)+sin(angl)*data(k,:); + data(k,:) = -sin(angl)*data(j,:)+cos(angl)*data(k,:); + data(j,:) = tmp; + end + end + end + + crit = [sum(sum(data'.^4)-sum(data'.^2).^2/size(data,2)) crit(1)]; + inoim = inoim + 1; + ict = ict + 1; + + fprintf('#%d - delta = %g\n',ict,(crit(1)-crit(2))/crit(1)); + + if (crit(1) - crit(2)) / crit(1) > eps2 + inoim = 0; + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if reorder + fprintf('Reordering rows...'); + [fnorm index] = sort(sum(data'.^2)); + V = V .* ((2 * (sum(data') > 0) - 1)' * ones(1, size(V,2))); + data = data .* ((2 * (sum(data') > 0) - 1)' * ones(1, size(data,2))); + V = V(fliplr(index),:); + data = data(fliplr(index),:); + fprintf('\n'); +else + fprintf('Not reordering rows.\n'); +end diff --git a/code/eeglab13_4_4b/functions/miscfunc/varsort.m b/code/eeglab13_4_4b/functions/miscfunc/varsort.m new file mode 100644 index 0000000..b3de9a8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/varsort.m @@ -0,0 +1,91 @@ +% varsort() - reorder ICA components, largest to smallest, by +% the size of their MEAN projected variance +% across all time points +% Usage: +% >> [windex,meanvar] = varsort(activations,weights,sphere); +% +% Inputs: +% activations = (chans,framestot) the runica() activations +% weights = ica weight matrix from runica() +% sphere = sphering matrix from runica() +% +% Outputs: +% windex = order of projected component mean variances (large to small) +% meanvar = projected component mean variance (in windex order) +% +% Author: Scott Makeig & Martin McKeown, SCCN/INC/UCSD, La Jolla, 09-01-1997 +% +% See also: runica() + +% Copyright (C) 9-01-1997 Scott Makeig & Martin McKeown, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-19-97 simplified, replaced grandmean with datamean info in calculation, +% made function return mean projected variance across the data, +% changed var() to diag(cov()) -sm +% 05-20-97 use sum-of-squares instead of diag() to allow long data sets -sm +% 06-07-97 changed order of args to conform to runica, fixed meanvar computation -sm +% 07-25-97 removed datamean -sm +% 01-25-02 reformated help & license, added link -ad + +function [windex,meanvar] = varsort(activations,weights,sphere) +% +if nargin ~= 3 % needs all 3 args + help varsort + return +end +[chans,framestot] = size(activations); +if framestot==0, + fprintf('Gvarsort(): cannot process an empty activations array.\n\n'); + return +end; + +[srows,scols] = size(sphere); +[wrows,wcols] = size(weights); + +if nargin<3, + fprintf('Gvarsort(): needs at least 3 arguments.\n\n'); + return +end; + +% activations = (wrows,wcols)X(srows,scols)X(chans,framestot) +if chans ~= scols | srows ~= wcols, + fprintf('varsort(): input data dimensions do not match.\n'); + fprintf(' i.e., Either %d ~= %d or %d ~= %d\n',... + chans,scols,srows,wcols); + return +end + +%%%%%%%%%%%%%%%%%%%% Find mean variances %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +fprintf('Computing mean projected variance for all %d components:\n',wrows); +meanvar = zeros(wrows,1); % size of the projections +winv = inv(weights*sphere); +for s=1:wrows + fprintf('%d ',s); % construct single-component data matrix + % project to scalp, then add row means + compproj = winv(:,s)*activations(s,:); + meanvar(s) = mean(sum(compproj.*compproj)/(size(compproj,1)-1)); + % compute mean variance +end % at all scalp channels + +%%%%%%%%%%%%%%%%%%% sort by mean variance %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +[sortvar, windex] = sort(meanvar); +windex = windex(wrows:-1:1);% order large to small +meanvar = meanvar(windex); +fprintf('\n'); diff --git a/code/eeglab13_4_4b/functions/miscfunc/vectdata.m b/code/eeglab13_4_4b/functions/miscfunc/vectdata.m new file mode 100644 index 0000000..aa17d8a --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/vectdata.m @@ -0,0 +1,116 @@ +% vectdata() - vector data interpolation with optional moving +% average. +% +% Usage: +% >> [interparray timesout] = vectdata( array, timesin, 'key', 'val', ... ); +% +% Inputs: +% array - 1-D or 2-D float array. If 2-D, the second dimension +% only is interpolated. +% timesin - [float vector] time point indices. Same dimension as +% the interpolated dimension in array. +% +% Optional inputs +% 'timesout' - [float vector] time point indices for interpolating +% data. +% 'method' - method for interpolation +% 'linear' -> Triangle-based linear interpolation (default). +% 'cubic' -> Triangle-based cubic interpolation. +% 'nearest' -> Nearest neighbor interpolation. +% 'v4' -> MATLAB 4 griddata method. +% 'average' - [real] moving average in the dimension of timesin +% note that extreme values might be inacurate (see 'borders'). +% Default none or []. +% 'avgtype' - ['const'|'gauss'] use a const value when averaging (array of +% ones) or a gaussian window. Default is 'const'. +% 'border' - ['on'|'off'] correct border effect when smoothing. +% default is 'off'. +% +% Outputs: +% interparray - interpolated array +% timesout - output time points +% +% Author: Arnaud Delorme, CNL / Salk Institute, 20 Oct 2002 +% +% See also: griddata() + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [interparray, timesout] = vectdata( array, timevect, varargin ); + +if nargin < 3 + help vectdata; + return; +end; + +g = finputcheck( varargin, { 'timesout' 'real' [] []; + 'average' 'real' [] []; + 'gauss' 'real' [] []; + 'border' 'string' { 'on','off' } 'off'; + 'avgtype' 'string' { 'const','gauss' } 'const'; + 'method' 'string' { 'linear','cubic','nearest','v4' } 'linear'}); +if isstr(g), error(g); end; + +if size(array,2) == 1 + array = transpose(array); +end; + +if ~isempty(g.average) + timediff = timevect(2:end) -timevect(1:end-1); + if any( (timediff - mean(timediff)) > 1e-8 ) % not uniform values + fprintf('Data has to be interpolated uniformly for moving average\n'); + minspace = mean(timediff); + newtimevect = linspace(timevect(1), timevect(end), ceil((timevect(end)-timevect(1))/minspace)); + array = interpolate( array, timevect, newtimevect, g.method); + timevect = newtimevect; + end; + oldavg = g.average; + g.average = round(g.average/(timevect(2)-timevect(1))); + if oldavg ~= g.average + fprintf('Moving average updated from %3.2f to %3.2f (=%d points)\n', ... + oldavg, g.average*(timevect(2)-timevect(1)), g.average); + end; + if strcmpi(g.border, 'on') + if strcmpi(g.avgtype, 'const') + array = convolve(array, ones(1, g.average)); + else + convolution = gauss2d(1,g.average,1,round(0.15*g.average)); + array = convolve(array, convolution); + end; + else + if strcmpi(g.avgtype, 'const') + array = conv2(array, ones(1, g.average)/g.average, 'same'); + else + convolution = gauss2d(1,g.average,1,round(0.15*g.average)); + array = conv2(array, convolution/sum(convolution), 'same'); + end; + end; +end; + +interparray = interpolate( array, timevect, g.timesout, g.method); +timesout = g.timesout; + +% interpolation function +% ---------------------- +function [interparray] = interpolate( array, timesin, timesout, method); + interparray = zeros(size(array,1), length(timesout)); + for index = 1:size(array,1) + tmpa = [array(index,:) ; array(index,:)]; + + [Xi,Yi,Zi] = griddata(timesin, [1 2]', tmpa, timesout, [1 2]', method); % Interpolate data + interparray(index,:) = Zi(1,:); + end; diff --git a/code/eeglab13_4_4b/functions/miscfunc/zica.m b/code/eeglab13_4_4b/functions/miscfunc/zica.m new file mode 100644 index 0000000..a86285b --- /dev/null +++ b/code/eeglab13_4_4b/functions/miscfunc/zica.m @@ -0,0 +1,110 @@ +% zica() - Z-transform of ICA activations; useful for studying component SNR +% +% Usage: >> [zact,basesd,maz,mazc,mazf] = zica(activations,frames,baseframes) +% +% Inputs: +% activations - activations matrix produced by runica() +% frames - frames per epoch {0|default -> length(activations)} +% baseframes - vector of frames in z-defining baseline period {default frames} +% +% Outputs: +% zact - activations z-scaled and reorded in reverse order of max abs +% basesd - standard deviations in each activation row (reverse ordered) +% maz - maximum absolute z-value for each activation row (rev ordered) +% mazc - component indices of the reverse-sorted max abs z-values +% (this is the act -> zact reordering) +% mazf - frame indices of the max abs z-values (reverse ordered) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 2-25-98 +% +% See also: runica() + +function [zact,basesd,maxabsz,maxc,maxabszf] = zica(activations,frames,baseframes) + +% Copyright (C) 2-25-98 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-2-98 added frames variable -sm +% 1-25-01 put revsort subfunction in the core of the zica program -ad +% 01-25-02 reformated help & license, added link -ad + +if nargin<1 + help zica + return +end + +[chans,framestot] = size(activations); + +if nargin < 3 + baseframes = 0; +end +if nargin < 2 + frames = 0; +end +if frames == 0 + frames = framestot; +end +if baseframes == 0 + baseframes = 1:frames +end +epochs = floor(framestot/frames); +if frames*epochs ~= framestot + fprintf('zica(): indicated frames does not divide data length.\n'); + return +end + +if length(baseframes) < 3 + fprintf('\n zica() - too few baseframes (%d).\n',length(baseframes)); + help zica + return +end + +if min(baseframes) < 1 | max(baseframes) > frames + fprintf('\n zica() - baseframes out of range.\n'); + help zica + return +end + +baselength = length(baseframes); +baseact = zeros(epochs*baselength,chans); +for e=1:epochs + baseact((e-1)*baselength+1:e*baselength,:) = ... + matsel(activations,frames,baseframes,0,e)'; +end +basesd = sqrt(covary(baseact)); +zact = activations./(basesd'*ones(1,framestot)); +[maxabsz,maxabszf] = sort(abs(zact')); +maxabsz = maxabsz(frames,:); +maxabszf = maxabszf(frames,:); + +% +% reorder outputs in reverse order of max abs z +[maxabsz,maxc] = revsort(maxabsz); +zact = zact(maxc,:); +basesd = basesd(maxc); +maxabszf = maxabszf(maxc); + +% revsort - reverse sort columns (biggest 1st, ...) +function [out,i] = revsort(in) + +if size(in,1) == 1 + in = in'; % make column vector +end + +[out,i] = sort(in); +out = out(size(in,1):-1:1,:); + i = i(size(in,1):-1:1,:); +return; diff --git a/code/eeglab13_4_4b/functions/octavefunc/isoctave.m b/code/eeglab13_4_4b/functions/octavefunc/isoctave.m new file mode 100644 index 0000000..fc42c01 --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/isoctave.m @@ -0,0 +1,2 @@ +function res = isoctave; + res = ~ismatlab; diff --git a/code/eeglab13_4_4b/functions/octavefunc/optim/fmins.m b/code/eeglab13_4_4b/functions/octavefunc/optim/fmins.m new file mode 100644 index 0000000..fbc11f6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/optim/fmins.m @@ -0,0 +1,85 @@ +% Copyright (C) 2003 Andy Adler +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; If not, see . + +% -*- texinfo -*- +% @deftypefn {Function File} {[@var{x}] =} fmins(@var{f},@var{X0},@var{options},@var{grad},@var{P1},@var{P2}, ...) +% +% Find the minimum of a funtion of several variables. +% By default the method used is the Nelder&Mead Simplex algorithm +% +% Example usage: +% fmins(inline('(x(1)-5).^2+(x(2)-8).^4'),[0;0]) +% +% @strong{Inputs} +% @table @var +% @item f +% A string containing the name of the function to minimize +% @item X0 +% A vector of initial parameters fo the function @var{f}. +% @item options +% Vector with control parameters (not all parameters are used) +% @verbatim +% options(1) - Show progress (if 1, default is 0, no progress) +% options(2) - Relative size of simplex (default 1e-3) +% options(6) - Optimization algorithm +% if options(6)==0 - Nelder & Mead simplex (default) +% if options(6)==1 - Multidirectional search Method +% if options(6)==2 - Alternating Directions search +% options(5) +% if options(6)==0 && options(5)==0 - regular simplex +% if options(6)==0 && options(5)==1 - right-angled simplex +% Comment: the default is set to "right-angled simplex". +% this works better for me on a broad range of problems, +% although the default in nmsmax is "regular simplex" +% options(10) - Maximum number of function evaluations +% @end verbatim +% @item grad +% Unused (For compatibility with Matlab) +% @item P1,P2, ... +% Optional parameters for function @var{f} +% +% @end table +% @end deftypefn + +function ret=fmins(funfun, X0, options, grad, varargin) + + if ismatlab + if license('test','optim_toolbox') + p = fileparts(which('fmins')); + error( [ 'Octave functions should not run on Matlab' 10 'remove path to ' p ]); + end; + end; + + stopit = [1e-3, inf, inf, 1, 0, -1]; + minfun = 'nmsmax'; + + if nargin < 3; options=[]; end + + if length(options)>=1; stopit(5)= options(1); end + if length(options)>=2; stopit(1)= options(2); end + if length(options)>=5; + if options(6)==0; minfun= 'nmsmax'; + if options(5)==0; stopit(4)= 0; + elseif options(5)==1; stopit(4)= 1; + else error('options(5): no associated simple strategy'); + end + elseif options(6)==1; minfun= 'mdsmax'; + elseif options(6)==2; minfun= 'adsmax'; + else error('options(6) does not correspond to known algorithm'); + end + end + if length(options)>=10; stopit(2)= options(10); end + + ret = feval(minfun, funfun, X0, stopit, [], varargin{:}); diff --git a/code/eeglab13_4_4b/functions/octavefunc/optim/fminsearch.m b/code/eeglab13_4_4b/functions/octavefunc/optim/fminsearch.m new file mode 100644 index 0000000..36542fa --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/optim/fminsearch.m @@ -0,0 +1,49 @@ +% Copyright (C) 2006 Sylvain Pelissier +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; If not, see . + +% -*- texinfo -*- +% @deftypefn {Function File} {[@var{x}] =} fminsearch(@var{f},@var{X0},@var{options},@var{grad},@var{P1},@var{P2}, ...) +% +% Find the minimum of a funtion of several variables. +% By default the method used is the Nelder&Mead Simplex algorithm +% @seealso{fmin,fmins,nmsmax} +% @end deftypefn + +function varargout = fminsearch(funfun, X0, varargin) + if ismatlab + p1 = fileparts(which('fminsearch')); + rmpath(p1); + p2 = fileparts(which('fminsearch')); + if ~isequal(p1, p2) + disp( [ 'Some Octave functions should not run on Matlab' 10 'removing path to Octave fminsearch and using Matlab fminsearch' ]); + switch nargout + case 1, varargout{1} = fminsearch(funfun, X0, varargin{:}); + case 2, [varargout{1} varargout{2}] = fminsearch(funfun, X0, varargin{:}); + case 3, [varargout{1} varargout{2} varargout{3}] = fminsearch(funfun, X0, varargin{:}); + case 4, [varargout{1} varargout{2} varargout{3} varargout{4}]= fminsearch(funfun, X0, varargin{:}); + end; + else + disp( [ 'Octave functions should not run on Matlab' 10 'remove path ' p1 ]); + end; + return; + end; + if (nargin == 0); usage('[x fval] = fminsearch(funfun, X0, options, grad, varargin)'); end + if length(varargin) > 0, options = varargin{1}; varargin(1) = []; end; + if length(varargin) > 0, grad = varargin{1}; varargin(1) = []; end; + if (nargin < 3); options=[]; end + if (nargin < 4); grad=[]; end + if (nargin < 5); varargin={}; end + varargout{1} = fmins(funfun, X0, options, grad, varargin{:}); + varargout{2} = feval(funfun, x, varargin{:}); diff --git a/code/eeglab13_4_4b/functions/octavefunc/optim/nmsmax.m b/code/eeglab13_4_4b/functions/octavefunc/optim/nmsmax.m new file mode 100644 index 0000000..b79906d --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/optim/nmsmax.m @@ -0,0 +1,207 @@ +function [x, fmax, nf] = nmsmax(fun, x, stopit, savit, varargin) +%NMSMAX Nelder-Mead simplex method for direct search optimization. +% [x, fmax, nf] = NMSMAX(FUN, x0, STOPIT, SAVIT) attempts to +% maximize the function FUN, using the starting vector x0. +% The Nelder-Mead direct search method is used. +% Output arguments: +% x = vector yielding largest function value found, +% fmax = function value at x, +% nf = number of function evaluations. +% The iteration is terminated when either +% - the relative size of the simplex is <= STOPIT(1) +% (default 1e-3), +% - STOPIT(2) function evaluations have been performed +% (default inf, i.e., no limit), or +% - a function value equals or exceeds STOPIT(3) +% (default inf, i.e., no test on function values). +% The form of the initial simplex is determined by STOPIT(4): +% STOPIT(4) = 0: regular simplex (sides of equal length, the default) +% STOPIT(4) = 1: right-angled simplex. +% Progress of the iteration is not shown if STOPIT(5) = 0 (default 1). +% STOPIT(6) indicates the direction (ie. minimization or +% maximization.) Default is 1, maximization. +% set STOPIT(6)=-1 for minimization +% If a non-empty fourth parameter string SAVIT is present, then +% `SAVE SAVIT x fmax nf' is executed after each inner iteration. +% NB: x0 can be a matrix. In the output argument, in SAVIT saves, +% and in function calls, x has the same shape as x0. +% NMSMAX(fun, x0, STOPIT, SAVIT, P1, P2,...) allows additional +% arguments to be passed to fun, via feval(fun,x,P1,P2,...). + +% From Matrix Toolbox +% Copyright (C) 2002 N.J.Higham +% www.maths.man.ac.uk/~higham/mctoolbox +% distributed under the terms of the GNU General Public License +% +% Modifications for octave by A.Adler 2003 +% $Id: nmsmax.m 8056 2011-01-16 17:42:02Z i7tiol $ + +% References: +% N. J. Higham, Optimization by direct search in matrix computations, +% SIAM J. Matrix Anal. Appl, 14(2): 317-333, 1993. +% C. T. Kelley, Iterative Methods for Optimization, Society for Industrial +% and Applied Mathematics, Philadelphia, PA, 1999. + +if ismatlab + if license('test','optim_toolbox') + p = fileparts(which('fmins')); + error( [ 'Octave functions should not run on Matlab' 10 'remove path to ' p ]); + end; +end; + +x0 = x(:); % Work with column vector internally. +n = length(x0); + +% Set up convergence parameters etc. +if (nargin < 3 || isempty(stopit)) + stopit(1) = 1e-3; +end +tol = stopit(1); % Tolerance for cgce test based on relative size of simplex. +if length(stopit) == 1, stopit(2) = inf; end % Max no. of f-evaluations. +if length(stopit) == 2, stopit(3) = inf; end % Default target for f-values. +if length(stopit) == 3, stopit(4) = 0; end % Default initial simplex. +if length(stopit) == 4, stopit(5) = 1; end % Default: show progress. +trace = stopit(5); +if length(stopit) == 5, stopit(6) = 1; end % Default: maximize +dirn= stopit(6); +if nargin < 4, savit = []; end % File name for snapshots. + +V = [zeros(n,1) eye(n)]; +f = zeros(n+1,1); +V(:,1) = x0; +f(1) = dirn*feval(fun,x,varargin{:}); +fmax_old = f(1); + +if trace, fprintf('f(x0) = %9.4e\n', f(1)), end + +k = 0; m = 0; + +% Set up initial simplex. +scale = max(norm(x0,inf),1); +if stopit(4) == 0 + % Regular simplex - all edges have same length. + % Generated from construction given in reference [18, pp. 80-81] of [1]. + alpha = scale / (n*sqrt(2)) * [ sqrt(n+1)-1+n sqrt(n+1)-1 ]; + V(:,2:n+1) = (x0 + alpha(2)*ones(n,1)) * ones(1,n); + for j=2:n+1 + V(j-1,j) = x0(j-1) + alpha(1); + x(:) = V(:,j); + f(j) = dirn*feval(fun,x,varargin{:}); + end +else + % Right-angled simplex based on co-ordinate axes. + alpha = scale*ones(n+1,1); + for j=2:n+1 + V(:,j) = x0 + alpha(j)*V(:,j); + x(:) = V(:,j); + f(j) = dirn*feval(fun,x,varargin{:}); + end +end +nf = n+1; +how = 'initial '; + +[temp,j] = sort(f); +j = j(n+1:-1:1); +f = f(j); V = V(:,j); + +alpha = 1; beta = 1/2; gamma = 2; + +while 1 %%%%%% Outer (and only) loop. +k = k+1; + + fmax = f(1); + if fmax > fmax_old + if ~isempty(savit) + x(:) = V(:,1); eval(['save ' savit ' x fmax nf']) + end + end + if trace + fprintf('Iter. %2.0f,', k) + fprintf([' how = ' how ' ']); + fprintf('nf = %3.0f, f = %9.4e (%2.1f%%)\n', nf, fmax, ... + 100*(fmax-fmax_old)/(abs(fmax_old)+eps)) + end + fmax_old = fmax; + + %%% Three stopping tests from MDSMAX.M + + % Stopping Test 1 - f reached target value? + if fmax >= stopit(3) + msg = ['Exceeded target...quitting\n']; + break % Quit. + end + + % Stopping Test 2 - too many f-evals? + if nf >= stopit(2) + msg = ['Max no. of function evaluations exceeded...quitting\n']; + break % Quit. + end + + % Stopping Test 3 - converged? This is test (4.3) in [1]. + v1 = V(:,1); + size_simplex = norm(V(:,2:n+1)-v1(:,ones(1,n)),1) / max(1, norm(v1,1)); + if size_simplex <= tol + msg = sprintf('Simplex size %9.4e <= %9.4e...quitting\n', ... + size_simplex, tol); + break % Quit. + end + + % One step of the Nelder-Mead simplex algorithm + % NJH: Altered function calls and changed CNT to NF. + % Changed each `fr < f(1)' type test to `>' for maximization + % and re-ordered function values after sort. + + vbar = (sum(V(:,1:n)')/n)'; % Mean value + vr = (1 + alpha)*vbar - alpha*V(:,n+1); + x(:) = vr; + fr = dirn*feval(fun,x,varargin{:}); + nf = nf + 1; + vk = vr; fk = fr; how = 'reflect, '; + if fr > f(n) + if fr > f(1) + ve = gamma*vr + (1-gamma)*vbar; + x(:) = ve; + fe = dirn*feval(fun,x,varargin{:}); + nf = nf + 1; + if fe > f(1) + vk = ve; fk = fe; + how = 'expand, '; + end + end + else + vt = V(:,n+1); ft = f(n+1); + if fr > ft + vt = vr; ft = fr; + end + vc = beta*vt + (1-beta)*vbar; + x(:) = vc; + fc = dirn*feval(fun,x,varargin{:}); + nf = nf + 1; + if fc > f(n) + vk = vc; fk = fc; + how = 'contract,'; + else + for j = 2:n + V(:,j) = (V(:,1) + V(:,j))/2; + x(:) = V(:,j); + f(j) = dirn*feval(fun,x,varargin{:}); + end + nf = nf + n-1; + vk = (V(:,1) + V(:,n+1))/2; + x(:) = vk; + fk = dirn*feval(fun,x,varargin{:}); + nf = nf + 1; + how = 'shrink, '; + end + end + V(:,n+1) = vk; + f(n+1) = fk; + [temp,j] = sort(f); + j = j(n+1:-1:1); + f = f(j); V = V(:,j); + +end %%%%%% End of outer (and only) loop. + +% Finished. +if trace, fprintf(msg), end +x(:) = V(:,1); diff --git a/code/eeglab13_4_4b/functions/octavefunc/signal/checkfunctionmatlab.m b/code/eeglab13_4_4b/functions/octavefunc/signal/checkfunctionmatlab.m new file mode 100644 index 0000000..4d3df30 --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/signal/checkfunctionmatlab.m @@ -0,0 +1,17 @@ +function checkfunctionmatlab(func, toolbox) + +if ismatlab + if license('test',toolbox) + p1 = fileparts(which('firls')); + rmpath(p1); + p2 = fileparts(which('firls')); + if ~isempty(p2) + error( [ 'Octave functions should not run on Matlab' 10 'Removing path to ' p1 '. Run your command again' ]); + else + addpath(p1); + warning([ toolbox ' toolbox is absent or not in the path, using replacement functions' ]); + end; + else + warning([ toolbox ' toolbox is absent or not in the path, using replacement functions' ]); + end; +end; diff --git a/code/eeglab13_4_4b/functions/octavefunc/signal/filtfilt.m b/code/eeglab13_4_4b/functions/octavefunc/signal/filtfilt.m new file mode 100644 index 0000000..74a2059 --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/signal/filtfilt.m @@ -0,0 +1,139 @@ +% Copyright (C) 1999 Paul Kienzle +% Copyright (C) 2007 Francesco Potortì +% Copyright (C) 2008 Luca Citi +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; If not, see . + +% usage: y = filtfilt(b, a, x) +% +% Forward and reverse filter the signal. This corrects for phase +% distortion introduced by a one-pass filter, though it does square the +% magnitude response in the process. That's the theory at least. In +% practice the phase correction is not perfect, and magnitude response +% is distorted, particularly in the stop band. +%% +% Example +% [b, a]=butter(3, 0.1); % 10 Hz low-pass filter +% t = 0:0.01:1.0; % 1 second sample +% x=sin(2*pi*t*2.3)+0.25*randn(size(t)); % 2.3 Hz sinusoid+noise +% y = filtfilt(b,a,x); z = filter(b,a,x); % apply filter +% plot(t,x,';data;',t,y,';filtfilt;',t,z,';filter;') + +% Changelog: +% 2000 02 pkienzle@kienzle.powernet.co.uk +% - pad with zeros to load up the state vector on filter reverse. +% - add example +% 2007 12 pot@gnu.org +% - use filtic to compute initial and final states +% - work for multiple columns as well +% 2008 12 lciti@essex.ac.uk +% - fixed instability issues with IIR filters and noisy inputs +% - initial states computed according to Likhterov & Kopeika, 2003 +% - use of a 'reflection method' to reduce end effects +% - added some basic tests + +% TODO: (pkienzle) My version seems to have similar quality to matlab, +% but both are pretty bad. They do remove gross lag errors, though. + + +function y = filtfilt(b, a, x) +checkfunctionmatlab('filtfilt', 'signal_toolbox') + +if (nargin ~= 3) + usage('y=filtfilt(b,a,x)'); +end + +rotflag = 0; +if size(x,1) == 1 + rotflag == 1; + x = x'; % make it a column vector +end; + +lx = size(x,1); +a = a(:).'; +b = b(:).'; +lb = length(b); +la = length(a); +n = max(lb, la); +lrefl = 3 * (n - 1); +if la < n, a(n) = 0; end +if lb < n, b(n) = 0; end + +% Compute a the initial state taking inspiration from +% Likhterov & Kopeika, 2003. 'Hardware-efficient technique for +% minimizing startup transients in Direct Form II digital filters' +kdc = sum(b) / sum(a); +if (abs(kdc) < inf) % neither NaN nor +/- Inf + si = fliplr(cumsum(fliplr(b - kdc * a))); +else + si = zeros(size(a)); % fall back to zero initialization +end +si(1) = []; + +for (c = 1:size(x,2)) % filter all columns, one by one + v = [2*x(1,c)-x((lrefl+1):-1:2,c); x(:,c); + 2*x(end,c)-x((end-1):-1:end-lrefl,c)]; % a column vector + + % Do forward and reverse filtering + v = filter(b,a,v,si*v(1)); % forward filter + v = flipud(filter(b,a,flipud(v),si*v(end))); % reverse filter + y(:,c) = v((lrefl+1):(lx+lrefl)); +end + +if (rotflag) % x was a row vector + y = y'; % rotate it back +end + +%!error filtfilt (); + +%!error filtfilt (1, 2, 3, 4); + +%!test +%! randn('state',0); +%! r = randn(1,200); +%! [b,a] = butter(10, [.2, .25]); +%! yfb = filtfilt(b, a, r); +%! assert (size(r), size(yfb)); +%! assert (mean(abs(yfb)) < 1e3); +%! assert (mean(abs(yfb)) < mean(abs(r))); +%! ybf = fliplr(filtfilt(b, a, fliplr(r))); +%! assert (mean(abs(ybf)) < 1e3); +%! assert (mean(abs(ybf)) < mean(abs(r))); + +%!test +%! randn('state',0); +%! r = randn(1,1000); +%! s = 10 * sin(pi * 4e-2 * (1:length(r))); +%! [b,a] = cheby1(2, .5, [4e-4 8e-2]); +%! y = filtfilt(b, a, r+s); +%! assert (size(r), size(y)); +%! assert (mean(abs(y)) < 1e3); +%! assert (corrcoef(s(250:750), y(250:750)) > .95) +%! [b,a] = butter(2, [4e-4 8e-2]); +%! yb = filtfilt(b, a, r+s); +%! assert (mean(abs(yb)) < 1e3); +%! assert (corrcoef(y, yb) > .99) + +%!test +%! randn('state',0); +%! r = randn(1,1000); +%! s = 10 * sin(pi * 4e-2 * (1:length(r))); +%! [b,a] = butter(2, [4e-4 8e-2]); +%! y = filtfilt(b, a, [r.' s.']); +%! yr = filtfilt(b, a, r); +%! ys = filtfilt(b, a, s); +%! assert (y, [yr.' ys.']); +%! y2 = filtfilt(b.', a.', [r.' s.']); +%! assert (y, y2); + diff --git a/code/eeglab13_4_4b/functions/octavefunc/signal/firls.m b/code/eeglab13_4_4b/functions/octavefunc/signal/firls.m new file mode 100644 index 0000000..1214c7c --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/signal/firls.m @@ -0,0 +1,118 @@ +% Copyright (C) 2006 Quentin Spencer +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; If not, see . + +% b = firls(N, F, A); +% b = firls(N, F, A, W); +% +% FIR filter design using least squares method. Returns a length N+1 +% linear phase filter such that the integral of the weighted mean +% squared error in the specified bands is minimized. +% +% F specifies the frequencies of the band edges, normalized so that +% half the sample frequency is equal to 1. Each band is specified by +% two frequencies, to the vector must have an even length. +% +% A specifies the amplitude of the desired response at each band edge. +% +% W is an optional weighting function that contains one value for each +% band that weights the mean squared error in that band. A must be the +% same length as F, and W must be half the length of F. + +% The least squares optimization algorithm for computing FIR filter +% coefficients is derived in detail in: +% +% I. Selesnick, 'Linear-Phase FIR Filter Design by Least Squares,' +% http://cnx.org/content/m10577 + +function coef = firls(N, frequencies, pass, weight, str); + +checkfunctionmatlab('firls', 'signal_toolbox') + +if nargin<3 | nargin>6 + usage(''); +end +if nargin==3 + weight = ones(1, length(pass)/2); + str = []; +end +if nargin==4 + if ischar(weight) + str = weight; + weight = ones(size(pass)); + else + str = []; + end +end +if length(frequencies) ~= length(pass) + error('F and A must have equal lengths.'); +end +if 2 * length(weight) ~= length(pass) + error('W must contain one weight per band.'); +end + +if ischar(str) + error('This feature is implemented yet'); +else + + M = N/2; + w = kron(weight(:), [-1; 1]); + omega = frequencies * pi; + i1 = 1:2:length(omega); + i2 = 2:2:length(omega); + + % Generate the matrix Q + % As illustrated in the above-cited reference, the matrix can be + % expressed as the sum of a Hankel and Toeplitz matrix. A factor of + % 1/2 has been dropped and the final filter coefficients multiplied + % by 2 to compensate. + warning off MATLAB:colon:nonIntegerIndex + cos_ints = [omega; sin((1:N)' * omega)]; + q = [1, 1./(1:N)]' .* (cos_ints * w); + Q = toeplitz(q(1:M+1)) + hankel(q(1:M+1), q(M+1:end)); + + % The vector b is derived from solving the integral: + % + % _ w + % / 2 + % b = / W(w) D(w) cos(kw) dw + % k / w + % - 1 + % + % Since we assume that W(w) is constant over each band (if not, the + % computation of Q above would be considerably more complex), but + % D(w) is allowed to be a linear function, in general the function + % W(w) D(w) is linear. The computations below are derived from the + % fact that: + % _ + % / a ax + b + % / (ax + b) cos(nx) dx = --- cos (nx) + ------ sin(nx) + % / 2 n + % - n + % + cos_ints2 = [omega(i1).^2 - omega(i2).^2; ... + cos((1:M)' * omega(i2)) - cos((1:M)' * omega(i1))] ./ ... + ([2, 1:M]' * (omega(i2) - omega(i1))); + d = [-weight .* pass(i1); weight .* pass(i2)]; + d = d(:); + b = [1, 1./(1:M)]' .* ((kron(cos_ints2, [1, 1]) + cos_ints(1:M+1,:)) * d); + + % Having computed the components Q and b of the matrix equation, + % solve for the filter coefficients. + a = Q \ b; + coef = [ a(end:-1:2); 2 * a(1); a(2:end) ]; + warning on MATLAB:colon:nonIntegerIndex + +end + diff --git a/code/eeglab13_4_4b/functions/octavefunc/signal/pwelch.m b/code/eeglab13_4_4b/functions/octavefunc/signal/pwelch.m new file mode 100644 index 0000000..50c2704 --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/signal/pwelch.m @@ -0,0 +1,958 @@ +% Copyright (C) 2006 Peter V. Lanspeary +% +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 2, +% or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; If not, see . +% +% USAGE: +% [spectra,freq] = pwelch(x,window,overlap,Nfft,Fs, +% range,plot_type,detrend,sloppy) +% Estimate power spectral density of data "x" by the Welch (1967) +% periodogram/FFT method. All arguments except "x" are optional. +% The data is divided into segments. If "window" is a vector, each +% segment has the same length as "window" and is multiplied by "window" +% before (optional) zero-padding and calculation of its periodogram. If +% "window" is a scalar, each segment has a length of "window" and a +% Hamming window is used. +% The spectral density is the mean of the periodograms, scaled so that +% area under the spectrum is the same as the mean square of the +% data. This equivalence is supposed to be exact, but in practice there +% is a mismatch of up to 0.5% when comparing area under a periodogram +% with the mean square of the data. +% +% [spectra,freq] = pwelch(x,y,window,overlap,Nfft,Fs, +% range,plot_type,detrend,sloppy,results) +% Two-channel spectrum analyser. Estimate power spectral density, cross- +% spectral density, transfer function and/or coherence functions of time- +% series input data "x" and output data "y" by the Welch (1967) +% periodogram/FFT method. +% pwelch treats the second argument as "y" if there is a control-string +% argument "cross", "trans", "coher" or "ypower"; "power" does not force +% the 2nd argument to be treated as "y". All other arguments are +% optional. All spectra are returned in matrix "spectra". +% +% [spectra,Pxx_ci,freq] = pwelch(x,window,overlap,Nfft,Fs,conf, +% range,plot_type,detrend,sloppy) +% [spectra,Pxx_ci,freq] = pwelch(x,y,window,overlap,Nfft,Fs,conf, +% range,plot_type,detrend,sloppy,results) +% Estimates confidence intervals for the spectral density. +% See Hint (7) below for compatibility options. Confidence level "conf" +% is the 6th or 7th numeric argument. If "results" control-string +% arguments are used, one of them must be "power" when the "conf" +% argument is present; pwelch can estimate confidence intervals only for +% the power spectrum of the "x" data. It does not know how to estimate +% confidence intervals of the cross-power spectrum, transfer function or +% coherence; if you can suggest a good method, please send a bug report. +% +% ARGUMENTS +% All but the first argument are optional and may be empty, except that +% the "results" argument may require the second argument to be "y". +% +% x % [non-empty vector] system-input time-series data +% y % [non-empty vector] system-output time-series data +% +% window % [real vector] of window-function values between 0 and 1; the +% % data segment has the same length as the window. +% % Default window shape is Hamming. +% % [integer scalar] length of each data segment. The default +% % value is window=sqrt(length(x)) rounded up to the +% % nearest integer power of 2; see 'sloppy' argument. +% +% overlap % [real scalar] segment overlap expressed as a multiple of +% % window or segment length. 0 <= overlap < 1, +% % The default is overlap=0.5 . +% +% Nfft % [integer scalar] Length of FFT. The default is the length +% % of the "window" vector or has the same value as the +% % scalar "window" argument. If Nfft is larger than the +% % segment length, "seg_len", the data segment is padded +% % with "Nfft-seg_len" zeros. The default is no padding. +% % Nfft values smaller than the length of the data +% % segment (or window) are ignored silently. +% +% Fs % [real scalar] sampling frequency (Hertz); default=1.0 +% +% conf % [real scalar] confidence level between 0 and 1. Confidence +% % intervals of the spectral density are estimated from +% % scatter in the periodograms and are returned as Pxx_ci. +% % Pxx_ci(:,1) is the lower bound of the confidence +% % interval and Pxx_ci(:,2) is the upper bound. If there +% % are three return values, or conf is an empty matrix, +% % confidence intervals are calculated for conf=0.95 . +% % If conf is zero or is not given, confidence intervals +% % are not calculated. Confidence intervals can be +% % obtained only for the power spectral density of x; +% % nothing else. +% +% CONTROL-STRING ARGUMENTS -- each of these arguments is a character string. +% Control-string arguments must be after the other arguments but can be in +% any order. +% +% range % 'half', 'onesided' : frequency range of the spectrum is +% % zero up to but not including Fs/2. Power from +% % negative frequencies is added to the positive side of +% % the spectrum, but not at zero or Nyquist (Fs/2) +% % frequencies. This keeps power equal in time and +% % spectral domains. See reference [2]. +% % 'whole', 'twosided' : frequency range of the spectrum is +% % -Fs/2 to Fs/2, with negative frequencies +% % stored in "wrap around" order after the positive +% % frequencies; e.g. frequencies for a 10-point 'twosided' +% % spectrum are 0 0.1 0.2 0.3 0.4 0.5 -0.4 -0.3 -0.2 -0.1 +% % 'shift', 'centerdc' : same as 'whole' but with the first half +% % of the spectrum swapped with second half to put the +% % zero-frequency value in the middle. (See "help +% % fftshift". +% % If data (x and y) are real, the default range is 'half', +% % otherwise default range is 'whole'. +% +% plot_type % 'plot', 'semilogx', 'semilogy', 'loglog', 'squared' or 'db': +% % specifies the type of plot. The default is 'plot', which +% % means linear-linear axes. 'squared' is the same as 'plot'. +% % 'dB' plots "10*log10(psd)". This argument is ignored and a +% % spectrum is not plotted if the caller requires a returned +% % value. +% +% detrend % 'no-strip', 'none' -- do NOT remove mean value from the data +% % 'short', 'mean' -- remove the mean value of each segment from +% % each segment of the data. +% % 'linear', -- remove linear trend from each segment of +% % the data. +% % 'long-mean' -- remove the mean value from the data before +% % splitting it into segments. This is the default. +% +% sloppy % 'sloppy': FFT length is rounded up to the nearest integer +% % power of 2 by zero padding. FFT length is adjusted +% % after addition of padding by explicit Nfft argument. +% % The default is to use exactly the FFT and window/ +% % segment lengths specified in argument list. +% +% results % specifies what results to return (in the order specified +% % and as many as desired). +% % 'power' calculate power spectral density of "x" +% % 'cross' calculate cross spectral density of "x" and "y" +% % 'trans' calculate transfer function of a system with +% % input "x" and output "y" +% % 'coher' calculate coherence function of "x" and "y" +% % 'ypower' calculate power spectral density of "y" +% % The default is 'power', with argument "y" omitted. +% +% RETURNED VALUES: +% If return values are not required by the caller, the results are +% plotted and nothing is returned. +% +% spectra % [real-or-complex matrix] columns of the matrix contain results +% % in the same order as specified by "results" arguments. +% % Each column contains one of the result vectors. +% +% Pxx_ci % [real matrix] estimate of confidence interval for power +% % spectral density of x. First column is the lower +% % bound. Second column is the upper bound. +% +% freq % [real column vector] frequency values +% +% HINTS +% 1) EMPTY ARGS: +% if you don't want to use an optional argument you can leave it empty +% by writing its value as []. +% 2) FOR BEGINNERS: +% The profusion of arguments may make pwelch difficult to use, and an +% unskilled user can easily produce a meaningless result or can easily +% mis-interpret the result. With real data "x" and sampling frequency +% "Fs", the easiest and best way for a beginner to use pwelch is +% probably "pwelch(x,[],[],[],Fs)". Use the "window" argument to +% control the length of the spectrum vector. For real data and integer +% scalar M, "pwelch(x,2*M,[],[],Fs)" gives an M+1 point spectrum. +% Run "demo pwelch" (octave only). +% 3) WINDOWING FUNCTIONS: +% Without a window function, sharp spectral peaks can have strong +% sidelobes because the FFT of a data in a segment is in effect convolved +% with a rectangular window. A window function which tapers off +% (gradually) at the ends produces much weaker sidelobes in the FFT. +% Hann (hanning), hamming, bartlett, blackman, flattopwin etc are +% available as separate Matlab/sigproc or Octave functions. The sidelobes +% of the Hann window have a roll-off rate of 60dB/decade of frequency. +% The first sidelobe of the Hamming window is suppressed and is about 12dB +% lower than the first Hann sidelobe, but the roll-off rate is only +% 20dB/decade. You can inspect the FFT of a Hann window by plotting +% "abs(fft(postpad(hanning(256),4096,0)))". +% The default window is Hamming. +% 4) ZERO PADDING: +% Zero-padding reduces the frequency step in the +% spectrum, and produces an artificially smoothed spectrum. For example, +% "Nfft=2*length(window)" gives twice as many frequency values, but +% adjacent PSD (power spectral density) values are not independent; +% adjacent PSD values are independent if "Nfft=length(window)", which is +% the default value of Nfft. +% 5) REMOVING MEAN FROM SIGNAL: +% If the mean is not removed from the signal there is a large spectral +% peak at zero frequency and the sidelobes of this peak are likely to +% swamp the rest of the spectrum. For this reason, the default behaviour +% is to remove the mean. However, the matlab pwelch does not do this. +% 6) WARNING ON CONFIDENCE INTERVALS +% Confidence intervals are obtained by measuring the sample variance of +% the periodograms and assuming that the periodograms have a Gaussian +% probability distribution. This assumption is not accurate. If, for +% example, the data (x) is Gaussian, the periodogram has a Rayleigh +% distribution. However, the confidence intervals may still be useful. +% +% 7) COMPATIBILITY WITH Matlab R11, R12, etc +% When used without the second data (y) argument, arguments are compatible +% with the pwelch of Matlab R12, R13, R14, 2006a and 2006b except that +% 1) overlap is expressed as a multiple of window length --- +% effect of overlap scales with window length +% 2) default values of length(window), Nfft and Fs are more sensible, and +% 3) Goertzel algorithm is not available so Nfft cannot be an array of +% frequencies as in Matlab 2006b. +% Pwelch has four persistent Matlab-compatibility levels. Calling pwelch +% with an empty first argument sets the order of arguments and defaults +% specified above in the USAGE and ARGUMENTS section of this documentation. +% prev_compat=pwelch([]); +% [Pxx,f]=pwelch(x,window,overlap,Nfft,Fs,conf,...); +% Calling pwelch with a single string argument (as described below) gives +% compatibility with Matlab R11 or R12, or the R14 spectrum.welch +% defaults. The returned value is the PREVIOUS compatibility string. +% +% Matlab R11: For compatibility with the Matlab R11 pwelch: +% prev_compat=pwelch('R11-'); +% [Pxx,f]=pwelch(x,Nfft,Fs,window,overlap,conf,range,units); +% % units of overlap are "number of samples" +% % defaults: Nfft=min(length(x),256), Fs=2*pi, length(window)=Nfft, +% % window=Hanning, do not detrend, +% % N.B. "Sloppy" is not available. +% +% Matlab R12: For compatibility with Matlab R12 to 2006a pwelch: +% prev_compat=pwelch('R12+'); +% [Pxx,f]=pwelch(x,window,overlap,nfft,Fs,...); +% % units of overlap are "number of samples" +% % defaults: length(window)==length(x)/8, window=Hamming, +% % Nfft=max(256,NextPow2), Fs=2*pi, do not detrend +% % NextPow2 is the next power of 2 greater than or equal to the +% % window length. "Sloppy", "conf" are not available. Default +% % window length gives very poor amplitude resolution. +% +% To adopt defaults of the Matlab R14 "spectrum.welch" spectrum object +% associated "psd" method. +% prev_compat=pwelch('psd'); +% [Pxx,f] = pwelch(x,window,overlap,Nfft,Fs,conf,...); +% % overlap is expressed as a percentage of window length, +% % defaults: length(window)==64, Nfft=max(256,NextPow2), Fs=2*pi +% % do not detrend +% % NextPow2 is the next power of 2 greater than or equal to the +% % window length. "Sloppy" is not available. +% % Default window length gives coarse frequency resolution. +% +% +% REFERENCES +% [1] Peter D. Welch (June 1967): +% "The use of fast Fourier transform for the estimation of power spectra: +% a method based on time averaging over short, modified periodograms." +% IEEE Transactions on Audio Electroacoustics, Vol AU-15(6), pp 70-73 +% +% [2] William H. Press and Saul A. Teukolsky and William T. Vetterling and +% Brian P. Flannery", +% "Numerical recipes in C, The art of scientific computing", 2nd edition, +% Cambridge University Press, 2002 --- Section 13.7. +% [3] Paul Kienzle (1999-2001): "pwelch", http://octave.sourceforge.net/ + + +function [varargout] = pwelch(x,varargin) + +checkfunctionmatlab('pwelch', 'signal_toolbox') + + % + % COMPATIBILITY LEVEL + % Argument positions and defaults depend on compatibility level selected + % by calling pwelch without arguments or with a single string argument. + % native: compatib=1; prev_compat=pwelch(); prev_compat=pwelch([]); + % matlab R11: compatib=2; prev_compat=pwelch('R11-'); + % matlab R12: compatib=3; prev_compat=pwelch('R12+'); + % spectrum.welch defaults: compatib=4; prev_compat=pwelch('psd'); + % In each case, the returned value is the PREVIOUS compatibility string. + % +compat_str = {[]; 'R11-'; 'R12+'; 'psd'}; +persistent compatib; +if ( isempty(compatib) || compatib<=0 || compatib>4 ) + % legal values are 1, 2, 3, 4 + compatib = 1; +end +if ( nargin <= 0 ) + error( 'pwelch: Need at least 1 arg. Use "help pwelch".' ); +elseif ( nargin==1 && (ischar(x) || isempty(x)) ) + varargout{1} = compat_str{compatib}; + if ( isempty(x) ) % native + compatib = 1; + elseif ( strcmp(x,'R11-') ) + compatib = 2; + elseif ( strcmp(x,'R12+') ) + compatib = 3; + elseif ( strcmp(x,'psd') ) + compatib = 4; + else + error( 'pwelch: compatibility arg must be empty, R11-, R12+ or psd' ); + end + % return +% +% Check fixed argument +elseif ( isempty(x) || ~isvector(x) ) + error( 'pwelch: arg 1 (x) must be vector.' ); +else + % force x to be COLUMN vector + if ( size(x,1)==1 ) + x=x(:); + end + % + % Look through all args to check if cross PSD, transfer function or + % coherence is required. If yes, the second arg is data vector "y". + arg2_is_y = 0; + x_len = length(x); + nvarargin = length(varargin); + for iarg=1:nvarargin + arg = varargin{iarg}; + if ( ~isempty(arg) && ischar(arg) && ... + ( strcmp(arg,'cross') || strcmp(arg,'trans') || ... + strcmp(arg,'coher') || strcmp(arg,'ypower') )) + % OK. Need "y". Grab it from 2nd arg. + arg = varargin{1}; + if ( nargin<2 || isempty(arg) || ~isvector(arg) || length(arg)~=x_len ) + error( 'pwelch: arg 2 (y) must be vector, same length as x.' ); + end + % force COLUMN vector + y = varargin{1}(:); + arg2_is_y = 1; + break; + end + end + % + % COMPATIBILITY + % To select default argument values, "compatib" is used as an array index. + % Index values are 1=native, 2=R11, 3=R12, 4=spectrum.welch + % + % argument positions: + % arg_posn = varargin index of window, overlap, Nfft, Fs and conf + % args respectively, a value of zero ==>> arg does not exist + arg_posn = [1 2 3 4 5; % native + 3 4 1 2 5; % Matlab R11- pwelch + 1 2 3 4 0; % Matlab R12+ pwelch + 1 2 3 4 5]; % spectrum.welch defaults + arg_posn = arg_posn(compatib,:) + arg2_is_y; + % + % SPECIFY SOME DEFAULT VALUES for (not all) optional arguments + % Use compatib as array index. + % Fs = sampling frequency + Fs = [ 1.0 2*pi 2*pi 2*pi ]; + Fs = Fs(compatib); + % plot_type: 1='plot'|'squared'; 5='db'|'dB' + plot_type = [ 1 5 5 5 ]; + plot_type = plot_type(compatib); + % rm_mean: 3='long-mean'; 0='no-strip'|'none' + rm_mean = [ 3 0 0 0 ]; + rm_mean = rm_mean(compatib); + % use max_overlap=x_len-1 because seg_len is not available yet + % units of overlap are different for each version: + % fraction, samples, or percent + max_overlap = [ 0.95 x_len-1 x_len-1 95]; + max_overlap = max_overlap(compatib); + % default confidence interval + % if there are more than 2 return values and if there is a "conf" arg + conf = 0.95 * (nargout>2) * (arg_posn(5)>0); + % + is_win = 0; % =0 means valid window arg is not provided yet + Nfft = []; % default depends on segment length + overlap = []; % WARNING: units can be #samples, fraction or percentage + range = ~isreal(x) || ( arg2_is_y && ~isreal(y) ); + is_sloppy = 0; + n_results = 0; + do_power = 0; + do_cross = 0; + do_trans = 0; + do_coher = 0; + do_ypower = 0; +% +% DECODE AND CHECK OPTIONAL ARGUMENTS + end_numeric_args = 0; + for iarg = 1+arg2_is_y:nvarargin + arg = varargin{iarg}; + if ( ischar(arg) ) + % first string arg ==> no more numeric args + % non-string args cannot follow a string arg + end_numeric_args = 1; + % + % decode control-string arguments + if ( strcmp(arg,'sloppy') ) + is_sloppy = ~is_win || is_win==1; + elseif ( strcmp(arg,'plot') || strcmp(arg,'squared') ) + plot_type = 1; + elseif ( strcmp(arg,'semilogx') ) + plot_type = 2; + elseif ( strcmp(arg,'semilogy') ) + plot_type = 3; + elseif ( strcmp(arg,'loglog') ) + plot_type = 4; + elseif ( strcmp(arg,'db') || strcmp(arg,'dB') ) + plot_type = 5; + elseif ( strcmp(arg,'half') || strcmp(arg,'onesided') ) + range = 0; + elseif ( strcmp(arg,'whole') || strcmp(arg,'twosided') ) + range = 1; + elseif ( strcmp(arg,'shift') || strcmp(arg,'centerdc') ) + range = 2; + elseif ( strcmp(arg,'long-mean') ) + rm_mean = 3; + elseif ( strcmp(arg,'linear') ) + rm_mean = 2; + elseif ( strcmp(arg,'short') || strcmp(arg,'mean') ) + rm_mean = 1; + elseif ( strcmp(arg,'no-strip') || strcmp(arg,'none') ) + rm_mean = 0; + elseif ( strcmp(arg, 'power' ) ) + if ( ~do_power ) + n_results = n_results+1; + do_power = n_results; + end + elseif ( strcmp(arg, 'cross' ) ) + if ( ~do_cross ) + n_results = n_results+1; + do_cross = n_results; + end + elseif ( strcmp(arg, 'trans' ) ) + if ( ~do_trans ) + n_results = n_results+1; + do_trans = n_results; + end + elseif ( strcmp(arg, 'coher' ) ) + if ( ~do_coher ) + n_results = n_results+1; + do_coher = n_results; + end + elseif ( strcmp(arg, 'ypower' ) ) + if ( ~do_ypower ) + n_results = n_results+1; + do_ypower = n_results; + end + else + error( 'pwelch: string arg %d illegal value: %s', iarg+1, arg ); + end + % end of processing string args + % + elseif ( end_numeric_args ) + if ( ~isempty(arg) ) + % found non-string arg after a string arg ... oops + error( 'pwelch: control arg must be string' ); + end + % + % first 4 optional arguments are numeric -- in fixed order + % + % deal with "Fs" and "conf" first because empty arg is a special default + % -- "Fs" arg -- sampling frequency + elseif ( iarg == arg_posn(4) ) + if ( isempty(arg) ) + Fs = 1; + elseif ( ~isscalar(arg) || ~isreal(arg) || arg<0 ) + error( 'pwelch: arg %d (Fs) must be real scalar >0', iarg+1 ); + else + Fs = arg; + end + % + % -- "conf" arg -- confidence level + % guard against the "it cannot happen" iarg==0 + elseif ( arg_posn(5) && iarg == arg_posn(5) ) + if ( isempty(arg) ) + conf = 0.95; + elseif ( ~isscalar(arg) || ~isreal(arg) || arg < 0.0 || arg >= 1.0 ) + error( 'pwelch: arg %d (conf) must be real scalar, >=0, <1',iarg+1 ); + else + conf = arg; + end + % + % skip all empty args from this point onward + elseif ( isempty(arg) ) + 1; + % + % -- "window" arg -- window function + elseif ( iarg == arg_posn(1) ) + if ( isscalar(arg) ) + is_win = 1; + elseif ( isvector(arg) ) + is_win = length(arg); + if ( size(arg,2)>1 ) % vector must be COLUMN vector + arg = arg(:); + end + else + is_win = 0; + end + if ( ~is_win ) + error( 'pwelch: arg %d (window) must be scalar or vector', iarg+1 ); + elseif ( is_win==1 && ( ~isreal(arg) || fix(arg)~=arg || arg<=3 ) ) + error( 'pwelch: arg %d (window) must be integer >3', iarg+1 ); + elseif ( is_win>1 && ( ~isreal(arg) || any(arg<0) ) ) + error( 'pwelch: arg %d (window) vector must be real and >=0',iarg+1); + end + window = arg; + is_sloppy = 0; + % + % -- "overlap" arg -- segment overlap + elseif ( iarg == arg_posn(2) ) + if (~isscalar(arg) || ~isreal(arg) || arg<0 || arg>max_overlap ) + error( 'pwelch: arg %d (overlap) must be real from 0 to %f', ... + iarg+1, max_overlap ); + end + overlap = arg; + % + % -- "Nfft" arg -- FFT length + elseif ( iarg == arg_posn(3) ) + if ( ~isscalar(arg) || ~isreal(arg) || fix(arg)~=arg || arg<0 ) + error( 'pwelch: arg %d (Nfft) must be integer >=0', iarg+1 ); + end + Nfft = arg; + % + else + error( 'pwelch: arg %d must be string', iarg+1 ); + end + end + if ( conf>0 && (n_results && ~do_power ) ) + error('pwelch: can give confidence interval for x power spectrum only' ); + end + % + % end DECODE AND CHECK OPTIONAL ARGUMENTS. + % + % SETUP REMAINING PARAMETERS + % default action is to calculate power spectrum only + if ( ~n_results ) + n_results = 1; + do_power = 1; + end + need_Pxx = do_power || do_trans || do_coher; + need_Pxy = do_cross || do_trans || do_coher; + need_Pyy = do_coher || do_ypower; + log_two = log(2); + nearly_one = 0.99999999999; + % + % compatibility-options + % provides exact compatibility with Matlab R11 or R12 + % + % Matlab R11 compatibility + if ( compatib==2 ) + if ( isempty(Nfft) ) + Nfft = min( 256, x_len ); + end + if ( is_win > 1 ) + seg_len = min( length(window), Nfft ); + window = window(1:seg_len); + else + if ( is_win ) + % window arg is scalar + seg_len = window; + else + seg_len = Nfft; + end + % make Hann window (don't depend on sigproc) + xx = seg_len - 1; + window = 0.5 - 0.5 * cos( (2*pi/xx)*[0:xx].' ); + end + % + % Matlab R12 compatibility + elseif ( compatib==3 ) + if ( is_win > 1 ) + % window arg provides window function + seg_len = length(window); + else + % window arg does not provide window function; use Hamming + if ( is_win ) + % window arg is scalar + seg_len = window; + else + % window arg not available; use R12 default, 8 windows + % ignore overlap arg; use overlap=50% -- only choice that makes sense + % this is the magic formula for 8 segments with 50% overlap + seg_len = fix( (x_len-3)*2/9 ); + end + % make Hamming window (don't depend on sigproc) + xx = seg_len - 1; + window = 0.54 - 0.46 * cos( (2*pi/xx)*[0:xx].' ); + end + if ( isempty(Nfft) ) + Nfft = max( 256, 2^ceil(log(seg_len)*nearly_one/log_two) ); + end + % + % Matlab R14 psd(spectrum.welch) defaults + elseif ( compatib==4 ) + if ( is_win > 1 ) + % window arg provides window function + seg_len = length(window); + else + % window arg does not provide window function; use Hamming + if ( is_win ) + % window arg is scalar + seg_len = window; + else + % window arg not available; use default seg_len = 64 + seg_len = 64; + end + % make Hamming window (don't depend on sigproc) + xx = seg_len - 1; + window = 0.54 - 0.46 * cos( (2*pi/xx)*[0:xx].' ); + end + % Now we know segment length, + % so we can set default overlap as number of samples + if ( ~isempty(overlap) ) + overlap = fix(seg_len * overlap / 100 ); + end + if ( isempty(Nfft) ) + Nfft = max( 256, 2^ceil(log(seg_len)*nearly_one/log_two) ); + end + % + % default compatibility level + else %if ( compatib==1 ) + % calculate/adjust segment length, window function + if ( is_win > 1 ) + % window arg provides window function + seg_len = length(window); + else + % window arg does not provide window function; use Hamming + if ( is_win ) % window arg is scalar + seg_len = window; + else + % window arg not available; use default length: + % = sqrt(length(x)) rounded up to nearest integer power of 2 + if ( isempty(overlap) ) + overlap=0.5; + end + seg_len = 2 ^ ceil( log(sqrt(x_len/(1-overlap)))*nearly_one/log_two ); + end + % make Hamming window (don't depend on sigproc) + xx = seg_len - 1; + window = 0.54 - 0.46 * cos( (2*pi/xx)*[0:xx].' ); + end + % Now we know segment length, + % so we can set default overlap as number of samples + if ( ~isempty(overlap) ) + overlap = fix(seg_len * overlap); + end + % + % calculate FFT length + if ( isempty(Nfft) ) + Nfft = seg_len; + end + if ( is_sloppy ) + Nfft = 2 ^ ceil( log(Nfft) * nearly_one / log_two ); + end + end + % end of compatibility options + % + % minimum FFT length is seg_len + Nfft = max( Nfft, seg_len ); + % Mean square of window is required for normalising PSD amplitude. + win_meansq = (window.' * window) / seg_len; + % + % Set default or check overlap. + if ( isempty(overlap) ) + overlap = fix(seg_len /2); + elseif ( overlap >= seg_len ) + error( 'pwelch: arg (overlap=%d) too big. Must be 0 ) + Vxx = xx; + else + Vxx = []; + end + n_ffts = 0; + for start_seg = [1:seg_len-overlap:x_len-seg_len+1] + end_seg = start_seg+seg_len-1; + % Don't truncate/remove the zero padding in xx and yy + if ( need_Pxx || need_Pxy ) + if ( rm_mean==1 ) % remove mean from segment + xx(1:seg_len) = window .* ( ... + x(start_seg:end_seg) - sum(x(start_seg:end_seg)) / seg_len); + elseif ( rm_mean == 2 ) % remove linear trend from segment + xx(1:seg_len) = window .* detrend( x(start_seg:end_seg) ); + else % rm_mean==0 or 3 + xx(1:seg_len) = window .* x(start_seg:end_seg); + end + fft_x = fft(xx); + end + if ( need_Pxy || need_Pyy ) + if ( rm_mean==1 ) % remove mean from segment + yy(1:seg_len) = window .* ( ... + y(start_seg:end_seg) - sum(y(start_seg:end_seg)) / seg_len); + elseif ( rm_mean == 2 ) % remove linear trend from segment + yy(1:seg_len) = window .* detrend( y(start_seg:end_seg) ); + else % rm_mean==0 or 3 + yy(1:seg_len) = window .* y(start_seg:end_seg); + end + fft_y = fft(yy); + end + if ( need_Pxx ) + % force Pxx to be real; pgram = periodogram + pgram = real(fft_x .* conj(fft_x)); + Pxx = Pxx + pgram; + % sum of squared periodograms is required for confidence interval + if ( conf>0 ) + Vxx = Vxx + pgram .^2; + end + end + if ( need_Pxy ) + % Pxy (cross power spectrum) is complex. Do not force to be real. + Pxy = Pxy + fft_y .* conj(fft_x); + end + if ( need_Pyy ) + % force Pyy to be real + Pyy = Pyy + real(fft_y .* conj(fft_y)); + end + n_ffts = n_ffts +1; + end + % + % Calculate confidence interval + % -- incorrectly assumes that the periodogram has Gaussian probability + % distribution (actually, it has a single-sided (e.g. exponential) + % distribution. + % Sample variance of periodograms is (Vxx-Pxx.^2/n_ffts)/(n_ffts-1). + % This method of calculating variance is more susceptible to round-off + % error, but is quicker, and for double-precision arithmetic and the + % inherently noisy periodogram (variance==mean^2), it should be OK. + if ( conf>0 && need_Pxx ) + if ( n_ffts<2 ) + Vxx = zeros(Nfft,1); + else + % Should use student distribution here (for unknown variance), but tinv + % is not a core Matlab function (is in statistics toolbox. Grrr) + Vxx = (erfinv(conf)*sqrt(2*n_ffts/(n_ffts-1))) * sqrt(Vxx-Pxx.^2/n_ffts); + end + end + % + % Convert two-sided spectra to one-sided spectra (if range == 0). + % For one-sided spectra, contributions from negative frequencies are added + % to the positive side of the spectrum -- but not at zero or Nyquist + % (half sampling) frequencies. This keeps power equal in time and spectral + % domains, as required by Parseval theorem. + % + if ( range == 0 ) + if ( ~ rem(Nfft,2) ) % one-sided, Nfft is even + psd_len = Nfft/2+1; + if ( need_Pxx ) + Pxx = Pxx(1:psd_len) + [0; Pxx(Nfft:-1:psd_len+1); 0]; + if ( conf>0 ) + Vxx = Vxx(1:psd_len) + [0; Vxx(Nfft:-1:psd_len+1); 0]; + end + end + if ( need_Pxy ) + Pxy = Pxy(1:psd_len) + conj([0; Pxy(Nfft:-1:psd_len+1); 0]); + end + if ( need_Pyy ) + Pyy = Pyy(1:psd_len) + [0; Pyy(Nfft:-1:psd_len+1); 0]; + end + else % one-sided, Nfft is odd + psd_len = (Nfft+1)/2; + if ( need_Pxx ) + Pxx = Pxx(1:psd_len) + [0; Pxx(Nfft:-1:psd_len+1)]; + if ( conf>0 ) + Vxx = Vxx(1:psd_len) + [0; Vxx(Nfft:-1:psd_len+1)]; + end + end + if ( need_Pxy ) + Pxy = Pxy(1:psd_len) + conj([0; Pxy(Nfft:-1:psd_len+1)]); + end + if ( need_Pyy ) + Pyy = Pyy(1:psd_len) + [0; Pyy(Nfft:-1:psd_len+1)]; + end + end + else % two-sided (and shifted) + psd_len = Nfft; + end + % end MAIN CALCULATIONS + % + % SCALING AND OUTPUT + % Put all results in matrix, one row per spectrum + % Pxx, Pxy, Pyy are sums of periodograms, so "n_ffts" + % in the scale factor converts them into averages + spectra = zeros(psd_len,n_results); + spect_type = zeros(n_results,1); + scale = n_ffts * seg_len * Fs * win_meansq; + if ( do_power ) + spectra(:,do_power) = Pxx / scale; + spect_type(do_power) = 1; + if ( conf>0 ) + Vxx = [Pxx-Vxx Pxx+Vxx]/scale; + end + end + if ( do_cross ) + spectra(:,do_cross) = Pxy / scale; + spect_type(do_cross) = 2; + end + if ( do_trans ) + spectra(:,do_trans) = Pxy ./ Pxx; + spect_type(do_trans) = 3; + end + if ( do_coher ) + % force coherence to be real + spectra(:,do_coher) = real(Pxy .* conj(Pxy)) ./ Pxx ./ Pyy; + spect_type(do_coher) = 4; + end + if ( do_ypower ) + spectra(:,do_ypower) = Pyy / scale; + spect_type(do_ypower) = 5; + end + freq = [0:psd_len-1].' * ( Fs / Nfft ); + % + % range='shift': Shift zero-frequency to the middle + if ( range == 2 ) + len2 = fix((Nfft+1)/2); + spectra = [ spectra(len2+1:Nfft,:); spectra(1:len2,:)]; + freq = [ freq(len2+1:Nfft)-Fs; freq(1:len2)]; + if ( conf>0 ) + Vxx = [ Vxx(len2+1:Nfft,:); Vxx(1:len2,:)]; + end + end + % + % RETURN RESULTS or PLOT + if ( nargout>=2 && conf>0 ) + varargout{2} = Vxx; + end + if ( nargout>=(2+(conf>0)) ) + % frequency is 2nd or 3rd return value, + % depends on if 2nd is confidence interval + varargout{2+(conf>0)} = freq; + end + if ( nargout>=1 ) + varargout{1} = spectra; + else + % + % Plot the spectra if there are no return variables. + plot_title=['power spectrum x '; + 'cross spectrum '; + 'transfer function'; + 'coherence '; + 'power spectrum y ' ]; + for ii = 1: n_results + if ( conf>0 && spect_type(ii)==1 ) + Vxxxx = Vxx; + else + Vxxxx = []; + end + if ( n_results > 1 ) + figure(); + end + if ( plot_type == 1 ) + plot(freq,[abs(spectra(:,ii)) Vxxxx]); + elseif ( plot_type == 2 ) + semilogx(freq,[abs(spectra(:,ii)) Vxxxx]); + elseif ( plot_type == 3 ) + semilogy(freq,[abs(spectra(:,ii)) Vxxxx]); + elseif ( plot_type == 4 ) + loglog(freq,[abs(spectra(:,ii)) Vxxxx]); + elseif ( plot_type == 5 ) % db + ylabel( 'amplitude (dB)' ); + plot(freq,[10*log10(abs(spectra(:,ii))) 10*log10(abs(Vxxxx))]); + end + title( char(plot_title(spect_type(ii),:)) ); + ylabel( 'amplitude' ); + % Plot phase of cross spectrum and transfer function + if ( spect_type(ii)==2 || spect_type(ii)==3 ) + figure(); + if ( plot_type==2 || plot_type==4 ) + semilogx(freq,180/pi*angle(spectra(:,ii))); + else + plot(freq,180/pi*angle(spectra(:,ii))); + end + title( char(plot_title(spect_type(ii),:)) ); + ylabel( 'phase' ); + end + end %for + end +end +end + +%!demo +%! fflush(stdout); +%! rand('seed',2038014164); +%! a = [ 1.0 -1.6216505 1.1102795 -0.4621741 0.2075552 -0.018756746 ]; +%! white = rand(1,16384); +%! signal = detrend(filter(0.70181,a,white)); +%! % frequency shift by modulating with exp(j.omega.t) +%! skewed = signal.*exp(2*pi*i*2/25*[1:16384]); +%! Fs = 25; % sampling frequency +%! hold off +%! pwelch([]); +%! pwelch(signal); +%! disp('Default settings: Fs=1Hz, overlap=0.5, no padding' ) +%! input('Onesided power spectral density (real data). Press ENTER', 's' ); +%! hold on +%! pwelch(skewed); +%! disp('Frequency-shifted complex data. Twosided wrap-around spectrum.' ); +%! input('Area is same as one-sided spectrum. Press ENTER', 's' ); +%! pwelch(signal,'shift','semilogy'); +%! input('Twosided, centred zero-frequency, lin-log plot. Press ENTER', 's' ); +%! hold off +%! figure(); +%! pwelch(skewed,[],[],[],Fs,'shift','semilogy'); +%! input('Actual Fs=25 Hz. Note change of scales. Press ENTER', 's' ); +%! pwelch(skewed,[],[],[],Fs,0.95,'shift','semilogy'); +%! input('Spectral density with 95% confidence interval. Press ENTER', 's' ); +%! pwelch('R12+'); +%! pwelch(signal,'squared'); +%! input('Spectral density with Matlab R12 defaults. Press ENTER', 's' ); +%! figure(); +%! pwelch([]); +%! pwelch(signal,3640,[],4096,2*pi,[],'no-strip'); +%! input('Same spectrum with 95% confidence interval. Press ENTER', 's' ); +%! figure(); +%! pwelch(signal,[],[],[],2*pi,0.95,'no-strip'); +%! input('95% confidence interval with native defaults. Press ENTER', 's' ); +%! pwelch(signal,64,[],[],2*pi,'no-strip'); +%! input('Only 32 frequency values in this spectrum. Press ENTER', 's' ); +%! hold on +%! pwelch(signal,64,[],256,2*pi,'no-strip'); +%! input('4:1 zero padding gives artificial smoothing. Press ENTER', 's' ); +%! figure(); +%! pwelch('psd'); +%! pwelch(signal,'squared'); +%! input('Just like Matlab spectrum.welch(...) defaults. Press ENTER', 's' ); +%! hold off +%! pwelch({}); +%! pwelch(white,signal,'trans','coher','short') +%! input('Transfer and coherence functions. Press ENTER', 's' ); +%! disp('Use "close all" to remove plotting windows.' ); + diff --git a/code/eeglab13_4_4b/functions/octavefunc/test_gui.m b/code/eeglab13_4_4b/functions/octavefunc/test_gui.m new file mode 100644 index 0000000..70dfa01 --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/test_gui.m @@ -0,0 +1,10 @@ +% This simple scripts test Octave GUI capabilities +% (it crashes Octave under OS X) + +% The line is sometimes necessary +graphics_toolkit fltk + +figure; +tmp = uimenu('label', 'This is a custom menu', 'callback', 'disp(''Hello'');'); +tmp2 = uimenu(tmp, 'label', 'Menu showing "Hello"', 'callback', 'disp(''Hello'');'); +tmp2 = uimenu(tmp, 'label', 'Menu plotting a new figure', 'callback', 'figure; plot([1:10]);'); diff --git a/code/eeglab13_4_4b/functions/octavefunc/test_octaveparsing.m b/code/eeglab13_4_4b/functions/octavefunc/test_octaveparsing.m new file mode 100644 index 0000000..4c2c0f7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/octavefunc/test_octaveparsing.m @@ -0,0 +1,20 @@ +function test_octaveparsing; + +a = dir; + +for index = 1:length(a) + %fprintf('testing %s\n', a(index).name); + if exist(a(index).name) == 7 && ~strcmpi(a(index).name, '.') && ~strcmpi(a(index).name, '..') + cd(a(index).name); + test_octaveparsing; + cd('..'); + elseif length(a(index).name) > 2 && a(index).name(end) == 'm' + try + which(a(index).name(1:end-2)); + catch + tmp = lasterr; + inds = find(tmp == 10); + fprintf('*************\n%s\n*************\n', tmp(1:inds(1)-1)); + end; + end; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_addnewevents.m b/code/eeglab13_4_4b/functions/popfunc/eeg_addnewevents.m new file mode 100644 index 0000000..7c91294 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_addnewevents.m @@ -0,0 +1,237 @@ +% eeg_addnewevents() Add new events to EEG structure. Both EEG.event and +% EEG.urevent are updated. +% +% Usage: +% >> EEG = eeg_addnewevents(EEG, latencies, types, fieldNames, fieldValues); +% +% Inputs: +% EEG - input dataset +% latencies - cell containing numerical arrays for latencies of new +% events, each array corresponds to a different event type. +% type - cell array containing name of event types. +% +% Optional Inputs +% fieldNames - cell array containing names of fields to be added to event structure. +% fieldValues - A cell containing arrays for field values corresponding to fieldNames. +% Number of values for each field should be equal to the total number of +% latencies (new events) added to dataset. +% Outputs: +% EEG - EEG dataset with updated event and urevent fields +% +% Example: +% EEG = eeg_addnewevents(EEG, {[100 200] [300 400 500]}, {'type1' 'type2'}, {'field1' 'field2'}, {[1 2 3 4 5] [6 7 8 9]}); +% +% Author: Nima Bigdely Shamlo, SCCN/INC/UCSD, 2008 +function EEG = eeg_addnewevents(EEG, eventLatencyArrays, types, fieldNames, fieldValues); + + + +if ~isfield(EEG, 'event') + EEG.event = []; + EEG.urevent = []; + + EEG.event(1).type = 'dummy'; + EEG.event(1).latency = 1; + EEG.event(1).duration = 0; + EEG.event(1).urevent = 1; + + EEG.urevent(1).type = 'dummy'; + EEG.urevent(1).latency = 1; + EEG.urevent(1).duration = 0; +end; + +% add duration field if it does not exist +if length(EEG.event)>0 && ~isfield(EEG.event(1),'duration') + EEG.event(1).duration = 0; + EEG.urevent(1).duration = 0; +end; + +if nargin<4 + fieldNames = []; + fieldValues = []; +end; + +newEventLatency = []; +for i=1:length(eventLatencyArrays) + newEventLatency = [newEventLatency eventLatencyArrays{i}]; +end; + + +newEventType = []; + +for i=1:length(eventLatencyArrays{1}) + newEventType{i} = types{1}; +end; + + +for j=2:length(eventLatencyArrays) + startIndex = length(newEventType); + for i=1:length(eventLatencyArrays{j}) + newEventType{startIndex+i} = types{j}; + end; +end; + +% mix new and old events, sort them by latency and put them back in EEG +originalEventLatency = []; +originalEventType = []; +originalFieldNames = []; +for i=1:length(EEG.event) + originalEventLatency(i) = EEG.event(i).latency; + originalEventType{i} = EEG.event(i).type; + originalEventFields(i) = EEG.event(i); +end; + + +% make sure that originalEventFields has all the new field names +if ~isempty(EEG.event) + originalFieldNames = fields(originalEventFields); + for f= 1:length(fieldNames) + if ~isfield(originalEventFields, fieldNames{f}) + originalEventFields(length(originalEventFields)).(fieldNames{f}) = NaN; + end; + end; +end; + +% make sure that newEventFields has all the original field names +for i=1:length(originalFieldNames) + newEventFields(length(newEventLatency)).(originalFieldNames{i}) = NaN; +end; + +for i=1:length(newEventLatency) + newEventFields(i).latency = newEventLatency(i); + newEventFields(i).type = newEventType{i}; + newEventFields(i).duration = 0; + for f= 1:length(fieldNames) + newEventFields(i).(fieldNames{f}) = fieldValues{f}(i); + end; +end; + +if ~isempty(EEG.event) + %newEventFields = struct('latency', num2cell(newEventLatency), 'type', newEventType); + combinedFields = [originalEventFields newEventFields]; + combinedLatencies = [originalEventLatency newEventLatency]; + combinedType = [originalEventType newEventType]; +else + combinedFields = newEventFields; + combinedLatencies = newEventLatency; + combinedType = newEventType; +end + +[sortedEventLatency order] = sort(combinedLatencies,'ascend'); +sortedEventType = combinedType(order); +combinedFields = combinedFields(order); +% put events in eeg + +%EEG.urevent = []; +%EEG.event = []; +EEG = rmfield(EEG,'event'); + +for i=1:length(sortedEventLatency) + % EEG.urevent(i).latency = sortedEventLatency(i); + % EEG.urevent(i).type = sortedEventType{i}; + + % combinedFields(order(i)).urevent = i; + + EEG.event(i) = combinedFields(i); + % EEG.event(i).urevent = i; +end; + +%% adding new urevents + +originalUreventNumber = 1:length(EEG.urevent); +originalUreventLatency = zeros(1, length(EEG.urevent)); +originalUreventFields= cell(1, length(EEG.urevent)); + +for i=1:length(EEG.urevent) + originalUreventLatency(i) = EEG.urevent(i).latency; + originalUreventFields{i} = EEG.urevent(i); +end; + +newUreventLatency = []; +newUreventType = []; + +for i=1:length(EEG.event) + if ~isfield(EEG.event,'urevent') || length(EEG.event(i).urevent) == 0 || isnan(EEG.event(i).urevent) + % newUreventLatency = [newUreventLatency newEventUrEventLatency(EEG, combinedFields, i)]; + + % use eeg_urlatency to calculate the original latency based on + % EEG.event duartions + newUreventLatency = [newUreventLatency eeg_urlatency(EEG.event, EEG.event(i).latency)]; + else + newUreventLatency = [newUreventLatency EEG.urevent(EEG.event(i).urevent).latency]; + end; + + newUreventFields{i} = EEG.event(i); + + newUreventEventNumber(i) = i; +end; + +combinedEventNumber = newUreventEventNumber;%[NaN(1,length(EEG.urevent)) newUreventEventNumber]; +combinedUrEventLatencies = newUreventLatency;%[originalUreventLatency newUreventLatency]; +[sortedUrEventLatency order] = sort(combinedUrEventLatencies,'ascend'); + +% make urvent stucture ready +EEG.urevent = []; +EEG.urevent= newUreventFields{order(1)}; + +for i=1:length(order) + %if ~isnan(newUreventEventNumber(i)) + + EEG.urevent(i) = newUreventFields{order(i)}; + + EEG.urevent(i).latency = combinedUrEventLatencies(order(i)); + EEG.event(newUreventEventNumber(i)).urevent = i; + %end; +end; + +if isfield(EEG.urevent,'urevent') + EEG.urevent = rmfield(EEG.urevent,'urevent'); % remove urevent field +end; + +% turn empty event durations into 0 +for i=1:length(EEG.event) + if isempty(EEG.event(i).duration) + EEG.event(i).duration = 0; + end; +end; + +for i=1:length(EEG.urevent) + if isempty(EEG.urevent(i).duration) + EEG.urevent(i).duration = 0; + end; +end; + +% +% function latency = newEventUrEventLatency(EEG, combinedFields, i) +% +% %% looks for an event with urvent before the new event +% urlatencyBefore = []; +% currentEventNumber = i; +% +% while isempty(urlatencyBefore) && currentEventNumber > 1 +% currentEventNumber = currentEventNumber - 1; +% if ~(~isfield(combinedFields(currentEventNumber),'urevent') || isempty(combinedFields(currentEventNumber).urevent) || isnan(combinedFields(currentEventNumber).urevent)) +% urlatencyBefore = EEG.urevent(combinedFields(currentEventNumber).urevent).latency; +% end; +% end +% +% %% if no event with urevent is found before, look for an event with urvent after the new event +% if isempty(urlatencyBefore) +% urlatencyAfter = []; +% currentEventNumber = i; +% +% while isempty(urlatencyAfter) && currentEventNumber < length(combinedFields) +% currentEventNumber = currentEventNumber + 1; +% if ~(~isfield(combinedFields(currentEventNumber),'urevent') || isempty(combinedFields(currentEventNumber).urevent) || isnan(combinedFields(currentEventNumber).urevent)) +% urlatencyAfter = EEG.urevent(combinedFields(currentEventNumber).urevent).latency; +% end; +% end +% end; +% %% +% if ~isempty(urlatencyBefore) +% latency = urlatencyBefore + combinedFields(i).latency - combinedFields(currentEventNumber).latency; +% elseif ~isempty(urlatencyAfter) +% latency = urlatencyAfter + combinedFields(currentEventNumber).latency - combinedFields(i).latency; +% else +% latency = []; +% end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_amplitudearea.m b/code/eeglab13_4_4b/functions/popfunc/eeg_amplitudearea.m new file mode 100644 index 0000000..bc30a85 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_amplitudearea.m @@ -0,0 +1,247 @@ +% eeg_amplitudearea() - Resamples an ERP average using spline interpolation +% at a new sample rate (resrate) in Hz to get the exact limits +% of the window of integration. Finely samples the window +% and adds together very narrow rectangles capped by +% right-angled triangles under the window. Output is in uV. +% Trade-off between speed and number of resamples and number of +% channels selected occurs. +% Usage: +% >> [channels, amplitude] = eeg_amplitudearea(EEG,channels, resrate, wstart, wend); +% Inputs: +% EEG - EEGLAB data struct containing a (3-D) epoched data matrix +% channels - vector of channel indices +% resrate - resampling rate for window of integration in Hz +% wstart - start of window of integration in ms post stimulus-onset +% wend - end of window of integration in ms post stimulus-onset +% +% Outputs: +% channels - a vector of channel indices. +% amplitude - 1-dimensional array in uV for the channels +% +% Example +% >> [channels, amplitude] = eeg_amplitudearea(EEG,[12 18 25 29], 2000, 90.52, 120.52); +% +% Author: Tom Campbell, Helsinki Collegium for Advanced Studies, Biomag Laboratory, +% Engineering Centre, Helsinki University Central Hospital Helsinki Brain +% Research Centre (tom.campbell@helsinki.fi) Spartam nanctus es: Hanc exorna. +% Combined with amplitudearea_msuV() by Darren Weber, UCSF 28/1/05 +% Retested and debugged Tom Campbell 2/2/05 +% Reconceived, factored somewhat, tested and debugged Tom Campbell 13:24 23.3.2005 + +function [channels,overall_amplitude] = eeg_amplitudearea2(EEG, channels, resrate, wstart, wend) + +if wstart > wend + error ('ERROR: wstart must be greater than wend') +else + [channels, overall_amplitude] = eeg_amplitudearea_msuV (EEG,channels, resrate, wstart, wend) + overall_amplitude = overall_amplitude/(wend - wstart) +end + +return + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [channels, overall_area] = eeg_amplitudearea_msuV (EEG, channels, resrate, wstart, wend) + +%if ndim(EEG.data) ~= 3 +% error('EEG.data must be 3-D data epochs'); +%end +erp = mean(EEG.data,3); + +[tmp ind1] =min( abs( EEG.times - wstart ) ); % closest time index to wstart +[tmp ind2] =min( abs( EEG.times - wend ) ); % closest time index to wend +restep = 1/resrate + + +if EEG.times(ind1) > wstart + ind1= ind1 -1; +end + +if EEG.times(ind2) < wend + ind2= ind2 +1; +end + +for x= ind1:ind2 + t = (x -ind1)+1; + tim(t) = EEG.times(x); +end + +tr = 1 +timr(tr) = wstart; +while timr(tr) < wend + tr = tr + 1; + timr(tr) = timr(tr-1)+ restep; +end + + +for x = 1:size(channels,2) + channel = channels(x) + %resamples + rerp(x, 1:tr) = spline(tim(:),erp(channel, ind1:ind2), timr(1:tr)) + pent = timr(tr - 1) + overall_area(x) = 0 + for y = 1:(tr -1) + v1 = rerp(x,(y)) + v2 = rerp(x,(y+1)) + if ((v1 > 0) & (v2 < 0)) | ((v1 < 0) & (v2 > 0)) + if (y == (tr-1)) & (timr(y+1)> wend) + area1 = zero_crossing_truncated(v1, v2, restep, wend, pent) + else + area1 = zero_crossing(v1, v2, restep) + end + else + if( y == (tr-1)) & (timr(y+1)> wend) + area1 = rect_tri_truncated(v1, v2, restep,wend,pent) + else + area1 = rect_tri(v1, v2, restep) + end + end + overall_area(x) = overall_area(x) + area1 + end +end + +return + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [area] = zero_crossing(v1,v2,step) + if (v1 > v2) + T1 = v1 + T2 = v2 + else + T1 = v2 + T2 = v1 + end + tantheta = (abs(T1)+ abs(T2))/step + if (v1 > v2) + %decline + z = abs(T1)/tantheta + tr1= abs(T1)*(z/2) + tr2= abs(T2)*((step-z)/2) + else + %incline + z = abs(T2)/tantheta + tr2= abs(T2)*(z/2) + tr1= abs(T1)*((step-z)/2) + end + [area] = (tr1 - tr2) +return +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [area] = zero_crossing_truncated(v1,v2,step,wend,pent) + if (v1 > v2) + T1 = v1 + T2 = v2 + else + T1 = v2 + T2 = v1 + end + tantheta = (abs(T1)+ abs(T2))/step + s = wend - pent + if (v1 > v2) + z = abs(T1)/tantheta + if s < z + %decline,truncated before zerocrossing + t1 = tantheta * s + r1 = abs(T1)-abs(t1) + tr1= abs(t1)*(s/2) + tr2= 0 + rect1 = r1*s + rect2 = 0 + else + %decline,truncated after zerocrossing + t2= tantheta*(s-z) + tr1= abs(T1)*(z/2) + tr2 = abs(t2)*((s-z)/2) + rect1 = 0 + rect2 = 0 + end + else + z = abs(T2)/tantheta + if s < z + %incline,truncated before zerocrossing + t2 = tantheta * s + r2 = abs(T2)-abs(t2) + tr1= 0 + tr2= abs(t2)*(s/2) + rect1 = 0 + rect2 = r2*s + else + %incline,truncated after zerocrossing + t1= tantheta*(s-z) + tr1 = abs(t1)*((s-z)/2) + tr2 = abs(T2) * (z/2) + rect1 = 0 + rect2 = 0 + end + end + +[area] = ((rect1 + tr1) - (rect2 + tr2)) +return + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [area] = rect_tri(v1,v2,step) + if (abs(v1) > abs(v2)) + T = abs(v1)-abs(v2) + R = abs(v2) + else + T = abs(v2)-abs(v1) + R = abs(v1) + end + rect = R*step + tri = T*(step/2) + if v1 > 0 + area = 1* (rect+tri) + else + area = -1 * (rect+tri) + end +return + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [area] = rect_tri_truncated(v1,v2,step,wend,pent) + if (abs(v1) > abs(v2)) + T = abs(v1)-abs(v2) + R = abs(v2) + else + T = abs(v2)-abs(v1) + R = abs(v1) + end + + tantheta = abs(T)/step + s = wend -pent + + if (v1>0) + if v1 >v2 + %positive decline + t = tantheta*s + e = abs(T)-abs(t) + rect = s*R + exrect = s*e + tri = (s/2)*R + else + %positive incline + t = tantheta*s + rect = s*R + exrect = 0 + tri = (s/2)*R + end + else + if v1 >v2 + %negative decline + t = tantheta*s + rect = s*R + exrect = 0 + tri = (s/2)*R + else + %negative incline + t = tantheta*s + e = abs(T)-abs(t) + rect = s*R + exrect = s*e + tri = (s/2)*R + end + end + tri = T*(step/2) + if v1 > 0 + area = 1* (rect+exrect+tri) + else + area = -1 * (rect+exrect+tri) + end +return diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_chaninds.m b/code/eeglab13_4_4b/functions/popfunc/eeg_chaninds.m new file mode 100644 index 0000000..5a4d0a5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_chaninds.m @@ -0,0 +1,70 @@ +% std_chaninds() - look up channel indices in a EEG structure +% +% Usage: +% >> inds = std_chaninds(EEG, channames); +% Inputs: +% EEG - EEG structure containing a chanlocs substructure. +% the chanlocs structure may also be used as input. +% channames - [cell] channel names. May also be a string containing +% one or several channel names. +% +% Outputs: +% inds - [integer array] channel indices +% +% Author: Arnaud Delorme, CERCO, 2009- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function finalinds = eeg_chaninds(EEG, channames, errorifnotfound); + + if nargin < 2 + help eeg_chaninds; + return; + end; + if nargin < 3 + errorifnotfound = 1; + end; + + if isfield(EEG, 'chanlocs') + chanlocs = EEG.chanlocs; + else chanlocs = EEG; + end; + + % decode string if necessary + % -------------------------- + if isstr(channames) + channames = parsetxt( channames ); + end; + + finalinds = []; + if isempty(chanlocs) + tmpallchans = []; + else tmpallchans = lower({ chanlocs.labels }); + end; + if isempty(channames), finalinds = [1:length(chanlocs)]; return; end; + for c = 1:length(channames) + chanind = strmatch( lower(channames{c}), tmpallchans, 'exact'); + if isempty(chanind), + chanind = str2double(channames{c}); + if isnan(chanind), chanind = []; end; + if errorifnotfound && isempty(chanind) + error(sprintf('Channel %s not found', channames{c})); + end; + end; + finalinds = [ finalinds chanind ]; + end; + finalinds = sort(finalinds); diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_chantype.m b/code/eeglab13_4_4b/functions/popfunc/eeg_chantype.m new file mode 100644 index 0000000..a92a652 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_chantype.m @@ -0,0 +1,68 @@ +% eeg_chantype() - Returns the channel indices of the desired channel type(s). +% +% Usage: +% >> indices = eeg_chantype(struct, types ) +% +% Inputs: +% struct - EEG.chanlocs data structure returned by readlocs() containing +% channel location, type and gain information. +% +% Optional input +% types - [cell array] cell array containing types ... +% +% Output: +% indices - +% +% Author: Toby Fernsler, Arnaud Delorme, Scott Makeig +% +% See also: topoplot() + +% Copyright (C) 2005 Toby Fernsler, SCCN, INC, UCSD, toby@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function indices = eeg_chantype(data,chantype) + + if nargin < 1 + help eeg_chantype; + end; + + if ischar(chantype), chantype = cellstr(chantype); end + if ~iscell(chantype), + error( 'chantype must be cell array, e.g. {''EEG'', ''EOG''}, or single character string, e.g.''EEG''.'); + end + + % Define 'datatype' variable, listing the type of each channel. + % ------------------------------------------------------------ + if isfield(data,'type') + datatype = {data.type}; + elseif isfield(data,'chanlocs') & isfield(data.chanlocs,'type') + datatype = {data.chanlocs.type}; + else error('Incorrect ''data'' input. Should be ''EEG'' or ''loc_file'' structure variable in the format associated with EEGLAB.'); + end + + % seach for types + % --------------- + k = 1; + plotchans = []; + for i = 1:length(chantype) + for j = 1:length(datatype) + if strcmpi(chantype{i},char(datatype{j})) + plotchans(k) = j; + k = k + 1; + end; + end + end + indices = sort(plotchans); diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_context.m b/code/eeglab13_4_4b/functions/popfunc/eeg_context.m new file mode 100644 index 0000000..d41761b --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_context.m @@ -0,0 +1,651 @@ +% eeg_context() - returns (in output 'delays') a matrix giving, for each event of specified +% ("target") type(s), the latency (in ms) to the Nth preceding and/or following +% urevents (if any) of specified ("neighbor") type(s). Return the target event +% and urevent numbers, the neighbor urevent numbers, and the values of specified +% urevent field(s) for each of the neighbor urevents. Uses the EEG.urevent +% structure, plus EEG.event().urevent pointers to it. If epoched data, also +% uses the EEG.epoch structure. For use in event-handling scripts and functions. +% Usage: +% >> [targs,urnbrs,urnbrtypes,delays,tfields,urnfields] = ... +% eeg_context(EEG,{targets},{neighbors},[positions],{fields},alltargs); +% Required input: +% EEG - EEGLAB dataset structure containing EEG.event and EEG.urevent sub-structures +% +% Optional inputs: +% targets - string or cell array of strings naming event type(s) of the specified target +% events {default | []: all events} +% neighbors - string or cell array of strings naming event type(s) of the specified +% neighboring urevents {default | []: any neighboring events}. +% [positions] - int vector giving the relative positions of 'neighbor' type urevents to return. +% Ex: [-3 -2 -1 0 1 2 3] -> return the previous 3, current, and succeeding 3 +% urevents of the specified {neighbor} types. [positions] values are arranged +% in ascending order before processing. {default | []: 1 = first succeeding} +% fields - string or cell array of strings naming one or more (ur)event field(s) to return +% values for neighbor urevents. {default: no field info returned} +% alltargs - string ('all'|[]) if 'all', return information about all target urevents, +% even those on which no epoch in the current dataset is centered. +% {default: [] -> only return information on epoch-centered target events} +% Outputs: +% targs - size(ntargets,4) matrix giving the indices of target events in the event +% structure in column 1 and in the urevent structure in column 2. Column 3 gives +% the epoch number in which the target has latency 0 (else NaN if no such epoch). +% The fourth column gives the index of the target type in the {targets} cell array. +% urnbrs - matrix of indices of "neighbor" events in the URevent structure (NaN if none). +% urnbrtypes - int array giving the urnbrs event type indices in the {neighbor} cell array, +% else NaN if no such neighbor. Ex: If nbr = {'square','rt'} (see below), +% then urnbrtypes outputs are [1|2]; if nbr = {'rt'}, returns [1]s. +% delays - matrix giving, for each {targets} type event, the latency of the delay (in ms) +% from each target event to its neighbor urevents. Else, returns NaN when no +% neighbor event. Output matrix size: (ntargets,length(positions)). +% tfields - real or cell array of values of the requested (ur)event field(s) for the target +% events. Values are the same type as the field values, else NaN if no such event. +% urnfields - real or cell array of values of the requested (ur)event field(s) for the neighbor +% urevents. Values are the same type as the field values, else NaN if no such event. +% If > 1 field specified, a 3-D array or cell array (nevents,nnbrpos,nfields). +% Example: +% +% >> target = 'square'; % target events are type 'square' +% >> nbr = {'square','rt'}; % neighbor events are either 'square' or 'rt' +% +% >> [trgs,urnbrs,urnbrtypes,delays,tflds,urnflds] = ... +% eeg_context(EEG,target,nbr,[-4 1],'position'); +% % +% % Output 'delays' now contains latencies (in ms) from each 'square' target event to the +% % 4th preceding and 1st succeeding 'rt' OR 'square' urevent (else NaN when none such). +% % Outputs 'tfields' and 'urnflds' give the 'position' field values of target events and +% % neighbor urevents. Output 'urnbrtypes', the index of the type (1='square' or 2='rt') +% % of the ('urnbrs') neighbor urevents. +% % +% >> trts = find(trgs(:,4)==2); % targets followed by an 'rt' (before any 'square') +% >> pos3 = find(trgfld = 3); % targets with 'position'=3 (numeric field value). +% >> selevents = intersect_bc(trts,pos3); % target events by both criteria +% >> selepochs = trgs(selevents,3); % epoch numbers centered on the selected target events +% +% Author: Scott Makeig, SCCN, Institute for Neural Computation, UCSD, March 27, 2004 + +% Edit History: +% 1/10/05 added 4th (type) field to output trgs; added to Example; +% 5/25/04 test for isnan(urevent.duration) to detect real break events -sm +% 3/27/04 made no-such-event return NaNs; added {target} and {neighbor} defaults -sm +% 3/28/04 added test for boundary urevents; renamed relidx as positions, lats as delays -sm +% 3/29/04 reorganized output order, adding urnbrtypes -sm +% 3/29/04 changed urnbrtypes to int array -sm +% 3/31/04 ruled out searching 'boundary' events -sm +% 5/06/04 completed the function -sm +% +function [targs,ur_nbrs,ur_nbrtypes,delays,tfields,nfields] = eeg_context(EEG,targets,neighbors,positions,field,alltargs) + +verbose = 0; % flag useful info printout (1=on|0=off) +debug_print = 0; % flag overly verbose printout +breakwarning = 0; % flag no pre-4.4 warning given + +if nargin < 1 + help eeg_context + return +end + +if nargin< 6 | isempty(alltargs) + alltargs = 0; +elseif strcmpi(alltargs,'all') + alltargs = 1; +else + error('alltargs argument must be ''all'' or [].') +end + +if ~isstruct(EEG) + error('first argument must be an EEG dataset structure'); +end +if ~isfield(EEG,'event') + error('No EEG.event structure found'); +end +if ~isfield(EEG,'urevent') + error('No EEG.urevent structure found'); +end +if ~isfield(EEG.event,'urevent') + error('No EEG.event().urevent field found'); +end + +if EEG.trials == 1 | ~isfield(EEG.event(1),'epoch') + fprintf('Data are continuous: Returning info on all targets; no epoch info returned.\n') + alltargs = 1; + epochinfo = 0; +else + epochinfo = 1; +end +if epochinfo & ~isfield(EEG,'epoch') + error('No EEG.epoch information in this epoched dataset - run eeg_checkset()'); +end +if epochinfo & ~isfield(EEG.epoch,'eventlatency') + error('No EEG.epoch.eventlatency information in this epoched dataset'); +end +if epochinfo & ~isfield(EEG.epoch,'event') + error('No EEG.epoch.event information in this epoched dataset'); +end + +nevents = length(EEG.event); +nurevents = length(EEG.urevent); +if length(EEG.urevent) < nevents + fprintf('In this dataset there are more events than urevents. Check consistency.\n'); +end +% +%%%%%%%%%%%%%%%%%% Substitute input defaults %%%%%%%%%%%%%%%%%%%% +% +if nargin < 5 | isempty(field) + NO_FIELD = 1; % flag no field variable output +end +if nargin < 4 | isempty(positions) + positions = 1; % default: find next +end +if nargin < 3 | isempty(neighbors) + neighbors = {'_ALL'}; % flag neighbors are all neighboring events +end +if nargin < 2 | isempty(targets) + targets = {'_ALL'}; % flag targets are all events +end + +% +%%%%%%%%%%%%% Test and adjust input arguments %%%%%%%%%%%%%%%%%%%% +% +if ischar(targets) + targets = {targets}; +end +if ~iscell(targets) + error('2nd argument "targets" must be a {cell array} of event types.'); +end +if ischar(neighbors) + neighbors = {neighbors}; +end +if ~iscell(neighbors) + error('3rd argument "neighbors" must be a {cell array} of event types.'); +end + +for k=1:length(targets) % make all target types strings + if ~ischar(targets{k}) + targets{k} = num2str(targets{k}); + end +end +for k=1:length(neighbors) % make all neighbor types strings + if ~ischar(neighbors{k}) + neighbors{k} = num2str(neighbors{k}); + end +end + +tmp = sort(positions); % reorder positions in ascending order +if sum(tmp==positions) ~= length(positions) + fprintf('eeg_context(): returning neighbors in ascending order: '); + for k=1:length(tmp) + fprintf('%d ',tmp(k)); + end + fprintf('\n'); +end +positions = tmp; + +% +%%%%%%%%%%%%%% Prepare to find "neighbor" events %%%%%%%%%%%%%%%%%% +% +zeroidx = find(positions == 0); % find 0's in positions vector +negidx = find(positions < 0); +negpos = positions(negidx); +if ~isempty(negpos) + negpos = abs(negpos(end:-1:1)); % work backwards, make negpos positive + negidx = negidx(end:-1:1); % index into output ur_nbrs +end +nnegpos = length(negpos); % number of negative positions to search for + +posidx = find(positions>0); % work forwards +pospos = positions(posidx); +npospos = length(pospos); % number of positive positions to search for + +% +%%%%%%%%%%%%%%%%%%%% Initialize output arrays %%%%%%%%%%%%%%%%%%%%%% +% +npos = length(positions); +delays = NaN*zeros(nevents,npos); % holds inter-event intervals in ms + % else NaN when no neighboring event +targs = NaN*zeros(nevents,1); % holds indices of targets +targepochs= NaN*zeros(nevents,1); % holds numbers of the epoch centered + % on each target (or NaN if none such) +ur_trgs = NaN*zeros(nevents,1); % holds indices of targets +ur_nbrs = NaN*zeros(nevents,npos); % holds indices of neighbors +ur_nbrtypes = NaN*zeros(nevents,npos); % holds {neighbors} type indices + +cellfld = -1; % flag no field output specified + +if ~exist('NO_FIELD','var') % if field values asked for + if ischar(field) + if ~isfield(EEG.urevent,field) + error('Specified field not found in urevent struct'); + end + if ischar(EEG.urevent(1).(field)) ... + | iscell(EEG.urevent(1).(field)) ... + | isstruct(EEG.urevent(1).(field)), + tfields = cell(nevents,1); + nfields = cell(nevents,npos); + cellfld = 1; % flag that field outputs are cell arrays + else % is number + tfields = NaN*zeros(nevents,1); + nfields = NaN*zeros(nevents,npos); + cellfld = 0; % flag that field outputs are numeric arrays + end + field = {field}; % make string field a cell array for uniformity + nfieldnames = 1; + elseif iscell(field) + nfieldnames = length(field); + for f = 1:nfieldnames + if ~isfield(EEG.urevent,field{f}) + error('Specified field not found in urevent struct'); + end + if ischar(EEG.urevent(1).(field{f})) ... + | iscell(EEG.urevent(1).(field{f})) ... + | isstruct(EEG.urevent(1).(field{f})), + if f==1, + tfields = cell(nevents,nfieldnames); + nfields = cell(nevents,npos,nfieldnames); + end + cellfld = 1; % flag that field outputs are cell arrays + else % is number + if f==1 + tfields = NaN*zeros(nevents,nfieldnames); + nfields = NaN*zeros(nevents,npos,nfieldnames); + end + end + end + if cellfld == -1, + cellfld = 0; % field value(s) must be numeric + end + else + error('''field'' value must be string or cell array'); + end +end + +targetcount = 0; % index of current target + +% Below: +% evidx = current event index +% uridx = current urevent index +% uidx = neighbor urevent index +% tidx = target type index +% nidx = neighbor type index +% pidx = position index +% +%%%%%%%%%%%for each event in the dataset %%%%%%%%%%%%%%%%%%%% +% +wb=waitbar(0,'Computing event contexts...','createcancelbtn','delete(gcf)'); +noepochs = 0; % counter of targets that are not epoch-centered +targidx = zeros(nevents,1); + +for evidx = 1:nevents %%%%%% for each event in the dataset %%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +waitbar(evidx/nevents); % update the waitbar fraction +if ~strcmp(EEG.event(evidx).type,'boundary') % ignore boundary events (no urevents!) + % + %%%%%%%%%%%%%%%%%%%%%%%% find target events %%%%%%%%%%%%%%%%% + % + uridx = EEG.event(evidx).urevent; % find its urevent index + if isempty(uridx) + fprintf('eeg_context(): Data event %d does not point to an urevent.\n',evidx); + delete(wb); + return + end + istarget = 0; % initialize target flag + tidx = 1; % initialize target type index + % + %%%%%%%%%%%%%%% cycle through target types %%%%%%%%%%%%%%%%%% + % + while ~istarget & tidx<=length(targets) % for each potential target type + uridxtype = EEG.urevent(uridx).type; + if ~ischar(uridxtype), uridxtype = num2str(uridxtype); end + if strcmpi(uridxtype,targets(tidx)) | strcmp(targets{1},'_ALL') + % if is a target type + istarget=1; % flag event as target + targetcount = targetcount+1; % increment target count + % + %%%%%%%%%%%%% find 0th neighbors (=targets themselves) + % + if ~isempty(zeroidx) % if the target event is asked for in the nbrs array + delays(targetcount,zeroidx) = 0; + if ~exist('NO_FIELD','var') + for f=1:nfieldnames + if cellfld == 0 + nfields(targetcount,zeroidx,f) = EEG.urevent(uridx).(field{f}); + else % cellfld == 1 + nfields{targetcount,zeroidx,f} = EEG.urevent(uridx).(field{f}); + end + end + end + end + if epochinfo % if the data are epoched + is0epoch = 0; + for z = 1:length(EEG.event(evidx).epoch) % for each epoch the event is in + ep = EEG.event(evidx).epoch(z); + for e = 1:length(EEG.epoch(ep).event) % for each event in the epoch + if EEG.epoch(ep).event(e) == evidx % if current event + % js : added the if ~iscell loop + if ~iscell(EEG.epoch(ep).eventlatency) % i.e. not more than 1 eventtype in the epoch + if length(EEG.epoch(ep).eventlatency(e)) == 1 + trglt = EEG.epoch(ep).eventlatency(e); % get its epoch latency + else + trglt = EEG.epoch(ep).eventlatency(1); % this shouldn't happen + fprintf('EEG.epoch(%d).eventlatency(%d) length > 1 ??\n',ep,e); + end + else + if length(EEG.epoch(ep).eventlatency{e}) == 1 + trglt = EEG.epoch(ep).eventlatency{e}; % get its epoch latency + else + trglt = EEG.epoch(ep).eventlatency{e}(1); % this shouldn't happen + fprintf('EEG.epoch(%d).eventlatency{%d} length > 1 ??\n',ep,e); + end; + end + if trglt == 0 + targepochs(targetcount) = ep; + is0epoch = 1; + break; + end + end + end + if is0epoch + break; + end + end % for + if ~is0epoch, noepochs = noepochs+1; end + end + + targs(targetcount) = evidx; % save event index + ur_trgs(targetcount) = uridx; % save urevent index + if ~exist('NO_FIELD','var') + for f=1:nfieldnames + if cellfld ==0 + tfields(targetcount,f) = EEG.urevent(uridx).(field{f}); + elseif cellfld == 1 + tfields{targetcount,f} = EEG.urevent(uridx).(field{f}); + end + end + break % stop target type checking + end + else % next target type + tidx = tidx+1; % else try next target type + end % if is target + end % while ~istarget + + if istarget % if current event is a target type + targidx(targetcount) = tidx; % save index of its type within targets + if ~isempty(negpos) + % + %%%%%%%%%%%%%%%%%% find previous neighbor urevents %%%%%%%%%%%% + % + uidx = uridx-1; % begin with the previous urevent + npidx = 1; % index into negpos + curpos = 1; % current (negative) position + seekpos = negpos(npidx); % begin with first negpos position + while uidx > 0 & npidx <= nnegpos % search through previous urevents + uidxtype = EEG.urevent(uidx).type; + if ~ischar(uidxtype), uidxtype = num2str(uidxtype); end + if strcmpi(uidxtype,'boundary') % flag boundary urevents + if ~isfield(EEG.urevent,'duration') ... + | ( isnan(EEG.urevent(uidx).duration) ... + | isempty(EEG.urevent(uidx).duration)) % pre-v4.4 or real break urevent + % (NaN duration) + if ~isfield(EEG.urevent,'duration') ... % pre version-4.4 dataset + & breakwarning == 0 + fprintf('Pre-v4.4 boundary urevent found - duration field not defined.'); + breakwarning = 1; + end + end + break % don't search for neighbors across a boundary urevent + end + isneighbor = 0; % initialize neighbor flag + nidx = 1; % initialize neighbor type index + % + %%%%%%%%%% cycle through neighbor types %%%%%%%%%%%%% + % + while ~isneighbor & nidx<=length(neighbors) % for each neighbor event type + if strcmpi(uidxtype,neighbors(nidx)) | strcmp(neighbors,'_ALL') + isneighbor=1; % flag 'neighbors' event + curpos = curpos+1; + % + %%%%%%%%%%%%%%% if an event in one of the specified positions %%%%% + % + if curpos-1 == seekpos + delays(targetcount,negidx(npidx)) = 1000/EEG.srate * ... + (EEG.urevent(uidx).latency - EEG.urevent(uridx).latency); + % return negative latencies for negpos events + ur_nbrs(targetcount,negidx(npidx))=uidx; % mark urevent as neighbor + ur_nbrtypes(targetcount,negidx(npidx)) = nidx; + if ~exist('NO_FIELD','var') + for f=1:nfieldnames + if cellfld ==0 + if nfieldnames > 1 + if ~isempty(EEG.urevent(uidx).(field{f})) + nfields(targetcount,negidx(npidx),f) = EEG.urevent(uidx).(field{f}); + else + nfields(targetcount,negidx(npidx),f) = NaN; + end + elseif ~isempty(EEG.urevent(uidx).(field{f})) + nfields(targetcount,negidx(npidx)) = EEG.urevent(uidx).(field{f}); + else + nfields(targetcount,negidx(npidx)) = NaN; + end + elseif cellfld == 1 + if nfieldnames > 1 + nfields{targetcount,negidx(npidx),f} = EEG.urevent(uidx).(field{f}); + else + nfields{targetcount,negidx(npidx)} = EEG.urevent(uidx).(field{f}); + end + end + end + end + npidx = npidx+1; % look for next negpos position + if npidx<=nnegpos + seekpos = negpos(npidx); % new seek position + end + end % if seekpos + break % stop neighbors type checking + else + nidx = nidx+1; % try next 'neighbors' event type + end + end % nidx - neighbor-type testing loop + % + %%%%%%%%%%%%%%% find preceding neighbor event %%%%%%%%%%%%%% + % + uidx = uidx-1; % keep checking for a 'neighbors' type event + end % while uidx - urevent type checking + end % if negpos + + if ~isempty(pospos) + % + %%%%%%%%%%%%%%% find succeeding position urevents %%%%%%%%%%%% + % + uidx = uridx+1; % begin with the succeeding urevent + ppidx = 1; % index into pospos + curpos = 1; % current (positive) position + seekpos = pospos(ppidx); % begin with first pospos position + while uidx <= nurevents & ppidx <= npospos % search through succeeding urevents + isneighbor = 0; % initialize neighbor flag + uidxtype = EEG.urevent(uidx).type; + if ~ischar(uidxtype), uidxtype = num2str(uidxtype); end + if strcmpi(uidxtype,'boundary') % flag boundary events + if ~isfield(EEG.urevent,'duration') ... + | ( isnan(EEG.urevent(uidx).duration) ... + | isempty(EEG.urevent(uidx).duration)) % pre-v4.4 or real break urevent + % (NaN duration) + if ~isfield(EEG.urevent,'duration') ... % pre version-4.4 dataset + & breakwarning == 0 + fprintf('Pre-v4.4 boundary urevent found - duration field not defined.'); + breakwarning = 1; + end + end + break % don't search for neighbors across a boundary urevent + end + pidx = 1; % initialize neighbor type index + % + %%%%%%%%%% cycle through neighbor types %%%%%%%%%%%%% + % + while ~isneighbor & pidx<=length(neighbors) % for each neighbor event type + if strcmpi(uidxtype,neighbors(pidx)) ... + | strcmp(neighbors,'_ALL') + isneighbor=1; % flag 'neighbors' event + curpos = curpos+1; + % + %%%% if an event in one of the specified positions %%%%% + % + if curpos-1 == seekpos + ur_nbrs(targetcount,posidx(ppidx))=uidx; % mark urevent as neighbor + % ur_nbrtypes{targetcount,posidx(ppidx)} = EEG.urevent(uidx).type; % note its type + ur_nbrtypes(targetcount,posidx(ppidx)) = pidx; % note its type + delays(targetcount,posidx(ppidx)) = 1000/EEG.srate * ... + (EEG.urevent(uidx).latency - EEG.urevent(uridx).latency); + % return positive latencies for pospos events + if ~exist('NO_FIELD','var') + for f=1:nfieldnames + if cellfld ==0 + if nfieldnames > 1 + if ~isempty(EEG.urevent(uidx).(field{f})) + nfields(targetcount,posidx(ppidx),f) = EEG.urevent(uidx).(field{f}); + else + nfields(targetcount,posidx(ppidx),f) = NaN; + end + elseif ~isempty(EEG.urevent(uidx).(field{f})) + nfields(targetcount,posidx(ppidx)) = EEG.urevent(uidx).(field{f}); + else + nfields(targetcount,posidx(ppidx)) = NaN; + end + else % if cellfld == 1 + if nfieldnames > 1 + nfields{targetcount,posidx(ppidx),f} = EEG.urevent(uidx).(field{f}); + else + nfields{targetcount,posidx(ppidx)} = EEG.urevent(uidx).(field{f}); + end + end + end + end + ppidx = ppidx+1; + if ppidx<=npospos + seekpos = pospos(ppidx); % new seek position + end + break % stop neighbors type checking + end % if seekpos + break + else + % + %%%%%%%%%%%% find succeeding neighbor event %%%%%%%%%%%% + % + pidx = pidx+1; % try next 'neighbors' event-type + end + end % pidx - neighbor-type testing loop + uidx = uidx+1; % keep checking for 'neighbors' type urevents + end % uidx - urevent type checking + end % if pospos + % + %%%%%%%%%%%%%%% debug mode info printout %%%%%%%%%%%%%%%%%%%%%% + % + if debug_print + fprintf('%d. ',targetcount) + if targetcount<1000, fprintf(' '); end + if targetcount<100, fprintf(' '); end + if targetcount<10, fprintf(' '); end; + if uidx > 1 + %fprintf('event %-4d ttype %s - delays: ',evidx,num2str(EEG.urevent(evidx).type)); + for k=1:npos + fprintf('(%d) ',ur_nbrs(targetcount,k)); + if ur_nbrs(targetcount,k)<1000, fprintf(' '); end + if ur_nbrs(targetcount,k)<100, fprintf(' '); end + if ur_nbrs(targetcount,k)<10, fprintf(' '); end; + fprintf('%2.0f ',delays(targetcount,k)); + end + if ~exist('NO_FIELD','var') + if cellfld == 0 % numeric field values + fprintf('fields: ') + for f=1:nfieldnames + fprintf('%-5g - ',tfields(targetcount,f)) + for k=1:npos + fprintf('%-5g ',nfields(targetcount,k,f)); + end + end + elseif cellfld == 1 % cell array field values + fprintf('fields: ') + for f=1:nfieldnames + if ischar(EEG.urevent(1).(field{f})) + fprintf('%-5g -',tfields{targetcount,f}) + for k=1:npos + fprintf('%-5g ',nfields{targetcount,k,f}); + end % k + end % ischar + end % f + end % cellfield + end % ~NO_FIELD + end % uidx > 1 + fprintf('\n'); + end % debug_print + end % istarget + % + %%%%%%%%%%%%%%%%% find next target event %%%%%%%%%%%%%%%%%%%%%% + % + end % if not 'boundary' event + evidx = evidx+1; % continue event checking +end % event loop + +% +%%%%%%%%% delete watibar %%%%%%%% +% +if ishandle(wb), delete(wb); end; + +if ~alltargs + fprintf('Returning info on the %d of %d target events that have epochs centered on them.\n',... + targetcount-noepochs,targetcount); +else + fprintf('Returning info on all %d target events (%d have epochs centered on them).\n',... + targetcount,targetcount-noepochs); +end + +if debug_print + fprintf('---------------------------------------------------\n'); + fprintf('ur# event # ttype targtype - delays (urnbr) ms\n'); +end +% +%%%%%%%%%%%%%% Truncate the output arrays %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if targetcount > 0 + targs = [targs(1:targetcount) ur_trgs(1:targetcount) ... + targepochs(1:targetcount) targidx(1:targetcount)]; % 4-column output + ur_nbrs = ur_nbrs(1:targetcount,:); + delays = delays(1:targetcount,:); + + epcenttargs = find(~isnan(targs(:,3))); % find targets that have an epoch centered on them + if ~alltargs + targs = targs(epcenttargs,:); + ur_nbrs = ur_nbrs(epcenttargs,:); + delays = delays(epcenttargs,:); + end + + if ~exist('NO_FIELD','var') + if cellfld == 0 + tfields = tfields(1:targetcount,:); + nfields = nfields(1:targetcount,:,:); + elseif cellfld == 1 + tfields = tfields(1:targetcount,:); + nfields = nfields(1:targetcount,:,:); + end + if ~alltargs + tfields = tfields(epcenttargs,:); + nfields = nfields(epcenttargs,:,:); + end + else % NO_FIELD + tfields = []; + nfields = []; + end + ur_nbrtypes = ur_nbrtypes(1:targetcount,:); + if ~alltargs + ur_nbrtypes = ur_nbrtypes(epcenttargs,:); + end +else % return nulls if no targets found + if verbose + fprintf('eeg_context(): No target type events found.\n') + end + delays = []; + targs = []; + ur_nbrs = []; + tfields = []; + nfields = []; +end + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_countepochs.m b/code/eeglab13_4_4b/functions/popfunc/eeg_countepochs.m new file mode 100644 index 0000000..25a881c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_countepochs.m @@ -0,0 +1,122 @@ +% eeg_countepochs() Count how many epochs there are of each type +% +% Usage: +% >> eeg_countepochs(EEG); +% +% Inputs: +% EEG - input dataset +% epochmarker - ['type'|'eventtype'] indicates which part of the +% EEG.epoch structure the different trial types are stored in. Depending +% on what system the data are from and how they were preprocessed, this +% may be either EEG.epoch.type or EEG.epoch.eventtype. Defaults to +% 'type'. + +% Outputs: +% sweeps - Scalar structure showing, for each epoch type +% (sweeps.types) the number of sweeps in the dataset with that type +% (sweeps.counts) +% +% Example: +% eeg_countepochs( EEG, 'type' ) +% eeg_countepochs( EEG, 'eventtype' ) +% +% Author: Stephen Politzer-Ahles, University of Kansas, 2013 + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [sweeps] = eeg_countepochs(EEG, epochmarker); + +if nargin < 1 + help eeg_countepochs; + return; +end; + +% Initialize an array which will keep counts +clearvars types counts +types{1} = ''; +counts = [0]; + +% Iterate through all trials +for trial=1:length(EEG.epoch) + + % Default 'epochmarker' to 'type' if no input was provided. + if nargin < 2 + epochmarker = 'type'; + end; + + % Look for epochs that have >1 event and find which event is epoched around + eventindex = 1; % if only 1 event, eventindex=1 + if length(EEG.epoch(trial).eventlatency) > 1 + for eventnum = 1:length(EEG.epoch(trial).eventlatency) + if EEG.epoch(trial).eventlatency{eventnum}==0 + eventindex = eventnum; + end % end if + end % end for + end % end if + + % Get the trigger number for this trial + if strcmp(epochmarker,'eventtype') + + % change event type from cell/number event to string + if iscell(EEG.epoch(trial).eventtype(eventindex)) + type = EEG.epoch(trial).eventtype{eventindex}; + elseif isnumeric(EEG.epoch(trial).eventtype(eventindex)) + type = num2str( EEG.epoch(trial).eventtype(eventindex) ); + else % is char + type = EEG.epoch(trial).eventtype; + end + elseif strcmp(epochmarker,'type') + + % change cell/number event to string + if iscell(EEG.epoch(trial).type(eventindex)) + type = EEG.epoch(trial).type{eventindex}; + elseif isnumeric(EEG.epoch(trial).type(eventindex)) + type = num2str( EEG.epoch(trial).type(eventindex) ); + else % is char + type = EEG.epoch(trial).type; + end + end; % end if + + % Find the row of the array that corresponds to this trigger (or if this trigger has not been counted yet) + index_of_type = find( cellfun(@(x) strcmp(x,type), types) ); + + % If this trial has a trigger that has already been counted before, + % 'row_of_type' will be a number. If not, it will be an empty + % array. + if index_of_type + + % If we already have a count for this trigger, increment that count by 1 + counts(index_of_type) = counts(index_of_type) + 1; + else + + % If not, create a new count for this type + types = [types type]; + counts(end+1) = 1; + end; % end if + +end; % end for + +% Remove the unnecessary first item +types = types(2:end); +counts = counts(2:end); + +% Sorts +[Y,I] = sort( types ); + +% Add types and sweeps to a scalar structure +sweeps.types = types(I); +sweeps.counts = counts(I); + +end diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_decodechan.m b/code/eeglab13_4_4b/functions/popfunc/eeg_decodechan.m new file mode 100644 index 0000000..a45180a --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_decodechan.m @@ -0,0 +1,129 @@ +% eeg_decodechan() - given an input EEG dataset structure, output a new EEG data structure +% retaining and/or excluding specified time/latency, data point, channel, +% and/or epoch range(s). +% Usage: +% >> [chaninds chanlist] = eeg_decodechan(chanlocs, chanlist); +% +% Inputs: +% chanlocs - channel location structure +% chanlist - list of channels, numerical indices [1 2 3 ...] or string +% 'cz pz fz' or cell array { 'cz' 'pz' 'fz' } +% +% Outputs: +% chaninds - integer array with the list of channel indices +% chanlist - cell array with a list of channel labels +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, 2009- +% +% see also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ chaninds chanlist ] = eeg_decodechan(chanlocs, chanstr); + +if nargin < 2 + help eeg_decodechan; + return; +end; + +if isempty(chanlocs) && isstr(chanstr) + chaninds = str2num(chanstr); + chanlist = chaninds; + return; +end; + +if isstr(chanstr) + % convert chanstr + % --------------- + chanstr(find(chanstr == ']')) = []; + chanstr(find(chanstr == '[')) = []; + chanlistnum = []; + chanstr = [ ' ' chanstr ' ' ]; + chanlist = {}; + sp = find(chanstr == ' '); + for i = 1:length(sp)-1 + c = chanstr(sp(i)+1:sp(i+1)-1); + if ~isempty(c) + chanlist{end+1} = c; + if isnan(str2double(chanlocs(1).labels)) % channel labels are not numerical + if ~isnan(str2double(c)) + chanlistnum(end+1) = str2double(c); + end; + end; + end; + end; + if length(chanlistnum) == length(chanlist) + chanlist = chanlistnum; + end; +else + chanlist = chanstr; +end; + +% convert to values +% ----------------- +chanval = 0; +if isnumeric(chanlist) + chanval = chanlist; +end; +% chanval = []; +% if iscell(chanlist) +% for ind = 1:length(chanlist) +% +% valtmp = str2double(chanlist{ind}); +% if ~isnan(valtmp) +% chanval(end+1) = valtmp; +% else chanval(end+1) = 0; +% end; +% end; +% else +% chanval = chanlist; +% end; + +% convert to numerical +% -------------------- +if all(chanval) > 0 + chaninds = chanval; + chanlist = chanval; +else + chaninds = []; + alllabs = lower({ chanlocs.labels }); + chanlist = lower(chanlist); + for ind = 1:length(chanlist) + indmatch = find(strcmp(alllabs,chanlist{ind})); %#ok + if ~isempty(indmatch) + for tmpi = 1:length(indmatch) + chaninds(end+1) = indmatch(tmpi); + end; + else + try, + eval([ 'chaninds = ' chanlist{ind} ';' ]); + if isempty(chaninds) + error([ 'Channel ''' chanlist{ind} ''' not found' ]); + else + end; + catch + error([ 'Channel ''' chanlist{ind} ''' not found' ]); + end; + end; + end; +end; +chaninds = sort(chaninds); +if ~isempty(chanlocs) + chanlist = { chanlocs(chaninds).labels }; +else + chanlist = {}; +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_dipselect.m b/code/eeglab13_4_4b/functions/popfunc/eeg_dipselect.m new file mode 100644 index 0000000..3262944 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_dipselect.m @@ -0,0 +1,81 @@ +% eeg_dipselect() - select componet dipoles from an EEG dataset with +% reisdual variance (rv) less than a selected threshold +% and equivalent dipole location inside the brain volume. +% Usage: +% >> selctedComponents = eeg_dipselect(EEG, rvThreshold, selectionType, depthThreshold) +% +% Inputs: +% EEG - EEGLAB dataset structure +% +% Optional Inputs +% rvThreshold - residual variance threshold (%). Dipoles with residual variance +% less than this value will be selected. {default = 15} +% selectionType - criteria for selecting dipoles: +% 'rv' = only by residual variance, +% 'inbrain' = inside brain volume and residual variance. +% {default = 'inbrain'} +% +% depthThreshold - maximum accepted distance outside brain volume (mm) {default = 1} +% +% Outputs: +% selctedComponents - vector of selected components +% +% Example: +% >> selctedComponents = eeg_dipselect(EEG) % select in-brain dipoles with rv less than 0.15 (default value) +% >> selctedComponents = eeg_dipselect(EEG, 20,'rv') % select dipoles with rv less than 0.2 +% +% Author: Nima Bigdely Shamlo, Copyright (C) September 2007 +% based on an script from Julie Onton and sourcedepth() function +% provided by Robert Oostenveld. +% +% See also: sourcedepth() + +function brainComponents = eeg_dipselect(EEG, rvThreshold, selectionType, depthThreshold); + + +if nargin<2 + rvThreshold = 0.15; + fprintf('Maximum residual variance for selected dipoles set to %1.2f (default).\n',rvThreshold); +else + rvThreshold = rvThreshold/100; % change from percent to value + if rvThreshold>1 + error('Error: residual variance threshold should be less than 1.\n'); + end; +end + + +if nargin<4 + depthThreshold = 1; +end; + +% find components with low residual variance + +for ic = 1:length(EEG.dipfit.model) + residualvariance(1,ic) =EEG.dipfit.model(ic).rv; +end; +compLowResidualvariance = find(residualvariance =3) && strcmp(selectionType, 'rv')) % if only rv is requested (not in-brain) + brainComponents = compLowResidualvariance; + return; +else + if ~exist('ft_sourcedepth') + selectionType = 'rv'; + tmpWarning = warning('backtrace'); + warning backtrace off; + warning('You need to install the Fieldtrip extension to be able to select "in brain" dipoles'); + warning(tmpWarning); + brainComponents = compLowResidualvariance; + return; + end; + load(EEG.dipfit.hdmfile); + + posxyz = []; + for c = compLowResidualvariance + posxyz = cat(1,posxyz,EEG.dipfit.model(c).posxyz(1,:)); + end; + + depth = ft_sourcedepth(posxyz, vol); + + brainComponents = compLowResidualvariance(find(depth<=depthThreshold)); +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_eegrej.m b/code/eeglab13_4_4b/functions/popfunc/eeg_eegrej.m new file mode 100644 index 0000000..f6ef2c3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_eegrej.m @@ -0,0 +1,153 @@ +% eeg_eegrej() - reject porition of continuous data in an EEGLAB +% dataset +% +% Usage: +% >> EEGOUT = eeg_eegrej( EEGIN, regions ); +% +% Inputs: +% INEEG - input dataset +% regions - array of regions to suppress. number x [beg end] of +% regions. 'beg' and 'end' are expressed in term of points +% in the input dataset. Size of the array is +% number x 2 of regions. +% +% Outputs: +% INEEG - output dataset with updated data, events latencies and +% additional boundary events. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 8 August 2002 +% +% See also: eeglab(), eegplot(), pop_rejepoch() + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = eeg_eegrej( EEG, regions); + +com = ''; +if nargin < 2 + help eeg_eegrej; + return; +end; +if nargin<3 + probadded = []; +end +if isempty(regions) + return; +end; + +% regions = sortrows(regions,3); % Arno and Ramon on 5/13/2014 for bug 1605 + +% Ramon on 5/29/2014 for bug 1619 +if size(regions,2) > 2 + regions = sortrows(regions,3); +else + regions = sortrows(regions,1); +end; + +try + % For AMICA probabilities...Temporarily add model probabilities as channels + %----------------------------------------------------- + if isfield(EEG.etc, 'amica') && ~isempty(EEG.etc.amica) && isfield(EEG.etc.amica, 'v_smooth') && ~isempty(EEG.etc.amica.v_smooth) && ~isfield(EEG.etc.amica,'prob_added') + if isfield(EEG.etc.amica, 'num_models') && ~isempty(EEG.etc.amica.num_models) + if size(EEG.data,2) == size(EEG.etc.amica.v_smooth,2) && size(EEG.data,3) == size(EEG.etc.amica.v_smooth,3) && size(EEG.etc.amica.v_smooth,1) == EEG.etc.amica.num_models + + EEG = eeg_formatamica(EEG); + %------------------------------------------- + + [EEG com] = eeg_eegrej(EEG,regions); + + %------------------------------------------- + + EEG = eeg_reformatamica(EEG); + EEG = eeg_checkamica(EEG); + return; + else + disp('AMICA probabilities not compatible with size of data, probabilities cannot be epoched') + disp('Load AMICA components before extracting epochs') + disp('Resuming rejection...') + end + end + + end + % ------------------------------------------------------ +catch + warnmsg = strcat('your dataset contains amica information, but the amica plugin is not installed. Continuing and ignoring amica information.'); + warning(warnmsg) +end + + +if isfield(EEG.event, 'latency'), + tmpevent = EEG.event; + tmpalllatencies = [ tmpevent.latency ]; +else tmpalllatencies = []; +end; + +% handle regions from eegplot +% --------------------------- +if size(regions,2) > 2, regions = regions(:, 3:4); end; +regions = combineregions(regions); + +[EEG.data EEG.xmax tmpalllatencies boundevents] = eegrej( EEG.data, ... + regions, EEG.xmax-EEG.xmin, tmpalllatencies); +oldEEGpnts = EEG.pnts; +EEG.pnts = size(EEG.data,2); +EEG.xmax = EEG.xmax+EEG.xmin; + +% add boundary events +% ------------------- +if ~isempty(boundevents) % boundevent latencies will be recomputed in the function below + [ EEG.event ] = eeg_insertbound(EEG.event, oldEEGpnts, regions); + EEG = eeg_checkset(EEG, 'eventconsistency'); +end; + +com = sprintf('%s = eeg_eegrej( %s, %s);', inputname(1), inputname(1), vararg2str({ regions })); + +% combine regions if necessary +% it should not be necessary but a +% bug in eegplot makes that it sometimes is +% ---------------------------- +% function newregions = combineregions(regions) +% newregions = regions; +% for index = size(regions,1):-1:2 +% if regions(index-1,2) >= regions(index,1) +% disp('Warning: overlapping regions detected and fixed in eeg_eegrej'); +% newregions(index-1,:) = [regions(index-1,1) regions(index,2) ]; +% newregions(index,:) = []; +% end; +% end; + +function newregions = combineregions(regions) +% 9/1/2014 RMC +regions = sortrows(sort(regions,2)); % Sorting regions +allreg = [ regions(:,1)' regions(:,2)'; ones(1,numel(regions(:,1))) -ones(1,numel(regions(:,2)')) ].'; +allreg = sortrows(allreg,1); % Sort all start and stop points (column 1), + +mboundary = cumsum(allreg(:,2)); % Rationale: regions will start always with 1 and close with 0, since starts=1 end=-1 +indx = 0; count = 1; + +while indx ~= length(allreg) + newregions(count,1) = allreg(indx+1,1); + [tmp,I]= min(abs(mboundary(indx+1:end))); + newregions(count,2) = allreg(I + indx,1); + indx = indx + I ; + count = count+1; +end + +% Verbose +if size(regions,1) ~= size(newregions,1) + disp('Warning: overlapping regions detected and fixed in eeg_eegrej'); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_emptyset.m b/code/eeglab13_4_4b/functions/popfunc/eeg_emptyset.m new file mode 100644 index 0000000..ea09232 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_emptyset.m @@ -0,0 +1,93 @@ +% eeg_emptyset() - Initialize an EEG dataset structure with default values. +% +% Usage: +% >> EEG = eeg_emptyset(); +% +% Outputs: +% EEG - empty dataset structure with default values. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function EEG = eeg_emptyset(); + +EEG.setname = ''; +EEG.filename = ''; +EEG.filepath = ''; +EEG.subject = ''; +EEG.group = ''; +EEG.condition = ''; +EEG.session = []; +EEG.comments = ''; +EEG.nbchan = 0; +EEG.trials = 0; +EEG.pnts = 0; +EEG.srate = 1; +EEG.xmin = 0; +EEG.xmax = 0; +EEG.times = []; +EEG.data = []; +EEG.icaact = []; +EEG.icawinv = []; +EEG.icasphere = []; +EEG.icaweights = []; +EEG.icachansind = []; +EEG.chanlocs = []; +EEG.urchanlocs = []; +EEG.chaninfo = []; +EEG.ref = []; +EEG.event = []; +EEG.urevent = []; +EEG.eventdescription = {}; +EEG.epoch = []; +EEG.epochdescription = {}; +EEG.reject = []; +EEG.stats = []; +EEG.specdata = []; +EEG.specicaact = []; +EEG.splinefile = ''; +EEG.icasplinefile = ''; +EEG.dipfit = []; +EEG.history = ''; +EEG.saved = 'no'; +EEG.etc = []; + +%EEG.reject.threshold = [1 0.8 0.85]; +%EEG.reject.icareject = []; +%EEG.reject.compreject = []; +%EEG.reject.gcompreject= []; +%EEG.reject.comptrial = []; +%EEG.reject.sigreject = []; +%EEG.reject.elecreject = []; + +%EEG.stats.kurta = []; +%EEG.stats.kurtr = []; +%EEG.stats.kurtd = []; +%EEG.stats.eegentropy = []; +%EEG.stats.eegkurt = []; +%EEG.stats.eegkurtg = []; +%EEG.stats.entropy = []; +%EEG.stats.kurtc = []; +%EEG.stats.kurtt = []; +%EEG.stats.entropyc = []; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_epoch2continuous.m b/code/eeglab13_4_4b/functions/popfunc/eeg_epoch2continuous.m new file mode 100644 index 0000000..14df5e0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_epoch2continuous.m @@ -0,0 +1,51 @@ +% eeg_epoch2continuous() - convert epoched dataset to continuous dataset +% with data epochs separated by boundary events. +% Usage: +% >> EEGOUT = eeg_epoch2continuous(EEGIN); +% +% Inputs: +% EEGIN - a loaded epoched EEG dataset structure. +% +% Inputs: +% EEGOUT - a continuous EEG dataset structure. +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, January, 2012 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2012, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = eeg_epoch2continuous(EEG) + +if nargin < 1 + help eeg_epoch2continuous; + return; +end; + +EEG.data = reshape(EEG.data, size(EEG.data,1), size(EEG.data,2)*size(EEG.data,3)); + +for index = 1:EEG.trials-1 + EEG.event(end+1).type = 'boundary'; + EEG.event(end ).latency = index*EEG.pnts-0.5; + EEG.event(end ).duration = NaN; +end; + +EEG.pnts = size(EEG.data,2); +EEG.trials = 1; +if ~isempty(EEG.event) && isfield(EEG.event, 'epoch') + EEG.event = rmfield(EEG.event, 'epoch'); +end; + +EEG = eeg_checkset(EEG); \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_epochformat.m b/code/eeglab13_4_4b/functions/popfunc/eeg_epochformat.m new file mode 100644 index 0000000..065351c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_epochformat.m @@ -0,0 +1,208 @@ +% eeg_epochformat() - Convert the epoch information of a dataset from struct +% to array or vice versa. +% +% Usage: >> [epochsout fields] = eeg_epochformat( epochs, 'format', fields, events ); +% +% Input: +% epochs - epoch numerical or cell array or epoch structure +% format - ['struct'|'array'] convert epoch array to structure and epoch +% structure to array. +% fields - [optional] cell array of strings containing the names of +% the epoch struct fields. If this field is empty, it uses the +% following list for the names of the fields { 'var1' 'var2' ... }. +% For structure conversion, this field helps export a given +% event type. If this field is left empty, the time locking +% event for each epoch is exported. +% events - numerical array of event indices associated with each epoch. +% For array conversion, this field is ignored. +% +% Outputs: +% epochsout - output epoch array or structure +% fields - output cell array with the name of the fields +% +% Epoch format: +% struct - Epoch information is organised as an array of structs +% array - Epoch information is organised as an 2-d array of numbers, +% each column representing a user-defined variable (the +% order of the variable is a function of its order in the +% struct format). +% +% Note: 1) The epoch structure is defined only for epoched data. +% 2) The epoch 'struct' format is more comprehensible. +% For instance, to see all the properties of epoch i, +% type >> EEG.epoch(i) +% Unfortunately, structures are awkward for expert users to deal +% with from the command line (Ex: To get an array of 'var1' values, +% >> celltomat({EEG.epoch(:).var1})') +% In array format, asuming 'var1' is the first variable +% declared, the same information is obtained by +% >> EEG.epoch(:,1) +% 3) This function automatically updates the 'epochfields' +% cell array depending on the format. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 12 Feb 2002 +% +% See also: eeglab() + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) from eeg_eventformat.m, +% Arnaud Delorme, CNL / Salk Institute, 12 Feb 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: eeg_epochformat.m,v $ +% Revision 1.4 2005/05/24 16:57:09 arno +% cell2mat +% +% Revision 1.3 2003/07/20 19:32:20 scott +% typos +% +% Revision 1.2 2002/04/21 01:10:35 scott +% *** empty log message *** +% +% Revision 1.1 2002/04/05 17:32:13 jorn +% Initial revision +% + +% 03/13/02 added field arrays options -ad + +function [ epoch, fields, epocheventout] = eeg_epochformat( epoch, format, fields, epochevent); + +if nargin < 2 + help eeg_epochformat; + return; +end; + +if nargin < 3 + fields = {}; +end; +epocheventout = []; + +switch format +case 'struct' + if ~isempty(epoch) & ~isstruct(epoch) + + fields = getnewfields( fields, size(epoch,2) - length(fields)); + + % generate the structure + % ---------------------- + command = 'epoch = struct('; + for index = 1:length(fields) + if iscell(epoch) + command = [ command '''' fields{index} ''', epoch(:,' num2str(index) ')'',' ]; + else + command = [ command '''' fields{index} ''', mattocell( epoch(:,' num2str(index) ')'',' ... + '[1], ones(1,size(epoch,1))),' ]; + end; + end; + eval( [command(1:end-1) ');' ] ); + + if exist('epochevent') == 1 + for index = 1:size(epoch,2) + if iscell(epochevent) + epoch(index).event = epochevent{index}; + else + epoch(index).event = epochevent(index); + end; + end; + end; + end + +case 'array' + if isstruct(epoch) + + % note that the STUDY std_maketrialinfo also gets the epoch info for the + % time locking event + + selectedType = fields; + if iscell(fields) && ~isempty(fields), selectedType = fields{1}; end; + fields = fieldnames( epoch ); + + eval( [ 'values = { epoch.' fields{1} ' };' ]); + + if any(cellfun(@length, values) > 1) + if ~isfield(epoch, 'eventlatency') + error('eventlatency field not present in data epochs'); + end; + + if isempty(selectedType) + % find indices of time locking events + for index = 1:length(epoch) + epochlat = [ epoch(index).eventlatency{:} ]; + tmpevent = find( abs(epochlat) < 0.02 ); + if isempty(tmpevent) + error('time locking event missing, cannot convert to array'); + end; + epochSubIndex(index) = tmpevent; + end; + else + % find indices of specific event type (if several take the + % first one + for index = 1:length(epoch) + epochtype = epoch(index).eventtype; + tmpeventind = strmatch( selectedType, epochtype ); + if length(tmpeventind) > 1 + fprintf('Warning: epoch %d has several events of "type" %s, taking the fist one\n', index, selectedType); + end; + if isempty(tmpeventind) + epochSubIndex(index) = NaN; + else epochSubIndex(index) = tmpeventind(1); + end; + end; + end; + else + epochSubIndex = ones(1, length(epoch)); + end; + + % copy values to array + tmp = cell( length(epoch), length( fields )); + for index = 1:length( fields ) + for trial = 1:length(epoch) + tmpval = getfield(epoch, {trial}, fields{index}); + if isnan(epochSubIndex(trial)) + tmp(trial, index) = { NaN }; + elseif iscell(tmpval) + tmp(trial, index) = tmpval(epochSubIndex(trial)); + elseif ~ischar(tmpval) + tmp(trial, index) = { tmpval(epochSubIndex(trial)) }; + else tmp(trial, index) = { tmpval }; + end; + end; + end; + epoch = tmp; + end; + otherwise, error('unrecognised format'); +end; + +return; + +% create new field names +% ---------------------- +function epochfield = getnewfields( epochfield, nbfields ) + count = 1; + if nbfields > 0 + while nbfields > 0 + if isempty( strmatch([ 'var' int2str(count) ], epochfield ) ) + epochfield = { epochfield{:} [ 'var' int2str(count) ] }; + nbfields = nbfields-1; + else count = count+1; + end; + end; + else + epochfield = epochfield(1:end+nbfields); + end; +return; + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_eventformat.m b/code/eeglab13_4_4b/functions/popfunc/eeg_eventformat.m new file mode 100644 index 0000000..960e0da --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_eventformat.m @@ -0,0 +1,73 @@ +% eeg_eventformat() - Convert the event information of a dataset from struct +% to array or vice versa. +% +% Usage: >> [eventout fields] = eeg_eventformat( event, 'format', fields ); +% +% Inputs: +% event - event array or structure +% format - ['struct'|'array'] see below +% fields - [optional] cell array of strings containing the names of +% the event struct fields. If this field is empty, it uses +% the following list for +% the names of the fields { 'type' 'latency' 'var1' ... +% 'var2' ... }. +% Output: +% eventout - output event array or structure +% fields - output cell array with the name of the fields +% +% Event formats: +% struct - Events are organised as an array of structs with at +% least two fields ('type' and 'latency') +% (Ex: reaction_time may be type 1). +% array - events are organized as an array, the first column +% representing the type, the second the latency and the +% other ones user-defined variables. +% +% Note: 1) The event structure is defined only for continuous data +% or epoched data derived from continuous data. +% 2) The event 'struct' format is more comprehensible. +% For instance, to see all the properties of event 7, +% type >> EEG.event(7) +% Unfortunately, structures are awkward for expert users to deal +% with from the command line (Ex: To get an array of latencies, +% >> [ EEG.event(:).latency ] ) +% In array format, the same information is obtained by typing +% >> EEG.event(:,2) +% 3) This function automatically updates the 'eventfield' +% cell array depending on the format. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 27 Jan 2002 +% +% See also: eeglab(), pop_selectevent(), pop_importevent() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 27 Jan 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 2/06/02 modifed header - sm & ad +% 2/08/02 add field input - ad +% 2/12/02 reprogrammed function using epochformat.m - ad + +function [event, eventfield] = eeg_eventformat(event, format, fields); + +if nargin < 2 + help eeg_eventformat; + return; +end; + +if exist('fields') ~= 1, fields = { 'type', 'latency' }; end; + +[event eventfield] = eeg_epochformat( event, format, fields); + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_eventhist.m b/code/eeglab13_4_4b/functions/popfunc/eeg_eventhist.m new file mode 100644 index 0000000..91591b8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_eventhist.m @@ -0,0 +1,160 @@ +% eeg_eventhist() - return or plot histogram of event or urevent field values. +% If NO output args, plots the histogram. If the field values +% are not numbers or strings, no histogram is computed. +% Usage: +% >> figure; eeg_eventhist(EEG.event,'field',bins); % plot histogram +% >> [fldvals] = eeg_eventhist(EEG.event,'field'); % return field values +% >> [fldvals,binNs,binedges] = eeg_eventhist(EEG.event,'field',bins); +% Inputs: +% +% Event - an EEGLAB EEG.event or EEG.urevent structure +% 'field' - string containing the name of a field in the input Event structure +% bins - optional number of bins to use, else vector of bin edges {default: 10} +% If event field values are strings, this argument is ignored. +% Outputs: +% +% fldvals - numeric, struct, or cell array vector of field values for each event +% in the input event order (with [] values, if any, replaced by NaN's or ' 's). +% binNs - numbers of events in the histogram bins +% binedges - if numeric values, a one-column matrix giving bin edges of the [low,high) bins +% Else, if string values, cell array containing the string associated with each bin. +% Example: +% >> [vals,histNs,bins] = eeg_eventhist(EEG.event,'type'); +% % +% % Returns cell array of event-type strings, numbers of each event type, +% % and event type strings, in alphabetic order. No bar() plot produced. +% +% See also: pop_eventstat(), signalstat(), pop_signalstat(). +% +% Author: Scott Makeig, SCCN, Institute for Neural Computation, UCSD, March 26, 2004 +% + +% 8-20-05 replace found numeric field values [] with NaN to avoid bug -sm +% replace bin numbers in plot with bin labels if strings; add plot title + +function [vals,histNs,outbins] = eeg_eventhist(Event,field,bins) + +if nargin < 2 + help eeg_eventhist + return +end + +if nargin < 3 + bins = 10; +end + +if isempty(Event) + error('Event structure is empty'); +end +if ~isfield(Event,field) + error('named field is not an Event field') +end + +idx = 0; fld = []; +while isempty(fld) + idx = idx+1; + if idx > length(Event) + error('All named event fields are empty'); + end + fld = getfield(Event(idx),field); + if ischar(fld) + IS_CHAR = 1; + elseif isstruct(fld) + IS_STRUCT = 1; + elseif ~isempty(fld) + IS_NUM = 1; + end +end + +if exist('IS_NUM') + vals = zeros(length(Event),1); + fprintf('Assuming ''%s'' field values are numeric.\n',field); +elseif exist('IS_CHAR') + vals = cell(length(Event),1); + fprintf('Assuming ''%s'' field values are strings.\n',field); +elseif exist('IS_STRUCT') + vals = repmat(field1,length(Event),1); + fprintf('Assuming ''%s'' field values are structures.\n',field); +else + error('Cannot determine field value type') +end + +if exist('IS_NUM') + for k=1:length(Event) + v = getfield(Event(k),field); + if isempty(v) + v = NaN; + end + vals(k) = v; + end +else + for k=1:length(Event) + vals{k} = getfield(Event(k),field); + end +end +if nargout == 1 | exist('IS_STRUCT') + return % return vals only, no histogram +end +% +if exist('IS_NUM') %%%%%%%%%%%%%%%% numeric values histogram %%%%%%%%%%%%%%%%%%%%%% +% + if numel(bins) == 1 + if bins < 3 + error('number of bins must be > 2'); + end + + mn = mean(vals); + stdev = std(vals); + + binsout = zeros(bins,1); + fl2 = floor(bins/2); + for k = -1*fl2:ceil(bins/2) + binsout(k+fl2+1) = mn+k*stdev; + end + binsout(1) = -inf; + binsout(end) = inf; + + histNs = histc(vals,binsout); + histNs = histNs(1:end-1); + + else % accomodate specified bin edges + histNs = histc(vals,bins); + histNs = histNs(1:end-1); + end + + outbins = binsout; + if nargout == 0 + h = bar(histNs,'histc'); + end +% +else % exist('IS_CHAR') %%%%%%%%%%%% string values histogram %%%%%%%%%%%%%%%%%%%%%% +% + for v=1:length(vals) + if isempty(cell2mat(vals(v))) + vals(v) = {' '}; + end + end + outbins = unique_bc(vals); + histNs = zeros(length(outbins)-1,1); + for k=1:length(outbins) + histNs(k) = sum(ismember(vals,outbins{k})); + end + + if nargout == 0 + bar(histNs,1); + if IS_CHAR + set(gca,'xticklabel',outbins); % ??? NEEDS MORE WORK - CANT TEST FROM HOME + yl = get(gca,'ylim'); + set(gca,'ylim',[yl(1) yl(2)*1.1]); + + if strcmp(field,'type') + tl=title(['Histogram of event types']); + else + tl=title(['Histogram of event field ''' field ''' values']); + end + end + end +end + +return + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_eventtable.m b/code/eeglab13_4_4b/functions/popfunc/eeg_eventtable.m new file mode 100644 index 0000000..1881376 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_eventtable.m @@ -0,0 +1,154 @@ +function events = eeg_eventtable(EEG, varargin) +% eeg_eventtable() - returns all events contained in the EEG structure (and +% optionally exports them to a CSV file) +% +% Usage: +% >> events = eeg_eventtable(EEG); +% +% Inputs: +% EEG - EEG structure +% +% Optional inputs: +% 'unit' - Unit of events containing time samples, can be either +% 'samples' (default) or 'seconds' +% 'dispTable' - Display an overview of all events if set to true (default); +% do not display if set to false +% 'exportFile' - Exports events as a CSV file (using tabs as delimiters); set +% this parameter to the file name you wish to export the events +% to (string); default: no file is exported +% 'indexCol' - Adds a column with the event indices as the first row; note +% that this is not an event field; default: true +% +% Outputs: +% events - event structure (cell array) +% +% Examples: +% Get all events contained in the EEG structure and display an overview: +% >> events = eeg_eventtable(EEG); +% +% In addition to displaying an overview, export into a CSV file: +% >> events = eeg_eventtable(EEG, 'exportFile', 'test.csv'); + +% Copyright by Clemens Brunner +% Revision: 0.15 +% Date: 10/13/2011 + +% Revision history: +% 0.15: Added option to add/remove index column +% 0.11: Changed function name and updated documentation +% 0.10: Initial version + +% This program is free software; you can redistribute it and/or modify it under +% the terms of the GNU General Public License as published by the Free Software +% Foundation; either version 2 of the License, or (at your option) any later +% version. +% +% This program is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License along with +% this program; if not, write to the Free Software Foundation, Inc., 59 Temple +% Place - Suite 330, Boston, MA 02111-1307, USA. + +% Default parameters, can be overwritten by varargin +unit = 'samples'; % Unit of latencies is 'samples' +dispTable = true; % Display the event table +exportFile = []; % Export events to text file +indexCol = true; % Add an index column as first column + +if ~isempty(varargin) % Are there optional parameters available? + k = 1; + while k <= length(varargin) + if strcmp(varargin{k}, 'dispTable') + dispTable = varargin{k + 1}; + k = k + 2; + elseif strcmp(varargin{k}, 'unit') + unit = varargin{k + 1}; + k = k + 2; + elseif strcmp(varargin{k}, 'exportFile') + exportFile = varargin{k + 1}; + k = k + 2; + elseif strcmp(varargin{k}, 'indexCol') + indexCol = varargin{k + 1}; + k = k + 2; + else % Ignore unknown parameters + k = k + 2; + end; + end; +end; + +fields = fieldnames(EEG.event); % Get all event fields +nFields = length(fields); % Number of event fields +nEvents = length(EEG.event); % Number of events + +events = cell(nFields, 1); +for k = 1:nFields + events{k}.name = fields{k}; % Event name + events{k}.values = cell(nEvents, 1); % Will contain values for this event + + for l = 1:nEvents % Write values + if strcmp(events{k}.name, 'latency') && strcmp(unit, 'seconds') + events{k}.values{l} = getfield(EEG.event(l), fields{k})/EEG.srate; + elseif strcmp(events{k}.name, 'duration') && strcmp(unit, 'seconds') + events{k}.values{l} = getfield(EEG.event(l), fields{k})/EEG.srate; + else + events{k}.values{l} = getfield(EEG.event(l), fields{k}); + end + end + +end + +if dispTable || ~isempty(exportFile) % Display overview or export to CSV file? + + nr = cell(nEvents, 1); % Consecutive event numbers + for l = 1:nEvents + nr{l} = l; end + + eventsTable = []; + if indexCol % Add index column + titleTable{1} = 'number'; + titleOffset = 1; + else % Do not add index column + titleOffset = 0; + end + for k = 1:nFields + eventsTable = [eventsTable, events{k}.values]; + titleTable{k + titleOffset} = events{k}.name; + end + if indexCol + eventsTable = [nr, eventsTable]; % Add event numbers in first column + end + finalTable = [titleTable; eventsTable]; % Add title in first row + + if dispTable + format('shortG'); + disp(finalTable); + format; + end + + if ~isempty(exportFile) + fid = fopen(exportFile, 'w'); + for rows = 1:size(finalTable, 1) + for cols = 1:size(finalTable, 2) + dataValue = finalTable(rows, cols); + if cols < size(finalTable, 2) % If we're not in the last column, print the delimiter + if iscellstr(dataValue) + fprintf(fid, '%s\t', dataValue{:}); + elseif iscellnumeric(dataValue) + fprintf(fid, '%f\t', dataValue{:}); + end + else % If we're in the last column, do not print the delimiter + if iscellstr(dataValue) + fprintf(fid, '%s', dataValue{:}); + elseif iscellnumeric(dataValue) + fprintf(fid, '%f', dataValue{:}); + end + end + end + fprintf(fid, '\n'); + end + fclose(fid); + end +end + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_eventtypes.m b/code/eeglab13_4_4b/functions/popfunc/eeg_eventtypes.m new file mode 100644 index 0000000..51bc6c3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_eventtypes.m @@ -0,0 +1,182 @@ +% eeg_eventtypes() - return a list of event or urevent types in a dataset and +% the respective number of events of each type. Ouput event +% types are sorted in reverse order of their number. If no +% outputs, print this list on the commandline instead. +% +% Usage: +% >> [types,numbers] = eeg_eventtypes(EEG); +% Inputs: +% EEG - EEGLAB dataset structure +% Outputs: +% types - cell array of event type strings +% numbers - vector giving the numbers of each event type in the data +% +% Example: +% >> eeg_eventtypes(EEG); % print numner of each event types +% +% Author: Scott Makeig, SCCN/INC/UCSD, April 28, 2004- + +% >> [types,numbers] = eeg_eventtypes(EEG,types); +% >> [types,numbers] = eeg_eventtypes(EEG,'urevents',types); +% Inputs: +% EEG - EEGLAB dataset structure +% 'urevents' - return event information for the EEG.urevent structure +% types - {cell array} of event types to return or print. +% Outputs: +% types - cell array of event type strings +% numbers - vector giving the numbers of each event type in the data +% +% Note: Numeric (ur)event types are converted to strings, so, for example, +% types {13} and {'13'} are not distinguished. +% +% Example: +% >> eeg_eventtypes(EEG); % print numner of each event types +% +% Curently disabled: +% >> eeg_eventtypes(EEG,'urevent'); % print hist. of urevent types +% >> eeg_eventtypes(EEG,{'rt'});% print number of 'rt' events +% >> eeg_eventtypes(EEG,'urevent',{'rt','break'}); +% % print numbers of 'rt' and 'break' +% % type urevents + +% Copyright (C) 2004 Scott Makeig, SCCN/INC/UCSD, smakeig@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +% +% +% event types can be numbers, Stefan Debener, 05/12/2006, +% added 2nd and 3rd args, sorted outputs by number, Scott Makeig, 09/12/06 + +function [types,numbers] = eeg_eventtypes(EEG,arg2,arg3) + +if nargin< 1 + help eeg_eventtypes + return +end +if ~isstruct(EEG) + error('EEG argument must be a dataset structure') +end + +if ~isfield(EEG,'event') + error('EEG.event field not found'); +end +if nargin > 1 + error('Multiple input arguments are currently disabled'); +end; + +UREVENTS = 0; % flag returning infor for urevents instead of events +typelist = []; +if nargin>1 + if ischar(arg2) + if strcmp(arg2,'urevent') | strcmp(arg2,'urevents') + UREVENTS = 1; % change flag + else + error('second argument string not understood') + end + if nargin>2 + if iscell(arg3) + typelist = arg3; + end + end + elseif iscell(arg2) + typelist = arg2; + end +end +if ~isempty(typelist) % cast to cell array of strings + for k=1:length(typelist) + if isnumeric(typelist{k}) + typelist{k} = num2str(typelist{k}); + end + end +end + +if ~UREVENTS + nevents = length(EEG.event); + alltypes = cell(nevents,1); + for k=1:nevents + if isnumeric(EEG.event(k).type) + alltypes{k} = num2str(EEG.event(k).type); + else + alltypes{k} = EEG.event(k).type; + end + end +else + nevents = length(EEG.urevent); + alltypes = cell(nevents,1); + for k=1:nevents + if isnumeric(EEG.urevent(k).type) + alltypes{k} = num2str(EEG.urevent(k).type); + else + alltypes{k} = EEG.urevent(k).type; + end + end +end + +[types i j] = unique_bc(alltypes); + +istypes = 1:length(types); +notistypes = []; +if ~isempty(typelist) + notistypes = ismember_bc(typelist,types); + istypes = ismember_bc(types,typelist(find(notistypes==1))); % types in typelist? + notistypes = typelist(find(notistypes==0)); +end + +types(~istypes) = []; % restrict types to typelist + +ntypes = length(types); +numbers = zeros(ntypes + length(notistypes),1); +for k=1:ntypes + numbers(k) = length(find(j==k)); +end +types = [types(:); notistypes(:)]; % concatenate the types not found +ntypes = length(types); +for j = 1:length(notistypes) + numbers(k+j) = 0; +end + +% sort types in reverse order of event numbers +[numbers nsort] = sort(numbers); +numbers = numbers(end:-1:1); +types = types(nsort(end:-1:1)); + +% +% print output on commandline %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargout < 1 + fprintf('\n'); + if UREVENTS + fprintf('EEG urevent types:\n\n') + else + fprintf('EEG event types:\n\n') + end + + maxx = 0; + for k=1:ntypes + x = length(types{k}); + if x > maxx + maxx = x; % find max type name length + end + end + for k=1:ntypes + fprintf(' %s',types{k}); + for j=length(types{k})+1:maxx+4 + fprintf(' '); + end + fprintf('%d\n',numbers(k)); + end + fprintf('\n'); + clear types % no return variables +end diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_getepochevent.m b/code/eeglab13_4_4b/functions/popfunc/eeg_getepochevent.m new file mode 100644 index 0000000..6d90896 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_getepochevent.m @@ -0,0 +1,315 @@ +% eeg_getepochevent() - Return dataset event field values for all events +% of one or more specified types +% Usage: +% >> epochval = eeg_getepochevent( EEG ); +% >> epochval = eeg_getepochevent( EEG, 'key', 'val'); +% +% Inputs: +% EEG - Input dataset +% +% Optional inputs: +% 'type' - String containing an event type. Cell array of string +% may be used to select several event types; +% {} is all types of events. Note: Requires that +% a field named 'type' is defined in 'EEG.event'. +% 'timewin' - [start end] Event time window in milliseconds +% (default []=whole epoch). +% 'fieldname' - Name of the field to return the values for. +% Default field is 'EEG.event.latency' in milliseconds +% (though internally this information is stored in +% real frames). +% 'trials' - [integer array] return values only for selected trials. +% +% Outputs: +% epochval - A value of the selected field for each epoch. This is +% NaN if no selected event occurred during the epoch. If +% several values are available for each epoch, only the +% first one is taken into consideration. +% Latencies are measured in msec relative to epoch onset. +% Forced to be numerical, where a string is converted by +% double to its ascii number which is normalized to be +% between 0 and 1, and the string is summed together. See +% the subfunction ascii2num for more details. +% allepochval - cell array with same length as the number of epoch +% containing all values for all epochs. This output is +% usefull when several value are found within each epoch. +% Not forced to be numerical. +% +% Notes: 1) Each epoch structure refers to the events that occurred +% during its time window. This function allows the user to return +% specified field values for a subset of the defined events. +% +% 2) If several of the selected events occur during a single epoch, +% a warning is issued, and value of ONLY THE FIRST event in the epoch +% is returned. +% +% If NO EVENT is selected in a given epoch, the value returned +% is NaN. +% +% 3) If the user elects to return the latency field, eeg_getepochevent() +% recomputes the latency of each event relative to the epoch time +% limits. +% +% Example: +% >> latencies = eeg_getepochevent(EEG, 'rt'); +% % Return the latencies (by default) in milliseconds of events having +% % type 'rt' (reaction time) +% +% >> latencies = eeg_getepochevent(EEG, {'target','rare'}, [0 300], 'position'); +% % Return the position (field 'position') of 'target' or 'rare' type +% % events occurring between 0 and 300 milliseconds of each epoch. +% % Returns NaN for epochs with no such events. (See Notes above). +% +% Author: Arnaud Delorme & Scott Makeig, CNL / Salk Institute, 15 Feb 2002 +% +% See also: eeglab(), epoch() + +% Copyright (C) 15 Feb 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 02/15/02 modified function according to new event structure -ad + +function [epochval, allepochval] = eeg_getepochevent(EEG, varargin); + +if nargin < 2 + help eeg_getepochevent; + return; +end; + +% process more than one EEG dataset (for STUDY purposes) +% ------------------------------------------------------ +if length(EEG) > 1 + % the trial input may be a cell array; it has to be + % extracted before calling the function on each dataset + trials = cell(1,length(EEG)); + for iArg = length(varargin)-1:-2:1 + if strcmpi(varargin{iArg}, 'trials') + trials = varargin{iArg+1}; + varargin(iArg:iArg+1) = []; + end; + end; + + epochval = []; + for dat = 1:length(EEG) + tmpepochval = eeg_getepochevent(EEG(dat), 'trials', trials{dat}, varargin{:}); + epochval = [ epochval tmpepochval ]; + end; + return; +end; + +% deal with old input format +% ------------------------- +options = {}; +oldformat = 0; +if nargin < 3 + oldformat = 1; +elseif isnumeric(varargin{2}) && length(varargin{2}) == 2 + oldformat = 1; +elseif length(varargin) == 3 && isfield(EEG.event,varargin(3)) + oldformat = 1; +end; +if oldformat + if nargin > 1, options = { options{:} 'type' varargin{1} }; end; + if nargin > 2, options = { options{:} 'timewin' varargin{2} }; end; + if nargin > 3, options = { options{:} 'fieldname' varargin{3} }; end; +else + options = varargin; +end; +opt = finputcheck(options, { 'type' { 'string';'cell' } { [] [] } ''; + 'timewin' 'real' [] [-Inf Inf]; + 'fieldname' 'string' [] 'latency'; + 'trials' { 'real';'cell' } [] [] }, 'eeg_getepochevent'); +if isstr(opt), error(opt); end; +if iscell(opt.trials) && ~isempty(opt.trials), opt.trials = opt.trials{1}; end; + +if isempty(opt.timewin) + opt.timewin = [-Inf Inf]; +end; + +if isempty(EEG.event) + disp('Getepochevent: no event structure, aborting.'); return; +end; + +% check if EEG.epoch contain references to events +% ----------------------------------------------- +if ~isfield( EEG.event, 'epoch' ) + disp('Getepochevent: no epoch indices in events, considering continuous values.'); +end; + +% check if EEG.epoch and EEG.event contains 'latency' field +% ------------------------------------------ +if ~isfield( EEG.event, opt.fieldname) + disp(['Getepochevent: no ''' opt.fieldname ''' field in events, aborting.']); return; +end; + +% deal with empty types +% --------------------- +if ~isempty(opt.type) & ~iscell(opt.type) + opt.type = { opt.type }; +end; + +% convert types +% ------------- +for indextype=1:length(opt.type) + if isstr(opt.type{indextype}) & isnumeric(EEG.event(1).type) + if ~isempty(str2num(opt.type{indextype})) + opt.type{indextype} = str2num(opt.type{indextype}); + else + error('eeg_getepochevent: string type cannot be found in numeric event type array'); + end; + elseif isnumeric(opt.type{indextype}) & isstr(EEG.event(1).type) + opt.type{indextype} = num2str(opt.type{indextype}); + end; +end; + +% select epochs +% ------------- +if ~isempty(opt.type) + Ieventtmp = []; + tmpevent = EEG.event; + for indextype=1:length(opt.type) + typeval = opt.type{indextype}; + if isstr(typeval) + Ieventtmp = [Ieventtmp strmatch(typeval, { tmpevent.type }, 'exact')' ]; + else + Ieventtmp = [Ieventtmp find(typeval == [ tmpevent.type ] ) ]; + end; + end; +else + Ieventtmp = [1:length(EEG.event)]; +end; + +% select latencies +% ---------------- +if isfield(EEG.event, 'latency') & (opt.timewin(1) ~= -Inf | opt.timewin(2) ~= Inf) + selected = ones(size(Ieventtmp)); + for index=1:length(Ieventtmp) + if ~isfield(EEG.event, 'epoch'), epoch = 1; + else epoch = EEG.event(Ieventtmp(index)).epoch; + end; + reallat = eeg_point2lat(EEG.event(Ieventtmp(index)).latency, epoch, ... + EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); + if reallat < opt.timewin(1) | reallat > opt.timewin(2) + selected(index) = 0; + end; + end; + Ieventtmp = Ieventtmp( find(selected == 1) ); +end; + +% select events +% ------------- +epochval = cell(1,EEG.trials); epochval(:) = { nan }; +allepochval = cell(1, EEG.trials); allepochval(:) = { {} }; +if strcmp(opt.fieldname, 'latency') + for index = 1:length(Ieventtmp) + if ~isfield(EEG.event, 'epoch'), epoch = 1; + else epoch = EEG.event(Ieventtmp(index)).epoch; + end; + + allepochval{epoch}{end+1} = eeg_point2lat(EEG.event(Ieventtmp(index)).latency, epoch, ... + EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); + if length(allepochval{epoch}) == 1 + epochval{epoch} = allepochval{epoch}{end}; + else + if length(allepochval{epoch}) == 2 & nargout < 2 + disp(['Warning: multiple event latencies found in epoch ' int2str(epoch) ]); + %, ignoring event ' int2str(Ieventtmp(index)) ' (''' num2str(EEG.event(Ieventtmp(index)).type) ''' type)' ]); + end; + end; + end; +elseif strcmp(opt.fieldname, 'duration') + for index = 1:length(Ieventtmp) + eval( [ 'val = EEG.event(Ieventtmp(index)).' opt.fieldname ';']); + if ~isempty(val) + if ~isfield(EEG.event, 'epoch'), epoch = 1; + else epoch = EEG.event(Ieventtmp(index)).epoch; + end; + epochval{epoch} = val/EEG.srate*1000; + allepochval{epoch}{end+1} = val/EEG.srate*1000; + end; + end; +else + for index = 1:length(Ieventtmp) + eval( [ 'val = EEG.event(Ieventtmp(index)).' opt.fieldname ';']); + if ~isempty(val) + if isstr(val) + val = ascii2num(val); + %val_tmp = double(val); % force epochval output to be numerical + % **Turn string into number that will sort in alphebetical order** + %val = 0; + %for val_count = 1:length(val_tmp) + % -48 so that '1' is scaled to ascii number 1, not 49 + % /74 to scale double('z')=122 to 1 + % 10^((2-... scale to 0 to 100milliseconds + + % val = val + (val_tmp(val_count)-48)/74*10^(2-(val_count-1)); + %end + % **End turn string ...** + end + if ~isfield(EEG.event, 'epoch'), + epoch = 1; + else epoch = EEG.event(Ieventtmp(index)).epoch; + end + epochval{epoch} = val(1); + allepochval{epoch}{end+1} = val(1); + end; + end; +end; + +if isnumeric(epochval{1}) + try + epochval = [ epochval{:} ]; + for index = 1:length(allepochval) + allepochval{index} = [ allepochval{index}{:} ]; + end + catch + end +end + +% select specific trials +if ~isempty(opt.trials) + epochval = epochval(opt.trials); + allepochval = allepochval(opt.trials); +end; + +%% SUBFUNCTION ASCII2NUM +% Maps ascii characters ['0','9'] to [1, 10], ['a','z'] to [11, 36] +% This is intended for alphebetically sorting string arrays numerically +% ascii_in [string array] +% output [double] +function out = ascii2num(ascii_in) + +ascii_vector = double(ascii_in); +out = 0; +% go through each character in the string and scale and add it to output +for val_count = 1:length(ascii_vector) + ascii_char = ascii_vector(val_count); + if ascii_char>=48 & ascii_char<=57 % ['0','9'] to [1, 10] + ascii_adj = ascii_char - 47; + elseif ascii_char>=65 & ascii_char<=90 % ['A','Z'] to [11, 36] + ascii_adj = ascii_char - 64; + elseif ascii_char>=97 & ascii_char<=122 % ['a','z'] to [11, 36] + ascii_adj = ascii_char - 96; + else ascii_adj = ascii_char; + end + out = out + ascii_adj/36^val_count; +end + + + + + + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_getica.m b/code/eeglab13_4_4b/functions/popfunc/eeg_getica.m new file mode 100644 index 0000000..4f71d63 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_getica.m @@ -0,0 +1,50 @@ +% eeg_getica() - get ICA component activation. Recompute if necessary. +% +% >> mergelocs = eeg_getica(EEG, comp); +% +% Inputs: +% EEG - EEGLAB dataset structure +% comp - component index +% +% Output: +% icaact - ICA component activity +% +% Author: Arnaud Delorme, 2006 + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function icaact = eeg_getica(EEG, comp) + + if nargin < 1 + help eeg_getica; + return; + end; + if nargin < 2 + comp = 1:size(EEG.icaweights,1); + end; + + if ~isempty(EEG.icaact) + icaact = EEG.icaact(comp,:,:); + else + disp('Recomputing ICA activations'); + if isempty(EEG.icachansind) + EEG.icachansind = 1:EEG.nbchan; + disp('Channels indices are assumed to be in regular order and arranged accordingly'); + end + icaact = (EEG.icaweights(comp,:)*EEG.icasphere)*reshape(EEG.data(EEG.icachansind,:,:), length(EEG.icachansind), EEG.trials*EEG.pnts); + icaact = reshape( icaact, size(icaact,1), EEG.pnts, EEG.trials); + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_insertbound.m b/code/eeglab13_4_4b/functions/popfunc/eeg_insertbound.m new file mode 100644 index 0000000..3b8295b --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_insertbound.m @@ -0,0 +1,178 @@ +% eeg_insertbound() - insert boundary event in an EEG event structure. +% +% Usage: +% >> [eventout indnew] = eeg_insertbound( eventin, pnts, ... +% abslatency, duration); +% Required Inputs: +% eventin - EEGLAB event structure (EEG.event) +% pnts - data points in EEG dataset (EEG.pnts * EEG.trials) +% abslatency - absolute latency of regions in original dataset. Can +% also be an array of [beg end] latencies with one row +% per region removed. Then 'lengths' argument is ignored. +% Optional Inputs: +% lengths - lengths of removed regions +% +% Outputs: +% eventout - EEGLAB event output structure with added boundaries +% indnew - array of indices returning new event index for any old +% (input eventin) event index +% Notes: +% This function performs the following: +% 1) add boundary events to the 'event' structure; +% remove nested boundaries; +% recompute the latencies of all events. +% 2) all latencies are given in (float) data points. +% e.g., a latency of 2000.3 means 0.3 samples (at EEG.srate) +% after the 2001st data frame (since first frame has latency 0). +% +% Author: Arnaud Delorme and Hilit Serby, SCCN, INC, UCSD, April, 19, 2004 +% +% See also: eeg_eegrej(), pop_mergeset() + +% Copyright (C) 2004 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [eventout,indnew] = eeg_insertbound( eventin, pnts, regions, lengths); + + if nargin < 3 + help eeg_insertbound; + return; + end; + if size(regions,2) ~= 1 & exist('lengths') ~= 1 + lengths = regions(:,2)-regions(:,1)+1; + regions = regions(:,1); + end; + if exist('lengths') ~= 1 + lengths = zeros(size(regions)); + end; + + if length(regions) + fprintf('eeg_insertbound(): %d boundary (break) events added.\n', size(regions, 1)); + else + return; + end; + + % recompute latencies of boundevents (in new dataset) + % --------------------------------------------------- + [regions tmpsort] = sort(regions); + lengths = lengths(tmpsort); + boundevents = regions(:,1)-0.5; + + % sort boundevents by decreasing order (otherwise bug in new event index) + % ------------------------------------ + boundevents = boundevents(end:-1:1); + lengths = lengths (end:-1:1); + eventout = eventin; + indnew = 1:length(eventin); + allnest = []; + countrm = 0; + for tmpindex = 1:length(boundevents) % sorted in decreasing order + if boundevents(tmpindex) >= 0.5 & boundevents(tmpindex) <= pnts + + % find event succeding boundary to insert event + % at the correct location in the event structure + % ---------------------------------------------- + if ~isempty(eventout) & isfield(eventout, 'latency') + alllats = [ eventout.latency ] - boundevents(tmpindex); + tmpind = find( alllats >= 0 ); + [tmp tmpind2 ] = min(alllats(tmpind)); + tmpind2 = tmpind(tmpind2); + else + tmpind2 = []; + end; + + % insert event at tmpind2 + % ----------------------- + if ~isempty(tmpind2) + eventout(end+1).type = 'boundary'; + tmp = eventout(end); + eventout(tmpind2+1:end) = eventout(tmpind2:end-1); + eventout(tmpind2) = tmp; + indnew(tmpind2:end) = indnew(tmpind2:end)+1; + else + tmpind2 = length(eventout)+1; + eventout(tmpind2).type = 'boundary'; + end; + eventout(tmpind2).latency = boundevents(tmpindex); + eventout(tmpind2).duration = lengths(tmpindex); % just to create field + + [ tmpnest addlength ] = findnested(eventout, tmpind2); + + % recompute latencies and remove events in the rejected region + % ------------------------------------------------------------ + eventout(tmpnest) = []; + countrm = countrm+length(tmpnest); + for latind = tmpind2+1:length(eventout) + eventout(latind).latency = eventout(latind).latency-lengths(tmpindex); + end; + + % add lengths of previous events (must be done after above) + % --------------------------------------------------------- + eventout(tmpind2).duration = lengths(tmpindex)+addlength; + if eventout(tmpind2).duration == 0, eventout(tmpind2).duration=NaN; end; + + end; + end; + + if countrm > 0 + fprintf('eeg_insertbound(): event latencies recomputed and %d events removed.\n', countrm); + end; + + +% look for nested events +% retrun indices of nested events and +% their total length +% ----------------------------------- +function [ indnested, addlen ] = findnested(event, ind); + indnested = []; + addlen = 0; + tmpind = ind+1; + + while tmpind <= length(event) & ... + event(tmpind).latency < event(ind).latency+event(ind).duration + if strcmpi(event(tmpind).type, 'boundary') + if ~isempty( event(tmpind).duration ) + addlen = addlen + event(tmpind).duration; + % otherwise old event duration or merge data discontinuity + end; + end; + indnested = [ indnested tmpind ]; + tmpind = tmpind+1; + end; + +% remove urevent and recompute indices +% THIS FUNCTION IS DEPRECATED +% ------------------------------------ +function [event, urevent] = removenested(event, urevent, nestind); + + if length(nestind) > 0 + fprintf('eeg_insertbound() debug msg: removing %d nested urevents\n', length(nestind)); + nestind = sort(nestind); + urind = [ event.urevent ]; % this must not be done in the loop + % since the indices are dyanmically updated + end; + + for ind = 1:length(nestind) + % find event urindices higher than the urevent to suppress + % -------------------------------------------------------- + tmpind = find( urind > nestind(ind) ); + for indevent = tmpind + event(indevent).urevent = event(indevent).urevent-1; + end; + end; + + urevent(nestind) = []; + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_interp.m b/code/eeglab13_4_4b/functions/popfunc/eeg_interp.m new file mode 100644 index 0000000..b616c97 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_interp.m @@ -0,0 +1,351 @@ + % eeg_interp() - interpolate data channels +% +% Usage: EEGOUT = eeg_interp(EEG, badchans, method); +% +% Inputs: +% EEG - EEGLAB dataset +% badchans - [integer array] indices of channels to interpolate. +% For instance, these channels might be bad. +% [chanlocs structure] channel location structure containing +% either locations of channels to interpolate or a full +% channel structure (missing channels in the current +% dataset are interpolated). +% method - [string] method used for interpolation (default is 'spherical'). +% 'invdist'/'v4' uses inverse distance on the scalp +% 'spherical' uses superfast spherical interpolation. +% 'spacetime' uses griddata3 to interpolate both in space +% and time (very slow and cannot be interupted). +% Output: +% EEGOUT - data set with bad electrode data replaced by +% interpolated data +% +% Author: Arnaud Delorme, CERCO, CNRS, Mai 2006- + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = eeg_interp(ORIEEG, bad_elec, method) + + if nargin < 2 + help eeg_interp; + return; + end; + EEG = ORIEEG; + + if nargin < 3 + disp('Using spherical interpolation'); + method = 'spherical'; + end; + + % check channel structure + tmplocs = ORIEEG.chanlocs; + if isempty(tmplocs) || isempty([tmplocs.X]) + error('Interpolation require channel location'); + end; + + if isstruct(bad_elec) + + % add missing channels in interpolation structure + % ----------------------------------------------- + lab1 = { bad_elec.labels }; + tmpchanlocs = EEG.chanlocs; + lab2 = { tmpchanlocs.labels }; + [tmp tmpchan] = setdiff_bc( lab2, lab1); + tmpchan = sort(tmpchan); + if ~isempty(tmpchan) + newchanlocs = []; + fields = fieldnames(bad_elec); + for index = 1:length(fields) + if isfield(bad_elec, fields{index}) + for cind = 1:length(tmpchan) + fieldval = getfield( EEG.chanlocs, { tmpchan(cind) }, fields{index}); + newchanlocs = setfield(newchanlocs, { cind }, fields{index}, fieldval); + end; + end; + end; + newchanlocs(end+1:end+length(bad_elec)) = bad_elec; + bad_elec = newchanlocs; + end; + if length(EEG.chanlocs) == length(bad_elec), return; end; + + lab1 = { bad_elec.labels }; + tmpchanlocs = EEG.chanlocs; + lab2 = { tmpchanlocs.labels }; + [tmp badchans] = setdiff_bc( lab1, lab2); + fprintf('Interpolating %d channels...\n', length(badchans)); + if length(badchans) == 0, return; end; + goodchans = sort(setdiff(1:length(bad_elec), badchans)); + + % re-order good channels + % ---------------------- + [tmp1 tmp2 neworder] = intersect_bc( lab1, lab2 ); + [tmp1 ordertmp2] = sort(tmp2); + neworder = neworder(ordertmp2); + EEG.data = EEG.data(neworder, :, :); + + % looking at channels for ICA + % --------------------------- + %[tmp sorti] = sort(neworder); + %{ EEG.chanlocs(EEG.icachansind).labels; bad_elec(goodchans(sorti(EEG.icachansind))).labels } + + % update EEG dataset (add blank channels) + % --------------------------------------- + if ~isempty(EEG.icasphere) + + [tmp sorti] = sort(neworder); + EEG.icachansind = sorti(EEG.icachansind); + EEG.icachansind = goodchans(EEG.icachansind); + EEG.chaninfo.icachansind = EEG.icachansind; + + % TESTING SORTING + %icachansind = [ 3 4 5 7 8] + %data = round(rand(8,10)*10) + %neworder = shuffle(1:8) + %data2 = data(neworder,:) + %icachansind2 = sorti(icachansind) + %data(icachansind,:) + %data2(icachansind2,:) + end; + % { EEG.chanlocs(neworder).labels; bad_elec(sort(goodchans)).labels } + %tmpdata = zeros(length(bad_elec), size(EEG.data,2), size(EEG.data,3)); + %tmpdata(goodchans, :, :) = EEG.data; + + % looking at the data + % ------------------- + %tmp1 = mattocell(EEG.data(sorti,1)); + %tmp2 = mattocell(tmpdata(goodchans,1)); + %{ EEG.chanlocs.labels; bad_elec(goodchans).labels; tmp1{:}; tmp2{:} } + %EEG.data = tmpdata; + + EEG.chanlocs = bad_elec; + + else + badchans = bad_elec; + goodchans = setdiff_bc(1:EEG.nbchan, badchans); + oldelocs = EEG.chanlocs; + EEG = pop_select(EEG, 'nochannel', badchans); + EEG.chanlocs = oldelocs; + disp('Interpolating missing channels...'); + end; + + % find non-empty good channels + % ---------------------------- + origoodchans = goodchans; + chanlocs = EEG.chanlocs; + nonemptychans = find(~cellfun('isempty', { chanlocs.theta })); + [tmp indgood ] = intersect_bc(goodchans, nonemptychans); + goodchans = goodchans( sort(indgood) ); + datachans = getdatachans(goodchans,badchans); + badchans = intersect_bc(badchans, nonemptychans); + if isempty(badchans), return; end; + + % scan data points + % ---------------- + if strcmpi(method, 'spherical') + % get theta, rad of electrodes + % ---------------------------- + tmpgoodlocs = EEG.chanlocs(goodchans); + xelec = [ tmpgoodlocs.X ]; + yelec = [ tmpgoodlocs.Y ]; + zelec = [ tmpgoodlocs.Z ]; + rad = sqrt(xelec.^2+yelec.^2+zelec.^2); + xelec = xelec./rad; + yelec = yelec./rad; + zelec = zelec./rad; + tmpbadlocs = EEG.chanlocs(badchans); + xbad = [ tmpbadlocs.X ]; + ybad = [ tmpbadlocs.Y ]; + zbad = [ tmpbadlocs.Z ]; + rad = sqrt(xbad.^2+ybad.^2+zbad.^2); + xbad = xbad./rad; + ybad = ybad./rad; + zbad = zbad./rad; + + EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts*EEG.trials); + %[tmp1 tmp2 tmp3 tmpchans] = spheric_spline_old( xelec, yelec, zelec, EEG.data(goodchans,1)); + %max(tmpchans(:,1)), std(tmpchans(:,1)), + %[tmp1 tmp2 tmp3 EEG.data(badchans,:)] = spheric_spline( xelec, yelec, zelec, xbad, ybad, zbad, EEG.data(goodchans,:)); + [tmp1 tmp2 tmp3 badchansdata] = spheric_spline( xelec, yelec, zelec, xbad, ybad, zbad, EEG.data(datachans,:)); + %max(EEG.data(goodchans,1)), std(EEG.data(goodchans,1)) + %max(EEG.data(badchans,1)), std(EEG.data(badchans,1)) + EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts, EEG.trials); + elseif strcmpi(method, 'spacetime') % 3D interpolation, works but x10 times slower + disp('Warning: if processing epoch data, epoch boundary are ignored...'); + disp('3-D interpolation, this can take a long (long) time...'); + tmpgoodlocs = EEG.chanlocs(goodchans); + tmpbadlocs = EEG.chanlocs(badchans); + [xbad ,ybad] = pol2cart([tmpbadlocs.theta],[tmpbadlocs.radius]); + [xgood,ygood] = pol2cart([tmpgoodlocs.theta],[tmpgoodlocs.radius]); + pnts = size(EEG.data,2)*size(EEG.data,3); + zgood = [1:pnts]; + zgood = repmat(zgood, [length(xgood) 1]); + zgood = reshape(zgood,prod(size(zgood)),1); + xgood = repmat(xgood, [1 pnts]); xgood = reshape(xgood,prod(size(xgood)),1); + ygood = repmat(ygood, [1 pnts]); ygood = reshape(ygood,prod(size(ygood)),1); + tmpdata = reshape(EEG.data, prod(size(EEG.data)),1); + zbad = 1:pnts; + zbad = repmat(zbad, [length(xbad) 1]); + zbad = reshape(zbad,prod(size(zbad)),1); + xbad = repmat(xbad, [1 pnts]); xbad = reshape(xbad,prod(size(xbad)),1); + ybad = repmat(ybad, [1 pnts]); ybad = reshape(ybad,prod(size(ybad)),1); + badchansdata = griddata3(ygood, xgood, zgood, tmpdata,... + ybad, xbad, zbad, 'nearest'); % interpolate data + else + % get theta, rad of electrodes + % ---------------------------- + tmpchanlocs = EEG.chanlocs; + [xbad ,ybad] = pol2cart([tmpchanlocs( badchans).theta],[tmpchanlocs( badchans).radius]); + [xgood,ygood] = pol2cart([tmpchanlocs(goodchans).theta],[tmpchanlocs(goodchans).radius]); + + fprintf('Points (/%d):', size(EEG.data,2)*size(EEG.data,3)); + badchansdata = zeros(length(badchans), size(EEG.data,2)*size(EEG.data,3)); + + for t=1:(size(EEG.data,2)*size(EEG.data,3)) % scan data points + if mod(t,100) == 0, fprintf('%d ', t); end; + if mod(t,1000) == 0, fprintf('\n'); end; + + %for c = 1:length(badchans) + % [h EEG.data(badchans(c),t)]= topoplot(EEG.data(goodchans,t),EEG.chanlocs(goodchans),'noplot', ... + % [EEG.chanlocs( badchans(c)).radius EEG.chanlocs( badchans(c)).theta]); + %end; + tmpdata = reshape(EEG.data, size(EEG.data,1), size(EEG.data,2)*size(EEG.data,3) ); + if strcmpi(method, 'invdist'), method = 'v4'; end; + [Xi,Yi,badchansdata(:,t)] = griddata(ygood, xgood , double(tmpdata(datachans,t)'),... + ybad, xbad, method); % interpolate data + end + fprintf('\n'); + end; + + tmpdata = zeros(length(bad_elec), EEG.pnts, EEG.trials); + tmpdata(origoodchans, :,:) = EEG.data; + %if input data are epoched reshape badchansdata for Octave compatibility... + if length(size(tmpdata))==3 + badchansdata = reshape(badchansdata,length(badchans),size(tmpdata,2),size(tmpdata,3)); + end + tmpdata(badchans,:,:) = badchansdata; + EEG.data = tmpdata; + EEG.nbchan = size(EEG.data,1); + EEG = eeg_checkset(EEG); + +% get data channels +% ----------------- +function datachans = getdatachans(goodchans, badchans); + datachans = goodchans; + badchans = sort(badchans); + for index = length(badchans):-1:1 + datachans(find(datachans > badchans(index))) = datachans(find(datachans > badchans(index)))-1; + end; + +% ----------------- +% spherical splines +% ----------------- +function [x, y, z, Res] = spheric_spline_old( xelec, yelec, zelec, values); + +SPHERERES = 20; +[x,y,z] = sphere(SPHERERES); +x(1:(length(x)-1)/2,:) = []; x = [ x(:)' ]; +y(1:(length(y)-1)/2,:) = []; y = [ y(:)' ]; +z(1:(length(z)-1)/2,:) = []; z = [ z(:)' ]; + +Gelec = computeg(xelec,yelec,zelec,xelec,yelec,zelec); +Gsph = computeg(x,y,z,xelec,yelec,zelec); + +% equations are +% Gelec*C + C0 = Potential (C unknow) +% Sum(c_i) = 0 +% so +% [c_1] +% * [c_2] +% [c_ ] +% xelec [c_n] +% [x x x x x] [potential_1] +% [x x x x x] [potential_ ] +% [x x x x x] = [potential_ ] +% [x x x x x] [potential_4] +% [1 1 1 1 1] [0] + +% compute solution for parameters C +% --------------------------------- +meanvalues = mean(values); +values = values - meanvalues; % make mean zero +C = pinv([Gelec;ones(1,length(Gelec))]) * [values(:);0]; + +% apply results +% ------------- +Res = zeros(1,size(Gsph,1)); +for j = 1:size(Gsph,1) + Res(j) = sum(C .* Gsph(j,:)'); +end +Res = Res + meanvalues; +Res = reshape(Res, length(x(:)),1); + +function [xbad, ybad, zbad, allres] = spheric_spline( xelec, yelec, zelec, xbad, ybad, zbad, values); + +newchans = length(xbad); +numpoints = size(values,2); + +%SPHERERES = 20; +%[x,y,z] = sphere(SPHERERES); +%x(1:(length(x)-1)/2,:) = []; xbad = [ x(:)']; +%y(1:(length(x)-1)/2,:) = []; ybad = [ y(:)']; +%z(1:(length(x)-1)/2,:) = []; zbad = [ z(:)']; + +Gelec = computeg(xelec,yelec,zelec,xelec,yelec,zelec); +Gsph = computeg(xbad,ybad,zbad,xelec,yelec,zelec); + +% compute solution for parameters C +% --------------------------------- +meanvalues = mean(values); +values = values - repmat(meanvalues, [size(values,1) 1]); % make mean zero + +values = [values;zeros(1,numpoints)]; +C = pinv([Gelec;ones(1,length(Gelec))]) * values; +clear values; +allres = zeros(newchans, numpoints); + +% apply results +% ------------- +for j = 1:size(Gsph,1) + allres(j,:) = sum(C .* repmat(Gsph(j,:)', [1 size(C,2)])); +end +allres = allres + repmat(meanvalues, [size(allres,1) 1]); + +% compute G function +% ------------------ +function g = computeg(x,y,z,xelec,yelec,zelec) + +unitmat = ones(length(x(:)),length(xelec)); +EI = unitmat - sqrt((repmat(x(:),1,length(xelec)) - repmat(xelec,length(x(:)),1)).^2 +... + (repmat(y(:),1,length(xelec)) - repmat(yelec,length(x(:)),1)).^2 +... + (repmat(z(:),1,length(xelec)) - repmat(zelec,length(x(:)),1)).^2); + +g = zeros(length(x(:)),length(xelec)); +%dsafds +m = 4; % 3 is linear, 4 is best according to Perrin's curve +for n = 1:7 + if ismatlab + L = legendre(n,EI); + else % Octave legendre function cannot process 2-D matrices + for icol = 1:size(EI,2) + tmpL = legendre(n,EI(:,icol)); + if icol == 1, L = zeros([ size(tmpL) size(EI,2)]); end; + L(:,:,icol) = tmpL; + end; + end; + g = g + ((2*n+1)/(n^m*(n+1)^m))*squeeze(L(1,:,:)); +end +g = g/(4*pi); + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_laplac.m b/code/eeglab13_4_4b/functions/popfunc/eeg_laplac.m new file mode 100644 index 0000000..e363806 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_laplac.m @@ -0,0 +1,158 @@ +% eeg_laplac() - gives the laplacian for the data contained in EEG +% for the values 1:stepl:end with electrodes position gived by EEG.chanlocs. +% Step must be a number betwen 1 and length(EEG.data) +% The metod used for computig the laplacian is the described by Perrin et al. +% 1989 using a spline interpolation between the electrodes. This function +% requires the functions g2() and gm_1() to be in the path or in the same dir. +% Usage: +% >> [laplac time] = eeg_laplac(EEG, step); +% >> laplac = eeg_laplac(EEG, step); +% Inputs: +% EEG - A EEG structure containig the EEG.data an the EEG.chanlocs +% step - The step for subsampling the data +% +% Outputs: +% laplac - A matrix containig the value of laplacian for the data +% time - Time spent in calculation +% +% See also: del2map() +% +% Author: Juan Sebastian Gonzalez, DFI / Universidad de Chile +% +% Message from Jürgen Kayser, one of the main author of the CSD (Current +% Source Density) toolbox: "I do not find any differences between his Laplacian +% solution and our CSD transform (i.e., apart from the lack of a smoothing +% constant, the choice of the m constant, and the specific spherical locations +% assigned to any given electrode). Even more important would be a warning that +% the flexibility constant m is fixed at 3 (2 = max flexible, 3 = medium, +% 4=medium rigid, 5+=increasingly less flexible splines), which is a debatable +% choice and not recommended by us. The choice of the m constant (and the +% regulization or smoothing constant) should depend on the objective of the +% study." + +% Copyright (C)2006 Juan Sebastian Gonzalez, DFI / Universidad de Chile +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [laplac, time] = eeg_laplac(EEG, paso) + +if nargin < 2 + help eeg_laplac; + return; +end; + +tic +n = length(EEG.data(:,1)); +a = zeros(n,3); +g = zeros(n); +for i=1:n + a(i,1)=EEG.chanlocs(i).sph_phi; + a(i,2)=EEG.chanlocs(i).sph_theta; +end +V = zeros(1,n+1); +aux = a*pi/180; +matriz_g = zeros(n+1); +for i=1:n + matriz_g(i,1:n) = g2(aux(i,1)*ones(n,1),aux(i,2)*ones(n,1),aux(:,1),aux(:,2)); + g(i,:) = gm_1(aux(i,1)*ones(n,1),aux(i,2)*ones(n,1),aux(:,1),aux(:,2)); +end +matriz_g(:,n+1) = 1; +matriz_g(n+1,:) = 1; +inv_m = inv(matriz_g); +k = 1; +largo = length(EEG.data(1,:)); +laplac = zeros(n,round((largo-1)/paso)); +for j=1:paso:largo + % ciclo para sacar los anglos phi y theta en grados + for i=1:n + V(i) = EEG.data(i,j); + end + % calculo la constante a partir de la matriz invertida + constant = inv_m*V'; + % una vez que tengo las constantes, calculo el laplaciano segun la formula + % de perrin 89 corregida + for i=1:n + laplac(i,k) = g(i,:)*constant(1:n); + end + k = k + 1; +end +time = toc; +%--------------------------------------------------------------------- +% internal functions g2 gm_1 +function valor=g2(r1,r2,r3,r4) +%g entrega la sumatoria hasta 7 con m=3 de la ec. (2) de la tecnical note del +%Electrical Geodesics, salvo que esta esta bien + +x=cos(r1).*cos(r2).*cos(r3).*cos(r4) + ... + cos(r1).*sin(r2).*cos(r3).*sin(r4) + ... + sin(r1).*sin(r3); +L = length(x); +for i=1:L + if x(i) > 1 + x(i) = 1; + + elseif x(i) < -1 + x(i) = -1; + + end +end + +P = zeros(25,length(x)); +for n=1:25 + aux = legendre(n,x); % calculo los polinomios de legendre de orden n % + P(n,:) = aux(1,:); % tomo el que me sirve % +end + +n = 1:25; + +for i=1:25 + aux2(i,:) = ((2*n(i)+1)./(n(i).*(n(i)+1)).^3)*ones(1,L); +end + valor = 1/4/pi*sum(aux2.*P); + %----------------------------------------------------- +function valor=gm_1(r1,r2,r3,r4) +%g entrega la sumatoria hasta 7 con m=3 de la ec. (2) de la tecnical note del +%Electrical Geodesics + +x=cos(r1).*cos(r2).*cos(r3).*cos(r4) + ... + cos(r1).*sin(r2).*cos(r3).*sin(r4) + ... + sin(r1).*sin(r3); +L = length(x); +for i=1:L + if x(i) > 1 + x(i) = 1; + + elseif x(i) < -1 + x(i) = -1; + + end +end +P = zeros(25,length(x)); +for n=1:25 + aux=legendre(n,x); + P(n,:)=aux(1,:); +end + +n=1:25; +%el problema es calcular esto para cada columna...sin hacer un for +%respuesta, hacer for de 7 vueltas jajaj +for i=1:25 + aux2(i,:)=(2*n(i)+1)/(n(i)*(n(i)+1))^2*ones(1,L); +end + + valor=1/4/pi*sum(aux2.*P); + + + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_lat2point.m b/code/eeglab13_4_4b/functions/popfunc/eeg_lat2point.m new file mode 100644 index 0000000..ef78252 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_lat2point.m @@ -0,0 +1,105 @@ +% eeg_lat2point() - convert latencies in time units relative to the +% time locking event of an eeglab() data epoch to +% latencies in data points (assuming concatenated epochs). +% Usage: +% >> [newlat] = eeg_lat2point( lat_array, epoch_array,... +% srate, timelimits, timeunit); +% >> [newlat] = eeg_lat2point( lat_array, epoch_array,... +% srate, timelimits, '','outrange',1); +% Inputs: +% lat_array - latency array in 'timeunit' units (see below) +% epoch_array - epoch number for each latency +% srate - data sampling rate in Hz +% timelimits - [min max] epoch timelimits in 'timeunit' units (see below) +% timeunit - time unit relative to seconds. Default is 1 = seconds. +% +% Optional inputs: +% outrange - [1/0] Replace the points out of the range with the value of +% the maximun point in the valid range or raise an error. +% Default [1] : Replace point. +% +% Outputs: +% newlat - converted latency values in points assuming concatenated +% data epochs (see eeglab() event structure) +% flag - 1 if any point out of range was replaced. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2 Mai 2002 +% +% See also: eeg_point2lat(), eeglab() + +% Copyright (C) 2 Mai 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [newlat,flag] = eeg_lat2point( lat_array, epoch_array, srate, timewin, timeunit, varargin); +% ------------------------------------------------------------------------- +try + options = varargin; + if ~isempty( varargin ), + for i = 1:2:numel(options) + g.(options{i}) = options{i+1}; + end + else g= []; end; +catch + error('std_checkdatasession() error: calling convention {''key'', value, ... } error'); +end; + try, g.outrange; catch, g.outrange = 1; end; % + + flag = 0; +% ------------------------------------------------------------------------- + +if nargin <4 + help eeg_lat2point; + return; +end; +if nargin <5 | isempty(timeunit) + timeunit = 1; +end; + +if length(lat_array) ~= length(epoch_array) + if length(epoch_array)~= 1 + disp('eeg_lat2point: latency and epochs must have the same length'); return; + else + epoch_array = ones(1,length(lat_array))*epoch_array; + end; +end; +if length(timewin) ~= 2 + disp('eeg_lat2point: timelimits must have length 2'); return; +end; +if iscell(epoch_array) + epoch_array = [ epoch_array{:} ]; +end; +if iscell(lat_array) + lat_array = [ lat_array{:} ]; +end + +timewin = timewin*timeunit; +pnts = (timewin(2)-timewin(1))*srate+1; +newlat = (lat_array*timeunit-timewin(1))*srate+1 + (epoch_array-1)*pnts; + +% Detecting points out of range (RMC) +% Note: This is neccesary since the double precision multiplication could lead to the +% shifting in one sample out of the valid range + +if and(~isempty(newlat),~isempty(epoch_array)) && max(newlat(:)) > max((epoch_array)*pnts) + if g.outrange == 1 + IndxOut = find(newlat(:) > max((epoch_array)*pnts)); + newlat(IndxOut) = max((epoch_array)*pnts); + flag = 1; + warning('eeg_lat2point(): Points out of range detected. Points replaced with maximum value'); + elseif g.outrange == 0 + error('Error in eeg_lat2point(): Points out of range detected'); + end +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_latencyur.m b/code/eeglab13_4_4b/functions/popfunc/eeg_latencyur.m new file mode 100644 index 0000000..3eba75f --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_latencyur.m @@ -0,0 +1,82 @@ +% eeg_latencyur() - transform latency of sample point in the continuous +% data into latencies in the transformed dataset. +% +% Usage: +% >> lat_out = eeg_latencyur( events, lat_in); +% +% Inputs: +% events - event structure. If this structure contain boundary +% events, the length of these events is added to restore +% the original latency from the relative latency in 'lat_in' +% lat_in - sample latency (in point) in the original urEEG. +% +% Outputs: +% lat_out - output latency +% +% Note: the function that finds the original (ur) latency in the original +% dataset using latencies in the current dataset is called +% eeg_urlatency() +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2011- +% +% See also: eeg_urlatency() + +% Copyright (C) 2011 Arnaud Delorme, SCCN, INC, UCSD, arno@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function latout = eeg_latencyur( events, latin ); + + if nargin < 2 + help eeg_latencyur; + return; + end; + + boundevents = { events.type }; + latout = latin; + if ~isempty(boundevents) & isstr(boundevents{1}) + indbound = strmatch('boundary', boundevents); + + if isfield(events, 'duration') & ~isempty(indbound) + for index = indbound' + lowerVals = find(latout > events(index).latency); + latout(lowerVals) = latout(lowerVals)-events(index).duration; + end; + end; + end; + return; + + % build array of 0 and 1 (0 no data) + boundevents = { events.type }; + latout = latin; + if ~isempty(boundevents) & isstr(boundevents{1}) + indbound = strmatch('boundary', boundevents); + + if isfield(events, 'duration') & ~isempty(indbound) + currentadd = 0; + points = ones(1, events(end).latency+sum([events(indbound').duration])); % arrays of 1 + for index = indbound' + currentlat = events(index).latency+currentadd; + currentdur = events(index).duration; + points(round(currentlat):round(currentlat+currentdur)) = 0; + currentadd = currentadd + currentdur; + end; + end; + end; + 8; + + + + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_matchchans.m b/code/eeglab13_4_4b/functions/popfunc/eeg_matchchans.m new file mode 100644 index 0000000..1d4c7a6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_matchchans.m @@ -0,0 +1,134 @@ +% eeg_matchchans() - find closest channels in a larger EEGLAB chanlocs structure +% to channels in a smaller chanlocs structure +% Usage: +% >> [selchans,distances,selocs] = eeg_matchchans(BIGlocs,smalllocs,'noplot'); +% Inputs: +% BIGlocs - larger (or equal-sized) EEG.chanlocs structure array +% smalllocs - smaller (or equal-sized) EEG.chanlocs structure array +% Optional inputs: +% 'noplot' - [optional string 'noplot'] -> do not produce plots {default: +% produce illustrative plots of the BIG and small locations} +% Outputs: +% selchans - indices of BIGlocs channels closest to the smalllocs channels +% distances - vector of distances between the selected BIGlocs and smalllocs chans +% selocs - EEG.chanlocs structure array containing nearest BIGlocs channels +% to each smalllocs channel: 1, 2, 3,... n. This structure has +% two extra fields: +% bigchan - original channel index in BIGlocs +% bigdist - distance between bigchan and smalllocs chan +% ==> bigdist assumes both input locs have sph_radius 1. +% +% Author: Scott Makeig, SCCN/INC/UCSD, April 9, 2004 + +% Copyright (C) 2004 Scott Makeig, SCCN/INC/UCSD, smakeig@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% History: began Jan 27, 2004 as selectchans.m(?) -sm + +function [selchans,dists,selocs] = eeg_matchchans(bglocs,ltlocs,noplot) + +if nargin < 2 + help eeg_matchchans + return +end +no_plot = 0; % yes|no flag +if nargin > 2 & strcmp(lower(noplot),'noplot') + no_plot = 1; +end + +if ~isstruct(bglocs) | ~isstruct(ltlocs) + help eeg_matchchans +end + +ltchans = length(ltlocs); +bgchans = length(bglocs); +if ltchans > bgchans + fprintf('BIGlocs chans (%d) < smalllocs chans (%d)\n',bgchans,ltchans); + return +end +selchans = zeros(ltchans,1); +dists = zeros(ltchans,1); +bd = zeros(bgchans,1); +% +%%%%%%%%%%%%%%%%% Compute the distances %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +fprintf('BIG ltl Dist\n'); +for c=1:ltchans + for C=1:bgchans + if ~isempty(ltlocs(c).X) & ~isempty(bglocs(C).X) + bd(C) = sqrt((ltlocs(c).X/ltlocs(c).sph_radius - bglocs(C).X/bglocs(C).sph_radius)^2 + ... + (ltlocs(c).Y/ltlocs(c).sph_radius - bglocs(C).Y/bglocs(C).sph_radius)^2 + ... + (ltlocs(c).Z/ltlocs(c).sph_radius - bglocs(C).Z/bglocs(C).sph_radius)^2); + end + end + % + %%%%%%%%%%%%%%%%% Find the nearest BIGlocs channel %%%%%%%%%%%%%%%%%%%%%%% + % + [bd ix] = sort(bd); % find smallest distance c <-> C + bglocs(1).bigchan = []; + k=1; + while ~isempty(bglocs(ix(k)).bigchan) & k<=bgchans % avoid empty channels + k=k+1; + end + if k>bgchans + fprintf('No match found for smalllocs channel %d - error!?\n',c); + return % give up - should not reach here! + end + while k1 & sum(ismember(ix(k),selchans(1:c-1)))>0 % avoid chans already chosen + k = k+1; + else + break + end + end + if k==length(ix) + fprintf('NO available nearby channel for littlechan %d - using %d\n',... + c,ix(k)); + end + selchans(c) = ix(k); % note the nearest BIGlocs channel + dists(c) = bd(k); % note its distance + bglocs(ix(k)).bigchan = selchans(c); % add this info to the output + bglocs(ix(k)).bigdist = dists(c); + fprintf('.bigchan %4d, c %4d, k %d, .bigdist %3.2f\n',... + bglocs(ix(k)).bigchan,c,k,bglocs(ix(k)).bigdist); % commandline printout +end; % c +selocs = bglocs(selchans); % return the selected BIGlocs struct array subset +% +%%%%%%%%%%%%%%%%% Plot the results %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~no_plot + figure; + titlestring = sprintf('%d-channel subset closest to %d channel locations',ltchans,bgchans); + tl=textsc(titlestring,'title'); + set(tl,'fontweight','bold'); + set(tl,'fontsize',15); + sbplot(7,2,[3 13]); + hist(dists,length(dists)); + title('Distances between corresponding channels'); + xlabel('Euclidian distance (sph. rad. 1)'); + ylabel('Number of channels'); + + sbplot(7,5,[8,35]); + topoplot(dists,selocs,'electrodes','numbers','style','both'); + title('Distances'); + clen = size(colormap,1); + sbnull = sbplot(7,2,[10 12]) + cb=cbar; + cbar(cb,[clen/2+1:clen]); + set(sbnull,'visible','off') + + axcopy; % turn on axcopy +end diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_mergechan.m b/code/eeglab13_4_4b/functions/popfunc/eeg_mergechan.m new file mode 100644 index 0000000..a5c0734 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_mergechan.m @@ -0,0 +1,68 @@ +% eeg_mergechan() - merge channel structure while preserving channel +% order +% +% >> mergelocs = eeg_mergechan(locs1, locs2); +% +% Inputs: +% locs1 - EEGLAB channel location structure +% locs2 - second EEGLAB channel location structure +% +% Output: +% mergelocs - merged channel location structure +% +% Author: Arnaud Delorme, August 2006 + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% union of two channel location structure +% without loosing the order information +% --------------------------------------- +function alllocs = myunion(locs1, locs2) + + labs1 = { locs1.labels }; + labs2 = { locs2.labels }; + + count1 = 1; + count2 = 1; + count3 = 1; + alllocs = locs1; alllocs(:) = []; + while count1 <= length(locs1) | count2 <= length(locs2) + + if count1 > length(locs1) + alllocs(count3) = locs2(count2); + count2 = count2 + 1; + count3 = count3 + 1; + elseif count2 > length(locs2) + alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count3 = count3 + 1; + elseif strcmpi(labs1{count1}, labs2{count2}) + alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count2 = count2 + 1; + count3 = count3 + 1; + elseif isempty(strmatch(labs1{count1}, labs2)) + alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count3 = count3 + 1; + else + alllocs(count3) = locs2(count2); + count2 = count2 + 1; + count3 = count3 + 1; + end; + + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_mergelocs.m b/code/eeglab13_4_4b/functions/popfunc/eeg_mergelocs.m new file mode 100644 index 0000000..2abd38a --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_mergelocs.m @@ -0,0 +1,124 @@ +% eeg_mergelocs() - merge channel structure while preserving channel +% order +% +% >> mergedlocs = eeg_mergelocs(loc1, loc2, loc3, ...); +% +% Inputs: +% loc1 - EEGLAB channel location structure +% loc2 - second EEGLAB channel location structure +% +% Output: +% mergedlocs - merged channel location structure +% warning - [0|1] dissimilar structures found (0=false, 1=true) +% +% Author: Arnaud Delorme, August 2006 + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [alllocs warn] = eeg_mergelocs(varargin) + +persistent warning_shown; +warn = 0; + +try + % sort by length + % -------------- + len = cellfun(@length, varargin); + [tmp so] = sort(len, 2, 'descend'); + varargin = varargin(so); + + alllocs = varargin{1}; + for index = 2:length(varargin) + + % fuse while preserving order (assumes the same channel order) + % ------------------------------------------------------------ + tmplocs = varargin{index}; + newlocs = myunion(alllocs, tmplocs); + + if length(newlocs) > length(union({ alllocs.labels }, { tmplocs.labels })) + + warn = 1; + if isempty(warning_shown) + disp('Warning: different channel montage or electrode order for the different datasets'); + warning_shown = 1; + end; + + % trying to preserve order of the longest array + %---------------------------------------------- + if length(alllocs) < length(tmplocs) + tmp = alllocs; + alllocs = tmplocs; + tmplocs = tmp; + end; + allchans = { alllocs.labels tmplocs.labels }; + [uniquechan ord1 ord2 ] = unique_bc( allchans ); + + [tmp rminds] = intersect_bc( uniquechan, { alllocs.labels }); + ord1(rminds) = []; + tmplocsind = ord1-length(alllocs); + + newlocs = [ alllocs tmplocs(tmplocsind) ]; + + end; + alllocs = newlocs; + end; +catch, + % temporary fix for dissimilar structures + % should check channel structure consistency instead + % using checkchan function + disp('Channel merging warning: dissimilar fields in the two structures'); + [alllocs warn ] = eeg_mergelocs_diffstruct(varargin{:}); +end; + +% union of two channel location structure +% without loosing the order information +% --------------------------------------- +function alllocs = myunion(locs1, locs2) + + labs1 = { locs1.labels }; + labs2 = { locs2.labels }; + + count1 = 1; + count2 = 1; + count3 = 1; + alllocs = locs1; alllocs(:) = []; + while count1 <= length(locs1) || count2 <= length(locs2) + + if count1 > length(locs1) + alllocs(count3) = locs2(count2); + count2 = count2 + 1; + count3 = count3 + 1; + elseif count2 > length(locs2) + alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count3 = count3 + 1; + elseif strcmpi(labs1{count1}, labs2{count2}) + alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count2 = count2 + 1; + count3 = count3 + 1; + elseif isempty(strmatch(labs1{count1}, labs2, 'exact')) + alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count3 = count3 + 1; + else + alllocs(count3) = locs2(count2); + count2 = count2 + 1; + count3 = count3 + 1; + end; + + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_mergelocs_diffstruct.m b/code/eeglab13_4_4b/functions/popfunc/eeg_mergelocs_diffstruct.m new file mode 100644 index 0000000..7f1014f --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_mergelocs_diffstruct.m @@ -0,0 +1,156 @@ +% eeg_mergelocs() - merge channel structure while preserving channel +% order +% +% >> mergedlocs = eeg_mergelocs(loc1, loc2, loc3, ...); +% +% Inputs: +% loc1 - EEGLAB channel location structure +% loc2 - second EEGLAB channel location structure +% +% Output: +% mergedlocs - merged channel location structure +% +% Author: Arnaud Delorme, August 2006 + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [alllocs warn] = eeg_mergelocs(varargin) + +persistent warning_shown; +warn = 0; + +% sort by length +% -------------- +len = cellfun(@length, varargin); +[tmp so] = sort(len, 2, 'descend'); +varargin = varargin(so); + +alllocs = varargin{1}; +for index = 2:length(varargin) + + % fuse while preserving order (assumes the same channel order) + % ------------------------------------------------------------ + tmplocs = varargin{index}; + newlocs = myunion(alllocs, tmplocs); + + if length(newlocs) > length(union({ alllocs.labels }, { tmplocs.labels })) + + warn = 1; + if isempty(warning_shown) + disp('Warning: different channel montage order for the different datasets'); + warning_shown = 1; + end; + + % trying to preserve order of the longest array + %---------------------------------------------- + if length(alllocs) < length(tmplocs) + tmp = alllocs; + alllocs = tmplocs; + tmplocs = tmp; + end; + allchans = { alllocs.labels tmplocs.labels }; + [uniquechan ord1 ord2 ] = unique_bc( allchans ); + + [tmp rminds] = intersect_bc( uniquechan, { alllocs.labels }); + ord1(rminds) = []; + tmplocsind = ord1-length(alllocs); + + newlocs = concatlocs(alllocs, tmplocs(tmplocsind)); + + end; + alllocs = newlocs; +end; + +% union of two channel location structure +% without loosing the order information +% --------------------------------------- +function alllocs = myunion(locs1, locs2) + + labs1 = { locs1.labels }; + labs2 = { locs2.labels }; + + count1 = 1; + count2 = 1; + count3 = 1; + alllocs = locs1; alllocs(:) = []; + while count1 <= length(locs1) | count2 <= length(locs2) + + if count1 > length(locs1) + alllocs = copyfields(alllocs, count3, locs2(count2)); + %alllocs(count3) = locs2(count2); + count2 = count2 + 1; + count3 = count3 + 1; + elseif count2 > length(locs2) + alllocs = copyfields(alllocs, count3, locs1(count1)); + %alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count3 = count3 + 1; + elseif strcmpi(labs1{count1}, labs2{count2}) + alllocs = copyfields(alllocs, count3, locs1(count1)); + %alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count2 = count2 + 1; + count3 = count3 + 1; + elseif isempty(strmatch(labs1{count1}, labs2, 'exact')) + alllocs = copyfields(alllocs, count3, locs1(count1)); + %alllocs(count3) = locs1(count1); + count1 = count1 + 1; + count3 = count3 + 1; + else + alllocs = copyfields(alllocs, count3, locs2(count2)); + %alllocs(count3) = locs2(count2); + count2 = count2 + 1; + count3 = count3 + 1; + end; + + end; + +% concatenate channel structures with different fields +function loc3 = concatlocs(loc1, loc2); + + fields1 = fieldnames(loc1); + fields2 = fieldnames(loc2); + if isequal(fields1, fields2) + % the try, catch clause is necessary + % below seems to be a Matlab bug + try, loc3 = [ loc1; loc2 ]; + catch + try loc3 = [ loc1 loc2 ]; + catch, loc3 = [ loc1(:)' loc2(:)' ]; + end; + end; + else + loc3 = loc1; + for index = 1:length(loc2) + loc3 = copyfields(loc3, length(loc1)+index, loc2(index)); + end; + end; + +% copy fields of a structure to another one +function [struct1] = copyfields(struct1, index1, struct2) + + fields1 = fieldnames(struct1); + fields2 = fieldnames(struct2); + + if isequal(fields1, fields2) + struct1(index1) = struct2; + else + for index = 1:length(fields2) + struct1 = setfield(struct1, {index1}, fields2{index}, getfield(struct2, fields2{index})); + end; + end; + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_multieegplot.m b/code/eeglab13_4_4b/functions/popfunc/eeg_multieegplot.m new file mode 100644 index 0000000..e520077 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_multieegplot.m @@ -0,0 +1,118 @@ +% eeg_multieegplot() - Produce an eegplot() of a the average of an epoched dataset +% (with optional pre-labelling of specific trials). +% Usage: +% >> eeg_multieegplot( data,trialrej, elecrej, ... +% 'key1', value, 'key2', value ... ); +% Inputs: +% data - input data (channels x points or channels x points x trials). +% trialrej - array of 0s and 1s (depicting rejected trials) (size sweeps) +% elecrej - array of 0s and 1s (depicting electrodes rejected in +% all trials) (size nbelectrodes x sweeps ) +% oldtrialrej - array of 0s and 1s (depicting rejected trials) (size sweeps) +% oldelecrej - array of 0s and 1s (depicting electrodes rejected in +% all trials) (size nbelectrodes x sweeps ) +% +% Note: 1) {'Key', value } Arguments are passed on to eegplot() +% 2) To ignore previous rejections simply set 'oldtrialrej' and +% 'oldelecrej' arguments to empty ([]). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eegplot(), eegplot2event(), eegplot2trial(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 corrected help -ad + +function eeg_multieegplot( data, rej, rejE, oldrej, oldrejE, varargin); + +if nargin < 1 + help eeg_multieegplot; + return; +end; +if nargin < 4 + oldrej = []; +end; +if nargin < 5 + oldrejE = []; +end; +if ~exist('command') + command = ''; +end; +chans = size(data,1); +pnts = size(data,2); + +colnew = [0.8 0.8 1]; +colold = [0.8 1 0.8]; + +if ndims(data) > 2 % --------------- considering epoched EEG data + rejeegplot = []; + % concatenate old rejection if not empty + % -------------------------------------- + if ~isempty( oldrej ) + oldrej = find( oldrej > 0); + oldrejE = oldrejE(:, oldrej)'; + rejeegplot = trial2eegplot( oldrej, oldrejE, pnts, colold); + end; + % convert for eegplot + % ------------------- + if ~isempty( rej ) + rej = find( rej > 0); + rejE = rejE(:,rej)'; + secondrejeegplot = trial2eegplot( rej, rejE, pnts, colnew); % see bottom of code for this function + rejeegplot = [ rejeegplot' secondrejeegplot' ]'; + + % remove duplicates + % ----------------- + %[tmp I] = unique_bc( rejeegplot(:,1) ); + %rejeegplot = rejeegplot(I,:); + end; +else % ---------------------------------------- considering continuous EEG + % for continuous EEG, electrodes (rejE and oldrejE) are not considered yet + % because there would be a format problem (these rejection are stored in + % the event array). + + rejeegplot = []; + if ~isempty(rej) %assuming nrejection x 2 (2 = begin end) + s = size(rej, 1); + rejeegplot = [ rej(3:4) colnew*ones(s,1) zeros(s, chans) ]; + end; + + % pooling previous rejections + if ~isempty(oldrej) + tmp = [ oldrej(:, 3:4) colold*ones(s,1) zeros(size(oldrej,1), chans) ]; + rejeegplot = [rejeegplot; tmp]; + end; +end; + +if isempty(varargin) + eegplot(data, 'winlength', 5, 'position', [100 300 800 500], 'winrej', rejeegplot, 'xgrid', 'off'); +else + eegplot(data, 'winlength', 5, 'position', [100 300 800 500], 'winrej', rejeegplot, 'xgrid', 'off', varargin{:} ); +end; +return; + +% convert eeglab format to eeplot format of rejection window +% ---------------------------------------------------------- +function rejeegplot = trial2eegplot( rej, rejE, pnts, color) + rejeegplot = zeros(length(rej), size(rejE,2)+5); + rejeegplot(:, 6:end) = rejE; + rejeegplot(:, 1) = (rej(:)-1)*pnts; + rejeegplot(:, 2) = rej(:)*pnts-1; + rejeegplot(:, 3:5) = ones(size(rejeegplot,1),1)*color; +return diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_oldica.m b/code/eeglab13_4_4b/functions/popfunc/eeg_oldica.m new file mode 100644 index 0000000..484f759 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_oldica.m @@ -0,0 +1,121 @@ +% eeg_oldica() - report, return or add to oldicaweights and oldicasphere +% stored in cell arrays in EEG.etc of an EEGLAB dataset +% Usage: +% >> eeg_oldica(EEG); % report number of stored oldicaweights +% >> [EEG,icaweights, icasphere] = eeg_oldica(EEG,N); % return matrices +% >> EEG = eeg_oldica(EEG,N,icaweights,icasphere); % add wts and sph +% % matrices to EEG.etc.icaweights and EEG.etc.icasphere +% Inputs: +% EEG - EEGLAB dataset structure +% nreturn - index of the oldicaweights and sphere to return {default: 1} +% icaweights - ICA weights matrix to store in EEG.etc.oldicaweights +% icasphere - ICA sphere matrix to store in EEG.etc.oldicasphere +% Outputs: +% icaweights - ICA unmixing matrix (e.g., EEG.icaweights) +% icasphere - ICA data sphering matrix (e.g., EEG.icasphere) +% +% See also: pop_runica() +% +% Author: Scott Makeig, SCCN/INC/UCSD, March 17, 2005 + +% Copyright (C) 2004 Scott Makeig, SCCN/INC/UCSD, smakeig@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG,oldicaweights,oldicasphere] = eeg_oldica(EEG, nreturn,icaweights,icasphere) + +if nargin< 1 + help eeg_oldica + return +end +if ~isstruct(EEG) + error('EEG argument must be a dataset structure') +end + +if ~isfield(EEG,'etc') + error('EEG.etc field not found - no old ICA weights in dataset'); +end + +if ~isfield(EEG.etc,'oldicaweights') & nargin < 3 + error('EEG.etc.oldicaweights field not found - no old ICA weights in dataset'); +elseif nargout < 2 & nargin < 3 + if length(EEG.etc.oldicaweights) > 1 + fprintf('EEG.etc.oldicaweights contains %d weight matrices\n',length(EEG.etc.oldicaweights)); + EEG.etc.oldicaweights + else + fprintf('EEG.etc.oldicaweights contains %d weight matrix\n',length(EEG.etc.oldicaweights)); + EEG.etc.oldicaweights + end +end + +if ~isfield(EEG.etc,'oldicasphere') & nargin < 3 + fprintf('EEG.etc.oldicasphere field not found - no old ICA sphere matrix in dataset'); +elseif nargout < 2 & nargin < 3 + fprintf('\n'); + if length(EEG.etc.oldicasphere) > 1 + fprintf('EEG.etc.oldicasphere contains %d weight matrices\n',length(EEG.etc.oldicasphere)); + EEG.etc.oldicasphere + else + fprintf('EEG.etc.oldicasphere contains %d weight matrix\n',length(EEG.etc.oldicasphere)); + EEG.etc.oldicasphere + end + fprintf('\n'); +end + +if nargin < 2 + nreturn = 1; +elseif nargin < 3 + if nreturn< 1 + error('nreturn must be an oldicaweights index'); + elseif length(EEG.etc.oldicaweights) < nreturn + fprintf('nreturn (%d) > number of stored oldicaweights (%d) ', nreturn,length(EEG.etc.oldicaweights)); + error(' '); + end +end + +if nargin > 4 + error('too many arguments.\n'); +end + +if nargin > 2 + if nargout > 0 + fprintf('New EEG.etc.oldicaweights: '); + EEG.etc.oldicaweights = [EEG.etc.oldicaweights {icaweights}]; + EEG.etc.oldicaweights + else + error('To update oldicaweights, at least one output required'); + end +end +if nargin > 3 + fprintf('New EEG.etc.oldicasphere: '); + EEG.etc.oldicasphere = [EEG.etc.oldicasphere {icasphere}]; + EEG.etc.oldicasphere +end + +if nargout > 1 + % fprintf('\n'); + oldicaweights = EEG.etc.oldicaweights{nreturn}; + % fprintf('Stored oldicaweights matrix (%d) returned (%d,%d).\n',nreturn,size(oldicaweights,1),size(oldicaweights,2)); + + if length(EEG.etc.oldicasphere) >= nreturn + oldicasphere = EEG.etc.oldicasphere{nreturn}; + % fprintf('Stored oldicasphere matrix (%d) returned (%d,%d).\n',nreturn,size(oldicasphere,1),size(oldicasphere,2)); + else + oldicasphere = []; + % fprintf('No corresponding oldicasphere matrix; [] returned.\n'); + end + % fprintf('\n'); +end +return diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_point2lat.m b/code/eeglab13_4_4b/functions/popfunc/eeg_point2lat.m new file mode 100644 index 0000000..9f019c8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_point2lat.m @@ -0,0 +1,91 @@ +% eeg_point2lat() - convert latency in data points to latency in ms relative +% to the time locking. Used in eeglab(). +% Usage: +% >> [newlat ] = eeg_point2lat( lat_array, [], srate); +% >> [newlat ] = eeg_point2lat( lat_array, epoch_array,... +% srate, timelimits, timeunit); +% Inputs: +% lat_array - latency array in data points assuming concatenated +% data epochs (see eeglab() event structure) +% epoch_array - epoch number corresponding to each latency value +% srate - data sampling rate in Hz +% timelimits - [min max] timelimits in 'timeunit' units (see below) +% timeunit - time unit in second. Default is 1 = seconds. +% +% Outputs: +% newlat - converted latency values (in 'timeunit' units) for each epoch +% +% Example: +% tmpevent = EEG.event; +% eeg_point2lat( [ tmpevent.latency ], [], EEG.srate, [EEG.xmin EEG.xmax]); +% % returns the latency of all events in second for a continuous +% % dataset EEG +% +% eeg_point2lat( [ tmpevent.latency ], [ tmpevent.epoch ], +% EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); +% % returns the latency of all events in millisecond for a dataset +% % containing data epochs. +% +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2 Mai 2002 +% +% See also: eeg_lat2point(), eeglab(), pop_editieventvals(), pop_loaddat() + +% Copyright (C) 2 Mai 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function newlat = eeg_point2lat( lat_array, epoch_array, srate, timewin, timeunit); + +if nargin <3 + help eeg_point2lat; + return; +end; +if isempty( epoch_array ) + epoch_array = ones( size(lat_array) ); +end; +if nargin <4 + timewin = 0; +end; +if nargin <5 + timeunit = 1; +end; + +if length(lat_array) ~= length(epoch_array) + if length(epoch_array)~= 1 + disp('eeg_point2lat: latency and epoch arrays must have the same length'); return; + else + epoch_array = ones(1,length(lat_array))*epoch_array; + end; +end; +if length(timewin) ~= 2 + disp('eeg_point2lat: timelimits array must have length 2'); return; +end; +if iscell(epoch_array) + epoch_array = [ epoch_array{:} ]; +end; +if iscell(lat_array) + lat_array = [ lat_array{:} ]; +end + +timewin = timewin*timeunit; + +if length(timewin) == 2 + pnts = (timewin(2)-timewin(1))*srate+1; +else + pnts = 0; +end; +newlat = ((lat_array - (epoch_array-1)*pnts-1)/srate+timewin(1))/timeunit; +newlat = round(newlat*1E9)*1E-9; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_pv.m b/code/eeglab13_4_4b/functions/popfunc/eeg_pv.m new file mode 100644 index 0000000..594a380 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_pv.m @@ -0,0 +1,262 @@ +% eeg_pv() - Compute EEG.data 'percent variance ' (pv) of the whole EEG data versus the projections +% of specified components. +% Can omit specified components and channels from the computation. Can draw a plot +% of the scalp distribution of pv, or progressively compute the pv for comps +% 1:k, where k = 1 -> the total number of components. Note: pv's of spatially +% non-orthogonal independent components may not add to 100%, and individual component +% pv could be < 0%. +% Usage: +% >> [pv] = eeg_pv(EEG,comps); +% >> [pv,pvs,vars] = eeg_pv(EEG,comps,artcomps,omitchans,fraction,'plot'); +% Inputs: +% EEG - EEGLAB dataset. Must have icaweights, icasphere, icawinv, icaact. +% comps - vector of component indices to sum {default|[] -> progressive mode} +% In progressive mode, comps is first [1], then [1 2], etc. up to +% [1:size(EEG.icaweights,2)] (all components); here, the plot shows pv. +% artcomps - vector of artifact component indices to remove from data before +% computing pv {default|[]: none} +% omitchans - channels to omit from the computation (e.g. off-head, etc) {default|[]: none} +% fraction - (0 6 + help eeg_pv + return +end +numcomps = size(EEG.icaact,1); +plotit = 0; +if nargin>5 | nargout < 1 + plotit = 1; +end +if nargin<5 | isempty(fraction) + fraction = 1; +end +if fraction>1 + fprintf('eeg_pv(): considering all the data.\n'); + fraction=1; +end +if round(fraction*EEG.pnts*EEG.trials)<1 + error('fraction of data specified too small.') + return +end +if nargin<4 | isempty(omitchans) + omitchans = []; +end +if nargin<3|isempty(artcomps) + artcomps=[]; +end + +numchans = EEG.nbchan; +chans = 1:numchans; +if ~isempty(omitchans) + if max(omitchans)>numchans + help eeg_pv + error('at least one channel to omit > number of channels in data'); + end + if min(omitchans)<1 + help eeg_pv + error('channel numbers to omit must be > 0'); + end + chans(omitchans) = []; +end + +progressive = 0; % by default, progressive mode is off +if nargin < 2 | isempty(comps)|comps==0 + comps = []; + progressive = 1; % turn progressive mode on +end + +if isempty(EEG.icaweights) + help eeg_pv + return +end +if isempty(EEG.icasphere) + help eeg_pv + return +end + +if isempty(EEG.icawinv) + EEG.icawinv = pinv(EEG.icaweights*EEG.icasphere); +end +if isempty(EEG.icaact) + help eeg_pv + fprintf('EEG.icaact not present.\n'); + % EEG.icaact = EEG.icaweights*EEG.icasphere*EEG.data; % remake it like this +end +if max(comps) > size(EEG.icawinv,1) + help eeg_pv + fprintf('Only %d components in this dataset. Cannot project component %d.\n',numcomps,max(comps)); + error('bad comps input'); +end +if ~isempty(artcomps) & max(artcomps) > numcomps + help eeg_pv + fprintf('Only %d components in this dataset. Cannot project artcomp %d.\n',numcomps,max(artcomps)); + error('bad artcomps input') +end + +npts = EEG.trials*EEG.pnts; +allcomps = 1:numcomps; +if progressive + fprintf('Considering components up to: '); + cum_pv = zeros(1,numcomps); + cum_pvs = zeros(numcomps,numchans); +end + +for comp = 1:numcomps %%%%%%%%%%%%%%% progressive mode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if progressive + comps = allcomps(1:comp); % summing components 1 to current comp + fprintf('%d ',comp) +end + +if ~isempty(artcomps) + [a b c] = intersect_bc(artcomps,comps); + if ~isempty(a) + if ~progressive + if length(a)>1 + fprintf('eeg_pv(): not back-projecting %d comps already in the artcomps.\n',length(c)); + else + fprintf('eeg_pv(): not back-projecting comp %d already in the artcomps.\n',comps(c)); + end + end + comps(c) = []; + end +end +if ~isempty(artcomps) & min([comps artcomps]) < 1 + error('comps and artcomps must contain component indices'); +end + +% +%%%%%%%%%%%%%%%%%%%%%%%% compute variance accounted for by specified components %%%%%%%%%%%%% +% +if ~progressive | comp == 1 % pare out omitchans and artcomps from EEG.data + if ~isempty(artcomps) + EEG.data = EEG.data(chans,:) - EEG.icawinv(chans,artcomps)*EEG.icaact(artcomps,:); + else + EEG.data = EEG.data(chans,:); + end + + nsel = round(fraction*npts); + varpts = randperm(npts); + varwts = ones(size(varpts)); + if nsel5 % add text legend + if length(artcomps)>3 + tlstr=sprintf('Pvaf by %d comps in data minus %d comps',length(comps),length(artcomps)); + elseif isempty(artcomps) + tlstr=sprintf('Pvaf by %d comps in data',length(comps)); + elseif length(artcomps)==1 % < 4 artcomps, list them + tlstr=sprintf('Pvaf by %d comps in data (less comp ',length(comps)); + tlstr = [tlstr sprintf('%d ',artcomps) ')']; + else + tlstr=sprintf('Pvaf by %d comps in data (less comps ',length(comps)); + tlstr = [tlstr sprintf('%d ',artcomps) ')']; + end + else % < 6 comps, list them + if length(comps)>1 + tlstr=sprintf('Pvaf by comps '); + else + tlstr=sprintf('Pvaf by comp '); + end + if length(artcomps)>3 + tlstr = ... +[tlstr sprintf('%d ',comps) sprintf('in data minus %d comps',length(comps),length(artcomps))]; + else + if isempty(artcomps) + tlstr = [tlstr sprintf('%d ',comps) 'in data']; + elseif length(artcomps)==1 + tlstr = [tlstr sprintf('%d ',comps) 'in data (less comp ']; + tlstr = [tlstr int2str(artcomps) ')']; + else + tlstr = [tlstr sprintf('%d ',comps) 'in data (less comps ']; + tlstr = [tlstr sprintf('%d ',artcomps) ')']; + end + end + end + tl=title(tlstr); + if max(pvs)>100, + maxc=max(pvs) + else + maxc=100; + end; + + pvstr=sprintf('Total pv: %3.1f%%',pv); + tx=text(-0.9,-0.6,pvstr); + + caxis([-100 100]); + cb=cbar('vert',33:64,[0 100]); % color bar showing >0 (green->red) only + else + fprintf('EEG.chanlocs not found - not plotting scalp pv\n'); + end +end % plotit + + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_pvaf.m b/code/eeglab13_4_4b/functions/popfunc/eeg_pvaf.m new file mode 100644 index 0000000..bb27665 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_pvaf.m @@ -0,0 +1,277 @@ +% eeg_pvaf() - Compute EEG.data 'percent variance accounted for' (pvaf) by specified components. +% Can omit specified components and channels from the computation. Can draw a plot +% of the scalp distribution of pvaf, or progressively compute the pvaf for comps +% 1:k, where k = 1 -> the total number of components. Note: pvaf's of spatially +% non-orthogonal independent components may not add to 100%, and individual component +% pvaf could be < 0%. +% Usage: +% >> [pv] = eeg_pvaf(EEG,comps);s +% >> [pvaf,pvafs,vars] = eeg_pvaf(EEG, comps,'key', val); +% Inputs: +% EEG - EEGLAB dataset. Must have icaweights, icasphere, icawinv, icaact. +% comps - vector of component indices to sum {default|[] -> progressive mode} +% In progressive mode, comps is first [1], then [1 2], etc. up to +% [1:size(EEG.icaweights,2)] (all components); here, the plot shows pvaf. +% +% Optional inputs: +% 'artcomps' - [integer] vector of artifact component indices to remove from data before +% computing pvaf {default|[]: none} +% 'omitchans' - [integer] channels to omit from the computation (e.g. off-head, etc) +% {default|[]: none} +% 'chans' - [integer] only compute pvaf at selected channels. Overwrite omitchans above. +% 'fraction' - [0 0, g.plot = 'on'; + else g.plot = 'off'; + end; +end + +numchans = EEG.nbchan; +chans = 1:numchans; +if ~isempty(g.chans) + g.omitchans = setdiff_bc([1:EEG.nbchan], g.chans); +end; +if ~isempty(g.omitchans) + if max(g.omitchans)>numchans + help eeg_pvaf + error('at least one channel to omit > number of channels in data'); + end + if min(g.omitchans)<1 + help eeg_pvaf + error('channel numbers to omit must be > 0'); + end + chans(g.omitchans) = []; +end + +progressive = 0; % by default, progressive mode is off +if nargin < 2 | isempty(comps)|comps==0 + comps = []; + progressive = 1; % turn progressive mode on +end + +if isempty(EEG.icaweights) + help eeg_pvaf + return +end +if isempty(EEG.icasphere) + help eeg_pvaf + return +end + +if isempty(EEG.icawinv) + EEG.icawinv = pinv(EEG.icaweights*EEG.icasphere); +end +if isempty(EEG.icaact) + help eeg_pvaf + fprintf('EEG.icaact not present.\n'); + % EEG.icaact = EEG.icaweights*EEG.icasphere*EEG.data; % remake it like this +end +if max(comps) > size(EEG.icawinv,1) + help eeg_pvaf + fprintf('Only %d components in this dataset. Cannot project component %d.\n',numcomps,max(comps)); + error('bad comps input'); +end +if ~isempty(g.artcomps) & max(g.artcomps) > numcomps + help eeg_pvaf + fprintf('Only %d components in this dataset. Cannot project artcomp %d.\n',numcomps,max(g.artcomps)); + error('bad artcomps input') +end + +npts = EEG.trials*EEG.pnts; +allcomps = 1:numcomps; +if progressive + fprintf('Considering components up to: '); + cum_pvaf = zeros(1,numcomps); + cum_pvafs = zeros(numcomps,numchans); +end + +for comp = 1:numcomps %%%%%%%%%%%%%%% progressive mode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if progressive + comps = allcomps(1:comp); % summing components 1 to current comp + fprintf('%d ',comp) +end + +if ~isempty(g.artcomps) + [a b c] = intersect_bc(g.artcomps,comps); + if ~isempty(a) + if ~progressive + if length(a)>1 + fprintf('eeg_pvaf(): not back-projecting %d comps already in the artcomps.\n',length(c)); + else + fprintf('eeg_pvaf(): not back-projecting comp %d already in the artcomps.\n',comps(c)); + end + end + comps(c) = []; + end +end +if ~isempty(g.artcomps) & min([comps g.artcomps]) < 1 + error('comps and artcomps must contain component indices'); +end + +% +%%%%%%%%%%%%%%%%%%%%%%%% compute variance accounted for by specified components %%%%%%%%%%%%% +% +if ~progressive | comp == 1 % pare out g.omitchans and artcomps from EEG.data + if ~isempty(g.artcomps) + EEG.data = EEG.data(chans,:) - EEG.icawinv(chans,g.artcomps)*EEG.icaact(g.artcomps,:); + else + EEG.data = EEG.data(chans,:); + end + + nsel = round(g.fraction*npts); + varpts = randperm(npts); + varwts = ones(size(varpts)); + if nsel 1 + topoplot(pvafs',chanlocs); % plot pvaf here + end; + + if length(comps)>5 % add text legend + if length(g.artcomps)>3 + tlstr=sprintf('Pvaf by %d comps in data minus %d comps',length(comps),length(g.artcomps)); + elseif isempty(g.artcomps) + tlstr=sprintf('Pvaf by %d comps in data',length(comps)); + elseif length(g.artcomps)==1 % < 4 g.artcomps, list them + tlstr=sprintf('Pvaf by %d comps in data (less comp ',length(comps)); + tlstr = [tlstr sprintf('%d ',g.artcomps) ')']; + else + tlstr=sprintf('Pvaf by %d comps in data (less comps ',length(comps)); + tlstr = [tlstr sprintf('%d ',g.artcomps) ')']; + end + else % < 6 comps, list them + if length(comps)>1 + tlstr=sprintf('Pvaf by comps '); + else + tlstr=sprintf('Pvaf by comp '); + end + if length(g.artcomps)>3 + tlstr = ... +[tlstr sprintf('%d ',comps) sprintf('in data minus %d comps',length(comps),length(g.artcomps))]; + else + if isempty(g.artcomps) + tlstr = [tlstr sprintf('%d ',comps) 'in data']; + elseif length(g.artcomps)==1 + tlstr = [tlstr sprintf('%d ',comps) 'in data (less comp ']; + tlstr = [tlstr int2str(g.artcomps) ')']; + else + tlstr = [tlstr sprintf('%d ',comps) 'in data (less comps ']; + tlstr = [tlstr sprintf('%d ',g.artcomps) ')']; + end + end + end + tl=title(tlstr); + if max(pvafs)>100, + maxc=max(pvafs) + else + maxc=100; + end; + + pvstr=sprintf('Total pvaf: %3.1f%%',pvaf); + tx=text(-0.9,-0.6,pvstr); + + caxis([-100 100]); + cb=cbar('vert',33:64,[0 100]); % color bar showing >0 (green->red) only + else + fprintf('EEG.chanlocs not found - not plotting scalp pvaf\n'); + end +end % end plot + + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_rejmacro.m b/code/eeglab13_4_4b/functions/popfunc/eeg_rejmacro.m new file mode 100644 index 0000000..dc81bd8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_rejmacro.m @@ -0,0 +1,183 @@ +% eeg_rejmacro() - Internal EEGLAB macro for all pop_ functions that +% perform data rejection. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-08-02 include past rejections in eegplot -ad + +% this macro is used by pop_eegplot, pop_eegthresh, pop_const, pop_jointprob, pop_eegthreshfreq, pop_kurtosis + +% inputs: +% rej - input rejection in this workspace (string) +% rejE - electrode rejection in this workspace (string) +% elecrange - range of selected electrodes +% reject - superpose with previous rejections +% optional : nbpnts = number of points per trial + +% outputs: +% rejection arrays ('oldrej', 'oldrejE'), 'command' for eeglot + +if ~exist('elecrange') + help eeg_rejmacro; + error('Error: eeg_rejmacro cannot be called from the command line'); +end; + +if ~exist('nbpnts') nbpnts = EEG.pnts; end; + +% mix all type of rejections +% -------------------------- +if icacomp + nChan = EEG.nbchan; +else + nChan = size(EEG.icaweights,1); +end +if superpose == 2 + com2 = ['if ~isempty(TMPREJ), ' ... + ' icaprefix = ' fastif(icacomp, '''''', '''ica''') ';' ... + ' for indextmp = 1:length(EEG.reject.disprej),' ... + ' eval([ ''colortmp = EEG.reject.rej'' EEG.reject.disprej{indextmp} ''col;'' ]);' ... + ' [tmprej tmprejE] = eegplot2trial(TMPREJ,' int2str(nbpnts) ', EEG.trials, colortmp, []);' ... + ' if ~isempty(tmprejE),' ... + ' tmprejE2 = zeros(' int2str(nChan) ', length(tmprej));' ... + ' tmprejE2([' int2str(elecrange) '],:) = tmprejE;' ... + ' else,' ... + ' tmprejE2 = [];' ... + ' end;' ... + ' eval([ ''EEG.reject.'' icaprefix ''rej'' EEG.reject.disprej{indextmp} ''= tmprej;'' ]);' ... + ' eval([ ''EEG.reject.'' icaprefix ''rej'' EEG.reject.disprej{indextmp} ''E = tmprejE2;'' ]);' ... + ' end;' ]; +% ' colortmp, tmpstr = [ ''EEG.reject.'' icaprefix ''rej'' EEG.reject.disprej{indextmp} ], sum(tmprej),' ... +else + com2 = [ 'if ~isempty(TMPREJ),' ... + ' icaprefix = ' fastif(icacomp, '''''', '''ica''') ';' ... + ' [tmprej tmprejE] = eegplot2trial(TMPREJ,' int2str(nbpnts) ', EEG.trials, [' num2str(colrej) '], []);' ... + ' if ~isempty(tmprejE),' ... + ' tmprejE2 = zeros(' int2str(nChan) ', length(tmprej));' ... + ' tmprejE2([' int2str(elecrange) '],:) = tmprejE;' ... + ' else,' ... + ' tmprejE2 = [];' ... + ' end;' ... + macrorej '= tmprej;' macrorejE '= tmprejE2;' ... + ... % below are manual rejections + ' tmpstr = [ ''EEG.reject.'' icaprefix ''rejmanual'' ];' ... + ' if ~isempty(tmprej) eval([ ''if ~isempty('' tmpstr ''),'' tmpstr ''='' tmpstr ''| tmprej; else, '' tmpstr ''=tmprej; end;'' ]); end;' ... + ' if ~isempty(tmprejE2) eval([ ''if ~isempty('' tmpstr ''E),'' tmpstr ''E='' tmpstr ''E| tmprejE2; else, '' tmpstr ''E=tmprejE2; end;'' ]); end;' ]; +% ' size(tmprejE2), eval([''disp(size('' tmpstr ''E))'']),' ... +end; +% text commented below to fix BUG 478 +% ' [tmprej tmprejE] = eegplot2trial(TMPREJ,' int2str(nbpnts) ', EEG.trials, [' num2str(EEG.reject.rejmanualcol) '], []);' ... +% ' if ~isempty(tmprejE),' ... +% ' tmprejE2 = zeros(EEG.nbchan, length(tmprej));' ... +% ' tmprejE2([' int2str(elecrange) '],:) = tmprejE;' ... +% ' else,' ... +% ' tmprejE2 = [];' ... +% ' end;' ... +if reject + com2 = [ com2 ... + '[EEGTMP LASTCOM] = pop_rejepoch(EEG, tmprej, 1);' ... + 'if ~isempty(LASTCOM),'... + ' [ALLEEG EEG CURRENTSET tmpcom] = pop_newset(ALLEEG, EEGTMP, CURRENTSET);' ... + ' if ~isempty(tmpcom),' ... + ' EEG = eegh(LASTCOM, EEG);' ... + ' eegh(tmpcom);' ... + ' eeglab(''redraw'');' ... + ' end;' ... + 'end; clear EEGTMP tmpcom; end;' ] ; +else + com2 = [com2 ... + ' warndlg2(strvcat(''Epochs (=trials) marked for rejection have been noted.'',' ... + '''To actually reject these epochs, use '', ''Tools > Reject data epochs > Reject marked epochs''), ''Warning'');' ... + '[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); eeglab(''redraw''); end;' ]; +end; +if ~exist('topcommand') + topcommand = []; +end; + +% the first part is used to convert the eegplot output +command = [ com2 topcommand 'clear indextmp colortmp icaprefix tmpcom tmprej tmprejE tmprejE2 TMPREJ;' ]; + +if all(colrej == EEG.reject.rejmanualcol) + oldrej = []; % for manual rejection, old rejection are + oldrejE = []; % the current rejection +else + oldrej = eval(macrorej); + oldrejE = eval(macrorejE); +end; + +switch superpose + case 0, rejeegplot = trial2eegplot( rej, rejE, nbpnts, colrej); + case 1, rejeegplottmp = trial2eegplot( oldrej, oldrejE, nbpnts, min(colrej+0.15, [1 1 1])); + if ~isempty(rejeegplottmp), rejeegplot = [ rejeegplottmp ]; + else rejeegplot = []; end; + rejeegplottmp = trial2eegplot( rej, rejE, nbpnts, colrej); + if ~isempty(rejeegplottmp), rejeegplot = [ rejeegplot; rejeegplottmp ]; end; + case 2, + rejeegplot = []; + for index = 1:length(EEG.reject.disprej) + if ~isempty(EEG.reject.disprej{index}) + eval([ 'colortmp = EEG.reject.rej' EEG.reject.disprej{index} 'col;']); + if any(colortmp ~= colrej) % test if current rejection (if color different) + if icacomp == 0 % ica + currentname = [ 'EEG.reject.icarej' EEG.reject.disprej{index} ]; + else + currentname = [ 'EEG.reject.rej' EEG.reject.disprej{index} ]; + end; + currentcolor = [ 'EEG.reject.rej' EEG.reject.disprej{index} 'col' ]; + %if strcmp(EEG.reject.disprej{index}, 'manual') + % currentcolor = [ 'min(' currentcolor '+0.15, [1 1 1])' ]; + %end; % using this test, manual rejections won't be added to current rej + eval( [ 'rejeegplottmp = trial2eegplot( ' currentname ',' currentname ... + 'E, nbpnts,' currentcolor ');' ]); + if ~isempty(rejeegplottmp), rejeegplot = [ rejeegplot; rejeegplottmp ]; end; + end; + end; + end; + rejeegplottmp = trial2eegplot( rej, rejE, nbpnts, colrej); + if ~isempty(rejeegplottmp), rejeegplot = [ rejeegplot; rejeegplottmp ]; end; +end; +if ~isempty(rejeegplot) + rejeegplot = rejeegplot(:,[1:5,elecrange+5]); +else + rejeegplot = []; +end; +eegplotoptions = { 'events', EEG.event, 'winlength', 5, 'winrej', ... + rejeegplot, 'xgrid', 'off', 'wincolor', EEG.reject.rejmanualcol, ... + 'colmodif', { { EEG.reject.rejmanualcol EEG.reject.rejthreshcol EEG.reject.rejconstcol ... + EEG.reject.rejjpcol EEG.reject.rejkurtcol EEG.reject.rejfreqcol } } }; + +if ~isempty(EEG.chanlocs) & icacomp == 1 + if exist('elecrange') + eegplotoptions = { eegplotoptions{:} 'eloc_file', EEG.chanlocs(elecrange) }; + else + eegplotoptions = { eegplotoptions{:} 'eloc_file', EEG.chanlocs }; + end; +else + if exist('elecrange') + for index = 1:length(elecrange) + tmpstruct(index).labels = int2str(elecrange(index)); + end; + eegplotoptions = { eegplotoptions{:} 'eloc_file' tmpstruct }; + end; +end; +if ~reject + eegplotoptions = { eegplotoptions{:} 'butlabel', 'UPDATE MARKS' }; +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_rejsuperpose.m b/code/eeglab13_4_4b/functions/popfunc/eeg_rejsuperpose.m new file mode 100644 index 0000000..dcc0991 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_rejsuperpose.m @@ -0,0 +1,126 @@ +% eeg_rejsuperpose() - superpose rejections of a EEG dataset. +% +% Usage: +% >> EEGOUT = eeg_rejsuperpose( EEGIN, typerej, Rmanual, Rthres, ... +% Rconst, Rent, Rkurt, Rfreq, Rothertype); +% +% Inputs: +% EEGIN - input dataset +% typerej - type of rejection (1=raw data; 0=ica). +% Rmanual - include manual rejection (0|1). +% Rthres - include threshold rejection (0|1). +% Rconst - include rejection of constant activity (0|1). +% Rent - include entropy rejection (0|1). +% Rkurt - include kurtosis rejection (0|1). +% Rfreq - include frequcy based rejection (0|1). +% Rothertype - include manual rejection (0|1). +% +% Outputs: +% EEGOUT - with rejglobal and rejglobalE fields updated +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = eeg_rejsuperpose( EEG, typerej, Rmanual, Rthres, Rconst, ... + Rent, Rkurt, Rfreq, Rothertype); + +if nargin < 9 + help eeg_rejsuperpose; + return; +end; + +typerej = ~typerej; +rejglobal = zeros( 1, EEG.trials); +if typerej == 0 + rejglobalE = zeros( EEG.nbchan, EEG.trials); +else + rejglobalE = zeros( size(EEG.icaweights,1), EEG.trials); +end + +if typerej == 0 | Rothertype + if Rmanual + rejglobal = rejarray( rejglobal, EEG.reject.rejmanual); % see bottom for the + rejglobalE = rejarray( rejglobalE, EEG.reject.rejmanualE); % function rejarray + end; + if Rthres + rejglobal = rejarray( rejglobal, EEG.reject.rejthresh); + rejglobalE = rejarray( rejglobalE, EEG.reject.rejthreshE); + end; + if Rfreq + rejglobal = rejarray( rejglobal, EEG.reject.rejfreq); + rejglobalE = rejarray( rejglobalE, EEG.reject.rejfreqE); + end; + if Rconst + rejglobal = rejarray( rejglobal, EEG.reject.rejconst); + rejglobalE = rejarray( rejglobalE, EEG.reject.rejconstE); + end; + if Rent + rejglobal = rejarray( rejglobal, EEG.reject.rejjp); + rejglobalE = rejarray( rejglobalE, EEG.reject.rejjpE); + end; + if Rkurt + rejglobal = rejarray( rejglobal, EEG.reject.rejkurt); + rejglobalE = rejarray( rejglobalE, EEG.reject.rejkurtE); + end; +end; + +% --------------- + +if typerej == 1 | Rothertype + if Rmanual + rejglobal = rejarray( rejglobal, EEG.reject.icarejmanual); + rejglobalE = rejarray( rejglobalE, EEG.reject.icarejmanualE); + end; + if Rthres + rejglobal = rejarray( rejglobal, EEG.reject.icarejthresh); + rejglobalE = rejarray( rejglobalE, EEG.reject.icarejthreshE); + end; + if Rfreq + rejglobal = rejarray( rejglobal, EEG.reject.icarejfreq); + rejglobalE = rejarray( rejglobalE, EEG.reject.icarejfreqE); + end; + if Rconst + rejglobal = rejarray( rejglobal, EEG.reject.icarejconst); + rejglobalE = rejarray( rejglobalE, EEG.reject.icarejconstE); + end; + if Rent + rejglobal = rejarray( rejglobal, EEG.reject.icarejjp); + rejglobalE = rejarray( rejglobalE, EEG.reject.icarejjpE); + end; + if Rkurt + rejglobal = rejarray( rejglobal, EEG.reject.icarejkurt); + rejglobalE = rejarray( rejglobalE, EEG.reject.icarejkurtE); + end; +end; + +EEG.reject.rejglobal = rejglobal; +EEG.reject.rejglobalE = rejglobalE; + +com =sprintf('%s = eeg_rejsuperpose( %s, %d, %d, %d, %d, %d, %d, %d, %d);', ... + inputname(1), inputname(1), ~typerej, Rmanual, Rthres, Rconst, Rent, Rkurt, Rfreq, Rothertype); + +return; + +% subfunction rejecting an array ------ +function dest = rejarray( dest, ori) + if isempty(dest) + dest = ori; + elseif ~isempty(ori) + dest = dest | ori; + end; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_timeinterp.m b/code/eeglab13_4_4b/functions/popfunc/eeg_timeinterp.m new file mode 100644 index 0000000..ae234b9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_timeinterp.m @@ -0,0 +1,83 @@ +% eeg_timeinterp() - perform spline interpolation of a portion +% of data based on prior and post activity. See +% eeg_interp() for interpolation of bad channels. +% +% Usage: +% >> OUTEEG = eeg_timeinterp( INEEG, samples, 'key', 'val'); +% +% Inputs: +% INEEG - input EEG structure +% samplerange - [min max] range sample points in continuous +% or epoched data. Only one sample point range +% may be given at a time. +% +% Optional inputs: +% 'elecinds' - indices of electrodes to interpolate (default all) +% 'epochinds' - indices of epochs for epoched data (default all) +% 'interpwin' - [integer] number of data points to use before and +% after the sample range. Default is 5 times the +% interpolated sample range. +% 'epochcont' - ['on'|'off'] epochs are contiguous. Only works for +% interpolating the end of epochs (default 'off') +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, 2007 + +% Copyright (C) Arnaud Delorme, SCCN/INC/UCSD, 2007 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = eeg_timeinterp( EEG, samples, varargin); + + if nargin < 2 + help eeg_timeinterp; + return; + end; + + opt = finputcheck(varargin, { 'epochinds' 'integer' [] [1:EEG.trials]; ... + 'interpwin' 'integer' [] 5; ... + 'elecinds' 'integer' [] [1:EEG.nbchan]; ... + 'epochcont' 'string' { 'on';'off' } 'off' }, 'eeg_timeinterp'); + + if isstr(opt), error(opt); end; + + srange = samples(2)-samples(1); + data = EEG.data; + pnts = EEG.pnts; + + if strcmpi(opt.epochcont, 'on') + data(:,end+1:end+srange*opt.interpwin,1:end-1) = data(:,1:srange*opt.interpwin,2:end); + pnts = pnts + srange*opt.interpwin; + end; + + % determine region to interpolate + % and region to use for interpolation + % ----------------------------------- + samplesin = [min(samples(1)-srange*opt.interpwin,1):samples(1)-1 samples(2)+1:min(samples(2)+srange*opt.interpwin, pnts)]; + samplesout = [samples(1):samples(2)]; + + if length(opt.epochinds) > 1, fprintf('Trials:'); end; + for index = opt.epochinds + for elec = opt.elecinds + EEG.data(elec,samplesout,index) = spline( samplesin, data(elec, samplesin, index), samplesout); + end; + if length(opt.epochinds) > 1, + fprintf('.'); + if mod(index,40) == 01, fprintf('\n'); end; + end; + end; + if length(opt.epochinds) > 1, fprintf('\n'); end; diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_topoplot.m b/code/eeglab13_4_4b/functions/popfunc/eeg_topoplot.m new file mode 100644 index 0000000..8a989fe --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_topoplot.m @@ -0,0 +1,385 @@ +% eeg_topoplot() - plot scalp map +% +% eeg_topoplot( vals, chanlocs, 'key', 'val'); +% +% Input: +% vals - values, one per channel +% chanlocs - channel structure, same size as vals +% +% Optional inputs: +% 'colormap' - colormap. Possible colormaps are 'blueredyellow', ... +% 'yellowredblue', 'bluered' or any Matlab colormap ('cool', +% 'jet', 'hsv', ...). It can also be a text file 'xxx.txt'. +% The text file must contain 3 columns and idealy 64 rows +% defining the colors in RGB format. +% 'maplimits' - can be [min max]. This help defines the color scale for +% maps. +% 'electrodes' - can be 'on' to show electrode dots, 'off', or +% 'labels' to show electrode labels. Default is 'on' +% 'dotsize' - size of electrode dots. Default is 5. +% 'shading' - 'flat','interp' {default: 'interp'} +% 'exclude' - labels or indices of electrodes not to be plotted. From the +% compiled files, these must be entered using underscores +% for separators (e.g., "cz_pz"). +% 'sphspline' - can be 'on' or 'off'. If 'on' spherical splines are used +% for interpolation of the scalp map. If 'off' standard +% planar inverse distance interpolation is used. +% 'shrink' - shrink electrode positions (default is 0.75 to be able to +% plot electrode at the head limit if spherical interpolation +% is set and 0.95 for planar 2-D interpolation). +% +% References for spline interpolation: +% [1] Perrin, F., Pernier, J., Bertrand, O., & Echallier, J. F. +% (1989). Spherical splines for scalp potential and current +% density mapping. Electroencephalography and Clinical +% Neurophysiology, 72, 184-187 +% [2] Ferree, T. C. (2000). Spline Interpolation of the Scalp EEG. +% Retrieved March 26, 2006, from +% www.egi.com/Technotes/SplineInterpolation.pdf +% +% limitation: does not plot anything below the upper part of the head + +% Copyright (C) Arnaud Delorme, SCCN, INC, 2010 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function eeg_topoplot(values, chanlocs, varargin); + +g = []; +for index = 1:2:length(varargin) + g = setfield(g, varargin{index}, varargin{index+1}); +end; +if ~isfield(g, 'electrodes'), g.electrodes = 'on'; end; +if ~isfield(g, 'colormap'), g.colormap = jet; end; +if ~isfield(g, 'maplimits'), g.maplimits = []; end; +if ~isfield(g, 'headrad'), g.headrad = []; end; +if ~isfield(g, 'sphspline'), g.sphspline = 'on'; end; +if ~isfield(g, 'shading'), g.shading = 'interp'; end; +if ~isfield(g, 'contour'), g.contour = 'on'; end; +if ~isfield(g, 'dotsize'), g.dotsize = 5; end; +if ~isfield(g, 'mark'), g.mark = []; end; +if ~isfield(g, 'exclude'), g.exclude = []; end; +if ~isfield(g, 'linewidth'), g.linewidth = 2; end; +if ~isfield(g, 'shrink'), g.shrink = 1; end; +if isstr(g.dotsize), g.dotsize = str2num(g.dotsize); end; +if any(values == 0) + inds = find(values == 0); + if ~isempty( [ chanlocs(inds).theta ]) + g.contour = 'off'; + g.sphspline = 'off'; + end; +end; + +% exclude electrodes +% ------------------ +if ~isempty(g.exclude) + chanlocs(g.exclude) = []; + values(g.exclude) = []; +end; + +% find channel coordinates +% ------------------------ +emptyvals = cellfun('isempty', { chanlocs.theta }); +th = [ chanlocs.theta ]; +rd = [ chanlocs.radius ]; +[y x] = pol2cart(th/180*pi, rd); x=-x; +x = x*g.shrink; +y = y*g.shrink; +newvalues = values; +newvalues(emptyvals) = []; +labls = { chanlocs.labels }; +labls(emptyvals) = []; + +if strcmpi(g.sphspline, 'on') + % default head radius + % ------------------- + g.headrad = 0.5; + + % spherical plotting + % ------------------ + xelec = [ chanlocs.X ]; + yelec = [ chanlocs.Y ]; + zelec = [ chanlocs.Z ]; + + dist = sqrt(xelec.^2+yelec.^2+zelec.^2); + xelec = xelec./dist; + yelec = yelec./dist; + zelec = zelec./dist; + + if g.shrink ~= 1 + [th phi rad] = cart2sph(xelec, yelec, zelec); + phi = (phi-pi/2)*g.shrink+pi/2; + [xelec, yelec, zelec] = sph2cart(th, phi, rad); + end; + + [xsph, ysph, zsph, valsph] = spheric_spline(xelec,yelec,zelec,newvalues); + surf(-ysph/2,xsph/2,zsph/2,double(valsph), 'edgecolor', 'none'); view([0 0 1]);hold on; + shading(g.shading); + top = max(abs(valsph(:)))*1000; + + if strcmpi(g.contour, 'on') + [c h] = contour3(-ysph/2, xsph/2, valsph+top/10, 5); view([0 0 1]); + set(h, 'cdata', [], 'edgecolor', 'k') + end; + + % coordinates for electrodes + % -------------------------- + xelec(find(zelec < 0)) = []; + yelec(find(zelec < 0)) = []; + x = yelec/2; + y = xelec/2; + +else + % default head radius + % ------------------- + if isempty(g.headrad); + g.headrad = max(sqrt(x.^2+y.^2)); + end; + + % data points for 2-D data plot + % ----------------------------- + pnts = linspace(0,2*pi,200/0.25*(g.headrad.^2)); + xx = sin(pnts)*g.headrad; + yy = cos(pnts)*g.headrad; + + % make grid and add circle + % ------------------------ + gridres = 30; + coords = linspace(-g.headrad, g.headrad, gridres); + ay = repmat(coords, [gridres 1]); + ax = repmat(coords', [1 gridres]); + for ind=1:length(xx) + [tmp closex] = min(abs(xx(ind)-coords)); + [tmp closey] = min(abs(yy(ind)-coords)); + ax(closex,closey) = xx(ind); + ay(closex,closey) = yy(ind); + end; + xx2 = sin(pnts)*(g.headrad-0.01); + yy2 = cos(pnts)*(g.headrad-0.01); + for ind=1:length(xx) + [tmp closex] = min(abs(xx2(ind)-coords)); + [tmp closey] = min(abs(yy2(ind)-coords)); + ax(closex,closey) = xx(ind); + ay(closex,closey) = yy(ind); + end; + + % linear interpolation and removal of values outside circle + % --------------------------------------------------------- + a = griddata(x, y, newvalues, -ay, ax, 'v4'); + aradius = sqrt(ax.^2 + ay.^2); + indoutcircle = find(aradius(:) > g.headrad+0.01); + a(indoutcircle) = NaN; + surf(ay, ax, a, 'edgecolor', 'none'); view([0 0 1]); hold on; + shading(g.shading); + top = max(values)*1.5; + + % plot level lines + % ---------------- + if strcmpi(g.contour, 'on') + [c h] = contour3(ay, ax, a, 5); + set(h, 'cdata', [], 'edgecolor', 'k') + end; +end; + +% plot electrodes as dots +% ----------------------- +if strcmpi(g.electrodes, 'on') | strcmpi(g.electrodes, 'labels') + rad = sqrt(x.^2 + y.^2); + x(find(rad > g.headrad)) = []; + y(find(rad > g.headrad)) = []; + plot3( -x, y, ones(size(x))*top, 'k.', 'markersize', g.dotsize); + for i = g.mark, plot3( -x(i), y(i), double(top), 'y.', 'markersize', 4*g.dotsize); plot3( -x(i), y(i), double(top), 'r.', 'markersize', 2*g.dotsize); end; + if strcmpi(g.electrodes, 'labels') + for index = 1:length(x) + text( -x(index)+0.02, y(index), double(top), labls{index}); + end; + end; +else + % invisible electrode that avoid plotting problem (no surface, only + % contours) + plot3( -x, y, -ones(size(x))*top, 'k.', 'markersize', 0.001); +end; + +% plot dipoles if any +% ------------------- +if ~isempty(g.dipole) + hold on; + for index = 1:size(g.dipole,1) + g.dipole(index,:) = g.dipole(index,:)*0.5; + g.dipole(index,3:5) = g.dipole(index,3:5)/norm(g.dipole(index,3:end))*0.2; + if ~any(g.dipole(index,:)) + fprintf('Note: dipole contains 0 - not plotted\n') + elseif sum(g.dipole(index,3:4).^2) <= 0.00001 + fprintf('Note: dipole is length 0 - not plotted\n') + elseif sum(g.dipole(index,1:2).^2) > g.headrad + fprintf('Note: dipole is outside plotting area - not plotted\n') + else + hh = plot3( -g.dipole(index, 2), g.dipole(index, 1), top, '.'); + set(hh, 'color', 'k', 'markersize', 30); + hh = line( -[g.dipole(index, 2) g.dipole(index, 2)+g.dipole(index, 4)]', ... + [g.dipole(index, 1) g.dipole(index, 1)+g.dipole(index, 3)]',[top top]); + set(hh, 'color', 'k', 'linewidth', 30/7); + end; + end; +end; + +% special colormaps +% ----------------- +if isstr(g.colormap) + if ~isempty(strmatch(g.colormap, { 'hsv' 'jet' 'gray' 'hot' 'cool' 'bone' ... + 'copper', 'pink' 'flag' 'prism' }, 'exact')) + else % read text file + g.colormap = load('-ascii', g.colormap); + end; +end; +colormap(g.colormap); + +if ~isempty(g.maplimits) + if ~isstr(g.maplimits) && ~isempty(g.maplimits) && ~isnan(g.maplimits(1)) + caxis(g.maplimits); + end; +end; + +% main circle +% ----------- +radiuscircle = 0.5; +pnts = linspace(0,2*pi,200); +xc = sin(pnts)*radiuscircle; +yc = cos(pnts)*radiuscircle; +sf = 1; % scaling factor +plot3(xc*sf,yc*sf,ones(size(xc))*top, 'k', 'linewidth', g.linewidth); hold on; + +% ears & nose +% ----------- +rmax = 0.5; +base = rmax-.0046; +basex = 0.18*rmax; % nose width +tip = 1.15*rmax; +tiphw = .04*rmax; % nose tip half width +tipr = .01*rmax; % nose tip rounding +q = .04; % ear lengthening +EarX = [.497-.005 .510 .518 .5299 .5419 .54 .547 .532 .510 .489-.005]; % rmax = 0.5 +EarY = [q+.0555 q+.0775 q+.0783 q+.0746 q+.0555 -.0055 -.0932 -.1313 -.1384 -.1199]; + +plot3(EarX*sf,EarY*sf,ones(size(EarX))*top,'color','k','LineWidth',g.linewidth) % plot left ear +plot3(-EarX*sf,EarY*sf,ones(size(EarY))*top,'color','k','LineWidth',g.linewidth) % plot right ear +plot3([basex;tiphw;0;-tiphw;-basex]*sf,[base;tip-tipr;tip;tip-tipr;base]*sf,top*ones(size([basex;tiphw;0;-tiphw;-basex])),'color','k','LineWidth',g.linewidth); + +% axis limits +% ----------- +axis off; +set(gca, 'ydir', 'normal'); +axis equal +ylimtmp = max(g.headrad, 0.58); +ylim([-ylimtmp ylimtmp]); + +% ---------------- +% spherical spline +% ---------------- +function [x, y, z, Res] = spheric_spline( xelec, yelec, zelec, values); + +SPHERERES = 40; +[x,y,z] = sphere(SPHERERES); +x(1:(length(x)-1)/2,:) = []; +y(1:(length(x)-1)/2,:) = []; +z(1:(length(x)-1)/2,:) = []; + +Gelec = computeg(xelec,yelec,zelec,xelec,yelec,zelec); +Gsph = computeg(x,y,z,xelec,yelec,zelec); + +% equations are +% Gelec*C + C0 = Potential (C unknow) +% Sum(c_i) = 0 +% so +% [c_1] +% * [c_2] +% [c_ ] +% xelec [c_n] +% [x x x x x] [potential_1] +% [x x x x x] [potential_ ] +% [x x x x x] = [potential_ ] +% [x x x x x] [potential_4] +% [1 1 1 1 1] [0] + +% compute solution for parameters C +% --------------------------------- +meanvalues = mean(values); +values = values - meanvalues; % make mean zero +C = pinv([Gelec;ones(1,length(Gelec))]) * [values(:);0]; + +% apply results +% ------------- +Res = zeros(1,size(Gsph,1)); +for j = 1:size(Gsph,1) + Res(j) = sum(C .* Gsph(j,:)'); +end +Res = Res + meanvalues; +Res = reshape(Res, size(x)); + +% compute G function +% ------------------ +function g = computeg(x,y,z,xelec,yelec,zelec) + +unitmat = ones(length(x(:)),length(xelec)); +EI = unitmat - ((repmat(x(:),1,length(xelec)) - repmat(xelec,length(x(:)),1)).^2 +... + (repmat(y(:),1,length(xelec)) - repmat(yelec,length(x(:)),1)).^2 +... + (repmat(z(:),1,length(xelec)) - repmat(zelec,length(x(:)),1)).^2)/2; + +g = zeros(length(x(:)),length(xelec)); +m = 4; % 3 is linear, 4 is best according to Perrin's curve +for n = 1:7 + L = legendre(n,EI); + g = g + ((2*n+1)/(n^m*(n+1)^m))*squeeze(L(1,:,:)); +end +g = g/(4*pi); + +% find electrode indices +% ---------------------- +function allinds = elecind( str, chanlocs, values ); + + findmax = 0; + findmin = 0; + if ~iscell(str) + if strmatch(str, 'max', 'exact'), findmax = 1; end; + if strmatch(str, 'min', 'exact'), findmin = 1; end; + indunderscore = [ 0 find( str == '_' ) length(str)+1 ]; + else indunderscore = [1:length(str)+1]; + end; + + % find maximum or minimum + % ----------------------- + if findmax, [tmp allinds] = max(values); return; end; + if findmin, [tmp allinds] = min(values); return; end; + + % find indices for labels + % ----------------------- + labels = lower({ chanlocs.labels }); + for i = 1:length(indunderscore)-1 + if ~iscell(str) + tmpstr = str(indunderscore(i)+1:indunderscore(i+1)-1); + else tmpstr = str{i}; + end; + tmpind = strmatch(lower(tmpstr), labels, 'exact'); + if isempty(tmpind) + if str2num(tmpstr) > 0 + tmpind = str2num(tmpstr); + else + error(sprintf('Could not find channel "%s"', tmpstr)); + end; + end; + allinds(i) = tmpind; + end; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/eeg_urlatency.m b/code/eeglab13_4_4b/functions/popfunc/eeg_urlatency.m new file mode 100644 index 0000000..caaa053 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/eeg_urlatency.m @@ -0,0 +1,60 @@ +% eeg_urlatency() - find the original (ur) latency of a time point in +% the original continuous data. +% +% Usage: +% >> lat_out = eeg_urlatency( event, lat_in ); +% +% Inputs: +% event - event structure. If this structure contain boundary +% events, the length of these events is added to restore +% the original latency from the relative latency in 'lat_in' +% lat_in - relative latency in sample point +% +% Outputs: +% lat_out - output latency +% +% Note: the function that finds the latency in the current dataset using (ur) +% original latencies as input is eeg_latencyur() +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, April, 15, 2004 +% +% See also: eeg_latencyur() + +% Copyright (C) 2004 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function latout = eeg_urlatency( events, latin ); + + if nargin < 2 + help eeg_urlatency; + return; + end; + + boundevents = { events.type }; + latout = latin; + if ~isempty(boundevents) & isstr(boundevents{1}) + indbound = strmatch('boundary', boundevents); + + if isfield(events, 'duration') & ~isempty(indbound) + for index = indbound' + tmpInds = find(events(index).latency < latin); % the find handles several input latencies + latout(tmpInds) = latout(tmpInds) + events(index).duration; + end; + elseif ~isempty(indbound) % boundaries but with no associated duration + latout = NaN; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/popfunc/getchanlist.m b/code/eeglab13_4_4b/functions/popfunc/getchanlist.m new file mode 100644 index 0000000..2d8fba6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/getchanlist.m @@ -0,0 +1,64 @@ +% getchanlist() - Obtain indices of specified channel types. +% +% Usage: +% >> chanlist = getchanlist(chanlocs, type) +% +% Inputs: +% chanlocs - EEGLAB channel location structure +% type - [string] select channel of specified type +% can enter a cell array to select several channel types +% +% Output: +% chanlist - list of channel indices for the selected type(s) +% sorted in increasing order +% +% Note: this function is not case sensitive +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2004 +% +% See also: pop_chanedit() + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2004 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function chanlist = getchanlist(chanlocs, type) + + if nargin < 1 + help getchanlist; + return; + end; + + if nargin < 2 || ~isfield(chanlocs, 'type') + chanlist = [1:length(chanlocs)]; + return; + end; + + % search channel types + % -------------------- + if isstr(type), type = { type }; end; + type = lower(type); + chanlist = []; + alltypes = lower({ chanlocs.type }); + for index = 1:length(type) + tmplist = strmatch(type{index}, alltypes, 'exact'); + if isempty(tmplist) + fprintf('Warning: no channel of type ''%s'' found\n', type{index}); + end; + chanlist = [ chanlist tmplist' ]; + end; + chanlist = sort(chanlist); + + diff --git a/code/eeglab13_4_4b/functions/popfunc/importevent.m b/code/eeglab13_4_4b/functions/popfunc/importevent.m new file mode 100644 index 0000000..4c25cdc --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/importevent.m @@ -0,0 +1,375 @@ +% importevent() - Import experimental events from data file or Matlab +% array into a structure. +% +% Usage: >> eventstruct = importevent( event, oldevent, srate); +% >> eventstruct = importevent( event, oldevent, srate, 'key1', 'value1', ...); +% +% Input: +% event - [ 'filename'|array ] Filename of a text file, or name of +% Matlab array in the global workspace containing an +% array of events in the folowing format: The first column of +% the cell array is the type of the event, the second the latency. +% The others are user-defined. The function can read +% either numeric or text entries in ascii files. +% oldevent - Old event structure. Used for aligning new events with old +% ones. Enter [] is no such structure exist. +% srate - Sampling rate of the underlying data. Event latencies are +% expressed in terms of latency in sample point with respect +% to the data. +% +% Optional file or array input: +% 'fields' - [Cell array] List of the name of each user-defined column, +% optionally followed by a description. Ex: { 'type', 'latency' } +% 'skipline' - [Interger] Number of header rows to skip in the text file +% 'timeunit' - [ latency unit rel. to seconds ]. Default unit is 1 = seconds. +% NaN indicates that the latencies are given in time points. +% 'delim' - [string] String of delimiting characters in the input file. +% Default is tab|space. +% +% Optional oldevent input: +% 'append' - ['yes'|'no'] 'yes' = Append events to the current events in +% the EEG dataset {default}: 'no' = Erase the previous events. +% 'indices' - {integer vector] Vector indicating the indices of the events to +% modify. +% 'align' - [num] Align the first event latency to the latency of existing +% event number (num), and check latency consistency. +% A value of 0 indicates that the first events of the pre-defined +% events and imported events will be aligned. A positive value (num) +% aligns the first event to the num-th pre-existing event. +% A negative value can also be used; then event number (-num) +% is aligned to the first pre-existing event. Default is 0. +% (NaN-> no alignment). +% 'optimmeas' - ['median'|'mean'] Uses either the median of the mean +% distance to align events. Default is 'mean'. Median is +% preferable if events are missing in the event file. +% 'optimalign' - ['on'|'off'] Optimize the sampling rate of the new events so +% they best align with old events. Default is 'on'. +% +% Outputs: +% eventstruct - Event structure containing imported events +% +% Example: >> eventstruct = importevent( 'event_values.txt', [], 256, ... +% 'fields', {'type', 'latency','condition' }, ... +% 'append', 'no', 'align', 0, 'timeunit', 1E-3 ); +% +% This loads the ascii file 'event_values.txt' containing 3 columns +% (event_type, latency, and condition). Latencies in the file are +% in ms (1E-3). The first event latency is re-aligned with the +% beginning of the dataset ('align', 0). Any previous events +% are erased ('append', 'no'). +% +% Author: Arnaud Delorme & Scott Makeig, CNL / Salk Institute, 2004 +% +% See also: pop_importevent() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 2004, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%% REVISION HISTORY +%% function definition, input check +function event = importevent(event, oldevent, srate, varargin) + +if nargin < 1 + help importevent; + return; +end; + +I = []; + +% remove the event field +% ---------------------- +if ~isempty(oldevent), allfields = fieldnames(oldevent); +else allfields = {}; end; + +g = finputcheck( varargin, { 'fields' 'cell' [] {}; + 'skipline' 'integer' [0 Inf] 0; + 'indices' 'integer' [1 Inf] []; + 'append' 'string' {'yes';'no';'''yes''';'''no''' } 'yes'; + 'timeunit' 'real' [] 1; + 'event' { 'cell';'real';'string' } [] []; + 'align' 'integer' [] NaN; + 'optimalign' 'string' { 'on';'off' } 'on'; + 'optimmeas' 'string' { 'median';'mean' } 'mean'; + 'delim' {'integer';'string'} [] char([9 32 44])}, 'importevent'); +if isstr(g), error(g); end; +if ~isempty(g.indices), g.append = 'yes'; end; +g.delim = char(g.delim); + +% call from pop_importevent +% ------------------------- +if ~isempty(g.event) + event = g.event; + if ~isstr(event) + if size(event,2) > size(event,1), event = event'; end; + if iscell(event) + eventStr = cellfun(@ischar, event); + eventNum = cellfun(@isnumeric, event); + if all(eventStr(1,:)) && ~all(eventStr(:,1)) + event = event'; + end; + if all(eventNum(1,:)) && ~all(eventNum(:,1)) + event = event'; + end; + end; + end; +end; +g.event = event; + +% determine latency for old event alignment +% ----------------------------------------- +tmpalign = g.align; +g.align = []; +g.align.val = tmpalign; +if ~isnan(g.align.val) + if isempty(oldevent) + error('Setevent: no pre-existing event, cannot perform alignment'); + end; + if ~isfield(oldevent, 'latency') + error('Setevent: pre-existing events do not have a latency field for re-alignment'); + end; + switch g.append + case {'yes' '''yes'''}, disp('Setevent warning: cannot align and append events at the same time; disabling event alignment'); + end; + if g.align.val < 0 + g.align.event = oldevent(1).latency; + else + g.align.event = oldevent(g.align.val+1).latency; + end + g.align.nbevent = length(oldevent); + g.oldevents = oldevent; + g.align.txt = sprintf([ 'Check alignment between pre-existing (old) and loaded event' ... + ' latencies:\nOld event latencies (10 first): %s ...\n' ], ... + int2str([ oldevent(1:min(10, length(oldevent))).latency ])); +else + g.oldevents = []; +end; + +tmpfields = fieldnames(g); +event = oldevent; +%% scan all the fields of g +% ------------------------ +for curfield = tmpfields' + if ~isempty(event), allfields = fieldnames(event); + else allfields = {}; end; + switch lower(curfield{1}) + case {'append', 'fields', 'skipline', 'indices', 'timeunit', 'align', 'delim' }, ; % do nothing now + case 'event', % load an ascii file + switch g.append + case { '''no''' 'no' } % ''no'' for backward compatibility + if isstr(g.event) && ~exist(g.event), g.event = evalin('caller', g.event); end; + event = load_file_or_array( g.event, g.skipline, g.delim ); + allfields = g.fields(1:min(length(g.fields), size(event,2))); + event = eeg_eventformat(event, 'struct', allfields); + % generate ori fields + % ------------------- + if ~isnan(g.timeunit) + for index = 1:length(event) + event(index).init_index = index; + event(index).init_time = event(index).latency*g.timeunit; + end; + end; + event = recomputelatency( event, 1:length(event), srate, ... + g.timeunit, g.align, g.oldevents, g.optimalign, g.optimmeas); + case { '''yes''' 'yes' } + % match existing fields + % --------------------- + if isstr(g.event) && ~exist(g.event), g.event = evalin('caller', g.event); end; + tmparray = load_file_or_array( g.event, g.skipline, g.delim ); + if isempty(g.indices) g.indices = [1:size(tmparray,1)] + length(event); end; + if length(g.indices) ~= size(tmparray,1) + error('Set error: number of row in file does not match the number of event given as input'); + end; + + % add field + % --------- + g.fields = getnewfields( g.fields, size(tmparray,2)-length(g.fields)); + + % add new values + % --------------------- + for eventfield = 1:size(tmparray,2) + event = setstruct( event, g.fields{eventfield}, g.indices, { tmparray{:,eventfield} }); + end; + % generate ori fields + % ------------------- + offset = length(event)-size(tmparray,1); + for index = 1:size(tmparray,1) + event(index+offset).init_index = index; + event(index+offset).init_time = event(index+offset).latency*g.timeunit; + end; + event = recomputelatency( event, g.indices, srate, g.timeunit, ... + g.align, g.oldevents, g.optimalign, g.optimmeas); + end; + end; +end; + +if isempty(event) % usefull 0xNB empty structure + event = []; +end; + +%% remove the events wit out-of-bound latencies +% -------------------------------------------- +if isfield(event, 'latency') + try + res = cellfun('isempty', { event.latency }); + res = find(res); + if ~isempty(res) + fprintf( 'importevent warning: %d/%d event(s) have invalid latencies and were removed\n', ... + length(res), length(event)); + event( res ) = []; + end; + end; +end; + +%% interpret the variable name +% --------------------------- +function array = load_file_or_array( varname, skipline, delim ); + if isstr(varname) & exist(varname) == 2 % mean that it is a filename + % -------------------------- + array = loadtxt( varname, 'skipline', skipline, 'delim', delim, 'blankcell', 'off' ); + + else + if ~iscell(varname) + array = mattocell(varname); + else + array = varname; + end; + end; +return; + +%% update latency values +% --------------------- +function event = recomputelatency( event, indices, srate, timeunit, align, oldevents, optimalign, optimmeas) + + % update time unit + % ---------------- + if ~isfield(event, 'latency'), + if isfield(event, 'duration') + error('A duration field cannot be defined if a latency field has not been defined'); + end; + return; + end; + if ~isnan(timeunit) + for index = indices + event(index).latency = event(index).latency*srate*timeunit; + if isfield(event, 'duration') + event(index).duration = event(index).duration*srate*timeunit; + end; + end; + end; + + % alignment with old events + % ------------------------- + if ~isnan( align.val ) + if align.val >= 0, alignlatency = event(1).latency; + else alignlatency = event(-align.val+1).latency; + end; + for index = indices + event(index).latency = event(index).latency-alignlatency+align.event; + end; + if length(event) ~= align.nbevent + disp('Setevent warning: the number of pre-existing events do not correspond to the number of events'); + disp(' that were read, so their latencies may have been wrongly re-aligned'); + end; + fprintf(align.txt); + fprintf('New event latencies (10 first): %s ...\n', int2str(round([ event(1:min(10, length(event))).latency ]))); + end; + if strcmpi(optimalign, 'on') & ~isempty(oldevents) + newlat = [ event.latency ]; + oldlat = [ oldevents.latency ]; + + newlat = repmat(newlat, [length(oldlat) 1]); + oldlat = repmat(oldlat', [1 size(newlat,2)]); + if align.val >= 0 + newlat = newlat-newlat(1); + oldlat = oldlat-oldlat(1+align.val); + else + newlat = newlat-newlat(1-align.val); + oldlat = oldlat-oldlat(1); + end; + + try + newfactor = fminsearch('eventalign',1,[],newlat, oldlat, optimmeas); + catch + newfactor = fminsearch('eventalign',1,[],[],newlat, oldlat, optimmeas); % Octave + end; + fprintf('Best sampling rate ratio found is %1.7f. Below latencies after adjustment\n', newfactor); + if newfactor > 1.01 | newfactor < 0.99 + disp('Difference is more than 1%, something is wrong; ignoring ratio'); + newfactor = 1; + else + difference1 = eventalign( 1 , newlat, oldlat, optimmeas); + difference2 = eventalign( newfactor, newlat, oldlat, optimmeas); + fprintf('The average difference before correction was %f sample points\n', difference1); + fprintf('The average difference after correction is %f sample points\n', difference2); + end; + + %diffarray = abs(newfactor*newlat-oldlat)'; + %[allmins poss] = min(diffarray); + %figure; hist(allmins); + else + newfactor = 1; + end; + if ~isnan( align.val ) & newfactor ~= 1 + if align.val >= 0 + latfirstevent = event(1).latency; + else + latfirstevent = event(-align.val+1).latency; + end; + for index = setdiff_bc(indices, 1) + event(index).latency = round(event(index).latency-latfirstevent)*newfactor+latfirstevent; + end; + if ~isempty(oldevents) + fprintf('Old event latencies (10 first): %s ...\n', int2str(round([ oldevents(1:min(10, length(oldevents))).latency ]))); + fprintf('New event latencies (10 first): %s ...\n', int2str(round([ event(1:min(10, length(event))).latency ]))); + end; + else + % must add one (because first sample point has latency 0 + % ------------------------------------------------------ + if ~isnan(timeunit) + for index = indices + event(index).latency = round((event(index).latency+1)*1000*newfactor)/1000; + end; + end; + end; + + +%% create new field names +% ---------------------- +function epochfield = getnewfields( epochfield, nbfields ) + count = 1; + while nbfields > 0 + if isempty( strmatch([ 'var' int2str(count) ], epochfield ) ) + epochfield = { epochfield{:} [ 'var' int2str(count) ] }; + nbfields = nbfields-1; + else count = count+1; + end; + end +return; + +%% +% ---------------------- +function var = setstruct( var, fieldname, indices, values ) + if exist('indices') ~= 1, indices = 1:length(var); end + if ~isempty(values) + for index = 1:length(indices) + var = setfield(var, {indices(index)}, fieldname, values{index}); + end + else + for index = 1:length(indices) + var = setfield(var, {indices(index)}, fieldname, ''); + end + end +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_autorej.m b/code/eeglab13_4_4b/functions/popfunc/pop_autorej.m new file mode 100644 index 0000000..637c070 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_autorej.m @@ -0,0 +1,251 @@ +% pop_autorej() - perform automatic artifact epoch detection and rejection +% +% Usage: +% >> [EEG, rmepochs] = pop_autorej( EEG, 'key', 'val'); +% +% Inputs: +% EEG - input EEG structure where epochs have been extracted. +% +% Optional inputs: +% 'threshold' - [float] Threshold limit for detection of extremely large +% fluctuations (uV) {default: 1000} +% 'electrodes' - [integer] Use these channel indices for detection +% of improbable data {default: all channels} +% 'icacomps' - [integer] Use these component activities (instead of +% channel data) for detection of improbable data. +% {default: none} +% 'startprob' - [float] Probability threshold (in std. dev.) for +% detection of improbable data {default: 5} +% 'maxrej' - [float] Maximum % of total trials to reject per +% iteration {default: 5} +% 'eegplot' - ['on'|'off'] Allow for visual inspection of rejected +% trials {default: 'off' if called from the command line, +% 'on' if called from the gui} +% 'nogui' - ['on'|'off'] Do not pop up a gui window to ask for +% input parameters {default: 'off'} +% +% Outputs: +% EEG - EEGLAB data structure +% rmepochs - [integer] rejected trial indices +% +% Function description: +% pop_autorej() first detects extremely large potential fluctuations; +% this is mostly to detect artifacts from electrical surges or other +% unreasonably large amplitude events. Then it applies the following. +% The function rejects data epochs containing data values outside a +% given standard deviation (s.d.) threshold entered by the user (e.g., +% 3 s.d.'s). In each iteration, if the number of epochs that are +% thus marked for rejection are fewer than 'maxrej' (by default, 5%), it +% then rejects the beyond-threshold data epochs and iterates. If the number +% of epochs marked  for rejection is more than 5% of the total number +% of data epochs, it does not reject them, but instead  increases the +% s.d. threshold by 0.5 s.d. and iterates. When no more data epochs are +% found to exceed the current s.d. threshold, it lowers the threshold +% by 0.5 s.d. and continues to iterate until either no more epochs are +% rejected or until 8 iterations have been performed. +% +% Authors: Julie Onton and Arnaud Delorme, SCCN/INC/UCSD, 2007- + +% Copyright (C) Arnaud Delorme, SCCN/INC/UCSD, 2007 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, rmep, com ] = pop_autorej(EEG, varargin); + + DEFAULT_STARTPROB = 5; % std devs + DEFAULT_MAXREJ = 5; % std devs + DEFAULT_THRESH = 1000; % uV + if nargin < 1 + help pop_autorej; + return; + end; + rmep = []; + com = ''; + + if EEG.trials == 1 + error('This function requires data epochs'); + end; + + opt = finputcheck(varargin, { 'startprob' 'real' [] DEFAULT_STARTPROB; ... + 'electrodes' 'real' [] [1:EEG.nbchan]; ... + 'icacomps' 'real' [] []; ... + 'maxrej' 'real' [] DEFAULT_MAXREJ; ... + 'eegplot' 'string' { 'on';'off' } 'off'; ... + 'nogui' 'string' { 'on';'off' } 'off'; ... + 'threshold' 'real' [] DEFAULT_THRESH }, 'pop_autorej'); + if isstr(opt), error(opt); end; + + % pop-up GUI for rejecting artifacts + % ---------------------------------- + if strcmpi(opt.nogui, 'off') + + promptstr = { { 'style' 'text' 'string' 'Detection of extremelly large fluctuations (channels only)' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Threshold limit (microV)' } ... + { 'style' 'edit' 'string' '1000' } ... + { 'style' 'text' 'string' ' ' } ... + { 'style' 'text' 'string' 'Detection of unprobable activity (channels or ICA)' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Do not use these channel indices (default=all)' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Use these ICA components instead of data channels' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Probability threshold (std. dev.)' } ... + { 'style' 'edit' 'string' '5' } ... + { 'style' 'text' 'string' 'Maximum % of total trials to reject per iteration' } ... + { 'style' 'edit' 'string' '5' } ... + { 'style' 'text' 'string' ' ' } ... + { 'style' 'text' 'string' 'Check box for visual inspection of results' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 } }; + geometry = { [1] [2 1] [1] [1] [2 1] [2 1] [2 1] [2 1] [1] [2 1]}; + result = inputgui( 'geometry', geometry, 'uilist', promptstr, ... + 'helpcom', 'pophelp(''pop_autorej'')', ... + 'title', 'Automatic artifact rejection -- pop_autorej()'); + if isempty(result), return; end; + + options = { 'nogui' 'on' }; + if ~strcmpi(result{1}, '1000'), options = { options{:} 'threshold' str2num(result{1}) }; end; + if ~isempty(result{2}), options = { options{:} 'electrodes' setdiff([1:EEG.nbchan], str2num(result{2})) }; end; + if ~isempty(result{3}), options = { options{:} 'icacomps' str2num(result{3}) }; end; + if ~strcmpi(result{4}, '5'), options = { options{:} 'startprob' str2num(result{4}) }; end; + if ~strcmpi(result{5}, '5'), options = { options{:} 'maxrej' str2num(result{5}) }; end; + if result{6}, options = { options{:} 'eegplot' 'on' }; end; + + [ EEG rmep com ] = pop_autorej(EEG, options{:}); + return; + end; + + EEGIN = EEG; % backup EEG structure + if ~isempty(opt.icacomps), + processdat = 0; + complist = opt.icacomps; + else + processdat = 1; + complist = opt.electrodes; + end; + + % rejection of extremelly large fluctuations + % ------------------------------------------ + fprintf('\nRunning auto-rejection protocol...\n'); + rmep = zeros(1,0); + alleps = [1:EEG.trials]; + EEG = pop_eegthresh(EEG,1,[1:size(EEG.data,1)],-opt.threshold,opt.threshold,EEG.xmin,EEG.xmax,0,0); + numrej = length(find(EEG.reject.rejthresh)); % count number of epochs marked +% if numrej > 0 +% rmep(1,end+1:end+length(find(EEG.reject.rejthresh))) = alleps(find(EEG.reject.rejthresh)); +% alleps(find(EEG.reject.rejthresh)) = []; +% EEG = pop_rejepoch( EEG,EEG.reject.rejthresh,0); % actually reject high prob epochs +% fprintf('\nRe-baselining after large amplitude artifact removed (does not affect the data)...\n'); +% EEG = pop_rmbase( EEG, [EEG.xmin*1000 EEG.xmax*1000]); +% end; + + %-------------------------------------------- + + EEG = pop_jointprob(EEG, processdat, complist ,opt.startprob,opt.startprob,0,0);% calculate component probabilities + if processdat % if rejection based on channels + numrej = length(find(EEG.reject.rejjp)); % count number of epochs marked + + else% if rejection based on ICs + numrej = length(find(EEG.reject.icarejjp)); % count number of epochs marked + end; + if (numrej/EEG.trials) < opt.maxrej/100 + if processdat + rmep(1,end+1:end+length(find(EEG.reject.rejjp))) = alleps(EEG.reject.rejjp); + alleps(EEG.reject.rejjp) = []; + EEG = pop_rejepoch( EEG,EEG.reject.rejjp,0); % actually reject high prob epochs + else + rmep(1,end+1:end+length(find(EEG.reject.icarejjp))) = alleps(EEG.reject.icarejjp); + alleps(EEG.reject.icarejjp) = []; + EEG = pop_rejepoch( EEG,EEG.reject.icarejjp,0); % actually reject high prob epochs + end; + else + fprintf('Re-adjusting probability limits and running again...*********\n'); + opt.startprob = opt.startprob + .5; + end; + repeat = 1; maxiter = 0; + while repeat == 1 % keep running probability until there are no epochs above threshold + if numrej > 0 + EEG = pop_jointprob(EEG,processdat,complist ,opt.startprob,opt.startprob,0,0); + if processdat % if rejection based on channels + numrej = length(find(EEG.reject.rejjp)); % count number of epochs marked + + else% if rejection based on ICs + numrej = length(find(EEG.reject.icarejjp)); % count number of epochs marked + end; + if (numrej/EEG.trials) < opt.maxrej/100 + if processdat + rmep(1,end+1:end+length(find(EEG.reject.rejjp))) = alleps(EEG.reject.rejjp); + alleps(EEG.reject.rejjp) = []; + EEG = pop_rejepoch( EEG,EEG.reject.rejjp,0); % actually reject high prob epochs + else + rmep(1,end+1:end+length(find(EEG.reject.icarejjp))) = alleps(EEG.reject.icarejjp); + alleps(EEG.reject.icarejjp) = []; + EEG = pop_rejepoch( EEG,EEG.reject.icarejjp,0); + end; + else + opt.startprob = opt.startprob + 0.5; EEG.reject.icarejjp = [];EEG.reject.rejjpE = []; + fprintf('Re-adjusting probability limits and running again...*********\n'); + end; + else + if opt.startprob > 5 & maxiter < 8 % don't decrease and startover more than 8 times + fprintf('Decreasing probability limits for final pruning...######\n'); + opt.startprob = opt.startprob - 0.5; numrej = 1; maxiter = maxiter+1; % repeat process back to 5 stds + else + if maxiter > 8 + opt.maxrej = 15; % go through last round with a high threshold + else + repeat = 0; + end; + end; + end; + end; + + % run kurtosis check + % ------------------ + disp('Final kurotsis reject...'); + EEG = pop_rejkurt(EEG,processdat,complist ,6,6,0,0); + numrej = length(find(EEG.reject.icarejkurt)); % count number of epochs marked + if numrej > 0 + rmep(1,end+1:end+length(find(EEG.reject.icarejkurt))) = alleps(EEG.reject.icarejkurt); + alleps(EEG.reject.icarejjp) = []; + EEG = pop_rejepoch( EEG,EEG.reject.icarejkurt,0); + end; + + %-------------------------------------------- + + EEG = EEGIN; + if strcmpi(opt.eegplot, 'on') + EEG = EEGIN; + EEG.reject.rejauto = zeros(1, length(EEG.trials)); + EEG.reject.rejauto(rmep) = 1; + EEG.reject.rejautoE = zeros(EEG.nbchan, EEG.trials); + + colrej = EEG.reject.rejmanualcol; + rej = EEG.reject.rejauto; + rejE = EEG.reject.rejautoE; + elecrange = complist; + superpose = 0; + icacomp = processdat; + macrorej = 'EEG.reject.rejauto'; + macrorejE = 'EEG.reject.rejautoE'; + reject = 1; + + eeg_rejmacro; % script macro for generating command and old rejection arrays + + eegplot( EEG.data(elecrange,:,:), 'srate', EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + else + EEG = pop_rejepoch( EEG, rmep, 0); % actually reject high prob epochs + end; + + com = sprintf('EEG = pop_autorej(EEG, %s);', vararg2str( varargin )); + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_averef.m b/code/eeglab13_4_4b/functions/popfunc/pop_averef.m new file mode 100644 index 0000000..75b8b9c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_averef.m @@ -0,0 +1,73 @@ +% pop_averef() - Convert an EEG dataset to average reference. +% This function is obsolete. See pop_reref() instead. +% +% Usage: +% >> EEGOUT = pop_averef( EEG ); +% +% Author: Arnaud Delorme, CNL / Salk Institute, 22 March 2002 +% +% See also: eeglab(), reref(), averef() + +% Copyright (C) 22 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_averef( EEG, confirm); + +[EEG, com] = pop_reref(EEG, []); +return; + +com = ''; +if nargin < 1 + help pop_averef; + return; +end; +if isempty(EEG.data) + error('Pop_averef: cannot process empty data'); +end; + +if nargin < 2 | confirm == 1 + % which set to save + % ----------------- + ButtonName=questdlg2( strvcat('Convert the data to average reference?', ... + 'Note: ICA activations will also be converted if they exist...'), ... + 'Average reference confirmation -- pop_averef()', 'Cancel', 'Yes','Yes'); + switch lower(ButtonName), + case 'cancel', return; + end; + confirm = 0; +end; + +EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts*EEG.trials); +if ~isempty(EEG.icaweights) + disp('pop_averef(): converting ICA weight matrix to average reference (see >> help averef)'); + [EEG.data EEG.icaweights EEG.icasphere EEG.rmave] = averef(EEG.data,EEG.icaweights,EEG.icasphere); + EEG.icawinv = []; + if size(EEG.icaweights,1) > EEG.nbchan + disp('Warning: one or more channels may have been removed; component weight re-referencing may be inaccurate'); + end; + if size(EEG.icasphere,1) < EEG.nbchan + disp('Warning: one or more components may have been removed; component weight re-referencing could be inaccurate'); + end; +else + EEG.data = averef(EEG.data); +end; +EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts, EEG.trials); +EEG.averef = 'Yes'; +EEG.icaact = []; +EEG = eeg_checkset(EEG); + +com = sprintf('%s = pop_averef( %s, %d);', inputname(1), inputname(1), confirm); +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_biosig.m b/code/eeglab13_4_4b/functions/popfunc/pop_biosig.m new file mode 100644 index 0000000..4ad04f7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_biosig.m @@ -0,0 +1,260 @@ +% pop_biosig() - import data files into EEGLAB using BIOSIG toolbox +% +% Usage: +% >> OUTEEG = pop_biosig; % pop up window +% >> OUTEEG = pop_biosig( filename, channels, type); +% +% Inputs: +% filename - [string] file name +% +% Optional inputs: +% 'channels' - [integer array] list of channel indices +% 'blockrange' - [min max] integer range of data blocks to import, in seconds. +% Entering [0 3] will import the first three blocks of data. +% Default is empty -> import all data blocks. +% 'importevent' - ['on'|'off'] import events. Default if 'on'. +% 'importannot' - ['on'|'off'] import annotations (EDF+ only). Default if 'on' +% 'blockepoch' - ['on'|'off'] force importing continuous data. Default is 'on' +% 'ref' - [integer] channel index or index(s) for the reference. +% Reference channels are not removed from the data, +% allowing easy re-referencing. If more than one +% channel, data are referenced to the average of the +% indexed channels. WARNING! Biosemi Active II data +% are recorded reference-free, but LOSE 40 dB of SNR +% if no reference is used!. If you do not know which +% channel to use, pick one and then re-reference after +% the channel locations are read in. {default: none}. +% For more information see http://www.biosemi.com/faq/cms&drl.htm +% 'refoptions' - [Cell] Option for the pop_reref function. Default is to +% remove the reference channel if there is one of them and to +% keep it if there are several of them from the graphic +% interface. From the command line default option is to +% keep the reference channel. +% 'rmeventchan' - ['on'|'off'] remove event channel after event +% extraction. Default is 'on'. +% 'memorymapped' - ['on'|'off'] import memory mapped file (useful if +% encountering memory errors). Default is 'off'. +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Oct. 29, 2003- +% +% Note: BIOSIG toolbox must be installed. Download BIOSIG at +% http://biosig.sourceforge.net +% Contact a.schloegl@ieee.org for troubleshooting using BIOSIG. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command, dat] = pop_biosig(filename, varargin); +EEG = []; +command = ''; + +if ~plugin_askinstall('Biosig', 'sopen'), return; end; + +if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.*', 'Choose a data file -- pop_biosig()'); %%% this is incorrect in original version!!!!!!!!!!!!!! + drawnow; + + if filename == 0 return; end; + filename = [filepath filename]; + + % look if MEG + % ----------- + if length(filepath)>4 + if strcmpi(filepath(end-3:end-1), '.ds'), filename = filepath(1:end-1); end; + end; + + % open file to get infos + % ---------------------- + disp('Reading data file header...'); + dat = sopen(filename, 'r', [], 'OVERFLOWDETECTION:OFF'); + if ~isfield(dat, 'NRec') + error('Unsuported data format'); + end; + + % special BIOSEMI + % --------------- + eeglab_options; + if strcmpi(dat.TYPE, 'BDF') + disp(upper('We highly recommend that you choose a reference channel IF these are Biosemi data')); + disp(upper('(e.g., a mastoid or other channel). Otherwise the data will lose 40 dB of SNR!')); + disp('For more information, see http://www.biosemi.com/faq/cms&drl.htm'); + end; + uilist = { { 'style' 'text' 'String' 'Channel list (defaut all):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' [ 'Data range (in seconds) to read (default all [0 ' int2str(dat.NRec) '])' ] } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' 'Extract event' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 'enable' 'on' } {} ... + { 'style' 'text' 'String' 'Import anotations (EDF+ only)' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 'enable' 'on' } {} ... + { 'style' 'text' 'String' 'Force importing continuous data' 'value' 1} ... + { 'style' 'checkbox' 'string' '' 'value' 0 } {} ... + { 'style' 'text' 'String' 'Reference chan(s) indices - required for BIOSEMI' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'checkbox' 'String' 'Import as memory mapped file (use if out of memory error)' 'value' option_memmapdata } }; + geom = { [3 1] [3 1] [3 0.35 0.5] [3 0.35 0.5] [3 0.35 0.5] [3 1] [1] }; + + result = inputgui( geom, uilist, 'pophelp(''pop_biosig'')', ... + 'Load data using BIOSIG -- pop_biosig()'); + if length(result) == 0 return; end; + + % decode GUI params + % ----------------- + options = {}; + if ~isempty(result{1}), options = { options{:} 'channels' eval( [ '[' result{1} ']' ] ) }; end; + if ~isempty(result{2}), options = { options{:} 'blockrange' eval( [ '[' result{2} ']' ] ) }; end; + if length(result) > 2 + if ~result{3}, options = { options{:} 'importevent' 'off' }; end; + if ~result{4}, options = { options{:} 'importannot' 'off' }; end; + if result{5}, options = { options{:} 'blockepoch' 'off' }; end; + if ~isempty(result{6}), options = { options{:} 'ref' eval( [ '[' result{6} ']' ] ) }; end; + if result{7}, options = { options{:} 'memorymapped' 'on' }; end; + end; + if length(eval( [ '[' result{6} ']' ] )) > 1 + options = { options{:} 'refoptions' { 'keepref' 'off' } }; + end; +else + options = varargin; +end; + +% decode imput parameters +% ----------------------- +g = finputcheck( options, { 'blockrange' 'integer' [0 Inf] []; + 'channels' 'integer' [0 Inf] []; + 'ref' 'integer' [0 Inf] []; + 'refoptions' 'cell' {} { 'keepref' 'on' }; + 'rmeventchan' 'string' { 'on';'off' } 'on'; + 'importevent' 'string' { 'on';'off' } 'on'; + 'importannot' 'string' { 'on';'off' } 'on'; + 'memorymapped' 'string' { 'on';'off' } 'off'; + 'blockepoch' 'string' { 'on';'off' } 'off' }, 'pop_biosig'); +if isstr(g), error(g); end; + +% import data +% ----------- +EEG = eeg_emptyset; +[dat DAT interval] = readfile(filename, g.channels, g.blockrange, g.memorymapped); + +if strcmpi(g.blockepoch, 'off') + dat.NRec = 1; +end; + +EEG = biosig2eeglab(dat, DAT, interval, g.channels, strcmpi(g.importevent, 'on')); + +if strcmpi(g.rmeventchan, 'on') & strcmpi(dat.TYPE, 'BDF') & isfield(dat, 'BDF') + if size(EEG.data,1) >= dat.BDF.Status.Channel, + disp('Removing event channel...'); + EEG.data(dat.BDF.Status.Channel,:) = []; + if ~isempty(EEG.chanlocs) && length(EEG.chanlocs) >= dat.BDF.Status.Channel + EEG.chanlocs(dat.BDF.Status.Channel) = []; + end; + end; + EEG.nbchan = size(EEG.data,1); +end; + +% rerefencing +% ----------- +if ~isempty(g.ref) + disp('Re-referencing...'); + EEG = pop_reref(EEG, g.ref, g.refoptions{:}); +% EEG.data = EEG.data - repmat(mean(EEG.data(g.ref,:),1), [size(EEG.data,1) 1]); +% if length(g.ref) == size(EEG.data,1) +% EEG.ref = 'averef'; +% end; +% if length(g.ref) == 1 +% disp([ 'Warning: channel ' int2str(g.ref) ' is now zeroed (but still present in the data)' ]); +% else +% disp([ 'Warning: data matrix rank has decreased through re-referencing' ]); +% end; +end; + +% test if annotation channel is present +% ------------------------------------- +if isfield(dat, 'EDFplus') && strcmpi(g.importannot, 'on') + tmpfields = fieldnames(dat.EDFplus); + for ind = 1:length(tmpfields) + tmpdat = getfield(dat.EDFplus, tmpfields{ind}); + if length(tmpdat) == EEG.pnts + EEG.data(end+1,:) = tmpdat; + EEG.nbchan = EEG.nbchan+1; + if ~isempty(EEG.chanlocs) + EEG.chanlocs(end+1).labels = tmpfields{ind}; + end; + end; + end; +end; + +% convert data to single if necessary +% ----------------------------------- +EEG = eeg_checkset(EEG,'makeur'); % Make EEG.urevent field +EEG = eeg_checkset(EEG); + +% history +% ------- +if isempty(options) + command = sprintf('EEG = pop_biosig(''%s'');', filename); +else + command = sprintf('EEG = pop_biosig(''%s'', %s);', filename, vararg2str(options)); +end; + +% --------- +% read data +% --------- +function [dat DAT interval] = readfile(filename, channels, blockrange, memmapdata); + +if isempty(channels), channels = 0; end; +dat = sopen(filename, 'r', channels,'OVERFLOWDETECTION:OFF'); + +if strcmpi(memmapdata, 'off') + fprintf('Reading data in %s format...\n', dat.TYPE); + + if ~isempty(blockrange) + newblockrange = blockrange; +% newblockrange = newblockrange*dat.Dur; + DAT=sread(dat, newblockrange(2)-newblockrange(1), newblockrange(1)); + else + DAT=sread(dat, Inf);% this isn't transposed in original!!!!!!!! + newblockrange = []; + end + sclose(dat); +else + fprintf('Reading data in %s format (file will be mapped to memory so this may take a while)...\n', dat.TYPE); + inc = ceil(250000/(dat.NS*dat.SPR)); % 1Mb block + + if isempty(blockrange), blockrange = [0 dat.NRec]; end; + blockrange(2) = min(blockrange(2), dat.NRec); + allblocks = [blockrange(1):inc:blockrange(end)]; + count = 1; + for bind = 1:length(allblocks)-1 + TMPDAT=sread(dat, (allblocks(bind+1)-allblocks(bind))*dat.Dur, allblocks(bind)*dat.Dur); + if bind == 1 + DAT = mmo([], [size(TMPDAT,2) (allblocks(end)-allblocks(1))*dat.SPR]); + end; + DAT(:,count:count+length(TMPDAT)-1) = TMPDAT'; + count = count+length(TMPDAT); + end; + sclose(dat); +end; + +if ~isempty(blockrange) + interval(1) = blockrange(1) * dat.SampleRate(1) + 1; + interval(2) = blockrange(2) * dat.SampleRate(1); +else interval = []; +end diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_biosig16.m b/code/eeglab13_4_4b/functions/popfunc/pop_biosig16.m new file mode 100644 index 0000000..96b60cf --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_biosig16.m @@ -0,0 +1,270 @@ +% pop_biosig() - import data files into EEGLAB using BIOSIG toolbox +% +% Usage: +% >> OUTEEG = pop_biosig; % pop up window +% >> OUTEEG = pop_biosig( filename, channels, type); +% +% Inputs: +% filename - [string] file name +% +% Optional inputs: +% 'channels' - [integer array] list of channel indices +% 'blockrange' - [min max] integer range of data blocks to import, in seconds. +% Entering [0 3] will import the first three blocks of data. +% Default is empty -> import all data blocks. +% 'ref' - [integer] channel index or index(s) for the reference. +% Reference channels are not removed from the data, +% allowing easy re-referencing. If more than one +% channel, data are referenced to the average of the +% indexed channels. WARNING! Biosemi Active II data +% are recorded reference-free, but LOSE 40 dB of SNR +% if no reference is used!. If you do not know which +% channel to use, pick one and then re-reference after +% the channel locations are read in. {default: none} +% 'rmeventchan' - ['on'|'off'] remove event channel after event +% extraction. Default is 'on'. +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Oct. 29, 2003- +% +% Note: BIOSIG toolbox must be installed. Download BIOSIG at +% http://biosig.sourceforge.net +% Contact a.schloegl@ieee.org for troubleshooting using BIOSIG. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = my_pop_biosig(filename, varargin); +EEG = []; +command = ''; + +if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.*', 'Choose an BDF file -- pop_biosig()'); %%% this is incorrect in original version!!!!!!!!!!!!!! + drawnow; + + if filename == 0 return; end; + filename = [filepath filename]; + + % open file to get infos + % ---------------------- + disp('Reading data file header...'); + dat = sopen(filename); + + % special BIOSEMI + % --------------- + if strcmpi(dat.TYPE, 'BDF') + disp('We highly recommend that you choose a reference channel IF these are Biosemi data'); + disp('(e.g., a mastoid or other channel). Otherwise the data will lose 40 dB of SNR!'); + end; + uilist = { { 'style' 'text' 'String' 'Channel list (defaut all):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' [ 'Data range (in seconds) to read (default all [0 ' int2str(dat.NRec) '])' ] } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' 'Extract event - cannot be unset (set=yes)' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 'enable' 'on' } {} ... + { 'style' 'text' 'String' 'Import continuous data (set=yes)' 'value' 1} ... + { 'style' 'checkbox' 'string' '' 'value' 0 } {} ... + { 'style' 'text' 'String' 'Reference chan(s) indices - required for BIOSEMI' } ... + { 'style' 'edit' 'string' '' } }; + geom = { [3 1] [3 1] [3 0.35 0.5] [3 0.35 0.5] [3 1] }; + result = inputgui( geom, uilist, 'pophelp(''pop_biosig'')', ... + 'Load data using BIOSIG -- pop_biosig()'); + if length(result) == 0 return; end; + + % decode GUI params + % ----------------- + options = {}; + if ~isempty(result{1}), options = { options{:} 'channels' eval( [ '[' result{1} ']' ] ) }; end; + if ~isempty(result{2}), options = { options{:} 'blockrange' eval( [ '[' result{2} ']' ] ) }; end; + if length(result) > 2 + if ~isempty(result{4}), options = { options{:} 'ref' eval( [ '[' result{4} ']' ] ) }; end; + if ~result{3}, options = { options{:} 'rmeventchan' 'off' }; end; + end; +else + options = varargin; +end; + +% decode imput parameters +% ----------------------- +g = finputcheck( options, { 'blockrange' 'integer' [0 Inf] []; + 'channels' 'integer' [0 Inf] []; + 'ref' 'integer' [0 Inf] []; + 'rmeventchan' 'string' { 'on';'off' } 'on' }, 'pop_biosig'); +if isstr(g), error(g); end; + +% import data +% ----------- +EEG = eeg_emptyset; +if ~isempty(g.channels) + dat = sopen(filename, 'r', g.channels,'OVERFLOWDETECTION:OFF'); +else dat = sopen(filename, 'r', 0,'OVERFLOWDETECTION:OFF'); +end +fprintf('Reading data in %s format...\n', dat.TYPE); + +if ~isempty(g.blockrange) + newblockrange = g.blockrange; + newblockrange(2) = min(newblockrange(2), dat.NRec); + newblockrange = newblockrange*dat.Dur; + DAT=sread(dat, newblockrange(2)-newblockrange(1), newblockrange(1))'; +else + DAT=sread(dat, Inf)';% this isn't transposed in original!!!!!!!! + newblockrange = []; +end +dat = sclose(dat); + +% convert to seconds for sread +% ---------------------------- +EEG.nbchan = size(DAT,1); +EEG.srate = dat.SampleRate(1); +EEG.data = DAT; +clear DAT; +% $$$ try % why would you do the following??????? JO +% $$$ EEG.data = EEG.data'; +% $$$ catch, +% $$$ pack; +% $$$ EEG.data = EEG.data'; +% $$$ end; +EEG.setname = sprintf('%s file', dat.TYPE); +EEG.comments = [ 'Original file: ' filename ]; +EEG.xmin = 0; +if strcmpi(dat.TYPE, 'BDF') || strcmpi(dat.TYPE, 'EDF') + EEG.trials = 1; + EEG.pnts = size(EEG.data,2); +else + EEG.trials = dat.NRec; + EEG.pnts = size(EEG.data,2)/dat.NRec; +end +if isfield(dat, 'Label') & ~isempty(dat.Label) + EEG.chanlocs = struct('labels', cellstr(char(dat.Label))); +end +EEG = eeg_checkset(EEG); + +% extract events % this part I totally revamped to work... JO +% -------------- +disp('Extracting events from last EEG channel...'); +EEG.event = []; + +% $$$ startval = mode(EEG.data(end,:)); % my code +% $$$ for p = 2:size(EEG.data,2)-1 +% $$$ [codeout] = code(EEG.data(end,p)); +% $$$ if EEG.data(end,p) > EEG.data(end,p-1) & EEG.data(end,p) >= EEG.data(end,p+1) +% $$$ EEG.event(end+1).latency = p; +% $$$ EEG.event(end).type = bitand(double(EEG.data(end,p)-startval),255); +% $$$ end; +% $$$ end; + +% lastout = mod(EEG.data(end,1),256);newevs = []; % andrey's code 8 bits +% codeout = mod(EEG.data(end,2),256); +% for p = 2:size(EEG.data,2)-1 +% nextcode = mod(EEG.data(end,p+1),256); +% if codeout > lastout & codeout >= nextcode +% newevs = [newevs codeout]; +% EEG.event(end+1).latency = p; +% EEG.event(end).type = codeout; +% end; +% lastout = codeout; +% codeout = nextcode; +% end; + +%lastout = mod(EEG.data(end,1),256*256);newevs = []; % andrey's code 16 bits +%codeout = mod(EEG.data(end,2),256*256); +%for p = 2:size(EEG.data,2)-1 +% nextcode = mod(EEG.data(end,p+1),256*256); +% if (codeout > lastout) & (codeout >= nextcode) +% newevs = [newevs codeout]; +% EEG.event(end+1).latency = p; +% EEG.event(end).type = codeout; +% end; +% lastout = codeout; +% codeout = nextcode; +%end; + +% Modifieded by Andrey (Aug.5,2008) to detect all non-zero codes: +thiscode = 0; +for p = 1:size(EEG.data,2)-1 + prevcode = thiscode; + thiscode = mod(EEG.data(end,p),256*256); % andrey's code - 16 bits + if (thiscode ~= 0) && (thiscode~=prevcode) + EEG.event(end+1).latency = p; + EEG.event(end).type = thiscode; + end; +end; + +if strcmpi(g.rmeventchan, 'on') + EEG.data(dat.BDF.Status.Channel,:) = []; + EEG.nbchan = size(EEG.data,1); + if ~isempty(EEG.chanlocs) + EEG.chanlocs(dat.BDF.Status.Channel,:) = []; + end; +end; +EEG = eeg_checkset(EEG, 'eventconsistency'); + +% $$$ if ~isempty(dat.EVENT) +% $$$ if isfield(dat, 'out') % Alois fix for event interval does not work +% $$$ if isfield(dat.out, 'EVENT') +% $$$ dat.EVENT = dat.out.EVENT; +% $$$ end; +% $$$ end; +% $$$ if ~isempty(newblockrange) +% $$$ interval(1) = newblockrange(1) * dat.SampleRate(1) + 1; +% $$$ interval(2) = newblockrange(2) * dat.SampleRate(1); +% $$$ else interval = []; +% $$$ end +% $$$ EEG.event = biosig2eeglabevent(dat.EVENT, interval); % Toby's fix +% $$$ if strcmpi(g.rmeventchan, 'on') & strcmpi(dat.TYPE, 'BDF') & isfield(dat, 'BDF') +% $$$ disp('Removing event channel...'); +% $$$ EEG.data(dat.BDF.Status.Channel,:) = []; +% $$$ EEG.nbchan = size(EEG.data,1); +% $$$ if ~isempty(EEG.chanlocs) +% $$$ EEG.chanlocs(dat.BDF.Status.Channel,:) = []; +% $$$ end; +% $$$ end; +% $$$ EEG = eeg_checkset(EEG, 'eventconsistency'); +% $$$ else +% $$$ disp('Warning: no event found. Events might be embeded in a data channel.'); +% $$$ disp(' To extract events, use menu File > Import Event Info > From data channel'); +% $$$ end; + +% rerefencing +% ----------- +if ~isempty(g.ref) + disp('Re-referencing...'); + EEG.data = EEG.data - repmat(mean(EEG.data(g.ref,:),1), [size(EEG.data,1) 1]); + if length(g.ref) == size(EEG.data,1) + EEG.ref = 'averef'; + end; + if length(g.ref) == 1 + disp([ 'Warning: channel ' int2str(g.ref) ' is now zeroed (but still present in the data)' ]); + else + disp([ 'Warning: data matrix rank has decreased through re-referencing' ]); + end; +end; + +% convert data to single if necessary +% ----------------------------------- +EEG = eeg_checkset(EEG,'makeur'); % Make EEG.urevent field +EEG = eeg_checkset(EEG); + +% history +% ------- +if isempty(options) + command = sprintf('EEG = my_pop_biosig(''%s'');', filename); +else + command = sprintf('EEG = my_pop_biosig(''%s'', %s);', filename, vararg2str(options)); +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_biosig16ying.m b/code/eeglab13_4_4b/functions/popfunc/pop_biosig16ying.m new file mode 100644 index 0000000..5b65f8a --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_biosig16ying.m @@ -0,0 +1,271 @@ +% pop_biosig() - import data files into EEGLAB using BIOSIG toolbox +% +% Usage: +% >> OUTEEG = pop_biosig; % pop up window +% >> OUTEEG = pop_biosig( filename, channels, type); +% +% Inputs: +% filename - [string] file name +% +% Optional inputs: +% 'channels' - [integer array] list of channel indices +% 'blockrange' - [min max] integer range of data blocks to import, in seconds. +% Entering [0 3] will import the first three blocks of data. +% Default is empty -> import all data blocks. +% 'ref' - [integer] channel index or index(s) for the reference. +% Reference channels are not removed from the data, +% allowing easy re-referencing. If more than one +% channel, data are referenced to the average of the +% indexed channels. WARNING! Biosemi Active II data +% are recorded reference-free, but LOSE 40 dB of SNR +% if no reference is used!. If you do not know which +% channel to use, pick one and then re-reference after +% the channel locations are read in. {default: none} +% 'rmeventchan' - ['on'|'off'] remove event channel after event +% extraction. Default is 'on'. +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Oct. 29, 2003- +% +% Note: BIOSIG toolbox must be installed. Download BIOSIG at +% http://biosig.sourceforge.net +% Contact a.schloegl@ieee.org for troubleshooting using BIOSIG. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = my_pop_biosig(filename, varargin); +EEG = []; +command = ''; + +if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.*', 'Choose an BDF file -- pop_biosig()'); %%% this is incorrect in original version!!!!!!!!!!!!!! + drawnow; + + if filename == 0 return; end; + filename = [filepath filename]; + + % open file to get infos + % ---------------------- + disp('Reading data file header...'); + dat = sopen(filename); + + % special BIOSEMI + % --------------- + if strcmpi(dat.TYPE, 'BDF') + disp('We highly recommend that you choose a reference channel IF these are Biosemi data'); + disp('(e.g., a mastoid or other channel). Otherwise the data will lose 40 dB of SNR!'); + end; + uilist = { { 'style' 'text' 'String' 'Channel list (defaut all):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' [ 'Data range (in seconds) to read (default all [0 ' int2str(dat.NRec) '])' ] } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' 'Extract event - cannot be unset (set=yes)' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 'enable' 'on' } {} ... + { 'style' 'text' 'String' 'Import continuous data (set=yes)' 'value' 1} ... + { 'style' 'checkbox' 'string' '' 'value' 0 } {} ... + { 'style' 'text' 'String' 'Reference chan(s) indices - required for BIOSEMI' } ... + { 'style' 'edit' 'string' '' } }; + geom = { [3 1] [3 1] [3 0.35 0.5] [3 0.35 0.5] [3 1] }; + result = inputgui( geom, uilist, 'pophelp(''pop_biosig'')', ... + 'Load data using BIOSIG -- pop_biosig()'); + if length(result) == 0 return; end; + + % decode GUI params + % ----------------- + options = {}; + if ~isempty(result{1}), options = { options{:} 'channels' eval( [ '[' result{1} ']' ] ) }; end; + if ~isempty(result{2}), options = { options{:} 'blockrange' eval( [ '[' result{2} ']' ] ) }; end; + if length(result) > 2 + if ~isempty(result{4}), options = { options{:} 'ref' eval( [ '[' result{4} ']' ] ) }; end; + if ~result{3}, options = { options{:} 'rmeventchan' 'off' }; end; + end; +else + options = varargin; +end; + +% decode imput parameters +% ----------------------- +g = finputcheck( options, { 'blockrange' 'integer' [0 Inf] []; + 'channels' 'integer' [0 Inf] []; + 'ref' 'integer' [0 Inf] []; + 'rmeventchan' 'string' { 'on';'off' } 'on' }, 'pop_biosig'); +if isstr(g), error(g); end; + +% import data +% ----------- +EEG = eeg_emptyset; +if ~isempty(g.channels) + dat = sopen(filename, 'r', g.channels,'OVERFLOWDETECTION:OFF'); +else dat = sopen(filename, 'r', 0,'OVERFLOWDETECTION:OFF'); +end +fprintf('Reading data in %s format...\n', dat.TYPE); + +if ~isempty(g.blockrange) + newblockrange = g.blockrange; + newblockrange(2) = min(newblockrange(2), dat.NRec); + newblockrange = newblockrange*dat.Dur; + DAT=sread(dat, newblockrange(2)-newblockrange(1), newblockrange(1))'; +else + DAT=sread(dat, Inf)';% this isn't transposed in original!!!!!!!! + newblockrange = []; +end +dat = sclose(dat); + +% convert to seconds for sread +% ---------------------------- +EEG.nbchan = size(DAT,1); +EEG.srate = dat.SampleRate(1); +EEG.data = DAT; +clear DAT; +% $$$ try % why would you do the following??????? JO +% $$$ EEG.data = EEG.data'; +% $$$ catch, +% $$$ pack; +% $$$ EEG.data = EEG.data'; +% $$$ end; +EEG.setname = sprintf('%s file', dat.TYPE); +EEG.comments = [ 'Original file: ' filename ]; +EEG.xmin = 0; +if strcmpi(dat.TYPE, 'BDF') || strcmpi(dat.TYPE, 'EDF') + EEG.trials = 1; + EEG.pnts = size(EEG.data,2); +else + EEG.trials = dat.NRec; + EEG.pnts = size(EEG.data,2)/dat.NRec; +end +if isfield(dat, 'Label') & ~isempty(dat.Label) + EEG.chanlocs = struct('labels', cellstr(char(dat.Label))); +end +EEG = eeg_checkset(EEG); + +% extract events % this part I totally revamped to work... JO +% -------------- +disp('Extracting events from last EEG channel...'); +EEG.event = []; + +% $$$ startval = mode(EEG.data(end,:)); % my code +% $$$ for p = 2:size(EEG.data,2)-1 +% $$$ [codeout] = code(EEG.data(end,p)); +% $$$ if EEG.data(end,p) > EEG.data(end,p-1) & EEG.data(end,p) >= EEG.data(end,p+1) +% $$$ EEG.event(end+1).latency = p; +% $$$ EEG.event(end).type = bitand(double(EEG.data(end,p)-startval),255); +% $$$ end; +% $$$ end; + +% lastout = mod(EEG.data(end,1),256);newevs = []; % andrey's code 8 bits +% codeout = mod(EEG.data(end,2),256); +% for p = 2:size(EEG.data,2)-1 +% nextcode = mod(EEG.data(end,p+1),256); +% if codeout > lastout & codeout >= nextcode +% newevs = [newevs codeout]; +% EEG.event(end+1).latency = p; +% EEG.event(end).type = codeout; +% end; +% lastout = codeout; +% codeout = nextcode; +% end; + +%lastout = mod(EEG.data(end,1),256*256);newevs = []; % andrey's code 16 bits +%codeout = mod(EEG.data(end,2),256*256); +%for p = 2:size(EEG.data,2)-1 +% nextcode = mod(EEG.data(end,p+1),256*256); +% if (codeout > lastout) & (codeout >= nextcode) +% newevs = [newevs codeout]; +% EEG.event(end+1).latency = p; +% EEG.event(end).type = codeout; +% end; +% lastout = codeout; +% codeout = nextcode; +%end; + +% Modifieded by Andrey (Aug.5,2008) to detect all non-zero codes: +thiscode = 0;lastcode=0; +for p = 1:size(EEG.data,2)-1 + prevcode = thiscode; + thiscode = mod(EEG.data(end,p),256*256); % andrey's code - 16 bits + if (thiscode ~= 0) && (thiscode~=prevcode) && (thiscode~=lastcode) % fix to avoid repeated codes (per Ying's demand) + EEG.event(end+1).latency = p; + EEG.event(end).type = thiscode; + lastcode = thiscode; + end; +end; + +if strcmpi(g.rmeventchan, 'on') + EEG.data(dat.BDF.Status.Channel,:) = []; + EEG.nbchan = size(EEG.data,1); + if ~isempty(EEG.chanlocs) + EEG.chanlocs(dat.BDF.Status.Channel,:) = []; + end; +end; +EEG = eeg_checkset(EEG, 'eventconsistency'); + +% $$$ if ~isempty(dat.EVENT) +% $$$ if isfield(dat, 'out') % Alois fix for event interval does not work +% $$$ if isfield(dat.out, 'EVENT') +% $$$ dat.EVENT = dat.out.EVENT; +% $$$ end; +% $$$ end; +% $$$ if ~isempty(newblockrange) +% $$$ interval(1) = newblockrange(1) * dat.SampleRate(1) + 1; +% $$$ interval(2) = newblockrange(2) * dat.SampleRate(1); +% $$$ else interval = []; +% $$$ end +% $$$ EEG.event = biosig2eeglabevent(dat.EVENT, interval); % Toby's fix +% $$$ if strcmpi(g.rmeventchan, 'on') & strcmpi(dat.TYPE, 'BDF') & isfield(dat, 'BDF') +% $$$ disp('Removing event channel...'); +% $$$ EEG.data(dat.BDF.Status.Channel,:) = []; +% $$$ EEG.nbchan = size(EEG.data,1); +% $$$ if ~isempty(EEG.chanlocs) +% $$$ EEG.chanlocs(dat.BDF.Status.Channel,:) = []; +% $$$ end; +% $$$ end; +% $$$ EEG = eeg_checkset(EEG, 'eventconsistency'); +% $$$ else +% $$$ disp('Warning: no event found. Events might be embeded in a data channel.'); +% $$$ disp(' To extract events, use menu File > Import Event Info > From data channel'); +% $$$ end; + +% rerefencing +% ----------- +if ~isempty(g.ref) + disp('Re-referencing...'); + EEG.data = EEG.data - repmat(mean(EEG.data(g.ref,:),1), [size(EEG.data,1) 1]); + if length(g.ref) == size(EEG.data,1) + EEG.ref = 'averef'; + end; + if length(g.ref) == 1 + disp([ 'Warning: channel ' int2str(g.ref) ' is now zeroed (but still present in the data)' ]); + else + disp([ 'Warning: data matrix rank has decreased through re-referencing' ]); + end; +end; + +% convert data to single if necessary +% ----------------------------------- +EEG = eeg_checkset(EEG,'makeur'); % Make EEG.urevent field +EEG = eeg_checkset(EEG); + +% history +% ------- +if isempty(options) + command = sprintf('EEG = my_pop_biosig(''%s'');', filename); +else + command = sprintf('EEG = my_pop_biosig(''%s'', %s);', filename, vararg2str(options)); +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_chancenter.m b/code/eeglab13_4_4b/functions/popfunc/pop_chancenter.m new file mode 100644 index 0000000..bb31762 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_chancenter.m @@ -0,0 +1,103 @@ +% pop_chancenter() - recenter cartesian X,Y,Z channel coordinates +% +% Usage: +% >> chanlocs = pop_chancenter(chanlocs); % pop up interactive window +% >> [chanlocs centerloc] = pop_chancenter(chanlocs, center, omitchan); +% +% Inputs: +% chanlocs = eeglab channel location structure (see readlocs()) +% center = [X Y Z] known center different from [0 0 0] +% [] will optimize the center location according +% to the best sphere. Default is [0 0 0]. +% omitchan = indices of channel to omit when computing center +% +% Outputs: +% chanlocs = updated channel location structure +% centerloc = 3-D location of the new center (in the old coordinate +% frame). +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, Feb 2004 +% +% See also: chancenter(), spherror(), cart2topo() + +% Copyright (C) 2004, Arnaud Delorme, SCCN/INC/UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ chanlocs, newcenter, com] = pop_chancenter( chanlocs, center, omitchans) + +optim = 0; + +if nargin<1 + help pop_chancenter + return; +end; + +com = ''; +newcenter = []; +if nargin < 3 + omitchans = []; +end; +if nargin < 2 + cb_browse = [ 'tmpchans = get(gcbf, ''userdata'');' ... + 'set(findobj(gcbf, ''tag'', ''chans''), ''string'', ' ... + 'int2str(pop_chansel( { tmpchans.labels } )));' ]; + cb_opt = [ 'if get(gcbo, ''value''), ' ... + ' set(findobj(gcbf, ''tag'', ''center''), ''enable'', ''off'');' ... + 'else,' ... + ' set(findobj(gcbf, ''tag'', ''center''), ''enable'', ''on'');' ... + 'end;' ]; + geometry = { [1.3 0.28 1 1] [1] [1] [2 1] }; + uilist = { { 'Style', 'text', 'string', 'Optimize center location', 'fontweight', 'bold' } ... + { 'Style', 'checkbox', 'value', 1 'callback' cb_opt } ... + { 'Style', 'text', 'string', 'or specify center', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', '0 0 0', 'tag' 'center' 'enable' 'off' } ... + { } ... + { 'Style', 'text', 'string', 'Channel indices to ignore for best-sphere matching' } ... + { 'Style', 'edit', 'string', '', 'tag', 'chans' } ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', cb_browse } }; + + results = inputgui( geometry, uilist, 'pophelp(''pop_chancenter'');', ... + 'Convert channel locations -- pop_chancenter()', chanlocs ); + if isempty(results), return; end; + if results{1} + center = []; + else + center = eval( [ '[' results{2} ']' ] ); + end; + if ~isempty(results{3}) + omitchans = eval( [ '[' results{3} ']' ] ); + end; +end; + +% remove channels +% --------------- +c = setdiff_bc([1:length(chanlocs)], union(omitchans, find(cellfun('isempty', { chanlocs.theta })))); + +% optimize center +% --------------- +[X Y Z newcenter]= chancenter( [ chanlocs(c).X ]', [ chanlocs(c).Y ]', [ chanlocs(c).Z ]', center); +for index = 1:length(c) + chanlocs(c(index)).X = X(index); + chanlocs(c(index)).Y = Y(index); + chanlocs(c(index)).Z = Z(index); +end; +disp('Note: automatically convert XYZ coordinates to spherical and polar'); +chanlocs = convertlocs(chanlocs, 'cart2all'); +if ~isempty(omitchans) + disp('Important warning: the location of omitted channels has not been modified'); +end; + +com = sprintf('%s = pop_chancenter( %s, %s);', inputname(1), inputname(1), vararg2str({ center omitchans })); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_chancoresp.m b/code/eeglab13_4_4b/functions/popfunc/pop_chancoresp.m new file mode 100644 index 0000000..5cd7884 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_chancoresp.m @@ -0,0 +1,316 @@ +% pop_chancoresp() - define correspondances between two channel locations structures +% (EEG.chanlocs) automatically (by matching channel labels) +% else using a user input gui. +% Usage: +% >> [chanlist1 chanlist2] = pop_chancoresp(chanstruct1, chanstruc2, 'key', 'val', ...); +% +% Inputs: +% chanstruct1 - first (new) channel locations structure (EEG.chanlocs). +% For details, >> help readlocs +% chanstruct2 - second (reference) chanlocs structure. +% +% Optional parameters: +% 'gui' - ['on'|'off'] display gui or not ('on' -> yes) +% 'autoselect' - ['none'|'fiducials'|'all'] automatically pair channels +% 'chaninfo1' - EEG.chaninfo structure for first (new) EEG.chanlocs +% 'chaninfo2' - EEG.chaninfo structure for second (reference) EEG.chanlocs +% 'chanlist1' - [integer] selected channel to pair in the graphic interface +% for the first channel structure. This requires the input +% 'chanlist2' below. +% 'chanlist2' - [integer] selected channel to pair in the graphic interface +% for the first channel structure. This requires the input +% requires the input 'chanlist1' that must be of the same length. +% Output: +% chanlist1 - [int vector] indices of selected channels from first (new) EEG.chanlocs +% chanlist2 - [int vector] selected channels from second (reference) EEG.chanlocs +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2005 + +% Copyright (C) 2005 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [chanlistout1, chanlistout2, thirdout, outfourth] = pop_chancoresp(chans1, chans2, varargin); + + if nargin < 2 + help pop_chancoresp; + return; + end; + chanlistout1 = []; + chanlistout2 = []; + + % process sub command + % ------------------- + if isstr(chans1) + if strcmpi(chans1, 'pair') + [chanlistout1, chanlistout2, thirdout, outfourth] = pair(chans2, varargin{:}); + elseif strcmpi(chans1, 'unpair') + [chanlistout1, chanlistout2, thirdout, outfourth] = unpair(chans2, varargin{:}); + elseif strcmpi(chans1, 'clear') + [chanlistout1, chanlistout2, thirdout, outfourth] = clearchans(chans2, varargin{:}); + elseif strcmpi(chans1, 'auto') + [chanlistout1, chanlistout2, thirdout, outfourth] = autoselect(chans2, varargin{:}); + end; + return; + end; + + g = finputcheck(varargin, { 'autoselect' 'string' {'none';'fiducials';'all'} 'all'; + 'chanlist1' 'integer' [1 Inf] []; + 'chanlist2' 'integer' [1 Inf] []; + 'chaninfo1' '' [] []; + 'chaninfo2' '' [] []; + 'gui' 'string' { 'on';'off' } 'on' } ); + if isstr(g), error(g); end; + g.chanstruct1 = chans1; + g.chanstruct2 = chans2; + if length(g.chanlist1) ~= length(g.chanlist2) + error('input arguments ''chanlist1'' and ''chanlist2'' must have the same length'); + end; + + % decode different input formats + % ------------------------------ + if isstruct(chans1) + if isfield(chans1, 'label') % fieldtrip + chanstr1 = chans1.label; + chanstr2 = chans2.label; + else % EEGLAB + chanstr1 = { chans1.labels }; + chanstr2 = { chans2.labels }; + end; + else % only channel labels + chanstr1 = chans1; + chanstr2 = chans2; + end; + + % convert selection to integer + % ---------------------------- + if isempty(g.chanlist1) + if strcmpi(g.autoselect, 'fiducials') + % find fiducials in both channel location strustures + % -------------------------------------------------- + naz1 = strmatch('nz', lower( chanstr1 ), 'exact'); if isempty(naz1), naz1 = strmatch('nasion', lower( chanstr1 ), 'exact'); end; if isempty(naz1), naz1 = strmatch('fidnz', lower( chanstr1 ), 'exact'); end; + naz2 = strmatch('nz', lower( chanstr2 ), 'exact'); if isempty(naz2), naz2 = strmatch('nasion', lower( chanstr2 ), 'exact'); end; if isempty(naz2), naz2 = strmatch('fidnz', lower( chanstr2 ), 'exact'); end; + lpa1 = strmatch('lpa', lower( chanstr1 ), 'exact'); if isempty(lpa1), lpa1 = strmatch('left', lower( chanstr1 ), 'exact'); end; if isempty(lpa1), lpa1 = strmatch('fidt10', lower( chanstr1 ), 'exact'); end; + lpa2 = strmatch('lpa', lower( chanstr2 ), 'exact'); if isempty(lpa2), lpa2 = strmatch('left', lower( chanstr2 ), 'exact'); end; if isempty(lpa2), lpa2 = strmatch('fidt10', lower( chanstr2 ), 'exact'); end; + rpa1 = strmatch('rpa', lower( chanstr1 ), 'exact'); if isempty(rpa1), rpa1 = strmatch('right', lower( chanstr1 ), 'exact'); end; if isempty(rpa1), rpa1 = strmatch('fidt9', lower( chanstr1 ), 'exact'); end; + rpa2 = strmatch('rpa', lower( chanstr2 ), 'exact'); if isempty(rpa2), rpa2 = strmatch('right', lower( chanstr2 ), 'exact'); end; if isempty(rpa2), rpa2 = strmatch('fidt9', lower( chanstr2 ), 'exact'); end; + g.chanlist1 = [ naz1 lpa1 rpa1 ]; + g.chanlist2 = [ naz2 lpa2 rpa2 ]; + if length(g.chanlist1) ~= length(g.chanlist2) | length(g.chanlist1) == 0 + disp('Warning: could not find fiducials in at least one of the channel location structure'); + g.chanlist1 = []; + g.chanlist2 = []; + end; + elseif strcmpi(g.autoselect, 'all') + % find common channels in both channel location strustures + % -------------------------------------------------------- + chanstr2low = lower( chanstr2 ); + chanstr1low = lower( chanstr1 ); + for index = 1:length( chanstr1 ) + ind = strmatch(chanstr1low{index}, chanstr2low, 'exact' ); + if ~isempty(ind) + g.chanlist1(end+1) = index; + g.chanlist2(end+1) = ind; + end; + end; + end; + end; + + % plot + % ---- + if strcmpi(g.gui, 'off') + chanlistout1 = g.chanlist1; + chanlistout2 = g.chanlist2; + return; + end; + try, g.promptstring; catch, g.promptstring = ''; end; + try, g.selectionmode; catch, g.selectionmode = 'multiple'; end; + try, g.listsize; catch, g.listsize = []; end; + try, g.initialvalue; catch, g.initialvalue = []; end; + try, g.name; catch, g.name = ''; end; + g.chanstr1 = chanstr1; + g.chanstr2 = chanstr2; + + fig = figure('visible', 'off'); + set(fig, 'name', 'Select corresponding channels to pair'); + + % make text for list + % ------------------ + [ g.newchanstr1 g.newchanstr2 ] = makelisttext( chanstr1, chanstr2, g.chanlist1, g.chanlist2); + + % callback for paring and unpairing + % --------------------------------- + cb_pair = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpval1 = get(findobj(gcbf, ''tag'', ''list1''), ''value'');' ... + 'tmpval2 = get(findobj(gcbf, ''tag'', ''list2''), ''value'');' ... + '[tmpdat.newchanstr1{tmpval1}, tmpdat.newchanstr2{tmpval2}, tmpdat.chanlist1, tmpdat.chanlist2] = pop_chancoresp(''pair'', tmpval1, tmpval2, tmpdat.chanstr1, tmpdat.chanstr2, tmpdat.chanlist1, tmpdat.chanlist2, tmpdat.newchanstr1{tmpval1}, tmpdat.newchanstr2{tmpval2});' ... + 'set(findobj(gcbf, ''tag'', ''list1''), ''string'', tmpdat.newchanstr1);' ... + 'set(findobj(gcbf, ''tag'', ''list2''), ''string'', tmpdat.newchanstr2);' ... + 'set(gcbf, ''userdata'', tmpdat);' ... + 'clear tmpdat tmpval1 tmpval2;' ]; + cb_unpair = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpval1 = get(findobj(gcbf, ''tag'', ''list1''), ''value'');' ... + 'tmpval2 = get(findobj(gcbf, ''tag'', ''list2''), ''value'');' ... + '[tmpdat.newchanstr1{tmpval1}, tmpdat.newchanstr2{tmpval2}, tmpdat.chanlist1, tmpdat.chanlist2] = pop_chancoresp(''unpair'', tmpval1, tmpval2, tmpdat.chanstr1, tmpdat.chanstr2, tmpdat.chanlist1, tmpdat.chanlist2, tmpdat.newchanstr1{tmpval1}, tmpdat.newchanstr2{tmpval2});' ... + 'set(findobj(gcbf, ''tag'', ''list1''), ''string'', tmpdat.newchanstr1);' ... + 'set(findobj(gcbf, ''tag'', ''list2''), ''string'', tmpdat.newchanstr2);' ... + 'set(gcbf, ''userdata'', tmpdat);' ... + 'clear tmpdat tmpval1 tmpval2;' ]; + cb_plot1 = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'figure; topoplot([], tmpdat.chanstruct1, ''style'', ''blank'', ''drawaxis'', ''on'', ' ... + '''electrodes'', ''labelpoint'', ''chaninfo'', tmpdat.chaninfo1);' ]; + cb_plot2 = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'figure; topoplot([], tmpdat.chanstruct2, ''style'', ''blank'', ''drawaxis'', ''on'', ' ... + '''electrodes'', ''labelpoint'', ''chaninfo'', tmpdat.chaninfo2);' ]; + cb_list1 = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpval = get(findobj(gcbf, ''tag'', ''list1''), ''value'');' ... + 'tmppos = find(tmpdat.chanlist1 == tmpval);' ... + 'if ~isempty(tmppos), set(findobj(gcbf, ''tag'', ''list2''), ''value'', tmpdat.chanlist2(tmppos)); end;' ... + 'clear tmpdat tmpval tmppos;' ]; + cb_list2 = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpval = get(findobj(gcbf, ''tag'', ''list2''), ''value'');' ... + 'tmppos = find(tmpdat.chanlist2 == tmpval);' ... + 'if ~isempty(tmppos), set(findobj(gcbf, ''tag'', ''list1''), ''value'', tmpdat.chanlist1(tmppos)); end;' ... + 'clear tmpdat tmpval tmppos;' ]; + cb_clear = [ 'tmpdat = get(gcbf, ''userdata'');' ... + '[tmpdat.newchanstr1, tmpdat.newchanstr2, tmpdat.chanlist1, tmpdat.chanlist2] = pop_chancoresp(''clear'', tmpdat.chanstr1, tmpdat.chanstr2);' ... + 'set(gcbf, ''userdata'', tmpdat);' ... + 'set(findobj(gcbf, ''tag'', ''list1''), ''string'', tmpdat.newchanstr1);' ... + 'set(findobj(gcbf, ''tag'', ''list2''), ''string'', tmpdat.newchanstr2);' ... + 'set(gcbf, ''userdata'', tmpdat);' ... + 'clear tmpdat;' ]; + cb_auto = [ 'tmpdat = get(gcbf, ''userdata'');' ... + '[tmpdat.newchanstr1, tmpdat.newchanstr2, tmpdat.chanlist1, tmpdat.chanlist2] = pop_chancoresp(''auto'', tmpdat.chanstr1, tmpdat.chanstr2, tmpdat.newchanstr1, tmpdat.newchanstr2, tmpdat.chanlist1, tmpdat.chanlist2);' ... + 'set(gcbf, ''userdata'', tmpdat);' ... + 'set(findobj(gcbf, ''tag'', ''list1''), ''string'', tmpdat.newchanstr1);' ... + 'set(findobj(gcbf, ''tag'', ''list2''), ''string'', tmpdat.newchanstr2);' ... + 'set(gcbf, ''userdata'', tmpdat);' ... + 'clear tmpdat;' ]; + geometry = {[1 1] [1 1] [1 1] [1 1] [1 1]}; + geomvert = [ 1 min(max(length(chanstr1),length(chanstr2)), 10) 1 1 1]; + listui = { ... + { 'Style', 'pushbutton', 'string', 'Plot new montage', 'callback', cb_plot1 } ... + { 'Style', 'pushbutton', 'string', 'Plot ref montage', 'callback', cb_plot2 } ... + { 'Style', 'listbox', 'tag', 'list1', 'string', g.newchanstr1, 'value', 1, 'min', 1, 'max', 2, 'callback', cb_list1 } ... + { 'Style', 'listbox', 'tag', 'list2', 'string', g.newchanstr2, 'value', 1, 'min', 1, 'max', 2, 'callback', cb_list2 } ... + { 'Style', 'pushbutton', 'string', 'Pair channels' , 'callback', cb_pair } ... + { 'Style', 'pushbutton', 'string', 'Clear this pair', 'callback', cb_unpair } ... + { 'Style', 'pushbutton', 'string', 'Clear all pairs' , 'callback', cb_clear } ... + { 'Style', 'pushbutton', 'string', 'Auto select', 'callback', cb_auto } ... + { 'Style', 'pushbutton', 'string', 'Cancel', 'callback', 'close(gcbf);' } ... + { 'Style', 'pushbutton', 'string', 'Ok' , 'tag', 'ok', 'callback', ['set(gcbo, ''userdata'', ''ok'');'] } }; + + [tmp tmp2 allobj] = supergui( fig, geometry, geomvert, listui{:} ); + set(fig, 'userdata', g); + + % decode output + % ------------- + okbut = findobj( 'parent', fig, 'tag', 'ok'); + figure(fig); + drawnow; + waitfor( okbut, 'userdata'); + try, + tmpdat = get(fig, 'userdata'); + chanlistout1 = tmpdat.chanlist1; + chanlistout2 = tmpdat.chanlist2; + close(fig); + drawnow; + end; + +% unpair channels +% --------------- +function [ str1, str2, chanlist1, chanlist2 ] = unpair(ind1, ind2, chanstr1, chanstr2, chanlist1, chanlist2, str1, str2); + if nargin > 4 + if isempty(find(chanlist2 == ind2)), disp('Channels not associated'); return; end; + if isempty(find(chanlist1 == ind1)), disp('Channels not associated'); return; end; + end; + + str1 = sprintf('%2d - %3s', ind1, chanstr1{ind1}); + str2 = sprintf('%2d - %3s', ind2, chanstr2{ind2}); + if nargout > 2 + tmppos = find( chanlist1 == ind1); + chanlist1(tmppos) = []; + chanlist2(tmppos) = []; + end; + +% pair channels +% ------------- +function [ str1, str2, chanlist1, chanlist2 ] = pair(ind1, ind2, chanstr1, chanstr2, chanlist1, chanlist2, str1, str2); + if nargin > 4 + if ~isempty(find(chanlist2 == ind2)), disp('Channel in second structure already associated'); return; end; + if ~isempty(find(chanlist1 == ind1)), disp('Channel in first structure already associated'); return; end; + end; + + str1 = sprintf('%2d - %3s -> %2d - %3s', ind1, chanstr1{ind1}, ind2, chanstr2{ind2}); + str2 = sprintf('%2d - %3s -> %2d - %3s', ind2, chanstr2{ind2}, ind1, chanstr1{ind1}); + if nargout > 2 + chanlist1 = [ chanlist1 ind1 ]; + chanlist2 = [ chanlist2 ind2 ]; + end; + +% make full channel list +% ---------------------- +function [ newchanstr1, newchanstr2 ] = makelisttext( chanstr1, chanstr2, chanlist1, chanlist2); + for index = 1:length(chanstr1) + if ismember(index, chanlist1) + pos = find(chanlist1 == index); + newchanstr1{index} = pair( chanlist1(pos), chanlist2(pos), chanstr1, chanstr2 ); + else + newchanstr1{index} = sprintf('%2d - %3s', index, chanstr1{index}); + end; + end; + for index = 1:length(chanstr2) + if ismember(index, chanlist2) + pos = find(chanlist2 == index); + [tmp newchanstr2{index}] = pair( chanlist1(pos), chanlist2(pos), chanstr1, chanstr2 ); + else + newchanstr2{index} = sprintf('%2d - %3s', index, chanstr2{index}); + end; + end; + +% clear channel pairs +% ------------------- +function [ newchanstr1, newchanstr2, chanlist1, chanlist2 ] = clearchans(chanstr1, chanstr2); + + chanlist1 = []; + chanlist2 = []; + [ newchanstr1, newchanstr2 ] = makelisttext( chanstr1, chanstr2, chanlist1, chanlist2); + +% autoselect channel pairs +% ------------------------ +function [ newchanstr1, newchanstr2, chanlist1, chanlist2 ] = autoselect(chanstr1, chanstr2, newchanstr1, newchanstr2, chanlist1, chanlist2); + + % GUI for selecting pairs + % ----------------------- + listoptions = { 'All channels (same labels)' 'Fiducials (same labels)' 'BIOSEMI -> 10-20' ... + 'EGI -> 10-20' }; + listui = { { 'style' 'text' 'string' [ 'How to pair channels (click to select)' 10 ] } ... + { 'style' 'listbox' 'string' listoptions 'value' 1 } }; + results = inputgui({ [1 1] }, listui, '', 'Auto select channel pairs', [], 'normal', 2); + + % decode results + % -------------- + if isempty(results), return; end; + if results{1} == 1 % select all pairs + [chanlist1 chanlist2] = pop_chancoresp(chanstr1, chanstr2, 'autoselect', 'all', 'gui', 'off'); + elseif results{1} == 2 + [chanlist1 chanlist2] = pop_chancoresp(chanstr1, chanstr2, 'autoselect', 'fiducials', 'gui', 'off'); + else + disp('Not implemented yet'); return; + end; + [ newchanstr1, newchanstr2 ] = makelisttext( chanstr1, chanstr2, chanlist1, chanlist2); + + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_chanedit.m b/code/eeglab13_4_4b/functions/popfunc/pop_chanedit.m new file mode 100644 index 0000000..64bd107 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_chanedit.m @@ -0,0 +1,956 @@ +% pop_chanedit() - Edit the channel locations structure of an EEGLAB dataset, +% EEG.chanlocs. For structure location and file formats, +% see >> help readlocs +% +% EEG.chanlocs. For structure location and file formats, +% see >> help readlocs +% +% Usage: >> EEG = pop_chanedit( EEG, 'key1', value1, 'key2', value2, ... ); +% >> [ chanlocs options ] = pop_chanedit( chanlocs, 'key1', value1); +% >> [ chanlocs chaninfo options ] = pop_chanedit( chanlocs, chaninfo, ... +% 'key1', value1, 'key2', value2, ... ); +% +% Graphic interface: +% "Channel information ('field name')" - [edit boxes] display channel field +% contents for the current channel. Command line equivalent +% to modify these fields: 'transform' +% "Opt. 3D center" - [button] optimally re-center 3-D channel coordinates. Uses +% chancenter(). Command line equivalent: 'convert', { 'chancenter' +% [xc yc zc] }, [xc yc zc] being the center of the sphere. Use [] +% to find the center of the best fitting sphere. +% "Rotate axis" - [button] force one electrode to one position and rotate the other +% electrodes accordingly. Command line equivalent: 'forcelocs'. +% "Transform axis" - [button] perform any operation on channel fields. Command +% line equivalent: 'transform'. +% "Xyz->polar & sph." - [button] convert 3-D cartesian coordinates to polar and +% 3-D spherical coordinates. This is useful when you edit the +% coordinates manually. Command line equivalent: 'convert', 'cart2all'. +% "Sph.->polar & xyz" - [button] convert 3-D spherical coordinates to polar and +% 3-D cartesian coordinates. Command line equivalent: 'convert', 'sph2all'. +% "Polar->sph & xyz" - [button] convert 2-D polar coordinates to 3-D spherical and +% 3-D cartesian coordinates. Command line equivalent: 'convert', 'topo2all'. +% Note that if spherical radii are absent, they are forced to 1. +% "Set head radius" - [button] change head size radius. This is useful +% to make channels location compatible with a specified spherical model. +% Command line equivalent: 'headrad'. +% "Set channel types" - [button] set channel type names for a range of data channels. +% "Delete chan" - [button] delete channel. Command line equivalent: 'delete'. +% "Insert chan" - [button] insert channel before current channel. +% Command line equivalent: 'insert'. +% "<<" - [button] scroll channel backward by 10. +% "<" - [button] scroll channel backward by 1. +% ">" - [button] scroll channel forward by 1. +% ">>" - [button] scroll channel forward by 10. +% "Append chan" - [button] append channel after the current channel. +% Command line equivalent: 'append'. +% "Plot 2D" - [button] plot channel locations in 2-D using topoplot() +% "Plot radius [value (0.2-1.0), []=auto)" - [edit box] default plotting radius +% in 2-D polar views. This does NOT affect channel locations; it +% is only used for visualization. This parameter is attached to the +% chanlocs structure and is then used in all 2-D scalp topoplots. +% Default -> to data limits. Command line equivalent: 'plotrad'. +% "Nose along +X" - [list] Indicate the direction of the nose. This information +% is used in functions like topoplot(), headplot() and dipplot(). +% Command line equivalent: 'nosedir'. +% "Plot 3D" - [button] plot channel positions in 3-D using plotchans3d() +% "Read locations" - [button] read location file using readlocs() +% Command line equivalent: 'load'. +% "Read help" - [button] display readlocs() function help. +% "Save .ced" - [button] save channel locations in native EEGLAB ".ced" format. +% Command line equivalent: 'save'. +% "Save others" - [button] save channel locations in other formats using +% pop_writelocs() (see readlocs() for available channel formats). +% "Cancel" - [button] cancel all editing. +% "Help" - [button] display this help message. +% "OK" - [button] save edits and propagate to parent. +% +% Inputs: +% EEG - EEG dataset +% chanlocs - EEG.chanlocs structure +% +% Optional inputs: +% 'convert' - {conversion_type [args]} Conversion type may be: 'cart2topo' +% 'sph2topo', 'topo2sph', 'sph2cart', 'cart2sph', or 'chancenter'. +% See help messages for these functions. Args are only relevant +% for 'chancenter'. More info is given in the graphic interface +% description above. +% 'transform' - String command for manipulating arrays. 'chan' is full channel +% info. Fields that can be manipulated are 'labels', 'theta' +% 'radius' (polar angle and radius), 'X', 'Y', 'Z' (cartesian +% 3-D) or 'sph_theta', 'sph_phi', 'sph_radius' for spherical +% horizontal angle, azimuth and radius. +% Ex: 'chans(3) = chans(14)', 'X = -X' or a multi-step transform +% with steps separated by ';': Ex. 'TMP = X; X = Y; Y = TMP' +% 'changechan' - {number value1 value2 value3 ...} Change the values of all fields +% for the given channel number, mimimally {num label theta radius}. +% Ex: 'changechan' {12 'PXz' -90 0.30} +% 'changefield' - {number field value} Change field value for channel number number. +% Ex: {34 'theta' 320.4}. +% 'insert' - {number label theta radius X Y Z sph_theta sph_phi sph_radius } +% Insert new channel and specified values before the current channel +% number. If the number of values is less than 10, remaining +% fields will be 0. (Previously, this parameter was termed 'add'). +% 'append' - {num label theta radius X Y Z sph_theta sph_phi sph_radius } +% same as 'insert' (above) but insert the the new channel after +% the current channel number. +% 'delete' - [int_vector] Vector of channel numbers to delete. +% 'forcelocs' - [cell] call forcelocs() to force a particular channel to be at a +% particular location on the head sphere; rotate other channels +% accordingly. +% 'skirt' - Topographical polar skirt factor (see >> help topoplot) +% 'shrink' - Topographical polar shrink factor (see >> help topoplot) +% 'load' - [filename|{filename, 'key', 'val'}] Load channel location file +% optional arguments (such as file format) to the function +% readlocs() can be specified if the input is a cell array. +% 'save' - 'filename' Save text file with channel info. +% 'eval' - [string] evaluate string ('chantmp' is the name of the channel +% location structure). +% 'headrad' - [float] change head radius. +% 'lookup' - [string] look-up channel numbers for standard locations in the +% channel location file given as input. +% +% Outputs: +% EEG - new EEGLAB dataset with updated channel location structures +% EEG.chanlocs, EEG.urchanlocs, EEG.chaninfo +% chanlocs - updated channel location structure +% chaninfo - updated chaninfo structure +% options - structure containing plotting options (equivalent to EEG.chaninfo) +% +% Ex: EEG = pop_chanedit(EEG,'load', { 'dummy.elp' 'elp' }, 'delete', [3 4], ... +% 'convert', { 'xyz->polar' [] -1 1 }, 'save', 'mychans.loc' ) +% % Load polhemus file, delete two channels, convert to polar (see +% % cart2topo() for arguments) and save into 'mychans.loc'. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 20 April 2002 +% +% See also: readlocs() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 15 March 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% hidden parameter +% 'gui' - [figure value], allow to process the same dialog box several times + +function [chansout, chaninfo, urchans, com] = pop_chanedit(chans, orichaninfo, varargin); + +urchans = []; +com =''; +if nargin < 1 + help pop_chanedit; + return; +end; +chansout = chans; +chaninfo = []; +fig = []; + +if nargin < 2 + orichaninfo = []; +end; + +if isempty(chans) || ~ishandle(chans) + % in case an EEG structure was given as input + % ------------------------------------------- + if isfield(chans, 'chanlocs') + dataset_input = 1; + EEG = chans; + chans = EEG(1).chanlocs; + nchansori = EEG.nbchan; + if isfield(EEG, 'chaninfo') + chaninfo = EEG(1).chaninfo; + else chaninfo = []; + end; + if isfield(EEG, 'urchanlocs') + urchans = EEG(1).urchanlocs; + end; + else + nchansori = 0; + dataset_input = 0; + chaninfo = orichaninfo; + end; + + % dealing with additional parameters + % ---------------------------------- + if nargin > 1 && ~isstr(orichaninfo), % nothing + if nargin > 2 + if ~isstr(varargin{1}) + urchans = varargin{1}; + varargin = varargin(2:end); + end; + end; + elseif nargin > 1 && ~isempty(orichaninfo) && isstr(orichaninfo) + varargin = { orichaninfo varargin{:} }; + if isequal(orichaninfo, chaninfo) + chaninfo = []; + end; + orichaninfo = []; + end; + + % insert "no data channels" in channel structure + % ---------------------------------------------- + nbchan = length(chans); + [tmp chaninfo chans] = eeg_checkchanlocs(chans, chaninfo); + + if isfield(chaninfo, 'shrink') && ~isempty(chaninfo.shrink) + icadefs; + if SHRINKWARNING + warndlg2( [ 'You are currently shrinking channel locations for display.' 10 ... + 'A new option (more anatomically correct) is to plot channels' 10 ... + 'outside head limits so the shrink option has been disabled.' 10 ... + '(Edit the icadefs file to disable this message)' ], 'Shrink factor warning'); + end; + end; + + oldchaninfo = chaninfo; +end; + +if nargin < 3 + + totaluserdat = {}; + % lookup channel locations if necessary + % ------------------------------------- + if ~all(cellfun('isempty', {chans.labels})) && all(cellfun('isempty', {chans.theta})) + [chans chaninfo urchans com] = pop_chanedit(chans, chaninfo, 'lookupgui', []); + for index = 1:length(chans) + chans(index).ref = ''; + chans(index).datachan = 1; + end; + if ~isempty(com) + totaluserdat = com; + %[chans chaninfo urchans com] = pop_chanedit(chans, chaninfo, com{:}); + end; + end; + + commentfields = { 'Channel label ("label")', ... + 'Polar angle ("theta")', 'Polar radius ("radius")', ... + 'Cartesian X ("X")', ... + 'Cartesian Y ("Y")', ... + 'Cartesian Z ("Z")', ... + 'Spherical horiz. angle ("sph_theta")', ... + 'Spherical azimuth angle ("sph_phi")', ... + 'Spherical radius ("sph_radius")' ... + 'Channel type' 'Reference' ... + 'Index in backup ''urchanlocs'' structure' ... + 'Channel in data array (set=yes)' }; + + % add field values + % ---------------- + geometry = { 1 }; + tmpstr = sprintf('Channel information ("field_name"):'); + uilist = { { 'Style', 'text', 'string', tmpstr, 'fontweight', 'bold' } }; + + uiconvert = { ... + { 'Style', 'pushbutton', 'string', 'Opt. head center', 'callback', 'pop_chanedit(gcbf, [], ''chancenter'', []);' } ... + { 'Style', 'pushbutton', 'string', 'Rotate axis' , 'callback', 'pop_chanedit(gcbf, [], ''forcelocs'', []);' } ... + { 'Style', 'pushbutton', 'string', 'Transform axes' , 'callback', 'pop_chanedit(gcbf, [], ''transform'', []);' } ... + { }, ... + { 'Style', 'pushbutton', 'string', 'xyz -> polar & sph.', 'callback', 'pop_chanedit(gcbf, [], ''convert'', {''cart2all''});' }, ... + { 'Style', 'pushbutton', 'string', 'sph. -> polar & xyz', 'callback', 'pop_chanedit(gcbf, [], ''convert'', {''sph2all'' });' }, ... + { 'Style', 'pushbutton', 'string', 'polar -> sph. & xyz', 'callback', 'pop_chanedit(gcbf, [], ''convert'', {''topo2all''});' }, ... + { }, ... + { 'Style', 'pushbutton', 'string', 'Set head radius', 'callback', 'pop_chanedit(gcbf, [], ''headrad'', []);' } ... + { 'Style', 'pushbutton', 'string', 'Set channel types', 'callback', 'pop_chanedit(gcbf, [], ''settype'', []);' } ... + { 'Style', 'pushbutton', 'string', 'Set reference', 'callback', 'pop_chanedit(gcbf, [], ''setref'' , []);' } ... + { } { } }; + + % create text and edit for each field + % ----------------------------------- + allfields = { 'labels' 'theta' 'radius' 'X' 'Y' 'Z' 'sph_theta' 'sph_phi' 'sph_radius' 'type' 'ref' 'urchan' 'datachan' }; + for index = 1:length(allfields)-1 + cbfield = [ 'valnumtmp = str2num(get(findobj(gcbf, ''tag'', ''chaneditnumval''), ''string''));' ... + 'pop_chanedit(gcbf, [], ''changefield'', { valnumtmp ''' allfields{index} ''' get(gcbo, ''string'') });' ... + 'clear valnumtmp;' ]; + geometry = { geometry{:} [1.5 1 0.2 1] }; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', commentfields{index} }, ... + { 'Style', 'edit', 'tag', [ 'chanedit' allfields{index} ], 'string', ... + num2str(getfield(chans,{1}, allfields{index})), 'horizontalalignment', 'center', 'callback', cbfield } ... + { } uiconvert{index} }; + end; + + % special checkbox for chandata field + % ----------------------------------- + geometry = { geometry{:} [2 0.35 0.5 1] }; + cbfield = [ 'valnumtmp = str2num(get(findobj(gcbf, ''tag'', ''chaneditnumval''), ''string''));' ... + 'pop_chanedit(gcbf, [], ''changefield'', { valnumtmp ''' allfields{end} ''' get(gcbo, ''value'') });' ... + 'clear valnumtmp;' ]; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', commentfields{end} }, ... + { 'Style', 'checkbox', 'tag', [ 'chanedit' allfields{end}], 'string', '' 'value', 1 'callback', cbfield } { } uiconvert{end} }; + + % add buttons + % ----------- + geometry = { geometry{:} [1] [1.15 0.5 0.6 1.9 0.4 0.4 1.15] [1.15 0.7 0.7 1 0.7 0.7 1.15] }; + cb_del = [ 'valnum = str2num(char(get(findobj(gcbf,''tag'', ''chaneditnumval''), ''string'')));' ... + 'pop_chanedit(gcbf, [], ''deletegui'', valnum);' ]; + cb_insert = [ 'valnum = str2num(char(get(findobj(gcbf,''tag'', ''chaneditnumval''), ''string'')));' ... + 'pop_chanedit(gcbf, [], ''insert'', valnum);' ]; + cb_append = [ 'valnum = str2num(char(get(findobj(gcbf,''tag'', ''chaneditnumval''), ''string'')));' ... + 'pop_chanedit(gcbf, [], ''append'', valnum);' ]; + + uilist = { uilist{:}, ... + { }, ... + { 'Style', 'pushbutton', 'string', 'Delete chan', 'callback', cb_del }, ... + { },{ }, ... + { 'Style', 'text' , 'string', ['Channel number (of ' int2str(length(chans)) ')'], ... + 'fontweight', 'bold', 'tag', 'chaneditscantitle' }, { },{ },{ }, ... + { 'Style', 'pushbutton', 'string', 'Insert chan', 'callback', cb_insert } ... + { 'Style', 'pushbutton', 'string', '<<', 'callback', [ 'pop_chanedit(gcbf, [], ''movecursor'', -10);' ] } ... + { 'Style', 'pushbutton', 'string', '<', 'callback', [ 'pop_chanedit(gcbf, [], ''movecursor'', -1);' ] } ... + { 'Style', 'edit' , 'string', '1', 'tag', 'chaneditnumval', 'callback', [ 'pop_chanedit(gcbf, []);' ] } ... + { 'Style', 'pushbutton', 'string', '>', 'callback', [ 'pop_chanedit(gcbf, [], ''movecursor'', 1);' ] } ... + { 'Style', 'pushbutton', 'string', '>>', 'callback', [ 'pop_chanedit(gcbf, [], ''movecursor'', 10);' ] } ... + { 'Style', 'pushbutton', 'string', 'Append chan', 'callback', cb_append }, ... + }; + + % add sorting options + % ------------------- + noseparam = strmatch(upper(chaninfo.nosedir), { '+X' '-X' '+Y' '-Y' }); + if isempty(noseparam), error('Wrong value for nose direction'); end; + geometry = { geometry{:} [1] [0.9 1.3 0.6 1.1 0.9] [1] [1 1 1 1 1]}; + uilist = { uilist{:},... + { } ... + { 'Style', 'pushbutton', 'string', 'Plot 2-D', 'callback', 'pop_chanedit(gcbf, [], ''plot2d'', []);' },... + { 'Style', 'text', 'string', 'Plot radius (0.2-1, []=auto)'} ... + { 'Style', 'edit', 'string', chaninfo.plotrad, 'tag', 'plotrad' 'callback' 'pop_chanedit(gcbf, [], ''plotrad'', []);' } ... + { 'Style', 'popupmenu', 'string', 'Nose along +X|Nose along -X|Nose along +Y|Nose along -Y', ... + 'tag' 'nosedir' 'value',noseparam, 'callback' 'pop_chanedit(gcbf,[],''nosedir'',[]);' 'listboxtop' noseparam } ... + { 'Style', 'pushbutton', 'string', 'Plot 3-D (xyz)', 'callback', 'pop_chanedit(gcbf, [], ''plot3d'', []);' } ... + {}, ... + { 'Style', 'pushbutton', 'string', 'Read locations', 'callback', 'pop_chanedit(gcbf,[],''load'',[]);' }, ... + { 'Style', 'pushbutton', 'string', 'Read locs help', 'callback', 'pophelp(''readlocs.m'');' }, ... + { 'Style', 'pushbutton', 'string', 'Look up locs', 'callback', 'pop_chanedit(gcbf,[], ''lookupgui'', []);' }, ... + { 'Style', 'pushbutton', 'string', 'Save (as .ced)', 'callback', 'pop_chanedit(gcbf,[], ''save'',[]);' } ... + { 'Style', 'pushbutton', 'string', 'Save (other types)' 'callback', 'pop_chanedit(gcbf,[], ''saveothers'',[]);' } ... + }; + + % evaluation of command below is required to center text (if + % declared a text instead of edit, the uicontrol is not centered) + comeval = [ 'set(findobj( ''tag'', ''chanediturchan''), ''style'', ''text'', ''backgroundcolor'', [.66 .76 1] );' ... + 'set(findobj( ''tag'', ''chaneditref''), ''style'', ''text'', ''backgroundcolor'', [.66 .76 1] );' ... + 'set(findobj( ''tag'', ''ok''), ''callback'', ''pop_chanedit(gcbf, [], ''''return'''', []);'')' ]; + + userdata.chans = chans; + userdata.nchansori = nchansori; + userdata.chaninfo = chaninfo; + userdata.commands = totaluserdat; + + [results userdata returnmode] = inputgui( 'geometry', geometry, 'uilist', uilist, 'helpcom', ... + 'pophelp(''pop_chanedit'');', 'title', 'Edit channel info -- pop_chanedit()', ... + 'userdata', userdata, 'eval' , comeval ); + + if length(results) == 0, + com = ''; + if dataset_input, chansout = EEG; end; + return; + end; + + % transfer events back from global workspace + chans = userdata.chans; + chaninfo = userdata.chaninfo; + if ~isempty(userdata.commands) + com = sprintf('%s=pop_chanedit(%s, %s);', inputname(1), inputname(1), vararg2str(userdata.commands)); + end; +else + + % call from command line or from a figure + % --------------------------------------- + currentpos = 0; + if ishandle(chans) + fig = chans; + userdata = get(fig, 'userdata'); + chans = userdata.chans; + nchansori = userdata.nchansori; + chaninfo = userdata.chaninfo; + currentpos = str2num(get(findobj(fig, 'tag', 'chaneditnumval'), 'string')); + end; + + args = varargin; + % no interactive inputs + % scan all the fields of g + % ------------------------ + for curfield = 1:2:length(args) + switch lower(args{curfield}) + case 'return' + [tmpchans] = eeg_checkchanlocs(chans); + if nchansori ~= 0 & nchansori ~= length(tmpchans) + if ~popask(strvcat(['The number of data channels (' int2str(length(tmpchans)) ') not including fiducials does not'], ... + ['correspond to the initial number of channels (' int2str(nchansori) '), so for consistency purposes'], ... + 'new channel information will be ignored if this function was called from EEGLAB', ... + 'If you have added a reference channel manually, check the "Data channel" checkbox is off')) + else + set(findobj(fig, 'tag', 'ok'), 'userdata', 'stop'); + end; + else + set(findobj(fig, 'tag', 'ok'), 'userdata', 'stop'); + end; + args = {}; + case 'plot3d', % GUI only + tmpind = find(~cellfun('isempty', { chans.X })); + if ~isempty(tmpind), + plotchans3d([ [ chans(tmpind).X ]' [ chans(tmpind).Y ]' [ chans(tmpind).Z ]'], { chans(tmpind).labels }); + else disp('cannot plot: no XYZ coordinates'); + end; + args = {}; + case 'plot2d', % GUI only + plotrad = str2num(get(findobj(fig, 'tag', 'plotrad'), 'string')); + figure; topoplot([],chans, 'style', 'blank', 'drawaxis', 'on', 'electrodes', ... + 'labelpoint', 'plotrad', plotrad, 'chaninfo', chaninfo); + args = {}; + case 'movecursor', % GUI only + currentpos = max(1,min(currentpos+args{curfield+1},length(chans))); + args = {}; + case 'plotrad', + if isempty( args{curfield+1} ) + args{curfield+1} = str2num(get(findobj(fig, 'tag', 'plotrad'), 'string')); + end; + chaninfo.plotrad = args{curfield+1}; + case 'forcelocs', + if ~isempty(fig) % GUI BASED + [ comtmp tmpforce ] = forcelocs(chans); + if ~isempty(tmpforce), + args{curfield+1} = tmpforce{1}; + end; + end; + if ~isempty(args{curfield+1}) + chans = forcelocs(chans,args{curfield+1}); + disp('Convert XYZ coordinates to spherical and polar'); + end; + case 'chancenter', + if ~isempty(fig) + [chans newcenter tmpcom] = pop_chancenter(chans); + args{curfield } = 'eval'; + args{curfield+1} = tmpcom; + end; + case 'convert', + if iscell(args{curfield+1}) + method=args{curfield+1}{1}; + extraargs = args{curfield+1}(2:end); + else + method=args{curfield+1}; + extraargs = {''}; + end; + if ~isempty(fig) & ~strcmp(method, 'chancenter') + tmpButtonName=questdlg2( strvcat('This will modify fields in the channel structure', ... + 'Are you sure you want to apply this function ?'), 'Confirmation', 'Cancel', 'Yes','Yes'); + if ~strcmpi(tmpButtonName, 'Yes'), return; end; + end; + switch method + case 'chancenter', + if isempty(extraargs) + [X Y Z]=chancenter( [chans.X ]', [ chans.Y ]', [ chans.Z ]',[]); + else + [X Y Z]=chancenter( [chans.X ]', [ chans.Y ]', [ chans.Z ]', extraargs{:}); + end; + if isempty(X), return; end; + for index = 1:length(chans) + chans(index).X = X(index); + chans(index).Y = Y(index); + chans(index).Z = Z(index); + end; + disp('Note: automatically convert XYZ coordinates to spherical and polar'); + chans = convertlocs(chans, 'cart2all'); + otherwise + chans = convertlocs(chans, method, 'verbose', 'on'); + end; + case 'settype' + if ~isempty(fig) + args{curfield+1} = inputdlg2({'Channel indices' 'Type (e.g. EEG)' }, ... + 'Set channel type', 1, { '' '' }, 'pop_chanedit'); + end; + try, tmpchans = args{curfield+1}{1}; tmptype = args{curfield+1}{2};catch, return; end; + if isempty(tmpchans) & isempty(tmptype), return; end; + if isstr(tmpchans) + tmpchans = eval( [ '[' tmpchans ']' ], 'settype: error in channel indices'); + end; + if ~isstr(tmptype), tmptype = num2str(tmptype); end; + for index = 1:length(tmpchans) + if tmpchans(index) > 0 & tmpchans(index) <= length(chans) + chans( tmpchans(index) ).type = tmptype; + end; + end; + case 'setref' + if ~isempty(fig) + disp('Note that setting the reference only changes the reference labels'); + disp('Use the re-referencing menu to change the reference'); + args{curfield+1} = inputdlg2({'Channel indices' 'Reference (e.g. Cz)' }, ... + 'Set channel reference', 1, { '' '' }, 'pop_chanedit'); + end; + try, tmpchans = args{curfield+1}{1}; tmpref = args{curfield+1}{2};catch, return; end; + if isempty(tmpchans) & isempty(tmpref), return; end; + if isstr(tmpchans) + tmpchans = eval( [ '[' tmpchans ']' ], 'settype: error in channel indices'); + end; + if ~isstr(tmpref), tmpref = num2str(tmpref); end; + for index = 1:length(tmpchans) + if tmpchans(index) > 0 & tmpchans(index) <= length(chans) + chans( tmpchans(index) ).ref = tmpref; + end; + end; + case 'transform' + if ~isempty(fig) + args{curfield+1} = inputdlg2({'Enter transform: (Ex: TMP=X; X=-Y; Y=TMP or Y(3) = X(2), etc.' }, ... + 'Transform', 1, { '' }, 'pop_chanedit'); + end; + try, tmpoper = args{curfield+1}; catch, return; end; + if isempty(deblank(tmpoper)), return; end; + if iscell(tmpoper), tmpoper = tmpoper{1}; end; + tmpoper = [ tmpoper ';' ]; + [eloc, labels, theta, radius, indices] = readlocs(chans); + if isempty(findstr(tmpoper, 'chans')) + try, + X = [ chans(indices).X ]; + Y = [ chans(indices).Y ]; + Z = [ chans(indices).Z ]; + sph_theta = [ chans(indices).sph_theta ]; + sph_phi = [ chans(indices).sph_phi ]; + sph_radius = [ chans(indices).sph_radius ]; + eval(tmpoper); + + for ind = 1:length(indices) + chans(indices(ind)).X = X(min(length(X),ind)); + chans(indices(ind)).Y = Y(min(length(Y),ind)); + chans(indices(ind)).Z = Z(min(length(Z),ind)); + chans(indices(ind)).theta = theta(min(length(theta),ind)); + chans(indices(ind)).radius = radius(min(length(radius),ind)); + chans(indices(ind)).sph_theta = sph_theta(min(length(sph_theta),ind)); + chans(indices(ind)).sph_phi = sph_phi(min(length(sph_phi),ind)); + chans(indices(ind)).sph_radius = sph_radius(min(length(sph_radius),ind)); + end; + + if ~isempty(findstr(tmpoper, 'X')), chans = convertlocs(chans, 'cart2all'); end; + if ~isempty(findstr(tmpoper, 'Y')), chans = convertlocs(chans, 'cart2all'); end; + if ~isempty(findstr(tmpoper, 'Z')), chans = convertlocs(chans, 'cart2all'); end; + if ~isempty(findstr(tmpoper, 'sph_theta')), chans = convertlocs(chans, 'sph2all'); + elseif ~isempty(findstr(tmpoper, 'theta')), chans = convertlocs(chans, 'topo2all'); end; + if ~isempty(findstr(tmpoper, 'sph_phi')), chans = convertlocs(chans, 'sph2all'); end; + if ~isempty(findstr(tmpoper, 'sph_radius')), chans = convertlocs(chans, 'sph2all'); + elseif ~isempty(findstr(tmpoper, 'radius')), chans = convertlocs(chans, 'topo2all'); end; + catch, disp('Unknown error when applying transform'); end; + else + eval(tmpoper); + end; + + case 'headrad' + if ~isempty(fig) % GUI + tmpres = inputdlg2({'Enter new head radius (same unit as DIPFIT head model):' }, ... + 'Head radius', 1, { '' }, 'pop_chanedit'); + if ~isempty(tmpres), + args{ curfield+1 } = str2num(tmpres{1}); + else return; + end; + end; + if ~isempty( args{ curfield+1 } ) + allrad = [ chans.sph_radius ]; + if length(unique(allrad)) == 1 % already spherical + chans = pop_chanedit(chans, 'transform', [ 'sph_radius = ' num2str( args{ curfield+1 } ) ';' ]); + else % non-spherical, finding best match + factor = args{ curfield+1 } / mean(allrad); + chans = pop_chanedit(chans, 'transform', [ 'sph_radius = sph_radius*' num2str( factor ) ';' ]); + disp('Warning: electrodes do not lie on a sphere. Sphere model fitting for'); + disp(' dipole localization will work but generate many warnings'); + end; + chans = convertlocs(chans, 'sph2all'); + end; + + case 'shrink' + chans(1).shrink = args{ curfield+1 }; + + case 'plotrad' + chans(1).plotrad = args{ curfield+1 }; + + case 'deletegui' + chans(args{ curfield+1 })=[]; + currentpos = min(length(chans), currentpos); + args{ curfield } = 'delete'; + + case 'delete' + chans(args{ curfield+1 })=[]; + + case 'changefield' + tmpargs = args{ curfield+1 }; + if length( tmpargs ) < 3 + error('pop_chanedit: not enough arguments to change field value'); + end; + if ~isempty(strmatch( tmpargs{2}, { 'X' 'Y' 'Z' 'theta' 'radius' 'sph_theta' 'sph_phi' 'sph_radius'})) + if ~isnumeric(tmpargs{3}), tmpargs{3} = str2num(tmpargs{3}); end; + end; + eval([ 'chans(' int2str(tmpargs{1}) ').' tmpargs{2} '=' reformat(tmpargs{3} ) ';' ]); + case { 'insert' 'add' 'append' } + tmpargs = args{ curfield+1 }; + allfields = fieldnames(chans); + if isnumeric(tmpargs) + tmpargs2 = cell(1, length(allfields)+1); + tmpargs2{1} = tmpargs; + tmpargs = tmpargs2; + if strcmpi(allfields{end}, 'datachan'), tmpargs{end} = 0; end; + end; + if length( tmpargs ) < length(allfields)+1 + error('pop_chanedit: not enough arguments to change all field values'); + end; + num = tmpargs{1}; + if strcmpi(lower(args{curfield}), 'append'), num=num+1; currentpos = currentpos+1; end; + chans(end+1) = chans(end); + chans(num+1:end) = chans(num:end-1); + for index = 1:length( allfields ) + chans = setfield(chans, {num}, allfields{index}, tmpargs{index+1}); + end; + if isfield(chans, 'datachan') + if isempty(chans(num).datachan) + chans(num).datachan = 0; + end; + end; + case 'changechan' + tmpargs = args{ curfield+1 }; + num = tmpargs{1}; + allfields = fieldnames(chans); + if length( tmpargs ) < length(allfields)+1 + error('pop_chanedit: not enough arguments to change all field values'); + end; + for index = 1:length( allfields ) + eval([ 'chans(' int2str(num) ').' allfields{index} '=' reformat(tmpargs{index+1}) ';' ]); + end; + + case 'load' + if ~isempty(fig) % GUI + [tmpf tmpp] = uigetfile('*.*', 'Load a channel location file'); + drawnow; + if ~isequal(tmpf, 0), + tmpformats = readlocs('getinfos'); + tmpformattype = { 'autodetect' tmpformats(1:end-1).type }; + tmpformatstr = { 'autodetect' tmpformats(1:end-1).typestring }; + tmpformatdesc = { 'Autodetect file format from file extension' tmpformats(1:end-1).description }; + %cb_listbox = 'tmpdesc=get(gcbf, ''userdata''); set(findobj(gcbf, ''tag'', ''strdesc''), ''string'', strmultiline([ ''File format: '' tmpdesc{get(gcbo, ''value'')} ], 30, 10)); clear tmpdesc;'' } }, ''pophelp(''''readlocs'''')'',' ... + % 'Read electrode file'', tmpformatdesc, ''normal'', 4); + %txtgui = [ strmultiline([ 'File format: Autodetect file format from file extension'], 20, 10) 10 10 ]; + %tmpfmt = inputgui( 'geometry', {[1 1]}, ... + % 'uilist' , { { 'style', 'text', 'string', txtgui 'tag' 'strdesc' }, ... + % { 'style', 'listbox', 'string', strvcat(tmpformatstr) 'callback' '' } }, ... + % 'geomvert', [10], ... + % 'helpcom' , 'pophelp(''readlocs'');'); + tmpfmt = inputgui( 'geometry', {[1 1 1] [1]}, ... + 'uilist' , { { 'style', 'text', 'string', 'File format:' 'tag' 'strdesc' } {} {}, ... + { 'style', 'listbox', 'string', strvcat(tmpformatstr) 'callback' '' } }, ... + 'geomvert', [1 8], ... + 'helpcom' , 'pophelp(''readlocs'');'); + if isempty(tmpfmt), + args{ curfield+1 } = []; + else args{ curfield+1 } = { fullfile(tmpp, tmpf) 'filetype' tmpformattype{tmpfmt{1}} }; + end; + else args{ curfield+1 } = []; + end; + end; + + tmpargs = args{ curfield+1 }; + if ~isempty(tmpargs), + if isstr(tmpargs) + [chans] = readlocs(tmpargs); + [tmp tmp2 chans] = eeg_checkchanlocs(chans); + chaninfo = []; + chaninfo.filename = tmpargs; + else + [chans] = readlocs(tmpargs{:}); + [tmp tmp2 chans] = eeg_checkchanlocs(chans); + chaninfo = []; + chaninfo.filename = tmpargs{1}; + end; + + % backup file content etc... + % -------------------------- + tmptext = loadtxt( chaninfo.filename, 'delim', [], 'verbose', 'off', 'convert', 'off'); + chaninfo.filecontent = strvcat(tmptext{:}); + + % set urchan structure + % -------------------- + urchans = chans; + for index = 1:length(chans) + chans(index).urchan = index; + end; + end; + if ~isfield(chans, 'datachan') + chans(1).datachan = []; + end; + for index = 1:length(chans) + if isempty(chans(index).datachan) + chans(index).datachan = 1; + end; + end; + + case 'eval' + tmpargs = args{ curfield+1 }; + eval(tmpargs); + + case 'saveothers' + com = pop_writelocs(chans); + args{ curfield } = 'eval'; + args{ curfield+1 } = com; + + case 'save' + if ~isempty(fig) + [tmpf tmpp] = uiputfile('*.ced', 'Save channel locs in EEGLAB .ced format'); + drawnow; + args{ curfield+1 } = fullfile(tmpp, tmpf); + end; + tmpargs = args{ curfield+1 }; + if isempty(tmpargs), return; end; + fid = fopen(tmpargs, 'w'); + if fid ==-1, error('Cannot open file'); end; + + allfields = fieldnames(chans); + fields = { 'labels' 'theta' 'radius' 'X' 'Y' 'Z' 'sph_theta' 'sph_phi' 'sph_radius' 'type' }; + tmpdiff = setdiff(fields, allfields); + if ~isempty(tmpdiff), error(sprintf('Field "%s" missing in channel location structure', tmpdiff{1})); end; + fprintf(fid, 'Number\t'); + for field = 1:length(fields) + fprintf(fid, '%s\t', fields{field}); + end; + fprintf(fid, '\n'); + for index=1:length(chans) + fprintf(fid, '%d\t', index); + for field = 1:length(fields) + tmpval = getfield(chans, {index}, fields{field}); + if isstr(tmpval) + fprintf(fid, '%s\t', tmpval); + else + fprintf(fid, '%3.3g\t', tmpval); + end; + end; + fprintf(fid, '\n'); + end; + if isempty(tmpargs), chantmp = readlocs(tmpargs); end; + + case 'nosedir' + nosevals = { '+X' '-X' '+Y' '-Y' }; + if ~isempty(fig) + tmpval = get(findobj(gcbf, 'tag', 'nosedir'), 'value'); + args{ curfield+1 } = nosevals{tmpval}; + warndlg2( [ 'Changing the nose direction will force EEGLAB to physically rotate ' 10 ... + 'electrodes, so next time you call this interface, nose direction will' 10 ... + 'be +X. If your electrodes are currently aligned with a specific' 10 ... + 'head model, you will have to rotate them in the model coregistration' 10 ... + 'interface to realign them with the model.'], 'My Warn Dialog'); + end; + chaninfo.nosedir = args{ curfield+1 }; + if isempty(strmatch(chaninfo.nosedir, nosevals)) + error('Wrong value for nose direction'); + end; + + case { 'lookup' 'lookupgui' } + if strcmpi(lower(args{curfield}), 'lookupgui') + standardchans = { 'Fp1' 'Fpz' 'Fp2' 'Nz' 'AF9' 'AF7' 'AF3' 'AFz' 'AF4' 'AF8' 'AF10' 'F9' 'F7' 'F5' ... + 'F3' 'F1' 'Fz' 'F2' 'F4' 'F6' 'F8' 'F10' 'FT9' 'FT7' 'FC5' 'FC3' 'FC1' 'FCz' 'FC2' ... + 'FC4' 'FC6' 'FT8' 'FT10' 'T9' 'T7' 'C5' 'C3' 'C1' 'Cz' 'C2' 'C4' 'C6' 'T8' 'T10' ... + 'TP9' 'TP7' 'CP5' 'CP3' 'CP1' 'CPz' 'CP2' 'CP4' 'CP6' 'TP8' 'TP10' 'P9' 'P7' 'P5' ... + 'P3' 'P1' 'Pz' 'P2' 'P4' 'P6' 'P8' 'P10' 'PO9' 'PO7' 'PO3' 'POz' 'PO4' 'PO8' 'PO10' ... + 'O1' 'Oz' 'O2' 'O9' 'O10' 'CB1' 'CB2' 'Iz' }; + for indexchan = 1:length(chans) + if isempty(chans(indexchan).labels), chans(indexchan).labels = ''; end; + end; + [tmp1 ind1 ind2] = intersect_bc( lower(standardchans), {chans.labels}); + if ~isempty(tmp1) | isfield(chans, 'theta') + + % finding template location files + % ------------------------------- + setmodel = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpval = get(gcbo, ''value'');' ... + 'set(findobj(gcbf, ''tag'', ''elec''), ''string'', tmpdat{tmpval});' ... + 'clear tmpval tmpdat;' ]; + try + EEG = eeg_emptyset; % for dipfitdefs + dipfitdefs; + tmpp = which('eeglab.m'); + tmpp = fullfile(fileparts(tmpp), 'functions', 'resources', 'Standard-10-5-Cap385_witheog.elp'); + userdatatmp = { template_models(1).chanfile template_models(2).chanfile tmpp }; + clear EEG; + catch, userdatatmp = { 'Standard-10-5-Cap385.sfp' 'Standard-10-5-Cap385.sfp' 'Standard-10-5-Cap385_witheog.elp' }; + end; + + % other commands for help/load + % ---------------------------- + comhelp = [ 'warndlg2(strvcat(''The template file depends on the model'',' ... + '''you intend to use for dipole fitting. The default file is fine for'',' ... + '''spherical model.'');' ]; + commandload = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''elec''), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + if ~isfield(chans, 'theta'), message =1; + elseif all(cellfun('isempty', {chans.theta })), message =1; + else message =2; + end; + if message == 1 + textcomment = strvcat('Only channel labels are present currently, but some of these labels have known', ... + 'positions. Do you want to look up coordinates for these channels using the electrode', ... + 'file below? If you have a channel location file for this dataset, press cancel, then', ... + 'use button "Read location" in the following gui. If you do not know, just press OK.'); + else + textcomment = strvcat('Some channel labels may have known locations.', ... + 'Do you want to look up coordinates for these channels using the electrode', ... + 'file below? If you do not know, press OK.'); + end; + uilist = { { 'style' 'text' 'string' textcomment } ... + { 'style' 'popupmenu' 'string' [ 'use BESA file for 4-shell dipfit spherical model' ... + '|use MNI coordinate file for BEM dipfit model|Use spherical file with eye channels' ] ... + 'callback' setmodel } ... + { } ... + { 'style' 'edit' 'string' userdatatmp{1} 'tag' 'elec' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' commandload } }; + + res = inputgui( { 1 [1 0.3] [1 0.3] }, uilist, 'pophelp(''pop_chanedit'')', 'Look up channel locations?', userdatatmp, 'normal', [4 1 1] ); + if ~isempty(res) + chaninfo.filename = res{2}; + args{ curfield } = 'lookup'; + args{ curfield+1 } = res{2}; + com = args; + else + return; + end; + end; + else + chaninfo.filename = args{ curfield+1 }; + end; + if strcmpi(chaninfo.filename, 'standard-10-5-cap385.elp') + dipfitdefs; + chaninfo.filename = template_models(1).chanfile; + elseif strcmpi(chaninfo.filename, 'standard_1005.elc') + dipfitdefs; + chaninfo.filename = template_models(2).chanfile; + end; + tmplocs = readlocs( chaninfo.filename, 'defaultelp', 'BESA' ); + for indexchan = 1:length(chans) + if isempty(chans(indexchan).labels), chans(indexchan).labels = ''; end; + end; + [tmp ind1 ind2] = intersect_bc(lower({ tmplocs.labels }), lower({ chans.labels })); + if ~isempty(tmp) + chans = struct('labels', { chans.labels }, 'datachan', { chans.datachan }, 'type', { chans.type }); + [ind2 ind3] = sort(ind2); + ind1 = ind1(ind3); + + for index = 1:length(ind2) + chans(ind2(index)).theta = tmplocs(ind1(index)).theta; + chans(ind2(index)).radius = tmplocs(ind1(index)).radius; + chans(ind2(index)).X = tmplocs(ind1(index)).X; + chans(ind2(index)).Y = tmplocs(ind1(index)).Y; + chans(ind2(index)).Z = tmplocs(ind1(index)).Z; + chans(ind2(index)).sph_theta = tmplocs(ind1(index)).sph_theta; + chans(ind2(index)).sph_phi = tmplocs(ind1(index)).sph_phi; + chans(ind2(index)).sph_radius = tmplocs(ind1(index)).sph_radius; + end; + tmpdiff = setdiff_bc([1:length(chans)], ind2); + if ~isempty(tmpdiff) + fprintf('Channel lookup: no location for '); + for index = 1:(length(tmpdiff)-1) + fprintf('%s,', chans(tmpdiff(index)).labels); + end; + fprintf('%s\nSend us standard location for your channels at eeglab@sccn.ucsd.edu\n', ... + chans(tmpdiff(end)).labels); + end; + if ~isfield(chans, 'type'), chans(1).type = []; end; + end; + if ~isempty(findstr(args{ curfield+1 }, 'standard_10')) & ... + ~isempty(findstr(args{ curfield+1 }, '.elc')) + chaninfo.nosedir = '+Y'; + else + chaninfo.nosedir = '+X'; + end; + urchans = chans; + for index = 1:length(chans) + chans(index).urchan = index; + chans(index).ref = ''; + end; + end; + end; + +end; + +% call from a figure +% ------------------ +if ~isempty(fig) + userdata.chans = chans; + userdata.chaninfo = chaninfo; + userdata.commands = { userdata.commands{:} args{:} }; + set(fig, 'userdata', userdata); + + set(findobj(fig, 'tag', 'chaneditnumval'), 'string', num2str(currentpos)); + set(findobj(fig, 'tag', 'chaneditscantitle'), 'string', ['Channel number (of ' int2str(length(chans)) ')']); + + % update GUI with current channel info + allfields = fieldnames(chans); + if ~isempty(chans) + for index = 1:length(allfields) + obj = findobj(fig, 'tag', [ 'chanedit' allfields{index}]); + if strcmpi(allfields{index}, 'datachan') + set(obj, 'value', getfield(chans(currentpos), allfields{index})); + else + tmpval = getfield(chans(currentpos), allfields{index}); + if isstr(tmpval) && strcmpi(tmpval, '[]'), tmpval = ''; end; + set(obj, 'string', num2str(tmpval)); + end; + end; + else + for index = 1:length(allfields) + obj = findobj(fig, 'tag', [ 'chanedit' allfields{index}]); + if strcmpi(allfields{index}, 'datachan') + set(obj, 'value', 0); + else + set(obj, 'string', ''); + end; + end; + end; +else + [chans chaninfo] = eeg_checkchanlocs(chans, chaninfo); + if dataset_input, + if nchansori == length(chans) + for index = 1:length(EEG) + EEG(index).chanlocs = chans; + EEG(index).chaninfo = chaninfo; + end; + EEG = eeg_checkset(EEG); % for channel orientation + else + disp('Wrong channel structure size, changes ignored'); + end; + chansout = EEG; + else chansout = chans; + end; +end; + +return; + +% format the output field +% ----------------------- +function strval = reformat( val ) +if isnumeric(val) & isempty(val), val = '[]'; end; +if isstr(val), strval = [ '''' val '''' ]; +else strval = num2str(val); +end; + +% extract text using tokens (not used) +% ------------------------------------ +function txt = inserttxt( txt, tokins, tokfind); +locfind = findstr(txt, tokfind); +for index = length(locfind):-1:1 + txt = [txt(1:locfind(index)-1) tokins txt(locfind(index):end)]; +end; + +% ask for confirmation +% -------------------- +function num = popask( text ) +ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); +switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_chanevent.m b/code/eeglab13_4_4b/functions/popfunc/pop_chanevent.m new file mode 100644 index 0000000..cb3a09e --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_chanevent.m @@ -0,0 +1,299 @@ +% pop_chanevent() - import event latencies from the rising and/or falling 'edge' +% latencies of a specified event-marker channel in EEG.data +% Usage: +% >> OUTEEG = pop_chanevent( INEEG ); % select parameters via a pop-up window +% >> OUTEEG = pop_chanevent( INEEG, chanindices, 'key', 'val' ... ); % no pop-up +% +% Graphic interface: +% "Event channel(s)" - [edit box] indices of event channel(s) to import. +% Command line equivalent: chanindices. +% "Preprocessing transform" - [edit box] apply this preprocessing +% formula or function to the selected data channel(s) X, +% transforming X into the command output before edge +% extraction. Command line equivalent 'oper'. +% "Transition to extract" - [list box] extract events when the event +% channel values go up ('leading'), down ('trailing') +% or both ('both'). Command line equivalent: 'edge'. +% "Transition length" - [edit box] Increase this number to avoid having +% events very close to each other due to a not perfectly +% straight edge. Command line equivalent: 'edgelen'. +% "Assign duration to events?" - [checkbox] . Assign duration to each +% extracted event. This option can only be used when +% extracting events on leading edges. Event will last +% until next trailing edge (down) event. Command line +% equivalent: 'duration'. +% "Delete event channel(s)" - [checkbox] check to delete the event channel +% after events have been extracted from it. +% Command line equivalent: 'delchan'. +% "Delete old events if any" - [checkbox] check this checkbox to +% remove any prior events in the dataset. Otherwise +% imported events are appended to old events. Command +% line equivalent: 'delevent'. +% "Only one event type" - [checkbox] check this checkbox to assign +% all transitions in the event channel to one event +% type. Else, one type is assigned for each non-zero +% channel value. Command line equivalent: 'nbtype'. +% Inputs: +% INEEG - input dataset structure +% chanindices - index|(indices) of the event channel(s) +% +% Optional inputs: +% 'edge' - ['leading'|'trailing'|'both'] extract events when values +% in the event channel go up ('leading'), down ('trailing') +% or both ('both'). {Default is 'both'}. +% 'edgelen' - [integer] maximum edge length (for some data edge do not +% take whole value and it takes a few sample points for +% signal to rise. Default is 1 (perfect edges). +% 'oper' - [string] prior to extracting edges, preprocess data +% channel(s) using the string command argument. +% In this command, the data channel(s) are designated by +% (capital) X. For example, 'X>3' will test the value of X +% at each time point (returning 1 if the data channel value +% is larger than 3, and 0 otherwise). You may also use +% any function (Ex: 'myfunction(X)'). +% 'duration' - ['on'|'off'] extract event duration. This option can only be +% used when extracting events on leading edges. Event will last +% until next trailing-edge (down) event { 'off' }. +% 'delchan' - ['on'|'off'] delete channel from data { 'on' }. +% 'delevent' - ['on'|'off'] delete old events if any { 'on' }. +% 'nbtype' - [1|NaN] setting this to 1 will force the program to +% consider all events to have the same type. {Default is NaN}. +% If set (1), all transitions are considered the same event type +% If unset (NaN), each (transformed) event channel value following a +% transition determines an event type (Ex: Detecting leading-edge +% transitions of 0 0 1 0 2 0 ... produces event types 1 and 2). +% 'typename' - [string] event type name. Only relevant if 'nbtype' is 1 +% or if there is only one event type in the event channel. +% {Default is 'chanX', X being the index of +% the selected event channel}. +% Outputs: +% OUTEEG - EEGLAB output data structure +% +% Author: Arnaud Delorme, CNL / Salk Institute, 29 July 2002 +% +% See also: eeglab() + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_chanevent(EEG, chan, varargin); +command = ''; + +if nargin < 1 + help pop_chanevent; + return; +end; + +if nargin < 2 + geometry = { [1.5 1 1] [1] [1.5 1 1] [1.5 1 1] [1.5 1 1] [1.5 0.2 0.36 0.84] ... + [1] [1.5 0.21 1] [1.5 0.21 1] [1.5 0.21 1] }; + + % callback from listbox to disable duration checkbox (if leading event is not selected) + % -------------------------------------------------- + cb_list = [ 'if get(gcbo, ''value'') == 1,' ... + ' set(findobj(gcbf, ''tag'', ''dur''), ''enable'', ''on'');' ... + 'else,' ... + ' set(findobj(gcbf, ''tag'', ''dur''), ''enable'', ''off'', ''value'', 0);' ... + 'end;' ]; + + strgui = { { 'style' 'text' 'string' 'Event channel(s)' 'tooltipstring' 'indexes of event channels' } ... + { 'style' 'edit' 'string' '' } { } ... + {} ... + { 'style' 'text' 'string' 'Preprocessing transform (data=''X'')' 'tooltipstring' ... + [ 'For example, ''X>3'' will test the value of X' 10 ... + 'at each time point (returning 1 if the data channel value' 10 ... + 'is larger than 3, and 0 otherwise).' ] } ... + { 'style' 'edit' 'string' '' } { 'style' 'text' 'string' 'Optional. Ex: X>3' } ... + { 'style' 'text' 'string' 'Transitions to extract? (up|down)' 'tooltipstring' ... + [ 'Extract events whenever values in the (transformed) event channel(s) shift up' 10 ... + '(''leading''), down (''trailing'') or either (''both'').' 10 ... + 'AFTER SCROLLING CLICK TO SELECT' ] } ... + { 'style' 'listbox' 'string' 'up (leading)|both|down (trailing)' 'value' 1 'callback' cb_list } ... + { 'style' 'text' 'string' '(click to select)'} ... + { 'style' 'text' 'string' 'Transition length (1=perfect edges)' 'tooltipstring' ... + [ 'Increase this number to avoid having events very close to each other due.' 10 ... + 'to a not perfectly straight edge' ] } ... + { 'style' 'edit' 'string' '0' } { } ... + { 'style' 'text' 'string' 'Assign duration to each events?' 'tag' 'dur' 'tooltipstring' ... + [ 'You may assign an event duration to each event if you select to detect' 10 ... + 'event on the leading edge above. Event will last as long as the signal is non-0.' ] } ... + { 'style' 'checkbox' 'string' '' 'value' 0 'tag' 'dur'} { } ... + { 'style' 'text' 'string' '(set=yes)' } ... + {} ... + { 'style' 'text' 'string' 'Delete event channel(s)? ' } ... + { 'style' 'checkbox' 'value' 1 } { 'style' 'text' 'string' ' (set = yes)'} ... + { 'style' 'text' 'string' 'Delete old events if any? ' } ... + { 'style' 'checkbox' 'value' 1 } { } ... + { 'style' 'text' 'string' 'All events of same type? ' 'tooltipstring' ... + ['If set, all transitions are considered the same event type,' 10 ... + 'If unset, each (transformed) event channel value following a transition' 10 ... + 'determines an event type (Ex: Detecting leading-edge transitions of' 10 ... + '0 0 1 0 2 0 ... produces event types 1 and 2).' ] } ... + { 'style' 'checkbox' 'value' 0 } { } }; + result = inputgui( geometry, strgui, 'pophelp(''pop_chanevent'');', 'Extract event from channel(s) - pop_chanevent()'); + + if length(result) == 0 return; end; + chan = eval( [ '[' result{1} ']' ] ); + options = {}; + if ~isempty(result{2}), options = { options{:} 'oper' result{2} }; end; + switch result{3}, + case 1, options = { options{:} 'edge' 'leading' }; + case 2, options = { options{:} 'edge' 'both' }; + case 3, options = { options{:} 'edge' 'trailing' }; + end; + options = { options{:} 'edgelen' eval( [ '[' result{4} ']' ] ) }; + if result{5}, options = { options{:} 'duration' 'on' }; end; + if ~result{6}, options = { options{:} 'delchan' 'off'}; end; + if ~result{7}, options = { options{:} 'delevent' 'off'}; end; + if result{8}, options = { options{:} 'nbtype' 1}; end; +else + options = varargin; +end; +listcheck = { 'edge' 'string' { 'both';'leading';'trailing'} 'both'; + 'edgelen' 'integer' [1 Inf] 1; + 'delchan' 'string' { 'on';'off' } 'on'; + 'oper' 'string' [] ''; + 'delevent' 'string' { 'on';'off' } 'on'; + 'duration' 'string' { 'on';'off' } 'off'; + 'typename' 'string' [] [ 'chan' int2str(chan) ]; + 'nbtype' 'integer' [1 NaN] NaN }; +g = finputcheck( options, listcheck, 'pop_chanedit'); +if isstr(g), error(g); end; + +% check inut consistency +% ---------------------- +if strcmpi(g.duration, 'on') & ~strcmpi(g.edge, 'leading') + error('Must detect leading edge to extract event duration'); +end; + +% process events +% -------------- +fprintf('pop_chanevent: importing events from data channel %d ...\n', chan); +counte = 1; % event counter +events(10000).latency = 0; +if isnan(g.nbtype) + if length(unique(EEG.data(chan, :))) == 2, g.nbtype = 1; end; +end; + +for ci = chan + X = EEG.data(ci, :); + + % apply preprocessing + % ------------------- + if ~isempty(g.oper) + try, eval( [ 'X = ' g.oper ';' ]); + catch, error('pop_chanevent: error executing preprocessing string'); + end; + end; + + % extract edges + % ------------- + tmpdiff = diff(abs([ X X(end) ])); + switch g.edge + case 'both' , tmpevent1 = find( tmpdiff > 0)-1; tmpevent2 = find( tmpdiff < 0); + case 'trailing', tmpevent2 = find( tmpdiff < 0); + case 'leading' , tmpevent1 = find( tmpdiff > 0)-1; tmpdur = find( tmpdiff < 0); + end; + + % fuse close events if necessary + % ------------------------------ + if exist('tmpevent1') + tmpclose = find( tmpevent1(2:end)-tmpevent1(1:end-1) < g.edgelen)+1; + tmpevent1(tmpclose) = []; + tmpevent = tmpevent1+1; + tmpeventval = tmpevent1+2; + end; + if exist('tmpevent2') + tmpclose = find( tmpevent2(2:end)-tmpevent2(1:end-1) < g.edgelen); % not +1 + tmpevent2(tmpclose) = []; + tmpevent = tmpevent2+1; + tmpeventval = tmpevent2; + end; + if exist('tmpevent1') & exist('tmpevent2') + tmpevent = sort([ tmpevent1+1 tmpevent2+1]); + tmpeventval = sort([ tmpevent1+2 tmpevent2]); + end; + + % adjust edges for duration if necessary + % --------------------------------------- + if strcmpi(g.duration, 'on') + tmpclose = find( tmpdur(2:end)-tmpdur(1:end-1) < g.edgelen); % not +1 (take out the first) + tmpdur(tmpclose) = []; + if tmpdur(1) < tmpevent(1), tmpdur(1) = []; end; + if length(tmpevent) > length(tmpdur), tmpdur(end+1) = EEG.pnts; end; + if length(tmpevent) ~= length(tmpdur) + error([ 'Error while attempting to extract event durations' 10 ... + 'Maybe edges are not perfectly defined, try increasing edge length' ]); + end; + end; + + if isempty(tmpevent), + fprintf('No event found for channel %d\n', ci); + else + for tmpi = 1:length(tmpevent) + if ~isnan(g.nbtype) + events(counte).type = g.typename; + else + events(counte).type = X(tmpeventval(tmpi)); + end; + events(counte).latency = tmpevent(tmpi); + if strcmpi(g.duration, 'on') + events(counte).duration = tmpdur(tmpi) - tmpevent(tmpi); + end; + counte = counte+1; + end; + end; + events = events(1:counte-1); +end; + +% resort events +% -------------- +if strcmp(g.delevent, 'on') + EEG.event = events; + if EEG.trials > 1 + for index = 1:length(events) + EEG.event(index).epoch = 1+floor((EEG.event(index).latency-1) / EEG.pnts); + end; + end; +else + for index = 1:length(events) + EEG.event(end+1).type = events(index).type; + EEG.event(end).latency = events(index).latency; + if EEG.trials > 1 | isfield(EEG.event, 'epoch'); + EEG.event(end).epoch = 1+floor((EEG.event(end).latency-1) / EEG.pnts); + end; + end; + if EEG.trials > 1 + EEG = pop_editeventvals( EEG, 'sort', { 'epoch' 0 'latency', [0] } ); + else + EEG = pop_editeventvals( EEG, 'sort', { 'latency', [0] } ); + end; +end; +if isfield(EEG.event, 'urevent'), EEG.event = rmfield(EEG.event, 'urevent'); end; +EEG = eeg_checkset(EEG, 'eventconsistency'); +EEG = eeg_checkset(EEG, 'makeur'); + +% delete channels +% --------------- +if strcmp(g.delchan, 'on') + EEG = pop_select(EEG, 'nochannel', chan); +end; + +if nargin < 2 + command = sprintf('%s = pop_chanevent(%s, %s);', inputname(1), inputname(1), ... + vararg2str({ chan options{:} })); +end; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_chansel.m b/code/eeglab13_4_4b/functions/popfunc/pop_chansel.m new file mode 100644 index 0000000..aaa4041 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_chansel.m @@ -0,0 +1,145 @@ +% pop_chansel() - pop up a graphic interface to select channels +% +% Usage: +% >> [chanlist] = pop_chansel(chanstruct); % a window pops up +% >> [chanlist strchannames cellchannames] = ... +% pop_chansel(chanstruct, 'key', 'val', ...); +% +% Inputs: +% chanstruct - channel structure. See readlocs() +% +% Optional input: +% 'withindex' - ['on'|'off'] add index to each entry. May also a be +% an array of indices +% 'select' - selection of channel. Can take as input all the +% outputs of this function. +% 'selectionmode' - selection mode 'multiple' or 'single'. See listdlg2(). +% +% Output: +% chanlist - indices of selected channels +% strchannames - names of selected channel names in a concatenated string +% (channel names are separated by space characters) +% cellchannames - names of selected channel names in a cell array +% +% Author: Arnaud Delorme, CNL / Salk Institute, 3 March 2003 + +% Copyright (C) 3 March 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [chanlist,chanliststr, allchanstr] = pop_chansel(chans, varargin); + + if nargin < 1 + help pop_chansel; + return; + end; + if isempty(chans), disp('Empty input'); return; end; + if isnumeric(chans), + for c = 1:length(chans) + newchans{c} = num2str(chans(c)); + end; + chans = newchans; + end; + chanlist = []; + chanliststr = {}; + allchanstr = ''; + + g = finputcheck(varargin, { 'withindex' { 'integer';'string' } { [] {'on' 'off'} } 'off'; + 'select' { 'cell';'string';'integer' } [] []; + 'selectionmode' 'string' { 'single';'multiple' } 'multiple'}); + if isstr(g), error(g); end; + if ~isstr(g.withindex), chan_indices = g.withindex; g.withindex = 'on'; + else chan_indices = 1:length(chans); + end; + + % convert selection to integer + % ---------------------------- + if isstr(g.select) & ~isempty(g.select) + g.select = parsetxt(g.select); + end; + if iscell(g.select) & ~isempty(g.select) + if isstr(g.select{1}) + tmplower = lower( chans ); + for index = 1:length(g.select) + matchind = strmatch(lower(g.select{index}), tmplower, 'exact'); + if ~isempty(matchind), g.select{index} = matchind; + else error( [ 'Cannot find ''' g.select{index} '''' ] ); + end; + end; + end; + g.select = [ g.select{:} ]; + end; + if ~isnumeric( g.select ), g.select = []; end; + + % add index to channel name + % ------------------------- + tmpstr = {chans}; + if isnumeric(chans{1}) + tmpstr = [ chans{:} ]; + tmpfieldnames = cell(1, length(tmpstr)); + for index=1:length(tmpstr), + if strcmpi(g.withindex, 'on') + tmpfieldnames{index} = [ num2str(chan_indices(index)) ' - ' num2str(tmpstr(index)) ]; + else + tmpfieldnames{index} = num2str(tmpstr(index)); + end; + end; + else + tmpfieldnames = chans; + if strcmpi(g.withindex, 'on') + for index=1:length(tmpfieldnames), + tmpfieldnames{index} = [ num2str(chan_indices(index)) ' - ' tmpfieldnames{index} ]; + end; + end; + end; + [chanlist,tmp,chanliststr] = listdlg2('PromptString',strvcat('(use shift|Ctrl to', 'select several)'), ... + 'ListString', tmpfieldnames, 'initialvalue', g.select, 'selectionmode', g.selectionmode); + if tmp == 0 + chanlist = []; + chanliststr = ''; + return; + else + allchanstr = chans(chanlist); + end; + + % test for spaces + % --------------- + spacepresent = 0; + if ~isnumeric(chans{1}) + tmpstrs = [ allchanstr{:} ]; + if ~isempty( find(tmpstrs == ' ')) | ~isempty( find(tmpstrs == 9)) + spacepresent = 1; + end; + end; + + % get concatenated string (if index) + % ----------------------- + if strcmpi(g.withindex, 'on') | spacepresent + if isnumeric(chans{1}) + chanliststr = num2str(celltomat(allchanstr)); + else + chanliststr = ''; + for index = 1:length(allchanstr) + if spacepresent + chanliststr = [ chanliststr '''' allchanstr{index} ''' ' ]; + else + chanliststr = [ chanliststr allchanstr{index} ' ' ]; + end; + end; + chanliststr = chanliststr(1:end-1); + end; + end; + + return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_comments.m b/code/eeglab13_4_4b/functions/popfunc/pop_comments.m new file mode 100644 index 0000000..c6c14c6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_comments.m @@ -0,0 +1,162 @@ +% pop_comments() - edit comments +% +% Usage: +% >> newcomments = pop_comments( oldcomments); +% >> newcomments = pop_comments( oldcomments, title, newcomments, concat); +% +% Inputs: +% oldcomments - old comments (string or cell array of strings) +% title - optional window title (string) +% newcomments - new comments (string or cell array of strings) +% to assign (during commandline calls only) +% concat - [0|1] 1 concatenate the newcomments to the old one. +% Default is 0. +% +% Outputs: +% newcomments - new comments, string +% +% Note: if new comments are given as input, there are simply +% converted and returned by the function; otherwise a +% window pops up. +% +% Example +% EEG.comments = pop_comments( { 'This is the first line.' ' ' ... +% 'This is the third line.' }, 'Editing'); +% EEG.comments = pop_comments(EEG.comments,'','This is the fourth line.",1); +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-16-02 text interface editing -sm & ad + +function [newcomments, com] = pop_comments( comments, plottitle, newcomments, concat ); + +com = ''; +if exist('comments') ~=1, comments = ''; +elseif iscell(comments), comments = strvcat(comments{:}); +end; + +% remove trailing blanks and make multiline +comments = strmultiline( comments, 53); + +if nargin < 3 + newcomments = comments; + try, icadefs; + catch, + BACKCOLOR = [.8 .8 .8]; + GUIBUTTONCOLOR = [.8 .8 .8]; + end; + figure('menubar', 'none', 'tag', 'comment', 'color', BACKCOLOR, 'userdata', 0, ... + 'numbertitle', 'off', 'name', 'Read/Enter comments -- pop_comments()'); + pos = get(gca,'position'); % plot relative to current axes + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]./100; + if exist('plottitle') ~=1, plottitle = ''; end; + + h = title(plottitle); + set(h, 'fontname','Helvetica','fontweight', 'bold', 'interpreter', 'none'); + + axis off; + + % create the buttons + % ------------------ + uicontrol('Parent',gcf, ... + 'Units','Normalized', ... + 'Position', [0 -5 20 10].*s+q, ... + 'backgroundcolor', GUIBUTTONCOLOR, ... + 'string','CANCEL', 'callback', 'close(findobj(''tag'', ''comment''));' ); + + uicontrol('Parent',gcf, ... + 'Units','Normalized', ... + 'Position', [80 -5 20 10].*s+q, ... + 'backgroundcolor', GUIBUTTONCOLOR, ... + 'string','SAVE', 'callback', ... + [ 'set(gcbf, ''userdata'', ' ... + 'get(findobj(''parent'', gcbf, ''tag'', ''edit''), ''string''));' ]); + + %hh = text( q(1), 100*s(2)+q(2), comments, 'tag', 'edit'); + %set( hh, 'editing', 'on', 'verticalalignment', 'top'); + + %hh = uicontrol('Parent',gcf, ... + %'Units','Normalized', ... + %'style', 'text', ... + %'Position', [0 100 105 5].*s+q, ... + %'string', 'Warning: each blank line must contain at least a ''space'' character', ... + %'horizontalalignment', 'left', ... + %'backgroundcolor', BACKCOLOR ); + + hh = uicontrol('Parent',gcf, ... + 'Units','Normalized', ... + 'style', 'edit', ... + 'tag', 'edit', ... + 'Position', [0 10 105 85].*s+q, ... + 'string', comments, ... + 'backgroundcolor', [ 1 1 1], ... + 'horizontalalignment', 'left', ... + 'max', 3, ... + 'fontsize', 12); + + % Try to use 'courier' since it has constant character size + lf = listfonts; + tmppos = strmatch('Courier', lf); + if ~isempty(tmppos) + set(hh, 'fontname', lf{tmppos(1)}, 'fontsize', 10); + end; + + waitfor(gcf, 'userdata'); + + % find return mode + if isempty(get(0, 'currentfigure')), return; end; + tmp = get(gcf, 'userdata'); + if ~isempty(tmp) & isstr(tmp) + newcomments = tmp; % ok button + else return; + end; + + close(findobj('tag', 'comment')); +else + if iscell(newcomments) + newcomments = strvcat(newcomments{:}); + end; + if nargin > 3 & concat == 1 + newcomments = strvcat(comments, newcomments); + end; + return; +end; + +I = find( comments(:) == ''''); +comments(I) = ' '; +if nargout > 1 + if ~strcmp( comments, newcomments) + allsame = 1; + for index = 1:size(comments, 1) + if ~strcmp(comments(index,:), newcomments(index,:)), allsame = 0; end; + end; + else + allsame = 0; + end; + if allsame & ~isempty(comments) + com =sprintf('EEG.comments = pop_comments(EEG.comments, '''', %s, 1);', vararg2str(newcomments(index+1:end,:))); + else + com =sprintf('EEG.comments = pop_comments('''', '''', %s);', vararg2str(newcomments)); + end; +end; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_compareerps.m b/code/eeglab13_4_4b/functions/popfunc/pop_compareerps.m new file mode 100644 index 0000000..4134c17 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_compareerps.m @@ -0,0 +1,77 @@ +% pop_compareerps() - Compare the (ERP) averages of two datasets. +% +% Usage: +% >> pop_compareerps( ALLEEG, datasetlist, chansubset, title); +% Inputs: +% ALLEEG - array of datasets +% datasetlist - list of datasets +% chansubset - vector of channel subset +% title - plot title +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab(), plottopo() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-11-02 added empty ALLEEG check -ad +% 03-18-02 added channel subset -ad +% 03-18-02 added title -ad & sm +function com = pop_compareerps( ALLEEG, setlist, chansubset, plottitle); + +com = ''; +if nargin < 1 + help pop_compareerps; + return; +end; +if isempty(ALLEEG) + error('pop_compareerps: cannot process empty sets of data'); +end; +if exist('plottitle') ~= 1 + plottitle = ''; +end; +if nargin < 2 + % which set to save + % ----------------- + promptstr = { 'List of datasets to compare (ex: 1 3 4):' ... + 'Channels subset to consider ([]=all):' ... + 'Plot title ([]=automatic):' }; + inistr = { '1' '' '' }; + result = inputdlg2( promptstr, 'Compare dataset ERPs -- pop_compareerps()', 1, inistr, 'pop_compareerps'); + if length(result) == 0 return; end; + setlist = eval( [ '[' result{1} ']' ] ); + chansubset = eval( [ '[' result{2} ']' ] ); + if isempty( chansubset ), chansubset = 1:ALLEEG(setlist(1)).nbchan; end; + plottitle = result{3}; + if isempty(plottitle) + plottitle = [ 'Compare datasets number (blue=first; red=sec.)' int2str(setlist) ]; + end; + figure; +end; +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; +tracing = []; +for setindex = setlist + tracing = [ tracing squeeze(mean(ALLEEG(setindex).data,3))]; +end; + +% save channel names +% ------------------ +plottopo( tracing, ALLEEG(setlist(1)).chanlocs, ALLEEG(setlist(1)).pnts, [ALLEEG(setlist(1)).xmin ALLEEG(setlist(1)).xmax 0 0]*1000, plottitle, chansubset ); + +com = sprintf('figure; pop_compareerps( %s, [%s], [%s], ''%s'');', inputname(1), num2str(setlist), num2str(chansubset), plottitle); +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_comperp.m b/code/eeglab13_4_4b/functions/popfunc/pop_comperp.m new file mode 100644 index 0000000..88cec75 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_comperp.m @@ -0,0 +1,543 @@ +% pop_comperp() - Compute the grand average ERP waveforms of multiple datasets +% currently loaded into EEGLAB, with optional ERP difference-wave +% plotting and t-tests. Creates a plotting figure. +% Usage: +% >> pop_comperp( ALLEEG, flag ); % pop-up window, interactive mode +% >> [erp1 erp2 erpsub time sig] = pop_comperp( ALLEEG, flag, ... +% datadd, datsub, 'key', 'val', ...); +% Inputs: +% ALLEEG - Array of loaded EEGLAB EEG structure datasets +% flag - [0|1] 0 -> Use ICA components; 1 -> use data channels {default: 1} +% datadd - [integer array] List of ALLEEG dataset indices to average to make +% an ERP grand average and optionally to compare with 'datsub' datasets. +% +% Optional inputs: +% datsub - [integer array] List of ALLEEG dataset indices to average and then +% subtract from the 'datadd' result to make an ERP grand mean difference. +% Together, 'datadd' and 'datsub' may be used to plot and compare grand mean +% responses across subjects or conditions. Both arrays must contain the same +% number of dataset indices and entries must be matched pairwise (Ex: +% 'datadd' indexes condition A datasets from subjects 1:n, and 'datsub', +% condition B datasets from the same subjects 1:n). {default: []} +% 'alpha' - [0 < float < 1] Apply two-tailed t-tests for p < alpha. If 'datsub' is +% not empty, perform t-tests at each latency. If 'datasub' is empty, +% perform two-tailed t-tests against a 0 mean dataset with same variance. +% Significant time regions are highlighted in the plotted data. +% 'chans' - [integer array] Vector of chans. or comps. to use {default: all} +% 'geom' - ['scalp'|'array'] Plot erps in a scalp array (plottopo()) +% or as a rectangular array (plotdata()). Note: Only channels +% (see 'chans' above) can be plotted in a 'scalp' array. +% 'tlim' - [min max] Time window (ms) to plot data {default: whole time range} +% 'title' - [string] Plot title {default: none} +% 'ylim' - [min max] y-axis limits {default: auto from data limits} +% 'mode' - ['ave'|'rms'] Plotting mode. Plot either grand average or RMS +% (root mean square) time course(s) {default: 'ave' -> grand average}. +% 'std' - ['on'|'off'|'none'] 'on' -> plot std. devs.; 'none' -> do not +% interact with other options {default:'none'} +% +% Vizualisation options: +% 'addavg' - ['on'|'off'] Plot grand average (or RMS) of 'datadd' datasets +% {default: 'on' if 'datsub' empty, otherwise 'off'} +% 'subavg' - ['on'|'off'] Plot grand average (or RMS) of 'datsub' datasets +% {default:'off'} +% 'diffavg' - ['on'|'off'] Plot grand average (or RMS) difference +% 'addall' - ['on'|'off'] Plot the ERPs for all 'dataadd' datasets only {default:'off'} +% 'suball' - ['on'|'off'] Plot the ERPs for all 'datasub datasets only {default:'off'} +% 'diffall' - ['on'|'off'] Plot all the 'datadd'-'datsub' ERP differences {default:'off'} +% 'addstd' - ['on'|'off'] Plot std. dev. for 'datadd' datasets only +% {default: 'on' if 'datsub' empty, otherwise 'off'} +% 'substd' - ['on'|'off'] Plot std. dev. of 'datsub' datasets only {default:'off'} +% 'diffstd' - ['on'|'off'] Plot std. dev. of 'datadd'-'datsub' differences {default:'on'} +% 'diffonly' - ['on'|'off'|'none'] 'on' -> plot difference only; 'none' -> do not affect +% other options {default:'none'} +% 'allerps' - ['on'|'off'|'none'] 'on' -> show ERPs for all conditions; +% 'none' -> do not affect other options {default:'none'} +% 'tplotopt' - [cell array] Pass 'key', val' plotting options to plottopo() +% +% Output: +% erp1 - Grand average (or rms) of the 'datadd' datasets +% erp2 - Grand average (or rms) of the 'datsub' datasets +% erpsub - Grand average (or rms) 'datadd' minus 'datsub' difference +% times - Vector of epoch time indices +% sig - T-test significance values (chans,times). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 15 March 2003 +% +% Note: t-test functions were adapted for matrix preprocessing from C functions +% by Press et al. See the description in the pttest() code below +% for more information. +% +% See also: eeglab(), plottopo() + +% Copyright (C) 15 March 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [erp1, erp2, erpsub, times, pvalues] = pop_comperp( ALLEEG, flag, datadd, datsub, varargin); + +erp1 = ''; +if nargin < 1 + help pop_comperp; + return; +end; +if isempty(ALLEEG) + error('pop_comperp: cannot process empty sets of data'); +end; +if nargin < 2 + flag = 1; +end; +allcolors = { 'b' 'r' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' ... + 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm'}; +erp1 = ''; +if nargin < 3 + gtmp = [1.1 0.8 .21 .21 .21 0.1]; gtmp2 = [1.48 1.03 1]; + uigeom = { [2.6 0.95] gtmp gtmp gtmp [1] gtmp2 gtmp2 [1.48 0.25 1.75] gtmp2 gtmp2 }; + commulcomp= ['if get(gcbo, ''value''),' ... + ' set(findobj(gcbf, ''tag'', ''multcomp''), ''enable'', ''on'');' ... + 'else,' ... + ' set(findobj(gcbf, ''tag'', ''multcomp''), ''enable'', ''off'');' ... + 'end;']; + uilist = { { } ... + { 'style' 'text' 'string' 'avg. std. all ERPs' } ... + { 'style' 'text' 'string' 'Datasets to average (ex: 1 3 4):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 } ... + { 'style' 'checkbox' 'string' '' } ... + { 'style' 'checkbox' 'string' '' } { } ... + { 'style' 'text' 'string' 'Datasets to average and subtract (ex: 5 6 7):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 } ... + { 'style' 'checkbox' 'string' '' } ... + { 'style' 'checkbox' 'string' '' } { } ... + { 'style' 'text' 'string' 'Plot difference' } { } ... + { 'style' 'checkbox' 'string' '' 'value' 1 } ... + { 'style' 'checkbox' 'string' '' } ... + { 'style' 'checkbox' 'string' '' } { } ... + { } ... + { 'style' 'text' 'string' fastif(flag, 'Channels subset ([]=all):', ... + 'Components subset ([]=all):') } ... + { 'style' 'edit' 'string' '' } { } ... + { 'style' 'text' 'string' 'Highlight significant regions (.01 -> p=.01)' } ... + { 'style' 'edit' 'string' '' } { } ... + { 'style' 'text' 'string' 'Use RMS instead of average (check):' } { 'style' 'checkbox' 'string' '' } { } ... + { 'style' 'text' 'string' 'Low pass (Hz) (for display only)' } ... + { 'style' 'edit' 'string' '' } { } ... + { 'style' 'text' 'string' 'Plottopo options (''key'', ''val''):' } ... + { 'style' 'edit' 'string' '''ydir'', -1' } ... + { 'style' 'pushbutton' 'string' 'Help' 'callback', 'pophelp(''plottopo'')' } ... + }; + + % remove geometry textbox for ICA components + result = inputgui( uigeom, uilist, 'pophelp(''pop_comperp'')', 'ERP grand average/RMS - pop_comperp()'); + if length(result) == 0, return; end; + + %decode parameters list + options = {}; + datadd = eval( [ '[' result{1} ']' ]); + if result{2}, options = { options{:} 'addavg' 'on' }; else, options = { options{:} 'addavg' 'off' }; end; + if result{3}, options = { options{:} 'addstd' 'on' }; else, options = { options{:} 'addstd' 'off' }; end; + if result{4}, options = { options{:} 'addall' 'on' }; end; + datsub = eval( [ '[' result{5} ']' ]); + if result{6}, options = { options{:} 'subavg' 'on' }; end; + if result{7}, options = { options{:} 'substd' 'on' }; end; + if result{8}, options = { options{:} 'suball' 'on' }; end; + if result{9}, options = { options{:} 'diffavg' 'on' }; else, options = { options{:} 'diffavg' 'off' }; end; + if result{10}, options = { options{:} 'diffstd' 'on' }; else, options = { options{:} 'diffstd' 'off' }; end; + if result{11}, options = { options{:} 'diffall' 'on' }; end; + + if result{12}, options = { options{:} 'chans' eval( [ '[' result{12} ']' ]) }; end; + if ~isempty(result{13}), options = { options{:} 'alpha' str2num(result{13}) }; end; + if result{14}, options = { options{:} 'mode' 'rms' }; end; + if ~isempty(result{15}), options = { options{:} 'lowpass' str2num(result{15}) }; end; + if ~isempty(result{16}), options = { options{:} 'tplotopt' eval([ '{ ' result{16} ' }' ]) }; end; +else + options = varargin; +end; + +if nargin == 3 + datsub = []; % default +end + +% decode inputs +% ------------- +if isempty(datadd), error('First edit box (datasets to add) can not be empty'); end; +g = finputcheck( options, ... + { 'chans' 'integer' [] [1:ALLEEG(datadd(1)).nbchan]; + 'title' 'string' [] ''; + 'alpha' 'float' [] []; + 'geom' 'string' {'scalp';'array'} fastif(flag, 'scalp', 'array'); + 'addstd' 'string' {'on';'off'} fastif(isempty(datsub), 'on', 'off'); + 'substd' 'string' {'on';'off'} 'off'; + 'diffstd' 'string' {'on';'off'} 'on'; + 'addavg' 'string' {'on';'off'} fastif(isempty(datsub), 'on', 'off'); + 'subavg' 'string' {'on';'off'} 'off'; + 'diffavg' 'string' {'on';'off'} 'on'; + 'addall' 'string' {'on';'off'} 'off'; + 'suball' 'string' {'on';'off'} 'off'; + 'diffall' 'string' {'on';'off'} 'off'; + 'std' 'string' {'on';'off';'none'} 'none'; + 'diffonly' 'string' {'on';'off';'none'} 'none'; + 'allerps' 'string' {'on';'off';'none'} 'none'; + 'lowpass' 'float' [0 Inf] []; + 'tlim' 'float' [] []; + 'ylim' 'float' [] []; + 'tplotopt' 'cell' [] {}; + 'mode' 'string' {'ave';'rms'} 'ave'; + 'multcmp' 'integer' [0 Inf] [] }); +if isstr(g), error(g); end; +if length(datadd) == 1 + disp('Cannot perform statistics using only 1 dataset'); + g.alpha = []; +end; + +figure; axcopy + +try, icadefs; set(gcf, 'color', BACKCOLOR); axis off; catch, end; + +% backward compatibility of param +% ------------------------------- +if ~strcmpi(g.diffonly, 'none') + if strcmpi(g.diffonly, 'off'), g.addavg = 'on'; g.subavg = 'on'; end; +end; +if ~strcmpi(g.allerps, 'none') + if isempty(datsub) + g.addall = g.allerps; + else g.diffall = g.allerps; + end; +end; +if ~strcmpi(g.std, 'none') + if isempty(datsub) + g.addstd = g.std; + else g.diffstd = g.std; + end; +end; + +% check consistency +% ----------------- +if length(datsub) > 0 & length(datadd) ~= length(datsub) + error('The number of component to subtract must be the same as the number of components to add'); +end; + +% if only 2 dataset entered, toggle average to single trial +% --------------------------------------------------------- +if length(datadd) == 1 &strcmpi(g.addavg, 'on') + g.addavg = 'off'; + g.addall = 'on'; +end; +if length(datsub) == 1 &strcmpi(g.subavg, 'on') + g.subavg = 'off'; + g.suball = 'on'; +end; +if length(datsub) == 1 & length(datadd) == 1 &strcmpi(g.diffavg, 'on') + g.diffavg = 'off'; + g.diffall = 'on'; +end; + +regions = {}; +pnts = ALLEEG(datadd(1)).pnts; +srate = ALLEEG(datadd(1)).srate; +xmin = ALLEEG(datadd(1)).xmin; +xmax = ALLEEG(datadd(1)).xmax; +nbchan = ALLEEG(datadd(1)).nbchan; +chanlocs = ALLEEG(datadd(1)).chanlocs; +unionIndices = union_bc(datadd, datsub); +for index = unionIndices(:)' + if ALLEEG(index).pnts ~= pnts, error(['Dataset ' int2str(index) ' does not have the same number of points as others']); end; + if ALLEEG(index).xmin ~= xmin, error(['Dataset ' int2str(index) ' does not have the same xmin as others']); end; + if ALLEEG(index).xmax ~= xmax, error(['Dataset ' int2str(index) ' does not have the same xmax as others']); end; + if ALLEEG(index).nbchan ~= nbchan, error(['Dataset ' int2str(index) ' does not have the same number of channels as others']); end; +end; + +if ~isempty(g.alpha) & length(datadd) == 1 + error([ 'T-tests require more than one ''' datadd ''' dataset' ]); +end + +% compute ERPs for add +% -------------------- +for index = 1:length(datadd) + TMPEEG = eeg_checkset(ALLEEG(datadd(index)),'loaddata'); + if flag == 1, erp1ind(:,:,index) = mean(TMPEEG.data,3); + else erp1ind(:,:,index) = mean(eeg_getdatact(TMPEEG, 'component', [1:size(TMPEEG.icaweights,1)]),3); + end; + addnames{index} = [ '#' int2str(datadd(index)) ' ' TMPEEG.setname ' (n=' int2str(TMPEEG.trials) ')' ]; + clear TMPEEG; +end; + +% optional: subtract +% ------------------ +colors = {}; % color aspect for curves +allcolors = { 'b' 'r' 'g' 'c' 'm' 'y' [0 0.5 0] [0.5 0 0] [0 0 0.5] [0.5 0.5 0] [0 0.5 0.5] [0.5 0 0.5] [0.5 0.5 0.5] }; +allcolors = { allcolors{:} allcolors{:} allcolors{:} allcolors{:} allcolors{:} allcolors{:} }; +allcolors = { allcolors{:} allcolors{:} allcolors{:} allcolors{:} allcolors{:} allcolors{:} }; +if length(datsub) > 0 % dataset to subtract + + % compute ERPs for sub + % -------------------- + for index = 1:length(datsub) + TMPEEG = eeg_checkset(ALLEEG(datsub(index)),'loaddata'); + if flag == 1, erp2ind(:,:,index) = mean(TMPEEG.data,3); + else erp2ind(:,:,index) = mean(eeg_getdatact(TMPEEG, 'component', [1:size(TMPEEG.icaweights,1)]),3); + end; + subnames{index} = [ '#' int2str(datsub(index)) ' ' TMPEEG.setname '(n=' int2str(TMPEEG.trials) ')' ]; + clear TMPEEG + end; + + l1 = size(erp1ind,3); + l2 = size(erp2ind,3); + allcolors1 = allcolors(3:l1+2); + allcolors2 = allcolors(l1+3:l1+l2+3); + allcolors3 = allcolors(l1+l2+3:end); + [erps1, erpstd1, colors1, colstd1, legend1] = preparedata( erp1ind , g.addavg , g.addstd , g.addall , g.mode, 'Add ' , addnames, 'b', allcolors1 ); + [erps2, erpstd2, colors2, colstd2, legend2] = preparedata( erp2ind , g.subavg , g.substd , g.suball , g.mode, 'Sub ' , subnames, 'r', allcolors2 ); + [erps3, erpstd3, colors3, colstd3, legend3] = preparedata( erp1ind-erp2ind, g.diffavg, g.diffstd, g.diffall, g.mode, 'Diff ', ... + { addnames subnames }, 'k', allcolors3 ); + + % handle special case of std + % -------------------------- + erptoplot = [ erps1 erps2 erps3 erpstd1 erpstd2 erpstd3 ]; + colors = { colors1{:} colors2{:} colors3{:} colstd1{:} colstd2{:} colstd3{:}}; + legend = { legend1{:} legend2{:} legend3{:} }; + + % highlight significant regions + % ----------------------------- + if ~isempty(g.alpha) + pvalues = pttest(erp1ind(g.chans,:,:), erp2ind(g.chans,:,:), 3); + regions = p2regions(pvalues, g.alpha, [xmin xmax]*1000); + else + pvalues= []; + end; + +else + [erptoplot, erpstd, colors, colstd, legend] = preparedata( erp1ind, g.addavg, g.addstd, g.addall, g.mode, '', addnames, 'k', allcolors); + erptoplot = [ erptoplot erpstd ]; + colors = { colors{:} colstd{:} }; + + % highlight significant regions + % ----------------------------- + if ~isempty(g.alpha) + pvalues = ttest(erp1ind, 0, 3); + regions = p2regions(pvalues, g.alpha, [xmin xmax]*1000); + else + pvalues= []; + end; +end; + +% lowpass data +% ------------ +if ~isempty(g.lowpass) + if exist('filtfilt') == 2 + erptoplot = eegfilt(erptoplot, srate, 0, g.lowpass); + else + erptoplot = eegfiltfft(erptoplot, srate, 0, g.lowpass); + end; +end; +if strcmpi(g.geom, 'array') | flag == 0, chanlocs = []; end; +if ~isfield(chanlocs, 'theta'), chanlocs = []; end; + +% select time range +% ----------------- +if ~isempty(g.tlim) + pointrange = round(eeg_lat2point(g.tlim/1000, [1 1], srate, [xmin xmax])); + g.tlim = eeg_point2lat(pointrange, [1 1], srate, [xmin xmax]); + erptoplot = reshape(erptoplot, size(erptoplot,1), pnts, size(erptoplot,2)/pnts); + erptoplot = erptoplot(:,[pointrange(1):pointrange(2)],:); + pnts = size(erptoplot,2); + erptoplot = reshape(erptoplot, size(erptoplot,1), pnts*size(erptoplot,3)); + xmin = g.tlim(1); + xmax = g.tlim(2); +end; + +% plot data +% --------- +plottopo( erptoplot, 'chanlocs', chanlocs, 'frames', pnts, ... + 'limits', [xmin xmax 0 0]*1000, 'title', g.title, 'colors', colors, ... + 'chans', g.chans, 'legend', legend, 'regions', regions, 'ylim', g.ylim, g.tplotopt{:}); + +% outputs +% ------- +times = linspace(xmin, xmax, pnts); +erp1 = mean(erp1ind,3); +if length(datsub) > 0 % dataset to subtract + erp2 = mean(erp2ind,3); + erpsub = erp1-erp2; +else + erp2 = []; + erpsub = []; +end; + +if nargin < 3 & nargout == 1 + erp1 = sprintf('pop_comperp( %s, %d, %s);', inputname(1), ... + flag, vararg2str({ datadd datsub options{:} }) ); +end; +return; + +% convert significance values to alpha +% ------------------------------------ +function regions = p2regions( pvalues, alpha, limits); + + for index = 1:size(pvalues,1) + signif = diff([1 pvalues(index,:) 1] < alpha); + pos = find([signif] > 0); + pos = pos/length(pvalues)*(limits(2) - limits(1))+limits(1); + neg = find([signif(2:end)] < 0); + neg = neg/length(pvalues)*(limits(2) - limits(1))+limits(1); + if length(pos) ~= length(neg), signif, pos, neg, error('Region error'); end; + regions{index} = [neg;pos]; + end; + +% process data +% ------------ +function [erptoplot, erpstd, colors, colstd, legend] = preparedata( erpind, plotavg, plotstd, plotall, mode, tag, dataset, coloravg, allcolors); + + colors = {}; + legend = {}; + erptoplot = []; + erpstd = []; + colstd = {}; + + % plot individual differences + % --------------------------- + if strcmpi(plotall, 'on') + erptoplot = [ erptoplot erpind(:,:) ]; + for index=1:size(erpind,3) + if iscell(dataset) + if strcmpi(tag, 'Diff ') + legend = { legend{:} [ dataset{1}{index} ' - ' dataset{2}{index} ] }; + else + legend = { legend{:} dataset{index} }; + end; + else + legend = { legend{:} [ 'Dataset ' int2str(dataset(index)) ] }; + end; + colors = { colors{:} allcolors{index} }; + end; + end; + + % plot average + % ------------ + if strcmpi( plotavg, 'on') + if strcmpi(mode, 'ave') + granderp = mean(erpind,3); + legend = { legend{:} [ tag 'Average' ] }; + else granderp = sqrt(mean(erpind.^2,3)); + legend = { legend{:} [ tag 'RMS' ] }; + end; + colors = { colors{:} {coloravg;'linewidth';2 }}; + erptoplot = [ erptoplot granderp]; + end; + + % plot standard deviation + % ----------------------- + if strcmpi(plotstd, 'on') + if strcmpi(plotavg, 'on') + std1 = std(erpind, [], 3); + erptoplot = [ erptoplot granderp+std1 ]; + erpstd = granderp-std1; + legend = { legend{:} [ tag 'Standard dev.' ] }; + colors = { colors{:} { coloravg;'linestyle';':' } }; + colstd = { { coloravg 'linestyle' ':' } }; + else + disp('Warning: cannot show standard deviation without showing average'); + end; + end; + +% ------------------------------------------------------------------ + +function [p, t, df] = pttest(d1, d2, dim) +%PTTEST Student's paired t-test. +% PTTEST(X1, X2) gives the probability that Student's t +% calculated on paired data X1 and X2 is higher than +% observed, i.e. the "significance" level. This is used +% to test whether two paired samples have significantly +% different means. +% [P, T] = PTTEST(X1, X2) gives this probability P and the +% value of Student's t in T. The smaller P is, the more +% significant the difference between the means. +% E.g. if P = 0.05 or 0.01, it is very likely that the +% two sets are sampled from distributions with different +% means. +% +% This works for PAIRED SAMPLES, i.e. when elements of X1 +% and X2 correspond one-on-one somehow. +% E.g. residuals of two models on the same data. +% Ref: Press et al. 1992. Numerical recipes in C. 14.2, Cambridge. + +if size(d1,dim) ~= size(d2, dim) + error('PTTEST: paired samples must have the same number of elements !') +end +if size(d1,dim) == 1 + close; error('Cannot compute paired t-test for a single ERP difference') +end; +a1 = mean(d1, dim); +a2 = mean(d2, dim); +v1 = std(d1, [], dim).^2; +v2 = std(d2, [], dim).^2; +n1 = size(d1,dim); +df = n1 - 1; +disp(['Computing t-values, df:' int2str(df) ]); + +d1 = d1-repmat(a1, [ones(1,dim-1) size(d1,3)]); +d2 = d2-repmat(a2, [ones(1,dim-1) size(d2,3)]); +%cab = (x1 - a1)' * (x2 - a2) / (n1 - 1); +cab = sum(d1.*d2,3)/(n1-1); +% use abs to avoid numerical errors for very similar data +% for which v1+v2-2cab may be close to 0. +t = (a1 - a2) ./ sqrt(abs(v1 + v2 - 2 * cab) / n1) ; +p = betainc( df ./ (df + t.*t), df/2, 0.5) ; + +% ------------------------------------------------------------------ + +function [p, t] = ttest(d1, d2, dim) +%TTEST Student's t-test for equal variances. +% TTEST(X1, X2) gives the probability that Student's t +% calculated on data X1 and X2, sampled from distributions +% with the same variance, is higher than observed, i.e. +% the "significance" level. This is used to test whether +% two sample have significantly different means. +% [P, T] = TTEST(X1, X2) gives this probability P and the +% value of Student's t in T. The smaller P is, the more +% significant the difference between the means. +% E.g. if P = 0.05 or 0.01, it is very likely that the +% two sets are sampled from distributions with different +% means. +% +% This works if the samples are drawn from distributions with +% the SAME VARIANCE. Otherwise, use UTTEST. +% +%See also: UTTEST, PTTEST. +if size(d1,dim) == 1 + close; error('Cannot compute t-test for a single ERP') +end; +a1 = mean(d1, dim); +v1 = std(d1, [], dim).^2; +n1 = size(d1,dim); +if length(d2) == 1 & d2 == 0 + a2 = 0; + n2 = n1; + df = n1 + n2 - 2; + pvar = (2*(n1 - 1) * v1) / df ; +else + a2 = mean(d2, dim); + v2 = std(d2, [], dim).^2; + n2 = size(d2,dim); + df = n1 + n2 - 2; + pvar = ((n1 - 1) * v1 + (n2 - 1) * v2) / df ; +end; +disp(['Computing t-values, df:' int2str(df) ]); + +t = (a1 - a2) ./ sqrt( pvar * (1/n1 + 1/n2)) ; +p = betainc( df ./ (df + t.*t), df/2, 0.5) ; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_copyset.m b/code/eeglab13_4_4b/functions/popfunc/pop_copyset.m new file mode 100644 index 0000000..5e4599a --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_copyset.m @@ -0,0 +1,73 @@ +% pop_copyset() - Copy the current EEG dataset into another dataset. +% +% Usage: +% >> ALLEEG = pop_copyset(ALLEEG, index1); % pop-up +% >> [ ALLEEG EEG CURRENTSET ] = pop_copyset(ALLEEG, index1, index2 ); +% +% Inputs: +% ALLEEG - array of dataset structure +% index1 - input dataset number +% index2 - index of dataset to copy into +% +% Inputs: +% ALLEEG - array of dataset structures +% EEG - new copied structure +% CURRENTSET - index of the new dataset +% +% Note: this function performs ALLEEG(index2) = ALLEEG(index1); +% with dataset checks +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeg_store(), pop_delset(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [ALLEEG, EEG, CURRENTSET, com] = pop_copyset(ALLEEG, set_in, set_out); + +com = ''; +if nargin < 2 + help pop_copyset; + return; +end; +if isempty(ALLEEG) + error(['Pop_copyset error: cannot copy' 10 'single dataset mode']); +end; +if set_in == 0 + error('Pop_copyset error: cannot copy dataset'); return; +end; +if isempty(ALLEEG(set_in).data) + error('Pop_copyset error: cannot copy empty dataset'); return; +end; + +if nargin < 3 + % which set to save + % ----------------- + promptstr = { 'Index of the new dataset:'}; + inistr = { int2str(set_in+1) }; + result = inputdlg2( promptstr, 'Copy dataset -- pop_copyset()', 1, inistr, 'pop_copyset'); + if size( result ) == 0, EEG = []; CURRENTSET = 0; return; end; + set_out = eval( result{1} ); +end; +ALLEEG = eeg_store(ALLEEG, eeg_retrieve(ALLEEG, set_in), set_out); +EEG = eeg_retrieve(ALLEEG, set_out); +CURRENTSET = set_out; + +com = sprintf('[ALLEEG EEG CURRENTSET] = pop_copyset( %s, %d, %d);', inputname(1), set_in, set_out); +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_crossf.m b/code/eeglab13_4_4b/functions/popfunc/pop_crossf.m new file mode 100644 index 0000000..25748c9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_crossf.m @@ -0,0 +1,219 @@ +% pop_crossf() - Return estimates and plots of event-related spectral coherence +% +% Usage: +% >> pop_crossf(EEG, typeproc, num1, num2, tlimits,cycles, +% 'key1',value1,'key2',value2, ... ); +% Inputs: +% INEEG - Input EEG dataset +% typeproc - Type of processing: +% 1 = process two raw-data channels, +% 0 = process two ICA components +% num1 - First component or channel number +% num2 - Second component or channel number +% tlimits - [mintime maxtime] Sub-epoch time limits in ms +% cycles - >0 -> Number of cycles in each analysis wavelet +% 0 -> Use FFTs (with constant window length) +% +% Optional inputs: As for crossf(). See >> help crossf +% +% Outputs: Same as crossf(). No outputs are returned when a +% window pops-up to ask for additional arguments +% +% Author: Arnaud Delorme, CNL / Salk Institute, 11 March 2002 +% +% See also: timef(), eeglab() + +% Copyright (C) 11 March 2002 arno@salk.edu, Arnaud Delorme, CNL / Salk Institute +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-18-02 added title -ad & sm +% 04-04-02 added outputs -ad & sm + +function varargout = pop_crossf(EEG, typeproc, num1, num2, tlimits, cycles, varargin ); + +varargout{1} = ''; +% display help if not enough arguments +% ------------------------------------ +if nargin < 2 + help pop_crossf; + return; +end; +lastcom = []; +if nargin < 3 + popup = 1; +else + popup = isstr(num1) | isempty(num1); + if isstr(num1) + lastcom = num1; + end; +end; + +% pop up window +% ------------- +if popup + [txt vars] = gethelpvar('timef.m'); + + geometry = { [1 0.5 0.5] [1 0.5 0.5] [1 0.5 0.5] [1 0.5 0.5] [0.92 0.1 0.78] [1 0.5 0.5] [1 0.8 0.2] [1] [1 1]}; + uilist = { { 'Style', 'text', 'string', fastif(typeproc, 'First channel number', 'First component number'), 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,3,[],'1') } {} ... + { 'Style', 'text', 'string', fastif(typeproc, 'Second channel number', 'Second component number'), 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,4,[],'2') } {} ... + { 'Style', 'text', 'string', 'Epoch time range [min max] (msec)', 'fontweight', 'bold', ... + 'tooltipstring', 'Sub epoch time limits' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,5,[],[ int2str(EEG.xmin*1000) ' ' int2str(EEG.xmax*1000) ]) } {} ... + { 'Style', 'text', 'string', 'Wavelet cycles (0->FFT, see >> help timef)', 'fontweight', 'bold', ... + 'tooltipstring', context('cycles',vars,txt) } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,6,[],'3 0.5') } {} ... + { 'Style', 'text', 'string', '[set]->Linear coher / [unset]->Phase coher', 'fontweight', 'bold', ... + 'tooltipstring', ['Compute linear inter-trial coherence (coher)' 10 ... + 'OR Amplitude-normalized inter-trial phase coherence (phasecoher)'] } ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'phasecoher','present',1) } { } ... + { 'Style', 'text', 'string', 'Bootstrap significance level (Ex: 0.01 -> 1%)', 'fontweight', 'bold', ... + 'tooltipstring', context('alpha',vars,txt) } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,'alpha') } {} ... + { 'Style', 'text', 'string', 'Optional timef() arguments (see Help)', 'fontweight', 'bold', ... + 'tooltipstring', 'See crossf() help via the Help button on the right...' } ... + { 'Style', 'edit', 'string', '''padratio'', 4' } ... + { 'Style', 'pushbutton', 'string', 'Help', 'callback', 'pophelp(''crossf'');' } ... + {} ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotersp','present',0), 'string', ... + 'Plot coherence amplitude', 'tooltipstring', ... + 'Plot coherence ampltitude image in the upper panel' } ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotphase','present',0), 'string', ... + 'Plot coherence phase', 'tooltipstring', ... + 'Plot coherence phase image in the lower panel' } ... + }; + + result = inputgui( geometry, uilist, 'pophelp(''pop_crossf'');', ... + fastif(typeproc, 'Plot channel cross-coherence -- pop_crossf()', ... + 'Plot component cross-coherence -- pop_crossf()')); + if length( result ) == 0 return; end; + + num1 = eval( [ '[' result{1} ']' ] ); + num2 = eval( [ '[' result{2} ']' ] ); + tlimits = eval( [ '[' result{3} ']' ] ); + cycles = eval( [ '[' result{4} ']' ] ); + if result{5} + options = [',''type'', ''coher''' ]; + else + options = [',''type'', ''phasecoher''' ]; + end; + + % add topoplot + % ------------ + if isfield(EEG.chanlocs, 'theta') + if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; + if typeproc == 1 + options = [options ', ''topovec'', [' int2str([num1 num2]) ... + '], ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo' ]; + else % typeproc == 0 + options = [options ', ''topovec'', EEG.icawinv(:, [' int2str([num1 num2]) ... + '])'', ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo' ]; + end; + end; + + % add title + % --------- + if isempty( findstr( 'title', result{7})) + if ~isempty(EEG.chanlocs) & typeproc + chanlabel1 = EEG.chanlocs(num1).labels; + chanlabel2 = EEG.chanlocs(num2).labels; + else + chanlabel1 = int2str(num1); + chanlabel2 = int2str(num2); + end; + if result{5} + options = [options ', ''title'',' fastif(typeproc, '''Channel ', '''Component ') chanlabel1 '-' chanlabel2 ... + ' Coherence''']; + else + options = [options ', ''title'',' fastif(typeproc, '''Channel ', '''Component ') chanlabel1 '-' chanlabel2 ... + ' Phase Coherence''' ]; + end; + end; + if ~isempty( result{6} ) + options = [ options ', ''alpha'',' result{6} ]; + end; + if ~isempty( result{7} ) + options = [ options ',' result{7} ]; + end; + if ~result{8} + options = [ options ', ''plotersp'', ''off''' ]; + end; + if ~result{9} + options = [ options ', ''plotphase'', ''off''' ]; + end; + figure; try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; +else + options = [ ',' vararg2str(varargin) ]; +end; + +% compute epoch limits +% -------------------- +if isempty(tlimits) + tlimits = [EEG.xmin, EEG.xmax]*1000; +end; +pointrange1 = round(max((tlimits(1)/1000-EEG.xmin)*EEG.srate, 1)); +pointrange2 = round(min((tlimits(2)/1000-EEG.xmin)*EEG.srate, EEG.pnts)); +pointrange = [pointrange1:pointrange2]; + +% call function sample either on raw data or ICA data +% --------------------------------------------------- +if typeproc == 1 + tmpsig1 = EEG.data(num1,pointrange,:); + tmpsig2 = EEG.data(num2,pointrange,:); +else + if ~isempty( EEG.icasphere ) + tmpsig1 = eeg_getdatact(EEG, 'component', num1, 'samples', pointrange); + tmpsig2 = eeg_getdatact(EEG, 'component', num2, 'samples', pointrange); + else + error('You must run ICA first'); + end; +end; +tmpsig1 = reshape( tmpsig1, 1, size(tmpsig1,2)*size(tmpsig1,3)); +tmpsig2 = reshape( tmpsig2, 1, size(tmpsig2,2)*size(tmpsig2,3)); + +% outputs +% ------- +outstr = ''; +if ~popup + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% plot the datas and generate output command +% -------------------------------------------- +if length( options ) < 2 + options = ''; +end; +varargout{1} = sprintf('figure; pop_crossf( %s, %d, %d, %d, [%s], [%s] %s);', ... + inputname(1), typeproc, num1, num2, int2str(tlimits), num2str(cycles), options); + +%options = [ options ', ''ydir'', ''norm''' ]; +com = sprintf( '%s crossf( tmpsig1, tmpsig2, length(pointrange), [tlimits(1) tlimits(2)], EEG.srate, cycles %s);', outstr, options); +eval(com) + +return; + +% get contextual help +% ------------------- +function txt = context(var, allvars, alltext); + loc = strmatch( var, allvars); + if ~isempty(loc) + txt= alltext{loc(1)}; + else + disp([ 'warning: variable ''' var ''' not found']); + txt = ''; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_editeventfield.m b/code/eeglab13_4_4b/functions/popfunc/pop_editeventfield.m new file mode 100644 index 0000000..7a35e16 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_editeventfield.m @@ -0,0 +1,444 @@ +% pop_editeventfield() - Add/remove/rename/modify a field in the event structure +% of an EEG dataset. Can also be used to append new events to the end of the +% event structure or to delete all current events. If the dataset is +% the only input, a window pops up to ask for relevant parameter values. +% +% Usage: >> [EEG] = pop_editeventfield( EEG, 'key1', 'value1', ...); +% +% Input: +% EEG - input dataset +% +% Optional inputs: +% 'FIELDNAME_X' - [ 'filename'|vector ]. Name of a current or new +% user-defined event field. The ascii file, vector variable, +% or explicit numeric vector should contain values for this field +% for all events specified in 'indices' (below) or in new events +% appended to the dataset (if 'indices' not specified). If one arg +% value is given, it will be used for all the specified events. +% If the arg is [], the named field is *removed* from all the +% specified (or new) events. Use this option to add a new field to +% all events in the dataset, or to modify the field values of specified +% events, to specify field information for new events appended to +% the event structure, or to remove an event field. For example, +% 'FIELDNAME_X' may be 'latency', 'type', 'duration'. +% 'latency' - [ 'filename'|vector ] example of field name (see description above). +% 'type' - [ 'filename'|vector ] example of field name (see description above). +% 'duration' - [ 'filename'|vector ] example of field name (see description above). +% 'FIELDNAME_X_info' - new comment string for field FIELDNAME_X. +% 'latency_info' - description string for the latency field. +% 'type_info' - description string for the type field. +% 'duration_info' - description string for the duration field. +% 'indices' - [vector of event indices] The indices of the events to modify. +% If adding a new event field, events not listed here +% will have an empty field value IF they are not in an epoch +% containing events whose field value is specified. However, +% if adding a new (FIELDNAME) field to an epoched dataset, +% and the field value for only one event in some data epoch is +% specified, then the other events in the same epoch will be given +% the specified value. If field values of more than one, but not all +% the events in an epoch are specified, then unspecified events at +% the beginning of the epoch will be given the value of the first +% specified event, unspecified epoch events after this event will +% be given the field value of the second specified epoch event, etc. +% {default|[]: modify all events in the dataset} +% 'rename' - ['FIELDNAME1->FIELDNAME2'] rename field 'FIELDNAME1' to +% field 'FIELDNAME2'. Ex: { 'rename', 'blocktype->condition' }. +% 'delold' - ['yes'|'no'] 'yes' = delete ALL previous events. {default: 'no'} +% 'timeunit' - [latency field time unit in fraction of seconds]. Ex: 1e-3 -> +% read specified latencies as msec {default: 1 (-->seconds)} +% 'skipline' - number of leading text file lines to skip in named text files. +% {default: 0}. +% 'delim' - delimiting characters in named text files {default: tabs and spaces} +% +% Outputs: +% EEG - dataset with updated event field +% +% Example: EEG = pop_editeventfield(EEG, 'type', 1, ... +% 'sleepstage', 'sleepstage_values.txt', ... +% 'latency', [100 130 123 400],'timeunit',1e-3); +% % Append 4 events to the EEG struct, all of type 1, at the latencies +% % given (in msec) with user-defined field ('sleepstage') values read +% % from a one-column ascii file ('sleepstage_values.txt'). +% +% Example: EEG = pop_editeventfield(EEG, 'indices', 1:2:3277, ... +% 'sleepstage', 'sleepstage_values.txt'); +% % Add a new 'sleepstage' field to all events in the EEG struct. +% % Read 'sleepstage' field values for odd-numbered events from a one-column +% % ascii file ('sleepstage_values.txt') -- even-numbered % events will have +% % an empty 'sleepstage' value (unless the data are epoched, see 'indices' above). +% +% Note: To save events into a readable table, first convert them to 'array' format, +% then save the array. +% >> events = eeg_eventformat(EEG.event, 'array'); +% >> save -ascii myevents.txt events +% +% Author: Arnaud Delorme & Scott Makeig, CNL / Salk Institute, 9 Feb 2002- +% +% See also: pop_importevent(), eeg_eventformat(), pop_selectevent() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 9 Feb 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%02/13/2001 fix bug if EEG.event is empty -ad +%03/12/2001 add timeunit option -ad +%03/18/2001 debug rename option -ad & sm +%03/18/2001 correct allignment problem -ad & ja + +function [EEG, com] = pop_editeventfield(EEG, varargin); + +com =''; +if nargin < 1 + help pop_editeventfield; + return; +end; + +if isempty(EEG.data) + error('Setevent error: cannot process empty dataset'); +end; + +I = []; + +% remove the event field +% ---------------------- +if ~isempty(EEG.event), + allfields = fieldnames(EEG.event); + ind1 = strmatch('urevent', allfields, 'exact'); + ind2 = strmatch('epoch', allfields, 'exact'); + allfields([ind1 ind2]) = []; + try, EEG.eventdescription([ind1 ind2]) = []; catch, end; +else + allfields = { 'type' 'latency' }; +end; + +if nargin<2 + commandload = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', tagtest), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + uilist = { ... + { 'Style', 'text', 'string', 'Edit fields:', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Edit description', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', sprintf('New values (file or array containing %d values)', length(EEG.event)), 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Delete field', 'fontweight', 'bold' } ... + }; + geometry = { [1.05 1.05 2 0.8] }; + + listboxtext = { 'No field selected' }; + txt_warn = 'warndlg2(strvcat(''Warning: deleting/renaming this field might cause EEGLAB'', ''to be unstable. Some functionalities will also be lost.''));'; + cb_warn2 = [ 'strtmp = get(gcbo, ''string''); if ~isempty(strmatch(strtmp(get(gcbo, ''value'')), { ''latency'' ''type''}, ''exact'')),' txt_warn 'end;' ]; + for index = 1:length(allfields) + geometry = { geometry{:} [1 1 1 0.7 0.2 0.32 0.2] }; + description = ''; + try, + description = fastif(isempty(EEG.eventdescription{index}), '', EEG.eventdescription{index}); + description = description(1,:); + tmplines = find(description == 10); + if ~isempty(tmplines), description = description(1:tmplines(1)-1); end; + catch, end; + if strcmp(allfields{index}, 'latency') || strcmp(allfields{index}, 'type') + cb_warn = { 'callback' [ 'if get(gcbo, ''value''),' txt_warn 'end;' ] }; + else cb_warn = { }; + end; + if strcmp(allfields{index}, 'latency') + tmpfield = [ allfields{index} '(s)' ]; + elseif strcmp(allfields{index}, 'duration') + tmpfield = [ allfields{index} '(s)' ]; + else + tmpfield = allfields{index}; + end; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', tmpfield }, ... + { 'Style', 'pushbutton', 'string', description, 'callback', ... + [ 'tmpuserdata = get(gcf, ''userdata'');' ... + 'tmpuserdata{' int2str(index) '} = pop_comments(tmpuserdata{' int2str(index) ... + '}, ''Comments on event field: ' allfields{index} ''');' ... + 'set(gcbo, ''string'', tmpuserdata{' int2str(index) '});' ... + 'set(gcf, ''userdata'', tmpuserdata); clear tmpuserdata;' ] }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', allfields{index} }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', ['tagtest = ''' allfields{index} ''';' commandload ] }, ... + { }, { 'Style', 'checkbox', 'string', ' ', cb_warn{:} }, { } }; + listboxtext = { listboxtext{:} allfields{index} }; + end; + index = length(allfields) + 1; + uilist = { uilist{:}, ... + { 'Style', 'edit', 'string', ''}, ... + { 'Style', 'pushbutton', 'string', '', 'callback', ... + [ 'tmpuserdata = get(gcf, ''userdata'');' ... + 'tmpuserdata{' int2str(index) '} = pop_comments(tmpuserdata{' int2str(index) ... + '}, ''Comments on new event field:'');' ... + 'set(gcbo, ''string'', tmpuserdata{' int2str(index) '});' ... + 'set(gcf, ''userdata'', tmpuserdata); clear tmpuserdata;' ] }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'newfield' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', ['tagtest = ''newfield'';' commandload ] }, ... + { 'Style', 'text', 'string', '-> add field'} ... + { } ... + { 'Style', 'text', 'string', 'Rename field', 'fontweight', 'bold' }, ... + { 'Style', 'popupmenu', 'string', listboxtext 'callback' cb_warn2 }, ... + { 'Style', 'text', 'string', 'as', 'fontweight', 'bold' }, ... + { 'Style', 'edit', 'string', '' } ... + fastif(isunix,{ 'Style', 'text', 'string', '(Click on field name to select it!)' },{ })}; + geometry = { geometry{:} [1 1 1 0.7 0.72] [1] [1 1.2 0.6 1 2] }; + + descriptions = EEG.eventdescription; + if isempty(descriptions), descriptions = { '' '' }; end; + [results userdat ]= inputgui( geometry, uilist, 'pophelp(''pop_editeventfield'');', ... + 'Edit event field(s) -- pop_editeventfield()', { descriptions{:} '' } ); + if length(results) == 0, return; end; + + % decode top inputs + % ----------------- + args = { }; + + % dealing with existing fields + %----------------------------- + for index = 1:length(allfields) + if results{index*2} == 1, args = { args{:}, allfields{index}, [] }; + else + if ~isempty( results{index*2-1} ) + if exist(results{index*2-1}) == 2, args = { args{:}, allfields{index}, [ results{index*2-1} ] }; % file + else args = { args{:}, allfields{index}, results{index*2-1} }; end; + end; + try, + if ~strcmp( userdat{index}, EEG.eventdescription{index}) + args = { args{:}, [ allfields{index} 'info' ], userdat{index} }; + end; + catch, end; + end; + end; + + % dealing with the new field + %--------------------------- + sub = 3; + if ~isempty( results{end-sub} ) + args = { args{:}, results{end-sub}, results{end-sub+1} }; % file + end; + + % handle rename + % ------------- + if results{end-1} ~= 1, args = { args{:}, 'rename', [ allfields{results{end-1}-1} '->' results{end} ] }; end; +else % no interactive inputs + args = varargin; + % scan args to modify array/file format + % array are transformed into string + % files are transformed into string of string + % (this is usefull to build the string command for the function) + % -------------------------------------------------------------- + for index=1:2:length(args) + if iscell(args{index+1}), args{index+1} = { args{index+1} }; end; % double nested + if isstr(args{index+1}) args{index+1} = args{index+1}; % string + end; + end; +end; + +% create structure +% ---------------- +try, g = struct(args{:}); +catch, disp('pop_editeventfield(): wrong syntax in function arguments'); return; +end; + +% test the presence of variables +% ------------------------------ +try, g.skipline; catch, g.skipline = 0; end; +try, g.indices; catch, g.indices = [1:length(EEG.event)]; end; +try, g.delold; catch, g.delold = 'no'; end; +try, g.timeunit; catch, g.timeunit = 1; end; +try, g.delim; catch, g.delim = char([9 32]); end; +if isstr(g.indices), g.indices = eval([ '[' g.indices ']' ]); end; + +tmpfields = fieldnames(g); +% scan all the fields of g +% ------------------------ +for curfield = tmpfields' + if ~isempty(EEG.event), allfields = fieldnames(EEG.event); + else allfields = {}; end; + switch lower(curfield{1}) + case { 'append' 'delold', 'fields', 'skipline', 'indices', 'timeunit', 'delim' }, ; % do nothing now + case 'rename', + if isempty( findstr('->',g.rename) ), + disp('warning pop_editeventfield() bad syntax for ''rename'', ignoring input'); + else + oldname = g.rename(1:findstr('->',g.rename)-1); + newname = g.rename(findstr('->',g.rename)+2:end); + indexmatch = strmatch(oldname, allfields); + if isempty(indexmatch), disp('pop_editeventfield() warning: name not found for rename'); + else + for index = 1:length(EEG.event) + eval([ 'EEG.event(index).' newname '=EEG.event(index).' oldname ';']); + end; + EEG.event = rmfield(EEG.event, oldname); + end; + if isfield(EEG, 'urevent') + disp('pop_editeventfield() warning: field name not renamed in urevent structure'); + end; + end; + otherwise, % user defined field command + % -------------------------- + infofield = findstr(curfield{1}, 'info'); + if ~isempty(infofield) & infofield == length( curfield{1} )-3 + % description of a field + % ---------------------- + fieldname = curfield{1}(1:infofield-1); + indexmatch = strmatch( fieldname, allfields); + if isempty( indexmatch ) + disp(['pop_editeventfield() warning: Field ' fieldname ' not found to add description, ignoring']); + else + EEG.eventdescription{indexmatch} = getfield(g, curfield{1}); + end; + else + % not an field for description + % ---------------------------- + if isempty( getfield(g, curfield{1}) ) % delete + indexmatch = strmatch( curfield{1}, allfields); + if isempty( indexmatch ) + disp(['pop_editeventfield() warning: Field ''' curfield{1} ''' not found for deletion, ignoring']); + else + EEG.event = rmfield(EEG.event, curfield{1}); + allfields(indexmatch) = []; + if isfield(EEG, 'urevent') + fprintf('pop_editeventfield() warning: field ''%s'' not deleted from urevent structure\n', curfield{1} ); + end; + try, + EEG.eventdescription(indexmatch) = []; + catch, end; + end; + else % interpret + switch g.delold % delete old events + case 'yes' + EEG.event = load_file_or_array( getfield(g, curfield{1}), g.skipline, g.delim ); + allfields = { curfield{1} }; + EEG.event = eeg_eventformat(EEG.event, 'struct', allfields); + EEG.event = recomputelatency( EEG.event, 1:length(EEG.event), EEG.srate, g.timeunit); + EEG = eeg_checkset(EEG, 'makeur'); + case 'no' % match existing fields + % --------------------- + tmparray = load_file_or_array( getfield(g, curfield{1}), g.skipline, g.delim ); + if isempty(g.indices) g.indices = [1:size(tmparray(:),1)] + length(EEG.event); end; + + indexmatch = strmatch(curfield{1}, allfields); + if isempty(indexmatch) % no match + disp(['pop_editeventfield(): creating new field ''' curfield{1} '''' ]); + end; + try + EEG.event = setstruct(EEG.event, curfield{1}, g.indices, [ tmparray{:} ]); + catch, + error('Wrong size for input array'); + end; + if strcmp(curfield{1}, 'latency') + EEG.event = recomputelatency( EEG.event, g.indices, EEG.srate, g.timeunit); + end; + if strcmp(curfield{1}, 'duration') + for indtmp = 1:length(EEG.event) + EEG.event(indtmp).duration = EEG.event(indtmp).duration/EEG.srate; + end; + end; + if isfield(EEG, 'urevent') + disp('pop-editeventfield(): updating urevent structure'); + try + tmpevent = EEG.event; + for indtmp = g.indices(:)' + if ~isempty(EEG.event(indtmp).urevent) + tmpval = getfield (EEG.event, {indtmp}, curfield{1}); + EEG.urevent = setfield (EEG.urevent, { tmpevent(indtmp).urevent }, ... + curfield{1}, tmpval); + end; + end; + catch, + disp('pop_editeventfield(): problem while updating urevent structure'); + end; + end; + end; + end; + end; + end; +end; + +if isempty(EEG.event) % usefull 0xNB empty structure + EEG.event = []; +end; +EEG = eeg_checkset(EEG, 'eventconsistency'); + +% generate the output command +% --------------------------- +com = sprintf('%s = pop_editeventfield( %s, %s);', inputname(1), inputname(1), vararg2str(args)); + +% interpret the variable name +% --------------------------- +function str = str2str( array ) + str = ''; + for index = 1:size(array,1) + str = [ str ', ''' array(index,:) '''' ]; + end; + if size(array,1) > 1 + str = [ 'strvcat(' str(2:end) ')']; + else + str = str(2:end); + end; +return; + +% interpret the variable name +% --------------------------- +function array = load_file_or_array( varname, skipline, delim ); + if isstr(varname) + if exist(varname) == 2 % mean that it is a filename + % -------------------------- + array = loadtxt( varname, 'skipline', skipline, 'delim', delim); + + else % variable in the global workspace + % -------------------------- + array = evalin('base', varname); + if ~iscell(array) + array = mattocell(array, ones(1, size(array,1)), ones(1, size(array,2))); + end; + end; + else + array = mattocell(varname); + end; +return; + +% update latency values +% --------------------- +function event = recomputelatency( event, indices, srate, timeunit); + if ~isfield(event, 'latency'), return; end; + for index = indices + event(index).latency = event(index).latency*srate*timeunit+1; + end; + +% create new field names +% ---------------------- +function epochfield = getnewfields( epochfield, nbfields ) + count = 1; + while nbfields > 0 + if isempty( strmatch([ 'var' int2str(count) ], epochfield ) ) + epochfield = { epochfield{:} [ 'var' int2str(count) ] }; + nbfields = nbfields-1; + else count = count+1; + end; + end; +return; + +function var = setstruct( var, fieldname, indices, values ) + if exist('indices') ~= 1, indices = 1:length(var); end; + if length(values) > 1 + for index = 1:length(indices) + var = setfield(var, {indices(index)}, fieldname, values(index)); + end; + else + for index = 1:length(indices) + var = setfield(var, {indices(index)}, fieldname, values); + end; + end; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_editeventvals.m b/code/eeglab13_4_4b/functions/popfunc/pop_editeventvals.m new file mode 100644 index 0000000..a92bfd9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_editeventvals.m @@ -0,0 +1,656 @@ +% pop_editeventvals() - Edit events contained in an EEG dataset structure. +% If the dataset is the only input, a window pops up +% allowing the user to insert the relevant parameter values. +% +% Usage: >> EEGOUT = pop_editeventvals( EEG, 'key1', value1, ... +% 'key2', value2, ... ); +% Input: +% EEG - EEG dataset +% +% Optional inputs: +% 'sort' - { field1 dir1 field2 dir2 } Sort events based on field1 +% then on optional field2. Arg dir1 indicates the sort +% direction (0 = increasing, 1 = decreasing). +% 'changefield' - {num field value} Insert the given value into the specified +% field in event num. (Ex: {34 'latency' 320.4}) +% 'changeevent' - {num value1 value2 value3 ...} Change the values of +% all fields in event num. +% 'add','append','insert' - {num value1 value2 value3 ...} Insert event +% before or at event num, and assign value to structure +% fields. Note that the latency field must be in second +% and will be converted to data sample. Note also that +% the index of the event is often irrelevant, as events +% will be automatically resorted by latencies. +% 'delete' - vector of indices of events to delete +% +% Outputs: +% EEGOUT - EEG dataset with the selected events only +% +% Ex: EEG = pop_editeventvals(EEG,'changefield', { 1 'type' 'target'}); +% % set field type of event number 1 to 'target' +% +% Author: Arnaud Delorme & Hilit Serby, SCCN, UCSD, 15 March 2002 +% +% See also: pop_selectevent(), pop_importevent() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 15 March 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-16-02 text interface editing -sm & ad +% 03-18-02 automatic latency switching display (epoch/continuous) - ad & sm +% 03-18-02 debug soring order - ad +% 03-18-02 put latencies in ms - ad, lf & sm +% 03-29-02 debug latencies in ms - ad & sm +% 04-02-02 debuging test - ad & sm + +function [EEG, com] = pop_editeventvals(EEG, varargin); + +com =''; +if nargin < 1 + help pop_editeventvals; + return; +end; + +if nargin >= 2 | isstr(EEG) % interpreting command from GUI or command line + + if isstr(EEG) % GUI + gui = 1; + varargin = { EEG varargin{:} }; + + % user data + % --------- + userdata = get(gcf, 'userdata'); + EEG = userdata{1}; + oldcom = userdata{2}; + allfields = fieldnames(EEG.event); + tmpind = strmatch('urevent', allfields); + allfields(tmpind) = []; + + % current event + % ------------- + objevent = findobj('parent', gcf, 'tag', 'numval'); + valnum = str2num(get(objevent, 'string')); + shift = 0; + + else % command line + + gui = 0; + if isempty(EEG.event) + disp('Getevent: cannot deal with empty event structure'); + return; + end; + + allfields = fieldnames(EEG.event); + tmpind = strmatch('urevent', allfields); + allfields(tmpind) = []; + + end; + + % retinterpret inputs (fix BUG 454) + % -------------------------------- + if ~gui + newvararg = {}; + for indfield = 1:2:length(varargin) + + com = varargin{ indfield }; + tmpargs = varargin{ indfield+1 }; + newvararg = { newvararg{:} com }; + + if any(strcmpi({'add','insert','append'},com)) + evtind = tmpargs{1}; + fields = fieldnames(EEG.event); + emptycells = cell(1,length(fields)-1); + newvararg = { newvararg{:}, { evtind emptycells{:} } }; + if strcmpi(com, 'append'), evtind = evtind+1; end; + + for ind = 2:length( tmpargs ) + if ~strcmpi(fields{ind-1}, 'urevent') + newvararg = { newvararg{:},'changefield',{ evtind fields{ind-1} tmpargs{ind} } }; + end; + end; + else + newvararg = { newvararg{:} tmpargs }; + end; + end; + varargin = newvararg; + end; + + % scan inputs + % ----------- + for indfield = 1:2:length(varargin) + if length(varargin) >= indfield+1 + tmparg = varargin{ indfield+1 }; + end; + + switch lower(varargin{indfield}) + + case 'goto', % ******************** GUI ONLY *********************** + + % shift time + % ---------- + shift = tmparg; + valnum = valnum + shift; + if valnum < 1, valnum = 1; end; + if valnum > length(EEG.event), valnum = length(EEG.event); end; + set(objevent, 'string', num2str(valnum,5)); + + % update fields + % ------------- + for index = 1:length(allfields) + + enable = 'on'; + if isfield(EEG.event, 'type') + if strcmpi(EEG.event(valnum).type, 'boundary'), enable = 'off'; end; + end; + if strcmp( allfields{index}, 'latency') & ~isempty(EEG.event(valnum).latency) + if isfield(EEG.event, 'epoch') + value = eeg_point2lat( EEG.event(valnum).latency, EEG.event(valnum).epoch, ... + EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); + else value = (EEG.event(valnum).latency-1)/EEG.srate+EEG.xmin; + end; + elseif strcmp( allfields{index}, 'duration') & ~isempty(EEG.event(valnum).duration) + if isfield(EEG.event, 'epoch') + value = EEG.event(valnum).duration/EEG.srate*1000; % milliseconds + else value = EEG.event(valnum).duration/EEG.srate; % seconds + end; + else + value = getfield( EEG.event(valnum), allfields{index}); + end; + + % update interface + % ---------------- + tmpobj = findobj('parent', gcf, 'tag', allfields{index}); + set(tmpobj, 'string', num2str(value,5), 'enable', enable); + end; + + % update original + % --------------- + tmpobj = findobj('parent', gcf, 'tag', 'original'); + if isfield(EEG.event, 'urevent') & EEG.event(valnum).urevent ~= valnum + set(tmpobj, 'string', [ 'originally ' int2str(EEG.event(valnum).urevent)], ... + 'horizontalalignment', 'center'); + else set(tmpobj, 'string', ' '); + end; + return; % NO NEED TO SAVE ANYTHING + + case { 'append' 'insert' 'add' }, % ********************************************************** + + if gui + shift = tmparg; % shift is for adding before or after the event + + % add epoch number if data epoch + % ------------------------------ + tmpcell = cell(1,1+length(fieldnames(EEG.event))); + tmpcell{1} = valnum; + if EEG.trials > 1 + indepoch = strmatch('epoch', fieldnames(EEG.event), 'exact'); + if valnum > 1, tmpprevval = valnum-1; + else tmpprevval = valnum+1; + end; + if tmpprevval <= length(EEG.event) + tmpcell{indepoch+1} = EEG.event(tmpprevval).epoch; + end; + end; + + % update commands + % --------------- + if shift + oldcom = { oldcom{:} 'append', tmpcell }; + else + oldcom = { oldcom{:} 'insert', tmpcell }; + end; + else + if strcmpi(lower(varargin{indfield}), 'append') % not 'add' for backward compatibility + shift = 1; + else shift = 0; + end; + valnum = tmparg{1}; + end; + + % find ur index + % ------------- + valnum = valnum + shift; + if isfield(EEG.event, 'epoch'), curepoch = EEG.event(valnum).epoch; end; + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + % find non empty urvalnum + urvalnum = []; + count = 0; + while isempty(urvalnum) + tmpindex = mod(valnum+count-1, length(EEG.event)+1)+1; + urvalnum = EEG.event(valnum+count).urevent; + count = count+1; + end; + if isfield(EEG.urevent, 'epoch'), urcurepoch = EEG.urevent(urvalnum).epoch; end; + urvalnum = urvalnum; + end; + + % update urevents + % --------------- + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + EEG.urevent(end+3) = EEG.urevent(end); + EEG.urevent(urvalnum+1:end-2) = EEG.urevent(urvalnum:end-3); + EEG.urevent(urvalnum) = EEG.urevent(end-1); + EEG.urevent = EEG.urevent(1:end-2); + if isfield(EEG.urevent, 'epoch'), EEG.urevent(urvalnum).epoch = urcurepoch; end; + end; + + % update events + % ------------- + EEG.event(end+3) = EEG.event(end); + EEG.event(valnum+1:end-2) = EEG.event(valnum:end-3); + EEG.event(valnum) = EEG.event(end-1); + EEG.event = EEG.event(1:end-2); + if isfield(EEG.event, 'epoch'), EEG.event(valnum).epoch = curepoch; end; + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + EEG.event(valnum).urevent = urvalnum; + for index = valnum+1:length(EEG.event) + EEG.event(index).urevent = EEG.event(index).urevent+1; + end; + end; + + % update type field + % ----------------- + for tmpind = 1:length(allfields) + EEG.event = checkconsistency(EEG.event, valnum, allfields{tmpind}); + end; + + case 'delete', % ********************************************************** + + if ~gui + valnum = tmparg; + end + + EEG.event(valnum) = []; + + if gui, + + valnum = min(valnum,length(EEG.event)); + set(objevent, 'string', num2str(valnum)); + + % update commands + % --------------- + oldcom = { oldcom{:} 'delete', valnum }; + + end; + + case { 'assign' 'changefield' }, % ********************************************************** + + if gui, % GUI case + + field = tmparg; + objfield = findobj('parent', gcf, 'tag', field); + editval = get(objfield, 'string'); + if ~isempty(editval) & ~isempty(str2num(editval)), editval = str2num(editval); end; + + % update history + % -------------- + oldcom = { oldcom{:},'changefield',{ valnum field editval }}; + + else % command line case + + valnum = tmparg{1}; + field = tmparg{2}; + editval = tmparg{3}; + + end; + + % latency and duration case + % ------------------------- + if strcmp( field, 'latency') & ~isempty(editval) + if isfield(EEG.event, 'epoch') + editval = eeg_lat2point( editval, EEG.event(valnum).epoch, ... + EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); + else editval = (editval- EEG.xmin)*EEG.srate+1; + end; + end; + if strcmp( field, 'duration') & ~isempty(editval) + if isfield(EEG.event, 'epoch') + editval = editval/1000*EEG.srate; % milliseconds + else editval = editval*EEG.srate; % seconds + end; + end; + + % adapt to other formats + % ---------------------- + EEG.event(valnum) = setfield(EEG.event(valnum), field, editval); + EEG.event = checkconsistency(EEG.event, valnum, field); + + % update urevents + % --------------- + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + urvalnum = EEG.event(valnum).urevent; + + % latency case + % ------------ + if strcmp( field, 'latency') & ~isempty(editval) + if isfield(EEG.urevent, 'epoch') + urepoch = EEG.urevent(urvalnum).epoch; + + + % find closest event latency + % -------------------------- + if valnum1 + if EEG.event(valnum-1).epoch == urepoch + urlatency = EEG.urevent(EEG.event(valnum-1).urevent).latency; + latency = EEG.event(valnum-1).latency; + end; + end; + + % update event + % ------------ + if exist('urlatency') ~=1 + disp('Urevent not updated: could not find other event in the epoch'); + else + editval = urlatency - ( latency - editval ); % new latency value + end; + else + editval = eeg_urlatency(EEG.event, EEG.event(valnum).latency); + end; + elseif strcmp( field, 'latency') % empty editval + EEG.event(valnum).latency = NaN; + end; + + % duration case + % ------------ + if strcmp( field, 'duration') & ~isempty(editval) + if isfield(EEG.event, 'epoch') + editval = editval/1000*EEG.srate; % milliseconds -> point + else editval = editval*EEG.srate; % seconds -> point + end; + end; + EEG.urevent = setfield(EEG.urevent, {urvalnum}, field, editval); + end; + + case 'sort', % ********************************************************** + + if gui % retrieve data + + field1 = get(findobj('parent', gcf, 'tag', 'listbox1'), 'value'); + field2 = get(findobj('parent', gcf, 'tag', 'listbox2'), 'value'); + dir1 = get(findobj('parent', gcf, 'tag', 'order1'), 'value'); + dir2 = get(findobj('parent', gcf, 'tag', 'order2'), 'value'); + + if field1 > 1, field1 = allfields{field1-1}; else return; end; + if field2 > 1, field1 = allfields{field2-1}; else field2 = []; end; + + % update history + % -------------- + oldcom = { oldcom{:},'sort',{ field1 dir1 field2 dir2 } }; + + else % command line + field1 = tmparg{1}; + if length(tmparg) < 2, dir1 = 0; + else dir1 = tmparg{2}; + end; + if length(tmparg) < 3, field2 = []; + else field2 = tmparg{3}; + end; + if length(tmparg) < 4, dir2 = 0; + else dir2 = tmparg{4}; + end; + end; + + % Toby edit 11/16/2005 This section is scrambling the eeg.event + % fields. Requires further investigation. + + if ~isempty(field2) + tmpevent = EEG.event; + if ~ischar(EEG.event(1).(field2)) + tmparray = [ tmpevent.(field2) ]; + else tmparray = { tmpevent.(field2) }; + end + % Commented out 11/18/2005, Toby + % These lines were incorrectly sorting the event.latency field in + % units of time (seconds) relevant to each event's relative + % latency time as measured from the start of each epoch. It is + % possible that there are occasions when it is desirable to do + % so, but in the case of pop_mergset() it is not. + + %if strcmp(field2, 'latency') & EEG.trials > 1 + % tmparray = eeg_point2lat(tmparray, {EEG.event.epoch}, EEG.srate, [EEG.xmin EEG.xmax], 1); + %end; + [X I] = mysort( tmparray ); + if dir2 == 1, I = I(end:-1:1); end; + events = EEG.event(I); + else + events = EEG.event; + end; + tmpevent = EEG.event; + if ~ischar(EEG.event(1).(field1)) + tmparray = [ tmpevent.(field1) ]; + else tmparray = { tmpevent.(field1) }; + end + % Commented out 11/18/2005, Toby + %if strcmp( field1, 'latency') & EEG.trials > 1 + % tmparray = eeg_point2lat(tmparray, {events.epoch}, EEG.srate, [EEG.xmin EEG.xmax], 1); + %end; + [X I] = mysort( tmparray ); + if dir1 == 1, I = I(end:-1:1); end; + EEG.event = events(I); + + + if gui + % warn user + % --------- + warndlg2('Sorting done'); + else + noeventcheck = 1; % otherwise infinite recursion with eeg_checkset + end; + + end; % end switch + end; % end loop + + % save userdata + % ------------- + if gui + userdata{1} = EEG; + userdata{2} = oldcom; + set(gcf, 'userdata', userdata); + pop_editeventvals('goto', shift); + else + if ~exist('noeventcheck','var') + EEG = eeg_checkset(EEG, 'eventconsistency'); + EEG = eeg_checkset(EEG, 'checkur'); + end; + end; + return; +end; + +% ---------------------- +% graphic interface part +% ---------------------- + +if isempty(EEG.event) + disp('Getevent: cannot deal with empty event structure'); + return; +end; + +allfields = fieldnames(EEG.event); +tmpind = strmatch('urevent', allfields); +allfields(tmpind) = []; + +if nargin<2 + % add field values + % ---------------- + geometry = { [2 0.5] }; + tmpstr = sprintf('Edit event field values (currently %d events)',length(EEG.event)); + uilist = { { 'Style', 'text', 'string', tmpstr, 'fontweight', 'bold' } ... + { 'Style', 'pushbutton', 'string', 'Delete event', 'callback', 'pop_editeventvals(''delete'');' }}; + + for index = 1:length(allfields) + + geometry = { geometry{:} [1 1 1 1] }; + + % input string + % ------------ + if strcmp( allfields{index}, 'latency') | strcmp( allfields{index}, 'duration') + if EEG.trials > 1 + inputstr = [ allfields{index} ' (ms)']; + else inputstr = [ allfields{index} ' (sec)']; + end; + else inputstr = allfields{index}; + end; + + % callback for displaying help + % ---------------------------- + if index <= length( EEG.eventdescription ) + tmptext = EEG.eventdescription{ index }; + if ~isempty(tmptext) + if size(tmptext,1) > 15, stringtext = [ tmptext(1,1:15) '...' ]; + else stringtext = tmptext(1,:); + end; + else stringtext = 'no-description'; tmptext = 'no-description'; + end; + else stringtext = 'no-description'; tmptext = 'no-description'; + end; + cbbutton = ['questdlg2(' vararg2str(tmptext) ... + ',''Description of field ''''' allfields{index} ''''''', ''OK'', ''OK'');' ]; + + % create control + % -------------- + cbedit = [ 'pop_editeventvals(''assign'', ''' allfields{index} ''');' ]; + uilist = { uilist{:}, { }, ... + { 'Style', 'pushbutton', 'string', inputstr, 'callback',cbbutton }, ... + { 'Style', 'edit', 'tag', allfields{index}, 'string', '', 'callback', cbedit } ... + { } }; + end; + + % add buttons + % ----------- + geometry = { geometry{:} [1] [1.2 0.6 0.6 1 0.6 0.6 1.2] [1.2 0.6 0.6 1 0.6 0.6 1.2] [2 1 2] }; + + tpappend = 'Append event after the current event'; + tpinsert = 'Insert event before the current event'; + tporigin = 'Original index of the event (in EEG.urevent table)'; + uilist = { uilist{:}, ... + { }, ... + { },{ },{ }, {'Style', 'text', 'string', 'Event Num', 'fontweight', 'bold' }, { },{ },{ }, ... + { 'Style', 'pushbutton', 'string', 'Insert event', 'callback', 'pop_editeventvals(''append'', 0);', 'tooltipstring', tpinsert }, ... + { 'Style', 'pushbutton', 'string', '<<', 'callback', 'pop_editeventvals(''goto'', -10);' }, ... + { 'Style', 'pushbutton', 'string', '<', 'callback', 'pop_editeventvals(''goto'', -1);' }, ... + { 'Style', 'edit', 'string', '1', 'callback', 'pop_editeventvals(''goto'', 0);', 'tag', 'numval' }, ... + { 'Style', 'pushbutton', 'string', '>', 'callback', 'pop_editeventvals(''goto'', 1);' }, ... + { 'Style', 'pushbutton', 'string', '>>', 'callback', 'pop_editeventvals(''goto'', 10);' }, ... + { 'Style', 'pushbutton', 'string', 'Append event', 'callback', 'pop_editeventvals(''append'', 1);', 'tooltipstring', tpappend }, ... + { }, { 'Style', 'text', 'string', ' ', 'tag', 'original' 'horizontalalignment' 'center' 'tooltipstring' tporigin } { } }; + + % add sorting options + % ------------------- + listboxtext = 'No field selected'; + for index = 1:length(allfields) + listboxtext = [ listboxtext '|' allfields{index} ]; + end; + geometry = { geometry{:} [1] [1 1 1] [1 1 1] [1 1 1] }; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', 'Re-order events (for review only)', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Main sorting field:' }, ... + { 'Style', 'popupmenu', 'string', listboxtext, 'tag', 'listbox1' }, ... + { 'Style', 'checkbox', 'string', 'Click for decreasing order', 'tag', 'order1' } ... + { 'Style', 'text', 'string', 'Secondary sorting field:' }, ... + { 'Style', 'popupmenu', 'string', listboxtext, 'tag', 'listbox2' }, ... + { 'Style', 'checkbox', 'string', 'Click for decreasing order', 'tag', 'order2' }, ... + { } { 'Style', 'pushbutton', 'string', 'Re-sort', 'callback', 'pop_editeventvals(''sort'');' }, ... + { } }; + + userdata = { EEG {} }; + inputgui( geometry, uilist, 'pophelp(''pop_editeventvals'');', ... + 'Edit event values -- pop_editeventvals()', userdata, 'plot'); + pop_editeventvals('goto', 0); + + % wait for figure + % --------------- + fig = gcf; + waitfor( findobj('parent', fig, 'tag', 'ok'), 'userdata'); + try, userdata = get(fig, 'userdata'); close(fig); % figure still exist ? + catch, return; end; + + % transfer events + % --------------- + if ~isempty(userdata{2}) + com = sprintf('%s = pop_editeventvals(%s,%s);', inputname(1), inputname(1), vararg2str(userdata{2})); + end; + if isempty(findstr('''sort''', com)) + if ~isempty(userdata{2}) % some modification have been done + EEG = userdata{1}; + disp('Checking event consistency...'); + EEG = eeg_checkset(EEG, 'eventconsistency'); + EEG = eeg_checkset(EEG, 'checkur'); + end; + else + com = ''; + disp('WARNING: all edits discarded because of event resorting. The EEGLAB event structure'); + disp(' must contain events sorted by latency (you may obtain an event structure'); + disp(' with resorted event by calling this function from the command line).'); + end; + return; + +end; +return; + +% format the output field +% ----------------------- +function strval = reformat( val, latencycondition, trialcondition, eventnum) + if latencycondition + if trialcondition + strval = ['eeg_lat2point(' num2str(val) ', EEG.event(' int2str(eventnum) ').epoch, EEG.srate,[EEG.xmin EEG.xmax]*1000, 1E-3);' ]; + else + strval = [ '(' num2str(val) '-EEG.xmin)*EEG.srate+1;' ]; + end; + else + if isstr(val), strval = [ '''' val '''' ]; + else strval = num2str(val); + end; + end; + +% sort also empty values +% ---------------------- +function [X, I] = mysort(tmparray); + if iscell(tmparray) + if all(cellfun('isreal', tmparray)) + tmpempty = cellfun('isempty', tmparray); + tmparray(tmpempty) = { 0 }; + tmparray = [ tmparray{:} ]; + end; + end; + try, + [X I] = sort(tmparray); + catch, + disp('Sorting failed. Check that selected fields contain uniform value format.'); + X = tmparray; + I = 1:length(X); + end; + +% checkconsistency of new event +% ----------------------------- +function eventtmp = checkconsistency(eventtmp, valnum, field) + + otherval = mod(valnum+1, length(eventtmp))+1; + + if isstr(getfield(eventtmp(valnum), field)) & ~isstr(getfield(eventtmp(otherval), field)) + eventtmp(valnum) = setfield(eventtmp(valnum), field, str2num(getfield(eventtmp(valnum), field))); + end; + if ~isstr(getfield(eventtmp(valnum), field)) & isstr(getfield(eventtmp(otherval), field)) + eventtmp(valnum) = setfield(eventtmp(valnum), field, num2str(getfield(eventtmp(valnum), field))); + end; + if strcmpi(field, 'latency') & isempty(getfield(eventtmp(valnum), field)) + eventtmp(valnum).latency = NaN; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_editset.m b/code/eeglab13_4_4b/functions/popfunc/pop_editset.m new file mode 100644 index 0000000..15ca41b --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_editset.m @@ -0,0 +1,497 @@ +% pop_editset() - Edit EEG dataset structure fields. +% +% Usage: +% >> EEGOUT = pop_editset( EEG ); % pops-up a data entry window +% >> EEGOUT = pop_editset( EEG, 'key', val,...); % no pop-up window +% +% Graphic interface: +% "Dataset name" - [Edit box] Name for the new dataset. +% In the right column of the graphic interface, the "EEG.setname" +% text indicates which field of the EEG structure this parameter +% corresponds to (in this case, .'setname'). +% Command line equivalent: 'setname'. +% "Data sampling rate" - [Edit box] In Hz. Command line equivalent: 'srate' +% "Time points per epoch" - [Edit box] Number of data frames (points) per epoch. +% Changing this value will change the number of data epochs. +% Command line equivalent: 'pnts'. +% "Start time" - [Edit box] This edit box is only present for epoched data +% and specifies the epoch start time in ms. Epoch end time +% is automatically calculated. Command line equivalent: 'xmin' +% "Number of channels" - [Edit box] Number of data channels. Command line +% equivalent: 'nbchan'. This edit box cannot be edited. +% "Ref. channel indices or mode" - [edit box] current reference. This edit box +% cannot be edited. To change the data reference, use menu item, +% 'Tools > Re-reference', calling function pop_reref(). The +% reference can be either a string (channel name), 'common', +% indicating an unknown common reference, 'averef' indicating +% average reference, or an array of integers containing indices +% of the reference channel(s). +% "Subject code" - [Edit box] subject code. For example, 'S01'. The command +% line equivalent is 'subject'. +% "Task Condition" - [Edit box] task condition. For example, 'Targets'. +% The command line equivalent 'condition'. +% "Session number" - [Edit box] session number (from the same subject). +% All datasets from the same subject and session will be +% assumed to use the same ICA decomposition. The command +% line equivalent 'session'. +% "Subject group" - [Edit box] subject group. For example 'Patients' or +% 'Control'. The command line equivalent is 'group'. +% "About this dataset" - [Edit box] Comments about the dataset. Command line +% equivalent is 'comments'. +% "Channel locations file or array" - [Edit box] For channel data formats, see +% >> readlocs help Command line equivalent: 'chanlocs' +% "ICA weights array or text/binary file" - [edit box] Import ICA weights from +% other decompositions (e.g., same session, different conditions). +% To use the ICA weights from another loaded dataset (n), enter +% ALLEEG(n).icaweights. Command line equivalent: 'icaweights' +% "ICA sphere array or text/binary file" - [edit box] Import ICA sphere matrix. +% In EEGLAB, ICA decompositions require a sphere matrix and +% an unmixing weight matrix (see above). To use the sphere +% matrix from a loaded dataset (n), enter ALLEEG(n).icasphere +% Command line equivalent: 'icasphere'. +% "From other dataset" - [push button] Press this button to enter the index +% of another dataset. This will update the channel locations or +% the ICA edit box. +% Inputs: +% EEG - EEG dataset structure +% +% Optional inputs: +% 'setname' - Name of the EEG dataset +% 'data' - ['varname'|'filename'] Import data from a Matlab variable or +% mat file into an EEG data structure +% 'dataformat' - ['array|matlab|ascii|float32le|float32be'] Input data format. +% 'array' is a Matlab array in the global workspace. +% 'matlab' is a Matlab file (containing a single variable). +% 'ascii' is an ascii file. +% 'float32le' and 'float32be' are 32-bit float data files +% with little-endian and big-endian byte order, respectively. +% Data must be organised as 2-D (channels, timepoints), i.e. +% channels = rows, timepoints = columns; else as 3-D (channels, +% timepoints, epochs). For convenience, the data file is +% transposed if the number of rows is larger than the number +% of columns, as the program assumes that there are more +% channels than data points. +% 'subject' - [string] subject code. For example, 'S01'. +% {default: none -> each dataset from a different subject} +% 'condition' - [string] task condition. For example, 'Targets' +% {default: none -> all datasets from one condition} +% 'group' - [string] subject group. For example 'Patients' or 'Control'. +% {default: none -> all subjects in one group} +% 'session' - [integer] session number (from the same subject). All datasets +% from the same subject and session will be assumed to use the +% same ICA decomposition {default: none -> each dataset from +% a different session} +% 'chanlocs' - ['varname'|'filename'] Import a channel location file. +% For file formats, see >> help readlocs +% 'nbchan' - [int] Number of data channels. +% 'xmin' - [real] Data epoch start time (in seconds). +% {default: 0} +% 'pnts' - [int] Number of data points per data epoch. The number of +% data trials is automatically calculated. +% {default: length of the data -> continuous data assumed} +% 'srate' - [real] Data sampling rate in Hz {default: 1Hz} +% 'ref' - [string or integer] reference channel indices; 'averef' +% indicates average reference. Note that this does not perform +% referencing but only sets the initial reference when the data +% are imported. +% 'icaweight' - [matrix] ICA weight matrix. +% 'icasphere' - [matrix] ICA sphere matrix. By default, the sphere matrix +% is initialized to the identity matrix if it is left empty. +% 'comments' - [string] Comments on the dataset, accessible through the +% EEGLAB main menu using ('Edit > About This Dataset'). +% Use this to attach background information about the +% experiment or the data to the dataset. +% Outputs: +% EEGOUT - Modified EEG dataset structure +% +% Note: +% To create a new dataset: +% >> EEG = pop_editset( eeg_emptyset ); % eeg_emptyset() returns an empty dataset +% +% To erase a variable, use '[]'. The following suppresses channel locations: +% >> EEG = pop_editset( EEG, 'chanlocs', '[]'); +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_importdata(), pop_select(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-16-02 text interface editing -sm & ad +% 03-16-02 remove EEG.xmax et EEG.xmin (for continuous) -ad & sm +% 03-31-02 changed interface, reprogrammed all function -ad +% 04-02-02 recompute event latencies when modifying xmin -ad + +function [EEGOUT, com] = pop_editset(EEG, varargin); + +com = ''; +if nargin < 1 + help pop_editset; + return; +end; + +EEGOUT = EEG; +if nargin < 2 % if several arguments, assign values + % popup window parameters + % ----------------------- + % popup window parameters + % ----------------------- + geometry = { [2 3.38] [1] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] ... + [1] [1.4 0.7 .8 0.5] [1] [1.4 0.7 .8 0.5] [1.4 0.7 .8 0.5] [1.4 0.7 .8 0.5] }; + editcomments = [ 'tmp = pop_comments(get(gcbf, ''userdata''), ''Edit comments of current dataset'');' ... + 'if ~isempty(tmp), set(gcf, ''userdata'', tmp); end; clear tmp;' ]; + commandload = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename(1) ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', tagtest), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + commandselica = [ 'res = inputdlg2({ ''Enter dataset number'' }, ''Select ICA weights and sphere from other dataset'', 1, { ''1'' });' ... + 'if ~isempty(res),' ... + ' set(findobj( ''parent'', gcbf, ''tag'', ''weightfile''), ''string'', sprintf(''ALLEEG(%s).icaweights'', res{1}));' ... + ' set(findobj( ''parent'', gcbf, ''tag'', ''sphfile'') , ''string'', sprintf(''ALLEEG(%s).icasphere'' , res{1}));' ... + ' set(findobj( ''parent'', gcbf, ''tag'', ''icainds'') , ''string'', sprintf(''ALLEEG(%s).icachansind'' , res{1}));' ... + 'end;' ]; + commandselchan = [ 'res = inputdlg2({ ''Enter dataset number'' }, ''Select channel information from other dataset'', 1, { ''1'' });' ... + 'if ~isempty(res),' ... + ' set(findobj( ''parent'', gcbf, ''tag'', ''chanfile''), ' ... + ' ''string'', sprintf(''{ ALLEEG(%s).chanlocs ALLEEG(%s).chaninfo ALLEEG(%s).urchanlocs }'', res{1}, res{1}, res{1}));' ... + 'end;' ]; + if isstr(EEGOUT.ref) + curref = EEGOUT.ref; + else + if length(EEGOUT.ref) > 1 + curref = [ int2str(abs(EEGOUT.ref)) ]; + else + curref = [ int2str(abs(EEGOUT.ref)) ]; + end; + end; + + uilist = { ... + { 'Style', 'text', 'string', 'Dataset name', 'horizontalalignment', 'right', ... + 'fontweight', 'bold' }, { 'Style', 'edit', 'string', EEG.setname }, { } ... + ... + { 'Style', 'text', 'string', 'Data sampling rate (Hz)', 'horizontalalignment', 'right', 'fontweight', ... + 'bold' }, { 'Style', 'edit', 'string', num2str(EEGOUT.srate) }, ... + { 'Style', 'text', 'string', 'Subject code', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', EEG.subject }, ... + { 'Style', 'text', 'string', 'Time points per epoch (0->continuous)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', num2str(EEGOUT.pnts) }, ... + { 'Style', 'text', 'string', 'Task condition', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', EEG.condition }, ... + { 'Style', 'text', 'string', 'Start time (sec) (only for data epochs)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', num2str(EEGOUT.xmin) }, ... + { 'Style', 'text', 'string', 'Session number', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', EEG.session }, ... + { 'Style', 'text', 'string', 'Number of channels (0->set from data)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', EEG.nbchan 'enable' 'off' }, ... + { 'Style', 'text', 'string', 'Subject group', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', EEG.group }, ... + { 'Style', 'text', 'string', 'Ref. channel indices or mode (see help)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', curref 'enable' 'off' }, ... + { 'Style', 'text', 'string', 'About this dataset', 'horizontalalignment', 'right', ... + }, { 'Style', 'pushbutton', 'string', 'Enter comments' 'callback' editcomments }, ... + { } ... + { 'Style', 'text', 'string', 'Channel location file or info', 'horizontalalignment', 'right', 'fontweight', ... + 'bold' }, {'Style', 'pushbutton', 'string', 'From other dataset', 'callback', commandselchan }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'chanfile' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''chanfile'';' commandload ] }, ... + ... + { 'Style', 'text', 'string', ... + ' Note: The file format may be auto-detected from its file extension. See menu "Edit > Channel locations" for other options.', ... + 'horizontalalignment', 'right' }, ... + ... + { 'Style', 'text', 'string', 'ICA weights array or text/binary file (if any):', 'horizontalalignment', 'right' }, ... + { 'Style', 'pushbutton' 'string' 'from other dataset' 'callback' commandselica }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'weightfile' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''weightfile'';' commandload ] }, ... + ... + { 'Style', 'text', 'string', 'ICA sphere array or text/binary file (if any):', 'horizontalalignment', 'right' }, ... + { 'Style', 'pushbutton' 'string' 'from other dataset' 'callback' commandselica }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'sphfile' } ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''sphfile'';' commandload ] } ... + ... + { 'Style', 'text', 'string', 'ICA channel indices (by default all):', 'horizontalalignment', 'right' }, ... + { 'Style', 'pushbutton' 'string' 'from other dataset' 'callback' commandselica }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'icainds' } ... + { } }; + + [ results newcomments ] = inputgui( geometry, uilist, 'pophelp(''pop_editset'');', 'Edit dataset information - pop_editset()', ... + EEG.comments); + if length(results) == 0, return; end; + args = {}; + + i = 1; + if ~strcmp( results{i }, EEG.setname ) , args = { args{:}, 'setname', results{i } }; end; + if ~strcmp( results{i+1}, num2str(EEG.srate) ) , args = { args{:}, 'srate', str2num(results{i+1}) }; end; + if ~strcmp( results{i+2}, EEG.subject ) , args = { args{:}, 'subject', results{i+2} }; end; + if ~strcmp( results{i+3}, num2str(EEG.pnts) ) , args = { args{:}, 'pnts', str2num(results{i+3}) }; end; + if ~strcmp( results{i+4}, EEG.condition ) , args = { args{:}, 'condition', results{i+4} }; end; + if ~strcmp( results{i+5}, num2str(EEG.xmin) ) , args = { args{:}, 'xmin', str2num(results{i+5}) }; end; + if ~strcmp( results{i+6}, num2str(EEG.session) ) , args = { args{:}, 'session', str2num(results{i+6}) }; end; + if ~strcmp( results{i+7}, num2str(EEG.nbchan) ) , args = { args{:}, 'nbchan', str2num(results{i+7}) }; end; + if ~strcmp( results{i+8}, EEG.group ) , args = { args{:}, 'group', results{i+8} }; end; + if ~strcmp( results{i+9}, num2str(EEG.ref) ) , args = { args{:}, 'ref', results{i+9} }; end; + if ~strcmp(EEG.comments, newcomments) , args = { args{:}, 'comments' , newcomments }; end; + + if abs(str2num(results{i+5})) > 10, + fprintf('WARNING: are you sure the epoch start time (%3.2f) is in seconds\n', str2num(results{i+5})); + end; + + if ~isempty( results{i+12} ) , args = { args{:}, 'icachansind', results{i+13} }; end; + if ~isempty( results{i+10} ) , args = { args{:}, 'chanlocs' , results{i+10} }; end; + if ~isempty( results{i+11} ), args = { args{:}, 'icaweights', results{i+11} }; end; + if ~isempty( results{i+12} ) , args = { args{:}, 'icasphere', results{i+12} }; end; + +else % no interactive inputs + args = varargin; + % Do not copy varargin + % -------------------- + %for index=1:2:length(args) + % if ~isempty(inputname(index+2)) & ~isstr(args{index+1}) & length(args{index+1})>1, + % args{index+1} = inputname(index+1); + % end; + %end; +end; + +% create structure +% ---------------- +if ~isempty(args) + try, g = struct(args{:}); + catch, disp('Setevent: wrong syntax in function arguments'); return; end; +else + g = []; +end; + +% test the presence of variables +% ------------------------------ +try, g.dataformat; catch, g.dataformat = 'ascii'; end; + +% assigning values +% ---------------- +tmpfields = fieldnames(g); +for curfield = tmpfields' + switch lower(curfield{1}) + case {'dataformat' }, ; % do nothing now + case 'setname' , EEGOUT.setname = getfield(g, {1}, curfield{1}); + case 'subject' , EEGOUT.subject = getfield(g, {1}, curfield{1}); + case 'condition' , EEGOUT.condition = getfield(g, {1}, curfield{1}); + case 'group' , EEGOUT.group = getfield(g, {1}, curfield{1}); + case 'session' , EEGOUT.session = getfield(g, {1}, curfield{1}); + case 'setname' , EEGOUT.setname = getfield(g, {1}, curfield{1}); + case 'setname' , EEGOUT.setname = getfield(g, {1}, curfield{1}); + case 'pnts' , EEGOUT.pnts = getfield(g, {1}, curfield{1}); + case 'comments' , EEGOUT.comments = getfield(g, {1}, curfield{1}); + case 'nbchan' , tmp = getfield(g, {1}, curfield{1}); + if tmp ~=0, EEGOUT.nbchan = tmp; end; + case 'averef' , disp('The ''averef'' argument is obsolete; use function pop_reref() instead'); + case 'ref' , EEGOUT.ref = getfield(g, {1}, curfield{1}); + disp('WARNING: CHANGING REFERENCE DOES NOT RE-REFERENCE THE DATA, use menu Tools > Rereference instead'); + if ~isempty(str2num( EEGOUT.ref )), EEG,ref = str2num(EEG.ref); end; + case 'xmin' , oldxmin = EEG.xmin; + EEGOUT.xmin = getfield(g, {1}, curfield{1}); + if oldxmin ~= EEGOUT.xmin + if ~isempty(EEG.event) + if nargin < 2 + if ~popask( ['Warning: changing the starting point of epochs will' 10 'lead to recomputing epoch event latencies, Continue?'] ) + com = ''; warndlg2('pop_editset(): transformation cancelled by user'); return; + end; + end; + if isfield(EEG.event, 'latency') + for index = 1:length(EEG.event) + EEG.event(index).latency = EEG.event(index).latency - (EEG.xmin-oldxmin)*EEG.srate; + end; + end; + end; + end; + case 'srate' , EEGOUT.srate = getfield(g, {1}, curfield{1}); + case 'chanlocs', varname = getfield(g, {1}, curfield{1}); + if isempty(varname) + EEGOUT.chanlocs = []; + elseif isstr(varname) & exist( varname ) == 2 + fprintf('pop_editset(): channel locations file ''%s'' found\n', varname); + [ EEGOUT.chanlocs lab theta rad ind ] = readlocs(varname); + elseif isstr(varname) + EEGOUT.chanlocs = evalin('base', varname, 'fprintf(''pop_editset() warning: variable ''''%s'''' not found, ignoring\n'', varname)' ); + if iscell(EEGOUT.chanlocs) + if length(EEGOUT.chanlocs) > 1, EEGOUT.chaninfo = EEGOUT.chanlocs{2}; end; + if length(EEGOUT.chanlocs) > 2, EEGOUT.urchanlocs = EEGOUT.chanlocs{3}; end; + EEGOUT.chanlocs = EEGOUT.chanlocs{1}; + end; + else + EEGOUT.chanlocs = varname; + end; + case 'icaweights', varname = getfield(g, {1}, curfield{1}); + if isstr(varname) & exist( varname ) == 2 + fprintf('pop_editset(): ICA weight matrix file ''%s'' found\n', varname); + if ~isempty(EEGOUT.icachansind), nbcol = length(EEGOUT.icachansind); else nbcol = EEG.nbchan; end; + try, EEGOUT.icaweights = load(varname, '-ascii'); + EEGOUT.icawinv = []; + catch, + try + EEGOUT.icaweights = floatread(varname, [1 Inf]); + EEGOUT.icaweights = reshape( EEGOUT.icaweights, [length(EEGOUT.icaweights)/nbcol nbcol]); + catch + fprintf('pop_editset() warning: error while reading filename ''%s'' for ICA weight matrix\n', varname); + end; + end; + else + if isempty(varname) + EEGOUT.icaweights = []; + elseif isstr(varname) + EEGOUT.icaweights = evalin('base', varname, 'fprintf(''pop_editset() warning: variable ''''%s'''' not found, ignoring\n'', varname)' ); + EEGOUT.icawinv = []; + else + EEGOUT.icaweights = varname; + EEGOUT.icawinv = []; + end; + end; + if ~isempty(EEGOUT.icaweights) & isempty(EEGOUT.icasphere) + EEGOUT.icasphere = eye(size(EEGOUT.icaweights,2)); + end; + case 'icachansind', varname = getfield(g, {1}, curfield{1}); + if isempty(varname) + EEGOUT.icachansind = []; + elseif isstr(varname) + EEGOUT.icachansind = evalin('base', varname, 'fprintf(''pop_editset() warning: variable ''''%s'''' not found, ignoring\n'', varname)' ); + else + EEGOUT.icachansind = varname; + end; + case 'icasphere', varname = getfield(g, {1}, curfield{1}); + if isstr(varname) & exist( varname ) == 2 + fprintf('pop_editset(): ICA sphere matrix file ''%s'' found\n', varname); + if ~isempty(EEGOUT.icachansind), nbcol = length(EEGOUT.icachansind); else nbcol = EEG.nbchan; end; + try, EEGOUT.icasphere = load(varname, '-ascii'); + EEGOUT.icawinv = []; + catch, + try + EEGOUT.icasphere = floatread(varname, [1 Inf]); + EEGOUT.icasphere = reshape( EEGOUT.icasphere, [length(EEGOUT.icasphere)/nbcol nbcol]); + catch + fprintf('pop_editset() warning: erro while reading filename ''%s'' for ICA weight matrix\n', varname); + end; + end; + else + if isempty(varname) + EEGOUT.icasphere = []; + elseif isstr(varname) + EEGOUT.icasphere = evalin('base', varname, 'fprintf(''pop_editset() warning: variable ''''%s'''' not found, ignoring\n'', varname)' ); + EEGOUT.icawinv = []; + else + EEGOUT.icaweights = varname; + EEGOUT.icawinv = []; + end; + end; + if ~isempty(EEGOUT.icaweights) & isempty(EEGOUT.icasphere) + EEGOUT.icasphere = eye(size(EEGOUT.icaweights,2)); + end; + case 'data' , varname = getfield(g, {1}, curfield{1}); + if isnumeric(varname) + EEGOUT.data = varname; + elseif exist( varname ) == 2 & ~strcmp(lower(g.dataformat), 'array'); + fprintf('pop_editset(): raw data file ''%s'' found\n', varname); + switch lower(g.dataformat) + case 'ascii' , + try, EEGOUT.data = load(varname, '-ascii'); + catch, disp(lasterr); error(['pop_editset() error: cannot read ascii file ''' varname ''' ']); + end; + if ndims(EEGOUT.data)<3 & size(EEGOUT.data,1) > size(EEGOUT.data,2), EEGOUT.data = transpose(EEGOUT.data); end; + case 'matlab', + try, + x = whos('-file', varname); + if length(x) > 1, + error('pop_editset() error: .mat file must contain a single variable'); + end; + tmpdata = load(varname, '-mat'); + EEGOUT.data = getfield(tmpdata,{1},x(1).name); + clear tmpdata; + catch, error(['pop_editset() error: cannot read .mat file ''' varname ''' ']); + end; + if ndims(EEGOUT.data)<3 & size(EEGOUT.data,1) > size(EEGOUT.data,2), EEGOUT.data = transpose(EEGOUT.data); end; + case {'float32le' 'float32be'}, + if EEGOUT.nbchan == 0, + error(['pop_editset() error: to read float32 data you must first specify the number of channels']); + end; + try, EEGOUT.data = floatread(varname, [EEGOUT.nbchan Inf], ... + fastif(strcmpi(g.dataformat, 'float32le'), 'ieee-le', 'ieee-be')); + catch, error(['pop_editset() error: cannot read float32 data file ''' varname ''' ']); + end; + otherwise, error('pop_editset() error: unrecognized file format'); + end; + elseif isstr(varname) + % restoration command + %-------------------- + try + res = evalin('base', ['exist(''' varname ''') == 1']); + catch + disp('pop_editset() warning: cannot find specified variable in global workspace!'); + end; + if ~res, + error('pop_editset(): cannot find specified variable.'); + end; + warning off; + try, + testval = evalin('base', ['isglobal(' varname ')']); + catch, testval = 0; end; + if ~testval + commandrestore = [ ' tmpp = ' varname '; clear global ' varname ';' varname '=tmpp;clear tmpp;' ]; + else + commandrestore = []; + end; + % make global, must make these variable global, if you try to evaluate them direclty in the base + % workspace, with a large array the computation becomes incredibly slow. + %-------------------------------------------------------------------- + comglobal = sprintf('global %s;', varname); + evalin('base', comglobal); + eval(comglobal); + eval( ['EEGOUT.data = ' varname ';' ]); + try, evalin('base', commandrestore); catch, end; + warning on; + else + EEGOUT.data = varname; + if ndims(EEGOUT.data)<3 & size(EEGOUT.data,1) > size(EEGOUT.data,2), EEGOUT.data = transpose(EEGOUT.data); end; + end; + otherwise, error(['pop_editset() error: unrecognized field ''' curfield{1} '''']); + end; +end; + +EEGOUT = eeg_checkset(EEGOUT); + +% generate the output command +% --------------------------- +if nargout > 1 + com = sprintf( '%s = pop_editset(%s', inputname(1), inputname(1) ); + for i=1:2:length(args) + if ~isempty( args{i+1} ) + if isstr( args{i+1} ) com = sprintf('%s, ''%s'', %s', com, args{i}, vararg2str(args{i+1}) ); + else com = sprintf('%s, ''%s'', [%s]', com, args{i}, num2str(args{i+1}) ); + end; + else + com = sprintf('%s, ''%s'', []', com, args{i} ); + end; + end; + com = [com ');']; +end; +return; + +function num = popask( text ) + ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); + switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_eegfilt.m b/code/eeglab13_4_4b/functions/popfunc/pop_eegfilt.m new file mode 100644 index 0000000..b830494 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_eegfilt.m @@ -0,0 +1,243 @@ +% pop_eegfilt() - interactively filter EEG dataset data using eegfilt() +% +% Usage: +% >> EEGOUT = pop_eegfilt( EEG, locutoff, hicutoff, filtorder); +% +% Graphical interface: +% "Lower edge ..." - [edit box] Lower edge of the frequency pass band (Hz) +% Same as the 'locutoff' command line input. +% "Higher edge ..." - [edit box] Higher edge of the frequency pass band (Hz) +% Same as the 'hicutoff' command line input. +% "Notch filter" - [edit box] provide the notch range, i.e. [45 55] +% for 50 Hz). This option overwrites the low and high edge limits +% given above. Set the 'locutoff' and 'hicutoff' values to the +% values entered as parameters, and set 'revfilt to 1, to swap +% from bandpass to notch filtering. +% "Filter length" - [edit box] Filter lenghth in point (default: see +% >> help eegfilt). Same as 'filtorder' optional input. +% +% Inputs: +% EEG - input dataset +% locutoff - lower edge of the frequency pass band (Hz) {0 -> lowpass} +% hicutoff - higher edge of the frequency pass band (Hz) {0 -> highpass} +% filtorder - length of the filter in points {default 3*fix(srate/locutoff)} +% revfilt - [0|1] Reverse filter polarity (from bandpass to notch filter). +% Default is 0 (bandpass). +% usefft - [0|1] 1 uses FFT filtering instead of FIR. Default is 0. +% plotfreqz - [0|1] plot frequency response of filter. Default is 0. +% firtype - ['firls'|'fir1'] filter design method, default is 'firls' +% from the command line +% causal - [0|1] 1 uses causal filtering. Default is 0. +% +% Outputs: +% EEGOUT - output dataset +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eegfilt(), eegfiltfft(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [EEG, com] = pop_eegfilt( EEG, locutoff, hicutoff, filtorder, revfilt, usefft, plotfreqz, firtype, causal) + +com = ''; +if nargin < 1 + help pop_eegfilt; + return; +end; +if isempty(EEG(1).data) + disp('Pop_eegfilt() error: cannot filter an empty dataset'); return; +end; + +% warning +% ------- +if exist('filtfilt') ~= 2 + disp('Warning: cannot find the signal processing toolbox'); + disp(' a simple fft/inverse fft filter will be used'); + usefft = 1; +end; + +if nargin < 2 + % which set to save + % ----------------- + uilist = { ... + { 'style' 'text' 'string' 'Lower edge of the frequency pass band (Hz)' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Higher edge of the frequency pass band (Hz)' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'FIR Filter order (default is automatic)' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'checkbox' 'string' 'Notch filter the data instead of pass band' } ... + { 'style' 'checkbox' 'string' 'Use (sharper) FFT linear filter instead of FIR filtering' 'value' 0 } ... + { 'style' 'text' 'string' '(Use the option above if you do not have the Signal Processing Toolbox)' } ... + { 'style' 'checkbox' 'string' 'Use causal filter (useful when performing causal analysis)' 'value' 0} ... + { 'style' 'checkbox' 'string' 'Plot the filter frequency response' 'value' 0} ... + { 'style' 'checkbox' 'string' 'Use fir1 (check, recommended) or firls (uncheck, legacy)' 'value' 1}}; + geometry = { [3 1] [3 1] [3 1] 1 1 1 1 1 1 }; + + result = inputgui( 'geometry', geometry, 'uilist', uilist, 'title', 'Filter the data -- pop_eegfilt()', ... + 'helpcom', 'pophelp(''pop_eegfilt'')'); + + if isempty(result), return; end; + if isempty(result{1}), result{1} = '0'; end; + if isempty(result{2}), result{2} = '0'; end; + + locutoff = eval( result{1} ); + hicutoff = eval( result{2} ); + if isempty( result{3} ) + filtorder = []; + else filtorder = eval( result{3} ); + end; + revfilt = 0; + if result{4}, + revfilt = 1; + if locutoff == 0 | hicutoff == 0, + error('Need both lower and higher edge for notch filter'); + end; + end; + if result{5} + usefft = 1; + else usefft = 0; + end; + if result{6} + causal = 1; + else causal = 0; + end; + plotfreqz = result{7}; + if locutoff == 0 & hicutoff == 0 return; end; + if result{8} + firtype = 'fir1'; + else + firtype = 'firls'; + end +else + if nargin < 3 + hicutoff = 0; + end; + if nargin < 4 + filtorder = []; + end; + if nargin < 5 + revfilt = 0; + end; + if nargin < 6 + usefft = 0; + end; + if nargin < 7 + plotfreqz = 0; + end + if nargin < 8 + firtype = 'firls'; + end + if nargin < 8 + causal = 0; + end +end; + +if locutoff && hicutoff + disp('WARNING: BANDPASS FILTERS SOMETIMES DO NOT WORK (MATLAB BUG)') + disp('WARNING: PLOT SPECTRUM AFTER FILTERING TO ASSESS FILTER EFFICIENCY') + disp('WARNING: IF FILTER FAILS, LOWPASS DATA THEN HIGHPASS DATA') +end; + +% process multiple datasets +% ------------------------- +if length(EEG) > 1 + [ EEG com ] = eeg_eval( 'pop_eegfilt', EEG, 'warning', 'on', 'params', ... + { locutoff, hicutoff, filtorder, revfilt } ); + return; +end; + +options = { EEG.srate, locutoff, hicutoff, 0 }; +if ~isempty( filtorder ) + options = { options{:} filtorder }; +else + options = { options{:} 0 }; +end; + +options = {options{:} revfilt firtype causal}; + +if EEG.trials == 1 + if ~isempty(EEG.event) & isfield(EEG.event, 'type') & isstr(EEG.event(1).type) + tmpevent = EEG.event; + boundaries = strmatch('boundary', { tmpevent.type }); + if isempty(boundaries) + if ~usefft + [EEG.data, b] = eegfilt( EEG.data, options{:}); + else + EEG.data = eegfiltfft( EEG.data, options{1:6}); % 7/30/2014 Ramon: {:} to {1:6}; + end; + else + options{4} = 0; + disp('Pop_eegfilt:finding continuous data boundaries'); + tmplat = [ tmpevent.latency ]; + boundaries = tmplat(boundaries); + boundaries = [0 floor(boundaries-0.49) EEG.pnts]; + try, warning off MATLAB:divideByZero + catch, end; + for n=1:length(boundaries)-1 + if boundaries(n)+1 < boundaries(n+1) + try + fprintf('Processing continuous data (%d:%d)\n',boundaries(n),boundaries(n+1)); + if ~usefft + [EEG.data(:,boundaries(n)+1:boundaries(n+1)), b] = ... + eegfilt(EEG.data(:,boundaries(n)+1:boundaries(n+1)), options{:}); + else + EEG.data(:,boundaries(n)+1:boundaries(n+1)) = ... + eegfiltfft(EEG.data(:,boundaries(n)+1:boundaries(n+1)), options{1:6}); % 7/30/2014 Ramon: {:} to {1:6}; + end; + catch + fprintf('\nFilter error: continuous data portion too narrow (DC removed if highpass only)\n'); + if locutoff ~= 0 & hicutoff == 0 + tmprange = [boundaries(n)+1:boundaries(n+1)]; + EEG.data(:,tmprange) = ... + EEG.data(:,tmprange) - repmat(mean(EEG.data(:,tmprange),2), [1 length(tmprange)]); + end; + end; + end; + end + try, warning on MATLAB:divideByZero + catch, end; + end + else + if ~usefft + [EEG.data, b] = eegfilt( EEG.data, options{:}); + else + EEG.data = eegfiltfft( EEG.data, options{1:6}); % 7/30/2014 Ramon: {:} to {1:6}; + end; + end; +else + EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts*EEG.trials); + options{4} = EEG.pnts; + if ~usefft + [EEG.data, b] = eegfilt( EEG.data, options{:}); + else + EEG.data = eegfiltfft( EEG.data, options{1:6}); % 7/30/2014 Ramon: {:} to {1:6}; + end; + % Note: reshape does not reserve new memory while EEG.data(:,:) does +end; +EEG.icaact = []; + +if ~usefft & plotfreqz & exist('b') == 1 + freqz(b, 1, [], EEG.srate); +end + +com = sprintf( '%s = pop_eegfilt( %s, %s, %s, [%s], [%s], %s, %s, ''%s'', %d);', inputname(1), inputname(1), ... + num2str( locutoff), num2str( hicutoff), num2str( filtorder ), num2str( revfilt ), num2str(usefft), num2str(plotfreqz), firtype, causal); +return diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_eegplot.m b/code/eeglab13_4_4b/functions/popfunc/pop_eegplot.m new file mode 100644 index 0000000..63d6f9a --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_eegplot.m @@ -0,0 +1,193 @@ +% pop_eegplot() - Visually inspect EEG data using a scrolling display. +% Perform rejection or marking for rejection of visually +% (and/or previously) selected data portions (i.e., stretches +% of continuous data or whole data epochs). +% Usage: +% >> pop_eegplot( EEG ) % Scroll EEG channel data. Allow marking for rejection via +% % button 'Update Marks' but perform no actual data rejection. +% % Do not show or use marks from previous visual inspections +% % or from semi-auotmatic rejection. +% >> pop_eegplot( EEG, typerej, superpose, reject ); +% +% Graphic interface: +% "Add to previously marked rejections" - [edit box] Either YES or NO. +% Command line equivalent: 'superpose'. +% "Reject marked trials" - [edit box] Either YES or NO. Command line +% equivalent 'reject'. +% Inputs: +% EEG - input EEG dataset +% typerej - type of rejection 0 = independent components; +% 1 = data channels. {Default: 1 = data channels} +% superpose - 0 = Show new marks only: Do not color the background of data portions +% previously marked for rejection by visual inspection. Mark new data +% portions for rejection by first coloring them (by dragging the left +% mouse button), finally pressing the 'Update Marks' or 'Reject' +% buttons (see 'reject' below). Previous markings from visual inspection +% will be lost. +% 1 = Show data portions previously marked by visual inspection plus +% data portions selected in this window for rejection (by dragging +% the left mouse button in this window). These are differentiated +% using a lighter and darker hue, respectively). Pressing the +% 'Update Marks' or 'Reject' buttons (see 'reject' below) +% will then mark or reject all the colored data portions. +% {Default: 0, show and act on new marks only} +% reject - 0 = Mark for rejection. Mark data portions by dragging the left mouse +% button on the data windows (producing a background coloring indicating +% the extent of the marked data portion). Then press the screen button +% 'Update Marks' to store the data portions marked for rejection +% (stretches of continuous data or whole data epochs). No 'Reject' button +% is present, so data marked for rejection cannot be actually rejected +% from this eegplot() window. +% 1 = Reject marked trials. After inspecting/selecting data portions for +% rejection, press button 'Reject' to reject (remove) them from the EEG +% dataset (i.e., those portions plottted on a colored background. +% {default: 0, mark for rejection only} +% Outputs: +% Modifications are applied to the current EEG dataset at the end of the +% eegplot() call, when the user presses the 'Update Marks' or 'Reject' button. +% NOTE: The modifications made are not saved into EEGLAB history. As of v4.2, +% events contained in rejected data portions are remembered in the EEG.urevent +% structure (see EEGLAB tutorial). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab(), eegplot(), pop_rejepoch() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 added srate argument to eegplot call -ad +% 03-27-02 added event latency recalculation for continuous data -ad + +function com = pop_eegplot( EEG, icacomp, superpose, reject, topcommand, varargin) + +com = ''; +if nargin < 1 + help pop_eegplot; + return; +end; +if nargin < 2 + icacomp = 1; +end; +if nargin < 3 + superpose = 0; +end; +if nargin < 4 + reject = 1; +end; +if icacomp == 0 + if isempty( EEG.icasphere ) + disp('Error: you must run ICA first'); return; + end; +end; + +if nargin < 3 & EEG.trials > 1 + + % which set to save + % ----------------- + uilist = { { 'style' 'text' 'string' 'Add to previously marked rejections? (checked=yes)'} , ... + { 'style' 'checkbox' 'string' '' 'value' 1 } , ... + { 'style' 'text' 'string' 'Reject marked trials? (checked=yes)'} , ... + { 'style' 'checkbox' 'string' '' 'value' 0 } }; + result = inputgui( { [ 2 0.2] [ 2 0.2]} , uilist, 'pophelp(''pop_eegplot'');', ... + fastif(icacomp==0, 'Manual component rejection -- pop_eegplot()', ... + 'Reject epochs by visual inspection -- pop_eegplot()')); + size_result = size( result ); + if size_result(1) == 0 return; end; + + if result{1}, superpose=1; end; + if ~result{2}, reject=0; end; + +end; + +if EEG.trials > 1 + if icacomp == 1 macrorej = 'EEG.reject.rejmanual'; + macrorejE = 'EEG.reject.rejmanualE'; + else macrorej = 'EEG.reject.icarejmanual'; + macrorejE = 'EEG.reject.icarejmanualE'; + end; + if icacomp == 1 + elecrange = [1:EEG.nbchan]; + else elecrange = [1:size(EEG.icaweights,1)]; + end; + colrej = EEG.reject.rejmanualcol; + rej = eval(macrorej); + rejE = eval(macrorejE); + + eeg_rejmacro; % script macro for generating command and old rejection arrays + +else % case of a single trial (continuous data) + %if icacomp, + % command = ['if isempty(EEG.event) EEG.event = [eegplot2event(TMPREJ, -1)];' ... + % 'else EEG.event = [EEG.event(find(EEG.event(:,1) ~= -1),:); eegplot2event(TMPREJ, -1, [], [0.8 1 0.8])];' ... + % 'end;']; + %else, command = ['if isempty(EEG.event) EEG.event = [eegplot2event(TMPREJ, -1)];' ... + % 'else EEG.event = [EEG.event(find(EEG.event(:,1) ~= -2),:); eegplot2event(TMPREJ, -1, [], [0.8 1 0.8])];' ... + % 'end;']; + %end; + %if reject + % command = ... + % [ command ... + % '[EEG.data EEG.xmax] = eegrej(EEG.data, EEG.event(find(EEG.event(:,1) < 0),3:end), EEG.xmax-EEG.xmin);' ... + % 'EEG.xmax = EEG.xmax+EEG.xmin;' ... + % 'EEG.event = EEG.event(find(EEG.event(:,1) >= 0),:);' ... + % 'EEG.icaact = [];' ... + % 'EEG = eeg_checkset(EEG);' ]; + eeglab_options; % changed from eeglaboptions 3/30/02 -sm + if reject == 0, command = []; + else + command = ... + [ '[EEGTMP LASTCOM] = eeg_eegrej(EEG,eegplot2event(TMPREJ, -1));' ... + 'if ~isempty(LASTCOM),' ... + ' [ALLEEG EEG CURRENTSET tmpcom] = pop_newset(ALLEEG, EEGTMP, CURRENTSET);' ... + ' if ~isempty(tmpcom),' ... + ' EEG = eegh(LASTCOM, EEG);' ... + ' eegh(tmpcom);' ... + ' eeglab(''redraw'');' ... + ' end;' ... + 'end;' ... + 'clear EEGTMP tmpcom;' ]; + if nargin < 4 + res = questdlg2( strvcat('Mark stretches of continuous data for rejection', ... + 'by dragging the left mouse button. Click on marked', ... + 'stretches to unmark. When done,press "REJECT" to', ... + 'excise marked stretches (Note: Leaves rejection', ... + 'boundary markers in the event table).'), 'Warning', 'Cancel', 'Continue', 'Continue'); + if strcmpi(res, 'Cancel'), return; end; + end; + end; + eegplotoptions = { 'events', EEG.event }; + if ~isempty(EEG.chanlocs) & icacomp + eegplotoptions = { eegplotoptions{:} 'eloc_file', EEG.chanlocs }; + end; +end; + +if EEG.nbchan > 100 + disp('pop_eegplot() note: Baseline subtraction disabled to speed up display'); + eegplotoptions = { eegplotoptions{:} 'submean' 'off' }; +end; + +if icacomp == 1 + eegplot( EEG.data, 'srate', EEG.srate, 'title', 'Scroll channel activities -- eegplot()', ... + 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}, varargin{:}); +else + tmpdata = eeg_getdatact(EEG, 'component', [1:size(EEG.icaweights,1)]); + eegplot( tmpdata, 'srate', EEG.srate, 'title', 'Scroll component activities -- eegplot()', ... + 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}, varargin{:}); +end; +com = [ com sprintf('pop_eegplot( %s, %d, %d, %d);', inputname(1), icacomp, superpose, reject) ]; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_eegthresh.m b/code/eeglab13_4_4b/functions/popfunc/pop_eegthresh.m new file mode 100644 index 0000000..d812749 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_eegthresh.m @@ -0,0 +1,229 @@ +% pop_eegthresh() - reject artifacts by detecting outlier values. This has +% long been a standard method for selecting data to reject. +% Applied either for electrode data or component activations. +% Usage: +% >> pop_eegthresh( INEEG, typerej); % pop-up interactive window +% >> [EEG Indexes] = pop_eegthresh( INEEG, typerej, elec_comp, lowthresh, ... +% upthresh, starttime, endtime, superpose, reject); +% +% Graphic interface: +% "Electrode|Component number(s)" - [edit box] number(s) of the electrode(s) or +% component(s) to take into consideration. Same as the 'elec_comp' +% parameter from the command line. +% "Lower limit(s)" - [edit box] lower threshold limit(s) (in uV|std. dev.). +% Sets command line parameter 'lowthresh'. +% "Upper limit(s)" - [edit box] upper threshold limit(s) (in uV|std. dev.). +% Sets command line parameter 'upthresh'. +% "Start time(s)" - [edit box] starting time limit(s) (in seconds). +% Sets command line parameter 'starttime'. +% "End time(s)" - [edit box] ending time limit(s) (in seconds). +% Sets command line parameter 'endtime'. +% "Display with previously marked rejections?" - [edit box] either YES or +% NO. This edit box sets command line option 'superpose'. +% "Reject marked trials?" - [edit box] either YES or NO. This edit box +% sets command line option 'reject'. +% +% Inputs: +% INEEG - input EEG dataset +% typerej - type of rejection (0 = independent components; 1 = raw +% data). Default is 1. For independent components, before +% thresholding the activations are normalized (to have std. dev. 1). +% elec_comp - [e1 e2 ...] electrode|component numbers to take +% into consideration for rejection +% lowthresh - lower threshold limit (in uV|std. dev. For components, the +% threshold(s) are in std. dev.). Can be an array if more than one +% electrode|component number is given in elec_comp (above). +% If fewer values than the number of electrodes|components, the +% last value is used for the remaining electrodes|components. +% upthresh - upper threshold limit (in uV|std dev) (see lowthresh above) +% starttime - rejection window start time(s) in seconds (see lowthresh above) +% endtime - rejection window end time(s) in seconds (see lowthresh) +% superpose - [0|1] 0=do not superpose rejection markings on previous +% rejection marks stored in the dataset: 1=show both current and +% previously marked rejections using different colors. {Default: 0}. +% reject - [1|0] 0=do not actually reject the marked trials (but store the +% marks: 1=immediately reject marked trials. {Default: 1}. +% Outputs: +% Indexes - index of rejected trials +% When eegplot() is called, modifications are applied to the current +% dataset at the end of the call to eegplot() when the user presses +% the 'Reject' button. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eegthresh(), eeglab(), eegplot(), pop_rejepoch() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 added srate argument to eegplot call -ad + +function [EEG, Irej, com] = pop_eegthresh( EEG, icacomp, elecrange, negthresh, posthresh, ... + starttime, endtime, superpose, reject, topcommand); + +Irej = []; +com = ''; +if nargin < 1 + help pop_eegthresh; + return; +end; +if nargin < 2 + icacomp = 1; +end; + +if icacomp == 0 + if isempty( EEG.icasphere ) + disp('Error: you must run ICA first'); return; + end; +end; +if exist('reject') ~= 1 + reject = 1; +end; + +if nargin < 3 + + % which set to save + % ----------------- + promptstr = { fastif(icacomp==0, 'Component (number(s), Ex: 2 4 5):', 'Electrode (number(s), Ex: 2 4 5):'), ... + fastif(icacomp==0, 'Lower limit(s) (std. dev, Ex: -3 -2.5 -2):', 'Lower limit(s) (uV, Ex:-20 -10 -15):'), ... + fastif(icacomp==0, 'Upper limit(s) (std. dev, Ex: 2 2 2.5):', 'Upper limit(s) (uV, Ex: 20 10 15):'), ... + 'Start time(s) (seconds, Ex -0.1 0.3):', ... + 'End time(s) (seconds, Ex 0.2):', ... + 'Display with previously marked rejections? (YES or NO)', ... + 'Reject marked trial(s)? (YES or NO)' }; + inistr = { fastif(icacomp==1, ['1:' int2str(EEG.nbchan)], '1:5'), ... + fastif(icacomp==1, '-10', '-20'), ... + fastif(icacomp==1, '10', '20'), ... + num2str(EEG.xmin), ... + num2str(EEG.xmax), ... + 'NO', ... + 'NO' }; + + result = inputdlg2( promptstr, fastif(icacomp == 0, 'Rejection abnormal comp. values -- pop_eegthresh()', ... + 'Rejection abnormal elec. values -- pop_eegthresh()'), 1, inistr, 'pop_eegthresh'); + size_result = size( result ); + if size_result(1) == 0 return; end; + elecrange = result{1}; + negthresh = result{2}; + posthresh = result{3}; + starttime = result{4}; + endtime = result{5}; + switch lower(result{6}), case 'yes', superpose=1; otherwise, superpose=0; end; + switch lower(result{7}), case 'yes', reject=1; otherwise, reject=0; end; +end; + +if isstr(elecrange) % convert arguments if they are in text format + calldisp = 1; + elecrange = eval( [ '[' elecrange ']' ] ); + negthresh = eval( [ '[' negthresh ']' ] ); + posthresh = eval( [ '[' posthresh ']' ] ); + if isstr(starttime) + starttime = eval( [ '[' starttime ']' ] ); + end; + if isstr(endtime) + endtime = eval( [ '[' endtime ']' ] ); + end; +else + calldisp = 0; +end; + +if any(starttime < EEG.xmin) + fprintf('Warning : starttime inferior to minimum time, adjusted\n'); + starttime(find(starttime < EEG.xmin)) = EEG.xmin; +end; +if any(endtime > EEG.xmax) + fprintf('Warning : endtime superior to maximum time, adjusted\n'); + endtime(find(endtime > EEG.xmax)) = EEG.xmax; +end; + +if icacomp == 1 + [Itmp Irej NS Erejtmp] = eegthresh( EEG.data, EEG.pnts, elecrange, negthresh, posthresh, [EEG.xmin EEG.xmax], starttime, endtime); + tmpelecIout = zeros(EEG.nbchan, EEG.trials); + tmpelecIout(elecrange,Irej) = Erejtmp; +else + icaacttmp = eeg_getdatact(EEG, 'component', elecrange); + [Itmp Irej NS Erejtmp] = eegthresh( icaacttmp, EEG.pnts, 1:length(elecrange), negthresh, posthresh, [EEG.xmin EEG.xmax], starttime, endtime); + tmpelecIout = zeros(size(EEG.icaweights,1), EEG.trials); + tmpelecIout(elecrange,Irej) = Erejtmp; +end; + +fprintf('%d channel selected\n', size(elecrange(:), 1)); +fprintf('%d/%d trials marked for rejection\n', length(Irej), EEG.trials); +tmprejectelec = zeros( 1, EEG.trials); +tmprejectelec(Irej) = 1; + +rej = tmprejectelec; +rejE = tmpelecIout; +if calldisp + if icacomp == 1 macrorej = 'EEG.reject.rejthresh'; + macrorejE = 'EEG.reject.rejthreshE'; + else macrorej = 'EEG.reject.icarejthresh'; + macrorejE = 'EEG.reject.icarejthreshE'; + end; + + colrej = EEG.reject.rejthreshcol; + eeg_rejmacro; % script macro for generating command and old rejection arrays + + if icacomp == 1 + eegplot( EEG.data(elecrange,:,:), 'srate', EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + else + eegplot( icaacttmp, 'srate', EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + end; +else + if reject == 1 + EEG = pop_rejepoch(EEG, rej, 0); + end; +end; +if ~isempty(rej) + if icacomp == 1 + EEG.reject.rejthresh = rej; + EEG.reject.rejthreshE = rejE; + else + EEG.reject.icarejthresh = rej; + EEG.reject.icarejthreshE = rejE; + end; +end; + +%com = sprintf('Indexes = pop_eegthresh( %s, %d, [%s], [%s], [%s], [%s], [%s], %d, %d);', ... +% inputname(1), icacomp, num2str(elecrange), num2str(negthresh), ... +% num2str(posthresh), num2str(starttime ) , num2str(endtime), superpose, reject ); +com = [ com sprintf('%s = pop_eegthresh(%s,%s);', inputname(1), ... + inputname(1), vararg2str({icacomp,elecrange,negthresh,posthresh,starttime,endtime,superpose,reject})) ]; +if nargin < 3 + Irej = com; +end; + +return; + +% reject artifacts in a sequential fashion to save memory (ICA ONLY) +% ------------------------------------------------------- +function [Irej, Erej] = thresh( data, elecrange, timerange, negthresh, posthresh, starttime, endtime); + Irej = []; + Erej = zeros(size(data,1), size(data,2)); + for index = 1:length(elecrange) + tmpica = data(index,:,:); + tmpica = reshape(tmpica, 1, size(data,2)*size(data,3)); + + % perform the rejection + % --------------------- + tmpica = (tmpica-mean(tmpica,2)*ones(1,size(tmpica,2)))./ (std(tmpica,0,2)*ones(1,size(tmpica,2))); + [I1 Itmprej NS Etmprej] = eegthresh( tmpica, size(data,2), 1, negthresh, posthresh, ... + timerange, starttime, endtime); + Irej = union_bc(Irej, Itmprej); + Erej(elecrange(index),Itmprej) = Etmprej; + end; + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_envtopo.m b/code/eeglab13_4_4b/functions/popfunc/pop_envtopo.m new file mode 100644 index 0000000..3a70420 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_envtopo.m @@ -0,0 +1,192 @@ +% pop_envtopo() - Plot envelope of an averaged EEG epoch, plus scalp maps +% of specified or largest contributing components referenced +% to their time point of maximum variance in the epoch or specified +% sub-epoch. Calls envtopo(). When nargin < 3, a query window +% pops-up to allow additional arguments. +% Usage: +% >> pop_envtopo( EEG ); % pop-up window mode +% >> pop_envtopo( EEG, timerange, 'key', 'val', ...); +% +% Inputs: +% EEG - input dataset. Can also be an array of two epoched datasets. +% In this case, the epoch mean (ERP) of the second is subtracted +% from the epoch mean (ERP) of the first. Note: The ICA weights +% must be the same for the two datasets. +% timerange - [min max] time range (in ms) in epoch to plot, or if [], from EEG +% +% Optional inputs: +% 'key','val' - optional envtopo() and topoplot() arguments +% (see >> help topoplot()) +% +% Outputs: Same as envtopo(). When nargin < 3, a query window pops-up +% to ask for additional arguments and no outputs are returned. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: envtopo(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformatted help & license -ad +% 03-16-02 added all topoplot() options -ad +% 03-18-02 added title -ad & sm + +function varargout = pop_envtopo( EEG, timerange, varargin); + +varargout{1} = ''; +if nargin < 1 + help pop_envtopo; + return; +end; +if length(EEG) == 1 & isempty( EEG.icasphere ) + disp('Error: cannot make plot without ICA weights. See "Tools > Run ICA".'); return; +end; +if length(EEG) == 1 & isempty(EEG.chanlocs) + fprintf('Cannot make plot without channel locations. See "Edit > Dataset info".\n'); + return; +end; +if exist('envtitle') ~= 1 + envtitle = 'Largest ERP components'; +end; + +options = ','; +if nargin < 3 + % which set to save + % ----------------- + promptstr = { 'Enter time range (in ms) to plot:', ... + 'Enter time range (in ms) to rank component contributions:', ... + 'Number of largest contributing components to plot (7):', ... + 'Else plot these component numbers only (Ex: 2:4,7):', ... + 'Component numbers to remove from data before plotting:' ... + 'Plot title:' ... + 'Optional topoplot() and envtopo() arguments:' }; + inistr = { [num2str( EEG(end).xmin*1000) ' ' num2str(EEG(end).xmax*1000)], ... + [num2str( EEG(end).xmin*1000) ' ' num2str(EEG(end).xmax*1000)], ... + '7', ... + '', ... + '', ... + ['Largest ERP components' fastif(isempty(EEG(end).setname), '',[' of ' EEG(end).setname])] ... + '''electrodes'',''off''' }; + if length(EEG) > 1 + promptstr = { 'Dataset indices to subtract (Ex: ''1 2''-> 1-2)' promptstr{:} }; + inistr = { '2 1' inistr{:} }; + end; + result = inputdlg2( promptstr, 'Plot component and ERP envelopes -- pop_envtopo()', 1, inistr, 'pop_envtopo'); + if length(result) == 0 return; end; + + if length(EEG) > 1 + subindices = eval( [ '[' result{1} ']' ] ); + result(1) = []; + EEG = EEG(subindices(1:2)); + fprintf('pop_envtopo(): Subtracting the epoch mean of dataset %d from that of dataset %d\n', ... + subindices(2), subindices(1)); + end; + + timerange = eval( [ '[' result{1} ']' ] ); + if ~isempty( result{2} ), options = [ options '''limcontrib'',[' result{2} '],' ]; end; + if ~isempty( result{3} ), options = [ options '''compsplot'',[' result{3} '],' ]; end; + if ~isempty( result{4} ), options = [ options '''compnums'',[' result{4} '],' ]; end; + if ~isempty(result{5}), options = [ options '''subcomps'',[' result{5} '],' ]; end; + if ~isempty(result{6}), options = [ options '''title'', ''' result{6} ''',' ]; end; + options = [ options result{7} ]; + figure; + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; +else + if isempty(timerange) + timerange = [EEG.xmin*1000 EEG.xmax*1000]; + end + options = [options vararg2str( varargin ) ]; +end; + +if length(EEG) > 2 + error('Cannot process more than two datasets'); +end; + +if timerange(1) < max([EEG.xmin])*1000, timerange(1) = max([EEG.xmin])*1000; end; +if timerange(2) > min([EEG.xmax])*1000, timerange(2) = min([EEG.xmax])*1000; end; + +EEG1 = eeg_checkset(EEG(1),'loaddata'); +sigtmp = reshape(EEG1.data, EEG1.nbchan, EEG1.pnts, EEG1.trials); +if ~isempty(EEG1.icachansind), sigtmp = sigtmp(EEG1.icachansind,:,:); end; +if length(EEG) == 2 + EEG2 = eeg_checkset(EEG(2),'loaddata'); + if ~all(EEG1.icaweights(:) == EEG2.icaweights(:)) + error('The ICA decomposition must be the same for the two datasets'); + end; + sigtmp2 = reshape(EEG2.data, EEG2.nbchan, EEG2.pnts, EEG2.trials); + if ~isempty(EEG2.icachansind), sigtmp2 = sigtmp2(EEG2.icachansind,:,:); end; +end; +posi = round( (timerange(1)/1000-EEG1.xmin) * EEG1.srate) + 1; +posf = min(round( (timerange(2)/1000-EEG1.xmin) * EEG1.srate) + 1, EEG1.pnts); + +% outputs +% ------- +outstr = ''; +if nargin >= 4 + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% generate output command +% ------------------------ +if length( options ) < 2, options = ''; end; +if length(EEG) == 1 + varargout{1} = sprintf('figure; pop_envtopo(%s, [%s] %s);', ... + inputname(1), num2str(timerange), options); +else + if exist('subindices') + varargout{1} = sprintf('figure; pop_envtopo(%s([%s]), [%s] %s);', ... + inputname(1), int2str(subindices), num2str(timerange), options); + end; +end; + +% plot the data +% -------------- +options = [ options ', ''verbose'', ''off''' ]; +if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; +if any(isnan(sigtmp(:))) + disp('NaN detected: using nan_mean'); + if length(EEG) == 2 + com = sprintf(['%s envtopo(nan_mean(sigtmp(:,posi:posf,:),3)-nan_mean(sigtmp2(:,posi:posf,:),3),' ... + 'EEG(1).icaweights*EEG(1).icasphere, ' ... + '''chanlocs'', EEG(1).chanlocs, ''chaninfo'', EEG(1).chaninfo, ''icawinv'', EEG(1).icawinv,' ... + '''timerange'', [timerange(1) timerange(2)] %s);' ] , outstr, options); + else % length(EEG) == 1 + com = sprintf(['%s envtopo(nan_mean(sigtmp(:,posi:posf,:),3), EEG.icaweights*EEG.icasphere, ' ... + '''chanlocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo, ''icawinv'', EEG.icawinv,' ... + '''timerange'', [timerange(1) timerange(2)] %s);' ] , outstr, options); + end; +else + if length(EEG) == 2 + com = sprintf(['%s envtopo(mean(sigtmp(:,posi:posf,:),3)-mean(sigtmp2(:,posi:posf,:),3),' ... + ' EEG(1).icaweights*EEG(1).icasphere, ' ... + '''chanlocs'', EEG(1).chanlocs, ''chaninfo'', EEG(1).chaninfo, ''icawinv'', EEG(1).icawinv,' ... + '''timerange'', [timerange(1) timerange(2)] %s);' ] , outstr, options); + else % length(EEG) == 1 + com = sprintf(['%s envtopo(mean(sigtmp(:,posi:posf,:),3), EEG.icaweights*EEG.icasphere, ' ... + '''chanlocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo, ''icawinv'', EEG.icawinv,' ... + '''timerange'', [timerange(1) timerange(2)] %s);' ] , outstr, options); + end; +end; + +% fprintf(['\npop_envtopo(): Issuing command: ' com '\n\n']); % type the evntopo() call + +eval(com); % make the plot using envtopo() + +return; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_epoch.m b/code/eeglab13_4_4b/functions/popfunc/pop_epoch.m new file mode 100644 index 0000000..2b7a68c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_epoch.m @@ -0,0 +1,397 @@ +% pop_epoch() - Convert a continuous EEG dataset to epoched data by extracting +% data epochs time locked to specified event types or event indices. +% May also sub-epoch an already epoched dataset (if sub-epochs are +% same size or smaller). This pop_function calls epoch(). +% Usage: +% >> OUTEEG = pop_epoch( EEG); % pop-up a data entry window +% >> OUTEEG = pop_epoch( EEG, events, timelimits); +% >> [OUTEEG, indices] = pop_epoch( EEG, typerange, timelimits,'key1', value1 ...); +% +% Graphic interface: +% "Time-locking event type(s)" - [edit box] Select 'Edit > Event values' +% to see a list of event.type values; else use the push button. +% To use event types containing spaces, enter in single-quotes. +% epoch() function command line equivalent: 'typerange' +% "..." - [push button] scroll event types. +% "Epoch limits" - [edit box] epoch latency range [start, end] in seconds relative +% to the time-locking events. epoch() function equivalent: 'timelim' +% "Name for the new dataset" - [edit box] +% epoch() function equivalent: 'newname' +% "Out-of-bounds EEG ..." - [edit box] Rejection limits ([min max], []=none). +% epoch() function equivalent: 'valuelim' +% Inputs: +% EEG - Input dataset. Data may already be epoched; in this case, +% extract (shorter) subepochs time locked to epoch events. +% typerange - Cell array of event types to time lock to. 'eventindices' +% {default {} --> time lock epochs to any type of event} +% (Note: An event field called 'type' must be defined in the +% 'EEG.event' structure. The command line argument is +% 'eventindices' below). +% timelim - Epoch latency limits [start end] in seconds relative to +% the time-locking event {default: [-1 2]} +% +% Optional inputs: +% 'eventindices'- [integer vector] Extract data epochs time locked to the +% indexed event numbers. +% 'valuelim' - [min max] or [max]. Lower and upper bound latencies for +% trial data. Else if one positive value is given, use its +% negative as the lower bound. The given values are also +% considered outliers (min max) {default: none} +% 'verbose' - ['yes'|'no'] {default: 'yes'} +% 'newname' - [string] New dataset name {default: "[old_dataset] epochs"} +% 'epochinfo'- ['yes'|'no'] Propagate event information into the new +% epoch structure {default: 'yes'} +% +% Outputs: +% OUTEEG - output dataset +% indices - indices of accepted events +% +% Authors: Arnaud Delorme and Hilit Serby, SCCN, INC, UCSD, 2001 +% +% See also: eeglab, epoch + +% deprecated +% 'timeunit' - Time unit ['seconds'|'points'] If 'seconds,' consider events +% times to be in seconds. If 'points,' consider events as +% indices into the data array. {default: 'points'} + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 02-13-02 introduction of 'key', val arguments -ad +% 02-13-02 rereferencing of events -ad +% 03-18-02 interface and debugging -ad +% 03-27-02 interface and debugging -ad & sm + +function [EEG, indices, com] = pop_epoch( EEG, events, lim, varargin ); + +if nargin < 1 + help pop_epoch; + return; +end; +com = ''; +indices = []; + +if isempty(EEG.event) + if EEG.trials > 1 & EEG.xmin <= 0 & EEG.xmax >=0 + disp('No EEG.event structure found: creating events of type ''TLE'' (Time-Locking Event) at time 0'); + EEG.event(EEG.trials).epoch = EEG.trials; + for trial = 1:EEG.trials + EEG.event(trial).epoch = trial; + EEG.event(trial).type = 'TLE'; + EEG.event(trial).latency = -EEG.xmin*EEG.srate+1+(trial-1)*EEG.pnts; + end; + else + disp('Cannot epoch data with no events'); beep; + return; + end; +end; +if ~isfield(EEG.event, 'latency'), + disp( 'Absent latency field in event array/structure: must name one of the fields ''latency'''); + beep; return; +end; +OLDEEG = EEG; + +if nargin < 3 + % popup window parameters + % ----------------------- + promptstr = { strvcat('Time-locking event type(s) ([]=all):', ... + 'Select ''Edit > Event values'' to see type values.'), ... + 'Epoch limits [start, end] in seconds:', ... + 'Name for the new dataset:', ... + 'Out-of-bounds EEG rejection limits ([min max], []=none):' }; + + cbevent = ['if ~isfield(EEG.event, ''type'')' ... + ' errordlg2(''No type field'');' ... + 'else' ... + ' tmpevent = EEG.event;' ... + ' if isnumeric(EEG.event(1).type),' ... + ' [tmps,tmpstr] = pop_chansel(unique([ tmpevent.type ]));' ... + ' else,' ... + ' [tmps,tmpstr] = pop_chansel(unique({ tmpevent.type }));' ... + ' end;' ... + ' if ~isempty(tmps)' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''events''), ''string'', tmpstr);' ... + ' end;' ... + 'end;' ... + 'clear tmps tmpevent tmpv tmpstr tmpfieldnames;' ]; + + geometry = { [2 1 0.5] [2 1 0.5] [2 1.5] [2 1 0.5] }; + uilist = { { 'style' 'text' 'string' 'Time-locking event type(s) ([]=all)' } ... + { 'style' 'edit' 'string' '' 'tag' 'events' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cbevent } ... + { 'style' 'text' 'string' 'Epoch limits [start, end] in seconds' } ... + { 'style' 'edit' 'string' '-1 2' } ... + { } ... + { 'style' 'text' 'string' 'Name for the new dataset' } ... + { 'style' 'edit' 'string' fastif(isempty(EEG.setname), '', [ EEG.setname ' epochs' ]) } ... + { 'style' 'text' 'string' 'Out-of-bounds EEG limits if any [min max]' } ... + { 'style' 'edit' 'string' '' } { } }; + + result = inputgui( geometry, uilist, 'pophelp(''pop_epoch'')', 'Extract data epochs - pop_epoch()'); + if length(result) == 0 return; end; + + if strcmpi(result{1}, '[]'), result{1} = ''; end; + if ~isempty(result{1}) + if strcmpi(result{1}(1),'''') % If event type appears to be in single-quotes, use comma + % and single-quote as delimiter between event types. toby 2.24.2006 + % fixed Arnaud May 2006 + events = eval( [ '{' result{1} '}' ] ); + else events = parsetxt( result{1}); + end; + else events = {}; + end + lim = eval( [ '[' result{2} ']' ] ); + + args = {}; + if ~isempty( result{3} ), args = { args{:}, 'newname', result{3} }; end; + if ~isempty( result{4} ), args = { args{:}, 'valuelim', eval( [ '[' result{4} ']' ] ) }; end; + args = { args{:}, 'epochinfo', 'yes' }; + +else % no interactive inputs + args = varargin; +end; + +% create structure +% ---------------- +if ~isempty(args) + try, g = struct(args{:}); + catch, disp('pop_epoch(): wrong syntax in function arguments'); return; end; +else + g = []; +end; + +% test the presence of variables +% ------------------------------ +try, g.epochfield; catch, g.epochfield = 'type'; end; % obsolete +try, g.timeunit; catch, g.timeunit = 'points'; end; +try, g.verbose; catch, g.verbose = 'on'; end; +try, g.newname; catch, g.newname = fastif(isempty(EEG.setname), '', [EEG.setname ' epochs' ]); end; +try, g.eventindices; catch, g.eventindices = 1:length(EEG.event); end; +try, g.epochinfo; catch, g.epochinfo = 'yes'; end; +try, if isempty(g.valuelim), g.valuelim = [-Inf Inf]; end; catch, g.valuelim = [-Inf Inf]; end; + +% transform string events into a int array of column indices +% ---------------------------------------------------------- +tmpevent = EEG.event; +tmpeventlatency = [ tmpevent(:).latency ]; +[tmpeventlatency Itmp] = sort(tmpeventlatency); +EEG.event = EEG.event(Itmp); % sort by ascending time +Ievent = g.eventindices; + +if ~isempty( events ) + % select the events for epoching + % ------------------------------ + Ieventtmp = []; + tmpevent = EEG.event; + tmpeventtype = { tmpevent.type }; + if iscell(events) + if isstr(EEG.event(1).type) + for index2 = 1:length( events ) + tmpevent = events{index2}; + if ~isstr( tmpevent ), tmpevent = num2str( tmpevent ); end; + Ieventtmp = [ Ieventtmp ; strmatch(tmpevent, tmpeventtype, 'exact') ]; + end; + else + for index2 = 1:length( events ) + tmpevent = events{index2}; + if isstr( tmpevent ),tmpevent = str2num( tmpevent ); end; + if isempty( tmpevent ), error('pop_epoch(): string entered in a numeric field'); end; + Ieventtmp = [ Ieventtmp find(tmpevent == [ tmpeventtype{:} ]) ]; + end; + end; + else + error('pop_epoch(): multiple event types must be entered as {''a'', ''cell'', ''array''}'); return; + end; + Ievent = sort(intersect(Ievent, Ieventtmp)); +end; + +% select event latencies for epoching +%------------------------------------ +Ievent = sort(Ievent); +alllatencies = tmpeventlatency(Ievent); + +if isempty(alllatencies) + error('pop_epoch(): empty epoch range (no epochs were found).'); return; +end; +fprintf('pop_epoch():%d epochs selected\n', length(alllatencies)); + +try + % ---------------------------------------------------- + % For AMICA probabilities...Temporarily add model probabilities as channels + %----------------------------------------------------- + if isfield(EEG.etc, 'amica') && ~isempty(EEG.etc.amica) && isfield(EEG.etc.amica, 'v_smooth') && ~isempty(EEG.etc.amica.v_smooth) && ~isfield(EEG.etc.amica,'prob_added') + if isfield(EEG.etc.amica, 'num_models') && ~isempty(EEG.etc.amica.num_models) + if size(EEG.data,2) == size(EEG.etc.amica.v_smooth,2) && size(EEG.data,3) == size(EEG.etc.amica.v_smooth,3) && size(EEG.etc.amica.v_smooth,1) == EEG.etc.amica.num_models + + EEG = eeg_formatamica(EEG); + %-------------------- + [EEG indices com] = pop_epoch(EEG,events,lim,args{:}); + %--------------------------------- + + EEG = eeg_reformatamica(EEG); + EEG = eeg_checkamica(EEG); + return; + else + disp('AMICA probabilities not compatible with size of data, model probabilities cannot be epoched...') + + end + end + end + % ---------------------------------------------------- +catch + warnmsg = strcat('your dataset contains amica information, but the amica plugin is not installed. Continuing and ignoring amica information.'); + warning(warnmsg) +end + +% change boundaries in rare cases when limits do not include time-locking events +% ------------------------------------------------------------------------------ +tmpevents = EEG.event; +if lim(1) > 0 && ischar(EEG.event(1).type) + % go through all onset latencies + for Z1 = length(alllatencies):-1:1 + % if there is any event in between trigger and epoch onset which are boundary events + selEvt = find([tmpevents.latency] > alllatencies(Z1) & [tmpevents.latency] < alllatencies(Z1) + lim(1) * EEG.srate); + selEvt = selEvt(strcmp({tmpevents(selEvt).type}, 'boundary')); + if any(selEvt) + if sum([tmpevents(selEvt).duration]) > lim(1) * EEG.srate + alllatencies(Z1) = []; + else + % correct the latencies by the duration of the data that were cutout + alllatencies(Z1) = alllatencies(Z1) - sum([tmpevents(selEvt).duration]); + end; + end + end +end +if lim(2) < 0 && ischar(EEG.event(1).type) + % go through all onset latencies + for Z1 = length(alllatencies):-1:1 + % if there is any event in between trigger and epoch onset which are boundary events + selEvt = find([tmpevents.latency] < alllatencies(Z1) & [tmpevents.latency] > alllatencies(Z1) + lim(2) * EEG.srate); + selEvt = selEvt(strcmp({tmpevents(selEvt).type}, 'boundary')); + if any(selEvt) + if sum([tmpevents(selEvt).duration]) > -lim(2) * EEG.srate + alllatencies(Z1) = []; + else + % correct the latencies by the duration of the data that were cutout + alllatencies(Z1) = alllatencies(Z1) + sum([tmpevents(selEvt).duration]); + end; + end + end +end + +% select event time format and epoch +% ---------------------------------- +switch lower( g.timeunit ) + case 'points', [EEG.data tmptime indices epochevent]= epoch(EEG.data, alllatencies, [lim(1) lim(2)]*EEG.srate, ... + 'valuelim', g.valuelim, 'allevents', tmpeventlatency); + tmptime = tmptime/EEG.srate; + case 'seconds', [EEG.data tmptime indices epochevent]= epoch(EEG.data, alllatencies, lim, 'valuelim', g.valuelim, ... + 'srate', EEG.srate, 'allevents', tmpeventlatency); + otherwise, disp('pop_epoch(): invalid event time format'); beep; return; +end; +alllatencies = alllatencies(indices); +fprintf('pop_epoch():%d epochs generated\n', length(indices)); + + +% update other fields +% ------------------- +if lim(1) ~= tmptime(1) & lim(2)-1/EEG.srate ~= tmptime(2) + fprintf('pop_epoch(): time limits have been adjusted to [%3.3f %3.3f] to fit data points limits\n', ... + tmptime(1), tmptime(2)+1/EEG.srate); +end; +EEG.xmin = tmptime(1); +EEG.xmax = tmptime(2); +EEG.pnts = size(EEG.data,2); +EEG.trials = size(EEG.data,3); +EEG.icaact = []; +if ~isempty(EEG.setname) + if ~isempty(EEG.comments) + EEG.comments = strvcat(['Parent dataset "' EEG.setname '": ----------'], EEG.comments); + end; + EEG.comments = strvcat(['Parent dataset: ' EEG.setname ], ' ', EEG.comments); +end; +EEG.setname = g.newname; + +% count the number of events to duplicate and duplicate them +% ---------------------------------------------------------- +totlen = 0; +for index=1:EEG.trials, totlen = totlen + length(epochevent{index}); end; +EEG.event(1).epoch = 0; % create the epoch field (for assignment consistency afterwards) +if totlen ~= 0 + newevent(totlen) = EEG.event(1); % reserve array +else + newevent = []; +end; + +% modify the event structure accordingly (latencies and add epoch field) +% ---------------------------------------------------------------------- +allevents = []; +count = 1; +for index=1:EEG.trials + for indexevent = epochevent{index} + newevent(count) = EEG.event(indexevent); + newevent(count).epoch = index; + newevent(count).latency = newevent(count).latency ... + - alllatencies(index) - tmptime(1)*EEG.srate + 1 + EEG.pnts*(index-1); + count = count + 1; + end; +end; +EEG.event = newevent; +EEG.epoch = []; +EEG = eeg_checkset(EEG, 'eventconsistency'); + +% check for boundary events +% ------------------------- +disp('pop_epoch(): checking epochs for data discontinuity'); +if ~isempty(EEG.event) & isstr(EEG.event(1).type) + tmpevent = EEG.event; + boundaryindex = strmatch('boundary', { tmpevent.type }); + if ~isempty(boundaryindex) + indexepoch = []; + for tmpindex = boundaryindex + if isfield(tmpevent, 'epoch') + indexepoch = [indexepoch tmpevent(tmpindex).epoch ]; + else + indexepoch = 1; % only one epoch + end; + end; + EEG = pop_select(EEG, 'notrial', indexepoch); + % update the "indices of accepted events", too + indices = indices(setdiff(1:length(indices),indexepoch)); + end; +end; + +% generate text command +% --------------------- +com = sprintf('%s = pop_epoch( %s, { ', inputname(1), inputname(1)); +for j=1:length(events); + if isstr( events{j} ) com = sprintf('%s ''%s'' ', com, events{j} ); + else com = sprintf('%s [%s] ', com, num2str(events{j}) ); + end; +end; +com = sprintf('%s }, [%s]', com, num2str(lim)); +for i=1:2:length(args) + if ~isempty( args{i+1} ) + if isstr( args{i+1} ) com = sprintf('%s, ''%s'', ''%s''', com, args{i}, args{i+1} ); + else com = sprintf('%s, ''%s'', [%s]', com, args{i}, num2str(args{i+1}) ); + end; + end; +end; +com = [com ');']; +return; % text command + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_erpimage.m b/code/eeglab13_4_4b/functions/popfunc/pop_erpimage.m new file mode 100644 index 0000000..c2d3c50 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_erpimage.m @@ -0,0 +1,697 @@ +% pop_erpimage() - draw an ERP-image plot of a given EEG channel or independent +% component. Uses a pop-up window if less than three (or four +% in one condition) input arguments are supplied. Calls erpimage(). +% For futher details see >> help erpimage +% Usage: +% >> pop_erpimage(EEG, typeplot); % pop-up a data entry window +% >> pop_erpimage(EEG, typeplot, lastcom); % pop-up a data entry window +% >> pop_erpimage(EEG, typeplot, channel); % no pop-up window +% >> pop_erpimage(EEG, typeplot, channel, projchan, title, ... +% smooth, decimate, sortingtype, sortingwin, ... +% sortingeventfield, renorm, options...); +% Graphic interface: +% "Channel or Component" - [edit box] Enter channel number or component +% number to plot. erpimage() equivalent: 'channel' +% "Project to channel #" - [edit box] (for plotting independent components). +% Allow reprojecting the component activity +% to a given channel or group of channels. +% erpimage() equivalent: [none] +% "Smoothing" - [text box] Smoothing parameter in number of trials. +% erpimage() equivalent: 'smooth' +% "Downsampling" - [edit box] Decimate parameter. +% erpimage() equivalent: 'decimate' +% "Time limits" - [edit box] Enter the time limits in milliseconds. +% erpimage() equivalent: the 1st and 2nd parameters of the 'limit' array +% "Figure title" - [edit box] Enter the figure title here. If empty, a title +% is automatically generated. erpimage() equivalent: 'title' +% "Plot scalp map" - [checkbox] Setting this option plot a scalp map of the +% channel location (or component topography) next to the +% erpimage. erpimage() equivalent: 'topo' +% "plot ERP" - [checkbox] Setting this option plot the channel or component +% ERP below the ERP image. erpimage() equivalent: 'erp' +% "Plot colorbar" - [checkbox] Plot the colorbar on the right of the erpimage. +% erpimage() equivalent: 'cbar' +% "ERP limits" - [edit box] Set the minimum and maximum value for the ERP plot +% erpimage() equivalent: 3rd and 4th parameters of the 'limit' array +% "Color limits" - [edit box] Set the color limits for the ERP image. +% erpimage() equivalent: 'caxis' +% "Epoch sorting field" - [button and edit box] Specify the event field which +% values will be used to sort the trials. For instance, if you +% select the 'latency' fields, trials will be sorted by the +% latency of the selected events. +% erpimage() equivalent: 'sortingeventfield' +% "Event type(s)" - [button and edit box] Specify which event subset to select, +% based on the event 'type' field values (to scan for event types, use +% menu Edit > Events values and look at the values of the 'type' +% field). For instance, entering type 'rt' (if defined) and field +% 'latency' in option aboce will sort trials on reaction time latencies. +% When several selected events are present in individual trials, +% the first event values are used for sorting and a warning is issued. +% erpimage() equivalent: 'sortingtype' +% "Event time range" - [edit box] Specify which event subset to select based on +% event latency values. As the option above, this further restrains +% the selection of events. For example, entering [200 300] in this +% box, 'rt' for the event type (above), and 'latency' for the +% epoch sorting field will select trials with reaction-time latencies +% in between 200 and 300 ms. Trials with no such event will not be +% included in the ERP-image plot. erpimage() equivalent: 'sortingwin' +% "rescale" - [edit box] 'yes', 'no', or a Matlab formula. +% erpimage() equivalent: 'renorm' +% "align" - [edit box] Set this to 'Inf' to re-align the individual trials +% on the median latency of the selected events. Else, enter an epoch time +% (in ms) to align the events to (Ex: 0). erpimage() equivalent: 'align' +% "Don't sort by value" - [checkbox] Check this box if you do not want to +% sort the trials but do want to plot the selected event values. +% erpimage() equivalent: 'nosort' +% "Don't plot value" - [checkbox] Check this box if you do not want to +% plot the selected event values, but still want to sort +% the data trials according to these values. +% erpimage() eqivalent: 'noplot' +% "Sort by phase > Frequency" - [edit box] Specify the frequency or frequency +% range for sorting trials by phase. erpimage() equivalent: +% 3rd and 4th inputs to 'phasesort' +% "Window center (ms)" - [edit box] erpimage() equivalent: 1st 'phasesort' input +% "Percent low-amp. trials to ignore" - [edit box] erpimage() equivalent: +% 2nd 'phasesort' input +% "Wavelet cycles" - [text] Number of wavelet cycles used for spectral decomposition +% at the specified latency. To change this, see "More options" {default: 3} +% "Inter-trial coherence options > Frequency" - [edit box] Frequency at which +% to compute coherence. Constrained to be the same as the +% "Sort by phase > Frequency" edit box. erpimage() equivalent: 'coher' +% "Signif. level" - [edit box] Coherence significance cutoff, as a proability +% (Ex: .05). erpimage() equivalent: 'signif' +% "Amplitude limit" - [edit box] Amplitude limits [min max] for the data power +% plot at the selected frequency. erpimage() equivalent: +% 5th and 6th inputs to 'limit' +% "Coher limits" - [edit box] Upper limit (<=1) for the coherence +% plot. erpimage() equivalent: 7th and 8th inputs of 'limit' +% "Image amps" - [checkbox] Check this box for plotting the spectral amplitude +% image at the selected frequency (instead of plotting EEG potential). +% erpimage() equivalent: 'plotamp' +% "Plot spectrum" - [edit box] Plot the channel or component data spectrum in +% the top right corner of the ERP image. erpimage() equivalent: 'spec' +% "Baseline ampl." - [edit box] Baseline amplitude for data power plot at the +% selected frequency. erpimage() equivalent: 7th inputs of 'limit' +% "Mark times" - [edit box] Time(s) in ms to plot vertical lines. +% erpimage() equivalent: 'vert' +% "More options" - [edit box] Enter 'key', 'value' sequences. Other erpimage() +% options not handled by this interface, including: 'erpstd' to +% plot the ERP standard deviation; 'auxvar' to plot auxilary +% variables; 'ampsort' to sort trials based on amplitude at +% the selected frequency, etc. For further information see +% >> help erpimage() +% Inputs: +% EEG - dataset structure +% typeplot - 1=channel, 0=component {default: 1} +% lastcom - string containing previous pop_erpimage command (from LASTCOM) +% or from the previous function call output. The values from this +% function call are used as default in the graphic interface. +% +% Commandline options: +% channel - Index of channel or component(s) to plot {default: 1} +% projchan - Channel to back-project the selected component(s) to. +% If plotting channel activity, this argument is ignored. +% If [], the ICA component activation is plotted {default []}. +% title - ['string'] Plot title {default: []} +% smooth - Smoothing parameter (number of trials). {Default: 5} +% erpimage() equivalent: 'avewidth' +% decimate - Decimate parameter (i.e. ratio of trials_in/trials_out). +% erpaimge() equivalent: 'decimate' {Default: 0} +% sortingtype - Sorting event type(s) ([int vector]; []=all). See Notes below. +% Either a string or an integer. +% sortingwin - Sorting event window [start, end] in seconds ([]=whole epoch) +% sortingeventfield - Sorting field name. {default: none}. See Notes below. +% options - erpimage() options, separated by commas (Ex: 'erp', 'cbar'). +% {Default: none}. For further details see >> erpimage help +% +% Outputs from pop-up: +% String containing the command used to evaluate this plotting function +% (saved by eeglab() as LASTCOM). Enter it as the 'lastcom' input to restore +% the previous parameters as defaults in a new pop_erpimage() pop-up window +% +% Outputs from commandline: +% Same as erpimage(). Note: No outputs are returned when a window pops-up +% to ask for additional arguments +% +% Notes: +% 1) A new figure is created only when the pop-up window is called, +% so you may call this command with >3 args to draw in sbplot() axes. +% 2) To sort epochs, first define the event field to be used with +% the argument 'sortingeventfield' (for instance 'latency'). Then, +% because there may be several events with different latencies in a +% given epoch, it is possible to consider only a subsets of events +% using the 'sortingtype' and 'sortingwin' arguments. The +% 'sortingtype' argument selects events with definite types. The +% 'sortingwin' argument helps to define a specific time window in the +% epoch to select events. For instance the epoch time range may be -1 +% to 2 seconds but one may want to select events only in the range 0 +% to 1 second. These three parameters are forwarded to the function +% eeg_getepochevent(), whose help message contains more details. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab(), erpimage(), eeg_getepochevent() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 02-12-02 added new event format compatibility -ad +% 02-15-02 text interface editing -sm & ad +% 03-07-02 add the eeglab computeica options -ad +% 02-15-02 modified the function accoring to the new event/epoch structure -ad +% 03-18-02 added title -ad & sm +% 04-04-02 added outputs -ad & sm + +function varargout = pop_erpimage( EEG, typeplot, channel, projchan, titleplot, smooth, decimate, sortingtype, ... + sortingwin, sortingeventfield, varargin) + +varargout{1} = ''; +if nargin < 1 + help pop_erpimage; + return; +end; + +if typeplot == 0 && isempty(EEG.icasphere) + error('no ICA data for this set, first run ICA'); +end; +if EEG.trials == 1 + error('erpimage of one trial cannot be plotted'); +end; + +if nargin < 2 + typeplot = 1; %1=signal; 0=component +end; +lastcom = []; +if nargin < 3 + popup = 1; +else + popup = isstr(channel) | isempty(channel); + if isstr(channel) + lastcom = channel; + end; +end; + +if popup + % get contextual help + % ------------------- + clear functions; + erpimagefile = which('erpimage.m'); + [txt2 vars2] = gethelpvar(erpimagefile); + txt = { txt2{:}}; + vars = { vars2{:}}; + % [txt vars] = gethelpvar('erpimopt.m'); + % txt = { txt{:} txt2{:}}; + % vars = { vars{:} vars2{:}}; + + opt.topo = getkeyval(lastcom, 'topo', 'present', 1); + opt.fieldname = getkeyval(lastcom, 10); + opt.type = getkeyval(lastcom, 8); + opt.renorm = getkeyval(lastcom, 'renorm','', 'no'); + opt.erp = fastif(getkeyval(lastcom, '''erp''', 'present', 1), 'on', 'off'); + opt.cbar = fastif(getkeyval(lastcom, 'cbar', 'present', 1), 'on', 'off'); + opt.nosort = fastif(getkeyval(lastcom, 'nosort', 'present', 0), 'on', 'off'); + opt.noplot = fastif(getkeyval(lastcom, 'noplot', 'present', 0), 'on', 'off'); + opt.plotamps = fastif(getkeyval(lastcom, 'plotamps', 'present', 0), 'on', 'off'); + opt.index = str2num(getkeyval(lastcom,3,[],'1')); + opt.smoothing = str2num(getkeyval(lastcom, 6, [], int2str(min(max(EEG.trials-5,0), 10)))); + opt.downsampling = str2num(getkeyval(lastcom, 7, [], '1')); + opt.caxis = str2num(getkeyval(lastcom, 'caxis')); + opt.eventrange = str2num(getkeyval(lastcom, 9)); + opt.align = str2num(getkeyval(lastcom, 'align')); + opt.phasesort = str2num(getkeyval(lastcom, 'phasesort')); + opt.coher = str2num(getkeyval(lastcom, 'coher')); + opt.spec = str2num(getkeyval(lastcom, 'spec')); + opt.vert = str2num(getkeyval(lastcom, 'vert')); + opt.limits = str2num(getkeyval(lastcom, 'limits')); + opt.limits = [ opt.limits NaN NaN NaN NaN NaN NaN NaN NaN NaN ]; opt.limits = opt.limits(1:9); + opt.coher = [ opt.coher NaN NaN NaN NaN NaN NaN NaN NaN NaN ]; opt.coher = opt.coher(1:3); + opt.phasesort = [ opt.phasesort NaN NaN NaN NaN NaN NaN NaN NaN NaN ]; opt.phasesort = opt.phasesort(1:4); + if isnan(opt.limits(1)), opt.limits(1:2) = 1000*[EEG.xmin EEG.xmax]; end; + + commandphase = [ 'if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''phase''),''string'')),' ... + ' if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''coher''),''string'')), ' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''coher''), ''string'', get(findobj(''parent'', gcbf, ''tag'', ''phase''),''string''));' ... + 'end; end;' ]; + commandcoher = [ 'if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''coher''),''string'')),' ... + ' if ~isempty(get(findobj(''parent'', gcbf, ''tag'', ''phase''),''string'')), ' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''phase''), ''string'', get(findobj(''parent'', gcbf, ''tag'', ''coher''),''string''));' ... + 'end; end;' ]; + + commandfield = ['if isempty(EEG.event)' ... + ' errordlg2(''No events'');' ... + 'else' ... + ' tmpfieldnames = fieldnames(EEG.event);' ... + ' [tmps,tmpv] = listdlg2(''PromptString'', ''Select fields'', ''SelectionMode'',''single'',''ListString'', tmpfieldnames);' ... + ' if tmpv' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''field''), ''string'', tmpfieldnames{tmps});' ... + ' end;' ... + 'end;' ... + 'if isempty(get(findobj(''parent'', gcbf, ''tag'', ''type''), ''string'')),' ... + ' warndlg2(''Do not forget to select an event type in the next edit box'');' ... + 'end;' ... + 'clear tmps tmpv tmpfieldnames;' ]; + commandtype = [ 'if ~isfield(EEG.event, ''type'')' ... + ' errordlg2(''No type field'');' ... + 'else' ... + ' tmpevent = EEG.event;' ... + ' if isnumeric(EEG.event(1).type),' ... + ' [tmps,tmpstr] = pop_chansel(unique([ tmpevent.type ]));' ... + ' else,' ... + ' [tmps,tmpstr] = pop_chansel(unique({ tmpevent.type }));' ... + ' end;' ... + ' if ~isempty(tmps)' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''type''), ''string'', tmpstr);' ... + ' end;' ... + 'end;' ... + 'if isempty(get(findobj(''parent'', gcbf, ''tag'', ''field''), ''string'')),' ... + ' warndlg2(''Do not forget to select an event type in the previous edit box'');' ... + 'end;' ... + 'clear tmps tmpv tmpstr tmpevent tmpfieldnames;' ]; + + geometry = { [1 1 0.1 0.8 2.1] [1 1 1 1 1] [1 1 1 1 1] [1 1 1 1 1] [1] [1] [1 1 1 0.8 0.8 1.2] [1 1 1 0.8 0.8 1.2] [1] [1] ... + [1.6 1.7 1.2 1 .5] [1.6 1.7 1.2 1 .5] [1] [1] [1.5 1 1 1 1] [1.5 1 1 1 1] [1] [1] [1.5 1 1 2.2] [1.5 1 1 2.2]}; + uilist = { { 'Style', 'text', 'string', fastif(typeplot, 'Channel', 'Component(s)'), 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', num2str(opt.index), 'tag', 'chan' } { } ... + { 'Style', 'text', 'string', 'Figure title', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', '', 'tag', 'title' } ... + ... + { 'Style', 'text', 'string', 'Smoothing', 'fontweight', 'bold', 'tooltipstring', context('avewidth',vars,txt) } ... + { 'Style', 'edit', 'string', num2str(opt.smoothing), 'tag', 'smooth' } ... + { 'Style', 'checkbox', 'string', 'Plot scalp map', 'tooltipstring', 'plot a 2-d head map (vector) at upper left', ... + 'value', opt.topo, 'tag', 'plotmap' } { } { } ... + { 'Style', 'text', 'string', 'Downsampling', 'fontweight', 'bold', 'tooltipstring', context('decimate',vars,txt) } ... + { 'Style', 'edit', 'string', num2str(opt.downsampling), 'tag', 'decimate' } ... + { 'Style', 'checkbox', 'string', 'Plot ERP', 'tooltipstring', context('erp',vars,txt), 'value', fastif(strcmpi(opt.erp, 'on'), 1,0), 'tag', 'erp' } ... + { 'Style', 'text', 'string', fastif(typeplot, 'ERP limits (uV)','ERP limits'), 'tooltipstring', [ 'Plotting limits for ERP trace [min_uV max_uV]' 10 '{Default: ERP data limits}'] } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.limits(3)), num2str(opt.limits(3:4)), ''), 'tag', 'limerp' } ... + { 'Style', 'text', 'string', 'Time limits (ms)', 'fontweight', 'bold', 'tooltipstring', 'Select time subset in ms' } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.limits(1)), num2str(opt.limits(1:2)), ''), 'tag', 'limtime' } ... + { 'Style', 'checkbox', 'string', 'Plot colorbar','tooltipstring', context('caxis',vars,txt), 'value', fastif(strcmpi(opt.cbar, 'on'), 1,0), 'tag', 'cbar' } ... + { 'Style', 'text', 'string', 'Color limits (see Help)','tooltipstring', context('caxis',vars,txt) } ... + { 'Style', 'edit', 'string', num2str(opt.caxis), 'tag', 'caxis' } ... + {} ... + { 'Style', 'text', 'string', 'Sort/align trials by epoch event values', 'fontweight', 'bold'} ... + { 'Style', 'pushbutton', 'string', 'Epoch-sorting field', 'callback', commandfield, ... + 'tooltipstring', 'Epoch-sorting event field name (Ex: latency; default: no sorting):' } ... + { 'Style', 'pushbutton', 'string', 'Event type(s)', 'callback', commandtype, 'tooltipstring', ['Event type(s) subset (default: all):' 10 ... + '(See ''/Edit/Edit event values'' for event types)'] } ... + { 'Style', 'text', 'string', 'Event time range', 'tooltipstring', [ 'Sorting event window [start, end] in milliseconds (default: whole epoch):' 10 ... + 'events are only selected within this time window (can be usefull if several' 10 ... + 'events of the same type are in the same epoch, or for selecting trials with given response time)']} ... + { 'Style', 'text', 'string', 'Rescale', 'tooltipstring', 'Rescale sorting variable to plot window (yes|no|a*x+b)(Ex:3*x+2):' } ... + { 'Style', 'text', 'string', 'Align', 'tooltipstring', context('align',vars,txt) } ... + { 'Style', 'checkbox', 'string', 'Don''t sort by value', 'tooltipstring', context('nosort',vars,txt), 'value', fastif(strcmpi(opt.nosort, 'on'), 1,0), 'tag', 'nosort' } ... + { 'Style', 'edit', 'string', opt.fieldname, 'tag', 'field' } ... + { 'Style', 'edit', 'string', opt.type, 'tag', 'type' } ... + { 'Style', 'edit', 'string', num2str(opt.eventrange), 'tag', 'eventrange' } ... + { 'Style', 'edit', 'string', opt.renorm, 'tag', 'renorm' } ... + { 'Style', 'edit', 'string', num2str(opt.align), 'tag', 'align' } ... + { 'Style', 'checkbox', 'string', 'Don''t plot values', 'tooltipstring', context('noplot',vars,txt), 'value', fastif(strcmpi(opt.noplot, 'on'), 1,0), 'tag', 'noplot' } ... + {} ... + { 'Style', 'text', 'string', 'Sort trials by phase', 'fontweight', 'bold'} ... + { 'Style', 'text', 'string', 'Frequency (Hz | minHz maxHz)', 'tooltipstring', ['sort by phase at maximum-power frequency' 10 ... + 'in the data within the range [minHz,maxHz]' 10 '(overrides frequency specified in ''coher'' flag)'] } ... + { 'Style', 'text', 'string', 'Percent low-amp. trials to ignore', 'tooltipstring', ['percent of trials to reject for low' ... + 'amplitude. Else,' 10 'if prct is in the range [-100,0] -> percent to reject for high amplitude'] } ... + { 'Style', 'text', 'string', 'Window center (ms)', 'tooltipstring', 'Center time of the n-cycle window' } ... + { 'Style', 'text', 'string', 'Wavelet cycles', 'tooltipstring', 'cycles per wavelet window' } {}... + { 'Style', 'edit', 'string', fastif(~isnan(opt.phasesort(3)),num2str(opt.phasesort(3:4)),'') 'tag', 'phase', 'callback', commandphase } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.phasesort(2)),num2str(opt.phasesort(2)),''), 'tag', 'phase2' } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.phasesort(1)),num2str(opt.phasesort(1)),''), 'tag', 'phase3' } ... + { 'Style', 'text', 'string', ' 3' } {}... + {} ... + { 'Style', 'text', 'string', 'Inter-trial coherence options', 'fontweight', 'bold'} ... + { 'Style', 'text', 'string', 'Frequency (Hz | minHz maxHz)', 'tooltipstring', [ '[freq] -> plot erp plus amp & coher at freq (Hz)' 10 ... + '[minHz maxHz] -> find max in frequency range' 10 '(or at phase freq above, if specified)']} ... + { 'Style', 'text', 'string', 'Signif. level (<0.20)', 'tooltipstring', 'add coher. signif. level line at alpha (alpha range: (0,0.1])' } ... + { 'Style', 'text', 'string', 'Amplitude limits (dB)' } ... + { 'Style', 'text', 'string', 'Coher limits (<=1)' } ... + { 'Style', 'checkbox', 'string', 'Image amps', 'tooltipstring', context('plotamps',vars,txt), 'value', fastif(strcmpi(opt.plotamps, 'on'), 1,0), 'tag', 'plotamps' } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.coher(1)), num2str(opt.coher(1:2)), ''), 'tag', 'coher', 'callback', commandcoher } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.coher(3)), num2str(opt.coher(3)), ''), 'tag', 'coher2' } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.limits(5)), num2str(opt.limits(5:6)), ''), 'tag', 'limamp' } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.limits(7)), num2str(opt.limits(7:8)), ''), 'tag', 'limcoher' } ... + {'style', 'text', 'string', ' (Requires signif.)' } ... + {} ... + { 'Style', 'text', 'string', 'Other options', 'fontweight', 'bold'} ... + { 'Style', 'text', 'string', 'Plot spectrum (minHz maxHz)','tooltipstring', context('spec',vars,txt)} ... + { 'Style', 'text', 'string', 'Baseline ampl. (dB)', 'tooltipstring', 'Use it to fix baseline amplitude' } ... + { 'Style', 'text', 'string', 'Mark times (ms)','tooltipstring', context('vert',vars,txt)} ... + { 'Style', 'text', 'string', 'More options (see >> help erpimage)' } ... + { 'Style', 'edit', 'string', num2str(opt.spec), 'tag', 'spec' } ... + { 'Style', 'edit', 'string', fastif(~isnan(opt.limits(9)), num2str(opt.limits(9)), ''), 'tag', 'limbaseamp' } ... + { 'Style', 'edit', 'string', num2str(opt.vert), 'tag', 'vert' } ... + { 'Style', 'edit', 'string', '', 'tag', 'others' } ... + }; + if typeplot == 0 % add extra param for components + geometry = { [1 1 0.1 0.8 2.1] geometry{:} }; + uilist = { { } { } { } { } { } uilist{:}}; + uilist{1} = uilist{6}; + uilist{2} = uilist{7}; + uilist{6} = { 'Style', 'text', 'string', 'Project to channel #', 'fontweight', 'bold','tooltipstring', ['Project component(s) to data channel' 10 ... + 'This allows plotting projected component activity at one channel in microvolts'] }; + uilist{7} = { 'Style', 'edit', 'string', getkeyval(lastcom, 4), 'tag', 'projchan' }; + end; + [oldres a b res] = inputgui( geometry, uilist, 'pophelp(''pop_erpimage'');', ... + fastif( typeplot, 'Channel ERP image -- pop_erpimage()', 'Component ERP image -- pop_erpimage()')); + if isempty(oldres), return; end; + + % first rows + % --------- + channel = eval( [ '[' res.chan ']' ]); + titleplot = res.title; + if isfield(res, 'projchan'), + if ~isempty(res.projchan) + if strcmpi(res.projchan(1),'''') + projchan = eval( [ '{' res.projchan '}' ]); + else projchan = parsetxt( res.projchan); + end; + if ~isempty(projchan) && ~isempty(str2num(projchan{1})) + projchan = cellfun(@str2num, projchan); + end; + else + projchan = []; + end; + else, + projchan = []; + end; + opt = []; + if ~isempty(res.others) + try, + tmpcell = eval( [ '{' res.others '}' ] ); + opt = struct( tmpcell{:} ); + catch, error('Additional options ("More options") requires ''key'', ''val'' arguments'); + end; + end; + if ~typeplot && isempty(projchan) + opt.yerplabel = ''; + else + opt.yerplabel = '\muV' ; + end; + smooth = eval(res.smooth); + if res.plotmap + if isfield(EEG.chanlocs, 'theta') + if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; + if typeplot == 0 + opt.topo = [ ' { mean(EEG.icawinv(:,[' int2str(channel) ']),2) EEG.chanlocs EEG.chaninfo } ']; + else opt.topo = [ ' { [' int2str(channel) '] EEG.chanlocs EEG.chaninfo } ']; + end; + end; + end; + + decimate = eval( res.decimate ); + if res.erp + opt.erp = 'on'; + end; + + % finding limits + % -------------- + limits(1:8) = NaN; + if ~isempty(res.limerp) + limits(3:4) = eval( [ '[' res.limerp ']' ]); + end; + if ~isempty(res.limtime) % time limits + if ~strcmp(res.limtime, num2str(1000*[EEG.xmin EEG.xmax])) + limits(1:2) = eval( [ '[' res.limtime ']' ]); + end; + end; + if ~isempty(res.limamp) + limits(5:6) = eval( [ '[' res.limamp ']' ]); + end; + if ~isempty(res.limcoher) + limits(7:8) = eval( [ '[' res.limcoher ']' ]); + end; + if ~isempty(res.limbaseamp) + limits(9) = eval( res.limbaseamp ); %bamp + end; + if ~all(isnan(limits)) + opt.limits = limits; + end; + + % color limits + % -------------- + if res.cbar + opt.cbar = 'on'; + end; + if res.caxis + opt.caxis = str2num(res.caxis); + end; + + % event rows + % ---------- + if res.nosort + opt.nosort = 'on'; + end; + try, sortingeventfield = eval( res.field ); catch, sortingeventfield = res.field; end; + if ~isempty(res.type) + if strcmpi(res.type(1),'''') + sortingtype = eval( [ '{' res.type '}' ] ); + else sortingtype = parsetxt( res.type ); + end; + end + sortingwin = eval( [ '[' res.eventrange ']' ] ); + if ~isempty(res.field) & ~strcmp(res.renorm, 'no') + opt.renorm = res.renorm; + end; + if ~isempty(res.align) + opt.align = str2num(res.align); + end; + if res.noplot + opt.noplot = 'on'; + end; + + % phase rows + % ---------- + tmpphase = []; + if ~isempty(res.phase) + tmpphase = eval( [ '[ 0 0 ' res.phase ']' ]); + end; + if ~isempty(res.phase2) + tmpphase(2) = eval( res.phase2 ); + end; + if ~isempty(res.phase3) + tmpphase(1) = eval( res.phase3 ); + end; + if ~isempty(tmpphase) + opt.phasesort = tmpphase; + end; + + % coher row + % ---------- + tmpcoher = []; + if res.plotamps + opt.plotamps = 'on'; + end; + if ~isempty(res.coher) + tmpcoher = eval( [ '[' res.coher ']' ]); + end; + if ~isempty(res.coher2) + if length(tmpcoher) == 1 + tmpcoher(2) = tmpcoher(1); + end; + tmpcoher(3) = eval( res.coher2 ); + end; + if ~isempty(tmpcoher) + opt.coher = tmpcoher; + end; + + % options row + % ------------ + if ~isempty(res.spec) + opt.spec = eval( [ '[' res.spec ']' ]); + end; + if ~isempty(res.vert) + opt.vert = eval( [ '[' res.vert ']' ]); + end; + figure; + options = ''; +else + options = ''; + if nargin < 4 + projchan = []; + end; + if nargin < 5 + titleplot = ' '; + end; + if nargin < 6 + smooth = 5; + end; + if nargin < 7 + decimate = 0; + end; + if nargin < 8 + sortingtype = []; + end; + if nargin < 9 + sortingwin = []; + end; + if nargin < 10 + sortingeventfield = []; + end; + %options = vararg2str(varargin); % NO BECAUSE OF THE CHANNEL LOCATION + % PROBLEM BELOW + for i=1:length( varargin ) + if isstr( varargin{ i } ) + options = [ options ', ''' varargin{i} '''' ]; + else + if ~iscell( varargin{ i } ) + options = [ options ',' vararg2str({varargin{i}}) ]; + else + %options = [ options ', { [' num2str(varargin{ i }{1}') ']'' EEG.chanlocs EEG.chaninfo }' ]; % JRI -- why does this ignore value passed as topo option? + if length(varargin{i})>1 + optchanlocs = varargin{i}{2}; % JRI -- fix + else + optchanlocs = EEG.chanlocs; + end; + if length(varargin{i})>2, + optchaninfo = varargin{i}{3}; + else + optchaninfo = EEG.chaninfo; + end + options = [ options ', { [' num2str(varargin{ i }{1}') ']'' optchanlocs optchaninfo }' ]; + end; + end; + end; +end; +try, icadefs; set(gcf, 'color', BACKCOLOR,'Name',' erpimage()'); catch, end; + +% testing inputs +% -------------- +if typeplot == 0 && length(channel) > 1 && isempty(projchan) + error('A channel must be selected to plot (the sum of) several component projections'); +end; + +% find sorting latencies +% --------------------- +typetxt = ''; +if ~isempty(sortingeventfield) + %events = eeg_getepochevent( EEG, sortingtype, sortingwin, sortingeventfield); + events = sprintf('eeg_getepochevent( EEG, %s)', vararg2str({sortingtype, sortingwin, sortingeventfield})); + + % generate text for the command + % ----------------------------- + for index = 1:length(sortingtype) + if isstr(sortingtype{index}) + typetxt = [typetxt ' ''' sortingtype{index} '''' ]; + else + typetxt = [typetxt ' ' num2str(sortingtype{index}) ]; + end; + end; +% $$$ % renormalize latencies if necessary +% $$$ % ---------------------------------- +% $$$ switch lower(renorm) +% $$$ case 'yes', +% $$$ disp('Pop_erpimage warning: *** sorting variable renormalized ***'); +% $$$ events = (events-min(events)) / (max(events) - min(events)) * ... +% $$$ 0.5 * (EEG.xmax*1000 - EEG.xmin*1000) + EEG.xmin*1000 + 0.4*(EEG.xmax*1000 - EEG.xmin*1000); +% $$$ case 'no',; +% $$$ otherwise, +% $$$ locx = findstr('x', lower(renorm)) +% $$$ if length(locx) ~= 1, error('Pop_erpimage error: unrecognize renormalazing formula'); end; +% $$$ eval( [ 'events =' renorm(1:locx-1) 'events' renorm(locx+1:end) ';'] ); +% $$$ end; +else + events = 'ones(1, EEG.trials)*EEG.xmax*1000'; + %events = ones(1, EEG.trials)*EEG.xmax*1000; + sortingeventfield = ''; +end; + +if isstr(projchan) + projchan = { projchan }; +end; +if iscell(projchan) + projchannum = std_chaninds(EEG, projchan); +else + projchannum = projchan; +end; + +if typeplot == 1 + tmpsig = ['mean(EEG.data([' int2str(channel) '], :),1)']; +else + % test if ICA was computed or if one has to compute on line + % --------------------------------------------------------- + tmpsig = [ 'eeg_getdatact(EEG, ''component'', [' int2str(channel) '], ''projchan'', [' int2str(projchannum) '])' ]; +end; + +% outputs +% ------- +outstr = ''; +if ~popup + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% plot title +% ---------- +if isempty(titleplot) + if typeplot==1 % if channel plot + if ~isempty(EEG.chanlocs) % if channel information exist + titleplot = [ EEG.chanlocs(channel).labels ]; + else, titleplot = [ int2str(channel) ]; + end + else + titleplot = [ 'Comp. ' int2str(channel) ]; + if ~isempty(projchan), + tmpstr = vararg2str({projchan}); + tmpstr(find(tmpstr == '''')) = '"'; + titleplot = [ titleplot ' -> Chan. ' tmpstr ]; + end; + end +end; + +% plot the data and generate output command +% -------------------------------------------- +if isempty( options ) + if isfield(opt, 'topo') + tmptopo = opt.topo; + opt = rmfield(opt, 'topo'); + else + tmptopo = ''; + end; + fields = fieldnames(opt); + values = struct2cell(opt); + params = { fields{:}; values{:} }; + options = [ ',' vararg2str( { params{:} } ) ]; + tmpind = find( options == '\' ); options(tmpind(1:2:end)) = []; + if ~isempty(tmptopo), options = [ options ',''topo'',' tmptopo ]; end; +end; + +% varargout{1} = sprintf('figure; pop_erpimage(%s,%d,%d,''%s'',%d,%d,{%s},[%s],''%s'',''%s''%s);', inputname(1), typeplot, channel, titleplot, smooth, decimate, typetxt, int2str(sortingwin), sortingeventfield, renorm, options); +popcom = sprintf('figure; pop_erpimage(%s,%d, [%s],[%s],''%s'',%d,%d,{%s},[%s],''%s'' %s);', inputname(1), typeplot, int2str(channel), vararg2str({projchan}), titleplot, smooth, decimate, typetxt, int2str(sortingwin), sortingeventfield, options); + +com = sprintf('%s erpimage( %s, %s, linspace(EEG.xmin*1000, EEG.xmax*1000, EEG.pnts), ''%s'', %d, %d %s);', outstr, tmpsig, events, titleplot, smooth, decimate, options); +disp('Command executed by pop_erpimage:'); +disp(' '); disp(com); disp(' '); +eval(com) + +if popup + varargout{1} = popcom; % [10 '% Call: ' com]; +end; + +return; + +% get contextual help +% ------------------- +function txt = context(var, allvars, alltext); + loc = strmatch( var, allvars); + if ~isempty(loc) + txt= alltext{loc(1)}; + else + disp([ 'warning: variable ''' var ''' not found']); + txt = ''; + end; + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_eventstat.m b/code/eeglab13_4_4b/functions/popfunc/pop_eventstat.m new file mode 100644 index 0000000..f6e4949 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_eventstat.m @@ -0,0 +1,139 @@ +% pop_eventstat() - Computes and plots statistical characteristics of an EEG event, +% including the data histogram, a fitted normal distribution, +% a normal ditribution fitted on trimmed data, a boxplot, and +% the QQ-plot. The estimates value are printed in a panel and +% can be read as output. NaNs are omitted. See signalstat(). +% +% Usage: +% >> OUTEEG = pop_eventstat( EEG ); % pops up +% >> [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh] = pop_eventstat( EEG, eventfield, type ); +% >> [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh] = pop_eventstat( EEG, eventfield, type, percent ); +% +% Inputs: +% EEG - input EEG dataset +% eventfield - event field to process (i.e. latency) +% type - name of the event type(s) to process. Can be a single element or +% a cell array. Default is all types. +% latrange - [min max] event latency range within data epochs in milliseconds. +% Default is whole epoch. +% percent - percentage for trimmed data statistics. Default is 5%. (see signalstat()) +% +% Outputs: +% OUTEEG - output dataset +% +% Author: Arnaud Delorme & Luca Finelli, CNL / Salk Institute - SCCN, 15 August 2002 +% +% See also: signalstat(), eeg_getepochevent(), eeglab() + +% Copyright (C) 2002 Arnaud Delorme & Luca Finelli, Salk/SCCN, La Jolla, CA +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function varargout = pop_eventstat( EEG, eventfield, type, latrange, percent ); + +% the command output is a hidden output that does not have to +% be described in the header + +com = ''; % this initialization ensure that the function will return something + % if the user press the cancel button +varargout{1} = ''; + +% display help if not enough arguments +% ------------------------------------ +if nargin < 1 + help pop_eventstat; + return; +end; +popup=0; +if nargin < 2 + popup = 1; +end; +if nargin < 3 + percent=5; +end; + +% pop up window +% ------------- +if nargin < 2 + promptstr = { 'Event field to process:' ... + strvcat('Event type(s) ([]=all):', ... + 'Select "Edit > Event values" to see type values') ... + strvcat('Event latency range (ms)', ... + 'Default is whole epoch or data') ... + 'Percent for trimmed statistics:' }; + inistr = { 'latency' '' '' '5' }; + result = inputdlg2( promptstr, 'Plot event statistics -- pop_eventstat()', 1, inistr, 'signalstat'); + if length( result ) == 0 return; end; + eventfield = deblank(result{1}); % the brackets allow to process matlab arrays + if ~isempty(result{2}) + if strcmpi(result{2}(1),'''') + type = eval( [ '{' result{2} '}' ] ); + else type = parsetxt( result{2}); + end; + else + disp('WARNING: you should select an event type'); + type = {}; + end; + latrange = eval( [ '[' result{3} ']' ] ); + percent = eval( [ '[' result{4} ']' ] ); +else + if nargin < 3 + type = []; + end; + if nargin < 4 + latrange = []; + end; + if nargin < 5 + percent = 5; + end; +end; + +% call function signalstat() either on raw data or ICA data +% --------------------------------------------------------- +[ typevals alltypevals ] = eeg_getepochevent(EEG, type, latrange, eventfield); +% concatenate alltypevals +% ----------------------- +typevals = []; +for index = 1:length(alltypevals) + typevals = [ typevals alltypevals{index} ]; +end; +if isempty(typevals) + error('No such events found. See Edit > Event values to confirm event type.'); +end; +dlabel='Event values'; +if isempty(type) + dlabel2=['All event statistics for ''' eventfield ''' info']; +else + dlabel2=['Event ' vararg2str(type) ' statistics for ''' eventfield ''' info']; +end; + +% outputs +% ------- +outstr = ''; +if ~popup + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% return the string command +% ------------------------- +fprintf('pop_eventstat: extracting events...\n'); +varargout{1} = sprintf('pop_eventstat( %s, %s );', inputname(1), vararg2str({eventfield type latrange percent})); +com = sprintf('%s signalstat( typevals, 1, dlabel, percent, dlabel2 ); %s', outstr); + +eval(com) +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_expevents.m b/code/eeglab13_4_4b/functions/popfunc/pop_expevents.m new file mode 100644 index 0000000..16808f4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_expevents.m @@ -0,0 +1,69 @@ +function com = pop_expevents(EEG, filename, unit) +% pop_expevents() - export events to CSV file +% +% Usage: +% >> pop_expevents(EEG); +% >> pop_expevents(EEG, filename); +% >> pop_expevents(EEG, filename, unit); +% +% Inputs: +% EEG - EEGLAB dataset +% filename - text file name +% unit - display latency and duration in 'samples' (default) or 'seconds' +% +% Outputs: +% com - Command to execute this function from the command line +% +% Examples: +% Export all events and show a dialog window: +% >> pop_expevents(EEG); +% +% Export all events to a file, latency and duration in samples: +% >> pop_expevents(EEG, filename); +% +% Export all events to a file, latency and duration in seconds: +% >> pop_expevents(EEG, filename, 'seconds'); + +% Copyright by Clemens Brunner +% Revision: 0.10 +% Date: 09/16/2011 + +% Revision history: +% 0.10: Initial version + +% This program is free software; you can redistribute it and/or modify it under +% the terms of the GNU General Public License as published by the Free Software +% Foundation; either version 2 of the License, or (at your option) any later +% version. +% +% This program is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License along with +% this program; if not, write to the Free Software Foundation, Inc., 59 Temple +% Place - Suite 330, Boston, MA 02111-1307, USA. + +com = ''; +if nargin < 1 + help pop_expevents; + return +end + +if nargin < 2 + [filename, filepath] = uiputfile('*.csv', 'File name -- pop_expevents()'); + drawnow; + if filename == 0 + return; end + filename = [filepath filename]; +end; + +if nargin < 3 + unit = 'samples'; end + +if ~(strcmp(unit, 'samples') || strcmp(unit, 'seconds')) + error('Unit must be either ''samples'' or ''seconds''.'); end + +eeg_eventtable(EEG, 'dispTable', false, 'exportFile', filename, 'unit', unit); + +com = sprintf('pop_expevents(%s, ''%s'', ''%s'');', inputname(1), filename, unit); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_expica.m b/code/eeglab13_4_4b/functions/popfunc/pop_expica.m new file mode 100644 index 0000000..adfbb45 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_expica.m @@ -0,0 +1,70 @@ +% pop_expica() - export ICA weights or inverse matrix +% +% Usage: +% >> pop_expica( EEG, whichica); % a window pops up +% >> pop_expica( EEG, whichica, filename ); +% +% Inputs: +% EEG - EEGLAB dataset +% whichica - ['weights'|'inv'] export ica 'weights' or ica inverse +% matrix ('inv'). Note: for 'weights', the function +% export the product of the sphere and weights matrix. +% filename - text file name +% +% Author: Arnaud Delorme, CNL / Salk Institute, Mai 14, 2003 +% +% See also: pop_export() + +% Copyright (C) Mai 14, 2003, Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function com = pop_expica(EEG, whichica, filename); + +com = ''; +if nargin < 1 + help pop_expica; + return; +end; + +if nargin < 2 + whichica = 'weights'; +end; +switch lower(whichica) + case {'weights' 'inv'}, ; + otherwise error('Unrecognized option for ''whichica'' parameter'); +end; + +if nargin < 3 + % ask user + [filename, filepath] = uiputfile('*.*', [ 'File name for ' ... + fastif(strcmpi(whichica, 'inv'), 'inverse', 'weight') ' matrix -- pop_expica()']); + drawnow; + if filename == 0 return; end; + filename = [filepath filename]; +end; + +% save datas +% ---------- +if strcmpi(whichica, 'inv') + tmpmat = double(EEG.icawinv); +else + tmpmat = double(EEG.icaweights*EEG.icasphere); +end; +save(filename, '-ascii', 'tmpmat'); + +com = sprintf('pop_expica(%s, ''%s'', ''%s'');', inputname(1), whichica, filename); + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_export.m b/code/eeglab13_4_4b/functions/popfunc/pop_export.m new file mode 100644 index 0000000..5b2767c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_export.m @@ -0,0 +1,208 @@ +% pop_export() - export EEG dataset +% +% Usage: +% >> com = pop_export(EEG); % a window pops up +% >> com = pop_export(EEG, filename, 'key', 'val', ... ); +% +% Inputs: +% EEG - eeglab dataset +% filename - file name +% +% Optional inputs: +% 'ica' - ['on'|'off'] export ICA activities (or ERP). Default 'off'. +% 'time' - ['on'|'off'] include time values. Default 'on'. +% 'timeunit' - [float] time unit rel. to seconds. Default: 1E-3 = msec. +% 'elec' - ['on'|'off'] include electrodes names or component numbers. +% Default 'on'. +% 'transpose' - ['on'|'off'] 'off'-> electrode data = rows; 'on' -> electrode +% data = columns. Default 'off'. +% 'erp' - ['on'|'off'] export ERP instead of raw data. Default 'off'. +% 'expr' - [string] evaluate epxression on data. The expression must +% contain a variable 'x' representing the 2-D or 3-D +% data. For example "x = 2*x" to multiply the data by 2. +% 'precision' - [float] number of significant digits in output. Default 7. +% Default of 7 should allow to reach about 23 to 24 bits +% of precision and should be enough for EEG. +% +% Outputs: +% com - The expresion that execute this function. i.e. 'pop_export(MyEEG, 'ExpEEG.mat')' +% +% Note: tabulation are used as a delimiter. +% +% Author: Arnaud Delorme, CNL / Salk Institute, May 13, 2003 + +% Copyright (C) May 13, 2003, Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function com = pop_export(EEG, filename, varargin); + +com = ''; +if nargin < 1 + help pop_export; + return; +end; + +if nargin < 2 + commandload = [ '[filename, filepath] = uiputfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''tagedit''), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + + uilist = { { 'style' 'text' 'string' 'Output file name' }, ... + { 'style' 'edit' 'string' '' 'tag' 'tagedit' }, ... + { 'style' 'pushbutton' 'string' 'Browse' 'callback' commandload },... + { 'style' 'text' 'string' 'Export ICA activities instead of EEG data:' }, ... + { 'style' 'checkbox' 'string' '' }, { },{ }, ... + { 'style' 'text' 'string' 'Export ERP average instead of trials:' }, ... + { 'style' 'checkbox' 'string' '' }, { }, { }, ... + { 'style' 'text' 'string' 'Transpose matrix (elec -> rows):' }, ... + { 'style' 'checkbox' 'string' '' }, { }, { }, ... + { 'style' 'text' 'string' 'Export channel labels/component numbers:' }, ... + { 'style' 'checkbox' 'string' '' 'value' 1 }, { }, { }, ... + { 'style' 'text' 'string' 'Export time values:' }, ... + { 'style' 'checkbox' 'string' '' 'value' 1 }, ... + { 'style' 'text' 'string' 'Unit (re. sec)' }, { 'style' 'edit' 'string' '1E-3' }, ... + { 'style' 'text' 'string' 'Number of significant digits to output:' }, ... + { 'style' 'edit' 'string' '4' }, { }, { }, ... + { 'style' 'text' 'string' 'Apply an expression to the output (see ''expr'' help):'} , ... + { 'style' 'edit' 'string' '' } { } { } }; + bcheck = [1.7 0.25 0.7 0.6]; + uigeom = { [1 2 0.5] bcheck bcheck bcheck bcheck bcheck [3 0.7 0.8 0.6] [3 2 0.05 0.05] }; + result = inputgui( uigeom, uilist, 'pophelp(''pop_export'');', 'Export data - pop_export()' ); + if length( result ) == 0 return; end; + + % decode options + % -------------- + if isempty(result{1}), error('File name required'); end; + filename = result{1}; + options = {}; + if result{2}, options = { options{:} 'ica' 'on' }; end; + if result{3}, options = { options{:} 'erp' 'on' }; end; + if result{4}, options = { options{:} 'transpose' 'on' }; end; + if ~result{5}, options = { options{:} 'elec' 'off' }; end; + if ~result{6}, options = { options{:} 'time' 'off' }; end; + if ~strcmpi(result{7}, '1E-3'), options = { options{:} 'timeunit' eval(result{7}) }; end; + if ~strcmpi(result{8}, '7'), options = { options{:} 'precision' eval(result{8}) }; end; + if ~isempty(result{9}), options = { options{:} 'expr' result{9} }; end; +else + options = varargin; +end; + +% test inputs +% ----------- +g = finputcheck(options, { ... + 'ica' 'string' { 'on';'off' } 'off'; + 'time' 'string' { 'on';'off' } 'on'; + 'timeunit' 'float' [0 Inf] 1E-3; + 'elec' 'string' { 'on';'off' } 'on'; + 'transpose' 'string' { 'on';'off' } 'off'; + 'erp' 'string' { 'on';'off' } 'off'; + 'precision' 'integer' [0 Inf] 7; + 'expr' 'string' [] '' }, 'pop_export'); +if isstr(g), error(g); end; + +% select data +% ---------- +if strcmpi(g.ica, 'on'); + eeglab_options; % changed from eeglaboptions 3/30/02 -sm + if option_computeica + x = EEG.icaact; + else + x = EEG.icaweights*EEG.icasphere*reshape(EEG.data(EEG.icachansind,:,:), length(EEG.icachansind), EEG.trials*EEG.pnts); + x = reshape(x, size(x,1), EEG.pnts, EEG.trials); + end; +else + x = EEG.data; +end; + +% select erp +% ---------- +if strcmpi(g.erp, 'on'); + x = mean(x, 3); +else + x = reshape(x, size(x,1), size(x,2)*size(x,3)); +end; + +% write data +% ---------- +if ~isempty(g.expr) + eval([ g.expr ';' ]); +end; + +% add time axis +% ------------- +if strcmpi(g.time, 'on'); + timeind = repmat( linspace(EEG.xmin, EEG.xmax, EEG.pnts)/g.timeunit, ... + [ 1 fastif(strcmpi(g.erp,'on'), 1, EEG.trials) ]); + xx = zeros(size(x,1)+1, size(x,2)); + xx(1,:) = timeind; + xx(2:end,:) = x; + x = xx; clear xx; +end + +% transpose and write to disk +% --------------------------- +fid = fopen(filename, 'w'); +if strcmpi(g.transpose, 'on'); + % writing electrodes + % ------------------ + strprintf = ''; + for index = 1:size(x,1) + if strcmpi(g.time, 'on'), tmpind = index-1; + else tmpind = index; + end; + if strcmpi(g.elec, 'on') + if tmpind > 0 + if ~isempty(EEG.chanlocs) & ~strcmpi(g.ica, 'on') + fprintf(fid, '%s\t', EEG.chanlocs(tmpind).labels); + else fprintf(fid, '%d\t', tmpind); + end; + else + fprintf(fid, ' \t'); + end; + end; + strprintf = [ strprintf '%.' num2str(g.precision) 'f\t' ]; + end; + strprintf(end) = 'n'; + if strcmpi(g.elec, 'on'), fprintf(fid, '\n'); end; + fprintf(fid, strprintf, x); +else + % writing electrodes + % ------------------ + for index = 1:size(x,1) + if strcmpi(g.time, 'on'), tmpind = index-1; + else tmpind = index; + end; + if strcmpi(g.elec, 'on') + if tmpind > 0 + if ~isempty(EEG.chanlocs) & ~strcmpi(g.ica, 'on') + fprintf(fid,'%s\t', EEG.chanlocs(tmpind).labels); + else fprintf(fid,'%d\t', tmpind); + end; + else + fprintf(fid, ' \t'); + end; + end; + fprintf(fid,[ '%.' num2str(g.precision) 'f\t' ], x(index, :)); + fprintf(fid, '\n'); + end; +end; +fclose(fid); + +com = sprintf('pop_export(%s,%s);', inputname(1), vararg2str({ filename, options{:} })); +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_fileio.m b/code/eeglab13_4_4b/functions/popfunc/pop_fileio.m new file mode 100644 index 0000000..0467ba5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_fileio.m @@ -0,0 +1,180 @@ +% pop_fileio() - import data files into EEGLAB using FileIO +% +% Usage: +% >> OUTEEG = pop_fileio; % pop up window +% >> OUTEEG = pop_fileio( filename ); +% +% Inputs: +% filename - [string] file name +% +% Optional inputs: +% 'channels' - [integer array] list of channel indices +% 'samples' - [min max] sample point limits for importing data. +% 'trials' - [min max] trial's limit for importing data. +% 'memorymapped' - ['on'|'off'] import memory mapped file (useful if +% encountering memory errors). Default is 'off'. +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2008- +% +% Note: FILEIO toolbox must be installed. + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_fileio(filename, varargin); +EEG = []; +command = ''; + +if ~plugin_askinstall('Fileio', 'ft_read_data'), return; end; + +if nargin < 1 + % ask user + ButtonName = questdlg2('Do you want to import a file or a folder?', ... + 'FILE-IO import', ... + 'Folder', 'File', 'File'); + if strcmpi(ButtonName, 'file') + [filename, filepath] = uigetfile('*.*', 'Choose a file or header file -- pop_fileio()'); + drawnow; + if filename(1) == 0 return; end; + filename = fullfile(filepath, filename); + else + filename = uigetfile('*.*', 'Choose a folder -- pop_fileio()'); + drawnow; + if filename(1) == 0 return; end; + end; + + % open file to get infos + % ---------------------- + eeglab_options; + mmoval = option_memmapdata; + disp('Reading data file header...'); + dat = ft_read_header(filename); + uilist = { { 'style' 'text' 'String' 'Channel list (defaut all):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' [ 'Data range (in sample points) (default all [1 ' int2str(dat.nSamples) '])' ] } ... + { 'style' 'edit' 'string' '' } }; + geom = { [3 1] [3 1] }; + if dat.nTrials > 1 + uilist{end+1} = { 'style' 'text' 'String' [ 'Trial range (default all [1 ' int2str(dat.nTrials) '])' ] }; + uilist{end+1} = { 'style' 'edit' 'string' '' }; + geom = { geom{:} [3 1] }; + end; + uilist = { uilist{:} { 'style' 'checkbox' 'String' 'Import as memory mapped file (use in case of out of memory error)' 'value' option_memmapdata } }; + geom = { geom{:} [1] }; + + result = inputgui( geom, uilist, 'pophelp(''pop_fileio'')', 'Load data using FILE-IO -- pop_fileio()'); + if length(result) == 0 return; end; + + options = {}; + if length(result) == 3, result = { result{1:2} '' result{3}}; end; + if ~isempty(result{1}), options = { options{:} 'channels' eval( [ '[' result{1} ']' ] ) }; end; + if ~isempty(result{2}), options = { options{:} 'samples' eval( [ '[' result{2} ']' ] ) }; end; + if ~isempty(result{3}), options = { options{:} 'trials' eval( [ '[' result{3} ']' ] ) }; end; + if result{4}, options = { options{:} 'memorymapped' fastif(result{4}, 'on', 'off') }; end; + +else + dat = ft_read_header(filename); + options = varargin; +end; + +% decode imput parameters +% ----------------------- +g = finputcheck( options, { 'samples' 'integer' [1 Inf] []; + 'trials' 'integer' [1 Inf] []; + 'channels' 'integer' [1 Inf] []; + 'memorymapped' 'string' { 'on';'off' } 'off' }, 'pop_fileio'); +if isstr(g), error(g); end; + +% import data +% ----------- +EEG = eeg_emptyset; +fprintf('Reading data ...\n'); +dataopts = {}; +if ~isempty(g.samples ), dataopts = { dataopts{:} 'begsample', g.samples(1), 'endsample', g.samples(2)}; end; +if ~isempty(g.trials ), dataopts = { dataopts{:} 'begtrial', g.trials(1), 'endtrial', g.trials(2)}; end; +if strcmpi(g.memorymapped, 'off') + if ~isempty(g.channels), dataopts = { dataopts{:} 'chanindx', g.channels }; end; + alldata = ft_read_data(filename, 'header', dat, dataopts{:}); +else + % read memory mapped file + g.datadims = [ dat.nChans dat.nSamples dat.nTrials ]; + disp('Importing as memory mapped array, this may take a while...'); + if isempty(g.channels), g.channels = [1:g.datadims(1)]; end; + if ~isempty(g.samples ), g.datadims(2) = g.samples(2) - g.samples(1); end; + if ~isempty(g.trials ), g.datadims(3) = g.trials(2) - g.trials(1); end; + g.datadims(1) = length(g.channels); + alldata = mmo([], g.datadims); + for ic = 1:length(g.channels) + alldata(ic,:,:) = ft_read_data(filename, 'header', dat, dataopts{:}, 'chanindx', g.channels(ic)); + end; +end; + +% convert to seconds for sread +% ---------------------------- +EEG.srate = dat.Fs; +EEG.nbchan = dat.nChans; +EEG.data = alldata; +EEG.setname = ''; +EEG.comments = [ 'Original file: ' filename ]; +EEG.xmin = -dat.nSamplesPre/EEG.srate; +EEG.trials = dat.nTrials; +EEG.pnts = dat.nSamples; +if isfield(dat, 'label') && ~isempty(dat.label) + EEG.chanlocs = struct('labels', dat.label); +end + +% extract events +% -------------- +disp('Reading events...'); +try + event = ft_read_event(filename); +catch, disp(lasterr); event = []; end; +if ~isempty(event) + subsample = 0; + + if ~isempty(g.samples), subsample = g.samples(1); end; + + for index = 1:length(event) + offset = fastif(isempty(event(index).offset), 0, event(index).offset); + EEG.event(index).type = event(index).value; + EEG.event(index).value = event(index).type; + EEG.event(index).latency = event(index).sample+offset+subsample; + EEG.event(index).duration = event(index).duration; + if EEG.trials > 1 + EEG.event(index).epoch = ceil(EEG.event(index).latency/EEG.pnts); + end; + end; + + EEG = eeg_checkset(EEG, 'eventconsistency'); +else + disp('Warning: no event found. Events might be embeded in a data channel.'); + disp(' To extract events, use menu File > Import Event Info > From data channel'); +end; + +% convert data to single if necessary +% ----------------------------------- +EEG = eeg_checkset(EEG,'makeur'); % Make EEG.urevent field + +% history +% ------- +if isempty(options) + command = sprintf('EEG = pop_fileio(''%s'');', filename); +else + command = sprintf('EEG = pop_fileio(''%s'', %s);', filename, vararg2str(options)); +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_fileiodir.m b/code/eeglab13_4_4b/functions/popfunc/pop_fileiodir.m new file mode 100644 index 0000000..0c4d4ee --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_fileiodir.m @@ -0,0 +1,76 @@ +% pop_fileiodir() - import directory into EEGLAB using FileIO +% +% Usage: +% >> OUTEEG = pop_fileiodir; % pop up window +% >> OUTEEG = pop_fileiodir( folder ); +% +% Inputs: +% folder - [string] folder name +% +% Optional inputs: +% 'channels' - [integer array] list of channel indices +% 'samples' - [min max] sample point limits for importing data. +% 'trials' - [min max] trial's limit for importing data. +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2012- +% +% Note: FILEIO toolbox must be installed. + +% Copyright (C) 2012 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_fileiodir(folder, varargin); +EEG = []; +command = ''; + +if nargin < 1 + % ask user + folder = uigetdir('*.*', 'Choose a directory -- pop_fileiodir()'); + if folder == 0 return; end; + drawnow; + + % open file to get infos + % ---------------------- + disp('Reading data file header...'); + dat = ft_read_header(folder); + uilist = { { 'style' 'text' 'String' 'Channel list (defaut all):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' [ 'Data range (in sample points) (default all [1 ' int2str(dat.nSamples) '])' ] } ... + { 'style' 'edit' 'string' '' } }; + geom = { [3 1] [3 1] }; + if dat.nTrials > 1 + uilist{end+1} = { 'style' 'text' 'String' [ 'Trial range (default all [1 ' int2str(dat.nTrials) '])' ] }; + uilist{end+1} = { 'style' 'edit' 'string' '' }; + geom = { geom{:} [3 1] }; + end; + result = inputgui( geom, uilist, 'pophelp(''pop_fileiodir'')', 'Load data using FILE-IO -- pop_fileiodir()'); + if length(result) == 0 return; end; + + options = {}; + result = { result{:} '' }; + if ~isempty(result{1}), options = { options{:} 'channels' eval( [ '[' result{1} ']' ] ) }; end; + if ~isempty(result{2}), options = { options{:} 'samples' eval( [ '[' result{2} ']' ] ) }; end; + if ~isempty(result{3}), options = { options{:} 'trials' eval( [ '[' result{3} ']' ] ) }; end; +else + dat = ft_read_header(folder); + options = varargin; +end; + +[EEG command] = pop_fileio(folder, options{:}); + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_headplot.m b/code/eeglab13_4_4b/functions/popfunc/pop_headplot.m new file mode 100644 index 0000000..55aa831 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_headplot.m @@ -0,0 +1,504 @@ +% pop_headplot() - plot one or more spherically-splined EEG field maps +% using a semi-realistic 3-D head model. Requires a +% spline file, which is created first if not found. +% This may take some time, but does not need to be +% done again for this channel locations montage. A wait +% bar will pop up to indicate how much time remains. +% Usage: +% To open input GUI: +% >> EEGOUT = pop_headplot( EEG, typeplot) +% To run as a script without further GUI input: +% >> EEGOUT = pop_headplot( EEG, typeplot, ... +% latencies/components, title, rowscols, 'key', 'val' ...); +% Required Inputs: +% EEG - EEG dataset structure +% typeplot - 1=channel, 0=component {Default: 1} +% +% Required Inputs to bypass input GUI +% latencies/components - If channels, array of epoch mean latencies (in ms), +% Else, for components, array of component indices to plot. +% +% Optional inputs: +% title - Plot title +% rowscols - Vector of the form [m,n] where m is total vertical tiles and n +% horizontal tiles per page. If the number of maps exceeds m*n, +% multiple figures will be produced {def|0 -> 1 near-square page} +% +% Optional 'Key' 'Value' Paired Inputs +% 'setup' - ['name_of_file_to_save.spl'] Make the headplot spline file +% 'load' - ['name_of_file_to_load.spl'] Load the headplot spline file +% 'colorbar' - ['on' or 'off'] Switch to turn colorbar on or off. {Default: 'on'} +% others... - All other key-val calls are passed directly to headplot. +% See >> help headplot +% +% Output: +% EEGOUT - EEG dataset, possibly with a new or modified splinefile. +% +% Note: +% A new figure is created only when the pop_up window is called or when +% several channels/components are plotted. Therefore you may call this +% command to draw single 3-D topographic maps in an existing figure. +% +% Headplot spline file is a matlab .mat file with the extension .spl. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 20 March 2002 +% +% See also: headplot(), eegplot(), traditional() + +% Copyright (C) 20 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_headplot( EEG, typeplot, arg2, topotitle, rowcols, varargin); + +com = ''; +if nargin < 1 + help pop_headplot; + return; +end; + +if isempty(EEG.chanlocs) + error('Pop_headplot: this dataset does not contain channel locations. Use menu item: Edit > Dataset info'); +end; + +if nargin < 3 % Open GUI input window + % remove old spline file + % ---------------------- + if isfield(EEG, 'splinefile') + if ~isempty(EEG.splinefile) && exist(EEG.splinefile, 'file') + splfile = dir(EEG.splinefile); + byteperelec = splfile.bytes/EEG.nbchan; + if byteperelec/EEG.nbchan < 625, % old head plot file + EEG.splinefile = []; + disp('Warning: Wrong montage or old-version spline file version detected and removed; new spline file required'); + end; + end; + end; + + % show the file be recomputed + % --------------------------- + compute_file = 0; + if typeplot == 1 % ********** data plot + fieldname = 'splinefile'; + if isempty(EEG.splinefile) && exist(EEG.splinefile, 'file') + if length(EEG.icachansind) == EEG.nbchan & ~isempty(EEG.icasplinefile) + EEG.splinefile = EEG.icasplinefile; + else + compute_file = 1; + end; + else + compute_file = 1; + end; + else % ************* Component plot + fieldname = 'icasplinefile'; + if isempty(EEG.icasplinefile) && exist(EEG.icasplinefile, 'file') + if length(EEG.icachansind) == EEG.nbchan & ~isempty(EEG.splinefile) + EEG.icasplinefile = EEG.splinefile; + else + compute_file = 1; + end; + else + compute_file = 1; + end; + end; + + if compute_file + + warndlg2( strvcat('headplot() must generate a spline file the first', ... + 'time it is called or after changes in the channel location file.', ... + 'You must also co-register your channel locations with the', ... + 'head template. Using a standard 10-20 system montage, default', ... + 'parameters should allow creating the correct spline file.'), 'Headplot() warning'); + else + pop_options = {}; + end; + + % graphic interface + % ----------------- + template(1).keywords = { 'standard-10-5-cap385' }; + template(1).transform = [ -0.355789 -6.33688 12.3705 0.0533239 0.0187461 -1.55264 1.06367 0.987721 0.932694 ]; + %template(1).transform = [ -0.31937 -5.96928 13.1812 0.0509311 0.0172127 -1.55007 1.08221 1.00037 0.923518 ]; + template(2).keywords = { 'standard_1005' }; + template(2).transform = [ -1.13598 7.75226 11.4527 -0.0271167 0.0155306 -1.54547 0.912338 0.931611 0.806978 ]; +% -0.732155 7.58141 11.8939 -0.0249659 0.0148571 0.0227427 0.932423 0.918943 0.793166 ]; + template(3).keywords = { 'gsn' 'sfp' }; + %template(3).transform = [ 0 -9 -9 -0.12 0 -1.6 9.7 10.7 11.5 ]; + template(3).transform = [ 0.664455 -3.39403 -14.2521 -0.00241453 0.015519 -1.55584 11 10.1455 12]; + template(4).keywords = { 'egi' 'elp' }; + template(4).transform = [ 0.0773 -5.3235 -14.72 -0.1187 -0.0023 -1.5940 92.4 92.5 110.9 ]; + + transform = []; + if isfield(EEG.chaninfo, 'filename') + [tmp transform] = lookupchantemplate(lower(EEG.chaninfo.filename), template); + end; + + if typeplot + txt = sprintf('Making headplots for these latencies (from %d to %d ms):', round(EEG.xmin*1000), round(EEG.xmax*1000)); + else + %txt = ['Component numbers (negate index to invert component polarity):' 10 '(NaN -> empty subplot)(Ex: -1 NaN 3)']; + txt = ['Component numbers to plot (negative numbers invert comp. polarities):' ]; + end; + if compute_file + enableload = 'off'; + enablecomp = 'on'; + else + enableload = 'on'; + enablecomp = 'off'; + end; + cb_load = [ 'set(findobj(gcbf, ''tag'', ''load''), ''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''comp''), ''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''compcb''), ''value'', 0);' ]; + cb_comp = [ 'set(findobj(gcbf, ''tag'', ''load''), ''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''comp''), ''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''loadcb''), ''value'', 0);' ]; + cb_browseload = [ '[filename, filepath] = uigetfile(''*.spl'', ''Select a spline file'');' ... + 'if filename ~=0,' ... + ' set(findobj( gcbf, ''userdata'', ''load''), ''string'', fullfile(filepath,filename));' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + cb_browsecomp = [ '[filename, filepath] = uiputfile(''*.spl'', ''Select a spline file'');' ... + 'if filename ~=0,' ... + ' set(findobj( gcbf, ''userdata'', ''coregfile''), ''string'', fullfile(filepath,filename));' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + cb_browsemesh = [ '[filename, filepath] = uigetfile(''*.spl'', ''Select a spline file'');' ... + 'if filename ~=0,' ... + ' set(findobj( gcbf, ''userdata'', ''meshfile''), ''style'', ''edit'', ''callback'', '''', ''string'', fullfile(filepath,filename));' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + cb_browsemeshchan = [ '[filename, filepath] = uigetfile(''*.spl'', ''Select a spline file'');' ... + 'if filename ~=0,' ... + ' set(findobj( gcbf, ''userdata'', ''meshchanfile''), ''style'', ''edit'', ''callback'', '''', ''string'', fullfile(filepath,filename));' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + cb_selectcoreg = [ 'tmpmodel = get( findobj(gcbf, ''userdata'', ''meshfile'') , ''string''); tmpmodel = tmpmodel{get( findobj(gcbf, ''userdata'', ''meshfile'') , ''value'')};' ... + 'tmploc2 = get( findobj(gcbf, ''userdata'', ''meshchanfile''), ''string''); tmploc2 = tmploc2{ get( findobj(gcbf, ''userdata'', ''meshchanfile'') , ''value'')};' ... + 'tmploc1 = get( gcbo, ''userdata'');' ... + 'tmptransf = get( findobj(gcbf, ''userdata'', ''coregtext''), ''string'');' ... + '[tmp tmptransf] = coregister(tmploc1{1}, tmploc2, ''mesh'', tmpmodel, ''helpmsg'', ''on'',' ... + ' ''chaninfo1'', tmploc1{2}, ''transform'', str2num(tmptransf));' ... + 'if ~isempty(tmptransf), set( findobj(gcbf, ''userdata'', ''coregtext''), ''string'', num2str(tmptransf)); end;' ... + 'clear tmpmodel tmploc2 tmploc1 tmp tmptransf;' ]; + cb_helpload = [ 'warndlg2(strvcat(''If you have already generated a spline file for this channel location'',' ... + '''structure, you may enter it here. Click on the "Use existing spline file or'',' ... + '''structure" to activate the edit box first.''), ''Load file for headplot()'');' ]; + cb_helpcoreg = [ 'warndlg2(strvcat(''Your channel locations must be co-registered with a 3-D head mesh to be plotted.'',' ... + '''If you are using one of the template location files, the "Talairach transformation matrix"'',' ... + '''field will be filled automatically (just enter an output file name and press "OK").'',' ... + '''Otherwise press the "Manual coreg." button to perform co-registration.''), ''Load file for headplot()'');' ]; + cb_selectmesh = [ 'set(findobj(gcbf, ''userdata'', ''meshchanfile''), ''value'', get(gcbo, ''value''));' ... + 'set(findobj(gcbf, ''userdata'', ''meshfile'') , ''value'', get(gcbo, ''value''));' ... + 'tmpdat = get(gcbf, ''userdata'');' ... + 'set(findobj(gcbf, ''userdata'', ''coregtext''), ''string'', num2str(tmpdat{get(gcbo, ''value'')}));' ]; + defaultmat = { 'mheadnew.mat' 'colin27headmesh.mat' }; + defaultloc = { 'mheadnew.xyz' 'colin27headmesh.xyz' }; + defaulttransform = { transform [0 -15 10 0.05 0 -1.57 1.25 1.1 1] }; + if iseeglabdeployed + defaultmat = fullfile(eeglabexefolder, defaultmat); + defaultloc = fullfile(eeglabexefolder, defaultloc); + end; + userdatatmp = { EEG.chanlocs EEG.chaninfo }; + txt = { { 'style' 'text' 'string' 'Co-register channel locations with head mesh and compute a mesh spline file (each scalp montage needs a headplot() spline file)' 'fontweight' 'bold' } ... + { 'style' 'checkbox' 'string' 'Use the following spline file or structure' 'userdata' 'loadfile' 'tag' 'loadcb' 'callback' cb_load 'value' ~compute_file } ... + { 'style' 'edit' 'string' fastif(typeplot, EEG.splinefile, EEG.icasplinefile) 'userdata' 'load' 'tag' 'load' 'enable' enableload } ... + { 'style' 'pushbutton' 'string' 'Browse' 'callback' cb_browseload 'tag' 'load' 'enable' enableload } ... + { 'style' 'pushbutton' 'string' 'Help' 'callback' cb_helpload } ... + { 'style' 'checkbox' 'string' 'Or (re)compute a new spline file named:' 'tag' 'compcb' 'callback' cb_comp 'value' compute_file } ... + { 'style' 'edit' 'string' [fullfile(pwd, EEG.filename(1:length(EEG.filename)-3)),'spl'] 'userdata' 'coregfile' 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'pushbutton' 'string' 'Browse' 'callback' cb_browsecomp 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'pushbutton' 'string' 'Help' 'callback' cb_helpcoreg } ... + { 'style' 'text' 'string' ' 3-D head mesh file' 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'popupmenu' 'string' defaultmat 'userdata' 'meshfile' 'callback' cb_selectmesh 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'pushbutton' 'string' 'Browse other' 'callback' cb_browsemesh 'tag' 'comp' 'enable' enablecomp } ... + { } ... + { 'style' 'text' 'string' ' Mesh associated channel file' 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'popupmenu' 'string' defaultloc 'userdata' 'meshchanfile' 'callback' cb_selectmesh 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'pushbutton' 'string' 'Browse other' 'callback' cb_browsemeshchan 'tag' 'comp' 'enable' enablecomp } ... + { } ... + { 'style' 'text' 'string' ' Talairach-model transformation matrix' 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'edit' 'string' num2str(transform) 'userdata' 'coregtext' 'tag' 'comp' 'enable' enablecomp } ... + { 'style' 'pushbutton' 'string' 'Manual coreg.' 'callback' cb_selectcoreg 'userdata' userdatatmp 'tag' 'comp' 'enable' enablecomp } ... + { } ... + { } ... + { 'style' 'text' 'string' 'Plot interpolated activity onto 3-D head' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' txt } ... + { 'style' 'edit' 'string' fastif( typeplot, '', ['1:' int2str(size(EEG.data,1))] ) } { } ... + { 'style' 'text' 'string' 'Plot title:' } ... + { 'style' 'edit' 'string' [ fastif( typeplot, 'ERP scalp maps of dataset:', 'Components of dataset: ') ... + fastif(~isempty(EEG.setname), EEG.setname, '') ] } { } ... + { 'style' 'text' 'string' 'Plot geometry (rows,columns): (Default [] = near square)' } ... + { 'style' 'edit' 'string' '' } { } ... + { 'style' 'text' 'string' 'Other headplot options (See >> help headplot):' } ... + { 'style' 'edit' 'string' '' } { } }; + + % plot GUI and protect parameters + % ------------------------------- + geom = { [1] [1.3 1.6 0.5 0.5 ] [1.3 1.6 0.5 0.5 ] [1.3 1.6 0.6 0.4 ] [1.3 1.6 0.6 0.4 ] [1.3 1.6 0.6 0.4 ] ... + [1] [1] [1.5 1 0.5] [1.5 1 0.5] [1.5 1 0.5] [1.5 1 0.5] }; + optiongui = { 'uilist', txt, 'title', fastif( typeplot, 'ERP head plot(s) -- pop_headplot()', ... + 'Component head plot(s) -- pop_headplot()'), 'geometry', geom 'userdata' defaulttransform }; + [result, userdat2, strhalt, outstruct] = inputgui( 'mode', 'noclose', optiongui{:}); + if isempty(result), return; end; + if ~isempty(get(0, 'currentfigure')) currentfig = gcf; else return; end; + + while test_wrong_parameters(currentfig) + [result, userdat2, strhalt, outstruct] = inputgui( 'mode', currentfig, optiongui{:}); + if isempty(result), return; end; + end; + close(currentfig); + + % decode setup parameters + % ----------------------- + options = {}; + if result{1}, options = { options{:} 'load' result{2} }; + else + if ~isstr(result{5}) result{5} = defaultmat{result{5}}; end; + if isempty(result{7}) setupopt = { result{4} 'meshfile' result{5} }; % no coreg + else setupopt = { result{4} 'meshfile' result{5} 'transform' str2num(result{7}) }; + fprintf('Transformation matrix: %s\n', result{7}); + end; + options = { options{:} 'setup' setupopt }; + if ~strcmpi(result{5}, 'mheadnew.mat'), EEG.headplotmeshfile = result{5}; end; + end; + + % decode other parameters + % ----------------------- + arg2 = eval( [ '[' result{8} ']' ] ); + if length(arg2) > EEG.nbchan + tmpbut = questdlg2(['This will draw ' int2str(length(arg2)) ' plots. Continue ?'], '', 'Cancel', 'Yes', 'Yes'); + if strcmp(tmpbut, 'Cancel'), return; end; + end; + if length(arg2) == 0, error('please choose a latency(s) to plot'); end + topotitle = result{9}; + rowcols = eval( [ '[ ' result{10} ' ]' ] ); + tmpopts = eval( [ '{ ' result{11} ' }' ] ); + if ~isempty(tmpopts) + options = { options{:} tmpopts{:} }; + end; + if size(arg2(:),1) == 1, figure; end; +else % Pass along parameters and bypass GUI input + options = varargin; +end; + +% Check if pop_headplot input 'colorbar' was called, and don't send it to headplot +loc = strmatch('colorbar', options(1:2:end), 'exact'); +loc = loc*2-1; +if ~isempty(loc) + colorbar_switch = strcmp('on',options{ loc+1 }); + options(loc:loc+1) = []; +else + colorbar_switch = 1; +end + +% read or generate file if necessary +% ---------------------------------- +pop_options = options; +loc = strmatch('load', options(1:2:end)); loc = loc*2-1; +if ~isempty(loc) + if typeplot + EEG.splinefile = options{ loc+1 }; + else + EEG.icasplinefile = options{ loc+1 }; + end; + options(loc:loc+1) = []; +end; +loc = strmatch('setup', options(1:2:end)); loc = loc*2-1; +if ~isempty(loc) + if typeplot + headplot('setup', EEG.chanlocs, options{loc+1}{1}, 'chaninfo', EEG.chaninfo, options{ loc+1 }{2:end}); + EEG.splinefile = options{loc+1}{1}; + else + headplot('setup', EEG.chanlocs, options{loc+1}{1}, 'chaninfo', EEG.chaninfo, 'ica', 'on', options{ loc+1 }{2:end}); + EEG.icasplinefile = options{loc+1}{1}; + end; + options(loc:loc+1) = []; + compute_file = 1; +else + compute_file = 0; +end; + +% search for existing file if necessary +% ------------------------------------- +if typeplot == 1 % ********** data plot + fieldname = 'splinefile'; + if isempty(EEG.splinefile) + if length(EEG.icachansind) == EEG.nbchan & ~isempty(EEG.icasplinefile) + EEG.splinefile = EEG.icasplinefile; + end; + end; +else % ************* Component plot + fieldname = 'icasplinefile'; + if isempty(EEG.icasplinefile) + if length(EEG.icachansind) == EEG.nbchan & ~isempty(EEG.splinefile) + EEG.icasplinefile = EEG.splinefile; + end; + end; +end; + +% headplot mesh file +% ------------------ +if isfield(EEG, 'headplotmeshfile') + if ~isempty(EEG.headplotmeshfile) + options = { options{:} 'meshfile' EEG.headplotmeshfile }; + end; +end; + +% check parameters +% ---------------- +if ~exist('topotitle') + topotitle = ''; +end; +if typeplot + if isempty(EEG.splinefile) + error('Pop_headplot: cannot find spline file, aborting...'); + end; +else + if isempty(EEG.icasplinefile) + error('Pop_headplot: cannot find spline file, aborting...'); + end; +end; +SIZEBOX = 150; +nbgraph = size(arg2(:),1); +if ~exist('rowcols') | isempty(rowcols) | rowcols == 0 + rowcols(2) = ceil(sqrt(nbgraph)); + rowcols(1) = ceil(nbgraph/rowcols(2)); +end; + +fprintf('Plotting...\n'); + +% determine the scale for plot of different times (same scales) +% ------------------------------------------------------------- +if typeplot + SIGTMP = reshape(EEG.data, EEG.nbchan, EEG.pnts, EEG.trials); + pos = round( (arg2/1000-EEG.xmin)/(EEG.xmax-EEG.xmin) * (EEG.pnts-1))+1; + indexnan = find(isnan(pos)); + nanpos = find(isnan(pos)); + pos(nanpos) = 1; + SIGTMPAVG = mean(SIGTMP(:,pos,:),3); + SIGTMPAVG(:, nanpos) = NaN; + maxlim = max(SIGTMPAVG(:)); + minlim = min(SIGTMPAVG(:)); + maplimits = max(maxlim, -minlim); + maplimits = maplimits*1.1; + maplimits = [ -maplimits maplimits ]; +else + maplimits = [-1 1]; +end; + +% plot the graphs +% --------------- +counter = 1; +disp('IMPORTANT NOTICE: electrodes are projected to the head surface so their location'); +disp(' might slightly differ from the one they had during coregistration '); +for index = 1:size(arg2(:),1) + if nbgraph > 1 + if mod(index, rowcols(1)*rowcols(2)) == 1 + if index> 1, a = textsc(0.5, 0.05, topotitle); set(a, 'fontweight', 'bold'); end; + figure; + pos = get(gcf,'Position'); + posx = max(0, pos(1)+(pos(3)-SIZEBOX*rowcols(2))/2); + posy = pos(2)+pos(4)-SIZEBOX*rowcols(1); + set(gcf,'Position', [posx posy SIZEBOX*rowcols(2) SIZEBOX*rowcols(1)]); + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + end; + subplot( rowcols(1), rowcols(2), mod(index-1, rowcols(1)*rowcols(2))+1); + end; + + if ~isnan(arg2(index)) + if typeplot + headplot( SIGTMPAVG(:,index), EEG.splinefile, 'maplimits', maplimits, options{:}); + if nbgraph == 1, title( topotitle ); + else title([int2str(arg2(index)) ' ms']); + end; + else + if arg2(index) < 0 + headplot( -EEG.icawinv(:, -arg2(index)), EEG.icasplinefile, options{:}); + else + headplot( EEG.icawinv(:, arg2(index)), EEG.icasplinefile, options{:}); + end; + if nbgraph == 1, title( topotitle ); + else title(['' int2str(arg2(index))]); + end; + end; + drawnow; + axis equal; + rotate3d off; + else + axis off + end +end + +% Draw colorbar +if colorbar_switch + if nbgraph == 1 + ColorbarHandle = cbar(0,0,[maplimits(1) maplimits(2)]); + pos = get(ColorbarHandle,'position'); % move left & shrink to match head size + set(ColorbarHandle,'position',[pos(1)-.05 pos(2)+0.13 pos(3)*0.7 pos(4)-0.26]); + else + cbar('vert',0,[maplimits(1) maplimits(2)]); + end + if ~typeplot % Draw '+' and '-' instead of numbers for colorbar tick labels + tmp = get(gca, 'ytick'); + set(gca, 'ytickmode', 'manual', 'yticklabelmode', 'manual', 'ytick', [tmp(1) tmp(end)], 'yticklabel', { '-' '+' }); + end +end + +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + + +if nbgraph> 1, + a = textsc(0.5, 0.05, topotitle); + set(a, 'fontweight', 'bold'); + axcopy(gcf, [ 'set(gcf, ''''units'''', ''''pixels''''); postmp = get(gcf, ''''position'''');' ... + 'set(gcf, ''''position'''', [postmp(1) postmp(2) 560 420]); rotate3d(gcf); clear postmp;' ]); +end; + +% generate output command +% ----------------------- +com = sprintf('pop_headplot(%s, %d, %s, ''%s'', [%s], %s);', inputname(1), typeplot, vararg2str(arg2), ... + topotitle, int2str(rowcols), vararg2str( pop_options ) ); +if compute_file, com = [ 'EEG = ' com ]; end; +if nbgraph== 1, com = [ 'figure; ' com ]; rotate3d(gcf); end; + +return; + +% test for wrong parameters +% ------------------------- +function bool = test_wrong_parameters(hdl) + + bool = 0; + loadfile = get( findobj( hdl, 'userdata', 'loadfile') , 'value' ); + + textlines = ''; + if ~loadfile + coreg1 = get( findobj( hdl, 'userdata', 'coregtext') , 'string' ); + coreg3 = get( findobj( hdl, 'userdata', 'coregfile') , 'string' ); + if isempty(coreg1) + textlines = strvcat('You must co-register your channel locations with the head model.', ... + 'This is an easy process: Press the "Manual coreg." button in the', ... + 'right center of the pop_headplot() window and follow instructions.',... + 'To bypass co-registration (not recommended), enter', ... + '"0 0 0 0 0 0 1 1 1" as the "Tailairach transformation matrix.'); + bool = 1; + end; + if isempty(coreg3) + textlines = strvcat(textlines, ' ', 'You need to enter an output file name.'); + bool = 1; + end; + + if bool + warndlg2( textlines, 'Error'); + end; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_icathresh.m b/code/eeglab13_4_4b/functions/popfunc/pop_icathresh.m new file mode 100644 index 0000000..021632e --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_icathresh.m @@ -0,0 +1,286 @@ +% pop_icathresh() - main menu for choosing threshold for component +% rejection in EEGLAB. +% +% Usage: +% >> [OUTEEG rej] = pop_icathresh(INEEG, threshval, rejmethod, +% rejvalue, interact); +% +% Inputs: +% INEEG - input dataset +% threshval - values of thresholds for each of the 3 statistical +% measures. Default is [] and the program uses the value +% in the dataset. +% rejmethod - either 'percent', 'dataset' or 'current'. 'percent' +% will reject a given percentage of components with +% the highest value in one or several statistical +% measure. 'dataset' will use an other dataset for +% calibration. 'current' will use the current dataset +% for calibration. Default is 'current'. +% rejvalue - percentage if rejmethod is 'percent', dataset number +% if rejmethod is 'dataset' (no input if 'current'). If it +% is a percentage, '25' for instance means that the 25% +% independent components with the highest values of one +% statistical measure are rejected. Note that, one can +% also enter one percentage per statistical value (such as +% 25 20 30). +% interact - interactive windows or just rejection +% +% Inputs: +% OUTEEG - output dataset with updated thresholds +% rej - new rejection array +% +% Graphic interface: +% The graphic interface is divided into 3 parts. On the top, the +% experimenter chooses the basis for the component rejection (see +% rejmethod input). On the middle panel, the user can tune thresholds +% manually and plot the distribution of statistical values. Each time +% that setting of one of these two top panels is modified, the curve +% on the third panel are redrawn. +% The third panel is composed of 3 graphs, one for each statistical +% measure. The blue curve on each graph indicates the accuracy of the +% measure to detect artifactual components and non-artifactual +% components of a dataset. Note that 'artifactual components are +% defined with the rejection methods fields on the top (if you use +% the percentage methods, these artifactual components may not actually +% be artifactual). For accurate rejection, one should first reject +% artifactual component manually and then set up the threshold to +% approximate this manual rejection. The green curve indicate the +% rejection when all measure are considered. Points on the blue and +% on the green curves indicate the position of the current threshold on +% the parametric curve. Not that for the green cumulative curve, this +% point is at the same location for all graphs. +% How to tune the threshold? To tune the threshold, one should try to +% maximize the detection of non-artifactual components (because it is +% preferable to miss some artifactual components than to classify as +% artifactual non-artifact components). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%PROBLEM: when the % is set and we change manually yhe threshold, +% the software comes back to the percentage rejection + +% 01-25-02 reformated help & license -ad + +function [EEG, rej, com] = pop_icathresh( EEG, threshval, rejmethod, rejvalue, interact); + +com = []; +rej = EEG.reject.gcompreject; +if nargin < 1 + help pop_icathresh; + return; +end; + +if nargin < 2 + threshval = []; +end; +if nargin < 3 + rejmethod = 'current'; +end; +if nargin < 4 + rejvalue = 25; +end; +if nargin < 5 + interact = 1; +end; +if ~isempty(threshval) + EEG.reject.threshentropy = threshval(1); + EEG.reject.threshkurtact = threshval(2); + EEG.reject.threshkurtdist = threshval(3); +end; + +tagmenu = 'pop_icathresh'; + +if ~isempty( findobj('tag', tagmenu)) + error('cannot open two identical windows, close the first one first'); +end; + +% the current rejection will be stored in userdata of the figure +% -------------------------------------------------------------- +gcf = figure('visible', 'off', 'numbertitle', 'off', 'name', 'Choose thresholds', 'tag', tagmenu, 'userdata', rej); +pos = get(gca, 'position'); +q = [pos(1) pos(2) 0 0]; +s = [pos(3) pos(4) pos(3) pos(4)]./100; +axis off; + +% definition of callbacks +% ----------------------- + +cb_cancel = [ 'userdat = get(gcbo, ''userdata'');' ... % restore thresholds + 'EEG.reject.threshentropy = userdat{1};' ... + 'EEG.reject.threshkurtact = userdat{2};' ... + 'EEG.reject.threshkurtdist = userdat{3};' ... + 'clear userdat; close(gcbf);' ]; + +drawgraphs = [ 'if isempty( gcbf ), fig = gcf; else fig = gcbf; end;' ... % determine the figure handler + 'if get( findobj(''parent'', fig, ''tag'', ''Ipercent''), ''value'') == 1, ' ... % test if percentage + ' perc = str2num(get( findobj(''parent'', fig, ''tag'', ''Ipercenttext''), ''String''));' ... + ' if length(perc < 2), perc = [perc perc perc]; end;' ... + ' perc = round((100-perc) * length( EEG.stats.compenta) / 100);' ... % convert the percentage + ' method = zeros( size( EEG.stats.compenta ) );' ... + ' [tmprej tmpindex] = sort(EEG.stats.compenta(:));' ... + ' method( tmpindex(perc(1)+1:end) ) = 1;' ... + ' set( findobj(''parent'', fig, ''tag'', ''entstring''), ''string'', num2str(tmprej(perc(1)+1)));' ... % update threshold + ' [tmprej tmpindex] = sort(EEG.stats.compkurta(:));' ... + ' method( tmpindex(perc(2)+1:end) ) = 1;' ... + ' set( findobj(''parent'', fig, ''tag'', ''kurtstring''), ''string'', num2str(tmprej(perc(1)+1)));' ... % update threshold + ' [tmprej tmpindex] = sort(EEG.stats.compkurtdist(:));' ... + ' method( tmpindex(perc(3)+1:end) ) = 1;' ... + ' set( findobj(''parent'', fig, ''tag'', ''kurtdiststring''), ''string'', num2str(tmprej(perc(1)+1)));' ... % update threshold + ' allvalues = [EEG.stats.compenta(:) EEG.stats.compkurta(:) EEG.stats.compkurtdist(:) ];' ... + ' clear perc tmprej tmpindex;' ... + 'end;' ... + 'if get( findobj(''parent'', fig, ''tag'', ''Iother''), ''value'') == 1, ' ... % test if other dataset + ' di = str2num(get( findobj(''parent'', fig, ''tag'', ''Iothertext''), ''String''));' ... + ' if isempty( di ), clear fig; return; end;' ... + ' method = ALLEEG(di).reject.gcompreject'';' ... + ' allvalues = [ALLEEG(di).stats.compenta(:) ALLEEG(di).stats.compkurta(:) ALLEEG(di).stats.compkurtdist(:) ];' ... + ' clear di;' ... + 'end;' ... + 'if get( findobj(''parent'', fig, ''tag'', ''Icurrent''), ''value'') == 1, ' ... % test if current dataset + ' method = EEG.reject.gcompreject'';' ... + ' allvalues = [EEG.stats.compenta(:) EEG.stats.compkurta(:) EEG.stats.compkurtdist(:) ];' ... + 'end;' ... + 'axes( findobj( ''parent'', fig, ''tag'', ''graphent'')); cla;' ... + '[tmp1 tmp2 tmp3] = drawproba( method, allvalues, [0 EEG.reject.threshkurtact EEG.reject.threshkurtdist ], ' ... + ' { ''&'' ''|'' }, EEG.reject.threshentropy, ''Entropy of activity'',''Artifact detection (%)'', ''Non-artifact detection (%)'');' ... + 'set(gca, ''tag'', ''graphent'');' ... + 'axes( findobj( ''parent'', fig, ''tag'', ''graphkurt'')); cla;' ... + '[tmp1 tmp2 tmp3] = drawproba( method, allvalues, [EEG.reject.threshentropy 0 EEG.reject.threshkurtdist ], ' ... + ' { ''&'' ''|'' }, EEG.reject.threshkurtact, ''Kurtosis of activity'', ''Artifact detection (%)'', '''');' ... + 'set(gca, ''tag'', ''graphkurt'');' ... + 'axes( findobj( ''parent'', fig, ''tag'', ''graphkurtdist'')); cla;' ... + '[tmp1 tmp2 tmp3] = drawproba( method, allvalues, [EEG.reject.threshentropy EEG.reject.threshkurtact 0 ], ' ... + ' { ''&'' ''|'' }, EEG.reject.threshkurtdist, ''Kurtosis of topography'', ''Artifact detection (%)'', '''');' ... + 'set(gca, ''tag'', ''graphkurtdist'');' ... + 'clear method allvalues fig;' ... + ]; + +cb_percent = [ 'if isempty( gcbf ), fig = gcf; else fig = gcbf; end;' ... % determine the figure handler + 'set( findobj(''parent'', fig, ''tag'', ''Ipercent''), ''value'', 1);'... + 'set( findobj(''parent'', fig, ''tag'', ''Iother''), ''value'', 0);' ... + 'set( findobj(''parent'', fig, ''tag'', ''Icurrent''), ''value'', 0);' ... + 'set( findobj(''parent'', fig, ''tag'', ''Ipercenttext''), ''enable'', ''on'');' ... + 'set( findobj(''parent'', fig, ''tag'', ''Iothertext''), ''enable'', ''off''); clear fig;' drawgraphs ]; + +cb_other = [ 'if isempty( gcbf ), fig = gcf; else fig = gcbf; end;' ... % determine the figure handler + 'set( findobj(''parent'', fig, ''tag'', ''Iother''), ''value'', 1);'... + 'set( findobj(''parent'', fig, ''tag'', ''Ipercent''), ''value'', 0);' ... + 'set( findobj(''parent'', fig, ''tag'', ''Icurrent''), ''value'', 0);' ... + 'set( findobj(''parent'', fig, ''tag'', ''Ipercenttext''), ''enable'', ''off'');' ... + 'set( findobj(''parent'', fig, ''tag'', ''Iothertext''), ''enable'', ''on''); clear fig;' drawgraphs ]; + +cb_current = [ 'if isempty( gcbf ), fig = gcf; else fig = gcbf; end;' ... % determine the figure handler + 'set( findobj(''parent'', fig, ''tag'', ''Icurrent''), ''value'', 1);'... + 'set( findobj(''parent'', fig, ''tag'', ''Iother''), ''value'', 0);' ... + 'set( findobj(''parent'', fig, ''tag'', ''Ipercent''), ''value'', 0);' ... + 'set( findobj(''parent'', fig, ''tag'', ''Ipercenttext''), ''enable'', ''off'');' ... + 'set( findobj(''parent'', fig, ''tag'', ''Iothertext''), ''enable'', ''off''); clear fig;' drawgraphs ]; + +cb_entropy = [ 'EEG.reject.threshentropy = str2num(get(gcbo, ''string''));' ... + drawgraphs ]; +cb_kurtact = [ 'EEG.reject.threshkurtact = str2num(get(gcbo, ''string''));' ... + drawgraphs ]; +cb_kurtdist = [ 'EEG.reject.threshkurtdist = str2num(get(gcbo, ''string''));' ... + drawgraphs ]; + +if interact + cb_calrej = [ 'ButtonName=questdlg2( ''This will erase previous projections'', ''Confirmation'', ''CANCEL'', ''OK'', ''OK'');' ] +else + cb_calrej = [ 'ButtonName= ''OK''' ]; +end; +cb_calrej = [ cb_calrej ... + 'switch ButtonName,' ... + ' case ''OK'',' ... + ' rej1 = find(EEG.stats.compenta > EEG.reject.threshentropy);' ... + ' rej2 = find(EEG.stats.compkurta > EEG.reject.threshkurtact);' ... + ' rej3 = find(EEG.stats.compkurtdist > EEG.reject.threshkurtdist);' ... + ' EEG.reject.gcompreject = (rej1 & rej2) | rej3;' ... + ' clear rej1 rej2 rej3;' ... + 'end; clear ButtonName;' ]; + +% default value for rejection methods +% ----------------------------------- +rejvalother = ''; +rejvalpercent = '25'; +switch rejmethod + case 'percent', rejvalpercent = num2str( rejvalue); + case 'dataset', rejvalother = num2str( rejvalue); +end; + +% ----------------------------------------------------- +allh = supergui(gcf, { [1] ... + [2 1] [2 1] [2 1] ... + [1] ... + [1] ... + [1.5 0.5 1] [1.5 0.5 1] [1.5 0.5 1] ... + [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] ... + [1 1 1 1 1] ... + }, [], ... + { 'Style', 'text', 'string', 'Calibration method', 'FontSize', 13, 'fontweight', 'bold' }, ... + ... + { 'style', 'checkbox', 'String', '% of artifactual components (can also put one % per rejection)', 'tag', 'Ipercent', 'value', 1, 'callback', cb_percent}, ... + { 'style', 'edit', 'String', rejvalpercent, 'tag', 'Ipercenttext', 'callback', drawgraphs }, ... + ... + { 'style', 'checkbox', 'String', 'Specific dataset (enter dataset number)', 'tag', 'Iother', 'value', 0, 'callback', cb_other}, ... + { 'style', 'edit', 'String', rejvalother, 'tag', 'Iothertext', 'enable', 'off', 'callback', drawgraphs }, ... + ... + { 'style', 'checkbox', 'String', 'Current dataset', 'tag', 'Icurrent', 'value', 0, 'callback', cb_current}, ... + { }, ... + ... + { }, ... + ... + { 'Style', 'text', 'string', 'Threshold values', 'FontSize', 13, 'fontweight', 'bold' }, ... + ... + { 'style', 'text', 'String', 'Entropy of activity threshold' }, ... + { 'style', 'edit', 'String', num2str(EEG.reject.threshentropy), 'tag', 'entstring', 'callback', cb_entropy }, ... + { 'style', 'pushbutton', 'String', 'Histogram', 'callback', 'figure; hist(EEG.stats.compenta,20); title(''Entropy of activity'');' }, ... + ... + { 'style', 'text', 'String', 'Kurtosis of activity threshold' }, ... + { 'style', 'edit', 'String', num2str(EEG.reject.threshkurtact), 'tag', 'kurtstring', 'callback', cb_kurtact }, ... + { 'style', 'pushbutton', 'String', 'Histogram', 'callback', 'figure; hist(EEG.stats.compkurta,200); title(''Kurtosis of activity'');' }, ... + ... + { 'style', 'text', 'String', 'Kurtosis of topography threshold' }, ... + { 'style', 'edit', 'String', num2str(EEG.reject.threshkurtdist), 'tag', 'kurtdiststring', 'callback', cb_kurtdist }, ... + { 'style', 'pushbutton', 'String', 'Histogram', 'callback', 'figure; hist(EEG.stats.compkurtdist,20); title(''Kurtosis of topography'');' }, ... + ... + { }, { }, { }, { }, { }, { }, { }, { }, { }, { }, ... + ... + { 'style', 'pushbutton', 'String', 'Cancel', 'callback', cb_cancel, 'userdata', { EEG.reject.threshentropy EEG.reject.threshkurtact EEG.reject.threshkurtdist }}, ... + { 'style', 'pushbutton', 'String', 'Auto thresh' , 'callback', '', 'enable', 'off' }, ... + { 'style', 'pushbutton', 'String', 'Help' , 'callback', 'pophelp(''pop_icathresh'');' }, ... + { 'style', 'pushbutton', 'String', 'Accept thresh.' , 'callback', 'close(gcbf);' }, ... + { 'style', 'pushbutton', 'String', 'Calc. rejection' , 'callback', 'close(gcbf);' } ... + ... + ); + +h = axes('position', [0 15 30 30].*s+q, 'tag', 'graphent'); +h = axes('position', [35 15 30 30].*s+q, 'tag', 'graphkurt'); +h = axes('position', [70 15 30 30].*s+q, 'tag', 'graphkurtdist'); + +rejmethod +switch rejmethod + case 'dataset', eval([ 'gcbf = [];' cb_other]); + case 'current', eval([ 'gcbf = [];' cb_current]); + otherwise, eval([ 'gcbf = [];' cb_percent]); +end; + + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_importdata.m b/code/eeglab13_4_4b/functions/popfunc/pop_importdata.m new file mode 100644 index 0000000..9d5864c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_importdata.m @@ -0,0 +1,289 @@ +% pop_importdata() - import data from a Matlab variable or disk file by calling +% importdata(). +% Usage: +% >> EEGOUT = pop_importdata(); % pop-up a data entry window +% >> EEGOUT = pop_importdata( 'key', val,...); % no pop-up window +% +% Graphic interface (refer to a previous version of the GUI): +% "Data file/array" - [Edit box] Data file or Matlab variable name to import +% to EEGLAB. Command line equivalent: 'data' +% "Data file/array" - [list box] select data format from listbox. If you +% browse for a data file, the graphical interface might be +% able to detect the file format from the file extension and +% his list box accordingly. Note that you have to click on +% the option to make it active. Command line equivalent is +% 'dataformat' +% "Dataset name" - [Edit box] Name for the new dataset. +% In the last column of the graphic interface, the "EEG.setname" +% text indicates which field of the EEG structure this parameter +% is corresponding to (in this case 'setname'). +% Command line equivalent: 'setname'. +% "Data sampling rate" - [Edit box] In Hz. Command line equivalent: 'srate' +% "Time points per epoch" - [Edit box] Number of data frames (points) per epoch. +% Changing this value will change the number of data epochs. +% Command line equivalent: 'pnts'. +% "Start time" - [Edit box] This edit box is only present for +% data epoch and specify the epochs start time in ms. Epoch upper +% time limit is automatically calculated. +% Command line equivalent: 'xmin' +% "Number of channels" - [Edit box] Number of data channels. Command line +% equivalent: 'nbchan'. This edit box cannot be edited. +% "Ref. channel indices or mode" - [edit box] current reference. This edit box +% cannot be edited. To change data reference, use menu +% Tools > Re-reference calling function pop_reref(). The reference +% can be a string, 'common' indicating an unknow common reference, +% 'averef' indicating average reference, or an array of integer +% containing the indices of the reference channels. +% "Subject code" - [Edit box] subject code. For example, 'S01'. The command +% line equivalent is 'subject'. +% "Task Condition" - [Edit box] task condition. For example, 'Targets'. The +% command line equivalent is 'condition'. +% "Session number" - [Edit box] session number (from the same subject). All datasets +% from the same subject and session will be assumed to use the +% same ICA decomposition. The command line equivalent is 'session'. +% "Subject group" - [Edit box] subject group. For example 'Patients' or 'Control'. +% Command line equivalent is 'group'. +% "About this dataset" - [Edit box] Comments about the dataset. Command line +% equivalent is 'comments'. +% "Channel locations file or array" - [Edit box] For channel data formats, see +% >> readlocs help Command line equivalent: 'chanlocs' +% "ICA weights array or text/binary file" - [edit box] Import ICA weights from other +% decompositions (e.g., same data, different conditions). +% To use the ICA weights from another loaded dataset (n), enter +% ALLEEG(n).icaweights. Command line equivalent: 'icaweights' +% "ICA sphere array or text/binary file" - [edit box] Import ICA sphere matrix. +% In EEGLAB, ICA decompositions require a sphere matrix +% and an unmixing weight matrix (see above). To use the sphere +% matrix from another loaded dataset (n), enter ALLEEG(n).icasphere +% Command line equivalent: 'icasphere'. +% "From other dataset" - [push button] Press this button and enter the index +% of another dataset. This will update the channel location or the +% ICA edit box. +% +% Optional inputs: +% 'setname' - Name of the EEG dataset +% 'data' - ['varname'|'filename'] Import data from a Matlab variable or file +% into an EEG data structure +% 'dataformat' - ['array|matlab|ascii|float32le|float32be'] Input data format. +% 'array' is a Matlab array in the global workspace. +% 'matlab' is a Matlab file (which must contain a single variable). +% 'ascii' is an ascii file. 'float32le' and 'float32be' are 32-bit +% float data files with little-endian and big-endian byte order. +% Data must be organised as (channels, timepoints) i.e. +% channels = rows, timepoints = columns; else, as 3-D (channels, +% timepoints, epochs). For convenience, the data file is transposed +% if the number of rows is larger than the number of columns as the +% program assumes that there is more channel than data points. +% 'subject' - [string] subject code. For example, 'S01'. +% {default: none -> each dataset from a different subject} +% 'condition' - [string] task condition. For example, 'Targets' +% {default: none -> all datasets from one condition} +% 'group' - [string] subject group. For example 'Patients' or 'Control'. +% {default: none -> all subjects in one group} +% 'session' - [integer] session number (from the same subject). All datasets +% from the same subject and session will be assumed to use the +% same ICA decomposition {default: none -> each dataset from +% a different session} +% 'chanlocs' - ['varname'|'filename'] Import a channel location file. +% For file formats, see >> help readlocs +% 'nbchan' - [int] Number of data channels. +% 'xmin' - [real] Data epoch start time (in seconds). +% {default: 0} +% 'pnts' - [int] Number of data points per data epoch. The number of trial +% is automatically calculated. +% {default: length of the data -> continuous data assumed} +% 'srate' - [real] Data sampling rate in Hz {default: 1Hz} +% 'ref' - [string or integer] reference channel indices. 'averef' indicates +% average reference. Note that this does not perform referencing +% but only sets the initial reference when the data is imported. +% 'icaweight' - [matrix] ICA weight matrix. +% 'icasphere' - [matrix] ICA sphere matrix. By default, the sphere matrix +% is initialized to the identity matrix if it is left empty. +% 'comments' - [string] Comments on the dataset, accessible through the EEGLAB +% main menu using (Edit > About This Dataset). Use this to attach +% background information about the experiment or data to the dataset. +% Outputs: +% EEGOUT - modified EEG dataset structure +% +% Note: This function calls pop_editset() to modify parameter values. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_editset(), pop_select(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-16-02 text interface editing -sm & ad +% 03-16-02 remove EEG.xmax et EEG.xmin (for continuous) -ad & sm +% 04-02-02 debugging command line calls -ad & lf + +function [EEGOUT, com] = pop_importdata( varargin); + +com = ''; +EEGOUT = eeg_emptyset; +if nargin < 1 % if several arguments, assign values + % popup window parameters + % ----------------------- + geometry = { [1.4 0.7 .8 0.5] [2 3.02] [1] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] [2.5 1 1.5 1.5] ... + [1] [1.4 0.7 .8 0.5] [1] [1.4 0.7 .8 0.5] [1.4 0.7 .8 0.5] }; + editcomments = [ 'tmp = pop_comments(get(gcbf, ''userdata''), ''Edit comments of current dataset'');' ... + 'if ~isempty(tmp), set(gcf, ''userdata'', tmp); end; clear tmp;' ]; + commandload = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename(1) ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', tagtest), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + commandsetfiletype = [ 'filename = get( findobj(''parent'', gcbf, ''tag'', ''globfile''), ''string'');' ... + 'tmpext = findstr(filename,''.'');' ... + 'if ~isempty(tmpext),' ... + ' tmpext = lower(filename(tmpext(end)+1:end));' ... + ' switch tmpext, ' ... + ' case ''mat'', set(findobj(gcbf,''tag'', ''loclist''), ''value'',5);' ... + ' case ''fdt'', set(findobj(gcbf,''tag'', ''loclist''), ''value'',3);' ... + ' case ''txt'', set(findobj(gcbf,''tag'', ''loclist''), ''value'',2);' ... + ' end;' ... + 'end; clear tmpext filename;' ]; + commandselica = [ 'res = inputdlg2({ ''Enter dataset number'' }, ''Select ICA weights and sphere from other dataset'', 1, { ''1'' });' ... + 'if ~isempty(res),' ... + ' set(findobj( ''parent'', gcbf, ''tag'', ''weightfile''), ''string'', sprintf(''ALLEEG(%s).icaweights'', res{1}));' ... + ' set(findobj( ''parent'', gcbf, ''tag'', ''sphfile'') , ''string'', sprintf(''ALLEEG(%s).icasphere'' , res{1}));' ... + 'end;' ]; + commandselchan = [ 'res = inputdlg2({ ''Enter dataset number'' }, ''Select channel information from other dataset'', 1, { ''1'' });' ... + 'if ~isempty(res),' ... + ' set(findobj( ''parent'', gcbf, ''tag'', ''chanfile''), ' ... + ' ''string'', sprintf(''{ ALLEEG(%s).chanlocs ALLEEG(%s).chaninfo ALLEEG(%s).urchanlocs }'', res{1}, res{1}, res{1}));' ... + 'end;' ]; + if isstr(EEGOUT.ref) + curref = EEGOUT.ref; + else + if length(EEGOUT.ref) > 1 + curref = [ int2str(abs(EEGOUT.ref)) ]; + else + curref = [ int2str(abs(EEGOUT.ref)) ]; + end; + end; + + uilist = { ... + { 'Style', 'text', 'string', 'Data file/array (click on the selected option)', 'horizontalalignment', 'right', 'fontweight', 'bold' }, ... + { 'Style', 'popupmenu', 'string', 'Matlab variable|ASCII text file|float32 le file|float32 be file|Matlab .mat file', ... + 'fontweight', 'bold', 'tag','loclist' } ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'globfile' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', ... + [ 'tagtest = ''globfile'';' commandload commandsetfiletype ] }, ... + ... + { 'Style', 'text', 'string', 'Dataset name', 'horizontalalignment', 'right', ... + 'fontweight', 'bold' }, { 'Style', 'edit', 'string', '' }, { } ... + ... + { 'Style', 'text', 'string', 'Data sampling rate (Hz)', 'horizontalalignment', 'right', 'fontweight', ... + 'bold' }, { 'Style', 'edit', 'string', num2str(EEGOUT.srate) }, ... + { 'Style', 'text', 'string', 'Subject code', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', 'Time points per epoch (0->continuous)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', num2str(EEGOUT.pnts) }, ... + { 'Style', 'text', 'string', 'Task condition', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', 'Start time (sec) (only for data epochs)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', num2str(EEGOUT.xmin) }, ... + { 'Style', 'text', 'string', 'Session number', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', 'Number of channels (0->set from data)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', '0' }, ... + { 'Style', 'text', 'string', 'Subject group', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', 'Ref. channel indices or mode (see help)', 'horizontalalignment', 'right', ... + }, { 'Style', 'edit', 'string', curref }, ... + { 'Style', 'text', 'string', 'About this dataset', 'horizontalalignment', 'right', ... + }, { 'Style', 'pushbutton', 'string', 'Enter comments' 'callback' editcomments }, ... + { } ... + { 'Style', 'text', 'string', 'Channel location file or info', 'horizontalalignment', 'right', 'fontweight', ... + 'bold' }, {'Style', 'pushbutton', 'string', 'From other dataset', 'callback', commandselchan }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'chanfile' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''chanfile'';' commandload ] }, ... + ... + { 'Style', 'text', 'string', ... + ' (note: autodetect file format using file extension; use menu "Edit > Channel locations" for more importing options)', ... + 'horizontalalignment', 'right' }, ... + ... + { 'Style', 'text', 'string', 'ICA weights array or text/binary file (if any):', 'horizontalalignment', 'right' }, ... + { 'Style', 'pushbutton' 'string' 'from other dataset' 'callback' commandselica }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'weightfile' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''weightfile'';' commandload ] }, ... + ... + { 'Style', 'text', 'string', 'ICA sphere array or text/binary file (if any):', 'horizontalalignment', 'right' }, ... + { 'Style', 'pushbutton' 'string' 'from other dataset' 'callback' commandselica }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'sphfile' } ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''sphfile'';' commandload ] } }; + + [ results newcomments ] = inputgui( geometry, uilist, 'pophelp(''pop_importdata'');', 'Import dataset info -- pop_importdata()'); + if length(results) == 0, return; end; + args = {}; + + % specific to importdata (not identical to pop_editset + % ---------------------------------------------------- + switch results{1} + case 1, args = { args{:}, 'dataformat', 'array' }; + case 2, args = { args{:}, 'dataformat', 'ascii' }; + case 3, args = { args{:}, 'dataformat', 'float32le' }; + case 4, args = { args{:}, 'dataformat', 'float32be' }; + case 5, args = { args{:}, 'dataformat', 'matlab' }; + end; + i = 3; + if ~isempty( results{i+7} ) , args = { args{:}, 'nbchan', str2num(results{i+7}) }; end; + if ~isempty( results{2} ) , args = { args{:}, 'data', results{2} }; end; + + if ~isempty( results{i } ) , args = { args{:}, 'setname', results{i } }; end; + if ~isempty( results{i+1} ) , args = { args{:}, 'srate', str2num(results{i+1}) }; end; + if ~isempty( results{i+2} ) , args = { args{:}, 'subject', results{i+2} }; end; + if ~isempty( results{i+3} ) , args = { args{:}, 'pnts', str2num(results{i+3}) }; end; + if ~isempty( results{i+4} ) , args = { args{:}, 'condition', results{i+4} }; end; + if ~isempty( results{i+5} ) , args = { args{:}, 'xmin', str2num(results{i+5}) }; end; + if ~isempty( results{i+6} ) , args = { args{:}, 'session', str2num(results{i+6}) }; end; + if ~isempty( results{i+8} ) , args = { args{:}, 'group', results{i+8} }; end; + if ~isempty( results{i+9} ) , args = { args{:}, 'ref', str2num(results{i+9}) }; end; + if ~isempty( newcomments ) , args = { args{:}, 'comments', newcomments }; end; + + if abs(str2num(results{i+5})) > 10, + fprintf('WARNING: are you sure the epoch start time (%3.2f) is in seconds\n'); + end; + + if ~isempty( results{i+10} ) , args = { args{:}, 'chanlocs' , results{i+10} }; end; + if ~isempty( results{i+11} ), args = { args{:}, 'icaweights', results{i+11} }; end; + if ~isempty( results{i+12} ) , args = { args{:}, 'icasphere', results{i+12} }; end; + + % generate the output command + % --------------------------- + EEGOUT = pop_editset(EEGOUT, args{:}); + com = sprintf( 'EEG = pop_importdata(%s);', vararg2str(args) ); + + %com = ''; + %for i=1:2:length(args) + % if ~isempty( args{i+1} ) + % if isstr( args{i+1} ) com = sprintf('%s, ''%s'', ''%s''', com, args{i}, char(args{i+1}) ); + % else com = sprintf('%s, ''%s'', [%s]', com, args{i}, num2str(args{i+1}) ); + % end; + % else + % com = sprintf('%s, ''%s'', []', com, args{i} ); + % end; + %end; + %com = [ 'EEG = pop_importdata(' com(2:end) ');']; + +else % no interactive inputs + EEGOUT = pop_editset(EEGOUT, varargin{:}); +end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_importegimat.m b/code/eeglab13_4_4b/functions/popfunc/pop_importegimat.m new file mode 100644 index 0000000..cafd9d1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_importegimat.m @@ -0,0 +1,148 @@ +% pop_importegimat() - import EGI Matlab segmented file +% +% Usage: +% >> EEG = pop_importegimat(filename, srate, latpoint0); +% +% Inputs: +% filename - Matlab file name +% srate - sampling rate +% latpoint0 - latency in sample ms of stimulus presentation. +% When data files are exported using Netstation, the user specify +% a time range (-100 ms to 500 ms for instance). In this +% case, the latency of the stimulus is 100 (ms). Default is 0 (ms) +% +% Output: +% EEG - EEGLAB dataset structure +% +% Authors: Arnaud Delorme, CERCO/UCSD, Jan 2010 + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG com] = pop_importegimat(filename, srate, latpoint0, dataField); + + EEG = []; + com = ''; + if nargin < 3, latpoint0 = 0; end; + if nargin < 4, lookupchanfile = 0; end; + if nargin < 5, dataField = 'Session'; end; + if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.mat', 'Choose a Matlab file from Netstation -- pop_importegimat()'); + if filename == 0 return; end; + filename = fullfile(filepath, filename); + tmpdata = load('-mat', filename); + fieldValues = fieldnames(tmpdata); + sessionPos = strmatch('Session', fieldValues); + posFieldData = 1; + if ~isempty(sessionPos), posFieldData = sessionPos; end; + + if ~isfield(tmpdata, 'samplingRate'), srate = 250; else srate = tmpdata.samplingRate; end; + % epoch data files only + promptstr = { { 'style' 'text' 'string' 'Sampling rate (Hz)' } ... + { 'style' 'edit' 'string' int2str(srate) } ... + { 'style' 'text' 'string' 'Sample latency for stimulus (ms)' } ... + { 'style' 'edit' 'string' '0' } ... + { 'style' 'text' 'string' 'Field containing data' } ... + { 'style' 'popupmenu' 'string' fieldValues 'value' posFieldData } ... + }; + geometry = { [1 1] [1 1] [1 1] }; + result = inputgui( 'geometry', geometry, 'uilist', promptstr, ... + 'helpcom', 'pophelp(''pop_importegimat'')', ... + 'title', 'Import a Matlab file from Netstation -- pop_importegimat()'); + + if length(result) == 0 return; end; + srate = str2num(result{1}); + latpoint0 = str2num(result{2}); + dataField = fieldValues{result{3}}; + if isempty(latpoint0), latpoint0 = 0; end; + end; + + EEG = eeg_emptyset; + fprintf('Reading EGI Matlab file %s\n', filename); + tmpdata = load('-mat', filename); + if isfield(tmpdata, 'samplingRate') % continuous file + srate = tmpdata.samplingRate; + end; + + fieldValues = fieldnames(tmpdata); + if all(cellfun(@(x)isempty(findstr(x, 'Segment')), fieldValues)) + EEG.srate = srate; + indData = strmatch(dataField, fieldValues); + EEG.data = tmpdata.(fieldValues{indData(1)}); + EEG = eeg_checkset(EEG); + EEG = readegilocs(EEG); + + com = sprintf('EEG = pop_importegimat(''%s'');', filename); + else + % get data types + % -------------- + allfields = fieldnames(tmpdata); + for index = 1:length(allfields) + allfields{index} = allfields{index}(1:findstr(allfields{index}, 'Segment')-2); + end; + datatypes = unique_bc(allfields); + datatypes(cellfun(@isempty, datatypes)) = []; + + % read all data + % ------------- + counttrial = 1; + EEG.srate = srate; + latency = (latpoint0/1000)*EEG.srate+1; + for index = 1:length(datatypes) + tindex = 1; + for tindex = 1:length(allfields) + if isfield(tmpdata, sprintf('%s_Segment%d', datatypes{index}, tindex)) + datatrial = getfield(tmpdata, sprintf('%s_Segment%d', datatypes{index}, tindex)); + if counttrial == 1 + EEG.pnts = size(datatrial,2); + EEG.data = repmat(single(0), [size(datatrial,1), size(datatrial,2), 1000]); + end; + EEG.data(:,:,counttrial) = datatrial; + + EEG.event(counttrial).type = datatypes{index}; + EEG.event(counttrial).latency = latency; + EEG.event(counttrial).epoch = counttrial; + + counttrial = counttrial+1; + latency = latency + EEG.pnts; + end; + end; + end; + fprintf('%d trials read\n', counttrial-1); + EEG.data(:,:,counttrial:end) = []; + + EEG.setname = filename(1:end-4); + EEG.nbchan = size(EEG.data,1); + EEG.trials = counttrial-1; + if latpoint0 ~= 1 + EEG.xmin = -latpoint0/1000; + end; + EEG = eeg_checkset(EEG); + + % channel location + % ---------------- + if all(EEG.data(end,1:10) == 0) + disp('Deleting empty data reference channel (reference channel location is retained)'); + EEG.data(end,:) = []; + EEG.nbchan = size(EEG.data,1); + EEG = eeg_checkset(EEG); + end; + EEG = readegilocs(EEG); + + com = sprintf('EEG = pop_importegimat(''%s'', %3.2f, %3.2f, %d);', filename, srate, latpoint0, lookupchanfile); + end; + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_importepoch.m b/code/eeglab13_4_4b/functions/popfunc/pop_importepoch.m new file mode 100644 index 0000000..8b68230 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_importepoch.m @@ -0,0 +1,421 @@ +% pop_importepoch() - Export epoch and/or epoch event information to the event +% structure array of an EEG dataset. If the dataset is +% the only input, a window pops up to ask for the relevant +% parameter values. +% Usage: +% >> EEGOUT = pop_importepoch( EEG ); % pop-up window mode +% >> EEGOUT = pop_importepoch( EEG, filename, fieldlist, 'key', 'val', ...); +% +% Graphic interface: +% "Epoch file or array" - [edit box] enter epoch text file name. Use "Browse" +% button to browse for a file. If a file with the given name +% can not be found, the function search for a variable with +% this name in the global workspace. Command line +% equivalent: filename. +% "File input field ..." - [edit box] enter a name for each of the column in the +% text file. If columns names are defined in the text file, +% they cannnot be used and you must copy their names +% in this edit box (and skip the rows). One column name +% for each column must be provided. The keywords "type" and +% "latency" should not be used. Columns names can be +% separated by comas, quoted or not. Command line +% equivalent: fieldlist. +% "Field name(s) containing event latencies" - [edit box] enter columns name(s) +% containing latency information. It is not necessary to +% define a latency field for epoch information. All fields +% that contain latencies will be imported as different event +% types. For instance, if field 'RT' contains latencies, +% events of type 'RT' will be created with latencies given +% in the RT field. See notes. Command line +% equivalent: 'latencyfields'. +% "Field name(s) containing event durations" - [edit box] enter columns name(s) +% containing duration information. It is not necessary to +% define a latency field for epoch information, but if you +% do, a duration field (or 0) must be entered for each +% latency field you define. For instance if the latency fields +% are "'rt1' 'rt2'", then you must have duration fields +% such as "'dr1' 'dr2'". If duration is not defined for event +% latency 'tr1', you may enter "0 'rt2'". Command line +% equivalent: 'durationfields'. +% "Field name containing time locking event type(s)" - [edit box] if one column +% contain the epoch type, its name must be defined in the +% previous edit box and copied here. It is not necessary to +% define a type field for the time-locking event (TLE). By +% default it is defined as type ''TLE'' at time 0 for all +% epochs. Command line equivalent: 'typefield'. +% "Latency time unit rel. to seconds" - [edit box] specify the time unit for +% latency columns defined above. Command line +% equivalent: 'timeunit'. +% "Number of header lines to ignore" - [edit box] for some text files, the first +% rows do not contain epoch information and have to be +% skipped. Command line equivalent: 'headerlines'. +% "Remove old epoch and event info" - [checkbox] check this checkbox +% to remove any prior event or epoch information. Command +% line equivalent: 'clearevents'. +% +% Inputs: +% EEG - Input EEG dataset +% filename - Name of an ascii file with epoch and/or epoch event +% information organised in columns. ELSE, name of a Matlab +% variable with the same information (either a Matlab array +% or cell array). +% fieldlist - {cell array} Label of each column (data field) in the file. +% +% Optional inputs: +% 'typefield' - ['string'] Name of the field containing the type(s) +% of the epoch time-locking events (at time 0). +% By default, all the time-locking events are assigned +% type 'TLE' (for "time-locking event"). +% 'latencyfields' - {cell array} Field names that contain the latency +% of an event. These fields are transferred into +% events whose type will be the same as the name of +% the latency field. (Ex: field RT -> type 'RT' events). +% 'durationfields' - {cell array} Field names that contain the duration +% of an event. +% 'timeunit' - [float] Optional unit for latencies relative to seconds. +% Ex: sec -> 1, msec -> 1e-3. Default: Assume latencies +% are in time points (relative to the time-zero time point +% in the epoch). +% 'headerlines' - [int] Number of header lines in the input file to ignore. +% {Default 0}. +% 'clearevents' - ['on'|'off'], 'on'-> clear the old event array. +% {Default 'on'} +% +% Output: +% EEGOUT - EEG dataset with modified event structure +% +% FAQ: +% 1) Why is this function so complex? This function can handle as many events +% per epochs as needed, and the information is stored in terms of events +% rather than epoch information, which requires some conversion. +% 2) Can I access epoch information later? The epoch information is stored in +% "EEG.event" and the information is stored in terms of events only. For +% user convenience the "EEG.epoch" structure is generated automatically +% from the event structure. See EEGLAB manual for more information. +% +% Authors: Arnaud Delorme & Scott Makeig, CNL/Salk Institute, 11 March 2002 +% +% See also: eeglab() + +% Copyright (C) 15 Feb 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% graphic interface INFOS +% 03/18/02 debugging variable passing - ad & lf +% 03/18/02 adding event updates and incremental calls -ad +% 03/25/02 adding default event description -ad +% 03/28/02 fixed latency calculation -ad + +function [EEG, com] = pop_importepoch( EEG, filename, fieldlist, varargin); + +com =''; +if nargin < 1 + help pop_importepoch + return; +end; +if nargin < 2 + geometry = { [ 1 1 1.86] [1] [1 0.66] [2.5 1 0.6] [2.5 1 0.6] [2.5 1 0.6] [1] [2 0.5 0.5] [2 0.5 0.5] [2 0.17 0.86]}; + commandload = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', tagtest), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + helpstrtype = ['It is not necessary to define a type field for the time-locking event.' 10 ... + 'By default it is defined as type ''TLE'' at time 0 for all epochs']; + helpstrlat = ['It is not necessary to define a latency field for epoch information.' 10 ... + 'All fields that contain latencies will be imported as different event types.' 10 ... + 'For instance, if field ''RT'' contains latencies, events of type ''RT''' 10 ... + 'will be created with latencies given in the RT field']; + helpstrdur = ['It is not necessary to define a duration for each event (default is 0).' 10 ... + 'However if a duration is defined, a corresponding latency must be defined too' 10 ... + '(in the edit box above). For each latency field, you have define a duration field.' 10 ... + 'if no duration field is defined for a specific event latency, enter ''0'' in place of the duration field' ]; + uilist = { ... + { 'Style', 'text', 'string', 'Epoch file or array', 'horizontalalignment', 'right', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''globfile'';' commandload ] }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'globfile' }, ... + { }... + { 'Style', 'text', 'string', 'File input field (col.) names', 'fontweight', 'bold' }, { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', ' Field name(s) containing event latencies', 'horizontalalignment', 'right', ... + 'fontweight', 'bold', 'tooltipstring', helpstrlat }, ... + { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', '(Ex: RT)', 'tooltipstring', helpstrlat }, ... + { 'Style', 'text', 'string', ' Field name(s) containing event durations', 'horizontalalignment', 'right', ... + 'fontweight', 'bold', 'tooltipstring', helpstrdur }, ... + { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', 'NOTE', 'tooltipstring', helpstrdur }, ... + { 'Style', 'text', 'string', ' Field name containing time-locking event type(s)', 'horizontalalignment', 'right', ... + 'tooltipstring', helpstrtype }, ... + { 'Style', 'edit', 'string', '' }, ... + { 'Style', 'text', 'string', 'NOTE', 'tooltipstring', helpstrtype }, ... + { } ... + { 'Style', 'text', 'string', 'Latency time unit rel. to seconds. Ex: ms -> 1E-3 (NaN -> samples)', 'horizontalalignment', 'left' }, { 'Style', 'edit', 'string', '1' }, { } ... + { 'Style', 'text', 'string', 'Number of file header lines to ignore', 'horizontalalignment', 'left' }, { 'Style', 'edit', 'string', '0' }, { },... + { 'Style', 'text', 'string', 'Remove old epoch and event info (set = yes)', 'horizontalalignment', 'left' }, { 'Style', 'checkbox', 'value', isempty(EEG.event) }, { } }; + result = inputgui( geometry, uilist, 'pophelp(''pop_importepoch'');', 'Import epoch info (data epochs only) -- pop_importepoch()'); + if length(result) == 0, return; end; + + filename = result{1}; + fieldlist = parsetxt( result{2} ); + options = {}; + if ~isempty( result{3}), options = { options{:} 'latencyfields' parsetxt( result{3} ) }; end; + if ~isempty( result{4}), options = { options{:} 'durationfields' parsetxt( result{4} ) }; end; + if ~isempty( result{5}), options = { options{:} 'typefield' result{5} }; end; + if ~isempty( result{6}), options = { options{:} 'timeunit' eval(result{6}) }; end; + if ~isempty( result{7}), options = { options{:} 'headerlines' eval(result{7}) }; end; + if ~result{8}, options = { options{:} 'clearevents' 'off'}; end; +else + if ~isempty(varargin) & ~isstr(varargin{1}) + % old call compatibility + options = { 'latencyfields' varargin{1} }; + if nargin > 4 + options = { options{:} 'timeunit' varargin{2} }; + end; + if nargin > 5 + options = { options{:} 'headerlines' varargin{3} }; + end; + if nargin > 6 + options = { options{:} 'clearevents' fastif(varargin{4}, 'on', 'off') }; + end; + else + options = varargin; + end; +end; + +g = finputcheck( options, { 'typefield' 'string' [] ''; ... + 'latencyfields' 'cell' [] {}; ... + 'durationfields' 'cell' [] {}; ... + 'timeunit' 'real' [0 Inf] 1/EEG.srate; ... + 'headerlines' 'integer' [0 Inf] 0; ... + 'clearevents' 'string' {'on';'off'} 'on'}, 'pop_importepoch'); +if isstr(g), error(g); end; + +% check duration field +% -------------------- +if ~isempty(g.durationfields) + if length(g.durationfields) ~= length(g.latencyfields) + error( [ 'If duration field(s) are defined, their must be as many duration' 10 ... + 'fields as there are latency fields (or enter 0 instead of a field for no duration' ]); + end; +else + for index = 1:length(g.latencyfields) + g.durationfields{index} = 0; + end; +end; + +% convert filename +% ---------------- +fprintf('Pop_importepoch: Loading file or array...\n'); +if isstr(filename) + % check filename + % -------------- + if exist(filename) == 2 & evalin('base', ['exist(''' filename ''')']) == 1 + disp('Pop_importepoch WARNING: FILE AND ARRAY WITH THE SAME NAME, LOADING FILE'); + end; + values = load_file_or_array( filename, g.headerlines ); +else + values = filename; + filename = inputname(2); +end; + +% check parameters +% ---------------- +if size(values,1) < size(values,2), values = values'; end; +if length(fieldlist) ~= size(values,2) + values = values'; + if length(fieldlist) ~= size(values,2) + error('There must be as many field names as there are columsn in the file/array'); + end; +end; +if ~iscell(fieldlist) + otherfieldlist = { fieldlist }; + fieldlist = { fieldlist }; +end; +otherfieldlist = setdiff_bc( fieldlist, g.latencyfields); +otherfieldlist = setdiff_bc( otherfieldlist, g.typefield); +for index = 1:length(g.durationfields) + if isstr(g.durationfields{index}) + otherfieldlist = setdiff_bc( otherfieldlist, g.durationfields{index}); + end; +end; +if size(values,1) ~= EEG.trials + error( [ 'Pop_importepoch() error: the number of rows in the input file/array does' 10 ... + 'not match the number of trials. Maybe you forgot to specify the file header length?' ]); +end; + +% create epoch array info +% ----------------------- +if iscell( values ) + for indexfield = 1:length(fieldlist) + for index=1:EEG.trials + eval( ['EEG.epoch(index).' fieldlist{ indexfield } '=values{ index, indexfield };'] ); + end; + end; +else + for indexfield = 1:length(fieldlist) + for index=1:EEG.trials + eval( ['EEG.epoch(index).' fieldlist{ indexfield } '=values( index, indexfield);'] ); + end; + end; +end; + +if isempty( EEG.epoch ) + error('Pop_importepoch: cannot process empty epoch structure'); +end; +epochfield = fieldnames( EEG.epoch ); + +% determine the name of the non latency fields +% -------------------------------------------- +tmpfieldname = {}; +for index = 1:length(otherfieldlist) + if isempty(strmatch( otherfieldlist{index}, epochfield )) + error(['Pop_importepoch: field ''' otherfieldlist{index} ''' not found']); + end; + switch otherfieldlist{index} + case {'type' 'latency'}, tmpfieldname{index} = [ 'epoch' otherfieldlist{index} ]; + otherwise, tmpfieldname{index} = otherfieldlist{index}; + end; +end; + +if ~isempty(EEG.event) + if ~isfield(EEG.event, 'epoch') + g.clearevents = 'on'; + disp('Pop_importepoch: cannot add events to a non-epoch event structure, erasing old epoch structure'); + end; +end; +if strcmpi(g.clearevents, 'on') + if ~isempty(EEG.event) + fprintf('Pop_importepoch: deleting old events if any\n'); + end; + EEG.event = []; +else + fprintf('Pop_importepoch: appending new events to the existing event array\n'); +end; + +% add time locking event fields +% ----------------------------- +if EEG.xmin <= 0 + fprintf('Pop_importepoch: adding automatically Time Locking Event (TLE) events\n'); + if ~isempty(g.typefield) + if isempty(strmatch( g.typefield, epochfield )) + error(['Pop_importepoch: type field ''' g.typefield ''' not found']); + end; + end; + for trial = 1:EEG.trials + EEG.event(end+1).epoch = trial; + if ~isempty(g.typefield) + eval( ['EEG.event(end).type = EEG.epoch(trial).' g.typefield ';'] ); + else + EEG.event(end).type = 'TLE'; + end; + EEG.event(end).latency = -EEG.xmin*EEG.srate+1+(trial-1)*EEG.pnts; + EEG.event(end).duration = 0; + end; +end; + +% add latency fields +% ------------------ +for index = 1:length(g.latencyfields) + if isempty(strmatch( g.latencyfields{index}, epochfield )) + error(['Pop_importepoch: latency field ''' g.latencyfields{index} ''' not found']); + end; + for trials = 1:EEG.trials + EEG.event(end+1).epoch = trials; + EEG.event(end).type = g.latencyfields{index}; + EEG.event(end).latency = (getfield(EEG.epoch(trials), g.latencyfields{index})*g.timeunit-EEG.xmin)*EEG.srate+1+(trials-1)*EEG.pnts; + if g.durationfields{index} ~= 0 & g.durationfields{index} ~= '0' + EEG.event(end).duration = getfield(EEG.epoch(trials), g.durationfields{index})*g.timeunit*EEG.srate; + else + EEG.event(end).duration = 0; + end; + end; +end; + +% add non latency fields +% ---------------------- +if ~isfield(EEG.event, 'epoch') % no events added yet + for trial = 1:EEG.trials + EEG.event(end+1).epoch = trial; + end; +end; +for indexevent = 1:length(EEG.event) + if ~isempty( EEG.event(indexevent).epoch ) + for index2 = 1:length(tmpfieldname) + eval( ['EEG.event(indexevent).' tmpfieldname{index2} ' = EEG.epoch(EEG.event(indexevent).epoch).' otherfieldlist{index2} ';' ] ); + end; + end; +end; + +% adding desciption to the fields +% ------------------------------- +if ~isfield(EEG, 'eventdescription' ) | isempty( EEG.eventdescription ) + allfields = fieldnames(EEG.event); + EEG.eventdescription{strmatch('epoch', allfields, 'exact')} = 'Epoch number'; + if ~isempty(strmatch('type', allfields)), EEG.eventdescription{strmatch('type', allfields)} = 'Event type'; end; + if ~isempty(strmatch('latency', allfields)), EEG.eventdescription{strmatch('latency', allfields)} = 'Event latency'; end; + if ~isempty(strmatch('duration', allfields)), EEG.eventdescription{strmatch('duration', allfields)} = 'Event duration'; end; +end; + +% checking and updating events +% ---------------------------- +EEG = pop_editeventvals( EEG, 'sort', { 'epoch', 0 } ); % resort fields +EEG = eeg_checkset(EEG, 'eventconsistency'); +EEG = eeg_checkset(EEG, 'makeur'); + +% generate the output command +% --------------------------- +if isempty(filename) & nargout == 2 + disp('Pop_importepoch: cannot generate command string'); return; +else + com = sprintf('%s = pop_importepoch( %s, ''%s'', %s);', inputname(1), inputname(1), ... + filename, vararg2str( { fieldlist options{:} })); +end; + +% interpret the variable name +% --------------------------- +function array = load_file_or_array( varname, skipline ); + + if exist( varname ) == 2 + if exist(varname) ~= 2, error( [ 'Set error: no filename ' varname ] ); end; + + fid=fopen(varname,'r','ieee-le'); + if fid<0, error( ['Set error: file ''' varname ''' found but error while opening file'] ); end; + + for index=1:skipline fgetl(fid); end; % skip lines --------- + inputline = fgetl(fid); + linenb = 1; + while inputline~=-1 + colnb = 1; + while ~isempty(deblank(inputline)) + [tmp inputline] = strtok(inputline); + tmp2 = str2num( tmp ); + if isempty( tmp2 ), array{linenb, colnb} = tmp; + else array{linenb, colnb} = tmp2; + end; + colnb = colnb+1; + end; + inputline = fgetl(fid); + linenb = linenb +1; + end; + + fclose(fid); + + else % variable in the global workspace + % -------------------------- + array = evalin('base', varname); + end; +return; + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_importev2.m b/code/eeglab13_4_4b/functions/popfunc/pop_importev2.m new file mode 100644 index 0000000..f8df336 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_importev2.m @@ -0,0 +1,75 @@ +% pop_importev2() - merge a neuroscan EV2 file with input dataset +% (pop out window if no arguments). +% +% Usage: +% >> OUTEEG = pop_importev2( INEEG ); % pop-up window mode +% >> OUTEEG = pop_importev2( INEEG, filename); +% +% Inputs: +% INEEG - input EEGLAB data structure +% filename - file name +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2007 + +% Copyright (C) 2007 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_importev2(EEG, filename); +command = ''; + +if nargin < 1 + help pop_importev2; + return; +end; + +if nargin < 2 + % ask user + [filename, filepath] = uigetfile('*.*', 'Choose a EV2 file -- pop_importev2'); + drawnow; + if filename == 0 return; end; + filename = fullfile(filepath, filename); +end; + +% find out if there is a line to skip or not +% ------------------------------------------ +fid = fopen(filename, 'r'); +tmpl = fgetl(fid); +if isempty(findstr('ype', tmpl)), skipline = 0; +else skipline = 1; +end; +fclose(fid); + +% load datas +% ---------- +tmpevent = EEG.event; +try, oldeventlats = [ tmpevent.latency ]; catch, end; +EEG = pop_importevent(EEG, 'fields', { 'num' 'type' 'response' 'acc' 'RT' 'latency'}, ... + 'skipline', skipline, 'timeunit', 1E-3, 'align', NaN, 'append', 'no', 'event', filename ); + +tmpevent = EEG.event; +neweventlats = [ tmpevent.latency ]; +if ~exist('oldeventlats'), oldeventlats = neweventlats; end; +len = min(min(length(oldeventlats), length(neweventlats)), 10); +if mean(oldeventlats(1:len) - neweventlats(1:len)) > 1 + error('Wrong alignment of ev2 file with data'); +end; + +command = sprintf('%s = pop_importev2(%s, %s);', inputname(1), inputname(1), filename); + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_importevent.m b/code/eeglab13_4_4b/functions/popfunc/pop_importevent.m new file mode 100644 index 0000000..cbe02df --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_importevent.m @@ -0,0 +1,229 @@ +% pop_importevent() - Import events into an EEG dataset. If the EEG dataset +% is the only input, a window pops up to ask for the relevant +% parameter values. +% +% Usage: >> EEG = pop_importevent( EEG ); % pop-up window mode +% >> EEG = pop_importevent( EEG, 'key1', 'value1', ...); +% +% Graphic interface: +% "Event indices" - [edit box] Enter indices of events to modify. +% Leave this field blank to import new events. +% Command line equivalent: 'indices'. +% "Append events?" - [checkbox] Check this checkbox to clear prior +% event information. In addition, see the "Align event latencies ..." +% edit box. Command line equivalent: 'append'. +% "Event file or array" - [edit box] Enter event file name. Use "Browse" +% button to browse for a file. If a file with the given name +% cannot be found, the function search for a variable with +% this name in the global workspace. +% Command line equivalent: 'filename'. +% "Input field (column) name" - [edit box] Enter a name for each of the +% columns in the event text file. If column names are defined +% in the text file, they cannnot be used and you must copy +% the names into this edit box (and skip the name row). Must +% provide a name for each column. The keywords "type", +% "latency", and "duration" are recognized EEGLAB keywords and +% should be used to define the event log file columns containing +% event types, latencies, and durations. Column names can be +% separated by commas, quoted or not. +% Command line equivalent: fields. +% "Latency time unit (sec)" - [edit box] Specify the time unit for the +% latency column defined above relative to seconds. +% Command line equivalent: 'timeunit'. +% "Number of header lines to ignore" - [edit box] For some text files, the +% first rows do not contain epoch information and need to be +% skipped. Command line equivalent: 'skiplines'. +% "Align event latencies to data events" - [edit box] For most EEG datasets, +% basic event information is defined along with the EEG, and +% a more detailed file is recorded separately. This option +% helps fuse the two sources of information by realigning the +% imported data text file information into the existing event. +% A value of 0 indicates that the first events of the pre-defined +% events and imported events will be aligned. A positive value (num) +% aligns the first event to the num-th pre-existing event. +% A negative value can also be used; then event number (-num) +% is aligned to the first pre-existing event. Default is 0. +% (NaN-> no alignment). Command line equivalent is 'align'. +% "Auto adjust event sampling rate" - [checkbox] When checked, the function +% automatically adjusts the sampling rate of the new events so +% they best align with the closest old events. This may account +% for small differences in sampling rate that could lead to +% big differences at the end of the experiement (e.g., A 0.01% +% clock difference over an hour would lead to a 360-ms difference +% if not corrected). Command line line equivalent is 'optimalim'. +% Input: +% EEG - input dataset +% +% Optional file or array input: +% 'event' - [ 'filename'|array ] Filename of a text file, or name of s +% Matlab array in the global workspace containing an +% array of events in the folowing format: The first column +% is the type of the event, the second the latency. +% The others are user-defined. The function can read +% either numeric or text entries in ascii files. +% 'fields' - [Cell array] List of the name of each user-defined column, +% optionally followed by a description. Ex: { 'type', 'latency' } +% 'skipline' - [Interger] Number of header rows to skip in the text file +% 'timeunit' - [ latency unit rel. to seconds ]. Default unit is 1 = seconds. +% 'delim' - [string] String of delimiting characters in the input file. +% Default is tab|space. +% +% Optional oldevent input: +% 'append' - ['yes'|'no'] 'yes' = Append events to the current events in +% the EEG dataset {default}: 'no' = Erase the previous events. +% 'indices' - {integer vector] Vector indicating the indices of the events to +% modify. +% 'align' - [num] Align the first event latency to the latency of existing +% event number (num), and check latency consistency. +% 'optimalign' - ['on'|'off'] Optimize the sampling rate of the new events so +% they best align with old events. Default is 'on'. +% +% Outputs: +% EEG - EEG dataset with updated event fields +% +% Example: >> [EEG, eventnumbers] = pop_importevent(EEG, 'event', ... +% 'event_values.txt', 'fields', {'type', 'latency','condition' }, ... +% 'append', 'no', 'align', 0, 'timeunit', 1E-3 ); +% +% This loads the ascii file 'event_values.txt' containing 3 columns +% (event_type, latency, and condition). Latencies in the file are +% in ms (1E-3). The first event latency is re-aligned with the +% beginning of the dataset ('align', 0). Any previous events +% are erased ('append', 'no'). +% +% Author: Arnaud Delorme & Scott Makeig, CNL / Salk Institute, 9 Feb 2002 +% +% See also: importevent(), pop_editeventfield(), pop_selectevent() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 9 Feb 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_importevent(EEG, varargin); + +com =''; +if nargin < 1 + help pop_importevent; + return; +end; + +if isempty(EEG.data) + disp('pop_importevent(): error: cannot process empty dataset'); return; +end; + +I = []; + +% warning if data epochs +% ---------------------- +if nargin<2 & EEG.trials > 1 + questdlg2(strvcat('Though epoch information is defined in terms of the event structure,', ... + 'this function is usually used to import events into continuous data.', ... + 'For epoched data, use menu item ''File > Import epoch info'''), ... + 'pop_importevent warning', 'OK', 'OK'); +end; + +% remove the event field +% ---------------------- +if ~isempty(EEG.event), allfields = fieldnames(EEG.event); +else allfields = {}; end; + +if nargin<2 + commandload = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', tagtest), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + helpfields = ['latency field (lowercase) must be present; field ''type'' and' 10 ... + '''duration'' are also recognized keywords and it is recommended to define them']; + uilist = { ... + { 'Style', 'text', 'string', 'Event indices', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Append events?', 'fontweight', 'bold' } }; + geometry = { [ 1 1.1 1.1 1] [ 1 1 2] [1 1 2] [ 1.2 1 1] }; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', 'Event file or array', 'horizontalalignment', 'right', 'fontweight', 'bold' }, ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', [ 'tagtest = ''globfile'';' commandload ] }, ... + { 'Style', 'edit' } ... + { 'Style', 'checkbox', 'string', 'Yes/No', 'value', 0 }, ... + { 'Style', 'edit', 'string', '', 'horizontalalignment', 'left', 'tag', 'globfile' }, ... + { }, { 'Style', 'text', 'string', 'NB: No = overwrite', 'value', 0 }, { }, ... + { 'Style', 'text', 'string', 'Input field (column) names ', 'fontweight', 'bold', 'tooltipstring', helpfields } ... + { 'Style', 'edit', 'string', '' } { 'Style', 'text', 'string', 'Ex: type latency duration', 'tooltipstring', helpfields } }; + geometry = { geometry{:} [1.2 1 1] [1.2 1 1] [1.2 1 1] [1.2 0.2 1.8] }; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', 'Number of file header lines', 'horizontalalignment', 'left' }, { 'Style', 'edit', 'string', '0' }, ... + { 'Style', 'text', 'string', '(latency field required above)', 'tooltipstring', helpfields },... + { 'Style', 'text', 'string', 'Time unit (sec)', 'horizontalalignment', 'left' }, { 'Style', 'edit', 'string', '1' } ... + { 'Style', 'text', 'string', 'Ex: If ms, 1E-3; if points, NaN' },... + { 'Style', 'text', 'string', 'Align event latencies to data events', 'horizontalalignment', 'left' }, ... + { 'Style', 'edit', 'string', fastif(isempty(EEG.event),'NaN','0') } { 'Style', 'text', 'string', 'See Help' },... + { 'Style', 'text', 'string', 'Auto adjust new events sampling rate', 'horizontalalignment', 'left' }, ... + { 'Style', 'checkbox', 'value' 1 } { },... + }; + results = inputgui( geometry, uilist, 'pophelp(''pop_importevent'');', 'Import event info -- pop_importevent()' ); + if length(results) == 0, return; end; + + % decode top inputs + % ----------------- + args = {}; + if ~isempty( results{1} ), args = { args{:}, 'indices', eval( [ '[' results{1} ']' ]) }; end; + if results{2} == 0 & ~isempty(EEG.event), args = { args{:}, 'append', 'no' }; end; + if ~isempty( results{3} ), + if isstr( results{3} ) && ~exist(results{3}) + args = { args{:}, 'event', evalin('base', results{3}) }; + else + args = { args{:}, 'event', results{3} }; + end; + end; + if ~isempty( results{4} ), args = { args{:}, 'fields', parsetxt(results{4}) }; end; + + % handle skipline + % --------------- + if ~isempty(eval(results{end-3})), if eval(results{end-3}) ~= 0, args = { args{:}, 'skipline', eval(results{end-3}) }; end; end; + + % handle timeunit + % ------------- + if ~isempty(eval(results{end-2})), if eval(results{end-2}) ~= 0, args = { args{:}, 'timeunit', eval(results{end-2}) }; end; end; + + % handle alignment + % ---------------- + if ~isempty(eval(results{end-1})), if ~isnan(eval(results{end-1})), args = { args{:}, 'align', eval(results{end-1}) }; end; end; + if ~results{end} ~= 0, args = { args{:}, 'optimalign', 'off' }; end; + +else % no interactive inputs + args = varargin; + % scan args to modify array/file format + % array are transformed into string + % files are transformed into string of string + % (this is usefull to build the string command for the function) + % -------------------------------------------------------------- + for index=1:2:length(args) + if iscell(args{index+1}), if iscell(args{index+1}{1}) args{index+1} = args{index+1}{1}; end; end; % double nested + if isstr(args{index+1}) & length(args{index+1}) > 2 & args{index+1}(1) == '''' & args{index+1}(end) == '''' + args{index+1} = args{index+1}(2:end-1); end; + %else if ~isempty( inputname(index+2) ), args{index+1} = inputname(index+2); end; + %end; + end; +end; + +EEG.event = importevent( [], EEG.event, EEG.srate, args{:}); + +% generate ur variables +% --------------------- +EEG = eeg_checkset(EEG, 'eventconsistency'); +EEG = eeg_checkset(EEG, 'makeur'); + +% generate the output command +% --------------------------- +com = sprintf('%s = pop_importevent( %s, %s);', inputname(1), inputname(1), vararg2str(args)); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_importpres.m b/code/eeglab13_4_4b/functions/popfunc/pop_importpres.m new file mode 100644 index 0000000..fe981c3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_importpres.m @@ -0,0 +1,189 @@ +% pop_importpres() - append Presentation event file information into an EEGLAB dataset +% The Presentation stimulus presentation program outputs an ascii +% log file. This function merges existing EEG dataset events with +% additional field information (fields) about those events contained +% in the logfile. +% Usage: +% >> EEGOUT = pop_importpres( EEGIN, filename ); +% >> EEGOUT = pop_importpres( EEGIN, filename, typefield, ... +% latfield, durfield, align, 'key', 'val', ... ); +% Inputs: +% EEGIN - input dataset +% logfilename - Presentation logfile name +% +% typefield - [string] type fieldname {default: 'code'} +% latfield - [string] latency fieldname {default: 'time'} +% durfield - [string] duration fieldname {default: 'none'} +% align - [integer] alignment with pre-existing events +% See >> help pop_importevent +% 'key','val' - This function calls pop_importevent(). These are +% optional arguments for this function (for event +% alignment for instance). +% Outputs: +% EEGOUT - data structure with added Presentation logfile information +% +% Note: If there are pre-existing events in the input dataset, +% this function will recalculate the latencies of the events +% in the Presentation file, so that they match those +% of the pre-existing events. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 15 March 2002 +% +% Note: This function is backward compatible with its early versions +% (before the input argument 'durfield' was introduced). +% It can read the 'align' value as its 5th (not 6th) paramater. +% +% See also: eeglab(), pop_importevent() + +% Copyright (C) 13 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_importpres(EEG, filename, typefield, latfield, durfield, align, varargin); + +command = ''; + +if nargin < 1 + help pop_importpres; + return +end; + +% decode input (and backward compatibility) +% ----------------------------------------- +if nargin < 5 + durfield = ''; +end; +if nargin >= 5 & ~isstr(durfield) + if nargin >= 6 + varargin = { align varargin{:} }; + end; + align = durfield; + durfield = ''; +else + if nargin < 6 + align = 0; + end; +end; + +if nargin < 2 + % ask user + [filename, filepath] = uigetfile('*.log;*.LOG', 'Choose a Presentation file -- pop_importpres()'); + drawnow; + if filename == 0 return; end; + filename = [filepath filename]; +end; + +fields = loadtxt(filename, 'delim', 9, 'skipline', -2, 'nlines', 1, 'verbose', 'off'); + +% finding fields +% -------------- +if nargin > 1 + if nargin < 3 + typefield = 'code'; % backward compatibility + latfield = 'time'; + end; + indtype = strmatch(lower(typefield), lower(fields)); + indlat = strmatch(lower(latfield) , lower(fields)); + if ~isempty(durfield) + inddur = strmatch(lower(durfield) , lower(fields)); + else inddur = 0; + end; +else + indtype1 = strmatch('event type', lower(fields)); + indtype2 = strmatch('code', lower(fields)); + indtype = [ indtype1 indtype2 1]; + indlatency = strmatch('time', lower(fields), 'exact'); + indlatency = [ indlatency 1 ]; + uilist = { { 'style' 'text' 'string' [ 'File field containing event types' 10 '' ] } ... + { 'style' 'list' 'string' strvcat(fields) 'value' indtype(1) 'listboxtop' indtype(1)} ... + { 'style' 'text' 'string' [ 'File field containing event latencies' 10 '' ] } ... + { 'style' 'list' 'string' strvcat(fields) 'value' indlatency(1) 'listboxtop' indlatency(1) } ... + { 'style' 'text' 'string' [ 'File field containing event durations' 10 '' ] } ... + { 'style' 'list' 'string' strvcat({ 'None' fields{:} }) 'value' 1 'listboxtop' 1 } ... + { } { 'style' 'text' 'string' 'Note: scroll lists then click to select field' } }; + uigeom = { [2 1] [2 1] [2 1] 1 1 }; + result = inputgui(uigeom, uilist, 'pophelp(''pop_importpres'')', 'Import presentation file - pop_importpres()', ... + [], 'normal', [2 2 2 1 1]); + if isempty(result), return; end; + + indtype = result{1}; + indlat = result{2}; + inddur = result{3}-1; + typefield = fields{indtype}; + latfield = fields{indlat}; + if inddur ~= 0 + durfield = fields{inddur}; + else durfield = ''; + end; +end; +if isempty(indtype) + error(['Could not detect field ''' typefield ''', try importing the file as ASCII (use delimiter=9 (tab))']); +end; +if isempty(indlat) + error(['Could not detect field ''' latfield ''', try importing the file as ASCII (use delimiter=9 (tab))']); +end; +disp(['Replacing field ''' typefield ''' by ''type'' for EEGLAB compatibility']); +disp(['Replacing field ''' latfield ''' by ''latency'' for EEGLAB compatibility']); +fields{indtype} = 'type'; +fields{indlat} = 'latency'; +if inddur ~= 0 + fields{inddur} = 'duration'; +end + +% check inputs + + +% regularizing field names +% ------------------------ +for index = 1:length(fields) + indspace = find(fields{index} == ' '); + fields{index}(indspace) = '_'; + indparen = find(fields{index} == ')'); + if ~isempty(indparen) & indparen == length(fields{index}) + % remove text for parenthesis + indparen = find(fields{index} == '('); + if indparen ~= 1 + disp([ 'Renaming ''' fields{index} ''' to ''' fields{index}(1:indparen-1) ''' for Matlab compatibility' ]); + fields{index} = fields{index}(1:indparen-1); + else + fields{index}(indspace) = '_'; + end; + else + fields{index}(indspace) = '_'; + indparen = find(fields{index} == '('); + fields{index}(indspace) = '_'; + end; +end; + +% find if uncertainty is duplicated +% --------------------------------- +induncert = strmatch('uncertainty', lower(fields), 'exact'); +if length(induncert) > 1 + fields{induncert(2)}= 'Uncertainty2'; + disp('Renaming second ''Uncertainty'' field'); +end; + +% import file +% ----------- +if isempty(EEG.event), align = NaN; end; + +%EEG = pop_importevent(EEG, 'append', 'no', 'event', filename, 'timeunit', 1E-4, 'skipline', -3, ... +% 'delim', 9, 'align', align, 'fields', fields, varargin{:}); +EEG = pop_importevent(EEG, 'event', filename, 'timeunit', 1E-4, 'skipline', -3, ... + 'delim', 9, 'align', align, 'fields', fields, varargin{:}); + +command = sprintf('EEG = pop_importpres(%s, %s);', inputname(1), vararg2str({ filename typefield latfield durfield align })); + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_interp.m b/code/eeglab13_4_4b/functions/popfunc/pop_interp.m new file mode 100644 index 0000000..164e00d --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_interp.m @@ -0,0 +1,158 @@ +% pop_interp() - interpolate data channels +% +% Usage: EEGOUT = pop_interp(EEG, badchans, method); +% +% Inputs: +% EEG - EEGLAB dataset +% badchans - [integer array] indices of channels to interpolate. +% For instance, these channels might be bad. +% [chanlocs structure] channel location structure containing +% either locations of channels to interpolate or a full +% channel structure (missing channels in the current +% dataset are interpolated). +% method - [string] method used for interpolation (default is 'spherical'). +% 'invdist'/'v4' uses inverse distance on the scalp +% 'spherical' uses superfast spherical interpolation. +% 'spacetime' uses griddata3 to interpolate both in space +% and time (very slow and cannot be interupted). +% Output: +% EEGOUT - data set with bad electrode data replaced by +% interpolated data +% +% Author: Arnaud Delorme, CERCO, CNRS, 2009- + +% Copyright (C) Arnaud Delorme, CERCO, 2009, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG com] = pop_interp(EEG, bad_elec, method) + + com = ''; + if nargin < 1 + help pop_interp; + return; + end; + + if nargin < 2 + disp('Warning: interpolation can be done on the fly in studies'); + disp(' this function will actually create channels in the dataset'); + disp('Warning: do not interpolate channels before running ICA'); + disp('You may define channel location to interpolate in the channel'); + disp('editor and declare such channels as non-data channels'); + + enablenondat = 'off'; + if isfield(EEG.chaninfo, 'nodatchans') + if ~isempty(EEG.chaninfo.nodatchans) + enablenondat = 'on'; + end; + end; + + uilist = { { 'Style' 'text' 'string' 'What channel(s) do you want to interpolate' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'none selected' 'tag' 'chanlist' } ... + { 'style' 'pushbutton' 'string' 'Select from removed channels' 'callback' 'pop_interp(''nondatchan'',gcbf);' 'enable' enablenondat } ... + { 'style' 'pushbutton' 'string' 'Select from data channels' 'callback' 'pop_interp(''datchan'',gcbf);' } ... + { 'style' 'pushbutton' 'string' 'Use specific channels of other dataset' 'callback' 'pop_interp(''selectchan'',gcbf);'} ... + { 'style' 'pushbutton' 'string' 'Use all channels from other dataset' 'callback' 'pop_interp(''uselist'',gcbf);'} ... + { } ... + { 'style' 'text' 'string' 'Interpolation method'} ... + { 'style' 'popupmenu' 'string' 'Spherical|Planar (slow)' 'tag' 'method' } ... + }; + + geom = { 1 1 1 1 1 1 1 [1.1 1] }; + [res userdata tmp restag ] = inputgui( 'uilist', uilist, 'title', 'Interpolate channel(s) -- pop_interp()', 'geometry', geom, 'helpcom', 'pophelp(''pop_interp'')'); + if isempty(res) | isempty(userdata), return; end; + + if restag.method == 1 + method = 'spherical'; + else method = 'invdist'; + end; + bad_elec = userdata.chans; + + com = sprintf('EEG = pop_interp(EEG, %s, ''%s'');', userdata.chanstr, method); + if ~isempty(findstr('nodatchans', userdata.chanstr)) + eval( [ userdata.chanstr '=[];' ] ); + end; + + elseif isstr(EEG) + command = EEG; + clear EEG; + fig = bad_elec; + userdata = get(fig, 'userdata'); + + if strcmpi(command, 'nondatchan') + global EEG; + tmpchaninfo = EEG.chaninfo; + [chanlisttmp chanliststr] = pop_chansel( { tmpchaninfo.nodatchans.labels } ); + if ~isempty(chanlisttmp), + userdata.chans = EEG.chaninfo.nodatchans(chanlisttmp); + userdata.chanstr = [ 'EEG.chaninfo.nodatchans([' num2str(chanlisttmp) '])' ]; + set(fig, 'userdata', userdata); + set(findobj(fig, 'tag', 'chanlist'), 'string', chanliststr); + end; + elseif strcmpi(command, 'datchan') + global EEG; + tmpchaninfo = EEG.chanlocs; + [chanlisttmp chanliststr] = pop_chansel( { tmpchaninfo.labels } ); + if ~isempty(chanlisttmp), + userdata.chans = chanlisttmp; + userdata.chanstr = [ '[' num2str(chanlisttmp) ']' ]; + set(fig, 'userdata', userdata); + set(findobj(fig, 'tag', 'chanlist'), 'string', chanliststr); + end; + else + global ALLEEG EEG; + tmpanswer = inputdlg2({ 'Dataset index' }, 'Choose dataset', 1, { '' }); + if ~isempty(tmpanswer), + tmpanswernum = round(str2num(tmpanswer{1})); + if ~isempty(tmpanswernum), + if tmpanswernum > 0 & tmpanswernum <= length(ALLEEG), + TMPEEG = ALLEEG(tmpanswernum); + + tmpchans1 = TMPEEG.chanlocs; + if strcmpi(command, 'selectchan') + chanlist = pop_chansel( { tmpchans1.labels } ); + else + chanlist = 1:length(TMPEEG.chanlocs); % use all channels + end + + % look at what new channels are selected + tmpchans2 = EEG.chanlocs; + [tmpchanlist chaninds] = setdiff_bc( { tmpchans1(chanlist).labels }, { tmpchans2.labels } ); + if ~isempty(tmpchanlist), + if length(chanlist) == length(TMPEEG.chanlocs) + userdata.chans = TMPEEG.chanlocs; + userdata.chanstr = [ 'ALLEEG(' tmpanswer{1} ').chanlocs' ]; + else + userdata.chans = TMPEEG.chanlocs(chanlist(sort(chaninds))); + userdata.chanstr = [ 'ALLEEG(' tmpanswer{1} ').chanlocs([' num2str(chanlist(sort(chaninds))) '])' ]; + end; + set(fig, 'userdata', userdata); + tmpchanlist(2,:) = { ' ' }; + set(findobj(gcbf, 'tag', 'chanlist'), 'string', [ tmpchanlist{:} ]); + else + warndlg2('No new channels selected'); + end; + else + warndlg2('Wrong index'); + end; + end; + end; + end; + return; + end; + + EEG = eeg_interp(EEG, bad_elec, method); + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_jointprob.m b/code/eeglab13_4_4b/functions/popfunc/pop_jointprob.m new file mode 100644 index 0000000..eab95eb --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_jointprob.m @@ -0,0 +1,242 @@ +% pop_jointprob() - reject artifacts in an EEG dataset using joint +% probability of the recorded electrode or component +% activities observed at each time point. e.g., Observing +% large absoluate values at most electrodes or components +% is improbable and may well mark the presence of artifact. +% Usage: +% >> pop_jointprob( INEEG, typerej) % pop-up interative window mode +% >> [OUTEEG, locthresh, globthresh, nrej] = ... +% = pop_jointprob( INEEG, typerej, elec_comp, ... +% locthresh, globthresh, superpose, reject, vistype); +% +% Graphic interface: +% "Electrode" - [edit box] electrode|component number(s) to take into +% consideration for rejection. Sets the 'elec_comp' +% parameter in the command line call (see below). +% "Single-channel limit(s)" - [edit box] activity probability limit(s) (in +% std. dev.) Sets the 'locthresh' command line parameter. +% If more than one, defined individual electrode|channel +% limits. If fewer values than the number of electrodes | +% components specified above, the last input value is used +% for all remaining electrodes|components. +% "All-channel limit(s)" - [edit box] activity probability limit(s) (in std. +% dev.) for all channels (grouped). Sets the 'globthresh' +% command line parameter. +% "Display with previously marked rejections?" - [edit box] either YES or +% NO. Sets the command line option 'superpose'. +% "Reject marked trial(s)?" - [edit box] either YES or NO. Sets the +% command line option 'reject'. +% "visualization mode" - [edit box] either REJECTRIALS or EEGPLOT. +% Sets the command line option 'vistype'. +% Inputs: +% INEEG - input dataset +% typerej - [1|0] data to reject on (0 = component activations; +% 1 = electrode data). {Default: 1 = electrode data}. +% elec_comp - [n1 n2 ...] electrode|component number(s) to take into +% consideration for rejection +% locthresh - activity probability limit(s) (in std. dev.) See "Single- +% channel limit(s)" above. +% globthresh - global limit(s) (all activities grouped) (in std. dev.) +% superpose - [0|1] 0 = Do not superpose rejection marks on previously +% marks stored in the dataset: 1 = Show both current and +% previous marks using different colors. {Default: 0}. +% reject - 0 = do not reject marked trials (but store the marks: +% 1 = reject marked trials {Default: 1}. +% vistype - visualization mode: 0 = rejstatepoch(); 1 = eegplot() +% {Default: 0}. +% +% Outputs: +% OUTEEG - output dataset with updated joint probability array +% locthresh - electrodes probability of activity thresholds in terms +% of standard-dev. +% globthresh - global threshold (where all electrode activity are +% regrouped). +% nrej - number of rejected sweeps +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: jointprob(), rejstatepoch(), eegplot(), eeglab(), pop_rejepoch() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 added srate argument to eegplot call -ad +% 03-08-02 add eeglab options -ad + +function [EEG, locthresh, globthresh, nrej, com] = pop_jointprob( EEG, icacomp, elecrange, ... + locthresh, globthresh, superpose, reject, vistype, topcommand); +com = ''; +if nargin < 1 + help pop_jointprob; + return; +end; +if nargin < 2 + icacomp = 1; +end; + +if icacomp == 0 + if isempty( EEG.icasphere ) + ButtonName=questdlg( 'Do you want to run ICA now ?', ... + 'Confirmation', 'NO', 'YES', 'YES'); + switch ButtonName, + case 'NO', disp('Operation cancelled'); return; + case 'YES', [ EEG com ] = pop_runica(EEG); + end % switch + end; +end; +if exist('reject') ~= 1 + reject = 1; +end; + +if nargin < 3 + + % which set to save + % ----------------- + promptstr = { [ fastif(icacomp, 'Electrode', 'Component') ' (number(s); Ex: 2 4 5):' ], ... + [ fastif(icacomp, 'Single-channel', 'Single-component') ' limit(s) (std. dev(s).: Ex: 2 2 2.5):'], ... + [ fastif(icacomp, 'All-channel', 'All-component') ' limit(s) (std. dev(s).: Ex: 2 2.1 2):'], ... + 'Display previously marked rejections? (YES or NO)', ... + 'Reject marked trial(s)? (YES or NO)', ... + 'Visualization mode (REJECTRIALS|EEGPLOT)' }; + inistr = { fastif(icacomp, ['1:' int2str(EEG.nbchan)], ['1:' int2str(size(EEG.icaweights,1))])... + fastif(icacomp, '3', '5'), ... + fastif(icacomp, '3', '5'), ... + 'YES', ... + 'NO', ... + 'REJECTTRIALS' }; + + result = inputdlg2( promptstr, fastif( ~icacomp, 'Reject. improbable comp. -- pop_jointprob()', 'Reject improbable data -- pop_jointprob()'), 1, inistr, 'pop_jointprob'); + size_result = size( result ); + if size_result(1) == 0 return; end; + elecrange = result{1}; + locthresh = result{2}; + globthresh = result{3}; + switch lower(result{4}), case 'yes', superpose=1; otherwise, superpose=0; end; + switch lower(result{5}), case 'yes', reject=1; otherwise, reject=0; end; + switch lower(result{6}), case 'rejecttrials', vistype=0; otherwise, vistype=1; end; +end; + +if ~exist('vistype') vistype = 0; end; +if ~exist('reject') reject = 0; end; +if ~exist('superpose') superpose = 1; end; + +if isstr(elecrange) % convert arguments if they are in text format + calldisp = 1; + elecrange = eval( [ '[' elecrange ']' ] ); + locthresh = eval( [ '[' locthresh ']' ] ); + globthresh = eval( [ '[' globthresh ']' ] ); +else + calldisp = 0; +end; + +if isempty(elecrange) + error('No electrode selectionned'); +end; + +% compute the joint probability +% ----------------------------- +if icacomp == 1 + fprintf('Computing joint probability for channels...\n'); + tmpdata = eeg_getdatact(EEG); + if isempty(EEG.stats.jpE) + [ EEG.stats.jpE rejE ] = jointprob( tmpdata, locthresh, EEG.stats.jpE, 1); + end; + [ tmp rejEtmp ] = jointprob( tmpdata(elecrange,:,:), locthresh, EEG.stats.jpE(elecrange,:), 1); + rejE = zeros(EEG.nbchan, size(rejEtmp,2)); + rejE(elecrange,:) = rejEtmp; + + fprintf('Computing all-channel probability...\n'); + tmpdata2 = permute(tmpdata, [3 1 2]); + tmpdata2 = reshape(tmpdata2, size(tmpdata2,1), size(tmpdata2,2)*size(tmpdata2,3)); + [ EEG.stats.jp rej ] = jointprob( tmpdata2, globthresh, EEG.stats.jp, 1); + clear tmpdata2; +else + tmpdata = eeg_getica(EEG); + fprintf('Computing joint probability for components...\n'); + if isempty(EEG.stats.icajpE) + [ EEG.stats.icajpE rejE ] = jointprob( tmpdata, locthresh, EEG.stats.icajpE, 1); + end; + [ tmp rejEtmp ] = jointprob( tmpdata(elecrange,:), locthresh, EEG.stats.icajpE(elecrange,:), 1); + rejE = zeros(size(tmpdata,1), size(rejEtmp,2)); + rejE(elecrange,:) = rejEtmp; + + fprintf('Computing global joint probability...\n'); + tmpdata2 = permute(tmpdata, [3 1 2]); + tmpdata2 = reshape(tmpdata2, size(tmpdata2,1), size(tmpdata2,2)*size(tmpdata2,3)); + [ EEG.stats.icajp rej] = jointprob( tmpdata2, globthresh, EEG.stats.icajp, 1); + clear tmpdata2; +end; +rej = rej' | max(rejE, [], 1); +fprintf('%d/%d trials marked for rejection\n', sum(rej), EEG.trials); + +if calldisp + if vistype == 1 % EEGPLOT ------------------------- + if icacomp == 1 macrorej = 'EEG.reject.rejjp'; + macrorejE = 'EEG.reject.rejjpE'; + else macrorej = 'EEG.reject.icarejjp'; + macrorejE = 'EEG.reject.icarejjpE'; + end; + colrej = EEG.reject.rejjpcol; + eeg_rejmacro; % script macro for generating command and old rejection arrays + + if icacomp == 1 + eegplot( tmpdata(elecrange,:,:), 'srate', ... + EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + else + eegplot( tmpdata(elecrange,:,:), 'srate', ... + EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + end; + else % REJECTRIALS ------------------------- + if icacomp == 1 + [ rej, rejE, n, locthresh, globthresh] = ... + rejstatepoch( tmpdata(elecrange,:,:), EEG.stats.jpE(elecrange,:), 'global', 'on', 'rejglob', EEG.stats.jp, ... + 'threshold', locthresh, 'thresholdg', globthresh, 'normalize', 'off' ); + else + [ rej, rejE, n, locthresh, globthresh] = ... + rejstatepoch( tmpdata(elecrange,:,:), EEG.stats.icajpE(elecrange,:), 'global', 'on', 'rejglob', EEG.stats.icajp, ... + 'threshold', locthresh, 'thresholdg', globthresh, 'normalize', 'off' ); + end; + nrej = n; + end; +else + % compute rejection locally + rejtmp = max(rejE(elecrange,:),[],1); + rej = rejtmp | rej; + nrej = sum(rej); + fprintf('%d trials marked for rejection\n', nrej); +end; +if ~isempty(rej) + if icacomp == 1 + EEG.reject.rejjp = rej; + EEG.reject.rejjpE = rejE; + else + EEG.reject.icarejjp = rej; + EEG.reject.icarejjpE = rejE; + end; + if reject + EEG = pop_rejepoch(EEG, rej, 0); + end; +end; +nrej = sum(rej); + +com = [ com sprintf('%s = pop_jointprob(%s,%s);', inputname(1), ... + inputname(1), vararg2str({icacomp,elecrange,locthresh,globthresh,superpose,reject})) ]; +if nargin < 3 & nargout == 2 + locthresh = com; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_loadbci.m b/code/eeglab13_4_4b/functions/popfunc/pop_loadbci.m new file mode 100644 index 0000000..a8a67bd --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_loadbci.m @@ -0,0 +1,357 @@ +% pop_loadbci() - import a BCI2000 ascii file into EEGLAB +% +% Usage: +% >> OUTEEG = pop_loadbci( filename, srate ); +% +% Inputs: +% filename - file name +% srate - sampling rate +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, CNL / Salk Institute, 9 July 2002 +% +% See also: eeglab() + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_loadbci(filename, srate); + + EEG = []; + command = ''; + + if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.*', 'Choose a BCI file -- pop_loadbci'); + drawnow; + if filename == 0 return; end; + filename = [filepath filename]; + promptstr = { 'Sampling rate' }; + inistr = { '256' }; + result = inputdlg2( promptstr, 'Import BCI2000 data -- pop_loadbci()', 1, inistr, 'pop_loadbci'); + if length(result) == 0 return; end; + srate = eval( result{1} ); + end; + + % import data + % ----------- + EEG = eeg_emptyset; + fprintf('Pop_loadbci: importing BCI file...\n'); + try + % try to read as matlab + % --------------------- + bci = load( filename, '-mat'); + allfields = fieldnames(bci); + allfields = setdiff_bc(allfields, 'signal'); + for index = 1:size(bci.signal,2) + chanlabels{index} = [ 'C' int2str(index) ]; + end; + for index = 1:length(allfields) + bci.signal(:,end+1) = getfield(bci, allfields{index}); + end; + EEG.chanlocs = struct('labels', { chanlabels{:} allfields{:} }); + EEG.data = bci.signal'; + EEG.nbchan = size(EEG.data, 1); + EEG.pnts = size(EEG.data, 2); + EEG.trials = 1; + EEG.srate = srate; + EEG.comments = [ 'Original file: ' filename ]; + EEG = eeg_checkset(EEG); + return; + catch + % get file names + % -------------- + fields = loadtxt(filename, 'nlines', 1, 'verbose', 'off'); + if length(fields) > 300 + error('Not a BCI ASCII file'); + end; + + % read data + % --------- + fid = fopen(filename, 'r'); + allcollumns = fgetl(fid); + tmpdata = fscanf(fid, '%d', Inf); + tmpdata = reshape(tmpdata, length(fields), length(tmpdata)/length(fields)); + + EEG.data = tmpdata; + EEG.chanlocs = struct('labels', fields); + EEG.nbchan = size(EEG.data, 1); + EEG.pnts = size(EEG.data, 2); + EEG.trials = 1; + EEG.srate = srate; + EEG = eeg_checkset(EEG); + return; + + % data channel range + % ------------------ + indices = strmatch('ch', fields); + + bci = []; + for index = setdiff_bc(1:length(fields), indices) + bci = setfield(bci, fields{index}, tmpdata(index,:)); + end; + bci.signal = tmpdata(indices,:); + end; + + + % ask for which event to import + % ----------------------------- + geom = {[0.7 0.7 0.7]}; + uilist = { { 'style' 'text' 'string' 'State name' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' ' Import' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Type of' 'fontweight' 'bold' } }; + allfields = setdiff_bc(fieldnames(bci), 'signal'); + latencyfields = { '-----' }; + for index = 1:length(allfields) + if ~isempty(findstr( lower(allfields{index}), 'time')) + latencyfields{end+1} = allfields{index}; + end; + end; + for index = 1:length(allfields) + geom = { geom{:} [1.3 0.3 0.3 0.3 1] }; + uilist{end+1} = { 'style' 'text' 'string' allfields{index} }; + if ~isempty(findstr( lower(allfields{index}), 'time')) + uilist{end+1} = { 'style' 'checkbox' 'value' 0 }; + uilist{end+1} = { }; + uilist{end+1} = { }; + uilist{end+1} = { }; + else + uilist{end+1} = { 'style' 'checkbox' }; + uilist{end+1} = { }; + uilist{end+1} = { }; + uilist{end+1} = { 'style' 'listbox' 'string' strvcat(latencyfields) }; + end; + end; + geom = { geom{:} [1] [0.08 1] }; + uilist{end+1} = { }; + uilist{end+1} = { 'style' 'checkbox' 'value' 0 }; + uilist{end+1} = { 'style' 'text' 'string' 'Attempt to adjust event latencies using sourcetime?' }; + + result = inputgui( geom, uilist, 'pophelp(''pop_loadbci'')', 'Import BCI2000 data files - pop_loadbci()'); + if isempty(result), return; end; + + % convert results to command line input + % ------------------------------------- + listimport = {}; + count = 1; + for index = 1:length(allfields) + if ~isempty(findstr( lower(allfields{index}), 'time')) + if result{count}, listimport{end+1} = 'event'; listimport{end+1} = { allfields{index} }; end; + count = count+1; + else + if result{count} + if result{count+1} ~= 1 + listimport{end+1} = 'event'; listimport{end+1} = { allfields{index} allfields{result{count+1}-1} }; + else + listimport{end+1} = 'event'; listimport{end+1} = { allfields{index} }; + end; + end; + count = count+2; + end; + end; + if result{end}, adjust = 1; else adjust = 0; end; + + % decode command line input + % ------------------------- + count = 1; + for index = 2:2:length(listimport) + tmpindmatch = strmatch(listimport{index}{1}, allfields, 'exact'); + if ~isempty(tmpindmatch), indeximport(count) = tmpindmatch; + else error(['State ''' listimport{index}{1} ''' not found']); + end; + if length( listimport{index} ) > 1 + tmpindmatch = strmatch(listimport{index}{2}, allfields, 'exact'); + if ~isempty(tmpindmatch), corresp(count) = tmpindmatch; + else error(['State ''' listimport{index}{2} ''' not found']); + end; + else + corresp(count) = 0; + end; + count = count+1; + end; + + % find block size + % --------------- + tmpevent = find( diff(getfield(bci, 'SourceTime')) ~= 0); + diffevent = tmpevent(2:end)-tmpevent(1:end-1); + blocksize = unique_bc(diffevent); + if length(blocksize) > 1, error('Error in determining block size'); + else fprintf('Blocksize: %d\n', blocksize); + end; + + % find types + % ---------- + tmpcorresp = find(corresp); + indexcorresp = corresp(tmpcorresp); + indexcorrespval = indeximport(tmpcorresp); + if length(tmpcorresp) ~= length(intersect(corresp, indeximport)) + disp('Warning: correspondance problem, some information will be lost'); + end; + + % remove type from latency array + % ------------------------------ + indeximport(tmpcorresp) = []; + if adjust + fprintf('Latency of event will be adjusted\n'); + else fprintf('WARNING: Latency of event will not be adjusted (latency uncertainty %2.1f ms)\n', ... + blocksize/srate*1000); + end; + + % process events + % -------------- + fprintf('Pop_loadbci: importing events...\n'); + counte = 1; % event counter + events(10000).latency = 0; + indexsource = strmatch('sourcetime', lower( allfields ), 'exact' ); + sourcetime = getfield(bci, allfields{ indexsource }); + for index = 1:length(indeximport) + tmpdata = getfield(bci, allfields{indeximport(index)}); + tmpevent = find( diff(tmpdata) > 0); + tmpevent = tmpevent+1; + tmpcorresp = find(indexcorresp == indeximport(index)); + + for tmpi = tmpevent' + if ~isempty(tmpcorresp) + events(counte).type = allfields{ indexcorrespval(tmpcorresp) }; + else + events(counte).type = allfields{ indeximport(index) }; + end; + if adjust + baselatency = sourcetime(tmpi); % note that this is the first bin a block + realtmpi = tmpi+blocksize; % jump to the end of the block+1 + if curlatency < baselatency, curlatency = curlatency+65536; end; % in ms + events(counte).latency = realtmpi+(curlatency-baselatency)/1000*srate; + % (curlatency-baselatency)/1000*srate + % there is still a potentially large error between baselatency <-> realtmpi + else + events(counte).latency = tmpi+(blocksize-1)/2; + end; + counte = counte+1; + end; + end; + + EEG.data = bci.signal'; + EEG.nbchan = size(EEG.data, 1); + EEG.pnts = size(EEG.data, 2); + EEG.trials = 1; + EEG.srate = srate; + EEG = eeg_checkset(EEG); + EEG.event = events(1:counte-1); + EEG = eeg_checkset( EEG, 'eventconsistency' ); + EEG = pop_editeventvals( EEG, 'sort', { 'latency', [0] } ); + +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ +% $$$ dsffd +% $$$ +% $$$ % find electrode indices +% $$$ % ---------------------- +% $$$ indices = []; +% $$$ for index = 1:length(colnames) +% $$$ if strcmp( colnames{index}(1:2), 'ch') +% $$$ indices = [indices index ]; +% $$$ end; +% $$$ end; +% $$$ +% $$$ EEG.data = tmpdata(indices,:); +% $$$ EEG.nbchan = size(EEG.data, 1); +% $$$ EEG.srate = srate; +% $$$ try +% $$$ eventindices = setdiff_bc(1:length(colnames), indices); +% $$$ ISIind = eventindices(3 + 9); +% $$$ eventindices(3 + [ 1 2 3 4 7 8 9 10 11 12]) = []; +% $$$ eventindices(1:3) = []; % suppress these event +% $$$ +% $$$ % add the trial number +% $$$ % -------------------- +% $$$ tmptrial = find( diff(tmpdata(ISIind, :)) ~= 0); +% $$$ tmptrial = tmptrial+1; +% $$$ +% $$$ % process events +% $$$ % -------------- +% $$$ fprintf('Pop_loadbci: importing events...\n'); +% $$$ counte = 1; % event counter +% $$$ events(10000).latency = 0; +% $$$ for index = eventindices +% $$$ counttrial = 1; +% $$$ tmpevent = find( diff(tmpdata(index, :)) ~= 0); +% $$$ tmpevent = tmpevent+1; +% $$$ for tmpi = tmpevent +% $$$ if tmpdata(index, tmpi) +% $$$ events(counte).type = [ colnames{index} int2str(tmpdata(index, tmpi)) ]; +% $$$ events(counte).latency = tmpi; +% $$$ %events(counte).value = tmpdata(index, tmpi); +% $$$ %while tmpi > tmptrial(counttrial) & counttrial < length(tmptrial) +% $$$ % counttrial = counttrial+1; +% $$$ %end; +% $$$ %events(counte).trial = counttrial; +% $$$ counte = counte+1; +% $$$ %if mod(counte, 100) == 0, fprintf('%d ', counte); end; +% $$$ end; +% $$$ end; +% $$$ end; +% $$$ +% $$$ % add up or down events +% $$$ % --------------------- +% $$$ EEG = eeg_checkset(EEG); +% $$$ EEG.event = events(1:counte-1); +% $$$ EEG = pop_editeventvals( EEG, 'sort', { 'latency', [0] } ); +% $$$ for index=1:length(EEG.event) +% $$$ if strcmp(EEG.event(index).type(1:6), 'Target') +% $$$ targetcode = str2num(EEG.event(index).type(end)); +% $$$ if targetcode == 1 +% $$$ EEG.event(index).type = 'toptarget'; +% $$$ else +% $$$ EEG.event(index).type = 'bottomtarget'; +% $$$ end; +% $$$ else +% $$$ if strcmp(EEG.event(index).type(1:6), 'Result') +% $$$ resultcode = str2num(EEG.event(index).type(end)); +% $$$ if resultcode == 1 +% $$$ EEG.event(index).type = 'topresp'; +% $$$ else +% $$$ EEG.event(index).type = 'bottomresp'; +% $$$ end; +% $$$ EEG.event(end+1).latency = EEG.event(index).latency; +% $$$ if (resultcode == targetcode) +% $$$ EEG.event(end).type = 'correct'; +% $$$ else +% $$$ EEG.event(end).type = 'miss'; +% $$$ end; +% $$$ end; +% $$$ end; +% $$$ end; +% $$$ EEG = pop_editeventvals( EEG, 'sort', { 'latency', [0] } ); +% $$$ %EEG.data = tmpdata([72 73 75],:); +% $$$ catch, disp('Failed to import data events'); +% $$$ end; +% $$$ +% $$$ command = sprintf('EEG = pop_loadbci(''%s'', %f);',filename, srate); +% $$$ return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_loadcnt.m b/code/eeglab13_4_4b/functions/popfunc/pop_loadcnt.m new file mode 100644 index 0000000..45f6616 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_loadcnt.m @@ -0,0 +1,234 @@ +% pop_loadcnt() - load a neuroscan CNT file (pop out window if no arguments). +% +% Usage: +% >> EEG = pop_loadcnt; % pop-up window mode +% >> EEG = pop_loadcnt( filename, 'key', 'val', ...); +% +% Graphic interface: +% "Data fomat" - [checkbox] 16-bits or 32-bits. We couldn't find in the +% data file where this information was stored. Command +% line equivalent in loadcnt() 'dataformat'. +% "Time interval in seconds" - [edit box] specify time interval [min max] +% to import portion of data. Command line equivalent +% in loadcnt: 't1' and 'lddur' +% "Import keystrokes" - [checkbox] set this option to import keystroke +% event types in dataset. Command line equivalent +% 'keystroke'. +% "loadcnt() 'key', 'val' params" - [edit box] Enter optional loadcnt() +% parameters. +% +% Inputs: +% filename - file name +% +% Optional inputs: +% 'keystroke' - ['on'|'off'] set the option to 'on' to import +% keystroke event types. Default is off. +% 'memmapfile' - ['memmapfile_name'] use this option if the .cnt file +% is too large to read in conventially. The suffix of +% the memmapfile_name must be .fdt. the memmapfile +% functions process files based on their suffix and an +% error will occur if you use a different suffix. +% Same as loadcnt() function. +% +% Outputs: +% EEG - EEGLAB data structure +% +% Note: +% 1) This function extract all non-null event from the CNT data structure. +% Null events are usually associated with internal signals (recalibrations...). +% 2) The "Average reference" edit box had been remove since the re-referencing +% menu of EEGLAB offers more options to re-reference data. +% 3) The 'blockread' has been disabled since we found where this information +% was stored in the file. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: loadcnt(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [EEG, command] = pop_loadcnt(filename, varargin); +command = ''; +EEG = []; + +if nargin < 1 + + % ask user + [filename, filepath] = uigetfile('*.CNT;*.cnt', 'Choose a CNT file -- pop_loadcnt()'); + drawnow; + if filename == 0 return; end; + + % popup window parameters + % ----------------------- + callback16 = 'set(findobj(gcbf, ''tag'', ''B32''), ''value'', ~get(gcbo, ''value'')); set(findobj(gcbf, ''tag'', ''AD''), ''value'', ~get(gcbo, ''value''));'; + callback32 = 'set(findobj(gcbf, ''tag'', ''B16''), ''value'', ~get(gcbo, ''value'')); set(findobj(gcbf, ''tag'', ''AD''), ''value'', ~get(gcbo, ''value''));'; + callbackAD = 'set(findobj(gcbf, ''tag'', ''B16''), ''value'', ~get(gcbo, ''value'')); set(findobj(gcbf, ''tag'', ''B32''), ''value'', ~get(gcbo, ''value''));'; + uigeom = { [1.3 0.5 0.5 0.5] [1 0.5] [1.09 0.13 0.4] [1 0.5] [1 0.5] 1 } ; + uilist = { { 'style' 'text' 'string' 'Data format 16 or 32 bit (Default = Autodetect)' } ... + { 'style' 'checkbox' 'tag' 'B16' 'string' '16-bits' 'value' 0 'callback' callback16 } ... + { 'style' 'checkbox' 'tag' 'B32' 'string' '32-bits' 'value' 0 'callback' callback32 } ... + { 'style' 'checkbox' 'tag' 'AD' 'string' 'Autodetect' 'value' 1 'callback' callbackAD } ... + { 'style' 'text' 'string' 'Time interval in s (i.e. [0 100]):' } ... + { 'style' 'edit' 'string' '' 'callback' 'warndlg2([ ''Events latency might be innacurate when'' 10 ''importing time intervals (this is an open issue)'']);' } ... + { 'style' 'text' 'string' 'Check to Import keystrokes:' } ... + { 'style' 'checkbox' 'string' '' } { } ... + { 'style' 'text' 'string' 'loadcnt() ''key'', ''val'' params' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' [ 'Large files, enter a file name for memory mapping (xxx.fdt)' ] } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' ' Note: requires to enable memory mapping in EEGLAB memory options and only works for 32-bit files' } }; + result = inputgui( uigeom, uilist, 'pophelp(''pop_loadcnt'')', 'Load a CNT dataset'); + if length( result ) == 0 return; end; + + % decode parameters + % ----------------- + options = []; + if result{1}, options = [ options ', ''dataformat'', ''int16''' ]; + elseif result{2}, options = [ options ', ''dataformat'', ''int32''' ]; + elseif result{3}, options = [ options ', ''dataformat'', ''auto''' ]; + end; + if ~isempty(result{4}), + timer = eval( [ '[' result{4} ']' ]); + options = [ options ', ''t1'', ' num2str(timer(1)) ', ''lddur'', ' num2str(timer(2)-timer(1)) ]; + end; + if result{5}, options = [ options ', ''keystroke'', ''on''' ]; end; + if ~isempty(result{6}), options = [ options ',' result{6} ]; end; + % Conditional pass if ~isempty(result{7}), options = ... + % [options ', ''memmapfile''', result{7} ] ; end ; + % Always pass the memmapfile paramter? + options = [ options ', ''memmapfile'', ''', result{7} '''' ] ; +else + options = vararg2str(varargin); +end; + +% load datas +% ---------- +EEG = eeg_emptyset; +if exist('filepath') + fullFileName = sprintf('%s%s', filepath, filename); +else + fullFileName = filename; +end; +if nargin > 0 + if ~isempty(varargin) + r = loadcnt( fullFileName, varargin{:}); + else + r = loadcnt( fullFileName); + end; +else + eval( [ 'r = loadcnt( fullFileName ' options ');' ]); +end; + +if isfield(r, 'dat') + error('pop_loadcnt is not compatible with current loadcnt version, please use latest loadcnt() version'); +end; +% Check to see if data is in memory or in a file. +EEG.data = r.data; +EEG.comments = [ 'Original file: ' fullFileName ]; +EEG.setname = 'CNT file'; +EEG.nbchan = r.header.nchannels; + +% inport events +% ------------- +I = 1:length(r.event); +if ~isempty(I) + EEG.event(1:length(I),1) = [ r.event(I).stimtype ]; + EEG.event(1:length(I),2) = [ r.event(I).offset ]+1; + EEG.event = eeg_eventformat (EEG.event, 'struct', { 'type' 'latency' }); +end; + +% modified by Andreas Widmann 2005/05/12 14:15:00 +try, % this piece of code makes the function crash sometimes - Arnaud Delorme 2006/04/27 + temp = find([r.event.accept_ev1] == 14 | [r.event.accept_ev1] == 11); % 14: Discontinuity, 11: DC reset + if ~isempty(temp) + disp('pop_loadcnt note: event field ''type'' set to ''boundary'' for data discontinuities'); + for index = 1:length(temp) + EEG.event(temp(index)).type = 'boundary'; + end; + end +catch, end; +% end modification + +% process keyboard entries +% ------------------------ +if ~isempty(findstr('keystroke', lower(options))) + tmpkbd = [ r.event(I).keyboard ]; + tmpkbd2 = [ r.event(I).keypad_accept ]; + for index = 1:length(EEG.event) + if EEG.event(index).type == 0 + if r.event(index).keypad_accept, + EEG.event(index).type = [ 'keypad' num2str(r.event(index).keypad_accept) ]; + else + EEG.event(index).type = [ 'keyboard' num2str(r.event(index).keyboard) ]; + end; + end; + end; +else + % removeing keystroke events + % -------------------------- + rmind = []; + for index = 1:length(EEG.event) + if EEG.event(index).type == 0 + rmind = [rmind index]; + end; + end; + if ~isempty(rmind) + fprintf('Ignoring %d keystroke events\n', length(rmind)); + EEG.event(rmind) = []; + end; +end; + +% import channel locations (Neuroscan coordinates are not wrong) +% ------------------------ +%x = celltomat( { r.electloc.x_coord } ); +%y = celltomat( { r.electloc.y_coord } ); +for index = 1:length(r.electloc) + names{index} = deblank(char(r.electloc(index).lab')); + if size(names{index},1) > size(names{index},2), names{index} = names{index}'; end; +end; +EEG.chanlocs = struct('labels', names); +%EEG.chanlocs = readneurolocs( { names x y } ); +%disp('WARNING: Electrode locations imported from CNT files may not reflect true locations'); + +% Check to see if data is in a file or in memory +% If in memory, leave alone +% If in a file, use values set in loadcnt.m for nbchan and pnts. +EEG.srate = r.header.rate; +EEG.nbchan = size(EEG.data,1) ; +EEG.nbchan = r.header.nchannels ; +% EEG.nbchan = size(EEG.data,1); +EEG.trials = 1; +EEG.pnts = r.ldnsamples ; +%size(EEG.data,2) + +%EEG.pnts = r.header.pnts +%size(EEG.data,2); +EEG = eeg_checkset(EEG, 'eventconsistency'); +EEG = eeg_checkset(EEG, 'makeur'); + +if ((size(EEG.data,1) ~= EEG.nbchan) && (size(EEG.data,2) ~= EEG.pnts)) + % Assume a data file + EEG = eeg_checkset(EEG, 'loaddata'); +end +if length(options) > 2 + command = sprintf('EEG = pop_loadcnt(''%s'' %s);',fullFileName, options); +else + command = sprintf('EEG = pop_loadcnt(''%s'');',fullFileName); +end; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_loaddat.m b/code/eeglab13_4_4b/functions/popfunc/pop_loaddat.m new file mode 100644 index 0000000..4c80975 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_loaddat.m @@ -0,0 +1,105 @@ +% pop_loaddat() - merge a neuroscan DAT file with input dataset +% (pop out window if no arguments). +% +% Usage: +% >> OUTEEG = pop_loaddat( INEEG ); % pop-up window mode +% >> OUTEEG = pop_loaddat( INEEG, filename, no_rt); +% +% Graphic interfance: +% "Code signifying no event ..." - [edit box] reaction time +% no event code. See 'no_rt' command line equivalent +% help. +% Inputs: +% filename - file name +% INEEG - input EEGLAB data structure +% no_rt - no reaction time integer code (ex: 1000). Since +% a number has to be defined for each reaction +% time, epochs with no reaction time usually have +% a stereotyped reaction time value (such as 1000). +% Default none. +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, CNL/Salk Institute, 2001 +% +% See also: loaddat(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 13/02/02 removed the no latency option -ad + +function [EEG, command] = pop_loaddat(EEG, filename, no_rt); +command = ''; + +if nargin < 1 + help pop_loaddat; + return; +end; + +if nargin < 2 + % ask user + [filename, filepath] = uigetfile('*.DAT', 'Choose a DAT file -- pop_loaddat'); + drawnow; + if filename == 0 return; end; + result = inputdlg2( { strvcat('Code signifying no event in a trial ([]=none)', ... + '(none=all latencies are imported)')}, ... + 'Load Neuroscan DATA file -- pop_loaddat()', 1, {'1000'}, 'pop_loaddat'); + if length(result) == 0 return; end; + no_rt = eval( result{1} ); +end; +if exist('no_rt') ~= 1 | isempty(no_rt) + no_rt = NaN; +end; + +% load datas +% ---------- +if exist('filepath') + fullFileName = sprintf('%s%s', filepath, filename); +else + fullFileName = filename; +end; +disp('Loading dat file...'); +[typeeeg, rt, response, n] = loaddat( fullFileName ); + +if n ~= EEG.trials + error('pop_loaddat, number of trials in input dataset and DAT file different, aborting'); +end; + +for index = 1:length(EEG.event) + EEG.event(index).eegtype = typeeeg (EEG.event(index).epoch); + EEG.event(index).response = response(EEG.event(index).epoch); +end; + +for index = 1:n + if rt(index) ~= no_rt + EEG.event(end+1).type = 'rt'; + EEG.event(end).latency = eeg_lat2point(rt(index)/1000, index, EEG.srate, [EEG.xmin EEG.xmax]); + EEG.event(end).epoch = index; + EEG.event(end).eegtype = typeeeg(index); + EEG.event(end).response = response(index); + end +end; +tmpevent = EEG.event; +tmp = [ tmpevent.latency ]; +[tmp indexsort] = sort(tmp); +EEG.event = EEG.event(indexsort); +EEG = eeg_checkset(EEG, 'eventconsistency'); + +command = sprintf('%s = pop_loaddat(%s, %s, %d);', inputname(1), inputname(1), fullFileName, no_rt); + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_loadeeg.m b/code/eeglab13_4_4b/functions/popfunc/pop_loadeeg.m new file mode 100644 index 0000000..1d667d8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_loadeeg.m @@ -0,0 +1,145 @@ +% pop_loadeeg() - load a Neuroscan .EEG file (via a pop-up window if no +% arguments). Calls loadeeg(). +% +% Usage: +% >> EEG = pop_loadeeg; % pop-up data entry window +% >> EEG = pop_loadeeg( filename, filepath, range_chan, range_trials, ... +% range_typeeeg, range_response, format); % no pop-up window +% +% Graphic interface: +% "Data precision in bits..." - [edit box] data binary format length +% in bits. Command line equivalent: 'format' +% "Trial range subset" - [edit box] integer array. +% Command line equivalent: 'range_trials' +% "Type range subset" - [edit box] integer array. +% Command line equivalent: 'range_typeeeg' +% "Electrode subset" - [edit box] integer array. +% Command line equivalent: 'range_chan' +% "Response range subset" - [edit box] integer array. +% Command line equivalent: 'range_response' +% +% Inputs: +% filename - ['string'] file name +% filepath - ['string'] file path +% range_chan - [integer array] Import only selected electrodes +% Ex: 3,4:10; {Default: [] -> import all} +% range_trials - [integer array] Import only selected trials +% { Default: [] -> import all} +% range_typeeeg - [integer array] Import only trials of selected type +% {Default: [] -> import all} +% range_response - [integer array] Import only trials with selected +% response values {Default: [] -> import all} +% format - ['short'|'int32'] data binary format (Neuroscan 4.3 +% saves data as 'int32'; earlier versions save data as +% 'short'. Default is 'short'. +% Outputs: +% EEG - eeglab() data structure +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: loadeeg(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +% uses calls to eeg_emptyset and loadeeg + +% popup loadeeg file +% ------------------ +function [EEG, command] = pop_loadeeg(filename, filepath, range_chan, range_sweeps, range_typeeeg, range_response, datformat); + +EEG = []; +command = ''; + +if nargin < 1 + + % ask user + [filename, filepath] = uigetfile('*.eeg;*.EEG', 'Choose an EEG file -- pop_loadeeg()'); + if filename == 0 return; end; + + % popup window parameters + % ----------------------- + promptstr = { 'Data precision in bits (16 / 32 bit or Auto for NS v4.3):', ... + 'Trial range subset:', ... + 'Type range subset:', ... + 'Electrodes subset:', ... + 'Response range subset:'}; + inistr = { 'Auto' '' '' '' '' }; + pop_title = sprintf('Load an EEG dataset'); + result = inputdlg2( promptstr, pop_title, 1, inistr, 'pop_loadeeg'); + if size( result,1 ) == 0 return; end; + + % decode parameters + % ----------------- + precision = lower(strtrim(result{1})); + if strcmpi(precision, '16') + datformat = 'short'; + elseif strcmpi(precision, '32') + datformat = 'int32'; + elseif (strcmpi(precision, '0') || strcmpi(precision, 'auto')) + datformat = 'auto' + end; + range_sweeps = eval( [ '[' result{2} ']' ] ); + range_typeeeg = eval( [ '[' result{3} ']' ] ); + range_chan = eval( [ '[' result{4} ']' ] ); + range_response = eval( [ '[' result{5} ']' ] ); +else + if exist('filepath') ~= 1 + filepath = ''; + end; +end; + +if exist('datformat') ~= 1, datformat = 'auto'; end; +if exist('range_chan') ~= 1 | isempty(range_chan) , range_chan = 'all'; end; +if exist('range_sweeps') ~= 1 | isempty(range_sweeps) , range_sweeps = 'all'; end; +if exist('range_typeeeg') ~= 1 | isempty(range_typeeeg) , range_typeeeg = 'all'; end; +if exist('range_response') ~= 1 | isempty(range_response), range_response = 'all'; end; + +% load datas +% ---------- +EEG = eeg_emptyset; +if ~isempty(filepath) + if filepath(end) ~= '/' & filepath(end) ~= '\' & filepath(end) ~= ':' + error('The file path last character must be a delimiter'); + end; + fullFileName = sprintf('%s%s', filepath, filename); +else + fullFileName = filename; +end; +[EEG.data, accept, eegtype, rt, eegresp, namechan, EEG.pnts, EEG.trials, EEG.srate, EEG.xmin, EEG.xmax] = ... + loadeeg( fullFileName, range_chan, range_sweeps, range_typeeeg, 'all', 'all', range_response, datformat); + +EEG.comments = [ 'Original file: ' fullFileName ]; +EEG.setname = 'Neuroscan EEG data'; +EEG.nbchan = size(EEG.data,1); +for index = 1:size(namechan,1) + EEG.chanlocs(index).labels = deblank(char(namechan(index,:))); +end; +EEG = eeg_checkset(EEG); +if any(rt) + EEG = pop_importepoch( EEG, [rt(:)*1000 eegtype(:) accept(:) eegresp(:)], { 'RT' 'type' 'accept' 'response'}, {'RT'}, 1E-3, 0, 1); +else + EEG = pop_importepoch( EEG, [eegtype(:) accept(:) eegresp(:)], { 'type' 'accept' 'response'}, { }, 1E-3, 0, 1); +end; +command = sprintf('EEG = pop_loadeeg(''%s'', ''%s'', %s);', filename, filepath, ... + vararg2str({range_chan range_sweeps range_typeeeg range_response datformat })); + +return; + + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_loadset.m b/code/eeglab13_4_4b/functions/popfunc/pop_loadset.m new file mode 100644 index 0000000..4e2ee84 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_loadset.m @@ -0,0 +1,373 @@ +% pop_loadset() - load an EEG dataset. If no arguments, pop up an input window. +% +% Usage: +% >> EEGOUT = pop_loadset; % pop up window to input arguments +% >> EEGOUT = pop_loadset( 'key1', 'val1', 'key2', 'val2', ...); +% >> EEGOUT = pop_loadset( filename, filepath); % old calling format +% +% Optional inputs: +% 'filename' - [string] dataset filename. Default pops up a graphical +% interface to browse for a data file. +% 'filepath' - [string] dataset filepath. Default is current folder. +% 'loadmode' - ['all', 'info', integer] 'all' -> load the data and +% the dataset structure. 'info' -> load only the dataset +% structure but not the actual data. [integer] -> load only +% a specific channel. This is efficient when data is stored +% in a separate '.dat' file in which individual channels +% may be loaded independently of each other. {default: 'all'} +% 'eeg' - [EEG structure] reload current dataset +% Note: +% Multiple filenames and filepaths may be specified. If more than one, +% the output EEG variable will be an array of EEG structures. +% Output +% EEGOUT - EEG dataset structure or array of structures +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001; SCCN/INC/UCSD, 2002- +% +% See also: eeglab(), pop_saveset() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [EEG, command] = pop_loadset( inputname, inputpath, varargin) + +command = ''; +EEG = []; + +if nargin < 1 + % pop up window + % ------------- + [inputname, inputpath] = uigetfile2('*.SET*;*.set', 'Load dataset(s) -- pop_loadset()', 'multiselect', 'on'); + drawnow; + if isequal(inputname, 0) return; end; + options = { 'filename' inputname 'filepath' inputpath }; +else + % account for old calling format + % ------------------------------ + if ~strcmpi(inputname, 'filename') && ~strcmpi(inputname, 'filepath') && ~strcmpi(inputname, 'eeg') + options = { 'filename' inputname }; + if nargin > 1 + options = { options{:} 'filepath' inputpath }; + end; + if nargin > 2 + options = { options{:} 'loadmode' varargin{1} }; + end; + else + options = { inputname inputpath varargin{:} }; + end; +end; + +% decode input parameters +% ----------------------- +g = finputcheck( options, ... + { 'filename' { 'string';'cell' } [] ''; + 'filepath' 'string' [] ''; + 'check' 'string' { 'on';'off' } 'on'; + 'loadmode' { 'string';'integer' } { { 'info' 'all' } [] } 'all'; + 'eeg' 'struct' [] struct('data',{}) }, 'pop_loadset'); +if isstr(g), error(g); end; +if isstr(g.filename), g.filename = { g.filename }; end; + +% reloading EEG structure from disk +% --------------------------------- +if ~isempty(g.eeg) + + EEG = pop_loadset( 'filepath', g.eeg.filepath, 'filename', g.eeg.filename); + +else + eeglab_options; + ALLEEGLOC = []; + for ifile = 1:length(g.filename) + + if ifile > 1 && option_storedisk + g.loadmode = 'last'; +% warndlg2(strvcat('You may only load a single dataset','when selecting the "Store at most one', 'dataset in memory" option')); +% break; + end; + + % read file + % --------- + filename = fullfile(g.filepath, g.filename{ifile}); + fprintf('pop_loadset(): loading file %s ...\n', filename); + %try + TMPVAR = load('-mat', filename); + %catch, + % error([ filename ': file is protected or does not exist' ]); + %end; + + % variable not found + % ------------------ + if isempty(TMPVAR) + error('No dataset info is associated with this file'); + end; + + if isfield(TMPVAR, 'EEG') + + % load individual dataset + % ----------------------- + EEG = checkoldformat(TMPVAR.EEG); + [ EEG.filepath EEG.filename ext ] = fileparts( filename ); + EEG.filename = [ EEG.filename ext ]; + + % account for name changes etc... + % ------------------------------- + if isstr(EEG.data) && ~strcmpi(EEG.data, 'EEGDATA') + + [tmp EEG.data ext] = fileparts( EEG.data ); EEG.data = [ EEG.data ext]; + if ~isempty(tmp) && ~strcmpi(tmp, EEG.filepath) + disp('Warning: updating folder name for .dat|.fdt file'); + end; + if ~strcmp(EEG.filename(1:end-3), EEG.data(1:end-3)) + disp('Warning: the name of the dataset has changed on disk, updating .dat & .fdt data file to the new name'); + EEG.data = [ EEG.filename(1:end-3) EEG.data(end-2:end) ]; + EEG.saved = 'no'; + end; + + end; + + % copy data to output variable if necessary (deprecated) + % ----------------------------------------- + if ~strcmpi(g.loadmode, 'info') && isfield(TMPVAR, 'EEGDATA') + if ~option_storedisk || ifile == length(g.filename) + EEG.data = TMPVAR.EEGDATA; + end; + end; + + elseif isfield(TMPVAR, 'ALLEEG') % old format + + eeglab_options; + if option_storedisk + error('Cannot load multiple dataset file. Change memory option to allow multiple datasets in memory, then try again. Remember that this file type is OBSOLETE.'); + end; + + % this part is deprecated as of EEGLAB 5.00 + % since all dataset data have to be saved in separate files + % ----------------------------------------------------- + disp('pop_loadset(): appending datasets'); + EEG = TMPVAR.ALLEEG; + for index=1:length(EEG) + EEG(index).filename = ''; + EEG(index).filepath = ''; + if isstr(EEG(index).data), + EEG(index).filepath = g.filepath; + if length(g.filename{ifile}) > 4 && ~strcmp(g.filename{ifile}(1:end-4), EEG(index).data(1:end-4)) && strcmpi(g.filename{ifile}(end-3:end), 'sets') + disp('Warning: the name of the dataset has changed on disk, updating .dat data file to the new name'); + EEG(index).data = [ g.filename{ifile}(1:end-4) 'fdt' int2str(index) ]; + end; + end; + end; + else + EEG = checkoldformat(TMPVAR); + if ~isfield( EEG, 'data') + error('pop_loadset(): not an EEG dataset file'); + end; + if isstr(EEG.data), EEG.filepath = g.filepath; end; + end; + + %ALLEEGLOC = pop_newset(ALLEEGLOC, EEG, 1); + ALLEEGLOC = eeg_store(ALLEEGLOC, EEG, 0, 'verbose', 'off'); + + end; + EEG = ALLEEGLOC; +end; + +% load all data or specific data channel +% -------------------------------------- +if strcmpi(g.check, 'on') + EEG = eeg_checkset(EEG); +end; +if isstr(g.loadmode) + if strcmpi(g.loadmode, 'all') + EEG = eeg_checkset(EEG, 'loaddata'); + elseif strcmpi(g.loadmode, 'last') + EEG(end) = eeg_checkset(EEG(end), 'loaddata'); + end; +else + % load/select specific channel + % ---------------------------- + EEG.datachannel = g.loadmode; + EEG.data = eeg_getdatact(EEG, 'channel', g.loadmode); + EEG.nbchan = length(g.loadmode); + if ~isempty(EEG.chanlocs) + EEG.chanlocs = EEG.chanlocs(g.loadmode); + end; + EEG.icachansind = []; + EEG.icaact = []; + EEG.icaweights = []; + EEG.icasphere = []; + EEG.icawinv = []; + %if isstr(EEG.data) + % EEG.datfile = EEG.data; + % fid = fopen(fullfile(EEG.filepath, EEG.data), 'r', 'ieee-le'); + % fseek(fid, EEG.pnts*EEG.trials*( g.loadmode - 1), 0 ); + % EEG.data = fread(fid, EEG.pnts*EEG.trials, 'float32'); + % fclose(fid); + %else + % EEG.data = EEG.data(g.loadmode,:,:); + %end; +end; + +% set file name and path +% ---------------------- +if length(EEG) == 1 + tmpfilename = g.filename{1}; + if isempty(g.filepath) + [g.filepath tmpfilename ext] = fileparts(tmpfilename); + tmpfilename = [ tmpfilename ext ]; + end; + EEG.filename = tmpfilename; + EEG.filepath = g.filepath; +end; + +% set field indicating that the data has not been modified +% -------------------------------------------------------- +if isfield(EEG, 'changes_not_saved') + EEG = rmfield(EEG, 'changes_not_saved'); +end; +for index=1:length(EEG) + EEG(index).saved = 'justloaded'; +end; + +command = sprintf('EEG = pop_loadset(%s);', vararg2str(options)); +return; + +function EEG = checkoldformat(EEG) + if ~isfield( EEG, 'data') + fprintf('pop_loadset(): Incompatible with new format, trying old format and converting...\n'); + eegset = EEG.cellArray; + + off_setname = 1; %= filename + off_filename = 2; %= filename + off_filepath = 3; %= fielpath + off_type = 4; %= type EEG AVG CNT + off_chan_names = 5; %= chan_names + off_chanlocs = 21; %= filename + off_pnts = 6; %= pnts + off_sweeps = 7; %= sweeps + off_rate = 8; %= rate + off_xmin = 9; %= xmin + off_xmax = 10; %= xmax + off_accept = 11; %= accept + off_typeeeg = 12; %= typeeeg + off_rt = 13; %= rt + off_response = 14; %= response + off_signal = 15; %= signal + off_variance = 16; %= variance + off_winv = 17; %= variance + off_weights = 18; %= variance + off_sphere = 19; %= variance + off_activations = 20; %= variance + off_entropytrial = 22; %= variance + off_entropycompo = 23; %= variance + off_threshold = 24; %= variance + off_comporeject = 25; %= variance + off_sigreject = 26; + off_kurtA = 29; + off_kurtR = 30; + off_kurtDST = 31; + off_nbchan = 32; + off_elecreject = 33; + off_comptrial = 34; + off_kurttrial = 35; %= variance + off_kurttrialglob = 36; %= variance + off_icareject = 37; %= variance + off_gcomporeject = 38; %= variance + off_eegentropy = 27; + off_eegkurt = 28; + off_eegkurtg = 39; + + off_tmp1 = 40; + off_tmp2 = 40; + + % must convert here into new format + EEG.setname = eegset{off_setname }; + EEG.filename = eegset{off_filename }; + EEG.filepath = eegset{off_filepath }; + EEG.namechan = eegset{off_chan_names}; + EEG.chanlocs = eegset{off_chanlocs }; + EEG.pnts = eegset{off_pnts }; + EEG.nbchan = eegset{off_nbchan }; + EEG.trials = eegset{off_sweeps }; + EEG.srate = eegset{off_rate }; + EEG.xmin = eegset{off_xmin }; + EEG.xmax = eegset{off_xmax }; + EEG.accept = eegset{off_accept }; + EEG.eegtype = eegset{off_typeeeg }; + EEG.rt = eegset{off_rt }; + EEG.eegresp = eegset{off_response }; + EEG.data = eegset{off_signal }; + EEG.icasphere = eegset{off_sphere }; + EEG.icaweights = eegset{off_weights }; + EEG.icawinv = eegset{off_winv }; + EEG.icaact = eegset{off_activations }; + EEG.stats.entropy = eegset{off_entropytrial }; + EEG.stats.kurtc = eegset{off_kurttrial }; + EEG.stats.kurtg = eegset{off_kurttrialglob}; + EEG.stats.entropyc = eegset{off_entropycompo }; + EEG.reject.threshold = eegset{off_threshold }; + EEG.reject.icareject = eegset{off_icareject }; + EEG.reject.compreject = eegset{off_comporeject }; + EEG.reject.gcompreject= eegset{off_gcomporeject }; + EEG.reject.comptrial = eegset{off_comptrial }; + EEG.reject.sigreject = eegset{off_sigreject }; + EEG.reject.elecreject = eegset{off_elecreject }; + EEG.stats.kurta = eegset{off_kurtA }; + EEG.stats.kurtr = eegset{off_kurtR }; + EEG.stats.kurtd = eegset{off_kurtDST }; + EEG.stats.eegentropy = eegset{off_eegentropy }; + EEG.stats.eegkurt = eegset{off_eegkurt }; + EEG.stats.eegkurtg = eegset{off_eegkurtg }; + %catch + % disp('Warning: some variables may not have been assigned'); + %end; + + % modify the eegtype to match the new one + + try + if EEG.trials > 1 + EEG.events = [ EEG.rt(:) EEG.eegtype(:) EEG.eegresp(:) ]; + end; + catch, end; + end; + % check modified fields + % --------------------- + if isfield(EEG,'icadata'), EEG.icaact = EEG.icadata; end; + if isfield(EEG,'poschan'), EEG.chanlocs = EEG.poschan; end; + if ~isfield(EEG, 'icaact'), EEG.icaact = []; end; + if ~isfield(EEG, 'chanlocs'), EEG.chanlocs = []; end; + + if isfield(EEG, 'events') && ~isfield(EEG, 'event') + try + if EEG.trials > 1 + EEG.events = [ EEG.rt(:) ]; + + EEG = eeg_checkset(EEG); + EEG = pop_importepoch(EEG, EEG.events, { 'rt'}, {'rt'}, 1E-3); + end; + if isfield(EEG, 'trialsval') + EEG = pop_importepoch(EEG, EEG.trialsval(:,2:3), { 'eegtype' 'response' }, {},1,0,0); + end; + EEG = eeg_checkset(EEG, 'eventconsistency'); + catch, disp('Warning: could not import events'); end; + end; + rmfields = {'icadata' 'events' 'accept' 'eegtype' 'eegresp' 'trialsval' 'poschan' 'icadata' 'namechan' }; + for index = 1:length(rmfields) + if isfield(EEG, rmfields{index}), + disp(['Warning: field ' rmfields{index} ' is deprecated']); + end; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_mergeset.m b/code/eeglab13_4_4b/functions/popfunc/pop_mergeset.m new file mode 100644 index 0000000..52707ec --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_mergeset.m @@ -0,0 +1,356 @@ +% pop_mergeset() - Merge two or more datasets. If only one argument is given, +% a window pops up to ask for more arguments. +% Usage: +% >> OUTEEG = pop_mergeset( ALLEEG ); % use a pop-up window +% >> OUTEEG = pop_mergeset( ALLEEG, indices, keepall); +% >> OUTEEG = pop_mergeset( INEEG1, INEEG2, keepall); +% +% Inputs: +% INEEG1 - first input dataset +% INEEG2 - second input dataset +% +% else +% ALLEEG - array of EEG dataset structures +% indices - indices of EEG datasets to merge +% +% keepall - [0|1] 0 -> remove, or 1 -> preserve, ICA activations +% of the first dataset and recompute the activations +% of the merged data {default: 0} +% +% Outputs: +% OUTEEG - merged dataset +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 01-26-02 change format for events and trial conditions -ad + +function [INEEG1, com] = pop_mergeset( INEEG1, INEEG2, keepall); + +com = ''; +if nargin < 1 + help pop_mergeset; + return; +end; +if isempty(INEEG1) + error('needs at least two datasets'); +end; +if nargin < 2 & length(INEEG1) == 1 + error('needs at least two datasets'); +end; + +if nargin == 1 + uilist = { { 'style' 'text' 'string' 'Dataset indices to merge' } ... + { 'style' 'edit' 'string' '1' } ... + { 'style' 'text' 'string' 'Preserve ICA weights of the first dataset ?' } ... + { 'style' 'checkbox' 'string' '' } }; + res = inputgui( 'uilist', uilist, 'geometry', { [3 1] [3 1] }, 'helpcom', 'pophelp(''pop_mergeset'')'); + + if isempty(res) return; end; + + INEEG2 = eval( [ '[' res{1} ']' ] ); + keepall = res{2}; +else + if nargin < 3 + keepall = 0; % default + end; +end; + +fprintf('Merging datasets...\n'); + +if ~isstruct(INEEG2) % if INEEG2 is a vector of ALLEEG indices + indices = INEEG2; + if length(indices) < 2 + error('needs at least two datasets'); + end; + + NEWEEG = eeg_retrieve(INEEG1, indices(1)); % why abandoned? + + for index = 2:length(indices) + INEEG2 = eeg_retrieve(INEEG1, indices(index)); + NEWEEG = pop_mergeset(NEWEEG, INEEG2, keepall); % recursive call + end; + INEEG1 = NEWEEG; + +else % INEEG is an EEG struct + % check consistency + % ----------------- + if INEEG1.nbchan ~= INEEG2.nbchan + error('The two datasets must have the same number of channels'); + end; + if INEEG1.srate ~= INEEG2.srate + error('The two datasets must have the same sampling rate'); + end; + if INEEG1.trials > 1 | INEEG2.trials > 1 + if INEEG1.pnts ~= INEEG2.pnts + error('The two epoched datasets must have the same number of points'); + end; + if INEEG1.xmin ~= INEEG2.xmin + INEEG2.xmin = INEEG1.xmin; + fprintf('Warning: the two epoched datasets do not have the same time onset, adjusted'); + end; + if INEEG1.xmax ~= INEEG2.xmax + INEEG2.xmax = INEEG1.xmax; + fprintf('Warning: the two epoched datasets do not have the same time offset, adjusted'); + end; + end; + + % Merge the epoch field + % --------------------- + if INEEG1.trials > 1 | INEEG2.trials > 1 + INEEGX = {INEEG1,INEEG2}; + for n = 1:2 + % make sure that both have an (appropriately-sized) epoch field + % ------------------------------------------------------------- + if ~isfield(INEEGX{n},'epoch') + INEEGX{n}.epoch = repmat(struct(),[1,INEEGX{n}.trials]); + end + % make sure that the epoch number is correct in each dataset + % ---------------------------------------------------------- + if ~isempty(INEEGX{n}.epoch) && length(INEEGX{n}.epoch) ~= INEEGX{n}.trials + disp('Warning: The number of trials does not match the length of the EEG.epoch field in one of'); + disp(' the datasets. Its epoch info will be reset and derived from the respective events.'); + INEEGX{n}.epoch = repmat(struct(),[1,INEEGX{n}.trials]); + end + end + for n=1:2 + % purge all event-related epoch fields from each dataset (EEG.epoch.event* fields) + % -------------------------------------------------------------------------------- + if isstruct(INEEGX{n}.epoch) + fn = fieldnames(INEEGX{n}.epoch); + INEEGX{n}.epoch = rmfield(INEEGX{n}.epoch,{fn{strmatch('event',fn)}}); + % copy remaining field names to the other dataset + % ----------------------------------------------- + for f = fieldnames(INEEGX{n}.epoch)' + if ~isfield(INEEGX{3-n}.epoch,f{1}) + INEEGX{3-n}.epoch(1).(f{1}) = []; + end + end + % after this, both sets have an epoch field with the appropriate number of items + % and possibly some user-defined fields, but no event* fields. + end + end + + % concatenate epochs + % ------------------ + if isstruct(INEEGX{1}.epoch) && isstruct(INEEGX{2}.epoch) + if length(fieldnames(INEEGX{2}.epoch)) > 0 + INEEGX{1}.epoch(end+1:end+INEEGX{2}.trials) = orderfields(INEEGX{2}.epoch,INEEGX{1}.epoch); + else + INEEGX{1}.epoch(end+1:end+INEEGX{2}.trials) = INEEGX{2}.epoch; + end; + end + % and write back + INEEG1 = INEEGX{1}; + INEEG2 = INEEGX{2}; + INEEGX = {}; + end + + % Concatenate data + % ---------------- + if INEEG1.trials > 1 | INEEG2.trials > 1 + INEEG1.data(:,:,end+1:end+size(INEEG2.data,3)) = INEEG2.data(:,:,:); + else + INEEG1.data(:,end+1:end+size(INEEG2.data,2)) = INEEG2.data(:,:); + end; + + INEEG1.setname = 'Merged datasets'; + INEEG1trials = INEEG1.trials; + INEEG2trials = INEEG2.trials; + INEEG1pnts = INEEG1.pnts; + INEEG2pnts = INEEG2.pnts; + + if INEEG1.trials > 1 | INEEG2.trials > 1 % epoched data + INEEG1.trials = INEEG1.trials + INEEG2.trials; + + else % continuous data + INEEG1.pnts = INEEG1.pnts + INEEG2.pnts; + end; + + if isfield(INEEG1, 'reject') + INEEG1 = rmfield(INEEG1, 'reject' ); + end; + INEEG1.specicaact = []; + INEEG1.specdata = []; + + if keepall == 0 + INEEG1.icaact = []; + INEEG1.icawinv = []; + INEEG1.icasphere = []; + INEEG1.icaweights = []; + if isfield(INEEG1, 'stats') + INEEG1 = rmfield(INEEG1, 'stats' ); + end; + else + INEEG1.icaact = []; + end; + + + % concatenate events + % ------------------ + if isempty(INEEG2.event) && INEEG2.trials == 1 + + % boundary event + % ------------- + disp('Inserting boundary event...'); + INEEG1.event(end+1).type = 'boundary'; % add boundary event between datasets + INEEG1.event(end ).latency = INEEG1pnts+0.5; % make boundary halfway between last,first pts + + % check urevents + % -------------- + if ~isfield(INEEG1, 'urevent'), + INEEG1.urevent = []; + fprintf('Warning: first dataset has no urevent structure.\n'); + end; + + % add boundary urevent + % -------------------- + disp('Inserting boundary urevent...'); + INEEG1.urevent(end+1).type = 'boundary'; + + if length(INEEG1.urevent) > 1 % if previous INEEG1 urevents + INEEG1.urevent(end ).latency = max(INEEG1pnts, INEEG1.urevent(end-1).latency)+0.5; + else + INEEG1.urevent(end ).latency = INEEG1pnts+0.5; + end; + + else % is ~isempty(INEEG2.event) + + % concatenate urevents + % -------------------- + if isfield(INEEG2, 'urevent') + if ~isempty(INEEG2.urevent) && isfield(INEEG1.urevent, 'latency') + + % insert boundary event + % --------------------- + disp('Inserting boundary event...'); + INEEG1.urevent(end+1).type = 'boundary'; + try + INEEG1.urevent(end ).latency = max(INEEG1pnts, INEEG1.urevent(end-1).latency)+0.5; + catch + % cko: sometimes INEEG1 has no events / urevents + INEEG1.urevent(end ).latency = INEEG1pnts+0.5; + end + + + % update urevent indices for second dataset + % ----------------------------------------- + disp('Concatenating urevents...'); + orilen = length(INEEG1.urevent); + newlen = length(INEEG2.urevent); + INEEG2event = INEEG2.event; + % update urevent index in INEEG2.event + tmpevents = INEEG2.event; + nonemptymask = ~cellfun('isempty',{tmpevents.urevent}); + [tmpevents(nonemptymask).urevent] = celldeal(num2cell([INEEG2event.urevent]+orilen)); + INEEG2.event = tmpevents; + % reserve space and append INEEG2.urevent + INEEG1.urevent(orilen+newlen).latency = []; + INEEG2urevent = INEEG2.urevent; + tmpevents = INEEG1.urevent; + for f = fieldnames(INEEG2urevent)' + [tmpevents((orilen+1):(orilen+newlen)).(f{1})] = INEEG2urevent.(f{1}); + end + INEEG1.urevent = tmpevents; + else + INEEG1.urevent = []; + INEEG2.urevent = []; + fprintf('Warning: second dataset has empty urevent structure.\n'); + end + end; + + % concatenate events + % ------------------ + disp('Concatenating events...'); + orilen = length(INEEG1.event); + newlen = length(INEEG2.event); + %allfields = fieldnames(INEEG2.event); + + % ensure similar event structures + % ------------------------------- + if ~isempty(INEEG2.event) + if isstruct(INEEG1.event) + for f = fieldnames(INEEG1.event)' + if ~isfield(INEEG2.event,f{1}) + INEEG2.event(1).(f{1}) = []; + end + end + end + if isstruct(INEEG2.event) + for f = fieldnames(INEEG2.event)' + if ~isfield(INEEG1.event,f{1}) + INEEG1.event(1).(f{1}) = []; + end + end + end + INEEG2.event = orderfields(INEEG2.event, INEEG1.event); + end; + + % append + INEEG1.event(orilen+(1:newlen)) = INEEG2.event; + INEEG2event = INEEG2.event; + if isfield(INEEG1.event,'latency') && isfield(INEEG2.event,'latency') + % update latency + tmpevents = INEEG1.event; + [tmpevents(orilen + (1:newlen)).latency] = celldeal(num2cell([INEEG2event.latency] + INEEG1pnts*INEEG1trials)); + INEEG1.event = tmpevents; + end + if isfield(INEEG1.event,'epoch') && isfield(INEEG2.event,'epoch') + % update epoch index + tmpevents = INEEG1.event; + [tmpevents(orilen + (1:newlen)).epoch] = celldeal(num2cell([INEEG2event.epoch]+INEEG1trials)); + INEEG1.event = tmpevents; + end + + % add discontinuity event if continuous + % ------------------------------------- + if INEEG1trials == 1 & INEEG2trials == 1 + disp('Adding boundary event...'); + INEEG1.event = eeg_insertbound(INEEG1.event, INEEG1.pnts, INEEG1pnts+1, 0); % +1 since 0.5 is subtracted + end; + + end; + + INEEG1.pnts = size(INEEG1.data,2); + + if ~isfield(INEEG1.event,'epoch') && ~isempty(INEEG1.event) && (size(INEEG1.data,3)>1 || ~isempty(INEEG1.epoch)) + INEEG1.event(1).epoch = []; + end + + % rebuild event-related epoch fields + % ---------------------------------- + disp('Reconstituting epoch information...'); + INEEG1 = eeg_checkset(INEEG1, 'eventconsistency'); +end + +% build the command +% ----------------- +if exist('indices') == 1 + com = sprintf('EEG = pop_mergeset( %s, [%s], %d);', inputname(1), int2str(indices), keepall); +else + com = sprintf('EEG = pop_mergeset( %s, %s, %d);', inputname(1), inputname(2), keepall); +end + +return + + +function varargout = celldeal(X) +varargout = X; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_newcrossf.m b/code/eeglab13_4_4b/functions/popfunc/pop_newcrossf.m new file mode 100644 index 0000000..d48ccae --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_newcrossf.m @@ -0,0 +1,226 @@ +% pop_newcrossf() - Return estimates and plots of event-related spectral coherence +% +% Usage: +% >> pop_newcrossf(EEG, typeproc, num1, num2, tlimits,cycles, +% 'key1',value1,'key2',value2, ... ); +% Inputs: +% INEEG - Input EEG dataset +% typeproc - Type of processing: +% 1 = process two raw-data channels, +% 0 = process two ICA components +% num1 - First component or channel number +% num2 - Second component or channel number +% tlimits - [mintime maxtime] Sub-epoch time limits in ms +% cycles - >0 -> Number of cycles in each analysis wavelet +% 0 -> Use FFTs (with constant window length) +% +% Optional inputs: As for newcrossf(). See >> help newcrossf +% +% Outputs: Same as newcrossf(). No outputs are returned when a +% window pops-up to ask for additional arguments +% +% Author: Arnaud Delorme, CNL / Salk Institute, 11 March 2002 +% +% See also: timef(), eeglab() + +% Copyright (C) 11 March 2002 arno@salk.edu, Arnaud Delorme, CNL / Salk Institute +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-18-02 added title -ad & sm +% 04-04-02 added outputs -ad & sm + +function varargout = pop_newcrossf(EEG, typeproc, num1, num2, tlimits, cycles, varargin ); + +varargout{1} = ''; +% display help if not enough arguments +% ------------------------------------ +if nargin < 2 + help pop_newcrossf; + return; +end; +lastcom = []; +if nargin < 3 + popup = 1; +else + popup = isstr(num1) | isempty(num1); + if isstr(num1) + lastcom = num1; + end; +end; + +% pop up window +% ------------- +if popup + [txt vars] = gethelpvar('timef.m'); + + geometry = { [1 0.5 0.5] [1 0.5 0.5] [1 0.5 0.5] [1 0.5 0.5] [0.92 0.15 0.73] [0.92 0.15 0.73] [1 0.5 0.5] [1 0.8 0.2] [1] [1 1]}; + uilist = { { 'Style', 'text', 'string', fastif(typeproc, 'First channel number', 'First component number'), 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,3,[],'1') } {} ... + { 'Style', 'text', 'string', fastif(typeproc, 'Second channel number', 'Second component number'), 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,4,[],'2') } {} ... + { 'Style', 'text', 'string', 'Epoch time range [min max] (msec)', 'fontweight', 'bold', ... + 'tooltipstring', 'Sub epoch time limits' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,5,[],[ int2str(EEG.xmin*1000) ' ' int2str(EEG.xmax*1000) ]) } {} ... + { 'Style', 'text', 'string', 'Wavelet cycles (0->FFT, see >> help timef)', 'fontweight', 'bold', ... + 'tooltipstring', context('cycles',vars,txt) } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,6,[],'3 0.5') } {} ... + { 'Style', 'text', 'string', '[set]->log. scale for frequencies (match STUDY)', 'fontweight', 'bold' } ... + { 'Style', 'checkbox', 'value', getkeyval(lastcom,'logscale',1,0) } { } ... + { 'Style', 'text', 'string', '[set]->Linear coher / [unset]->Phase coher', 'fontweight', 'bold', ... + 'tooltipstring', ['Compute linear inter-trial coherence (coher)' 10 ... + 'OR Amplitude-normalized inter-trial phase coherence (phasecoher)'] } ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'phasecoher','present',1) } { } ... + { 'Style', 'text', 'string', 'Bootstrap significance level (Ex: 0.01 -> 1%)', 'fontweight', 'bold', ... + 'tooltipstring', context('alpha',vars,txt) } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,'alpha') } {} ... + { 'Style', 'text', 'string', 'Optional timef() arguments (see Help)', 'fontweight', 'bold', ... + 'tooltipstring', 'See newcrossf() help via the Help button on the right...' } ... + { 'Style', 'edit', 'string', '''padratio'', 1' } ... + { 'Style', 'pushbutton', 'string', 'Help', 'callback', 'pophelp(''newcrossf'');' } ... + {} ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotersp','present',0), 'string', ... + 'Plot coherence amplitude', 'tooltipstring', ... + 'Plot coherence ampltitude image in the upper panel' } ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotphase','present',0), 'string', ... + 'Plot coherence phase', 'tooltipstring', ... + 'Plot coherence phase image in the lower panel' } ... + }; + + result = inputgui( geometry, uilist, 'pophelp(''pop_newcrossf'');', ... + fastif(typeproc, 'Plot channel cross-coherence -- pop_newcrossf()', ... + 'Plot component cross-coherence -- pop_newcrossf()')); + if length( result ) == 0 return; end; + + num1 = eval( [ '[' result{1} ']' ] ); + num2 = eval( [ '[' result{2} ']' ] ); + tlimits = eval( [ '[' result{3} ']' ] ); + cycles = eval( [ '[' result{4} ']' ] ); + if result{5}, + if isempty(result{8}), result{8} = '''freqscale'', ''log'''; + else result{8} = [ result{8} ', ''freqscale'', ''log''' ]; + end; + end; + if result{6} + options = [',''type'', ''coher''' ]; + else + options = [',''type'', ''phasecoher''' ]; + end; + + % add topoplot + % ------------ + if isfield(EEG.chanlocs, 'theta') && ~isempty(EEG.chanlocs(num1).theta) && ~isempty(EEG.chanlocs(num2).theta) + if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; + if typeproc == 1 + options = [options ', ''topovec'', [' int2str([num1 num2]) ... + '], ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo' ]; + else % typeproc == 0 + options = [options ', ''topovec'', EEG.icawinv(:, [' int2str([num1 num2]) ... + '])'', ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo' ]; + end; + end; + + % add title + % --------- + if isempty( findstr( 'title', result{8})) + if ~isempty(EEG.chanlocs) & typeproc + chanlabel1 = EEG.chanlocs(num1).labels; + chanlabel2 = EEG.chanlocs(num2).labels; + else + chanlabel1 = int2str(num1); + chanlabel2 = int2str(num2); + end; + if result{6} + options = [options ', ''title'',' fastif(typeproc, '''Channel ', '''Component ') chanlabel1 '-' chanlabel2 ... + ' Coherence''']; + else + options = [options ', ''title'',' fastif(typeproc, '''Channel ', '''Component ') chanlabel1 '-' chanlabel2 ... + ' Phase Coherence''' ]; + end; + end; + if ~isempty( result{7} ) + options = [ options ', ''alpha'',' result{7} ]; + end; + if ~isempty( result{8} ) + options = [ options ',' result{8} ]; + end; + if ~result{9} + options = [ options ', ''plotersp'', ''off''' ]; + end; + if ~result{10} + options = [ options ', ''plotphase'', ''off''' ]; + end; + figure; try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; +else + options = [ ',' vararg2str(varargin) ]; +end; + +% compute epoch limits +% -------------------- +if isempty(tlimits) + tlimits = [EEG.xmin, EEG.xmax]; +end; +pointrange1 = round(max((tlimits(1)/1000-EEG.xmin)*EEG.srate, 1)); +pointrange2 = round(min((tlimits(2)/1000-EEG.xmin)*EEG.srate, EEG.pnts)); +pointrange = [pointrange1:pointrange2]; + +% call function sample either on raw data or ICA data +% --------------------------------------------------- +if typeproc == 1 + tmpsig1 = EEG.data(num1,pointrange,:); + tmpsig2 = EEG.data(num2,pointrange,:); +else + if ~isempty( EEG.icasphere ) + eeglab_options; % changed from eeglaboptions 3/30/02 -sm + tmpsig1 = eeg_getdatact(EEG, 'component', num1, 'samples',pointrange); + tmpsig2 = eeg_getdatact(EEG, 'component', num2, 'samples',pointrange); + else + error('You must run ICA first'); + end; +end; +tmpsig1 = reshape( tmpsig1, 1, size(tmpsig1,2)*size(tmpsig1,3)); +tmpsig2 = reshape( tmpsig2, 1, size(tmpsig2,2)*size(tmpsig2,3)); + +% outputs +% ------- +outstr = ''; +if ~popup + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% plot the datas and generate output command +% -------------------------------------------- +if length( options ) < 2 + options = ''; +end; +varargout{1} = sprintf('figure; pop_newcrossf( %s, %d, %d, %d, [%s], [%s] %s);', ... + inputname(1), typeproc, num1, num2, int2str(tlimits), num2str(cycles), options); + +com = sprintf( '%s newcrossf( tmpsig1, tmpsig2, length(pointrange), [tlimits(1) tlimits(2)], EEG.srate, cycles %s);', outstr, options); +eval(com) + +return; + +% get contextual help +% ------------------- +function txt = context(var, allvars, alltext); + loc = strmatch( var, allvars); + if ~isempty(loc) + txt= alltext{loc(1)}; + else + disp([ 'warning: variable ''' var ''' not found']); + txt = ''; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_newset.m b/code/eeglab13_4_4b/functions/popfunc/pop_newset.m new file mode 100644 index 0000000..34f2512 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_newset.m @@ -0,0 +1,570 @@ +% pop_newset() - Edit/save EEG dataset structure information. +% +% Usage: +% >> [ALLEEG EEG CURRENTSET] = pop_newset( ALLEEG, EEG, CURRENTSET,... +% 'key', val,...); +% Inputs and outputs: +% ALLEEG - array of EEG dataset structures +% EEG - current dataset structure or structure array +% CURRENTSET - index(s) of the current EEG dataset(s) in ALLEEG +% +% Optional inputs: +% 'setname' - ['string'] name for the new dataset +% 'comments' - ['string'] comments on the new dataset +% 'overwrite' - ['on'|'off'] overwrite the old dataset +% 'saveold' - ['filename'] filename in which to save the old dataset +% 'savenew' - ['filename'] filename in which to save the new dataset +% 'retrieve' - [index] retrieve the old dataset (ignore recent changes) +% +% Note: Calls eeg_store() which may modify the variable ALLEEG +% containing the current dataset(s). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 23 Arpil 2002 +% +% See also: eeg_store(), pop_editset(), eeglab() + +% Copyright (C) 23 Arpil 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 'aboutparent' - ['on'|'off'] insert reference to parent dataset in the comments + +% testing: both options must be tested with datasets that have 2 +% files (.set and .dat) and with dataset using a single file +% +% Option when only one dataset is kept in memory +% +% *********** When STUDY present *********** +% Study selected -> select single dataset +% Study selected -> select multiple datasets +% Several dataset selected -> select single dataset +% Several dataset selected -> select other several datasets +% Several dataset selected -> select study +% Dataset (not modified) selected -> select study +% Dataset (not modified) selected -> select multiple datasets +% Dataset (not modified) selected -> select other single dataset +% Dataset (not modified) selected -> create new dataset (eg. resample) +% Dataset (modified) selected -> select study +% Dataset (modified) selected -> select multiple datasets +% Dataset (modified) selected -> select other single dataset +% Dataset (modified) selected -> create new dataset (eg. resample) +% *********** When study absent ************ +% Several dataset selected -> select single dataset +% Several dataset selected -> select other several datasets +% Dataset (not modified) selected -> select multiple datasets +% Dataset (not modified) selected -> select other single dataset +% Dataset (not modified) selected -> create new dataset (eg. resample) +% Dataset (modified) selected -> select multiple datasets +% Dataset (modified) selected -> select other single dataset +% Dataset (modified) selected -> create new dataset (eg. resample) +% +% Option when several datasets can be kept in memory +% +% *********** When STUDY present *********** +% Study selected -> select single dataset +% Study selected -> select multiple datasets +% Several dataset selected -> select single dataset +% Several dataset selected -> select other several datasets +% Several dataset selected -> select study +% Dataset (not modified) selected -> select study +% Dataset (not modified) selected -> select multiple datasets +% Dataset (not modified) selected -> select other single dataset +% Dataset (not modified) selected -> create new dataset (eg. resample) +% Dataset (modified) selected -> select study +% Dataset (modified) selected -> select multiple datasets +% Dataset (modified) selected -> select other single dataset +% Dataset (modified) selected -> create new dataset (eg. resample) +% *********** When study absent ************ +% Several dataset selected -> select single dataset +% Several dataset selected -> select other several datasets +% Dataset (not modified) selected -> select multiple datasets +% Dataset (not modified) selected -> select other single dataset +% Dataset (not modified) selected -> create new dataset (eg. resample) +% Dataset (modified) selected -> select multiple datasets +% Dataset (modified) selected -> select other single dataset +% Dataset (modified) selected -> create new dataset (eg. resample) + +function [ALLEEG, EEG, CURRENTSET, com] = pop_newset( ALLEEG, EEG, OLDSET, varargin); +% pop_newset( ALLEEG, EEG, 1, 'retrieve', [], 'study', [1] (retreiving a study) + +verbose = 0; +if nargin < 3 + help pop_newset; + return; +end; +CURRENTSET = OLDSET; +com = sprintf('[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, %s); ', vararg2str( { OLDSET varargin{:} } )); + +[g varargin] = finputcheck(varargin, { ... + 'gui' 'string' { 'on';'off' } 'on'; % []=none; can be multiple numbers + 'retrieve' 'integer' [] []; % []=none; can be multiple numbers + 'study' 'integer' [0 1] 0; % important because change behavior for modified datasets + }, 'pop_newset', 'ignore'); +if isstr(g), error(g); end; +eeglab_options; +if length(EEG) > 1 + % *************************************************** + % case 1 -> multiple datasets in memory (none has to be saved), retrieving single dataset + % *************************************************** + if ~isempty(g.retrieve) + [EEG, ALLEEG, CURRENTSET] = eeg_retrieve( ALLEEG, g.retrieve); + elseif length(OLDSET) == length(EEG) + % *************************************************** + % case 2 -> multiple datasets processed, storing them + % *************************************************** + [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, OLDSET); + else + % *************************************************** + % case 3 -> multiple datasets processed, storing new copies (not used in EEGLAB) + % *************************************************** + if strcmpi(EEG(1).saved, 'justloaded') + for ieeg = 1:length(EEG) + [ALLEEG TMP OLDSET] = pop_newset(ALLEEG, EEG(ieeg), OLDSET); + end; + CURRENTSET = OLDSET; + EEG = TMP; + else + [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG); + end; + end; + return; +elseif ~isempty(g.retrieve) % command line call + % *************************************************** + % case 4 -> single dataset, does not have to be saved, + % retrieving another dataset + % *************************************************** + if verbose, disp('Case 4'); end; + if ~(option_storedisk & strcmpi(EEG.saved, 'no')) + if strcmpi(EEG.saved, 'yes') & option_storedisk + fprintf('pop_newset(): Dataset %d has not been modified since last save, so did not resave it.\n', OLDSET); + EEG = update_datafield(EEG); + + tmpsave = EEG.saved; + EEG = eeg_hist(EEG, com); + [ALLEEG EEG] = eeg_store(ALLEEG, EEG, OLDSET); + EEG.saved = tmpsave; % eeg_store automatically set it to 'no' + ALLEEG(OLDSET).saved = tmpsave; + end; + + if ~isempty(g.retrieve) + [EEG, ALLEEG, CURRENTSET] = eeg_retrieve( ALLEEG, g.retrieve); + end; + return; + end; +end; + +if isempty(EEG) + args = { 'retrieve', OLDSET }; % cancel +elseif length(varargin) == 0 & length(EEG) == 1 & strcmpi(g.gui, 'on') % if several arguments, assign values + % popup window parameters + % ----------------------- + text_new = 'What do you want to do with the new dataset?'; + comcomment = ['tmpuserdat = get(gcbf, ''userdata'');' ... + 'tmpuserdat = pop_comments(tmpuserdat, ''Edit dataset comments'');' ... + 'set(gcbf, ''userdata'', tmpuserdat); clear tmpuserdat;']; + comsavenew = ['[tmpfile tmppath] = uiputfile(''*.set'', ''Enter filename''); drawnow;' ... + 'if tmpfile ~= 0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''filenamenew''), ''string'', fullfile(tmppath, tmpfile));' ... + 'end;' ... + 'clear tmpuserdat tmpfile tmppath;']; + cb_savenew = [ 'set(findobj(gcbf, ''userdata'', ''filenamenew''), ''enable'', fastif(get(gcbo, ''value''), ''on'', ''off''));' ]; + cb_saveold = [ 'set(findobj(gcbf, ''userdata'', ''filenameold''), ''enable'', fastif(get(gcbo, ''value''), ''on'', ''off''));' ]; + comsaveold = ['[tmpfile tmppath] = uiputfile(''*.set'', ''Enter filename''); drawnow;' ... + 'if tmpfile ~= 0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''filenameold''), ''string'', fullfile(tmppath, tmpfile));' ... + 'end;' ... + 'clear tmpuserdat tmpfile tmppath;']; + enable_saveold = 'off'; + enable_savenew = 'off'; + value_saveold = 0; + value_savenew = 0; + value_owrt = 0; + cb_owrt = ''; + userdat = EEG.comments; + + % status of parent dataset etc... + saved = 1; + filenameold = ''; + filenamenew = ''; + if ~isempty(ALLEEG) & any(OLDSET ~= 0) & length(OLDSET) == 1 + if strcmpi(ALLEEG(OLDSET).saved, 'no') + saved = 0; + if ~isempty(ALLEEG(OLDSET).filename) + filenameold = fullfile(ALLEEG(OLDSET).filepath, ALLEEG(OLDSET).filename); + end; + end; + end; + overwrite_or_save = 0; + have_to_save_new = 0; + + % *************************************************** + % case 5 -> single dataset, has to be saved, one dataset to retreive and study present or several dataset to retrieve + % *************************************************** + if length(g.retrieve) > 1 | ( g.study & ~isempty(g.retrieve)) % selecting several datasets or a study is present + if verbose, disp('Case 5'); end; + text_new = 'Current dataset has not been saved. Saved it or reload it from disk.'; + text_old = ''; + have_to_save_new = 1; + value_savenew = 1; + enable_savenew = 'on'; + filenamenew = fullfile(EEG.filepath, EEG.filename); + cb_savenew = [ 'if ~get(gcbo, ''value'') & ~get(findobj(gcbf, ''tag'', ''cb_loadold''), ''value''),' ... + ' set(gcbo, ''value'', 1);' ... + ' warndlg2(strvcat(''You must enter a filename for the dataset or use the copy on disk!'','' '',' ... + ' ''It must be saved or you must use the old dataset on disk because, by your current memory'',' ... + ' ''option, only one full dataset or study can be kept in memory. Note that if you choose to'',' ... + ' ''save the dataset, this will be taken into account in the study.''));' ... + 'else, ' cb_savenew ... + 'end;' ]; + % *************************************************** + % case 6 -> single dataset modified or not, study is present (the old + % dataset has to be replaced to preserve study consistency) + % *************************************************** + elseif g.study == 1 & isempty(g.retrieve) + if verbose, disp('Case 6'); end; + if saved + text_old = 'The old dataset has not been modified since last saved. What do you want to do with it?'; + cb_saveold = ''; + else + text_old = 'Some changes have not been saved. What do you want to do with the old dataset?'; + end; + cb_owrt = [ ... + ' set(gcbo, ''value'', 1);' ... + ' warndlg2(strvcat(''Cannot unset the overwrite checkbox!'','' '',' ... + '''The old dataset must be overwriten since all datasets'',' ... + '''must be in the STUDY.''), ''warning'');' ]; + value_owrt = 1; + filenamenew = fullfile(EEG.filepath, EEG.filename); + % *************************************************** + % case 7 -> single dataset modified, study is absent, old copy has to + % be flush to disk or overwritten + % *************************************************** + elseif ~saved & option_storedisk + if verbose, disp('Case 7'); end; + text_old = 'Some changes have not been saved. What do you want to do with the old dataset?'; + cb_saveold = [ 'if ~get(findobj(gcbf, ''tag'', ''cb_owrt''), ''value''),' ... + ' set(gcbo, ''value'', 1);' ... + ' warndlg2(strvcat(''Cannot unset the save checkbox!'','' '',' ... + '''By your selected memory option, only one full dataset'',' ... + '''can be kept in memory. Thus, you must either'',' ... + '''save or delete/overwrite the old dataset.''));' ... + 'else, ' cb_saveold ... + 'end;' ]; + cb_owrt = [ 'if ~get(findobj(gcbf, ''tag'', ''cb_saveold''), ''value''),' ... + ' set(gcbo, ''value'', 1);' ... + ' warndlg2(strvcat(''Cannot unset the overwrite checkbox!'','' '',' ... + '''By your memory option, only one full dataset'',' ... + '''can be kept in memory. Thus, you must either'',' ... + '''save or delete/overwrite the old dataset.''));' ... + 'end;' ]; + enable_saveold = 'on'; + value_saveold = 1; + overwrite_or_save = 1; + elseif ~saved + % *************************************************** + % case 8 -> single dataset modified, study is absent, no constraint on saving + % *************************************************** + if verbose, disp('Case 8'); end; + text_old = 'Some changes have not been saved. What do you want to do with the old dataset?'; + else + % *************************************************** + % case 9 -> single dataset not modified, study is absent, no constraint on saving + % *************************************************** + if verbose, disp('Case 9'); end; + text_old = 'What do you want to do with the old dataset (not modified since last saved)?'; + cb_saveold = ''; + cb_overwrite = 'Overwrite current dataset|New dataset'; + end; + + geometry = { [1] [0.15 0.5 1 0.5] [0.15 0.5 1 0.5] [1] [1] [0.15 1.8 0.1 0.1] [0.15 0.5 1 0.5] }; + geomvert = [ ]; + uilist = { ... + { 'style', 'text', 'string', text_new, 'fontweight', 'bold' } ... + {} ... + { 'Style', 'text', 'string', 'Name it:' } ... + { 'Style', 'edit', 'string', EEG.setname 'tag' 'namenew' } ... + { 'Style', 'pushbutton', 'string', 'Edit description', 'callback', comcomment } ... + { 'Style', 'checkbox' , 'string', '', 'callback', cb_savenew 'value' value_savenew 'tag' 'cb_savenew' } ... + { 'Style', 'text', 'string', 'Save it as file:' } ... + { 'Style', 'edit', 'string', filenamenew, 'tag', 'filenamenew' 'userdata' 'filenamenew' 'enable' enable_savenew } ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', comsavenew 'userdata' 'filenamenew' 'enable' enable_savenew } ... + { } ... + { 'style', 'text', 'string', text_old 'fontweight' 'bold' } ... + { 'Style', 'checkbox' , 'string', '' 'tag' 'cb_owrt' 'callback' cb_owrt 'value' value_owrt } ... + { 'Style', 'text' , 'string', 'Overwrite it in memory (set=yes; unset=create a new dataset)' } {} ... + { } ... + { 'Style', 'checkbox' , 'string', '', 'callback', cb_saveold 'value' value_saveold 'tag' 'cb_saveold' } ... + { 'Style', 'text' , 'string', 'Save it as file:' } ... + { 'Style', 'edit' , 'string', filenameold, 'tag', 'filenameold' 'userdata' 'filenameold' 'enable' enable_saveold } ... + { 'Style', 'pushbutton', 'string', 'Browse', 'callback', comsaveold 'userdata' 'filenameold' 'enable' enable_saveold } }; + + % remove old dataset if not present + % --------------------------------- + if OLDSET == 0 + uilist = uilist(1:9); + geometry = geometry(1:3); + end; + if isempty(cb_saveold) + uilist(end-3:end) = []; + geometry(end) = []; + end; + % update GUI for selecting multiple datasets + % ------------------------------------------ + if length(g.retrieve) > 1 | ( g.study & ~isempty(g.retrieve)) % selecting several datasets or a study is present + uilist = uilist(1:9); + geometry = geometry(1:3); + if ~isempty(EEG.filename) + cb_loadold = [ 'if ~get(gcbo, ''value'') & ~get(findobj(gcbf, ''tag'', ''cb_savenew''), ''value''),' ... + ' set(gcbo, ''value'', 1);' ... + ' warndlg2(strvcat(''You must enter a filename for the dataset or use the copy on disk!'','' '',' ... + ' ''It must be saved or you must use the old dataset on disk because, by your current memory option, only one full'',' ... + ' ''dataset or study can be kept in memory. This will also affect the'',' ... + ' ''dataset at this position in the study.''));' ... + 'end;' ]; + uilist{end+1} = { 'Style', 'checkbox' , 'string', '', 'callback', cb_loadold 'tag' 'cb_loadold' }; + uilist{end+1} = { 'Style', 'text', 'string', 'Reload copy from disk (will be done after optional saving above)' }; + uilist{end+1} = {}; + uilist{end+1} = {}; + geometry = { geometry{:} [0.12 1.6 0.2 0.2] }; + end; + end; + + % remove new dataset if already saved + % ----------------------------------- + if ~isfield(EEG, 'saved') + EEG = eeg_checkset(EEG); + end; + if strcmpi(EEG.saved, 'justloaded') | ~isempty(g.retrieve) + if overwrite_or_save % only pop-up a window if some action has to be taken + uilist = uilist(11:end); + geometry = geometry(5:end); + uilist(3) = {{ 'Style', 'text' , 'string', 'Delete it from memory (set=yes)' }}; + elseif isempty(g.retrieve) % just loaded from disk + + % remove data from file for old dataset + % ------------------------------------- + if option_storedisk & ~isempty(ALLEEG) & OLDSET ~= 0 + if ~isfield(ALLEEG(OLDSET), 'datfile'), ALLEEG(OLDSET).datfile = ''; end; + ALLEEG(OLDSET) = update_datafield(ALLEEG(OLDSET)); + end; + + [ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0); % 0 means that it is saved on disk + com = '[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 );'; + return; + end; + end; + + % show GUI (do not return if old dataset has to be saved or overwritten) + % ---------------------------------------------------------------------- + cont = 1; + while cont + [result userdat tmp tags] = inputgui( 'geometry', geometry, 'uilist', uilist, 'helpcom', 'pophelp(''pop_newset'');', ... + 'title', 'Dataset info -- pop_newset()', ... + 'userdata', userdat, 'geomvert', geomvert); + try, tags.cb_owrt; catch, tags.cb_owrt = 0; end; + try, tags.cb_savenew; catch, tags.cb_savenew = 0; end; + try, tags.cb_saveold; catch, tags.cb_saveold = 0; end; + try, tags.cb_loadold; catch, tags.cb_loadold = 0; end; + try, tags.namenew; catch, tags.namenew = EEG.setname; end; + try, tags.filenamenew; catch, tags.filenamenew = ''; end; + cont = 0; + if ~isempty(result) + if overwrite_or_save & tags.cb_saveold % save but not overwrite + if isempty(tags.filenameold) + warndlg2(strvcat('Error: You must enter a filename for the old dataset!',' ', ... + 'The old dataset must be saved because, by your', ... + 'current memory option, only one full dataset', ... + 'can be kept in memory. Thus, you must either', ... + 'save or overwrite the old dataset.')); + cont = 1; + end; + end; + end; + if have_to_save_new + if isempty(result) % cancel + com = ''; + drawnow; + return; + else + if isempty(tags.filenamenew) & tags.cb_savenew + warndlg2(strvcat('Error: You must enter a filename for the dataset!',' ', ... + 'It must be saved because, by your current memory option, only one full', ... + 'dataset or study can be kept in memory. Note that all changes will be', ... + 'taken into account when processing the STUDY.')); + cont = 1; + end; + end; + end; + end; + drawnow; + + % decode parameters + % ----------------- + args = {}; + if length(result) == 0, + if isempty(g.retrieve) + if isempty(OLDSET), error('Cancel operation'); end; + args = { 'retrieve', OLDSET }; % cancel + else + com = ''; + return; + end; + else + % new dataset + % ----------- + if ~strcmp(EEG.setname, tags.namenew ) + args = { 'setname', tags.namenew }; + end; + if tags.cb_savenew + if ~isempty(tags.filenamenew) + args = { args{:} 'savenew', tags.filenamenew }; + else + disp('Warning: no filename given for new dataset, so it will not be saved to disk.'); + end; + end; + if ~strcmp(EEG.comments, userdat) + args = { args{:} 'comments', userdat }; + end; + if tags.cb_loadold + args = { args{:} 'reload' 'on' }; + end; + + % old dataset + % ----------- + if tags.cb_owrt + args = { args{:} 'overwrite' 'on' }; + end; + if tags.cb_saveold + if ~isempty(tags.filenameold) + args = { args{:} 'saveold', tags.filenameold }; + else + disp('Warning: no file name given for the old dataset, so it will not be saved to disk.'); + end; + end; + end; +elseif length(EEG) > 1 + % processing multiple datasets + % ---------------------------- + [ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, OLDSET ); % it is possible to undo the operation here + com = '[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, CURRENTSET );'; + return; +else + % no interactive inputs + args = varargin; +end; + +% assigning values +% ---------------- +overWflag = 0; +if isempty(g.retrieve) & ~isempty(EEG) + if strcmpi(EEG.saved, 'justloaded') + EEG.saved = 'yes'; + else + EEG.saved = 'no'; + end; +end; + +for ind = 1:2:length(args) + switch lower(args{ind}) + case 'setname' , EEG.setname = args{ind+1}; EEG = eeg_hist(EEG, [ 'EEG.setname=''' EEG.setname ''';' ]); + case 'comments' , EEG.comments = args{ind+1}; + case 'reload' , EEG = pop_loadset('filename', EEG.filename, 'filepath', EEG.filepath, 'loadmode', 'info'); + [ALLEEG EEG] = eeg_store(ALLEEG, EEG, OLDSET); + ALLEEG(OLDSET).saved = 'yes'; + case 'retrieve' , if ~isempty(ALLEEG) & args{ind+1} ~= 0 + EEG = eeg_retrieve(ALLEEG, args{ind+1}); + else + EEG = eeg_emptyset; + end; + com = ''; return; + case { 'save' 'savenew' }, [filepath filename ext] = fileparts( args{ind+1} ); + EEG = pop_saveset(EEG, [ filename ext ], filepath); + case 'saveold', [filepath filename ext] = fileparts( args{ind+1} ); + TMPEEG = pop_saveset(ALLEEG(OLDSET), [ filename ext ], filepath); + [ALLEEG] = eeg_store(ALLEEG, TMPEEG, OLDSET); + ALLEEG(OLDSET).saved = 'yes'; + case 'overwrite' , if strcmpi(args{ind+1}, 'on') | strcmpi(args{ind+1}, 'yes') + overWflag = 1; % so it can be done at the end + end; + otherwise, error(['pop_newset error: unrecognized key ''' args{ind} '''']); + end; +end; + +% remove data from file if necessary +% ---------------------------------- +if option_storedisk & ~isempty(ALLEEG) & OLDSET ~= 0 + if ~isfield(ALLEEG, 'datfile'), ALLEEG(OLDSET).datfile = ''; end; + ALLEEG(OLDSET) = update_datafield(ALLEEG(OLDSET)); +end; + +% moving/erasing/creating datasets +% -------------------------------- +if ~isempty(g.retrieve) + + % in case the old dataset was modified + % ------------------------------------ + if strcmpi(EEG.saved, 'yes') + [ALLEEG, EEG] = eeg_store( ALLEEG, EEG, OLDSET); + ALLEEG(OLDSET).saved = 'yes'; + EEG.saved = 'yes'; + else + [ALLEEG, EEG] = eeg_store( ALLEEG, EEG, OLDSET); + end; + + % dataset retrieval + % ----------------- + if overWflag % delete old dataset + ALLEEG = pop_delset( ALLEEG, OLDSET); + end; + [EEG, ALLEEG, CURRENTSET] = eeg_retrieve( ALLEEG, g.retrieve); +else + % new dataset + % ----------- + if overWflag + if strcmpi(EEG.saved, 'yes') + [ALLEEG, EEG] = eeg_store( ALLEEG, EEG, OLDSET); + ALLEEG(OLDSET).saved = 'yes'; + EEG.saved = 'yes'; + else + [ALLEEG, EEG] = eeg_store( ALLEEG, EEG, OLDSET); + end; + else + if strcmpi(EEG.saved, 'yes') || strcmpi(EEG.saved, 'justloaded') + [ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0); % 0 means that it is saved on disk + else + [ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG); + end; + end; +end; + +com = sprintf('[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, %s); ', vararg2str( { OLDSET args{:} 'gui' 'off' } )); +return; + +function num = popask( text ) + ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); + switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; + end; + +function EEG = update_datafield(EEG); + if ~isfield(EEG, 'datfile'), EEG.datfile = ''; end; + if ~isempty(EEG.datfile) + EEG.data = EEG.datfile; + else + EEG.data = 'in set file'; + end; + EEG.icaact = []; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_newtimef.m b/code/eeglab13_4_4b/functions/popfunc/pop_newtimef.m new file mode 100644 index 0000000..2c49dc9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_newtimef.m @@ -0,0 +1,341 @@ +% pop_newtimef() - Returns estimates and plots of event-related (log) spectral +% perturbation (ERSP) and inter-trial coherence (ITC) phenomena +% timelocked to a set of single-channel input epochs +% +% Usage: +% >> pop_newtimef(EEG, typeplot); % pop_up window +% >> pop_newtimef(EEG, typeplot, lastcom); % pop_up window +% >> pop_newtimef(EEG, typeplot, channel); % do not pop-up window +% >> pop_newtimef(EEG, typeproc, num, tlimits,cycles, +% 'key1',value1,'key2',value2, ... ); +% +% Graphical interface: +% "Channel/component number" - [edit box] this is the index of the data +% channel or the index of the component for which to plot the +% time-frequency decomposition. +% "Sub-epoch time limits" - [edit box] sub epochs may be extracted (note that +% this function aims at plotting data epochs not continuous data). +% You may select the new epoch limits in this edit box. +% "Use n time points" - [muliple choice list] this is the number of time +% points to use for the time-frequency decomposition. The more +% time points, the longer the time-frequency decomposition +% takes to compute. +% "Frequency limits" - [edit box] these are the lower and upper +% frequency limit of the time-frequency decomposition. Instead +% of limits, you may also enter a sequence of frequencies. For +% example to compute the time-frequency decomposition at all +% frequency between 5 and 50 hertz with 1 Hz increment, enter "1:50" +% "Use limits, padding n" - [muliple choice list] "using limits" means +% to use the upper and lower limits in "Frequency limits" with +% a specific padding ratio (padratio argument of newtimef). +% The last option "use actual frequencies" forces newtimef to +% ignore the padratio argument and use the vector of frequencies +% given as input in the "Frequency limits" edit box. +% "Log spaced" - [checkbox] you may check this box to compute log-spaced +% frequencies. Note that this is only relevant if you specify +% frequency limits (in case you specify actual frequencies, +% this parameter is ignored). +% "Use divisive baseline" - [muliple choice list] there are two types of +% baseline correction, additive (the baseline is subtracted) +% or divisive (the data is divided by the baseline values). +% The choice is yours. There is also the option to perform +% baseline correction in single trials. See the 'trialbase' "full" +% option in the newtimef.m documentation for more information. +% "No baseline" - [checkbox] check this box to compute the raw time-frequency +% decomposition with no baseline removal. +% "Wavelet cycles" - [edit box] specify the number of cycle at the lowest +% and highest frequency. Instead of specifying the number of cycle +% at the highest frequency, you may also specify a wavelet +% "factor" (see newtimef help message). In addition, it is +% possible to specify actual wavelet cycles for each frequency +% by entering a sequence of numbers. +% "Use FFT" - [checkbox] check this checkbox to use FFT instead of +% wavelet decomposition. +% "ERSP color limits" - [edit box] set the upper and lower limit for the +% ERSP image. +% "see log power" - [checkbox] the log power values (in dB) are plotted. +% Uncheck this box to plot the absolute power values. +% "ITC color limits" - [edit box] set the upper and lower limit for the +% ITC image. +% "plot ITC phase" - [checkbox] check this box plot plot (overlayed on +% the ITC amplitude) the polarity of the ITC complex value. +% "Bootstrap significance level" - [edit box] use this edit box to enter +% the p-value threshold for masking both the ERSP and the ITC +% image for significance (masked values appear as light green) +% "FDR correct" - [checkbox] this correct the p-value for multiple comparisons +% (accross all time and frequencies) using the False Discovery +% Rate method. See the fdr.m function for more details. +% "Optional newtimef arguments" - [edit box] addition argument for the +% newtimef function may be entered here in the 'key', value +% format. +% "Plot Event Related Spectral Power" - [checkbox] plot the ERSP image +% showing event related spectral stimulus induced changes +% "Plot Inter Trial Coherence" - [checkbox] plot the ITC image. +% "Plot Curve at each frequency" - [checkbox] instead of plotting images, +% it is also possible to display curves at each frequency. +% This functionality is beta and might not work in all cases. +% +% Inputs: +% INEEG - input EEG dataset +% typeproc - type of processing: 1 process the raw channel data +% 0 process the ICA component data +% num - component or channel number +% tlimits - [mintime maxtime] (ms) sub-epoch time limits to plot +% cycles - > 0 --> Number of cycles in each analysis wavelet +% = 0 --> Use FFTs (with constant window length +% at all frequencies) +% +% Optional inputs: +% See the newtimef() function. +% +% Outputs: Same as newtimef(); no outputs are returned when a +% window pops-up to ask for additional arguments +% +% Saving the ERSP and ITC output values: +% Simply look up the history using the eegh function (type eegh). +% Then copy and paste the pop_newtimef() command and add output args. +% See the newtimef() function for a list of outputs. For instance, +% >> [ersp itc powbase times frequencies] = pop_newtimef( EEG, ....); +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: newtimef(), eeglab() + +% Copyright (C) 2002 University of California San Diego +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-08-02 add eeglab option & optimize variable sizes -ad +% 03-10-02 change newtimef call -ad +% 03-18-02 added title -ad & sm +% 04-04-02 added outputs -ad & sm + +function varargout = pop_newtimef(EEG, typeproc, num, tlimits, cycles, varargin ); + +varargout{1} = ''; +% display help if not enough arguments +% ------------------------------------ +if nargin < 2 + help pop_newtimef; + return; +end; +lastcom = []; +if nargin < 3 + popup = 1; +else + popup = isstr(num) | isempty(num); + if isstr(num) + lastcom = num; + end; +end; + +% pop up window +% ------------- +if popup + [txt vars] = gethelpvar('newtimef.m'); + + g = [1 0.3 0.6 0.4]; + geometry = { g g g g g g g g [0.975 1.27] [1] [1.2 1 1.2]}; + uilist = { ... + { 'Style', 'text', 'string', fastif(typeproc, 'Channel number', 'Component number'), 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,3,[],'1') 'tag' 'chan'} {} {} ... + ... + { 'Style', 'text', 'string', 'Sub epoch time limits [min max] (msec)', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,4,[],[ int2str(EEG.xmin*1000) ' ' int2str(EEG.xmax*1000) ]) 'tag' 'tlimits' } ... + { 'Style', 'popupmenu', 'string', 'Use 50 time points|Use 100 time points|Use 150 time points|Use 200 time points|Use 300 time points|Use 400 time points' 'tag' 'ntimesout' 'value' 4} { } ... + ... + { 'Style', 'text', 'string', 'Frequency limits [min max] (Hz) or sequence', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', '' 'tag' 'freqs' } ... + { 'Style', 'popupmenu', 'string', 'Use limits, padding 1|Use limits, padding 2|Use limits, padding 4|Use actual freqs.' 'tag' 'nfreqs' } ... + { 'Style', 'checkbox', 'string' 'Log spaced' 'value' 0 'tag' 'freqscale' } ... + ... + { 'Style', 'text', 'string', 'Baseline limits [min max] (msec) (0->pre-stim.)', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', '0' 'tag' 'baseline' } ... + { 'Style', 'popupmenu', 'string', 'Use divisive baseline (DIV)|Use standard deviation (STD)|Use single trial DIV baseline|Use single trial STD baseline' 'tag' 'basenorm' } ... + { 'Style', 'checkbox', 'string' 'No baseline' 'tag' 'nobase' } ... + ... + { 'Style', 'text', 'string', 'Wavelet cycles [min max/fact] or sequence', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,5,[],'3 0.5') 'tag' 'cycle' } ... + { 'Style', 'checkbox', 'string' 'Use FFT' 'value' 0 'tag' 'fft' } ... + { } ... + ... + { 'Style', 'text', 'string', 'ERSP color limits [max] (min=-max)', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', '' 'tag' 'erspmax'} ... + { 'Style', 'checkbox', 'string' 'see log power (set)' 'tag' 'scale' 'value' 1} {} ... + ... + { 'Style', 'text', 'string', 'ITC color limits [max]', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', '' 'tag' 'itcmax'} ... + { 'Style', 'checkbox', 'string' 'plot ITC phase (set)' 'tag' 'plotphase' } {} ... + ... + { 'Style', 'text', 'string', 'Bootstrap significance level (Ex: 0.01 -> 1%)', 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,'alpha') 'tag' 'alpha'} ... + { 'Style', 'checkbox', 'string' 'FDR correct (set)' 'tag' 'fdr' } {} ... + ... + { 'Style', 'text', 'string', 'Optional newtimef() arguments (see Help)', 'fontweight', 'bold', ... + 'tooltipstring', 'See newtimef() help via the Help button on the right...' } ... + { 'Style', 'edit', 'string', '' 'tag' 'options' } ... + {} ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotersp','present',0), 'string', ... + 'Plot Event Related Spectral Power', 'tooltipstring', ... + 'Plot log spectral perturbation image in the upper panel' 'tag' 'plotersp' } ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotitc','present',0), 'string', ... + 'Plot Inter Trial Coherence', 'tooltipstring', ... + 'Plot the inter-trial coherence image in the lower panel' 'tag' 'plotitc' } ... + { 'Style', 'checkbox', 'value', 0, 'string', ... + 'Plot curve at each frequency' 'tag' 'plotcurve' } ... + }; + % { 'Style', 'edit', 'string', '''padratio'', 4, ''plotphase'', ''off''' } ... + %{ 'Style', 'text', 'string', '[set] -> Plot ITC phase sign', 'fontweight', 'bold', ... + % 'tooltipstring', ['Plot the sign (+/-) of inter-trial coherence phase' 10 ... + % 'as red (+) or blue (-)'] } ... + % { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotphase','present',1) } { } ... + + [ tmp1 tmp2 strhalt result ] = inputgui( geometry, uilist, 'pophelp(''pop_newtimef'');', ... + fastif(typeproc, 'Plot channel time frequency -- pop_newtimef()', ... + 'Plot component time frequency -- pop_newtimef()')); + if length( tmp1 ) == 0 return; end; + + if result.fft, result.cycle = '0'; end; + if result.nobase, result.baseline = 'NaN'; end; + + num = eval( [ '[' result.chan ']' ] ); + tlimits = eval( [ '[' result.tlimits ']' ] ); + cycles = eval( [ '[' result.cycle ']' ] ); + freqs = eval( [ '[' result.freqs ']' ] ); + %result.ncycles == 2 is ignored + + % add topoplot + % ------------ + options = []; + if isfield(EEG.chanlocs, 'theta') && ~isempty(EEG.chanlocs(num).theta) + if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; + if typeproc == 1 + if isempty(EEG.chanlocs), caption = [ 'Channel ' int2str(num) ]; else caption = EEG.chanlocs(num).labels; end; + options = [options ', ''topovec'', ' int2str(num) ... + ', ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo, ''caption'', ''' caption '''' ]; + else + options = [options ', ''topovec'', EEG.icawinv(:,' int2str(num) ... + '), ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo, ''caption'', [''IC '', num2str(num)]' ]; + end; + end; + + if ~isempty( result.baseline ), options = [ options ', ''baseline'',[' result.baseline ']' ]; end; + if ~isempty( result.alpha ), options = [ options ', ''alpha'',' result.alpha ]; end; + if ~isempty( result.options ), options = [ options ',' result.options ]; end; + if ~isempty( result.freqs ), options = [ options ', ''freqs'', [' result.freqs ']' ]; end; + if ~isempty( result.erspmax ), options = [ options ', ''erspmax'', [' result.erspmax ']' ]; end; + if ~isempty( result.itcmax ), options = [ options ', ''itcmax'',' result.itcmax ]; end; + if ~result.plotersp, options = [ options ', ''plotersp'', ''off''' ]; end; + if ~result.plotitc, options = [ options ', ''plotitc'' , ''off''' ]; end; + if result.plotcurve, options = [ options ', ''plottype'', ''curve''' ]; end; + if result.fdr, options = [ options ', ''mcorrect'', ''fdr''' ]; end; + if result.freqscale, options = [ options ', ''freqscale'', ''log''' ]; end; + if ~result.plotphase, options = [ options ', ''plotphase'', ''off''' ]; end; + if ~result.scale, options = [ options ', ''scale'', ''abs''' ]; end; + if result.ntimesout == 1, options = [ options ', ''ntimesout'', 50' ]; end; + if result.ntimesout == 2, options = [ options ', ''ntimesout'', 100' ]; end; + if result.ntimesout == 3, options = [ options ', ''ntimesout'', 150' ]; end; + if result.ntimesout == 5, options = [ options ', ''ntimesout'', 300' ]; end; + if result.ntimesout == 6, options = [ options ', ''ntimesout'', 400' ]; end; + if result.nfreqs == 1, options = [ options ', ''padratio'', 1' ]; end; + if result.nfreqs == 2, options = [ options ', ''padratio'', 2' ]; end; + if result.nfreqs == 3, options = [ options ', ''padratio'', 4' ]; end; + if result.nfreqs == 4, options = [ options ', ''nfreqs'', ' int2str(length(freqs)) ]; end; + if result.basenorm == 2, options = [ options ', ''basenorm'', ''on''' ]; end; + if result.basenorm == 4, options = [ options ', ''basenorm'', ''on''' ]; end; + if result.basenorm >= 3, options = [ options ', ''trialbase'', ''full''' ]; end; + + % add title + % --------- + if isempty( findstr( '''title''', result.options)) + if ~isempty(EEG.chanlocs) & typeproc + chanlabel = EEG.chanlocs(num).labels; + else + chanlabel = int2str(num); + end; + end; + + % compute default winsize + % ----------------------- + if EEG.xmin < 0 && isempty(findstr( '''winsize''', result.options)) && isempty( result.freqs ) + fprintf('Computing window size in pop_newtimef based on half of the length of the baseline period'); + options = [ options ', ''winsize'', ' int2str(-EEG.xmin*EEG.srate) ]; + end; + + figure; try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; +else + options = [ ',' vararg2str(varargin) ]; +end; + +% compute epoch limits +% -------------------- +if isempty(tlimits) + tlimits = [EEG.xmin, EEG.xmax]*1000; +end; +pointrange1 = round(max((tlimits(1)/1000-EEG.xmin)*EEG.srate, 1)); +pointrange2 = round(min((tlimits(2)/1000-EEG.xmin)*EEG.srate, EEG.pnts)); +pointrange = [pointrange1:pointrange2]; + +% call function sample either on raw data or ICA data +% --------------------------------------------------- +if typeproc == 1 + tmpsig = EEG.data(num,pointrange,:); +else + if ~isempty( EEG.icasphere ) + eeglab_options; % changed from eeglaboptions 3/30/02 -sm + if option_computeica + tmpsig = EEG.icaact(num,pointrange,:); + else + tmpsig = (EEG.icaweights(num,:)*EEG.icasphere)*reshape(EEG.data(:,pointrange,:), EEG.nbchan, EEG.trials*length(pointrange)); + end; + else + error('You must run ICA first'); + end; +end; +tmpsig = reshape( tmpsig, length(num), size(tmpsig,2)*size(tmpsig,3)); + +% outputs +% ------- +outstr = ''; +if ~popup + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% plot the datas and generate output command +% -------------------------------------------- +if length( options ) < 2 + options = ''; +end; +if nargin < 4 + varargout{1} = sprintf('figure; pop_newtimef( %s, %d, %d, [%s], [%s] %s);', inputname(1), typeproc, num, ... + int2str(tlimits), num2str(cycles), options); +end; +com = sprintf('%s newtimef( tmpsig(:, :), length(pointrange), [tlimits(1) tlimits(2)], EEG.srate, cycles %s);', outstr, options); +eval(com) + +return; + +% get contextual help +% ------------------- +function txt = context(var, allvars, alltext); + loc = strmatch( var, allvars); + if ~isempty(loc) + txt= alltext{loc(1)}; + else + disp([ 'warning: variable ''' var ''' not found']); + txt = ''; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_plotdata.m b/code/eeglab13_4_4b/functions/popfunc/pop_plotdata.m new file mode 100644 index 0000000..dd602fb --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_plotdata.m @@ -0,0 +1,200 @@ +% pop_plotdata() - Plot average of EEG channels or independent components in +% a rectangular array. Else, (over)plot single trials. +% Usage: +% >> avg = pop_plotdata(EEG, typeplot, indices, trials, title, singletrials, ydir, ylimits); +% +% Inputs: +% EEG - Input dataset +% typeplot - Type data to plot (1=channels, 0=components) {Default:1} +% indices - Array of channels (or component) indices to plot +% {Default: all} +% trials - Array of trial indices. sum specific trials in the average +% {Default: all} +% title - Plot title. {Default: []}. +% singletrials - [0|1], Plot average or overplot single trials +% 0 plot average, 1 plot single trials {Default: 0} +% ydir - [1|-1] y-axis polarity (pos-up = 1; neg-up = -1) +% {def command line-> pos-up; def GUI-> neg-up} +% ylimits - [ymin ymax] plotting limits {default [0 0] -> data range} +% +% Outputs: +% avg - [matrix] Data average +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: plotdata(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-08-02 add eeglab options -ad +% 03-18-02 added title -ad & sm +% 03-30-02 added single trial capacities -ad + +function [sigtmp, com] = pop_plotdata(EEG, typeplot, indices, trials, plottitle, singletrials, ydir,ylimits); + +ylimits = [0 0];% default ylimits = data range + +% warning signal must be in a 3D form before averaging + +sigtmp = []; + +com = ''; +if nargin < 1 + help pop_plotdata; + return; +end; +if nargin < 2 + typeplot = 1; % 1=signal; 0=component +end; +if exist('plottitle') ~= 1 + plottitle = ''; +end; + +if nargin <3 + if typeplot % plot signal channels + result = inputdlg2({ 'Channel number(s):' ... + 'Plot title:' ... + 'Vertical limits ([0 0]-> data range):' ... + }, ... + 'Channel ERPs in rect. array -- pop_plotdata()', 1, ... + {['1:' int2str(EEG.nbchan)] [fastif(isempty(EEG.setname), '',[EEG.setname ' ERP'])] ['0 0'] }, ... + 'pop_plotdata' ); + else % plot components + result = inputdlg2({ 'Component number(s):' ... + 'Plot title:' ... + 'Vertical limits ([0 0]-> data range):' ... + }, ... + 'Component ERPs in rect. array -- pop_plotdata()', 1, ... + { ['1:' int2str(size(EEG.icawinv,2))] [fastif(isempty(EEG.setname), '',[EEG.setname ' ERP'])] ['0 0'] }, ... + 'pop_plotdata' ); + end; + if length(result) == 0 return; end; + + indices = eval( [ '[' result{1} ']' ] ); + + plottitle = result{2}; + + singletrials = 0; + + ylimits = eval( [ '[' result{3} ']' ] ); + if length(ylimits) ~= 2 + ylimits = [0 0]; % use default if 2 values not given + end +end; +if ~(exist('trials') == 1) + trials = 1:EEG.trials; +end; +if exist('plottitle') ~= 1 + plottitle = ''; +end; +if exist('singletrials') ~= 1 + singletrials = 0; +end; + +if EEG.trials > 1 & singletrials == 0 + fprintf('Selecting trials and components...\n'); + if typeplot == 1 + sigtmp = nan_mean(EEG.data(indices,:,trials),3); + else + if isempty(EEG.icasphere) + error('no ICA data for this set, first run ICA'); + end; + tmpdata = eeg_getdatact(EEG, 'component', indices, 'trialindices', trials); + fprintf('Averaging...\n'); + sigtmp = nan_mean(tmpdata,3); + end; +else + if typeplot == 1 + sigtmp = EEG.data(indices,:,trials); + else + if isempty(EEG.icasphere) + error('no ICA data for this set, first run ICA'); + end; + sigtmp = eeg_getdatact(EEG, 'component', indices, 'trialindices', trials); + end; +end; +figure; +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; +if exist('YDIR') ~= 1 + ydir = 1; +else + ydir = YDIR; +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%% make the plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +sigtmp = reshape( sigtmp, size(sigtmp,1), size(sigtmp,2)*size(sigtmp,3)); +ymin = ylimits(1); +ymax = ylimits(2); + +if ischar(ymin) + ymin = str2num(ymin); + ymax = str2num(ymax); +end + +% com = sprintf('pop_plotdata(%s, %d, %s, [1:%d], ''%s'', %d, %d, [%f %f]);', ... +% inputname(1), typeplot, vararg2str(indices), EEG.trials, plottitle, singletrials,ydir,ymin,ymax); +% fprintf([com '\n']); +if ~isempty(EEG.chanlocs) && typeplot == 1 + tmpchanlocs = EEG.chanlocs; + chanlabels = strvcat({ tmpchanlocs(indices).labels }); +else + chanlabels = num2str(indices(:)); +end; +plottopo( sigtmp, 'frames', EEG.pnts, 'limits', [EEG.xmin*1000 EEG.xmax*1000 ymin ymax], 'title', plottitle, 'chans', 1:size(sigtmp,1), 'ydir', ydir, 'channames', chanlabels); +%plotdata(sigtmp, EEG.pnts, [EEG.xmin*1000 EEG.xmax*1000 ymin ymax], plottitle, indices,0,0,ydir); + +% +%%%%%%%%%%%%%%%%%%%%%%%%%% add figure title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if typeplot == 1 + set(gcf, 'name', 'Plot > Channel ERPs > In rect. array -- plotdata()'); +else + set(gcf, 'name', 'Plot > Component ERPs > In rect. array -- plotdata()'); +end; +% +%%%%%%%%%%%%%%%%%%%%%%%%%% set y-axis direction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if exist('ydir') ~= 1 + if exist('YDIR') ~= 1 + ydir = 1; % default positive up + else + ydir = YDIR; % icadefs.m system-wide default + end +end + +if ydir==1 + set(gca,'ydir','normal'); +else % ydir == -1 + set(gca,'ydir','reverse'); +end + +switch nargin + case {0, 1, 2, 3}, com = sprintf('pop_plotdata(%s, %d, %s, [1:%d], ''%s'', %d, %d, [%g %g]);', inputname(1), typeplot, vararg2str(indices), EEG.trials, plottitle, singletrials,ydir,ymin,ymax); + case 4, com = sprintf('pop_plotdata(%s, %d, %s, %s, ''%s'', %d, %d, [%g %g]);', inputname(1), typeplot, vararg2str(indices), vararg2str(trials), plottitle, singletrials,ydir,ymin,ymax); +end; + +fprintf([com '\n']); +return; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function out = nan_mean(in, dim) + tmpin = in; + tmpin(find(isnan(in(:)))) = 0; + out = sum(tmpin, dim) ./ sum(~isnan(in),dim); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_plottopo.m b/code/eeglab13_4_4b/functions/popfunc/pop_plottopo.m new file mode 100644 index 0000000..31dc6e9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_plottopo.m @@ -0,0 +1,122 @@ +% pop_plottopo() - plot one or more concatenated multichannel data epochs +% in a topographic array format using plottopo() +% Usage: +% >> pop_plottopo( EEG ); % pop-up +% >> pop_plottopo( EEG, channels ); +% >> pop_plottopo( EEG, channels, title, singletrials); +% >> pop_plottopo( EEG, channels, title, singletrials, axsize, ... +% 'color', ydir, vert); +% +% Inputs: +% EEG - input dataset +% channels - indices of channels to plot +% title - plot title. Default is none. +% singletrials - [0|1], 0 plot average, 1 plot individual +% single trials. Default is 0. +% others... - additional plottopo arguments {'axsize', 'color', 'ydir' +% 'vert'} (see >> help plottopo) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 10 March 2002 +% +% See also: plottopo() + +% Copyright (C) 10 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 02-16-02 text interface editing -sm & ad +% 03-18-02 added title -ad & sm +% 03-30-02 added single trial capacities -ad + +function com = pop_plottopo( EEG, channels, plottitle, singletrials, varargin); + +com = ''; +if nargin < 1 + help pop_plottopo; + return; +end; + +if isempty(EEG.chanlocs) + fprintf('Cannot plot without knowing channel locations. Use Edit/Dataset info\n'); + return; +end; + +if nargin < 2 + uilist = { { 'style' 'text' 'string' 'Channels to plot' } ... + { 'style' 'edit' 'string' [ '1:' num2str( EEG.nbchan ) ] 'tag' 'chan' } ... + { 'style' 'text' 'string' 'Plot title' } ... + { 'style' 'edit' 'string' fastif(isempty(EEG.setname), '',EEG.setname) 'tag' 'title' } ... + { 'style' 'text' 'string' 'Plot single trials' } ... + { 'style' 'checkbox' 'string' '(set=yes)' 'tag' 'cbst' } ... + { 'style' 'text' 'string' 'Plot in rect. array' } ... + { 'style' 'checkbox' 'string' '(set=yes)' 'tag' 'cbra' } ... + { 'style' 'text' 'string' 'Other plot options (see help)' } ... + { 'style' 'edit' 'string' '''ydir'', 1' 'tag' 'opt' } }; + geometry = { [1 1] [1 1] [1 1] [1 1] [1 1] }; + [result userdata tmphalt restag ] = inputgui( 'uilist', uilist, 'geometry', geometry, 'helpcom', 'pophelp(''pop_plottopo'')', 'title', 'Topographic ERP plot - pop_plottopo()'); + if length(result) == 0 return; end; + + channels = eval( [ '[' restag.chan ']' ] ); + plottitle = restag.title; + singletrials = restag.cbst; + addoptions = eval( [ '{' restag.opt '}' ] ); + rect = restag.cbra; + + figure('name', ' plottopo()'); + options ={ 'frames' EEG.pnts 'limits' [EEG.xmin EEG.xmax 0 0]*1000 ... + 'title' plottitle 'chans' channels addoptions{:} }; + if ~rect + options = { options{:} 'chanlocs' EEG.chanlocs }; + end; +else + options ={ 'chanlocs' EEG.chanlocs 'frames' EEG.pnts 'limits' [EEG.xmin EEG.xmax 0 0]*1000 ... + 'title' plottitle 'chans' channels varargin{:}}; + addoptions = {}; +end; +% adapt frames to time limit. +if any(strcmp(addoptions,'limits')) + addoptions{end+1} = 'frames'; + ilimits = find(strcmp(addoptions,'limits'))+1; + timelims = addoptions{ilimits}(1:2); + addoptions{end+1} = round(diff(timelims/1000)*EEG.srate); +end + +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + +if exist('plottitle') ~= 1 + plottitle = ''; +end; +if exist('singletrials') ~= 1 + singletrials = 0; +end; + +if singletrials + plottopo( EEG.data, options{:} ); +else + plottopo( mean(EEG.data,3), options{:} ); +end; + +if ~isempty(addoptions) + com = sprintf('figure; pop_plottopo(%s, %s, ''%s'', %d, %s);', ... + inputname(1), vararg2str(channels), plottitle, singletrials, vararg2str(addoptions)); +else + com = sprintf('figure; pop_plottopo(%s, %s, ''%s'', %d);', ... + inputname(1), vararg2str(channels), plottitle, singletrials); +end; + +return; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_prop.m b/code/eeglab13_4_4b/functions/popfunc/pop_prop.m new file mode 100644 index 0000000..1d6fd9a --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_prop.m @@ -0,0 +1,403 @@ +% pop_prop() - plot the properties of a channel or of an independent +% component. +% Usage: +% >> pop_prop( EEG); % pops up a query window +% >> pop_prop( EEG, typecomp); % pops up a query window +% >> pop_prop( EEG, typecomp, chanorcomp, winhandle,spectopo_options); +% +% Inputs: +% EEG - EEGLAB dataset structure (see EEGGLOBAL) +% +% Optional inputs: +% typecomp - [0|1] 1 -> display channel properties +% 0 -> component properties {default: 1 = channel} +% chanorcomp - channel or component number[s] to display {default: 1} +% +% winhandle - if this parameter is present or non-NaN, buttons +% allowing the rejection of the component are drawn. +% If non-zero, this parameter is used to back-propagate +% the color of the rejection button. +% spectopo_options - [cell array] optional cell arry of options for +% the spectopo() function. +% For example { 'freqrange' [2 50] } +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_runica(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% hidden parameter winhandle + +% 01-25-02 reformated help & license -ad +% 02-17-02 removed event index option -ad +% 03-17-02 debugging -ad & sm +% 03-18-02 text settings -ad & sm +% 03-18-02 added title -ad & sm + +function com = pop_prop(EEG, typecomp, chanorcomp, winhandle, spec_opt) + +com = ''; +if nargin < 1 + help pop_prop; + return; +end; +if nargin < 5 + spec_opt = {}; +end; +if nargin == 1 + typecomp = 1; % defaults + chanorcomp = 1; +end; +if typecomp == 0 & isempty(EEG.icaweights) + error('No ICA weights recorded for this dataset -- first run ICA on it'); +end; +if nargin == 2 + promptstr = { fastif(typecomp,'Channel index(ices) to plot:','Component index(ices) to plot:') ... + 'Spectral options (see spectopo() help):' }; + inistr = { '1' '''freqrange'', [2 50]' }; + result = inputdlg2( promptstr, 'Component properties - pop_prop()', 1, inistr, 'pop_prop'); + if size( result, 1 ) == 0 return; end; + + chanorcomp = eval( [ '[' result{1} ']' ] ); + spec_opt = eval( [ '{' result{2} '}' ] ); +end; + +% plotting several component properties +% ------------------------------------- +if length(chanorcomp) > 1 + for index = chanorcomp + pop_prop(EEG, typecomp, index, 0, spec_opt); % call recursively for each chanorcomp + end; + com = sprintf('pop_prop( %s, %d, [%s], NaN, %s);', inputname(1), ... + typecomp, int2str(chanorcomp), vararg2str( { spec_opt } )); + return; +end; + +if chanorcomp < 1 | chanorcomp > EEG.nbchan % should test for > number of components ??? -sm + error('Component index out of range'); +end; + +% assumed input is chanorcomp +% ------------------------- +try, icadefs; +catch, + BACKCOLOR = [0.8 0.8 0.8]; + GUIBUTTONCOLOR = [0.8 0.8 0.8]; +end; +basename = [fastif(typecomp,'Channel ', 'Component ') int2str(chanorcomp) ]; + +fh = figure('name', ['pop_prop() - ' basename ' properties'], 'color', BACKCOLOR, 'numbertitle', 'off', 'visible', 'off'); +pos = get(gcf,'Position'); +set(gcf,'Position', [pos(1) pos(2)-500+pos(4) 500 500], 'visible', 'on'); +pos = get(gca,'position'); % plot relative to current axes +hh = gca; +q = [pos(1) pos(2) 0 0]; +s = [pos(3) pos(4) pos(3) pos(4)]./100; +axis off; + +% plotting topoplot +% ----------------- +h = axes('Units','Normalized', 'Position',[-10 60 40 42].*s+q); + +%topoplot( EEG.icawinv(:,chanorcomp), EEG.chanlocs); axis square; + +if isfield(EEG.chanlocs, 'theta') + if typecomp == 1 % plot single channel locations + topoplot( chanorcomp, EEG.chanlocs, 'chaninfo', EEG.chaninfo, ... + 'electrodes','off', 'style', 'blank', 'emarkersize1chan', 12); axis square; + else % plot component map + topoplot( EEG.icawinv(:,chanorcomp), EEG.chanlocs, 'chaninfo', EEG.chaninfo, ... + 'shading', 'interp', 'numcontour', 3); axis square; + end; +else + axis off; +end; +basename = [fastif(typecomp,'Channel ', 'IC') int2str(chanorcomp) ]; +% title([ basename fastif(typecomp, ' location', ' map')], 'fontsize', 14); +title(basename, 'fontsize', 14); + +% plotting erpimage +% ----------------- +hhh = axes('Units','Normalized', 'Position',[45 62 48 38].*s+q); +eeglab_options; +if EEG.trials > 1 + % put title at top of erpimage + axis off + hh = axes('Units','Normalized', 'Position',[45 62 48 38].*s+q); + EEG.times = linspace(EEG.xmin, EEG.xmax, EEG.pnts); + if EEG.trials < 6 + ei_smooth = 1; + else + ei_smooth = 3; + end + if typecomp == 1 % plot channel + offset = nan_mean(EEG.data(chanorcomp,:)); + erp=nan_mean(squeeze(EEG.data(chanorcomp,:,:))')-offset; + erp_limits=get_era_limits(erp); + erpimage( EEG.data(chanorcomp,:)-offset, ones(1,EEG.trials)*10000, EEG.times*1000, ... + '', ei_smooth, 1, 'caxis', 2/3, 'cbar','erp','erp_vltg_ticks',erp_limits); + else % plot component + icaacttmp = eeg_getdatact(EEG, 'component', chanorcomp); + offset = nan_mean(icaacttmp(:)); + era = nan_mean(squeeze(icaacttmp)')-offset; + era_limits=get_era_limits(era); + erpimage( icaacttmp-offset, ones(1,EEG.trials)*10000, EEG.times*1000, ... + '', ei_smooth, 1, 'caxis', 2/3, 'cbar','erp', 'yerplabel', '','erp_vltg_ticks',era_limits); + end; + axes(hhh); + title(sprintf('%s activity \\fontsize{10}(global offset %3.3f)', basename, offset), 'fontsize', 14); +else + % put title at top of erpimage + EI_TITLE = 'Continous data'; + axis off + hh = axes('Units','Normalized', 'Position',[45 62 48 38].*s+q); + ERPIMAGELINES = 200; % show 200-line erpimage + while size(EEG.data,2) < ERPIMAGELINES*EEG.srate + ERPIMAGELINES = 0.9 * ERPIMAGELINES; + end + ERPIMAGELINES = round(ERPIMAGELINES); + if ERPIMAGELINES > 2 % give up if data too small + if ERPIMAGELINES < 10 + ei_smooth = 1; + else + ei_smooth = 3; + end + erpimageframes = floor(size(EEG.data,2)/ERPIMAGELINES); + erpimageframestot = erpimageframes*ERPIMAGELINES; + eegtimes = linspace(0, erpimageframes-1, length(erpimageframes)); % 05/27/2014 Ramon: length(erpimageframes) by EEG.srate/1000 in eegtimes = linspace(0, erpimageframes-1, EEG.srate/1000); + if typecomp == 1 % plot channel + offset = nan_mean(EEG.data(chanorcomp,:)); + % Note: we don't need to worry about ERP limits, since ERPs + % aren't visualized for continuous data + erpimage( reshape(EEG.data(chanorcomp,1:erpimageframestot),erpimageframes,ERPIMAGELINES)-offset, ones(1,ERPIMAGELINES)*10000, eegtimes , ... + EI_TITLE, ei_smooth, 1, 'caxis', 2/3, 'cbar'); + else % plot component + icaacttmp = eeg_getdatact(EEG, 'component', chanorcomp); + offset = nan_mean(icaacttmp(:)); + erpimage(reshape(icaacttmp(:,1:erpimageframestot),erpimageframes,ERPIMAGELINES)-offset,ones(1,ERPIMAGELINES)*10000, eegtimes , ... + EI_TITLE, ei_smooth, 1, 'caxis', 2/3, 'cbar','yerplabel', ''); + end + else + axis off; + text(0.1, 0.3, [ 'No erpimage plotted' 10 'for small continuous data']); + end; + axes(hhh); +end; + +% plotting spectrum +% ----------------- +if ~exist('winhandle') + winhandle = NaN; +end; +if ishandle(winhandle) % RMC isnan by ~ishandle + h = axes('units','normalized', 'position',[5 10 95 35].*s+q); +else + h = axes('units','normalized', 'position',[5 0 95 40].*s+q); +end; +%h = axes('units','normalized', 'position',[45 5 60 40].*s+q); +try + eeglab_options; + if typecomp == 1 + [spectra freqs] = spectopo( EEG.data(chanorcomp,:), EEG.pnts, EEG.srate, spec_opt{:} ); + else + if option_computeica + [spectra freqs] = spectopo( EEG.icaact(chanorcomp,:), EEG.pnts, EEG.srate, 'mapnorm', EEG.icawinv(:,chanorcomp), spec_opt{:} ); + else + icaacttmp = (EEG.icaweights(chanorcomp,:)*EEG.icasphere)*reshape(EEG.data(EEG.icachansind,:,:), length(EEG.icachansind), EEG.trials*EEG.pnts); + [spectra freqs] = spectopo( icaacttmp, EEG.pnts, EEG.srate, 'mapnorm', EEG.icawinv(:,chanorcomp), spec_opt{:} ); + end; + end; + % set up new limits + % ----------------- + %freqslim = 50; + %set(gca, 'xlim', [0 min(freqslim, EEG.srate/2)]); + %spectra = spectra(find(freqs <= freqslim)); + %set(gca, 'ylim', [min(spectra) max(spectra)]); + + %tmpy = get(gca, 'ylim'); + %set(gca, 'ylim', [max(tmpy(1),-1) tmpy(2)]); + set( get(gca, 'ylabel'), 'string', 'Power 10*log_{10}(\muV^{2}/Hz)', 'fontsize', 14); + set( get(gca, 'xlabel'), 'string', 'Frequency (Hz)', 'fontsize', 14); + title('Activity power spectrum', 'fontsize', 14); +catch err + axis off; + text(0.1, 0.3, [ 'Error: no spectrum plotted' 10 err.message 10]); +% lasterror +% text(0.1, 0.3, [ 'Error: no spectrum plotted' 10 ' make sure you have the ' 10 'signal processing toolbox']); +end; + +% display buttons +% --------------- +if ishandle(winhandle) + COLREJ = '[1 0.6 0.6]'; + COLACC = '[0.75 1 0.75]'; + % CANCEL button + % ------------- + h = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', GUIBUTTONCOLOR, 'string', 'Cancel', 'Units','Normalized','Position',[-10 -10 15 6].*s+q, 'callback', 'close(gcf);'); + + % VALUE button + % ------------- + hval = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', GUIBUTTONCOLOR, 'string', 'Values', 'Units','Normalized', 'Position', [15 -10 15 6].*s+q); + + % REJECT button + % ------------- + if ~isempty(EEG.reject.gcompreject) + status = EEG.reject.gcompreject(chanorcomp); + else + status = 0; + end; + hr = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', eval(fastif(status,COLREJ,COLACC)), ... + 'string', fastif(status, 'REJECT', 'ACCEPT'), 'Units','Normalized', 'Position', [40 -10 15 6].*s+q, 'userdata', status, 'tag', 'rejstatus'); + command = [ 'set(gcbo, ''userdata'', ~get(gcbo, ''userdata''));' ... + 'if get(gcbo, ''userdata''),' ... + ' set( gcbo, ''backgroundcolor'',' COLREJ ', ''string'', ''REJECT'');' ... + 'else ' ... + ' set( gcbo, ''backgroundcolor'',' COLACC ', ''string'', ''ACCEPT'');' ... + 'end;' ]; + set( hr, 'callback', command); + + % HELP button + % ------------- + h = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', GUIBUTTONCOLOR, 'string', 'HELP', 'Units','Normalized', 'Position', [65 -10 15 6].*s+q, 'callback', 'pophelp(''pop_prop'');'); + + % OK button + % --------- + command = [ 'global EEG;' ... + 'tmpstatus = get( findobj(''parent'', gcbf, ''tag'', ''rejstatus''), ''userdata'');' ... + 'EEG.reject.gcompreject(' num2str(chanorcomp) ') = tmpstatus;' ]; + if winhandle ~= 0 + if VERS < 8.04 + command = [ command ... + sprintf('if tmpstatus set(%3.15f, ''backgroundcolor'', %s); else set(%3.15f, ''backgroundcolor'', %s); end;', ... + winhandle, COLREJ, winhandle, COLACC)]; + elseif VERS >= 8.04 + command = [ command ... + sprintf('if tmpstatus set(findobj(''Tag'', ''%s''), ''backgroundcolor'', %s); else set(findobj(''Tag'',''%s''), ''backgroundcolor'', %s); end;', ... + winhandle.Tag, COLREJ, winhandle.Tag, COLACC)]; + end + end; + command = [ command 'close(gcf); clear tmpstatus' ]; + h = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'OK', 'backgroundcolor', GUIBUTTONCOLOR, 'Units','Normalized', 'Position',[90 -10 15 6].*s+q, 'callback', command); + + % draw the figure for statistical values + % -------------------------------------- + index = num2str( chanorcomp ); + command = [ ... + 'figure(''MenuBar'', ''none'', ''name'', ''Statistics of the component'', ''numbertitle'', ''off'');' ... + '' ... + 'pos = get(gcf,''Position'');' ... + 'set(gcf,''Position'', [pos(1) pos(2) 340 340]);' ... + 'pos = get(gca,''position'');' ... + 'q = [pos(1) pos(2) 0 0];' ... + 's = [pos(3) pos(4) pos(3) pos(4)]./100;' ... + 'axis off;' ... + '' ... + 'txt1 = sprintf(''(\n' ... + 'Entropy of component activity\t\t%2.2f\n' ... + '> Rejection threshold \t\t%2.2f\n\n' ... + ' AND \t\t\t----\n\n' ... + 'Kurtosis of component activity\t\t%2.2f\n' ... + '> Rejection threshold \t\t%2.2f\n\n' ... + ') OR \t\t\t----\n\n' ... + 'Kurtosis distibution \t\t\t%2.2f\n' ... + '> Rejection threhold\t\t\t%2.2f\n\n' ... + '\n' ... + 'Current thesholds sujest to %s the component\n\n' ... + '(after manually accepting/rejecting the component, you may recalibrate thresholds for future automatic rejection on other datasets)'',' ... + 'EEG.stats.compenta(' index '), EEG.reject.threshentropy, EEG.stats.compkurta(' index '), ' ... + 'EEG.reject.threshkurtact, EEG.stats.compkurtdist(' index '), EEG.reject.threshkurtdist, fastif(EEG.reject.gcompreject(' index '), ''REJECT'', ''ACCEPT''));' ... + '' ... + 'uicontrol(gcf, ''Units'',''Normalized'', ''Position'',[-11 4 117 100].*s+q, ''Style'', ''frame'' );' ... + 'uicontrol(gcf, ''Units'',''Normalized'', ''Position'',[-5 5 100 95].*s+q, ''String'', txt1, ''Style'',''text'', ''HorizontalAlignment'', ''left'' );' ... + 'h = uicontrol(gcf, ''Style'', ''pushbutton'', ''string'', ''Close'', ''Units'',''Normalized'', ''Position'', [35 -10 25 10].*s+q, ''callback'', ''close(gcf);'');' ... + 'clear txt1 q s h pos;' ]; + set( hval, 'callback', command); + if isempty( EEG.stats.compenta ) + set(hval, 'enable', 'off'); + end; + + com = sprintf('pop_prop( %s, %d, %d, 0, %s);', inputname(1), typecomp, chanorcomp, vararg2str( { spec_opt } ) ); +else + com = sprintf('pop_prop( %s, %d, %d, NaN, %s);', inputname(1), typecomp, chanorcomp, vararg2str( { spec_opt } ) ); +end; + +return; + +function out = nan_mean(in) + + nans = find(isnan(in)); + in(nans) = 0; + sums = sum(in); + nonnans = ones(size(in)); + nonnans(nans) = 0; + nonnans = sum(nonnans); + nononnans = find(nonnans==0); + nonnans(nononnans) = 1; + out = sum(in)./nonnans; + out(nononnans) = NaN; + + +function era_limits=get_era_limits(era) +%function era_limits=get_era_limits(era) +% +% Returns the minimum and maximum value of an event-related +% activation/potential waveform (after rounding according to the order of +% magnitude of the ERA/ERP) +% +% Inputs: +% era - [vector] Event related activation or potential +% +% Output: +% era_limits - [min max] minimum and maximum value of an event-related +% activation/potential waveform (after rounding according to the order of +% magnitude of the ERA/ERP) + +mn=min(era); +mx=max(era); +mn=orderofmag(mn)*round(mn/orderofmag(mn)); +mx=orderofmag(mx)*round(mx/orderofmag(mx)); +era_limits=[mn mx]; + + +function ord=orderofmag(val) +%function ord=orderofmag(val) +% +% Returns the order of magnitude of the value of 'val' in multiples of 10 +% (e.g., 10^-1, 10^0, 10^1, 10^2, etc ...) +% used for computing erpimage trial axis tick labels as an alternative for +% plotting sorting variable + +val=abs(val); +if val>=1 + ord=1; + val=floor(val/10); + while val>=1, + ord=ord*10; + val=floor(val/10); + end + return; +else + ord=1/10; + val=val*10; + while val<1, + ord=ord/10; + val=val*10; + end + return; +end + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_readegi.m b/code/eeglab13_4_4b/functions/popfunc/pop_readegi.m new file mode 100644 index 0000000..c02ebd0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_readegi.m @@ -0,0 +1,211 @@ +% pop_readegi() - load a EGI EEG file (pop out window if no arguments). +% +% Usage: +% >> EEG = pop_readegi; % a window pops up +% >> EEG = pop_readegi( filename ); +% >> EEG = pop_readegi( filename, datachunks, forceversion, fileloc); +% +% Inputs: +% filename - EGI file name +% datachunks - desired frame numbers (see readegi() help) +% option available from the command line only +% forceversion - [integer] force reading a specfic file version +% fileloc - [string] channel location file name. Default is +% 'auto' (autodetection) +% +% Outputs: +% EEG - EEGLAB data structure +% +% Author: Arnaud Delorme, CNL / Salk Institute, 12 Nov 2002 +% +% See also: eeglab(), readegi(), readegihdr() + +% Copyright (C) 12 Nov 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_readegi(filename, datachunks, forceversion, fileloc); + +EEG = []; +command = ''; +if nargin < 4, fileloc = 'auto'; end; +disp('Warning: This function can only import continuous files or'); +disp(' epoch files with only one length for data epochs'); + +if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.RAW;*.raw', ... + 'Choose an EGI RAW file -- pop_readegi()'); + drawnow; + if filename == 0 return; end; + filename = [filepath filename]; + + fid = fopen(filename, 'rb', 'b'); + if fid == -1, error('Cannot open file'); end + head = readegihdr(fid); % read EGI file header + fclose(fid); + if head.segments ~= 0 + fileloc = ''; + floc = { 'GSN-HydroCel-32.sfp' 'GSN65v2_0.sfp' 'GSN129.sfp' 'GSN-HydroCel-257.sfp'}; + switch head.nchan + case { 32 33 }, fileloc = floc; + case { 64 65 }, fileloc = {floc{2} floc{3:4} floc{1}}; + case { 128 129 }, fileloc = {floc{3} floc{4} floc{1:2}}; + case { 256 257 }, fileloc = {floc{4} floc{1:3}}; + end; + uilist = { { 'style' 'text' 'string' sprintf('Segment/frame number (default: 1:%d)', head.segments) } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Channel location file (in eeglab/sample_locs)' } ... + { 'style' 'popupmenu' 'string' fileloc } ... + { } ... + { 'style' 'text' 'string' ... + [ 'Note: Choosing the correct electrode location file for your data is critical.' 10 ... + 'Note that in some cases none of the channel location files listed will correspond' 10 ... + 'to your montage as EGI has different versions of caps and is creating new ones' 10 ... + 'constantly. Remember to check your montage in the channel editor and import. Channel' 10 ... + 'location files are stored in the sample_locs sub-folder of the EEGLAB distribution.' ] } }; + uigeometry = { [2 1] [2 1] [1] [1] }; + uigeomvert = [1 1 1.5 3]; + result = inputgui('uilist', uilist, 'geometry', uigeometry, 'geomvert', uigeomvert); + +% promptstr = { sprintf('Segment/frame number (default: 1:%d)', head.segments) 'Channel location file (in eeglab/sample_locs)' }; +% inistr = { '' fileloc(res{2})}; +% result = inputdlg2( promptstr, 'Import EGI file -- pop_readegi()', 1, inistr, 'pop_readegi'); + if length(result) == 0 return; end; + datachunks = eval( [ '[' result{1} ']' ] ); + fileloc = char(fileloc(result{2})); + else + datachunks = []; + disp('Only one segment, cannot read portion of the file'); + end; +end; + +% load data +% ---------- +EEG = eeg_emptyset; +if exist('datachunks') && exist('forceversion') && ~isempty(forceversion) + [Head EEG.data Eventdata SegCatIndex] = readegi( filename, datachunks,forceversion); +elseif exist('forceversion') && ~isempty(forceversion) + [Head EEG.data Eventdata SegCatIndex] = readegi( filename,[],forceversion); +elseif exist('datachunks') + [Head EEG.data Eventdata SegCatIndex] = readegi( filename, datachunks); + forceversion = []; +else + [Head EEG.data Eventdata SegCatIndex] = readegi( filename); + forceversion = []; +end +if ~isempty(Eventdata) & size(Eventdata,2) == size(EEG.data,2) + EEG.data(end+1:end+size(Eventdata,1),:) = Eventdata; +end; +EEG.comments = [ 'Original file: ' filename ]; +EEG.setname = 'EGI file'; +EEG.nbchan = size(EEG.data,1); +EEG.srate = Head.samp_rate; +EEG.trials = Head.segments; +EEG.pnts = Head.segsamps; +EEG.xmin = 0; + +% importing the events +% -------------------- +EEG = eeg_checkset(EEG); +if ~isempty(Eventdata) + orinbchans = EEG.nbchan; + for index = size(Eventdata,1):-1:1 + EEG = pop_chanevent( EEG, orinbchans-size(Eventdata,1)+index, 'edge', 'leading', ... + 'delevent', 'off', 'typename', Head.eventcode(index,:), ... + 'nbtype', 1, 'delchan', 'on'); + Head.eventcode(end,:) = []; + end; + + % renaming event codes + % -------------------- + try, + tmpevent = EEG.event; + alltypes = { tmpevent.type }; + if isstr(alltypes{1}) + indepoc = strmatch('epoc', lower(alltypes), 'exact'); + indtim = strmatch('tim0', lower(alltypes), 'exact'); + + % if epoc but no tim0 then epoc represent pauses in recording + if isempty(indtim) & ~isempty(indepoc) + for index = indepoc + EEG.event(index).type = 'boundary'; + end; + end; + % other wise if both non-empty data epochs + if ~isempty(indtim) & ~isempty(indepoc) + if rem(size(EEG.data,2) / (length(indepoc)+1),1) == 0 + EEG.event(index) = []; % remove epoch events + EEG.trials = length(indepoc)+1; + else + disp('Warning: data epochs detected but wrong data size'); + end; + end; + end; + catch, disp('Warning: event renaming failed'); end; +end; + +% adding segment category indices +% ------------------------------- +if ~isempty(SegCatIndex) && EEG.trials > 1 + try + if ~isempty(EEG.event) + for index = 1:length(EEG.event) + EEG.event(index).category = Head.catname{SegCatIndex(EEG.event(index).epoch)}; + end; + else % create time-locking events + for trial = 1:EEG.trials + EEG.event(trial).epoch = trial; + EEG.event(trial).type = 'TLE'; + EEG.event(trial).latency = -EEG.xmin*EEG.srate+1+(trial-1)*EEG.pnts; + EEG.event(trial).category = Head.catname{SegCatIndex(trial)}; + end; + end; + catch, + disp('Warning: error while importing trial categories'); + EEG.event = rmfield(EEG.event, 'category'); + end; +end; +EEG = eeg_checkset(EEG, 'makeur'); +EEG = eeg_checkset(EEG, 'eventconsistency'); + +% importing channel locations +% --------------------------- +if nargin < 1 + warndlg2( [ 'EEGLAB will now import a default electrode location file' 10 ... + 'for your data. Note that this might not correspond' 10 ... + 'to your montage as EGI has different versions of caps.' 10 ... + 'Check your montage in the channel editor and import' 10 ... + 'the correct location file if necessary.' ]); +end; +if all(EEG.data(end,1:10) == 0) + disp('Deleting empty data reference channel (reference channel location is retained)'); + EEG.data(end,:) = []; + EEG.nbchan = size(EEG.data,1); + EEG = eeg_checkset(EEG); +end; +if ~isempty(fileloc) + if strcmpi(fileloc, 'auto') + EEG = readegilocs(EEG); + else + EEG = readegilocs(EEG, fileloc); + end; +end; + +if nargin < 1 + command = sprintf('EEG = pop_readegi(''%s'', %s);', filename, vararg2str({datachunks forceversion fileloc }) ); +end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_readlocs.m b/code/eeglab13_4_4b/functions/popfunc/pop_readlocs.m new file mode 100644 index 0000000..b6b027d --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_readlocs.m @@ -0,0 +1,218 @@ +% pop_readlocs() - load a EGI-format EEG file (pop up an interactive window if no arguments). +% +% Usage: +% >> EEG = pop_readlocs; % a window pops up +% >> EEG = pop_readlocs( filename, 'key', val, ...); % no window +% +% Inputs: +% filename - Electrode location file name +% 'key',val - Same options as readlocs() (see >> help readlocs) +% +% Outputs: same as readlocs() +% +% Author: Arnaud Delorme, CNL / Salk Institute, 17 Dec 2002 +% +% See also: readlocs() + +% Copyright (C) 17 Dec 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [tmplocs, command] = pop_readlocs(filename, varargin); + +tmplocs = []; +command = ''; + +% get infos from readlocs +% ----------------------- +[chanformat listcolformat] = readlocs('getinfos'); +listtype = { chanformat.type }; + +if nargin < 1 + [filename, filepath] = uigetfile('*.*', 'Importing electrode location file -- pop_readlocs()'); + %filename = 'chan32.locs'; + %filepath = 'c:\eeglab\eeglab4.0\'; + drawnow; + if filename == 0 return; end; + filename = [filepath filename]; + tmpfile = loadtxt(filename); + nbcols = cellfun('isempty', tmpfile(end,:)); + nbcols = ones(1,length(find(~nbcols))); + + % decoding file type + % ------------------ + periods = find(filename == '.'); + fileextension = filename(periods(end)+1:end); + switch lower(fileextension), + case {'loc' 'locs' }, filetype = 'loc'; + case 'xyz', filetype = 'xyz'; + case 'sph', filetype = 'sph'; + case 'txt', filetype = 'chanedit'; + case 'elp', filetype = 'polhemus'; + case 'eps', filetype = 'besa'; + otherwise, filetype = ''; + end; + indexfiletype = strmatch(filetype, listtype, 'exact'); + + % convert format info + % ------------------- + formatinfo = { chanformat.importformat }; + formatskipcell = { chanformat.skipline }; + rmindex = []; + count = 1; + for index = 1:length(formatinfo) + if ~isstr(formatinfo{index}) + for index2 = 1:length(formatinfo{index}) + indexformat = strmatch(formatinfo{index}{index2}, listcolformat, 'exact'); + indexlist(count, index2) = indexformat; + end; + if isempty(formatskipcell{index}), formatskip(count) = 0; + else formatskip(count) = formatskipcell{index}; + end; + count = count+1; + else + rmindex = [ rmindex index ]; + end; + end; + listtype(rmindex) = []; + listtype (end+1) = { 'custom' }; + formatskip(end+1) = 0; + indexlist(end+1,:) = -1; + + % ask user + formatcom = [ ... + 'indexformat = get(findobj(gcf, ''tag'', ''format''), ''value'');' ... + 'tmpformat = get(findobj(gcf, ''tag'', ''format''), ''userdata'');' ... + 'for tmpindex=1:' int2str(length(nbcols)) ... + ' tmpobj = findobj(gcf, ''tag'', [ ''col'' int2str(tmpindex) ]);' ... + ' if tmpformat{1}(indexformat,tmpindex) == -1,' ... + ' set(tmpobj, ''enable'', ''on'');' ... + ' else ' ... + ' set(tmpobj, ''enable'', ''off'');' ... + ' set(tmpobj, ''value'', tmpformat{1}(indexformat,tmpindex));' ... + ' end;' ... + 'end;' ... + 'strheaderline = fastif(tmpformat{2}(indexformat)<0, ''auto'', int2str(tmpformat{2}(indexformat)));' ... + 'set(findobj(gcf, ''tag'', ''headlines''), ''string'', strheaderline);' ... + 'eval(get(findobj(gcf, ''tag'', ''headlines''), ''callback''));' ... + 'clear tmpindex indexformat tmpformat tmpobj strheaderline;' ]; + + headercom = [ ... + 'tmpheader = str2num(get(findobj(gcf, ''tag'', ''headlines''), ''string''));' ... + 'if ~isempty(tmpheader), ' ... + ' for tmpindex=1:' int2str(length(nbcols)) ... + ' tmpobj = findobj(gcf, ''tag'', [ ''text'' int2str(tmpindex) ]);' ... + ' tmpstr = get(tmpobj, ''userdata'');' ... + ' set(tmpobj, ''string'', tmpstr(tmpheader+1:min(tmpheader+10, size(tmpstr,1)),:));' ... + ' end;' ... + 'end;' ... + 'clear tmpobj tmpstr tmpheader tmpindex;' ]; + + geometry = { [1 1 1] [1 2] [nbcols] [nbcols] [nbcols] [1] [1 1 1]}; + listui = { ... + { 'style' 'text' 'string' 'Predefined format' } ... + { 'style' 'text' 'string' 'Header lines' } ... + { 'style' 'edit' 'tag' 'headlines' 'string' '0' 'callback' headercom } ... + { 'style' 'listbox' 'tag' 'format' 'string' strvcat(listtype{:}) ... + 'callback' formatcom 'userdata' { indexlist;formatskip } } ... + { 'style' 'pushbutton' 'string' 'preview' ... + 'callback' 'set(findobj(gcbf, ''tag'', ''Import''), ''userdata'', ''preview'')'} }; + + % custom columns + % -------------- + for index = 1:length(nbcols) + listui{end+1} = { 'style' 'text' 'string' [ 'column ' int2str(index) ] }; + end; + for index = 1:length(nbcols) + listui{end+1} = { 'style' 'listbox' 'tag' [ 'col' int2str(index) ] 'string' ... + strvcat(listcolformat{:}) }; + end; + for index = 1:length(nbcols) + listui{end+1} = { 'style' 'text' 'string' formatstr(tmpfile(1:min(10, size(tmpfile,1)),index)) ... + 'tag' ['text' int2str(index) ] 'userdata' formatstr(tmpfile(:,index)) }; + end; + listui = { listui{:} ... + {} ... + { 'style' 'pushbutton' 'string' 'Cancel', 'callback', 'close gcbf;' } ... + { 'style' 'pushbutton' 'string' 'Help', 'callback', 'pophelp(''pop_readlocs'');' } ... + { 'style' 'pushbutton' 'string' 'Import' 'tag' 'Import' ... + 'callback', 'set(findobj(gcbf, ''tag'', ''Import''), ''userdata'', ''import'')'} }; + + fig = figure('name', 'Importing electrode location file -- pop_readlocs()', 'visible', 'off'); + supergui( fig, geometry, [1 2 1 3 7 1 1], listui{:}); + + % update figure + set(findobj(gcf, 'tag', 'format'), 'value', indexfiletype); + eval(formatcom); + + % this loop is necessary for decoding Preview + cont = 1; + while cont + waitfor( findobj('parent', fig, 'tag', 'Import'), 'userdata'); + if isempty( findobj('parent', fig, 'tag', 'Import') ), return; end; + + % decode inputs + % ------------- + tmpheader = str2num(get(findobj(fig, 'tag', 'headlines'), 'string')); + tmpobj = findobj(fig, 'tag', 'format'); + tmpformatstr = get(tmpobj, 'string'); + tmpformatstr = tmpformatstr(get(tmpobj, 'value'),:); + for tmpindex=1:length(nbcols) + tmpobj = findobj(fig, 'tag', [ 'col' int2str(tmpindex) ]); + tmpcolstr{tmpindex} = get(tmpobj, 'string'); + tmpcolstr{tmpindex} = deblank(tmpcolstr{tmpindex}(get(tmpobj,'value'),:)); + end; + + % take appropriate measures + % ------------------------- + res = get(findobj('parent', fig, 'tag', 'Import'), 'userdata'); + set(findobj('parent', fig, 'tag', 'Import'), 'userdata', ''); + if strcmp(res, 'preview') + try, + tmplocs = readlocs( filename, 'filetype', tmpformatstr, ... + 'skiplines', tmpheader, 'format', tmpcolstr); + figure; topoplot([],tmplocs, 'style', 'blank', 'electrodes', 'labelpoint'); + catch, + errordlg2(strvcat('Error while importing locations:', lasterr), 'Error'); + end; + else + cont = 0; + end; + end; + close(fig); + + % importing files + % --------------- + tmplocs = readlocs( filename, 'filetype', tmpformatstr, ... + 'skiplines', tmpheader, 'format', tmpcolstr); + +else + tmplocs = readlocs( filename, varargin{:}); +end; + +command = sprintf('EEG.chanlocs = pop_readlocs(''%s'', %s);', filename, vararg2str(varargin)); +return; + +% format string for text file +% --------------------------- +function alltxt = formatstr( celltxt ) +for index1 = 1:size(celltxt,1) + alltxt{index1} = ''; + for index2 = 1:size(celltxt,2) + alltxt{index1} = sprintf('%s\t%s', alltxt{index1}, num2str(celltxt{index1,index2})); + end; + alltxt{index1} = sprintf(alltxt{index1}, '%s\n', alltxt{index1}); +end; +alltxt = strvcat( alltxt{:}); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_readsegegi.m b/code/eeglab13_4_4b/functions/popfunc/pop_readsegegi.m new file mode 100644 index 0000000..4db96f8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_readsegegi.m @@ -0,0 +1,114 @@ +% pop_readsegegi() - load a segmented EGI EEG file. Pop up query +% window if no arguments. +% Usage: +% >> EEG = pop_readsegegi; % a window pops up +% >> EEG = pop_readsegegi( filename ); % no pop-up window +% +% Inputs: +% filename - first EGI file name +% +% Outputs: +% EEG - EEGLAB data structure +% +% Author: Arnaud Delorme, CNL / Salk Institute, 10 April 2003 +% +% See also: eeglab(), readegi(), readegihdr() + +% Copyright (C) 12 Nov 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_readegi(filename); + +EEG = []; +command = ''; +if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.RAW;*.raw', 'Choose first EGI RAW file -- pop_readsegegi()'); + drawnow; + if filename == 0 return; end; + filename = fullfile(filepath, filename); +end; + +% load datas +% ---------- +EEG = eeg_emptyset; + +tailname = filename(end-3:end); +basename = filename(1:end-7); +index = 1; +cont = 1; +Eventdata = []; + +disp('Removing trailing character of selected file to find base file name'); +fprintf('Base file name is: %s\n', basename); +orifilename = [ basename sprintf('%3.3d', index) tailname ]; +if ~exist(orifilename) + disp ([ 'First file of series ''' orifilename ''' not found' ] ); + error([ 'First file of series ''' orifilename ''' not found' ] ); +end; + +while cont + tmpfilename = [ basename sprintf('%3.3d', index) tailname ]; + try, + disp(['Importing ' tmpfilename ]); + [Head tmpdata tmpevent] = readegi( tmpfilename ); + EEG.data = [ EEG.data tmpdata ]; + Eventdata = [ Eventdata tmpevent ]; + index = index + 1; + catch, + cont = 0; + end; +end; + +% add one channel with the event data +% ----------------------------------- +if ~isempty(Eventdata) & size(Eventdata,2) == size(EEG.data,2) + EEG.data(end+1:end+size(Eventdata,1),:) = Eventdata; +end; +EEG.comments = [ 'Original files: ' orifilename ' to ' tmpfilename ]; +EEG.filepath = ''; +EEG.setname = 'EGI file'; +EEG.nbchan = size(EEG.data,1); +EEG.srate = Head.samp_rate; +EEG.trials = Head.segments; +EEG.pnts = Head.segsamps; +EEG.xmin = 0; + +% importing the events +% -------------------- +if ~isempty(Eventdata) + orinbchans = EEG.nbchan; + for index = size(Eventdata,1):-1:1 + EEG = pop_chanevent( EEG, orinbchans-size(Eventdata,1)+index, 'edge', 'leading', ... + 'delevent', 'off', 'typename', Head.eventcode(index,:), ... + 'nbtype', 1, 'delchan', 'on'); + end; +end; + +% importing channel locations +% --------------------------- +if all(EEG.data(end,1:10) == 0) + disp('Deleting empty data reference channel (reference channel location is retained)'); + EEG.data(end,:) = []; + EEG.nbchan = size(EEG.data,1); + EEG = eeg_checkset(EEG); +end; +EEG = readegilocs(EEG); + +EEG = eeg_checkset(EEG); +command = sprintf('EEG = pop_readsegegi(''%s'');', filename); + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rejchan.m b/code/eeglab13_4_4b/functions/popfunc/pop_rejchan.m new file mode 100644 index 0000000..f8abff0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rejchan.m @@ -0,0 +1,227 @@ +% pop_rejchan() - reject artifacts channels in an EEG dataset using joint +% probability of the recorded electrode. +% +% Usage: +% >> pop_rejchan( INEEG ) % pop-up interative window mode +% >> [EEG, indelec, measure, com] = ... +% = pop_rejchan( INEEG, 'key', 'val'); +% +% Inputs: +% INEEG - input dataset +% +% Optional inputs: +% 'elec' - [n1 n2 ...] electrode number(s) to take into +% consideration for rejection +% 'threshold' - [max] absolute thresold or activity probability +% limit(s) (in std. dev.) if norm is 'on'. +% 'measure' - ['prob'|'kurt'|'spec'] compute probability 'prob', kurtosis 'kurt' +% or spectrum 'spec' for each channel. Default is 'kurt'. +% 'norm' - ['on'|'off'] normalize measure above (using trimmed +% normalization as described in the function jointprob() +% and rejkurt(). Default is 'off'. +% 'precomp' - [float array] use this array instead of computing the 'prob' +% or 'kurt' measures. +% 'freqrange' - [min max] frequency range for spectrum computation. +% Default is 1 to sampling rate divided by 2. The average +% of the log spectral power is computed over the frequency +% range of interest. +% +% Outputs: +% OUTEEG - output dataset with updated joint probability array +% indelec - indices of rejected electrodes +% measure - measure value for each electrode +% com - executed command +% +% Author: Arnaud Delorme, CERCO, UPS/CNRS, 2008- +% +% See also: jointprob(), rejkurt() + +% Copyright (C) 2008 Arnaud Delorme, CERCO, UPS/CNRS +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, indelec, measure, com] = pop_rejchan( EEG, varargin); + +com = ''; +indelec = []; +measure = []; +if nargin < 1 + help pop_rejchan; + return; +end; + +if nargin < 2 + + % which set to save + % ----------------- + cb_select = [ 'if get(gcbo, ''value'') == 3,' ... + ' set(findobj(gcbf, ''tag'', ''spec''), ''enable'', ''on'');' ... + 'else,' ... + ' set(findobj(gcbf, ''tag'', ''spec''), ''enable'', ''off'');' ... + 'end;' ]; + cb_norm = [ 'if get(gcbo, ''value''),' ... + ' set(findobj(gcbf, ''tag'', ''normlab''), ''string'', ''Z-score threshold [max] or [min max]'');' ... + 'else,' ... + ' set(findobj(gcbf, ''tag'', ''normlab''), ''string'', ''Absolute threshold [max] or [min max]'');' ... + 'end;' ]; + uilist = { { 'style' 'text' 'string' 'Electrode (number(s); Ex: 2 4 5)' } ... + { 'style' 'edit' 'string' ['1:' int2str(EEG.nbchan)] } ... + { 'style' 'text' 'string' 'Measure to use' } ... + { 'style' 'popupmenu' 'string' 'Probability|Kurtosis|Spectrum' 'value' 2 'callback' cb_select } ... + { 'style' 'text' 'string' 'Normalize measure (check=on)' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 'callback' cb_norm } { } ... + { 'style' 'text' 'string' 'Z-score threshold [max] or [min max]' 'tag' 'normlab' } ... + { 'style' 'edit' 'string' '5' } ... + { 'style' 'text' 'string' 'Spectrum freq. range' 'enable' 'off' 'tag' 'spec' } ... + { 'style' 'edit' 'string' num2str([1 EEG.srate/2]) 'enable' 'off' 'tag' 'spec' } }; % 7/16/2014 Ramon + geom = { [2 1.3] [2 1.3] [2 0.4 0.9] [2 1.3] [2 1.3] }; + result = inputgui( 'uilist', uilist, 'geometry', geom, 'title', 'Reject channel -- pop_rejchan()', ... + 'helpcom', 'pophelp(''pop_rejchan'')'); + if isempty(result), return; end; + + options = { 'elec' eval( [ '[' result{1} ']' ] ) 'threshold' str2num(result{4}) }; + if result{3}, + options = { options{:} 'norm', 'on' }; + else options = { options{:} 'norm', 'off' }; + end; + + if result{2} == 1 + options = { options{:} 'measure', 'prob' }; + elseif result{2} == 2 + options = { options{:} 'measure', 'kurt' }; + else + options = { options{:} 'measure', 'spec' }; + options = { options{:} 'freqrange', str2double(result{5})}; % 7/16/2014 Ramon + end; + +else + options = varargin; +end; + +opt = finputcheck( options, { 'norm' 'string' { 'on';'off' } 'off'; + 'measure' 'string' { 'prob';'kurt';'spec' } 'kurt'; + 'precomp' 'real' [] []; + 'freqrange' 'real' [] [1 EEG.srate/2]; + 'elec' 'integer' [] [1:EEG.nbchan]; + 'threshold' 'real' [] 400 }, 'pop_rejchan'); +if isstr(opt), error(opt); end; + +% compute the joint probability +% ----------------------------- +if strcmpi(opt.norm, 'on') + normval = 2; +else + normval = 0; +end; +if strcmpi(opt.measure, 'prob') + fprintf('Computing probability for channels...\n'); + [ measure indelec ] = jointprob( reshape(EEG.data(opt.elec,:,:), length(opt.elec), size(EEG.data,2)*size(EEG.data,3)), opt.threshold, opt.precomp, normval); +elseif strcmpi(opt.measure, 'kurt') + fprintf('Computing kurtosis for channels...\n'); + [ measure indelec ] = rejkurt( reshape(EEG.data(opt.elec,:,:), length(opt.elec), size(EEG.data,2)*size(EEG.data,3)), opt.threshold, opt.precomp, normval); +else + fprintf('Computing spectrum for channels...\n'); + [measure freq] = pop_spectopo(EEG, 1, [], 'EEG' , 'plot','off'); + + % select frequency range + if ~isempty(opt.freqrange) + [tmp fBeg] = min(abs(freq-opt.freqrange(1))); + [tmp fEnd] = min(abs(freq-opt.freqrange(2))); + measure = measure(:, fBeg:fEnd); + end; + + % consider that data below 20 db has been filtered and remove it + indFiltered = find(mean(measure) < -20); + if ~isempty(indFiltered) && indFiltered(1) > 11, measure = measure(:,1:indFiltered(1)-10); disp('Removing spectrum data below -20dB (most likelly filtered out)'); end; + meanSpec = mean(measure); + stdSpec = std( measure); + +% for indChan = 1:size(measure,1) +% if any(measure(indChan,:) > meanSpec+stdSpec*opt.threshold), indelec(indChan) = 1; end; +% end; + if strcmpi(opt.norm, 'on') + measure1 = max(bsxfun(@rdivide, bsxfun(@minus, measure, meanSpec), stdSpec),[],2); + if length(opt.threshold) > 1 + measure2 = min(bsxfun(@rdivide, bsxfun(@minus, measure, meanSpec), stdSpec),[],2); + indelec = measure2 < opt.threshold(1) | measure1 > opt.threshold(end); + disp('Selecting minimum and maximum normalized power over the frequency range'); + else + indelec = measure1 > opt.threshold(1); + disp('Selecting maximum normalized power over the frequency range'); + end; + else + measure1 = max(measure,[],2); + if length(opt.threshold) > 1 + measure2 = min(measure,[],2); + indelec = measure2 < opt.threshold(1) | measure1 > opt.threshold(end); + disp('Selecting minimum and maximum power over the frequency range'); + else + indelec = measure > opt.threshold(1); + disp('Selecting maximum power over the frequency range'); + end; + end; + measure = measure1; +end; +colors = cell(1,length(opt.elec)); colors(:) = { 'k' }; +colors(find(indelec)) = { 'r' }; colors = colors(end:-1:1); +fprintf('%d electrodes labeled for rejection\n', length(find(indelec))); + +% output variables +indelec = find(indelec)'; +tmpchanlocs = EEG.chanlocs; +if ~isempty(EEG.chanlocs), tmplocs = EEG.chanlocs(opt.elec); tmpelec = { tmpchanlocs(opt.elec).labels }'; +else tmplocs = []; tmpelec = mattocell([opt.elec]'); % tmpelec = mattocell([1:EEG.nbchan]');%Ramon on 8/7/2014 +end; +if exist('measure2', 'var') + fprintf('#\tElec.\t[min]\t[max]\n'); + tmpelec(:,3) = mattocell(measure2); + tmpelec(:,4) = mattocell(measure); +else fprintf('#\tElec.\tMeasure\n'); + tmpelec(:,3) = mattocell(measure); +end; +tmpelec(:,2) = tmpelec(:,1); +tmpelec(:,1) = mattocell([1:length(measure)]'); +for index = 1:size(tmpelec,1) + if exist('measure2', 'var') + fprintf('%d\t%s\t%3.2f\t%3.2f', tmpelec{index,1}, tmpelec{index,2}, tmpelec{index,3}, tmpelec{index,4}); + elseif ~isempty(EEG.chanlocs) + fprintf('%d\t%s\t%3.2f' , tmpelec{index,1}, tmpelec{index,2}, tmpelec{index,3}); + else % Ramon on 8/7/2014 + fprintf('%d\t%d\t%3.2f' , tmpelec{index,1}, tmpelec{index,2}, tmpelec{index,3}); + end; + if any(indelec == index), fprintf('\t*Bad*\n'); + else fprintf('\n'); + end; +end; +if isempty(indelec), return; end; + +com = sprintf('EEG = pop_rejchan(EEG, %s);', vararg2str(options)); +if nargin < 2 + tmpcom = [ 'EEGTMP = pop_select(EEG, ''nochannel'', [' num2str(opt.elec(indelec)) ']);' ]; + tmpcom = [ tmpcom ... + 'LASTCOM = ' vararg2str(com) ';' ... + '[ALLEEG EEG CURRENTSET tmpcom] = pop_newset(ALLEEG, EEGTMP, CURRENTSET);' ... + ' if ~isempty(tmpcom),' ... + ' EEG = eegh(LASTCOM, EEG);' ... + ' eegh(tmpcom);' ... + ' eeglab(''redraw'');' ... + ' end; clear EEGTMP tmpcom;' ]; + eegplot(EEG.data(opt.elec,:,:), 'srate', EEG.srate, 'title', 'Scroll component activities -- eegplot()', ... + 'limits', [EEG.xmin EEG.xmax]*1000, 'color', colors(end:-1:1), 'eloc_file', tmplocs, 'command', tmpcom); +else + EEG = pop_select(EEG, 'nochannel', opt.elec(indelec)); +end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rejchanspec.m b/code/eeglab13_4_4b/functions/popfunc/pop_rejchanspec.m new file mode 100644 index 0000000..b22716b --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rejchanspec.m @@ -0,0 +1,242 @@ +% pop_rejchanspec() - reject artifacts channels in an EEG dataset using +% channel spectrum. The average spectrum for all selected +% is computed and a threshold is applied. +% +% Usage: +% >> pop_rejchanspec( INEEG ) % pop-up interative window mode +% >> [OUTEEG, indelec] = pop_rejchanspec( INEEG, 'key', 'val'); +% +% Inputs: +% INEEG - input EEGLAB dataset +% +% Optional inputs: +% 'freqlims' - [min max] frequency limits. May also be an array where +% each row defines a different set of limits. Default is +% 35 to the Niquist frequency of the data. +% 'stdthresh' - [max] positive threshold in terms of standard deviation. +% Default is 5. +% 'absthresh' - [max] positive threshold in terms of spectrum units +% (overides the option above). +% 'averef' - ['on'|'off'] 'on' computes average reference before +% applying threshold. Default is 'off'. +% 'plothist' - ['on'|'off'] 'on' plot the histogram of values along +% with the threshold. +% 'plotchans' - ['on'|'off'] 'on' plot the channels scrollplot with +% selected channels for rejection in red. Allow selected +% channels rejection with the 'REJECT' button. +% 'elec' - [integer array] only include specific channels. Default +% is to use all channels. +% 'specdata' - [fload array] use this array containing the precomputed +% spectrum instead of computing the spectrum. Default is +% empty. +% 'specfreqs' - [fload array] frequency array for precomputed spectrum +% above. +% 'verbose' - ['on'|'off'] display information. Default is 'off'. +% +% Outputs: +% OUTEEG - output dataset with updated joint probability array +% indelec - indices of rejected electrodes +% specdata - data spectrum for the selected channels +% specfreqs - frequency array for spectrum above +% +% Author: Arnaud Delorme, CERCO, UPS/CNRS, 2008- + +% Copyright (C) 2008 Arnaud Delorme, CERCO, UPS/CNRS +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG allrmchan specdata specfreqs com] = pop_rejchanspec(EEG, varargin) + +if nargin < 1 + help pop_rejchanspec; + return; +end; +allrmchan = []; +specdata = []; +specfreqs = []; +com = ''; +if nargin < 2 + uilist = { { 'style' 'text' 'string' 'Electrode (number(s); Ex: 2 4 5)' } ... + { 'style' 'edit' 'string' ['1:' int2str(EEG.nbchan)] } ... + { 'style' 'text' 'string' 'Frequency limits [min max]' } ... + { 'style' 'edit' 'string' [ '35 ' int2str(floor(EEG.srate/2)) ] } ... + { 'style' 'text' 'string' 'Standard dev. threshold limits [max]' } ... + { 'style' 'edit' 'string' '5' } ... + { 'style' 'text' 'string' 'OR absolute threshold limit [min max]' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Compute average reference first (check=on)' } ... + { 'style' 'checkbox' 'string' '' 'value' 0 } { } ... + { 'style' 'text' 'string' 'Plot histogram of power values (check=on)' } ... + { 'style' 'checkbox' 'string' '' 'value' 0 } { } ... + { 'style' 'text' 'string' 'Plot channels scrollplot (check=on)' } ... + { 'style' 'checkbox' 'string' '' 'value' 0 } { } ... + }; + + + geom = { [2 1] [2 1] [2 1] [2 1] [2 0.3 0.7] [2 0.3 0.7] [2 0.3 0.7] }; + result = inputgui( 'uilist', uilist, 'geometry', geom, 'title', 'Reject channel using spectrum -- pop_rejchanspec()', ... + 'helpcom', 'pophelp(''pop_rejchan'')'); + if isempty(result), return; end; + + options = { 'elec' eval( [ '[' result{1} ']' ] ) 'stdthresh' str2num(result{3}) 'freqlims' str2num(result{2}) }; + if ~isempty(result{4}) + options = { options{:} 'absthresh' str2num(result{4}) }; + end; + if result{5}, + options = { options{:} 'averef', 'on' }; + end; + if result{6}, + options = { options{:} 'plothist', 'on' }; + end; + % Begin: Added by Romain on 22 July 2010 + if result{7}, + options = { options{:} 'plotchans', 'on' }; + end; + % End: Added by Romain on 22 July 2010 + +else + options = varargin; +end; + +% decode options +% -------------- +opt = finputcheck( options, { 'averef' 'string' { 'on';'off' } 'off'; + 'plothist' 'string' { 'on';'off' } 'off'; + 'plotchans' 'string' { 'on';'off' } 'off'; + 'verbose' 'string' { 'on';'off' } 'off'; + 'elec' 'integer' [] [1:EEG.nbchan]; + 'freqlims' 'real' [] [35 EEG.srate/2]; + 'specdata' 'real' [] []; + 'specfreqs' 'real' [] []; + 'absthresh' 'real' [] []; + 'stdthresh' 'real' [] 5 }, 'pop_rejchanspec'); +if isstr(opt), error(opt); end; + +% compute average referecne if necessary +if strcmpi(opt.averef, 'on') + NEWEEG = pop_reref(EEG, [], 'exclude', setdiff([1:EEG.nbchan], opt.elec)); +else NEWEEG = EEG; +end; +if isempty(opt.specdata) + [tmpspecdata specfreqs] = pop_spectopo(NEWEEG, 1, [], 'EEG' , 'percent', 100, 'freqrange',[0 EEG.srate/2], 'plot', 'off'); + % add back 0 channels + devStd = std(EEG.data(:,:), [], 2); + if any(devStd == 0) + goodchan = find(devStd ~= 0); + specdata = zeros(length(opt.elec), size(tmpspecdata,2)); + specdata(goodchan,:) = tmpspecdata; + else + specdata = tmpspecdata; + end; +else + specdata = opt.specdata; + specfreqs = opt.specfreqs; +end; + +if size(opt.stdthresh,1) == 1 && size(opt.freqlims,1) > 1 + opt.stdthresh = ones(length(opt.stdthresh), size(opt.freqlims,1))*opt.stdthresh; +end; + +allrmchan = []; +for index = 1:size(opt.freqlims,1) + % select frequencies, compute median and std then reject channels + % --------------------------------------------------------------- + [tmp fbeg] = min(abs(specfreqs - opt.freqlims(index,1))); + [tmp fend] = min(abs(specfreqs - opt.freqlims(index,2))); + selectedspec = mean(specdata(opt.elec, fbeg:fend), 2); + if ~isempty(opt.absthresh) + rmchan = find(selectedspec <= opt.absthresh(1) | selectedspec >= opt.absthresh(2)); + else + m = median(selectedspec); + s = std( selectedspec); + nbTresh = size(opt.stdthresh); + if length(opt.stdthresh) > 1 + rmchan = find(selectedspec <= m+s*opt.stdthresh(index,1) | selectedspec >= m+s*opt.stdthresh(index,2)); + else + rmchan = find(selectedspec > m+s*opt.stdthresh(index)); + end + end; + + % print out results + % ----------------- + if isempty(rmchan) + textout = sprintf('Range %2.1f-%2.1f Hz: no channel removed\n', opt.freqlims(index,1), opt.freqlims(index,2)); + else textout = sprintf('Range %2.1f-%2.1f Hz: channels %s removed\n', opt.freqlims(index,1), opt.freqlims(index,2), int2str(opt.elec(rmchan'))); + end; + fprintf(textout); + if strcmpi(opt.verbose, 'on') + for inde = 1:length(opt.elec) + if ismember(inde, rmchan) + fprintf('Elec %s power: %1.2f *\n', EEG.chanlocs(opt.elec(inde)).labels, selectedspec(inde)); + else fprintf('Elec %s power: %1.2f\n', EEG.chanlocs(opt.elec(inde)).labels , selectedspec(inde)); + end; + end; + end; + allrmchan = [ allrmchan rmchan' ]; + + % plot histogram + % -------------- + if strcmpi(opt.plothist, 'on') + figure; hist(selectedspec); + hold on; yl = ylim; + if ~isempty(opt.absthresh) + plot([opt.absthresh(1) opt.absthresh(1)], yl, 'r'); + plot([opt.absthresh(2) opt.absthresh(2)], yl, 'r'); + else + if length(opt.stdthresh) > 1 + threshold1 = m+s*opt.stdthresh(index,1); + threshold2 = m+s*opt.stdthresh(index,2); + plot([m m], yl, 'g'); + plot([threshold1 threshold1], yl, 'r'); + plot([threshold2 threshold2], yl, 'r'); + else + threshold = m+s*opt.stdthresh(index,1); + plot([threshold threshold], yl, 'r'); + end + end; + title(textout); + end; + +end; +allrmchan = unique_bc(allrmchan); + +com = sprintf('EEG = pop_rejchan(EEG, %s);', vararg2str(options)); +if strcmpi(opt.plotchans, 'on') + tmpcom = [ 'EEGTMP = pop_select(EEG, ''nochannel'', [' num2str(opt.elec(allrmchan)) ']);' ]; + tmpcom = [ tmpcom ... + 'LASTCOM = ' vararg2str(com) ';' ... + '[ALLEEG EEG CURRENTSET tmpcom] = pop_newset(ALLEEG, EEGTMP, CURRENTSET);' ... + ' if ~isempty(tmpcom),' ... + ' EEG = eegh(LASTCOM, EEG);' ... + ' eegh(tmpcom);' ... + ' eeglab(''redraw'');' ... + ' end; clear EEGTMP tmpcom;' ]; + + colors = cell(1,length(opt.elec)); colors(:) = { 'k' }; + colors(allrmchan) = { 'r' }; colors = colors(end:-1:1); + fprintf('%d electrodes labeled for rejection\n', length(find(allrmchan))); + tmpchanlocs = EEG.chanlocs; + if ~isempty(EEG.chanlocs), tmplocs = EEG.chanlocs(opt.elec); tmpelec = { tmpchanlocs(opt.elec).labels }'; + else tmplocs = []; tmpelec = mattocell([1:EEG.nbchan]'); + end; + eegplot(EEG.data(opt.elec,:,:), 'srate', EEG.srate, 'title', 'Scroll component activities -- eegplot()', ... + 'limits', [EEG.xmin EEG.xmax]*1000, 'color', colors, 'eloc_file', tmplocs, 'command', tmpcom); +else + EEG = pop_select(EEG, 'nochannel', opt.elec(allrmchan)); +end; + +if nargin < 2 + allrmchan = sprintf('EEG = pop_rejchanspec(EEG, %s);', vararg2str(options)); +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rejcont.m b/code/eeglab13_4_4b/functions/popfunc/pop_rejcont.m new file mode 100644 index 0000000..e3372e3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rejcont.m @@ -0,0 +1,313 @@ +% pop_rejcont() - reject continuous portions of data based on spectrum +% thresholding. First, contiguous data epochs are extracted +% and a standard spectrum thresholding algorithm is +% applied. Regions of contiguous epochs larger than a +% specified size are then labeled as artifactual. +% +% Usage: +% >> pop_rejcont( INEEG ) % pop-up interative window mode +% >> [OUTEEG, selectedregions] = pop_rejcont( INEEG, 'key', 'val'); +% +% Inputs: +% INEEG - input dataset +% +% Optional inputs: +% 'elecrange' - [integer array] electrode indices {Default: all electrodes} +% 'epochlength' - [float] epoch length in seconds {Default: 0.5 s} +% 'overlap' - [float] epoch overlap in seconds {Default: 0.25 s} +% 'freqlimit' - [min max] frequency range too consider for thresholding +% Default is [35 128] Hz. +% 'threshold' - [float] frequency upper threshold in dB {Default: 10} +% 'contiguous' - [integer] number of contiguous epochs necessary to +% label a region as artifactual {Default: 4 } +% 'addlength' - [float] once a region of contiguous epochs has been labeled +% as artifact, additional trailing neighboring regions on +% each side may also be added {Default: 0.25 s} +% 'eegplot' - ['on'|'off'] plot rejected portions of data in a eegplot +% window. Default is 'off'. +% 'onlyreturnselection' - ['on'|'off'] this option when set to 'on' only +% return the selected regions and does not remove them +% from the datasets. This allow to perform quick +% optimization of the rejected portions of data. +% 'precompstruct' - [struct] structure containing precomputed spectrum (see +% Outputs) to be used instead of computing the spectrum. +% 'verbose' - ['on'|'off'] display information. Default is 'off'. +% 'taper' - ['none'|'hamming'] taper to use before FFT. Default is +% 'none' for backward compatibility but 'hamming' is +% recommended. +% +% Outputs: +% OUTEEG - output dataset with updated joint probability array +% selectedregions - frames indices of rejected electrodes. Array of n x 2 +% n being the number of regions and 2 for the beginning +% and end of each region. +% precompstruct - structure containing precomputed data. This structure +% contains the spectrum, the frequencies and the EEGLAB +% dataset used as input with epochs extracted. +% +% Author: Arnaud Delorme, CERCO, UPS/CNRS, 2009- +% +% Example: +% EEG = pop_rejcont(EEG, 'elecrange',[1:32] ,'freqlimit',[20 40] ,'threshold',... +% 10,'epochlength',0.5,'contiguous',4,'addlength',0.25, 'taper', 'hamming'); +% +% See also: eegthresh() + +% Copyright (C) 2009 Arnaud Delorme, CERCO, UPS/CNRS +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG selectedregions precompstruct com ] = pop_rejcont(EEG, varargin); + +com = ''; +if nargin < 1 + help pop_rejcont; + return; +end; + +if nargin < 2 + firstelec = 'EXG1'; % first non EEG channel + % take all scalp electrodes + % ------------------------- + if ~isempty(EEG.chanlocs) + tmpchanlocs = EEG.chanlocs; + indelec = strmatch( firstelec, { tmpchanlocs.labels }); + + if isempty(indelec), elecrange = 1:EEG.nbchan; + else elecrange = 1:(indelec-1); + end; + else + elecrange = 1:EEG.nbchan; + end; + elecrange = deblank(vararg2str(elecrange)); + %elecrange = elecrange(2:end-1); + +% promptstr = { 'Channel range' ... +% 'Frequency range (Hz)' ... +% 'Frequency threshold in dB' ... +% 'Epoch segment length (s)' ... +% 'Minimum number of contiguous epochs' ... +% 'Add trails before and after regions (s)' ... +% }; +% initstr = { elecrange '20 40' '10' '0.5' '4' '0.25' }; +% result = inputdlg2(promptstr, 'Reject portions of continuous data - pop_rejcont', 1, initstr); + uilist = { { 'style' 'text' 'string' 'Channel range' } ... + { 'style' 'edit' 'string' elecrange } ... + { 'style' 'text' 'string' 'Frequency range (Hz)' } ... + { 'style' 'edit' 'string' '20 40' } ... + { 'style' 'text' 'string' 'Frequency threshold in dB' } ... + { 'style' 'edit' 'string' '10' } ... + { 'style' 'text' 'string' 'Epoch segment length (s)' } ... + { 'style' 'edit' 'string' '0.5' } ... + { 'style' 'text' 'string' 'Minimum number of contiguous epochs' } ... + { 'style' 'edit' 'string' '4' } ... + { 'style' 'text' 'string' 'Add trails before and after regions (s)' } ... + { 'style' 'edit' 'string' '0.25' } ... + { 'style' 'text' 'string' 'Use hanning window before computing FFT' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 } ... + }; + geom = { [2 1] [2 1] [2 1] [2 1] [2 1] [2 1] [2 1] }; + result = inputgui('uilist', uilist, 'geometry', geom); + if length( result ) == 0 return; end; + + options = { 'elecrange' str2num(result{1}) ... + 'freqlimit' str2num(result{2}) ... + 'threshold' str2double(result{3}) ... + 'epochlength' str2double(result{4}) ... + 'contiguous' str2double(result{5}) ... + 'addlength' str2double(result{6}) ... + 'taper' fastif(result{7}, 'hamming', 'none') }; +else + options = varargin; +end; + +opt = finputcheck(options, { 'threshold' { 'real';'cell' } [] 10; + 'freqlimit' { 'real';'cell' } [] [35 128]; + 'elecrange' 'real' [] [1:EEG.nbchan]; + 'rejectori' 'real' [] []; + 'contiguous' 'real' [] 4; + 'addlength' 'real' [] 0.25; + 'precompstruct' 'struct' [] struct([]); + 'eegplot' 'string' { 'on';'off' } 'off'; + 'onlyreturnselection' 'string' { 'on';'off' } 'off'; + 'verbose' 'string' { 'on';'off' } 'on'; + 'taper' 'string' { 'none' 'hamming' } 'none'; + 'overlap' 'real' [] 0.25; + 'epochlength' 'real' [] 0.5 }, 'pop_rejcont'); +if isstr(opt), error(opt); end; +if ~iscell(opt.threshold) && length(opt.threshold) == 2 && ... + iscell(opt.freqlimit) && length(opt.freqlimit) == 2 + opt.threshold = { opt.threshold(1) opt.threshold(2) }; +end; +if ~iscell(opt.threshold), opt.threshold = { opt.threshold }; end; +if ~iscell(opt.freqlimit), opt.freqlimit = { opt.freqlimit }; end; + +%EEG.event = []; +grouplen = opt.contiguous/2*opt.epochlength*EEG.srate+1; % maximum number of points for grouping regions +color = [ 0 0.9 0]; % color of rejection window + +NEWEEG = EEG; +if isempty(opt.precompstruct) + % compute power spectrum + % ---------------------- + % average reference + % NEWEEG.data(opt.elecrange,:) = NEWEEG.data(opt.elecrange,:)-repmat(mean(NEWEEG.data(opt.elecrange,:),1), [length(opt.elecrange) 1]); + + % only keep boundary events + % ------------------------- + tmpevent = NEWEEG.event; + if ~isempty(tmpevent) + if isnumeric( tmpevent(1).type ) + NEWEEG.event = []; + else + boundEvent = strmatch('boundary', { tmpevent.type }, 'exact'); + NEWEEG.event = NEWEEG.event(boundEvent); + end; + end; + + [TMPNEWEEG] = eeg_regepochs(NEWEEG, opt.overlap, [0 opt.epochlength], NaN); + %[TMPNEWEEG indices] = pop_rejspec(TMPNEWEEG, 1, [1:64], -100, 15, 30, 45, 0, 0); + %rejepoch = find(indices); + + tmpdata = TMPNEWEEG.data; + if strcmpi(opt.taper, 'hamming'), + tmpdata = bsxfun(@times, tmpdata, hamming(size(TMPNEWEEG.data,2))'); + end; + tmp = fft(tmpdata, [], 2); + freqs = linspace(0, TMPNEWEEG.srate/2, size(tmp,2)/2); + freqspectrum = freqs(2:end); % remove DC (match the output of PSD) + tmp = tmp(:,2:size(tmp,2)/2,:); + warning('off', 'MATLAB:log:logOfZero'); + tmpspec = 10*log10(abs(tmp).^2); + warning('on', 'MATLAB:log:logOfZero'); + tmpspec = tmpspec - repmat( mean(tmpspec,3), [1 1 TMPNEWEEG.trials]); + specdata = tmpspec; + + % compute mean spectrum + % --------------------- + meanspectrum = nan_mean(specdata(opt.elecrange, :, :), 1); + precompstruct.spec = meanspectrum; + precompstruct.freqs = freqspectrum; + precompstruct.EEG = TMPNEWEEG; +else + meanspectrum = opt.precompstruct.spec; + freqspectrum = opt.precompstruct.freqs; + TMPNEWEEG = opt.precompstruct.EEG; + precompstruct = opt.precompstruct; +end; + +% apply threshold to average of all electrodes +% -------------------------------------------- +rejepoch = []; +for iReject = 1:length(opt.threshold) + threshold = opt.threshold{iReject}; + freqLim = opt.freqlimit{iReject}; + if length(threshold) == 1, threshold = [ -100 threshold ]; end; + [I1 tmpRejEpoch NS Erej] = eegthresh( meanspectrum, size(meanspectrum,2), 1, threshold(1), threshold(2), [freqspectrum(1) freqspectrum(end)], freqLim(1), freqLim(2)); + rejepoch = union_bc(rejepoch, tmpRejEpoch); + if strcmpi(opt.verbose, 'on') + fprintf('%d regions selected for rejection, threshold %3.2f-%3.2f dB, frequency limits %3.1f-%3.1f\n', length(tmpRejEpoch), threshold(1), threshold(2), freqLim(1), freqLim(2)); + end; +end; + +% build the winrej array for eegplot +% ---------------------------------- +winrej = []; +if ~isempty(find(cellfun(@isempty, { TMPNEWEEG.event.epoch }) == 1)) + error('Some events are not associated with any epoch'); +end; +tmpevent = TMPNEWEEG.event; +allepoch = [ tmpevent.epoch ]; +if ~isempty(rejepoch) + for index = 1:length(rejepoch) + eventepoch = find( rejepoch(index) == allepoch ); + if strcmpi(TMPNEWEEG.event(eventepoch(1)).type, 'X') + urevent = TMPNEWEEG.event(eventepoch(1)).urevent; + lat = TMPNEWEEG.urevent(urevent).latency; + winrej = [ winrej; lat lat+opt.epochlength*TMPNEWEEG.srate-1 color ]; %Erej(:,index)']; + else + error('Wrong type for epoch'); + end; + end; + winrej(:,6:6+length(opt.elecrange)-1) = 0; +end; + +% remove isolated regions and merge others +% ---------------------------------------- +merged = 0; +isolated = 0; +for index = size(winrej,1):-1:1 + if size(winrej,1) >= index && winrej(index,2) - winrej(index,1) > grouplen, winrej(index,:) = []; isolated = isolated + 1; + elseif index == 1 && size(winrej,1) > 1 && winrej(index+1,1) - winrej(index,2) > grouplen, winrej(index,:) = []; isolated = isolated + 1; + elseif index == size(winrej,1) && size(winrej,1) > 1 && winrej(index,1) - winrej(index-1,2) > grouplen, winrej(index,:) = []; isolated = isolated + 1; + elseif index > 1 && size(winrej,1) > 1 && index < size(winrej,1) && winrej(index+1,1) - winrej(index,2) > grouplen && ... + winrej(index,1) - winrej(index-1,2) > grouplen + winrej(index,:) = []; + isolated = isolated + 1; + elseif index < size(winrej,1) && size(winrej,1) > 1 && winrej(index+1,1) - winrej(index,2) <= grouplen + winrej(index,2) = winrej(index+1,2); + winrej(index+1,:) = []; + merged = merged + 1; + end; +end; +if strcmpi(opt.verbose, 'on') + fprintf('%d regions merged\n', merged); + fprintf('%d regions removed\n', isolated); +end; + +% add time before and after each region +% ------------------------------------- +for index = 1:size(winrej,1) + winrej(index,1) = max(1, winrej(index,1)-opt.addlength*EEG.srate); + winrej(index,2) = min(EEG.pnts, winrej(index,2)+opt.addlength*EEG.srate); +end; + +% plot result +% ----------- +if ~isempty(winrej) + selectedregions = winrej(:,1:2); + if strcmpi(opt.onlyreturnselection, 'off') + % merge with initial regions + if ~isempty(opt.rejectori) + winrej(:,3) = 1; % color + for iRow = 1:size(opt.rejectori,1) + winrej(end+1,1:2) = opt.rejectori(iRow,:); + winrej(end ,4) = 1; % color + winrej(end ,5) = 1; % color + end; + end; + + command = '[EEG LASTCOM] = pop_select(EEG, ''nopoint'', TMPREJ(:,1:2)); eegh(LASTCOM); [ALLEEG EEG CURRENTSET LASTCOM] = pop_newset(ALLEEG, EEG, CURRENTSET, ''study'', ~isempty(STUDY)+0); eegh(LASTCOM); eeglab redraw'; + if nargin < 2 || strcmpi(opt.eegplot, 'on') + eegplot(NEWEEG.data(opt.elecrange,:), 'srate', NEWEEG.srate, 'winrej', winrej, 'command', command, 'events', EEG.event, 'winlength', 50); + disp('Green is overlap'); + disp('Light blue is ORIGINAL rejection'); + disp('Yellow is AUTOMATIC rejection'); + else + NEWEEG = pop_select(EEG, 'nopoint', round(selectedregions)); + end; + EEG = NEWEEG; + else + EEG = []; + end; +else + selectedregions = []; + if strcmpi(opt.verbose, 'on') + disp('No region removed'); + end; +end; +if nargout > 3 + com = sprintf('EEG = pop_rejcont(EEG, %s);', vararg2str(options)); +end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rejepoch.m b/code/eeglab13_4_4b/functions/popfunc/pop_rejepoch.m new file mode 100644 index 0000000..cd4a679 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rejepoch.m @@ -0,0 +1,90 @@ +% pop_rejepoch() - Reject pre-labeled trials in a EEG dataset. +% Ask for confirmation and accept the rejection +% +% Usage: +% >> OUTEEG = pop_rejepoch( INEEG, trialrej, confirm) +% +% Inputs: +% INEEG - Input dataset +% trialrej - Array of 0s and 1s (depicting rejected trials) (size is +% number of trials) +% confirm - Display rejections and ask for confirmation. (0=no. 1=yes; +% default is 1). +% Outputs: +% OUTEEG - output dataset +% +% Example: +% >> data2 = pop_rejepoch( EEG, [1 1 1 0 0 0] ); +% % reject the 3 first trials of a six-trial dataset +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab(), eegplot() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [EEG, com] = pop_rejepoch( EEG, tmprej, confirm); + +com = ''; +if nargin < 1 + help pop_rejepoch; + return; +end; +if nargin < 2 + tmprej = find(EEG.reject.rejglobal); +end; +if nargin < 3 + confirm = 1; +end; +if islogical(tmprej), tmprej = tmprej+0; end; + +uniquerej = double(sort(unique(tmprej))); +if length(tmprej) > 0 && length(uniquerej) <= 2 && ... + ismember(uniquerej(1), [0 1]) && ismember(uniquerej(end), [0 1]) && any(~tmprej) + format0_1 = 1; + fprintf('%d/%d trials rejected\n', sum(tmprej), EEG.trials); +else + format0_1 = 0; + fprintf('%d/%d trials rejected\n', length(tmprej), EEG.trials); +end; + +if confirm ~= 0 + ButtonName=questdlg2('Are you sure, you want to reject the labeled trials ?', ... + 'Reject pre-labelled epochs -- pop_rejepoch()', 'NO', 'YES', 'YES'); + switch ButtonName, + case 'NO', + disp('Operation cancelled'); + return; + case 'YES', + disp('Compute new dataset'); + end % switch + +end; + +% create a new set if set_out is non nul +% -------------------------------------- +if format0_1 + tmprej = find(tmprej > 0); +end; +EEG = pop_select( EEG, 'notrial', tmprej); + +%com = sprintf( '%s = pop_rejepoch( %s, find(%s.reject.rejglobal), 0);', inputname(1), ... +% inputname(1), inputname(1)); +com = sprintf( '%s = pop_rejepoch( %s, %s);', inputname(1), inputname(1), vararg2str({ tmprej 0 })); +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rejkurt.m b/code/eeglab13_4_4b/functions/popfunc/pop_rejkurt.m new file mode 100644 index 0000000..0f15fdc --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rejkurt.m @@ -0,0 +1,242 @@ +% pop_rejkurt() - rejection of artifact in a dataset using kurtosis +% of activity (i.e. to detect peaky distribution of +% activity). +% +% Usage: +% >> pop_rejkurt( INEEG, typerej) % pop-up interative window mode +% >> [OUTEEG, locthresh, globthresh, nrej] = ... +% = pop_rejkurt( INEEG, typerej, elec_comp, ... +% locthresh, globthresh, superpose, reject, vistype); +% +% Graphical interface: +% "Electrode" - [edit box] electrodes or components (number) to take into +% consideration for rejection. Same as the 'elec_comp' +% parameter from the command line. +% "Single-channel limit" - [edit box] pkurtosis limit in terms of +% standard-dev. Same as 'locthresh' command line +% parameter. +% "All-channel limit" - [edit box] kurtosis limit in terms of +% standard-dev (all channel regrouped). Same as +% 'globthresh' command line parameter. +% "Display with previous rejection" - [edit box] can be either YES or +% NO. This edit box corresponds to the command line input +% option 'superpose'. +% "Reject marked trials" - [edit box] can be either YES or NO. This edit +% box corresponds to the command line input option 'reject'. +% "visualization type" - [edit box] can be either REJECTRIALS or EEGPLOT. +% This edit box corresponds to the command line input +% option 'vistype'. +% +% Inputs: +% INEEG - input dataset +% typerej - type of rejection (0 = independent components; 1 = eeg +% data). Default is 1. For independent components, before +% thresholding, the activity is normalized for each +% component. +% elec_comp - [e1 e2 ...] electrodes (number) to take into +% consideration for rejection +% locthresh - activity kurtosis limit in terms of standard-dev. +% globthresh - global limit (for all channel). Same unit as above. +% superpose - 0=do not superpose pre-labelling with previous +% pre-labelling (stored in the dataset). 1=consider both +% pre-labelling (using different colors). Default is 0. +% reject - 0=do not reject labelled trials (but still store the +% labels. 1=reject labelled trials. Default is 1. +% vistype - visualization type. 0 calls rejstatepoch() and 1 calls eegplot() +% default is 0. +% +% Outputs: +% OUTEEG - output dataset with updated kurtosis array +% locthresh - electrodes probability of activity thresholds in terms +% of standard-dev. +% globthresh - global threshold (where all electrode activity are +% regrouped). +% nrej - number of rejected sweeps +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: rejkurt(), rejstatepoch(), pop_rejepoch(), eegplot(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 added srate argument to eegplot call -ad +% 03-08-02 add eeglab options -ad + +function [EEG, locthresh, globthresh, nrej, com] = pop_rejkurt( EEG, icacomp, elecrange, ... + locthresh, globthresh, superpose, reject, vistype, topcommand); +com = ''; +if nargin < 1 + help pop_rejkurt; + return; +end; +if nargin < 2 + icacomp = 1; +end; +if exist('reject') ~= 1 + reject = 1; +end; +if icacomp == 0 + if isempty( EEG.icasphere ) + ButtonName=questdlg( 'Do you want to run ICA now ?', ... + 'Confirmation', 'NO', 'YES', 'YES'); + switch ButtonName, + case 'NO', disp('Operation cancelled'); return; + case 'YES', [ EEG com ] = pop_runica(EEG); + end % switch + end; +end; + +if nargin < 3 + + % which set to save + % ----------------- + promptstr = { [ fastif(icacomp, 'Electrode', 'Component') ' (number(s); Ex: 2 4 5):' ], ... + [ fastif(icacomp, 'Single-channel', 'Single-component') ' limit(s) (std. dev(s).: Ex: 2 2 2.5):'], ... + [ fastif(icacomp, 'All-channel', 'All-component') ' limit (std. dev(s).: Ex: 2.1 2 2):'], ... + 'Display with previously marked rejections? (YES or NO)', ... + 'Reject marked trial(s)? (YES or NO)', ... + 'Visualization mode (REJECTTRIALS or EEGPLOT)' }; + inistr = { fastif(icacomp, ['1:' int2str(EEG.nbchan)], ['1:' int2str(size(EEG.icaweights,1))])... + fastif(icacomp, '3', '5'), ... + fastif(icacomp, '3', '5'), ... + 'YES', ... + 'NO', ... + 'REJECTTRIALS' }; + + result = inputdlg2( promptstr, fastif(~icacomp, 'Trial rejection using comp. kurtosis -- pop_rejkurt()', 'Trial rejection using data kurtosis -- pop_rejkurt()'), 1, inistr, 'pop_rejkurt'); + size_result = size( result ); + if size_result(1) == 0 return; end; + elecrange = result{1}; + locthresh = result{2}; + globthresh = result{3}; + switch lower(result{4}), case 'yes', superpose=1; otherwise, superpose=0; end; + switch lower(result{5}), case 'yes', reject=1; otherwise, reject=0; end; + switch lower(result{6}), case 'rejecttrials', vistype=0; otherwise, vistype=1; end; +end; + +if ~exist('vistype') vistype = 0; end; +if ~exist('reject') reject = 0; end; +if ~exist('superpose') superpose = 1; end; + +if isstr(elecrange) % convert arguments if they are in text format + calldisp = 1; + elecrange = eval( [ '[' elecrange ']' ] ); + locthresh = eval( [ '[' locthresh ']' ] ); + globthresh = eval( [ '[' globthresh ']' ] ); +else + calldisp = 0; +end; + +if isempty(elecrange) + error('No electrode selectionned'); +end; + +% compute the joint probability +% ----------------------------- +if icacomp == 1 + fprintf('Computing kurtosis for channels...\n'); + tmpdata = eeg_getdatact(EEG); + if isempty(EEG.stats.kurtE ) + [ EEG.stats.kurtE rejE ] = rejkurt( tmpdata, locthresh, EEG.stats.kurtE, 1); + end; + [ tmp rejEtmp ] = rejkurt( tmpdata(elecrange, :,:), locthresh, EEG.stats.kurtE(elecrange, :), 1); + rejE = zeros(EEG.nbchan, size(rejEtmp,2)); + rejE(elecrange,:) = rejEtmp; + + fprintf('Computing all-channel kurtosis...\n'); + tmpdata2 = permute(tmpdata, [3 1 2]); + tmpdata2 = reshape(tmpdata2, size(tmpdata2,1), size(tmpdata2,2)*size(tmpdata2,3)); + [ EEG.stats.kurt rej ] = rejkurt( tmpdata2, globthresh, EEG.stats.kurt, 1); +else + fprintf('Computing joint probability for components...\n'); + % test if ICA was computed + % ------------------------ + icaacttmp = eeg_getica(EEG); + if isempty(EEG.stats.icakurtE ) + [ EEG.stats.icakurtE rejE ] = rejkurt( icaacttmp, locthresh, EEG.stats.icakurtE, 1); + end; + [ tmp rejEtmp ] = rejkurt( icaacttmp(elecrange, :,:), locthresh, EEG.stats.icakurtE(elecrange, :), 1); + rejE = zeros(size(icaacttmp,1), size(rejEtmp,2)); + rejE(elecrange,:) = rejEtmp; + + fprintf('Computing global joint probability...\n'); + tmpdata = permute(icaacttmp, [3 1 2]); + tmpdata = reshape(tmpdata, size(tmpdata,1), size(tmpdata,2)*size(tmpdata,3)); + [ EEG.stats.icakurt rej] = rejkurt( tmpdata, globthresh, EEG.stats.icakurt, 1); +end; +rej = rej' | max(rejE, [], 1); +fprintf('%d/%d trials marked for rejection\n', sum(rej), EEG.trials); + +if calldisp + if vistype == 1 % EEGPLOT ------------------------- + if icacomp == 1 macrorej = 'EEG.reject.rejkurt'; + macrorejE = 'EEG.reject.rejkurtE'; + else macrorej = 'EEG.reject.icarejkurt'; + macrorejE = 'EEG.reject.icarejkurtE'; + end; + + colrej = EEG.reject.rejkurtcol; + eeg_rejmacro; % script macro for generating command and old rejection arrays + + if icacomp == 1 + eegplot( tmpdata(elecrange,:,:), 'srate', ... + EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + else + eegplot( icaacttmp(elecrange,:,:), 'srate', ... + EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + end; + else % REJECTRIALS ------------------------- + if icacomp == 1 + [ rej, rejE, n, locthresh, globthresh] = ... + rejstatepoch( tmpdata, EEG.stats.kurtE(elecrange,:), 'global', 'on', 'rejglob', EEG.stats.kurt, ... + 'threshold', locthresh, 'thresholdg', globthresh, 'normalize', 'off' ); + else + [ rej, rejE, n, locthresh, globthresh] = ... + rejstatepoch( icaacttmp, EEG.stats.icakurtE(elecrange,:), 'global', 'on', 'rejglob', EEG.stats.icakurt, ... + 'threshold', locthresh, 'thresholdg', globthresh, 'normalize', 'off' ); + end; + nrej = n; + end; +else + % compute rejection locally + rejtmp = max(rejE(elecrange,:),[],1); + rej = rejtmp | rej; + nrej = sum(rej); + fprintf('%d trials marked for rejection\n', nrej); +end; +if ~isempty(rej) + if icacomp == 1 + EEG.reject.rejkurt = rej; + EEG.reject.rejkurtE = rejE; + else + EEG.reject.icarejkurt = rej; + EEG.reject.icarejkurtE = rejE; + end; + if reject + EEG = pop_rejepoch(EEG, rej, 0); + end; +end; +nrej = sum(rej); + +com = [ com sprintf('%s = pop_rejkurt(%s,%s);', inputname(1), ... + inputname(1), vararg2str({icacomp,elecrange,locthresh,globthresh,superpose,reject})) ]; +if nargin < 3 & nargout == 2 + locthresh = com; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rejspec.m b/code/eeglab13_4_4b/functions/popfunc/pop_rejspec.m new file mode 100644 index 0000000..9bd4ad9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rejspec.m @@ -0,0 +1,286 @@ +% pop_rejspec() - rejection of artifact in a dataset using +% thresholding of frequencies in the data. +% Usage: +% >> pop_rejspec(INEEG, typerej); % pop-up interactive window mode +% >> [OUTEEG, Indices] = pop_rejspec( INEEG, typerej, 'key', val, ...); +% +% Pop-up window options: +% "Electrode|Component" - [edit box] electrode or component number(s) to +% take into consideration for rejection. Sets the 'elecrange' +% parameter in the command line call (see below). +% "Lower limits(s)" - [edit box] lower threshold limits(s) (in dB). +% Sets the command line parameter 'threshold'. If more than +% one, apply to each electrode|component individually. If +% fewer than number of electrodes|components, apply the +% last values to all remaining electrodes|components. +% "Upper limits(s)" - [edit box] upper threshold limit(s) in dB. +% Sets the command line parameter 'threshold'. +% "Low frequency(s)" - [edit box] low-frequency limit(s) in Hz. +% Sets the command line parameter 'freqlimits'. +% "High frequency(s)" - [edit box] high-frequency limit(s) in Hz. +% Sets the command line parameter 'freqlimits'. +% "Display previous rejection marks?" - [edit box] either YES or NO. +% Sets the command line input option 'eegplotplotallrej'. +% "Reject marked trials?" - [edit box] either YES or NO. Sets the +% command line input option 'eegplotreject'. +% +% Command line inputs: +% INEEG - input dataset +% typerej - [1|0] data to reject on (0 = component activations; 1 = +% electrode data). {Default is 1}. +% +% Optional arguments. +% 'elecrange' - [e1 e2 ...] array of indices of electrode|component +% number(s) to take into consideration during rejection. +% 'threshold' - [lower upper] threshold limit(s) in dB. +% 'freqlimits' - [lower upper] frequency limit(s) in Hz. +% 'method' - ['fft'|'multitaper'] method to compute spectrum. +% 'specdata' - [array] precomputed spectral data. +% 'eegplotcom' - [string] EEGPLOT command to execute when pressing the +% reject button (see 'command' input of EEGPLOT). +% 'eegplotreject' - [0|1] 0 = Do not reject marked trials (but store the +% marks. 1 = Reject marked trials. {Default: 1}. +% 'eegplotplotallrej' - [0|1] 0 = Do not superpose rejection marks on previous +% marks stored in the dataset. 1 = Show both previous and +% current marks using different colors. {Default: 0}. +% +% Outputs: +% OUTEEG - output dataset with updated spectrograms +% Indices - index of rejected trials +% Note: When eegplot() is called, modifications are applied to the current +% dataset at the end of the call to eegplot() (e.g., when the user presses +% the 'Reject' button). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001- +% +% See also: eegthresh(), eeglab(), eegplot(), pop_rejepoch() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 added srate argument to eegplot call -ad +% 03-08-02 reworked spectrum to save space & add eeglab options -ad + +function [EEG, Irej, com] = pop_rejspec( EEG, icacomp, varargin); + %elecrange, negthresh, posthresh, ... + %startfreq, endfreq, superpose, reject); + +Irej = []; +com = ''; +if nargin < 1 + help pop_rejspec; + return; +end; +if nargin < 2 + icacomp = 1; +end; + +if icacomp == 0 + if isempty( EEG.icasphere ) + ButtonName=questdlg( 'Do you want to run ICA now ?', ... + 'Confirmation', 'NO', 'YES', 'YES'); + switch ButtonName, + case 'NO', disp('Operation cancelled'); return; + case 'YES', [ EEG com ] = pop_runica(EEG); + end % switch + end; +end; + +if nargin < 3 + + % which set to save + % ----------------- + promptstr = { fastif(icacomp==0, 'Component number(s) (Ex: 2 4 5):', ... + 'Electrode number(s) (Ex: 2 4 5):'), ... + 'Lower limit(s) (dB):', ... + 'Upper limit(s) (dB):', ... + 'Low frequency(s) (Hz):', ... + 'High frequency(s) (Hz):', ... + 'Display previous rejection marks? (YES or NO)', ... + 'Reject marked trial(s)? (YES or NO)' }; + inistr = { ['1:' int2str(EEG.nbchan)], ... + '-30', ... + '30', ... + '15', ... + '30', ... + 'NO', ... + 'NO' }; + + result = inputdlg2( promptstr, fastif(~icacomp, 'Reject by component spectra -- pop_rejspec()', ... + 'Reject by data spectra -- pop_rejspec()'), 1, inistr, 'pop_rejspec'); + size_result = size( result ); + if size_result(1) == 0 return; end; + options = {}; + options = { options{:} 'elecrange' eval( [ '[' result{1} ']' ] ) }; + thresholdsLow = eval( [ '[' result{2} ']' ] ); + thresholdsHigh = eval( [ '[' result{3} ']' ] ); + options = { options{:} 'threshold' [thresholdsLow(:) thresholdsHigh(:) ] }; + freqLimitsLow = eval( [ '[' result{4} ']' ] ); + freqLimitsHigh = eval( [ '[' result{5} ']' ] ); + options = { options{:} 'freqlimits' [freqLimitsLow(:) freqLimitsHigh(:) ] }; + + switch lower(result{6}), case 'yes', superpose=1; otherwise, superpose=0; end; + switch lower(result{7}), case 'yes', reject=1; otherwise, reject=0; end; + options = { options{:} 'eegplotplotallrej' superpose }; + options = { options{:} 'eegplotreject' reject }; +else + if isnumeric(varargin{3}) || ~isempty(str2num(varargin{3})) + options = {}; + if isstr(varargin{1}), varargin{1} = str2num(varargin{1}); end; + if isstr(varargin{2}), varargin{2} = str2num(varargin{2}); end; + if isstr(varargin{3}), varargin{3} = str2num(varargin{3}); end; + if isstr(varargin{4}), varargin{4} = str2num(varargin{4}); end; + if isstr(varargin{5}), varargin{5} = str2num(varargin{5}); end; + if nargin > 2, options = { options{:} 'elecrange' varargin{1} }; end; + if nargin > 3, options = { options{:} 'threshold' [ varargin{2}; varargin{3}]' }; end; + if nargin > 5, options = { options{:} 'freqlimits' [ varargin{4}; varargin{5}]' }; end; + if nargin > 7, options = { options{:} 'eegplotplotallrej' varargin{6} }; end; + if nargin > 8, options = { options{:} 'eegplotreject' varargin{7} }; end; + if nargin > 9, options = { options{:} 'eegplotcom' varargin{8} }; end; + else + options = varargin; + end; +end; + +opt = finputcheck( options, { 'elecrange' 'integer' [] [1:EEG.nbchan]; + 'threshold' 'real' [] [-30 30]; + 'freqlimits' 'real' [] [15 30]; + 'specdata' 'real' [] EEG.specdata; + 'eegplotcom' 'string' [] ''; + 'method' 'string' { 'fft';'multitaper' } 'multitaper'; + 'eegplotreject' 'integer' [] 0; + 'eegplotplotallrej' 'integer' [] 0 }, 'pop_rejspec'); +if isstr(opt), error(opt); end; + +sizewin = 2^nextpow2(EEG.pnts); +if icacomp == 1 + [allspec, Irej, tmprejE, freqs ] = spectrumthresh( EEG.data, opt.specdata, ... + opt.elecrange, EEG.srate, opt.threshold(:,1)', opt.threshold(:,2)', opt.freqlimits(:,1)', opt.freqlimits(:,2)', opt.method); + rejE = zeros(EEG.nbchan, EEG.trials); + rejE(opt.elecrange,Irej) = tmprejE; +else + % test if ICA was computed + % ------------------------ + icaacttmp = eeg_getdatact(EEG, 'component', [1:size(EEG.icaweights,1)]); + [allspec, Irej, tmprejE, freqs ] = spectrumthresh( icaacttmp, EEG.specicaact, ... + opt.elecrange, EEG.srate, opt.threshold(:,1)', opt.threshold(:,2)', opt.freqlimits(:,1)', opt.freqlimits(:,2)', opt.method); + rejE = zeros(size(EEG.icaweights,1), size(icaacttmp,1)); + rejE(opt.elecrange,Irej) = tmprejE; +end; + +fprintf('%d channel selected\n', size(opt.elecrange(:), 1)); +fprintf('%d/%d trials marked for rejection\n', length(Irej), EEG.trials); +rej = zeros( 1, EEG.trials); +rej(Irej) = 1; + +if nargin < 3 || opt.eegplotplotallrej == 2 + nbpnts = size(allspec,2); + if icacomp == 1 macrorej = 'EEG.reject.rejfreq'; + macrorejE = 'EEG.reject.rejfreqE'; + else macrorej = 'EEG.reject.icarejfreq'; + macrorejE = 'EEG.reject.icarejfreqE'; + end; + colrej = EEG.reject.rejfreqcol; + + elecrange = opt.elecrange; + superpose = opt.eegplotplotallrej; + reject = opt.eegplotreject; + topcommand = opt.eegplotcom; + eeg_rejmacro; % script macro for generating command and old rejection arrays + + if icacomp == 1 + eegplot(EEG.data(opt.elecrange,:,:), 'winlength', 5, 'position', [100 550 800 500], ... + 'limits', [EEG.xmin EEG.xmax]*1000, 'xgrid', 'off', 'tag', 'childEEG' ); + else + eegplot(icaacttmp(opt.elecrange,:,:), 'winlength', 5, 'position', [100 550 800 500], 'limits', ... + [EEG.xmin EEG.xmax]*1000 , 'xgrid', 'off', 'tag', 'childEEG' ); + end; + eegplot( allspec(elecrange,:,:), 'srate', EEG.srate, 'freqlimits', [1 EEG.srate/2], 'command', ... + command, 'children', findobj('tag', 'childEEG'), 'position', [100 50 800 500], eegplotoptions{:}); +end; +if ~isempty(rej) + if icacomp == 1 + EEG.reject.rejfreq = rej; + EEG.reject.rejfreqE = rejE; + else + EEG.reject.icarejfreq = rej; + EEG.reject.icarejfreqE = rejE; + end; + if opt.eegplotreject + EEG = pop_rejepoch(EEG, rej, 0); + end; + Irej = find(rej); +end; + +% store variables +% --------------- +if icacomp == 1, EEG.specdata = allspec; +else, EEG.specicaact = allspec; +end; + +com = [com sprintf('%s = pop_rejspec( %s, %s);', inputname(1), ... + inputname(1), vararg2str({icacomp, 'elecrange', opt.elecrange, 'threshold', opt.threshold, 'freqlimits', opt.freqlimits, ... + 'eegplotcom', opt.eegplotcom, 'eegplotplotallrej' opt.eegplotplotallrej 'eegplotreject' opt.eegplotreject })) ]; + +return; + +% compute spectrum and reject artifacts +% ------------------------------------- +function [specdata, Irej, Erej, freqs ] = spectrumthresh( data, specdata, elecrange, srate, negthresh, posthresh, startfreq, endfreq, method); + + % compute the fft if necessary - old version + if isempty(specdata) + if strcmpi(method, 'fft') + sizewin = size(data,2); + freqs = srate*[1, sizewin]/sizewin/2; + specdata = fft( data-repmat(mean(data,2), [1 size(data,2) 1]), sizewin, 2); + specdata = specdata( :, 2:sizewin/2+1, :); + specdata = 10*log10(abs( specdata ).^2); + specdata = specdata - repmat( mean(specdata,3), [1 1 size(data,3)]); + else + if ~exist('pmtm') + error('The signal processing toolbox needs to be installed'); + end; + [tmp freqs] = pmtm( data(1,:,1), [],[],srate); % just to get the frequencies + + fprintf('Computing spectrum (using slepian tapers; done only once):\n'); + + for index = 1:size(data,1) + fprintf('%d ', index); + for indextrials = 1:size(data,3) + [ tmpspec(index,:,indextrials) freqs] = pmtm( data(index,:,indextrials) , [],[],srate); + end; + end; + tmpspec = 10*log(tmpspec); + tmpspec = tmpspec - repmat( mean(tmpspec,3), [1 1 size(data,3)]); + specdata = tmpspec; + end; + else + if strcmpi(method, 'fft') + sizewin = size(data,2); + freqs = srate*[1, sizewin]/sizewin/2; + else + [tmp freqs] = pmtm( data(1,:,1), [],[],srate); % just to get the frequencies + end; + end; + + % perform the rejection + % --------------------- + [I1 Irej NS Erej] = eegthresh( specdata(elecrange, :, :), size(specdata,2), 1:length(elecrange), negthresh, posthresh, ... + [freqs(1) freqs(end)], startfreq, min(freqs(end), endfreq)); + fprintf('\n'); + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rejtrend.m b/code/eeglab13_4_4b/functions/popfunc/pop_rejtrend.m new file mode 100644 index 0000000..50f6d24 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rejtrend.m @@ -0,0 +1,204 @@ +% pop_rejtrend() - Measure linear trends in EEG data; reject data epochs +% containing strong trends. +% Usage: +% >> pop_rejtrend( INEEG, typerej); % pop up an interactive window +% >> OUTEEG = pop_rejtrend( INEEG, typerej, elec_comp, ... +% winsize, maxslope, minR, superpose, reject,calldisp); +% +% Pop-up window interface: +% "Electrode|Component number(s)" - [edit box] electrode or component number(s) +% to take into consideration during rejection. Sets the 'elec_comp' +% parameter in the command line call (see below). +% "Slope window width" - [edit box] integer number of consecutive data +% points to use in detecting linear trends. Sets the 'winsize' +% parameter in the command line call. +% "Maximum slope to allow" - [edit box] maximal absolute slope of the +% linear trend to allow in the data. If electrode data, uV/epoch; +% if component data, std. dev./epoch. Sets the 'maxslope' +% parameter in the command line call. +% "R-square limit" -[edit box] maximal regression R-square (0 to 1) value +% to allow. Sets the 'minR' parameter in the command line call. +% This represents how "line-like" the rejected data should be; 0 +% accepts everything that meets the slope requirement, 0.9 is visibly +% flat. +% "Display previous rejection marks?" - [edit box] either YES or NO. +% Sets the command line input option 'superpose'. +% "Reject marked trials?" - [edit box] either YES or NO. +% Sets the command line input option 'reject'. +% Command line inputs: +% INEEG - input EEG dataset +% typerej - [1|0] data to reject on: 0 = component activations; +% 1 = electrode data. {Default: 1}. +% elec_comp - [e1 e2 ...] electrode|component number(s) to take into +% consideration during rejection +% winsize - (integer) number of consecutive points +% to use in detecing linear trends +% maxslope - maximal absolute slope of the linear trend to allow in the data +% minR - minimal linear regression R-square value to allow in the data +% (= coefficient of determination, between 0 and 1) +% superpose - [0|1] 0 = Do not superpose marks on previous marks +% stored in the dataset; 1 = Show both types of marks using +% different colors. {Default: 0} +% reject - [1|0] 0 = Do not reject marked trials but store the +% labels; 1 = Reject marked trials. {Default: 1} +% calldisp - [0|1] 1 = Open scroll window indicating rejected trials +% 0 = Do not open scroll window. {Default: 1} +% +% Outputs: +% OUTEEG - output dataset with rejected trials marked for rejection +% Note: When eegplot() is called, modifications are applied to the current +% dataset at the end of the call to eegplot() (e.g., when the user presses +% the 'Reject' button). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: rejtrend(), eeglab(), eegplot(), pop_rejepoch() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 added srate argument to eegplot call -ad +% 03-07-02 add the eeglab options -ad + +function [EEG, com] = pop_rejtrend( EEG, icacomp, elecrange, winsize, ... + minslope, minstd, superpose, reject, calldisp); + +com = ''; +if nargin < 1 + help pop_rejtrend; + return; +end; +if nargin < 2 + icacomp = 1; +end; +if icacomp == 0 + if isempty( EEG.icasphere ) + ButtonName=questdlg( 'Do you want to run ICA now ?', ... + 'Confirmation', 'NO', 'YES', 'YES'); + switch ButtonName, + case 'NO', disp('Operation cancelled'); return; + case 'YES', [ EEG com ] = pop_runica(EEG); + end % switch + end; +end; +if exist('reject') ~= 1 + reject = 1; +end; +if nargin < 3 + + % which set to save + % ----------------- + promptstr = { fastif(icacomp==0, 'Component number(s), Ex: 2 4 5):', ... + 'Electrode number(s), Ex: 2 4 5):'), ... + 'Slope window width (in points)', ... + fastif(icacomp==0, ... + 'Maximum slope to allow (uV/epoch)', ... + 'Maximum slope to allow (std. dev./epoch)'), ... + 'R-square limit to allow (0 to 1, Ex: 0.8):', ... + 'Display previous rejection marks? (YES or NO)', ... + 'Reject marked trial(s)? (YES or NO)' }; + inistr = { ['1:' int2str(EEG.nbchan)], ... + int2str(EEG.pnts), ... + '0.5', ... + '0.3', ... + 'NO', ... + 'NO' }; + + result = inputdlg2( promptstr, fastif(~icacomp, 'Trend rejection in component(s) -- pop_rejtrend()', ... + 'Data trend rejection -- pop_rejtrend()'), 1, inistr, 'pop_rejtrend'); + size_result = size( result ); + if size_result(1) == 0 return; end; + elecrange = result{1}; + winsize = result{2}; + minslope = result{3}; + minstd = result{4}; + calldisp = 1; + switch lower(result{5}), case 'yes', superpose=1; otherwise, superpose=0; end; + switch lower(result{6}), case 'yes', reject=1; otherwise, reject=0; end; +end; +if nargin < 7 + superpose = 0; + reject = 0; + calldisp = 1; +end; +if nargin < 9 + calldisp = 1; +end + +if isstr(elecrange) % convert arguments if they are in text format + calldisp = 1; + elecrange = eval( [ '[' elecrange ']' ] ); + winsize = eval( [ '[' winsize ']' ] ); + minslope = eval( [ '[' minslope ']' ] ); + minstd = eval( [ '[' minstd ']' ] ); +end; + +fprintf('Selecting trials...\n'); +if icacomp == 1 + [rej tmprejE] = rejtrend( EEG.data(elecrange, :, :), winsize, minslope, minstd); + rejE = zeros(EEG.nbchan, length(rej)); + rejE(elecrange,:) = tmprejE; +else + % test if ICA was computed or if one has to compute on line + % --------------------------------------------------------- + icaacttmp = eeg_getdatact(EEG, 'component', elecrange); + [rej tmprejE] = rejtrend( icaacttmp, winsize, minslope, minstd); + rejE = zeros(size(icaacttmp,1), length(rej)); + rejE(elecrange,:) = tmprejE; +end +rejtrials = find(rej > 0); +fprintf('%d channel(s) selected\n', size(elecrange(:), 1)); +fprintf('%d/%d trial(s) marked for rejection\n', length(rejtrials), EEG.trials); +fprintf('The following trials have been marked for rejection\n'); +fprintf([num2str(rejtrials) '\n']); + +if calldisp + if icacomp == 1 macrorej = 'EEG.reject.rejconst'; + macrorejE = 'EEG.reject.rejconstE'; + else macrorej = 'EEG.reject.icarejconst'; + macrorejE = 'EEG.reject.icarejconstE'; + end; + colrej = EEG.reject.rejconstcol; + eeg_rejmacro; % script macro for generating command and old rejection arrays + + if icacomp == 1 + eegplot( EEG.data(elecrange,:,:), 'srate', ... + EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + else + eegplot( icaacttmp, 'srate', ... + EEG.srate, 'limits', [EEG.xmin EEG.xmax]*1000 , 'command', command, eegplotoptions{:}); + end; +end; +if ~isempty(rej) + if icacomp == 1 + EEG.reject.rejconst = rej; + EEG.reject.rejconstE = rejE; + else + EEG.reject.icarejconst = rej; + EEG.reject.icarejconstE = rejE; + end; + if reject + EEG = pop_rejepoch(EEG, rej, 0); + end; +end; + +%com = sprintf('Indexes = pop_rejtrend( %s, %d, [%s], %s, %s, %s, %d, %d);', ... +% inputname(1), icacomp, num2str(elecrange), num2str(winsize), num2str(minslope), num2str(minstd), superpose, reject ); +com = [ com sprintf('%s = pop_rejtrend(%s,%s);', inputname(1), ... + inputname(1), vararg2str({icacomp,elecrange,winsize,minslope,minstd,superpose,reject})) ]; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_reref.m b/code/eeglab13_4_4b/functions/popfunc/pop_reref.m new file mode 100644 index 0000000..bfe2f2b --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_reref.m @@ -0,0 +1,291 @@ +% pop_reref() - Convert an EEG dataset to average reference or to a +% new common reference channel (or channels). Calls reref(). +% Usage: +% >> EEGOUT = pop_reref( EEG ); % pop up interactive window +% >> EEGOUT = pop_reref( EEG, ref, 'key', 'val' ...); +% +% Graphic interface: +% "Compute average reference" - [edit box] Checking this box (for 'yes') is +% the same as giving an empty value for the commandline 'ref' +% argument. Unchecked, the data are transformed to common reference. +% "Re-reference data to channel(s)" - [checkbox] Checking this option +% automatically unchecks the checkbox above, allowing reference +% channel indices to be entered in the text edit box to its right +% (No commandline equivalent). +% "Retain old reference channels in data" - [checkbox] When re-referencing the +% data, checking this checkbox includes the data for the +% previous reference channel. +% "Exclude channel indices (EMG, EOG)" - [edit box] exclude the given +% channel indices from rereferencing. +% "Add current reference channel back to the data" - [edit box] When +% re-referencing the data, checking this checkbox +% reconstitutes the data for the previous reference +% channel. If the location for this channel was not +% defined, it can be specified using the text box below. +% Inputs: +% EEG - input dataset +% ref - reference: [] = convert to average reference +% [int vector] = new reference electrode number(s) +% Optional inputs: +% 'exclude' - [integer array] List of channels to exclude. Default: none. +% 'keepref' - ['on'|'off'] keep the reference channel. Default: 'off'. +% 'refloc' - [structure] Previous reference channel structure. Default: none. +% +% Outputs: +% EEGOUT - re-referenced output dataset +% +% Notes: +% For other options, call reref() directly. See >> help reref +% +% Author: Arnaud Delorme, CNL / Salk Institute, 12 Nov 2002 +% +% See also: reref(), eeglab() + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_reref( EEG, ref, varargin); + +com = ''; +if nargin < 1 + help pop_reref; + return; +end; +if isempty(EEG.data) + error('Pop_reref: cannot process empty data'); +end; + +% gui inputs +% ---------- +orichanlocs = EEG.chanlocs; +orinbchan = EEG.nbchan; +if nargin < 2 + + % find initial reference + % ---------------------- + if length(EEG.chanlocs) == EEG.nbchan+1 + includeref = 1; + end; + + geometry = { [1] [1] [1.8 1 0.3] [1] [1] [1.8 1 0.3] [1.8 1 0.3] }; + cb_setref = [ 'set(findobj(''parent'', gcbf, ''tag'', ''refbr'') , ''enable'', ''on'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''reref'') , ''enable'', ''on'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''keepref'') , ''enable'', ''on'');' ]; + cb_setave = [ 'set(findobj(''parent'', gcbf, ''tag'', ''refbr'') , ''enable'', ''off'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''reref'') , ''enable'', ''off'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''keepref'') , ''enable'', ''off'', ''value'', 0);' ]; + cb_averef = [ 'set(findobj(''parent'', gcbf, ''tag'', ''rerefstr'') , ''value'', ~get(gcbo, ''value''));' ... + 'if get(gcbo, ''value''),' cb_setave ... + 'else,' cb_setref ... + 'end;' ]; + cb_ref = [ 'set(findobj(''parent'', gcbf, ''tag'', ''ave'') , ''value'', ~get(gcbo, ''value''));' ... + 'if get(gcbo, ''value''),' cb_setref ... + 'else,' cb_setave ... + 'end;' ]; + cb_chansel1 = 'tmpchanlocs = EEG(1).chanlocs; [tmp tmpval] = pop_chansel({tmpchanlocs.labels}, ''withindex'', ''on''); set(findobj(gcbf, ''tag'', ''reref'' ), ''string'',tmpval); clear tmpchanlocs tmp tmpval'; + cb_chansel2 = 'tmpchanlocs = EEG(1).chanlocs; [tmp tmpval] = pop_chansel({tmpchanlocs.labels}, ''withindex'', ''on''); set(findobj(gcbf, ''tag'', ''exclude'' ), ''string'',tmpval); clear tmpchanlocs tmp tmpval'; + cb_chansel3 = [ 'if ~isfield(EEG(1).chaninfo, ''nodatchans''), ' ... + ' warndlg2(''There are no Reference channel defined, add it using the channel location editor'');' ... + 'elseif isempty(EEG(1).chaninfo.nodatchans),' ... + ' warndlg2(''There are no Reference channel defined, add it using the channel location editor'');' ... + 'else,' ... + ' tmpchaninfo = EEG(1).chaninfo; [tmp tmpval] = pop_chansel({tmpchaninfo.nodatchans.labels}, ''withindex'', ''on''); set(findobj(gcbf, ''tag'', ''refloc'' ), ''string'',tmpval); clear tmpchanlocs tmp tmpval;' ... + 'end;' ]; + if isempty(EEG.chanlocs), cb_chansel1 = ''; cb_chansel2 = ''; cb_chansel3 = ''; end; + + % find current reference (= reference most used) + % ---------------------------------------------- + if isfield(EEG(1).chanlocs, 'ref') + tmpchanlocs = EEG(1).chanlocs; + [curref tmp allinds] = unique_bc( { tmpchanlocs.ref }); + maxind = 1; + for ind = unique_bc(allinds) + if length(find(allinds == ind)) > length(find(allinds == maxind)) + maxind = ind; + end; + end; + curref = curref{maxind}; + if isempty(curref), curref = 'unknown'; end; + else curref = 'unknown'; + end; + + uilist = { { 'style' 'text' 'string' [ 'Current data reference state is: ' curref] } ... + ... + { 'style' 'checkbox' 'tag' 'ave' 'value' 1 'string' 'Compute average reference' 'callback' cb_averef } ... + ... + { 'style' 'checkbox' 'tag' 'rerefstr' 'value' 0 'string' 'Re-reference data to channel(s):' 'callback' cb_ref } ... + { 'style' 'edit' 'tag' 'reref' 'string' '' 'enable' 'off' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cb_chansel1 'enable' 'off' 'tag' 'refbr' } ... + ... + {} ... + ... + { 'style' 'checkbox' 'value' 0 'enable' 'off' 'tag' 'keepref' 'string' 'Retain old reference channels in data' } ... + ... + { 'style' 'text' 'string' 'Exclude channel indices (EMG, EOG)' } ... + { 'style' 'edit' 'tag' 'exclude' 'string' '' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cb_chansel2 } ... + ... + { 'style' 'text' 'tag' 'reflocstr' 'string' 'Add current reference channel back to the data' } ... + { 'style' 'edit' 'tag' 'refloc' 'string' '' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cb_chansel3 } }; + + [result tmp tmp2 restag] = inputgui(geometry, uilist, 'pophelp(''pop_reref'')', 'pop_reref - average reference or re-reference data'); + if isempty(result), return; end; + + % decode inputs + % ------------- + options = {}; + if ~isempty(restag.refloc), + try + tmpchaninfo = EEG.chaninfo; + tmpallchans = lower({ tmpchaninfo.nodatchans.labels }); + allelecs = parsetxt(lower(restag.refloc)); + chanind = []; + for iElec = 1:length(allelecs) + chanind = [chanind strmatch( allelecs{iElec}, tmpallchans, 'exact') ]; + end; + options = { options{:} 'refloc' EEG.chaninfo.nodatchans(chanind) }; + catch, disp('Error with old reference: ignoring it'); + end; + end; + if ~isempty(restag.exclude), options = { options{:} 'exclude' eeg_chaninds(EEG, restag.exclude) }; end; + if restag.keepref, options = { options{:} 'keepref' 'on' }; end; + if restag.ave, ref = []; end; + if restag.rerefstr + if isempty(restag.reref) + warndlg2('Abording: you must enter one or more reference channels'); + return; + else + ref = eeg_chaninds(EEG, restag.reref); + end; + end; +else + options = varargin; +end; +optionscall = options; + +% include channel location file +% ----------------------------- +if ~isempty(EEG.chanlocs) + optionscall = { optionscall{:} 'elocs' EEG.chanlocs }; +end; + +nchans = EEG.nbchan; +fprintf('Re-referencing data\n'); +oldchanlocs = EEG.chanlocs; +[EEG.data EEG.chanlocs refchan ] = reref(EEG.data, ref, optionscall{:}); +g = struct(optionscall{:}); +if ~isfield(g, 'exclude'), g.exclude = []; end; +if ~isfield(g, 'keepref'), g.keepref = 'off'; end; +if ~isfield(g, 'refloc') , g.refloc = []; end; + +% deal with reference +% ------------------- +if ~isempty(refchan) + if ~isfield(EEG.chaninfo, 'nodatchans') + EEG.chaninfo.nodatchans = refchan; + elseif isempty(EEG.chaninfo.nodatchans) + EEG.chaninfo.nodatchans = refchan; + else + allf = fieldnames(refchan); + n = length(EEG.chaninfo.nodatchans); + for ind = 1:length(allf) + EEG.chaninfo.nodatchans = setfield(EEG.chaninfo.nodatchans, { n }, ... + allf{ind}, getfield(refchan, allf{ind})); + end; + end; +end; +if ~isempty(g.refloc) + allinds = []; + tmpchaninfo = EEG.chaninfo; + for iElec = 1:length(g.refloc) + allinds = [allinds strmatch( g.refloc(iElec).labels, { tmpchaninfo.nodatchans.labels }) ]; + end; + EEG.chaninfo.nodatchans(allinds) = []; +end; + +% legacy EEG.ref field +% -------------------- +if isfield(EEG, 'ref') + if strcmpi(EEG.ref, 'common') && isempty(ref) + EEG.ref = 'averef'; + elseif strcmpi(EEG.ref, 'averef') && ~isempty(ref) + EEG.ref = 'common'; + end; +end; + +EEG.nbchan = size(EEG.data,1); +EEG = eeg_checkset(EEG); + +% include ICA or not +% ------------------ +if ~isempty(EEG.icaweights) + + if ~isempty(intersect(EEG.icachansind, g.exclude)) + disp('Warning: some channels used for ICA were excluded from referencing'); + disp(' the ICA decomposition has been removed'); + EEG.icaweights = []; + EEG.icasphere = []; + elseif length(EEG.icachansind) ~= nchans - length(g.exclude) + disp('Error: some channels not used for ICA decomposition are used for rereferencing'); + disp(' the ICA decomposition has been removed'); + EEG.icaweights = []; + EEG.icasphere = []; + else + fprintf('Re-referencing ICA matrix\n'); + if isempty(orichanlocs) + error('Cannot re-reference ICA decomposition without channel locations') + end; + + newICAchaninds = zeros(orinbchan, size(EEG.icawinv,2)); + newICAchaninds(EEG.icachansind,:) = EEG.icawinv; + + [newICAchaninds newchanlocs] = reref(newICAchaninds, ref, optionscall{:}); + + % convert channel indices in icachanlocs (uses channel labels) + % ------------------------------------------------------------ + icachansind = EEG.icachansind; + rminds = [1:size(newICAchaninds,1)]; + for i=length(icachansind):-1:1 + oldLabel = orichanlocs(icachansind(i)).labels; + newLabelPos = strmatch(oldLabel, { newchanlocs.labels }, 'exact'); + + if ~isempty( newLabelPos ) + icachansind(i) = newLabelPos; + rminds(find(icachansind(i) == rminds)) = []; + else + icachansind(i) = []; + end; + end; + newICAchaninds(rminds,:) = []; + EEG.icawinv = newICAchaninds; + + EEG.icachansind = icachansind; + if length(EEG.icachansind) ~= size(EEG.icawinv,1) + warning('Wrong channel indices, removing ICA decomposition'); + EEG.icaweights = []; + EEG.icasphere = []; + else + EEG.icaweights = pinv(EEG.icawinv); + EEG.icasphere = eye(length(icachansind)); + end; + end; + EEG = eeg_checkset(EEG); +end; + +% generate the output command +% --------------------------- +com = sprintf('%s = pop_reref( %s, %s);', inputname(1), inputname(1), vararg2str({ref, options{:}})); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_resample.m b/code/eeglab13_4_4b/functions/popfunc/pop_resample.m new file mode 100644 index 0000000..f43a318 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_resample.m @@ -0,0 +1,251 @@ +% pop_resample() - resample dataset (pop up window). +% +% Usage: +% >> [OUTEEG] = pop_resample( INEEG ); % pop up interactive window +% >> [OUTEEG] = pop_resample( INEEG, freq); +% +% Graphical interface: +% The edit box entitled "New sampling rate" contains the frequency in +% Hz for resampling the data. Entering a value in this box is the same +% as providing it in the 'freq' input from the command line. +% +% Inputs: +% INEEG - input dataset +% freq - frequency to resample (Hz) +% +% Outputs: +% OUTEEG - output dataset +% +% Author: Arnaud Delorme, CNL/Salk Institute, 2001 +% +% Note: uses the resample() function from the signal processing toolbox +% if present. Otherwise use griddata interpolation method (it should be +% reprogrammed using spline interpolation for speed up). +% +% See also: resample(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-08-02 remove ica activity resampling (now set to []) -ad +% 03-08-02 debug call to function help -ad +% 04-05-02 recompute event latencies -ad + +function [EEG, command] = pop_resample( EEG, freq); + +command = ''; +if nargin < 1 + help pop_resample; + return; +end; +if isempty(EEG(1).data) + disp('Pop_resample error: cannot resample empty dataset'); return; +end; + +if nargin < 2 + + % popup window parameters + % ----------------------- + promptstr = {['New sampling rate']}; + inistr = { num2str(EEG(1).srate) }; + result = inputdlg2( promptstr, 'Resample current dataset -- pop_resample()', 1, inistr, 'pop_resample'); + if length(result) == 0 return; end; + freq = eval( result{1} ); + +end; + +% process multiple datasets +% ------------------------- +if length(EEG) > 1 + [ EEG command ] = eeg_eval( 'pop_resample', EEG, 'warning', 'on', 'params', { freq } ); + return; +end; + +% finding the best ratio +[p,q] = rat(freq/EEG.srate, 0.0001); % not used right now + +% set variable +% ------------ +EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts, EEG.trials); +oldpnts = EEG.pnts; + +% resample for multiple channels +% ------------------------- +if isfield(EEG, 'event') & isfield(EEG.event, 'type') & isstr(EEG.event(1).type) + tmpevent = EEG.event; + bounds = strmatch('boundary', { tmpevent.type }); + if ~isempty(bounds), + disp('Data break detected and taken into account for resampling'); + bounds = [ tmpevent(bounds).latency ]; + bounds(bounds <= 0 | bounds > size(EEG.data,2)) = []; % Remove out of range boundaries + bounds(mod(bounds, 1) ~= 0) = round(bounds(mod(bounds, 1) ~= 0) + 0.5); % Round non-integer boundary latencies + end; + bounds = [1 bounds size(EEG.data, 2) + 1]; % Add initial and final boundary event + bounds = unique(bounds); % Sort (!) and remove doublets +else + bounds = [1 size(EEG.data,2) + 1]; % [1:size(EEG.data,2):size(EEG.data,2)*size(EEG.data,3)+1]; +end; + +eeglab_options; +if option_donotusetoolboxes + usesigproc = 0; +elseif exist('resample') == 2 + usesigproc = 1; +else usesigproc = 0; + disp('Signal Processing Toolbox absent: using custom interpolation instead of resample() function.'); + disp('This method uses cubic spline interpolation after anti-aliasing (see >> help spline)'); +end; + +fprintf('resampling data %3.4f Hz\n', EEG.srate*p/q); +eeglab_options; +for index1 = 1:size(EEG.data,1) + fprintf('%d ', index1); + sigtmp = reshape(EEG.data(index1,:, :), oldpnts, EEG.trials); + + if index1 == 1 + tmpres = []; + indices = [1]; + for ind = 1:length(bounds)-1 + tmpres = [ tmpres; myresample( double( sigtmp(bounds(ind):bounds(ind+1)-1,:)), p, q, usesigproc ) ]; + indices = [ indices size(tmpres,1)+1 ]; + end; + if size(tmpres,1) == 1, EEG.pnts = size(tmpres,2); + else EEG.pnts = size(tmpres,1); + end; + if option_memmapdata == 1 + tmpeeglab = mmo([], [EEG.nbchan, EEG.pnts, EEG.trials]); + else tmpeeglab = zeros(EEG.nbchan, EEG.pnts, EEG.trials); + end; + else + for ind = 1:length(bounds)-1 + tmpres(indices(ind):indices(ind+1)-1,:) = myresample( double( sigtmp(bounds(ind):bounds(ind+1)-1,:) ), p, q, usesigproc ); + end; + end; + tmpeeglab(index1,:, :) = tmpres; +end; +fprintf('\n'); +EEG.srate = EEG.srate*p/q; +EEG.data = tmpeeglab; + +% recompute all event latencies +% ----------------------------- +if isfield(EEG.event, 'latency') + fprintf('resampling event latencies...\n'); + + for iEvt = 1:length(EEG.event) + + % From >> help resample: Y is P/Q times the length of X (or the + % ceiling of this if P/Q is not an integer). + % That is, recomputing event latency by pnts / oldpnts will give + % inaccurate results in case of multiple segments and rounded segment + % length. Error is accumulated and can lead to several samples offset. + % Blocker for boundary events. + % Old version EEG.event(index1).latency = EEG.event(index1).latency * EEG.pnts /oldpnts; + + % Recompute event latencies relative to segment onset + if strcmpi(EEG.event(iEvt).type, 'boundary') && mod(EEG.event(iEvt).latency, 1) == 0.5 % Workaround to keep EEGLAB style boundary events at -0.5 latency relative to DC event; actually incorrect + iBnd = sum(EEG.event(iEvt).latency + 0.5 >= bounds); + EEG.event(iEvt).latency = indices(iBnd) - 0.5; + else + iBnd = sum(EEG.event(iEvt).latency >= bounds); + EEG.event(iEvt).latency = (EEG.event(iEvt).latency - bounds(iBnd)) * p / q + indices(iBnd); + end + + end + + if isfield(EEG, 'urevent') & isfield(EEG.urevent, 'latency') + try + for iUrevt = 1:length(EEG.urevent) + % Recompute urevent latencies relative to segment onset + if strcmpi(EEG.urevent(iUrevt).type, 'boundary') && mod(EEG.urevent(iUrevt).latency, 1) == 0.5 % Workaround to keep EEGLAB style boundary events at -0.5 latency relative to DC event; actually incorrect + iBnd = sum(EEG.urevent(iUrevt).latency + 0.5 >= bounds); + EEG.urevent(iUrevt).latency = indices(iBnd) - 0.5; + else + iBnd = sum(EEG.urevent(iUrevt).latency >= bounds); + EEG.urevent(iUrevt).latency = (EEG.urevent(iUrevt).latency - bounds(iBnd)) * p / q + indices(iBnd); + end + + end; + catch + disp('pop_resample warning: ''urevent'' problem, reinitializing urevents'); + EEG = rmfield(EEG, 'urevent'); + end; + end; + EEG = eeg_checkset(EEG, 'eventconsistency'); +end; + +% resample for multiple channels ica +EEG.icaact = []; + +% store dataset +fprintf('resampling finished\n'); + +EEG.setname = [EEG.setname ' resampled']; +EEG.pnts = size(EEG.data,2); +EEG.xmax = EEG.xmin + (EEG.pnts-1)/EEG.srate; % cko: recompute xmax, since we may have removed a few of the trailing samples +EEG.times = linspace(EEG.xmin*1000, EEG.xmax*1000, EEG.pnts); + +command = sprintf('EEG = pop_resample( %s, %d);', inputname(1), freq); +return; + +% resample if resample is not present +% ----------------------------------- +function tmpeeglab = myresample(data, pnts, new_pnts, usesigproc); + + if length(data) < 2 + tmpeeglab = data; + return; + end; + %if size(data,2) == 1, data = data'; end; + if usesigproc + % padding to avoid artifacts at the beginning and at the end + % Andreas Widmann May 5, 2011 + + %The pop_resample command introduces substantial artifacts at beginning and end + %of data when raw data show DC offset (e.g. as in DC recorded continuous files) + %when MATLAB Signal Processing Toolbox is present (and MATLAB resample.m command + %is used). + %Even if this artifact is short, it is a filtered DC offset and will be carried + %into data, e.g. by later highpass filtering to a substantial amount (easily up + %to several seconds). + %The problem can be solved by padding the data at beginning and end by a DC + %constant before resampling. + + [p, q] = rat(pnts / new_pnts, 1e-12); % Same precision as in resample + N = 10; % Resample default + nPad = ceil((max(p, q) * N) / q) * q; % # datapoints to pad, round to integer multiple of q for unpadding + tmpeeglab = resample([data(ones(1, nPad), :); data; data(end * ones(1, nPad), :)], pnts, new_pnts); + nPad = nPad * p / q; % # datapoints to unpad + tmpeeglab = tmpeeglab(nPad + 1:end - nPad, :); % Remove padded data + return; + end; + + % anti-alias filter + % ----------------- + data = eegfiltfft(data', 256, 0, 128*pnts/new_pnts); % Downsample from 256 to 128 times the ratio of freq. + % Code was verified by Andreas Widdman March 2014 + + % spline interpolation + % -------------------- + X = [1:length(data)]; + nbnewpoints = length(data)*pnts/new_pnts; + nbnewpoints2 = ceil(nbnewpoints); + lastpointval = length(data)/nbnewpoints*nbnewpoints2; + XX = linspace( 1, lastpointval, nbnewpoints2); + + cs = spline( X, data); + tmpeeglab = ppval(cs, XX)'; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rmbase.m b/code/eeglab13_4_4b/functions/popfunc/pop_rmbase.m new file mode 100644 index 0000000..330392c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rmbase.m @@ -0,0 +1,179 @@ +% pop_rmbase() - remove channel baseline means from an epoched or +% continuous EEG dataset. Calls rmbase(). +% Usage: +% >> OUTEEG = pop_rmbase( EEG ); % pop up an interactive arg entry window +% >> OUTEEG = pop_rmbase( EEG, timerange, pointrange); % call rmbase() +% +% Graphic interface: +% "Baseline latency range" - [edit box] Latency range for the baseline in ms. +% Collects the 'timerange' command line input. +% Empty or [] input -> Use whole epoch as baseline +% "Baseline points vector" - [edit box] Collects the 'pointrange' command line +% option (below). (Overwritten by 'timerange' above). +% Empty or [] input -> Use whole epoch as baseline +% Inputs: +% EEG - Input dataset +% timerange - [min_ms max_ms] Baseline latency range in milliseconds. +% Empty or [] input -> Use whole epoch as baseline +% pointrange - [min:max] Baseline points vector (overwritten by timerange). +% Empty or [] input -> Use whole epoch as baseline +% Outputs: +% OUTEEG - Output dataset +% +% Note: If dataset is continuous, channel means are removed separately +% for each continuous data region, respecting 'boundary' events +% marking boundaries of excised or concatenated data portions. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: rmbase(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [EEG, com] = pop_rmbase( EEG, timerange, pointrange); + +com =''; +if nargin < 1 + help pop_rmbase; + return; +end; +if isempty(EEG(1).data) + disp('pop_rmbase(): cannot remove baseline of an empty dataset'); return; +end; +if nargin < 1 + help pop_rmbase; + return; +end; +if nargin < 2 & EEG(1).trials > 1 + % popup window parameters + % ----------------------- + defaultbase = [num2str(EEG(1).xmin*1000) ' 0']; + if EEG(1).xmin*1000 >= 0 + defaultbase = '[ ]'; + end; + uilist = { { 'style' 'text' 'string' 'Baseline latency range ([min max] in ms) ([ ] = whole epoch):' } ... + { 'style' 'edit' 'string' defaultbase } ... + { 'style' 'text' 'string' 'Or remove baseline points vector (ex:1:56):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Note: press Cancel if you do not want to remove the baseline' } ... + }; + uigeom = { [3 1] [3 1] [1] }; + [result usrdat] = inputgui( 'uilist', uilist, 'geometry', uigeom, 'title', 'Baseline removal - pop_rmbase()', 'helpcom', 'pophelp(''pop_rmbase'');'); + if isempty(result), return; end; + if ~isempty(usrdat) && isnan(usrdat), return; end; + + % decode parameters + % ----------------- + if numel(result) < 2 | ((isempty(result{1}) | strcmp(result{1},'[]') ) ... + & (isempty(result{2}) | strcmp(result{2},'[]'))) + timerange = [num2str(EEG(1).xmin*1000) num2str(EEG(1).xmax*1000)]; % whole epoch latency range + fprintf('pop_rmbase(): using whole epoch as baseline.\n'); + + % fprintf('pop_rmbase(): baseline limits must be specified.\n'); + % return; end; + else + timerange = eval( [ '[' result{1} ']' ] ); + pointrange = eval( [ '[' result{2} ']' ] ); + end +elseif nargin < 2 & EEG(1).trials == 1 + % popup window parameters + % ----------------------- + resp = questdlg2(strvcat('Remove mean of each data channel'), 'pop_rmbase', 'Cancel', 'Ok', 'Ok'); + if strcmpi(resp, 'Cancel'), return; end; + timerange = []; + pointrange = [1:EEG(1).pnts]; +end; + +% process multiple datasets +% ------------------------- +if length(EEG) > 1 + [ EEG com ] = eeg_eval( 'pop_rmbase', EEG, 'warning', 'on', 'params', ... + { timerange pointrange } ); + return; +end; + +if exist('pointrange') ~= 1 && ~isempty(timerange) + if (timerange(1) < EEG.xmin*1000) & (timerange(2) > EEG.xmax*1000) + error('pop_rmbase(): Bad time range'); + end; + pointrange = round((timerange(1)/1000-EEG.xmin)*EEG.srate+1):round((timerange(2)/1000-EEG.xmin)*EEG.srate); +end; + +if isempty(timerange) + timerange = [ EEG(1).xmin*1000 EEG(1).xmax*1000]; +end; + +if exist('pointrange') ~= 1 || isempty(pointrange) + if ~isempty(timerange) && (timerange(1) < EEG.xmin*1000) & (timerange(2) > EEG.xmax*1000) + error('pop_rmbase(): Bad time range'); + end; + pointrange = round((timerange(1)/1000-EEG.xmin)*EEG.srate+1):ceil((timerange(2)/1000-EEG.xmin)*EEG.srate); + if pointrange(end) > EEG.pnts, pointrange(end) = EEG.pnts; end; +end; + +if ~isempty(pointrange) && ((min(pointrange) < 1) || (max( pointrange ) > EEG.pnts)) + error('pop_rmbase(): Wrong point range'); +end; + +fprintf('pop_rmbase(): Removing baseline...\n'); +% +% Respect excised data boundaries if continuous data +% --------------------------------------------------- +if EEG.trials == 1 && ~isempty(EEG.event) ... + && isfield(EEG.event, 'type') ... + && isstr(EEG.event(1).type) + tmpevent = EEG.event; + boundaries = strmatch('boundary', {tmpevent.type}); + if ~isempty(boundaries) % this is crashing + fprintf('Pop_rmbase(): finding continuous data discontinuities\n'); + boundaries = round([ tmpevent(boundaries).latency ] -0.5-pointrange(1)+1); + boundaries(boundaries>=pointrange(end)-pointrange(1)) = []; + boundaries(boundaries<1) = []; + boundaries = [0 boundaries pointrange(end)-pointrange(1)+1]; + for index=1:length(boundaries)-1 + tmprange = [boundaries(index)+1:boundaries(index+1)]; + if length(tmprange) > 1 + EEG.data(:,tmprange) = rmbase( EEG.data(:,tmprange), length(tmprange), ... + [1:length(tmprange)]); + elseif length(tmprange) == 1 + EEG.data(:,tmprange) = 0; + end; + end; + else + EEG.data = rmbase( EEG.data, EEG.pnts, pointrange ); + end; +else + for indc = 1:EEG.nbchan + tmpmean = mean(double(EEG.data(indc,pointrange,:)),2); + EEG.data(indc,:,:) = EEG.data(indc,:,:) - repmat(tmpmean, [1 EEG.pnts 1]); + end; +% EEG.data = rmbase( reshape(EEG.data, EEG.nbchan, EEG.pnts*EEG.trials), EEG.pnts, pointrange ); +end; + +EEG.data = reshape( EEG.data, EEG.nbchan, EEG.pnts, EEG.trials); +EEG.icaact = []; + +if ~isempty(timerange) + com = sprintf('%s = pop_rmbase( %s, [%s]);', inputname(1), inputname(1), ... + num2str(timerange)); +else + com = sprintf('%s = pop_rmbase( %s, [], %s);', inputname(1), inputname(1), ... + vararg2str({pointrange})); +end; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_rmdat.m b/code/eeglab13_4_4b/functions/popfunc/pop_rmdat.m new file mode 100644 index 0000000..5501906 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_rmdat.m @@ -0,0 +1,174 @@ +% pop_rmdat() - Remove continuous data around specific events +% +% Usage: +% >> OUTEEG = pop_rmdat( EEG); % pop-up a data entry window +% >> OUTEEG = pop_rmdat( EEG, typerange, timelimits, invertselection); +% +% Graphic interface: +% "Time-locking event type(s)" - [edit box] Select 'Edit > Event values' +% to see a list of event.type values; else use the push button. +% To use event types containing spaces, enter in single-quotes. +% "..." - [push button] scroll event types. +% "Time limits" - [edit box] epoch latency range [start, end] in seconds relative +% to the event type latency. +% +% Inputs: +% EEG - Input dataset. Data may already be epoched; in this case, +% extract (shorter) subepochs time locked to epoch events. +% typerange - Cell array of event types to time lock to. +% (Note: An event field called 'type' must be defined in +% the 'EEG.event' structure). +% timelimits - Epoch latency limits [start end] in seconds relative to the time-locking event +% {default: [-1 2]}% +% invertselection - [0|1] Invert selection {default:0 is no} +% +% Outputs: +% OUTEEG - output dataset +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, 2009- + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_rmdat( EEG, events, timelims, invertsel ); + +if nargin < 1 + help pop_rmdat; + return; +end; +com = ''; + +if isempty(EEG.event) + error( [ 'No event. This function removes data' 10 'based on event latencies' ]); +end; +if isempty(EEG.trials) + error( [ 'This function only works with continuous data' ]); +end; +if ~isfield(EEG.event, 'latency'), + error( 'Absent latency field in event array/structure: must name one of the fields ''latency'''); +end; + +if nargin < 3 + % popup window parameters + % ----------------------- + promptstr = { strvcat('Time-locking event type(s) ([]=all):', ... + 'Select ''Edit > Event values'' to see type values.'), ... + 'Epoch limits [start, end] in seconds:', ... + 'Name for the new dataset:', ... + 'Out-of-bounds EEG rejection limits ([min max], []=none):' }; + + cbevent = ['if ~isfield(EEG.event, ''type'')' ... + ' errordlg2(''No type field'');' ... + 'else' ... + ' tmpevent = EEG.event;' ... + ' if isnumeric(EEG.event(1).type),' ... + ' [tmps,tmpstr] = pop_chansel(unique([ tmpevent.type ]));' ... + ' else,' ... + ' [tmps,tmpstr] = pop_chansel(unique({ tmpevent.type }));' ... + ' end;' ... + ' if ~isempty(tmps)' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''events''), ''string'', tmpstr);' ... + ' end;' ... + 'end;' ... + 'clear tmps tmpv tmpstr tmpevent tmpfieldnames;' ]; + + geometry = { [2 1 1.2] [2 1 1.2] }; + uilist = { { 'style' 'text' 'string' 'Event type(s) ([]=all)' } ... + { 'style' 'edit' 'string' '' 'tag' 'events' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cbevent } ... + { 'style' 'text' 'string' 'Time limits [start, end] in sec.' } ... + { 'style' 'edit' 'string' '-1 1' } ... + { 'style' 'popupmenu' 'string' 'Keep selected|Remove selected' } }; + + result = inputgui( geometry, uilist, 'pophelp(''pop_rmdat'')', 'Remove data portions around events - pop_rmdat()'); + if length(result) == 0 return; end; + + if strcmpi(result{1}, '[]'), result{1} = ''; end; + if ~isempty(result{1}) + if strcmpi(result{1}(1),'''') % If event type appears to be in single-quotes, use comma + % and single-quote as delimiter between event types. toby 2.24.2006 + % fixed Arnaud May 2006 + events = eval( [ '{' result{1} '}' ] ); + else events = parsetxt( result{1}); + end; + else events = {}; + end + timelims = eval( [ '[' result{2} ']' ] ); + invertsel = result{3}-1; + +end; + +tmpevent = EEG.event; +alltypes = { tmpevent.type }; + +% compute event indices +% --------------------- +allinds = []; +for index = 1:length(events) + inds = strmatch(events{index},alltypes, 'exact'); + allinds = [allinds(:); inds(:) ]'; +end; +allinds = sort(allinds); +if isempty(allinds) + disp('No event found'); + return; +end; + +% compute time limits +% ------------------- +array = []; +tmpevent = EEG.event; +bnd = strmatch('boundary', lower({tmpevent.type })); +bndlat = [ tmpevent(bnd).latency ]; +for bind = 1:length(allinds) + evtlat = EEG.event(allinds(bind)).latency; + evtbeg = evtlat+EEG.srate*timelims(1); + evtend = evtlat+EEG.srate*timelims(2); + if any(bndlat > evtbeg & bndlat < evtend) + % find the closer upper and lower boundaries + bndlattmp = bndlat(bndlat > evtbeg & bndlat < evtend); + diffbound = bndlattmp-evtlat; + allneginds = find(diffbound < 0); + allposinds = find(diffbound > 0); + if ~isempty(allneginds), evtbeg = bndlattmp(allneginds(1)); end; + if ~isempty(allposinds), evtend = bndlattmp(allposinds(1)); end; + fprintf('Boundary found: time limits for event %d reduced from %3.2f to %3.2f\n', allinds(bind), ... + (evtbeg-evtlat)/EEG.srate, (evtend-evtlat)/EEG.srate); + end + if ~isempty(array) && evtbeg < array(end) + array(end) = evtend; + else + array = [ array; evtbeg evtend]; + end; +end; +array + +if ~isempty(array) && array(1) < 1, array(1) = 1; end; +if ~isempty(array) && array(end) > EEG.pnts, array(end) = EEG.pnts; end; +if isempty(array) + disp('No event found'); + return; +end; + +if invertsel + EEG = pop_select(EEG, 'notime', (array-1)/EEG.srate); +else + EEG = pop_select(EEG, 'time', (array-1)/EEG.srate); +end; + +% generate output command +% ----------------------- +com = sprintf('EEG = pop_rmdat( EEG, %s);', vararg2str( { events timelims invertsel } )); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_runica.m b/code/eeglab13_4_4b/functions/popfunc/pop_runica.m new file mode 100644 index 0000000..c4451e7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_runica.m @@ -0,0 +1,528 @@ +% pop_runica() - Run an ICA decomposition of an EEG dataset using runica(), +% binica(), or another ICA or other linear decomposition. +% Usage: +% >> OUT_EEG = pop_runica( EEG ); % pops-up a data entry window +% >> OUT_EEG = pop_runica( EEG, 'key', 'val' ); % no pop_up +% +% Graphic interface: +% "ICA algorithm to use" - [edit box] The ICA algorithm to use for +% ICA decomposition. Command line equivalent: 'icatype' +% "Commandline options" - [edit box] Command line options to forward +% to the ICA algorithm. Command line equivalent: 'options' +% Inputs: +% EEG - input EEG dataset or array of datasets +% +% Optional inputs: +% 'icatype' - ['runica'|'binica'|'jader'|'fastica'] ICA algorithm +% to use for the ICA decomposition. The nature of any +% differences in the results of these algorithms have +% not been well characterized. {default: binica(), if +% found, else runica()} +% 'dataset' - [integer array] dataset index or indices. +% 'chanind' - [integer array or cell array] subset of channel indices +% for running the ICA decomposition. Alternatively, you may +% also enter channel types here in a cell array. +% 'concatenate' - ['on'|'off'] 'on' concatenate all input datasets +% (assuming there are several). 'off' run ICA independently +% on each dataset. Default is 'off'. +% 'concatcond' - ['on'|'off'] 'on' concatenate conditions for input datasets +% of the same sessions and the same subject. Default is 'off'. +% 'key','val' - ICA algorithm options (see ICA routine help messages). +% +% Adding a new algorithm: +% Add the algorithm to the list of algorithms line 366 to 466, for example +% +% case 'myalgo', [EEG.icaweights] = myalgo( tmpdata, g.options{:} ); +% +% where "myalgo" is the name of your algorithm (and Matlab function). +% tmpdata is the 2-D array containing the EEG data (channels x points) and +% g.options{} contains custom options for your algorithm (there is no +% predetermined format for these options). The output EEG.icaweights is the +% mixing matrix (or inverse of the unmixing matrix). +% +% Note: +% 1) Infomax (runica, binica) is the ICA algorithm we use most. It is based +% on Tony Bell's infomax algorithm as implemented for automated use by +% Scott Makeig et al. using the natural gradient of Amari et al. It can +% also extract sub-Gaussian sources using the (recommended) 'extended' option +% of Lee and Girolami. Function runica() is the all-Matlab version; function +% binica() calls the (1.5x faster) binary version (a separate download) +% translated into C from runica() by Sigurd Enghoff. +% 2) jader() calls the JADE algorithm of Jean-Francois Cardoso. This is +% included in the EEGLAB toolbox by his permission. See >> help jader +% 3) To run fastica(), download the fastICA toolbox from its website, +% http://www.cis.hut.fi/projects/ica/fastica/, and make it available +% in your Matlab path. According to its authors, default parameters +% are not optimal: Try args 'approach', 'sym' to estimate components +% in parallel. +% +% Outputs: +% OUT_EEG = The input EEGLAB dataset with new fields icaweights, icasphere +% and icachansind (channel indices). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: runica(), binica(), jader(), fastica() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-07-02 add the eeglab options -ad +% 03-18-02 add other decomposition options -ad +% 03-19-02 text edition -sm + +function [ALLEEG, com] = pop_runica( ALLEEG, varargin ) + +com = ''; +if nargin < 1 + help pop_runica; + return; +end; + +% find available algorithms +% ------------------------- +allalgs = { 'runica' 'binica' 'jader' 'jadeop' 'jade_td_p' 'MatlabshibbsR' 'fastica' ... + 'tica' 'erica' 'simbec' 'unica' 'amuse' 'fobi' 'evd' 'evd24' 'sons' 'sobi' 'ng_ol' ... + 'acsobiro' 'acrsobibpf' 'pearson_ica' 'egld_ica' 'eeA' 'tfbss' 'icaML' 'icaMS' }; % do not use egld_ica => too slow +selectalg = {}; +linenb = 1; +count = 1; +for index = length(allalgs):-1:1 + if exist(allalgs{index}) ~= 2 & exist(allalgs{index}) ~= 6 + allalgs(index) = []; + end; +end; + +% special AMICA +% ------------- +selectamica = 0; +defaultopts = [ '''extended'', 1' ] ; +if nargin > 1 + if isstr(varargin{1}) + if strcmpi(varargin{1}, 'selectamica') + selectamica = 1; + allalgs = { 'amica' allalgs{:} }; + defaultopts = sprintf('''outdir'', ''%s''', fullfile(pwd, 'amicaout')); + elseif strcmpi(varargin{1}, 'selectamicaloc') + selectamica = 1; + allalgs = { 'amica' allalgs{:} }; + defaultopts = sprintf('''outdir'', ''%s'', ''qsub'', ''off''', fullfile(pwd, 'amicaout')); + end; + end; +end; + +% popup window parameters +% ----------------------- +fig = []; +if nargin < 2 | selectamica + commandchans = [ 'tmpchans = get(gcbf, ''userdata'');' ... + 'tmpchans = tmpchans{1};' ... + 'set(findobj(gcbf, ''tag'', ''chantype''), ''string'', ' ... + ' int2str(pop_chansel( tmpchans )));' ... + 'clear tmpchans;' ]; + commandtype = ['tmptype = get(gcbf, ''userdata'');' ... + 'tmptype = tmptype{2};' ... + 'if ~isempty(tmptype),' ... + ' [tmps,tmpv, tmpstr] = listdlg2(''PromptString'',''Select type(s)'', ''ListString'', tmptype);' ... + ' if tmpv' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''chantype''), ''string'', tmpstr);' ... + ' end;' ... + 'else,' ... + ' warndlg2(''No channel type'', ''No channel type'');' ... + 'end;' ... + 'clear tmps tmpv tmpstr tmptype tmpchans;' ]; + cb_ica = [ 'if get(gcbo, ''value'') < 3, ' ... + ' set(findobj(gcbf, ''tag'', ''params''), ''string'', ''''''extended'''', 1'');' ... + 'else set(findobj(gcbf, ''tag'', ''params''), ''string'', '''');' ... + 'end;' ]; + + promptstr = { { 'style' 'text' 'string' 'ICA algorithm to use (click to select)' } ... + { 'style' 'listbox' 'string' strvcat(allalgs{:}) 'callback', cb_ica } ... + { 'style' 'text' 'string' 'Commandline options (See help messages)' } ... + { 'style' 'edit' 'string' defaultopts 'tag' 'params' } ... + { 'style' 'text' 'string' 'Channel type(s) or channel indices' } ... + { 'style' 'edit' 'string' '' 'tag' 'chantype' } ... + { 'style' 'pushbutton' 'string' '... types' 'callback' commandtype } ... + { 'style' 'pushbutton' 'string' '... channels' 'callback' commandchans } }; + geometry = { [2 1.5] [2 1.5] [2 1 1 1] }; + if length(ALLEEG) > 1 + cb1 = 'set(findobj(''parent'', gcbf, ''tag'', ''concat2''), ''value'', 0);'; + cb2 = 'set(findobj(''parent'', gcbf, ''tag'', ''concat1''), ''value'', 0);'; + promptstr = { promptstr{:}, ... + { 'style' 'text' 'string' 'Concatenate all datasets (check=yes; uncheck=run ICA on each dataset)?' }, ... + { 'style' 'checkbox' 'string' '' 'value' 0 'tag' 'concat1' 'callback' cb1 }, ... + { 'style' 'text' 'string' 'Concatenate datasets for the same subject and session (check=yes)?' }, ... + { 'style' 'checkbox' 'string' '' 'value' 1 'tag' 'concat2' 'callback' cb2 } }; + geometry = { geometry{:} [ 2 0.2 ] [ 2 0.2 ]}; + end; + % channel types + % ------------- + if isfield(ALLEEG(1).chanlocs, 'type'), + tmpchanlocs = ALLEEG(1).chanlocs; + alltypes = { tmpchanlocs.type }; + indempty = cellfun('isempty', alltypes); + alltypes(indempty) = ''; + try, + alltypes = unique_bc(alltypes); + catch, + alltypes = ''; + end; + else + alltypes = ''; + end; + + % channel labels + % -------------- + if ~isempty(ALLEEG(1).chanlocs) + tmpchanlocs = ALLEEG(1).chanlocs; + alllabels = { tmpchanlocs.labels }; + else + for index = 1:ALLEEG(1).nbchan + alllabels{index} = int2str(index); + end; + end; + + % gui + % --- + result = inputgui( 'geometry', geometry, 'uilist', promptstr, ... + 'helpcom', 'pophelp(''pop_runica'')', ... + 'title', 'Run ICA decomposition -- pop_runica()', 'userdata', { alllabels alltypes } ); + if length(result) == 0 return; end; + options = { 'icatype' allalgs{result{1}} 'dataset' [1:length(ALLEEG)] 'options' eval( [ '{' result{2} '}' ]) }; + if ~isempty(result{3}) + if ~isempty(str2num(result{3})), options = { options{:} 'chanind' str2num(result{3}) }; + else options = { options{:} 'chanind' parsetxt(result{3}) }; + end; + end; + if length(result) > 3 + options = { options{:} 'concatenate' fastif(result{4}, 'on', 'off') }; + options = { options{:} 'concatcond' fastif(result{5}, 'on', 'off') }; + end; +else + if mod(length(varargin),2) == 1 + options = { 'icatype' varargin{1:end} }; + else + options = varargin; + end; +end; + +% decode input arguments +% ---------------------- +[ g addoptions ] = finputcheck( options, { 'icatype' 'string' allalgs 'runica'; ... + 'dataset' 'integer' [] [1:length(ALLEEG)]; + 'options' 'cell' [] {}; + 'concatenate' 'string' { 'on','off' } 'off'; + 'concatcond' 'string' { 'on','off' } 'off'; + 'chanind' { 'cell','integer' } { [] [] } [];}, ... + 'pop_runica', 'ignore'); +if isstr(g), error(g); end; +if ~isempty(addoptions), g.options = { g.options{:} addoptions{:}}; end; + +% select datasets, create new big dataset if necessary +% ---------------------------------------------------- +if length(g.dataset) == 1 + EEG = ALLEEG(g.dataset); + EEG = eeg_checkset(EEG, 'loaddata'); +elseif length(ALLEEG) > 1 & ~strcmpi(g.concatenate, 'on') & ~strcmpi(g.concatcond, 'on') + [ ALLEEG com ] = eeg_eval( 'pop_runica', ALLEEG, 'warning', 'off', 'params', ... + { 'icatype' g.icatype 'options' g.options 'chanind' g.chanind } ); + return; +elseif length(ALLEEG) > 1 & strcmpi(g.concatcond, 'on') + allsubjects = { ALLEEG.subject }; + allsessions = { ALLEEG.session }; + allgroups = { ALLEEG.group }; + alltags = zeros(1,length(allsubjects)); + if any(cellfun('isempty', allsubjects)) + disp('Aborting: Subject names missing from at least one dataset.'); + return; + end; + dats = {}; + for index = 1:length(allsubjects) + if ~alltags(index) + allinds = strmatch(allsubjects{index}, allsubjects, 'exact'); + rmind = []; + % if we have different sessions they will not be concatenated + for tmpi = setdiff_bc(allinds,index)' + if ~isequal(allsessions(index), allsessions(tmpi)), rmind = [rmind tmpi]; + %elseif ~isequal(allgroups(index), allgroups(tmpi)), rmind = [rmind tmpi]; + end; + end; + allinds = setdiff_bc(allinds, rmind); + fprintf('Found %d datasets for subject ''%s''\n', length(allinds), allsubjects{index}); + dats = { dats{:} allinds }; + alltags(allinds) = 1; + end; + end; + fprintf('**************************\nNOW RUNNING ALL DECOMPOSITIONS\n****************************\n'); + for index = 1:length(dats) + ALLEEG(dats{index}) = pop_runica(ALLEEG(dats{index}), 'icatype', g.icatype, ... + 'options', g.options, 'chanind', g.chanind, 'concatenate', 'on'); + for idat = 1:length(dats{index}) + ALLEEG(dats{index}(idat)).saved = 'no'; + pop_saveset(ALLEEG(dats{index}(idat)), 'savemode', 'resave'); + ALLEEG(dats{index}(idat)).saved = 'yes'; + end; + end; + com = sprintf('%s = pop_runica(%s, %s);', inputname(1),inputname(1), ... + vararg2str({ 'icatype' g.icatype 'concatcond' 'on' 'options' g.options }) ); + return; +else + disp('Concatenating datasets...'); + EEG = ALLEEG(g.dataset(1)); + + % compute total data size + % ----------------------- + totalpnts = 0; + for i = g.dataset + totalpnts = totalpnts+ALLEEG(g.dataset(i)).pnts*ALLEEG(g.dataset(i)).trials; + end; + EEG.data = zeros(EEG.nbchan, totalpnts); + + % copy data + % --------- + cpnts = 1; + for i = g.dataset + tmplen = ALLEEG(g.dataset(i)).pnts*ALLEEG(g.dataset(i)).trials; + TMP = eeg_checkset(ALLEEG(g.dataset(i)), 'loaddata'); + EEG.data(:,cpnts:cpnts+tmplen-1) = reshape(TMP.data, size(TMP.data,1), size(TMP.data,2)*size(TMP.data,3)); + cpnts = cpnts+tmplen; + end; + EEG.icaweights = []; + EEG.trials = 1; + EEG.pnts = size(EEG.data,2); + EEG.saved = 'no'; +end; + +% Store and then remove current EEG ICA weights and sphere +% --------------------------------------------------- +fprintf('\n'); +if ~isempty(EEG.icaweights) + fprintf('Saving current ICA decomposition in "EEG.etc.oldicaweights" (etc.).\n'); + if ~isfield(EEG,'etc'), EEG.etc = []; end; + if ~isfield(EEG.etc,'oldicaweights') + EEG.etc.oldicaweights = {}; + EEG.etc.oldicasphere = {}; + EEG.etc.oldicachansind = {}; + end; + tmpoldicaweights = EEG.etc.oldicaweights; + tmpoldicasphere = EEG.etc.oldicasphere; + tmpoldicachansind = EEG.etc.oldicachansind; + EEG.etc.oldicaweights = { EEG.icaweights tmpoldicaweights{:} }; + EEG.etc.oldicasphere = { EEG.icasphere tmpoldicasphere{:} }; + EEG.etc.oldicachansind = { EEG.icachansind tmpoldicachansind{:} }; + fprintf(' Decomposition saved as entry %d.\n',length(EEG.etc.oldicaweights)); +end +EEG.icaweights = []; +EEG.icasphere = []; +EEG.icawinv = []; +EEG.icaact = []; + +% select sub_channels +% ------------------- +if isempty(g.chanind) + g.chanind = 1:EEG.nbchan; +end; +if iscell(g.chanind) + g.chanind = eeg_chantype(EEG.chanlocs, g.chanind); +end; +EEG.icachansind = g.chanind; + +% is pca already an option? +% ------------------------- +pca_opt = 0; +for i = 1:length(g.options) + if isstr(g.options{i}) + if strcmpi(g.options{i}, 'pca') + pca_opt = 1; + end; + end; +end; + +%------------------------------ +% compute ICA on a definite set +% ----------------------------- +tmpdata = reshape( EEG.data(g.chanind,:,:), length(g.chanind), EEG.pnts*EEG.trials); +tmprank = getrank(double(tmpdata(:,1:min(3000, size(tmpdata,2))))); +tmpdata = tmpdata - repmat(mean(tmpdata,2), [1 size(tmpdata,2)]); % zero mean +if ~strcmpi(lower(g.icatype), 'binica') + try + disp('Attempting to convert data matrix to double precision for more accurate ICA results.') + tmpdata = double(tmpdata); + tmpdata = tmpdata - repmat(mean(tmpdata,2), [1 size(tmpdata,2)]); % zero mean (more precise than single precision) + catch + disp('*************************************************************') + disp('Not enough memory to convert data matrix to double precision.') + disp('All computations will be done in single precision. Matlab 7.x') + disp('under 64-bit Linux and others is imprecise in this mode.') + disp('We advise use of "binica" instead of "runica."') + disp('*************************************************************') + end; +end; +switch lower(g.icatype) + case 'runica' + try, if ismatlab, g.options = { g.options{:}, 'interupt', 'on' }; end; catch, end; + if tmprank == size(tmpdata,1) | pca_opt + [EEG.icaweights,EEG.icasphere] = runica( tmpdata, 'lrate', 0.001, g.options{:} ); + else + if nargin < 2 + uilist = { { 'style' 'text' 'string' [ 'EEGLAB has detected that the rank of your data matrix' 10 ... + 'is lower the number of input data channels. This might' 10 ... + 'be because you are including a reference channel or' 10 ... + 'because you are running a second ICA decomposition.' 10 ... + sprintf('The proposed dimension for ICA is %d (out of %d channels).', tmprank, size(tmpdata,1)) 10 ... + 'Rank computation may be innacurate so you may edit this' 10 ... + 'number below. If you do not understand, simply press OK.' ] } { } ... + { 'style' 'text' 'string' 'Proposed rank:' } ... + { 'style' 'edit' 'string' num2str(tmprank) } }; + res = inputgui('uilist', uilist, 'geometry', { [1] [1] [1 1] }, 'geomvert', [6 1 1]); + if isempty(res), return; end; + tmprank = str2num(res{1}); + g.options = [g.options { 'pca' tmprank }]; + else + g.options = [g.options {'pca' tmprank }]; % automatic for STUDY (batch processing) + end; + disp(['Data rank (' int2str(tmprank) ') is smaller than the number of channels (' int2str(size(tmpdata,1)) ').']); + [EEG.icaweights,EEG.icasphere] = runica( tmpdata, 'lrate', 0.001, g.options{:} ); + end; + case 'binica' + icadefs; + fprintf(['Warning: If the binary ICA function does not work, check that you have added the\n' ... + 'binary file location (in the EEGLAB directory) to your Unix /bin directory (.cshrc file)\n']); + if exist(ICABINARY) ~= 2 + error('Pop_runica(): binary ICA executable not found. Edit icadefs.m file to specify the ICABINARY location'); + end; + tmprank = getrank(tmpdata(:,1:min(3000, size(tmpdata,2)))); + if tmprank == size(tmpdata,1) | pca_opt + [EEG.icaweights,EEG.icasphere] = binica( tmpdata, 'lrate', 0.001, g.options{:} ); + else + disp(['Data rank (' int2str(tmprank) ') is smaller than the number of channels (' int2str(size(tmpdata,1)) ').']); + [EEG.icaweights,EEG.icasphere] = binica( tmpdata, 'lrate', 0.001, 'pca', tmprank, g.options{:} ); + end; + case 'amica' + tmprank = getrank(tmpdata(:,1:min(3000, size(tmpdata,2)))); + fprintf('Now Running AMICA\n'); + if length(g.options) > 1 + if isstr(g.options{2}) + fprintf('See folder %s for outputs\n', g.options{2}); + end; + end; + fprintf('To import results, use menu item "Tools > Run AMICA > Load AMICA components\n'); + modres = runamica( tmpdata, [], size(tmpdata,1), size(tmpdata,2), g.options{:} ); + if ~isempty(modres) + EEG.icaweights = modres.W; + EEG.icasphere = modres.S; + else + return; + end; + case 'pearson_ica' + if isempty(g.options) + disp('Warning: EEGLAB default for pearson ICA is 1000 iterations and epsilon=0.0005'); + [tmp EEG.icaweights] = pearson_ica( tmpdata, 'maxNumIterations', 1000,'epsilon',0.0005); + else + [tmp EEG.icaweights] = pearson_ica( tmpdata, g.options{:}); + end; + case 'egld_ica', disp('Warning: This algorithm is very slow!!!'); + [tmp EEG.icaweights] = egld_ica( tmpdata, g.options{:} ); + case 'tfbss' + if isempty(g.options) + [tmp EEG.icaweights] = tfbss( tmpdata, size(tmpdata,1), 8, 512 ); + else + [tmp EEG.icaweights] = tfbss( tmpdata, g.options{:} ); + end; + case 'jader', [EEG.icaweights] = jader( tmpdata, g.options{:} ); + case 'matlabshibbsr', [EEG.icaweights] = MatlabshibbsR( tmpdata, g.options{:} ); + case 'eea', [EEG.icaweights] = eeA( tmpdata, g.options{:} ); + case 'icaml', [tmp EEG.icawinv] = icaML( tmpdata, g.options{:} ); + case 'icams', [tmp EEG.icawinv] = icaMS( tmpdata, g.options{:} ); + case 'fastica', [ ICAcomp, EEG.icawinv, EEG.icaweights] = fastica( tmpdata, 'displayMode', 'off', g.options{:} ); + case { 'tica' 'erica' 'simbec' 'unica' 'amuse' 'fobi' 'evd' 'sons' ... + 'jadeop' 'jade_td_p' 'evd24' 'sobi' 'ng_ol' 'acsobiro' 'acrsobibpf' } + fig = figure('tag', 'alg_is_run', 'visible', 'off'); + + if isempty(g.options), g.options = { size(tmpdata,1) }; end; + switch lower(g.icatype) + case 'tica', EEG.icaweights = tica( tmpdata, g.options{:} ); + case 'erica', EEG.icaweights = erica( tmpdata, g.options{:} ); + case 'simbec', EEG.icaweights = simbec( tmpdata, g.options{:} ); + case 'unica', EEG.icaweights = unica( tmpdata, g.options{:} ); + case 'amuse', EEG.icaweights = amuse( tmpdata ); + case 'fobi', [tmp EEG.icaweights] = fobi( tmpdata, g.options{:} ); + case 'evd', EEG.icaweights = evd( tmpdata, g.options{:} ); + case 'sons', EEG.icaweights = sons( tmpdata, g.options{:} ); + case 'jadeop', EEG.icaweights = jadeop( tmpdata, g.options{:} ); + case 'jade_td_p',EEG.icaweights = jade_td_p( tmpdata, g.options{:} ); + case 'evd24', EEG.icaweights = evd24( tmpdata, g.options{:} ); + case 'sobi', EEG.icawinv = sobi( tmpdata, g.options{:} ); + case 'ng_ol', [tmp EEG.icaweights] = ng_ol( tmpdata, g.options{:} ); + case 'acsobiro', EEG.icawinv = acsobiro( tmpdata, g.options{:} ); + case 'acrsobibpf', EEG.icawinv = acrsobibpf( tmpdata, g.options{:} ); + end; + clear tmp; + close(fig); + otherwise, error('Pop_runica: unrecognized algorithm'); +end; + +% update weight and inverse matrices etc... +% ----------------------------------------- +if ~isempty(fig), try, close(fig); catch, end; end; +if isempty(EEG.icaweights) + EEG.icaweights = pinv(EEG.icawinv); +end; +if isempty(EEG.icasphere) + EEG.icasphere = eye(size(EEG.icaweights,2)); +end; +if isempty(EEG.icawinv) + EEG.icawinv = pinv(EEG.icaweights*EEG.icasphere); % a priori same result as inv +end; + +% copy back data to datasets if necessary +% --------------------------------------- +if length(g.dataset) > 1 + for i = g.dataset + ALLEEG(i).icaweights = EEG.icaweights; + ALLEEG(i).icasphere = EEG.icasphere; + ALLEEG(i).icawinv = EEG.icawinv; + ALLEEG(i).icachansind = g.chanind; + end; + ALLEEG = eeg_checkset(ALLEEG); +else + EEG = eeg_checkset(EEG); + ALLEEG = eeg_store(ALLEEG, EEG, g.dataset); +end; + +if nargin < 2 || selectamica + com = sprintf('%s = pop_runica(%s, %s);', inputname(1), inputname(1), vararg2str(g.options) ); %vararg2str({ 'icatype' g.icatype 'dataset' g.dataset 'options' g.options }) ); +end; + +return; + +function tmprank2 = getrank(tmpdata); + + tmprank = rank(tmpdata); + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %Here: alternate computation of the rank by Sven Hoffman + %tmprank = rank(tmpdata(:,1:min(3000, size(tmpdata,2)))); old code + covarianceMatrix = cov(tmpdata', 1); + [E, D] = eig (covarianceMatrix); + rankTolerance = 1e-7; + tmprank2=sum (diag (D) > rankTolerance); + if tmprank ~= tmprank2 + fprintf('Warning: fixing rank computation inconsistency (%d vs %d) most likely because running under Linux 64-bit Matlab\n', tmprank, tmprank2); + tmprank2 = max(tmprank, tmprank2); + end; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_runscript.m b/code/eeglab13_4_4b/functions/popfunc/pop_runscript.m new file mode 100644 index 0000000..118ed4b --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_runscript.m @@ -0,0 +1,44 @@ +% pop_runscript() - Run Matlab script +% +% Usage: >> pop_runscript; +% >> pop_runscript( filename ); +% +% Input: +% filename - [string] name of the file. +% +% Author: Arnaud Delorme, SCCN / INC / UCSD, August 2009 + +% Copyright (C) Arnaud Delorme, August 2009 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function com = pop_runscript(filename); + +com = []; +if nargin <1 + [filename filepath] = uigetfile('*.*', 'Please select input script -- pop_runscript()'); + + if filename(1) == 0, return; end; + + filename = fullfile(filepath, filename); +end; + +str = readtxtfile(filename); +try + evalin('base', str); +catch + lasterr +end; +com = sprintf('pop_runscript(''%s'');', filename); diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_saveh.m b/code/eeglab13_4_4b/functions/popfunc/pop_saveh.m new file mode 100644 index 0000000..591ba39 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_saveh.m @@ -0,0 +1,76 @@ +% pop_saveh() - save the EEGLAB session command history stored in ALLCOM +% or in the 'history' field of the current dataset +% +% Usage: +% >> pop_saveh( ALLCOM, filename, filepath); +% >> pop_saveh( EEG.history, filename, filepath); +% +% Inputs: +% ALLCOM - cell array of strings containing the EEGLAB command history +% EEG.history - history field of the current dataset +% filename - name of the file to save to (optional, default "eeglabhist.m" +% filepath - path of the file to save to (optional, default pwd) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 22 March 2002 +% +% See also: eegh(), eeglab() + +% Copyright (C) 22 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-29-02 added update menu -ad + +function com = pop_saveh( allcoms, curfilename, curfilepath); + +com = ''; +if nargin < 1 + help pop_saveh; + return; +end; + +if nargin < 3 + [curfilename, curfilepath] = uiputfile('eeglabhist.m', 'Save the EEGLAB session command history with .m extension -- pop_saveh()'); + drawnow; + if curfilename == 0 return; end; +end; + + +fid = fopen( [ curfilepath '/' curfilename ], 'w'); +if fid == -1 + error('pop_saveh(): Cannot open named file'); +end; +fprintf(fid, '%% EEGLAB history file generated on the %s\n', date); +fprintf(fid, '%% ------------------------------------------------\n'); +if iscell(allcoms) + disp('Saving the EEGLAB session command history...'); + for index = length(allcoms):-1:1 + fprintf(fid, '%s\n', allcoms{index}); + end; + fprintf(fid, 'eeglab redraw;\n'); +else + disp('Saving the current EEG dataset command history...'); + fprintf(fid, '%s\n', allcoms); +end; +fclose(fid); + +if iscell(allcoms) + com = sprintf('pop_saveh( %s, ''%s'', ''%s'');', inputname(1), curfilename, curfilepath); +else + com = sprintf('pop_saveh( EEG.history, ''%s'', ''%s'');', curfilename, curfilepath); +end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_saveset.m b/code/eeglab13_4_4b/functions/popfunc/pop_saveset.m new file mode 100644 index 0000000..b5b007c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_saveset.m @@ -0,0 +1,329 @@ +% pop_saveset() - save one or more EEG dataset structures +% +% Usage: +% >> pop_saveset( EEG ); % use an interactive pop-up window +% >> EEG = pop_saveset( EEG, 'key', 'val', ...); % no pop-up +% +% Inputs: +% EEG - EEG dataset structure. May only contain one dataset. +% +% Optional inputs: +% 'filename' - [string] name of the file to save to +% 'filepath' - [string] path of the file to save to +% 'check' - ['on'|'off'] perform extended syntax check. Default 'off'. +% 'savemode' - ['resave'|'onefile'|'twofiles'] 'resave' resave the +% current dataset using the filename and path stored +% in the dataset; 'onefile' saves the full EEG +% structure in a Matlab '.set' file, 'twofiles' saves +% the structure without the data in a Matlab '.set' file +% and the transposed data in a binary float '.dat' file. +% By default the option from the eeg_options.m file is +% used. +% 'version' - ['6'|'7.3'] save Matlab file as version 6 or +% '7.3' (default; as defined in eeg_option file). +% +% Outputs: +% EEG - saved dataset (after extensive syntax checks) +% ALLEEG - saved datasets (after extensive syntax checks) +% +% Note: An individual dataset should be saved with a '.set' file extension +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_loadset(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [EEG, com] = pop_saveset( EEG, varargin); + +com = ''; +if nargin < 1 + help pop_saveset; + return; +end; +if isempty(EEG) , error('Cannot save empty datasets'); end; + +% empty filename (resave file) +emptyfilename = 0; +if nargin > 1 + if isempty(varargin{1}) && isempty(EEG.filename), emptyfilename = 1; end; + if strcmpi(varargin{1},'savemode') + if length(EEG) == 1 + if isempty(EEG(1).filename), varargin{2} = ''; emptyfilename = 1; end; + else + if any(cellfun(@isempty, { EEG.filename })) + error('Cannot resave files who have not been saved previously'); + end; + end; + end; +end; + +if nargin < 2 || emptyfilename + if length(EEG) >1, error('For reasons of consistency, this function does not save multiple datasets any more'); end; + % pop up window to ask for file + [filename, filepath] = uiputfile2('*.set', 'Save dataset with .set extension -- pop_saveset()'); + if ~isstr(filename), return; end; + drawnow; + options = { 'filename' filename 'filepath' filepath }; +else + % account for old calling format + % ------------------------------ + if isempty(strmatch( lower(varargin{1}), { 'filename' 'filepath' 'savemode' 'check' })) + options = { 'filename' varargin{1} }; + if nargin > 2 + options = { options{:} 'filepath' varargin{2} }; + end; + else + options = varargin; + end; +end; + +% decode input parameters +% ----------------------- +eeglab_options; +defaultSave = fastif(option_saveversion6, '6', '7.3'); +g = finputcheck(options, { 'filename' 'string' [] ''; + 'filepath' 'string' [] ''; + 'version' 'string' { '6','7.3' } defaultSave; + 'check' 'string' { 'on','off' } 'off'; + 'savemode' 'string' { 'resave','onefile','twofiles','' } '' }); +if isstr(g), error(g); end; + +% current filename without the .set +% --------------------------------- +if emptyfilename == 1, g.savemode = ''; end; +[g.filepath filenamenoext ext] = fileparts( fullfile(g.filepath, g.filename) ); ext = '.set'; +g.filename = [ filenamenoext ext ]; + +% performing extended syntax check +% -------------------------------- +if strcmpi(g.check, 'on') + fprintf('Pop_saveset: Performing extended dataset syntax check...\n'); + EEG = eeg_checkset(EEG, 'eventconsistency'); + EEG = eeg_checkset(EEG); +else + EEG = eeg_checkset(EEG); +end + +% check for change in saving mode +% ------------------------------- +if length(EEG) == 1 + if strcmpi(g.savemode, 'resave') && isfield(EEG, 'datfile') && ~option_savetwofiles + disp('Note that your memory options for saving datasets does not correspond') + disp('to the format of the datasets on disk (ignoring memory options)') +% $$$ but = questdlg2(strvcat('This dataset has an associated ''.dat'' file, but since you have', ... +% $$$ 'changed of saving mode, all the data will now be saved within the', ... +% $$$ 'Matlab file and the ''.dat'' file will be deleted.', ... +% $$$ '(Note: Just press ''No'' if you do not know what you are doing)'), ... +% $$$ 'Warning: saving mode changed', 'Cancel', 'No, save as before', 'Yes, do it', 'Yes, do it'); +% $$$ switch but +% $$$ case 'Cancel', return; +% $$$ case 'No, save as before', % nothing +% $$$ case 'Yes, do it', g.savemode = 'onefile'; +% $$$ end; +% $$$ g.filename = EEG.filename; +% $$$ g.filepath = EEG.filepath; + elseif strcmpi(g.savemode, 'resave') && ~isfield(EEG, 'datfile') && option_savetwofiles + disp('Note that your memory options for saving datasets does not correspond') + disp('to the format of the datasets on disk (ignoring memory options)') +% $$$ but = questdlg2(strvcat('This dataset does not have yet an associated ''.dat'' file, but since you have', ... +% $$$ 'changed of saving mode, all the data will now be saved within the ''.dat''', ... +% $$$ 'file and not in the Matlab file (as it is currently the case).', ... +% $$$ '(Note: Just press ''No'' if you do not know what you are doing)'), ... +% $$$ 'Warning: saving mode changed', 'Cancel', 'No, save as before', 'Yes, do it', 'Yes, do it'); +% $$$ switch but +% $$$ case 'Cancel', return; +% $$$ case 'No, save as before', % nothing +% $$$ case 'Yes, do it', g.savemode = 'twofiles'; +% $$$ end; +% $$$ g.filename = EEG.filename; +% $$$ g.filepath = EEG.filepath; + end; +end; + +% default saving otion +% -------------------- +save_as_dat_file = 0; +data_on_disk = 0; +if strcmpi(g.savemode, 'resave') + % process multiple datasets + % ------------------------- + if length(EEG) > 1 + for index = 1:length(EEG) + pop_saveset(EEG(index), 'savemode', 'resave'); + EEG(index).saved = 'yes'; + end; + com = sprintf('%s = pop_saveset( %s, %s);', inputname(1), inputname(1), vararg2str(options)); + return; + end; + + if strcmpi( EEG.saved, 'yes'), disp('Dataset has not been modified; No need to resave it.'); return; end; + g.filename = EEG.filename; + g.filepath = EEG.filepath; + if isfield(EEG, 'datfile') + if ~isempty(EEG.datfile) + save_as_dat_file = 1; + end; + end; + if isstr(EEG.data) & ~save_as_dat_file % data in .set file + TMP = pop_loadset(EEG.filename, EEG.filepath); + EEG.data = TMP.data; + data_on_disk = 1; + end; +else + if length(EEG) >1, error('For reasons of consistency, this function does not save multiple datasets any more'); end; + if ~strcmpi(EEG.filename, g.filename) | ~strcmpi(EEG.filepath, g.filepath) + EEG.datfile = ''; + end; + EEG.filename = g.filename; + EEG.filepath = g.filepath; + if isempty(g.savemode) + if option_savematlab, g.savemode = 'onefile'; + else g.savemode = 'twofiles'; + end; + end; + if strcmpi(g.savemode, 'twofiles') + save_as_dat_file = 1; + EEG.datfile = [ filenamenoext '.fdt' ]; + end; +end; + +% Saving data as float and Matlab +% ------------------------------- +tmpica = EEG.icaact; +EEG.icaact = []; +if ~isstr(EEG.data) + if ~strcmpi(class(EEG.data), 'memmapdata') && ~strcmpi(class(EEG.data), 'mmo') && ~strcmpi(class(EEG.data), 'single') + tmpdata = single(reshape(EEG.data, EEG.nbchan, EEG.pnts*EEG.trials)); + else + tmpdata = EEG.data; + end; + no_resave_dat = 'no'; +else + no_resave_dat = 'yes'; +end; +v = version; +try, + fprintf('Saving dataset...\n'); + EEG.saved = 'yes'; + if save_as_dat_file + if ~isstr(EEG.data) + EEG.data = EEG.datfile; + tmpdata = floatwrite( tmpdata, fullfile(EEG.filepath, EEG.data), 'ieee-le'); + end; + else + if isfield(EEG, 'datfile') + if ~isempty(EEG.datfile) + if exist(fullfile(EEG.filepath, EEG.datfile)) + try, + delete(fullfile(EEG.filepath, EEG.datfile)); + disp('Deleting .dat/.fdt file on disk (all data is within the Matlab file)'); + catch, end; + end; + end; + EEG.datfile = []; + end; + end; + + try + if strcmpi(g.version, '6') save(fullfile(EEG.filepath, EEG.filename), '-v6', '-mat', 'EEG'); + else save(fullfile(EEG.filepath, EEG.filename), '-v7.3', '-mat', 'EEG'); + end; + catch + save(fullfile(EEG.filepath, EEG.filename), '-mat', 'EEG'); + end; + if save_as_dat_file & strcmpi( no_resave_dat, 'no' ) + EEG.data = tmpdata; + end; + + % save ICA activities + % ------------------- +% icafile = fullfile(EEG.filepath, [EEG.filename(1:end-4) '.icafdt' ]); +% if isempty(EEG.icaweights) & exist(icafile) +% disp('ICA activation file found on disk, but no more ICA activities. Deleting file.'); +% delete(icafile); +% end; +% if ~option_saveica & exist(icafile) +% disp('Options indicate not to save ICA activations. Deleting ICA activation file.'); +% delete(icafile); +% end; +% if option_saveica & ~isempty(EEG.icaweights) +% if ~exist('tmpdata') +% TMP = eeg_checkset(EEG, 'loaddata'); +% tmpdata = TMP.data; +% end; +% if isempty(tmpica) +% tmpica2 = (EEG.icaweights*EEG.icasphere)*tmpdata(EEG.icachansind,:); +% else tmpica2 = tmpica; +% end; +% tmpica2 = reshape(tmpica2, size(tmpica2,1), size(tmpica2,2)*size(tmpica2,3)); +% floatwrite( tmpica2, icafile, 'ieee-le'); +% clear tmpica2; +% end; + +catch, + rethrow(lasterror); +end; + +% try to delete old .fdt or .dat files +% ------------------------------------ +tmpfilename = fullfile(EEG.filepath, [ filenamenoext '.dat' ]); +if exist(tmpfilename) == 2 + disp('Deleting old .dat file format detected on disk (now replaced by .fdt file)'); + try, + delete(tmpfilename); + disp('Delete sucessfull.'); + catch, disp('Error while attempting to remove file'); + end; +end; +if save_as_dat_file == 0 + tmpfilename = fullfile(EEG.filepath, [ filenamenoext '.fdt' ]); + if exist(tmpfilename) == 2 + disp('Old .fdt file detected on disk, deleting file the Matlab file contains all data...'); + try, + delete(tmpfilename); + disp('Delete sucessfull.'); + catch, disp('Error while attempting to remove file'); + end; + end; +end; + +% recovering variables +% -------------------- +EEG.icaact = tmpica; +if data_on_disk + EEG.data = 'in set file'; +end; +if isnumeric(EEG.data) && v(1) < 7 + EEG.data = double(reshape(tmpdata, EEG.nbchan, EEG.pnts, EEG.trials)); +end; +EEG.saved = 'justloaded'; + +com = sprintf('%s = pop_saveset( %s, %s);', inputname(1), inputname(1), vararg2str(options)); +return; + +function num = popask( text ) + ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); + switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; + end; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_select.m b/code/eeglab13_4_4b/functions/popfunc/pop_select.m new file mode 100644 index 0000000..8db48ba --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_select.m @@ -0,0 +1,667 @@ +% pop_select() - given an input EEG dataset structure, output a new EEG data structure +% retaining and/or excluding specified time/latency, data point, channel, +% and/or epoch range(s). +% Usage: +% >> OUTEEG = pop_select(INEEG, 'key1', value1, 'key2', value2 ...); +% +% Graphic interface: +% "Time range" - [edit box] RETAIN only the indicated epoch latency or continuous data +% time range: [low high] in ms, inclusive. For continuous data, several +% time ranges may be specified, separated by semicolons. +% Example: "5 10; 12 EEG.xmax" will retain the indicated +% stretches of continuous data, and remove data portions outside +% the indicated ranges, e.g. from 0 s to 5 s and from 10 s to 12 s. +% Command line equivalent: 'time' (or 'notime' - see below) +% "Time range" - [checkbox] EXCLUDE the indicated latency range(s) from the data. +% For epoched data, it is not possible to remove a range of latencies +% from the middle of the epoch, so either the low and/or the high values +% in the specified latency range (see above) must be at an epoch boundary +% (EEG.xmin, EEGxmax). Command line equivalent: [if checked] 'notime' +% "Point range" - [edit box] RETAIN the indicated data point range(s). +% Same options as for the "Time range" features (above). +% Command line equivalent: 'point' (or 'nopoint' - see below). +% "Point range" - [checkbox] EXCLUDE the indicated point range(s). +% Command line equivalent: [if checked] 'nopoint' +% "Epoch range" - [edit box] RETAIN the indicated data epoch indices in the dataset. +% This checkbox is only visible for epoched datasets. +% Command line equivalent: 'trial' (or 'notrial' - see below) +% "Epoch range" - [checkbox] EXCLUDE the specified data epochs. +% Command line equivalent: [if checked] 'notrial' +% "Channel range" - [edit box] RETAIN the indicated vector of data channels +% Command line equivalent: 'channel' (or 'nochannel' - see below) +% "Channel range" - [checkbox] EXCLUDE the indicated channels. +% Command line equivalent: [if checked] 'nochannel' +% "..." - [button] select channels by name. +% "Scroll dataset" - [button] call the eegplot() function to scroll the +% channel activities in a new window for visual inspection. +% Commandline equivalent: eegplot() - see its help for details. +% Inputs: +% INEEG - input EEG dataset structure +% +% Optional inputs +% 'time' - [min max] in seconds. Epoch latency or continuous data time range +% to retain in the new dataset, (Note: not ms, as in the GUI text entry +% above). For continuous data (only), several time ranges can be specified, +% separated by semicolons. Example: "5 10; 12 EEG.xmax" will retain +% the indicated times ranges, removing data outside the indicated ranges +% e.g. here from 0 to 5 s and from 10 s to 12 s. (See also, 'notime') +% 'notime' - [min max] in seconds. Epoch latency or continuous dataset time range +% to exclude from the new dataset. For continuous data, may be +% [min1 max1; min2 max2; ...] to exclude several time ranges. For epoched +% data, the latency range must include an epoch boundary, as latency +% ranges in the middle of epochs cannot be removed from epoched data. +% 'point' - [min max] epoch or continuous data point range to retain in the new +% dataset. For continuous datasets, this may be [min1 max1; min2 max2; ...] +% to retain several point ranges. (Notes: If both 'point'/'nopoint' and +% 'time' | 'notime' are specified, the 'point' limit values take precedence. +% The 'point' argument was originally a point vector, now deprecated). +% 'nopoint' - [min max] epoch or continuous data point range to exclude in the new dataset. +% For epoched data, the point range must include either the first (0) +% or the last point (EEG.pnts), as a central point range cannot be removed. +% 'trial' - array of trial indices to retain in the new dataset +% 'notrial' - array of trial indices to exclude from the new dataset +% 'sorttrial' - ['on'|'off'] sort trial indices before extracting them (default: 'on'). +% 'channel' - vector of channel indices to retain in the new +% dataset. Can also be a cell array of channel names. +% 'nochannel' - vector of channel indices to exclude from the new +% dataset. Can also be a cell array of channel names. +% 'newname' - name for the new dataset (OUTEEG) +% +% Outputs: +% OUTEEG - new EEG dataset structure +% +% Note: This function performs a conjunction (AND) of all its optional inputs. +% Using negative counterparts of all options, any logical combination is +% possible. +% +% Author: Arnaud Delorme, CNL/Salk Institute, 2001; SCCN/INC/UCSD, 2002- +% +% see also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 01-26-02 changed the format for events and trial conditions -ad +% 02-04-02 changed display format and allow for negation of inputs -ad +% 02-17-02 removed the event removal -ad +% 03-17-02 added channel info subsets selection -ad +% 03-21-02 added event latency recalculation -ad + +function [EEG, com] = pop_select( EEG, varargin); + +com = ''; +if nargin < 1 + help pop_select; + return; +end; +if isempty(EEG(1).data) + disp('Pop_select error: cannot process empty dataset'); return; +end; + +if nargin < 2 + geometry = { [1 1 1] [1 1 0.25 0.23 0.51] [1 1 0.25 0.23 0.51] [1 1 0.25 0.23 0.51] ... + [1 1 0.25 0.23 0.51] [1] [1 1 1]}; + uilist = { ... + { 'Style', 'text', 'string', 'Select data in:', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Input desired range', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'on->remove these', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Time range [min max] (s)', 'fontangle', fastif(length(EEG)>1, 'italic', 'normal') }, ... + { 'Style', 'edit', 'string', '', 'enable', fastif(length(EEG)>1, 'off', 'on') }, ... + { }, { 'Style', 'checkbox', 'string', ' ', 'enable', fastif(length(EEG)>1, 'off', 'on') },{ }, ... + ... + { 'Style', 'text', 'string', 'Point range (ex: [1 10])', 'fontangle', fastif(length(EEG)>1, 'italic', 'normal') }, ... + { 'Style', 'edit', 'string', '', 'enable', fastif(length(EEG)>1, 'off', 'on') }, ... + { }, { 'Style', 'checkbox', 'string', ' ', 'enable', fastif(length(EEG)>1, 'off', 'on') },{ }, ... + ... + { 'Style', 'text', 'string', 'Epoch range (ex: 3:2:10)', 'fontangle', fastif(length(EEG)>1, 'italic', 'normal') }, ... + { 'Style', 'edit', 'string', '', 'enable', fastif(length(EEG)>1, 'off', 'on') }, ... + { }, { 'Style', 'checkbox', 'string', ' ', 'enable', fastif(length(EEG)>1, 'off', 'on') },{ }, ... + ... + { 'Style', 'text', 'string', 'Channel range' }, ... + { 'Style', 'edit', 'string', '', 'tag', 'chans' }, ... + { }, { 'Style', 'checkbox', 'string', ' ' }, ... + { 'style' 'pushbutton' 'string' '...', 'enable' fastif(isempty(EEG.chanlocs), 'off', 'on') ... + 'callback' 'tmpchanlocs = EEG(1).chanlocs; [tmp tmpval] = pop_chansel({tmpchanlocs.labels}, ''withindex'', ''on''); set(findobj(gcbf, ''tag'', ''chans''), ''string'',tmpval); clear tmp tmpchanlocs tmpval' }, ... + { }, { }, { 'Style', 'pushbutton', 'string', 'Scroll dataset', 'enable', fastif(length(EEG)>1, 'off', 'on'), 'callback', ... + 'eegplot(EEG.data, ''srate'', EEG.srate, ''winlength'', 5, ''limits'', [EEG.xmin EEG.xmax]*1000, ''position'', [100 300 800 500], ''xgrid'', ''off'', ''eloc_file'', EEG.chanlocs);' } {}}; + results = inputgui( geometry, uilist, 'pophelp(''pop_select'');', 'Select data -- pop_select()' ); + if length(results) == 0, return; end; + + + % decode inputs + % ------------- + args = {}; + if ~isempty( results{1} ) + if ~results{2}, args = { args{:}, 'time', eval( [ '[' results{1} ']' ] ) }; + else args = { args{:}, 'notime', eval( [ '[' results{1} ']' ] ) }; end; + end; + + if ~isempty( results{3} ) + if ~results{4}, args = { args{:}, 'point', eval( [ '[' results{3} ']' ] ) }; + else args = { args{:}, 'nopoint', eval( [ '[' results{3} ']' ] ) }; end; + end; + + if ~isempty( results{5} ) + if ~results{6}, args = { args{:}, 'trial', eval( [ '[' results{5} ']' ] ) }; + else args = { args{:}, 'notrial', eval( [ '[' results{5} ']' ] ) }; end; + end; + + if ~isempty( results{7} ) + [ chaninds chanlist ] = eeg_decodechan(EEG.chanlocs, results{7}); + if isempty(chanlist), chanlist = chaninds; end; + if ~results{8}, args = { args{:}, 'channel' , chanlist }; + else args = { args{:}, 'nochannel', chanlist }; end; + end; + +else + args = varargin; +end; + +%----------------------------AMICA--------------------------------- +if isfield(EEG.etc,'amica') && isfield(EEG.etc.amica,'prob_added') + for index = 1:2:length(args) + if strcmpi(args{index}, 'channel') + args{index+1} = [ args{index+1} EEG.nbchan-(0:2*EEG.etc.amica.num_models-1)]; + + end; + + + end; +end; +%-------------------------------------------------------------------- + +% process multiple datasets +% ------------------------- +if length(EEG) > 1 + [ EEG com ] = eeg_eval( 'pop_select', EEG, 'warning', 'on', 'params', args); + return; +end; + +if isempty(EEG.chanlocs), chanlist = [1:EEG.nbchan]; +else chanlocs = EEG.chanlocs; chanlist = { chanlocs.labels }; +end; +g = finputcheck(args, { 'time' 'real' [] []; ... + 'notime' 'real' [] []; ... + 'trial' 'integer' [] [1:EEG.trials]; ... + 'notrial' 'integer' [] []; ... + 'point' 'integer' [] []; ... + 'nopoint' 'integer' [] []; ... + 'channel' { 'integer','cell' } [] chanlist; + 'nochannel' { 'integer','cell' } [] []; + 'trialcond' 'integer' [] []; ... + 'notrialcond' 'integer' [] []; ... + 'sort' 'integer' [] []; ... + 'sorttrial' 'string' { 'on','off' } 'on' }, 'pop_select'); +if isstr(g), error(g); end; +if ~isempty(g.sort) + if g.sort, g.sorttrial = 'on'; + else g.sorttrial = 'off'; + end; +end; +if strcmpi(g.sorttrial, 'on') + g.trial = sort(setdiff( g.trial, g.notrial )); + if isempty(g.trial), error('Error: dataset is empty'); end; +else + g.trial(ismember(g.trial,g.notrial)) = []; + % still warn about & remove duplicate trials (may be removed in the future) + [p,q] = unique_bc(g.trial); + if length(p) ~= length(g.trial) + disp('Warning: trial selection contained duplicated elements, which were removed.'); + end + g.trial = g.trial(sort(q)); +end + +if isempty(g.channel) && ~iscell(g.nochannel) && ~iscell(chanlist) + g.channel = [1:EEG.nbchan]; +end; + +if iscell(g.channel) && ~iscell(g.nochannel) && ~isempty(EEG.chanlocs) + noChannelAsCell = {}; + for nochanId = 1:length(g.nochannel) + noChannelAsCell{nochanId} = EEG.chanlocs(g.nochannel(nochanId)).labels; + end; + g.nochannel = noChannelAsCell; +end; + +if strcmpi(g.sorttrial, 'on') + if iscell(g.channel) + g.channel = sort(setdiff( lower(g.channel), lower(g.nochannel) )); + else g.channel = sort(setdiff( g.channel, g.nochannel )); + end; +else + g.channel(ismember(lower(g.channel),lower(g.nochannel))) = []; + % still warn about & remove duplicate channels (may be removed in the future) + [p,q] = unique_bc(g.channel); + if length(p) ~= length(g.channel) + disp('Warning: channel selection contained duplicated elements, which were removed.'); + end + g.channel = g.channel(sort(q)); +end + +if ~isempty(EEG.chanlocs) + if strcmpi(g.sorttrial, 'on') + g.channel = eeg_decodechan(EEG.chanlocs, g.channel); + else + % we have to protect the channel order against changes by eeg_decodechan + if iscell(g.channel) + % translate channel names into indices + [inds,names] = eeg_decodechan(EEG.chanlocs, g.channel); + % and sort the indices back into the original order of channel names + [tmp,I] = ismember_bc(lower(g.channel),lower(names)); + g.channel = inds(I); + end + end +end; + +if ~isempty(g.time) && (g.time(1) < EEG.xmin*1000) && (g.time(2) > EEG.xmax*1000) + error('Wrong time range'); +end; +if min(g.trial) < 1 || max( g.trial ) > EEG.trials + error('Wrong trial range'); +end; +if ~isempty(g.channel) + if min(double(g.channel)) < 1 || max(double(g.channel)) > EEG.nbchan + error('Wrong channel range'); + end; +end; + +if size(g.point,2) > 2, + g.point = [g.point(1) g.point(end)]; + disp('Warning: vector format for point range is deprecated'); +end; +if size(g.nopoint,2) > 2, + g.nopoint = [g.nopoint(1) g.nopoint(end)]; + disp('Warning: vector format for point range is deprecated'); +end; +if ~isempty( g.point ) + g.time = zeros(size(g.point)); + for index = 1:length(g.point(:)) + g.time(index) = eeg_point2lat(g.point(index), 1, EEG.srate, [EEG.xmin EEG.xmax]); + end; + g.notime = []; +end; +if ~isempty( g.nopoint ) + g.notime = zeros(size(g.nopoint)); + for index = 1:length(g.nopoint(:)) + g.notime(index) = eeg_point2lat(g.nopoint(index), 1, EEG.srate, [EEG.xmin EEG.xmax]); + end; + g.time = []; +end; +if ~isempty( g.notime ) + if size(g.notime,2) ~= 2 + error('Time/point range must contain 2 columns exactly'); + end; + if g.notime(2) == EEG.xmax + g.time = [EEG.xmin g.notime(1)]; + else + if g.notime(1) == EEG.xmin + g.time = [g.notime(2) EEG.xmax]; + elseif EEG.trials > 1 + error('Wrong notime range. Remember that it is not possible to remove a slice of time for data epochs.'); + end; + end; + if floor(max(g.notime(:))) > EEG.xmax || min(g.notime(:)) < EEG.xmin + error('Time/point range out of data limits'); + end; +end; +if ~isempty(g.time) + if size(g.time,2) ~= 2 + error('Time/point range must contain 2 columns exactly'); + end; + for index = 1:length(g.time) + if g.time(index) > EEG.xmax + g.time(index) = EEG.xmax; + disp('Upper time limits exceed data, corrected'); + elseif g.time(index) < EEG.xmin + g.time(index) = EEG.xmin; + disp('Lower time limits exceed data, corrected'); + end; + end; +end; + +% select trial values +%-------------------- +if ~isempty(g.trialcond) + try, tt = struct( g.trialcond{:} ); catch + error('Trial conditions format error'); + end; + ttfields = fieldnames (tt); + for index = 1:length(ttfields) + if ~isfield( EEG.epoch, ttfields{index} ) + error([ ttfields{index} 'is not a field of EEG.epoch' ]); + end; + tmpepoch = EEG.epoch; + eval( [ 'Itriallow = find( [ tmpepoch(:).' ttfields{index} ' ] >= tt.' ttfields{index} '(1) );' ] ); + eval( [ 'Itrialhigh = find( [ tmpepoch(:).' ttfields{index} ' ] <= tt.' ttfields{index} '(end) );' ] ); + Itrialtmp = intersect_bc(Itriallow, Itrialhigh); + g.trial = intersect_bc( g.trial(:)', Itrialtmp(:)'); + end; +end; + +if isempty(g.trial) + error('Empty dataset, no trial'); +end; +if length(g.trial) ~= EEG.trials + fprintf('Removing %d trial(s)...\n', EEG.trials - length(g.trial)); +end; +if length(g.channel) ~= EEG.nbchan + fprintf('Removing %d channel(s)...\n', EEG.nbchan - length(g.channel)); +end; + +try + % For AMICA probabilities... + %----------------------------------------------------- + if isfield(EEG.etc, 'amica') && ~isempty(EEG.etc.amica) && isfield(EEG.etc.amica, 'v_smooth') && ~isempty(EEG.etc.amica.v_smooth) && ~isfield(EEG.etc.amica,'prob_added') + if isfield(EEG.etc.amica, 'num_models') && ~isempty(EEG.etc.amica.num_models) + if size(EEG.data,2) == size(EEG.etc.amica.v_smooth,2) && size(EEG.data,3) == size(EEG.etc.amica.v_smooth,3) && size(EEG.etc.amica.v_smooth,1) == EEG.etc.amica.num_models + + EEG = eeg_formatamica(EEG); + + %------------------------------------------- + + [EEG com] = pop_select(EEG,args{:}); + + %------------------------------------------- + + EEG = eeg_reformatamica(EEG); + EEG = eeg_checkamica(EEG); + return; + else + disp('AMICA probabilities not compatible with size of data, probabilities cannot be rejected') + + disp('Resuming rejection...') + end + end + + end + % ------------------------------------------------------ +catch + warnmsg = strcat('your dataset contains amica information, but the amica plugin is not installed. Continuing and ignoring amica information.'); + warning(warnmsg) +end + + +% recompute latency and epoch number for events +% --------------------------------------------- +if length(g.trial) ~= EEG.trials & ~isempty(EEG.event) + if ~isfield(EEG.event, 'epoch') + disp('Pop_epoch warning: bad event format with epoch dataset, removing events'); + EEG.event = []; + else + if isfield(EEG.event, 'epoch') + keepevent = []; + for indexevent = 1:length(EEG.event) + newindex = find( EEG.event(indexevent).epoch == g.trial );% For AMICA probabilities... + %----------------------------------------------------- + try + if isfield(EEG.etc, 'amica') && ~isempty(EEG.etc.amica) && isfield(EEG.etc.amica, 'v_smooth') && ~isempty(EEG.etc.amica.v_smooth) && ~isfield(EEG.etc.amica,'prob_added') + if isfield(EEG.etc.amica, 'num_models') && ~isempty(EEG.etc.amica.num_models) + if size(EEG.data,2) == size(EEG.etc.amica.v_smooth,2) && size(EEG.data,3) == size(EEG.etc.amica.v_smooth,3) && size(EEG.etc.amica.v_smooth,1) == EEG.etc.amica.num_models + + EEG = eeg_formatamica(EEG); + + %------------------------------------------- + + [EEG com] = pop_select(EEG,args{:}); + + %------------------------------------------- + + EEG = eeg_reformatamica(EEG); + EEG = eeg_checkamica(EEG); + return; + else + disp('AMICA probabilities not compatible with size of data, probabilities cannot be rejected') + + disp('Resuming rejection...') + end + end + + end + catch + warnmsg = strcat('your dataset contains amica information, but the amica plugin is not installed. Continuing and ignoring amica information.'); + warning(warnmsg) + end; + % ------------------------------------------------------ + + if ~isempty(newindex) + keepevent = [keepevent indexevent]; + if isfield(EEG.event, 'latency') + EEG.event(indexevent).latency = EEG.event(indexevent).latency - (EEG.event(indexevent).epoch-1)*EEG.pnts + (newindex-1)*EEG.pnts; + end; + EEG.event(indexevent).epoch = newindex; + end; + end; + diffevent = setdiff_bc([1:length(EEG.event)], keepevent); + if ~isempty(diffevent) + disp(['Pop_select: removing ' int2str(length(diffevent)) ' unreferenced events']); + EEG.event(diffevent) = []; + end; + end; + end; +end; + + +% performing removal +% ------------------ +if ~isempty(g.time) | ~isempty(g.notime) + if EEG.trials > 1 + % select new time window + % ---------------------- + try, tmpevent = EEG.event; + tmpeventlatency = [ tmpevent.latency ]; + catch, tmpeventlatency = []; + end; + alllatencies = 1-(EEG.xmin*EEG.srate); % time 0 point + alllatencies = linspace( alllatencies, EEG.pnts*(EEG.trials-1)+alllatencies, EEG.trials); + [EEG.data tmptime indices epochevent]= epoch(EEG.data, alllatencies, ... + [g.time(1) g.time(2)]*EEG.srate, 'allevents', tmpeventlatency); + tmptime = tmptime/EEG.srate; + if g.time(1) ~= tmptime(1) & g.time(2)-1/EEG.srate ~= tmptime(2) + fprintf('pop_select(): time limits have been adjusted to [%3.3f %3.3f] to fit data points limits\n', tmptime(1), tmptime(2)+1/EEG.srate); + end; + EEG.xmin = tmptime(1); + EEG.xmax = tmptime(2); + EEG.pnts = size(EEG.data,2); + alllatencies = alllatencies(indices); + + % modify the event structure accordingly (latencies and add epoch field) + % ---------------------------------------------------------------------- + allevents = []; + newevent = []; + count = 1; + if ~isempty(epochevent) + newevent = EEG.event(1); + for index=1:EEG.trials + for indexevent = epochevent{index} + newevent(count) = EEG.event(indexevent); + newevent(count).epoch = index; + newevent(count).latency = newevent(count).latency - alllatencies(index) - tmptime(1)*EEG.srate + 1 + EEG.pnts*(index-1); + count = count + 1; + end; + end; + end; + EEG.event = newevent; + + % erase event-related fields from the epochs + % ------------------------------------------ + if ~isempty(EEG.epoch) + fn = fieldnames(EEG.epoch); + EEG.epoch = rmfield(EEG.epoch,{fn{strmatch('event',fn)}}); + end; + else + if isempty(g.notime) + if length(g.time) == 2 && EEG.xmin < 0 + disp('Warning: negative minimum time; unchanged to ensure correct latency of initial boundary event'); + end; + g.notime = g.time'; + g.notime = g.notime(:); + if g.notime(1) ~= 0, g.notime = [EEG.xmin g.notime(:)']; + else g.notime = [g.notime(2:end)']; + end; + if g.time(end) == EEG.xmax, g.notime(end) = []; + else g.notime(end+1) = EEG.xmax; + end; + + for index = 1:length(g.notime) + if g.notime(index) ~= 0 & g.notime(index) ~= EEG.xmax + if mod(index,2), g.notime(index) = g.notime(index) + 1/EEG.srate; + else g.notime(index) = g.notime(index) - 1/EEG.srate; + end; + end; + end; + g.notime = reshape(g.notime, 2, length(g.notime)/2)'; + end; + + nbtimes = length(g.notime(:)); + [points,flag] = eeg_lat2point(g.notime(:)', ones(1,nbtimes), EEG.srate, [EEG.xmin EEG.xmax]); + points = reshape(points, size(g.notime)); + + % fixing if last region is the same + if flag + if ~isempty(find((points(end,1)-points(end,2))== 0)), points(end,:) = []; end; + end + + EEG = eeg_eegrej(EEG, points); + end +end; + +% performing removal +% ------------------ +if ~isequal(g.channel,1:size(EEG.data,1)) || ~isequal(g.trial,1:size(EEG.data,3)) + %EEG.data = EEG.data(g.channel, :, g.trial); + % this code belows is prefered for memory mapped files + diff1 = setdiff_bc([1:size(EEG.data,1)], g.channel); + diff2 = setdiff_bc([1:size(EEG.data,3)], g.trial); + if ~isempty(diff1) + EEG.data(diff1, :, :) = []; + end; + if ~isempty(diff2) + EEG.data(:, :, diff2) = []; + end; +end +if ~isempty(EEG.icaact), EEG.icaact = EEG.icaact(:,:,g.trial); end; +EEG.trials = length(g.trial); +EEG.pnts = size(EEG.data,2); +EEG.nbchan = length(g.channel); +if ~isempty(EEG.chanlocs) + EEG.chanlocs = EEG.chanlocs(g.channel); +end; +if ~isempty(EEG.epoch) + EEG.epoch = EEG.epoch( g.trial ); +end; +if ~isempty(EEG.specdata) + if length(g.point) == EEG.pnts + EEG.specdata = EEG.specdata(g.channel, :, g.trial); + else + EEG.specdata = []; + fprintf('Warning: spectral data were removed because of the change in the numner of points\n'); + end; +end; + +% ica specific +% ------------ +if ~isempty(EEG.icachansind) + + rmchans = setdiff_bc( EEG.icachansind, g.channel ); % channels to remove + + % channel sub-indices + % ------------------- + icachans = 1:length(EEG.icachansind); + for index = length(rmchans):-1:1 + chanind = find(EEG.icachansind == rmchans(index)); + icachans(chanind) = []; + end; + + % new channels indices + % -------------------- + count = 1; + newinds = []; + for index = 1:length(g.channel) + if any(EEG.icachansind == g.channel(index)) + newinds(count) = index; + count = count+1; + end; + end; + EEG.icachansind = newinds; + +else + icachans = 1:size(EEG.icasphere,2); +end; + +if ~isempty(EEG.icawinv) + EEG.icawinv = EEG.icawinv(icachans,:); + EEG.icaweights = pinv(EEG.icawinv); + EEG.icasphere = eye(size(EEG.icaweights,2)); +end; +if ~isempty(EEG.specicaact) + if length(g.point) == EEG.pnts + EEG.specicaact = EEG.specicaact(icachans, :, g.trial); + else + EEG.specicaact = []; + fprintf('Warning: spectral ICA data were removed because of the change in the numner of points\n'); + end; +end; + +% check if only one epoch +% ----------------------- +if EEG.trials == 1 + if isfield(EEG.event, 'epoch') + EEG.event = rmfield(EEG.event, 'epoch'); + end; + EEG.epoch = []; +end; + +EEG.reject = []; +EEG.stats = []; +EEG.reject.rejmanual = []; +% for stats, can adapt remove the selected trials and electrodes +% in the future to gain time ----------------------------------- +EEG.stats.jp = []; +EEG = eeg_checkset(EEG, 'eventconsistency'); + +% generate command +% ---------------- +if nargout > 1 +com = sprintf('EEG = pop_select( %s,%s);', inputname(1), vararg2str(args)); +end + +return; + +% ********* OLD, do not remove any event any more +% ********* in the future maybe do a pack event to remove events not in the time range of any epoch + +if ~isempty(EEG.event) + % go to array format if necessary + if isstruct(EEG.event), format = 'struct'; + else format = 'array'; + end; + switch format, case 'struct', EEG = eventsformat(EEG, 'array'); end; + + % keep only events related to the selected trials + Indexes = []; + Ievent = []; + for index = 1:length( g.trial ) + currentevents = find( EEG.event(:,2) == g.trial(index)); + Indexes = [ Indexes ones(1, length(currentevents))*index ]; + Ievent = union_bc( Ievent, currentevents ); + end; + EEG.event = EEG.event( Ievent,: ); + EEG.event(:,2) = Indexes(:); + + switch format, case 'struct', EEG = eventsformat(EEG, 'struct'); end; +end; + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_selectcomps.m b/code/eeglab13_4_4b/functions/popfunc/pop_selectcomps.m new file mode 100644 index 0000000..5014087 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_selectcomps.m @@ -0,0 +1,189 @@ +% pop_selectcomps() - Display components with button to vizualize their +% properties and label them for rejection. +% Usage: +% >> OUTEEG = pop_selectcomps( INEEG, compnum ); +% +% Inputs: +% INEEG - Input dataset +% compnum - vector of component numbers +% +% Output: +% OUTEEG - Output dataset with updated rejected components +% +% Note: +% if the function POP_REJCOMP is ran prior to this function, some +% fields of the EEG datasets will be present and the current function +% will have some more button active to tune up the automatic rejection. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_prop(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function [EEG, com] = pop_selectcomps( EEG, compnum, fig ); + +COLREJ = '[1 0.6 0.6]'; +COLACC = '[0.75 1 0.75]'; +PLOTPERFIG = 35; + +com = ''; +if nargin < 1 + help pop_selectcomps; + return; +end; + +if nargin < 2 + promptstr = { 'Components to plot:' }; + initstr = { [ '1:' int2str(size(EEG.icaweights,1)) ] }; + + result = inputdlg2(promptstr, 'Reject comp. by map -- pop_selectcomps',1, initstr); + if isempty(result), return; end; + compnum = eval( [ '[' result{1} ']' ]); + + if length(compnum) > PLOTPERFIG + ButtonName=questdlg2(strvcat(['More than ' int2str(PLOTPERFIG) ' components so'],'this function will pop-up several windows'), ... + 'Confirmation', 'Cancel', 'OK','OK'); + if ~isempty( strmatch(lower(ButtonName), 'cancel')), return; end; + end; + +end; +fprintf('Drawing figure...\n'); +currentfigtag = ['selcomp' num2str(rand)]; % generate a random figure tag + +if length(compnum) > PLOTPERFIG + for index = 1:PLOTPERFIG:length(compnum) + pop_selectcomps(EEG, compnum([index:min(length(compnum),index+PLOTPERFIG-1)])); + end; + + com = [ 'pop_selectcomps(' inputname(1) ', ' vararg2str(compnum) ');' ]; + return; +end; + +if isempty(EEG.reject.gcompreject) + EEG.reject.gcompreject = zeros( size(EEG.icawinv,2)); +end; +try, icadefs; +catch, + BACKCOLOR = [0.8 0.8 0.8]; + GUIBUTTONCOLOR = [0.8 0.8 0.8]; +end; + +% set up the figure +% ----------------- +column =ceil(sqrt( length(compnum) ))+1; +rows = ceil(length(compnum)/column); +if ~exist('fig') + figure('name', [ 'Reject components by map - pop_selectcomps() (dataset: ' EEG.setname ')'], 'tag', currentfigtag, ... + 'numbertitle', 'off', 'color', BACKCOLOR); + set(gcf,'MenuBar', 'none'); + pos = get(gcf,'Position'); + set(gcf,'Position', [pos(1) 20 800/7*column 600/5*rows]); + incx = 120; + incy = 110; + sizewx = 100/column; + if rows > 2 + sizewy = 90/rows; + else + sizewy = 80/rows; + end; + pos = get(gca,'position'); % plot relative to current axes + hh = gca; + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]./100; + axis off; +end; + +% figure rows and columns +% ----------------------- +if EEG.nbchan > 64 + disp('More than 64 electrodes: electrode locations not shown'); + plotelec = 0; +else + plotelec = 1; +end; +count = 1; +for ri = compnum + if exist('fig') + button = findobj('parent', fig, 'tag', ['comp' num2str(ri)]); + if isempty(button) + error( 'pop_selectcomps(): figure does not contain the component button'); + end; + else + button = []; + end; + + if isempty( button ) + % compute coordinates + % ------------------- + X = mod(count-1, column)/column * incx-10; + Y = (rows-floor((count-1)/column))/rows * incy - sizewy*1.3; + + % plot the head + % ------------- + if ~strcmp(get(gcf, 'tag'), currentfigtag); + disp('Aborting plot'); + return; + end; + ha = axes('Units','Normalized', 'Position',[X Y sizewx sizewy].*s+q); + if plotelec + topoplot( EEG.icawinv(:,ri), EEG.chanlocs, 'verbose', ... + 'off', 'style' , 'fill', 'chaninfo', EEG.chaninfo, 'numcontour', 8); + else + topoplot( EEG.icawinv(:,ri), EEG.chanlocs, 'verbose', ... + 'off', 'style' , 'fill','electrodes','off', 'chaninfo', EEG.chaninfo, 'numcontour', 8); + end; + axis square; + + % plot the button + % --------------- + button = uicontrol(gcf, 'Style', 'pushbutton', 'Units','Normalized', 'Position',... + [X Y+sizewy sizewx sizewy*0.25].*s+q, 'tag', ['comp' num2str(ri)]); + command = sprintf('pop_prop( %s, 0, %d, gcbo, { ''freqrange'', [1 50] });', inputname(1), ri); %RMC command = sprintf('pop_prop( %s, 0, %d, %3.15f, { ''freqrange'', [1 50] });', inputname(1), ri, button); + set( button, 'callback', command ); + end; + set( button, 'backgroundcolor', eval(fastif(EEG.reject.gcompreject(ri), COLREJ,COLACC)), 'string', int2str(ri)); + drawnow; + count = count +1; +end; + +% draw the bottom button +% ---------------------- +if ~exist('fig') + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'Cancel', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[-10 -10 15 sizewy*0.25].*s+q, 'callback', 'close(gcf); fprintf(''Operation cancelled\n'')' ); + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'Set threhsolds', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[10 -10 15 sizewy*0.25].*s+q, 'callback', 'pop_icathresh(EEG); pop_selectcomps( EEG, gcbf);' ); + if isempty( EEG.stats.compenta ), set(hh, 'enable', 'off'); end; + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'See comp. stats', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[30 -10 15 sizewy*0.25].*s+q, 'callback', ' ' ); + if isempty( EEG.stats.compenta ), set(hh, 'enable', 'off'); end; + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'See projection', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[50 -10 15 sizewy*0.25].*s+q, 'callback', ' ', 'enable', 'off' ); + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'Help', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[70 -10 15 sizewy*0.25].*s+q, 'callback', 'pophelp(''pop_selectcomps'');' ); + command = '[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); eegh(''[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);''); close(gcf)'; + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'OK', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[90 -10 15 sizewy*0.25].*s+q, 'callback', command); + % sprintf(['eeg_global; if %d pop_rejepoch(%d, %d, find(EEG.reject.sigreject > 0), EEG.reject.elecreject, 0, 1);' ... + % ' end; pop_compproj(%d,%d,1); close(gcf); eeg_retrieve(%d); eeg_updatemenu; '], rejtrials, set_in, set_out, fastif(rejtrials, set_out, set_in), set_out, set_in)); +end; + +com = [ 'pop_selectcomps(' inputname(1) ', ' vararg2str(compnum) ');' ]; +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_selectevent.m b/code/eeglab13_4_4b/functions/popfunc/pop_selectevent.m new file mode 100644 index 0000000..b86565c --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_selectevent.m @@ -0,0 +1,569 @@ +% pop_selectevent() - Find events in an EEG dataset. If the dataset +% is the only input, a window pops up to +% ask for the relevant parameter values. +% +% Usage: >> [EEGOUT,event_indices] = pop_selectevent( EEG, 'key1', value1, ... +% 'key2', value2, ... ); +% Input: +% EEG - EEG dataset +% +% Optional inputs: +% 'latency' - [latency_range] latency range of events to include +% Ex: 'latency','400 <= 700' Include all events with +% latnecy in the range [400,700] +% 'omitlatency' - [latency_range] latency range of events to exclude +% 'type' - [type_range] event type(s) to include +% Ex: 'type',3 or [2 3 5] or 1:10 +% 'omittype' - [type_range], type(s) of events to exclude +% 'event' - [event_range], indices of events to include +% 'omitevent' - [event_range], indices of events to exclude +% 'USER_VAR' - [VAR_range], 'USER_VAR' is any user-defined field in +% the event structure. Includes events with values of +% field 'USER_VAR' in the specified range. Use [vector] +% format for integers, 'min 15, stringtext = [ tmptext(1,1:15) '...' ]; + else stringtext = tmptext(1,:); + end; + else stringtext = 'no description'; tmptext = 'no description (use menu Edit > Event Field)'; + end; + else stringtext = 'no description'; tmptext = 'no description (use menu Edit > Event Field)'; + end; + + descrip = { 'string', stringtext, 'callback', ['questdlg2(' vararg2str(tmptext) ... + ',''Description of field ''''' allfields{index} ''''''', ''OK'', ''OK'');' ] }; + + % create the gui for this field + % ----------------------------- + textfield = allfields{index}; + if strcmp(textfield, 'latency') | strcmp(textfield, 'duration') + if EEG.trials > 1, textfield = [ textfield ' (ms)' ]; + else textfield = [ textfield ' (s)' ]; + end; + middletxt = { { 'Style', 'text', 'string', 'min' } { 'Style', 'edit', 'string', '' 'tag' [ 'min' allfields{index} ] } ... + { 'Style', 'text', 'string', 'max' } { 'Style', 'edit', 'string', '' 'tag' [ 'max' allfields{index} ] } }; + middlegeom = [ 0.3 0.35 0.3 0.35 ]; + elseif strcmp(textfield, 'type') + commandtype = [ 'if ~isfield(EEG.event, ''type'')' ... + ' errordlg2(''No type field'');' ... + 'else' ... + ' tmpevent = EEG.event;' ... + ' if isnumeric(EEG.event(1).type),' ... + ' [tmps,tmpstr] = pop_chansel(unique([ tmpevent.type ]));' ... + ' else,' ... + ' [tmps,tmpstr] = pop_chansel(unique({ tmpevent.type }));' ... + ' end;' ... + ' if ~isempty(tmps)' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''type''), ''string'', tmpstr);' ... + ' end;' ... + 'end;' ... + 'clear tmps tmpv tmpevent tmpstr tmpfieldnames;' ]; + middletxt = { { 'Style', 'edit', 'string', '' 'tag' 'type' } { 'Style', 'pushbutton', 'string', '...' 'callback' commandtype } }; + middlegeom = [ 0.95 0.35 ]; + else + middletxt = { { 'Style', 'edit', 'string', '' 'tag' textfield } }; + middlegeom = 1.3; + end; + geometry = { geometry{:} [0.55 0.65 middlegeom 0.1 0.22 0.1] }; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', textfield }, ... + { 'Style', 'pushbutton', descrip{:}, 'horizontalalignment', 'left' }, ... + middletxt{:}, ... + { }, { 'Style', 'checkbox', 'string', ' ' 'tag' [ 'not' allfields{index} ] },{ } }; + end; + + % event indices + % ------------- + uilist = { uilist{:} ... + { 'Style', 'text', 'string', 'Event indices' }, ... + { }, ... + { 'Style', 'edit', 'string', '' 'tag' 'indices' }, ... + { }, { 'Style', 'checkbox', 'string', ' ' 'tag' 'notindices' },{ } }; + geometry = { geometry{:} [0.55 0.65 1.3 0.1 0.22 0.1] }; + + % rename/keep events + % ------------------ + geometry = { geometry{:} [1] [1] [.1 2 .3 .2] [.1 1.5 0.5 0.5] [.1 1 0.5 1] [.1 1 0.5 1] }; + uilist = { uilist{:} { } ... + { 'Style', 'text', 'string','Event selection', 'fontweight', 'bold' } ... + {} { 'Style', 'checkbox', 'string','Select all events NOT selected above (Set this button and "all BUT" buttons (above) for logical OR)' 'tag' 'invertevent' } { } { } ... + {} { 'Style', 'checkbox', 'string','Keep only selected events and remove all other events', ... + 'value', fastif(EEG.trials>1, 0, 1) 'tag' 'rmevents' } { } { } ... + {} { 'Style', 'text', 'string', 'Rename selected event type(s) as type:' } ... + { 'Style', 'edit', 'string', '' 'tag' 'rename' } { } ... + {} { 'Style', 'text', 'string', 'Retain old event type name(s) in (new) field named:' } ... + { 'Style', 'edit', 'string', '' 'tag' 'retainfield' } { } }; + + % epoch selections + % ---------------- + if EEG.trials > 1 + geometry = { geometry{:} [1] [0.1 2 0.5 0.5] [0.1 2 0.5 0.5]}; + uilist = { uilist{:} ... + { 'Style', 'text', 'string','Epoch selection', 'fontweight', 'bold' } ... + { } { 'Style', 'checkbox', 'string','Remove epochs not referenced by any selected event', ... + 'value', 1 'tag' 'rmepochs' } { } { } ... + { } { 'Style', 'checkbox', 'string','Invert epoch selection', ... + 'value', 0 'tag' 'invertepoch' } { } { } }; + end; + + [results tmp2 tmp3 res] = inputgui( geometry, uilist, 'pophelp(''pop_selectevent'')', 'Select events -- pop_selectevent()'); + if length(results) == 0, return; end; + + % decode inputs + % ------------- + args = {}; + if ~res.notindices, args = { args{:}, 'event', eval( [ '[' res.indices ']' ]) }; + else args = { args{:}, 'omitevent', eval( [ '[' res.indices ']' ]) }; + end; + for index = 1:length(allfields) + textfield = allfields{index}; + tmpflag = getfield(res, [ 'not' textfield ]); + if strcmp(textfield, 'duration') | strcmp(textfield, 'latency') + tmpres = []; + minlat = getfield(res, [ 'min' textfield ]); + maxlat = getfield(res, [ 'max' textfield ]); + if ~isempty(minlat) & ~isempty(maxlat) + tmpres = [ minlat '<=' maxlat ]; + end; + else + tmpres = getfield(res, textfield); + try, tmpres2 = eval( [ '[' tmpres ']' ] ); + if ~isnumeric(tmpres2), + if tmpres(1) == '''' + tmpres = eval( [ '{' tmpres '}' ] ); + else + tmpres = parsetxt( tmpres ); + end; + else + tmpres = tmpres2; + end; + catch, tmpres = parsetxt( tmpres ); end; + end + if ~isempty(tmpres) + if ~tmpflag, args = { args{:}, textfield, tmpres }; + else args = { args{:}, [ 'omit' textfield], tmpres }; + end; + end; + end; + if res.invertevent, args = { args{:}, 'select', 'inverse' }; end; + if ~isempty(res.rename), args = { args{:}, 'renametype', res.rename }; end; + if ~isempty(res.retainfield), args = { args{:}, 'oldtypefield', res.retainfield }; end; + args = { args{:}, 'deleteevents', fastif(res.rmevents, 'on', 'off') }; + if EEG.trials > 1 + args = { args{:}, 'deleteepochs', fastif(res.rmepochs , 'on', 'off') }; + args = { args{:}, 'invertepochs', fastif(res.invertepoch , 'on', 'off') }; + end; +else % no interactive inputs + args = varargin; +end; + +% setting default for the structure +% --------------------------------- +fieldlist = { 'event' 'integer' [] [1:length(EEG.event)] ; + 'omitevent' 'integer' [] [] ; + 'deleteepochs' 'string' { 'yes','no','on','off' } 'on' ; + 'invertepochs' 'string' { 'on','off' } 'off' ; + 'deleteevents' 'string' { 'yes','no','on','off' } 'off'; + 'renametype' 'string' [] ''; + 'oldtypefield' 'string' [] ''; + 'select' 'string' { 'normal','inverse','remove','keep' } 'normal' }; +for index = 1:length(allfields) + fieldlist{end+1, 1} = allfields{index}; + fieldlist{end , 2} = ''; + fieldlist{end+1, 1} = [ 'omit' allfields{index} ]; + fieldlist{end , 2} = ''; +end; +g = finputcheck( args, fieldlist, 'pop_selectevent'); +if isstr(g), error(g); end; +if isempty(g.event), g.event = [1:length(EEG.event)]; end; +if strcmpi(g.select, 'remove'), g.select = 'inverse'; end; +if strcmpi(g.select, 'keep' ), g.select = 'normal'; end; +if strcmpi(g.deleteepochs, 'yes' ), g.deleteepochs = 'on'; end; +if strcmpi(g.deleteepochs, 'no' ), g.deleteepochs = 'off'; end; +if ~isempty(g.oldtypefield) & isempty(g.renametype) + error('A name for the new type must be defined'); +end; + +% select the events to keep +% ------------------------- +Ievent = g.event; +Ieventrem = g.omitevent; + +for index = 1:length(allfields) + + % convert the value if the field is a string field + % ------------------------------------------------ + tmpvar = getfield(g, {1}, allfields{index}); + + if ~isempty(tmpvar) + if isnumeric(tmpvar) + if isstr(getfield( EEG.event, {1}, allfields{index})) + for tmpind = 1:length(tmpvar) + tmpvartmp{tmpind} = num2str(tmpvar(tmpind)); + end; + tmpvar = tmpvartmp; + end; + elseif isstr(tmpvar) & isempty( findstr(tmpvar, '<=')) + if isnumeric(getfield( EEG.event, {1}, allfields{index})) + error(['numerical values must be entered for field ''' allfields{index} '''']); + end; + end; + end; + + if isstr(tmpvar) & isempty( findstr(tmpvar, '<=')) + tmpvar = { tmpvar }; + end; + + % scan each field of EEG.event + % ---------------------------- + if ~isempty( tmpvar ) + if iscell( tmpvar ) % strings + eval( [ 'tmpevent = EEG.event; tmpvarvalue = {tmpevent(:).' allfields{index} '};'] ); + Ieventtmp = []; + for index2 = 1:length( tmpvar ) + tmpindex = transpose(find(strcmp(deblank(tmpvar{index2}), deblank(tmpvarvalue))));%Ramon: for bug 1318. Also for compatibility(strmatch will be deleted in next versions of MATLAB) + %tmpindex = strmatch( tmpvar{index2}, tmpvarvalue, 'exact'); + + if isempty( tmpindex ), + fprintf('Warning: ''%s'' field value ''%s'' not found\n', allfields{index}, tmpvar{index2}); + end; + Ieventtmp = unique_bc( [ Ieventtmp; tmpindex ]); + end; + Ievent = intersect_bc( Ievent, Ieventtmp ); + elseif isstr( tmpvar ) % real range + tmpevent = EEG.event; + % ======== JRI BUGFIX 3/6/14 + %eval( [ 'tmpvarvalue = [ tmpevent(:).' allfields{index} ' ];'] ); + tmpvarvalue = safeConcatenate(EEG.event, allfields{index}); + + min = eval(tmpvar(1:findstr(tmpvar, '<=')-1)); + max = eval(tmpvar(findstr(tmpvar, '<=')+2:end)); + if strcmp(allfields{index}, 'latency') + if EEG.trials > 1 + tmpevent = EEG.event; + tmpvarvalue = eeg_point2lat(tmpvarvalue, {tmpevent.epoch}, EEG.srate, ... + [EEG.xmin EEG.xmax]*1000, 1E-3); + else + tmpvarvalue = eeg_point2lat(tmpvarvalue, ones(1,length(EEG.event)), EEG.srate, ... + [EEG.xmin EEG.xmax], 1); + end; + end; + if strcmp(allfields{index}, 'duration') + if EEG.trials > 1, tmpvarvalue = tmpvarvalue/EEG.srate*1000; + else tmpvarvalue = tmpvarvalue/EEG.srate; + end; + end; + Ieventlow = find( tmpvarvalue >= min); + Ieventhigh = find( tmpvarvalue <= max); + Ievent = intersect_bc( Ievent, intersect( Ieventlow, Ieventhigh ) ); + else + if strcmp(allfields{index}, 'latency') + fprintf(['pop_selectevent warning: latencies are continuous values\n' ... + 'so you may use the ''a<=b'' notation to select these values\n']); + end; + % ======== JRI BUGFIX 3/6/14 + %eval( [ 'tmpevent = EEG.event; tmpvarvalue = [ tmpevent(:).' allfields{index} ' ];'] ); + tmpvarvalue = safeConcatenate(EEG.event, allfields{index}); + + Ieventtmp = []; + for index2 = 1:length( tmpvar ) + Ieventtmp = unique_bc( [ Ieventtmp find(tmpvarvalue == tmpvar(index2)) ] ); + end; + Ievent = intersect_bc( Ievent, Ieventtmp ); + end; + end; + + % scan each field of EEG.event (omit) + % ----------------------------------- + tmpvar = eval(['g.omit' allfields{index} ]); + if eval(['isstr(EEG.event(1).' allfields{index} ')' ]) & isnumeric(tmpvar) & ~isempty(tmpvar) + for tmpind = 1:length(tmpvar) + tmpvartmp{tmpind} = num2str(tmpvar(tmpind)); + end; + tmpvar = tmpvartmp; + end; + if isstr(tmpvar) & isempty( findstr(tmpvar, '<=')) + tmpvar = { tmpvar }; + end; + if ~isempty( tmpvar ) + if iscell( tmpvar ) + eval( [ 'tmpevent = EEG.event; tmpvarvalue = {tmpevent(:).' allfields{index} '};'] ); + Ieventtmp = []; + for index2 = 1:length( tmpvar ) + tmpindex = strmatch( tmpvar{index2}, tmpvarvalue, 'exact'); + if isempty( tmpindex ), + fprintf('Warning: ''%s'' field value ''%s'' not found\n', allfields{index}, tmpvar{index2}); + end; + Ieventtmp = unique_bc( [ Ieventtmp; tmpindex ]); + end; + Ieventrem = union_bc( Ieventrem, Ieventtmp ); + elseif isstr( tmpvar ) + tmpevent = EEG.event; + % ======== JRI BUGFIX 3/6/14 + %eval( [ 'tmpvarvalue = [ tmpevent(:).' allfields{index} ' ];'] ); + tmpvarvalue = safeConcatenate(EEG.event, allfields{index}); + + min = eval(tmpvar(1:findstr(tmpvar, '<=')-1)); + max = eval(tmpvar(findstr(tmpvar, '<=')+2:end)); + if strcmp(allfields{index}, 'latency') + if EEG.trials > 1 + tmpevent = EEG.event; + tmpvarvalue = eeg_point2lat(tmpvarvalue, {tmpevent.epoch}, EEG.srate, ... + [EEG.xmin EEG.xmax]*1000, 1E-3); + else + tmpvarvalue = eeg_point2lat(tmpvarvalue, ones(1,length(EEG.event)), EEG.srate, ... + [EEG.xmin EEG.xmax], 1); + end; + end; + if strcmp(allfields{index}, 'duration') + if EEG.trials > 1, tmpvarvalue = tmpvarvalue/EEG.srate*1000; + else tmpvarvalue = tmpvarvalue/EEG.srate; + end; + end; + Ieventlow = find( tmpvarvalue > min); + Ieventhigh = find( tmpvarvalue < max); + Ieventrem = union_bc( Ieventrem, intersect( Ieventlow, Ieventhigh ) ); + else + if strcmp(allfields{index}, 'latency') + fprintf(['pop_selectevent warning: latencies are continuous values\n' ... + 'so you may use the ''a<=b'' notation to select these values\n']); + end; + tmpevent = EEG.event; + % ======== JRI BUGFIX 3/6/14 + %eval( [ 'tmpvarvalue = [ tmpevent(:).' allfields{index} ' ];'] ); + tmpvarvalue = safeConcatenate(EEG.event, allfields{index}); + + Ieventtmp = []; + for index2 = 1:length( tmpvar ) + Ieventtmp = unique_bc( [ Ieventtmp find( tmpvarvalue ==tmpvar(index2)) ] ); + end; + Ieventrem = union_bc( Ieventrem, Ieventtmp ); + end; + end; +end; + +Ievent = setdiff_bc( Ievent, Ieventrem); +if strcmp(g.select, 'inverse') + Ievent = setdiff_bc( [1:length(EEG.event)], Ievent ); +end; + +% checking if trying to remove boundary events (in continuous data) +if isfield(EEG.event, 'type') + if isstr(EEG.event(1).type) & EEG.trials == 1 + Ieventrem = setdiff_bc([1:length(EEG.event)], Ievent ); + tmpevent = EEG.event; + boundaryindex = strmatch('boundary', { tmpevent(Ieventrem).type }); + if ~isempty(boundaryindex) + boundaryindex = Ieventrem(boundaryindex); + Ievent = [ Ievent boundaryindex ]; + end; + Ievent = sort(Ievent); + else boundaryindex = []; + end; +else boundaryindex = []; +end; + +% rename events if necessary +% -------------------------- +if ~isempty(g.renametype) + fprintf('Pop_selectevent: renaming %d selected events (out of %d)\n', length(Ievent), length(EEG.event)); + if ~isempty(g.oldtypefield) + for index = setdiff_bc(Ievent, boundaryindex) + eval([ 'EEG.event(index).' g.oldtypefield '= EEG.event(index).type;']); + EEG.event(index).type = g.renametype; + end; + else + for index = setdiff_bc(Ievent, boundaryindex) + EEG.event(index).type = g.renametype; + end; + end; +end; + +% Events: delete epochs +% --------------------- +if strcmp( lower(g.deleteepochs), 'on') & EEG.trials > 1 + % ask for confirmation + % -------------------- + Iepoch = ones(1, EEG.trials); + for index = 1:length(Ievent) + Iepoch(EEG.event(Ievent(index)).epoch) = 0; + end; + if strcmpi(g.invertepochs, 'on') + Iepoch = ~Iepoch; + end; + Iepoch = find(Iepoch == 0); + if length(Iepoch) == 0, + error('Empty dataset: all epochs have been removed'); + end; + if nargin < 2 + ButtonName=questdlg2(strvcat([ 'Warning: delete ' num2str(EEG.trials-length(Iepoch)) ... + ' (out of ' int2str(EEG.trials) ') un-referenced epochs ?' ]), ... + 'Confirmation', ... + 'Cancel', 'Ok','Ok'); + else ButtonName = 'ok'; end; + + switch lower(ButtonName), + case 'cancel', return; + case 'ok', + if strcmpi(g.deleteevents, 'on') + EEG.event = EEG.event(Ievent); + end; + EEG = pop_select(EEG, 'trial', Iepoch); + end % switch +else + % delete events if necessary + % -------------------------- + if strcmpi(g.deleteevents, 'on') + EEG.event = EEG.event(Ievent); + end; +end; + +EEG = eeg_checkset(EEG, 'eventconsistency'); + +% generate the output command +% --------------------------- +argsout = {}; +for index =1:2:length(args) + if ~isempty(args{index+1}) + argsout = { argsout{:} args{index} args{index+1}}; + end; +end; +com = sprintf('EEG = pop_selectevent( %s, %s);', inputname(1), vararg2str(argsout)); + +% chop the text so that it fits into the description window +% --------------------------------------------------------- +function chopedtext = choptext( tmptext ) + chopedtext = ''; + while length(tmptext) > 30 + blanks = findstr( tmptext, ' '); + [tmp I] = min( abs(blanks - 30) ); + chopedtext = [ chopedtext ''' 10 ''' tmptext(1:blanks(I)) ]; + tmptext = tmptext(blanks(I)+1:end); + end; + chopedtext = [ chopedtext ''' 10 ''' tmptext]; + chopedtext = chopedtext(7:end); +return; + +% ======== JRI BUGFIX 3/6/14 +% safely concatenate a numeric field that may contain empty values, replacing them with nans +% --------------------------------------------------------- +function tmpvarvalue = safeConcatenate(S, fieldname) +try + tmpvarvalue = {S.(fieldname)}; + tmpvarvalue = cellfun(@(x) fastif(isempty(x),nan,x), tmpvarvalue); +catch + %keep this style for backwards compatibility? + eval( [ 'tmpvarvalue = {S(:).' fieldname ' };'] ); + for itmp = 1:length(tmpvarvalue), + if isempty(tmpvarvalue{itmp}), + tmpvarvalue{itmp} = nan; + end + end + tmpvarvalue = cell2mat(tmpvarvalue); +end +% ======== JRI BUGFIX 3/6/14 + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_signalstat.m b/code/eeglab13_4_4b/functions/popfunc/pop_signalstat.m new file mode 100644 index 0000000..853bf25 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_signalstat.m @@ -0,0 +1,146 @@ +% pop_signalstat() - Computes and plots statistical characteristics of a signal, +% including the data histogram, a fitted normal distribution, +% a normal ditribution fitted on trimmed data, a boxplot, and +% the QQ-plot. The estimates value are printed in a panel and +% can be read as output. See SIGNALSTAT. +% Usage: +% >> OUTEEG = pop_signalstat( EEG, type ); % pops up +% >> [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh] = pop_signalstat( EEG, type, cnum ); +% >> [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh] = pop_signalstat( EEG, type, cnum, percent ); +% +% Inputs: +% EEG - input EEG dataset +% type - type of processing +% 1: process the raw data; 0: the ICA components +% cnum - selected channel or component +% +% Outputs: +% OUTEEG - output dataset +% +% Author: Luca Finelli, CNL / Salk Institute - SCCN, 2 August 2002 +% +% See also: +% SIGNALSTAT, EEGLAB + +% Copyright (C) 2002 Luca Finelli, Salk/SCCN, La Jolla, CA +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function varargout = pop_signalstat( EEG, typeproc, cnum, percent ); + +% the command output is a hidden output that does not have to +% be described in the header + +com = ''; % this initialization ensure that the function will return something + % if the user press the cancel button +varargout{1} = ''; + +% display help if not enough arguments +% ------------------------------------ +if nargin < 2 + help pop_signalstat; + return; +end; +popup=0; +if nargin < 3 + popup = 1; +end; +if nargin < 4 + percent=5; +end; + +% pop up window +% ------------- +if (nargin < 3 & typeproc==1) + promptstr = { 'Channel number:'; 'Trim percentage (each end):' }; + inistr = { '1';'5' }; + result = inputdlg2( promptstr, 'Plot signal statistics -- pop_signalstat()', 1, inistr, 'signalstat'); + if length( result ) == 0 return; end; + cnum = eval( [ '[' result{1} ']' ] ); % the brackets allow processing Matlab arrays + percent = eval( [ '[' result{2} ']' ] ); +elseif (nargin < 3 & typeproc==0) + promptstr = { 'Component number:'; 'Trim percentage (each end):' }; + inistr = { '1'; '5' }; + result = inputdlg2( promptstr, 'Plot signal statistics -- pop_signalstat()', 1, inistr, 'signalstat'); + if length( result ) == 0 return; end; + cnum = eval( [ '[' result{1} ']' ] ); % the brackets allow processing Matlab arrays + percent = eval( [ '[' result{2} ']' ] ); +end; + +if length(cnum) ~= 1 | (cnum-floor(cnum)) ~= 0 + error('pop_signalstat(): Channel/component number must be a single integer'); +end + +if cnum < 1 | cnum > EEG.nbchan + error('pop_signalstat(): Channel/component number out of range'); +end; + +% call function signalstat() either on raw data or ICA data +% --------------------------------------------------------- +if typeproc == 1 + tmpsig=EEG.data(cnum,:); +% [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh]=signalstat( EEG.data(cnum,:),1,[], percent); + dlabel=[]; + dlabel2=['Channel ' num2str(cnum)]; + map = cnum; +else + if ~isempty( EEG.icasphere ) + tmpsig = eeg_getdatact(EEG, 'component', cnum); + tmpsig = tmpsig(:,:); + % [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh]=signalstat( tmpsig,1,'Component Activity',percent); + dlabel='Component Activity'; + dlabel2=['Component ' num2str(cnum)]; + map = EEG.icawinv(:,cnum); + else + error('You must run ICA first'); + end; +end; + +% outputs +% ------- +outstr = ''; +if ~popup + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% return the string command +% ------------------------- +%fprintf('Pop_signalstat: computing statistics...\n'); +varargout{1} = sprintf('pop_signalstat( %s, %d, %d );', inputname(1), typeproc, cnum); + + +plotloc = 0; +if ~isempty(EEG.chanlocs) + if isfield(EEG.chanlocs, 'theta') + if ~isempty(EEG.chanlocs(cnum).theta) + plotloc = 1; + end; + end; +end; +if plotloc + if typeproc == 1 + com = sprintf('%s signalstat( tmpsig, 1, dlabel, percent, dlabel2, map, EEG.chanlocs );', outstr); + else + com = sprintf('%s signalstat( tmpsig, 1, dlabel, percent, dlabel2, map, EEG.chanlocs(EEG.icachansind) );', outstr); + end; +else + com = sprintf('%s signalstat( tmpsig, 1, dlabel, percent, dlabel2);', outstr); +end; + +eval(com) +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_snapread.m b/code/eeglab13_4_4b/functions/popfunc/pop_snapread.m new file mode 100644 index 0000000..9d821e6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_snapread.m @@ -0,0 +1,98 @@ +% pop_snapread() - load an EEG SnapMaster file (pop out window if no arguments). +% +% Usage: +% >> [dat] = pop_snapread( filename, gain); +% +% Graphic interface: +% "Relative gain" - [edit box] to compute the relative gain, fisrt look at +% the text header of the snapmater file with a text editor. +% Find the recording unit, usually in volts (UNITS field). +% Then, find the voltage range in the "CHANNEL.RANGE" [cmin cmax] +% field. Finally, determine the gain of the amplifiers (directly +% on the machine, not in the header file). +% Knowing that the recording precision is 12 bits. The folowing +% formula +% 1/2^12*[cmax-cmin]*1e6/gain +% returns the relative gain. You have to compute it and enter +% it in the edit box. Enter 1, for preserving the data file units. +% (note that if the voltage range is not the same for all channels +% or if the CONVERSION.POLY field in the file header +% is not "0 + 1x" for all channels, you will have to load the data +% using snapread() and scale manually all channels, then import +% the Matlab array into EEGLAB). +% +% Inputs: +% filename - SnapMaster file name +% gain - relative gain. See graphic interface help. +% +% Outputs: +% dat - EEGLAB data structure +% +% Author: Arnaud Delorme, CNL/Salk Institute, 13 March 2002 +% +% See also: eeglab(), snapread() + +% Copyright (C) 13 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_snapread(filename, gain); +command = ''; +EEG = []; + +if nargin < 1 + % ask user + [filename, filepath] = uigetfile('*.SMA', 'Choose a SnapMaster file -- pop_snapread()'); + if filename == 0 return; end; + filename = [filepath filename]; + + promptstr = { 'Relative gain (see help)' }; + inistr = { '400' }; + result = inputdlg2( promptstr, 'Import SnapMaster file -- pop_snapread()', 1, inistr, 'pop_snapread'); + if length(result) == 0 return; end; + gain = eval( result{1} ); + +end; + +if exist('gain') ~= 1 + gain = 1; +end; + +% load datas +% ---------- +EEG = eeg_emptyset; +[EEG.data,params,events, head] = snapread(filename); + +EEG.data = EEG.data*gain; +EEG.comments = [ 'Original file: ' filename ]; +EEG.filepath = ''; +EEG.setname = 'SnapMaster file'; +EEG.nbchan = params(1); +EEG.pnts = params(2); +EEG.trials = 1; +EEG.srate = params(3); +EEG.xmin = 0; + +A = find(events ~= 0); +if ~isempty(A) + EEG.event = struct( 'type', mattocell(events(A), [1], ones(1,length(events(A)))), ... + 'latency', mattocell(A(:)', [1], ones(1,length(A))) ); +end; + +EEG = eeg_checkset(EEG, 'eventconsistency'); +EEG = eeg_checkset(EEG, 'makeur'); +command = sprintf('EEG = pop_snapread(''%s'', %f);', filename, gain); + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_spectopo.m b/code/eeglab13_4_4b/functions/popfunc/pop_spectopo.m new file mode 100644 index 0000000..1ed56b7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_spectopo.m @@ -0,0 +1,324 @@ +% pop_spectopo() - Plot spectra of specified data channels or components. +% Show scalp maps of power at specified frequencies. +% Calls spectopo(). +% Usage: +% >> pop_spectopo( EEG, dataflag); % pops-up interactive window +% OR +% >> [spectopo_outputs] = pop_spectopo( EEG, dataflag, timerange, ... +% process, 'key', 'val',...); % returns spectopo() outputs +% +% Graphic interface for EEG data (dataflag = 1): +% "Epoch time range" - [edit box] [min max] Epoch time range (in ms) to use +% in computing the spectra (by default the whole epoch or data). +% Command line equivalent: 'timerange' +% "Percent data to sample" - [edit box] Percentage of data to use in +% computing the spectra (low % speeds up the computation). +% spectopo() equivalent: 'percent' +% "Frequencies to plot as scalp maps" - [edit box] Vector of 1-7 frequencies to +% plot topoplot() scalp maps of power at all channels. +% spectopo() equivalent: 'freqs' +% "Apply to EEG|ERP|BOTH" - [edit box] Plot spectra of the 'EEG', 'ERP' or of 'BOTH'. +% NOTE: This edit box does not appear for continuous data. +% Command line equivalent: 'process' +% "Plotting frequency range" - [edit box] [min max] Frequency range (in Hz) to plot. +% spectopo() equivalent: 'freqrange' +% "Spectral and scalp map options (see topoplot)" - [edit box] 'key','val','key',... +% sequence of arguments passed to spectopo() for details of the +% spectral decomposition or to topoplot() to adjust details of +% the scalp maps. For details see >> help topoplot +% +% Graphic interface for components (dataflag = 0): +% "Epoch time range" - [edit box] [min max] Epoch time range (in ms) to use +% in computing the spectra (by default the whole epoch or data). +% Command line equivalent: 'timerange' +% "Frequency (Hz) to analyze" - [edit box] Single frequency (Hz) at which to plot +% component contributions. spectopo() equivalent: 'freqs' +% "Electrode number to analyze" - [edit box] 1-nchans --> Plot component contributions +% at this channel; [] --> Plot contributions at channel with max +% power; 0 --> Plot component contributions to global (RMS) power. +% spectopo() equivalent: 'plotchan' +% "Percent data to sample" - [edit box] Percent of data to use in computing the spectra +% (low % speeds up the computation). spectopo() equivalent: 'percent' +% "Components to include ..." - [Edit box] Only compute spectrum of a subset of the +% components. spectopo() equivalent: 'icacomps' +% "Number of largest-contributing ..." - [edit box] Number of component maps +% to plot. spectopo() equivalent: 'nicamaps' +% "Else, map only these components ..." - [edit box] Use this entry to override +% plotting maps of the components that project most strongly (at +% the selected frequency) to the the selected channel (or whole scalp +% if 'plotchan' (above) == 0). spectopo() equivalent: 'icamaps' +% "[Checked] Compute comp spectra ..." - [checkbox] If checked, compute the spectra +% of the selected component activations; else, if unchecked +% compute the spectra of (the data MINUS each selected component). +% spectopo() equivalent: 'icamode' +% "Plotting frequency range" - [edit box] [min max] Frequency range (in Hz) to plot. +% spectopo() equivalent: 'freqrange' +% "Spectral and scalp map options (see topoplot)" - [edit box] 'key','val','key',... +% sequence of arguments passed to spectopo() for details of the +% spectral decomposition or to topoplot() to adjust details of +% the scalp maps. For details see >> help topoplot +% Inputs: +% EEG - Input EEGLAB dataset +% dataflag - If 1, process the input data channels. +% If 0, process its component activations. +% {Default: 1, process the data channels}. +% timerange - [min_ms max_ms] Epoch time range to use in computing the spectra +% {Default: whole input epochs} +% process - 'EEG'|ERP'|'BOTH' If processing data epochs, work on either the +% mean single-trial 'EEG' spectra, the spectrum of the trial-average +% 'ERP', or plot 'BOTH' the EEG and ERP spectra. {Default: 'EEG'} +% +% Optional inputs: +% 'key','val' - Optional topoplot() and/or spectopo() plotting arguments +% {Default, 'electrodes','off'} +% +% Outputs: As from spectopo(). When nargin<2, a query window pops-up +% to ask for additional arguments and NO outputs are returned. +% Note: Only the outputs of the 'ERP' spectral analysis +% are returned when plotting 'BOTH' ERP and EEG spectra. +% +% Author: Arnaud Delorme & Scott Makeig, CNL / Salk Institute, 10 March 2002 +% +% See also: spectopo(), topoplot() + +% Copyright (C) 10 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-15-02 debugging -ad +% 03-16-02 add all topoplot options -ad +% 04-04-02 added outputs -ad & sm + +function varargout = pop_spectopo( EEG, dataflag, timerange, processflag, varargin); + +varargout{1} = ''; +if nargin < 1 + help pop_spectopo; + return; +end; + +if nargin < 2 + dataflag = 1; +end; +if nargin < 3 + processflag = 'EEG'; +end; + +chanlocs_present = 0; +if ~isempty(EEG.chanlocs) + if isfield(EEG.chanlocs, 'theta') + tmpchanlocs = EEG.chanlocs; + if any(~cellfun(@isempty, { tmpchanlocs.theta })) + chanlocs_present = 1; + end; + end; +end; + +if nargin < 3 + if dataflag + geometry = { [2 1] [2 1] [2 1] [2 1] [2 1] [2 1]}; + scalp_freq = fastif(chanlocs_present, { '6 10 22' }, { '' 'enable' 'off' }); + promptstr = { { 'style' 'text' 'string' 'Epoch time range to analyze [min_ms max_ms]:' }, ... + { 'style' 'edit' 'string' [num2str( EEG.xmin*1000) ' ' num2str(EEG.xmax*1000)] }, ... + { 'style' 'text' 'string' 'Percent data to sample (1 to 100):'}, ... + { 'style' 'edit' 'string' '15' }, ... + { 'style' 'text' 'string' 'Frequencies to plot as scalp maps (Hz):'}, ... + { 'style' 'edit' 'string' scalp_freq{:} }, ... + { 'style' 'text' 'string' 'Apply to EEG|ERP|BOTH:'}, ... + { 'style' 'edit' 'string' 'EEG' }, ... + { 'style' 'text' 'string' 'Plotting frequency range [lo_Hz hi_Hz]:'}, ... + { 'style' 'edit' 'string' '2 25' }, ... + { 'style' 'text' 'string' 'Spectral and scalp map options (see topoplot):' } ... + { 'style' 'edit' 'string' '''electrodes'',''off''' } }; + if EEG.trials == 1 + geometry(3) = []; + promptstr(7:8) = []; + end; + result = inputgui( geometry, promptstr, 'pophelp(''pop_spectopo'')', 'Channel spectra and maps -- pop_spectopo()'); + if size(result,1) == 0 return; end; + timerange = eval( [ '[' result{1} ']' ] ); + options = []; + if isempty(EEG.chanlocs) + disp('Topographic plot options ignored. First import a channel location file'); + disp('To plot a single channel, use channel property menu or the following call'); + disp(' >> figure; chan = 1; spectopo(EEG.data(chan,:,:), EEG.pnts, EEG.srate);'); + end; + if eval(result{2}) ~= 100, options = [ options ', ''percent'', ' result{2} ]; end; + if ~isempty(result{3}) & ~isempty(EEG.chanlocs), options = [ options ', ''freq'', [' result{3} ']' ]; end; + if EEG.trials ~= 1 + processflag = result{4}; + if ~isempty(result{5}), options = [ options ', ''freqrange'',[' result{5} ']' ]; end; + if ~isempty(result{6}), options = [ options ',' result{6} ]; end; + else + if ~isempty(result{4}), options = [ options ', ''freqrange'',[' result{4} ']' ]; end; + if ~isempty(result{5}), options = [ options ',' result{5} ]; end; + end; + else + if ~chanlocs_present + error('pop_spectopo(): cannot plot component contributions without channel locations'); + end; + geometry = { [2 1] [2 1] [2 1] [2 1] [2 1] [2 1] [2 1] [2 0.18 0.78] [2 1] [2 1] }; + promptstr = { { 'style' 'text' 'string' 'Epoch time range to analyze [min_ms max_ms]:' }, ... + { 'style' 'edit' 'string' [num2str( EEG.xmin*1000) ' ' num2str(EEG.xmax*1000)] }, ... + { 'style' 'text' 'string' 'Frequency (Hz) to analyze:'}, ... + { 'style' 'edit' 'string' '10' }, ... + { 'style' 'text' 'string' 'Electrode number to analyze ([]=elec with max power; 0=whole scalp):', 'tooltipstring', ... + ['If value is 1 to nchans, plot component contributions at this channel' 10 ... + 'If value is [], plot contributions at channel with max. power' 10 ... + 'If value is 0, plot component contributions to global (RMS) power'] }, ... + { 'style' 'edit' 'string' '0' }, ... + { 'style' 'text' 'string' 'Percent data to sample (1 to 100):'}, ... + { 'style' 'edit' 'string' '20' }, ... + { 'style' 'text' 'string' 'Components to include in the analysis:' }, ... + { 'style' 'edit' 'string' ['1:' int2str(size(EEG.icaweights,1))] }, ... + { 'style' 'text' 'string' 'Number of largest-contributing components to map:' }, ... + { 'style' 'edit' 'string' '5' }, ... + { 'style' 'text' 'string' ' Else, map only these component numbers:', 'tooltipstring', ... + ['Use this entry to override plotting maps of the components that project' 10 ... + 'most strongly to the selected channel (or whole scalp) at the selected frequency.' ] }, ... + { 'style' 'edit' 'string' '' }, ... + { 'style' 'text' 'string' '[Checked] Compute comp spectra; [Unchecked] (data-comp) spectra:', 'tooltipstring' ... + ['If checked, compute the spectra of the selected component activations' 10 ... + 'else [if unchecked], compute the spectra of (the data MINUS each slected component)']}, ... + { 'style' 'checkbox' 'value' 1 } { }, ... + { 'style' 'text' 'string' 'Plotting frequency range ([min max] Hz):'}, ... + { 'style' 'edit' 'string' '2 25' }, ... + { 'style' 'text' 'string' 'Spectral and scalp map options (see topoplot):' } ... + { 'style' 'edit' 'string' '''electrodes'',''off''' } }; + result = inputgui( geometry, promptstr, 'pophelp(''spectopo'')', 'Component spectra and maps -- pop_spectopo()'); + if size(result,1) == 0 return; end; + timerange = eval( [ '[' result{1} ']' ] ); + options = ''; + if ~isempty(result{2}) , options = [ options ', ''freq'', [' result{2} ']' ]; end; + if ~isempty(result{3}) , options = [ options ', ''plotchan'', ' result{3} ]; end; + if eval(result{4}) ~= 100, options = [ options ', ''percent'', ' result{4} ]; end; + if ~isempty(result{5}) , options = [ options ', ''icacomps'', [' result{5} ']' ]; end; + if ~isempty(result{6}) , options = [ options ', ''nicamaps'', ' result{6} ]; end; + if ~isempty(result{7}) , options = [ options ', ''icamaps'', [' result{7} ']' ]; end; + if ~result{8}, options = [ options ', ''icamode'', ''sub''' ]; end; + if ~isempty(result{9}), options = [ options ', ''freqrange'',[' result{9} ']' ]; end; + if ~isempty(result{10}), options = [ options ',' result{10} ]; end; + end; + figure('tag', 'spectopo'); + set(gcf,'Name','spectopo()'); +else + if ~isempty(varargin) + options = [',' vararg2str(varargin)]; + else + options = ''; + end; + if isempty(timerange) + timerange = [ EEG.xmin*1000 EEG.xmax*1000 ]; + end; + if nargin < 3 + percent = 100; + end; + if nargin < 4 + topofreqs = []; + end; +end; + +% set the background color of the figure +try, tmpopt = struct(varargin{:}); if ~isfield(tmpopt, 'plot') || strcmpi(tmpopt, 'on'), icadefs; set(gcf, 'color', BACKCOLOR); end; catch, end; + +switch processflag, + case {'EEG' 'eeg' 'ERP' 'erp' 'BOTH' 'both'},; + otherwise, if nargin <3, close; end; + error('Pop_spectopo: processflag must be ''EEG'', ''ERP'' or ''BOTH'''); +end; +if EEG.trials == 1 & ~strcmp(processflag,'EEG') + if nargin <3, close; end; + error('pop_spectopo(): must use ''EEG'' mode when processing continuous data'); +end; + +if ~isempty(EEG.chanlocs) + if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; + spectopooptions = [ options ', ''verbose'', ''off'', ''chanlocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo' ]; + if dataflag == 0 % i.e. components + spectopooptions = [ spectopooptions ', ''weights'', EEG.icaweights*EEG.icasphere' ]; + end; +else + spectopooptions = options; +end; +if ~dataflag + spectopooptions = [ spectopooptions ', ''icawinv'', EEG.icawinv, ''icachansind'', EEG.icachansind' ]; +end; + +% The programming here is a bit redundant but it tries to optimize +% memory usage. +% ---------------------------------------------------------------- +if timerange(1)/1000~=EEG.xmin | timerange(2)/1000~=EEG.xmax + posi = round( (timerange(1)/1000-EEG.xmin)*EEG.srate )+1; + posf = min(round( (timerange(2)/1000-EEG.xmin)*EEG.srate )+1, EEG.pnts ); + pointrange = posi:posf; + if posi == posf, error('pop_spectopo(): empty time range'); end; + fprintf('pop_spectopo(): selecting time range %6.2f ms to %6.2f ms (points %d to %d)\n', ... + timerange(1), timerange(2), posi, posf); +end; +if isempty(EEG.icachansind) || dataflag == 1, chaninds = 1:EEG.nbchan; +else chaninds = EEG.icachansind; +end; +if exist('pointrange') == 1, SIGTMP = EEG.data(chaninds,pointrange,:); totsiz = length( pointrange); +else SIGTMP = EEG.data(chaninds,:,:); totsiz = EEG.pnts; +end; + +% add boundaries if continuous data +% ---------------------------------- +if EEG.trials == 1 & ~isempty(EEG.event) & isfield(EEG.event, 'type') & isstr(EEG.event(1).type) + tmpevent = EEG.event; + boundaries = strmatch('boundary', {tmpevent.type}); + if ~isempty(boundaries) + if exist('pointrange') + boundaries = [ tmpevent(boundaries).latency ] - 0.5-pointrange(1)+1; + boundaries(find(boundaries>=pointrange(end)-pointrange(1))) = []; + boundaries(find(boundaries<1)) = []; + boundaries = [0 boundaries pointrange(end)-pointrange(1)]; + else + boundaries = [0 [ tmpevent(boundaries).latency ]-0.5 EEG.pnts ]; + end; + spectopooptions = [ spectopooptions ',''boundaries'',[' int2str(round(boundaries)) ']']; + end; + fprintf('Pop_spectopo: finding data discontinuities\n'); +end; + +% outputs +% ------- +outstr = ''; +if nargin >= 2 + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% plot the data and generate output and history commands +% ------------------------------------------------------ +popcom = sprintf('figure; pop_spectopo(%s, %d, [%s], ''%s'' %s);', inputname(1), dataflag, num2str(timerange), processflag, options); +switch processflag + case { 'EEG' 'eeg' }, SIGTMP = reshape(SIGTMP, size(SIGTMP,1), size(SIGTMP,2)*size(SIGTMP,3)); + com = sprintf('%s spectopo( SIGTMP, totsiz, EEG.srate %s);', outstr, spectopooptions); + eval(com) + + case { 'ERP' 'erp' }, com = sprintf('%s spectopo( mean(SIGTMP,3), totsiz, EEG.srate %s);', outstr, spectopooptions); eval(com) + case { 'BOTH' 'both' }, sbplot(2,1,1); com = sprintf('%s spectopo( mean(SIGTMP,3), totsiz, EEG.srate, ''title'', ''ERP'' %s);', outstr, spectopooptions); eval(com) + SIGTMP = reshape(SIGTMP, size(SIGTMP,1), size(SIGTMP,2)*size(SIGTMP,3)); + sbplot(2,1,2); com = sprintf('%s spectopo( SIGTMP, totsiz, EEG.srate, ''title'', ''EEG'' %s);', outstr, spectopooptions); eval(com) +end; + +if nargout < 2 & nargin < 3 + varargout{1} = popcom; +end; + +return; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_subcomp.m b/code/eeglab13_4_4b/functions/popfunc/pop_subcomp.m new file mode 100644 index 0000000..ddea6ab --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_subcomp.m @@ -0,0 +1,152 @@ +% pop_subcomp() - remove specified components from an EEG dataset. +% and subtract their activities from the data. Else, +% remove components already marked for rejection. +% Usage: +% >> OUTEEG = pop_subcomp( INEEG ); % pop-up window mode +% >> OUTEEG = pop_subcomp( INEEG, components, confirm); +% +% Pop-up window interface: +% "Component(s) to remove ..." - [edit box] Array of components to +% remove from the data. Sets the 'components' parameter +% in the command line call (see below). +% "Component(s) to retain ..." - [edit box] Array of components to +% to retain in the data. Sets the 'components' parameter in +% the command line call. Then, comp_to_remove = ... +% setdiff([1:size(EEG.icaweights,1)], comp_to_keep) +% Overwrites "Component(s) to remove" (above). +% Command line inputs: +% INEEG - Input EEG dataset. +% components - Array of components to remove from the data. If empty, +% remove components previously marked for rejection (e.g., +% EEG.reject.gcompreject). +% confirm - [0|1] Display the difference between original and processed +% dataset. 1 = Ask for confirmation. 0 = Do not ask. {Default: 0} +% Outputs: +% OUTEEG - output dataset. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: compvar() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 02-15-02 propagate ica weight matrix -ad sm jorn + +function [EEG, com] = pop_subcomp( EEG, components, plotag ) + +com=''; +if nargin < 1 + help pop_subcomp; + return; +end; +if nargin < 3 + plotag = 0; +end; +if nargin < 2 + % popup window parameters + % ----------------------- + if ~isempty(EEG.reject.gcompreject) + components = find(EEG.reject.gcompreject == 1); + components = components(:)'; + promptstr = { ['Component(s) to remove from the data ([] = marked comps.)'] }; + %promptstr = { ['Components to subtract from data' 10 '(default: pre-labeled components to reject):'] }; + else + components = []; + promptstr = { ['Component(s) to remove from data:'] }; + end; + uilist = { { 'style' 'text' 'string' ['Component(s) to remove from data:'] } ... + { 'style' 'edit' 'string' int2str(components) } ... + { 'style' 'text' 'string' 'Component(s) to retain (overwrites "Component(s) to remove")' } ... + { 'style' 'edit' 'string' '' } ... + }; + geom = { [2 0.7] [2 0.7] }; + result = inputgui( 'uilist', uilist, 'geometry', geom, 'helpcom', 'pophelp(''pop_subcomp'')', ... + 'title', 'Remove components from data -- pop_subcomp()'); + if length(result) == 0 return; end; + components = eval( [ '[' result{1} ']' ] ); + if ~isempty(result{2}), + components = eval( [ '[' result{2} ']' ] ); + components = setdiff_bc([1:size(EEG.icaweights,1)], components); + end; +end; + +if isempty(components) + if ~isempty(EEG.reject.gcompreject) + components = find(EEG.reject.gcompreject == 1); + else + fprintf('Warning: no components specified, no rejection performed\n'); + return; + end; +else + if (max(components) > size(EEG.icaweights,1)) || min(components) < 1 + error('Component index out of range'); + end; +end; + +fprintf('Computing projection ....\n'); +component_keep = setdiff_bc(1:size(EEG.icaweights,1), components); +compproj = EEG.icawinv(:, component_keep)*eeg_getdatact(EEG, 'component', component_keep, 'reshape', '2d'); +compproj = reshape(compproj, size(compproj,1), EEG.pnts, EEG.trials); + +%fprintf( 'The ICA projection accounts for %2.2f percent of the data\n', 100*varegg); + +if nargin < 2 | plotag ~= 0 + + ButtonName = 'continue'; + while ~strcmpi(ButtonName, 'Cancel') & ~strcmpi(ButtonName, 'Accept') + ButtonName=questdlg2( [ 'Please confirm. Are you sure you want to remove these components?' ], ... + 'Confirmation', 'Cancel', 'Plot ERPs', 'Plot single trials', 'Accept', 'Accept'); + if strcmpi(ButtonName, 'Plot ERPs') + if EEG.trials > 1 + tracing = [ squeeze(mean(EEG.data(EEG.icachansind,:,:),3)) squeeze(mean(compproj,3))]; + figure; + plotdata(tracing, EEG.pnts, [EEG.xmin*1000 EEG.xmax*1000 0 0], ... + 'Trial ERPs (red) with and (blue) without these components'); + else + warndlg2('Cannot plot ERPs for continuous data'); + end; + elseif strcmpi(ButtonName, 'Plot single trials') + eegplot( EEG.data(EEG.icachansind,:,:), 'srate', EEG.srate, 'title', 'Black = channel before rejection; red = after rejection -- eegplot()', ... + 'limits', [EEG.xmin EEG.xmax]*1000, 'data2', compproj); + end; + end; + switch ButtonName, + case 'Cancel', + disp('Operation cancelled'); + return; + case 'Accept', + disp('Components removed'); + end % switch +end; +EEG.data(EEG.icachansind,:,:) = compproj; +EEG.setname = [ EEG.setname ' pruned with ICA']; +EEG.icaact = []; +goodinds = setdiff_bc(1:size(EEG.icaweights,1), components); +EEG.icawinv = EEG.icawinv(:,goodinds); +EEG.icaweights = EEG.icaweights(goodinds,:); +EEG.specicaact = []; +EEG.specdata = []; +EEG.reject = []; + +try, + EEG.dipfit.model = EEG.dipfit.model(goodinds); +catch, end; + +com = sprintf('%s = pop_subcomp( %s, [%s], %d);', inputname(1), inputname(1), ... + int2str(components), plotag); +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_timef.m b/code/eeglab13_4_4b/functions/popfunc/pop_timef.m new file mode 100644 index 0000000..4c814a9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_timef.m @@ -0,0 +1,223 @@ +% pop_timef() - Returns estimates and plots of event-related (log) spectral +% perturbation (ERSP) and inter-trial coherence (ITC) changes +% timelocked to a set of input events in one data channel. +% +% Usage: +% >> pop_timef(EEG, typeplot); % pop_up window +% >> pop_timef(EEG, typeplot, lastcom); % pop_up window +% >> pop_timef(EEG, typeplot, channel); % do not pop-up +% >> pop_timef(EEG, typeproc, num, tlimits,cycles, +% 'key1',value1,'key2',value2, ... ); +% +% Inputs: +% INEEG - input EEG dataset +% typeproc - type of processing. 1 process the raw +% data and 0 the ICA components +% num - component or channel number +% tlimits - [mintime maxtime] (ms) sub-epoch time limits +% cycles - >0 -> Number of cycles in each analysis wavelet +% 0 -> Use FFTs (with constant window length) +% +% Optional inputs: +% See the timef() function. +% +% Outputs: same as timef(), no outputs are returned when a +% window pops-up to ask for additional arguments +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: timef(), eeglab() + +% Copyright (C) 2002 arno@salk.edu, Arnaud Delorme, CNL / Salk Institute +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 03-08-02 add eeglab option & optimize variable sizes -ad +% 03-10-02 change timef call -ad +% 03-18-02 added title -ad & sm +% 04-04-02 added outputs -ad & sm + +function varargout = pop_timef(EEG, typeproc, num, tlimits, cycles, varargin ); + +varargout{1} = ''; +% display help if not enough arguments +% ------------------------------------ +if nargin < 2 + help pop_timef; + return; +end; +lastcom = []; +if nargin < 3 + popup = 1; +else + popup = isstr(num) | isempty(num); + if isstr(num) + lastcom = num; + end; +end; + +% pop up window +% ------------- +if popup + [txt vars] = gethelpvar('timef.m'); + + geometry = { [1 0.5 0.5] [1 0.5 0.5] [1 0.5 0.5] [0.92 0.1 0.78] [1 0.5 0.5] [1 0.8 0.2] [1] [1 1]}; + uilist = { ... + { 'Style', 'text', 'string', fastif(typeproc, 'Channel number', 'Component number'), 'fontweight', 'bold' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,3,[],'1') } {} ... + { 'Style', 'text', 'string', 'Epoch time range [min max] (msec)', 'fontweight', 'bold', ... + 'tooltipstring', 'Sub epoch time limits' } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,4,[],[ int2str(EEG.xmin*1000) ' ' int2str(EEG.xmax*1000) ]) } {} ... + { 'Style', 'text', 'string', 'Wavelet cycles (0->FFT, see >> help timef)', 'fontweight', 'bold', ... + 'tooltipstring', context('cycles',vars,txt) } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,5,[],'3 0.5') } {} ... + { 'Style', 'text', 'string', '[set]->Linear coher / [unset]->Phase coher', 'fontweight', 'bold', ... + 'tooltipstring', ['Compute linear inter-trial coherence (coher)' 10 ... + 'OR Amplitude-normalized inter-trial phase coherence (phasecoher)'] } ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'phasecoher','present',1) } { } ... + { 'Style', 'text', 'string', 'Bootstrap significance level (Ex: 0.01 -> 1%)', 'fontweight', 'bold', ... + 'tooltipstring', context('alpha',vars,txt) } ... + { 'Style', 'edit', 'string', getkeyval(lastcom,'alpha') } {} ... + { 'Style', 'text', 'string', 'Optional timef() arguments (see Help)', 'fontweight', 'bold', ... + 'tooltipstring', 'See timef() help via the Help button on the right...' } ... + { 'Style', 'edit', 'string', '''padratio'', 4, ''plotphase'',''off''' } ... + { 'Style', 'pushbutton', 'string', 'Help', 'callback', 'pophelp(''timef'');' } ... + {} ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotersp','present',0), 'string', ... + 'Plot Event Related Spectral Power', 'tooltipstring', ... + 'Plot log spectral perturbation image in the upper panel' } ... + { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotitc','present',0), 'string', ... + 'Plot Inter Trial Coherence', 'tooltipstring', ... + 'Plot the inter-trial coherence image in the lower panel' } ... + }; + % { 'Style', 'edit', 'string', '''padratio'', 4, ''plotphase'', ''off''' } ... + %{ 'Style', 'text', 'string', '[set] -> Plot ITC phase sign', 'fontweight', 'bold', ... + % 'tooltipstring', ['Plot the sign (+/-) of inter-trial coherence phase' 10 ... + % 'as red (+) or blue (-)'] } ... + % { 'Style', 'checkbox', 'value', ~getkeyval(lastcom,'plotphase','present',1) } { } ... + + result = inputgui( geometry, uilist, 'pophelp(''pop_timef'');', ... + fastif(typeproc, 'Plot channel time frequency -- pop_timef()', ... + 'Plot component time frequency -- pop_timef()')); + if length( result ) == 0 return; end; + + num = eval( [ '[' result{1} ']' ] ); + tlimits = eval( [ '[' result{2} ']' ] ); + cycles = eval( [ '[' result{3} ']' ] ); + if result{4} + options = [ ',''type'', ''coher''' ]; + else + options = [',''type'', ''phasecoher''' ]; + end; + + % add topoplot + % ------------ + if isfield(EEG.chanlocs, 'theta') + if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; + if typeproc == 1 + options = [options ', ''topovec'', ' int2str(num) ... + ', ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo' ]; + else + options = [options ', ''topovec'', EEG.icawinv(:,' int2str(num) ... + '), ''elocs'', EEG.chanlocs, ''chaninfo'', EEG.chaninfo' ]; + end; + end; + + % add title + % --------- + if isempty( findstr( '''title''', result{6})) + if ~isempty(EEG.chanlocs) & typeproc + chanlabel = EEG.chanlocs(num).labels; + else + chanlabel = int2str(num); + end; + switch lower(result{4}) + case 'coher', options = [options ', ''title'',' fastif(typeproc, '''Channel ', '''Component ') chanlabel ... + ' power and inter-trial coherence' fastif(~ isempty(EEG.setname), [' (' EEG.setname ')''' ], '''') ]; + otherwise, options = [options ', ''title'',' fastif(typeproc, '''Channel ', '''Component ') chanlabel ... + ' power and inter-trial phase coherence' fastif(~ isempty(EEG.setname), [' (' EEG.setname ')''' ], '''') ]; + end; + end; + if ~isempty( result{5} ) + options = [ options ', ''alpha'',' result{5} ]; + end; + if ~isempty( result{6} ) + options = [ options ',' result{6} ]; + end; + if ~result{7} + options = [ options ', ''plotersp'', ''off''' ]; + end; + if ~result{8} + options = [ options ', ''plotitc'', ''off''' ]; + end; + figure; try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; +else + options = [ ',' vararg2str(varargin) ]; +end; + +% compute epoch limits +% -------------------- +if isempty(tlimits) + tlimits = [EEG.xmin, EEG.xmax]*1000; +end; +pointrange1 = round(max((tlimits(1)/1000-EEG.xmin)*EEG.srate, 1)); +pointrange2 = round(min((tlimits(2)/1000-EEG.xmin)*EEG.srate, EEG.pnts)); +pointrange = [pointrange1:pointrange2]; + +% call function sample either on raw data or ICA data +% --------------------------------------------------- +if typeproc == 1 + tmpsig = EEG.data(num,pointrange,:); +else + if ~isempty( EEG.icasphere ) + tmpsig = eeg_getdatact(EEG, 'component', num, 'samples', pointrange); + else + error('You must run ICA first'); + end; +end; + +% outputs +% ------- +outstr = ''; +if ~popup + for io = 1:nargout, outstr = [outstr 'varargout{' int2str(io) '},' ]; end; + if ~isempty(outstr), outstr = [ '[' outstr(1:end-1) '] =' ]; end; +end; + +% plot the datas and generate output command +% -------------------------------------------- +if length( options ) < 2 + options = ''; +end; +if nargin < 4 + varargout{1} = sprintf('figure; pop_timef( %s, %d, %d, %s, %s %s);', inputname(1), typeproc, num, ... + vararg2str({tlimits}), vararg2str({cycles}), options); +end; +com = sprintf('%s timef( tmpsig(:, :), length(pointrange), [tlimits(1) tlimits(2)], EEG.srate, cycles %s);', outstr, options); +eval(com) + +return; + +% get contextual help +% ------------------- +function txt = context(var, allvars, alltext); + loc = strmatch( var, allvars); + if ~isempty(loc) + txt= alltext{loc(1)}; + else + disp([ 'warning: variable ''' var ''' not found']); + txt = ''; + end; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_timtopo.m b/code/eeglab13_4_4b/functions/popfunc/pop_timtopo.m new file mode 100644 index 0000000..7f5ce13 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_timtopo.m @@ -0,0 +1,101 @@ +% pop_timtopo() - call the timtopo() function for epoched EEG datasets. +% Plots the epoch mean for each channel on a single axis, +% plus scalp maps of the data at specified latencies. +% Usage: +% >> pop_timtopo( EEG, timerange, topotimes, title, 'key', 'val', ...); +% +% Inputs: +% EEG - input dataset +% timerange - [min max] epoch time range (in ms) to plot +% topotimes - array of times to plot scalp maps {Default: NaN +% = display scalp map at frame of max var()} +% +% Optional inputs: +% title - optional plot title +% 'key','val' - optional topoplot() arguments (see >> help topoplot) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: timtopo() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 02-16-02 text interface editing -sm & ad +% 03-15-02 add all topoplot options -ad +% 03-18-02 added title -ad & sm + +function com = pop_timtopo( EEG, timerange, topotime, plottitle, varargin); + +com = ''; +if nargin < 1 + help pop_timtopo; + return; +end; + +if nargin < 3 + promptstr = { 'Plotting time range (ms):', ... + ['Scalp map latencies (ms, NaN -> max-RMS)'], ... + 'Plot title:' ... + 'Scalp map options (see >> help topoplot):' }; + inistr = { [num2str( EEG.xmin*1000) ' ' num2str(EEG.xmax*1000)], ... + 'NaN', ... + ['ERP data and scalp maps' fastif(~isempty(EEG.setname), [' of ' EEG.setname ], '') ], ... + '' }; + result = inputdlg2( promptstr, 'ERP data and scalp maps -- pop_timtopo()', 1, inistr, 'pop_timtopo'); + if size(result,1) == 0 return; end; + timerange = eval( [ '[' result{1} ']' ] ); + topotime = eval( [ '[' result{2} ']' ] ); + plottitle = result{3}; + options = [ ',' result{4} ]; + figure; +else + options = []; + for i=1:length( varargin ) + if isstr( varargin{ i } ) + options = [ options ', ''' varargin{i} '''' ]; + else + options = [ options ', [' num2str(varargin{i}) ']' ]; + end; + end; +end; +try, icadefs; set(gcf, 'color', BACKCOLOR, 'Name', ' timtopo()'); catch, end; + +if exist('plottitle') ~= 1 + plottitle = ['ERP data and scalp maps' fastif(~isempty(EEG.setname), [' of ' EEG.setname ], '') ]; +end; + +if ~isempty(EEG.chanlocs) + if ~isfield(EEG, 'chaninfo'), EEG.chaninfo = []; end; + SIGTMP = reshape(EEG.data, size(EEG.data,1), EEG.pnts, EEG.trials); + posi = round( (timerange(1)/1000-EEG.xmin)/(EEG.xmax-EEG.xmin) * (EEG.pnts-1))+1; + posf = round( (timerange(2)/1000-EEG.xmin)/(EEG.xmax-EEG.xmin) * (EEG.pnts-1))+1; + if length( options ) < 2 + timtopo( mean(SIGTMP(:,posi:posf,:),3), EEG.chanlocs, 'limits', [timerange(1) timerange(2) 0 0], 'plottimes', topotime, 'chaninfo', EEG.chaninfo); + com = sprintf('figure; pop_timtopo(%s, [%s], [%s], ''%s'');', inputname(1), num2str(timerange), num2str(topotime), plottitle); + else + com = sprintf('timtopo( mean(SIGTMP(:,posi:posf,:),3), EEG.chanlocs, ''limits'', [timerange(1) timerange(2) 0 0], ''plottimes'', topotime, ''chaninfo'', EEG.chaninfo %s);', options); + eval(com) + com = sprintf('figure; pop_timtopo(%s, [%s], [%s], ''%s'' %s);', inputname(1), num2str(timerange), num2str(topotime), plottitle, options); + end; +else + fprintf('Cannot make plot without channel locations\n'); + return; +end; +return; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_topoplot.m b/code/eeglab13_4_4b/functions/popfunc/pop_topoplot.m new file mode 100644 index 0000000..02bdb94 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_topoplot.m @@ -0,0 +1,389 @@ +% pop_topoplot() - Plot scalp map(s) in a figure window. If number of input +% arguments is less than 3, pop up an interactive query window. +% Makes (possibly repeated) calls to topoplot(). +% Usage: +% >> pop_topoplot( EEG); % pops up a parameter query window +% >> pop_topoplot( EEG, typeplot, items, title, plotdip, options...); % no pop-up +% +% Inputs: +% EEG - Input EEG dataset structure (see >> help eeglab) +% typeplot - 1-> Plot channel ERP maps; 0-> Plot component maps {default:1}. +% +% Commandline inputs also set in pop-up window: +% items - [array] If typeplot==1 (ERP maps), within-epoch latencies +% (ms) at which to plot the maps. If typeplot==0 (component +% maps), component indices to plot. In this case, +% negative map indices -> invert map polarity, or +% NaN -> leave a blank subplot. (Ex: [1 -3 NaN 4]) +% title - Plot title. +% rowscols - Vector of the form [m,n] giving [rows, cols] per page. +% If the number of maps exceeds m*n, multiple figures +% are produced {default|0 -> one near-square page}. +% plotdip - [0|1] plot associated dipole(s) for scalp map if present +% in dataset. +% +% Optional Key-Value Pair Inputs +% 'colorbar' - ['on' or 'off'] Switch to turn colorbar on or off. {Default: 'on'} +% options - optional topoplot() arguments. Separate using commas. +% Example 'style', 'straight'. See >> help topoplot +% for further details. {default: none} +% +% Note: +% A new figure is created automatically only when the pop_up window is +% called or when more than one page of maps are plotted. Thus, this +% command may be used to draw topographic maps in a figure sub-axis. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: topoplot(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 02-15-02 text interface editing -sm & ad +% 02-16-02 added axcopy -ad & sm +% 03-18-02 added title -ad & sm + +function com = pop_topoplot( EEG, typeplot, arg2, topotitle, rowcols, varargin); + +com = ''; +if nargin < 1 + help pop_topoplot; + return; +end; +if nargin < 2 + typeplot = 1; +end; +if typeplot == 0 & isempty(EEG.icasphere) + disp('Error: no ICA data for this set, first run ICA'); return; +end; +if isempty(EEG.chanlocs) + disp('Error: cannot plot topography without channel location file'); return; +end; + +if nargin < 3 + % which set to save + % ----------------- + if typeplot + txtwhat2plot1 = 'Plotting ERP scalp maps at these latencies'; + txtwhat2plot2 = sprintf('(range: %d to %d ms, NaN -> empty):', ... + round(EEG.xmin*1000), round(EEG.xmax*1000)); + editwhat2plot = ['']; + else + txtwhat2plot1 = 'Component numbers'; + txtwhat2plot2 = '(negate index to invert component polarity; NaN -> empty subplot; Ex: -1 NaN 3)'; + editwhat2plot = ['1:' int2str(size(EEG.icaweights,1))]; + end; + if EEG.nbchan > 64, + elecdef = ['''electrodes'', ''off''']; + else, + elecdef = ['''electrodes'', ''on''']; + end; + uilist = { { 'style' 'text' 'string' txtwhat2plot1 } ... + { 'style' 'edit' 'string' editwhat2plot } ... + { 'style' 'text' 'string' txtwhat2plot2 } ... + { } ... + { 'style' 'text' 'string' 'Plot title' } ... + { 'style' 'edit' 'string' fastif(~isempty(EEG.setname), [EEG.setname], '') } ... + { 'style' 'text' 'string' 'Plot geometry (rows,col.); [] -> near square' } ... + { 'style' 'edit' 'string' '[]' } ... + { 'style' 'text' 'string' 'Plot associated dipole(s) (if present)' } ... + { 'style' 'checkbox' 'string' '' } { } ... + { } ... + { 'style' 'text' 'string' [ '-> Additional topoplot()' fastif(typeplot,'',' (and dipole)') ... + ' options (see Help)' ] } ... + { 'style' 'edit' 'string' elecdef } }; + uigeom = { [1.5 1] [1] [1] [1.5 1] [1.5 1] [1.55 0.2 0.8] [1] [1] [1] }; + if typeplot + uilist(9:11) = []; + uigeom(6) = []; + end; + guititle = fastif( typeplot, 'Plot ERP scalp maps in 2-D -- pop_topoplot()', ... + 'Plot component scalp maps in 2-D -- pop_topoplot()'); + + result = inputgui( uigeom, uilist, 'pophelp(''pop_topoplot'')', guititle, [], 'normal'); + if length(result) == 0 return; end; + + % reading first param + % ------------------- + arg2 = eval( [ '[' result{1} ']' ] ); + if length(arg2) > EEG.nbchan + tmpbut = questdlg2(... + ['This involves drawing ' int2str(length(arg2)) ' plots. Continue ?'], ... + '', 'Cancel', 'Yes', 'Yes'); + if strcmp(tmpbut, 'Cancel'), return; end; + end; + if isempty(arg2), error('Nothing to plot; enter parameter in first edit box'); end; + + % reading other params + % -------------------- + topotitle = result{2}; + rowcols = eval( [ '[' result{3} ']' ] ); + if typeplot + plotdip = 0; + try, options = eval( [ '{ ' result{4} ' }' ]); + catch, error('Invalid scalp map options'); end; + else + plotdip = result{4}; + try, options = eval( [ '{ ' result{5} ' }' ]); + catch, error('Invalid scalp map options'); end; + end; + if length(arg2) == 1, + figure('paperpositionmode', 'auto'); curfig=gcf; + try, icadefs; + set(curfig, 'color', BACKCOLOR); + catch, end; + end; +else + if ~isempty(varargin) & isnumeric(varargin{1}) + plotdip = varargin{1}; + varargin = varargin(2:end); + else + plotdip = 0; + end; + options = varargin; +end; + +% additional options +% ------------------ +outoptions = { options{:} }; % for command +options = { options{:} 'masksurf' 'on' }; + +% find maplimits +% -------------- +maplimits = []; +for i=1:2:length(options) + if isstr(options{i}) + if strcmpi(options{i}, 'maplimits') + maplimits = options{i+1}; + options(i:i+1) = []; + break; + end; + end; +end; + +nbgraph = size(arg2(:),1); +if ~exist('topotitle') + topotitle = ''; +end; +if ~exist('rowcols') | isempty(rowcols) | rowcols == 0 + rowcols(2) = ceil(sqrt(nbgraph)); + rowcols(1) = ceil(nbgraph/rowcols(2)); +end; + +SIZEBOX = 150; + +fprintf('Plotting...\n'); +if isempty(EEG.chanlocs) + fprintf('Error: set has no channel location file\n'); + return; +end; + +% Check if pop_topoplot input 'colorbar' was called, and don't send it to topoplot +loc = strmatch('colorbar', options(1:2:end), 'exact'); +loc = loc*2-1; +if ~isempty(loc) + colorbar_switch = strcmp('on',options{ loc+1 }); + options(loc:loc+1) = []; +else + colorbar_switch = 1; +end + +% determine the scale for plot of different times (same scales) +% ------------------------------------------------------------- +if typeplot + SIGTMP = reshape(EEG.data, EEG.nbchan, EEG.pnts, EEG.trials); + pos = round( (arg2/1000-EEG.xmin)/(EEG.xmax-EEG.xmin) * (EEG.pnts-1))+1; + nanpos = find(isnan(pos)); + pos(nanpos) = 1; + SIGTMPAVG = mean(SIGTMP(:,pos,:),3); + SIGTMPAVG(:, nanpos) = NaN; + if isempty(maplimits) + maxlim = max(SIGTMPAVG(:)); + minlim = min(SIGTMPAVG(:)); + maplimits = [ -max(maxlim, -minlim) max(maxlim, -minlim)]; + end; +else + if isempty(maplimits) + maplimits = 'absmax'; + end; +end; + +if plotdip + if strcmpi(EEG.dipfit.coordformat, 'CTF') + disp('Cannot plot dipole on scalp map for CTF MEG data'); + end; +end; + +% plot the graphs +% --------------- +counter = 1; +countobj = 1; +allobj = zeros(1,1000); +curfig = get(0, 'currentfigure'); +if isfield(EEG, 'chaninfo'), options = { options{:} 'chaninfo' EEG.chaninfo }; end + +for index = 1:size(arg2(:),1) + if nbgraph > 1 + if mod(index, rowcols(1)*rowcols(2)) == 1 + if index> 1, figure(curfig); a = textsc(0.5, 0.05, topotitle); set(a, 'fontweight', 'bold'); end; + curfig = figure('paperpositionmode', 'auto'); + pos = get(curfig,'Position'); + posx = max(0, pos(1)+(pos(3)-SIZEBOX*rowcols(2))/2); + posy = pos(2)+pos(4)-SIZEBOX*rowcols(1); + set(curfig,'Position', [posx posy SIZEBOX*rowcols(2) SIZEBOX*rowcols(1)]); + try, icadefs; set(curfig, 'color', BACKCOLOR); catch, end; + end; + curax = subplot( rowcols(1), rowcols(2), mod(index-1, rowcols(1)*rowcols(2))+1); + set(curax, 'visible', 'off') + end; + + % add dipole location if present + % ------------------------------ + dipoleplotted = 0; + if plotdip && typeplot == 0 + if isfield(EEG, 'dipfit') & isfield(EEG.dipfit, 'model') + if length(EEG.dipfit.model) >= index & ~strcmpi(EEG.dipfit.coordformat, 'CTF') + %curpos = EEG.dipfit.model(arg2(index)).posxyz/EEG.dipfit.vol.r(end); + curpos = EEG.dipfit.model(arg2(index)).posxyz; + curmom = EEG.dipfit.model(arg2(index)).momxyz; + try, + select = EEG.dipfit.model(arg2(index)).select; + catch select = 0; + end; + if ~isempty(curpos) + if strcmpi(EEG.dipfit.coordformat, 'MNI') % from MNI to sperical coordinates + transform = pinv( sph2spm ); + tmpres = transform * [ curpos(1,:) 1 ]'; curpos(1,:) = tmpres(1:3); + tmpres = transform * [ curmom(1,:) 1 ]'; curmom(1,:) = tmpres(1:3); + try, tmpres = transform * [ curpos(2,:) 1 ]'; curpos(2,:) = tmpres(1:3); catch, end; + try, tmpres = transform * [ curmom(2,:) 1 ]'; curmom(2,:) = tmpres(1:3); catch, end; + end; + curpos = curpos / 85; + if size(curpos,1) > 1 && length(select) == 2 + dipole_index = find(strcmpi('dipole',options),1); + if ~isempty(dipole_index) % if 'dipoles' is already defined in options{:} + options{dipole_index+1} = [ curpos(:,1:2) curmom(:,1:3) ]; + else + options = { options{:} 'dipole' [ curpos(:,1:2) curmom(:,1:3) ] }; + end + dipoleplotted = 1; + else + if any(curpos(1,:) ~= 0) + dipole_index = find(strcmpi('dipole',options),1); + if ~isempty(dipole_index) % if 'dipoles' is already defined in options{:} + options{dipole_index+1} = [ curpos(1,1:2) curmom(1,1:3) ]; + else + options = { options{:} 'dipole' [ curpos(1,1:2) curmom(1,1:3) ] }; + end + dipoleplotted = 1; + end + end + end + if nbgraph ~= 1 + dipscale_index = find(strcmpi('dipscale',options),1); + if ~isempty(dipscale_index) % if 'dipscale' is already defined in options{:} + options{dipscale_index+1} = 0.6; + else + options = { options{:} 'dipscale' 0.6 }; + end + end + %options = { options{:} 'dipsphere' max(EEG.dipfit.vol.r) }; + end + end + end + + % plot scalp map + % -------------- + if index == 1 + addopt = { 'verbose', 'on' }; + else + addopt = { 'verbose', 'off' }; + end; + %fprintf('Printing to figure %d.\n',curfig); + options = { 'maplimits' maplimits options{:} addopt{:} }; + if ~isnan(arg2(index)) + if typeplot + if nbgraph > 1, axes(curax); end; + tmpobj = topoplot( SIGTMPAVG(:,index), EEG.chanlocs, options{:}); + if nbgraph == 1, + figure(curfig); if nbgraph > 1, axes(curax); end; + title( [ 'Latency ' int2str(arg2(index)) ' ms from ' topotitle]); + else + figure(curfig); if nbgraph > 1, axes(curax); end; + title([int2str(arg2(index)) ' ms'] ); + end; + else + if arg2(index) < 0 + figure(curfig); if nbgraph > 1, axes(curax); end; + tmpobj = topoplot( -EEG.icawinv(:, -arg2(index)), EEG.chanlocs, options{:} ); + else + figure(curfig); if nbgraph > 1, axes(curax); end; + tmpobj = topoplot( EEG.icawinv(:, arg2(index)), EEG.chanlocs, options{:} ); + end; + if nbgraph == 1, texttitle = [ 'IC ' int2str(arg2(index)) ' from ' topotitle]; + else texttitle = ['' int2str(arg2(index))]; + end; + if dipoleplotted, texttitle = [ texttitle ' (' num2str(EEG.dipfit.model(arg2(index)).rv*100,2) '%)']; end; + figure(curfig); if nbgraph > 1, axes(curax); end; title(texttitle); + end; + allobj(countobj:countobj+length(tmpobj)-1) = tmpobj; + countobj = countobj+length(tmpobj); + drawnow; + axis square; + else + axis off + end; +end + +% Draw colorbar +if colorbar_switch + if nbgraph == 1 + if ~isstr(maplimits) + ColorbarHandle = cbar(0,0,[maplimits(1) maplimits(2)]); + else + ColorbarHandle = cbar(0,0,get(gca, 'clim')); + end; + pos = get(ColorbarHandle,'position'); % move left & shrink to match head size + set(ColorbarHandle,'position',[pos(1)-.05 pos(2)+0.13 pos(3)*0.7 pos(4)-0.26]); + elseif ~isstr(maplimits) + cbar('vert',0,[maplimits(1) maplimits(2)]); + else cbar('vert',0,get(gca, 'clim')); + end + if ~typeplot % Draw '+' and '-' instead of numbers for colorbar tick labels + tmp = get(gca, 'ytick'); + set(gca, 'ytickmode', 'manual', 'yticklabelmode', 'manual', 'ytick', [tmp(1) tmp(end)], 'yticklabel', { '-' '+' }); + end +end + +if nbgraph> 1, + figure(curfig); a = textsc(0.5, 0.05, topotitle); + set(a, 'fontweight', 'bold'); +end; +if nbgraph== 1, + com = 'figure;'; +end; +set(allobj(1:countobj-1), 'visible', 'on'); + +figure(curfig); +axcopy(curfig, 'set(gcf, ''''units'''', ''''pixels''''); postmp = get(gcf, ''''position''''); set(gcf, ''''position'''', [postmp(1) postmp(2) 560 420]); clear postmp;'); + +com = [com sprintf('pop_topoplot(%s,%d, %s);', ... + inputname(1), typeplot, vararg2str({arg2 topotitle rowcols plotdip outoptions{:} }))]; +return; + + diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_writeeeg.m b/code/eeglab13_4_4b/functions/popfunc/pop_writeeeg.m new file mode 100644 index 0000000..78c97e1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_writeeeg.m @@ -0,0 +1,76 @@ +% pop_writeeeg - write EEGLAB dataset to disk in EDF/GDF or BDF format +% +% pop_writeeeg( EEG ) % pops up a window +% pop_writeeeg( EEG, filename, 'key', 'val' ) +% +% Inputs: +% EEG - EEGLAB dataset +% filename - [string] filename +% +% Optional keys (same as writeeeg): +% 'TYPE' - ['GDF'|'EDF'|'BDF'|'CFWB'|'CNT'] file format for writing +% default is 'EDF'. +% See writeeeg for more information +% +% Author: Arnaud Delorme, SCCN, UCSD/CERCO, 2009 +% Based on BIOSIG, sopen and swrite + +% Copyright (C) 22 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [command] = pop_writeeeg(EEG, filename, varargin); +command = ''; + +if nargin < 2 + if EEG.trials > 1 + res = questdlg2( [ 'This dataset contains data epochs.' 10 'Do you want to export the concatenated' 10 'data epochs?' ], '', 'No', 'Yes', 'Yes'); + if strcmpi(res, 'No') + return; + end; + end; + + % ask user + [filename, filepath] = uiputfile('*.*', 'Enter a file name -- pop_writeeeg()'); + if filename == 0 return; end; + filename = fullfile(filepath,filename); + + % file format + % ----------- + fileformats = { 'EDF' 'GDF' 'BDF' }; + uilist = { { 'style' 'text' 'String' 'File format' } ... + { 'style' 'listbox' 'string' strvcat(fileformats) 'value' 1 } }; + geom = [1 1]; + result = inputgui( 'geometry', geom, 'uilist', uilist, 'helpcom', 'pophelp(''pop_writeeeg'')', ... + 'title', 'Write data using BIOSIG -- pop_writeeeg()', 'geomvert', [1 2.5]); + if length(result) == 0 return; end; + + options = { 'TYPE' fileformats{result{1}} }; +else + options = varargin; +end; + +warning('off', 'MATLAB:intConvertNonIntVal'); +if ~isempty(EEG.chanlocs) + tmpchanlocs = EEG.chanlocs; + writeeeg(filename, EEG.data(:,:), EEG.srate, 'label', { tmpchanlocs.labels }, 'EVENT', EEG.event, options{:}); +else + writeeeg(filename, EEG.data(:,:), EEG.srate, 'EVENT', EEG.event, options{:}); +end; +warning('on', 'MATLAB:intConvertNonIntVal'); + +command = sprintf('pop_writeeeg(EEG, ''%s'', %s);', filename, vararg2str(options)); + +return; diff --git a/code/eeglab13_4_4b/functions/popfunc/pop_writelocs.m b/code/eeglab13_4_4b/functions/popfunc/pop_writelocs.m new file mode 100644 index 0000000..573acd8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/popfunc/pop_writelocs.m @@ -0,0 +1,180 @@ +% pop_writelocs() - load a EGI EEG file (pop out window if no arguments). +% +% Usage: +% >> EEG = pop_writelocs(chanstruct); % a window pops up +% >> EEG = pop_writelocs(chanstruct, filename, 'key', val, ...); +% +% Inputs: +% chanstruct - channel structure. See readlocs() +% filename - Electrode location file name +% 'key',val - same as writelocs() +% +% Author: Arnaud Delorme, CNL / Salk Institute, 17 Dec 2002 +% +% See also: writelocs() + +% Copyright (C) Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function com = pop_writelocs(chans, filename, varargin); + +com = ''; +if nargin < 1 + help pop_writelocs; + return; +end; + +if isfield(chans, 'shrink') + chans = rmfield(chans, 'shrink'); + disp('Warning: shrink factor ignored'); +end; + +disp('WARNING: ELECTRODE COORDINATES MUST BE WITH NOSE ALONG THE +X DIMENSION TO BE EXPORTED') +disp(' IF NOT, THE EXPORTED FILE COORDINATES MAY BE INNACURATE') + +% get infos from readlocs +% ----------------------- +[chanformat listcolformat] = readlocs('getinfos'); +chanformat(end) = []; +listcolformat(end) = []; % remove chanedit +chanformat(end) = []; +listcolformat(end) = []; % remove chanedit +indformat = []; +for index = 1:length(chanformat), + if ~isstr(chanformat(index).importformat) + indformat = [ indformat index ]; + end; + if isempty(chanformat(index).skipline), chanformat(index).skipline = 0; end; +end; +listtype = { chanformat(indformat).type }; +formatinfo = { chanformat(indformat).importformat }; +formatskip = [ chanformat(indformat).skipline ]; + +%[listtype formatinfo listcolformat formatskip] = readlocs('getinfoswrite'); + +listtype{end+1} = 'custom'; +formatinfo{end+1} = {}; +formatskip = [ formatskip 0]; + +if nargin < 2 + updatefields = [ 'tmpdata = get(gcf, ''userdata'');' ... + 'tmpobj = findobj(gcf, ''tag'', ''list2'');' ... + 'set(tmpobj, ''string'', strvcat(tmpdata{2}));' ... + 'clear tmpobj tmpdata;' ]; + addfieldcom = [ 'tmpdata = get(gcbf, ''userdata'');' ... + 'tmpobj = findobj(gcf, ''tag'', ''list1'');' ... + 'tmpdata{2}{end+1} = tmpdata{1}{get(tmpobj, ''value'')};' ... + 'set(gcbf, ''userdata'', tmpdata);' ... + updatefields ]; + rmfieldcom = [ 'tmpdata = get(gcbf, ''userdata'');' ... + 'tmpobj = findobj(gcbf, ''tag'', ''list2'');' ... + 'try, tmpdata{2}(get(tmpobj, ''value'')) = [];' ... + ' set(tmpobj, ''value'', 1);' ... + 'catch, end;' ... + 'set(gcbf, ''userdata'', tmpdata);' ... + updatefields ]; + filetypecom = [ 'tmpdata = get(gcf, ''userdata'');' ... + 'tmpobj = findobj(gcf, ''tag'', ''formatlist'');' ... + 'tmpval = get(tmpobj, ''value'');' ... + 'try, tmpdata{2} = tmpdata{3}{tmpval}; catch, end;' ... %try and catch for custom + 'set(gcf, ''userdata'', tmpdata);' ... + updatefields ... + 'tmpdata = get(gcf, ''userdata'');' ... + 'tmpobj1 = findobj(gcf, ''tag'', ''insertcol'');' ... % the lines below + 'tmpobj2 = findobj(gcf, ''tag'', ''inserttext'');' ... % update the checkbox + 'try, ' ... % and the edit text box + ' if tmpdata{4}(tmpval) == 2,' ... + ' set(tmpobj1, ''value'', 1);' ... + ' else,' ... + ' set(tmpobj1, ''value'', 0);' ... + ' end;' ... + ' if tmpval == 1,' ... % besa only + ' set(tmpobj2, ''string'', ''' int2str(length(chans)) ''');' ... + ' else,' ... + ' set(tmpobj2, ''string'', '''');' ... + ' end;' ... + 'catch, end;' ... % catch for custom case + 'tmpobj = findobj(gcf, ''userdata'', ''setfield'');' ... + 'if tmpval == ' int2str(length(listtype)) ',' ... % disable if non-custom type + ' set(tmpobj, ''enable'', ''on'');' ... + 'else,' ... + ' set(tmpobj, ''enable'', ''off'');' ... + 'end; clear tmpobj tmpobj2 tmpdata tmpval;' ]; + + geometry = { [1 1 1] [1 1] [1] [1 1 1] [1 1] [1 1 1] [1 0.3 0.7] [1] [1] }; + listui = { ... + { 'style' 'text' 'string' 'Filename' } ... + { 'style' 'edit' 'string' '' 'tag' 'filename' 'horizontalalignment' 'left' } ... + { 'style' 'pushbutton' 'string' 'Browse' 'callback' ... + [ '[tmpfile tmppath] = uiputfile(''*'', ''Exporting electrode location file -- pop_writelocs()'');' ... + 'set(findobj(gcbf, ''tag'', ''filename''), ''string'', char([tmppath tmpfile ]));' ... + 'clear tmpfile tmppath;' ] } ... + { 'style' 'text' 'string' strvcat('Select output file type', ' ', ' ') } ... + { 'style' 'listbox' 'tag' 'formatlist' 'string' strvcat(listtype) ... + 'value' length(listtype) 'callback' filetypecom } ... + { 'style' 'text' 'string' 'Select fields to export below' } ... + { } { 'style' 'pushbutton' 'string' '-> ADD' 'callback' addfieldcom 'userdata' 'setfield' } { } ... + { 'style' 'listbox' 'tag' 'list1' 'string' strvcat(fieldnames(chans)) 'userdata' 'setfield' } ... + { 'style' 'listbox' 'tag' 'list2' 'string' '' 'userdata' 'setfield2' } ... + { } { 'style' 'pushbutton' 'string' 'REMOVE <-' 'callback' rmfieldcom 'userdata' 'setfield' } { } ... + { 'style' 'text' 'string' 'Insert column names' } ... + { 'style' 'checkbox' 'tag' 'insertcol' 'value' 1 'userdata' 'setfield' } { } ... + { 'style' 'text' 'string' 'Enter custom header below' } ... + { 'style' 'edit' 'userdata' 'setfield' 'tag' 'inserttext' 'horizontalalignment' 'left' 'max' 2 } ... + }; + + inputgui(geometry, listui, 'pophelp(''writelocs'');', ... + 'Exporting electrode location file -- pop_writelocs()', { fieldnames(chans) {} formatinfo formatskip }, 'plot', [1 3 1 1 3 1 1 1 3 ]); + fig = gcf; + + % set default format + tmpobj = findobj(fig, 'tag', 'formatlist'); + set(tmpobj, 'value', 6); + eval(get(tmpobj, 'callback')); + + res = inputgui(geometry, listui, 'pophelp(''writelocs'');', ... + 'Exporting electrode location file -- pop_writelocs()', { listcolformat {} formatinfo formatskip }, fig, [1 3 1 1 3 1 1 1 3 ]); + if gcf ~= fig, return; end; + exportfields = get(fig, 'userdata'); + exportfields = exportfields{2}; + close(fig); + + % decode the inputs + filename = res{1}; + if isempty(filename), + errordlg2('Error: Empty file name', 'Error'); + return; + end; + options = { 'filetype' listtype{res{2}} 'format' exportfields ... + 'header' fastif(res{5}, 'on', 'off') 'customheader' res{6} }; +else + options = varargin; +end; + +% generate history +% ---------------- +if isempty(inputname(1)) % not a variable name -> probably the structure from pop_chanedit + writelocs(chans, filename, options{:}); + com = sprintf('pop_writelocs( EEG.chanlocs, ''%s'', %s);', filename, vararg2str(options)); +else + if strcmpi(inputname(1), 'chantmp') + % do not write file (yet) + com = sprintf('pop_writelocs( chans, ''%s'', %s);', filename, vararg2str(options)); + else + writelocs(chans, filename, options{:}); + com = sprintf('pop_writelocs( %s, ''%s'', %s);', inputname(1), filename, vararg2str(options)); + end; +end; diff --git a/code/eeglab13_4_4b/functions/resources/Standard-10-20-Cap81.ced b/code/eeglab13_4_4b/functions/resources/Standard-10-20-Cap81.ced new file mode 100644 index 0000000..81ec13c --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/Standard-10-20-Cap81.ced @@ -0,0 +1,82 @@ +Number labels theta radius X Y Z sph_theta sph_phi sph_radius +1 Fp1 -18 0.511 0.95 0.309 -0.0349 18 -2 1 +2 Fpz 0 0.511 0.999 -0 -0.0349 -0 -2 1 +3 Fp2 18 0.511 0.95 -0.309 -0.0349 -18 -2 1 +4 Nz 0 0.622 0.927 -0 -0.375 -0 -22 1 +5 AF9 -43 0.639 0.663 0.618 -0.423 43 -25 1 +6 AF7 -38 0.511 0.788 0.615 -0.0349 38 -2 1 +7 AF3 -23 0.411 0.885 0.376 0.276 23 16 1 +8 AFz 0 0.383 0.934 -0 0.358 -0 21 1 +9 AF4 23 0.411 0.885 -0.376 0.276 -23 16 1 +10 AF8 38 0.511 0.788 -0.615 -0.0349 -38 -2 1 +11 AF10 43 0.639 0.663 -0.618 -0.423 -43 -25 1 +12 F9 -55 0.639 0.52 0.742 -0.423 55 -25 1 +13 F7 -54 0.511 0.587 0.809 -0.0349 54 -2 1 +14 F5 -49 0.417 0.634 0.729 0.259 49 15 1 +15 F3 -39 0.333 0.673 0.545 0.5 39 30 1 +16 F1 -22 0.278 0.71 0.287 0.643 22 40 1 +17 Fz 0 0.256 0.719 -0 0.695 -0 44 1 +18 F2 22 0.278 0.71 -0.287 0.643 -22 40 1 +19 F4 39 0.333 0.673 -0.545 0.5 -39 30 1 +20 F6 49 0.417 0.634 -0.729 0.259 -49 15 1 +21 F8 54 0.511 0.587 -0.809 -0.0349 -54 -2 1 +22 F10 55 0.639 0.52 -0.742 -0.423 -55 -25 1 +23 FT9 -72 0.639 0.28 0.862 -0.423 72 -25 1 +24 FT7 -72 0.511 0.309 0.95 -0.0349 72 -2 1 +25 FC5 -69 0.394 0.339 0.883 0.326 69 19 1 +26 FC3 -62 0.278 0.36 0.676 0.643 62 40 1 +27 FC1 -45 0.178 0.375 0.375 0.848 45 58 1 +28 FCz 0 0.128 0.391 -0 0.921 -0 67 1 +29 FC2 45 0.178 0.375 -0.375 0.848 -45 58 1 +30 FC4 62 0.278 0.36 -0.676 0.643 -62 40 1 +31 FC6 69 0.394 0.339 -0.883 0.326 -69 19 1 +32 FT8 72 0.511 0.309 -0.95 -0.0349 -72 -2 1 +33 FT10 72 0.639 0.28 -0.862 -0.423 -72 -25 1 +34 T9 -90 0.639 5.55e-17 0.906 -0.423 90 -25 1 +35 T7 -90 0.511 6.12e-17 0.999 -0.0349 90 -2 1 +36 C5 -90 0.383 5.72e-17 0.934 0.358 90 21 1 +37 C3 -90 0.256 4.4e-17 0.719 0.695 90 44 1 +38 C1 -90 0.128 2.39e-17 0.391 0.921 90 67 1 +39 Cz 90 0 3.75e-33 -6.12e-17 1 -90 90 1 +40 C2 90 0.128 2.39e-17 -0.391 0.921 -90 67 1 +41 C4 90 0.256 4.4e-17 -0.719 0.695 -90 44 1 +42 C6 90 0.383 5.72e-17 -0.934 0.358 -90 21 1 +43 T8 90 0.511 6.12e-17 -0.999 -0.0349 -90 -2 1 +44 T10 90 0.639 5.55e-17 -0.906 -0.423 -90 -25 1 +45 TP9 -108 0.639 -0.28 0.862 -0.423 108 -25 1 +46 TP7 -108 0.511 -0.309 0.95 -0.0349 108 -2 1 +47 CP5 -111 0.394 -0.339 0.883 0.326 111 19 1 +48 CP3 -118 0.278 -0.36 0.676 0.643 118 40 1 +49 CP1 -135 0.178 -0.375 0.375 0.848 135 58 1 +50 CPz 180 0.128 -0.391 -4.79e-17 0.921 -180 67 1 +51 CP2 135 0.178 -0.375 -0.375 0.848 -135 58 1 +52 CP4 118 0.278 -0.36 -0.676 0.643 -118 40 1 +53 CP6 111 0.394 -0.339 -0.883 0.326 -111 19 1 +54 TP8 108 0.511 -0.309 -0.95 -0.0349 -108 -2 1 +55 TP10 108 0.639 -0.28 -0.862 -0.423 -108 -25 1 +56 P9 -126 0.639 -0.533 0.733 -0.423 126 -25 1 +57 P7 -126 0.511 -0.587 0.809 -0.0349 126 -2 1 +58 P5 -131 0.417 -0.634 0.729 0.259 131 15 1 +59 P3 -141 0.333 -0.673 0.545 0.5 141 30 1 +60 P1 -158 0.278 -0.71 0.287 0.643 158 40 1 +61 Pz 180 0.256 -0.719 -8.81e-17 0.695 -180 44 1 +62 P2 158 0.278 -0.71 -0.287 0.643 -158 40 1 +63 P4 141 0.333 -0.673 -0.545 0.5 -141 30 1 +64 P6 131 0.417 -0.634 -0.729 0.259 -131 15 1 +65 P8 126 0.511 -0.587 -0.809 -0.0349 -126 -2 1 +66 P10 126 0.639 -0.533 -0.733 -0.423 -126 -25 1 +67 PO9 -144 0.639 -0.733 0.533 -0.423 144 -25 1 +68 PO7 -144 0.511 -0.809 0.587 -0.0349 144 -2 1 +69 PO3 -157 0.411 -0.885 0.376 0.276 157 16 1 +70 POz 180 0.383 -0.934 -1.14e-16 0.358 -180 21 1 +71 PO4 157 0.411 -0.885 -0.376 0.276 -157 16 1 +72 PO8 144 0.511 -0.809 -0.587 -0.0349 -144 -2 1 +73 PO10 144 0.639 -0.733 -0.533 -0.423 -144 -25 1 +74 O1 -162 0.511 -0.95 0.309 -0.0349 162 -2 1 +75 Oz 180 0.511 -0.999 -1.22e-16 -0.0349 -180 -2 1 +76 O2 162 0.511 -0.95 -0.309 -0.0349 -162 -2 1 +77 O9 -162 0.639 -0.862 0.28 -0.423 162 -25 1 +78 O10 162 0.639 -0.862 -0.28 -0.423 -162 -25 1 +79 CB1 -135 0.722 -0.542 0.542 -0.643 135 -40 1 +80 CB2 135 0.722 -0.542 -0.542 -0.643 -135 -40 1 +81 Iz 180 0.639 -0.906 -1.11e-16 -0.423 -180 -25 1 diff --git a/code/eeglab13_4_4b/functions/resources/Standard-10-5-Cap385.sfp b/code/eeglab13_4_4b/functions/resources/Standard-10-5-Cap385.sfp new file mode 100644 index 0000000..e8e3697 --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/Standard-10-5-Cap385.sfp @@ -0,0 +1,348 @@ +LPA -0.0865 0.0000 -0.0500 +RPA 0.0865 0.0000 -0.0500 +Nz 0.0000 0.0913 -0.0407 +Fp1 -0.0307 0.0949 -0.0047 +Fpz 0.0000 0.0999 -0.0021 +Fp2 0.0307 0.0949 -0.0047 +AF9 -0.0512 0.0723 -0.0462 +AF7 -0.0584 0.0807 -0.0070 +AF5 -0.0505 0.0856 0.0105 +AF3 -0.0370 0.0895 0.0245 +AF1 -0.0196 0.0920 0.0336 +AFz -0.0000 0.0929 0.0368 +AF2 0.0195 0.0921 0.0336 +AF4 0.0370 0.0895 0.0245 +AF6 0.0505 0.0856 0.0105 +AF8 0.0584 0.0808 -0.0070 +AF10 0.0512 0.0724 -0.0462 +F9 -0.0702 0.0523 -0.0482 +F7 -0.0804 0.0586 -0.0088 +F5 -0.0741 0.0635 0.0213 +F3 -0.0567 0.0677 0.0469 +F1 -0.0306 0.0704 0.0639 +Fz 0.0000 0.0714 0.0699 +F2 0.0306 0.0704 0.0640 +F4 0.0566 0.0677 0.0469 +F6 0.0741 0.0635 0.0214 +F8 0.0804 0.0587 -0.0088 +F10 0.0702 0.0523 -0.0482 +FT9 -0.0824 0.0274 -0.0495 +FT7 -0.0945 0.0308 -0.0100 +FC5 -0.0896 0.0338 0.0284 +FC3 -0.0697 0.0364 0.0617 +FC1 -0.0380 0.0381 0.0841 +FCz 0.0000 0.0387 0.0921 +FC2 0.0380 0.0381 0.0841 +FC4 0.0697 0.0364 0.0617 +FC6 0.0896 0.0338 0.0284 +FT8 0.0945 0.0308 -0.0100 +FT10 0.0824 0.0274 -0.0495 +T9 -0.0865 0.0000 -0.0500 +T7 -0.0994 0.0000 -0.0104 +C5 -0.0950 0.0000 0.0309 +C3 -0.0742 0.0000 0.0668 +C1 -0.0406 -0.0000 0.0913 +Cz 0.0000 0.0000 0.1000 +C2 0.0407 0.0000 0.0913 +C4 0.0743 0.0000 0.0669 +C6 0.0950 0.0000 0.0309 +T8 0.0994 0.0000 -0.0104 +T10 0.0865 0.0000 -0.0500 +TP9 -0.0824 -0.0274 -0.0495 +TP7 -0.0945 -0.0308 -0.0100 +CP5 -0.0896 -0.0338 0.0284 +CP3 -0.0697 -0.0364 0.0617 +CP1 -0.0380 -0.0381 0.0841 +CPz 0.0000 -0.0387 0.0921 +CP2 0.0380 -0.0381 0.0841 +CP4 0.0697 -0.0364 0.0617 +CP6 0.0896 -0.0338 0.0284 +TP8 0.0945 -0.0309 -0.0100 +TP10 0.0824 -0.0274 -0.0495 +P9 -0.0702 -0.0523 -0.0482 +P7 -0.0804 -0.0586 -0.0088 +P5 -0.0741 -0.0635 0.0213 +P3 -0.0567 -0.0677 0.0469 +P1 -0.0306 -0.0704 0.0639 +Pz 0.0000 -0.0714 0.0699 +P2 0.0306 -0.0704 0.0640 +P4 0.0566 -0.0677 0.0469 +P6 0.0741 -0.0635 0.0214 +P8 0.0804 -0.0587 -0.0088 +P10 0.0702 -0.0523 -0.0482 +PO9 -0.0512 -0.0723 -0.0462 +PO7 -0.0584 -0.0807 -0.0070 +PO5 -0.0505 -0.0856 0.0105 +PO3 -0.0370 -0.0895 0.0245 +PO1 -0.0196 -0.0920 0.0336 +POz 0.0000 -0.0929 0.0368 +PO2 0.0195 -0.0921 0.0336 +PO4 0.0370 -0.0895 0.0245 +PO6 0.0505 -0.0856 0.0105 +PO8 0.0584 -0.0808 -0.0070 +PO10 0.0512 -0.0724 -0.0462 +O1 -0.0307 -0.0949 -0.0047 +Oz 0.0000 -0.0999 -0.0021 +O2 0.0307 -0.0949 -0.0047 +I1 -0.0270 -0.0858 -0.0436 +O9 -0.0270 -0.0858 -0.0436 +Iz -0.0000 -0.0913 -0.0407 +I2 0.0270 -0.0858 -0.0436 +O10 0.0270 -0.0858 -0.0436 +AFp9h -0.0433 0.0863 -0.0259 +AFp7h -0.0412 0.0910 -0.0007 +AFp5h -0.0315 0.0945 0.0079 +AFp3h -0.0198 0.0969 0.0141 +AFp1h -0.0067 0.0982 0.0173 +AFp2h 0.0068 0.0982 0.0173 +AFp4h 0.0198 0.0969 0.0141 +AFp6h 0.0315 0.0945 0.0079 +AFp8h 0.0413 0.0910 -0.0007 +AFp10h 0.0433 0.0862 -0.0259 +AFF9h -0.0673 0.0683 -0.0282 +AFF7h -0.0679 0.0732 0.0045 +AFF5h -0.0562 0.0780 0.0271 +AFF3h -0.0371 0.0816 0.0442 +AFF1h -0.0130 0.0836 0.0533 +AFF2h 0.0129 0.0836 0.0533 +AFF4h 0.0371 0.0816 0.0441 +AFF6h 0.0563 0.0780 0.0271 +AFF8h 0.0678 0.0732 0.0045 +AFF10h 0.0673 0.0682 -0.0282 +FFT9h -0.0847 0.0437 -0.0299 +FFT7h -0.0876 0.0474 0.0082 +FFC5h -0.0751 0.0513 0.0414 +FFC3h -0.0506 0.0543 0.0669 +FFC1h -0.0178 0.0560 0.0809 +FFC2h 0.0178 0.0560 0.0809 +FFC4h 0.0505 0.0543 0.0669 +FFC6h 0.0751 0.0513 0.0413 +FFT8h 0.0876 0.0474 0.0082 +FFT10h 0.0848 0.0437 -0.0299 +FTT9h -0.0939 0.0151 -0.0308 +FTT7h -0.0980 0.0164 0.0102 +FCC5h -0.0852 0.0179 0.0490 +FCC3h -0.0578 0.0190 0.0793 +FCC1h -0.0204 0.0197 0.0958 +FCC2h 0.0205 0.0197 0.0959 +FCC4h 0.0578 0.0190 0.0793 +FCC6h 0.0853 0.0179 0.0490 +FTT8h 0.0981 0.0164 0.0102 +FTT10h 0.0939 0.0151 -0.0308 +TTP9h -0.0939 -0.0151 -0.0308 +TTP7h -0.0980 -0.0164 0.0102 +CCP5h -0.0852 -0.0179 0.0490 +CCP3h -0.0578 -0.0190 0.0793 +CCP1h -0.0204 -0.0197 0.0958 +CCP2h 0.0205 -0.0197 0.0959 +CCP4h 0.0578 -0.0190 0.0793 +CCP6h 0.0853 -0.0179 0.0490 +TTP8h 0.0981 -0.0164 0.0102 +TTP10h 0.0939 -0.0151 -0.0308 +TPP9h -0.0847 -0.0437 -0.0299 +TPP7h -0.0876 -0.0474 0.0082 +CPP5h -0.0751 -0.0513 0.0414 +CPP3h -0.0506 -0.0543 0.0669 +CPP1h -0.0178 -0.0560 0.0809 +CPP2h 0.0178 -0.0560 0.0809 +CPP4h 0.0505 -0.0543 0.0669 +CPP6h 0.0751 -0.0513 0.0413 +TPP8h 0.0876 -0.0474 0.0082 +TPP10h 0.0848 -0.0437 -0.0299 +PPO9h -0.0673 -0.0683 -0.0282 +PPO7h -0.0679 -0.0732 0.0045 +PPO5h -0.0562 -0.0780 0.0271 +PPO3h -0.0371 -0.0816 0.0442 +PPO1h -0.0130 -0.0836 0.0533 +PPO2h 0.0129 -0.0836 0.0533 +PPO4h 0.0371 -0.0816 0.0441 +PPO6h 0.0563 -0.0780 0.0271 +PPO8h 0.0678 -0.0732 0.0045 +PPO10h 0.0673 -0.0682 -0.0282 +POO9h -0.0433 -0.0863 -0.0259 +POO7h -0.0412 -0.0910 -0.0007 +POO5h -0.0315 -0.0945 0.0079 +POO3h -0.0198 -0.0969 0.0141 +POO1h -0.0067 -0.0982 0.0173 +POO2h 0.0068 -0.0982 0.0173 +POO4h 0.0198 -0.0969 0.0141 +POO6h 0.0315 -0.0945 0.0079 +POO8h 0.0413 -0.0910 -0.0007 +POO10h 0.0433 -0.0862 -0.0259 +OI1h -0.0150 -0.0961 -0.0232 +OI2h 0.0150 -0.0960 -0.0232 +Fp1h -0.0155 0.0986 -0.0034 +Fp2h 0.0156 0.0986 -0.0034 +AF9h -0.0560 0.0782 -0.0271 +AF7h -0.0552 0.0833 0.0021 +AF5h -0.0443 0.0877 0.0180 +AF3h -0.0287 0.0910 0.0298 +AF1h -0.0099 0.0927 0.0360 +AF2h 0.0099 0.0927 0.0359 +AF4h 0.0286 0.0910 0.0298 +AF6h 0.0443 0.0877 0.0180 +AF8h 0.0551 0.0833 0.0020 +AF10h 0.0560 0.0782 -0.0271 +F9h -0.0770 0.0567 -0.0292 +F7h -0.0788 0.0611 0.0066 +F5h -0.0667 0.0657 0.0350 +F3h -0.0445 0.0693 0.0567 +F1h -0.0156 0.0712 0.0684 +F2h 0.0156 0.0712 0.0684 +F4h 0.0445 0.0693 0.0567 +F6h 0.0667 0.0657 0.0350 +F8h 0.0788 0.0611 0.0066 +F10h 0.0770 0.0567 -0.0291 +FT9h -0.0904 0.0297 -0.0304 +FT7h -0.0941 0.0323 0.0094 +FC5h -0.0814 0.0352 0.0461 +FC3h -0.0550 0.0374 0.0745 +FC1h -0.0195 0.0386 0.0902 +FC2h 0.0194 0.0386 0.0902 +FC4h 0.0550 0.0374 0.0745 +FC6h 0.0814 0.0352 0.0461 +FT8h 0.0941 0.0324 0.0095 +FT10h 0.0904 0.0297 -0.0304 +T9h -0.0950 0.0000 -0.0309 +T7h -0.0994 0.0000 0.0105 +C5h -0.0865 -0.0000 0.0500 +C3h -0.0587 0.0000 0.0808 +C1h -0.0208 0.0000 0.0978 +C2h 0.0208 0.0000 0.0978 +C4h 0.0587 0.0000 0.0809 +C6h 0.0865 0.0000 0.0500 +T8h 0.0994 0.0000 0.0105 +T10h 0.0950 0.0000 -0.0309 +TP9h -0.0904 -0.0297 -0.0304 +TP7h -0.0941 -0.0323 0.0094 +CP5h -0.0814 -0.0352 0.0461 +CP3h -0.0550 -0.0374 0.0745 +CP1h -0.0195 -0.0386 0.0902 +CP2h 0.0194 -0.0386 0.0902 +CP4h 0.0550 -0.0374 0.0745 +CP6h 0.0814 -0.0352 0.0461 +TP8h 0.0941 -0.0324 0.0094 +TP10h 0.0904 -0.0297 -0.0304 +P9h -0.0770 -0.0567 -0.0292 +P7h -0.0788 -0.0611 0.0066 +P5h -0.0667 -0.0657 0.0350 +P3h -0.0445 -0.0693 0.0567 +P1h -0.0156 -0.0712 0.0684 +P2h 0.0156 -0.0712 0.0684 +P4h 0.0445 -0.0693 0.0567 +P6h 0.0667 -0.0657 0.0350 +P8h 0.0788 -0.0611 0.0066 +P10h 0.0770 -0.0567 -0.0291 +PO9h -0.0560 -0.0782 -0.0271 +PO7h -0.0552 -0.0833 0.0021 +PO5h -0.0443 -0.0877 0.0180 +PO3h -0.0287 -0.0910 0.0298 +PO1h -0.0099 -0.0927 0.0360 +PO2h 0.0099 -0.0927 0.0359 +PO4h 0.0286 -0.0910 0.0298 +PO6h 0.0443 -0.0877 0.0180 +PO8h 0.0551 -0.0833 0.0020 +PO10h 0.0560 -0.0782 -0.0271 +O1h -0.0155 -0.0986 -0.0034 +O2h 0.0156 -0.0986 -0.0034 +I1h -0.0137 -0.0896 -0.0421 +I2h 0.0137 -0.0896 -0.0421 +AFp9 -0.0396 0.0800 -0.0449 +AFp7 -0.0451 0.0890 -0.0059 +AFp5 -0.0367 0.0929 0.0039 +AFp3 -0.0259 0.0958 0.0114 +AFp1 -0.0134 0.0977 0.0161 +AFpz 0.0000 0.0983 0.0177 +AFp2 0.0134 0.0977 0.0161 +AFp4 0.0258 0.0958 0.0113 +AFp6 0.0367 0.0929 0.0039 +AFp8 0.0451 0.0890 -0.0059 +AFp10 0.0396 0.0800 -0.0449 +AFF9 -0.0614 0.0631 -0.0473 +AFF7 -0.0703 0.0706 -0.0080 +AFF5 -0.0631 0.0757 0.0163 +AFF3 -0.0474 0.0800 0.0364 +AFF1 -0.0254 0.0828 0.0498 +AFFz -0.0000 0.0838 0.0544 +AFF2 0.0254 0.0828 0.0498 +AFF4 0.0475 0.0800 0.0365 +AFF6 0.0631 0.0757 0.0163 +AFF8 0.0703 0.0706 -0.0080 +AFF10 0.0614 0.0631 -0.0473 +FFT9 -0.0773 0.0403 -0.0490 +FFT7 -0.0885 0.0453 -0.0095 +FFC5 -0.0831 0.0494 0.0254 +FFC3 -0.0641 0.0530 0.0554 +FFC1 -0.0349 0.0553 0.0755 +FFCz 0.0000 0.0562 0.0826 +FFC2 0.0349 0.0553 0.0756 +FFC4 0.0641 0.0530 0.0554 +FFC6 0.0830 0.0494 0.0254 +FFT8 0.0886 0.0453 -0.0095 +FFT10 0.0772 0.0403 -0.0490 +FTT9 -0.0855 0.0139 -0.0499 +FTT7 -0.0982 0.0156 -0.0103 +FCC5 -0.0937 0.0172 0.0303 +FCC3 -0.0731 0.0185 0.0655 +FCC1 -0.0400 0.0194 0.0895 +FCCz 0.0000 0.0197 0.0979 +FCC2 0.0400 0.0194 0.0896 +FCC4 0.0731 0.0185 0.0656 +FCC6 0.0937 0.0172 0.0303 +FTT8 0.0981 0.0156 -0.0103 +FTT10 0.0855 0.0139 -0.0498 +TTP9 -0.0855 -0.0139 -0.0499 +TTP7 -0.0982 -0.0156 -0.0103 +CCP5 -0.0937 -0.0172 0.0303 +CCP3 -0.0731 -0.0185 0.0655 +CCP1 -0.0400 -0.0194 0.0895 +CCPz 0.0000 -0.0197 0.0979 +CCP2 0.0400 -0.0194 0.0896 +CCP4 0.0731 -0.0185 0.0656 +CCP6 0.0937 -0.0172 0.0303 +TTP8 0.0981 -0.0156 -0.0103 +TTP10 0.0855 -0.0139 -0.0498 +TPP9 -0.0773 -0.0403 -0.0490 +TPP7 -0.0885 -0.0453 -0.0095 +CPP5 -0.0831 -0.0494 0.0254 +CPP3 -0.0641 -0.0530 0.0554 +CPP1 -0.0349 -0.0553 0.0755 +CPPz 0.0000 -0.0562 0.0826 +CPP2 0.0349 -0.0553 0.0756 +CPP4 0.0641 -0.0530 0.0554 +CPP6 0.0830 -0.0494 0.0254 +TPP8 0.0886 -0.0453 -0.0095 +TPP10 0.0772 -0.0403 -0.0490 +PPO9 -0.0614 -0.0631 -0.0473 +PPO7 -0.0703 -0.0706 -0.0080 +PPO5 -0.0631 -0.0757 0.0163 +PPO3 -0.0474 -0.0800 0.0364 +PPO1 -0.0255 -0.0828 0.0498 +PPOz 0.0000 -0.0838 0.0544 +PPO2 0.0254 -0.0828 0.0498 +PPO4 0.0475 -0.0800 0.0365 +PPO6 0.0631 -0.0757 0.0163 +PPO8 0.0703 -0.0706 -0.0080 +PPO10 0.0614 -0.0631 -0.0473 +POO9 -0.0396 -0.0800 -0.0449 +POO7 -0.0451 -0.0890 -0.0059 +POO5 -0.0367 -0.0929 0.0039 +POO3 -0.0259 -0.0958 0.0114 +POO1 -0.0134 -0.0977 0.0161 +POOz 0.0000 -0.0983 0.0177 +POO2 0.0134 -0.0977 0.0161 +POO4 0.0258 -0.0958 0.0113 +POO6 0.0367 -0.0929 0.0039 +POO8 0.0451 -0.0890 -0.0059 +POO10 0.0396 -0.0800 -0.0449 +OI1 -0.0295 -0.0923 -0.0246 +OIz -0.0000 -0.0975 -0.0218 +OI2 0.0295 -0.0922 -0.0246 +T3 -0.0994 0.0000 -0.0104 +T5 -0.0804 -0.0586 -0.0088 +T4 0.0994 0.0000 -0.0104 +T6 0.0804 -0.0587 -0.0088 +M1 -0.0707 -0.0130 -0.0707 +M2 0.0707 -0.0130 -0.0707 +A1 -0.0707 0.0000 -0.0707 +A2 0.0707 0.0000 -0.0707 diff --git a/code/eeglab13_4_4b/functions/resources/Standard-10-5-Cap385_witheog.elp b/code/eeglab13_4_4b/functions/resources/Standard-10-5-Cap385_witheog.elp new file mode 100644 index 0000000..28c0171 --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/Standard-10-5-Cap385_witheog.elp @@ -0,0 +1,357 @@ +346 + FID LPA -120.03 0 85 + FID RPA 120.03 0 85 + FID Nz 114.03 90 85 + EEG Fp1 -92.698 -72.074 85 + EEG Fpz 91.204 90 85 + EEG Fp2 92.698 72.074 85 + EEG AF9 -117.54 -54.695 85 + EEG AF7 -94.02 -54.108 85 + EEG AF5 -83.969 -59.461 85 + EEG AF3 -75.803 -67.539 85 + EEG AF1 -70.343 -77.973 85 + EEG AFz 68.39 90 85 + EEG AF2 70.358 78.046 85 + EEG AF4 75.803 67.539 85 + EEG AF6 83.969 59.461 85 + EEG AF8 94.016 54.142 85 + EEG AF10 117.52 54.733 85 + EEG F9 -118.84 -36.687 85 + EEG F7 -95.055 -36.087 85 + EEG F5 -77.687 -40.595 85 + EEG F3 -62.027 -50.053 85 + EEG F1 -50.225 -66.507 85 + EEG Fz 45.608 90 85 + EEG F2 50.181 66.507 85 + EEG F4 62.01 50.103 85 + EEG F6 77.631 40.595 85 + EEG F8 95.052 36.133 85 + EEG F10 118.84 36.687 85 + EEG FT9 -119.68 -18.393 85 + EEG FT7 -95.745 -18.052 85 + EEG FC5 -73.482 -20.668 85 + EEG FC3 -51.88 -27.575 85 + EEG FC1 -32.613 -45.075 85 + EEG FCz 22.792 90 85 + EEG FC2 32.613 45.075 85 + EEG FC4 51.88 27.575 85 + EEG FC6 73.482 20.668 85 + EEG FT8 95.745 18.052 85 + EEG FT10 119.68 18.393 85 + EEG T9 -120.03 0 85 + EEG T7 -95.973 0 85 + EEG C5 -71.982 0 85 + EEG C3 -48.004 0 85 + EEG C1 -23.974 0 85 + EEG Cz 0 90 85 + EEG C2 24.027 0 85 + EEG C4 48 0 85 + EEG C6 71.982 0 85 + EEG T8 95.973 0 85 + EEG T10 120.03 0 85 + EEG TP9 -119.68 18.393 85 + EEG TP7 -95.745 18.052 85 + EEG CP5 -73.482 20.668 85 + EEG CP3 -51.88 27.575 85 + EEG CP1 -32.613 45.075 85 + EEG CPz 22.792 -90 85 + EEG CP2 32.613 -45.075 85 + EEG CP4 51.88 -27.575 85 + EEG CP6 73.482 -20.668 85 + EEG TP8 95.743 -18.107 85 + EEG TP10 119.68 -18.393 85 + EEG P9 -118.84 36.687 85 + EEG P7 -95.055 36.087 85 + EEG P5 -77.687 40.595 85 + EEG P3 -62.027 50.053 85 + EEG P1 -50.225 66.507 85 + EEG Pz 45.608 -90 85 + EEG P2 50.181 -66.507 85 + EEG P4 62.01 -50.103 85 + EEG P6 77.631 -40.595 85 + EEG P8 95.052 -36.133 85 + EEG P10 118.84 -36.687 85 + EEG PO9 -117.54 54.695 85 + EEG PO7 -94.02 54.108 85 + EEG PO5 -83.969 59.461 85 + EEG PO3 -75.803 67.539 85 + EEG PO1 -70.343 77.973 85 + EEG POz 68.39 -90 85 + EEG PO2 70.358 -78.046 85 + EEG PO4 75.803 -67.539 85 + EEG PO6 83.969 -59.461 85 + EEG PO8 94.016 -54.142 85 + EEG PO10 117.52 -54.733 85 + EEG O1 -92.698 72.074 85 + EEG Oz 91.204 -90 85 + EEG O2 92.698 -72.074 85 + EEG I1 -115.86 72.532 85 + EEG Iz 114.03 -90 85 + EEG I2 115.86 -72.532 85 + EEG AFp9h -105.02 -63.355 85 + EEG AFp7h -90.401 -65.641 85 + EEG AFp5h -85.465 -71.565 85 + EEG AFp3h -81.886 -78.451 85 + EEG AFp1h -80.031 -86.097 85 + EEG AFp2h 80.032 86.039 85 + EEG AFp4h 81.886 78.451 85 + EEG AFp6h 85.465 71.565 85 + EEG AFp8h 90.401 65.589 85 + EEG AFp10h 105.03 63.329 85 + EEG AFF9h -106.39 -45.423 85 + EEG AFF7h -87.419 -47.151 85 + EEG AFF5h -74.258 -54.227 85 + EEG AFF3h -63.752 -65.551 85 + EEG AFF1h -57.79 -81.161 85 + EEG AFF2h 57.785 81.228 85 + EEG AFF4h 63.804 65.551 85 + EEG AFF6h 74.267 54.178 85 + EEG AFF8h 87.418 47.193 85 + EEG AFF10h 106.4 45.381 85 + EEG FFT9h -107.42 -27.291 85 + EEG FFT7h -85.294 -28.418 85 + EEG FFC5h -65.525 -34.337 85 + EEG FFC3h -47.97 -47.02 85 + EEG FFC1h -35.992 -72.367 85 + EEG FFC2h 35.992 72.367 85 + EEG FFC4h 47.944 47.077 85 + EEG FFC6h 65.577 34.337 85 + EEG FFT8h 85.294 28.418 85 + EEG FFT10h 107.4 27.263 85 + EEG FTT9h -107.94 -9.1355 85 + EEG FTT7h -84.139 -9.5002 85 + EEG FCC5h -60.628 -11.865 85 + EEG FCC3h -37.497 -18.197 85 + EEG FCC1h -16.49 -44 85 + EEG FCC2h 16.513 43.86 85 + EEG FCC4h 37.497 18.197 85 + EEG FCC6h 60.655 11.851 85 + EEG FTT8h 84.145 9.4907 85 + EEG FTT10h 107.94 9.1355 85 + EEG TTP9h -107.94 9.1355 85 + EEG TTP7h -84.139 9.5002 85 + EEG CCP5h -60.628 11.865 85 + EEG CCP3h -37.497 18.197 85 + EEG CCP1h -16.49 44 85 + EEG CCP2h 16.513 -43.86 85 + EEG CCP4h 37.497 -18.197 85 + EEG CCP6h 60.655 -11.851 85 + EEG TTP8h 84.145 -9.4907 85 + EEG TTP10h 107.94 -9.1355 85 + EEG TPP9h -107.42 27.291 85 + EEG TPP7h -85.294 28.418 85 + EEG CPP5h -65.525 34.337 85 + EEG CPP3h -47.97 47.02 85 + EEG CPP1h -35.992 72.367 85 + EEG CPP2h 35.992 -72.367 85 + EEG CPP4h 47.944 -47.077 85 + EEG CPP6h 65.577 -34.337 85 + EEG TPP8h 85.294 -28.418 85 + EEG TPP10h 107.4 -27.263 85 + EEG PPO9h -106.39 45.423 85 + EEG PPO7h -87.419 47.151 85 + EEG PPO5h -74.258 54.227 85 + EEG PPO3h -63.752 65.551 85 + EEG PPO1h -57.79 81.161 85 + EEG PPO2h 57.785 -81.228 85 + EEG PPO4h 63.804 -65.551 85 + EEG PPO6h 74.267 -54.178 85 + EEG PPO8h 87.418 -47.193 85 + EEG PPO10h 106.4 -45.381 85 + EEG POO9h -105.02 63.355 85 + EEG POO7h -90.401 65.641 85 + EEG POO5h -85.465 71.565 85 + EEG POO3h -81.886 78.451 85 + EEG POO1h -80.031 86.097 85 + EEG POO2h 80.032 -86.039 85 + EEG POO4h 81.886 -78.451 85 + EEG POO6h 85.465 -71.565 85 + EEG POO8h 90.401 -65.589 85 + EEG POO10h 105.03 -63.329 85 + EEG OI1h -103.42 81.128 85 + EEG OI2h 103.43 -81.119 85 + EEG Fp1h -91.951 -81.066 85 + EEG Fp2h 91.951 81.009 85 + EEG AF9h -105.74 -54.393 85 + EEG AF7h -88.796 -56.469 85 + EEG AF5h -79.619 -63.2 85 + EEG AF3h -72.656 -72.496 85 + EEG AF1h -68.886 -83.904 85 + EEG AF2h 68.939 83.904 85 + EEG AF4h 72.651 72.553 85 + EEG AF6h 79.619 63.2 85 + EEG AF8h 88.853 56.517 85 + EEG AF10h 105.74 54.393 85 + EEG F9h -106.98 -36.367 85 + EEG F7h -86.213 -37.789 85 + EEG F5h -69.502 -44.567 85 + EEG F3h -55.454 -57.294 85 + EEG F1h -46.82 -77.642 85 + EEG F2h 46.82 77.642 85 + EEG F4h 55.454 57.294 85 + EEG F6h 69.502 44.567 85 + EEG F8h 86.213 37.789 85 + EEG F10h 106.93 36.367 85 + EEG FT9h -107.72 -18.187 85 + EEG FT7h -84.603 -18.945 85 + EEG FC5h -62.534 -23.385 85 + EEG FC3h -41.758 -34.216 85 + EEG FC1h -25.615 -63.198 85 + EEG FC2h 25.592 63.316 85 + EEG FC4h 41.758 34.216 85 + EEG FC6h 62.534 23.385 85 + EEG FT8h 84.547 18.999 85 + EEG FT10h 107.72 18.187 85 + EEG T9h -108.02 0 85 + EEG T7h -83.97 0 85 + EEG C5h -59.971 0 85 + EEG C3h -35.998 0 85 + EEG C1h -12.007 0 85 + EEG C2h 12.007 0 85 + EEG C4h 35.964 0 85 + EEG C6h 59.971 0 85 + EEG T8h 83.97 0 85 + EEG T10h 108.02 0 85 + EEG TP9h -107.72 18.187 85 + EEG TP7h -84.603 18.945 85 + EEG CP5h -62.534 23.385 85 + EEG CP3h -41.758 34.216 85 + EEG CP1h -25.615 63.198 85 + EEG CP2h 25.592 -63.316 85 + EEG CP4h 41.758 -34.216 85 + EEG CP6h 62.534 -23.385 85 + EEG TP8h 84.604 -18.999 85 + EEG TP10h 107.72 -18.187 85 + EEG P9h -106.98 36.367 85 + EEG P7h -86.213 37.789 85 + EEG P5h -69.502 44.567 85 + EEG P3h -55.454 57.294 85 + EEG P1h -46.82 77.642 85 + EEG P2h 46.82 -77.642 85 + EEG P4h 55.454 -57.294 85 + EEG P6h 69.502 -44.567 85 + EEG P8h 86.213 -37.789 85 + EEG P10h 106.93 -36.367 85 + EEG PO9h -105.74 54.393 85 + EEG PO7h -88.796 56.469 85 + EEG PO5h -79.619 63.2 85 + EEG PO3h -72.656 72.496 85 + EEG PO1h -68.886 83.904 85 + EEG PO2h 68.939 -83.904 85 + EEG PO4h 72.651 -72.553 85 + EEG PO6h 79.619 -63.2 85 + EEG PO8h 88.853 -56.517 85 + EEG PO10h 105.74 -54.393 85 + EEG O1h -91.951 81.066 85 + EEG O2h 91.951 -81.009 85 + EEG I1h -114.91 81.307 85 + EEG I2h 114.91 -81.307 85 + EEG AFp9 -116.7 -63.665 85 + EEG AFp7 -93.384 -63.127 85 + EEG AFp5 -87.764 -68.444 85 + EEG AFp3 -83.447 -74.871 85 + EEG AFp1 -80.728 -82.19 85 + EEG AFpz 79.793 90 85 + EEG AFp2 80.728 82.19 85 + EEG AFp4 83.502 74.927 85 + EEG AFp6 87.764 68.444 85 + EEG AFp8 93.384 63.127 85 + EEG AFp10 116.7 63.665 85 + EEG AFF9 -118.25 -45.782 85 + EEG AFF7 -94.591 -45.122 85 + EEG AFF5 -80.608 -50.187 85 + EEG AFF3 -68.622 -59.353 85 + EEG AFF1 -60.101 -72.946 85 + EEG AFFz 57.01 90 85 + EEG AFF2 60.101 72.946 85 + EEG AFF4 68.579 59.3 85 + EEG AFF6 80.608 50.187 85 + EEG AFF8 94.591 45.122 85 + EEG AFF10 118.25 45.782 85 + EEG FFT9 -119.34 -27.535 85 + EEG FFT7 -95.458 -27.106 85 + EEG FFC5 -75.279 -30.73 85 + EEG FFC3 -56.333 -39.585 85 + EEG FFC1 -40.896 -57.744 85 + EEG FFCz 34.231 90 85 + EEG FFC2 40.859 57.744 85 + EEG FFC4 56.333 39.585 85 + EEG FFC6 75.266 30.76 85 + EEG FFT8 95.453 27.08 85 + EEG FFT10 119.36 27.565 85 + EEG FTT9 -119.94 -9.234 85 + EEG FTT7 -95.914 -9.0265 85 + EEG FCC5 -72.356 -10.402 85 + EEG FCC3 -49.021 -14.202 85 + EEG FCC1 -26.414 -25.873 85 + EEG FCCz 11.377 90 85 + EEG FCC2 26.389 25.873 85 + EEG FCC4 48.978 14.202 85 + EEG FCC6 72.356 10.402 85 + EEG FTT8 95.92 9.0356 85 + EEG FTT10 119.89 9.234 85 + EEG TTP9 -119.94 9.234 85 + EEG TTP7 -95.914 9.0265 85 + EEG CCP5 -72.356 10.402 85 + EEG CCP3 -49.021 14.202 85 + EEG CCP1 -26.414 25.873 85 + EEG CCPz 11.377 -90 85 + EEG CCP2 26.389 -25.873 85 + EEG CCP4 48.978 -14.202 85 + EEG CCP6 72.356 -10.402 85 + EEG TTP8 95.92 -9.0356 85 + EEG TTP10 119.89 -9.234 85 + EEG TPP9 -119.34 27.535 85 + EEG TPP7 -95.458 27.106 85 + EEG CPP5 -75.279 30.73 85 + EEG CPP3 -56.333 39.585 85 + EEG CPP1 -40.896 57.744 85 + EEG CPPz 34.231 -90 85 + EEG CPP2 40.859 -57.744 85 + EEG CPP4 56.333 -39.585 85 + EEG CPP6 75.266 -30.76 85 + EEG TPP8 95.453 -27.08 85 + EEG TPP10 119.36 -27.565 85 + EEG PPO9 -118.25 45.782 85 + EEG PPO7 -94.591 45.122 85 + EEG PPO5 -80.608 50.187 85 + EEG PPO3 -68.622 59.353 85 + EEG PPO1 -60.109 72.883 85 + EEG PPOz 57.01 -90 85 + EEG PPO2 60.101 -72.946 85 + EEG PPO4 68.579 -59.3 85 + EEG PPO6 80.608 -50.187 85 + EEG PPO8 94.591 -45.122 85 + EEG PPO10 118.25 -45.782 85 + EEG POO9 -116.7 63.665 85 + EEG POO7 -93.384 63.127 85 + EEG POO5 -87.764 68.444 85 + EEG POO3 -83.447 74.871 85 + EEG POO1 -80.728 82.19 85 + EEG POOz 79.793 -90 85 + EEG POO2 80.728 -82.19 85 + EEG POO4 83.502 -74.927 85 + EEG POO6 87.764 -68.444 85 + EEG POO8 93.384 -63.127 85 + EEG POO10 116.7 -63.665 85 + EEG OI1 -104.24 72.276 85 + EEG OIz 102.6 -90 85 + EEG OI2 104.26 -72.258 85 + EEG T3 -95.973 0 85 + EEG T5 -95.055 36.087 85 + EEG T4 95.973 0 85 + EEG T6 95.052 -36.133 85 + EEG M1 -134.52 10.419 85 + EEG M2 134.52 -10.419 85 + EEG A1 -135 0 85 + EEG A2 135 0 85 + EOG VEOG 125 63 85 + EOG HEOG -118 -48 85 + EOG EOG1 125 63 85 + EOG EOG2 -118 -48 85 + EOG LO1 -118 -48 85 + EOG LO2 118 48 85 + EOG IO1 -125 -63 85 + EOG IO2 125 63 85 + EOG SO1 -105 -65 85 + EOG SO2 105 65 85 diff --git a/code/eeglab13_4_4b/functions/resources/chan_file b/code/eeglab13_4_4b/functions/resources/chan_file new file mode 100644 index 0000000..aca0433 --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/chan_file @@ -0,0 +1,21 @@ + 1 -18 .352 Fp1. + 2 18 .352 Fp2. + 3 -39 .231 F3.. + 4 39 .231 F4.. + 5 -90 .181 C3.. + 6 90 .181 C4.. + 7 -90 .500 A1.. + 8 90 .500 A2.. + 9 -142 .231 P3.. +10 142 .231 P4.. +11 -162 .352 O1.. +12 162 .352 O2.. +13 -54 .352 F7.. +14 54 .352 F8.. +15 -90 .352 T3.. +16 90 .352 T4.. +17 -126 .352 T5.. +18 126 .352 T6.. +19 0 .181 Fz.. +20 0 0 Cz.. +21 180 .181 Pz.. diff --git a/code/eeglab13_4_4b/functions/resources/colin27headmesh.mat b/code/eeglab13_4_4b/functions/resources/colin27headmesh.mat new file mode 100644 index 0000000..590cb1a Binary files /dev/null and b/code/eeglab13_4_4b/functions/resources/colin27headmesh.mat differ diff --git a/code/eeglab13_4_4b/functions/resources/colin27headmesh.xyz b/code/eeglab13_4_4b/functions/resources/colin27headmesh.xyz new file mode 100644 index 0000000..c988bad --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/colin27headmesh.xyz @@ -0,0 +1,3 @@ +1 -91.2500 0.0846 -40.0000 NZ +2 14.9323 -85.0000 -40.0000 LPA +3 15.0677 85.0000 -40.0000 RPA diff --git a/code/eeglab13_4_4b/functions/resources/eeglab1020.ced b/code/eeglab13_4_4b/functions/resources/eeglab1020.ced new file mode 100644 index 0000000..8323452 --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/eeglab1020.ced @@ -0,0 +1,80 @@ +Number labels theta radius X Y Z sph_theta sph_phi sph_radius +1 Fp1 -18 0.511 0.95 0.309 -0.0349 18 -2 1 +2 Fp2 18 0.511 0.95 -0.309 -0.0349 -18 -2 1 +3 AF3 -23 0.411 0.885 0.376 0.276 23 16 1 +4 AF4 23 0.411 0.885 -0.376 0.276 -23 16 1 +5 AF7 -38 0.511 0.788 0.615 -0.0349 38 -2 1 +6 AF8 38 0.511 0.788 -0.615 -0.0349 -38 -2 1 +7 AF9 -43 0.639 0.663 0.618 -0.423 43 -25 1 +8 AF10 43 0.639 0.663 -0.618 -0.423 -43 -25 1 +9 F1 -22 0.278 0.71 0.287 0.643 22 40 1 +10 F2 22 0.278 0.71 -0.287 0.643 -22 40 1 +11 F3 -39 0.333 0.673 0.545 0.5 39 30 1 +12 F4 39 0.333 0.673 -0.545 0.5 -39 30 1 +13 F5 -49 0.417 0.634 0.729 0.259 49 15 1 +14 F6 49 0.417 0.634 -0.729 0.259 -49 15 1 +15 F7 -54 0.511 0.587 0.809 -0.0349 54 -2 1 +16 F8 54 0.511 0.587 -0.809 -0.0349 -54 -2 1 +17 F9 -55 0.639 0.52 0.742 -0.423 55 -25 1 +18 F10 55 0.639 0.52 -0.742 -0.423 -55 -25 1 +19 FC1 -45 0.178 0.375 0.375 0.848 45 58 1 +20 FC2 45 0.178 0.375 -0.375 0.848 -45 58 1 +21 FC3 -62 0.278 0.36 0.676 0.643 62 40 1 +22 FC4 62 0.278 0.36 -0.676 0.643 -62 40 1 +23 FC5 -69 0.394 0.339 0.883 0.326 69 19 1 +24 FC6 69 0.394 0.339 -0.883 0.326 -69 19 1 +25 FT7 -72 0.511 0.309 0.95 -0.0349 72 -2 1 +26 FT8 72 0.511 0.309 -0.95 -0.0349 -72 -2 1 +27 FT9 -72 0.639 0.28 0.862 -0.423 72 -25 1 +28 FT10 72 0.639 0.28 -0.862 -0.423 -72 -25 1 +29 C1 -90 0.128 2.39e-17 0.391 0.921 90 67 1 +30 C2 90 0.128 2.39e-17 -0.391 0.921 -90 67 1 +31 C3 -90 0.256 4.4e-17 0.719 0.695 90 44 1 +32 C4 90 0.256 4.4e-17 -0.719 0.695 -90 44 1 +33 C5 -90 0.383 5.72e-17 0.934 0.358 90 21 1 +34 C6 90 0.383 5.72e-17 -0.934 0.358 -90 21 1 +35 T7 -90 0.511 6.12e-17 0.999 -0.0349 90 -2 1 +36 T8 90 0.511 6.12e-17 -0.999 -0.0349 -90 -2 1 +37 T9 -90 0.639 5.55e-17 0.906 -0.423 90 -25 1 +38 T10 90 0.639 5.55e-17 -0.906 -0.423 -90 -25 1 +39 CP1 -135 0.178 -0.375 0.375 0.848 135 58 1 +40 CP2 135 0.178 -0.375 -0.375 0.848 -135 58 1 +41 CP3 -118 0.278 -0.36 0.676 0.643 118 40 1 +42 CP4 118 0.278 -0.36 -0.676 0.643 -118 40 1 +43 CP5 -111 0.394 -0.339 0.883 0.326 111 19 1 +44 CP6 111 0.394 -0.339 -0.883 0.326 -111 19 1 +45 TP7 -108 0.511 -0.309 0.95 -0.0349 108 -2 1 +46 TP8 108 0.511 -0.309 -0.95 -0.0349 -108 -2 1 +47 TP9 -108 0.639 -0.28 0.862 -0.423 108 -25 1 +48 TP10 108 0.639 -0.28 -0.862 -0.423 -108 -25 1 +49 P1 -158 0.278 -0.71 0.287 0.643 158 40 1 +50 P2 158 0.278 -0.71 -0.287 0.643 -158 40 1 +51 P3 -141 0.333 -0.673 0.545 0.5 141 30 1 +52 P4 141 0.333 -0.673 -0.545 0.5 -141 30 1 +53 P5 -131 0.417 -0.634 0.729 0.259 131 15 1 +54 P6 131 0.417 -0.634 -0.729 0.259 -131 15 1 +55 P7 -126 0.511 -0.587 0.809 -0.0349 126 -2 1 +56 P8 126 0.511 -0.587 -0.809 -0.0349 -126 -2 1 +57 P9 -126 0.639 -0.533 0.733 -0.423 126 -25 1 +58 P10 126 0.639 -0.533 -0.733 -0.423 -126 -25 1 +59 PO3 -157 0.411 -0.885 0.376 0.276 157 16 1 +60 PO4 157 0.411 -0.885 -0.376 0.276 -157 16 1 +61 PO7 -144 0.511 -0.809 0.587 -0.0349 144 -2 1 +62 PO8 144 0.511 -0.809 -0.587 -0.0349 -144 -2 1 +63 PO9 -144 0.639 -0.733 0.533 -0.423 144 -25 1 +64 PO10 144 0.639 -0.733 -0.533 -0.423 -144 -25 1 +65 O1 -162 0.511 -0.95 0.309 -0.0349 162 -2 1 +66 O2 162 0.511 -0.95 -0.309 -0.0349 -162 -2 1 +67 O9 -162 0.639 -0.862 0.28 -0.423 162 -25 1 +68 O10 162 0.639 -0.862 -0.28 -0.423 -162 -25 1 +69 CB1 -135 0.722 -0.542 0.542 -0.643 135 -40 1 +70 CB2 135 0.722 -0.542 -0.542 -0.643 -135 -40 1 +71 AFz 0 0.383 0.934 -0 0.358 -0 21 1 +72 POz 180 0.383 -0.934 -1.14e-16 0.358 -180 21 1 +73 Fpz 0 0.511 0.999 -0 -0.0349 -0 -2 1 +74 Oz 180 0.511 -0.999 -1.22e-16 -0.0349 -180 -2 1 +75 Fz 0 0.256 0.719 -0 0.695 -0 44 1 +76 Pz 180 0.256 -0.719 -8.81e-17 0.695 -180 44 1 +77 FCz 0 0.128 0.391 -0 0.921 -0 67 1 +78 CPz 180 0.128 -0.391 -4.79e-17 0.921 -180 67 1 +79 Cz 90 0 3.75e-33 -6.12e-17 1 -90 90 1 diff --git a/code/eeglab13_4_4b/functions/resources/ica_linux b/code/eeglab13_4_4b/functions/resources/ica_linux new file mode 100644 index 0000000..bcd7fc3 Binary files /dev/null and b/code/eeglab13_4_4b/functions/resources/ica_linux differ diff --git a/code/eeglab13_4_4b/functions/resources/mheadnew.elp b/code/eeglab13_4_4b/functions/resources/mheadnew.elp new file mode 100644 index 0000000..8d49003 --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/mheadnew.elp @@ -0,0 +1,372 @@ +3 2 +//Probe file +//Minor revision number +1 +//ProbeName +%N Name +//Probe type, number of sensors +0 72 +//Position of fiducials X+, Y+, Y- on the subject +%F 0.0955 0.0000 0.0000 +%F 0.0031 0.0681 0.0000 +%F -0.0031 -0.0681 0.0000 +//Sensor type +%S 400 +//Sensor name and data for sensor # 71 +%N LEYE +0.0572 0.0538 -0.0040 +//Sensor type +%S 400 +//Sensor name and data for sensor # 72 +%N REYE +0.0662 -0.0399 -0.0277 +//Sensor type +%S 400 +//Sensor name and data for sensor # 2 +%N FP1 +0.1068 0.0213 0.0441 +//Sensor type +%S 400 +//Sensor name and data for sensor # 3 +%N FPZ +0.1123 -0.0048 0.0441 +//Sensor type +%S 400 +//Sensor name and data for sensor # 4 +%N FP2 +0.1027 -0.0325 0.0457 +//Sensor type +%S 400 +//Sensor name and data for sensor # 5 +%N AF7 +0.0907 0.0445 0.0448 +//Sensor type +%S 400 +//Sensor name and data for sensor # 6 +%N AF3 +0.0937 0.0354 0.0688 +//Sensor type +%S 400 +//Sensor name and data for sensor # 7 +%N AFZ +0.0989 -0.0050 0.0794 +//Sensor type +%S 400 +//Sensor name and data for sensor # 8 +%N AF4 +0.0880 -0.0437 0.0673 +//Sensor type +%S 400 +//Sensor name and data for sensor # 9 +%N AF8 +0.0827 -0.0533 0.0408 +//Sensor type +%S 400 +//Sensor name and data for sensor # 10 +%N F9 +0.0533 0.0661 0.0232 +//Sensor type +%S 400 +//Sensor name and data for sensor # 11 +%N F7 +0.0675 0.0648 0.0442 +//Sensor type +%S 400 +//Sensor name and data for sensor # 12 +%N F5 +0.0729 0.0575 0.0678 +//Sensor type +%S 400 +//Sensor name and data for sensor # 13 +%N F3 +0.0752 0.0429 0.0897 +//Sensor type +%S 400 +//Sensor name and data for sensor # 14 +%N F1 +0.0806 0.0214 0.1010 +//Sensor type +%S 400 +//Sensor name and data for sensor # 15 +%N FZ +0.0818 -0.0038 0.1027 +//Sensor type +%S 400 +//Sensor name and data for sensor # 16 +%N F2 +0.0787 -0.0294 0.0977 +//Sensor type +%S 400 +//Sensor name and data for sensor # 17 +%N F4 +0.0709 -0.0492 0.0890 +//Sensor type +%S 400 +//Sensor name and data for sensor # 18 +%N F6 +0.0684 -0.0615 0.0658 +//Sensor type +%S 400 +//Sensor name and data for sensor # 19 +%N F8 +0.0602 -0.0684 0.0421 +//Sensor type +%S 400 +//Sensor name and data for sensor # 20 +%N F10 +0.0466 -0.0696 0.0220 +//Sensor type +%S 400 +//Sensor name and data for sensor # 21 +%N FT9 +0.0308 0.0728 0.0169 +//Sensor type +%S 400 +//Sensor name and data for sensor # 22 +%N FT7 +0.0404 0.0740 0.0474 +//Sensor type +%S 400 +//Sensor name and data for sensor # 23 +%N FC5 +0.0492 0.0673 0.0784 +//Sensor type +%S 400 +//Sensor name and data for sensor # 24 +%N FC3 +0.0519 0.0512 0.1034 +//Sensor type +%S 400 +//Sensor name and data for sensor # 25 +%N FC1 +0.0513 0.0249 0.1210 +//Sensor type +%S 400 +//Sensor name and data for sensor # 26 +%N FCZ +0.0555 -0.0060 0.1223 +//Sensor type +%S 400 +//Sensor name and data for sensor # 27 +%N FC2 +0.0519 -0.0339 0.1158 +//Sensor type +%S 400 +//Sensor name and data for sensor # 28 +%N FC4 +0.0463 -0.0571 0.1018 +//Sensor type +%S 400 +//Sensor name and data for sensor # 29 +%N FC6 +0.0397 -0.0723 0.0743 +//Sensor type +%S 400 +//Sensor name and data for sensor # 30 +%N FT8 +0.0333 -0.0786 0.0465 +//Sensor type +%S 400 +//Sensor name and data for sensor # 31 +%N FT10 +0.0249 -0.0761 0.0177 +//Sensor type +%S 400 +//Sensor name and data for sensor # 32 +%N T7 +0.0121 0.0810 0.0521 +//Sensor type +%S 400 +//Sensor name and data for sensor # 33 +%N C5 +0.0208 0.0757 0.0857 +//Sensor type +%S 400 +//Sensor name and data for sensor # 34 +%N C3 +0.0241 0.0582 0.1154 +//Sensor type +%S 400 +//Sensor name and data for sensor # 35 +%N C1 +0.0263 0.0311 0.1329 +//Sensor type +%S 400 +//Sensor name and data for sensor # 36 +%N CZ +0.0281 -0.0031 0.1397 +//Sensor type +%S 400 +//Sensor name and data for sensor # 37 +%N C2 +0.0244 -0.0363 0.1308 +//Sensor type +%S 400 +//Sensor name and data for sensor # 38 +%N C4 +0.0185 -0.0619 0.1133 +//Sensor type +%S 400 +//Sensor name and data for sensor # 39 +%N C6 +0.0131 -0.0770 0.0833 +//Sensor type +%S 400 +//Sensor name and data for sensor # 40 +%N T8 +0.0068 -0.0817 0.0501 +//Sensor type +%S 400 +//Sensor name and data for sensor # 41 +%N TP9 +-0.0199 0.0829 0.0312 +//Sensor type +%S 400 +//Sensor name and data for sensor # 42 +%N TP7 +-0.0127 0.0822 0.0625 +//Sensor type +%S 400 +//Sensor name and data for sensor # 43 +%N CP5 +-0.0102 0.0780 0.0938 +//Sensor type +%S 400 +//Sensor name and data for sensor # 44 +%N CP3 +-0.0042 0.0600 0.1217 +//Sensor type +%S 400 +//Sensor name and data for sensor # 45 +%N CP1 +-0.0033 0.0333 0.1407 +//Sensor type +%S 400 +//Sensor name and data for sensor # 46 +%N CPZ +-0.0045 0.0004 0.1455 +//Sensor type +%S 400 +//Sensor name and data for sensor # 47 +%N CP2 +-0.0052 -0.0366 0.1393 +//Sensor type +%S 400 +//Sensor name and data for sensor # 48 +%N CP4 +-0.0129 -0.0590 0.1219 +//Sensor type +%S 400 +//Sensor name and data for sensor # 49 +%N CP6 +-0.0181 -0.0743 0.0932 +//Sensor type +%S 400 +//Sensor name and data for sensor # 50 +%N TP8 +-0.0214 -0.0778 0.0631 +//Sensor type +%S 400 +//Sensor name and data for sensor # 51 +%N TP10 +-0.0304 -0.0793 0.0319 +//Sensor type +%S 400 +//Sensor name and data for sensor # 52 +%N P7 +-0.0389 0.0753 0.0700 +//Sensor type +%S 400 +//Sensor name and data for sensor # 53 +%N P5 +-0.0390 0.0692 0.0969 +//Sensor type +%S 400 +//Sensor name and data for sensor # 54 +%N P3 +-0.0362 0.0538 0.1200 +//Sensor type +%S 400 +//Sensor name and data for sensor # 55 +%N P1 +-0.0379 0.0292 0.1337 +//Sensor type +%S 400 +//Sensor name and data for sensor # 56 +%N PZ +-0.0366 0.0015 0.1387 +//Sensor type +%S 400 +//Sensor name and data for sensor # 57 +%N P2 +-0.0392 -0.0259 0.1340 +//Sensor type +%S 400 +//Sensor name and data for sensor # 58 +%N P4 +-0.0391 -0.0507 0.1203 +//Sensor type +%S 400 +//Sensor name and data for sensor # 59 +%N P6 +-0.0433 -0.0637 0.0947 +//Sensor type +%S 400 +//Sensor name and data for sensor # 60 +%N P8 +-0.0452 -0.0701 0.0696 +//Sensor type +%S 400 +//Sensor name and data for sensor # 61 +%N PO9 +-0.0696 0.0575 0.0513 +//Sensor type +%S 400 +//Sensor name and data for sensor # 62 +%N PO7 +-0.0627 0.0581 0.0816 +//Sensor type +%S 400 +//Sensor name and data for sensor # 63 +%N PO3 +-0.0604 0.0464 0.1057 +//Sensor type +%S 400 +//Sensor name and data for sensor # 64 +%N POZ +-0.0633 0.0022 0.1185 +//Sensor type +%S 400 +//Sensor name and data for sensor # 65 +%N PO4 +-0.0650 -0.0375 0.1059 +//Sensor type +%S 400 +//Sensor name and data for sensor # 66 +%N PO8 +-0.0684 -0.0462 0.0802 +//Sensor type +%S 400 +//Sensor name and data for sensor # 67 +%N PO10 +-0.0745 -0.0510 0.0526 +//Sensor type +%S 400 +//Sensor name and data for sensor # 68 +%N O1 +-0.0788 0.0314 0.0882 +//Sensor type +%S 400 +//Sensor name and data for sensor # 69 +%N OZ +-0.0841 0.0028 0.0903 +//Sensor type +%S 400 +//Sensor name and data for sensor # 70 +%N O2 +-0.0826 -0.0202 0.0901 +//Sensor type +%S 1C00 +//Sensor name and data for sensor # 1 +%N REF +-0.0395 -0.0622 0.0075 diff --git a/code/eeglab13_4_4b/functions/resources/mheadnew.mat b/code/eeglab13_4_4b/functions/resources/mheadnew.mat new file mode 100644 index 0000000..d17bd09 Binary files /dev/null and b/code/eeglab13_4_4b/functions/resources/mheadnew.mat differ diff --git a/code/eeglab13_4_4b/functions/resources/mheadnew.transform b/code/eeglab13_4_4b/functions/resources/mheadnew.transform new file mode 100644 index 0000000..8567c02 --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/mheadnew.transform @@ -0,0 +1,4 @@ +0 -3 -53.000 -0.200 0 -1.6 1000.0000 1000.0000 1000.0000 + +Orginal file is /data/common1/stern/eeg/jo74/jo74.elp +Nazion, LPA, RPA, REYE, slightly modified manually to appear on mesh \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/resources/mheadnew.xyz b/code/eeglab13_4_4b/functions/resources/mheadnew.xyz new file mode 100644 index 0000000..8397513 --- /dev/null +++ b/code/eeglab13_4_4b/functions/resources/mheadnew.xyz @@ -0,0 +1,75 @@ +1 -90.556 -2.7886 -34.035 Nz +2 1.9119 -68.161 -52.779 LPA +3 4.0881 68.161 -53.221 RPA +4 -52.291 -55.447 -45.873 LEYE +5 -68.498 37.95 -66.77 REYE +6 -92.256 -24.409 11.306 FP1 +7 -98.391 1.5188 12.55 FPZ +8 -89.461 29.487 12.372 FP2 +9 -75.68 -47.129 8.6605 AF7 +10 -74.112 -38.121 32.831 AF3 +11 -78.256 2.11 44.486 AFZ +12 -71.089 41.112 30.687 AF4 +13 -71.437 50.862 3.7189 AF8 +14 -42.715 -67.628 -20.061 F9 +15 -52.491 -66.743 3.3475 F7 +16 -53.301 -59.604 27.592 F5 +17 -51.621 -45.078 49.597 F3 +18 -55.282 -23.744 61.869 F1 +19 -56.841 1.4099 63.919 FZ +20 -55.53 27.089 58.552 F2 +21 -50.184 47.109 48.591 F4 +22 -52.696 59.477 25.428 F6 +23 -49.568 66.613 0.61239 F8 +24 -40.273 68.21 -21.781 F10 +25 -21.732 -73.668 -30.743 FT9 +26 -25.043 -75.148 1.0487 FT7 +27 -27.697 -68.708 33.217 FC5 +28 -25.836 -52.694 58.348 FC3 +29 -22.504 -26.387 75.631 FC1 +30 -27.245 4.3769 77.918 FCZ +31 -25.808 32.37 70.995 FC2 +32 -23.767 55.724 56.296 FC4 +33 -23.2 71.11 28.122 FC6 +34 -22.634 77.594 -0.35807 FT8 +35 -20.055 75.34 -30.267 FT10 +36 3.8149 -81.319 -0.0055424 T7 +37 1.8156 -76.275 34.683 C5 +38 3.9824 -58.879 64.548 C3 +39 4.5284 -31.855 82.293 C1 +40 3.1373 2.2782 89.514 CZ +41 4.0437 35.572 80.249 C2 +42 5.6143 61.333 62.074 C4 +43 4.5122 76.585 31.688 C6 +44 3.9537 81.467 -2.0743 T8 +45 31.066 -82.284 -26.855 TP9 +46 30.211 -81.794 5.2553 TP7 +47 33.86 -77.669 36.452 CP5 +48 33.01 -59.852 65.092 CP3 +49 35.139 -33.189 84.047 CP1 +50 36.326 -0.26843 88.704 CPZ +51 34.721 36.736 82.703 CP2 +52 38.167 59.352 64.251 CP4 +53 37.121 74.797 35.179 CP6 +54 34.274 78.392 5.0438 TP8 +55 36.85 80.154 -27.313 TP10 +56 57.17 -74.132 7.4429 P7 +57 62.438 -68.032 33.822 P5 +58 63.843 -52.72 57.107 P3 +59 67.526 -28.081 70.339 P1 +60 66.454 -0.43066 75.658 PZ +61 67.283 27.034 70.695 P2 +62 63.753 51.82 57.431 P4 +63 62.41 64.937 31.583 P6 +64 59.101 71.39 6.6433 P8 +65 83.021 -55.443 -16.878 PO9 +66 82.298 -56.244 14.185 PO7 +67 84.498 -44.617 38.329 PO3 +68 88.617 -0.35073 50.555 POZ +69 86.643 39.382 38.099 PO4 +70 84.619 48.178 12.286 PO8 +71 84.974 53.154 -15.947 PO10 +72 98.618 -29.086 17.611 O1 +73 103.41 -0.34313 18.783 OZ +74 101.24 22.603 19.018 O2 +75 41.406 63.327 -53.133 REF diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/acsobiro.m b/code/eeglab13_4_4b/functions/sigprocfunc/acsobiro.m new file mode 100644 index 0000000..f143d16 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/acsobiro.m @@ -0,0 +1,146 @@ +% acsobiro() - A. Chickocki's robust Second-Order Blind Identification (SOBI) +% by joint diagonalization of the time-delayed covariance matrices. +% NOTE: THIS CODE ASSUMES TEMPORALLY CORRELATED SIGNALS. +% Thus, the estimated time-delayed covariance matrices +% for at least some time delays must be nonsingular. +% +% Usage: >> [H] = acsobiro(X); +% >> [H,S] = acsobiro(X,n,p); +% Inputs: +% X - data matrix of dimension [m,N] where +% m is the number of sensors +% N is the number of samples +% n - number of sources {Default: n=m} +% p - number of correlation matrices to be diagonalized {default: 100} +% For noisy data, use at least 100 time delays. +% Outputs: +% H - matrix of dimension [m,n] an estimate of the *mixing* matrix +% S - matrix of dimension [n,N] an estimate of the source activities +% where >> X [m,N] = H [m,n] * S [n,N] +% +% Authors: Implemented and improved by A. Cichocki on the basis of +% the classical SOBI algorithm of Belouchrani and publications of: +% A. Belouchrani et al., F. Cardoso et al., +% S. Choi, S. Cruces, S. Amari, and P. Georgiev +% For references: see function body +% +% Note: Extended by Arnaud Delorme and Scott Makeig to process data epochs +% (computes the correlation matrix respecting epoch boundaries). + +% REFERENCES: +% A. Belouchrani, K. Abed-Meraim, J.-F. Cardoso, and E. Moulines, ``Second-order +% blind separation of temporally correlated sources,'' in Proc. Int. Conf. on +% Digital Sig. Proc., (Cyprus), pp. 346--351, 1993. +% +% A. Belouchrani, and A. Cichocki, +% Robust whitening procedure in blind source separation context, +% Electronics Letters, Vol. 36, No. 24, 2000, pp. 2050-2053. +% +% A. Cichocki and S. Amari, +% Adaptive Blind Signal and Image Processing, Wiley, 2003. + +function [H,S,D]=acsobiro(X,n,p), + +if nargin<1 || nargin > 3 + help acsobiro + return; +end; + +[m,N,ntrials]=size(X); +if nargin==1, + DEFAULT_LAGS = 100; + n=m; % source detection (hum...) + p=min(DEFAULT_LAGS,ceil(N/3)); % number of time delayed correlation matrices to be diagonalized + % Note: For noisy data, use at least p=100. +elseif nargin==2, + DEFAULT_LAGS = 100; + p=min(DEFAULT_LAGS,ceil(N/3)); % number of correlation matrices to be diagonalized +end; + +X(:,:)=X(:,:)-(mean(X(:,:)')'*ones(1,N*ntrials)); % Remove data means + +for t = 1:ntrials + if t == 1 + Rxx=(X(:,1:N-1,t)*X(:,2:N,t)')/(N-1)/ntrials; % Estimate the sample covariance matrix + % for the time delay p=1, to reduce influence + % of white noise. + else + Rxx=Rxx+(X(:,1:N-1,t)*X(:,2:N,t)')/(N-1)/ntrials; % Estimate the sample covariance matrix + % for the time delay p=1, to reduce influence + % of white noise. + end; +end; + +[Ux,Dx,Vx]=svd(Rxx); + Dx=diag(Dx); + +if n1e-99)); % detect the number of sources + fprintf('acsobiro(): Estimated number of sources is %d\n',n); + Q= diag(real(sqrt(1./Dx(1:n))))*Ux(:,1:n)'; +end; +Xb = zeros(size(X)); +Xb(:,:)=Q*X(:,:); % prewhitened data + +% Estimate the time delayed covariance matrices: + k=1; + pn=p*n; % for convenience + for u=1:m:pn, + k=k+1; + for t = 1:ntrials + if t == 1 + Rxp=Xb(:,k:N,t)*Xb(:,1:N-k+1,t)'/(N-k+1)/ntrials; + else + Rxp=Rxp+Xb(:,k:N,t)*Xb(:,1:N-k+1,t)'/(N-k+1)/ntrials; + end; + end; + M(:,u:u+m-1)=norm(Rxp,'fro')*Rxp; % Frobenius norm = + end; % sqrt(sum(diag(Rxp'*Rxp))) + +% Approximate joint diagonalization: +eps=1/sqrt(N)/100; encore=1; U=eye(n); +while encore, encore=0; + for p=1:n-1, + for q=p+1:n, + % Givens rotations: + g=[ M(p,p:n:pn)-M(q,q:n:pn) ; + M(p,q:n:pn)+M(q,p:n:pn) ; + i*(M(q,p:n:pn)-M(p,q:n:pn))]; + [Ucp,D] = eig(real(g*g')); [la,K]=sort(diag(D)); + angles=Ucp(:,K(3));angles=sign(angles(1))*angles; + c=sqrt(0.5+angles(1)/2); + sr=0.5*(angles(2)-j*angles(3))/c; sc=conj(sr); + asr = abs(sr)>eps ; + encore=encore | asr ; + if asr , % Update the M and U matrices: + colp=M(:,p:n:pn); + colq=M(:,q:n:pn); + M(:,p:n:pn)=c*colp+sr*colq; + M(:,q:n:pn)=c*colq-sc*colp; + rowp=M(p,:); + rowq=M(q,:); + M(p,:)=c*rowp+sc*rowq; + M(q,:)=c*rowq-sr*rowp; + temp=U(:,p); + U(:,p)=c*U(:,p)+sr*U(:,q); + U(:,q)=c*U(:,q)-sc*temp; + end %% if + end %% q loop + end %% p loop +end %% while + +% Estimate the mixing matrix H +H= pinv(Q)*U(1:n,1:n); + +% Estimate the source activities S +if nargout>1 + S=[]; + W=U(1:n,1:n)'*Q; + S= W*X(:,:); +end + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/adjustlocs.m b/code/eeglab13_4_4b/functions/sigprocfunc/adjustlocs.m new file mode 100644 index 0000000..7b9607c --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/adjustlocs.m @@ -0,0 +1,415 @@ +% adjustlocs() - read neuroscan polar location file (.asc) +% +% Usage: +% >> chanlocs = adjustlocs( chanlocs ); +% >> chanlocs = adjustlocs( chanlocs, 'key1', val1, 'key2', val2, ...); +% +% Inputs: +% chanlocs - EEGLAB channel location data structure. See +% help readlocs() +% +% Optional inputs: +% 'center' - [cell array] one or several electrode names to compute +% center location (if several electrodes are provided, the +% function use their iso-barycenter). Ex: { 'cz' } or +% { 'fz' 'pz' }. +% 'autocenter' - ['on'|'off'] attempt to automatically detect all symetrical +% electrode in the 10-20 system to compute the center. +% Default: 'on'. +% 'rotate' - [cell array] name and planar angle of landmark electrodes +% to use as template planar rotation. Ex: { 'c3', 90 }. +% 'autorotate' - ['on'|'off'] attempt to automatically detect +% electrode in the 10-20 system to compute the average +% planar rotation. Default 'on'. +% 'scale' - [cell array] name and phi angle of electrodes along +% horizontal central line. Ex: { 'c3' 44 }. Scale uniformly +% all direction. Use 'hscale' and 'vscale' for scaling x and +% y axis independently. +% 'hscale' - [cell array] name and phi angle of electrodes along +% honrizontal central line. Ex: { 'c3' 44 }. +% 'vscale' - [cell array] name and phi angle of one electrodes along +% central vertical axis. Ex: { 'fz' 44 }. +% 'autoscale' - ['on'|'off'] automatic scaling with 10-20 system used as +% reference. Default is 'on'. +% 'uniform' - ['on'|'off'] force the scaling to be uniform along the X +% and the Y axis. Default is 'on'. +% 'coordinates' - ['pol'|'sph'|'cart'] use polar coordinates ('pol'), sperical +% coordinates ('sph') or cartesian ('cart'). Default is 'sph'. +% (Note that using polar and spherical coordinates have the +% same effect, except that units are different). +% Default is 'sph'. +% +% Outputs: +% chanlocs - EEGLAB channel location data structure. See +% help readlocs() +% +% Note: operations are performed in the following order, first re-centering +% then planar rotation and finally sperical re-scaling. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 1 Dec 2003 +% +% See also: readlocs() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function chanlocs = adjustlocs( chanlocs, varargin) + + if nargin < 1 + help adjustlocs; + return; + end; + + % check input parameters + % ---------------------- + g = finputcheck( varargin, { 'hscale' 'cell' [] {}; + 'vscale' 'cell' [] {}; + 'scale' 'cell' [] {}; + 'center' 'cell' [] {}; + 'rotate' 'cell' [] {}; + 'autoscale' 'string' { 'on','off' } 'off'; + 'autocenter' 'string' { 'on','off' } 'on'; + 'autorotate' 'string' { 'on','off' } 'on'; + 'uniform' 'string' { 'on','off' } 'on'; + 'coordinates' 'string' { 'pol','sph','cart' } 'sph' }); + if ischar(g), error(g); end; + + names = { chanlocs.labels }; + + % auto center + % ----------- + if strcmpi(g.autocenter, 'on') & isempty(g.center) + disp('Reading template 10-20 file'); + locs1020 = readlocs('eeglab1020.ced'); + + % scan electrodes for horiz pos + % ----------------------------- + tmpnames = lower(names); + tmpnames1020 = lower({ locs1020.labels }); + [tmp indelec] = intersect_bc(tmpnames1020, tmpnames); + + % remove non-symetrical electrodes + % -------------------------------- + if ~isempty(indelec) + if find(indelec == 79), indelec(end+1) = 80; end; % for Cz + ind2remove = []; + for index = 1:length(indelec) + if mod(indelec(index),2) + if ~ismember(indelec(index)+1, indelec) + ind2remove = [ ind2remove index ]; + end; + else + if ~ismember(indelec(index)-1, indelec) + ind2remove = [ ind2remove index ]; + end; + end; + end; + indelec(ind2remove) = []; + if find(indelec == 80), indelec(end) = []; end; % for Cz + + g.center = tmpnames1020(indelec); + end; + if isempty(g.center) + disp('No electrodes found for auto-centering') + else + disp([ num2str(length(g.center)) ' landmark electrodes found for position auto-centering' ]) + end; + end; + + % auto rotate + % ----------- + if strcmpi(g.autorotate, 'on') & isempty(g.rotate) + if exist('locs1020') ~= 1 + disp('Reading template 10-20 file'); + locs1020 = readlocs('eeglab1020.ced'); + end; + + % scan electrodes for horiz pos + % ----------------------------- + tmpnames = lower(names); + tmpnames1020 = lower({ locs1020.labels }); + tmptheta1020 = { locs1020.theta }; + [tmp indelec] = intersect_bc(tmpnames1020(1:end-1), tmpnames); % do not use cz + + g.rotate(1:2:2*length(indelec)) = tmpnames1020 (indelec); + g.rotate(2:2:2*length(indelec)+1) = tmptheta1020(indelec); + + if isempty(g.rotate) + disp('No electrodes found for auto planar rotation') + else + disp([ num2str(length(g.rotate)/2) ' landmark electrodes found for auto planar rotation' ]) + end; + end; + + % auto scale + % ---------- + if strcmpi(g.autoscale, 'on') & isempty(g.hscale) & isempty(g.vscale) + if exist('locs1020') ~= 1 + disp('Reading template 10-20 file'); + locs1020 = readlocs('eeglab1020.ced'); + end; + + if strcmpi(g.uniform, 'off') + % remove all vertical electrodes for horizontal scaling + % ----------------------------------------------------- + theta = [ locs1020.theta ]; + indxh = find(abs(theta) == 90); + indxv = union_bc(find(theta == 0) , find(theta == 180)); + locs1020horiz = locs1020(indxh); + locs1020vert = locs1020(indxv); + + % scan electrodes for horiz pos + % ----------------------------- + tmpnames = lower(names); + tmpnames1020 = lower({ locs1020horiz.labels }); + tmpradius1020 = { locs1020horiz.radius }; + [tmp indelec] = intersect_bc(tmpnames1020, tmpnames); + + if isempty(indelec) + disp('No electrodes found for horiz. position spherical re-scaling') + else + disp([ num2str(length(indelec)) ' landmark electrodes found for horiz. position spherical re-scaling' ]); + if strcmpi(g.coordinates, 'cart') + g.hscale(2:2:2*length(indelec)+1) = [ locs1020horiz.Y ]; + else + g.hscale(2:2:2*length(indelec)+1) = tmpradius1020(indelec); + end; + end; + + % scan electrodes for vert. pos + % ----------------------------- + tmpnames1020 = lower({ locs1020vert.labels }); + tmpradius1020 = { locs1020vert.radius }; + [tmp indelec] = intersect_bc(tmpnames1020, tmpnames); + + if isempty(indelec) + disp('No electrodes found for vertical position spherical re-scaling') + else + disp([ num2str(length(indelec)) ' landmark electrodes found for vertical spherical re-scaling' ]); + g.vscale(1:2:2*length(indelec)) = tmpnames1020 (indelec); + if strcmpi(g.coordinates, 'cart') + g.vscale(2:2:2*length(indelec)+1) = [ locs1020vert.X ]; + else + g.vscale(2:2:2*length(indelec)+1) = tmpradius1020(indelec); + end; + end; + else + % uniform scaling + % --------------- + tmpnames = lower(names); + tmpnames1020 = lower({ locs1020.labels }); + tmpradius1020 = { locs1020.radius }; + [tmp indelec] = intersect_bc(tmpnames1020, tmpnames); + + if isempty(indelec) + disp('No electrodes found for uniform spherical re-scaling') + else + disp([ num2str(length(indelec)) ' landmark electrodes found for uniform spherical re-scaling' ]); + g.scale(1:2:2*length(indelec)) = tmpnames1020 (indelec); + if strcmpi(g.coordinates, 'cart') + tmpabsxyz = mattocell(abs([ locs1020.X ]+j*[ locs1020.Y ])); + g.scale(2:2:2*length(indelec)+1) = tmpabsxyz(indelec); + else + g.scale(2:2:2*length(indelec)+1) = tmpradius1020(indelec); + end; + end; + end; + if strcmpi(g.coordinates, 'sph') + g.coordinates = 'pol'; % use polar coordinates for scaling + end; + end; + + % get X and Y coordinates + % ----------------------- + if strcmpi(g.coordinates, 'sph') | strcmpi(g.coordinates, 'pol') + [X Y] = pol2cart( [ chanlocs.theta ]/180*pi, [ chanlocs.radius ]); Z = 1; + if strcmpi(g.coordinates, 'sph') + X = X/0.25*46; + Y = Y/0.25*46; + end; + else + X = [ chanlocs.X ]; + Y = [ chanlocs.Y ]; + Z = [ chanlocs.Z ]; + end; + + % recenter + % -------- + if ~isempty(g.center) + for index = 1:length(g.center) + tmpindex = strmatch( lower(g.center{index}), lower(names), 'exact' ); + if isempty(tmpindex) + error(['Electrode ''' g.center{index} ''' not found for re-centering']); + end; + indexelec(index) = tmpindex; + end; + showmsg('Using electrode', 'for re-centering', g.center); + centerx = mean(X(indexelec)); + centery = mean(Y(indexelec)); + X = X - centerx; + Y = Y - centery; + end; + + % planar rotation + % --------------- + if ~isempty(g.rotate) + % find electrodes + % --------------- + clear elec; + for index = 1:2:length(g.rotate) + tmpindex = strmatch( lower(g.rotate{index}), lower(names), 'exact' ); + if isempty(tmpindex) + error(['Electrode ''' g.rotate{index} ''' not found for left-right scaling']); + end; + elec((index+1)/2) = tmpindex; + end; + vals = [ g.rotate{2:2:end} ]; + + % compute average scaling factor + % ------------------------------ + [ allangles tmp ] = cart2pol(X(elec), Y(elec)); + allangles = allangles/pi*180; + diffangle = allangles - vals; + %diffangle2 = allangles + vals; + %if abs(diffangle1) > abs(diffangle2), diffangle = diffangle2; + %else diffangle = diffangle1; + %end; + tmpind = find(diffangle > 180); diffangle(tmpind) = diffangle(tmpind)-360; + tmpind = find(diffangle < -180); diffangle(tmpind) = diffangle(tmpind)+360; + anglerot = mean(diffangle); + tmpcplx = (X+j*Y)*exp(-j*anglerot/180*pi); + X = real(tmpcplx); + Y = imag(tmpcplx); + showmsg('Using electrode', ['for planar rotation (' num2str(anglerot,2) ' degrees)'], g.rotate(1:2:end)); + end; + + % computing scaling factors + % ------------------------- + if ~isempty(g.scale) + % find electrodes + % --------------- + clear elec; + for index = 1:2:length(g.scale) + tmpindex = strmatch( lower(g.scale{index}), lower(names), 'exact' ); + if isempty(tmpindex) + error(['Electrode ''' g.scale{index} ''' not found for left-right scaling']); + end; + elec((index+1)/2) = tmpindex; + end; + vals = [ g.scale{2:2:end} ]; + + % compute average scaling factor + % ------------------------------ + nonzero = find(vals > 0); + hscalefact = mean(abs(Y(elec(nonzero))+j*X(elec(nonzero)))./vals(nonzero)); % *46/0.25; %/44/0.25; + vscalefact = hscalefact; + showmsg('Using electrode', ['for uniform spherical re-scaling (x' num2str(1/hscalefact,4) ')'], g.scale(1:2:end)); + else + if ~isempty(g.hscale) + % find electrodes + % --------------- + clear elec; + for index = 1:2:length(g.hscale) + tmpindex = strmatch( lower(g.hscale{index}), lower(names), 'exact' ); + if isempty(tmpindex) + error(['Electrode ''' g.hscale{index} ''' not found for left-right scaling']); + end; + elec((index+1)/2) = tmpindex; + end; + vals = [ g.hscale{2:2:end} ]; + showmsg('Using electrode', [ 'for left-right spherical re-scaling (x' num2str(1/hscalefact,4) ')'], g.hscale(1:2:end)); + + % compute average scaling factor + % ------------------------------ + hscalefact = mean(abs(Y(elec))./vals); % *46/0.25; %/44/0.25; + if isempty(g.vscale) + vscalefact = hscalefact; + end; + end; + if ~isempty(g.vscale) + % find electrodes + % --------------- + clear elec; + for index = 1:2:length(g.vscale) + tmpindex = strmatch( lower(g.vscale{index}), lower(names), 'exact' ); + if isempty(tmpindex) + error(['Electrode ''' g.vscale{index} ''' not found for rear-front scaling']); + end; + elec((index+1)/2) = tmpindex; + end; + vals = [ g.vscale{2:2:end} ]; + showmsg('Using electrode', ['for rear-front spherical re-scaling (x' num2str(1/vscalefact,4) ')'], g.vscale(1:2:end)); + + % compute average scaling factor + % ------------------------------ + vscalefact = mean(abs(X(elec))./vals); % *46/0.25; %/44/0.25; + if isempty(g.vscale) + hscalefact = vscalefact; + end; + end; + end; + + % uniform? + % -------- + if strcmpi(g.uniform, 'on') & ( ~isempty(g.vscale) | ~isempty(g.hscale)) + disp('uniform scaling: averaging left-right and rear-front scaling factor'); + hscalefact = mean([hscalefact vscalefact]); + vscalefact = hscalefact; + end; + + % scaling data + % ------------ + if ~isempty(g.vscale) | ~isempty(g.hscale) | ~isempty(g.scale) + Y = Y/hscalefact; + X = X/vscalefact; + Z = Z/((hscalefact+vscalefact)/2); + end; + + % updating structure + % ------------------ + if strcmpi(g.coordinates, 'sph') | strcmpi(g.coordinates, 'pol') + [phi,theta] = cart2pol(Y, X); + phi = phi/pi*180; + if strcmpi(g.coordinates, 'pol') + theta = theta/0.25*46; + end; + + % convert to other types of coordinates + % ------------------------------------- + labels = names'; + chanlocs = struct('labels', names, 'sph_theta_besa', mattocell(theta), ... + 'sph_phi_besa', mattocell(phi), 'sph_radius', { chanlocs.sph_radius }); + chanlocs = convertlocs( chanlocs, 'sphbesa2all'); + else + for index = 1:length(chanlocs) + chanlocs(index).X = X(index); + chanlocs(index).Y = Y(index); + chanlocs(index).Z = Z(index); + end; + chanlocs = convertlocs(chanlocs, 'cart2all'); + end; + +function showmsg(begmsg, endmsg, struct); + if length(struct) <= 1 + disp([ begmsg ' ''' struct{1} ''' ' endmsg]); + elseif length(struct) <= 2 + disp([ begmsg ' ''' struct{1} ''' and ''' struct{2} ''' ' endmsg]); + elseif length(struct) <= 3 + disp([ begmsg ' ''' struct{1} ''', ''' struct{2} ''' and ''' struct{3} ''' ' endmsg]); + else + disp([ begmsg ' ''' struct{1} ''', ''' struct{2} ''', ''' struct{3} ''' ... ' endmsg]); + end; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/axcopy.m b/code/eeglab13_4_4b/functions/sigprocfunc/axcopy.m new file mode 100644 index 0000000..d650578 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/axcopy.m @@ -0,0 +1,94 @@ +% axcopy() - Copy a Matlab figure axis and its graphic objects to a new pop-up window +% using the left mouse button. +% +% Usage: >> axcopy +% >> axcopy(fig) +% >> axcopy('noticks') +% >> axcopy(fig, command) +% +% Notes: +% 1) Clicking the left mouse button on a Matlab figure axis copies the graphic objects +% in the axis to a new (pop-up) figure window. +% 2) Option 'noticks' does not make x and y tickloabelmodes 'auto' in the pop-up. +% 2) The command option is an optional string that is evaluated in the new window +% when it pops up. This allows the user to customize the pop-up display. +% 3) Deleting the pop-up window containing the copied axis leaves the selected axis +% as the current graphic axis (gca). + +% Authors: Tzyy-Ping Jung & Scott Makeig, SCCN/INC/UCSD, La Jolla, 2000 + +% Copyright (C) 2000 Tzyy-Ping Jung & Scott Makeig, SCCN/INC/UCSD, 3-16-00 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% requires copyaxes.m +% 4-2-00 added 'noticks' -sm +% 01-25-02 reformated help & license -ad +% 02-16-02 debuged exist('fig') -> exist('fig') == 1 -ad +% 02-16-02 added the ignore parent size option -ad +% 03-11-02 remove size option and added command option -ad + +function axcopy(fig, command) + +if (exist('fig') == 1) & strcmp(fig,'noticks') + noticks = 1; + if nargin> 1 + shift + else + fig = []; + end +end +if ~(exist('fig') ==1) | isempty(fig) | fig == 0 + fig = gcf; +end + +if ~strcmpi(get(fig, 'type'), 'axes') + hndl= findobj('parent',fig,'type','axes'); +else + hndl=fig; +end; +offidx=[]; +if exist('command') ~= 1 + comstr = 'copyaxis'; +else + command_dbl = double(command); + comstr = double(['copyaxis(''' char(command_dbl) ''')']); +end; +for a=1:length(hndl) % make all axes visible + allobjs = findobj('parent',hndl(a)); + for index = 1:length(allobjs) + if isempty(get(allobjs(index), 'ButtonDownFcn')) + set(allobjs(index), 'ButtonDownFcn', char(comstr)); + end; + end; +end +if ~strcmpi(get(fig, 'type'), 'axes') + figure(fig); +else + figure(get(fig, 'parent')); +end; +if exist('command') ~= 1 + set(hndl(a),'ButtonDownFcn','copyaxis'); +else + % set(hndl,'ButtonDownFcn',['copyaxis(''' command ''')']); + comstr = double(['copyaxis(''' char(command_dbl) ''')']); + set(hndl,'ButtonDownFcn',char(comstr)); +end; +%set(hndl,'ButtonDownFcn','copyaxis'); +%if ~exist('noticks') + %axis on + %set(gca,'xticklabelmode','auto') + %set(gca,'yticklabelmode','auto') +%end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/binica.m b/code/eeglab13_4_4b/functions/sigprocfunc/binica.m new file mode 100644 index 0000000..b1d3dea --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/binica.m @@ -0,0 +1,431 @@ +% binica() - Run stand-alone binary version of runica() from the +% Matlab command line. Saves time and memory relative +% to runica(). If stored in a float file, data are not +% read into Matlab, and so may be larger than Matlab +% can handle owing to memory limitations. +% Usage: +% >> [wts,sph] = binica( datavar, 'key1', arg1, 'key2', arg2 ...); +% else +% >> [wts,sph] = binica('datafile', chans, frames, 'key1', arg1, ...); +% +% Inputs: +% datavar - (chans,frames) data matrix in the Matlab workspace +% datafile - quoted 'filename' of float data file multiplexed by channel +% channels - number of channels in datafile (not needed for datavar) +% frames - number of frames (time points) in datafile (only) +% +% Optional flag,argument pairs: +% 'extended' - int>=0 [0 default: assume no subgaussian comps] +% Search for subgaussian comps: 'extended',1 is recommended +% 'pca' - int>=0 [0 default: don't reduce data dimension] +% NB: 'pca' reduction not recommended unless necessary +% 'sphering' - 'on'/'off' first 'sphere' the data {default: 'on'} +% 'lrate' - (0=0 [0 default: heuristic, from data size] +% 'maxsteps' - int>0 {default: 512} +% 'stop' - (0 25 + more on + help binica + more off + return +end +if size(data,3) > 1, data = reshape(data, size(data,1), size(data,2)*size(data,3) ); end; + +icadefs % import ICABINARY and SC +if ~exist('SC') + fprintf('binica(): You need to update your icadefs file to include ICABINARY and SC.\n') + return +end; +if exist(SC) ~= 2 + fprintf('binica(): No ica source file ''%s'' is in your Matlab path, check...\n', SC); + return +else + SC = which(SC); + fprintf('binica: using source file ''%s''\n', SC); +end +if exist(ICABINARY) ~= 2 + fprintf('binica(): ica binary ''%s'' is not in your Matlab path, check\n', ICABINARY); + return +else + ICABINARYdir = which(ICABINARY); + if ~isempty(ICABINARYdir) + fprintf('binica(): using binary ica file ''%s''\n', ICABINARYdir); + else + fprintf('binica(): using binary ica file ''\?/%s''\n', ICABINARY); + end; +end + +[flags,args] = read_sc(SC); % read flags and args in master SC file + +% +% substitute the flags/args pairs in the .sc file +% + +tmpint=[]; + +if ~ischar(data) % data variable given + firstarg = 2; +else % data filename given + firstarg = 4; +end + +arg = firstarg; +if arg > nargin + fprintf('binica(): no optional (flag, argument) pairs received.\n'); +else + if (nargin-arg+1)/2 > 1 + fprintf('binica(): processing %d (flag, arg) pairs.\n',(nargin-arg+1)/2); + else + fprintf('binica(): processing one (flag, arg) pair.\n'); + end + while arg <= nargin %%%%%%%%%%%% process flags & args %%%%%%%%%%%%%%%% + + eval(['OPTIONFLAG = var' int2str(arg) ';']); + % NB: Found that here Matlab var 'FLAG' is (64,3) why!?!? + + if arg == nargin + fprintf('\nbinica(): Flag %s needs an argument.\n',OPTIONFLAG) + return + end + eval(['Arg = var' int2str(arg+1) ';']); + + if strcmpi(OPTIONFLAG,'pca') + ncomps = Arg; % get number of components out for reading wts. + end + + if strcmpi(OPTIONFLAG,'weightsin') + wtsin = Arg; + if exist('wtsin') == 2 % file + fprintf(' setting %s, %s\n','weightsin',Arg); + elseif exist('wtsin') == 1 % variable + nchans = size(data,1); % by nima + if size(wtsin,2) ~= nchans + fprintf('weightsin variable must be of width %d\n',nchans); + return + end + else + fprintf('weightsin variable not found.\n'); + return + end + end + + if strcmpi(OPTIONFLAG,'filenum') + tmpint = Arg; % get number for name of output files + if ~isnumeric(tmpint) + fprintf('\nbinica(): FileNum argument needs to be a number. Will use random number instead.\n') + tmpint=[]; + end; + tmpint=int2str(tmpint); + end + + arg = arg+2; + + nflags = length(flags); + for f=1:nflags % replace SC arg with Arg passed from commandline + if strcmp(OPTIONFLAG,flags{f}) + args{f} = num2str(Arg); + fprintf(' setting %s, %s\n',flags{f},args{f}); + end + end + end +end + +% +% select random integer 1-10000 to index the binica data files +% make sure no such script file already exists in the pwd +% +scriptfile = ['binica' tmpint '.sc']; +while exist(scriptfile) + tmpint = int2str(round(rand*10000)); + scriptfile = ['binica' tmpint '.sc']; +end +fprintf('scriptfile = %s\n',scriptfile); + +nchans = 0; +tmpdata = []; +if ~ischar(data) % data variable given + if ~exist('data') + fprintf('\nbinica(): Variable name data not found.\n'); + return + end + nchans = size(data,1); + nframes = size(data,2); + tmpdata = ['binica' tmpint '.fdt']; + if strcmpi(computer, 'MAC') + floatwrite(data,tmpdata,'ieee-be'); + else + floatwrite(data,tmpdata); + end; + datafile = tmpdata; + +else % data filename given + if ~exist(data) + fprintf('\nbinica(): File data not found.\n') + return + end + datafile = data; + if nargin<3 + fprintf(... +'\nbinica(): Data file name must be followed by chans, frames\n'); + return + end + nchans = var2; + nframes = var3; + if ischar(nchans) | ischar(nframes) + fprintf(... +'\nbinica(): chans, frames args must be given after data file name\n'); + return + end +end + +% +% insert name of data files, chans and frames +% +for x=1:length(flags) + if strcmp(flags{x},'DataFile') + datafile = [pwd '/' datafile]; + args{x} = datafile; + elseif strcmp(flags{x},'WeightsOutFile') + weightsfile = ['binica' tmpint '.wts']; + weightsfile = [pwd '/' weightsfile]; + args{x} = weightsfile; + elseif strcmp(flags{x},'WeightsTempFile') + weightsfile = ['binicatmp' tmpint '.wts']; + weightsfile = [pwd '/' weightsfile]; + args{x} = weightsfile; + elseif strcmp(flags{x},'SphereFile') + spherefile = ['binica' tmpint '.sph']; + spherefile = [pwd '/' spherefile]; + args{x} = spherefile; + elseif strcmp(flags{x},'chans') + args{x} = int2str(nchans); + elseif strcmp(flags{x},'frames') + args{x} = int2str(nframes); + end +end + +% +% write the new .sc file +% +fid = fopen(scriptfile,'w'); +for x=1:length(flags) + fprintf(fid,'%s %s\n',flags{x},args{x}); +end +if exist('wtsin') % specify WeightsInfile from 'weightsin' flag, arg + if exist('wtsin') == 1 % variable + winfn = [pwd '/binica' tmpint '.inwts']; + if strcmpi(computer, 'MAC') + floatwrite(wtsin,winfn,'ieee-be'); + else + floatwrite(wtsin,winfn); + end; + fprintf(' saving input weights:\n '); + weightsinfile = winfn; % weights in file name + elseif exist(wtsin) == 2 % file + weightsinfile = wtsin; + weightsinfile = [pwd '/' weightsinfile]; + else + fprintf('binica(): weightsin file|variable not found.\n'); + return + end + eval(['!ls -l ' weightsinfile]); + fprintf(fid,'%s %s\n','WeightsInFile',weightsinfile); +end +fclose(fid); +if ~exist(scriptfile) + fprintf('\nbinica(): ica script file %s not written.\n',... + scriptfile); + return +end + +% +% %%%%%%%%%%%%%%%%%%%%%% run binary ica %%%%%%%%%%%%%%%%%%%%%%%%% +% + fprintf('\nRunning ica from script file %s\n',scriptfile); + if exist('ncomps') + fprintf(' Finding %d components.\n',ncomps); + end + eval_call = ['!' ICABINARY '<' pwd '/' scriptfile]; + eval(eval_call); +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +% +% read in wts and sph results. +% +if ~exist('ncomps') + ncomps = nchans; +end + +if strcmpi(computer, 'MAC') + wts = floatread(weightsfile,[ncomps Inf],'ieee-be',0); + sph = floatread(spherefile,[nchans Inf],'ieee-be',0); +else + wts = floatread(weightsfile,[ncomps Inf],[],0); + sph = floatread(spherefile,[nchans Inf],[],0); +end; +if isempty(wts) + fprintf('\nbinica(): weight matrix not read.\n') + return +end +if isempty(sph) + fprintf('\nbinica(): sphere matrix not read.\n') + return +end +fprintf('\nbinary ica files left in pwd:\n'); +eval(['!ls -l ' scriptfile ' ' weightsfile ' ' spherefile]); +if exist('wtsin') + eval(['!ls -l ' weightsinfile]); +end +fprintf('\n'); + +if ischar(data) + whos wts sph +else + whos data wts sph +end + +% +% If created by binica(), rm temporary data file +% NOTE: doesn't remove the .sc .wts and .fdt files + +if ~isempty(tmpdata) + eval(['!rm -f ' datafile]); +end + +% +%%%%%%%%%%%%%%%%%%% included functions %%%%%%%%%%%%%%%%%%%%%% +% +function sout = rmcomment(s,symb) + n =1; + while s(n)~=symb % discard # comments + n = n+1; + end + if n == 1 + sout = []; + else + sout = s(1:n-1); + end + +function sout = rmspace(s) + n=1; % discard leading whitespace + while nlength(s) + word = []; + sout = s; + else + word = s(1:n-1); + sout = s(n:end); + end + +function [flags,args] = read_sc(master_sc) +% +% read in the master ica script file SC +% +flags = []; +args = []; +fid = fopen(master_sc,'r'); +if fid < 0 + fprintf('\nbinica(): Master .sc file %s not read!\n',master_sc) + return +end +% +% read SC file info into flags and args lists +% +s = []; +f = 0; % flag number in file +while isempty(s) | s ~= -1 + s = fgetl(fid); + if s ~= -1 + if ~isempty(s) + s = rmcomment(s,'#'); + if ~isempty(s) + f = f+1; + s = rmspace(s); + [w s]=firstword(s); + if ~isempty(s) + flags{f} = w; + s = rmspace(s); + [w s]=firstword(s); + args{f} = w; + end + end + end + end +end +fclose(fid); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/binica.sc b/code/eeglab13_4_4b/functions/sigprocfunc/binica.sc new file mode 100644 index 0000000..15902ab --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/binica.sc @@ -0,0 +1,78 @@ +# ica - Perform infomax independent component analysis +# the binary ica application. +# +# Master input settings file for running the ICA algorithm of Bell & Sejnowski +# (1996) and/or the extended-ICA algorithm of Lee, Girolami & Sejnowski (1998). +# via the stand-alone C++-coded binary. This is the master .sc file. +# Normally, do not alter this file. Matlab function binica() makes +# a customized copy in the pwd and runs the binary ica application from +# that copy. Original Matlab code (runica.m) by Scott Makeig with +# code contributions by Tony Bell, Te-Won Lee, et al. C++ translation +# by Sigurd Enghoff, CNL / Salk Institute 7/98 +# +# The MATLAB binica() routine can be used to call binary ica from Matlab. +# Usage: >> [wts,sph] = binica(data,[runica() args]); +# +# Contacts: {scott,jung}@sccn.ucsd.edu +# {tony,terry}@salk.edu +# +# Required input variables: +# + DataFile XXX # Input data to decompose (native floats) + # multiplexed by channel (i.e., c1, c2, ...)) + chans 31 # Number of data channels (= data columns) + frames 768 # Number of data points (= data rows) +# +# Output variables: +# + WeightsOutFile binica.wts # Output ICA weight matrix (floats) + SphereFile binica.sph # Output sphering matrix (floats) +# +# Note: input data files must be, and output files will be native floats. +# +# Processing options: +# + sphering on # Flag sphering of data (on/off) {default: on} + bias on # Perform bias adjustment (on/off) {default: on} + extended 0 # Perform "extended-ICA" using tnah() with kurtosis + # estimation every N training blocks. If N < 0, + # fix number of sub-Gaussian components to -N + # {default|0: off} + pca 0 # Decompose a principal component subspace of +# # the data. Retain this many PCs. {default|0: all} +# Optional input variables: +# + lrate 1.0e-4 # Initial ICA learning rate (float << 1) + # {default: heuristic ~5e-4} + blocksize 0 # ICA block size (integer << datalength) + # {default: heuristic fraction of log data length} + stop 1.0e-7 # Stop training when weight-change < this value + # {default: heuristic ~0.0000001} + maxsteps 512 # Max. number of ICA training steps {default: 128} + posact off # Make each component activation net-positive + # (on/off) NB: requires extra space! {default: off} + annealstep 0.98 # Annealing factor (range (0,1]) - controls + # the speed of convergence. + annealdeg 60 # Angledelta threshold for annealing {default: 60} + momentum 0 # Momentum gain (range [0,1]) {default: 0} + verbose on # Give ascii messages (on/off) {default: on} +# +# Optional input starting weights: +# +# WeightsInFile file # Starting ICA weight matrix (nchans,ncomps) +# # {default: identity or sphering matrix} +# +# Optional output files: +# +# ActivationsFile data.act # Activations of each component (ncomps,points) +# BiasFile data.bs # Bias weights (ncomps,1) +# SignFile data.sgn # Signs designating (-1) sub- and (1) super-Gaussian + # components (ncomps,1) from 'extended' mode training +# Unused flags +# +# epochs 436 # Number of epochs +# FrameWindow 20 # Number of frames per window +# FrameStep 4 # Number of frames to step per window +# EpochWindow 100 # Number of epochs per window +# EpochStep 25 # Number of epochs to step per window +# Baseline 25 # Number of data points contained in baseline diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/biosig2eeglab.m b/code/eeglab13_4_4b/functions/sigprocfunc/biosig2eeglab.m new file mode 100644 index 0000000..600008f --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/biosig2eeglab.m @@ -0,0 +1,206 @@ +% biosig2eeglab() - convert BIOSIG structue to EEGLAB structure +% +% Usage: +% >> OUTEEG = pop_biosig2eeglab(hdr, data, interval); +% +% Inputs: +% hdr - BIOSIG header +% data - BIOSIG data array +% +% Optional input: +% interval - BIOSIG does not remove event which are outside of +% the data range when importing data range subsets. This +% parameter helps fix this problem. +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, Oct. 29, 2009- +% +% Note: BIOSIG toolbox must be installed. Download BIOSIG at +% http://biosig.sourceforge.net +% Contact a.schloegl@ieee.org for troubleshooting using BIOSIG. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = biosig2eeglab(dat, DAT, interval, channels, importevent); + +if nargin < 2 + help biosig2eeglab; + return; +end; +if nargin < 3 + interval = []; +end; +if nargin < 4 + channels = []; +end; +if nargin < 5 + importevent = 0; +end; + +% import data +% ----------- +if abs(dat.NS - size(DAT,1)) > 1 + DAT = DAT'; +end; +EEG = eeg_emptyset; + +% convert to seconds for sread +% ---------------------------- +EEG.nbchan = size(DAT,1); +EEG.srate = dat.SampleRate(1); +EEG.data = DAT; +clear DAT; +% try % why would you do the following??????? JO +% EEG.data = EEG.data'; +% catch, +% pack; +% EEG.data = EEG.data'; +% end; +EEG.setname = sprintf('%s file', dat.TYPE); +EEG.comments = [ 'Original file: ' dat.FileName ]; +EEG.xmin = 0; +nepoch = dat.NRec; +EEG.trials = nepoch; +EEG.pnts = size(EEG.data,2)/nepoch; + +if isfield(dat,'T0') + EEG.etc.T0 = dat.T0; % added sjo +end + +if isfield(dat, 'Label') & ~isempty(dat.Label) + if isstr(dat.Label) + EEG.chanlocs = struct('labels', cellstr(char(dat.Label(dat.InChanSelect)))); % 5/8/2104 insert (dat.InChanSelect) Ramon + else + % EEG.chanlocs = struct('labels', dat.Label(1:min(length(dat.Label), size(EEG.data,1)))); + EEG.chanlocs = struct('labels', dat.Label(dat.InChanSelect)); % sjo added 120907 to avoid error below % 5/8/2104 insert (dat.InChanSelect) Ramon + end; + if length(EEG.chanlocs) > EEG.nbchan, EEG.chanlocs = EEG.chanlocs(1:EEG.nbchan); end; +end +EEG = eeg_checkset(EEG); + +% extract events % this part I totally revamped to work... JO +% -------------- +EEG.event = []; + +% startval = mode(EEG.data(end,:)); % my code +% for p = 2:size(EEG.data,2)-1 +% [codeout] = code(EEG.data(end,p)); +% if EEG.data(end,p) > EEG.data(end,p-1) & EEG.data(end,p) >= EEG.data(end,p+1) +% EEG.event(end+1).latency = p; +% EEG.event(end).type = bitand(double(EEG.data(end,p)-startval),255); +% end; +% end; + +% lastout = mod(EEG.data(end,1),256);newevs = []; % andrey's code 8 bits +% codeout = mod(EEG.data(end,2),256); +% for p = 2:size(EEG.data,2)-1 +% nextcode = mod(EEG.data(end,p+1),256); +% if codeout > lastout & codeout >= nextcode +% newevs = [newevs codeout]; +% EEG.event(end+1).latency = p; +% EEG.event(end).type = codeout; +% end; +% lastout = codeout; +% codeout = nextcode; +% end; + +%lastout = mod(EEG.data(end,1),256*256);newevs = []; % andrey's code 16 bits +%codeout = mod(EEG.data(end,2),256*256); +%for p = 2:size(EEG.data,2)-1 +% nextcode = mod(EEG.data(end,p+1),256*256); +% if (codeout > lastout) & (codeout >= nextcode) +% newevs = [newevs codeout]; +% EEG.event(end+1).latency = p; +% EEG.event(end).type = codeout; +% end; +% lastout = codeout; +% codeout = nextcode; +%end; + +% if strcmp(dat.TYPE,'EDF') % sjo added 120907 +% disp('filetype EDF does not support events'); +% importevent = 0; +% end + +if importevent + if isfield(dat, 'BDF') + if dat.BDF.Status.Channel <= size(EEG.data,1) + EEG.data(dat.BDF.Status.Channel,:) = []; + end; + EEG.nbchan = size(EEG.data,1); + if ~isempty(EEG.chanlocs) && dat.BDF.Status.Channel <= length(EEG.chanlocs) + EEG.chanlocs(dat.BDF.Status.Channel,:) = []; + end; + elseif isempty(dat.EVENT.POS) + disp('Extracting events from last EEG channel...'); + %Modifieded by Andrey (Aug.5,2008) to detect all non-zero codes: + if length(unique(EEG.data(end, 1:100))) > 20 + disp('Warning: event extraction failure, the last channel contains data'); + elseif length(unique(EEG.data(end, :))) > 1000 + disp('Warning: event extraction failure, the last channel contains data'); + else + thiscode = 0; + for p = 1:size(EEG.data,2)*size(EEG.data,3)-1 + prevcode = thiscode; + thiscode = mod(EEG.data(end,p),256*256); % andrey's code - 16 bits + if (thiscode ~= 0) && (thiscode~=prevcode) + EEG.event(end+1).latency = p; + EEG.event(end).type = thiscode; + end; + end; + EEG.data(end,:) = []; + EEG.chanlocs(end) = []; + end; + % recreate the epoch field if necessary + % ------------------------------------- + if EEG.trials > 1 + for i = 1:length(EEG.event) + EEG.event(i).epoch = ceil(EEG.event(i).latency/EEG.pnts); + end; + end; + EEG = eeg_checkset(EEG, 'eventconsistency'); + end; + + if ~isempty(dat.EVENT.POS) + if isfield(dat, 'out') % Alois fix for event interval does not work + if isfield(dat.out, 'EVENT') + dat.EVENT = dat.out.EVENT; + end; + end; + EEG.event = biosig2eeglabevent(dat.EVENT, interval); % Toby's fix + + % recreate the epoch field if necessary + % ------------------------------------- + if EEG.trials > 1 + for i = 1:length(EEG.event) + EEG.event(i).epoch = ceil(EEG.event(i).latency/EEG.pnts); + end; + end; + + EEG = eeg_checkset(EEG, 'eventconsistency'); + elseif isempty(EEG.event) + disp('Warning: no event found. Events might be embeded in a data channel.'); + disp(' To extract events, use menu File > Import Event Info > From data channel'); + end; +end; + +% convert data to single if necessary +% ----------------------------------- +EEG = eeg_checkset(EEG,'makeur'); % Make EEG.urevent field +EEG = eeg_checkset(EEG); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/biosig2eeglabevent.m b/code/eeglab13_4_4b/functions/sigprocfunc/biosig2eeglabevent.m new file mode 100644 index 0000000..a3193eb --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/biosig2eeglabevent.m @@ -0,0 +1,86 @@ +% biosig2eeglabevent() - convert biosig events to EEGLAB event structure +% +% Usage: +% >> eeglabevent = biosig2eeglabevent( biosigevent, interval ) +% +% Inputs: +% biosigevent - BioSig event structure +% interval - Period to extract events for, in frames. +% Default [] is all. +% +% Outputs: +% eeglabevent - EEGLAB event structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2006- + +% Copyright (C) 13 2006- Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function event = biosig2eeglabevent(EVENT, interval) + +if nargin < 2 + interval = []; +end; + +event = []; +disp('Importing data events...'); + +% If the interval variable is empty, import all events. +if isempty(interval) + if isfield(EVENT, 'Teeg') + event = EVENT.Teeg; + end + if isfield(EVENT, 'TYP') + for index = 1:length( EVENT.TYP ) + event(index).type = EVENT.TYP(index); + end + end + if isfield(EVENT, 'POS') + for index = 1:length( EVENT.POS ) + event(index).latency = EVENT.POS(index); + end + end + if isfield(EVENT, 'DUR') + if any( [ EVENT.DUR ] ) + for index = 1:length( EVENT.DUR ) + event(index).duration = EVENT.DUR(index); + end + end + end + if isfield(EVENT, 'CHN') + if any( [ EVENT.CHN ] ) + for index = 1:length( EVENT.CHN ) + event(index).chanindex = EVENT.CHN(index); + end + end + end +% If a subinterval was specified, select only events that fall in that range, and +% edit duration field if it exceeds that range. +elseif isfield(EVENT,'POS') + count = 1; + for index = 1:length(EVENT.POS) + pos_tmp = EVENT.POS(index) - interval(1) + 1; + if pos_tmp > 0 & EVENT.POS(index) <= interval(2) + event(count).latency = pos_tmp; + if isfield(EVENT, 'TYP'), event(count).type = EVENT.TYP(index); end + if isfield(EVENT, 'CHN'), event(count).chanindex = EVENT.CHN(index); end + if isfield(EVENT, 'DUR') + event(count).duration = min(EVENT.DUR(index), interval(2) - EVENT.POS(index)); + end + count = count + 1; + end + end +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/blockave.m b/code/eeglab13_4_4b/functions/sigprocfunc/blockave.m new file mode 100644 index 0000000..4f00ab5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/blockave.m @@ -0,0 +1,90 @@ +% blockave() - make block average of concatenated data sets of same size +% Each data set is assumed to be of size (chans,frames). +% Usage: +% >> aveout = blockave(data,frames) +% >> aveout = blockave(data,frames,epochs,weights) +% Inputs: +% data = data matrix of size (chans,frames*epochs) +% frames = columns per data epoch +% epochs = vector of epochs to average {default|0 -> all} +% weights = vector of epoch weights {default|0 -> equal} +% non-equal weights are normalized internally to sum=1 +% Output: +% aveout = averaged data of size (chans, frames) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 1998 + +% Copyright (C) 1998 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 5-14-98 improved error checking, allowed 2 args -sm +% 01-25-02 reformated help & license -ad + +function ave = blockave(data,frames,epochs,weights) + +if nargin < 2 + help blockave + return +end +if nargin<3 + epochs = 0; +end +if nargin<4 + weights = nan; +end +if nargin>4 + help blockave +end + +[chans,framestot]=size(data); +nepochs = floor(framestot/frames); +if nepochs*frames ~= framestot + fprintf('blockave(): frames arg does not divide data length,\n'); + return +end +if max(epochs) > nepochs + help blockave + return +end +if min(epochs) < 1 + if size(epochs,1)>1 | size(epochs,2) > 1 + help blockave + return + else + epochs = 1:nepochs; + end +end +if ~isnan(weights) + if length(weights) ~= nepochs + fprintf(... + 'blockave(): number of weights (%d) must match number of epochs (%d).\n',... + length(weights), nepochs); + end + weights = weights/sum(weights); % normalize +end + +ave = zeros(chans,frames); +epochs = epochs(:)'; % make epochs a row vector +n = 1; +for e=epochs + if isnan(weights) + ave = ave + data(:,(e-1)*frames+1:e*frames); + else + ave = ave + weights(n)*data(:,(e-1)*frames+1:e*frames); + n = n+1; + end +end +ave = ave/length(epochs); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/cart2topo.m b/code/eeglab13_4_4b/functions/sigprocfunc/cart2topo.m new file mode 100644 index 0000000..8cb5f6c --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/cart2topo.m @@ -0,0 +1,167 @@ +% cart2topo() - convert xyz-cartesian channel coordinates +% to polar topoplot() coordinates. Input data +% are points on a sphere centered at (0,0,0) +% or at optional input 'center'. This function +% is now DEPRECATED! See Important warning below. +% +% Usage: >> [th r] = cart2topo(xyz); % 3-column [x y z] position data +% >> [th r] = cart2topo(x,y,z); % separate x,y,z vectors +% >> [th r x y z] = cart2topo(xyz,'key', 'val', ...); +% >> [th r x y z] = cart2topo(x,y,z,'key', 'val', ...); +% +% Optional inputs: +% 'center' = [X Y Z] use a known sphere center {Default: [0 0 0]} +% 'squeeze' = plotting squeeze factor (0[default]->1). -1 -> optimize +% the squeeze factor automatically so that maximum radius is 0.5. +% 'optim' = [0|1] find the best-fitting sphere center minimizing the +% standard deviation of the radius values. +% 'gui' = ['on'|'off'] pops up a gui for optional arguments. +% Default is off. +% +% Example: >> [th r] = cart2topo(xyz,[1 0 4]); +% +% Notes: topoplot() does not plot channels with radius>0.5 +% Shrink radii to within this range to plot all channels. +% [x y z] are returned after the optimization of the center +% and optionally squeezing r towards it by factor 'squeeze' +% +% Important: +% DEPRECATED: cart2topo() should NOT be used if elevation angle is less than 0 +% (for electrodes below zero plane) since then it returns INNACURATE results. +% SUBSTITUTE: Use cart2topo = cart2sph() -> sph2topo(). +% +% Authors: Scott Makeig, Luca Finelli & Arnaud Delorme SCCN/INC/UCSD, +% La Jolla, 11/1999-03/2002 +% +% See also: topo2sph(), sph2topo(), chancenter() + +% Copyright (C) 11/1999 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-16-00 improved help message -sm +% 1-25-02 put spherror subfunction inside cart2topo -ad +% 1-25-02 help pops-up if no arguments -ad +% 01-25-02 reformated help & license -ad +% 02-13-02 now center fitting works, need spherror outside cart2topo -lf +% 02-14-02 radii are squeezed of squeeze in to fit topoplot circle -lf +% 03-31-02 center fitting is optional +% 04-01-02 automatic squeeze calculation -ad & sm + +function [th,r,xx,yy,zz] = cart2topo(x,varargin) + +if nargin<1 + help cart2topo + return; +end; +if nargin >= 2 + if ~ischar(varargin{1}) + y = varargin{1}; + z = varargin{2}; + varargin = varargin(3:end); + end; +end; +if exist('y') ~= 1 + if size(x,2)==3 % separate 3-column data + z = x(:,3); + y = x(:,2); + x = x(:,1); + else + error('Insufficient data in first argument'); + end +end; + +g = []; +if ~isempty(varargin) + try, g = struct(varargin{:}); + catch, error('Argument error in the {''param'', value} sequence'); end; +end; + +try, g.optim; catch, g.optim = 0; end; +try, g.squeeze; catch, g.squeeze = 0; end; +try, g.center; catch, g.center = [0 0 0]; end; +try, g.gui; catch, g.gui = 'off'; end; + +if g.squeeze>1 + fprintf('Warning: Squeeze must be less than 1.\n'); + return +end + +if ~isempty(g.center) & size(g.center,2) ~= 3 + fprintf('Warning: Center must be [x y z].\n'); + return +end + +% convert to columns +x = -x(:); % minus os for consistency between measures +y = -y(:); +z = z(:); + +if any(z < 0) + disp('WARNING: some electrodes lie below the z=0 plane, result may be innacurate') + disp(' Instead use cart2sph() then sph2topo().') +end; +if strcmp(g.gui, 'on') + [x y z newcenter] = chancenter(x, y, z, [], 1); +else + if g.optim == 1 + [x y z newcenter] = chancenter(x, y, z, []); + else + [x y z newcenter] = chancenter(x, y, z, g.center); + end; +end; +radius = (sqrt(x.^2+y.^2+z.^2)); % assume xyz values are on a sphere +xx=-x; yy=-y; zz=z; +x = x./radius; % make radius 1 +y = y./radius; +z = z./radius; + +r = x; th=x; + +for n=1:size(x,1) + if x(n)==0 & y(n)==0 + r(n) = 0; + else + r(n) = pi/2-atan(z(n)./sqrt(x(n).^2+y(n).^2)); + end +end + +r = r/pi; % scale r to max 0.500 +if g.squeeze < 0 + g.squeeze = 1 - 0.5/max(r); %(2*max(r)-1)/(2*rmax); + fprintf('Electrodes will be squeezed together by %2.3g to show all\n', g.squeeze); +end; +r = r-g.squeeze*r; % squeeze electrodes in squeeze*100% to have all inside + +for n=1:size(x,1) + if abs(y(n))<1e-6 + if x(n)>0 + th(n) = -90; + else % x(n) <= 0 + th(n) = 90; + end + else + th(n) = atan(x(n)./y(n))*180/pi+90; + if y(n)<0 + th(n) = th(n)+180; + end + end + if th(n)>180 + th(n) = th(n)-360; + end + if th(n)<-180 + th(n) = th(n)+360; + end +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/cbar.m b/code/eeglab13_4_4b/functions/sigprocfunc/cbar.m new file mode 100644 index 0000000..c3d6e5f --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/cbar.m @@ -0,0 +1,233 @@ +% cbar() - Display full or partial color bar +% +% Usage: +% >> cbar % create a vertical cbar on the right side of a figure +% >> cbar(type) % specify direction as 'vert' or 'horiz' +% >> cbar(type,colors) % specify which colormap colors to plot +% else +% >> cbar(axhandle) % specify the axes to draw cbar in +% +% >> h = cbar(type|axhandle,colors, minmax, grad) +% +% Inputs: +% type - ['vert'|'horiz'] direction of the cbar {default: 'vert') +% ELSE axhandle = handle of axes to draw the cbar +% colors - vector of colormap indices to display, or integer to truncate upper +% limit by. +% (int n -> display colors [1:end-n]) {default: 0} +% minmax - [min, max] range of values to label on colorbar +% grad - [integer] number of tick labels. {default: 5}. +% +% Example: +% >> colormap('default') % default colormap is 64-color 'jet' +% >> cbar('vert',33:64); % plot a vertical cbar colored green->red +% % useful for showing >0 (warm) and 0 (green) +% % values only in a green=0 plot +% +% Author: Colin Humphries, Arnaud Delorme, CNL / Salk Institute, Feb. 1998- +% +% See also: colorbar() + +% Copyright (C) Colin Humphries, CNL / Salk Institute, Feb. 1998 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 12-13-98 added minmax arg -Scott Makeig +% 01-25-02 reformated help & license, added links -ad + +function [handle]=cbar(arg,colors,minmax, grad) + +if nargin < 2 + colors = 0; +end +posscale = 'off'; +if nargin < 1 + arg = 'vert'; + ax = []; +else + if isempty(arg) + arg = 0; + end + if arg(1) == 0 + ax = []; + arg = 'vert'; + elseif strcmpi(arg, 'pos') + ax = []; + arg = 'vert'; + posscale = 'on'; + else + if ischar(arg) + ax = []; + else + ax = arg; + arg = []; + end + end +end + +if nargin>2 + if size(minmax,1) ~= 1 | size(minmax,2) ~= 2 + help cbar + fprintf('cbar() : minmax arg must be [min,max]\n'); + return + end +end +if nargin < 4 + grad = 5; +end; + +%obj = findobj('tag','cbar','parent',gcf); +%if ~isempty(obj) & ~isempty(arg) +% arg = []; +% ax = obj; +%end +try + icadefs; +catch + warning('cbar.m unable to find icadefs.m'); +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Choose colorbar position +%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if (length(colors) == 1) & (colors == 0) + t = caxis; +else + t = [0 1]; +end +if ~isempty(arg) + if strcmp(arg,'vert') + cax = gca; + pos = get(cax,'Position'); + stripe = 0.04; + edge = 0.01; + space = .02; + +% set(cax,'Position',[pos(1) pos(2) pos(3)*(1-stripe-edge-space) pos(4)]) +% rect = [pos(1)+(1-stripe-edge)*pos(3) pos(2) stripe*pos(3) pos(4)]; + + set(cax,'Position',[pos(1) pos(2) pos(3) pos(4)]) + rect = [pos(1)+pos(3)+space pos(2) stripe*pos(3) pos(4)]; + ax = axes('Position', rect); + elseif strcmp(arg,'horiz') + cax = gca; + pos = get(cax,'Position'); + stripe = 0.075; + space = .1; + set(cax,'Position',... + [pos(1) pos(2)+(stripe+space)*pos(4) pos(3) (1-stripe-space)*pos(4)]) + rect = [pos(1) pos(2) pos(3) stripe*pos(4)]; + ax = axes('Position', rect); + end +else + pos = get(ax,'Position'); + if pos(3) > pos(4) + arg = 'horiz'; + else + arg = 'vert'; + end +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Draw colorbar using image() +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if exist('DEFAULT_COLORMAP', 'var') + map = colormap(DEFAULT_COLORMAP); +else + map = colormap; +end +n = size(map,1); + +if length(colors) == 1 + if strcmp(arg,'vert') + if strcmpi(posscale, 'on') + image([0 1],[0 t(2)],[ceil(n/2):n-colors]'); + else + image([0 1],t,[1:n-colors]'); + end; + set(ax,'xticklabelmode','manual') + set(ax,'xticklabel',[],'YAxisLocation','right') + + else + image(t,[0 1],[1:n-colors]); + set(ax,'yticklabelmode','manual') + set(ax,'yticklabel',[],'YAxisLocation','right') + end + set(ax,'Ydir','normal','YAxisLocation','right') + +else % length > 1 + + if max(colors) > n + error('Color vector excedes size of colormap') + end + if strcmp(arg,'vert') + image([0 1],t,[colors]'); + set(ax,'xticklabelmode','manual') + set(ax,'xticklabel',[]) + else + image([0 1],t,[colors]); + set(ax,'yticklabelmode','manual') + set(ax,'yticklabel',[],'YAxisLocation','right') + end + set(ax,'Ydir','normal','YAxisLocation','right') +end + +%%%%%%%%%%%%%%%%%%%%%%%%% +% Adjust cbar ticklabels +%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin > 2 + if strcmp(arg,'vert') + Cax = get(ax,'Ylim'); + else + Cax = get(ax,'Xlim'); + end; + CBTicks = [Cax(1):(Cax(2)-Cax(1))/(grad-1):Cax(2)]; % caxis tick positions + CBLabels = [minmax(1):(minmax(2)-minmax(1))/(grad-1):minmax(2)]; % tick labels + + dec = floor(log10(max(abs(minmax)))); % decade of largest abs value + CBLabels = ([minmax]* [ linspace(1,0, grad);linspace(0, 1, grad)]); + %[1.0 .75 .50 .25 0.0; 0.0 .25 .50 .75 1.0]); + if dec<1 + CBLabels = round(CBLabels*10^(1-dec))*10^(dec-1); + elseif dec == 1 + CBLabels = round(CBLabels*10^(2-dec))*10^(dec-2); + else + CBLabels = round(CBLabels); + end +% minmax +% CBTicks +% CBLabels + + if strcmp(arg,'vert') + set(ax,'Ytick',CBTicks); + set(ax,'Yticklabel',CBLabels); + else + set(ax,'Xtick',CBTicks); + set(ax,'Xticklabel',CBLabels); + end +end +handle = ax; + +%%%%%%%%%%%%%%%%%% +% Adjust cbar tag +%%%%%%%%%%%%%%%%%% + +set(ax,'tag','cbar'); + +if exist('DEFAULT_COLORMAP', 'var') + colormap(DEFAULT_COLORMAP); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/celltomat.m b/code/eeglab13_4_4b/functions/sigprocfunc/celltomat.m new file mode 100644 index 0000000..556f04e --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/celltomat.m @@ -0,0 +1,39 @@ +% celltomat() - convert cell array to matrix +% +% Usage: >> M = celltomat( C ); +% +% Author: Arnaud Delorme, CNL / Salk Institute, Jan 25 2002 +% +% Note: This function overloads the neuralnet toolbox function CELLTOMAT, +% but does not have all its capacities. Delete this version if you have +% the toolbox. + +% Copyright (C) Jan 25 2002 Arnaud Delorme, CNL / Salk Institute +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function M = celltomat( C, varargin ); + +if nargin < 1 + help celltomat; + return; +end; + +M = zeros(size(C)); +for i=1:size(C,1) + for j=1:size(C,2) + M(i,j) = C{i,j}; + end; +end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/chancenter.m b/code/eeglab13_4_4b/functions/sigprocfunc/chancenter.m new file mode 100644 index 0000000..f47d7d9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/chancenter.m @@ -0,0 +1,110 @@ +% chancenter() - recenter cartesian X,Y,Z channel coordinates +% +% Usage: >> [x y z newcenter] = chancenter(x,y,z,center); +% +% Optional inputs: +% x,y,z = 3D coordintates of the channels +% center = [X Y Z] known center different from [0 0 0] +% [] will optimize the center location according +% to the best sphere. Default is [0 0 0]. +% +% Note: 4th input gui is obsolete. Use pop_chancenter instead. +% +% Authors: Arnaud Delorme, Luca Finelli & Scott Makeig SCCN/INC/UCSD, +% La Jolla, 11/1999-03/2002 +% +% See also: spherror(), cart2topo() + +% Copyright (C) 11/1999 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-16-00 improved help message -sm +% 1-25-02 put spherror subfunction inside chancenter -ad +% 1-25-02 help pops-up if no arguments -ad +% 01-25-02 reformated help & license -ad +% 02-13-02 now center fitting works, need spherror outside chancenter -lf +% 02-14-02 radii are squeezed of squeeze in to fit topoplot circle -lf +% 03-31-02 center fitting is optional +% 04-01-02 automatic squeeze calculation -ad & sm + +function [ x, y, z, newcenter, optim] = chancenter( x, y, z, center, gui) + +optim = 0; + +if nargin<4 + help chancenter + return; +end; + +if nargin > 4 & gui + error('Chancenter: 4th input'' gui'' is obsolete. Use pop_chancenter instead'); +else + if isempty(center) + optim = 1; + center = [0 0 0]; + end; +end; + +options = {'MaxFunEvals',1000*length(center)}; +x = x - center(1); % center the data +y = y - center(2); +z = z - center(3); +radius = (sqrt(x.^2+y.^2+z.^2)); % assume xyz values are on a sphere +if ~isempty(radius) + wobble = std(radius); % test if xyz values are on a sphere +else wobble = []; +end; +fprintf('Radius values: %g (mean) +/- %g (std)\n',mean(radius),wobble); +newcenter = center; + +if wobble/mean(radius) > 0.01 & optim==1 + % Find center + % ---------------------------------------------- + fprintf('Optimizing center position...\n'); + kk=0; + while wobble/mean(radius) > 0.01 & kk<5 + try + newcenter = fminsearch('spherror',center,options,x,y,z); + catch + newcenter = fminsearch('spherror',center,[], [], x,y,z); + end; + nx = x - newcenter(1); % re-center the data + ny = y - newcenter(2); + nz = z - newcenter(3); + nradius = (sqrt(nx.^2+ny.^2+nz.^2)); % assume xyz values are on a sphere + newobble = std(nradius); + if newobble> newpoint(s) = changeunits(point(s),curaxhandle,newaxhandle) +% +% Inputs: +% point(s) - two-column vector of current [x y] data point locations +% curaxhandle - the point's current axes +% newaxhandle - the new axes handle. If figure handle or absent, returns +% the coordinates of the points in the whole figure +% +% Output: +% newpoint(s) - the coordinates of the same point(s) in the new axes +% +% Example: +% >> figure +% >> small1 = sbplot(4,4,10); % small axes in lower left +% >> plot(0.3,0.4,'ro'); % mark point [0.3 0.4] in small1 axes +% >> axis([0 1 0 1]); % set axes limits +% +% >> small2 = sbplot(4,4,7); % small axes in upper right +% >> plot(0.6,0.7,'ro'); % mark point [0.6 0.7] in small2 axes +% >> axis([0 1 0 1]); % set axes limits +% +% >> large = sbplot(1,1,1); % normal whole figure axes +% >> % Now draw line from point [0.3 0.4] in small1 axes +% >> % to point [0.6 0.7] in small2 axes +% >> from = changeunits([0.3 0.4],small1,large); % point in small1 axes +% >> to = changeunits([0.6 0.7],small2,large); % point in small2 axes +% >> plot([from(1) to(1)],[from(2) to(2)]) +% >> axis([0 1 0 1]); % set large axes limits +% >> axis off % finally, hide large axes +% +% Author: Colin Humphries, Salk Institute, La Jolla CA, Jan. 1998 + +% Copyright (C) 1998 Colin Humphries, Salk Institute, La Jolla CA, Jan. 1998 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 02-01-01 added default 3rd arg, multiple points, example -Scott Makeig +% 01-25-02 reformated help & license -ad + +function [newpnts] = changeunits(pnts,ax1,ax2) + +curax = gca; +curfig = gcf; + +if nargin<2 + help changeunits + error('Must have at least 2 arguments'); +end +if size(pnts,2) ~= 2 + help changeunits + error('Points must be 2-column'); +end + +if ~strcmp(get(ax1,'type'),'axes') + error('Second argument must be an axes handle') +end + +if nargin<3 + figh = get(ax1,'Parent'); + figure(figh); + ax2 = axes('Units','Normal','Position',[0 0 1 1],'Visible','Off'); + % whole figure axes in ax1 figure +end + + +if strcmp(get(ax2,'type'),'axes') + + figh = get(ax1,'Parent'); + if figh ~= get(ax2,'Parent') + error('Axes must be in the same figure.') + end + + units1 = get(ax1,'Units'); + units2 = get(ax2,'Units'); + set(ax1,'Units','normalized') + set(ax2,'Units','normalized') + + axpos1 = get(ax1,'Position'); + axpos2 = get(ax2,'Position'); + xlim1 = get(ax1,'Xlim'); + xlim2 = get(ax2,'Xlim'); + ylim1 = get(ax1,'Ylim'); + ylim2 = get(ax2,'Ylim'); + + l1 = [xlim1(1) ylim1(1)]; + l2 = [xlim1(2) ylim1(2)]; + p1 = axpos1([1,2]); + p2 = axpos1([3,4]); + + ll1 = [xlim2(1) ylim2(1)]; + ll2 = [xlim2(2) ylim2(2)]; + pp1 = axpos2([1,2]); + pp2 = axpos2([3,4]); + + newpnts = zeros(size(pnts)); + for p = 1:size(pnts,1) + figpnt = (((pnts(p,:)-l1)./(l2-l1)).*p2) + p1; + newpnts(p,:) = (((figpnt-pp1)./pp2).*(ll2-ll1)) + ll1; + end + + set(ax1,'Units',units1) + set(ax2,'Units',units2) + +elseif strcmp(get(ax2,'type'),'figure') + + axpos1 = get(ax1,'Position'); + xlim1 = get(ax1,'Xlim'); % value limits in ax1 + ylim1 = get(ax1,'Ylim'); + + l1 = [xlim1(1) ylim1(1)]; + l2 = [xlim1(2) ylim1(2)]; + p1 = axpos1([1,2]); + p2 = axpos1([3,4]); + + newpnts = zeros(size(pnts)); + for p = 1:size(pnts,1) % unnecessary loop? + newpnts(p,:) = (((pnts(p,:)-l1)./(l2-l1)).*p2) + p1; + end + +end + +if nargin<3 + delete(ax2) +end + +figure(curfig); % restore gcf +axes(curax); % restore gca diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/compvar.m b/code/eeglab13_4_4b/functions/sigprocfunc/compvar.m new file mode 100644 index 0000000..30ad8e3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/compvar.m @@ -0,0 +1,69 @@ +% compvar() - project selected components and compute the variance of +% the original data they account for. +% +% Usage: +% >> [proj, variance] = compvar( data, wts_or_act, winv, components); +% +% Required Inputs: +% data - 2-D (channels, points) or 3-D (channels, frames, trials) +% data array. +% wts_or_act - {sphere weights} cell array containing the ICA sphere +% and weights matrices. May also be a 2-D (channels, points) +% or 3-D (channels, frames, trials) array of component +% activations. +% winv - inverse or pseudo-inverse of the product of the weights +% and sphere matrices returned by the ICA decompnumsition, +% i.e., inv(weights*sphere) or pinv(weights*sphere). +% components - array of component indices to back-project +% +% Outputs: +% proj - summed back-projections of the specified components +% pvaf - percent variance of the data that the selected +% components account for (range: 100% to -Inf%). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ compproj, varegg ] = compvar( data, act, winv, compnums); + +if nargin < 4 + help compvar; + return; +end; + +if iscell(act) && length(act) == 1 + act = act{1}; +end; + +data = reshape(data, size(data,1), size(data,2)*size(data,3)); +act = reshape(act , size(act ,1), size(act ,2)*size( act,3)); +squaredata = sum(sum(data.^2)); % compute the grand sum-squared data + +if iscell(act) + sphere = act{1}; + weight = act{2}; + act = (weight(compnums,:)*sphere)*data; +end; + +compproj = winv(:,compnums)*act(compnums,:)-data; % difference between data and back-projection +squarecomp = sum(sum(compproj.^2)); % the summed-square difference +varegg = 100*(1- squarecomp/squaredata); % compute pvaf of components in data +compproj = compproj+data; % restore back-projected data + +return; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/condstat.m b/code/eeglab13_4_4b/functions/sigprocfunc/condstat.m new file mode 100644 index 0000000..bde8026 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/condstat.m @@ -0,0 +1,279 @@ +% condstat() - accumulate surrogate data for comparing two data conditions +% +% Usage: +% >> [diffres, accres, res1, res2] = condstat(formula, naccu, alpha, ... +% bootside, condboot, arg1, arg2 ...); +% +% Inputs: +% formula - [string or cell array of strings] formula(s) to compute a given measure. +% Takes arguments 'arg1', 'arg2' ... and X as inputs. e.g., +% 'sum(arg1(:,:,X),3) ./ sqrt(sum(arg2(:,:,X))) ./ sqrt(sum(arg3(:,:,X)))' +% naccu - [integer] number of accumulations of surrogate data. e.g., 200 +% alpha - [float] significance level (0> newchans = convertlocs( EEG, 'command'); +% +% Input: +% chanlocs - An EEGLAB EEG dataset OR a EEG.chanlocs channel locations structure +% 'command' - ['cart2topo'|'sph2topo'|'sphbesa2topo'| 'sph2cart'|'topo2cart'|'sphbesa2cart'| +% 'cart2sph'|'sphbesa2sph'|'topo2sph'| 'cart2sphbesa'|'sph2sphbesa'|'topo2sphbesa'| +% 'cart2all'|'sph2all'|'sphbesa2all'|'topo2all'] +% These command modes convert between four coordinate frames: 3-D Cartesian +% (cart), Matlab spherical (sph), Besa spherical (sphbesa), and 2-D polar (topo) +% 'auto' -- Here, the function finds the most complex coordinate frame +% and constrains all the others to this one. It searches first for Cartesian +% coordinates, then for spherical and finally for polar. Default is 'auto'. +% +% Optional input +% 'verbose' - ['on'|'off'] default is 'off'. +% +% Outputs: +% newchans - new EEGLAB channel locations structure +% +% Ex: CHANSTRUCT = convertlocs( CHANSTRUCT, 'cart2topo'); +% % Convert Cartesian coordinates to 2-D polar (topographic). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 22 Dec 2002 +% +% See also: readlocs() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 22 Dec 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function chans = convertlocs(chans, command, varargin); + +if nargin < 1 + help convertlocs; + return; +end; + +if nargin < 2 + command = 'auto'; +end; +if nargin == 4 && strcmpi(varargin{2}, 'on') + verbose = 1; +else + verbose = 0; % off +end; + +% test if value exists for default +% -------------------------------- +if strcmp(command, 'auto') + if isfield(chans, 'X') && ~isempty(chans(1).X) + command = 'cart2all'; + if verbose + disp('Make all coordinate frames uniform using Cartesian coords'); + end; + else + if isfield(chans, 'sph_theta') && ~isempty(chans(1).sph_theta) + command = 'sph2all'; + if verbose + disp('Make all coordinate frames uniform using spherical coords'); + end; + else + if isfield(chans, 'sph_theta_besa') && ~isempty(chans(1).sph_theta_besa) + command = 'sphbesa2all'; + if verbose + disp('Make all coordinate frames uniform using BESA spherical coords'); + end; + else + command = 'topo2all'; + if verbose + disp('Make all coordinate frames uniform using polar coords'); + end; + end; + end; + end; +end; + +% convert +% ------- +switch command + case 'topo2sph', + theta = {chans.theta}; + radius = {chans.radius}; + indices = find(~cellfun('isempty', theta)); + [sph_phi sph_theta] = topo2sph( [ [ theta{indices} ]' [ radius{indices}]' ] ); + if verbose + disp('Warning: electrodes forced to lie on a sphere for polar to 3-D conversion'); + end; + for index = 1:length(indices) + chans(indices(index)).sph_theta = sph_theta(index); + chans(indices(index)).sph_phi = sph_phi (index); + end; + if isfield(chans, 'sph_radius'), + meanrad = mean([ chans(indices).sph_radius ]); + if isempty(meanrad), meanrad = 1; end; + else + meanrad = 1; + end; + sph_radius(1:length(indices)) = {meanrad}; +case 'topo2sphbesa', + chans = convertlocs(chans, 'topo2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords +case 'topo2cart' + chans = convertlocs(chans, 'topo2sph', varargin{:}); % search for spherical coords + if verbose + disp('Warning: spherical coordinates automatically updated'); + end; + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'topo2all', + chans = convertlocs(chans, 'topo2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'sph2cart', + sph_theta = {chans.sph_theta}; + sph_phi = {chans.sph_phi}; + indices = find(~cellfun('isempty', sph_theta)); + if ~isfield(chans, 'sph_radius'), sph_radius(1:length(indices)) = {1}; + else sph_radius = {chans.sph_radius}; + end; + inde = find(cellfun('isempty', sph_radius)); + if ~isempty(inde) + meanrad = mean( [ sph_radius{:} ]); + sph_radius(inde) = { meanrad }; + end; + [x y z] = sph2cart([ sph_theta{indices} ]'/180*pi, [ sph_phi{indices} ]'/180*pi, [ sph_radius{indices} ]'); + for index = 1:length(indices) + chans(indices(index)).X = x(index); + chans(indices(index)).Y = y(index); + chans(indices(index)).Z = z(index); + end; +case 'sph2topo', + if verbose + % disp('Warning: all radii constrained to one for spherical to topo transformation'); + end; + sph_theta = {chans.sph_theta}; + sph_phi = {chans.sph_phi}; + indices = find(~cellfun('isempty', sph_theta)); + [chan_num,angle,radius] = sph2topo([ ones(length(indices),1) [ sph_phi{indices} ]' [ sph_theta{indices} ]' ], 1, 2); % using method 2 + for index = 1:length(indices) + chans(indices(index)).theta = angle(index); + chans(indices(index)).radius = radius(index); + if ~isfield(chans, 'sph_radius') || isempty(chans(indices(index)).sph_radius) + chans(indices(index)).sph_radius = 1; + end; + end; +case 'sph2sphbesa', + % using polar coordinates + sph_theta = {chans.sph_theta}; + sph_phi = {chans.sph_phi}; + indices = find(~cellfun('isempty', sph_theta)); + [chan_num,angle,radius] = sph2topo([ones(length(indices),1) [ sph_phi{indices} ]' [ sph_theta{indices} ]' ], 1, 2); + [sph_theta_besa sph_phi_besa] = topo2sph([angle radius], 1, 1); + for index = 1:length(indices) + chans(indices(index)).sph_theta_besa = sph_theta_besa(index); + chans(indices(index)).sph_phi_besa = sph_phi_besa(index); + end; +case 'sph2all', + chans = convertlocs(chans, 'sph2topo', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'sphbesa2sph', + % using polar coordinates + sph_theta_besa = {chans.sph_theta_besa}; + sph_phi_besa = {chans.sph_phi_besa}; + indices = find(~cellfun('isempty', sph_theta_besa)); + [chan_num,angle,radius] = sph2topo([ones(length(indices),1) [ sph_theta_besa{indices} ]' [ sph_phi_besa{indices} ]' ], 1, 1); + %for index = 1:length(chans) + % chans(indices(index)).theta = angle(index); + % chans(indices(index)).radius = radius(index); + % chans(indices(index)).labels = int2str(index); + %end; + %figure; topoplot([],chans, 'style', 'blank', 'electrodes', 'labelpoint'); + + [sph_phi sph_theta] = topo2sph([angle radius], 2); + for index = 1:length(indices) + chans(indices(index)).sph_theta = sph_theta(index); + chans(indices(index)).sph_phi = sph_phi (index); + end; +case 'sphbesa2topo', + chans = convertlocs(chans, 'sphbesa2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2topo', varargin{:}); % search for spherical coords +case 'sphbesa2cart', + chans = convertlocs(chans, 'sphbesa2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'sphbesa2all', + chans = convertlocs(chans, 'sphbesa2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2all', varargin{:}); % search for spherical coords +case 'cart2topo', + chans = convertlocs(chans, 'cart2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2topo', varargin{:}); % search for spherical coords +case 'cart2sphbesa', + chans = convertlocs(chans, 'cart2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords +case 'cart2sph', + if verbose + disp('WARNING: If XYZ center has not been optimized, optimize it using Edit > Channel Locations'); + end; + X = {chans.X}; + Y = {chans.Y}; + Z = {chans.Z}; + indices = find(~cellfun('isempty', X)); + [th phi radius] = cart2sph( [ X{indices} ], [ Y{indices} ], [ Z{indices} ]); + for index = 1:length(indices) + chans(indices(index)).sph_theta = th(index)/pi*180; + chans(indices(index)).sph_phi = phi(index)/pi*180; + chans(indices(index)).sph_radius = radius(index); + end; +case 'cart2all', + chans = convertlocs(chans, 'cart2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2all', varargin{:}); % search for spherical coords +end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/copyaxis.m b/code/eeglab13_4_4b/functions/sigprocfunc/copyaxis.m new file mode 100644 index 0000000..1206526 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/copyaxis.m @@ -0,0 +1,98 @@ +% copyaxis() - helper function for axcopy() +% +% Usage: >> copyaxis(); +% >> copyaxis( command ); +% +% Note: The optional command option (a string that will be evaluated +% when the figure is created allows to customize display). +% +% Author: Tzyy-Ping Jung, SCCN/INC/UCSD, La Jolla, 2000 +% +% See also: axcopy() + +% Copyright (C) 3-16-2000 Tzyy-Ping Jung, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad +% 02-16-02 added the ignore parent size option -ad +% 03-11-02 remove size option and added command option -ad + +function copyaxis(command) + +OFF_STD = 0.25; % std dev of figure offset +MIN_OFF = 0.15; % minimum offset for new figure +BORDER = 0.04; % screen edge tolerance + +fig=gcf; +sel=gca; +% +% Get position for new figure +% +set(fig,'Units','normalized'); +place=get(fig,'Position'); +axiscolor=get(fig,'Color'); +cmap=colormap; +newxy = (OFF_STD*randn(1,2))+place(1,1:2); +newx=newxy(1);newy=newxy(2); +if abs(newx-place(1,1))1-BORDER, newx=1-BORDER-place(3); end +if newy+place(4)>1-BORDER, newy=1-BORDER-place(4); end + +newfig=figure('Units','Normalized','Position',[newx,newy,place(1,3:4)]); + +% +% Copy object to new figure +% +set(newfig,'Color',axiscolor); +copyobj(sel,newfig);set(gca,'Position',[0.130 0.110 0.775 0.815]); +colormap(cmap); +% +% Increase font size +% +set(findobj('parent',newfig,'type','axes'),'FontSize',14); +set(get(gca,'XLabel'),'FontSize',16) +set(get(gca,'YLabel'),'FontSize',16) +set(get(gca,'Title'),'Fontsize',16); +% +% Add xtick and ytick labels if missing +% +if strcmp(get(gca,'Box'),'on') + set(gca,'xticklabelmode','auto') + set(gca,'xtickmode','auto') + set(gca,'yticklabelmode','auto') + set(gca,'ytickmode','auto') +end +% +% Turn on zoom in the new figure +% +zoom on; +% +% Turn off the axis copy for the new figure +% +hndl= findobj('parent',newfig,'type','axes'); +set(hndl,'ButtonDownFcn','','Selected','off'); +for a=1:length(hndl) % make all axes visible + set(findobj('parent',hndl(a)),'ButtonDownFcn','','Selected','off'); +end +% +% Execute additional command if present +% +if exist('command') == 1 + eval(command); +end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/coregister.m b/code/eeglab13_4_4b/functions/sigprocfunc/coregister.m new file mode 100644 index 0000000..207c4e0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/coregister.m @@ -0,0 +1,890 @@ +% coregister() - Co-register measured or template electrode locations with a +% a reference channel locations file. For instance if you +% want to perform dipole modeling you have to coregister +% (align) your channel electrodes with the model (and the +% easiest way to do that is to coregister your channel +% electrodes with the electrodes file associated with the +% model. To use coregister(), one may for instance use the default +% MNI head and 10-5 System locations from Robert Oostenveld, used in +% the dipfit2() dipole modeling function as a reference. +% Use coregister() to linearly align or nonlinearly warp +% subsequently recorded or nominally identified (e.g., 'Cz') sets of +% channel head locations to the reference locations. +% Both channel locations and/or fiducial (non-electrode) +% locations can then be used by coregister() to linearly align +% or nonlinearly warp a given or measured montage to the reference +% locations. In its (default) manual mode, coregister() produces +% an interactive gui showing the imported and reference channel +% locations on the imported head mesh (if any), allowing the user +% to make additional manual adjustments using gui text entry boxes, +% and to rotate the display using the mouse. +% Usage: +% >> coregister(EEG.chanlocs); % Show channel locations in the coregister() +% % gui, for align, warp, or manual mode co-registration with the +% % dipfit2() model head mesh and 10-5 System reference locations. +% % Note: May need to scale channel x,y,z positions by 100 to see +% % the imported locations in the default dipfit2() head mesh. +% +% >> [chanlocs_out transform] = coregister( chanlocs, reflocs, 'key', 'val' ) +% % Perform custom co-registration to a reference locations and +% % (optional) head mesh. If a ('warp' or 'alignfid') mode is +% % specified, no gui window is produced. +% Inputs: +% chanlocs - (EEG.chanlocs) channel locations structure (or file) to align +% For file structure, see >> headplot example +% or >> headplot cartesian +% reflocs - reference channel locations structure (or file) associated +% with the head mesh ('mesh' below) {default|[] -> 10-5 System locs} +% +% Optional 'keywords' and arguments ([ ]): +% 'mesh' - [cell array|string] head mesh. May contain {points triangles} +% or {points triangles normals} (see >> help plotmesh +% for details). May also be the name of a head mesh .mat +% file (several formats recognized). By default, loads the +% dipfit2() MNI head mesh file. Compare 'mheadnew.mat', the +% mesh used by headplot(); 'mesh',[] shows no head mesh. +% 'warpmethod' - ['rigidbody'|'globalrescale'|'traditional'|'nonlin1'| +% 'nonlin2'|'nonlin3'|'nonlin4'|'nonlin5'] +% 'traditional' calls the dipfit2.* function traditionaldipfit() +% all others are enacted by electrodenormalize() +% {default: 'traditional} +% 'transform' - [real array] homogenous transformation matrix (>>help +% electrodenormalize) or a 1x9 matrix containing traditional +% 9-parameter "Talairach model" transformation (>> help traditional) +% used to calculate locs_out. +% 'chaninfo1' - [EEG.chaninfo struct] channel information structure for the +% montage to be coregistered. May contain (no-electrode) fiducial +% locations. +% 'chaninfo2' - [EEG.chaninfo struct] channel information structure for +% the reference montage. +% 'helpmsg' - ['on'|'off'] pop-up help message when calling function. +% {default: 'off'} +% +% Optional 'keywords' for MANUAL MODE (default): +% 'manual' - ['on'|'off'] Pops up the coregister() gui window to +% allow viewing the current alignment, performing 'alignfid' or +% 'warp' mode co-registration, and making manual +% adjustments. Default if 'on'. +% +% Optional 'keywords' for ALIGN MODE: +% 'alignfid' - {cell array of strings} = labels of (fiducial) channels to use +% as common landmarks for aligning the new channel locations to +% the reference locations. These labels must be in both channel +% locations (EEG.chanlocs) and/or EEG.chaninfo structures (see +% 'chaninfo1' and 'chaninfo2' below). Will then apply a linear +% transform including translation, rotation, and/or uniform +% scaling so as to best match the two sets of landmarks. +% See 'autoscale' below. +% 'autoscale' - ['on'|'off'] autoscale electrode radius when aligning +% fiducials. {default: 'on'} +% +% Optional 'keywords' for WARP MODE: +% 'warp' - {cell array of strings} channel labels used for non-linear +% warping of the new channel locations to reference locations. +% For example: Specifying all 10-20 channel labels will +% nonlinearly warp the 10-20 channel locations in the new +% chanlocs to the 10-20 locations in the reference chanlocs. +% Locations of other channels in the new chanlocs will be +% adjusted so as to produce a smooth warp. Entering the +% string 'auto' will automatically select the common channel +% labels. +% +% Outputs: +% chanlocs_out - transformed input channel locations (chanlocs) structure +% transform - transformation matrix. Use traditionaldipfit() to convert +% this to a homogenous transformation matrix used in +% 3-D plotting functions such as headplot(). +% +% Note on how to create a template: +% (1) Extract a head mesh from a subject MRI (possibly in +% Matlab using the function isosurface). +% (2) Measure reference locations on the subject's head. +% (3) Align these locations to the extracted subject head mesh +% (using the coregister() graphic interface). The aligned locations +% then become reference locations for this mesh. +% +% Example: +% % This return the coregistration matrix to the MNI brain +% dipfitdefs; +% [newlocs transform] = coregister(EEG.chanlocs, template_models(2).chanfile, ... +% 'warp', 'auto', 'manual', 'off'); +% +% % This pops-up the coregistration window for the BEM (MNI) model +% dipfitdefs; +% [newlocs transform] = coregister(EEG.chanlocs, template_models(2).chanfile, ... +% 'mesh', template_models(2).hdmfile); +% +% See also: traditionaldipfit(), headplot(), plotmesh(), electrodenormalize(). +% +% Note: Calls Robert Oostenveld's FieldTrip coregistration functions for +% automatic coregistration. +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, 2005-06 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2005, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Here we bypass channel info +% 'chaninfo' - [struct] channel information structure for the first +% dataset (may use a cell array { struct struct } to enter +% channel location info for both channel location struct. +% + +function [ chanlocs1, transformmat ] = coregister(chanlocs1, chanlocs2, varargin) + +if nargin < 1 + help coregister + error('Not enough inputs'); +end + +if nargin < 2 + chanlocs2 = []; +end + % manually for s1: transf = [4 0 -50 -0.3 0 -1.53 1.05 1.1 1.1] + % manually for s2: transf = [-4 -6 -50 -0.37 0 -1.35 1.1 1.15 1.1] + +if isempty(chanlocs2) + dipfitdefs; chanlocs2 = template_models(1).chanfile; +end + +% undocumented commands run from GUI +% ---------------------------------- +if ischar(chanlocs1) + if ~strcmpi(chanlocs1, 'redraw') & ~strcmpi(chanlocs1, 'fiducials') & ~strcmpi(chanlocs1, 'warp') + chanlocs1 = readlocs(chanlocs1); + else + com = chanlocs1; + fid = chanlocs2; + + % update GUI + % ---------- + if strcmpi(com, 'redraw'), redrawgui(fid); return; end; + + % select electrodes and warp montage + % ---------------------------------- + dat = get(fid, 'userdata'); + if strcmpi(com, 'fiducials') + [clist1 clist2] = pop_chancoresp( dat.elec1, dat.elec2, 'autoselect', 'fiducials'); + try, + [ tmp transform ] = align_fiducials(dat.elec1, dat.elec2, dat.elec1.label(clist1), dat.elec2.label(clist2)); + if ~isempty(transform), dat.transform = transform; end; + catch, + warndlg2(strvcat('Transformation failed', lasterr)); + end; + elseif strcmpi(com, 'warp') + [clist1 clist2] = pop_chancoresp( dat.elec1, dat.elec2, 'autoselect', 'all'); + + % copy electrode names + if ~isempty(clist1) + tmpelec2 = dat.elec2; + for index = 1:length(clist2) + tmpelec2.label{clist2(index)} = dat.elec1.label{clist1(index)}; + end; + %try, + [ tmp dat.transform ] = warp_chans(dat.elec1, tmpelec2, tmpelec2.label(clist2), 'traditional'); + %catch, + % warndlg2(strvcat('Transformation failed', lasterr)); + %end; + end; + end; + set(fid, 'userdata', dat); + redrawgui(fid); + return; + end; +end; + +% check input arguments +% --------------------- +% defaultmesh = 'D:\matlab\eeglab\plugins\dipfit2.0\standard_BEM\standard_vol.mat'; +defaultmesh = 'standard_vol.mat'; +g = finputcheck(varargin, { 'alignfid' 'cell' {} {}; + 'warp' { 'string','cell' } { {} {} } {}; + 'warpmethod' 'string' {'rigidbody', 'globalrescale', 'traditional', 'nonlin1', 'nonlin2', 'nonlin3', 'nonlin4', 'nonlin5'} 'traditional'; + 'chaninfo1' 'struct' {} struct('no', {}); % default empty structure + 'chaninfo2' 'struct' {} struct('no', {}); + 'transform' 'real' [] []; + 'manual' 'string' { 'on','off' } 'on'; % -> pop up window + 'autoscale' 'string' { 'on','off' } 'on'; + 'helpmsg' 'string' { 'on','off' } 'off'; + 'mesh' '' [] defaultmesh }); +if ischar(g), error(g); end; + +% load mesh if any +% ---------------- +if ~isempty(g.mesh) + if ischar(g.mesh) + try + g.mesh = load(g.mesh); + catch, g.mesh = []; + end; + end; + if ischar(g.mesh) + if ~exist(g.mesh,'file') + fprintf('coregister(): mesh file not found\n'); + end + end + if ~isempty(g.mesh) + if isstruct(g.mesh) + if isfield(g.mesh, 'vol') + if isfield(g.mesh.vol, 'r') + [X Y Z] = sphere(50); + dat.meshpnt = { X*max(g.mesh.vol.r) Y*max(g.mesh.vol.r) Z*max(g.mesh.vol.r) }; + dat.meshtri = []; + else + dat.meshpnt = g.mesh.vol.bnd(1).pnt; + dat.meshtri = g.mesh.vol.bnd(1).tri; + end; + elseif isfield(g.mesh, 'bnd') + dat.meshpnt = g.mesh.bnd(1).pnt; + dat.meshtri = g.mesh.bnd(1).tri; + elseif isfield(g.mesh, 'TRI1') + dat.meshpnt = g.mesh.POS; + dat.meshtri = g.mesh.TRI1; + elseif isfield(g.mesh, 'vertices') + dat.meshpnt = g.mesh.vertices; + dat.meshtri = g.mesh.faces; + else + error('Unknown Matlab mesh file'); + end; + else + dat.meshpnt = g.mesh{1}; + dat.meshtri = g.mesh{2}; + end; + else + dat.meshpnt = []; + dat.meshtri = []; + end; +else + dat.meshpnt = []; + dat.meshtri = []; +end; + +% transform to arrays chanlocs1 +% ------------------------- +TMP = eeg_emptyset; +[TMP.chanlocs tmp2 tmp3 ind1] = readlocs(chanlocs1); +TMP.chaninfo = g.chaninfo1; +TMP.nbchan = length(TMP.chanlocs); +cfg = eeglab2fieldtrip(TMP, 'chanloc_withfid'); +elec1 = cfg.elec; + +% transform to arrays chanlocs2 +% ------------------------- +if ~isempty(chanlocs2) + TMP = eeg_emptyset; + [TMP.chanlocs tmp2 tmp3 ind1] = readlocs(chanlocs2); + TMP.chaninfo = g.chaninfo2; + TMP.nbchan = length(TMP.chanlocs); + cfg = eeglab2fieldtrip(TMP, 'chanloc_withfid'); + elec2 = cfg.elec; +else + elec2 = []; + dat.transform = [ 0 0 0 0 0 0 1 1 1 ]; +end; + +% copy or compute alignment matrix +% -------------------------------- +if ~isempty(g.transform) + dat.transform = g.transform; +else + + % perfrom alignment + % ----------------- + if strcmpi(g.autoscale, 'on') + avgrad1 = sqrt(sum(elec1.pnt.^2,2)); + avgrad2 = sqrt(sum(elec2.pnt.^2,2)); + ratio = mean(avgrad2)/mean(avgrad1); + else + ratio = 1; + end; + if ~isempty(g.alignfid) + + % autoscale + % --------- + [ electransf transform ] = align_fiducials(electmp, elec2, g.alignfid); + if ~isempty(transform), dat.transform = [ transform(1:6)' ratio ratio ratio ]; end; + + elseif ~isempty(g.warp) + if ischar(g.warp) + [clist1 clist2] = pop_chancoresp( elec1, elec2, 'autoselect', 'all', 'gui', 'off'); + % copy electrode names + if isempty(clist1) + disp('Warning: cannot wrap electrodes (no common channel labels)'); + else + tmpelec2 = elec2; + for index = 1:length(clist2) + tmpelec2.label{clist2(index)} = elec1.label{clist1(index)}; + end; + try, + [ electransf dat.transform ] = warp_chans(elec1, tmpelec2, tmpelec2.label(clist2), 'traditional'); + catch, + warndlg2(strvcat('Transformation failed', lasterr)); + end; + end; + else + [ electransf dat.transform ] = warp_chans(elec1, elec2, g.warp, g.warpmethod); + end; + else + dat.transform = [0 0 0 0 0 0 ratio ratio ratio]; + end; + +end; + +% manual mode off +% --------------- +if strcmpi(g.manual, 'off'), + transformmat = dat.transform; + dat.elec1 = elec1; + if size(dat.transform,1) > 1 + dat.electransf.pnt = dat.transform*[ dat.elec1.pnt ones(size(dat.elec1.pnt,1),1) ]'; + else + dat.electransf.pnt = traditionaldipfit(dat.transform)*[ dat.elec1.pnt ones(size(dat.elec1.pnt,1),1) ]'; + end; + dat.electransf.pnt = dat.electransf.pnt(1:3,:)'; + dat.electransf.label = dat.elec1.label; + chanlocs1 = dat.electransf; + return; +end; + +% find common electrode names +% --------------------------- +dat.elec1 = elec1; +dat.elec2 = elec2; +dat.elecshow1 = 1:length(elec1.label); +dat.elecshow2 = 1:length(elec2.label); +dat.color1 = [0 1 0]; +dat.color2 = [1 .75 .65]*.8; +%dat.color2 = [1 0 0]; +dat.label1 = 0; +dat.label2 = 0; +dat.meshon = 1; +fid = figure('userdata', dat, 'name', 'coregister()', 'numbertitle', 'off'); +try, icadefs; catch, end; + +if 1 + header = 'dattmp = get(gcbf, ''userdata'');'; + footer = 'set(gcbf, ''userdata'', dattmp); clear dattmp; coregister(''redraw'', gcbf);'; + cbright = [ header 'dattmp.transform(1) = str2num(get(gcbo, ''string''));' footer ]; + cbforward = [ header 'dattmp.transform(2) = str2num(get(gcbo, ''string''));' footer ]; + cbup = [ header 'dattmp.transform(3) = str2num(get(gcbo, ''string''));' footer ]; + cbpitch = [ header 'dattmp.transform(4) = str2num(get(gcbo, ''string''));' footer ]; + cbroll = [ header 'dattmp.transform(5) = str2num(get(gcbo, ''string''));' footer ]; + cbyaw = [ header 'dattmp.transform(6) = str2num(get(gcbo, ''string''));' footer ]; + cbresizex = [ header 'dattmp.transform(7) = str2num(get(gcbo, ''string''));' footer ]; + cbresizey = [ header 'dattmp.transform(8) = str2num(get(gcbo, ''string''));' footer ]; + cbresizez = [ header 'dattmp.transform(9) = str2num(get(gcbo, ''string''));' footer ]; + cb_ok = 'set(gcbo, ''userdata'', ''ok'')'; + cb_warp = 'coregister(''warp'', gcbf);'; + cb_fid = 'coregister(''fiducials'', gcbf);'; + + opt = { 'unit', 'normalized', 'position' }; + h = uicontrol( opt{:}, [0 .15 1 .02], 'style', 'text', 'string', ''); + h = uicontrol( opt{:}, [0 .1 .2 .05], 'style', 'text', 'string', 'Move right {mm}'); + h = uicontrol( opt{:}, [0 .05 .2 .05], 'style', 'text', 'string', 'Move front {mm}' ); + h = uicontrol( opt{:}, [0 0 .2 .05], 'style', 'text', 'string', 'Move up {mm}'); + h = uicontrol( opt{:}, [0.2 .1 .1 .05], 'tag', 'right' , 'callback', cbright , 'style', 'edit', 'string', ''); + h = uicontrol( opt{:}, [0.2 .05 .1 .05], 'tag', 'forward', 'callback', cbforward, 'style', 'edit', 'string', '' ); + h = uicontrol( opt{:}, [0.2 0 .1 .05], 'tag', 'up' , 'callback', cbup , 'style', 'edit', 'string', ''); + h = uicontrol( opt{:}, [0.3 .1 .15 .05], 'style', 'text', 'string', 'Pitch (rad)'); + h = uicontrol( opt{:}, [0.3 .05 .15 .05], 'style', 'text', 'string', 'Roll (rad)' ); + h = uicontrol( opt{:}, [0.3 0 .15 .05], 'style', 'text', 'string', 'Yaw (rad)'); + h = uicontrol( opt{:}, [0.45 .1 .1 .05], 'tag', 'pitch', 'callback', cbpitch, 'style', 'edit', 'string', ''); + h = uicontrol( opt{:}, [0.45 .05 .1 .05], 'tag', 'roll' , 'callback', cbroll , 'style', 'edit', 'string', '' ); + h = uicontrol( opt{:}, [0.45 0 .1 .05], 'tag', 'yaw' , 'callback', cbyaw , 'style', 'edit', 'string', ''); + h = uicontrol( opt{:}, [0.55 .1 .15 .05], 'style', 'text', 'string', 'Resize {x}'); + h = uicontrol( opt{:}, [0.55 .05 .15 .05], 'style', 'text', 'string', 'Resize {y}' ); + h = uicontrol( opt{:}, [0.55 0 .15 .05], 'style', 'text', 'string', 'Resize {z}'); + h = uicontrol( opt{:}, [0.7 .1 .1 .05], 'tag', 'resizex', 'callback', cbresizex, 'style', 'edit', 'string', ''); + h = uicontrol( opt{:}, [0.7 .05 .1 .05], 'tag', 'resizey', 'callback', cbresizey, 'style', 'edit', 'string', '' ); + h = uicontrol( opt{:}, [0.7 0 .1 .05], 'tag', 'resizez', 'callback', cbresizez, 'style', 'edit', 'string', ''); + h = uicontrol( opt{:}, [0.8 .1 .2 .05], 'style', 'pushbutton', 'string', 'Align fiducials', 'callback', cb_fid); + h = uicontrol( opt{:}, [0.8 .05 .2 .05], 'style', 'pushbutton', 'string', 'Warp montage', 'callback', cb_warp ); + h = uicontrol( opt{:}, [0.8 0 .1 .05], 'style', 'pushbutton', 'string', 'Cancel', 'callback', 'close(gcbf);' ); + h = uicontrol( opt{:}, [0.9 0 .1 .05], 'style', 'pushbutton', 'string', 'Ok', 'tag', 'ok', 'callback', cb_ok); + + % put labels next to electrodes + % ----------------------------- + cb_label1 = [ 'tmp = get(gcbf, ''userdata'');' ... + 'if tmp.label1, set(gcbo, ''string'', ''Labels on'');' ... + 'else set(gcbo, ''string'', ''Labels off'');' ... + 'end;' ... + 'tmp.label1 = ~tmp.label1;' ... + 'set(gcbf, ''userdata'', tmp);' ... + 'clear tmp;' ... + 'coregister(''redraw'', gcbf);' ]; + cb_label2 = [ 'tmp = get(gcbf, ''userdata'');' ... + 'if tmp.label2, set(gcbo, ''string'', ''Labels on'');' ... + 'else set(gcbo, ''string'', ''Labels off'');' ... + 'end;' ... + 'tmp.label2 = ~tmp.label2;' ... + 'set(gcbf, ''userdata'', tmp);' ... + 'clear tmp;' ... + 'coregister(''redraw'', gcbf);' ]; + cb_mesh = [ 'tmp = get(gcbf, ''userdata'');' ... + 'if tmp.meshon, set(gcbo, ''string'', ''Mesh on'');' ... + 'else set(gcbo, ''string'', ''Mesh off'');' ... + 'end;' ... + 'tmp.meshon = ~tmp.meshon;' ... + 'set(gcbf, ''userdata'', tmp);' ... + 'clear tmp;' ... + 'coregister(''redraw'', gcbf);' ]; + cb_elecshow1 = [ 'tmp = get(gcbf, ''userdata'');' ... + 'tmp.elecshow1 = pop_chansel( tmp.elec1.label, ''select'', tmp.elecshow1 );' ... + 'if ~isempty(tmp.elecshow1), set(gcbf, ''userdata'', tmp);' ... + 'coregister(''redraw'', gcbf); end; clear tmp;' ]; + cb_elecshow2 = [ 'tmp = get(gcbf, ''userdata'');' ... + 'tmpstrs = { ''21 elec (10/20 system)'' ''86 elec (10/10 system)'' ''all elec (10/5 system)'' };' ... + 'tmpres = inputgui( ''uilist'', {{ ''style'' ''text'' ''string'' ''show only'' } ' ... + ' { ''style'' ''listbox'' ''string'' strvcat(tmpstrs) }}, ' ... + ' ''geometry'', { 1 1 }, ''geomvert'', [1 3] );' ... + 'if ~isempty(tmpres), tmp.elecshow2 = tmpstrs{tmpres{1}}; end;' ... + 'set(gcbf, ''userdata'', tmp);' ... + 'clear tmp tmpres;' ... + 'coregister(''redraw'', gcbf);' ]; + h = uicontrol( opt{:}, [0 0.75 .13 .05], 'style', 'pushbutton', 'string', 'Mesh off', 'callback', cb_mesh ); + + % help message + % ------------ + + cb_helpme = [ 'warndlg2(strvcat( ''User channels (sometimes hidden in the 3-D mesh) are in green, reference channels in brown.'',' ... + '''Press "Warp" to automatically warp user channels to corresponding reference channels.'',' ... + '''Then, if desired, further edit the transformation manually using the coregister gui buttons.'',' ... + ''' '',' ... + '''To use locations of corresponding reference channels (and discard current locations),'',' ... + '''select "Edit > Channel locations" in the EEGLAB mensu and press, "Look up loc." Select a '',' ... + '''head model. Then re-open "Tools > Locate dipoles using DIPFIT2 > Head model and settings"'',' ... + '''in the EEGLAB menu and select the "No coreg" option.'',' ]; + if ~isstruct(chanlocs2) + if ~isempty(findstr(lower(chanlocs2), 'standard-10-5-cap385')) | ... + ~isempty(findstr(lower(chanlocs2), 'standard_1005')), + cb_helpme = [ cb_helpme '''Then re-open "Tools > Locate dipoles using DIPFIT2 > Head model and settings"'',' ... + '''in the EEGLAB menu and select the "No coreg" option.''), ''Warning'');' ]; + else + cb_helpme = [ cb_helpme '''Then re-open the graphic interface function you were using.''), ''Warning'');' ]; + end; + end; + h = uicontrol( opt{:}, [0.87 0.95 .13 .05], 'style', 'pushbutton', 'string', 'Help me', 'callback', cb_helpme); + h = uicontrol( opt{:}, [0.87 0.90 .13 .05], 'style', 'pushbutton', 'string', 'Funct. help', 'callback', 'pophelp(''coregister'');' ); + + % change colors + % ------------- + hh = findobj('parent', gcf, 'style', 'text'); + set(hh, 'Backgroundcolor', GUIBACKCOLOR); + set(hh, 'foregroundcolor', GUITEXTCOLOR); + hh = findobj('parent', gcf, 'style', 'edit'); + set(hh, 'Backgroundcolor', GUIBACKCOLOR); + set(hh, 'foregroundcolor', GUITEXTCOLOR); + hh = findobj('parent', gcf, 'style', 'pushbutton'); + set(hh, 'Backgroundcolor', GUIBACKCOLOR); + set(hh, 'foregroundcolor', GUITEXTCOLOR); + + h = uicontrol( opt{:}, [0 0.95 .13 .05], 'style', 'pushbutton', 'backgroundcolor', dat.color1, 'string', 'Labels on', 'callback', cb_label1 ); + h = uicontrol( opt{:}, [0 0.9 .13 .05], 'style', 'pushbutton', 'backgroundcolor', dat.color1, 'string', 'Electrodes', 'callback', cb_elecshow1 ); + + h = uicontrol( opt{:}, [0 0.85 .13 .05], 'style', 'pushbutton', 'backgroundcolor', dat.color2, 'string', 'Labels on', 'callback', cb_label2 ); + h = uicontrol( opt{:}, [0 0.8 .13 .05], 'style', 'pushbutton', 'backgroundcolor', dat.color2, 'string', 'Electrodes', 'callback', cb_elecshow2 ); + +end; + +coregister('redraw', fid); +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end + +% wait until button press and return values +% ----------------------------------------- +waitfor( findobj('parent', fid, 'tag', 'ok'), 'userdata'); +try, findobj(fid); % figure still exist ? +catch, transformmat = []; chanlocs1 = []; return; end; +dat = get(fid, 'userdata'); +transformmat = dat.transform; +chanlocs1 = dat.electransf; +close(fid); + +% plot electrodes +% --------------- +function plotelec(elec, elecshow, color, tag); + + X1 = elec.pnt(elecshow,1); + Y1 = elec.pnt(elecshow,2); + Z1 = elec.pnt(elecshow,3); + + XL = xlim; + YL = ylim; + ZL = zlim; + + lim=max(1.05*max([X1;Y1;Z1]), max([XL YL ZL])); + eps=lim/20; + delete(findobj(gcf, 'tag', tag)); + + % make bigger if fiducial + % ------------------------ + fidlist = { 'nz' 'lpa' 'rpa' 'nazion' 'left' 'right' 'nasion' 'fidnz' 'fidt9' 'fidt10'}; + [tmp fids ] = intersect_bc(lower(elec.label(elecshow)), fidlist); + nonfids = setdiff_bc(1:length(elec.label(elecshow)), fids); + h1 = plot3(X1(nonfids),Y1(nonfids),Z1(nonfids), 'o', 'color', color); hold on; + set(h1, 'tag', tag, 'marker', '.', 'markersize', 20); + if ~isempty(fids) + h2 = plot3(X1(fids),Y1(fids),Z1(fids), 'o', 'color', color*2/3); hold on; + set(h2, 'tag', tag, 'marker', '.', 'markersize', 35); % make bigger if fiducial + end; + + % plot axis and labels + %- ------------------- + if isempty(findobj(gcf, 'tag', 'axlabels')) + plot3([0.08 0.12],[0 0],[0 0],'r','LineWidth',4) % nose + plot3([0 lim],[0 0],[0 0],'b--', 'tag', 'axlabels') % axis + plot3([0 0],[0 lim],[0 0],'g--') + plot3([0 0],[0 0],[0 lim],'r--') + plot3(0,0,0,'b+') + text(lim+eps,0,0,'X','HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',[0 0 0],... + 'FontSize',10) + text(0,lim+eps,0,'Y','HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',[0 0 0],... + 'FontSize',10) + text(0,0,lim+eps,'Z','HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',[0 0 0],... + 'FontSize',10) + box on + end; + lim = abs(lim(1)); axis([-lim lim -lim lim -lim*0.5 lim]); + axis equal; + +% decode labels for electrode caps +% -------------------------------- +% 86 channels +function indices = decodelabels( chanlocs, strchan ); + label1020 = { 'nz' 'lpa' 'rpa' 'Fp1', 'Fpz', 'Fp2', 'F7', 'F3', 'Fz', 'F4', 'F8', 'T7', 'C3', 'Cz', 'C4', 'T8', 'P7', 'P3', 'Pz', 'P4', 'P8', 'O1', 'Oz', 'O2'}'; % 21 channels + label1010 = { 'nz' 'lpa' 'rpa' 'Fp1', 'Fpz', 'Fp2', 'AF9', 'AF7', 'AF5', 'AF3', 'AF1', 'AFz', 'AF2', 'AF4', 'AF6', 'AF8', 'AF10', 'F9', 'F7', 'F5', 'F3', 'F1', 'Fz', 'F2', 'F4', 'F6', 'F8', 'F10', 'FT9', 'FT7', 'FC5', 'FC3', 'FC1', 'FCz', 'FC2', 'FC4', 'FC6', 'FT8', 'FT10', 'T9', 'T7', 'C5', 'C3', 'C1', 'Cz', 'C2', ... + 'C4', 'C6', 'T8', 'T10', 'TP9', 'TP7', 'CP5', 'CP3', 'CP1', 'CPz', 'CP2', 'CP4', 'CP6', 'TP8', 'TP10', 'P9', 'P7', 'P5', 'P3', 'P1', 'Pz', 'P2', 'P4', 'P6', 'P8', 'P10', 'PO9', 'PO7', 'PO5', 'PO3', 'PO1', 'POz', 'PO2', 'PO4', 'PO6', 'PO8', 'PO10', 'O1', 'Oz', 'O2', 'I1', 'Iz', 'I2'}'; ... + if ~ischar(strchan), indices = strchan; return; end; + switch strchan + case '21 elec (10/20 system)', indices = pop_chancoresp( struct('labels', chanlocs.label), struct('labels', label1020), 'gui', 'off'); + case '86 elec (10/10 system)', indices = pop_chancoresp( struct('labels', chanlocs.label), struct('labels', label1010), 'gui', 'off'); + case 'all elec (10/5 system)', indices = 1:length(chanlocs.label); + otherwise, error('Unknown option'); + end; + +% plot electrode labels +% --------------------- +function plotlabels(elec, elecshow, color, tag); + + for i = 1:length(elecshow) + coords = elec.pnt(elecshow(i),:); + coords = coords*1.07; + text(coords(1), coords(2), coords(3), elec.label{elecshow(i)},'HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',color, 'FontSize',10, 'tag', tag) + end + +% align fiducials +% --------------- +function [elec1, transf] = align_fiducials(elec1, elec2, fidnames1, fidnames2) + + % rename fiducials + % ---------------- + ind1 = strmatch(fidnames1{1}, elec1.label, 'exact'); elec1.label{ind1} = fidnames2{1}; + ind2 = strmatch(fidnames1{2}, elec1.label, 'exact'); elec1.label{ind2} = fidnames2{2}; + ind3 = strmatch(fidnames1{3}, elec1.label, 'exact'); elec1.label{ind3} = fidnames2{3}; + cfg = []; + cfg.elec = elec1; + cfg.template = elec2; + cfg.method = 'realignfiducial'; + cfg.fiducial = fidnames2; + elec3 = electroderealign(cfg); + transf = homogenous2traditional(elec3.m); + + % test difference + % --------------- + diff1 = mean(mean(abs(elec3.m-traditionaldipfit(transf)))); + transf(6) = -transf(6); + diff2 = mean(mean(abs(elec3.m-traditionaldipfit(transf)))); + if diff1 < diff2, transf(6) = -transf(6); end; + + diff1 = mean(mean(abs(elec3.m-traditionaldipfit(transf)))); + transf(5) = -transf(5); + diff2 = mean(mean(abs(elec3.m-traditionaldipfit(transf)))); + if diff1 < diff2, transf(5) = -transf(5); end; + + diff1 = mean(mean(abs(elec3.m-traditionaldipfit(transf)))); + transf(4) = -transf(4); + diff2 = mean(mean(abs(elec3.m-traditionaldipfit(transf)))); + if diff1 < diff2, transf(4) = -transf(4); end; + + % rescale if necessary + % -------------------- + coords1 = elec1.pnt([ind1 ind2 ind3],:); dist_coords1 = sqrt(sum(coords1.^2,2)); + ind1 = strmatch(fidnames2{1}, elec2.label, 'exact'); + ind2 = strmatch(fidnames2{2}, elec2.label, 'exact'); + ind3 = strmatch(fidnames2{3}, elec2.label, 'exact'); + coords2 = elec2.pnt([ind1 ind2 ind3],:); dist_coords2 = sqrt(sum(coords2.^2,2)); + ratio = mean(dist_coords2./dist_coords1); + transf(7:9) = ratio; + + transfmat = traditionaldipfit(transf); + elec1.pnt = transfmat*[ elec1.pnt ones(size(elec1.pnt,1),1) ]'; + elec1.pnt = elec1.pnt(1:3,:)'; + +% warp channels +% ------------- +function [elec1, transf] = warp_chans(elec1, elec2, chanlist, warpmethod) + cfg = []; + cfg.elec = elec1; + cfg.template = elec2; + cfg.method = warpmethod; + %cfg.feedback = 'yes'; + cfg.channel = chanlist; + elec3 = electroderealign(cfg); + [tmp ind1 ] = intersect_bc( lower(elec1.label), lower(chanlist) ); + [tmp ind2 ] = intersect_bc( lower(elec2.label), lower(chanlist) ); + + transf = elec3.m; + transf(4:6) = transf(4:6)/180*pi; + if length(transf) == 6, transf(7:9) = 1; end; + transf = checktransf(transf, elec1, elec2); + + dpre = mean(sqrt(sum((elec1.pnt(ind1,:) - elec2.pnt(ind2,:)).^2, 2))); + transfmat = traditionaldipfit(transf); + elec1.pnt = transfmat*[ elec1.pnt ones(size(elec1.pnt,1),1) ]'; + elec1.pnt = elec1.pnt(1:3,:)'; + dpost = mean(sqrt(sum((elec1.pnt(ind1,:) - elec2.pnt(ind2,:)).^2, 2))); + + fprintf('mean distance prior to warping %f, after warping %f\n', dpre, dpost); + +% test difference and invert axis if necessary +% -------------------------------------------- +function transf = checktransf(transf, elec1, elec2) + + [tmp ind1 ind2] = intersect_bc( elec1.label, elec2.label ); + + transfmat = traditionaldipfit(transf); + tmppnt = transfmat*[ elec1.pnt ones(size(elec1.pnt,1),1) ]'; + tmppnt = tmppnt(1:3,:)'; + diff1 = tmppnt(ind1,:) - elec2.pnt(ind2,:); + diff1 = mean(sum(diff1.^2,2)); + + transf(6) = -transf(6); % yaw angle is sometimes inverted + transfmat = traditionaldipfit(transf); + tmppnt = transfmat*[ elec1.pnt ones(size(elec1.pnt,1),1) ]'; + tmppnt = tmppnt(1:3,:)'; + diff2 = tmppnt(ind1,:) - elec2.pnt(ind2,:); + diff2 = mean(sum(diff2.^2,2)); + + if diff1 < diff2, transf(6) = -transf(6); else diff1 = diff2; end; + + transf(4) = -transf(4); % yaw angle is sometimes inverted + transfmat = traditionaldipfit(transf); + tmppnt = transfmat*[ elec1.pnt ones(size(elec1.pnt,1),1) ]'; + tmppnt = tmppnt(1:3,:)'; + diff2 = tmppnt(ind1,:) - elec2.pnt(ind2,:); + diff2 = mean(sum(diff2.^2,2)); + + if diff1 < diff2, transf(4) = -transf(4); end; + +% redraw GUI +% ---------- +function redrawgui(fid) + dat = get(fid, 'userdata'); + tmpobj = findobj(fid, 'tag', 'pitch'); set(tmpobj, 'string', num2str(dat.transform(4),4)); + tmpobj = findobj(fid, 'tag', 'roll' ); set(tmpobj, 'string', num2str(dat.transform(5),4)); + tmpobj = findobj(fid, 'tag', 'yaw' ); set(tmpobj, 'string', num2str(dat.transform(6),4)); + tmpobj = findobj(fid, 'tag', 'right' ); set(tmpobj, 'string', num2str(dat.transform(1),4)); + tmpobj = findobj(fid, 'tag', 'forward'); set(tmpobj, 'string', num2str(dat.transform(2),4)); + tmpobj = findobj(fid, 'tag', 'up' ); set(tmpobj, 'string', num2str(dat.transform(3),4)); + tmpobj = findobj(fid, 'tag', 'resizex'); set(tmpobj, 'string', num2str(dat.transform(7),4)); + tmpobj = findobj(fid, 'tag', 'resizey'); set(tmpobj, 'string', num2str(dat.transform(8),4)); + tmpobj = findobj(fid, 'tag', 'resizez'); set(tmpobj, 'string', num2str(dat.transform(9),4)); + tmpview = view; + + if size(dat.transform,1) > 1 + dat.electransf.pnt = dat.transform*[ dat.elec1.pnt ones(size(dat.elec1.pnt,1),1) ]'; + else + dat.electransf.pnt = traditionaldipfit(dat.transform)*[ dat.elec1.pnt ones(size(dat.elec1.pnt,1),1) ]'; + end; + dat.electransf.pnt = dat.electransf.pnt(1:3,:)'; + dat.electransf.label = dat.elec1.label; + set(fid, 'userdata', dat); + + h = findobj(fid, 'tag', 'plot3d'); + if isempty(h) + axis off; + h = axes('unit', 'normalized', 'position', [0 0.2 1 0.75]); + set(h, 'tag', 'plot3d'); + axis off; + else + axes(h); + %axis off; + end; + plotelec(dat.electransf, dat.elecshow1, dat.color1, 'elec1'); + if ~isempty(dat.elec2) + dat.elecshow2 = decodelabels( dat.elec2, dat.elecshow2 ); + plotelec(dat.elec2, dat.elecshow2, dat.color2, 'elec2'); + end; + set(h, 'tag', 'plot3d'); + + % plot mesh + % --------- + if ~isempty(dat.meshpnt) & isempty(findobj(gcf, 'tag', 'mesh')) + if ~isempty(dat.meshtri) + p1 = plotmesh(dat.meshtri, dat.meshpnt, [], 1); + set(p1, 'tag', 'mesh'); + else + facecolor(1,1,1) = 1; facecolor(1,1,2) = .75; facecolor(1,1,3) = .65; + cdat = repmat( facecolor, [ size(dat.meshpnt{1}) 1]); + h = mesh(dat.meshpnt{1}, dat.meshpnt{2}, dat.meshpnt{3}, ... + 'cdata', cdat, 'tag', 'mesh', 'facecolor', squeeze(facecolor), 'edgecolor', 'none'); + hidden off; + lightangle(45,30); + lightangle(45+180,30); + lighting phong + s = plotnose([85 0 -75 0 0 pi/2 10 10 40]); + set(s, 'tag', 'mesh'); + end; + end; + meshobj = findobj(gcf, 'tag', 'mesh'); + if dat.meshon + set( meshobj, 'visible', 'on'); + else set( meshobj, 'visible', 'off'); + end; + + % plot electrodes + % --------------- + delete(findobj(gcf, 'tag', 'elec1labels')); + delete(findobj(gcf, 'tag', 'elec2labels')); + if dat.label1 + plotlabels(dat.electransf, dat.elecshow1, dat.color1, 'elec1labels'); + end; + if dat.label2 + plotlabels(dat.elec2, dat.elecshow2, dat.color2*0.5, 'elec2labels'); + end; + + %view(tmpview); + rotate3d on + + +% function to plot the nose +% ------------------------- +function s = plotnose(transf, col) + + if nargin < 1 + transf = [0 0 0 0 0 0 1 1 1]; + end; + if nargin < 2 + col = [1 0.75 0.65 ]; + end; + + x=[ % cube + NaN -1 1 NaN + -1 -1 1 1 + -1 -1 1 1 + NaN -1 1 NaN + NaN -1 1 NaN + NaN NaN NaN NaN + ]; + + y=[ % cube + NaN -1 -1 NaN + -1 -1 -1 -1 + 1 1 1 1 + NaN 1 1 NaN + NaN -1 -1 NaN + NaN NaN NaN NaN + ]; + + z=[ % cube + NaN 0 0 NaN + 0 1 1 0 + 0 1 1 0 + NaN 0 0 NaN + NaN 0 0 NaN + NaN NaN NaN NaN + ]; + + x=[ % noze + NaN -1 1 NaN + -1 0 0 1 + -.3 0 0 .3 + NaN -.3 .3 NaN + NaN -1 1 NaN + NaN NaN NaN NaN + ]; + + y=[ % noze + NaN -1 -1 NaN + -1 -1 -1 -1 + 1 -1 -1 1 + NaN 1 1 NaN + NaN -1 -1 NaN + NaN NaN NaN NaN + ]; + + z=[ % noze + NaN 0 0 NaN + 0 1 1 0 + 0 1 1 0 + NaN 0 0 NaN + NaN 0 0 NaN + NaN NaN NaN NaN + ]; + + % apply homogenous transformation + % ------------------------------- + transfhom = traditionaldipfit( transf ); + xyz = [ x(:) y(:) z(:) ones(length(x(:)),1) ]; + xyz2 = transfhom * xyz'; + x(:) = xyz2(1,:)'; + y(:) = xyz2(2,:)'; + z(:) = xyz2(3,:)'; + + % dealing with colors + % ------------------- + cc=zeros(8,3); + cc(1,:) = col; + cc(2,:) = col; + cc(3,:) = col; + cc(4,:) = col; + cc(5,:) = col; + cc(6,:) = col; + cc(7,:) = col; + cc(8,:) = col; + cc(1,:)=[0 0 0]; % black + cc(2,:)=[1 0 0]; % red + cc(3,:)=[0 1 0]; % green + cc(4,:)=[0 0 1]; % blue + cc(5,:)=[1 0 1]; % magenta + cc(6,:)=[0 1 1]; % cyan + cc(7,:)=[1 1 0]; % yellow + cc(8,:)=[1 1 1]; % white + cs=size(x); + c=repmat(zeros(cs),[1 1 3]); + for i=1:size(cc,1) + ix=find(x==cc(i,1) &... + y==cc(i,2) &... + z==cc(i,3)); + [ir,ic]=ind2sub(cs,ix); + for k=1:3 + for m=1:length(ir) + c(ir(m),ic(m),k)=cc(i,k); + end + end + end + + % plotting surface + % ---------------- + facecolor = zeros(size(x,1), size(z,2), 3); + facecolor(:,:,1) = 1; facecolor(:,:,2) = .75; facecolor(:,:,3) = .65; + + s=surf(x,y,z,facecolor); + set(s, 'edgecolor', [0.5 0.5 0.5]); + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/dipoledensity.m b/code/eeglab13_4_4b/functions/sigprocfunc/dipoledensity.m new file mode 100644 index 0000000..0e02548 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/dipoledensity.m @@ -0,0 +1,517 @@ +% dipoledensity() - compute and optionally plot a measure of the 3-D spatial +% (in)homogeneity of a specified (large) set of 1- or 2-dipole +% component models, either as physical dipole density or as +% dipole-position entropy across subjects. In either case, +% take into account either all the dipoles, or only the nearest +% dipole from each of the subjects. If no output arguments, +% or if 'plot','on', paints a 3-D density|entropy brain image +% on slices of the Montreal Neurological Institute (MNI) mean +% MR brain image ('standard_BESA/avg152t1.mat'). Calls +% dipplot(), +% mri3dplot(), and Fieldtrip function find_inside_vol(). +% Usage: +% >> [dens3d mri] = dipoledensity( dipoles, 'key',val, ... ); +% +% Inputs: +% dipoles - this may be either the same dipole structure given as input to +% the dipplot() function, a 3 by n array of dipole localization or +% a cell array containing arguments for the dipplot function. Note that +% the 'coordformat' option below defines the coordinate space for these +% dipoles (default is MNI). See help dipplot for more information. +% +% Optional 'key', val input pairs: +% 'mri' - [string or struct] mri file (matlab format or file format read +% by fcdc_read_mri). See dipplot.m help for more information. +% 'method' - ['alldistance'|'distance'|'entropy'|'relentropy'] method for +% computing density: +% 'alldistance' - {default} take into account the gaussian-weighted +% distances from each voxel to all the dipoles. See +% 'methodparam' (below) to specify a standard deviation +% (in mm) for the gaussian weight kernel. +% 'distance' - take into account only the distances to the nearest +% dipole for each subject. See 'methodparam' (below). +% 'entropy' - taking into account only the nearest dipole to each +% voxel for each subject. See 'methodparam' below. +% 'relentropy' - as in 'entropy,' but take into account all the +% dipoles for each subject. +% 'methodparam' - [number] for 'distance'|'alldistance' methods (see above), the +% standard deviation (in mm) of the 3-D gaussian smoothing kernel. +% For 'entropy'|'relentropy' methods, the number of closest dipoles +% to include {defaults: 20 mm | 20 dipoles } +% 'subsample' - [integer] subsampling of native MNI image {default: 2 -> 2x2x2} +% 'weight' - [(1,ncomps) array] for 'distance'|'alldistance' methods, the +% relative weight of each component dipole {default: ones()} +% 'coordformat' - ['mni'|'spherical'] coordinate format if dipole location or +% a structure is given as input. Default is 'mni'. +% 'subjind' - [(1,ncomps) array] subject index for each dipole model. If two +% dipoles are in one component model, give only one subject index. +% 'nsessions' - [integer] for 'alldistance' method, the number of sessions to +% divide the output values by, so that the returned measure is +% dipole density per session {default: 1} +% 'plot' - ['on'|'off'] force plotting dipole density|entropy +% {default: 'on' if no output arguments, else 'off'} +% 'dipplot' - ['on'|'off'] plot the dipplot image (used for converting +% coordinates (default is 'off') +% 'plotargs' - {cell array} plotting arguments for mri3dplot() function. +% 'volmesh_fname' - [string] precomputed mesh volume file name. If not +% given as input the function will recompute it (it can take from +% five to 20 minutes). By default this function save the volume file +% mesh into a file named volmesh_local.mat in the current +% folder. +% 'norm2JointProb' - ['on'|'off'] Use joint probability (i.e. sum of all +% voxel values == 1) instead of number of dipoles/cm^3. +% Should be used for group comparison. (default 'off') +% +% Outputs: +% dens3d - [3-D num array] density in dipoles per cubic centimeter. If output +% is returned, no plot is produced unless 'plot','on' is specified. +% mri - {MRI structure} used in mri3dplot(). +% +% Example: +% >> fakedipoles = (rand(3,10)-0.5)*80; +% >> [dens3d mri] = dipoledensity( fakedipoles, 'coordformat', 'mni'); +% >> mri3dplot(dens3d,mri); % replot if no output is given above +% % function is called automatically +% +% ------------------------------------ +% NOTES: to do multiple subject causal-weighted density map, +% (1) concatenate dipplot coord matrices for all subject +% (2) make g.subjind vector [ones(1,ncompsS1) 2*ones(1,ncompsS2) ... N*ones(1,ncompssN)] +% (3) concatenate normalized outflows for all subjects to form weight vector +% (4) call dipoledensity function with method = 'entropy' or 'relentropy' +% ------------------------------------ +% +% See also: +% EEGLAB: dipplot(), mri3dplot(), Fieldtrip: find_inside_vol() +% +% Author: Arnaud Delorme & Scott Makeig, SCCN, INC, UCSD +% 02/19/2013 'norm2JointProb' added by Makoto. + +% Copyright (C) Arnaud Delorme & Scott Makeig, SCCN/INC/UCSD, 2003- +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [prob3d, mri] = dipoledensity(dipplotargs, varargin) + + % TO DO: return in dipplot() the real 3-D location of dipoles (in posxyz) + % FIX the dimension order here + +prob3d = []; mri = []; +if nargin < 1 + help dipoledensity + return +end + +g = finputcheck(varargin, { 'subjind' 'integer' [] []; + 'method' 'string' { 'relentropy','entropy','distance','alldistance' } 'alldistance'; + 'methodparam' 'real' [] 20; + 'weight' { 'real','cell' } [] []; + 'smooth' 'real' [] 0; + 'nsessions' 'integer' [] 1; + 'subsample' 'integer' [] 2; + 'plotargs' 'cell' [] {}; + 'plot' 'string' { 'on','off' } fastif(nargout == 0, 'on', 'off'); + 'dipplot' 'string' { 'on','off' } 'off'; + 'coordformat' 'string' { 'mni','spherical' } 'mni'; + 'normalization' 'string' { 'on','off' } 'on'; + 'volmesh_fname' 'string' [] 'volmesh_local.mat'; + 'mri' { 'struct','string' } [] ''; + 'norm2JointProb' 'string' { 'on','off' } 'off'}); +if isstr(g), error(g); end; +if ~strcmpi(g.method, 'alldistance') & isempty(g.subjind) + error('Subject indices are required for this method'); +end; +if ~iscell(g.weight), g.weight = { g.weight }; end; + +% plotting dipplot +% ---------------- +if ~iscell(dipplotargs) % convert input + if ~isstruct(dipplotargs) + if size(dipplotargs,1) == 3, dipplotargs = dipplotargs'; + elseif size(dipplotargs,2) ~= 3 + error('If an array of dipoles is given as entry, there must be 3 columns or 3 rows for x y z'); + end; + model = []; + for idip = 1:length(dipplotargs) + model(idip).posxyz = dipplotargs(idip,:); + model(idip).momxyz = [1 0 0]; + model(idip).rv = 0.5; + end; + dipplotargs = model; + end; + dipplotargs = { dipplotargs 'coordformat' g.coordformat }; +else + dipplotargs = { dipplotargs{:} 'coordformat' g.coordformat }; +end; +struct = dipplot(dipplotargs{:}, 'plot', g.dipplot); +if nargout == 0 + drawnow; +end; + +% retrieve coordinates in MNI space +% --------------------------------- +if 0 % deprecated + % find dipoles + % ------------ + hmesh = findobj(gcf, 'tag', 'mesh'); + if isempty(hmesh), error('Current figure must contain dipoles'); end; + hh = []; + disp('Finding dipoles...'); + dips = zeros(1,200); + for index = 1:1000 + hh = [ hh(:); findobj(gcf, 'tag', ['dipole' int2str(index) ]) ]; + dips(index) = length(findobj(gcf, 'tag', ['dipole' int2str(index) ])); + end; + + disp('Retrieving dipole positions ...'); + count = 1; + for index = 1:length(hh) + tmp = get(hh(index), 'userdata'); + if length(tmp) == 1 + allx(count) = tmp.eleccoord(1,1); + ally(count) = tmp.eleccoord(1,2); + allz(count) = tmp.eleccoord(1,3); + alli(count) = index; + count = count + 1; + end; + end; +end; + +% check weights +% ------------- +if ~isempty(g.weight{1}) + if ~iscell(g.weight) + if length(g.weight) ~= length(struct) + error('There must be as many elements in the weight matrix as there are dipoles') + end; + else + if length(g.weight{1}) ~= length(struct) || length(g.weight{1}) ~= length(g.weight{end}) + error('There must be as many elements in the weight matrix as there are dipoles') + end; + end; +else + g.weight = { ones( 1, length(struct)) }; +end; +if ~isempty(g.subjind) + if length(g.subjind) ~= length(struct) + error('There must be as many element in the subject matrix as there are dipoles') + end; +else + g.subjind = ones( 1, length(struct)); +end; + +% decoding dipole locations +% ------------------------- +disp('Retrieving dipole positions ...'); +count = 1; +for index = 1:length(struct) + dips = size(struct(index).eleccoord,1); + for dip = 1:dips + allx(count) = struct(index).eleccoord(dip,1); + ally(count) = struct(index).eleccoord(dip,2); + allz(count) = struct(index).eleccoord(dip,3); + alli(count) = index; + allw1(count) = g.weight{1}( index)/dips; + allw2(count) = g.weight{end}(index)/dips; + alls(count) = g.subjind(index); + count = count + 1; + end; +end; +g.weight{1} = allw1; +g.weight{end} = allw2; +g.subjind = alls; + +% read MRI file +% ------------- +if isempty(g.mri) % default MRI file + dipfitdefs; + load('-mat', template_models(1).mrifile); % load mri variable + g.mri = mri; +end +if isstr(g.mri) + try, + mri = load('-mat', g.mri); + mri = mri.mri; + catch, + disp('Failed to read Matlab file. Attempt to read MRI file using function read_fcdc_mri'); + try, + warning off; + mri = read_fcdc_mri(g.mri); + mri.anatomy = round(gammacorrection( mri.anatomy, 0.8)); + mri.anatomy = uint8(round(mri.anatomy/max(reshape(mri.anatomy, prod(mri.dim),1))*255)); + % WARNING: if using double instead of int8, the scaling is different + % [-128 to 128 and 0 is not good] + % WARNING: the transform matrix is not 1, 1, 1 on the diagonal, some slices may be + % misplaced + warning on; + catch, + error('Cannot load file using read_fcdc_mri'); + end; + end; + g.mri = mri; % output the anatomic mri image +end; + + +% reserve array for density +% ------------------------- +prob3d = {zeros(ceil(g.mri.dim/g.subsample)) }; +for i = 2:length(g.weight), prob3d{i} = prob3d{1}; end; + +% compute voxel size +% ------------------ +point1 = g.mri.transform * [ 1 1 1 1 ]'; +point2 = g.mri.transform * [ 2 2 2 1 ]'; +voxvol = sum((point1(1:3)-point2(1:3)).^2)*g.subsample^3; % in mm + +% compute global subject entropy if necessary +% ------------------------------------------- +vals = unique_bc(g.subjind); % the unique subject indices +if strcmpi(g.method, 'relentropy') | strcmpi(g.method, 'entropy') %%%%% entropy %%%%%%% + newind = zeros(size(g.subjind)); + for index = 1:length(vals) % foreach subject in the cluster + tmpind = find(g.subjind == vals(index)); % dipoles for the subject + totcount(index) = length(tmpind); % store the number of subject dipoles + newind(tmpind) = index; % put subject index into newind + end; + g.subjind = newind; + gp = totcount/sum(totcount); + globent = -sum(gp.*log(gp)); +end; + +% compute volume inside head mesh +% ------------------------------- +dipfitdefs; % get the location of standard BEM volume file +tmp = load('-mat',DIPOLEDENSITY_STDBEM); % load MNI mesh + +if isempty(g.volmesh_fname) % default + filename = [ '/home/arno/matlab/MNI_VoxelTsearch' int2str(g.subsample) '.mat' ]; +else + filename = g.volmesh_fname; % +end +if ~exist(filename) + disp('Computing volume within head mesh...'); + [X Y Z] = meshgrid(g.mri.xgrid(1:g.subsample:end)+g.subsample/2, ... + g.mri.ygrid(1:g.subsample:end)+g.subsample/2, ... + g.mri.zgrid(1:g.subsample:end)+g.subsample/2); + [indX indY indZ ] = meshgrid(1:length(g.mri.xgrid(1:g.subsample:end)), ... + 1:length(g.mri.ygrid(1:g.subsample:end)), ... + 1:length(g.mri.zgrid(1:g.subsample:end))); + allpoints = [ X(:)' ; Y(:)' ; Z(:)' ]; + allinds = [ indX(:)' ; indY(:)'; indZ(:)' ]; + allpoints = g.mri.transform * [ allpoints ; ones(1, size(allpoints,2)) ]; + allpoints(4,:) = []; + + olddir = pwd; + tmppath = which('ft_electroderealign'); + tmppath = fullfile(fileparts(tmppath), 'private'); + cd(tmppath); + [Inside Outside] = find_inside_vol(allpoints', tmp.vol); % from Fieldtrip + cd(olddir); + disp('Done.'); + + if 0 % old code using Delaunay %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + P = tmp.vol.bnd(1).pnt; + T = delaunayn(P); % recompute triangularization (the original one is not compatible + % with tsearchn) get coordinates of all points in the volume + % search for points inside or ouside the volume (takes about 14 minutes!) + IO = tsearchn(P, T, allpoints'); + Inside = find(isnan(IO)); + Outside = find(~isnan(IO)); + disp('Done.'); + end; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + try, + save('-mat', filename, 'allpoints', 'allinds', 'Inside', 'Outside'); + disp('Saving file containing inside/outide voxel indices...'); + catch, end; +else + disp('Loading file containing inside/outide voxel indices...'); + load('-mat',filename); +end; +InsidePoints = allpoints(:, Inside); +InsideIndices = allinds(:, Inside); + +% scan grid and compute entropy at each voxel +% ------------------------------------------- +edges = [0.5:1:length(vals)+0.5]; + +if ~strcmpi(g.method, 'alldistance') + fprintf('Computing (of %d):', size(InsideIndices,2)); + % entropy calculation: have to scan voxels + % ---------------------------------------- + for i = 1:size(InsideIndices,2) + + alldists = (InsidePoints(1,i) - allx).^2 ... + + (InsidePoints(2,i) - ally).^2 ... + + (InsidePoints(3,i) - allz).^2; + [tmpsort indsort] = sort(alldists); % sort dipoles by distance + tmpweights{1} = g.weight{1}( indsort); + tmpweights{end} = g.weight{end}(indsort); + + if strcmpi(g.method, 'relentropy') | strcmpi(g.method, 'entropy') %%%%% entropy %%%%%%% + + subjs = g.subjind(indsort(1:g.methodparam)); % get subject indices of closest dipoles + p = histc(subjs, edges); + if strcmpi(g.method, 'relentropy') + p = p(1:end-1)./totcount; + % this should be uniform if p conforms to global count for all subjects + end; + p = p/sum(p); + p(find(p == 0)) = []; + for tmpi = 1:length(g.weight) + prob3d{1}(InsideIndices(1,i), InsideIndices(2,i), InsideIndices(3,i)) = -sum(p.*log(p)); + end; + else + % distance to each subject + ordsubjs = g.subjind(indsort); + for index = 1:length(vals) % for each subject + tmpind = find(ordsubjs == vals(index)); + if strcmpi(g.method,'distance') + use_dipoles(index) = tmpind(1); % find their nearest dipole + end + end; + for tmpi = 1:length(g.weight) + prob3d{tmpi}(InsideIndices(1,i), InsideIndices(2,i), InsideIndices(3,i)) = ... + sum(tmpweights{tmpi}(use_dipoles).*exp(-tmpsort(use_dipoles)/ ... + (2*g.methodparam^2))); % 3-D gaussian smooth + end; + end; + if mod(i,100) == 0, fprintf('%d ', i); end; + end; +else % 'alldistance' + % distance calculation: can scan dipoles instead of voxels (since linear) + % -------------------------------------------------------- + %alldists = allx.^2 + ally.^2 + allz.^2; + %figure; hist(alldists); return; % look at distribution of distances + + fprintf('Computing (of %d):', size(allx,2)); + for tmpi=1:length(g.weight) + tmpprob{tmpi} = zeros(1, size(InsidePoints,2)); + end; + if length(g.weight) > 1, tmpprob2 = tmpprob; end; + for i = 1:size(allx,2) + alldists = (InsidePoints(1,:) - allx(i)).^2 + ... + (InsidePoints(2,:) - ally(i)).^2 + ... + (InsidePoints(3,:) - allz(i)).^2; +% alldists = 1; % TM + for tmpi=1:length(g.weight) + tmpprob{tmpi} = tmpprob{tmpi} + g.weight{tmpi}(i)*exp(-alldists/(2*g.methodparam^2)); % 3-D gaussian smooth + if any(isinf(tmpprob{tmpi})), error('Infinite value in probability calculation'); end; + end; + if mod(i,50) == 0, fprintf('%d ', i); end; + end; + % copy values to 3-D mesh + % ----------------------- + for i = 1:length(Inside) + pnts = allinds(:,Inside(i)); + for tmpi = 1:length(g.weight) + prob3d{tmpi}(pnts(1), pnts(2), pnts(3)) = tmpprob{tmpi}(i); + end; + end; + +end; +fprintf('\n'); + +% normalize for points inside and outside the volume +% -------------------------------------------------- +if strcmpi(g.method, 'alldistance') && strcmpi(g.normalization,'on') + for i =1:length(g.weight) + disp('Normalizing to dipole/mm^3'); + if any(prob3d{i}(:)<0) + fprintf('WARNING: Some probabilities are negative, this will likely cause problems when normalizing probabilities.\n'); + fprintf('It is highly recommended to turn normaliziation off by using ''normalization'' key to ''off''.\n'); + end; + totval = sum(prob3d{i}(:)); % total values in the head + switch g.norm2JointProb + case 'off' + totdip = size(allx,2); % number of dipoles + voxvol; % volume of a voxel in mm^3 + prob3d{i} = prob3d{i}/totval*totdip/voxvol*1000; % time 1000 to get cubic centimeters + prob3d{i} = prob3d{i}/g.nsessions; + case 'on' + prob3d{i} = prob3d{i}/totval; + end + end; +end; + +% resample matrix +% ---------------- +if g.subsample ~= 1 + for i =1:length(g.weight) + prob3d{i} = prob3d{i}/g.subsample; + newprob3d = zeros(g.mri.dim); + X = ceil(g.mri.xgrid/g.subsample); + Y = ceil(g.mri.ygrid/g.subsample); + Z = ceil(g.mri.zgrid/g.subsample); + for index = 1:size(newprob3d,3) + newprob3d(:,:,index) = prob3d{i}(X,Y,Z(index)); + end; + prob3d{i} = newprob3d; + end; +end; + +% 3-D smoothing +% ------------- +if g.smooth ~= 0 + disp('Smoothing...'); + for i =1:length(g.weight) + prob3d{i} = smooth3d(prob3d{i}, g.smooth); + end; +end; + +% plotting +% -------- +if strcmpi(g.plot, 'off') + close gcf; +else + mri3dplot( prob3d, g.mri, g.plotargs{:}); % plot the density using mri3dplot() +end; +return; + +%% +function [inside, outside] = find_inside_vol(pos, vol); + +% FIND_INSIDE_VOL locates dipole locations inside/outside the source +% compartment of a volume conductor model. +% +% [inside, outside] = find_inside_vol(pos, vol) +% +% This function is obsolete and its use in other functions should be replaced +% by inside_vol + +% Copyright (C) 2003-2007, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +warning('find_inside_vol is obsolete and will be removed, please use ft_inside_vol'); +inside = ft_inside_vol(pos, vol); +% replace boolean vector with indexing vectors +outside = find(~inside); +inside = find(inside); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegfilt.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegfilt.m new file mode 100644 index 0000000..67f601d --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegfilt.m @@ -0,0 +1,214 @@ +% eegfilt() - (high|low|band)-pass filter data using two-way least-squares +% FIR filtering. Optionally uses the window method instead of +% least-squares. Multiple data channels and epochs supported. +% Requires the MATLAB Signal Processing Toolbox. +% Usage: +% >> [smoothdata] = eegfilt(data,srate,locutoff,hicutoff); +% >> [smoothdata,filtwts] = eegfilt(data,srate,locutoff,hicutoff, ... +% epochframes,filtorder,revfilt,firtype,causal); +% Inputs: +% data = (channels,frames*epochs) data to filter +% srate = data sampling rate (Hz) +% locutoff = low-edge frequency in pass band (Hz) {0 -> lowpass} +% hicutoff = high-edge frequency in pass band (Hz) {0 -> highpass} +% epochframes = frames per epoch (filter each epoch separately {def/0: data is 1 epoch} +% filtorder = length of the filter in points {default 3*fix(srate/locutoff)} +% revfilt = [0|1] reverse filter (i.e. bandpass filter to notch filter). {default 0} +% firtype = 'firls'|'fir1' {'firls'} +% causal = [0|1] use causal filter if set to 1 (default 0) +% +% Outputs: +% smoothdata = smoothed data +% filtwts = filter coefficients [smoothdata <- filtfilt(filtwts,1,data)] +% +% See also: firls(), filtfilt() + +% Author: Scott Makeig, Arnaud Delorme, Clemens Brunner SCCN/INC/UCSD, La Jolla, 1997 + +% Copyright (C) 4-22-97 from bandpass.m Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 05-08-97 fixed frequency bound computation -sm +% 10-22-97 added MINFREQ tests -sm +% 12-05-00 added error() calls -sm +% 01-25-02 reformated help & license, added links -ad +% 03-20-12 added firtype option -cb + +function [smoothdata,filtwts] = eegfilt(data,srate,locutoff,hicutoff,epochframes,filtorder,revfilt,firtype,causal) + +if nargin<4 + fprintf(''); + help eegfilt + return +end + +%if ~exist('firls') +% error('*** eegfilt() requires the signal processing toolbox. ***'); +%end + +[chans frames] = size(data); +if chans > 1 & frames == 1, + help eegfilt + error('input data should be a row vector.'); +end +nyq = srate*0.5; % Nyquist frequency +%MINFREQ = 0.1/nyq; +MINFREQ = 0; + +minfac = 3; % this many (lo)cutoff-freq cycles in filter +min_filtorder = 15; % minimum filter length +trans = 0.15; % fractional width of transition zones + +if locutoff>0 & hicutoff > 0 & locutoff > hicutoff, + error('locutoff > hicutoff ???\n'); +end +if locutoff < 0 | hicutoff < 0, + error('locutoff | hicutoff < 0 ???\n'); +end + +if locutoff>nyq, + error('Low cutoff frequency cannot be > srate/2'); +end + +if hicutoff>nyq + error('High cutoff frequency cannot be > srate/2'); +end + +if nargin<6 + filtorder = 0; +end +if nargin<7 + revfilt = 0; +end +if nargin<8 + firtype = 'firls'; +end +if nargin<9 + causal = 0; +end + +if strcmp(firtype, 'firls') + warning('Using firls to estimate filter coefficients. We recommend that you use fir1 instead, which yields larger attenuation. In future, fir1 will be used by default!'); +end + +if isempty(filtorder) | filtorder==0, + if locutoff>0, + filtorder = minfac*fix(srate/locutoff); + elseif hicutoff>0, + filtorder = minfac*fix(srate/hicutoff); + end + + if filtorder < min_filtorder + filtorder = min_filtorder; + end +end + +if nargin<5 + epochframes = 0; +end +if epochframes ==0, + epochframes = frames; % default +end +epochs = fix(frames/epochframes); +if epochs*epochframes ~= frames, + error('epochframes does not divide frames.\n'); +end + +if filtorder*3 > epochframes, % Matlab filtfilt() restriction + fprintf('eegfilt(): filter order is %d. ',filtorder); + error('epochframes must be at least 3 times the filtorder.'); +end +if (1+trans)*hicutoff/nyq > 1 + error('high cutoff frequency too close to Nyquist frequency'); +end; + +if locutoff > 0 & hicutoff > 0, % bandpass filter + if revfilt + fprintf('eegfilt() - performing %d-point notch filtering.\n',filtorder); + else + fprintf('eegfilt() - performing %d-point bandpass filtering.\n',filtorder); + end; + fprintf(' If a message, ''Matrix is close to singular or badly scaled,'' appears,\n'); + fprintf(' then Matlab has failed to design a good filter. As a workaround, \n'); + fprintf(' for band-pass filtering, first highpass the data, then lowpass it.\n'); + if strcmp(firtype, 'firls') + f=[MINFREQ (1-trans)*locutoff/nyq locutoff/nyq hicutoff/nyq (1+trans)*hicutoff/nyq 1]; + fprintf('eegfilt() - low transition band width is %1.1g Hz; high trans. band width, %1.1g Hz.\n',(f(3)-f(2))*srate/2, (f(5)-f(4))*srate/2); + m=[0 0 1 1 0 0]; + elseif strcmp(firtype, 'fir1') + filtwts = fir1(filtorder, [locutoff, hicutoff]./(srate/2)); + end +elseif locutoff > 0 % highpass filter + if locutoff/nyq < MINFREQ + error(sprintf('eegfilt() - highpass cutoff freq must be > %g Hz\n\n',MINFREQ*nyq)); + end + fprintf('eegfilt() - performing %d-point highpass filtering.\n',filtorder); + if strcmp(firtype, 'firls') + f=[MINFREQ locutoff*(1-trans)/nyq locutoff/nyq 1]; + fprintf('eegfilt() - highpass transition band width is %1.1g Hz.\n',(f(3)-f(2))*srate/2); + m=[ 0 0 1 1]; + elseif strcmp(firtype, 'fir1') + filtwts = fir1(filtorder, locutoff./(srate/2), 'high'); + end +elseif hicutoff > 0 % lowpass filter + if hicutoff/nyq < MINFREQ + error(sprintf('eegfilt() - lowpass cutoff freq must be > %g Hz',MINFREQ*nyq)); + end + fprintf('eegfilt() - performing %d-point lowpass filtering.\n',filtorder); + if strcmp(firtype, 'firls') + f=[MINFREQ hicutoff/nyq hicutoff*(1+trans)/nyq 1]; + fprintf('eegfilt() - lowpass transition band width is %1.1g Hz.\n',(f(3)-f(2))*srate/2); + m=[ 1 1 0 0]; + elseif strcmp(firtype, 'fir1') + filtwts = fir1(filtorder, hicutoff./(srate/2)); + end +else + error('You must provide a non-0 low or high cut-off frequency'); +end +if revfilt + if strcmp(firtype, 'fir1') + error('Cannot reverse filter using ''fir1'' option'); + else + m = ~m; + end; +end; + +if strcmp(firtype, 'firls') + filtwts = firls(filtorder,f,m); % get FIR filter coefficients +end + +smoothdata = zeros(chans,frames); +for e = 1:epochs % filter each epoch, channel + for c=1:chans + try + if causal + smoothdata(c,(e-1)*epochframes+1:e*epochframes) = filter( filtwts,1,data(c,(e-1)*epochframes+1:e*epochframes)); + else smoothdata(c,(e-1)*epochframes+1:e*epochframes) = filtfilt(filtwts,1,data(c,(e-1)*epochframes+1:e*epochframes)); + end; + catch, + if causal + smoothdata(c,(e-1)*epochframes+1:e*epochframes) = filter( filtwts,1,double(data(c,(e-1)*epochframes+1:e*epochframes))); + else smoothdata(c,(e-1)*epochframes+1:e*epochframes) = filtfilt(filtwts,1,double(data(c,(e-1)*epochframes+1:e*epochframes))); + end; + end; + if epochs == 1 + if rem(c,20) ~= 0, fprintf('.'); + else fprintf('%d',c); + end + end + end +end +fprintf('\n'); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegfiltfft.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegfiltfft.m new file mode 100644 index 0000000..4035c18 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegfiltfft.m @@ -0,0 +1,113 @@ +% eegfiltfft() - (high|low|band)-pass filter data using inverse fft +% (without using the Matlab signal processing toolbox) +% Usage: +% >> [smoothdata] = eegfiltfft(data,srate,locutoff,hicutoff); +% >> [smoothdata] = eegfiltfft(data,srate,locutoff,hicutoff,epochframes,filtorder,revfilt); +% +% Inputs: +% data = (channels,frames*epochs) data to filter +% srate = data sampling rate (Hz) +% locutoff = low-edge frequency in pass band (Hz) {0 -> lowpass} +% hicutoff = high-edge frequency in pass band (Hz) {0 -> highpass} +% +% Optional inputs: +% epochframes = frames per epoch (filter each epoch separately {def/0: data is 1 epoch} +% filtorder = argument not used (but required for symetry with eegfilt() function). +% revfilt = [0|1] reverse filter (i.e. bandpass filter to notch filter). {0} +% +% Outputs: +% smoothdata = smoothed data +% +% Known problems: +% The signal drop off is much smaller compared to standard filtering methods +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2003 +% +% See also: eegfilt() + +% inspired from a ggogle group message +% http://groups.google.com/groups?q=without+%22the+signal+processing+toolbox%22&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=f56893ae.0311141025.3069d4f8%40posting.google.com&rnum=8 + +% Copyright (C) Arnaud Delorme, SCCN/INC/UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function smoothdata = eegfiltfft(data, fs, lowcut, highcut, epochframes, filtorder, revfilt); + + if nargin < 4 + help eegfiltfft; + end; + [chans frames] = size(data); + if nargin < 5 | epochframes == 0 + epochframes = frames; + end + if nargin < 7 + revfilt = 0; + end; + + epochs = frames/epochframes; + if epochs ~= round(epochs) + error('Epochframes does not divide the total number of frames'); + end; + fv=reshape([0:epochframes-1]*fs/epochframes,epochframes,1); % Frequency vector for plotting + + %figure; + %plot(fv, 20*log(abs(X))/log(10)) % Plot power spectrum in dB scale + %xlabel('Frequency [Hz]') + %ylabel('Signal power [dB]') + + % find closest freq in fft decomposition + % -------------------------------------- + if lowcut ~= 0 + [tmp idxl]=min(abs(fv-lowcut)); % Find the entry in fv closest to 5 kHz + else + idxl = 0; + end; + if highcut ~= 0 + [tmp idxh]=min(abs(fv-highcut)); % Find the entry in fv closest to 5 kHz + else + idxh = ceil(length(fv)/2); + end; + + % filter the data + % --------------- + smoothdata = zeros(chans,frames); + for e = 1:epochs % filter each epoch, channel + for c=1:chans + X=fft(data(c,(e-1)*epochframes+1:e*epochframes)); + if revfilt + X(idxl+1:idxh-1)=0; + if mod(length(X),2) == 0 + X(end/2:end)=0; + else + X((end+1)/2:end)=0; + end; + else + X(1:idxl)=complex(0); + X(end-idxl:end)=complex(0); + X(idxh:end)=complex(0); + end; + smoothdata(c,(e-1)*epochframes+1:e*epochframes) = 2*real(ifft(X)); + if epochs == 1 + if rem(c,20) ~= 0 + fprintf('.'); + else + fprintf('%d',c); + end + end + end + end + fprintf('\n'); + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegplot.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot.m new file mode 100644 index 0000000..b02b835 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot.m @@ -0,0 +1,2094 @@ +% eegplot() - Scroll (horizontally and/or vertically) through multichannel data. +% Allows vertical scrolling through channels and manual marking +% and unmarking of data stretches or epochs for rejection. +% Usage: +% >> eegplot(data, 'key1', value1 ...); % use interface buttons, etc. +% else +% >> eegplot('noui', data, 'key1', value1 ...); % no user interface; +% % use for plotting +% Menu items: +% "Figure > print" - [menu] Print figure in portrait or landscape. +% "Figure > Edit figure" - [menu] Remove menus and buttons and call up the standard +% Matlab figure menu. Select "Tools > Edit" to format the figure +% for publication. Command line equivalent: 'noui' +% "Figure > Accept and Close" - [menu] Same as the bottom-right "Reject" button. +% "Figure > Cancel and Close" - [menu] Cancel all editing, same as the "Cancel" button. +% "Display > Marking color" > [Hide|Show] marks" - [menu] Show or hide patches of +% background color behind the data. Mark stretches of *continuous* +% data (e.g., for rejection) by dragging the mouse horizontally +% over the activity. With *epoched* data, click on the selected epochs. +% Clicked on a marked region to unmark it. Called from the +% command line, marked data stretches or epochs are returned in +% the TMPREJ variable in the global workspace *if/when* the "Reject" +% button is pressed (see Outputs); called from pop_eegplot() or +% eeglab(), the marked data portions are removed from the current +% dataset, and the dataset is automatically updated. +% "Display > Marking color > Choose color" - [menu] Change the background marking +% color. The marking color(s) of previously marked trials are preserved. +% Called from command line, subsequent functions eegplot2event() or +% eegplot2trials() allow processing trials marked with different colors +% in the TMPREJ output variable. Command line equivalent: 'wincolor'. +% "Display > Grid > ..." - [menu] Toggle (on or off) time and/or channel axis grids +% in the activity plot. Submenus allow modifications to grid aspects. +% Command line equivalents: 'xgrid' / 'ygrid' +% "Display > Show scale" - [menu] Show (or hide if shown) the scale on the bottom +% right corner of the activity window. Command line equivalent: 'scale' +% "Display > Title" - [menu] Change the title of the figure. Command line equivalent: +% 'title' +% "Settings > Time range to display" - [menu] For continuous EEG data, this item +% pops up a query window for entering the number of seconds to display +% in the activity window. For epoched data, the query window asks +% for the number of epochs to display (this can be fractional). +% Command line equivalent: 'winlength' +% "Settings > Number of channels to display" - [menu] Number of channels to display +% in the activity window. If not all channels are displayed, the +% user may scroll through channels using the slider on the left +% of the activity plot. Command line equivalent: 'dispchans' +% "Settings > Channel labels > ..." - [menu] Use numbers as channel labels or load +% a channel location file from disk. If called from the eeglab() menu or +% pop_eegplot(), the channel labels of the dataset will be used. +% Command line equivalent: 'eloc_file' +% "Settings > Zoom on/off" - [menu] Toggle Matlab figure zoom on or off for time and +% electrode axes. left-click to zoom (x2); right-click to reverse-zoom. +% Else, draw a rectange in the activity window to zoom the display into +% that region. NOTE: When zoom is on, data cannot be marked for rejection. +% "Settings > Events" - [menu] Toggle event on or off (assuming events have been +% given as input). Press "legend" to pop up a legend window for events. +% +% Display window interface: +% "Activity plot" - [main window] This axis displays the channel activities. For +% continuous data, the time axis shows time in seconds. For epoched +% data, the axis label indicate time within each epoch. +% "Cancel" - [button] Closes the window and cancels any data rejection marks. +% "Event types" - [button] pop up a legend window for events. +% "<<" - [button] Scroll backwards though time or epochs by one window length. +% "<" - [button] Scroll backwards though time or epochs by 0.2 window length. +% "Navigation edit box" - [edit box] Enter a starting time or epoch to jump to. +% ">" - [button] Scroll forward though time or epochs by 0.2 window length. +% ">>" - [button] Scroll forward though time or epochs by one window length. +% "Chan/Time/Value" - [text] If the mouse is within the activity window, indicates +% which channel, time, and activity value the cursor is closest to. +% "Scale edit box" - [edit box] Scales the displayed amplitude in activity units. +% Command line equivalent: 'spacing' +% "+ / -" - [buttons] Use these buttons to +/- the amplitude scale by 10%. +% "Reject" - [button] When pressed, save rejection marks and close the figure. +% Optional input parameter 'command' is evaluated at that time. +% NOTE: This button's label can be redefined from the command line +% (see 'butlabel' below). If no processing command is specified +% for the 'command' parameter (below), this button does not appear. +% "Stack/Spread" - [button] "Stack" collapses all channels/activations onto the +% middle axis of the plot. "Spread" undoes the operation. +% "Norm/Denorm" - [button] "Norm" normalizes each channel separately such that all +% channels have the same standard deviation without changing original +% data/activations under EEG structure. "Denorm" undoes the operation. +% +% Required command line input: +% data - Input data matrix, either continuous 2-D (channels,timepoints) or +% epoched 3-D (channels,timepoints,epochs). If the data is preceded +% by keyword 'noui', GUI control elements are omitted (useful for +% plotting data for presentation). A set of power spectra at +% each channel may also be plotted (see 'freqlimits' below). +% Optional command line keywords: +% 'srate' - Sampling rate in Hz {default|0: 256 Hz} +% 'spacing' - Display range per channel (default|0: max(whole_data)-min(whole_data)) +% 'eloc_file' - Electrode filename (as in >> topoplot example) to read +% ascii channel labels. Else, +% [vector of integers] -> Show specified channel numbers. Else, +% [] -> Do not show channel labels {default|0 -> Show [1:nchans]} +% 'limits' - [start end] Time limits for data epochs in ms (for labeling +% purposes only). +% 'freqs' - Vector of frequencies (If data contain spectral values). +% size(data, 2) must be equal to size(freqs,2). +% *** This option must be used ALWAYS with 'freqlimits' *** +% 'freqlimits' - [freq_start freq_end] If plotting epoch spectra instead of data, frequency +% limits to display spectrum. (Data should contain spectral values). +% *** This option must be used ALWAYS with 'freqs' *** +% 'winlength' - [value] Seconds (or epochs) of data to display in window {default: 5} +% 'dispchans' - [integer] Number of channels to display in the activity window +% {default: from data}. If < total number of channels, a vertical +% slider on the left side of the figure allows vertical data scrolling. +% 'title' - Figure title {default: none} +% 'xgrid' - ['on'|'off'] Toggle display of the x-axis grid {default: 'off'} +% 'ygrid' - ['on'|'off'] Toggle display of the y-axis grid {default: 'off'} +% 'ploteventdur' - ['on'|'off'] Toggle display of event duration { default: 'off' } +% 'data2' - [float array] identical size to the original data and +% plotted on top of it. +% +% Additional keywords: +% 'command' - ['string'] Matlab command to evaluate when the 'REJECT' button is +% clicked. The 'REJECT' button is visible only if this parameter is +% not empty. As explained in the "Output" section below, the variable +% 'TMPREJ' contains the rejected windows (see the functions +% eegplot2event() and eegplot2trial()). +% 'butlabel' - Reject button label. {default: 'REJECT'} +% 'winrej' - [start end R G B e1 e2 e3 ...] Matrix giving data periods to mark +% for rejection, each row indicating a different period +% [start end] = period limits (in frames from beginning of data); +% [R G B] = specifies the marking color; +% [e1 e2 e3 ...] = a (1,nchans) logical [0|1] vector giving +% channels (1) to mark and (0) not mark for rejection. +% 'color' - ['on'|'off'|cell array] Plot channels with different colors. +% If an RGB cell array {'r' 'b' 'g'}, channels will be plotted +% using the cell-array color elements in cyclic order {default:'off'}. +% 'wincolor' - [color] Color to use to mark data stretches or epochs {default: +% [ 0.7 1 0.9] is the default marking color} +% 'events' - [struct] EEGLAB event structure (EEG.event) to use to show events. +% 'submean' - ['on'|'off'] Remove channel means in each window {default: 'on'} +% 'position' - [lowleft_x lowleft_y width height] Position of the figure in pixels. +% 'tag' - [string] Matlab object tag to identify this eegplot() window (allows +% keeping track of several simultaneous eegplot() windows). +% 'children' - [integer] Figure handle of a *dependent* eegplot() window. Scrolling +% horizontally in the master window will produce the same scroll in +% the dependent window. Allows comparison of two concurrent datasets, +% or of channel and component data from the same dataset. +% 'scale' - ['on'|'off'] Display the amplitude scale {default: 'on'}. +% 'mocap' - ['on'|'off'] Display motion capture data in a separate figure. +% To run, select an EEG data period in the scolling display using +% the mouse. Motion capture (mocap) data should be +% under EEG.moredata.mocap.markerPosition in xs, ys and zs fields which are +% (number of markers, number of time points) arrays. +% {default: 'off'}. +% 'selectcommand' - [cell array] list of 3 commands (strings) to run when the mouse +% button is down, when it is moving and when the mouse button is up. +% 'ctrlselectcommand' - [cell array] same as above in conjunction with pressing the +% CTRL key. +% Outputs: +% TMPREJ - Matrix (same format as 'winrej' above) placed as a variable in +% the global workspace (only) when the REJECT button is clicked. +% The command specified in the 'command' keyword argument can use +% this variable. (See eegplot2trial() and eegplot2event()). +% +% Author: Arnaud Delorme & Colin Humphries, CNL/Salk Institute, SCCN/INC/UCSD, 1998-2001 +% +% See also: eeg_multieegplot(), eegplot2event(), eegplot2trial(), eeglab() + +% deprecated +% 'colmodif' - nested cell array of window colors that may be marked/unmarked. Default +% is current color only. + +% Copyright (C) 2001 Arnaud Delorme & Colin Humphries, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Note for programmers - Internal variable structure: +% All in g. except for Eposition and Eg.spacingwhich are inside the boxes +% gcf +% 1 - winlength +% 2 - srate +% 3 - children +% 'backeeg' axis +% 1 - trialtag +% 2 - g.winrej +% 3 - nested call flag +% 'eegaxis' +% 1 - data +% 2 - colorlist +% 3 - submean % on or off, subtract the mean +% 4 - maxfreq % empty [] if no gfrequency content +% 'buttons hold other informations' Eposition for instance hold the current postition + +function [outvar1] = eegplot(data, varargin); % p1,p2,p3,p4,p5,p6,p7,p8,p9) + +% Defaults (can be re-defined): + +DEFAULT_PLOT_COLOR = { [0 0 1], [0.7 0.7 0.7]}; % EEG line color +try, icadefs; + DEFAULT_FIG_COLOR = BACKCOLOR; + BUTTON_COLOR = GUIBUTTONCOLOR; +catch + DEFAULT_FIG_COLOR = [1 1 1]; + BUTTON_COLOR =[0.8 0.8 0.8]; +end; +DEFAULT_AXIS_COLOR = 'k'; % X-axis, Y-axis Color, text Color +DEFAULT_GRID_SPACING = 1; % Grid lines every n seconds +DEFAULT_GRID_STYLE = '-'; % Grid line style +YAXIS_NEG = 'off'; % 'off' = positive up +DEFAULT_NOUI_PLOT_COLOR = 'k'; % EEG line color for noui option + % 0 - 1st color in AxesColorOrder +SPACING_EYE = 'on'; % g.spacingI on/off +SPACING_UNITS_STRING = ''; % '\muV' for microvolt optional units for g.spacingI Ex. uV +%MAXEVENTSTRING = 10; +%DEFAULT_AXES_POSITION = [0.0964286 0.15 0.842 0.75-(MAXEVENTSTRING-5)/100]; + % dimensions of main EEG axes +ORIGINAL_POSITION = [50 50 800 500]; + +if nargin < 1 + help eegplot + return +end + +% %%%%%%%%%%%%%%%%%%%%%%%% +% Setup inputs +% %%%%%%%%%%%%%%%%%%%%%%%% + +if ~isstr(data) % If NOT a 'noui' call or a callback from uicontrols + + try + options = varargin; + if ~isempty( varargin ), + for i = 1:2:numel(options) + g.(options{i}) = options{i+1}; + end + else g= []; end; + catch + disp('eegplot() error: calling convention {''key'', value, ... } error'); return; + end; + + % Selection of data range If spectrum plot (Ramon) + + if isfield(g,'freqlimits') || isfield(g,'freqs') +% % Check consistency of freqlimits +% % Check consistency of freqs + + % Selecting data and freqs + [temp, fBeg] = min(abs(g.freqs-g.freqlimits(1))); + [temp, fEnd] = min(abs(g.freqs-g.freqlimits(2))); + data = data(:,fBeg:fEnd); + g.freqs = g.freqs(fBeg:fEnd); + + % Updating settings + g.winlength = g.freqs(end) - g.freqs(1); + g.srate = length(g.freqs)/(g.freqs(end)-g.freqs(1)); + g.isfreq = 1; + end + + % push button: create/remove window + % --------------------------------- + defdowncom = 'eegplot(''defdowncom'', gcbf);'; % push button: create/remove window + defmotioncom = 'eegplot(''defmotioncom'', gcbf);'; % motion button: move windows or display current position + defupcom = 'eegplot(''defupcom'', gcbf);'; + defctrldowncom = 'eegplot(''topoplot'', gcbf);'; % CTRL press and motion -> do nothing by default + defctrlmotioncom = ''; % CTRL press and motion -> do nothing by default + defctrlupcom = ''; % CTRL press and up -> do nothing by default + + try, g.srate; catch, g.srate = 256; end; + try, g.spacing; catch, g.spacing = 0; end; + try, g.eloc_file; catch, g.eloc_file = 0; end; % 0 mean numbered + try, g.winlength; catch, g.winlength = 5; end; % Number of seconds of EEG displayed + try, g.position; catch, g.position = ORIGINAL_POSITION; end; + try, g.title; catch, g.title = ['Scroll activity -- eegplot()']; end; + try, g.trialstag; catch, g.trialstag = -1; end; + try, g.winrej; catch, g.winrej = []; end; + try, g.command; catch, g.command = ''; end; + try, g.tag; catch, g.tag = 'EEGPLOT'; end; + try, g.xgrid; catch, g.xgrid = 'off'; end; + try, g.ygrid; catch, g.ygrid = 'off'; end; + try, g.color; catch, g.color = 'off'; end; + try, g.submean; catch, g.submean = 'off'; end; + try, g.children; catch, g.children = 0; end; + try, g.limits; catch, g.limits = [0 1000*(size(data,2)-1)/g.srate]; end; + try, g.freqs; catch, g.freqs = []; end; % Ramon + try, g.freqlimits; catch, g.freqlimits = []; end; + try, g.dispchans; catch, g.dispchans = size(data,1); end; + try, g.wincolor; catch, g.wincolor = [ 0.7 1 0.9]; end; + try, g.butlabel; catch, g.butlabel = 'REJECT'; end; + try, g.colmodif; catch, g.colmodif = { g.wincolor }; end; + try, g.scale; catch, g.scale = 'on'; end; + try, g.events; catch, g.events = []; end; + try, g.ploteventdur; catch, g.ploteventdur = 'off'; end; + try, g.data2; catch, g.data2 = []; end; + try, g.plotdata2; catch, g.plotdata2 = 'off'; end; + try, g.mocap; catch, g.mocap = 'off'; end; % nima + try, g.selectcommand; catch, g.selectcommand = { defdowncom defmotioncom defupcom }; end; + try, g.ctrlselectcommand; catch, g.ctrlselectcommand = { defctrldowncom defctrlmotioncom defctrlupcom }; end; + try, g.datastd; catch, g.datastd = []; end; %ozgur + try, g.normed; catch, g.normed = 0; end; %ozgur + try, g.envelope; catch, g.envelope = 0; end;%ozgur + try, g.maxeventstring; catch, g.maxeventstring = 10; end; % JavierLC + try, g.isfreq; catch, g.isfreq = 0; end; % Ramon + + if strcmpi(g.ploteventdur, 'on'), g.ploteventdur = 1; else g.ploteventdur = 0; end; + if ndims(data) > 2 + g.trialstag = size( data, 2); + end; + + gfields = fieldnames(g); + for index=1:length(gfields) + switch gfields{index} + case {'spacing', 'srate' 'eloc_file' 'winlength' 'position' 'title' ... + 'trialstag' 'winrej' 'command' 'tag' 'xgrid' 'ygrid' 'color' 'colmodif'... + 'freqs' 'freqlimits' 'submean' 'children' 'limits' 'dispchans' 'wincolor' ... + 'maxeventstring' 'ploteventdur' 'butlabel' 'scale' 'events' 'data2' 'plotdata2' 'mocap' 'selectcommand' 'ctrlselectcommand' 'datastd' 'normed' 'envelope' 'isfreq'},; + otherwise, error(['eegplot: unrecognized option: ''' gfields{index} '''' ]); + end; + end; + + % g.data=data; % never used and slows down display dramatically - Ozgur 2010 + + if length(g.srate) > 1 + disp('Error: srate must be a single number'); return; + end; + if length(g.spacing) > 1 + disp('Error: ''spacing'' must be a single number'); return; + end; + if length(g.winlength) > 1 + disp('Error: winlength must be a single number'); return; + end; + if isstr(g.title) > 1 + disp('Error: title must be is a string'); return; + end; + if isstr(g.command) > 1 + disp('Error: command must be is a string'); return; + end; + if isstr(g.tag) > 1 + disp('Error: tag must be is a string'); return; + end; + if length(g.position) ~= 4 + disp('Error: position must be is a 4 elements array'); return; + end; + switch lower(g.xgrid) + case { 'on', 'off' },; + otherwise disp('Error: xgrid must be either ''on'' or ''off'''); return; + end; + switch lower(g.ygrid) + case { 'on', 'off' },; + otherwise disp('Error: ygrid must be either ''on'' or ''off'''); return; + end; + switch lower(g.submean) + case { 'on' 'off' }; + otherwise disp('Error: submean must be either ''on'' or ''off'''); return; + end; + switch lower(g.scale) + case { 'on' 'off' }; + otherwise disp('Error: scale must be either ''on'' or ''off'''); return; + end; + + if ~iscell(g.color) + switch lower(g.color) + case 'on', g.color = { 'k', 'm', 'c', 'b', 'g' }; + case 'off', g.color = { [ 0 0 0.4] }; + otherwise + disp('Error: color must be either ''on'' or ''off'' or a cell array'); + return; + end; + end; + if length(g.dispchans) > size(data,1) + g.dispchans = size(data,1); + end; + if ~iscell(g.colmodif) + g.colmodif = { g.colmodif }; + end; + if g.maxeventstring>20 % JavierLC + disp('Error: maxeventstring must be equal or lesser than 20'); return; + end; + + % max event string; JavierLC + % --------------------------------- + MAXEVENTSTRING = g.maxeventstring; + DEFAULT_AXES_POSITION = [0.0964286 0.15 0.842 0.75-(MAXEVENTSTRING-5)/100]; + + % convert color to modify into array of float + % ------------------------------------------- + for index = 1:length(g.colmodif) + if iscell(g.colmodif{index}) + tmpcolmodif{index} = g.colmodif{index}{1} ... + + g.colmodif{index}{2}*10 ... + + g.colmodif{index}{3}*100; + else + tmpcolmodif{index} = g.colmodif{index}(1) ... + + g.colmodif{index}(2)*10 ... + + g.colmodif{index}(3)*100; + end; + end; + g.colmodif = tmpcolmodif; + + [g.chans,g.frames, tmpnb] = size(data); + g.frames = g.frames*tmpnb; + + if g.spacing == 0 + maxindex = min(1000, g.frames); + stds = std(data(:,1:maxindex),[],2); + g.datastd = stds; + stds = sort(stds); + if length(stds) > 2 + stds = mean(stds(2:end-1)); + else + stds = mean(stds); + end; + g.spacing = stds*3; + if g.spacing > 10 + g.spacing = round(g.spacing); + end + if g.spacing == 0 | isnan(g.spacing) + g.spacing = 1; % default + end; + end + + % set defaults + % ------------ + g.incallback = 0; + g.winstatus = 1; + g.setelectrode = 0; + [g.chans,g.frames,tmpnb] = size(data); + g.frames = g.frames*tmpnb; + g.nbdat = 1; % deprecated + g.time = 0; + g.elecoffset = 0; + + % %%%%%%%%%%%%%%%%%%%%%%%% + % Prepare figure and axes + % %%%%%%%%%%%%%%%%%%%%%%%% + + figh = figure('UserData', g,... % store the settings here + 'Color',DEFAULT_FIG_COLOR, 'name', g.title,... + 'MenuBar','none','tag', g.tag ,'Position',g.position, ... + 'numbertitle', 'off', 'visible', 'off'); + + pos = get(figh,'position'); % plot relative to current axes + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]./100; + clf; + + % Background axis + % --------------- + ax0 = axes('tag','backeeg','parent',figh,... + 'Position',DEFAULT_AXES_POSITION,... + 'Box','off','xgrid','off', 'xaxislocation', 'top'); + + % Drawing axis + % --------------- + YLabels = num2str((1:g.chans)'); % Use numbers as default + YLabels = flipud(str2mat(YLabels,' ')); + ax1 = axes('Position',DEFAULT_AXES_POSITION,... + 'userdata', data, ...% store the data here + 'tag','eegaxis','parent',figh,...%(when in g, slow down display) + 'Box','on','xgrid', g.xgrid,'ygrid', g.ygrid,... + 'gridlinestyle',DEFAULT_GRID_STYLE,... + 'Xlim',[0 g.winlength*g.srate],... + 'xtick',[0:g.srate*DEFAULT_GRID_SPACING:g.winlength*g.srate],... + 'Ylim',[0 (g.chans+1)*g.spacing],... + 'YTick',[0:g.spacing:g.chans*g.spacing],... + 'YTickLabel', YLabels,... + 'XTickLabel',num2str((0:DEFAULT_GRID_SPACING:g.winlength)'),... + 'TickLength',[.005 .005],... + 'Color','none',... + 'XColor',DEFAULT_AXIS_COLOR,... + 'YColor',DEFAULT_AXIS_COLOR); + + if isstr(g.eloc_file) | isstruct(g.eloc_file) % Read in electrode names + if isstruct(g.eloc_file) & length(g.eloc_file) > size(data,1) + g.eloc_file(end) = []; % common reference channel location + end; + eegplot('setelect', g.eloc_file, ax1); + end; + + % %%%%%%%%%%%%%%%%%%%%%%%%% + % Set up uicontrols + % %%%%%%%%%%%%%%%%%%%%%%%%% + +% positions of buttons + posbut(1,:) = [ 0.0464 0.0254 0.0385 0.0339 ]; % << + posbut(2,:) = [ 0.0924 0.0254 0.0288 0.0339 ]; % < + posbut(3,:) = [ 0.1924 0.0254 0.0299 0.0339 ]; % > + posbut(4,:) = [ 0.2297 0.0254 0.0385 0.0339 ]; % >> + posbut(5,:) = [ 0.1287 0.0203 0.0561 0.0390 ]; % Eposition + posbut(6,:) = [ 0.4744 0.0236 0.0582 0.0390 ]; % Espacing + posbut(7,:) = [ 0.2762 0.01 0.0582 0.0390 ]; % elec + posbut(8,:) = [ 0.3256 0.01 0.0707 0.0390 ]; % g.time + posbut(9,:) = [ 0.4006 0.01 0.0582 0.0390 ]; % value + posbut(14,:) = [ 0.2762 0.05 0.0582 0.0390 ]; % elec tag + posbut(15,:) = [ 0.3256 0.05 0.0707 0.0390 ]; % g.time tag + posbut(16,:) = [ 0.4006 0.05 0.0582 0.0390 ]; % value tag + posbut(10,:) = [ 0.5437 0.0458 0.0275 0.0270 ]; % + + posbut(11,:) = [ 0.5437 0.0134 0.0275 0.0270 ]; % - + posbut(12,:) = [ 0.6 0.02 0.14 0.05 ]; % cancel + posbut(13,:) = [-0.15 0.02 0.07 0.05 ]; % cancel + posbut(17,:) = [-0.06 0.02 0.09 0.05 ]; % events types + posbut(20,:) = [-0.17 0.15 0.015 0.8 ]; % slider + posbut(21,:) = [0.738 0.87 0.06 0.048];%normalize + posbut(22,:) = [0.738 0.93 0.06 0.048];%stack channels(same offset) + posbut(:,1) = posbut(:,1)+0.2; + +% Five move buttons: << < text > >> + + u(1) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position', posbut(1,:), ... + 'Tag','Pushbutton1',... + 'string','<<',... + 'Callback',['global in_callback;', ... + 'if isempty(in_callback);in_callback=1;', ... + ' try eegplot(''drawp'',1);', ... + ' clear global in_callback;', ... + ' catch error_struct;', ... + ' clear global in_callback;', ... + ' throw(error_struct);', ... + ' end;', ... + 'else;return;end;']);%James Desjardins 2013/Jan/22 + u(2) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position', posbut(2,:), ... + 'Tag','Pushbutton2',... + 'string','<',... + 'Callback',['global in_callback;', ... + 'if isempty(in_callback);in_callback=1;', ... + ' try eegplot(''drawp'',2);', ... + ' clear global in_callback;', ... + ' catch error_struct;', ... + ' clear global in_callback;', ... + ' throw(error_struct);', ... + ' end;', ... + 'else;return;end;']);%James Desjardins 2013/Jan/22 + u(5) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',[1 1 1], ... + 'Position', posbut(5,:), ... + 'Style','edit', ... + 'Tag','EPosition',... + 'string', fastif(g.trialstag(1) == -1, '0', '1'),... + 'Callback', 'eegplot(''drawp'',0);' ); + u(3) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(3,:), ... + 'Tag','Pushbutton3',... + 'string','>',... + 'Callback',['global in_callback;', ... + 'if isempty(in_callback);in_callback=1;', ... + ' try eegplot(''drawp'',3);', ... + ' clear global in_callback;', ... + ' catch error_struct;', ... + ' clear global in_callback;', ... + ' throw(error_struct);', ... + ' end;', ... + 'else;return;end;']);%James Desjardins 2013/Jan/22 + u(4) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(4,:), ... + 'Tag','Pushbutton4',... + 'string','>>',... + 'Callback',['global in_callback;', ... + 'if isempty(in_callback);in_callback=1;', ... + ' try eegplot(''drawp'',4);', ... + ' clear global in_callback;', ... + ' catch error_struct;', ... + ' clear global in_callback;', ... + ' error(error_struct);', ... + ' end;', ... + 'else;return;end;']);%James Desjardins 2013/Jan/22 + +% Text edit fields: ESpacing + + u(6) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',[1 1 1], ... + 'Position', posbut(6,:), ... + 'Style','edit', ... + 'Tag','ESpacing',... + 'string',num2str(g.spacing),... + 'Callback', 'eegplot(''draws'',0);' ); + +% Slider for vertical motion + u(20) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position', posbut(20,:), ... + 'Style','slider', ... + 'visible', 'off', ... + 'sliderstep', [0.9 1], ... + 'Tag','eegslider', ... + 'callback', [ 'tmpg = get(gcbf, ''userdata'');' ... + 'tmpg.elecoffset = get(gcbo, ''value'')*(tmpg.chans-tmpg.dispchans);' ... + 'set(gcbf, ''userdata'', tmpg);' ... + 'eegplot(''drawp'',0);' ... + 'clear tmpg;' ], ... + 'value', 0); + +% Channels, position, value and tag + + u(9) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',DEFAULT_FIG_COLOR, ... + 'Position', posbut(7,:), ... + 'Style','text', ... + 'Tag','Eelec',... + 'string',' '); + u(10) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',DEFAULT_FIG_COLOR, ... + 'Position', posbut(8,:), ... + 'Style','text', ... + 'Tag','Etime',... + 'string','0.00'); + u(11) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',DEFAULT_FIG_COLOR, ... + 'Position',posbut(9,:), ... + 'Style','text', ... + 'Tag','Evalue',... + 'string','0.00'); + + u(14)= uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',DEFAULT_FIG_COLOR, ... + 'Position', posbut(14,:), ... + 'Style','text', ... + 'Tag','Eelecname',... + 'string','Chan.'); + +% Values of time/value and freq/power in GUI + if g.isfreq + u15_string = 'Freq'; + u16_string = 'Power'; + else + u15_string = 'Time'; + u16_string = 'Value'; + end + + u(15) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',DEFAULT_FIG_COLOR, ... + 'Position', posbut(15,:), ... + 'Style','text', ... + 'Tag','Etimename',... + 'string',u15_string); + + u(16) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'BackgroundColor',DEFAULT_FIG_COLOR, ... + 'Position',posbut(16,:), ... + 'Style','text', ... + 'Tag','Evaluename',... + 'string',u16_string); + +% ESpacing buttons: + - + u(7) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(10,:), ... + 'Tag','Pushbutton5',... + 'string','+',... + 'FontSize',8,... + 'Callback','eegplot(''draws'',1)'); + u(8) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(11,:), ... + 'Tag','Pushbutton6',... + 'string','-',... + 'FontSize',8,... + 'Callback','eegplot(''draws'',2)'); + + cb_normalize = ['g = get(gcbf,''userdata'');if g.normed, disp(''Denormalizing...''); else, disp(''Normalizing...''); end;'... + 'hmenu = findobj(gcf, ''Tag'', ''Normalize_menu'');' ... + 'ax1 = findobj(''tag'',''eegaxis'',''parent'',gcbf);' ... + 'data = get(ax1,''UserData'');' ... + 'if isempty(g.datastd), g.datastd = std(data(:,1:min(1000,g.frames),[],2)); end;'... + 'if g.normed, '... + 'for i = 1:size(data,1), '... + 'data(i,:,:) = data(i,:,:)*g.datastd(i);'... + 'if ~isempty(g.data2), g.data2(i,:,:) = g.data2(i,:,:)*g.datastd(i);end;'... + 'end;'... + 'set(gcbo,''string'', ''Norm'');set(findobj(''tag'',''ESpacing'',''parent'',gcbf),''string'',num2str(g.oldspacing));' ... + 'else, for i = 1:size(data,1),'... + 'data(i,:,:) = data(i,:,:)/g.datastd(i);'... + 'if ~isempty(g.data2), g.data2(i,:,:) = g.data2(i,:,:)/g.datastd(i);end;'... + 'end;'... + 'set(gcbo,''string'', ''Denorm'');g.oldspacing = g.spacing;set(findobj(''tag'',''ESpacing'',''parent'',gcbf),''string'',''5'');end;' ... + 'g.normed = 1 - g.normed;' ... + 'eegplot(''draws'',0);'... + 'set(hmenu, ''Label'', fastif(g.normed,''Denormalize channels'',''Normalize channels''));' ... + 'set(gcbf,''userdata'',g);set(ax1,''UserData'',data);clear ax1 g data;' ... + 'eegplot(''drawp'',0);' ... + 'disp(''Done.'')']; +% Button for Normalizing data +u(21) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(21,:), ... + 'Tag','Norm',... + 'string','Norm', 'callback', cb_normalize); + +cb_envelope = ['g = get(gcbf,''userdata'');'... + 'hmenu = findobj(gcf, ''Tag'', ''Envelope_menu'');' ... + 'g.envelope = ~g.envelope;' ... + 'set(gcbf,''userdata'',g);'... + 'set(gcbo,''string'',fastif(g.envelope,''Spread'',''Stack''));' ... + 'set(hmenu, ''Label'', fastif(g.envelope,''Spread channels'',''Stack channels''));' ... + 'eegplot(''drawp'',0);clear g;']; + +% Button to plot envelope of data +u(22) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(22,:), ... + 'Tag','Envelope',... + 'string','Stack', 'callback', cb_envelope); + + + if isempty(g.command) tmpcom = 'fprintf(''Rejections saved in variable TMPREJ\n'');'; + else tmpcom = g.command; + end; + acceptcommand = [ 'g = get(gcbf, ''userdata'');' ... + 'TMPREJ = g.winrej;' ... + 'if g.children, delete(g.children); end;' ... + 'delete(gcbf);' ... + tmpcom ... + '; clear g;']; % quitting expression + if ~isempty(g.command) + u(12) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(12,:), ... + 'Tag','Accept',... + 'string',g.butlabel, 'callback', acceptcommand); + end; + u(13) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(13,:), ... + 'string',fastif(isempty(g.command),'CLOSE', 'CANCEL'), 'callback', ... + [ 'g = get(gcbf, ''userdata'');' ... + 'if g.children, delete(g.children); end;' ... + 'close(gcbf);'] ); + + if ~isempty(g.events) + u(17) = uicontrol('Parent',figh, ... + 'Units', 'normalized', ... + 'Position',posbut(17,:), ... + 'string', 'Event types', 'callback', 'eegplot(''drawlegend'', gcbf)'); + end; + + for i = 1: length(u) % Matlab 2014b compatibility + if isprop(eval(['u(' num2str(i) ')']),'Style') + set(u(i),'Units','Normalized'); + end + end + + % %%%%%%%%%%%%%%%%%%%%%%%%%%% + % Set up uimenus + % %%%%%%%%%%%%%%%%%%%%%%%%%%% + + % Figure Menu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + m(7) = uimenu('Parent',figh,'Label','Figure'); + m(8) = uimenu('Parent',m(7),'Label','Print'); + uimenu('Parent',m(7),'Label','Edit figure', 'Callback', 'eegplot(''noui'');'); + uimenu('Parent',m(7),'Label','Accept and close', 'Callback', acceptcommand ); + uimenu('Parent',m(7),'Label','Cancel and close', 'Callback','delete(gcbf)') + + % Portrait %%%%%%%% + + timestring = ['[OBJ1,FIG1] = gcbo;',... + 'PANT1 = get(OBJ1,''parent'');',... + 'OBJ2 = findobj(''tag'',''orient'',''parent'',PANT1);',... + 'set(OBJ2,''checked'',''off'');',... + 'set(OBJ1,''checked'',''on'');',... + 'set(FIG1,''PaperOrientation'',''portrait'');',... + 'clear OBJ1 FIG1 OBJ2 PANT1;']; + + uimenu('Parent',m(8),'Label','Portrait','checked',... + 'on','tag','orient','callback',timestring) + + % Landscape %%%%%%% + timestring = ['[OBJ1,FIG1] = gcbo;',... + 'PANT1 = get(OBJ1,''parent'');',... + 'OBJ2 = findobj(''tag'',''orient'',''parent'',PANT1);',... + 'set(OBJ2,''checked'',''off'');',... + 'set(OBJ1,''checked'',''on'');',... + 'set(FIG1,''PaperOrientation'',''landscape'');',... + 'clear OBJ1 FIG1 OBJ2 PANT1;']; + + uimenu('Parent',m(8),'Label','Landscape','checked',... + 'off','tag','orient','callback',timestring) + + % Print command %%%%%%% + uimenu('Parent',m(8),'Label','Print','tag','printcommand','callback',... + ['RESULT = inputdlg2( { ''Command:'' }, ''Print'', 1, { ''print -r72'' });' ... + 'if size( RESULT,1 ) ~= 0' ... + ' eval ( RESULT{1} );' ... + 'end;' ... + 'clear RESULT;' ]); + + % Display Menu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + m(1) = uimenu('Parent',figh,... + 'Label','Display', 'tag', 'displaymenu'); + + % window grid %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % userdata = 4 cells : display yes/no, color, electrode yes/no, + % trial boundary adapt yes/no (1/0) + m(11) = uimenu('Parent',m(1),'Label','Data select/mark', 'tag', 'displaywin', ... + 'userdata', { 1, [0.8 1 0.8], 0, fastif( g.trialstag(1) == -1, 0, 1)}); + + uimenu('Parent',m(11),'Label','Hide marks','Callback', ... + ['g = get(gcbf, ''userdata'');' ... + 'if ~g.winstatus' ... + ' set(gcbo, ''label'', ''Hide marks'');' ... + 'else' ... + ' set(gcbo, ''label'', ''Show marks'');' ... + 'end;' ... + 'g.winstatus = ~g.winstatus;' ... + 'set(gcbf, ''userdata'', g);' ... + 'eegplot(''drawb''); clear g;'] ) + + % color %%%%%%%%%%%%%%%%%%%%%%%%%% + if isunix % for some reasons, does not work under Windows + uimenu('Parent',m(11),'Label','Choose color', 'Callback', ... + [ 'g = get(gcbf, ''userdata'');' ... + 'g.wincolor = uisetcolor(g.wincolor);' ... + 'set(gcbf, ''userdata'', g ); ' ... + 'clear g;'] ) + end; + + % set channels + %uimenu('Parent',m(11),'Label','Mark channels', 'enable', 'off', ... + %'checked', 'off', 'Callback', ... + %['g = get(gcbf, ''userdata'');' ... + % 'g.setelectrode = ~g.setelectrode;' ... + % 'set(gcbf, ''userdata'', g); ' ... + % 'if ~g.setelectrode setgcbo, ''checked'', ''on''); ... + % else set(gcbo, ''checked'', ''off''); end;'... + % ' clear g;'] ) + + % trials boundaries + %uimenu('Parent',m(11),'Label','Trial boundaries', 'checked', fastif( g.trialstag(1) == -1, 'off', 'on'), 'Callback', ... + %['hh = findobj(''tag'',''displaywin'',''parent'', findobj(''tag'',''displaymenu'',''parent'', gcbf ));' ... + % 'hhdat = get(hh, ''userdata'');' ... + % 'set(hh, ''userdata'', { hhdat{1}, hhdat{2}, hhdat{3}, ~hhdat{4}} ); ' ... + %'if ~hhdat{4} set(gcbo, ''checked'', ''on''); else set(gcbo, ''checked'', ''off''); end;' ... + %' clear hh hhdat;'] ) + + % plot durations + % -------------- + if g.ploteventdur & isfield(g.events, 'duration') + disp(['Use menu "Display > Hide event duration" to hide colored regions ' ... + 'representing event duration']); + end; + if isfield(g.events, 'duration') + uimenu('Parent',m(1),'Label',fastif(g.ploteventdur, 'Hide event duration', 'Plot event duration'),'Callback', ... + ['g = get(gcbf, ''userdata'');' ... + 'if ~g.ploteventdur' ... + ' set(gcbo, ''label'', ''Hide event duration'');' ... + 'else' ... + ' set(gcbo, ''label'', ''Show event duration'');' ... + 'end;' ... + 'g.ploteventdur = ~g.ploteventdur;' ... + 'set(gcbf, ''userdata'', g);' ... + 'eegplot(''drawb''); clear g;'] ) + end; + + % X grid %%%%%%%%%%%% + m(3) = uimenu('Parent',m(1),'Label','Grid'); + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'if size(get(AXESH,''xgrid''),2) == 2' ... %on + ' set(AXESH,''xgrid'',''off'');',... + ' set(gcbo,''label'',''X grid on'');',... + 'else' ... + ' set(AXESH,''xgrid'',''on'');',... + ' set(gcbo,''label'',''X grid off'');',... + 'end;' ... + 'clear FIGH AXESH;' ]; + uimenu('Parent',m(3),'Label',fastif(strcmp(g.xgrid, 'off'), ... + 'X grid on','X grid off'), 'Callback',timestring) + + % Y grid %%%%%%%%%%%%% + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'if size(get(AXESH,''ygrid''),2) == 2' ... %on + ' set(AXESH,''ygrid'',''off'');',... + ' set(gcbo,''label'',''Y grid on'');',... + 'else' ... + ' set(AXESH,''ygrid'',''on'');',... + ' set(gcbo,''label'',''Y grid off'');',... + 'end;' ... + 'clear FIGH AXESH;' ]; + uimenu('Parent',m(3),'Label',fastif(strcmp(g.ygrid, 'off'), ... + 'Y grid on','Y grid off'), 'Callback',timestring) + + % Grid Style %%%%%%%%% + m(5) = uimenu('Parent',m(3),'Label','Grid Style'); + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'',''--'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','- -','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'',''-.'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','_ .','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'','':'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','. .','Callback',timestring) + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'set(AXESH,''gridlinestyle'',''-'');',... + 'clear FIGH AXESH;']; + uimenu('Parent',m(5),'Label','__','Callback',timestring) + + % Submean menu %%%%%%%%%%%%% + cb = ['g = get(gcbf, ''userdata'');' ... + 'if strcmpi(g.submean, ''on''),' ... + ' set(gcbo, ''label'', ''Remove DC offset'');' ... + ' g.submean =''off'';' ... + 'else' ... + ' set(gcbo, ''label'', ''Do not remove DC offset'');' ... + ' g.submean =''on'';' ... + 'end;' ... + 'set(gcbf, ''userdata'', g);' ... + 'eegplot(''drawp'', 0); clear g;']; + uimenu('Parent',m(1),'Label',fastif(strcmp(g.submean, 'on'), ... + 'Do not remove DC offset','Remove DC offset'), 'Callback',cb) + + % Scale Eye %%%%%%%%% + timestring = ['[OBJ1,FIG1] = gcbo;',... + 'eegplot(''scaleeye'',OBJ1,FIG1);',... + 'clear OBJ1 FIG1;']; + m(7) = uimenu('Parent',m(1),'Label','Show scale','Callback',timestring); + + % Title %%%%%%%%%%%% + uimenu('Parent',m(1),'Label','Title','Callback','eegplot(''title'')') + + % Stack/Spread %%%%%%%%%%%%%%% + cb = ['g = get(gcbf, ''userdata'');' ... + 'hbutton = findobj(gcf, ''Tag'', ''Envelope'');' ... % find button + 'if g.envelope == 0,' ... + ' set(gcbo, ''label'', ''Spread channels'');' ... + ' g.envelope = 1;' ... + ' set(hbutton, ''String'', ''Spread'');' ... + 'else' ... + ' set(gcbo, ''label'', ''Stack channels'');' ... + ' g.envelope = 0;' ... + ' set(hbutton, ''String'', ''Stack'');' ... + 'end;' ... + 'set(gcbf, ''userdata'', g);' ... + 'eegplot(''drawp'', 0); clear g;']; + uimenu('Parent',m(1),'Label',fastif(g.envelope == 0, ... + 'Stack channels','Spread channels'), 'Callback',cb, 'Tag', 'Envelope_menu') + + % Normalize/denormalize %%%%%%%%%%%%%%% + cb_normalize = ['g = get(gcbf,''userdata'');if g.normed, disp(''Denormalizing...''); else, disp(''Normalizing...''); end;'... + 'hbutton = findobj(gcf, ''Tag'', ''Norm'');' ... % find button + 'ax1 = findobj(''tag'',''eegaxis'',''parent'',gcbf);' ... + 'data = get(ax1,''UserData'');' ... + 'if isempty(g.datastd), g.datastd = std(data(:,1:min(1000,g.frames),[],2)); end;'... + 'if g.normed, '... + ' for i = 1:size(data,1), '... + ' data(i,:,:) = data(i,:,:)*g.datastd(i);'... + ' if ~isempty(g.data2), g.data2(i,:,:) = g.data2(i,:,:)*g.datastd(i);end;'... + ' end;'... + ' set(hbutton,''string'', ''Norm'');set(findobj(''tag'',''ESpacing'',''parent'',gcbf),''string'',num2str(g.oldspacing));' ... + ' set(gcbo, ''label'', ''Normalize channels'');' ... + 'else, for i = 1:size(data,1),'... + ' data(i,:,:) = data(i,:,:)/g.datastd(i);'... + ' if ~isempty(g.data2), g.data2(i,:,:) = g.data2(i,:,:)/g.datastd(i);end;'... + ' end;'... + ' set(hbutton,''string'', ''Denorm'');'... + ' set(gcbo, ''label'', ''Denormalize channels'');' ... + ' g.oldspacing = g.spacing;set(findobj(''tag'',''ESpacing'',''parent'',gcbf),''string'',''5'');end;' ... + 'g.normed = 1 - g.normed;' ... + 'eegplot(''draws'',0);'... + 'set(gcbf,''userdata'',g);set(ax1,''UserData'',data);clear ax1 g data;' ... + 'eegplot(''drawp'',0);' ... + 'disp(''Done.'')']; + uimenu('Parent',m(1),'Label',fastif(g.envelope == 0, ... + 'Normalize channels','Denormalize channels'), 'Callback',cb_normalize, 'Tag', 'Normalize_menu') + + + % Settings Menu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + m(2) = uimenu('Parent',figh,... + 'Label','Settings'); + + % Window %%%%%%%%%%%% + uimenu('Parent',m(2),'Label','Time range to display',... + 'Callback','eegplot(''window'')') + + % Electrode window %%%%%%%% + uimenu('Parent',m(2),'Label','Number of channels to display',... + 'Callback','eegplot(''winelec'')') + + % Electrodes %%%%%%%% + m(6) = uimenu('Parent',m(2),'Label','Channel labels'); + + timestring = ['FIGH = gcbf;',... + 'AXESH = findobj(''tag'',''eegaxis'',''parent'',FIGH);',... + 'YTICK = get(AXESH,''YTick'');',... + 'YTICK = length(YTICK);',... + 'set(AXESH,''YTickLabel'',flipud(str2mat(num2str((1:YTICK-1)''),'' '')));',... + 'clear FIGH AXESH YTICK;']; + uimenu('Parent',m(6),'Label','Show number','Callback',timestring) + uimenu('Parent',m(6),'Label','Load .loc(s) file',... + 'Callback','eegplot(''loadelect'');') + + % Zooms %%%%%%%% + zm = uimenu('Parent',m(2),'Label','Zoom off/on'); + commandzoom = [ 'set(gcbf, ''windowbuttondownfcn'', [ ''zoom(gcbf,''''down''''); eegplot(''''zoom'''', gcbf, 1);'' ]);' ... + 'tmpg = get(gcbf, ''userdata'');' ... + 'set(gcbf, ''windowbuttonmotionfcn'', tmpg.commandselect{2}); clear tmpg tmpstr;']; + + %uimenu('Parent',zm,'Label','Zoom time', 'callback', ... + % [ 'zoom(gcbf, ''xon'');' commandzoom ]); + %uimenu('Parent',zm,'Label','Zoom channels', 'callback', ... + % [ 'zoom(gcbf, ''yon'');' commandzoom ]); + uimenu('Parent',zm,'Label','Zoom on', 'callback', commandzoom); + uimenu('Parent',zm,'Label','Zoom off', 'separator', 'on', 'callback', ... + ['zoom(gcbf, ''off''); tmpg = get(gcbf, ''userdata'');' ... + 'set(gcbf, ''windowbuttondownfcn'', tmpg.commandselect{1});' ... + 'set(gcbf, ''windowbuttonmotionfcn'', tmpg.commandselect{2});' ... + 'set(gcbf, ''windowbuttonupfcn'', tmpg.commandselect{3});' ... + 'clear tmpg;' ]); + uimenu('Parent',figh,'Label', 'Help', 'callback', 'pophelp(''eegplot'');'); + + % Events %%%%%%%% + zm = uimenu('Parent',m(2),'Label','Events'); + complotevent = [ 'tmpg = get(gcbf, ''userdata'');' ... + 'tmpg.plotevent = ''on'';' ... + 'set(gcbf, ''userdata'', tmpg); clear tmpg; eegplot(''drawp'', 0);']; + comnoevent = [ 'tmpg = get(gcbf, ''userdata'');' ... + 'tmpg.plotevent = ''off'';' ... + 'set(gcbf, ''userdata'', tmpg); clear tmpg; eegplot(''drawp'', 0);']; + comeventmaxstring = [ 'tmpg = get(gcbf, ''userdata'');' ... + 'tmpg.plotevent = ''on'';' ... + 'set(gcbf, ''userdata'', tmpg); clear tmpg; eegplot(''emaxstring'');']; % JavierLC + comeventleg = [ 'eegplot(''drawlegend'', gcbf);']; + + uimenu('Parent',zm,'Label','Events on' , 'callback', complotevent, 'enable', fastif(isempty(g.events), 'off', 'on')); + uimenu('Parent',zm,'Label','Events off' , 'callback', comnoevent , 'enable', fastif(isempty(g.events), 'off', 'on')); + uimenu('Parent',zm,'Label','Events'' string length' , 'callback', comeventmaxstring, 'enable', fastif(isempty(g.events), 'off', 'on')); % JavierLC + uimenu('Parent',zm,'Label','Events'' legend', 'callback', comeventleg , 'enable', fastif(isempty(g.events), 'off', 'on')); + + + % %%%%%%%%%%%%%%%%% + % Set up autoselect + % %%%%%%%%%%%%%%%%% + g.commandselect{1} = [ 'if strcmp(get(gcbf, ''SelectionType''),''alt''),' g.ctrlselectcommand{1} ... + 'else ' g.selectcommand{1} 'end;' ]; + g.commandselect{2} = [ 'if strcmp(get(gcbf, ''SelectionType''),''alt''),' g.ctrlselectcommand{2} ... + 'else ' g.selectcommand{2} 'end;' ]; + g.commandselect{3} = [ 'if strcmp(get(gcbf, ''SelectionType''),''alt''),' g.ctrlselectcommand{3} ... + 'else ' g.selectcommand{3} 'end;' ]; + + set(figh, 'windowbuttondownfcn', g.commandselect{1}); + set(figh, 'windowbuttonmotionfcn', g.commandselect{2}); + set(figh, 'windowbuttonupfcn', g.commandselect{3}); + set(figh, 'WindowKeyPressFcn', @eegplot_readkey); + set(figh, 'interruptible', 'off'); + set(figh, 'busyaction', 'cancel'); + +% set(figh, 'windowbuttondownfcn', commandpush); +% set(figh, 'windowbuttonmotionfcn', commandmove); +% set(figh, 'windowbuttonupfcn', commandrelease); +% set(figh, 'interruptible', 'off'); +% set(figh, 'busyaction', 'cancel'); + + % prepare event array if any + % -------------------------- + if ~isempty(g.events) + if ~isfield(g.events, 'type') | ~isfield(g.events, 'latency'), g.events = []; end; + end; + + if ~isempty(g.events) + if isstr(g.events(1).type) + [g.eventtypes tmpind indexcolor] = unique_bc({g.events.type}); % indexcolor countinas the event type + else [g.eventtypes tmpind indexcolor] = unique_bc([ g.events.type ]); + end; + g.eventcolors = { 'r', [0 0.8 0], 'm', 'c', 'k', 'b', [0 0.8 0] }; + g.eventstyle = { '-' '-' '-' '-' '-' '-' '-' '--' '--' '--' '--' '--' '--' '--'}; + g.eventwidths = [ 2.5 1 ]; + g.eventtypecolors = g.eventcolors(mod([1:length(g.eventtypes)]-1 ,length(g.eventcolors))+1); + g.eventcolors = g.eventcolors(mod(indexcolor-1 ,length(g.eventcolors))+1); + g.eventtypestyle = g.eventstyle (mod([1:length(g.eventtypes)]-1 ,length(g.eventstyle))+1); + g.eventstyle = g.eventstyle (mod(indexcolor-1 ,length(g.eventstyle))+1); + + % for width, only boundary events have width 2 (for the line) + % ----------------------------------------------------------- + indexwidth = ones(1,length(g.eventtypes))*2; + if iscell(g.eventtypes) + for index = 1:length(g.eventtypes) + if strcmpi(g.eventtypes{index}, 'boundary'), indexwidth(index) = 1; end; + end; + end; + g.eventtypewidths = g.eventwidths (mod(indexwidth([1:length(g.eventtypes)])-1 ,length(g.eventwidths))+1); + g.eventwidths = g.eventwidths (mod(indexwidth(indexcolor)-1 ,length(g.eventwidths))+1); + + % latency and duration of events + % ------------------------------ + g.eventlatencies = [ g.events.latency ]+1; + if isfield(g.events, 'duration') + durations = { g.events.duration }; + durations(cellfun(@isempty, durations)) = { NaN }; + g.eventlatencyend = g.eventlatencies + [durations{:}]+1; + else g.eventlatencyend = []; + end; + g.plotevent = 'on'; + end; + if isempty(g.events) + g.plotevent = 'off'; + end; + + set(figh, 'userdata', g); + + % %%%%%%%%%%%%%%%%%%%%%%%%%% + % Plot EEG Data + % %%%%%%%%%%%%%%%%%%%%%%%%%% + axes(ax1) + hold on + + % %%%%%%%%%%%%%%%%%%%%%%%%%% + % Plot Spacing I + % %%%%%%%%%%%%%%%%%%%%%%%%%% + YLim = get(ax1,'Ylim'); + A = DEFAULT_AXES_POSITION; + axes('Position',[A(1)+A(3) A(2) 1-A(1)-A(3) A(4)],'Visible','off','Ylim',YLim,'tag','eyeaxes') + axis manual + if strcmp(SPACING_EYE,'on'), set(m(7),'checked','on') + else set(m(7),'checked','off'); + end + eegplot('scaleeye', [], gcf); + if strcmp(lower(g.scale), 'off') + eegplot('scaleeye', 'off', gcf); + end; + + eegplot('drawp', 0); + eegplot('drawp', 0); + if g.dispchans ~= g.chans + eegplot('zoom', gcf); + end; + eegplot('scaleeye', [], gcf); + + h = findobj(gcf, 'style', 'pushbutton'); + set(h, 'backgroundcolor', BUTTON_COLOR); + h = findobj(gcf, 'tag', 'eegslider'); + set(h, 'backgroundcolor', BUTTON_COLOR); + set(figh, 'visible', 'on'); + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% End Main Function +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +else + try, p1 = varargin{1}; p2 = varargin{2}; p3 = varargin{3}; catch, end; + switch data + case 'drawp' % Redraw EEG and change position + + % this test help to couple eegplot windows + if exist('p3', 'var') + figh = p3; + figure(p3); + else + figh = gcf; % figure handle + end; + + if strcmp(get(figh,'tag'),'dialog') + figh = get(figh,'UserData'); + end + ax0 = findobj('tag','backeeg','parent',figh); % axes handle + ax1 = findobj('tag','eegaxis','parent',figh); % axes handle + g = get(figh,'UserData'); + data = get(ax1,'UserData'); + ESpacing = findobj('tag','ESpacing','parent',figh); % ui handle + EPosition = findobj('tag','EPosition','parent',figh); % ui handle + if ~isempty(EPosition) && ~isempty(ESpacing) + if g.trialstag(1) == -1 + g.time = str2num(get(EPosition,'string')); + else + g.time = str2num(get(EPosition,'string')); + g.time = g.time - 1; + end; + g.spacing = str2num(get(ESpacing,'string')); + end; + + if p1 == 1 + g.time = g.time-g.winlength; % << subtract one window length + elseif p1 == 2 + g.time = g.time-fastif(g.winlength>=1, 1, g.winlength/5); % < subtract one second + elseif p1 == 3 + g.time = g.time+fastif(g.winlength>=1, 1, g.winlength/5); % > add one second + elseif p1 == 4 + g.time = g.time+g.winlength; % >> add one window length + end + + if g.trialstag ~= -1 % time in second or in trials + multiplier = g.trialstag; + else + multiplier = g.srate; + end; + + % Update edit box + % --------------- + g.time = max(0,min(g.time,ceil((g.frames-1)/multiplier)-g.winlength)); + if g.trialstag(1) == -1 + set(EPosition,'string',num2str(g.time)); + else + set(EPosition,'string',num2str(g.time+1)); + end; + set(figh, 'userdata', g); + + lowlim = round(g.time*multiplier+1); + highlim = round(min((g.time+g.winlength)*multiplier+2,g.frames)); + + % Plot data and update axes + % ------------------------- + if ~isempty(g.data2) + switch lower(g.submean) % subtract the mean ? + case 'on', + meandata = mean(g.data2(:,lowlim:highlim)'); + if any(isnan(meandata)) % 6/16/104 Ramon: meandata by memdata + meandata = nan_mean(g.data2(:,lowlim:highlim)'); + end; + otherwise, meandata = zeros(1,g.chans); + end; + else + switch lower(g.submean) % subtract the mean ? + case 'on', + meandata = mean(data(:,lowlim:highlim)'); + if any(isnan(meandata)) + meandata = nan_mean(data(:,lowlim:highlim)'); + end; + otherwise, meandata = zeros(1,g.chans); + end; + end; + if strcmpi(g.plotdata2, 'off') + axes(ax1) + cla + end; + + oldspacing = g.spacing; + if g.envelope + g.spacing = 0; + end + % plot data + % --------- + axes(ax1) + hold on + + % plot channels whose "badchan" field is set to 1. + % Bad channels are plotted first so that they appear behind the good + % channels in the eegplot figure window. + for i = 1:g.chans + if strcmpi(g.plotdata2, 'on') + tmpcolor = [ 1 0 0 ]; + else tmpcolor = g.color{mod(i-1,length(g.color))+1}; + end; + + if isfield(g, 'eloc_file') & ... + isfield(g.eloc_file, 'badchan') & ... + g.eloc_file(g.chans-i+1).badchan; + tmpcolor = [ .85 .85 .85 ]; + plot(data(g.chans-i+1,lowlim:highlim) -meandata(g.chans-i+1)+i*g.spacing + (g.dispchans+1)*(oldspacing-g.spacing)/2 +g.elecoffset*(oldspacing-g.spacing), ... + 'color', tmpcolor, 'clipping','on') + plot(1,mean(data(g.chans-i+1,lowlim:highlim) -meandata(g.chans-i+1)+i*g.spacing + (g.dispchans+1)*(oldspacing-g.spacing)/2 +g.elecoffset*(oldspacing-g.spacing),2),' 2 + for tpmi = 1:size(g.winrej,1) % scan rows + if (g.winrej(tpmi,1) >= lowlim & g.winrej(tpmi,1) <= highlim) | ... + (g.winrej(tpmi,2) >= lowlim & g.winrej(tpmi,2) <= highlim) + abscmin = max(1,round(g.winrej(tpmi,1)-lowlim)); + abscmax = round(g.winrej(tpmi,2)-lowlim); + maxXlim = get(gca, 'xlim'); + abscmax = min(abscmax, round(maxXlim(2)-1)); + for i = 1:g.chans + if g.winrej(tpmi,g.chans-i+1+5) + plot(abscmin+1:abscmax+1,data(g.chans-i+1,abscmin+lowlim:abscmax+lowlim) ... + -meandata(g.chans-i+1)+i*g.spacing + (g.dispchans+1)*(oldspacing-g.spacing)/2 +g.elecoffset*(oldspacing-g.spacing), 'color','r','clipping','on') + end; + end + end; + end; + end; + g.spacing = oldspacing; + set(ax1, 'Xlim',[1 g.winlength*multiplier+1],... + 'XTick',[1:multiplier*DEFAULT_GRID_SPACING:g.winlength*multiplier+1]); + if g.isfreq % Ramon + set(ax1, 'XTickLabel', num2str((g.freqs(1):DEFAULT_GRID_SPACING:g.freqs(end))')); + else + set(ax1, 'XTickLabel', num2str((g.time:DEFAULT_GRID_SPACING:g.time+g.winlength)')); + end + + % ordinates: even if all elec are plotted, some may be hidden + set(ax1, 'ylim',[g.elecoffset*g.spacing (g.elecoffset+g.dispchans+1)*g.spacing] ); + + if g.children ~= 0 + if ~exist('p2', 'var') + p2 =[]; + end; + eegplot( 'drawp', p1, p2, g.children); + figure(figh); + end; + + % draw second data if necessary + if ~isempty(g.data2) + tmpdata = data; + set(ax1, 'userdata', g.data2); + g.data2 = []; + g.plotdata2 = 'on'; + set(figh, 'userdata', g); + eegplot('drawp', 0); + g.plotdata2 = 'off'; + g.data2 = get(ax1, 'userdata'); + set(ax1, 'userdata', tmpdata); + set(figh, 'userdata', g); + else + eegplot('drawb'); + end; + + case 'drawb' % Draw background ****************************************************** + % Redraw EEG and change position + + ax0 = findobj('tag','backeeg','parent',gcf); % axes handle + ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle + + g = get(gcf,'UserData'); % Data (Note: this could also be global) + + % Plot data and update axes + axes(ax0); + cla; + hold on; + % plot rejected windows + if g.trialstag ~= -1 + multiplier = g.trialstag; + else + multiplier = g.srate; + end; + + % draw rejection windows + % ---------------------- + lowlim = round(g.time*multiplier+1); + highlim = round(min((g.time+g.winlength)*multiplier+1)); + displaymenu = findobj('tag','displaymenu','parent',gcf); + if ~isempty(g.winrej) & g.winstatus + if g.trialstag ~= -1 % epoched data + indices = find((g.winrej(:,1)' >= lowlim & g.winrej(:,1)' <= highlim) | ... + (g.winrej(:,2)' >= lowlim & g.winrej(:,2)' <= highlim)); + if ~isempty(indices) + tmpwins1 = g.winrej(indices,1)'; + tmpwins2 = g.winrej(indices,2)'; + if size(g.winrej,2) > 2 + tmpcols = g.winrej(indices,3:5); + else tmpcols = g.wincolor; + end; + try, eval('[cumul indicescount] = histc(tmpwins1, (min(tmpwins1)-1):g.trialstag:max(tmpwins2));'); + catch, [cumul indicescount] = myhistc(tmpwins1, (min(tmpwins1)-1):g.trialstag:max(tmpwins2)); + end; + count = zeros(size(cumul)); + %if ~isempty(find(cumul > 1)), find(cumul > 1), end; + for tmpi = 1:length(tmpwins1) + poscumul = indicescount(tmpi); + heightbeg = count(poscumul)/cumul(poscumul); + heightend = heightbeg + 1/cumul(poscumul); + count(poscumul) = count(poscumul)+1; + h = patch([tmpwins1(tmpi)-lowlim tmpwins2(tmpi)-lowlim ... + tmpwins2(tmpi)-lowlim tmpwins1(tmpi)-lowlim], ... + [heightbeg heightbeg heightend heightend], ... + tmpcols(tmpi,:)); % this argument is color + set(h, 'EdgeColor', get(h, 'facecolor')) + end; + end; + else + event2plot1 = find ( g.winrej(:,1) >= lowlim & g.winrej(:,1) <= highlim ); + event2plot2 = find ( g.winrej(:,2) >= lowlim & g.winrej(:,2) <= highlim ); + event2plot3 = find ( g.winrej(:,1) < lowlim & g.winrej(:,2) > highlim ); + event2plot = union_bc(union(event2plot1, event2plot2), event2plot3); + + for tpmi = event2plot(:)' + if size(g.winrej,2) > 2 + tmpcols = g.winrej(tpmi,3:5); + else tmpcols = g.wincolor; + end; + h = patch([g.winrej(tpmi,1)-lowlim g.winrej(tpmi,2)-lowlim ... + g.winrej(tpmi,2)-lowlim g.winrej(tpmi,1)-lowlim], ... + [0 0 1 1], tmpcols); + set(h, 'EdgeColor', get(h, 'facecolor')) + end; + end; + end; + + % plot tags + % --------- + %if trialtag(1) ~= -1 & displaystatus % put tags at arbitrary places + % for tmptag = trialtag + % if tmptag >= lowlim & tmptag <= highlim + % plot([tmptag-lowlim tmptag-lowlim], [0 1], 'b--'); + % end; + % end; + %end; + + % draw events if any + % ------------------ + if strcmpi(g.plotevent, 'on') + + % JavierLC ############################### + MAXEVENTSTRING = g.maxeventstring; + if MAXEVENTSTRING<0 + MAXEVENTSTRING = 0; + elseif MAXEVENTSTRING>75 + MAXEVENTSTRING=75; + end + AXES_POSITION = [0.0964286 0.15 0.842 0.75-(MAXEVENTSTRING-5)/100]; + % JavierLC ############################### + + % find event to plot + % ------------------ + event2plot = find ( g.eventlatencies >=lowlim & g.eventlatencies <= highlim ); + if ~isempty(g.eventlatencyend) + event2plot2 = find ( g.eventlatencyend >= lowlim & g.eventlatencyend <= highlim ); + event2plot3 = find ( g.eventlatencies < lowlim & g.eventlatencyend > highlim ); + event2plot = union_bc(union(event2plot, event2plot2), event2plot3); + end; + for index = 1:length(event2plot) + % draw latency line + % ----------------- + tmplat = g.eventlatencies(event2plot(index))-lowlim-1; + tmph = plot([ tmplat tmplat ], ylim, 'color', g.eventcolors{ event2plot(index) }, ... + 'linestyle', g.eventstyle { event2plot(index) }, ... + 'linewidth', g.eventwidths( event2plot(index) ) ); + + % schtefan: add Event types text above event latency line + % ------------------------------------------------------- + EVENTFONT = ' \fontsize{10} '; + ylims=ylim; + evntxt = strrep(num2str(g.events(event2plot(index)).type),'_','-'); + if length(evntxt)>MAXEVENTSTRING, evntxt = [ evntxt(1:MAXEVENTSTRING-1) '...' ]; end; % truncate + try, + tmph2 = text([tmplat], ylims(2)-0.005, [EVENTFONT evntxt], ... + 'color', g.eventcolors{ event2plot(index) }, ... + 'horizontalalignment', 'left',... + 'rotation',90); + catch, end; + + % draw duration is not 0 + % ---------------------- + if g.ploteventdur & ~isempty(g.eventlatencyend) ... + & g.eventwidths( event2plot(index) ) ~= 2.5 % do not plot length of boundary events + tmplatend = g.eventlatencyend(event2plot(index))-lowlim-1; + if tmplatend ~= 0, + tmplim = ylim; + tmpcol = g.eventcolors{ event2plot(index) }; + h = patch([ tmplat tmplatend tmplatend tmplat ], ... + [ tmplim(1) tmplim(1) tmplim(2) tmplim(2) ], ... + tmpcol ); % this argument is color + set(h, 'EdgeColor', 'none') + end; + end; + end; + else % JavierLC + MAXEVENTSTRING = 10; % default + AXES_POSITION = [0.0964286 0.15 0.842 0.75-(MAXEVENTSTRING-5)/100]; + end; + + if g.trialstag(1) ~= -1 + + % plot trial limits + % ----------------- + tmptag = [lowlim:highlim]; + tmpind = find(mod(tmptag-1, g.trialstag) == 0); + for index = tmpind + plot([tmptag(index)-lowlim-1 tmptag(index)-lowlim-1], [0 1], 'b--'); + end; + alltag = tmptag(tmpind); + + % compute Xticks + % -------------- + tagnum = (alltag-1)/g.trialstag+1; + set(ax0,'XTickLabel', tagnum,'YTickLabel', [],... + 'Xlim',[0 g.winlength*multiplier],... + 'XTick',alltag-lowlim+g.trialstag/2, 'YTick',[], 'tag','backeeg'); + + axes(ax1); + tagpos = []; + tagtext = []; + if ~isempty(alltag) + alltag = [alltag(1)-g.trialstag alltag alltag(end)+g.trialstag]; % add border trial limits + else + alltag = [ floor(lowlim/g.trialstag)*g.trialstag ceil(highlim/g.trialstag)*g.trialstag ]+1; + end; + + nbdiv = 20/g.winlength; % approximative number of divisions + divpossible = [ 100000./[1 2 4 5] 10000./[1 2 4 5] 1000./[1 2 4 5] 100./[1 2 4 5 10 20]]; % possible increments + [tmp indexdiv] = min(abs(nbdiv*divpossible-(g.limits(2)-g.limits(1)))); % closest possible increment + incrementpoint = divpossible(indexdiv)/1000*g.srate; + + % tag zero below is an offset used to be sure that 0 is included + % in the absicia of the data epochs + if g.limits(2) < 0, tagzerooffset = (g.limits(2)-g.limits(1))/1000*g.srate+1; + else tagzerooffset = -g.limits(1)/1000*g.srate; + end; + if tagzerooffset < 0, tagzerooffset = 0; end; + + for i=1:length(alltag)-1 + if ~isempty(tagpos) & tagpos(end)-alltag(i)<2*incrementpoint/3 + tagpos = tagpos(1:end-1); + end; + if ~isempty(g.freqlimits) + tagpos = [ tagpos linspace(alltag(i),alltag(i+1)-1, nbdiv) ]; + else + if tagzerooffset ~= 0 + tmptagpos = [alltag(i)+tagzerooffset:-incrementpoint:alltag(i)]; + else + tmptagpos = []; + end; + tagpos = [ tagpos [tmptagpos(end:-1:2) alltag(i)+tagzerooffset:incrementpoint:(alltag(i+1)-1)]]; + end; + end; + + % find corresponding epochs + % ------------------------- + tagtext = eeg_point2lat(tagpos, floor((tagpos)/g.trialstag)+1, g.srate, g.limits, 1E-3); + set(ax1,'XTickLabel', tagtext,'XTick', tagpos-lowlim); + + + else + set(ax0,'XTickLabel', [],'YTickLabel', [],... + 'Xlim',[0 g.winlength*multiplier],... + 'XTick',[], 'YTick',[], 'tag','backeeg'); + + axes(ax1); + if g.isfreq % Ramon + set(ax1, 'XTickLabel', num2str((g.freqs(1):DEFAULT_GRID_SPACING:g.freqs(end))'),... + 'XTick',[1:multiplier*DEFAULT_GRID_SPACING:g.winlength*multiplier+1]); + else + set(ax1,'XTickLabel', num2str((g.time:DEFAULT_GRID_SPACING:g.time+g.winlength)'),... + 'XTick',[1:multiplier*DEFAULT_GRID_SPACING:g.winlength*multiplier+1]); + end + + set(ax1, 'Position', AXES_POSITION) % JavierLC + set(ax0, 'Position', AXES_POSITION) % JavierLC + end; + + % ordinates: even if all elec are plotted, some may be hidden + set(ax1, 'ylim',[g.elecoffset*g.spacing (g.elecoffset+g.dispchans+1)*g.spacing] ); + + axes(ax1) + + case 'draws' + % Redraw EEG and change scale + + ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle + g = get(gcf,'UserData'); + data = get(ax1, 'userdata'); + ESpacing = findobj('tag','ESpacing','parent',gcf); % ui handle + EPosition = findobj('tag','EPosition','parent',gcf); % ui handle + if g.trialstag(1) == -1 + g.time = str2num(get(EPosition,'string')); + else + g.time = str2num(get(EPosition,'string'))-1; + end; + g.spacing = str2num(get(ESpacing,'string')); + + orgspacing= g.spacing; + if p1 == 1 + g.spacing= g.spacing+ 0.1*orgspacing; % increase g.spacing(5%) + elseif p1 == 2 + g.spacing= max(0,g.spacing-0.1*orgspacing); % decrease g.spacing(5%) + end + if round(g.spacing*100) == 0 + maxindex = min(10000, g.frames); + g.spacing = 0.01*max(max(data(:,1:maxindex),[],2),[],1)-min(min(data(:,1:maxindex),[],2),[],1); % Set g.spacingto max/min data + end; + + % update edit box + % --------------- + set(ESpacing,'string',num2str(g.spacing,4)) + set(gcf, 'userdata', g); + eegplot('drawp', 0); + set(ax1,'YLim',[0 (g.chans+1)*g.spacing],'YTick',[0:g.spacing:g.chans*g.spacing]) + set(ax1, 'ylim',[g.elecoffset*g.spacing (g.elecoffset+g.dispchans+1)*g.spacing] ); + + % update scaling eye (I) if it exists + % ----------------------------------- + eyeaxes = findobj('tag','eyeaxes','parent',gcf); + if ~isempty(eyeaxes) + eyetext = findobj('type','text','parent',eyeaxes,'tag','thescalenum'); + set(eyetext,'string',num2str(g.spacing,4)) + end + + return; + + case 'window' % change window size + % get new window length with dialog box + % ------------------------------------- + g = get(gcf,'UserData'); + result = inputdlg2( { fastif(g.trialstag==-1,'New window length (s):', 'Number of epoch(s):') }, 'Change window length', 1, { num2str(g.winlength) }); + if size(result,1) == 0 return; end; + + g.winlength = eval(result{1}); + set(gcf, 'UserData', g); + eegplot('drawp',0); + return; + + case 'winelec' % change channel window size + % get new window length with dialog box + % ------------------------------------- + fig = gcf; + g = get(gcf,'UserData'); + result = inputdlg2( ... +{ 'Number of channels to display:' } , 'Change number of channels to display', 1, { num2str(g.dispchans) }); + if size(result,1) == 0 return; end; + + g.dispchans = eval(result{1}); + if g.dispchans<0 | g.dispchans>g.chans + g.dispchans =g.chans; + end; + set(gcf, 'UserData', g); + eegplot('updateslider', fig); + eegplot('drawp',0); + eegplot('scaleeye', [], fig); + return; + + case 'emaxstring' % change events' string length ; JavierLC + % get dialog box + % ------------------------------------- + g = get(gcf,'UserData'); + result = inputdlg2({ 'Max events'' string length:' } , 'Change events'' string length to display', 1, { num2str(g.maxeventstring) }); + if size(result,1) == 0 return; end; + g.maxeventstring = eval(result{1}); + set(gcf, 'UserData', g); + eegplot('drawb'); + return; + + case 'loadelect' % load channels + [inputname,inputpath] = uigetfile('*','Channel locations file'); + if inputname == 0 return; end; + if ~exist([ inputpath inputname ]) + error('no such file'); + end; + + AXH0 = findobj('tag','eegaxis','parent',gcf); + eegplot('setelect',[ inputpath inputname ],AXH0); + return; + + case 'setelect' + % Set channels + eloc_file = p1; + axeshand = p2; + outvar1 = 1; + if isempty(eloc_file) + outvar1 = 0; + return + end + + tmplocs = readlocs(eloc_file); + YLabels = { tmplocs.labels }; + YLabels = strvcat(YLabels); + + YLabels = flipud(str2mat(YLabels,' ')); + set(axeshand,'YTickLabel',YLabels) + + case 'title' + % Get new title + h = findobj('tag', 'eegplottitle'); + + if ~isempty(h) + result = inputdlg2( { 'New title:' }, 'Change title', 1, { get(h(1), 'string') }); + if ~isempty(result), set(h, 'string', result{1}); end; + else + result = inputdlg2( { 'New title:' }, 'Change title', 1, { '' }); + if ~isempty(result), h = textsc(result{1}, 'title'); set(h, 'tag', 'eegplottitle');end; + end; + + return; + + case 'scaleeye' + % Turn scale I on/off + obj = p1; + figh = p2; + g = get(figh,'UserData'); + % figh = get(obj,'Parent'); + + if ~isempty(obj) + eyeaxes = findobj('tag','eyeaxes','parent',figh); + children = get(eyeaxes,'children'); + if isstr(obj) + if strcmp(obj, 'off') + set(children, 'visible', 'off'); + set(eyeaxes, 'visible', 'off'); + return; + else + set(children, 'visible', 'on'); + set(eyeaxes, 'visible', 'on'); + end; + else + toggle = get(obj,'checked'); + if strcmp(toggle,'on') + set(children, 'visible', 'off'); + set(eyeaxes, 'visible', 'off'); + set(obj,'checked','off'); + return; + else + set(children, 'visible', 'on'); + set(eyeaxes, 'visible', 'on'); + set(obj,'checked','on'); + end; + end; + end; + + eyeaxes = findobj('tag','eyeaxes','parent',figh); + ax1 = findobj('tag','eegaxis','parent',gcf); % axes handle + YLim = double(get(ax1, 'ylim')); + + ESpacing = findobj('tag','ESpacing','parent',figh); + g.spacing= str2num(get(ESpacing,'string')); + + axes(eyeaxes); cla; axis off; + set(eyeaxes, 'ylim', YLim); + + Xl = double([.35 .65; .5 .5; .35 .65]); + Yl = double([ g.spacing g.spacing; g.spacing 0; 0 0] + YLim(1)); + plot(Xl(1,:),Yl(1,:),'color',DEFAULT_AXIS_COLOR,'clipping','off', 'tag','eyeline'); hold on; + plot(Xl(2,:),Yl(2,:),'color',DEFAULT_AXIS_COLOR,'clipping','off', 'tag','eyeline'); + plot(Xl(3,:),Yl(3,:),'color',DEFAULT_AXIS_COLOR,'clipping','off', 'tag','eyeline'); + text(.5,(YLim(2)-YLim(1))/23+Yl(1),num2str(g.spacing,4),... + 'HorizontalAlignment','center','FontSize',10,... + 'tag','thescalenum') + text(Xl(2)+.1,Yl(1),'+','HorizontalAlignment','left',... + 'verticalalignment','middle', 'tag', 'thescale') + text(Xl(2)+.1,Yl(4),'-','HorizontalAlignment','left',... + 'verticalalignment','middle', 'tag', 'thescale') + if ~isempty(SPACING_UNITS_STRING) + text(.5,-YLim(2)/23+Yl(4),SPACING_UNITS_STRING,... + 'HorizontalAlignment','center','FontSize',10, 'tag', 'thescale') + end + text(.5,(YLim(2)-YLim(1))/10+Yl(1),'Scale',... + 'HorizontalAlignment','center','FontSize',10, 'tag', 'thescale') + set(eyeaxes, 'tag', 'eyeaxes'); + + case 'noui' + if ~isempty(varargin) + eegplot( varargin{:} ); fig = gcf; + else + fig = findobj('tag', 'EEGPLOT'); + end; + set(fig, 'menubar', 'figure'); + + % find button and text + obj = findobj(fig, 'style', 'pushbutton'); delete(obj); + obj = findobj(fig, 'style', 'edit'); delete(obj); + obj = findobj(fig, 'style', 'text'); + %objscale = findobj(obj, 'tag', 'thescale'); + %delete(setdiff(obj, objscale)); + obj = findobj(fig, 'tag', 'Eelec');delete(obj); + obj = findobj(fig, 'tag', 'Etime');delete(obj); + obj = findobj(fig, 'tag', 'Evalue');delete(obj); + obj = findobj(fig, 'tag', 'Eelecname');delete(obj); + obj = findobj(fig, 'tag', 'Etimename');delete(obj); + obj = findobj(fig, 'tag', 'Evaluename');delete(obj); + obj = findobj(fig, 'type', 'uimenu');delete(obj); + + case 'zoom' % if zoom + fig = varargin{1}; + ax1 = findobj('tag','eegaxis','parent',fig); + ax2 = findobj('tag','backeeg','parent',fig); + tmpxlim = get(ax1, 'xlim'); + tmpylim = get(ax1, 'ylim'); + tmpxlim2 = get(ax2, 'xlim'); + set(ax2, 'xlim', get(ax1, 'xlim')); + g = get(fig,'UserData'); + + % deal with abscissa + % ------------------ + if g.trialstag ~= -1 + Eposition = str2num(get(findobj('tag','EPosition','parent',fig), 'string')); + g.winlength = (tmpxlim(2) - tmpxlim(1))/g.trialstag; + Eposition = Eposition + (tmpxlim(1) - tmpxlim2(1)-1)/g.trialstag; + Eposition = round(Eposition*1000)/1000; + set(findobj('tag','EPosition','parent',fig), 'string', num2str(Eposition)); + else + Eposition = str2num(get(findobj('tag','EPosition','parent',fig), 'string'))-1; + g.winlength = (tmpxlim(2) - tmpxlim(1))/g.srate; + Eposition = Eposition + (tmpxlim(1) - tmpxlim2(1)-1)/g.srate; + Eposition = round(Eposition*1000)/1000; + set(findobj('tag','EPosition','parent',fig), 'string', num2str(Eposition+1)); + end; + + % deal with ordinate + % ------------------ + g.elecoffset = tmpylim(1)/g.spacing; + g.dispchans = round(1000*(tmpylim(2)-tmpylim(1))/g.spacing)/1000; + + set(fig,'UserData', g); + eegplot('updateslider', fig); + eegplot('drawp', 0); + eegplot('scaleeye', [], fig); + + % reactivate zoom if 3 arguments + % ------------------------------ + if exist('p2', 'var') == 1 + set(gcbf, 'windowbuttondownfcn', [ 'zoom(gcbf,''down''); eegplot(''zoom'', gcbf, 1);' ]); + set(gcbf, 'windowbuttonmotionfcn', g.commandselect{2}); + end; + + case 'updateslider' % if zoom + fig = varargin{1}; + g = get(fig,'UserData'); + sliider = findobj('tag','eegslider','parent',fig); + if g.elecoffset < 0 + g.elecoffset = 0; + end; + if g.dispchans >= g.chans + g.dispchans = g.chans; + g.elecoffset = 0; + set(sliider, 'visible', 'off'); + else + set(sliider, 'visible', 'on'); + set(sliider, 'value', g.elecoffset/g.chans, ... + 'sliderstep', [1/(g.chans-g.dispchans) g.dispchans/(g.chans-g.dispchans)]); + %'sliderstep', [1/(g.chans-1) g.dispchans/(g.chans-1)]); + end; + if g.elecoffset < 0 + g.elecoffset = 0; + end; + if g.elecoffset > g.chans-g.dispchans + g.elecoffset = g.chans-g.dispchans; + end; + set(fig,'UserData', g); + eegplot('scaleeye', [], fig); + + case 'drawlegend' + fig = varargin{1}; + g = get(fig,'UserData'); + + if ~isempty(g.events) % draw vertical colored lines for events, add event name text above + nleg = length(g.eventtypes); + fig2 = figure('numbertitle', 'off', 'name', '', 'visible', 'off', 'menubar', 'none', 'color', DEFAULT_FIG_COLOR); + pos = get(fig2, 'position'); + set(fig2, 'position', [ pos(1) pos(2) 130 14*nleg+20]); + + for index = 1:nleg + plot([10 30], [(index-0.5) * 10 (index-0.5) * 10], 'color', g.eventtypecolors{index}, 'linestyle', ... + g.eventtypestyle{ index }, 'linewidth', g.eventtypewidths( index )); hold on; + if iscell(g.eventtypes) + th=text(35, (index-0.5)*10, g.eventtypes{index}, ... + 'color', g.eventtypecolors{index}); + else + th=text(35, (index-0.5)*10, num2str(g.eventtypes(index)), ... + 'color', g.eventtypecolors{index}); + end; + end; + xlim([0 130]); + ylim([0 nleg*10]); + axis off; + set(fig2, 'visible', 'on'); + end; + + + % motion button: move windows or display current position (channel, g.time and activation) + % ---------------------------------------------------------------------------------------- + case 'defmotioncom' + fig = varargin{1}; + g = get(fig,'UserData'); + + ax1 = findobj('tag','backeeg','parent',fig); + tmppos = get(ax1, 'currentpoint'); + + if g.trialstag ~= -1, + lowlim = round(g.time*g.trialstag+1); + else, lowlim = round(g.time*g.srate+1); + end; + if g.incallback + g.winrej = [g.winrej(1:end-1,:)' [g.winrej(end,1) tmppos(1)+lowlim g.winrej(end,3:end)]']'; + set(fig,'UserData', g); + eegplot('drawb'); + else + hh = findobj('tag','Etime','parent',fig); + if g.trialstag ~= -1, + set(hh, 'string', num2str(mod(tmppos(1)+lowlim-1,g.trialstag)/g.trialstag*(g.limits(2)-g.limits(1)) + g.limits(1))); + else set(hh, 'string', num2str((tmppos(1)+lowlim-1)/g.srate)); % put g.time in the box + end; + ax1 = findobj('tag','eegaxis','parent',fig); + tmppos = get(ax1, 'currentpoint'); + tmpelec = round(tmppos(1,2) / g.spacing); + tmpelec = min(max(double(tmpelec), 1),g.chans); + labls = get(ax1, 'YtickLabel'); + hh = findobj('tag','Eelec','parent',fig); % put electrode in the box + if ~g.envelope + set(hh, 'string', labls(tmpelec+1,:)); + else + set(hh, 'string', ' '); + end + hh = findobj('tag','Evalue','parent',fig); + if ~g.envelope + eegplotdata = get(ax1, 'userdata'); + set(hh, 'string', num2str(eegplotdata(g.chans+1-tmpelec, min(g.frames,max(1,double(round(tmppos(1)+lowlim))))))); % put value in the box + else + set(hh,'string',' '); + end + end; + + % add topoplot + % ------------ + case 'topoplot' + fig = varargin{1}; + g = get(fig,'UserData'); + if ~isstruct(g.eloc_file) || ~isfield(g.eloc_file, 'theta') || isempty( [ g.eloc_file.theta ]) + return; + end; + ax1 = findobj('tag','backeeg','parent',fig); + tmppos = get(ax1, 'currentpoint'); + ax1 = findobj('tag','eegaxis','parent',fig); % axes handle + % plot vertical line + yl = ylim; + plot([ tmppos tmppos ], yl, 'color', [0.8 0.8 0.8]); + + if g.trialstag ~= -1, + lowlim = round(g.time*g.trialstag+1); + else, lowlim = round(g.time*g.srate+1); + end; + data = get(ax1,'UserData'); + datapos = max(1, round(tmppos(1)+lowlim)); + datapos = min(datapos, g.frames); + + figure; topoplot(data(:,datapos), g.eloc_file); + if g.trialstag == -1, + latsec = (datapos-1)/g.srate; + title(sprintf('Latency of %d seconds and %d milliseconds', floor(latsec), round(1000*(latsec-floor(latsec))))); + else + trial = ceil((datapos-1)/g.trialstag); + + latintrial = eeg_point2lat(datapos, trial, g.srate, g.limits, 0.001); + title(sprintf('Latency of %d ms in trial %d', round(latintrial), trial)); + end; + return; + + % release button: check window consistency, add to trial boundaries + % ------------------------------------------------------------------- + case 'defupcom' + fig = varargin{1}; + g = get(fig,'UserData'); + ax1 = findobj('tag','backeeg','parent',fig); + g.incallback = 0; + set(fig,'UserData', g); % early save in case of bug in the following + if strcmp(g.mocap,'on'), g.winrej = g.winrej(end,:);end; % nima + if ~isempty(g.winrej)', ... + if g.winrej(end,1) == g.winrej(end,2) % remove unitary windows + g.winrej = g.winrej(1:end-1,:); + else + if g.winrej(end,1) > g.winrej(end,2) % reverse values if necessary + g.winrej(end, 1:2) = [g.winrej(end,2) g.winrej(end,1)]; + end; + g.winrej(end,1) = max(1, g.winrej(end,1)); + g.winrej(end,2) = min(g.frames, g.winrej(end,2)); + if g.trialstag == -1 % find nearest trials boundaries if necessary + I1 = find((g.winrej(end,1) >= g.winrej(1:end-1,1)) & (g.winrej(end,1) <= g.winrej(1:end-1,2)) ); + if ~isempty(I1) + g.winrej(I1,2) = max(g.winrej(I1,2), g.winrej(end,2)); % extend epoch + g.winrej = g.winrej(1:end-1,:); % remove if empty match + else, + I2 = find((g.winrej(end,2) >= g.winrej(1:end-1,1)) & (g.winrej(end,2) <= g.winrej(1:end-1,2)) ); + if ~isempty(I2) + g.winrej(I2,1) = min(g.winrej(I2,1), g.winrej(end,1)); % extend epoch + g.winrej = g.winrej(1:end-1,:); % remove if empty match + else, + I2 = find((g.winrej(end,1) <= g.winrej(1:end-1,1)) & (g.winrej(end,2) >= g.winrej(1:end-1,1)) ); + if ~isempty(I2) + g.winrej(I2,:) = []; % remove if empty match + end; + end; + end; + end; + end; + end; + set(fig,'UserData', g); + eegplot('drawp', 0); + if strcmp(g.mocap,'on'), show_mocap_for_eegplot(g.winrej); g.winrej = g.winrej(end,:); end; % nima + + % push button: create/remove window + % --------------------------------- + case 'defdowncom' + show_mocap_timer = timerfind('tag','mocapDisplayTimer'); if ~isempty(show_mocap_timer), end; % nima + fig = varargin{1}; + g = get(fig,'UserData'); + + ax1 = findobj('tag','backeeg','parent',fig); + tmppos = get(ax1, 'currentpoint'); + if strcmp(get(fig, 'SelectionType'),'normal'); + g = get(fig,'UserData'); % get data of backgroung image {g.trialstag g.winrej incallback} + if g.incallback ~= 1 % interception of nestest calls + if g.trialstag ~= -1, + lowlim = round(g.time*g.trialstag+1); + highlim = round(g.winlength*g.trialstag); + else, + lowlim = round(g.time*g.srate+1); + highlim = round(g.winlength*g.srate); + end; + if (tmppos(1) >= 0) & (tmppos(1) <= highlim), + if isempty(g.winrej) Allwin=0; + else Allwin = (g.winrej(:,1) < lowlim+tmppos(1)) & (g.winrej(:,2) > lowlim+tmppos(1)); + end; + if any(Allwin) % remove the mark or select electrode if necessary + lowlim = find(Allwin==1); + if g.setelectrode % select electrode + ax2 = findobj('tag','eegaxis','parent',fig); + tmppos = get(ax2, 'currentpoint'); + tmpelec = g.chans + 1 - round(tmppos(1,2) / g.spacing); + tmpelec = min(max(tmpelec, 1), g.chans); + g.winrej(lowlim,tmpelec+5) = ~g.winrej(lowlim,tmpelec+5); % set the electrode + else % remove mark + g.winrej(lowlim,:) = []; + end; + else + if g.trialstag ~= -1 % find nearest trials boundaries if epoched data + alltrialtag = [0:g.trialstag:g.frames]; + I1 = find(alltrialtag < (tmppos(1)+lowlim) ); + if ~isempty(I1) & I1(end) ~= length(alltrialtag), + g.winrej = [g.winrej' [alltrialtag(I1(end)) alltrialtag(I1(end)+1) g.wincolor zeros(1,g.chans)]']'; + end; + else, + g.incallback = 1; % set this variable for callback for continuous data + if size(g.winrej,2) < 5 + g.winrej(:,3:5) = repmat(g.wincolor, [size(g.winrej,1) 1]); + end; + if size(g.winrej,2) < 5+g.chans + g.winrej(:,6:(5+g.chans)) = zeros(size(g.winrej,1),g.chans); + end; + g.winrej = [g.winrej' [tmppos(1)+lowlim tmppos(1)+lowlim g.wincolor zeros(1,g.chans)]']'; + end; + end; + set(fig,'UserData', g); + eegplot('drawp', 0); % redraw background + end; + end; + end; + otherwise + error(['Error - invalid eegplot() parameter: ',data]) + end +end + +% function not supported under Mac +% -------------------------------- +function [reshist, allbin] = myhistc(vals, intervals); + + reshist = zeros(1, length(intervals)); + allbin = zeros(1, length(vals)); + + for index=1:length(vals) + minvals = vals(index)-intervals; + bintmp = find(minvals >= 0); + [mintmp indextmp] = min(minvals(bintmp)); + bintmp = bintmp(indextmp); + + allbin(index) = bintmp; + reshist(bintmp) = reshist(bintmp)+1; + end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegplot2event.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot2event.m new file mode 100644 index 0000000..5293d56 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot2event.m @@ -0,0 +1,85 @@ +% eegplot2event() - convert EEGPLOT rejections into events +% compatible with the eeg_eegrej function for rejecting +% continuous portions of datasets. +% +% Usage: +% >> [events] = eegplot2event( eegplotrej, type, colorin, colorout ); +% +% Inputs: +% eegplotrej - EEGPLOT output (TMPREJ; see eegplot for more details) +% type - type of the event. Default -1. +% colorin - only extract rejection of specific colors (here a n x 3 +% array must be given). Default: extract all rejections. +% colorout - do not extract rejection of specified colors. +% +% Outputs: +% events - array of events compatible with the eeg_eegrej function +% for rejecting continuous portions of datasets. +% +% Example: +% NEWEEG = eeg_eegrej(EEG,eegplot2event(TMPREJ, -1)); +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eegplot(), eeg_multieegplot(), eegplot2trial(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function events = eegplot2event( TMPREJ, type, color, colorout ) + +if nargin < 1 + help eegplot2event; + return; +end; + +if nargin < 2 + type = -1; +end; + +% only take into account specific colors +% -------------------------------------- +if exist('color') == 1 + for index = 1:size(color,1) + tmpcol1 = TMPREJ(:,3) + 255*TMPREJ(:,4) + 255*255*TMPREJ(:,5); + tmpcol2 = color(index,1)+255*color(index,2)+255*255*color(index,3); + I = find( tmpcol1 == tmpcol2); + if isempty(I) + fprintf('Warning: color [%d %d %d] not found\n', ... + color(index,1), color(index,2), color(index,3)); + end; + TMPREJ = TMPREJ(I,:); + end; +end; + +% remove other specific colors +% ---------------------------- +if exist('colorout') == 1 + for index = 1:size(colorout,1) + tmpcol1 = TMPREJ(:,3) + 255*TMPREJ(:,4) + 255*255*TMPREJ(:,5); + tmpcol2 = colorout(index,1)+255*colorout(index,2)+255*255*colorout(index,3); + I = find( tmpcol1 ~= tmpcol2); + TMPREJ = TMPREJ(I,:); + end; +end; + +events = []; +if ~isempty(TMPREJ) + events = TMPREJ(:,1:5); + events = [ type*ones(size(events,1), 1) ones(size(events,1), 1) round(events(:,1:2)) events(:,3:5)]; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegplot2trial.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot2trial.m new file mode 100644 index 0000000..f58047b --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot2trial.m @@ -0,0 +1,99 @@ +% eegplot2trial() - convert EEGPLOT rejections into trial and electrode +% rejections compatible with EEGLAB format. +% +% Usage: +% >> [trialrej elecrej] = eegplot2trial( eegplotrej, frames, ... +% sweeps, colorin, colorout ); +% +% Inputs: +% eegplotrej - EEGPLOT output (TMPREJ; see eegplot for more details) +% frames - number of points per epoch +% sweeps - number of trials +% colorin - only extract rejection of specific colors (here a n x 3 +% array must be given). Default: extract all rejections. +% colorout - do not extract rejection of specified colors. +% +% Outputs: +% trialrej - array of 0 and 1 depicting rejected trials (size sweeps) +% elecrej - array of 0 and 1 depicting rejected electrodes in +% all trials (size nbelectrodes x sweeps ) +% +% Note: if colorin is used, colorout is ignored +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eegplot(), eeg_multieegplot(), eegplot2event(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [tmpsig, tmprejelec] = eegplot2trial( TMPREJINIT, pnts, sweeps, color, colorout ); + +if nargin < 3 + help eegplot2trial; + return; +end; + +% only take into account specific colors +% -------------------------------------- +TMPREJINIT(:,3:5) = round(TMPREJINIT(:,3:5)*100)/100; +TMPREJ = []; +if exist('color') == 1 && ~isempty(color) + color = round(color*100)/100; + for index = 1:size(color,1) + tmpcol1 = TMPREJINIT(:,3) + 255*TMPREJINIT(:,4) + 255*255*TMPREJINIT(:,5); + tmpcol2 = color(index,1)+255*color(index,2)+255*255*color(index,3); + I = find( tmpcol1 == tmpcol2); + %if isempty(I) + % fprintf('Warning: color [%d %d %d] not found\n', ... + % color(index,1), color(index,2), color(index,3)); + %end; + TMPREJ = [ TMPREJ; TMPREJINIT(I,:)]; + end; +else + TMPREJ = TMPREJINIT; + % remove other specific colors + % ---------------------------- + if exist('colorout') == 1 + colorout = round(colorout*100)/100; + for index = 1:size(colorout,1) + tmpcol1 = TMPREJ(:,3) + 255*TMPREJ(:,4) + 255*255*TMPREJ(:,5); + tmpcol2 = colorout(index,1)+255*colorout(index,2)+255*255*colorout(index,3); + I = find( tmpcol1 == tmpcol2); + TMPREJ(I,:) = []; + end; + end; +end; + +% perform the conversion +% ---------------------- +tmprejelec = []; +tmpsig = zeros(1,sweeps); +if ~isempty(TMPREJ) + nbchan = size(TMPREJ,2)-5; + TMPREJ = sortrows(TMPREJ,1); + TMPREJ(find(TMPREJ(:,1) == 1),1) = 0; + tmpsig = TMPREJ(:,1)''/pnts+1; + I = find(tmpsig == round(tmpsig)); + tmp = tmpsig(I); + tmpsig = zeros(1,sweeps); + tmpsig(tmp) = 1; + I = find(tmpsig); + tmprejelec = zeros( nbchan, sweeps); + tmprejelec(:,I) = TMPREJ(:,6:nbchan+5)'; +end; + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegplot_readkey.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot_readkey.m new file mode 100644 index 0000000..f2f333a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegplot_readkey.m @@ -0,0 +1,8 @@ +% eegplot helper function to read key strokes + +function eegplot_readkey(src,evnt) + if strcmp(evnt.Key, 'rightarrow')==1 + eegplot('drawp',4); + elseif strcmp(evnt.Key, 'leftarrow')==1 + eegplot('drawp',1); + end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegrej.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegrej.m new file mode 100644 index 0000000..390303b --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegrej.m @@ -0,0 +1,142 @@ +% eegrej() - reject/excise arbitrary periods from continuous EEG data +% (e.g., EEG.data). +% +% Usage: +% >> [outdata newt newevents boundevents] = ... +% eegrej( indata, regions, timelength, eventlatencies); +% +% Inputs: +% indata - input data (channels, frames). If indata is a string, +% the function use the disk to perform the rejection +% regions - array of regions to suppress. [beg end] x number of +% regions. 'beg' and 'end' are expressed in term of points +% in the input dataset. The size() of the array should be +% (2, number of regions). +% timelength - length in time (s) of the input data. Only used to compute +% new total data length after rejections (newt). +% eventlatencies - vector of event latencies in data points. +% Default []=none. +% +% Outputs: +% outdata - output dataset +% newt - new total data length +% newevents - new event latencies. If the event was in a removed +% region, NaN is returned. +% boundevents - boundary events latencies +% +% Exemple: +% [outdat t] = eegrej( 'EEG.data', [1 100; 200 300]', [0 10]); +% this command pick up two regions in EEG.data (from point 1 to +% point 100, and point 200 to point 300) and put the result in +% the EEG.data variable in the global workspace (thus allowing +% to perform the operation even if EEG.data takes all the memory) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [indata, times, newevents, boundevents] = eegrej( indata, regions, times, eventtimes ); + +if nargin < 2 + help eegrej; + return; +end; + +if isstr(indata) + datlen = evalin('base', [ 'size(' indata ',2)' ]); +else + datlen = size(indata, 2); +end; + +reject = zeros(1,datlen); +regions = round(regions); +% Checking for extreme values in regions (correcting round) RMC +if max(regions(:)) > size(indata, 2) + IndxOut = find(regions(:) > size(indata, 2)); + regions(IndxOut) = size(indata, 2); +end + +regions = sortrows(sort(regions,2)); % Sorting regions %regions = sort(regions,1); RMC +Izero = find(regions == 0); % Find regions index == 0 to adjust them +if ~isempty(Izero), regions(Izero) = 1;end; % Fractional point below 1 adjusted to 1 +for i=1:size(regions,1) + try + reject(regions(i,1):regions(i,2)) = 1; + catch + error(['Region ' int2str(i) ' out of bound']); + end; +end; + +% recompute event times +% --------------------- +newevents = []; +if exist('eventtimes') == 1 + if ~isempty(eventtimes) + try + rmevent = find( reject(min(length(reject),max(1,round(eventtimes)))) == 1); % cko: sometimes, events may have latencies < 0.5 or >= length(reject)+0.5 (e.g. after resampling) + catch, error('Latency event out of bound'); end; + eventtimes(rmevent) = NaN; + newevents = eventtimes; + for i=1:size(regions,1) + for index=1:length( eventtimes ) + if ~isnan(eventtimes(index)) + if regions(i,2) < eventtimes(index) + newevents(index) = newevents(index) - (regions(i,2)-regions(i,1)+1); + end; + end; + end; + end; + end; +end; + +% generate boundaries latencies +% ----------------------------- +boundevents = regions(:,1)-1; +for i=1:size(regions,1) + for index=i+1:size(regions) + boundevents(index) = boundevents(index) - (regions(i,2)-regions(i,1)+1); + end; +end; +boundevents = boundevents+0.5; + +if isstr(indata) + disp('Using disk to reject data'); + increment = 10000; + global elecIndices; + evalin('base', 'global elecIndices'); + elecIndices = find(reject == 0); + evalin('base', 'fid = fopen(''tmpeegrej.fdt'', ''w'')'); + evalin('base', ['numberrow = size(' indata ',1)']); + evalin('base', ['for indextmp=1:10000:length(elecIndices),', ... + ' endtmp = min(indextmp+9999, length(elecIndices));' ... + ' fwrite(fid,' indata '(:,elecIndices(indextmp:endtmp)), ''float'');'... + 'end']); + evalin('base', 'fclose(fid)'); + evalin('base', 'clear global elecIndices'); + evalin('base', [ indata '=[]; clear ' indata '']); + evalin('base', 'fid = fopen(''tmpeegrej.fdt'', ''r'')'); + evalin('base', [ indata '= fread(fid, [numberrow ' int2str(datlen) '], ''float'')']); + evalin('base', 'fclose(fid)'); + evalin('base', 'clear numberrow indextmp endtmp fid'); + evalin('base', 'delete(''tmpeegrej.fdt'')'); +else + timeIndices = find(reject == 1); + indata(:,timeIndices) = []; +end; +times = times * length(find(reject ==0)) / length(reject); + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eegthresh.m b/code/eeglab13_4_4b/functions/sigprocfunc/eegthresh.m new file mode 100644 index 0000000..456a4b1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eegthresh.m @@ -0,0 +1,126 @@ +% eegthresh() - classical trial rejection rejection using a threshold on +% the raw signal +% +% Usage: +% >> [Iin, Iout, newsignal, elec] = eegthresh( signal, frames, ... +% elecs, negthresh, posthresh, timerange, starttime, entime) +% +% Inputs: +% signal - signal 2D, channels x (frames*sweeps) or 3D channels x +% frames x sweeps +% frames - number of points per epoch +% elecs - [e1 e2 ...] electrodes (number) to take into +% consideration for rejection +% negthresh - negative threshold limit in mV (can be an array if +% several electrodes; if less numbe of values than number +% of electrodes the last value is used for the remaining +% electrodes) +% posthresh - positive threshold limit in mV (same syntax as +% negthresh) +% timerange - [mintime maxtime] timerange limit in second +% starttime - starting time limit in second (same syntax as +% negthresh) +% endtime - ending time limit in second (same syntax as negthresh) +% +% Outputs: +% Iin - Indexes of sweeps not rejected +% Iout - Indexes of sweeps rejected +% newsignal - signal after +% sweeps rejection (same number of dimension as signal) +% elec - electrode that served for the rejection (array of 0 and +% 1, same number of column as Iout, rows=number of +% electrodes) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_eegthresh(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [Iin, Iout, newsignal, elec] = eegthresh( signal, pnts, electrodes, negthresh, posthresh, timerange, starttime, endtime); + +if nargin < 7 + help eegthresh; + return; +end; + +if starttime < timerange(1) + disp('eegthresh: starting point out of range, adjusted'); + startime = timerange(1); +end; +if endtime > timerange(2) + disp('eegthresh: ending point out of range, adjusted'); + endtime = timerange(2); +end; + +% complete thresholds values if necessary +%---------------------------------------- +if size(posthresh,2) < size(electrodes,2) + posthresh = [ posthresh posthresh(end)*ones(1,size(electrodes,2)-size(posthresh,2))]; +end; +if size(negthresh,2) < size(electrodes,2) + negthresh = [ negthresh negthresh(end)*ones(1,size(electrodes,2)-size(negthresh,2))]; +end; + +% complete timeselect values if necessary +%---------------------------------------- +if size(starttime,2) < size(electrodes,2) + starttime = [ starttime starttime(end)*ones(1,size(electrodes,2)-size(starttime,2))]; +end; +if size(endtime,2) < size(electrodes,2) + endtime = [ endtime endtime(end)*ones(1,size(electrodes,2)-size(endtime,2))]; +end; + +% find the maximum for each trial +%-------------------------------- +sweeps = size(signal(1,:),2)/pnts; +signal = reshape(signal(electrodes,:), size(electrodes(:),1), pnts, sweeps); + +% reject the selected trials +%--------------------------- +elec = zeros(size(electrodes(:),1), sweeps); +allelec = zeros(1, sweeps); +for indexe = 1:size(electrodes(:),1) + % transform the time range + % ------------------------ + framelowlimit = max(1,floor((starttime(indexe)-timerange(1))/(timerange(2)-timerange(1))*(pnts-1))+1); + framehighlimit = floor((endtime(indexe) -timerange(1))/(timerange(2)-timerange(1))*(pnts-1))+1; + + % remove outliers + % --------------- + sigtmp = squeeze(signal(indexe,framelowlimit:framehighlimit,:)); + sigmax = max(sigtmp, [], 1); + sigmin = min(sigtmp, [], 1); + elec(indexe,:) = ( sigmin < negthresh(indexe) ) | ( sigmax > posthresh(indexe) ); + allelec = allelec | elec(indexe,:); +end; +Iout = find( allelec == 1 ); +Iin = find( allelec == 0 ); +elec = elec(:,Iout); + +% reject the selected trials +%--------------------------- +newsignal = reshape(signal, size(signal,1), pnts, sweeps); +if ~isempty(Iin) + newsignal = newsignal(:,:,Iin); + if ndims(signal) == 2 + newsignal = newsignal(:,:); + end; +else + newsignal = []; +end; +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/entropy_rej.m b/code/eeglab13_4_4b/functions/sigprocfunc/entropy_rej.m new file mode 100644 index 0000000..1ebe193 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/entropy_rej.m @@ -0,0 +1,113 @@ +% entropy_rej() - calculation of entropy of a 1D, 2D or 3D array and +% rejection of odd last dimension values of the input data array +% using the discrete entropy of the values in that dimension +% (and using the probability distribution of all columns). +% +% Usage: +% >> [entropy rej] = entropy_rej( signal, threshold, entropy, normalize, discret); +% +% Inputs: +% signal - one dimensional column vector of data values, two +% dimensional column vector of values of size +% sweeps x frames or three dimensional array of size +% component x sweeps x frames. If three dimensional, +% all components are treated independently. +% threshold - Absolute threshold. If normalization is used then the +% threshold is expressed in standard deviation of the +% mean. 0 means no threshold. +% entropy - pre-computed entropy_rej (only perform thresholding). Default +% is the empty array []. +% normalize - 0 = do not not normalize entropy. 1 = normalize entropy. +% Default is 0. +% discret - discretization variable for calculation of the +% discrete probability density. Default is 1000 points. +% +% Outputs: +% entropy - entropy (normalized or not) of the single data trials +% (same size as signal without the last dimension) +% rej - rejection matrix (0 and 1, size of number of rows) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: realproba() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ent, rej] = entropy_rej( signal, threshold, oldentropy_rej, normalize, discret ); + +if nargin < 1 + help entropy_rej; + return; +end; +if nargin < 2 + threshold = 0; +end; +if nargin < 3 + oldentropy_rej = []; +end; +if nargin < 4 + normalize = 0; +end; +if nargin < 5 + discret = 1000; +end; +% threshold = erfinv(threshold); + +if size(signal,2) == 1 % transpose if necessary + signal = signal'; +end; + +[nbchan pnts sweeps] = size(signal); +ent = zeros(nbchan,sweeps); + +if ~isempty( oldentropy_rej ) % speed up the computation + ent = oldentropy_rej; +else + for rc = 1:nbchan + + % COMPUTE THE DENSITY FUNCTION + % ---------------------------- + [ dataProba sortbox ] = realproba( signal(rc, :), discret ); + + % compute all entropy + % ------------------- + for index=1:sweeps + datatmp = dataProba((index-1)*pnts+1:index*pnts); + ent(rc, index) = - sum( datatmp .* log( datatmp ) ); + end; + end; + + % normalize the last dimension + % ---------------------------- + if normalize + switch ndims( signal ) + case 2, ent = (ent-mean(ent)) / std(ent); + case 3, ent = (ent-mean(ent,2)*ones(1,size(ent,2)))./ ... + (std(ent,0,2)*ones(1,size(ent,2))); + end; + end; +end + +% reject +% ------ +if threshold ~= 0 + rej = abs(ent) > threshold; +else + rej = zeros(size(ent)); +end; + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/env.m b/code/eeglab13_4_4b/functions/sigprocfunc/env.m new file mode 100644 index 0000000..90ce44a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/env.m @@ -0,0 +1,78 @@ +% env() - return envelope of rows of a data matrix, or optionally +% of the data interpolated to a different sampling rate. +% Usage: +% >> envdata = env(data); +% >> envdata = env(data, timelimits, timearray); +% +% Inputs: +% data - (nchannels,ntimepoints) data array +% +% Optional Inputs: +% timelimits - (start_time, end_time) timelimits (default: none required) +% timearray - Optional times array to interpolate the data (default: none) +% +% Outputs: +% envdata - A (2,timepoints) array containing the "envelope" of +% a multichannel data set = the maximum and minimum values, +% across all the channels, at each time point. That is, +% >> envdata = [max(data');min(data')]; +% +% Author: Scott Makeig & Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: ENVTOPO + +% Scott Makeig & Arnaud Delorme - CNL / Salk Institute, La Jolla 8/8/97 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 2001 - extrapolation -ad +% 01-25-02 reformated help & license -ad + +function envdata = env(data, timelimits, timearray ) + +maxdata = max(data); +mindata = min(data); + +% extrapolate these values if necessary +% ------------------------------------- +if nargin > 2 + timelimits = timelimits(:)'; % make row vector + if size(timelimits,2)~=2 | size(timelimits,2)~=2 + error('timelimits array must be a [start_time, end_time] vector') + end + X = linspace(timelimits(1),timelimits(2),length(maxdata)); % x-axis description (row vector) + Y = ones(1,size(X,2)); + if size(timearray,1)>1 & size(timearray,2)>1 + error('timearray must be a vector') + end + Xi = timearray(:)'; % make a row vector + Yi = ones(1,length(timearray)); + + try + [tmp1,tmp2,Zi] = griddata(Y, X, maxdata, Yi, Xi, 'v4'); % interpolate data + maxdata = Zi; + [tmp1,tmp2,Zi] = griddata(Y, X, mindata, Yi, Xi, 'v4'); % interpolate data + mindata = Zi; + catch + disp('Warning, "v4" interpolation failed, using linear interpolation instead (probably running Octave)'); + [tmp1,tmp2,Zi] = griddata(Y, X, maxdata, Yi, Xi, 'linear'); % interpolate data + maxdata = Zi; + [tmp1,tmp2,Zi] = griddata(Y, X, mindata, Yi, Xi, 'linear'); % interpolate data + mindata = Zi; + end +end; + +envdata = [maxdata;mindata]; +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/envtopo.m b/code/eeglab13_4_4b/functions/sigprocfunc/envtopo.m new file mode 100644 index 0000000..1eb5741 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/envtopo.m @@ -0,0 +1,1224 @@ +% +% envtopo() - Plot the envelope of a multichannel data epoch, plus envelopes and +% scalp maps of specified or largest-contributing components. If a 3-D +% input matrix, operates on the mean of the data epochs. Click on +% individual axes to examine them in detail. The black lines represent +% the max and min values across all channels at each time point. +% The blue shading represents the max and min contributions of +% the selected components tothose channels. The paired colored lines +% represent the max and min contributions of the indicated component +% across all channels. +% Usage: +% >> envtopo(data,weights,'chanlocs',file_or_struct); +% >> [cmpvarorder,cmpvars,cmpframes,cmptimes,cmpsplotted,sortvar] ... +% = envtopo(data, weights, 'key1', val1, ...); +% Inputs: +% data = single data epoch (chans,frames), else it a 3-D epoched data matrix +% (chans,frames,epochs) -> processes the mean data epoch. +% weights = linear decomposition (unmixing) weight matrix. The whole matrix +% should be passed to the function here. +% Ex: (EEG.icaweights*EEG.icasphere) +% Required keyword: +% 'chanlocs' = [string] channel location filename or EEG.chanlocs structure. +% For more information, see >> topoplot example +% +% Optional inputs: +% 'compnums' = [integer array] vector of component indices to use in the +% calculations and to select plotted components from +% {default|[]: all} +% 'compsplot' = [integer] the number of largest contributing components to plot. +% compnums in the latter case is restricted in size by the +% internal variable MAXTOPOS (20) {default|[] -> 7} +% 'subcomps' = [integer vector] indices of comps. to remove from the whole data +% before plotting. 0 -> Remove none. [] -> If 'compnums' +% also listed, remove *all* except 'compnums' {default: 0} +% 'limits' = 0 or [minms maxms] or [minms maxms minuV maxuV]. Specify +% start/end plot (x) limits (in ms) and min/max y-axis limits +% (in uV). If 0, or if both minmx & maxms == 0 -> use latencies +% from 'timerange' (else 0:frames-1). If both minuV and +% maxuV == 0 -> use data uV limits {default: 0} +% 'timerange' = start and end input data latencies (in ms) {default: from 'limits' +% if any}. Note: Does NOT select a portion of the input data, +% just makes time labels. +% 'limcontrib' = [minms maxms] time range (in ms) in which to rank component +% contribution (boundaries shown with thin dotted lines) +% {default|[]|[0 0] -> plotting limits} +% 'sortvar' = ['mp'|'pv'|'pp'|'rp'] {default:'mp'} +% 'mp', sort components by maximum mean back-projected power +% in the 'limcontrib' time range: mp(comp) = max(Mean(back_proj.^2)); +% where back_proj = comp_map * comp_activation(t) for t in 'limcontrib' +% 'pv', sort components by percent variance accounted for (eeg_pvaf()) +% pvaf(comp) = 100-100*mean(var(data - back_proj))/mean(var(data)); +% 'pp', sort components by percent power accounted for (ppaf) +% ppaf(comp) = 100-100*Mean((data - back_proj).^2)/Mean(data.^2); +% 'rp', sort components by relative power +% rp(comp) = 100*Mean(back_proj.^2)/Mean(data.^2); +% 'title' = [string] plot title {default|[] -> none} +% 'plotchans' = [integer array] data channels to use in computing contributions and +% envelopes, and also for making scalp topo plots +% {default|[] -> all}, by calling topoplot(). +% 'voffsets' = [float array] vertical line extentions above the data max to +% disentangle plot lines (left->right heads, values in y-axis units) +% {default|[] -> none} +% 'colors' = [string] filename of file containing colors for envelopes, 3 chars +% per line, (. = blank). First color should be "w.." (white) +% Else, 'bold' -> plot default colors in thick lines. +% {default|[] -> standard Matlab color order} +% 'fillcomp' = int_vector>0 -> fill the numbered component envelope(s) with +% solid color. Ex: [1] or [1 5] {default|[]|0 -> no fill} +% 'vert' = vector of times (in ms) at which to plot vertical dashed lines +% {default|[] -> none} +% 'icawinv' = [float array] inverse weight matrix. Normally computed by inverting +% the weights*sphere matrix (Note: If some components have been +% removed, the pseudo-inverse does not represent component maps +% accurately). +% 'icaact' = [float array] component activations. {default: computed from the +% input weight matrix} +% 'envmode' = ['avg'|'rms'] compute the average envelope or the root mean square +% envelope {default: 'avg'} +% 'sumenv' = ['on'|'off'|'fill'] 'fill' -> show the filled envelope of the summed +% projections of the selected components; 'on' -> show the envelope +% only {default: 'fill'} +% 'actscale' = ['on'|'off'] scale component scalp maps by maximum component activity +% in the designated (limcontrib) interval. 'off' -> scale scalp maps +% individually using +/- max(abs(map value)) {default: 'off'} +% 'dispmaps' = ['on'|'off'] display component numbers and scalp maps {default: 'on'} +% 'topoplotkey','val' = optional additional topoplot() arguments {default: none} +% +% Outputs: +% +% cmpvarorder = component numbers in decreasing order of max variance in data +% cmpvars = ('sortvar') max power for all components tested, sorted +% from highest to lowest. See 'sortvar' 'mp' +% cmpframes = frames of comvars for each component plotted +% cmptimes = times of compvars for each component plotted +% cmpsplotted = indices of components plotted. +% unsorted_compvars = compvars(compsplotted); +% sortvar = The computed data used to sort components with. +% See 'sortvar' option above. +% +% Notes: +% To label maps with other than component numbers, put four-char strings into +% a local (pwd) file named 'envtopo.labels' (using . = space) in time-order +% of their projection maxima +% +% Authors: Scott Makeig & Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 3/1998 +% +% See also: timtopo() axcopy() + +% Copyright (C) 3-10-98 from timtopo.m Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Edit History: +% 3-18-98 fixed bug in LineStyle for fifth component, topoplot maxproj with +% correct orientations, give specified component number labels -sm +% 4-28-98 plot largest components, ranked by max projected variance -sm +% 4-30-98 fixed bug found in icademo() -sm +% 5-08-98 fixed bug found by mw () -sm +% 5-23-98 made vert. line styles for comps 6 & 11 correct -sm +% 5-30-98 added 'envtopo.labels' option -sm +% 5-31-98 implemented plotchans arg -sm +% 7-13-98 gcf->gca to allow plotting in subplots -sm +% 9-18-98 worked more to get plotting in subplot to work -- no luck yet! -sm +% 2-22-99 draw oblique line to max env value if data clipped at max proj -sm +% 2-22-99 added colorfile -sm +% 4-17-99 added support for drawing in subplots -t-pj +% 10-29-99 new versions restores search through all components for max 7 and adds +% return variables (>7 if specified. Max of 7 comp envs still plotted. -sm +% 11-17-99 debugged new version -sm +% 12-27-99 improved help msg, moved new version to distribution -sm +% 01-21-00 added 'bold' option for colorfile arg -sm +% 02-28-00 added fill_comp_env arg -sm +% 03-16-00 added axcopy() -sm & tpj +% 05-02-00 added vert option -sm +% 05-30-00 added option to show "envelope" of only 1 channel -sm +% 09-07-00 added [-n] option for compnums, added BOLD_COLORS as default -sm +% 12-19-00 updated icaproj() args -sm +% 12-22-00 trying 'axis square' for topoplots -sm +% 02-02-01 fixed bug in printing component 6 env line styles -sm +% 04-11-01 added [] default option for args -sm +% 01-25-02 reformated help & license, added links -ad +% 03-15-02 added readlocs and the use of eloc input structure -ad +% 03-16-02 added all topoplot options -ad + +function [compvarorder,compvars,compframes,comptimes,compsplotted,sortvar] = envtopo(data,weights,varargin) + +% icadefs; % read toolbox defaults + +sortvar = []; +all_bold = 0; +BOLD_COLORS = 1; % 1 = use solid lines for first 5 components plotted + % 0 = use std lines according to component rank only +FILL_COMP_ENV = 0; % default no fill +FILLCOLOR = [.815 .94 1]; % use lighter blue for better env visibility +% FILLCOLOR = [.66 .76 1]; +MAXTOPOS = 20; % max topoplots to plot +VERTWEIGHT = 2.0; % lineweight of specified vertical lines +LIMCONTRIBWEIGHT = 1.2; % lineweight of limonctrib vertical lines +MAX_FRAMES = 10000; % maximum frames to plot +MAXENVPLOTCHANS = 10; +myfig =gcf; % remember the current figure (for Matlab 7.0.0 bug) +xmin = 0; xmax = 0; + +if nargin < 2 + help envtopo + return +end + +if nargin <= 2 | isstr(varargin{1}) + % 'key' 'val' sequences + fieldlist = { 'chanlocs' '' [] [] ; + 'title' 'string' [] ''; + 'limits' 'real' [] 0; + 'timerange' 'real' [] []; + 'plotchans' 'integer' [1:size(data,1)] [] ; + 'icawinv' 'real' [] pinv(weights) ; + 'icaact' 'real' [] [] ; + 'voffsets' 'real' [] [] ; + 'vert' 'real' [] [] ; + 'fillcomp' 'integer' [] 0 ; + 'colorfile' 'string' [] '' ; + 'colors' 'string' [] '' ; + 'compnums' 'integer' [] []; + 'compsplot' 'integer' [] 7; + 'subcomps' 'integer' [] 0; + 'envmode' 'string' {'avg','rms'} 'avg'; + 'dispmaps' 'string' {'on','off'} 'on'; + 'pvaf' 'string' {'mp','mv','on','rp','rv','pv','pvaf','pp','off',''} ''; + 'sortvar' 'string' {'mp','mv','rp','rv','pv','pvaf','pp'} 'mp'; + 'actscale' 'string' {'on','off'} 'off'; + 'limcontrib' 'real' [] 0; + 'topoarg' 'real' [] 0; + 'sumenv' 'string' {'on','off','fill'} 'fill'}; + + % Note: Above, previous 'pvaf' arguments 'on' -> 'pv', 'off' -> 'rv' + % for backwards compatibility 11/2004 -sm + + [g varargin] = finputcheck( varargin, fieldlist, 'envtopo', 'ignore'); + if isstr(g), error(g); end; + +else % dprecated - old style input args + if nargin > 3, g.chanlocs = varargin{1}; + else g.chanlocs = []; + end; + if isstr(varargin{2}), help envtopo; return; end + if nargin > 4, g.limits = varargin{2}; + else g.limits = 0; % []; + end; + if isstr(varargin{3}), help envtopo; return; end + if nargin > 5, g.compnums = varargin{3}; + else g.compnums = []; + end; + if ~isstr(varargin{4}), help envtopo; return; end + if nargin > 6, g.title = varargin{4}; + else g.title = ''; + end; + if isstr(varargin{5}), help envtopo; return; end + if nargin > 7, g.plotchans = varargin{5}; + else g.plotchans = []; + end; + if isstr(varargin{6}), help envtopo; return; end + if nargin > 8, g.voffsets = varargin{6}; + else g.voffsets = []; + end; + if isstr(varargin{7}), help envtopo; return; end + if nargin > 9, g.colorfile = varargin{7}; + else g.colorfile = ''; + g.colors = ''; + end; + if isstr(varargin{8}), help envtopo; return; end + if nargin > 10, g.fillcomp = varargin{8}; + else g.fillcom = 0; + end; + if isstr(varargin{9}), help envtopo; return; end + if nargin > 11, g.vert = varargin{9}; + else g.vert = []; + end; + if nargin > 12, varargin =varargin(10:end); end; + g.sumenv = 'on'; + g.sortvar = 'mp'; + g.pvaf = []; + g.timerange = []; + g.icaact = []; + g.limcontrib = 0; + g.icawinv = pinv(weights); + g.subcomps = 0; + g.envmode = 'avg'; + g.dispmaps = 'on'; +end; + +if ~isempty(g.pvaf) + g.sortvar = g.pvaf; % leave deprecated g.pvaf behind. +end + +if strcmpi(g.sortvar,'on') | strcmpi(g.sortvar,'pvaf') | strcmpi(g.sortvar,'mv') + g.sortvar = 'mp'; % update deprecated flags +end +if strcmpi(g.sortvar,'off') | strcmp(g.sortvar,'rv') + g.sortvar = 'rp'; +end + + +% +% Check input flags and arguments +% +if ndims(data) == 3 + data = mean(data,3); % average the data if 3-D +end; +[chans,frames] = size(data); + +if frames > MAX_FRAMES + error('number of data frames to plot too large!'); +end + +if isstr(g.chanlocs) + g.chanlocs = readlocs(g.chanlocs); % read channel location information + if length(g.chanlocs) ~= chans + fprintf(... + 'envtopo(): locations for the %d data channels not in the channel location file.\n', ... + chans); + return + end +end + +if ~isempty(g.colors) + g.colorfile = g.colors; % retain old usage 'colorfile' for 'colors' -sm 4/04 +end + +if ~isempty(g.vert) + g.vert = g.vert/1000; % convert from ms to s +end +% +%%%%%% Collect information about the gca, then delete it %%%%%%%%%%%%% +% +uraxes = gca; % the original figure or subplot axes +pos=get(uraxes,'Position'); +axcolor = get(uraxes,'Color'); +delete(gca) + +% +%%% Convert g.timerange, g.limits and g.limcontrib to sec from ms %%%% +% +g.timerange = g.timerange/1000; % the time range of the input data +g.limits(1) = g.limits(1)/1000; % the time range to plot +if length(g.limits) == 1 % make g.limits at least of length 2 + g.limits(1) = 0; g.limits(2) = 0; +else + g.limits(2) = g.limits(2)/1000; % +end; +g.limcontrib = g.limcontrib/1000; % the time range in which to select largest components + +% +%%%%%%%%%%%% Collect time range information %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if length(g.limits) == 3 | length(g.limits) > 4 % if g.limits wrong length + fprintf('envtopo: limits should be 0, [minms maxms], or [minms maxms minuV maxuV].\n'); +end + +xunitframes = 0; % flag plotting if xmin & xmax are in frames instead of sec +if ~isempty(g.timerange) % if 'timerange' given + if g.limits(1)==0 & g.limits(2)==0 + g.limits(1) = min(g.timerange); % if no time 'limits + g.limits(2) = max(g.timerange); % plot whole data epoch + end +else % if no 'timerange' given + if g.limits(1)==0 & g.limits(2)==0 % if no time limits as well, + fprintf('\nNOTE: No time limits given: using 0 to %d frames\n',frames-1); + g.limits(1) = 0; + g.limits(2) = frames-1; + xunitframes = 1; % mark frames as time unit instead of sec + end +end + +if isempty(g.timerange) + xmin = g.limits(1); % (xmin, xmax) are data limits in sec + xmax = g.limits(2); +else + xmin = g.timerange(1); % (xmin, xmax) are data limits in sec + xmax = g.timerange(2); +end + +pmin = g.limits(1); % plot min and max sec +if pmin < xmin + pmin = xmin; % don't allow plotting beyond the data limits +end +pmax = g.limits(2); +if pmax > xmax + pmax = xmax; +end + +dt = (xmax-xmin)/(frames-1); % sampling interval in sec +times=xmin*ones(1,frames)+dt*(0:frames-1); % time points in sec + +% +%%%%%%%%%%%%%%% Find limits of the component selection window %%%%%%%%% +% +if any(g.limcontrib ~= 0) + if xunitframes + g.limcontrib = g.limcontrib*1000; % if no time limits, interpret + end % limcontrib as frames + if g.limcontrib(1)xmax + g.limcontrib(2) = xmax; + end + srate = (frames-1)/(xmax-xmin); + limframe1 = round((g.limcontrib(1)-xmin)*srate)+1; + limframe2 = round((g.limcontrib(2)-xmin)*srate)+1; + g.vert(end+1) = g.limcontrib(1); + g.vert(end+1) = g.limcontrib(2); +else + limframe1 = 1; + limframe2 = frames; +end; + +% +%%%%%%%%%%%%%%%%%%%%% Read line color information %%%%%%%%%%%%%%%%%%%%% +% +ENVCOLORS = strvcat('w..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..','m..','c..','r..','g..','b..'); + +if isempty(g.colorfile) + g.colorfile = ENVCOLORS; % use default color order above +elseif ~isstr(g.colorfile) + error('Color file name must be a string.'); +end +if strcmpi(g.colorfile,'bold') + all_bold = 1; + g.colorfile = ENVCOLORS; % default colors +end +if exist(g.colorfile) == 2 % if an existing file + cid = fopen(g.colorfile,'r'); + if cid <3, + error('cannot open color file'); + else + colors = fscanf(cid,'%s',[3 MAXENVPLOTCHANS]); + colors = colors'; + end; +else + colors = g.colorfile; +end +[r c] = size(colors); + for i=1:r + for j=1:c + if colors(i,j)=='.', + if j==1 + error('Color file should have color letter in 1st column.'); + elseif j==2 + colors(i,j)='-'; + elseif j>2 + colors(i,j)=' '; + end; + end; + end; + end; +colors(1,1) = 'k'; % make sure 1st color (for data envelope) is black + +% +%%%%%%%%%%%%%%%% Check other input variables %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +[wtcomps,wchans] = size(weights); +if wchans ~= chans + error('Sizes of weights and data do not agree'); +end +if wtcomps ~= chans + fprintf('Number of components not the same as number of channels.\n'); + fprintf(' - component scalp maps and time courses may not be correct.\n'); +end + +if isempty(g.voffsets) | ( size(g.voffsets) == [1,1] & g.voffsets(1) == 0 ) + g.voffsets = zeros(1,MAXTOPOS); +end +if isempty(g.plotchans) | g.plotchans(1)==0 + g.plotchans = 1:chans; +end +if max(g.plotchans) > chans | min(g.plotchans) < 1 + error('invalid ''plotchan'' index'); +end + +if g.compsplot < 0 + g.compsplot = abs(g.compsplot); +end + +if g.compnums < 0 % legacy syntax + g.compsplot = abs(g.compnums); + g.compnums = []; +end +if isempty(g.compnums) | g.compnums(1) == 0 + g.compnums = 1:wtcomps; % by default, select from all components +end + +if g.compsplot > MAXTOPOS + fprintf('Can only plot a maximum of %d components.\n',MAXTOPOS); + return +else + MAXTOPOS = g.compsplot; +end + +if max(g.compnums) > wtcomps | min(g.compnums)< 1 + error('Keyword ''compnums'' out of range (1 to %d)', wtcomps); +end + +g.subcomps = abs(g.subcomps); % don't pass negative channel numbers +if max(g.subcomps) > wtcomps + error('Keyword ''subcomps'' argument out of bounds'); +end + +% +%%%%%%%%%%%%%%% Subtract components from data if requested %%%%%%%%%%%%% +% + +ncomps = length(g.compnums); + +if isempty(g.subcomps) % remove all but compnums + g.subcomps = 1:wtcomps; + g.subcomps(g.compnums) = []; +else + % g.subcomps 0 -> subtract no comps + % list -> subtract subcomps list + if min(g.subcomps) < 1 + if length(g.subcomps) > 1 + error('Keyword ''subcomps'' argument incorrect.'); + end + g.subcomps = []; % if subcomps contains a 0 (or <1), don't remove components + elseif max(g.subcomps) > wtcomps + error('Keyword ''subcomps'' argument out of bounds.'); + end +end + +g.icaact = weights*data; +if ~isempty(g.subcomps) + fprintf('Subtracting requested components from plotting data: '); + for k = 1:length(g.subcomps) + fprintf('%d ',g.subcomps(k)); + if ~rem(k,32) + fprintf('\n'); + end + end + fprintf('\n'); + g.icaact(g.subcomps,:) = zeros(length(g.subcomps),size(data,2)); +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% Process components %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +for i=1:ncomps-1 + if g.compnums(i) == 0 + fprintf('Removing component number 0 from compnums.\n'); + g.compnums(i)=[]; + elseif g.compnums(i)>wtcomps + fprintf('compnums(%d) > number of comps (%d)?\n',i,wtcomps); + return + end + for j=i+1:ncomps + if g.compnums(i)==g.compnums(j) + fprintf('Removing repeated component number (%d) in compnums.\n',g.compnums(i)); + g.compnums(j)=[]; + end + end +end + +limitset = 0; +if isempty(g.limits) + g.limits = 0; +end +if length(g.limits)>1 + limitset = 1; +end + +% +%%%%%%%%%%%%%%% Compute plotframes and envdata %%%%%%%%%%%%%%%%%%%%% +% +ntopos = length(g.compnums); +if ntopos > MAXTOPOS + ntopos = MAXTOPOS; % limit the number of topoplots to display +end + +if max(g.compnums) > wtcomps | min(g.compnums)< 1 + fprintf(... + 'envtopo(): one or more compnums out of range (1,%d).\n',wtcomps); + return +end + +plotframes = ones(ncomps); + +% toby 2.16.2006: maxproj will now contain all channel info, in case +% plotgrid is called in topoplot. +% NOT maxproj = zeros(length(g.plotchans),ncomps); +maxproj = zeros(chans,ncomps); + +% +% first, plot the data envelope +% +envdata = zeros(2,frames*(ncomps+1)); +envdata(:,1:frames) = envelope(g.icawinv(g.plotchans,:)*g.icaact, g.envmode); + +fprintf('Data epoch is from %.0f ms to %.0f ms.\n',1000*xmin,1000*xmax); +fprintf('Plotting data from %.0f ms to %.0f ms.\n',1000*xmin,1000*xmax); +fprintf('Comparing maximum projections for components: \n'); + if ncomps>32 + fprintf('\n'); + end + +compvars = zeros(1,ncomps); +mapsigns = zeros(1,ncomps); + +% +% Compute frames to plot +% +sampint = (xmax-xmin)/(frames-1); % sampling interval in sec +times = xmin:sampint:xmax; % make vector of data time values + +[v minf] = min(abs(times-pmin)); +[v maxf] = min(abs(times-pmax)); +pframes = minf:maxf; % frames to plot +ptimes = times(pframes); % times to plot +if limframe1 < minf + limframe1 = minf; +end +if limframe2 > maxf + limframe2 = maxf; +end + +% +%%%%%%%%%%%%%% find max variances and their frame indices %%%%%%%%%%% +% + +if strcmp(g.sortvar,'pv') %Changed -Jean + % Variance of the data in the interval, for calculating sortvar. + vardat = mean(var(data(g.plotchans,limframe1:limframe2),1)); +else + % Compute data rms for sortvar + powdat = mean(mean(data(g.plotchans,limframe1:limframe2).^2)); +end + +for c = 1:ncomps + + if isempty(g.icaact) % make the back-projection of component c + + % Changed to include all channels in computation for use in + % topoplot, particularly with plotgrid option. toby 2.16.2006 + proj = g.icawinv(:,g.compnums(c))*weights(g.compnums(c),:)*data; + else + proj = g.icawinv(:,g.compnums(c))*g.icaact(g.compnums(c),:); + end; + + % save the comp envelope for plotting component waveforms + envdata(:,c*frames+1:(c+1)*frames) = envelope(proj(g.plotchans,:), g.envmode); + + % Find the frame (timepoint) of largest rms component value + % and the relative value to those channels defined by plotchans. + if length(g.plotchans) > 1 + [maxval,maxi] = max(mean((proj(g.plotchans,limframe1:limframe2)).^2)); + else % g.plotchans == 1 --> find absmax value + [maxval,maxi] = max((abs(proj(g.plotchans,limframe1:limframe2)))); + end + maxi = maxi+limframe1-1; + + % plotframes and compvars are needed for plotting the lines indicating + % the timepoint a topoplot refers to. + plotframes(c) = maxi; + compvars(c) = maxval; % find value of max variance for comp c + maxproj(:,c) = proj(:,maxi); % maxproj now contains all channels, to handle + % the 'plotchans'/topoplot'gridplot' conflict. + % Toby 2.17.2006 + % + %%%%%% Calculate sortvar, used to sort the components %%%%%%%%%%% + % + if strcmpi(g.sortvar,'mp') % Maximum Power of backproj + sortvar(c) = maxval; + fprintf('IC%1.0f maximum mean power of back-projection: %g\n',c,sortvar(c)); + + elseif strcmpi(g.sortvar, 'pv') % Percent Variance + % toby 2.19.2006: Changed to be consistent with eeg_pvaf(). + sortvar(c) = 100-100*mean(var(data(g.plotchans,limframe1:limframe2)... + - proj(g.plotchans,limframe1:limframe2),1))/vardat; + fprintf('IC%1.0f percent variance accounted for(pvaf): %2.2f%%\n',c,sortvar(c)); + + elseif strcmpi(g.sortvar,'pp') % Percent Power + sortvar(c) = 100-100*mean(mean((data(g.plotchans,limframe1:limframe2)... + - proj(g.plotchans,limframe1:limframe2)).^2))/powdat; + fprintf('IC%1.0f percent power accounted for(ppaf): %2.2f%%\n',c,sortvar(c)); + + elseif strcmpi(g.sortvar,'rp') % Relative Power + sortvar(c) = 100*mean(mean((proj(g.plotchans,limframe1:limframe2)).^2))/powdat; + fprintf('IC%1.0f relative power of back-projection: %g\n',c,sortvar(c)); + else + error('''sortvar'' argument unknown'); + end; + +end % component c +fprintf('\n'); + +% +%%%%%%%%%%%%%%% Compute component selection criterion %%%%%%%%%%%%%%%%%%%%%%%%%% +% + +% compute sortvar +if ~xunitframes + fprintf(' in the interval %3.0f ms to %3.0f ms.\n',... + 1000*times(limframe1),1000*times(limframe2)); +end + +[sortsortvar spx] = sort(sortvar); +sortsortvar = sortsortvar(end:-1:1); +spx = spx(end:-1:1); +npercol = ceil(ncomps/3); + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Sort the components %%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +[tmp,compx] = sort(sortvar'); % sort compnums on sortvar (as defined by input + % 'sortvar', default is 'mp'). +compx = compx(ncomps:-1:1); % reverse order of sort +compvars = compvars(ncomps:-1:1)';% reverse order of sort (output var) +compvarorder = g.compnums(compx); % actual component numbers (output var) +plotframes = plotframes(compx); % plotted comps have these max frames +compframes = plotframes'; % frame of max variance in each comp (output var) +comptimes = times(plotframes(compx)); % time of max variance in each comp (output var) +compsplotted = compvarorder(1:ntopos); % (output var) + +% +%%%%%%%%%%%%%%%%%%%%%%%% Reduce to ntopos %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +[plotframes,ifx] = sort(plotframes(1:ntopos));% sort plotframes on their temporal order +plottimes = times(plotframes); % convert to times in ms +compx = compx(ifx); % indices into compnums, in plotting order +maporder = g.compnums(compx); % comp. numbers, in plotting order (l->r) +maxproj = maxproj(:,compx); % maps in plotting order + +vlen = length(g.voffsets); % extend voffsets if necessary +while vlen< ntopos + g.voffsets = [g.voffsets g.voffsets(vlen)]; % repeat last offset given + vlen=vlen+1; +end + +head_sep = 1.2; +topowidth = pos(3)/(ntopos+(ntopos-1)/5); % width of each topoplot +if topowidth > 0.20 % adjust for maximum height + topowidth = 0.2; +end + +if rem(ntopos,2) == 1 % odd number of topos + topoleft = pos(3)/2 - (floor(ntopos/2)*head_sep + 0.5)*topowidth; +else % even number of topos + topoleft = pos(3)/2 - (floor(ntopos/2)*head_sep)*topowidth; +end + +% +%%%%%%%%%%%%%%%%%%%% Print times and frames of comp maxes %%%%%%%%%%%%%% +% + +% fprintf('\n'); +fprintf('Plotting envelopes of %d component projections.\n',ntopos); +if length(g.plotchans) ~= chans + fprintf('Envelopes computed from %d specified data channels.\n',... + length(g.plotchans)); +end + +fprintf('Topo maps will show components: '); +for t=1:ntopos + fprintf('%4d ',maporder(t)); +end + +fprintf('\n'); +if ~xunitframes + fprintf(' with max var at times (ms): '); + for t=1:ntopos + fprintf('%4.0f ',1000*plottimes(t)); + end + fprintf('\n'); +end + +fprintf(' epoch frames: '); +for t=1:ntopos + fprintf('%4d ',limframe1-1+plotframes(t)); +end +fprintf('\n'); + +fprintf(' Component sortvar in interval: '); +for t=1:ntopos + fprintf('%4.2f ',sortvar(t)); +end +fprintf('\n'); + +sumproj = zeros(size(data(g.plotchans,:))); % toby 2.21.2006 REDUNDANT CALCULATIONS! +for n = 1:ntopos + if isempty(g.icaact) + sumproj = sumproj + ... + g.icawinv(g.plotchans,maporder(n))*weights(maporder(n),:)*data; + else + sumproj = sumproj + g.icawinv(g.plotchans,maporder(n))*g.icaact(maporder(n),:); + % updated -sm 11/04 + end; % Note: sumproj here has only g.plotchans +end +rmsproj = mean(mean((data(g.plotchans,limframe1:limframe2).^2))); % find data rms in interval + +if strcmpi(g.sortvar,'rp') + sumppaf = mean(mean(sumproj(:,limframe1:limframe2).^2)); + sumppaf = 100*sumppaf/rmsproj; + ot = 'rp'; +else + sumppaf = mean(mean((data(g.plotchans,limframe1:limframe2) ... + - sumproj(:,limframe1:limframe2)).^2)); + sumppaf = 100-100*sumppaf/rmsproj; + ot = 'ppaf'; +end; + +if ~xunitframes + fprintf(' Summed component ''%s'' in interval [%4g %4g] ms: %4.2f%%\n',... + ot, 1000*times(limframe1),1000*times(limframe2), sumppaf); +end + +% +% Collect user-supplied Y-axis information +% Edited and moved here from 'Collect Y-axis information' section below -Jean +% +if length(g.limits) == 4 + if g.limits(3)~=0 | g.limits(4)~=0 % collect plotting limits from 'limits' + ymin = g.limits(3); + ymax = g.limits(4); + ylimset = 1; + end +else + ylimset = 0; % flag whether hard limits have been set by the user + ymin = min(min(g.icawinv(g.plotchans,:)*g.icaact(:,pframes))); % begin by setting limits from plotted data + ymax = max(max(g.icawinv(g.plotchans,:)*g.icaact(:,pframes))); +end + +fprintf(' Plot limits (sec, sec, uV, uV) [%g,%g,%g,%g]\n\n',xmin,xmax, ymin,ymax); + +% +%%%%%%%%%%%%%%%%%%%%% Plot the data envelopes %%%%%%%%%%%%%%%%%%%%%%%%% +% +BACKCOLOR = [0.7 0.7 0.7]; +FONTSIZE=12; +FONTSIZEMED=10; +FONTSIZESMALL=8; +newaxes=axes('position',pos); +axis off +set(newaxes,'FontSize',FONTSIZE,'FontWeight','Bold','Visible','off'); +set(newaxes,'Color',BACKCOLOR); % set the background color +delete(newaxes) %XXX + +% site the plot at bottom of the current axes +axe = axes('Position',[pos(1) pos(2) pos(3) 0.6*pos(4)],... + 'FontSize',FONTSIZE,'FontWeight','Bold'); + +g.limits = get(axe,'Ylim'); +set(axe,'GridLineStyle',':') +set(axe,'Xgrid','off') +set(axe,'Ygrid','on') +axes(axe) +set(axe,'Color',axcolor); + +% +%%%%%%%%%%%%%%%%% Plot the envelope of the summed selected components %%%%%%%%%%%%%%%%% +% +if BOLD_COLORS==1 + mapcolors = 1:ntopos+1; +else + mapcolors = [1 maporder+1]; +end + +if strcmpi(g.sumenv,'on') | strcmpi(g.sumenv,'fill') %%%%%%%% if 'sunvenv' %%%%%%%%% + sumenv = envelope(sumproj(:,:), g.envmode); + if ~ylimset & max(sumenv) > ymax, ymax = max(sumenv(1,:)); end + if ~ylimset & min(sumenv) < ymin, ymin = min(sumenv(2,:)); end + if strcmpi(g.sumenv,'fill') + % + % Plot the summed projection filled + % + mins = matsel(sumenv,frames,0,2,0); + p=fill([times times(frames:-1:1)],... + [matsel(sumenv,frames,0,1,0) mins(frames:-1:1)],FILLCOLOR); + set(p,'EdgeColor',FILLCOLOR); + hold on + % + % Overplot the data envelope so it is not covered by the fill()'d component + % + p=plot(times,matsel(envdata,frames,0,1,1),colors(mapcolors(1),1));% plot the max + set(p,'LineWidth',2); % component order (if BOLD_COLORS==0) + p=plot(times,matsel(envdata,frames,0,2,1),colors(mapcolors(1),1));% plot the min + set(p,'LineWidth',2); % component order (if BOLD_COLORS==0) + + else % if no 'fill' + tmp = matsel(sumenv,frames,0,2,0); + p=plot(times,tmp);% plot the min + hold on + set(p,'color',FILLCOLOR); + set(p,'linewidth',2); + p=plot(times,matsel(sumenv,frames,0,1,0));% plot the max + set(p,'linewidth',2); + set(p,'color',FILLCOLOR); + end +end + +if strcmpi(g.sortvar,'rp') + t = text(double(xmin+0.1*(xmax-xmin)), ... + double(ymin+0.1*(ymax-ymin)), ... + ['rp ' num2str(sumppaf,'%4.2f') '%']); +else + t = text(double(xmin+0.1*(xmax-xmin)), ... + double(ymin+0.1*(ymax-ymin)), ... + ['ppaf ' num2str(sumppaf,'%4.2f') '%']); +end +set(t,'fontsize',FONTSIZESMALL,'fontweight','bold') + +% +% %%%%%%%%%%%%%%%%%%%%%%%% Plot the computed component envelopes %%%%%%%%%%%%%%%%%% +% + envx = [1;compx+1]; + for c = 1:ntopos+1 + curenv = matsel(envdata,frames,0,1,envx(c)); + if ~ylimset & max(curenv) > ymax, ymax = max(curenv); end + p=plot(times,curenv,colors(mapcolors(c),1));% plot the max + set(gca,'FontSize',FONTSIZESMALL,'FontWeight','Bold') + if c==1 % Note: use colors in original + set(p,'LineWidth',2); % component order (if BOLD_COLORS==0) + else + set(p,'LineWidth',1); + end + if all_bold > 0 + set(p,'LineStyle','-','LineWidth',3); + elseif mapcolors(c)>15 % thin/dot 16th-> comp. envs. + set(p,'LineStyle',':','LineWidth',1); + elseif mapcolors(c)>10 % + set(p,'LineStyle',':','LineWidth',2); + elseif mapcolors(c)>6 % dot 6th-> comp. envs. + set(p,'LineStyle',':','LineWidth',3); + elseif mapcolors(c)>1 + set(p,'LineStyle',colors(mapcolors(c),2),'LineWidth',1); + if colors(mapcolors(c),2) == ':' + set(l1,'LineWidth',2); % embolden dotted env lines + end + end + hold on + curenv = matsel(envdata,frames,0,2,envx(c)); + if ~ylimset & min(curenv) < ymin, ymin = min(curenv); end + p=plot(times,curenv,colors(mapcolors(c),1));% plot the min + + if c==1 + set(p,'LineWidth',2); + else + set(p,'LineWidth',1); + end + if all_bold > 0 + set(p,'LineStyle','-','LineWidth',3); + elseif mapcolors(c)>15 % thin/dot 11th-> comp. envs. + set(p,'LineStyle',':','LineWidth',1); + elseif mapcolors(c)>10 + set(p,'LineStyle',':','LineWidth',2); + elseif mapcolors(c)>6 % dot 6th-> comp. envs. + set(p,'LineStyle',':','LineWidth',3); + elseif mapcolors(c)>1 + set(p,'LineStyle',colors(mapcolors(c),2),'LineWidth',1); + if colors(mapcolors(c),2) == ':' + set(l1,'LineWidth',2); % embolden dotted env lines + end + end + if c==1 & ~isempty(g.vert) + for v=1:length(g.vert) + vl=plot([g.vert(v) g.vert(v)], [-1e10 1e10],'k--'); % plot specified vertical lines + if any(g.limcontrib ~= 0) & v>= length(g.vert)-1; + set(vl,'linewidth',LIMCONTRIBWEIGHT); + set(vl,'linestyle',':'); + else + set(vl,'linewidth',VERTWEIGHT); + set(vl,'linestyle','--'); + end + end + end + if g.limits(1) <= 0 & g.limits(2) >= 0 % plot vertical line at time zero + vl=plot([0 0], [-1e10 1e10],'k'); + set(vl,'linewidth',2); + end + + % + % plot the n-th component filled + % + if g.fillcomp(1)>0 & find(g.fillcomp==c-1) + fprintf('filling the envelope of component %d\n',c-1); + mins = matsel(envdata,frames,0,2,envx(c)); + p=fill([times times(frames:-1:1)],... + [matsel(envdata,frames,0,1,envx(c)) mins(frames:-1:1)],... + colors(mapcolors(c),1)); + % + % Overplot the data envlope again so it is not covered by the fill()'d component + % + p=plot(times,matsel(envdata,frames,0,1,envx(1)),colors(mapcolors(1),1));% plot the max + set(p,'LineWidth',2); % component order (if BOLD_COLORS==0) + p=plot(times,matsel(envdata,frames,0,2,envx(1)),colors(mapcolors(1),1));% plot the min + set(p,'LineWidth',2); % component order (if BOLD_COLORS==0) + end + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% +%%%%%%%%%%%%%%%%%%%%%%% Extend y limits by 5% %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~ylimset + datarange = ymax-ymin; + ymin = ymin-0.05*datarange; + ymax = ymax+0.05*datarange; +end +axis([pmin pmax ymin ymax]); + +% +%%%%%%%%%%%%%%%%%%%%%% Label axes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +set(axe,'Color',axcolor); +if ~xunitframes + l= xlabel('Time (s)'); +else % xunitframes == 1 + l= xlabel('Data (time points)'); +end +set(l,'FontSize',FONTSIZEMED,'FontWeight','Bold'); +if strcmpi(g.envmode, 'avg') + l=ylabel('Potential (uV)'); +else + l=ylabel('RMS of uV'); +end; +set(l,'FontSize',FONTSIZEMED,'FontWeight','Bold'); +% +%%%%%%%%%%%%%% Draw maps and oblique/vertical lines %%%%%%%%%%%%%%%%%%%%% +% +% axall = axes('Units','Normalized','Position',pos,... +axall = axes('Position',pos,... + 'Visible','Off','Fontsize',FONTSIZE); % whole-figure invisible axes +axes(axall) +set(axall,'Color',axcolor); +axis([0 1 0 1]) + +width = xmax-xmin; +pwidth = pmax-pmin; +height = ymax-ymin; + +if strcmpi(g.dispmaps, 'on') + for t=1:ntopos % draw oblique lines from max env vals (or plot top) + % to map bases, in left to right order + % + %%%%%%%%%%%%%%%%%%% draw oblique lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if BOLD_COLORS==1 + linestyles = 1:ntopos; + else + linestyles = maporder; + end + axes(axall) + axis([0 1 0 1]); + set(axall,'Visible','off'); + maxenv = matsel(envdata,frames,plotframes(t),1,compx(t)+1); + % max env val + data_y = 0.6*(g.voffsets(t)+maxenv-ymin)/height; + if (data_y > pos(2)+0.6*pos(4)) + data_y = pos(2)+0.6*pos(4); + end + l1 = plot([(plottimes(t)-pmin)/pwidth ... + topoleft + 1/pos(3)*(t-1)*1.2*topowidth + (topowidth*0.6)],... + [data_y 0.68], ... + colors(linestyles(t)+1)); % 0.68 is bottom of topo maps + if all_bold > 0 + set(l1,'LineStyle','-','LineWidth',3); + elseif linestyles(t)>15 % thin/dot 11th-> comp. envs. + set(l1,'LineStyle',':','LineWidth',1); + elseif linestyles(t)>10 + set(l1,'LineStyle',':','LineWidth',2); + elseif linestyles(t)>5 % dot 6th-> comp. envs. + set(l1,'LineStyle',':','LineWidth',3); + elseif linestyles(t)>1 + set(l1,'LineStyle',colors(linestyles(t)+1,2),'LineWidth',1); + if colors(linestyles(t)+1,2) == ':' + set(l1,'LineStyle',colors(linestyles(t)+1,2),'LineWidth',2); + end + end + hold on + % + %%%%%%%%%%%%%%%%%%%% add specified vertical lines %%%%%%%%%%%%%%%%%%%%%%%%% + % + if g.voffsets(t) > 0 + l2 = plot([(plottimes(t)-xmin)/width ... + (plottimes(t)-xmin)/width],... + [0.6*(maxenv-ymin)/height ... + 0.6*(g.voffsets(t)+maxenv-ymin)/height],... + colors(linestyles(t)+1)); + if all_bold > 0 + set(l2,'LineStyle','-','LineWidth',3); + elseif linestyles(t)>15 % thin/dot 11th-> comp. envs. + set(l2,'LineStyle',':','LineWidth',1); + elseif linestyles(t)>10 + set(l2,'LineStyle',':','LineWidth',2); + elseif linestyles(t)>5 % dot 6th-> comp. envs. + set(l2,'LineStyle',':','LineWidth',3); + else + set(l1,'LineStyle',colors(linestyles(t)+1,2),'LineWidth',1); + if colors(linestyles(t)+1,2) == ':' + set(l1,'LineWidth',2); + end + end + end + set(gca,'Visible','off'); + axis([0 1 0 1]); + end % t +end; % if g.dispmaps == on + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot the topoplots %%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmpi(g.dispmaps, 'on') + + % common scale for colors + % ----------------------- + if strcmpi(g.actscale, 'on') + maxvolt = 0; + for n=1:ntopos + maxvolt = max(max(abs(maxproj(:,n))), maxvolt); + end; + end; + + [tmp tmpsort] = sort(maporder); + [tmp tmpsort] = sort(tmpsort); + + for t=1:ntopos % left to right order (maporder) + % axt = axes('Units','Normalized','Position',... + axt = axes('Units','Normalized','Position',... + [pos(3)*topoleft+pos(1)+(t-1)*head_sep*topowidth pos(2)+0.66*pos(4) ... + topowidth topowidth*head_sep]); + axes(axt) % topoplot axes + cla + + if ~isempty(g.chanlocs) % plot the component scalp maps + figure(myfig); + if ~isempty(varargin) + topoplot(maxproj(g.plotchans,t),g.chanlocs(g.plotchans), varargin{:}); + else % if no varargin specified + topoplot(maxproj(g.plotchans,t),g.chanlocs(g.plotchans),... + 'style','both','emarkersize',3); + end + axis square + set(gca, 'userdata', ... + ['text(-0.6, -0.6, ''' g.sortvar ': ' sprintf('%6.2f', sortvar(tmpsort(t))) ''');']); + else + axis off; + end; + + % + %%%%%%%%%%%%% Scale colors %%%%%%%%%%%%%%%%%%%%%%%%% + % + if strcmpi(g.actscale, 'on') + caxis([-maxvolt maxvolt]); + end; + % + %%%%%%%%%%%%%%%%%%%%%%%% label components %%%%%%%%%%%%%%%%%%%%%%% + % + if t==1 + chid = fopen('envtopo.labels','r'); + if chid <3, + numlabels = 1; + else + fprintf('Will label scalp maps with labels from file %s\n',... + 'envtopo.labels'); + compnames = fscanf(chid,'%s',[4 MAXPLOTDATACHANS]); + compnames = compnames'; + [r c] = size(compnames); + for i=1:r + for j=1:c + if compnames(i,j)=='.', + compnames(i,j)=' '; + end; + end; + end; + numlabels=0; + end + end + if numlabels == 1 + complabel = int2str(maporder(t)); % label comp. numbers + else + complabel = compnames(t,:); % use labels in file + end + text(0.00,0.80,complabel,'FontSize',FONTSIZEMED,... + 'FontWeight','Bold','HorizontalAlignment','Center'); + % axt = axes('Units','Normalized','Position',[0 0 1 1],... + axt = axes('Position',[0 0 1 1],... + 'Visible','Off','Fontsize',FONTSIZE); + set(axt,'Color',axcolor); % topoplot axes + drawnow + end + % + %%%%%%%%%%%%%%%%%%%%%%%%%%% Plot a colorbar %%%%%%%%%%%%%%%%%%%%%%%%%% + % + % axt = axes('Units','Normalized','Position',[.88 .58 .03 .10]); + axt = axes('Position',[pos(1)+pos(3)*1.015 pos(2)+0.6055*pos(4) ... + pos(3)*.02 pos(4)*0.09]); + if strcmpi(g.actscale, 'on') + h=cbar(axt, [1:64],[-maxvolt maxvolt],3); + else + h=cbar(axt); % colorbar axes + set(h,'Ytick',[]); + + axes(axall) + set(axall,'Color',axcolor); + tmp = text(0.50,1.05,g.title,'FontSize',FONTSIZE,... + 'HorizontalAlignment','Center',... + 'FontWeight','Bold'); + set(tmp, 'interpreter', 'none'); + text(1,0.68,'+','FontSize',FONTSIZE,'HorizontalAlignment','Center'); + % text(1,0.637,'0','FontSize',12,'HorizontalAlignment','Center',... + % 'verticalalignment','middle'); + text(1,0.61,'-','FontSize',FONTSIZE,'HorizontalAlignment','Center'); + end; + axes(axall) + set(axall,'layer','top'); % bring component lines to top + +end; +% +%%%%%%%%%%%%%%%%%%%%%%%%% turn on axcopy %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +axcopy(gcf, ... + 'if ~isempty(get(gca,''''userdata'''')), eval(get(gca,''''userdata''''));end;'); + +return %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function envdata = envelope(data, envmode) % also in release as env() + if nargin < 2 + envmode = 'avg'; + end; + if strcmpi(envmode, 'rms'); % return rms of pos and neg vals at each time point + warning off; + datnaeg = (data < 0).*data; % zero out positive values + dataneg = -sqrt(sum(dataneg.^2,1) ./ sum(negflag,1)); + + datapos = (data > 0).*data; % zero out negative values + datapos = sqrt(sum(datapos.^2,1) ./ sum(posflag,1)); + + envdata = [datapos;dataneg]; + warning on; + else % find max and min value at each time point + if size(data,1)>1 + maxdata = max(data); % max at each time point + mindata = min(data); % min at each time point + envdata = [maxdata;mindata]; + else + maxdata = max([data;data]); % max at each time point + mindata = min([data;data]); % min at each time point + envdata = [maxdata;mindata]; + end + end; + +return %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/epoch.m b/code/eeglab13_4_4b/functions/sigprocfunc/epoch.m new file mode 100644 index 0000000..f098f0a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/epoch.m @@ -0,0 +1,173 @@ +% epoch() - Extract epochs time locked to specified events from continuous EEG data. +% +% Usage: +% >> epocheddata = epoch( data, events, timelim); +% >> [epocheddata, newtime, indices, rerefevent, rereflatencies ] = ... +% epoch( data, events, timelim, 'key1', value1, ... ); +% +% Inputs: +% data - input data (chan,frames). In the case, data is a +% 3D array (chan, frames, epochs), epochs are extracted +% only if their time windows fall within existing +% pre-existing epochs. +% events - vector events (expressed in seconds or points) +% timelim - [init end] in second or points centered +% on the events (i.e. [-1 2]) +% +% Optional inputs: +% 'srate' - sampling rate in Hz for events expressed in seconds +% 'valuelim' - [min max] data limits. If one positive value is given, +% the opposite value is used for lower bound. For example, +% use [-50 50] to remove artifactual epoch. Default: none. +% 'verbose' - ['on'|'off']. Default is 'on'. +% 'allevents' - event vector containing the latencies of all events +% (not only those used for epoching). The function +% return an array 'rerefevent' which contain the latency +% of these events in each trials (assuming the events are +% included in the trial time window). These events can +% be in point or second but they must be in the same format +% as the events used for epoching. +% 'alleventrange' - for event selection, defines a time range [start end] (in +% seconds or data points) relative to the time-locking events. +% Default is same as 'timelim'. +% +% Outputs: +% epocheddata - output (chan, frames, epochs) +% indices - indices of accepted events +% newtime - new time limits. See notes. +% rerefevent - re-referenced event cell array (size nbepochs) of array +% indices for each epochs (note that the number of events +% per trial may vary). +% rereflatencies - re-referenced latencies event cell array (same as above +% but indicates event latencies in epochs instead of event +% indices). +% +% Note: maximum time limit will be reduced by one point with comparison to the +% input time limits. For instance at 100 Hz, 3 seconds last 300 points, +% but if we assign time 0 to the first point, then we must assign time +% 299 to the last point. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: pop_epoch(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [epochdat, newtime, indexes, alleventout, alllatencyout, reallim] = epoch( data, events, lim, varargin ); + +if nargin < 2 + help epoch; + return; +end; +alleventout = {}; + +% create structure +% ---------------- +if ~isempty(varargin) + try, g = struct(varargin{:}); + catch, error('Epoch: wrong syntax in function arguments'); end; +else + g = []; +end; + +try, g.srate; catch, g.srate = 1; end; +try, g.valuelim; catch, g.valuelim = [-Inf Inf]; end; +try, g.verbose; catch, g.verbose = 'on'; end; +try, g.allevents; catch, g.allevents = []; end; +try, g.alleventrange; catch, g.alleventrange = lim; end; + +% computing point limits +% ---------------------- +reallim(1) = round(lim(1)*g.srate); % compute offset +reallim(2) = round(lim(2)*g.srate-1); % compute offset + +% epoching +% -------- +fprintf('Epoching...\n'); +newdatalength = reallim(2)-reallim(1)+1; + +eeglab_options; +if option_memmapdata == 1 + epochdat = mmo([], [size(data,1), newdatalength, length(events)]); +else epochdat = zeros( size(data,1), newdatalength, length(events) ); +end; +g.allevents = g.allevents(:)'; +datawidth = size(data,2)*size(data,3); +dataframes = size(data,2); +indexes = zeros(length(events),1); +alleventout = {}; +alllatencyout = {}; +for index = 1:length(events) + pos0 = floor(events(index)*g.srate); % offset of time locking event + posinit = pos0+reallim(1); % compute offset + posend = pos0+reallim(2); % compute offset + + if floor((posinit-1)/dataframes) == floor((posend-1)/dataframes) && posinit >= 1 && posend <= datawidth % test if within boundaries + tmpdata = data(:,posinit:posend); + epochdat(:,:,index) = tmpdata; + if ~isinf(g.valuelim(1)) || ~isinf(g.valuelim(2)) + tmpmin = min(reshape(tmpdata, prod(size(tmpdata)),1)); + tmpmax = max(reshape(tmpdata, prod(size(tmpdata)),1)); + if (tmpmin > g.valuelim(1)) && (tmpmax < g.valuelim(2)) + indexes(index) = 1; + else + switch g.verbose, case 'on', fprintf('Warning: event %d out of value limits\n', index); end; + end; + else + indexes(index) = 1; + end; + else + switch g.verbose, case 'on', fprintf('Warning: event %d out of data boundary\n', index); end; + end; + + % rereference events + % ------------------ + if ~isempty(g.allevents) + posinit = pos0 + g.alleventrange(1)*g.srate; % compute offset + posend = pos0 + g.alleventrange(2)*g.srate; % compute offset + eventtrial = intersect_bc( find(g.allevents*g.srate >= posinit), find(g.allevents*g.srate <= posend) ); + alleventout{index} = eventtrial; + alllatencyout{index} = g.allevents(eventtrial)*g.srate-pos0; + end; +end; +newtime(1) = reallim(1)/g.srate; +newtime(2) = reallim(2)/g.srate; + +epochdat(:,:,find(indexes == 0)) = []; +indexes = find(indexes == 1); +%epochdat = epochdat(:,:,indexes); +if ~isempty(alleventout) + alleventout = alleventout(indexes); + alllatencyout= alllatencyout(indexes); +end; +reallim = reallim*g.srate; +return; + +%% GENERATION OF NAN IN ARRAYS (old implementation) +%% ------------------------------------------------ +%alleventout(index,1:length(eventtrial) ) = eventtrial+1000000; +%%then replace all zeros by Nan and subtract 1000000 +%if ~isempty(alleventout) +% alleventout( find( alleventout == 0) ) = nan; +% alleventout = alleventout(indexes,:) - 1000000; +% alllatencyout( find( alllatencyout == 0) ) = nan; +% alllatencyout = alllatencyout(indexes,:) - 1000000; +%end; + +function res = lat2point( lat, srate, pnts); + +res = lat*srate+1 + (epoch_array-1)*pnts; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/erpimage.m b/code/eeglab13_4_4b/functions/sigprocfunc/erpimage.m new file mode 100644 index 0000000..8ed99e1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/erpimage.m @@ -0,0 +1,3842 @@ +% erpimage() - Plot a colored image of a collection of single-trial data epochs, optionally +% sorted on and/or aligned to an input sorting variable and smoothed across +% trials with a Gaussian weighted moving-average. (To return event-aligned data +% without plotting, use eegalign()). Optionally sort trials on value, amplitude +% or phase within a specified latency window. Optionally plot the ERP mean +% and std. dev.and moving-window spectral amplitude and inter-trial coherence +% at aselected or peak frequency. Optionally 'time warp' the single trial +% time-domain (potential) or power data to align the plotted data to a series +% of events with varying latencies that occur in each trial. Click on +% individual figures parts to examine them separately and zoom (using axcopy()). +% Usage: +% >> figure; erpimage(data,[],times); % image trials as colored lines in input order +% +% >> figure; [outdata,outvar,outtrials,limits,axhndls, ... +% erp,amps,cohers,cohsig,ampsig,outamps,... +% phsangls,phsamp,sortidx,erpsig] ... +% = erpimage(data,sortvar,times,'title',avewidth,decimate,... +% 'key', 'val', ...); % use options +% Required input: +% data = [vector or matrix] Single-channel input data to image. +% Formats (1,frames*trials) or (frames,trials) +% +% Optional ordered inputs {with defaults}: +% +% sortvar = [vector | []] Variable to sort epochs on (length(sortvar) = nepochs) +% Example: sortvar may by subject response time in each epoch (in ms) +% {default|[]: plot in input order} +% times = [vector | []] vector of latencies (in ms) for each epoch time point. +% Else [startms ntimes srate] = [start latency (ms), time points +% (=frames) per epoch, sampling rate (Hz)]. Else [] -> 0:nframes-1 +% {default: []} +% 'title' = ['string'] Plot title {default: none} +% avewidth = [positive scalar (may be non-integer)]. If avg_type is set to 'boxcar' +% (the default), this is the number of trials used to smooth +% (vertically) with a moving-average. If avg_type is set to +% 'Gaussian,' this is the standard deviation (in units of +% trials) of the Gaussian window used to smooth (vertically) +% with a moving-average. Gaussian window extends three +% standard deviations below and three standard deviations above window +% center (trials beyond window are not incorporated into average). {default: no +% smoothing} +% decimate = Factor to decimate|interpolate ntrials by (may be non-integer) +% Else, if this is large (> sqrt(ntrials)), output this many epochs. +% {default|0->1} +% +% Optional unordered 'keyword',argument pairs: +% +% Re-align data epochs: +% 'align' = [latency] Time-lock data to sortvar. Plot sortvar at given latency +% (in ms). Else Inf -> plot sortvar at median sortvar latency +% {default: do not align} +% 'timewarp' = {[events], [warpms], {colors}} Time warp ERP, amplitude and phase +% time-courses before smoothing. 'events' is a matrix whose columns +% specify the latencies (in ms) at which a series of successive events occur +% in each trial. 'warpms' is an optional vector of latencies (in ms) to which +% the series of events should be time locked. (Note: Epoch start and end +% should not be declared as events or warpms}. If 'warpms' is absent or [], +% the median of each 'events' column will be used. {colors} contains a +% list of Matlab linestyles to use for vertical lines marking the occurrence +% of the time warped events. If '', no line will be drawn for this event +% column. If fewer colors than event columns, cycles through the given color +% labels. Note: Not compatible with 'vert' (below). +% 'renorm' = ['yes'|'no'| formula] Normalize sorting variable to epoch +% latency range and plot. 'yes'= autoscale. formula must be a linear +% transformation in the format 'a*x+b' +% Example of formula: '3*x+2'. {default: 'no'} +% If sorting by string values like event type, suggested formulas for: +% letter string: '1000*x', number string: '30000*x-1500' +% 'noplot' = ['on'|'off'] Do not plot sortvar {default: Plot sortvar if in times range} +% 'NoShow' = ['on'|'off'] Do not plot erpimage, simply return outputs {default: 'off'} +% +% Sort data epochs: +% 'nosort' = ['on'|'off'] Do not sort data epochs. {default: Sort data epochs by +% sortvar (see sortvar input above)} +% 'replace_ties' = ['yes'|'no'] Replace trials with the same value of +% sortvar with the mean of those trials. Only works if sorting trials +% by sortvar. {default: 'no'} +% 'valsort' = [startms endms direction] Sort data on (mean) value +% between startms and (optional) endms. Direction is 1 or -1. +% If -1, plot max-value epoch at bottom {default: sort on sortvar} +% 'phasesort' = [ms_center prct freq maxfreq topphase] Sort epochs by phase in +% a 3-cycle window centered at latency ms_center (ms). +% Percentile (prct) in range [0,100] gives percent of trials +% to reject for (too) low amplitude. Else, if in range [-100,0], +% percent of trials to reject for (too) high amplitude; +% freq (Hz) is the phase-sorting frequency. With optional +% maxfreq, sort by phase at freq of max power in the data in +% the range [freq,maxfreq] (Note: 'phasesort' arg freq overrides +% the frequency specified in 'coher'). With optional topphase, +% sort by phase, putting topphase (degrees, in range [-180,180]) +% at the top of the image. Note: 'phasesort' now uses circular +% smoothing. Use 'cycles' (below) for wavelet length. +% {default: [0 25 8 13 180]} +% 'ampsort' = [center_ms prcnt freq maxfreq] Sort epochs by amplitude. +% (See 'phasesort' above). If ms_center is 'Inf', then sorting +% is by mean power across the time window specified by 'sortwin' +% below. If third arg, freq, is < 0, sort by mean power in the range +% [ abs(freq) maxfreq ]. +% 'sortwin' = [start_ms end_ms] If center_ms == Inf in 'ampsort' arg (above), sorts +% by mean amplitude across window centers shifted from start_ms +% to end_ms by 10 ms. +% 'showwin' = ['on'|'off'] Show sorting window behind ERP trace. {default: 'off'} +% +% Plot time-varying spectral amplitude instead of potential: +% 'plotamps' = ['on'|'off'] Image amplitudes at each trial and latency instead of +% potential values. Note: Currently requires 'coher' (below) with alpha signif. +% Use 'cycles' (see below) > (its default) 3 for better frequency specificity, +% {default: plot potential, not amplitudes, with no minimum}. The average power +% (in log space) before time 0 is automatically removed. Note that the +% 'baseline' parameter has no effect on 'plotamps'. Instead use +% change "baselinedb" or "basedB" in the 'limits' parameter. By default +% the baseline is removed before time 0. +% +% Specify plot parameters: +% 'limits' = [lotime hitime minerp maxerp lodB hidB locoher hicoher basedB] +% Plot axes limits. Can use NaN (or nan, but not Nan) for missing items +% and omit late items. Use last input, basedB, to set the +% baseline dB amplitude in 'plotamps' plots {default: from data} +% 'sortvar_limits' = [min max] minimum and maximum sorting variable +% values to image. This only affects visualization of +% ERPimage and ERPs (not smoothing). Cannot be used +% if sorting by any factor besides sortvar (e.g., +% phase). +% 'signif' = [lo_dB, hi_dB, coher_signif_level] Use precomputed significance +% thresholds (as from outputs ampsig, cohsig) to save time. {default: none} +% 'caxis' = [lo hi] Set color axis limits. Else [fraction] Set caxis limits at +% (+/-)fraction*max(abs(data)) {default: symmetrical in dB, based on data limits} +% +% Add epoch-mean ERP to plot: +% 'erp' = ['on'|'off'|1|2|3|4] Plot ERP time average of the trials below the +% image. If 'on' or 1, a single ERP (the mean of all trials) is shown. If 2, +% two ERPs (super and sub median trials) are shown. If 3, the trials are split into +% tertiles and their three ERPs are shown. If 4, the trials are split into quartiles +% and four ERPs are shown. Note, if you want negative voltage plotted up, change YDIR +% to -1 in icadefs.m. If 'erpalpha' option is used, any values of 'erp' greater than +% 1 will be reset to 1. {default no ERP plotted} +% 'erpalpha' = [alpha] Visualizes two-sided significance threshold (i.e., a two-tailed test) for the +% null hypothesis of a zero mean, symmetric distribution (range: [.001 0.1]). Thresholds +% are determined via a permutation test. Requires 'erp' to be a value other than 'off'. +% If 'erp' is set to a value greater than 1, it is reset to 1 to increase plot readability. +% {default: no alpha significance thresholds plotted} +% 'erpstd' = ['on'|'off'] Plot ERP +/- stdev. Requires 'erp' {default: no std. dev. plotted} +% 'erp_grid' = If 'erp_grid' is added as an option voltage axis dashed grid lines will be +% added to the ERP plot to facilitate judging ERP amplitude +% 'rmerp' = ['on'|'off'] Subtract the average ERP from each trial before processing {default: no} +% +% Add time/frequency information: +% 'coher' = [freq] Plot ERP average plus mean amplitude & coherence at freq (Hz) +% Else [minfrq maxfrq] = same, but select frequency with max power in +% given range. (Note: the 'phasesort' freq (above) overwrites these +% parameters). Else [minfrq maxfrq alpha] = plot coher. signif. level line +% at probability alpha (range: [0,0.1]) {default: no coher, no alpha level} +% 'srate' = [freq] Specify the data sampling rate in Hz for amp/coher (if not +% implicit in third arg, times) {default: as defined in icadefs.m} +% 'cycles' = [float] Number of cycles in the wavelet time/frequency decomposition {default: 3} +% +% Add plot features: +% 'cbar' = ['on'|'off'] Plot color bar to right of ERP-image {default no} +% 'cbar_title' = [string] The title for the color bar (e.g., '\muV' for +% microvolts). +% 'topo' = {map,chan_locs,eloc_info} Plot a 2-D scalp map at upper left of image. +% map may be a single integer, representing the plotted data channel, +% or a vector of scalp map channel values. chan_locs may be a channel locations +% file or a chanlocs structure (EEG.chanlocs). See '>> topoplot example' +% eloc_info (EEG.chaninfo), if empty ([]) or absent, implies the 'X' direction +% points towards the nose and all channels are plotted {default: no scalp map} +% 'spec' = [loHz,hiHz] Plot the mean data spectrum at upper right of image. +% 'specaxis' = ['log'|'lin] Use 'lin' for linear spectrum frequency scaling, +% else 'log' for log scaling {default: 'log'} +% 'horz' = [epochs_vector] Plot horizontal lines at specified epoch numbers. +% 'vert' = [times_vector] Plot vertical dashed lines at specified latencies +% 'auxvar' = [size(nvars,ntrials) matrix] Plot auxiliary variable(s) for each trial +% as separate traces. Else, 'auxvar',{[matrix],{colorstrings}} +% to specify N trace colors. Ex: colorstrings = {'r','bo-','','k:'} +% (see also: 'vert' and 'timewarp' above). {default: none} +% 'sortvarpercent' = [float vector] Plot percentiles for the sorting variable +% for instance, [0.1 0.5 0.9] plots the 10th percentile, the median +% and the 90th percentile. +% Plot options: +% 'noxlabel' = ['on'|'off'] Do not plot "Time (ms)" on the bottom x-axis +% 'yerplabel' = ['string'] ERP ordinate axis label (default is ERP). Print uV with '\muV' +% 'avg_type' = ['boxcar'|'Gaussian'] The type of moving average used to smooth +% the data. 'Boxcar' smoothes the data by simply taking the mean of +% a certain number of trials above and below each trial. +% 'Gaussian' does the same but first weights the trials +% according to a Gaussian distribution (e.g., nearby trials +% receive greater weight). The Gaussian is better than the +% boxcar in that it rather evenly filters out high frequency +% vertical components in the ERPimage. See 'avewidth' argument +% description for more information. {default: boxcar} +% 'img_trialax_label' = ['string'] The label of the axis corresponding to trials in the ERPimage +% (e.g., 'Reaction Time'). Note, if img_trialax_label is set to something +% besides 'Trials' or [], the tick marks on this axis will be set in units +% of the sorting variable. This is a useful alternative to plotting the +% sorting variable when the sorting variable is not in milliseconds. This +% option is not effective if sorting by amplitude, phase, or EEG value. {default: 'Trials'} +% 'img_trialax_ticks' = Vector of sorting variable values at which tick marks (e.g., [300 350 400 450] +% for reaction time in msec) will appear on the trial axis of the erpimage. Tick mark +% values should be given in units img_trialax_label (e.g., 'Trials' or msec). +% This option is not effective if sorting by amplitude, phase, or EEG value. +% {default: automatic} +% 'baseline' = [low_boundary high_boundary] a time window (in msec) whose mean amplitude in +% each trial will be removed from each trial (e.g., [-100 0]) after filtering. +% Useful in conjunction with 'filt' option to re-basline trials after they have been +% filtered. Not necessary if data have already been baselined and erpimage +% processing does not affect baseline amplitude {default: no further baselining +% of data}. +% 'baselinedb' = [low_boundary high_boundary] a time window (in msec) whose mean amplitude in +% each trial will be removed from each trial (e.g., [-100 0]). Use basedB in limits +% to remove a fixed value. Default is time before 0. If you do not want to use a +% baseline for amplitude plotting, enter a NaN value. +% 'filt' = [low_boundary high_boundary] a two element vector indicating the frequency +% cut-offs for a 3rd order Butterworth filter that will be applied to each +% trial of data. If low_boundary=0, the filter is a low pass filter. If +% high_boundary=srate/2, then the filter is a high pass filter. If both +% boundaries are between 0 and srate/2, then the filter is a bandpass filter. +% If both boundaries are between 0 and -srate/2, then the filter is a bandstop +% filter (with boundaries equal to the absolute values of low_boundary and +% high_boundary). Note, using this option requires the 'srate' option to be +% specified and the signal processing toolbox function butter.m. You should +% probably use the 'baseline' option as well since the mean prestimulus baseline +% may no longer be 0 after the filter is applied {default: no filtering} +% +% Optional outputs: +% outdata = (times,epochsout) data matrix (after smoothing) +% outvar = (1,epochsout) actual values trials are sorted on (after smoothing). +% if 'sortvarpercent' is used, this variable contains a cell array with +% { sorted_values { sorted_percent1 ... sorted_percentN } } +% outtrials = (1,epochsout) smoothed trial numbers +% limits = (1,10) array, 1-9 as in 'limits' above, then analysis frequency (Hz) +% axhndls = vector of 1-7 plot axes handles (img,cbar,erp,amp,coh,topo,spec) +% erp = plotted ERP average +% amps = mean amplitude time course +% coher = mean inter-trial phase coherence time course +% cohsig = coherence significance level +% ampsig = amplitude significance levels [lo high] +% outamps = matrix of imaged amplitudes (from option 'plotamps') +% phsangls = vector of sorted trial phases at the phase-sorting frequency +% phsamp = vector of sorted trial amplitudes at the phase-sorting frequency +% sortidx = indices of input data epochs in the sorting order +% erpsig = trial average significance levels [2,frames] +% +% Example: >> figure; +% erpimage(data,RTs,[-400 256 256],'Test',1,1,... +% 'erp','cbar','vert',-350); +% Plots an ERP-image of 1-s data epochs sampled at 256 Hz, sorted by RTs, with +% title ('Test'), and sorted epochs not smoothed or decimated (1,1). Overplots +% the (unsmoothed) RT latencies on the colored ERP-image. Also plots the +% epoch-mean (ERP), a color bar, and a dashed vertical line at -350 ms. +% +% Authors: Scott Makeig, Tzyy-Ping Jung & Arnaud Delorme, +% CNL/Salk Institute, La Jolla, 3-2-1998 - +% +% See also: phasecoher, rmbase, cbar, movav + +% Copyright (C) Scott Makeig & Tzyy-Ping Jung, CNL / Salk Institute, La Jolla 3-2-98 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Uses external toolbox functions: phasecoher(), rmbase(), cbar(), movav() +% Uses included functions: plot1trace(), phasedet() + +% UNIMPLEMENTED - 'allcohers',[data2] -> image the coherences at each latency & epoch. +% Requires arg 'coher' with alpha significance. +% Shows projection on grand mean coherence vector at each latency +% and trial. {default: no} + +%% LOG COMMENTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [data,outsort,outtrials,limits,axhndls,erp,amps,cohers,cohsig,ampsig,allamps,phaseangles,phsamp,sortidx,erpsig] = erpimage(data,sortvar,times,titl,avewidth,decfactor,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21,arg22,arg23,arg24,arg25,arg26,arg27,arg28,arg29,arg30,arg31,arg32,arg33,arg34,arg35,arg36,arg37,arg38,arg39,arg40,arg41,arg42,arg43,arg44,arg45,arg46,arg47,arg48,arg49,arg50,arg51,arg52,arg53,arg54,arg55,arg56,arg57,arg58,arg59,arg60,arg61,arg62,arg63,arg64,arg65,arg66) + +% +%% %%%%%%%%%%%%%%%%% Define defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Initialize optional output variables: +warning off; +erp = []; amps = []; cohers = []; cohsig = []; ampsig = []; +allamps = []; phaseangles = []; phsamp = []; sortidx = []; +auxvar = []; erpsig = []; winloc = [];winlocs = []; +timeStretchColors = {}; + +YES = 1; % logical variables +NO = 0; + +DEFAULT_BASELINE_END = 0; % ms +TIMEX = 1; % 1 -> plot time on x-axis; +% 0 -> plot trials on x-axis + +BACKCOLOR = [0.8 0.8 0.8]; % grey background +try, icadefs; catch, end; +% read BACKCOLOR for plot from defs file (edit this) +% read DEFAULT_SRATE for coher,phase,allamps, etc. +% read YDIR for plotting ERP +% Fix plotting text and line style parameters +SORTWIDTH = 2.5; % Linewidth of plotted sortvar +ZEROWIDTH = 3.0; % Linewidth of vertical 0 line +VERTWIDTH = 2.5; % Linewidth of optional vertical lines +HORZWIDTH = 2.1; % Linewidth of optional vertical lines +SIGNIFWIDTH = 1.9; % Linewidth of red significance lines for amp, coher +DOTSTYLE = 'k--'; % line style to use for vetical dotted/dashed lines +LINESTYLE = '-'; % solid line +LABELFONT = 10; % font sizes for axis labels, tick labels +TICKFONT = 10; + +PLOT_HEIGHT = 0.2; % fraction of y dim taken up by each time series axes +YGAP = 0.03; % fraction gap between time axes +YEXPAND = 1.3; % expansion factor for y-axis about erp, amp data limits + +DEFAULT_SDEV = 1/7; % smooth trials with this window size by default if Gaussian window +DEFAULT_AVEWIDTH = 1; % smooth trials with this window size by default +DEFAULT_DECFACTOR = 1; % decimate by this factor by default +DEFAULT_CYCLES = 3; % use this many cycles in amp,coher computation window +cycles = DEFAULT_CYCLES; +DEFAULT_CBAR = NO;% do not plot color bar by default +DEFAULT_PHARGS = [0 25 8 13]; % Default arguments for phase sorting +DEFAULT_ALPHA = 0.01; +alpha = 0; % default alpha level for coherence significance + +MIN_ERPALPHA = 0.001; % significance bounds for ERP +MAX_ERPALPHA = 0.1; + +NoShowVar = NO; % show sortvar by default +Nosort = NO; % sort on sortvar by default +Caxflag = NO; % use default caxis by default + +timestretchflag = NO; % Added -JH + +mvavg_type='boxcar'; % use the original rectangular moving average -DG +erp_grid = NO; % add y-tick grids to ERP plot -DG +cbar_title = []; % title to add above ERPimage color bar (e.g., '\muV') -DG +img_ylab = 'Trials'; % make the ERPimage y-axis in units of the sorting variable -DG +img_ytick_lab = []; % the values at which tick marks will appear on the trial axis of the ERPimage (the y-axis by default). +%Note, this is in units of the sorting variable if img_ylab~='Trials', otherwise it is in units of trials -DG +baseline = []; %time window of each trial whose mean amp will be used to baseline the trial -DG +baselinedb = []; %time window of each trial whose mean power will be used to baseline the trial +flt=[]; %frequency domain filter parameters -DG +sortvar_limits=[]; %plotting limits for sorting variable/trials; limits only affect visualization, not smoothing -DG +replace_ties = NO; %if YES, trials with the exact same value of a sorting variable will be replaced by their average -DG +erp_vltg_ticks=[]; %if non-empty, these are the voltage axis ticks for the ERP plot + +Caxis = []; +caxfraction = []; +Coherflag = NO; % don't compute or show amp,coher by default +Cohsigflag= NO; % default: do not compute coherence significance +Allampsflag=NO; % don't image the amplitudes by default +Allcohersflag=NO; % don't image the coherence amplitudes by default +Topoflag = NO; % don't plot a topoplot in upper left +Specflag = NO; % don't plot a spectrum in upper right +SpecAxisflag = NO; % don't change the default spectrum axis type from default +SpecAxis = 'log'; % default log frequency spectrum axis (if Specflag) +Erpflag = NO; % don't show erp average by default +Erpstdflag= NO; +Erpalphaflag= NO; +Alignflag = NO; % don't align data to sortvar by default +Colorbar = NO; % if YES, plot a colorbar to right of erp image +Limitflag = NO; % plot whole times range by default +Phaseflag = NO; % don't sort by phase +Ampflag = NO; % don't sort by amplitude +Sortwinflag = NO; % sort by amplitude over a window +Valflag = NO; % don't sort by value +Srateflag = NO; % srate not given +Vertflag = NO; +Horzflag = NO; +titleflag = NO; +NoShowflag = NO; +Renormflag = NO; +Showwin = NO; +yerplabel = 'ERP'; +yerplabelflag = NO; +verttimes = []; +horzepochs = []; +NoTimeflag= NO; % by default DO print "Time (ms)" below bottom axis +Signifflag= NO; % compute significance instead of receiving it +Auxvarflag= NO; +plotmodeflag= NO; +plotmode = 'normal'; +Cycleflag = NO; +signifs = NaN; +coherfreq = nan; % amp/coher-calculating frequency +freq = 0; % phase-sorting frequency +srate = DEFAULT_SRATE; % from icadefs.m +aligntime = nan; +timelimits= nan; +topomap = []; % topo map vector +lospecHz = []; % spec lo frequency +topphase = 180; % default top phase for 'phase' option +renorm = 'no'; +NoShow = 'no'; +Rmerp = 'no'; +percentiles = []; +percentileflag = NO; +erp_ptiles = 1; + +minerp = NaN; % default limits +maxerp = NaN; +minamp = NaN; +maxamp = NaN; +mincoh = NaN; +maxcoh = NaN; +baseamp =NaN; +allamps = []; % default return + +ax1 = NaN; % default axes handles +axcb = NaN; +ax2 = NaN; +ax3 = NaN; +ax4 = NaN; + + +timeStretchRef = []; +timeStretchMarks = []; +tsurdata = []; % time-stretched data before smoothing (for timestretched-erp computation) +% If time-stretching is off, this variable remains empty +% +%% %%%%%%%%%%%%%%%%% Test, fill in commandline args %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargin < 1 + help erpimage + return +end + +data = squeeze(data); +if nargin < 3 | isempty(times) + if size(data,1)==1 || size(data,2)==1 + fprintf('\nerpimage(): either input a times vector or make data size = (frames,trials).\n') + return + end + times = 1:size(data,1); + NoTimesPassed= 1; +end + +if nargin < 2 | isempty(sortvar) + sortvar = 1:size(data,2); + NoShowVar = 1; % don't plot the dummy sortvar +end + +framestot = size(data,1)*size(data,2); +ntrials = length(sortvar); +if ntrials < 2 + help erpimage + fprintf('\nerpimage(): too few trials.\n'); + return +end + +frames = floor(framestot/ntrials); +if frames*ntrials ~= framestot + help erpimage + fprintf(... + '\nerpimage(); length of sortvar doesn''t divide number of data elements??\n') + return +end + +if nargin < 6 + decfactor = 0; +end +if nargin < 5 + avewidth = DEFAULT_AVEWIDTH; +end +if nargin<4 + titl = ''; % default no title +end +if nargin<3 + times = NO; +end +if (length(times) == 1) | (times == NO), % make default times + times = 0:frames-1; + srate = 1000*(length(times)-1)/(times(length(times))-times(1)); + fprintf('Using sampling rate %g Hz.\n',srate); +elseif length(times) == 3 + mintime = times(1); + frames = times(2); + srate = times(3); + times = mintime:1000/srate:mintime+(frames-1)*1000/srate; + fprintf('Using sampling rate %g Hz.\n',srate); +else + % Note: might use default srate read from icadefs here... + srate = 1000*(length(times)-1)/(times(end)-times(1)); +end +if length(times) ~= frames + fprintf(... + '\nerpimage(): length(data)(%d) ~= length(sortvar)(%d) * length(times)(%d).\n\n',... + framestot, length(sortvar), length(times)); + return +end + +if decfactor == 0, + decfactor = DEFAULT_DECFACTOR; +elseif decfactor > ntrials + fprintf('Setting variable decfactor to max %d.\n',ntrials) + decfactor = ntrials; +end +% +%% %%%%%%%%%%%%%%% Collect optional args %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargin > 6 + flagargs = []; + + a = 6; + while a < nargin % for each remaining Arg + a = a + 1; + + Arg = eval(['arg' int2str(a-6)]); + if Caxflag == YES + if size(Arg,1) ~= 1 || size(Arg,2) > 2 + help erpimage + fprintf('\nerpimage(): caxis arg must be a scalar or (1,2) vector.\n'); + return + end + if size(Arg,2) == 2 + Caxis = Arg; + else + caxfraction = Arg; + end + Caxflag = NO; + + elseif timestretchflag == YES % Added -JH + timeStretchMarks = Arg{1}; + timeStretchMarks = round(1+(timeStretchMarks-times(1))*srate/1000); % convert from ms to frames -sm + [smc smr] = find(diff(timeStretchMarks') < 0); + if ~isempty(smr) + fprintf('\nerpimage(): Timewarp event latencies not in ascending order in trial %d.\n',smr) + return + end + + timeStretchMarks = [ ... + repmat(1, [size(timeStretchMarks,1), 1]), ...% Epoch begins + timeStretchMarks, ... + repmat(length(times), [size(timeStretchMarks,1), 1])]; % Epoch ends + if length(Arg) < 2 || isempty(Arg{2}) + timeStretchRef = median(timeStretchMarks); + else + timeStretchRef = Arg{2}; + timeStretchRef = round(1+(timeStretchRef-times(1))*srate/1000); % convert from ms to frames -sm + timeStretchRef = [1 timeStretchRef length(times)]; % add epoch beginning, end + end + if length(Arg) < 3 || isempty(Arg{3}) + timeStretchColors = {}; + else + timeStretchColors = Arg{3}; + end + fprintf('The %d events specified in each trial will be time warped to latencies:',length(timeStretchRef)-2); + fprintf(' %.0f', times(1)+1000*(timeStretchRef(2:end-1)-1)/srate); % converted from frames to ms -sm + fprintf(' ms\n'); + timestretchflag = NO; + elseif Coherflag == YES + if length(Arg) > 3 || length(Arg) < 1 + help erpimage + fprintf('\nerpimage(): coher arg must be size <= 3.\n'); + return + end + coherfreq = Arg(1); + if size(Arg,2) == 1 + coherfreq = Arg(1); + else + coherfreq = Arg(1:2); + end; + if size(Arg,2) == 3 + Cohsigflag = YES; + alpha = Arg(3); + if alpha < 0 || alpha > 0.1 + fprintf('\nerpimage(): alpha value %g out of bounds.\n',alpha); + return + end + end + Coherflag = NO; + Erpflag = YES; % plot amp, coher below erp time series + elseif Topoflag == YES; + if length(Arg) < 2 + help erpimage + fprintf('\nerpimage(): topo arg must be a list of length 2 or 3.\n'); + return + end + topomap = Arg{1}; + eloc_file = Arg{2}; + if length(Arg) > 2, eloc_info = Arg{3}; + else eloc_info = []; + end; + Topoflag = NO; + elseif Specflag == YES; + if length(Arg) ~= 2 + error('\nerpimage(): ''spec'' flag argument must be a numeric array of length 2.\n'); + return + end + lospecHz = Arg(1); + hispecHz = Arg(2); + Specflag = NO; + elseif SpecAxisflag == YES; + SpecAxis = Arg; + if ~strcmpi(SpecAxis,'lin') && ~strcmpi(SpecAxis,'log') + error('\nerpimage(): spectrum axis type must be ''lin'' or ''log''.\n'); + return + end + if strcmpi(SpecAxis,'lin') + SpecAxis = 'linear'; % convert to MATLAB Xscale keyword + end + SpecAxisflag = NO; + elseif Renormflag == YES + renorm = Arg; + Renormflag = NO; + elseif NoShowflag == YES + NoShow = Arg; + if strcmpi(NoShow, 'off'), NoShow = 'no'; end; + NoShowflag = NO; + elseif Alignflag == YES + aligntime = Arg; + Alignflag = NO; + elseif percentileflag == YES + percentiles = Arg; + percentileflag = NO; + elseif Limitflag == YES + % [lotime hitime loerp hierp loamp hiamp locoher hicoher] + if size(Arg,1) ~= 1 || size(Arg,2) < 2 || size(Arg,2) > 9 + help erpimage + fprintf('\nerpimage(): limits arg must be a vector sized (1,2<->9).\n'); + return + end + if ~isnan(Arg(1)) & (Arg(2) <= Arg(1)) + help erpimage + fprintf('\nerpimage(): time limits out of order or out of range.\n'); + return + end + if Arg(1) < min(times) + Arg(1) = min(times); + fprintf('Adjusting mintime limit to first data value %g\n',min(times)); + end + if Arg(2) > max(times) + Arg(2) = max(times); + fprintf('Adjusting maxtime limit to last data value %g\n',max(times)); + end + timelimits = Arg(1:2); + if length(Arg)> 2 + minerp = Arg(3); + end + if length(Arg)> 3 + maxerp = Arg(4); + end + if ~isnan(maxerp) & maxerp <= minerp + help erpimage + fprintf('\nerpimage(): erp limits args out of order.\n'); + return + end + if length(Arg)> 4 + minamp = Arg(5); + end + if length(Arg)> 5 + maxamp = Arg(6); + end + if maxamp <= minamp + help erpimage + fprintf('\nerpimage(): amp limits args out of order.\n'); + return + end + if length(Arg)> 6 + mincoh = Arg(7); + end + if length(Arg)> 7 + maxcoh = Arg(8); + end + if maxcoh <= mincoh + help erpimage + fprintf('\nerpimage(): coh limits args out of order.\n'); + return + end + if length(Arg)>8 + baseamp = Arg(9); % for 'allamps' + end + Limitflag = NO; + + elseif Srateflag == YES + srate = Arg(1); + Srateflag = NO; + elseif Cycleflag == YES + cycles = Arg; + Cycleflag = NO; + elseif Auxvarflag == YES; + if isa(Arg,'cell')==YES && length(Arg)==2 + auxvar = Arg{1}; + auxcolors = Arg{2}; + elseif isa(Arg,'cell')==YES + fprintf('\nerpimage(): auxvars argument must be a matrix or length-2 cell array.\n'); + return + else + auxvar = Arg; % no auxcolors specified + end + [xr,xc] = size(auxvar); + lns = length(sortvar); + if xr ~= lns && xc ~= lns + error('\nerpimage(): auxvar columns different from the number of epochs in data'); + elseif xr == lns && xc ~= lns + auxvar = auxvar'; % exchange rows/cols + end + Auxvarflag = NO; + elseif Vertflag == YES + verttimes = Arg; + Vertflag = NO; + elseif Horzflag == YES + horzepochs = Arg; + Horzflag = NO; + elseif yerplabelflag == YES + yerplabel = Arg; + yerplabelflag = NO; + elseif Signifflag == YES + signifs = Arg; % [low_amp hi_amp coher] + if length(signifs) ~= 3 + fprintf('\nerpimage(): signif arg [%g] must have 3 values\n',Arg); + return + end + Signifflag = NO; + elseif Allcohersflag == YES + data2=Arg; + if size(data2) ~= size(data) + fprintf('\nerpimage(): allcohers data matrix must be the same size as data.\n'); + return + end + Allcohersflag = NO; + elseif Phaseflag == YES + n = length(Arg); + if n > 5 + error('\nerpimage(): Too many arguments for keyword ''phasesort'''); + end + phargs = Arg; + + if phargs(3) < 0 + error('\nerpimage(): Invalid negative frequency argument for keyword ''phasesort'''); + end + if n>=4 + if phargs(4) < 0 + error('\nerpimage(): Invalid negative argument for keyword ''phasesort'''); + end + end + if min(phargs(1)) < times(1) | max(phargs(1)) > times(end) + error('\nerpimage(): time for phase sorting filter out of bound.'); + end + if phargs(2) >= 100 | phargs(2) < -100 + error('\nerpimage(): %-argument for keyword ''phasesort'' must be (-100;100)'); + end + if length(phargs) >= 4 & phargs(3) > phargs(4) + error('\nerpimage(): Phase sorting frequency range must be increasing.'); + end + if length(phargs) == 5 + topphase = phargs(5); + end + Phaseflag = NO; + elseif Sortwinflag == YES % 'ampsort' mean amplitude over a time window + n = length(Arg); + sortwinarg = Arg; + if n > 2 + error('\nerpimage(): Too many arguments for keyword ''sortwin'''); + end + if min(sortwinarg(1)) < times(1) | max(sortwinarg(1)) > times(end) + error('\nerpimage(): start time for value sorting out of bounds.'); + end + if n > 1 + if min(sortwinarg(2)) < times(1) | max(sortwinarg(2)) > times(end) + error('\nerpimage(): end time for value sorting out of bounds.'); + end + end + if n > 1 & sortwinarg(1) > sortwinarg(2) + error('\nerpimage(): Value sorting time range must be increasing.'); + end + Sortwinflag = NO; + elseif Ampflag == YES % 'ampsort',[center_time,prcnt_reject,minfreq,maxfreq] + n = length(Arg); + if n > 4 + error('\nerpimage(): Too many arguments for keyword ''ampsort'''); + end + ampargs = Arg; + + % if ampargs(3) < 0 + % error('\nerpimage(): Invalid negative argument for keyword ''ampsort'''); + % end + if n>=4 + if ampargs(4) < 0 + error('\nerpimage(): Invalid negative argument for keyword ''ampsort'''); + end + end + + if ~isinf(ampargs(1)) + if min(ampargs(1)) < times(1) | max(ampargs(1)) > times(end) + error('\nerpimage(): time for amplitude sorting filter out of bounds.'); + end + end + + if ampargs(2) >= 100 | ampargs(2) < -100 + error('\nerpimage(): percentile argument for keyword ''ampsort'' must be (-100;100)'); + end + + if length(ampargs) == 4 & abs(ampargs(3)) > abs(ampargs(4)) + error('\nerpimage(): Amplitude sorting frequency range must be increasing.'); + end + Ampflag = NO; + + elseif Valflag == YES % sort by potential value in a given window + % Usage: 'valsort',[mintime,maxtime,direction] + n = length(Arg); + if n > 3 + error('\nerpimage(): Too many arguments for keyword ''valsort'''); + end + valargs = Arg; + + if min(valargs(1)) < times(1) | max(valargs(1)) > times(end) + error('\nerpimage(): start time for value sorting out of bounds.'); + end + if n > 1 + if min(valargs(2)) < times(1) | max(valargs(2)) > times(end) + error('\nerpimage(): end time for value sorting out of bounds.'); + end + end + if n > 1 & valargs(1) > valargs(2) + error('\nerpimage(): Value sorting time range must be increasing.'); + end + if n==3 & (~isnumeric(valargs(3)) | valargs(3)==0) + error('\nerpimage(): Value sorting direction must be +1 or -1.'); + end + Valflag = NO; + elseif plotmodeflag == YES + plotmode = Arg; plotmodeflag = NO; + elseif titleflag == YES + titl = Arg; titleflag = NO; + elseif Erpalphaflag == YES + erpalpha = Arg(1); + if erpalpha < MIN_ERPALPHA | erpalpha > MAX_ERPALPHA + fprintf('\nerpimage(): erpalpha value is out of bounds [%g, %g]\n',... + MIN_ERPALPHA,MAX_ERPALPHA); + return + end + Erpalphaflag = NO; + % ----------------------------------------------------------------------- + % ----------------------------------------------------------------------- + % ----------------------------------------------------------------------- + elseif strcmpi(Arg,'avg_type') + if a < nargin, + a=a+1; + Arg = eval(['arg' int2str(a-6)]); + if strcmpi(Arg, 'Gaussian'), mvavg_type='gaussian'; + elseif strcmpi(Arg, 'Boxcar'), mvavg_type='boxcar'; + else error('\nerpimage(): Invalid value for optional argument ''avg_type''.'); + end; + else + error('\nerpimage(): Optional argument ''avg_type'' needs to be assigned a value.'); + end + elseif strcmp(Arg,'nosort') + Nosort = YES; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), Nosort = YES; a = a+1; + elseif strcmpi(Arg, 'off') Nosort = NO; a = a+1; + end; + end; + elseif strcmp(Arg,'showwin') + Showwin = YES; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), Showwin = YES; a = a+1; + elseif strcmpi(Arg, 'off') Showwin = NO; a = a+1; + end; + end; + elseif strcmp(Arg,'noplot') % elseif strcmp(Arg,'NoShow') % by Luca & Ramon + NoShowVar = YES; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), NoShowVar = YES; a = a+1; + elseif strcmpi(Arg, 'off'), NoShowVar = NO; a = a+1; + end; + end; + elseif strcmpi(Arg,'replace_ties') + if a < nargin, + a = a+1; + temp = eval(['arg' int2str(a-6)]); + if strcmpi(temp,'on'), + replace_ties = YES; + elseif strcmpi(temp,'off') replace_ties = NO; + else + error('\nerpimage(): Argument ''replace_ties'' needs to be followed by the string ''on'' or ''off''.'); + end + else + error('\nerpimage(): Argument ''replace_ties'' needs to be followed by the string ''on'' or ''off''.'); + end + elseif strcmpi(Arg,'sortvar_limits') + if a < nargin, + a = a+1; + sortvar_limits = eval(['arg' int2str(a-6)]); + if ischar(sortvar_limits) || length(sortvar_limits)~=2 + error('\nerpimage(): Argument ''sortvar_limits'' needs to be followed by a two element vector.'); + end + else + error('\nerpimage(): Argument ''sortvar_limits'' needs to be followed by a two element vector.'); + end + elseif strcmpi(Arg,'erp') + Erpflag = YES; + erp_ptiles=1; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), Erpflag = YES; erp_ptiles=1; a = a+1; + elseif strcmpi(Arg, 'off') Erpflag = NO; a = a+1; + elseif strcmpi(Arg,'1') | (Arg==1) Erplag = YES; erp_ptiles=1; a=a+1; + elseif strcmpi(Arg,'2') | (Arg==2) Erplag = YES; erp_ptiles=2; a=a+1; + elseif strcmpi(Arg,'3') | (Arg==3) Erplag = YES; erp_ptiles=3; a=a+1; + elseif strcmpi(Arg,'4') | (Arg==4) Erplag = YES; erp_ptiles=4; a=a+1; + end; + end; + elseif strcmpi(Arg,'rmerp') + Rmerp = 'yes'; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), Rmerp = 'yes'; a = a+1; + elseif strcmpi(Arg, 'off') Rmerp = 'no'; a = a+1; + end; + end; + elseif strcmp(Arg,'cbar') | strcmp(Arg,'colorbar') + Colorbar = YES; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), Colorbar = YES; a = a+1; + elseif strcmpi(Arg, 'off') Colorbar = NO; a = a+1; + end; + end; + elseif (strcmp(Arg,'allamps') | strcmp(Arg,'plotamps')) + Allampsflag = YES; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), Allampsflag = YES; a = a+1; + elseif strcmpi(Arg, 'off') Allampsflag = NO; a = a+1; + end; + end; + elseif strcmpi(Arg,'erpstd') + Erpstdflag = YES; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), Erpstdflag = YES; a = a+1; + elseif strcmpi(Arg, 'off') Erpstdflag = NO; a = a+1; + end; + end; + elseif strcmp(Arg,'noxlabel') | strcmp(Arg,'noxlabels') | strcmp(Arg,'nox') + NoTimeflag = YES; + if a < nargin, + Arg = eval(['arg' int2str(a+1-6)]); + if strcmpi(Arg, 'on'), NoTimeflag = YES; a = a+1; + elseif strcmpi(Arg, 'off') NoTimeflag = NO; a = a+1; + end; + end; + elseif strcmp(Arg,'plotmode') + plotmodeflag = YES; + elseif strcmp(Arg,'sortvarpercent') + percentileflag = YES; + elseif strcmp(Arg,'renorm') + Renormflag = YES; + elseif strcmp(Arg,'NoShow') + NoShowflag = YES; + elseif strcmp(Arg,'caxis') + Caxflag = YES; + elseif strcmp(Arg,'title') + titleflag = YES; + elseif strcmp(Arg,'coher') + Coherflag = YES; + elseif strcmp(Arg,'timestretch') | strcmp(Arg,'timewarp') % Added -JH + timestretchflag = YES; + elseif strcmp(Arg,'allcohers') + Allcohersflag = YES; + elseif strcmp(Arg,'topo') | strcmp(Arg,'topoplot') + Topoflag = YES; + elseif strcmp(Arg,'spec') | strcmp(Arg,'spectrum') + Specflag = YES; + elseif strcmp(Arg,'Specaxis') || strcmp(Arg,'specaxis') || strcmp(Arg,'SpecAxis') + SpecAxisflag = YES; + elseif strcmpi(Arg,'erpalpha') + Erpalphaflag = YES; + elseif strcmp(Arg,'align') + Alignflag = YES; + elseif strcmp(Arg,'limits') + Limitflag = YES; + elseif (strcmp(Arg,'phase') | strcmp(Arg,'phasesort')) + Phaseflag = YES; + elseif strcmp(Arg,'ampsort') + Ampflag = YES; + elseif strcmp(Arg,'sortwin') + Sortwinflag = YES; + elseif strcmp(Arg,'valsort') + Valflag = YES; + elseif strcmp(Arg,'auxvar') + Auxvarflag = YES; + elseif strcmp(Arg,'cycles') + Cycleflag = YES; + elseif strcmpi(Arg,'yerplabel') + yerplabelflag = YES; + elseif strcmpi(Arg,'srate') + Srateflag = YES; + elseif strcmpi(Arg,'erp_grid') + erp_grid = YES; + elseif strcmpi(Arg,'baseline') + if a < nargin, + a = a+1; + baseline = eval(['arg' int2str(a-6)]); + else + error('\nerpimage(): Argument ''baseline'' needs to be followed by a two element vector.'); + end + elseif strcmpi(Arg,'baselinedb') + if a < nargin, + a = a+1; + baselinedb = eval(['arg' int2str(a-6)]); + if length(baselinedb) > 2, error('''baselinedb'' need to be a 2 argument vector'); end; + else + error('\nerpimage(): Argument ''baselinedb'' needs to be followed by a two element vector.'); + end + elseif strcmpi(Arg,'filt') + if a < nargin, + a = a+1; + flt = eval(['arg' int2str(a-6)]); + else + error('\nerpimage(): Argument ''filt'' needs to be followed by a two element vector.'); + end + elseif strcmpi(Arg,'erp_vltg_ticks') + if a < nargin, + a = a+1; + erp_vltg_ticks=eval(['arg' int2str(a-6)]); + else + error('\nerpimage(): Argument ''erp_vltg_ticks'' needs to be followed by a vector.'); + end + elseif strcmpi(Arg,'img_trialax_label') + if a < nargin, + a = a+1; + img_ylab = eval(['arg' int2str(a-6)]); + else + error('\nerpimage(): Argument ''img_trialax_label'' needs to be followed by a string.'); + end; + elseif strcmpi(Arg,'img_trialax_ticks') + if a < nargin, + a = a+1; + img_ytick_lab = eval(['arg' int2str(a-6)]); + else + error('\nerpimage(): Argument ''img_trialax_ticks'' needs to be followed by a vector of values at which tick marks will appear.'); + end; + elseif strcmpi(Arg,'cbar_title') + if a < nargin, + a = a+1; + cbar_title = eval(['arg' int2str(a-6)]); + else + error('\nerpimage(): Argument ''cbar_title'' needs to be followed by a string.'); + end; + elseif strcmp(Arg,'vert') || strcmp(Arg,'verttimes') + Vertflag = YES; + elseif strcmp(Arg,'horz') || strcmp(Arg,'horiz') || strcmp(Arg,'horizontal') + Horzflag = YES; + elseif strcmp(Arg,'signif') || strcmp(Arg,'signifs') || strcmp(Arg,'sig') || strcmp(Arg,'sigs') + Signifflag = YES; + else + help erpimage + if isstr(Arg) + fprintf('\nerpimage(): unknown arg %s\n',Arg); + else + fprintf('\nerpimage(): unknown arg %d, size(%d,%d)\n',a,size(Arg,1),size(Arg,2)); + end + return + end + end % Arg +end + +if exist('img_ylab','var') || exist('img_ytick_lab','var'), + oops=0; + if exist('phargs','var'), + fprintf('********* Warning *********\n'); + fprintf('Options ''img_ylab'' and ''img_ytick_lab'' have no effect when sorting by phase.\n'); + oops=0; + elseif exist('valargs','var'), + fprintf('********* Warning *********\n'); + fprintf('Options ''img_ylab'' and ''img_ytick_lab'' have no effect when sorting by EEG voltage.\n'); + oops=0; + elseif exist('ampargs','var'), + fprintf('********* Warning *********\n'); + fprintf('Options ''img_ylab'' and ''img_ytick_lab'' have no effect when sorting by frequency amplitude.\n'); + oops=0; + end + if oops + img_ylab=[]; + img_ytick_lab=[]; + end +end + +if Caxflag == YES ... + |Coherflag == YES ... + |Alignflag == YES ... + |Limitflag == YES + help erpimage + fprintf('\nerpimage(): missing option arg.\n') + return +end +if (Allampsflag | exist('data2')) & ( any(isnan(coherfreq)) | ~Cohsigflag ) + fprintf('\nerpimage(): allamps and allcohers flags require coher freq, srate, and cohsig.\n'); + return +end +if Allampsflag & exist('data2') + fprintf('\nerpimage(): cannot image both allamps and allcohers.\n'); + return +end +if ~exist('srate') | srate <= 0 + fprintf('\nerpimage(): Data srate must be specified and > 0.\n'); + return +end +if ~isempty(auxvar) + % whos auxvar + if size(auxvar,1) ~= ntrials & size(auxvar,2) ~= ntrials + fprintf('\nerpimage(): auxvar size should be (N,ntrials), e.g., (N,%d)\n',... + ntrials); + return + end + if size(auxvar,1) == ntrials & size(auxvar,2) ~= ntrials % make (N,frames) + auxvar = auxvar'; + end + if size(auxvar,2) ~= ntrials + fprintf('\nerpimage(): auxvar size should be (N,ntrials), e.g., (N,%d)\n',... + ntrials); + return + end + if exist('auxcolors')==YES % if specified + if isa(auxcolors,'cell')==NO % if auxcolors is not a cell array + fprintf(... + '\nerpimage(): auxcolors argument to auxvar flag must be a cell array.\n'); + return + end + end +elseif exist('timeStretchRef') & ~isempty(timeStretchRef) + if ~isnan(aligntime) + fprintf(['\nerpimage(): options "align" and ' ... + '"timewarp" are not compatiable.\n']); + return; + end + + if ~isempty(timeStretchColors) + if length(timeStretchColors) < length(timeStretchRef) + nColors = length(timeStretchColors); + for k=nColors+1:length(timeStretchRef)-2 + timeStretchColors = { timeStretchColors{:} timeStretchColors{1+rem(k-1,nColors)}}; + end + end + timeStretchColors = {'' timeStretchColors{:} ''}; + else + timeStretchColors = { 'k--'}; + for k=2:length(timeStretchRef) + timeStretchColors = { timeStretchColors{:} 'k--'}; + end + end + + + auxvarInd = 1-strcmp('',timeStretchColors); % indicate which lines to draw + newauxvars = ((timeStretchRef(find(auxvarInd))-1)/srate+times(1)/1000) * 1000; % convert back to ms + fprintf('Overwriting vert with auxvar\n'); + verttimes = [newauxvars']; + verttimesColors = {timeStretchColors{find(auxvarInd)}}; + newauxvars = repmat(newauxvars, [1 ntrials]); + + if isempty(auxvar) % Initialize auxvar & auxcolors + % auxvar = newauxvars; + auxcolors = {timeStretchColors{find(auxvarInd)}}; + else % Append auxvar & auxcolors + if ~exist('auxcolors') + % Fill with default color (k-- for now) + auxcolors = {}; + for j=1:size(auxvar,1) + auxcolors{end+1} = 'k--'; + end + end + for j=find(auxvarInd) + auxcolors{end+1} = timeStretchColors{j}; + end + auxvar = [auxvar; newauxvars]; + end +end + +% No need to turn off ERP anymore; we now time-stretch potentials +% separately (see tsurdata below) so the (warped) ERP is actually meaningful + +if exist('phargs') + if phargs(3) > srate/2 + fprintf(... + '\nerpimage(): Phase-sorting frequency (%g Hz) must be less than Nyquist rate (%g Hz).',... + phargs(3),srate/2); + end + + if frames < cycles*srate/phargs(3) + fprintf('\nerpimage(): phase-sorting freq. (%g) too low: epoch length < %d cycles.\n',... + phargs(3),cycles); + return + end + if length(phargs)==4 & phargs(4) > srate/2 + phargs(4) = srate/2; + end + if length(phargs)==5 & (phargs(5)>180 | phargs(5) < -180) + fprintf('\nerpimage(): coher topphase (%g) out of range.\n',topphase); + return + end +end +if exist('ampargs') + if abs(ampargs(3)) > srate/2 + fprintf(... + '\nerpimage(): amplitude-sorting frequency (%g Hz) must be less than Nyquist rate (%g Hz).',... + abs(ampargs(3)),srate/2); + end + + if frames < cycles*srate/abs(ampargs(3)) + fprintf('\nerpimage(): amplitude-sorting freq. (%g) too low: epoch length < %d cycles.\n',... + abs(ampargs(3)),cycles); + return + end + if length(ampargs)==4 & abs(ampargs(4)) > srate/2 + ampargs(4) = srate/2; + fprintf('> Reducing max ''ampsort'' frequency to Nyquist rate (%g Hz)\n',srate/2) + end +end +if ~any(isnan(coherfreq)) + if coherfreq(1) <= 0 | srate <= 0 + fprintf('\nerpimage(): coher frequency (%g) out of range.\n',coherfreq(1)); + return + end + if coherfreq(end) > srate/2 | srate <= 0 + fprintf('\nerpimage(): coher frequency (%g) out of range.\n',coherfreq(end)); + return + end + if frames < cycles*srate/coherfreq(1) + fprintf('\nerpimage(): coher freq. (%g) too low: epoch length < %d cycles.\n',... + coherfreq(1),cycles); + return + end +end + +if isnan(timelimits) + timelimits = [min(times) max(times)]; +end +if ~isstr(aligntime) & ~isnan(aligntime) + if ~isinf(aligntime) ... + & (aligntime < timelimits(1) | aligntime > timelimits(2)) + help erpimage + fprintf('\nerpimage(): requested align time outside of time limits.\n'); + return + end +end +% +%% %%%%%%%%%%%%%% Replace nan's with 0s %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +nans = find(isnan(data)); +if length(nans) + fprintf('Replaced %d nan in data with 0s.\n'); + data(nans) = 0; +end +% +%% %%%%%%%%%%%% Reshape data to (frames,ntrials) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if size(data,2) ~= ntrials + if size(data,1)>1 + % fprintf('frames %d, ntrials %d length(data) %d\n',frames,ntrials,length(data)); + data=reshape(data,1,frames*ntrials); + end + data=reshape(data,frames,ntrials); +end +fprintf('Plotting input data as %d epochs of %d frames sampled at %3.1f Hz.\n',... + ntrials,frames,srate); +% +%% %%%%%%%%%%%% Reshape data2 to (frames,ntrials) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if exist('data2') == 1 + if size(data2,2) ~= ntrials + if size(data2,1)>1 + data2=reshape(data2,1,frames*ntrials); + end + data2=reshape(data2,frames,ntrials); + end +end +% +%% %%%%%%%%%%%%% if sortvar=NaN, remove lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -ad +% +if any(isnan(sortvar)) + nanlocs = find(isnan(sortvar)); + fprintf('Removing %d trials with NaN sortvar values.\n', length(nanlocs)); + data(:,nanlocs) = []; + sortvar(nanlocs) = []; + if exist('data2') == 1 + data2(:,nanlocs) = []; + end; + if ~isempty(auxvar) + auxvar(:,nanlocs) = []; + end + if ~isempty(verttimes) + if size(verttimes,1) == ntrials + verttimes(nanlocs,:) = []; + end; + end; + ntrials = size(data,2); + if ntrials <= 1, close(gcf); error('\nerpimage(): Too few trials'); end; +end; + +%% Create moving average window %% +if strcmpi(mvavg_type,'Gaussian'), + %construct Gaussian window to weight trials + if avewidth == 0, + avewidth = DEFAULT_SDEV; + elseif avewidth < 1, + help erpimage + fprintf('\nerpimage(): Variable avewidth cannot be < 1.\n') + fprintf('\nerpimage(): avewidth needs to be a positive integer.\n') + return + end + wt_wind=exp(-0.5*([-3*avewidth:3*avewidth]/avewidth).^2)'; + wt_wind=wt_wind/sum(wt_wind); %normalize to unit sum + avewidth=length(wt_wind); + + if avewidth > ntrials + avewidth=floor((ntrials-1)/6); + if avewidth==0, + avewidth=DEFAULT_SDEV; %should be a window with one time point (smallest possible) + end + wt_wind=exp(-0.5*([-3*avewidth:3*avewidth]/avewidth).^2)'; + wt_wind=wt_wind/sum(wt_wind); + fprintf('avewidth is too big for this number of trials.\n'); + fprintf('Changing avewidth to maximum possible size: %d\n',avewidth); + avewidth=length(wt_wind); + end +else + %construct rectangular "boxcar" window to equally weight trials within + %window + if avewidth == 0, + avewidth = DEFAULT_AVEWIDTH; + elseif avewidth < 1 + help erpimage + fprintf('\nerpimage(): Variable avewidth cannot be < 1.\n') + return + elseif avewidth > ntrials + fprintf('Setting variable avewidth to max %d.\n',ntrials) + avewidth = ntrials; + end + wt_wind=ones(1,avewidth)/avewidth; +end + + +%% Filter data with Butterworth filter (if requested) %%%%%%%%%%%% +% +if ~isempty(flt) + %error check + if length(flt)~=2, + error('\nerpimage(): ''filt'' parameter argument should be a two element vector.'); + elseif max(flt)>(srate/2), + error('\nerpimage(): ''filt'' parameters need to be less than or equal to sampling rate/2 (i.e., %f).',srate/2); + elseif (flt(2)==(srate/2)) && (flt(1)==0), + error('\nerpimage(): If second element of ''filt'' parameter is srate/2, then the first element must be greater than 0.'); + elseif abs(flt(2))<=abs(flt(1)), + error('\nerpimage(): Second element of ''filt'' parameters must be greater than first in absolute value.'); + elseif (flt(1)<0) || (flt(2)<0), + if (flt(1)>=0) || (flt(2)>=0), + error('\nerpimage(): BOTH parameters of ''filt'' need to be greater than or equal to zero OR need to be negative.'); + end + if min(flt)<=(-srate/2), + error('\nerpimage(): ''filt'' parameters need to be greater than sampling rate/2 (i.e., -%f) when creating a stop band.',srate/2); + end + end + + fprintf('\nFiltering data with 3rd order Butterworth filter: '); + if (flt(1)==0), + %lowpass filter the data + [B A]=butter(3,flt(2)*2/srate,'low'); + fprintf('lowpass at %.0f Hz\n',flt(2)); + elseif (flt(2)==(srate/2)), + %highpass filter the data + [B A]=butter(3,flt(1)*2/srate,'high'); + fprintf('highpass at %.0f Hz\n',flt(1)); + elseif (flt(1)<0) + %bandstop filter the data + flt=-flt; + [B A]=butter(3,flt*2/srate,'stop'); + fprintf('stopband from %.0f to %.0f Hz\n',flt(1),flt(2)); + else + %bandpass filter the data + [B A]=butter(3,flt*2/srate); + fprintf('bandpass from %.0f to %.0f Hz\n',flt(1),flt(2)); + end + s=size(data); + for trial=1:s(2), + data(:,trial)=filtfilt(B,A,double(data(:,trial))); + end + if isempty(baseline) + fprintf('Note, you might want to re-baseline the data using the erpimage ''baseline'' option.\n\n'); + end +end + +%% Mean Baseline Each Trial (if requested) %% +if ~isempty(baseline), + %check argument values for errors + if baseline(2)times(end), + error('\nerpimage(): First element of ''baseline'' argument needs to be less than or equal to epoch end time %.1f.',times(end)); + end + + %convert msec into time points + if baseline(1)times(end), + end_pt=length(times); + else + end_pt=find_crspnd_pt(baseline(2),times,1:length(times)); + end_pt=floor(end_pt); + end + fprintf('\nRemoving pre-stimulus mean baseline from %.1f to %.1f msec.\n\n',times(strt_pt),times(end_pt)); + bsln_mn=mean(data(strt_pt:end_pt,:),1); + data=data-repmat(bsln_mn,length(times),1); +end + + + +% +%% %%%%%%%%%%%%%%%%% Renormalize sortvar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +switch lower(renorm) + case 'yes', + disp('\nerpimage warning: *** sorting variable renormalized ***'); + sortvar = (sortvar-min(sortvar)) / (max(sortvar) - min(sortvar)) * ... + 0.5 * (max(times) - min(times)) + min(times) + 0.4*(max(times) - min(times)); + case 'no',; + otherwise, + if ~isempty(renorm) + locx = findstr('x', lower(renorm)); + if length(locx) ~= 1, error('\nerpimage: unrecognized renormalizing formula'); end; + eval( [ 'sortvar =' renorm(1:locx-1) 'sortvar' renorm(locx+1:end) ';'] ); + end; +end; +% +%% %%%%%%%%%%%%%%%%% Align data to sortvar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if isstr(aligntime) | ~isnan(aligntime) + if ~isstr(aligntime) & isinf(aligntime) + aligntime= median(sortvar); + fprintf('Aligning data to median sortvar.\n'); + % Alternative below: trimmed median - ignore top/bottom 5% + % ssv = sort(sortvar); % ssv = 'sorted sortvar' + % aligntime= median(ssv(ceil(ntrials/20)):floor(19*ntrials/20)); + end + + if ~isstr(aligntime) + fprintf('Realigned sortvar plotted at %g ms.\n',aligntime); + aligndata=zeros(frames,ntrials); % begin with matrix of zeros() + shifts = zeros(1,ntrials); + for t=1:ntrials, %%%%%%%%% foreach trial %%%%%%%%% + shft = round((aligntime-sortvar(t))*srate/1000); + shifts(t) = shft; + if shft>0, % shift right + if frames-shft > 0 + aligndata(shft+1:frames,t)=data(1:frames-shft,t); + else + fprintf('No aligned data for epoch %d - shift (%d frames) too large.\n',t,shft); + end + elseif shft < 0 % shift left + if frames+shft > 0 + aligndata(1:frames+shft,t)=data(1-shft:frames,t); + else + fprintf('No aligned data for epoch %d - shift (%d frames) too large.\n',t,shft); + end + else % shft == 0 + aligndata(:,t) = data(:,t); + end + end % end trial + if ~isempty(auxvar) + auxvar = auxvar+shifts; + end; + fprintf('Shifted epochs by %d to %d frames.\n',min(shifts),max(shifts)); + data = aligndata; % now data is aligned to sortvar + else + aligntime = str2num(aligntime); + if isinf(aligntime), aligntime= median(sortvar); end; + end; +end + +% +%% %%%%%%%%%%%%%%%%%%%% Remove the ERP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(Rmerp, 'yes') + data = data - repmat(nan_mean(data')', [1 size(data,2)]); +end; + +% +%% %%%%%%%%%%%%% Sort the data trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if exist('phargs') == 1 % if phase-sort the data trials + if length(phargs) >= 4 & phargs(3) ~= phargs(4) % find max frequency + % in specified band + if exist('psd') == 2 % requires Signal Processing Toolbox + fprintf('Computing data spectrum using psd().\n'); + [pxx,freqs] = psd(data(:),max(1024, pow2(ceil(log2(frames)))),srate,frames,0); + else % EEGLAB native work-around + fprintf('Computing data spectrum using spec().\n'); + [pxx,freqs] = spec(data(:),max(1024, pow2(ceil(log2(frames)))),srate,frames,0); + end; + % gf = gcf; % figure;plot(freqs,pxx); %xx=axis; %axis([phargs(3) phargs(4) xx(3) xx(4)]); %figure(gf); + pxx = 10*log10(pxx); + n = find(freqs >= phargs(3) & freqs <= phargs(4)); + if ~length(n) + freq = (phargs(3)+phargs(4))/2; + end + [dummy maxx] = max(pxx(n)); + freq = freqs(n(maxx)); + else + freq = phargs(3); % else use specified frequency + end + fprintf('Sorting trials on phase at %.2g Hz.\n',freq); + + [amps, cohers, cohsig, ampsig, allamps, allphs] = ... + phasecoher(data,length(times),srate,freq,cycles,0, ... + [], [], timeStretchRef, timeStretchMarks); + + phwin = phargs(1); + [dummy minx] = min(abs(times-phwin)); % closest time to requested + winlen = floor(cycles*srate/freq); + winloc = minx-linspace(floor(winlen/2), floor(-winlen/2), winlen+1); + tmprange = find(winloc>0 & winloc<=frames); + winloc = winloc(tmprange); % sorting window times + winlocs = winloc; + % + %%%%%%%%%%%%%%%%%%%% Compute phsamp and phaseangles %%%%%%%%%%%%%%%%%%%% + % + % $$$ [phaseangles phsamp] = phasedet(data,frames,srate,winloc,freq); + phaseangles = allphs(minx,:); + phsamp = allamps(minx,:); + % $$$ % hist(phaseangles,50); + % $$$ % return + % $$$ + % $$$ % + % $$$ % Print facts on commandline %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % $$$ % + % $$$ if length(tmprange) ~= winlen+1 + % $$$ filtersize = cycles * length(tmprange) / (winlen+1); + % $$$ timecenter = median(winloc)/srate*1000+times(1); % center of window in ms + % $$$ phaseangles = phaseangles + 2*pi*(timecenter-phargs(1))*freq; + % $$$ fprintf('Sorting data epochs by phase at frequency %2.1f Hz: \n', freq); + % $$$ fprintf(... + % $$$ ' Data time limits reached -> now uses a %1.1f cycles (%1.0f ms) window centered at %1.0f ms\n', ... + % $$$ filtersize, 1000/freq*filtersize, timecenter); + % $$$ fprintf(... + % $$$ ' Filter length is %d; Phase has been linearly interpolated to latency at %1.0f ms.\n', ... + % $$$ length(winloc), phargs(1)); + % $$$ else + % $$$ fprintf(... + % $$$ 'Sorting data epochs by phase at %2.1f Hz in a %1.1f-cycle (%1.0f ms) window centered at %1.0f ms.\n',... + % $$$ freq,cycles,1000/freq*cycles,times(minx)); + % $$$ fprintf('Phase is computed using a wavelet of %d frames.\n',length(winloc)); + % $$$ end; + % + % Reject small (or large) phsamp trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + phargs(2) = phargs(2)/100; % convert rejection rate from % to fraction + amprej = phargs(2); + [tmp ampsortidx] = sort(phsamp); % sort amplitudes + if amprej>=0 + ampsortidx = ampsortidx(ceil(amprej*length(ampsortidx))+1:end); % if amprej==0, select all trials + fprintf('Retaining %d epochs (%g percent) with largest power at the analysis frequency,\n',... + length(ampsortidx),100*(1-amprej)); + else % amprej < 0 + amprej = 1+amprej; % subtract from end + ampsortidx = ampsortidx(1:floor(amprej*length(ampsortidx))); + fprintf('Retaining %d epochs (%g percent) with smallest power at the analysis frequency,\n',... + length(ampsortidx),amprej*100); + end + % + % Remove low|high-amplitude trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + data = data(:,ampsortidx); % amp-sort the data, removing rejected-amp trials + phsamp = phsamp(ampsortidx); % amp-sort the amps + phaseangles = phaseangles(ampsortidx); % amp-sort the phaseangles + sortvar = sortvar(ampsortidx); % amp-sort the trial indices + ntrials = length(ampsortidx); % number of trials retained + if ~isempty(auxvar) + auxvar = auxvar(:,ampsortidx); + end + if ~isempty(timeStretchMarks) + timeStretchMarks = timeStretchMarks(:,ampsortidx); + end + + % + % Sort remaining data by phase angle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + phaseangles = -phaseangles; + topphase = (topphase/360)*2*pi; % convert from degrees to radians + ip = find(phaseangles>topphase); + phaseangles(ip) = phaseangles(ip)-2*pi; % rotate so topphase at top of plot + + [phaseangles sortidx] = sort(phaseangles); % sort trials on (rotated) phase + data = data(:,sortidx); % sort data by phase + phsamp = phsamp(sortidx); % sort amps by phase + sortvar = sortvar(sortidx); % sort input sortvar by phase + if ~isempty(auxvar) + auxvar = auxvar(:,sortidx); + end + if ~isempty(timeStretchMarks) + timeStretchMarks = timeStretchMarks(:,sortidx); + end + phaseangles = -phaseangles; % Note: phsangles now descend from pi + % TEST auxvar = 360 + (1000/256)*(256/5)*phaseangles/(2*pi); % plot phase+360 in ms for test + + fprintf('Size of data = [%d,%d]\n',size(data,1),size(data,2)); + sortidx = ampsortidx(sortidx); % return original trial indices in final sorted order + % + % %%%%%%%%%%%%%%% Sort data by amplitude %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % +elseif exist('ampargs') == 1 % if amplitude-sort + if length(ampargs) == 4 % find max frequency in specified band + if exist('psd') == 2 + fprintf('Computing data spectrum using psd().\n'); + [pxx,freqs] = psd(data(:),max(1024, pow2(ceil(log2(frames)))),srate,frames,0); + else + fprintf('Computing data spectrum using spec().\n'); + [pxx,freqs] = spec(data(:),max(1024, pow2(ceil(log2(frames)))),srate,frames,0); + end; + pxx = 10*log10(pxx); + if ampargs(3) == ampargs(4) + [freq n] = min(abs(freqs - ampargs(3))); + else + n = find(freqs >= abs(ampargs(3)) & freqs <= abs(ampargs(4))); + end; + if ~length(n) + freq = mean([abs(ampargs(3)),abs(ampargs(4))]); + end + if ampargs(3)>=0 + [dummy maxx] = max(pxx(n)); + freq = freqs(n(maxx)); % use the highest-power frequency + else + freq = freqs(n); % use all frequencies in the specified range + end + else + freq = abs(ampargs(3)); % else use specified frequency + end + if length(freq) == 1 + fprintf('Sorting data epochs by amplitude at frequency %2.1f Hz \n', freq); + else + fprintf('Sorting data epochs by amplitude at %d frequencies (%2.1f Hz to %.1f Hz) \n',... + length(freq),freq(1),freq(end)); + end + SPECWININCR = 10; % make spectral sorting time windows increment by 10 ms + if isinf(ampargs(1)) + ampwins = sortwinarg(1):SPECWININCR:sortwinarg(2); + else + ampwins = ampargs(1); + end + if ~isinf(ampargs(1)) % single time given + if length(freq) == 1 + fprintf(' in a %1.1f-cycle (%1.0f ms) time window centered at %1.0f ms.\n',... + cycles,1000/freq(1)*cycles,ampargs(1)); + else + fprintf(' in %1.1f-cycle (%1.0f-%1.0f ms) time windows centered at %1.0f ms.\n',... + cycles,1000/freq(1)*cycles,1000/freq(end)*cycles,ampargs(1)); + end + else % range of times + [dummy sortwin_st ] = min(abs(times-ampwins(1))); + [dummy sortwin_end] = min(abs(times-ampwins(end))); + if length(freq) == 1 + fprintf(' in %d %1.1f-cycle (%1.0f ms) time windows centered from %1.0f to %1.0f ms.\n',... + length(ampwins),cycles,1000/freq(1)*cycles,times(sortwin_st),times(sortwin_end)); + else + fprintf(' in %d %1.1f-cycle (%1.0f-%1.0f ms) time windows centered from %1.0f to %1.0f ms.\n',... + length(ampwins),cycles,1000/freq(1)*cycles,1000/freq(end)*cycles,times(sortwin_st),times(sortwin_end)); + end + end + + phsamps = 0; %%%%%%%%%%%%%%%%%%%%%%%%%% sort by (mean) amplitude %%%%%%%%%%%%%%%%%%%%%%%%%% + minxs = []; + for f = 1:length(freq) % use one or range of frequencies + frq = freq(f); + [amps, cohers, cohsig, ampsig, allamps, allphs] = ... + phasecoher(data,length(times),srate,frq,cycles,0, ... + [], [], timeStretchRef, timeStretchMarks); + + for ampwin = ampwins + [dummy minx] = min(abs(times-ampwin)); % find nearest time point to requested + minxs = [minxs minx]; + winlen = floor(cycles*srate/frq); + % winloc = minx-[winlen:-1:0]; % ending time version + winloc = minx-linspace(floor(winlen/2), floor(-winlen/2), winlen+1); + tmprange = find(winloc>0 & winloc<=frames); + winloc = winloc(tmprange); % sorting window frames + if f==1 + winlocs = [winlocs;winloc]; % store tme windows + end + % $$$ [phaseangles phsamp] = phasedet(data,frames,srate,winloc,frq); + % $$$ phsamps = phsamps+phsamps; % accumulate amplitudes across 'sortwin' + phaseangles = allphs(minx,:); + phsamps = phsamps+allamps(minx,:); % accumulate amplitudes across 'sortwin' + end + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if length(tmprange) ~= winlen+1 % ????????? + filtersize = cycles * length(tmprange) / (winlen+1); + timecenter = median(winloc)/srate*1000+times(1); % center of window in ms + phaseangles = phaseangles + 2*pi*(timecenter-ampargs(1))*freq(end); + fprintf(... + ' Data time limits reached -> now uses a %1.1f cycles (%1.0f ms) window centered at %1.0f ms\n', ... + filtersize, 1000/freq(1)*filtersize, timecenter); + fprintf(... + ' Wavelet length is %d; Phase has been linearly interpolated to latency et %1.0f ms.\n', ... + length(winloc(1,:)), ampargs(1)); + end + if length(freq) == 1 + fprintf('Amplitudes are computed using a wavelet of %d frames.\n',length(winloc(1,:))); + end + + % + % Reject small (or large) phsamp trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + ampargs(2) = ampargs(2)/100; % convert rejection rate from % to fraction + [tmp n] = sort(phsamps); % sort amplitudes + if ampargs(2)>=0 + n = n(ceil(ampargs(2)*length(n))+1:end); % if rej 0, select all trials + fprintf('Retaining %d epochs (%g percent) with largest power at the analysis frequency,\n',... + length(n),100*(1-ampargs(2))); + else % ampargs(2) < 0 + ampargs(2) = 1+ampargs(2); % subtract from end + n = n(1:floor(ampargs(2)*length(n))); + fprintf(... + 'Retaining %d epochs (%g percent) with smallest power at the analysis frequency,\n',... + length(n),ampargs(2)*100); + end + % + % Remove low|high-amplitude trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + data = data(:,n); % amp-sort the data, removing rejected-amp trials + phsamps = phsamps(n); % amp-sort the amps + phaseangles = phaseangles(n); % amp-sort the phaseangles + sortvar = sortvar(n); % amp-sort the trial indices + ntrials = length(n); % number of trials retained + if ~isempty(auxvar) + auxvar = auxvar(:,n); + end + % + % Sort remaining data by amplitude %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + [phsamps sortidx] = sort(phsamps); % sort trials on amplitude + data = data(:,sortidx); % sort data by amp + phaseangles = phaseangles(sortidx); % sort angles by amp + sortvar = sortvar(sortidx); % sort input sortvar by amp + if ~isempty(auxvar) + auxvar = auxvar(:,sortidx); + end + fprintf('Size of data = [%d,%d]\n',size(data,1),size(data,2)); + + sortidx = n(sortidx); % return original trial indices in final sorted order + % + %%%%%%%%%%%%%%%%%%%%%% Don't Sort trials %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % +elseif Nosort == YES + fprintf('Not sorting data on input sortvar.\n'); + sortidx = 1:ntrials; + % + %%%%%%%%%%%%%%%%%%%%%% Sort trials on (mean) value %%%%%%%%%%%%%%%%%%%%%%%%%%%% + % +elseif exist('valargs') + [sttime stframe] = min(abs(times-valargs(1))); + sttime = times(stframe); + if length(valargs)>1 + [endtime endframe] = min(abs(times-valargs(2))); + endtime = times(endframe); + else + endframe = stframe; + endtime = times(endframe); + end + if length(valargs)==1 || sttime == endtime + fprintf('Sorting data on value at time %4.0f ms.\n',sttime); + elseif length(valargs)>1 + fprintf('Sorting data on mean value between %4.0f and %4.0f ms.\n',... + sttime,endtime); + end + if endframe>stframe + sortval = mean(data(stframe:endframe,:)); + else + sortval = data(stframe,:); + end + [sortval,sortidx] = sort(sortval); + if length(valargs)>2 + if valargs(3) <0 + sortidx = sortidx(end:-1:1); % plot largest values on top + % if direction < 0 + end + end + data = data(:,sortidx); + sortvar = sortvar(sortidx); % sort input sortvar by amp + if ~isempty(auxvar) + auxvar = auxvar(:,sortidx); + end + if ~isempty(phaseangles) + phaseangles = phaseangles(sortidx); % sort angles by amp + end + winloc = [stframe,endframe]; + winlocs = winloc; + % + %%%%%%%%%%%%%%%%%%%%%% Sort trials on sortvar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % +else + fprintf('Sorting data on input sortvar.\n'); + [sortvar,sortidx] = sort(sortvar); + data = data(:,sortidx); + if ~isempty(auxvar) + auxvar = auxvar(:,sortidx); + end + uni_svar=unique_bc(sortvar); + n_ties=0; + tie_dist=zeros(1,length(uni_svar)); + loop_ct=0; + for tie_loop=uni_svar, + ids=find(sortvar==tie_loop); + n_ids=length(ids); + if n_ids>1, + if replace_ties==YES, + mn=mean(data(:,ids),2); + data(:,ids)=repmat(mn,1,n_ids); + if ~isempty(auxvar) + mn=mean(auxvar(:,ids),2); + auxvar(:,ids) = repmat(mn,1,n_ids); + end + end + n_ties=n_ties+n_ids; + loop_ct=loop_ct+1; + tie_dist(loop_ct)=n_ids; + end + end + fprintf('%.2f%c of the trials (i.e., %d out of %d) have the same sortvar value as at least one other trial.\n', ... + 100*n_ties/length(sortvar),37,n_ties,length(sortvar)); + fprintf('Distribution of number ties per unique value of sortvar:\n'); + if exist('prctile') + try + fprintf('Min: %d, 25th ptile: %d, Median: %d, 75th ptile: %d, Max: %d\n',min(tie_dist),round(prctile(tie_dist,25)), ... + round(median(tie_dist)),round(prctile(tie_dist,75)),max(tie_dist)); + catch + end; + end; + if replace_ties==YES, + fprintf('Trials with tied sorting values will be replaced by their mean.\n'); + end + fprintf('\n'); +end + +%if max(sortvar)<0 +% fprintf('Changing the sign of sortvar: making it positive.\n'); +% sortvar = -sortvar; +%end +% +%% %%%%%%%%%%%%%%%%% Adjust decfactor if phargs or ampargs %%%%%%%%%%%%%%%%%%%%% +% +if decfactor < 0 + decfactor = -decfactor; + invdec = 1; +else + invdec = 0; +end; +if decfactor > sqrt(ntrials) % if large, output this many trials + n = 1:ntrials; + if exist('phargs') & length(phargs)>1 + if phargs(2)>0 + n = n(ceil(phargs(2)*ntrials)+1:end); % trials after rejection + elseif phargs(2)<0 + n = n(1:floor(phargs(2)*length(n))); % trials after rejection + end + elseif exist('ampargs') & length(ampargs)>1 + if ampargs(2)>0 + n = n(ceil(ampargs(2)*ntrials)+1:end); % trials after rejection + elseif ampargs(2)<0 + n = n(1:floor(ampargs(2)*length(n))); % trials after rejection + end + end + if invdec + decfactor = (length(n)-avewidth)/decfactor; + else + decfactor = length(n)/decfactor; + end; +end +if ~isreal(decfactor), decfactor = imag(decfactor); end; + +% +%% %%%%%%%%%%%%%%%% Smooth data using moving average %%%%%%%%%%%%%%%%%%%%%%%%%%% +% +urdata = data; % save data to compute amp, coher on unsmoothed data + +if ~Allampsflag & ~exist('data2') % if imaging potential, + if length(timeStretchRef) > 0 & length(timeStretchMarks) > 0 + % + % Perform time-stretching here -JH %%%%%%%%%%%%%%%% + % + for t=1:size(data,2) + M = timewarp(timeStretchMarks(t,:)', timeStretchRef'); + data(:,t) = M*data(:,t); + end + end + tsurdata = data; + % Time-stretching ends here %%%%%%%%%%%%%% + + if avewidth > 1 || decfactor > 1 + if Nosort == YES + fprintf('Smoothing the data using a window width of %g epochs ',avewidth); + else + fprintf('Smoothing the sorted epochs with a %g-epoch moving window.',... + avewidth); + end + fprintf('\n'); + fprintf(' and a decimation factor of %g\n',decfactor); + + if ~exist('phargs') % if not phase-sorted trials + [data,outtrials] = movav(data,1:ntrials,avewidth,decfactor,[],[],wt_wind); + % Note: movav() here sorts using square window + [outsort,outtrials] = movav(sortvar,1:ntrials,avewidth,decfactor,[],[],wt_wind); + + else % if phase-sorted trials, use circular / wrap-around smoothing + backhalf = floor(avewidth/2); + fronthalf = floor((avewidth-1)/2); + if avewidth > 2 + [data,outtrials] = movav([data(:,[(end-backhalf+1):end]),... + data,... + data(:,[1:fronthalf])],... + [1:(ntrials+backhalf+fronthalf)],avewidth,decfactor,[],[],wt_wind); + [outsort,outtrials] = movav([sortvar((end-backhalf+1):end),... + sortvar,... + sortvar(1:fronthalf)],... + 1:(ntrials+backhalf+fronthalf),avewidth,decfactor,[],[],wt_wind); + % Shift elements of outtrials so the first element is 1 + outtrials = outtrials - outtrials(1) + 1; + else % avewidth==2 + [data,outtrials] = movav([data(:,end),data],... + [1:(ntrials+1)],avewidth,decfactor,[],[],wt_wind); + % Note: movav() here sorts using square window + [outsort,outtrials] = movav([sortvar(end) sortvar],... + 1:(ntrials+1),avewidth,decfactor,[],[],wt_wind); + % Shift elements of outtrials so the first element is 1 + outtrials = outtrials - outtrials(1) + 1; + end + end + for index=1:length(percentiles) + outpercent{index} = compute_percentile( sortvar, percentiles(index), outtrials, avewidth); + end; + if ~isempty(auxvar) + if ~exist('phargs') % if not phase-sorted trials + [auxvar,tmp] = movav(auxvar,1:ntrials,avewidth,decfactor,[],[],wt_wind); + else % if phase-sorted trials + if avewidth>2 + [auxvar,tmp] = movav([auxvar(:,[(end-backhalf+1):end]),... + auxvar,... + auxvar(:,[1:fronthalf])],... + [1:(ntrials+backhalf+fronthalf)],avewidth,decfactor,[],[],wt_wind); + % Shift elements of tmp so the first element is 1 + tmp = tmp - tmp(1) + 1; + else % avewidth==2 + [auxvar,tmp] = movav([auxvar(:,end),auxvar],[1:(ntrials+1)],avewidth,decfactor,[],[],wt_wind); + % Shift elements of tmp so the first element is 1 + tmp = tmp - tmp(1) + 1; + end + end + end + % if ~isempty(sortvar_limits), + % fprintf('Output data will be %d frames by %d smoothed trials.\n',... + % frames,length(outtrials)); + % fprintf('Outtrials: %3.2f to %4.2f\n',min(outtrials),max(outtrials)); + % end + else % don't smooth + outtrials = 1:ntrials; + outsort = sortvar; + end + + % + %%%%%%%%%%%%%%%%%%%%%%%%% Find color axis limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if ~isempty(Caxis) + mindat = Caxis(1); + maxdat = Caxis(2); + fprintf('Using the specified caxis range of [%g,%g].\n', mindat, maxdat); + else + mindat = min(min(data)); + maxdat = max(max(data)); + maxdat = max(abs([mindat maxdat])); % make symmetrical about 0 + mindat = -maxdat; + if ~isempty(caxfraction) + adjmax = (1-caxfraction)/2*(maxdat-mindat); + mindat = mindat+adjmax; + maxdat = maxdat-adjmax; + fprintf(... + 'The caxis range will be %g times the sym. abs. data range -> [%g,%g].\n',... + caxfraction,mindat,maxdat); + else + fprintf(... + 'The caxis range will be the sym. abs. data range -> [%g,%g].\n',... + mindat,maxdat); + end + end +end % if ~Allampsflag & ~exist('data2') + +% +%% %%%%%%%%%%%%%%%%%%%%%%%% Set time limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if isnan(timelimits(1)) + timelimits = [min(times) max(times)]; +end +fprintf('Data will be plotted between %g and %g ms.\n',timelimits(1),timelimits(2)); + +% +%% %%%%%%%%%%% Image the aligned/sorted/smoothed data %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(NoShow, 'no') + if ~any(isnan(coherfreq)) % if plot three time axes + image_loy = 3*PLOT_HEIGHT; + elseif Erpflag == YES % elseif if plot only one time axes + image_loy = 1*PLOT_HEIGHT; + else % else plot erp-image only + image_loy = 0*PLOT_HEIGHT; + end + gcapos=get(gca,'Position'); + delete(gca) + if isempty(topomap) + image_top = 1; + else + image_top = 0.9; + end + ax1=axes('Position',... + [gcapos(1) gcapos(2)+image_loy*gcapos(4) ... + gcapos(3) (image_top-image_loy)*gcapos(4)]); +end; +ind = isnan(data); % find nan's in data +[i j]=find(ind==1); +if ~isempty(i) + data(i,j) = 0; % plot shifted nan data as 0 (=green) +end + +% +%% %%%%%%%%%%% Determine coherence freqeuncy %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if length(coherfreq) == 2 & coherfreq(1) ~= coherfreq(2) & freq <= 0 + % find max frequency in specified band - should use Matlab pwelch()? + if exist('psd') == 2 % from Signal Processing Toolbox + [pxx,tmpfreq] = psd(urdata(:),max(1024,pow2(ceil(log2(frames)))),srate,frames,0); + else % substitute from EEGLAB + [pxx,tmpfreq] = spec(urdata(:),max(1024,pow2(ceil(log2(frames)))),srate,frames,0); + end; + pxx = 10*log10(pxx); + n = find(tmpfreq >= coherfreq(1) & tmpfreq <= coherfreq(2)); + % [tmpfreq(n) pxx(n)] + % coherfreqs = coherfreq; % save for debugging spectrum plotting + + if ~length(n) + coherfreq = coherfreq(1); + end + [dummy maxx] = max(pxx(n)); + coherfreq = tmpfreq(n(maxx)); +else + coherfreq = coherfreq(1); +end + + + +if ~Allampsflag & ~exist('data2') %%%%%%%% Plot ERP image %%%%%%%%%% + + %Stretch the data array + % $$$ keyboard; + + if strcmpi(NoShow, 'no') + if TIMEX + h_eim=imagesc(times,outtrials,data',[mindat,maxdat]);% plot time on x-axis + set(gca,'Ydir','normal'); + axis([timelimits(1) timelimits(2) ... + min(outtrials) max(outtrials)]); + else + h_eim=imagesc(outtrials,times,data,[mindat,maxdat]); % plot trials on x-axis + axis([min(outtrials) max(outtrials)... + timelimits(1) timelimits(2)]); + end + try colormap(DEFAULT_COLORMAP); catch, end; + hold on + drawnow + end; + +elseif Allampsflag %%%%%%%%%%%%%%%% Plot allamps instead of data %%%%%%%%%%%%%% + + if freq > 0 + coherfreq = mean(freq); % use phase-sort frequency + end + + if ~isnan(signifs) % plot received significance levels + fprintf(['Computing and plotting received ERSP and ITC signif. ' ... + 'levels...\n']); + [amps,cohers,cohsig,ampsig,allamps] = ... + phasecoher(urdata,length(times),srate,coherfreq,cycles,0, ... + [], [], timeStretchRef, timeStretchMarks); + % Note: need to receive cohsig and ampsig to get allamps <--- + ampsig = signifs([1 2]); % assume these already in dB + cohsig = signifs(3); + + elseif alpha>0 % compute significance levels + fprintf('Computing and plotting %g ERSP and ITC signif. level...\n',alpha); + [amps,cohers,cohsig,ampsig,allamps] = ... + phasecoher(urdata,length(times),srate,coherfreq, ... + cycles, alpha, [], [], ... + timeStretchRef, timeStretchMarks'); + % Note: need to receive cohsig and ampsig to get allamps + fprintf('Coherence significance level: %g\n',cohsig); + + else % no plotting of significance + [amps,cohers,cohsig,ampsig,allamps] = ... + phasecoher(urdata,length(times),srate,coherfreq, ... + cycles,0,[], [], timeStretchRef, timeStretchMarks); + % Note: need to receive cohsig and ampsig to get allamps + end + + % fprintf('#1 Size of allamps = [%d %d]\n',size(allamps,1),size(allamps,2)); + + base = find(times<=DEFAULT_BASELINE_END); + if length(base)<2 + base = 1:floor(length(times)/4); % default first quarter-epoch + end + fprintf('Using %g to %g ms as amplitude baseline.\n',... + times(1),times(base(end))); + + % fprintf('#2 Size of allamps = [%d %d]\n',size(allamps,1),size(allamps,2)); + + % fprintf('Subtracting the mean baseline log amplitude \n'); + %fprintf('Subtracting the mean baseline log amplitude %g\n',baseall); + % allamps = allamps./baseall; + % fprintf('#3 Size of allamps = [%d %d]\n',size(allamps,1),size(allamps,2)); + + if avewidth > 1 || decfactor > 1 + if Nosort == YES + fprintf(... + 'Smoothing the amplitude epochs using a window width of %g epochs ',... + avewidth); + else % sort trials + fprintf(... + 'Smoothing the sorted amplitude epochs with a %g-epoch moving window.',... + avewidth); + end + fprintf('\n'); + fprintf(' and a decimation factor of %g\n',decfactor); + + %fprintf('4 Size of allamps = [%d %d]\n',size(allamps,1),size(allamps,2)); + + if exist('phargs') % if phase-sorted trials, use circular/wrap-around smoothing + backhalf = floor(avewidth/2); + fronthalf = floor((avewidth-1)/2); + if avewidth > 2 + [allamps,outtrials] = movav([allamps(:,[(end-backhalf+1):end]),... + allamps,... + allamps(:,[1:fronthalf])],... + [1:(ntrials+backhalf+fronthalf)],avewidth,decfactor,[],[],wt_wind); + % Note: sort using square window + [outsort,outtrials] = movav([sortvar((end-backhalf+1):end),... + sortvar,... + sortvar(1:fronthalf)],... + 1:(ntrials+backhalf+fronthalf),avewidth,decfactor,[],[],wt_wind); + % Shift elements of outtrials so the first element is 1 + outtrials = outtrials - outtrials(1) + 1; + if ~isempty(auxvar) + [auxvar,tmp] = movav([auxvar(:,[(end-backhalf+1):end]),... + auxvar,... + auxvar(:,[1:fronthalf])],... + [1:(ntrials+backhalf+fronthalf)],avewidth,decfactor,[],[],wt_wind); + % Shift elements of outtrials so the first element is 1 + outtrials = outtrials - outtrials(1) + 1; + end + else % avewidth==2 + [allamps,outtrials] = movav([allamps(:,end),allamps],... + [1:(ntrials+1)],avewidth,decfactor,[],[],wt_wind); + % Note: sort using square window + [outsort,outtrials] = movav([sortvar(end) sortvar],... + 1:(ntrials+1),avewidth,decfactor,[],[],wt_wind); + % Shift elements of outtrials so the first element is 1 + outtrials = outtrials - outtrials(1) + 1; + [auxvar,tmp] = movav([auxvar(:,end),auxvar],[1:(ntrials+1)],avewidth,decfactor,[],[],wt_wind); + % Shift elements of tmp so the first element is 1 + tmp = tmp - tmp(1) + 1; + end + else % if trials not phase sorted, no wrap-around + [allamps,outtrials] = movav(allamps,1:ntrials,avewidth,decfactor,[],[],wt_wind); + %fprintf('5 Size of allamps = [%d %d]\n',size(allamps,1),size(allamps,2)); + [outsort,outtrials] = movav(sortvar,1:ntrials,avewidth,decfactor,[],[],wt_wind); + if ~isempty(auxvar) + [auxvar,tmp] = movav(auxvar,1:ntrials,avewidth,decfactor,[],[],wt_wind); + end + end + for index=1:length(percentiles) + outpercent{index} = compute_percentile( sortvar, percentiles(index), outtrials, avewidth); + end; + fprintf('Output allamps data will be %d frames by %d smoothed trials.\n',... + frames,length(outtrials)); + + else % if no smoothing + outtrials = 1:ntrials; + outsort = sortvar; + end + + allamps = 20*log10(allamps); % convert allamps to dB + amps = 20*log10(amps); % convert latency mean amps to dB + ampsig = 20*log10(ampsig); % convert amplitude signif thresholds to dB + + if alpha>0 + fprintf('Amplitude significance levels: [%g %g] dB\n',ampsig(1),ampsig(2)); + end + + if isnan(baseamp) % if not specified in 'limits' + [amps,baseamp] = rmbase(amps,length(times),base); % subtract the dB baseline (baseamp) + % amps are the means at each latency + allamps = allamps - baseamp; % subtract dB baseline from allamps + % amplitude + ampsig = ampsig - baseamp; % subtract dB baseline from ampsig + + else % if baseamp specified in 'limits' (as last argument 'basedB', see help) + amps = amps-baseamp; % use specified (log) baseamp + allamps = allamps - baseamp; % subtract dB baseline + if isnan(signifs); + ampsig = ampsig-baseamp; % subtract dB baseline + end + end + + + % + %%%%%%%%%%%%%%%%%%%%%%%%% Find color axis limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if ~isempty(Caxis) + mindat = Caxis(1); + maxdat = Caxis(2); + fprintf('Using the specified caxis range of [%g,%g].\n',... + mindat,maxdat); + else + + % Changed -JH + % 0.8 is Scott's suggestion to make the erp image show small + % variations better + maxdat = 0.8 * max(max(abs(allamps))); + mindat = -maxdat; + % $$$ mindat = min(min(allamps)); + % $$$ maxdat = max(max(allamps)); + % $$$ maxdat = max(abs([mindat maxdat])); % make symmetrical about 0 + % $$$ mindat = -maxdat; + + if ~isempty(caxfraction) + adjmax = (1-caxfraction)/2*(maxdat-mindat); + mindat = mindat+adjmax; + maxdat = maxdat-adjmax; + fprintf(... + 'The caxis range will be %g times the sym. abs. data range -> [%g,%g].\n',... + caxfraction,mindat,maxdat); + else + fprintf(... + 'The caxis range will be the sym. abs. data range -> [%g,%g].\n',... + mindat,maxdat); + end + end + % + %%%%%%%%%%%%%%%%%%%%% Image amplitudes at coherfreq %%%%%%%%%%%%%%%%%%%%%%%%%% + % + + if strcmpi(NoShow, 'no') + fprintf('Plotting amplitudes at freq %g Hz instead of potentials.\n',coherfreq); + if TIMEX + imagesc(times,outtrials,allamps',[mindat,maxdat]);% plot time on x-axis + set(gca,'Ydir','normal'); + axis([timelimits(1) timelimits(2) ... + min(outtrials) max(outtrials)]); + else + imagesc(outtrials,times,allamps,[mindat,maxdat]); % plot trials on x-axis + axis([min(outtrials) max(outtrials)... + timelimits(1) timelimits(2)]); + end + try colormap(DEFAULT_COLORMAP); catch, end; + drawnow + hold on + end; + data = allamps; + +elseif exist('data2') %%%%%% Plot allcohers instead of data %%%%%%%%%%%%%%%%%%% + %%%%%%%%% UNDOCUMENTED AND DEPRECATED OPTION %%%%%%%%%%%% + if freq > 0 + coherfreq = mean(freq); % use phase-sort frequency + end + if alpha>0 + fprintf('Computing and plotting %g coherence significance level...\n',alpha); + + % [amps,cohers,cohsig,ampsig,allcohers] = ... + % crosscoher(urdata,data2,length(times),srate,coherfreq,cycles,alpha); + + fprintf('Inter-Trial Coherence significance level: %g\n',cohsig); + fprintf('Amplitude significance levels: [%g %g]\n',ampsig(1),ampsig(2)); + else + % [amps,cohers,cohsig,ampsig,allcohers] = ... + % crosscoher(urdata,data2,length(times),srate,coherfreq,cycles,0); + end + if ~exist('allcohers') + fprintf('\nerpimage(): allcohers not returned....\n') + return + end + allamps = allcohers; % output variable + % fprintf('Size allcohers = (%d, %d)\n',size(allcohers,1),size(allcohers,2)); + % fprintf('#1 Size of allcohers = [%d %d]\n',size(allcohers,1),size(allcohers,2)); + base = find(times<=0); + if length(base)<2 + base = 1:floor(length(times)/4); % default first quarter-epoch + end + + amps = 20*(log10(amps) - log10(mean(amps))); % convert to dB + %amps = 20*log10(amps); % convert to dB + ampsig = 20*(log10(ampsig) - log10(mean(amps))); % convert to dB + %ampsig = 20*log10(ampsig); % convert to dB + + if isnan(baseamp) + [amps,baseamp] = rmbase(amps,length(times),base); % remove baseline + else + amps = amps - baseamp; + end + % fprintf('#2 Size of allcohers = [%d %d]\n',size(allcohers,1),size(allcohers,2)); + + if avewidth > 1 || decfactor > 1 + if Nosort == YES + fprintf(... + 'Smoothing the amplitude epochs using a window width of %g epochs '... + ,avewidth); + else + fprintf(... + 'Smoothing the sorted amplitude epochs with a %g-epoch moving window.'... + ,avewidth); + end + fprintf('\n'); + fprintf(' and a decimation factor of %g\n',decfactor); + % fprintf('4 Size of allcohers = [%d %d]\n',size(allcohers,1),size(allcohers,2)); + + [allcohers,outtrials] = movav(allcohers,1:ntrials,avewidth,decfactor,[],[],wt_wind); + % fprintf('5 Size of allcohers = [%d %d]\n',size(allcohers,1),size(allcohers,2)); + [outsort,outtrials] = movav(sortvar,1:ntrials,avewidth,decfactor,[],[],wt_wind); + % fprintf('Output data will be %d frames by %d smoothed trials.\n',... + % frames,length(outtrials)); + else + outtrials = 1:ntrials; + outsort = sortvar; + end + % + %%%%%%%%%%%%%%%%%%%%%%%%% Find color axis limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if ~isempty(Caxis) + mindat = Caxis(1); + maxdat = Caxis(2); + fprintf('Using the specified caxis range of [%g,%g].\n',... + mindat,maxdat); + else + mindat = -1; + maxdat = 1 + fprintf(... + 'The caxis range will be the sym. abs. data range [%g,%g].\n',... + mindat,maxdat); + end + % + %%%%%%%%%%%%%%%%%%%%% Image coherences at coherfreq %%%%%%%%%%%%%%%%%%%%%%%%%% + % + if strcmpi(NoShow, 'no') + fprintf('Plotting coherences at freq %g Hz instead of potentials.\n',coherfreq); + if TIMEX + imagesc(times,outtrials,allcohers',[mindat,maxdat]);% plot time on x-axis + set(gca,'Ydir','normal'); + axis([timelimits(1) timelimits(2) ... + min(outtrials) max(outtrials)]); + else + imagesc(outtrials,times,allcohers,[mindat,maxdat]); % plot trials on x-axis + axis([min(outtrials) max(outtrials)... + timelimits(1) timelimits(2)]); + end + try colormap(DEFAULT_COLORMAP); catch, end; + drawnow + hold on + end; + + +end + +%Change limits on ERPimage y-axis if requested +if ~isempty(sortvar_limits) + if exist('phargs','var'), + fprintf('********* Warning *********\n'); + fprintf('Specifying sorting variable limits has no effect when sorting by phase.\n'); + elseif exist('valargs','var'), + fprintf('********* Warning *********\n'); + fprintf('Specifying sorting variable limits has no effect when sorting by mean EEG voltage.\n'); + elseif exist('ampargs','var'), + fprintf('********* Warning *********\n'); + fprintf('Specifying sorting variable limits has no effect when sorting by frequency amp.\n'); + else + v=axis; + img_mn=find_crspnd_pt(sortvar_limits(1),outsort,outtrials); + if isempty(img_mn), + img_mn=1; + sortvar_limits(1)=outsort(1); + end + img_mx=find_crspnd_pt(sortvar_limits(2),outsort,outtrials); + if isempty(img_mx), + img_mx=length(outsort); + sortvar_limits(2)=outsort(img_mx); + end + axis([v(1:2) img_mn img_mx]); + id1=find(sortvar>=sortvar_limits(1)); + id2=find(sortvar<=sortvar_limits(2)); + id=intersect_bc(id1,id2); + fprintf('%d epochs fall within sortvar limits.\n',length(id)); + urdata=urdata(:,id); + if ~isempty(tsurdata), + tsurdata=tsurdata(:,id); + end + end +end +%%%%%%%%%%%%%%%%%%%%%%%%%%% End plot image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if strcmpi(NoShow, 'no') + v=axis; + fprintf('Output data will be %d frames by %d smoothed trials.\n',... + frames,v(4)-v(3)+1); + fprintf('Outtrials: %3.2f to %4.2f\n',v(3),v(4)); +end; + +% +%%%%%%%%%%%%%%%%%%%%% Compute y-axis tick values and labels (if requested) %%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmpi(NoShow, 'no') + if ~isempty(img_ylab) && ~strcmpi(img_ylab,'Trials') + %make ERPimage y-tick labels in units of sorting variable + if isempty(sortvar_limits), + mn=min(outsort); + mx=max(outsort); + else + mn=sortvar_limits(1); + mx=sortvar_limits(2); + end + ord=orderofmag(mx-mn); + rng_rnd=round([mn mx]/ord)*ord; + if isempty(img_ytick_lab) + img_ytick_lab=[rng_rnd(1):ord:rng_rnd(2)]; + in_range=find((img_ytick_lab>=mn) & (img_ytick_lab<=mx)); + img_ytick_lab=img_ytick_lab(in_range); + else + img_ytick_lab=unique_bc(img_ytick_lab); %make sure it is sorted + in_range=find((img_ytick_lab>=mn) & (img_ytick_lab<=mx)); + if length(img_ytick_lab)~=length(in_range), + fprintf('\n***Warning***\n'); + fprintf('''img_trialax_ticks'' exceed smoothed sorting variable values. Max/min values are %f/%f.\n\n',mn,mx); + img_ytick_lab=img_ytick_lab(in_range); + end + end + n_tick=length(img_ytick_lab); + img_ytick=zeros(1,n_tick); + for tickloop=1:n_tick, + img_ytick(tickloop)=find_crspnd_pt(img_ytick_lab(tickloop),outsort,outtrials); + end + elseif ~isempty(img_ylab), %make ERPimage y-tick labels in units of Trials + if isempty(img_ytick_lab) + v=axis; %note: sorting variable limits have already been used to determine range of ERPimage y-axis + mn=v(3); + mx=v(4); + ord=orderofmag(mx-mn); + rng_rnd=round([mn mx]/ord)*ord; + img_ytick=[rng_rnd(1):ord:rng_rnd(2)]; + in_range=find((img_ytick>=mn) & (img_ytick<=mx)); + img_ytick=img_ytick(in_range); + else + img_ytick=img_ytick_lab; + end + end +end; + +%% %%%%%%%%%%%%%%%%%%%%%%%%% plot vert lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if ~isempty(verttimes) + if size(verttimes,1) ~= 1 & size(verttimes,2) == 1 & size(verttimes,1) ~= ntrials + verttimes = verttimes'; + end + if size(verttimes,1) ~= 1 & size(verttimes,1) ~= ntrials + fprintf('\nerpimage(): vert arg matrix must have 1 or %d rows\n',ntrials); + return + end; + if strcmpi(NoShow, 'no') + if size(verttimes,1) == 1 + fprintf('Plotting %d lines at times: ',size(verttimes,2)); + else + fprintf('Plotting %d traces starting at times: ',size(verttimes,2)); + end + for vt = verttimes % for each column + fprintf('%g ',vt(1)); + if isnan(aligntime) % if NOT re-aligned data + if TIMEX % overplot vt on image + if length(vt)==1 + mydotstyle = DOTSTYLE; + if exist('auxcolors') & ... + length(verttimes) == length(auxcolors) + mydotstyle = auxcolors{find(verttimes == vt)}; + end + plot([vt vt],[0 max(outtrials)],mydotstyle,'Linewidth',VERTWIDTH); + elseif length(vt)==ntrials + [outvt,ix] = movav(vt,1:ntrials,avewidth,decfactor,[],[],wt_wind); + plot(outvt,outtrials,DOTSTYLE,'Linewidth',VERTWIDTH); + end + else + if length(vt)==1 + plot([0 max(outtrials)],[vt vt],DOTSTYLE,'Linewidth',VERTWIDTH); + elseif length(vt)==ntrials + [outvt,ix] = movav(vt,1:ntrials,avewidth,decfactor,[],[],wt_wind); + plot(outtrials,outvt,DOTSTYLE,'Linewidth',VERTWIDTH); + end + end + else % re-aligned data + if TIMEX % overplot vt on image + if length(vt)==ntrials + [outvt,ix] = movav(vt,1:ntrials,avewidth,decfactor,[],[],wt_wind); + plot(aligntime+outvt-outsort,outtrials,DOTSTYLE,'LineWidth',VERTWIDTH); + elseif length(vt)==1 + plot(aligntime+vt-outsort,outtrials,DOTSTYLE,'LineWidth',VERTWIDTH); + end + else + if length(vt)==ntrials + [outvt,ix] = movav(vt,1:ntrials,avewidth,decfactor,[],[],wt_wind); + plot(outtrials,aligntime+outvt-outsort,DOTSTYLE,'LineWidth',VERTWIDTH); + elseif length(vt)==1 + plot(outtrials,aligntime+vt-outsort,DOTSTYLE,'LineWidth',VERTWIDTH); + end + end + end + end + %end + fprintf('\n'); + end; +end + +% +%% %%%%%%%%%%%%%%%%%%%%%%%%% plot horizontal ('horz') lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isempty(horzepochs) + if size(horzepochs,1) > 1 & size(horzepochs,1) > 1 + fprintf('\nerpimage(): horz arg must be a vector\n'); + return + end; + if strcmpi(NoShow, 'no') + if ~isempty(img_ylab) && ~strcmpi(img_ylab,'Trials'), + %trial axis in units of sorting variable + mx=max(outsort); + mn=min(outsort); + fprintf('Plotting %d lines at epochs corresponding to sorting variable values: ',length(horzepochs)); + for he = horzepochs % for each horizontal line + fprintf('%g ',he); + %find trial number corresponding to this value of sorting + %variable: + if (he>mn) && (he= aligntime + plot([aligntime aligntime],[min(outtrials) max(outtrials)],... + 'k','Linewidth',ZEROWIDTH); % plot vertical line at time 0 + % plot vertical line at aligntime + end + else % trials not time-aligned + if times(1) <= 0 & times(frames) >= 0 + plot([0 0],[min(outtrials) max(outtrials)],... + 'k','Linewidth',ZEROWIDTH); % plot smoothed sortwvar + end + end +end; + +if strcmpi(NoShow, 'no') & ( min(outsort) < timelimits(1) ... + |max(outsort) > timelimits(2)) + ur_outsort = outsort; % store the pre-adjusted values + fprintf('Not all sortvar values within time vector limits: \n') + fprintf(' outliers will be shown at nearest limit.\n'); + i = find(outsort< timelimits(1)); + outsort(i) = timelimits(1); + i = find(outsort> timelimits(2)); + outsort(i) = timelimits(2); +end + +if strcmpi(NoShow, 'no') + if TIMEX + if Nosort == YES + + l=ylabel(img_ylab); + if ~isempty(img_ylab) && ~strcmpi(img_ylab,'Trials') + set(gca,'ytick',img_ytick,'yticklabel',img_ytick_lab); + end + else + if exist('phargs','var') + l=ylabel('Phase-sorted Trials'); + elseif exist('ampargs','var') + l=ylabel('Amplitude-sorted Trials'); + elseif exist('valargs','var') + l=ylabel('Voltage-sorted Trials'); + else + l=ylabel(img_ylab); + if ~isempty(img_ylab) + set(gca,'ytick',img_ytick); + end + if ~strcmpi(img_ylab,'Trials') + set(gca,'yticklabel',img_ytick_lab); + end + end + end + else % if switch x<->y axes + if Nosort == YES & NoTimeflag==NO + + l=xlabel(img_ylab); + if ~isempty(img_ylab) && ~strcmpi(img_ylab,'Trials') + set(gca,'xtick',img_ytick,'xticklabel',img_ytick_lab); + end + else + if exist('phargs') + l=ylabel('Phase-sorted Trials'); + elseif NoTimeflag == NO + l=xlabel('Sorted Trials'); + else + l=xlabel(img_ylab); + if ~isempty(img_ylab) && ~strcmpi(img_ylab,'Trials') + set(gca,'xtick',img_ytick,'xticklabel',img_ytick_lab); + end + end + end + end + set(l,'FontSize',LABELFONT); + + if ~strcmpi(plotmode, 'topo') + t=title(titl); + set(t,'FontSize',LABELFONT); + else + NAME_OFFSETX = 0.1; + NAME_OFFSETY = 0.2; + xx = xlim; xmin = xx(1); xdiff = xx(2)-xx(1); xpos = double(xmin+NAME_OFFSETX*xdiff); + yy = ylim; ymax = yy(2); ydiff = yy(2)-yy(1); ypos = double(ymax-NAME_OFFSETY*ydiff); + t=text(xpos, ypos,titl); + axis off; + end; + + set(gca,'Box','off'); + set(gca,'Fontsize',TICKFONT); + set(gca,'color',BACKCOLOR); + if Erpflag == NO & NoTimeflag == NO + if exist('NoTimesPassed')~=1 + l=xlabel('Time (ms)'); + else + l=xlabel('Frames'); + end + set(l,'Fontsize',LABELFONT); + end +end; + +% +%% %%%%%%%%%%%%%%%%%% Overplot sortvar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(NoShow, 'no') + + if NoShowVar == YES + fprintf('Not overplotting sorted sortvar on data.\n'); + + elseif isnan(aligntime) % plot sortvar on un-aligned data + + if Nosort == NO; + fprintf('Overplotting sorted sortvar on data.\n'); + end + hold on; + if TIMEX % overplot sortvar + plot(outsort,outtrials,'k','LineWidth',SORTWIDTH); + else + plot(outtrials,outsort,'k','LineWidth',SORTWIDTH); + end + drawnow + else % plot re-aligned zeros on sortvar-aligned data + if Nosort == NO; + fprintf('Overplotting sorted sortvar on data.\n'); + end + hold on; + if TIMEX % overplot re-aligned 0 time on image + plot([aligntime aligntime],[min(outtrials) max(outtrials)],... + 'k','LineWidth',SORTWIDTH); + else + plot([[min(outtrials) max(outtrials)],aligntime aligntime],... + 'k','LineWidth',SORTWIDTH); + end + fprintf('Overplotting realigned times-zero on data.\n'); + hold on; + + if TIMEX % overplot realigned sortvar on image + plot(0+aligntime-outsort,outtrials,'k','LineWidth',ZEROWIDTH); + else + plot(0+outtrials,aligntime-outsort,'k','LineWidth',ZEROWIDTH); + end + drawnow + end +end; + +% +%% %%%%%%%%%%%%%%%%%% Overplot auxvar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(NoShow, 'no') + if ~isempty(auxvar) + fprintf('Overplotting auxvar(s) on data.\n'); + hold on; + auxtrials = outtrials(:)' ; % make row vector + + if exist('auxcolors')~=1 % If no auxcolors specified + auxcolors = cell(1,size(auxvar,1)); + for c=1:size(auxvar,1) + auxcolors(c) = {'k'}; % plot auxvars as black trace(s) + end + end + if length(auxcolors) < size(auxvar,1) + nauxColors = length(auxcolors); + for k=nauxColors+1:size(auxvar,1) + auxcolors = { auxcolors{:} auxcolors{1+rem(k-1,nauxColors)}}; + end + end + for c=1:size(auxvar,1) + auxcolor = auxcolors{c}; + if ~isempty(auxcolor) + if isnan(aligntime) % plot auxvar on un-aligned data + if TIMEX % overplot auxvar + plot(auxvar(c,:)',auxtrials',auxcolor,'LineWidth',SORTWIDTH); + else + plot(auxtrials',auxvar(c,:)',auxcolor,'LineWidth',SORTWIDTH); + end + drawnow + else % plot re-aligned zeros on sortvar-aligned data + if TIMEX % overplot realigned 0-time on image + plot(auxvar(c,:)',auxtrials',auxcolor,'LineWidth',ZEROWIDTH); + else + plot(0+auxtrials',aligntime-auxvar(c,:)',auxcolor,'LineWidth',ZEROWIDTH); + end + drawnow + end % aligntime + end % if auxcolor + end % c + end % auxvar + if exist('outpercent') + for index = 1:length(outpercent) + if isnan(aligntime) % plot auxvar on un-aligned data + plot(outpercent{index},outtrials,'k','LineWidth',SORTWIDTH); + else + plot(aligntime-outpercent{index},outtrials,'k','LineWidth',SORTWIDTH); + end; + end; + end; +end; +% +%% %%%%%%%%%%%%%%%%%%%%%% Plot colorbar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(NoShow, 'no') + if Colorbar == YES + pos=get(ax1,'Position'); + axcb=axes('Position',... + [pos(1)+pos(3)+0.02 pos(2) ... + 0.03 pos(4)]); + cbar(axcb,0,[mindat,maxdat]); % plot colorbar to right of image + title(cbar_title); + set(axcb,'fontsize',TICKFONT,'xtick',[]); + % drawnow + axes(ax1); % reset current axes to the erpimage + end +end; + +% +%% %%%%%%%%%%%%%%%%%%%%% Compute ERP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +erp = []; + +if Erpflag == YES + if exist('erpalpha') + if erp_ptiles>1, + fprintf(['\nOnly plotting one ERP (i.e., not plotting ERPs from %d percentile splits) ' ... + 'because ''erpalpha'' option was chosen. You can''t plot both.\n\n'],erp_ptiles) + end + [erp erpsig] = nan_mean(fastif(length(tsurdata) > 0, tsurdata',urdata'), ... + erpalpha); + fprintf(' Mean ERP (p<%g) significance threshold: +/-%g\n', ... + erpalpha,mean(erpsig)); + else + %potentially make ERPs of 50%, 33%, or 25% split of trials + n_trials=size(urdata,2); + trials_step=round(n_trials/erp_ptiles); + erp=zeros(erp_ptiles,size(urdata,1)); + for ploop=1:erp_ptiles, + ptile_trials=[1:trials_step]+(ploop-1)*trials_step; + if max(ptile_trials)>n_trials, + ptile_trials=ptile_trials(1):n_trials; + end + if length(tsurdata) > 0 + erp(ploop,:) = nan_mean(tsurdata(:,ptile_trials)'); + else + erp(ploop,:) = nan_mean(urdata(:,ptile_trials)'); + end; + end + % else + %orig line + %[erp] = nan_mean(fastif(length(tsurdata) > 0, tsurdata', urdata')); + %end + end % compute average ERP, ignoring nan's +end; + +if Erpflag == YES & strcmpi(NoShow, 'no') + axes(ax1); % reset current axes to the erpimage + xtick = get(ax1,'Xtick'); % remember x-axis tick locations + xticklabel = get(ax1,'Xticklabel'); % remember x-axis tick locations + set(ax1, 'xticklabel', []); + widthxticklabel = size(xticklabel,2); + xticklabel = cellstr(xticklabel); + for tmpindex = 1:length(xticklabel) + if length(xticklabel{tmpindex}) < widthxticklabel + spaces = char(ones(1,ceil((widthxticklabel-length(xticklabel{tmpindex}))/2) )*32); + xticklabel{tmpindex} = [spaces xticklabel{tmpindex}]; + end; + end; + xticklabel = strvcat(xticklabel); + if Erpstdflag == YES + stdev = nan_std(urdata'); + end; + % + %%%%%% Plot ERP time series below image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if isnan(maxerp) + fac = 10; + maxerp = 0; + while maxerp == 0 + maxerp = round(fac*YEXPAND*max(erp))/fac; % minimal decimal places + fac = 10*fac; + end + if Erpstdflag == YES + fac = fac/10; + maxerp = max(maxerp, round(fac*YEXPAND*max(erp+stdev))/fac); + end; + if ~isempty(erpsig) + erpsig = [erpsig;-1*erpsig]; + maxerp = max(maxerp, round(fac*YEXPAND*max(erpsig))/fac); + end + maxerp=max(maxerp); + end + if isnan(minerp) + fac = 1; + minerp = 0; + while minerp == 0 + minerp = round(fac*YEXPAND*min(erp))/fac; % minimal decimal places + fac = 10*fac; + end + if Erpstdflag == YES + fac = fac/10; + minerp = min(minerp, round(fac*YEXPAND*min(erp-stdev))/fac); + end; + if ~isempty(erpsig) + minerp = min(minerp, round(fac*YEXPAND*min(erpsig))/fac); + end + minerp=min(minerp); + end + limit = [timelimits(1:2) minerp maxerp]; + + if ~isnan(coherfreq) + set(ax1,'Xticklabel',[]); % remove tick labels from bottom of image + ax2=axes('Position',... + [gcapos(1) gcapos(2)+2/3*image_loy*gcapos(4) ... + gcapos(3) (image_loy/3-YGAP)*gcapos(4)]); + else + ax2=axes('Position',... + [gcapos(1) gcapos(2) ... + gcapos(3) image_loy*gcapos(4)]); + end + fprintf('Plotting the ERP trace below the ERP image\n'); + if Erpstdflag == YES + if Showwin + tmph = plot1trace(ax2,times,erp,limit,[],stdev,times(winlocs),erp_grid,erp_vltg_ticks); % plot ERP +/-stdev + else + tmph = plot1trace(ax2,times,erp,limit, [], stdev,[],erp_grid,erp_vltg_ticks); % plot ERP +/-stdev + end + elseif ~isempty('erpsig') + if Showwin + tmph = plot1trace(ax2,times,erp,limit,erpsig,[],times(winlocs),erp_grid,erp_vltg_ticks); % plot ERP and 0+/-alpha threshold + else + tmph = plot1trace(ax2,times,erp,limit,erpsig,[],[],erp_grid,erp_vltg_ticks); % plot ERP and 0+/-alpha threshold + end + else % plot ERP alone - no significance or std dev plotted + if Showwin + tmph = plot1trace(ax2,times,erp,limit,[],[],times(winlocs),erp_grid,erp_vltg_ticks); % plot ERP alone + else + tmph = plot1trace(ax2,times,erp,limit,[],[],[],erp_grid,erp_vltg_ticks); % plot ERP alone + end + end; + + if ~isnan(aligntime) + line([aligntime aligntime],[limit(3:4)*1.1],'Color','k','LineWidth',ZEROWIDTH); % x=median sort value + line([0 0],[limit(3:4)*1.1],'Color','k','LineWidth',ZEROWIDTH); % x=median sort value + % remove y axis + if length(tmph) > 1 + delete(tmph(end)); + end; + end + + set(ax2,'Xtick',xtick); % use same Xticks as erpimage above + if ~isnan(coherfreq) + set(ax2,'Xticklabel',[]); % remove tick labels from ERP x-axis + else % bottom axis + set(ax2,'Xticklabel',xticklabel); % add ticklabels to ERP x-axis + end + + if isnan(coherfreq) % if no amp and coher plots below . . . + if TIMEX & NoTimeflag == NO + if exist('NoTimesPassed')~=1 + l=xlabel('Time (ms)'); + else + l=xlabel('Frames'); + end + set(l,'FontSize',LABELFONT); + % $$$ else + % $$$ if exist('NoTimesPassed')~=1 + % $$$ l=ylabel('Time (ms)'); + % $$$ else + % $$$ l=ylabel('Frames'); + % $$$ end + % $$$ set(l,'FontSize',LABELFONT); + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% plot vert lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~isempty(verttimes) + if size(verttimes,1) == ntrials + vts=sort(verttimes); + vts = vts(ceil(ntrials/2),:); % plot median verttimes values if a matrix + else + vts = verttimes(:)'; % make verttimes a row vector + end + for vt = vts + if isnan(aligntime) + if TIMEX % overplot vt on ERP + mydotstyle = DOTSTYLE; + if exist('auxcolors') & ... + length(verttimes) == length(verttimesColors) + mydotstyle = verttimesColors{find(verttimes == vt)}; + end + plot([vt vt],[limit(3:4)],mydotstyle,'Linewidth',VERTWIDTH); + else + plot([min(outtrials) max(outtrials)],[limit(3:4)],DOTSTYLE,... + 'Linewidth',VERTWIDTH); + end + else + if TIMEX % overplot realigned vt on ERP + plot(repmat(median(aligntime+vt-outsort),1,2),[limit(3),limit(4)],... + DOTSTYLE,'LineWidth',VERTWIDTH); + else + plot([limit(3),limit(4)],repmat(median(aligntime+vt-outsort),1,2),... + DOTSTYLE,'LineWidth',VERTWIDTH); + end + end + end + end + + limit = double(limit); + ydelta = double(1/10*(limit(2)-limit(1))); + ytextoffset = double(limit(1)-1.1*ydelta); + ynumoffset = double(limit(1)-0.3*ydelta); % double for Matlab 7 + + %Far left axis max and min labels not needed now that there are tick + %marks + %t=text(ynumoffset,0.7*limit(3), num2str(limit(3))); + %set(t,'HorizontalAlignment','right','FontSize',TICKFONT) + %t=text(ynumoffset,0.7*limit(4), num2str(limit(4))); + %set(t,'HorizontalAlignment','right','FontSize',TICKFONT) + + ynum = 0.7*(limit(3)+limit(4))/2; + t=text(ytextoffset,ynum,yerplabel,'Rotation',90); + set(t,'HorizontalAlignment','center','FontSize',LABELFONT) + + if ~exist('YDIR') + error('\nerpimage(): Default YDIR not read from ''icadefs.m'''); + end + if YDIR == 1 + set(ax2,'ydir','normal') + else + set(ax2,'ydir','reverse') + end + + set(ax2,'Fontsize',TICKFONT); + set(ax2,'Box','off','color',BACKCOLOR); + drawnow +end + +% +%% %%%%%%%%%%%%%%%%%%% Plot amp, coher time series %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isnan(coherfreq) + if freq > 0 + coherfreq = mean(freq); % use phase-sort frequency + end + % + %%%%%% Plot amp axis below ERP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if ~Allampsflag %%%% don't repeat computation if already done for 'allamps' + + fprintf('Computing and plotting amplitude at %g Hz.\n',coherfreq); + + if ~isnan(signifs) | Cohsigflag==NO % don't compute or plot signif. levels + [amps,cohers] = phasecoher(urdata,size(times,2),srate,coherfreq,cycles); + if ~isnan(signifs) + ampsig = signifs([1 2]); + fprintf('Using supplied amplitude significance levels: [%g,%g]\n',... + ampsig(1),ampsig(2)); + cohsig = signifs(3); + fprintf('Using supplied coherence significance level: %g\n',cohsig); + end + else % compute amps, cohers with significance + fprintf(... + 'Computing and plotting %g coherence significance level at %g Hz...\n',... + alpha, coherfreq); + [amps,cohers,cohsig,ampsig] = ... + phasecoher(urdata,size(times,2),srate,coherfreq,cycles,alpha); + fprintf('Coherence significance level: %g\n',cohsig); + ampsig = 20*log10(ampsig); % convert to dB + end + amps = 20*log10(amps); % convert to dB + + if isnan(baseamp) % if baseamp not specified in 'limits' + if ~isempty(baselinedb) && isnan(baselinedb(1)) + disp('Not removing amplitude baseline'); + else + if isempty(baselinedb) + baselinedb = [times(1) DEFAULT_BASELINE_END]; + end; + base = find(times >= baselinedb(1) & times<=baselinedb(end)); % use default baseline end point (ms) + if length(base)<2 + base = 1:floor(length(times)/4); % default first quarter-epoch + fprintf('Using %g to %g ms as amplitude baseline.\n',... + times(1),times(base(end))); + end + [amps,baseamp] = rmbase(amps,length(times),base); % remove dB baseline + fprintf('Removed baseline amplitude of %d dB for plotting.\n',baseamp); + end; + else % if 'basedB' specified in 'limits' (in dB) + fprintf('Removing specified baseline amplitude of %d dB for plotting.\n',... + baseamp); + amps = amps-baseamp; % remove specified dB baseline + end + + fprintf('Data amplitude levels: [%g %g] dB\n',min(amps),max(amps)); + + if alpha>0 % if computed significance levels + ampsig = ampsig - baseamp; + fprintf('Data amplitude significance levels: [%g %g] dB\n',ampsig(1),ampsig(2)); + end + + end % ~Allampsflag + + if strcmpi(NoShow, 'no') + axis('off') % rm ERP axes axis and labels + + v=axis; + minampERP=v(3); + maxampERP=v(4); + + if ~exist('ynumoffset') + limit = [timelimits(1:2) -max(abs([minampERP maxampERP])) max(abs([minampERP maxampERP]))]; + limit = double(limit); + ydelta = double(1/10*(limit(2)-limit(1))); + ytextoffset = double(limit(1)-1.1*ydelta); + ynumoffset = double(limit(1)-0.3*ydelta); % double for Matlab 7 + end + + t=text(double(ynumoffset),double(maxampERP),num2str(maxampERP,3)); + set(t,'HorizontalAlignment','right','FontSize',TICKFONT); + + t=text(double(ynumoffset),double(minampERP), num2str(minampERP,3)); + set(t,'HorizontalAlignment','right','FontSize',TICKFONT); + + ax3=axes('Position',... + [gcapos(1) gcapos(2)+1/3*image_loy*gcapos(4) ... + gcapos(3) (image_loy/3-YGAP)*gcapos(4)]); + + if isnan(maxamp) % if not specified + fac = 1; + maxamp = 0; + while maxamp == 0 + maxamp = floor(YEXPAND*fac*max(amps))/fac; % minimal decimal place + fac = 10*fac; + end + maxamp = maxamp + 10/fac; + if Cohsigflag + if ampsig(2)>maxamp + if ampsig(2)>0 + maxamp = 1.01*(ampsig(2)); + else + maxamp = 0.99*(ampsig(2)); + end + end + end + end + if isnan(maxamp), maxamp = 0; end % In case the above iteration went on + % until fac = Inf and maxamp = NaN again. + + if isnan(minamp) % if not specified + fac = 1; + minamp = 0; + while minamp == 0 + minamp = floor(YEXPAND*fac*max(-amps))/fac; % minimal decimal place + fac = 10*fac; + end + minamp = minamp + 10/fac; + minamp = -minamp; + if Cohsigflag + if ampsig(1)< minamp + if ampsig(1)<0 + minamp = 1.01*(ampsig(1)); + else + minamp = 0.99*(ampsig(1)); + end + end + end + end + if isnan(minamp), minamp = 0; end % In case the above iteration went on + % until fac = Inf and minamp = NaN again. + + fprintf('Plotting the ERSP amplitude trace below the ERP\n'); + fprintf('Min, max plotting amplitudes: [%g, %g] dB\n',minamp,maxamp); + fprintf(' relative to baseamp: %g dB\n',baseamp); + if Cohsigflag + ampsiglims = [repmat(ampsig(1)-mean(ampsig),1,length(times))]; + ampsiglims = [ampsiglims;-1*ampsiglims]; + plot1trace(ax3,times,amps,[timelimits minamp(1) maxamp(1)],ampsiglims,[],[],0); % plot AMP + else + plot1trace(ax3,times,amps,[timelimits minamp(1) maxamp(1)],[],[],[],0); % plot AMP + end + + if ~isnan(aligntime) + line([aligntime aligntime],[minamp(1) maxamp(1)]*1.1,'Color','k'); + % x=median sort value + end + if exist('xtick') % Added -JH + set(ax3,'Xtick',xtick); + end + set(ax3,'Xticklabel',[]); % remove tick labels from bottom of image + set(ax3,'Yticklabel',[]); % remove tick labels from left of image + set(ax3,'YColor',BACKCOLOR); + axis('off'); + set(ax3,'Box','off','color',BACKCOLOR); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% plot vert marks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~isempty(verttimes) + if size(verttimes,1) == ntrials + vts=sort(verttimes); + vts = vts(ceil(ntrials/2),:); % plot median values if a matrix + else + vts=verttimes(:)'; + end + for vt = vts + if isnan(aligntime) + if TIMEX % overplot vt on amp + mydotstyle = DOTSTYLE; + if exist('auxcolors') & ... + length(verttimes) == length(verttimesColors) + mydotstyle = verttimesColors{find(verttimes == vt)}; + end + + plot([vt vt],[minamp(1) maxamp(1)],mydotstyle,... + 'Linewidth',VERTWIDTH); + else + plot([min(outtrials) max(outtrials)],[minamp(1) maxamp(1)], ... + DOTSTYLE,... + 'Linewidth',VERTWIDTH); + end + else + if TIMEX % overplot realigned vt on amp + plot(repmat(median(aligntime+vt-outsort),1,2), ... + [minamp(1),maxamp(1)],DOTSTYLE,... + 'LineWidth',VERTWIDTH); + else + plot([minamp,maxamp],repmat(median(aligntime+vt-outsort),1,2), ... + DOTSTYLE,... + 'LineWidth',VERTWIDTH); + end + end + end + end + + if 0 % Cohsigflag % plot amplitude significance levels + hold on + plot([timelimits(1) timelimits(2)],[ampsig(1) ampsig(1)] - mean(ampsig),'r',... + 'linewidth',SIGNIFWIDTH); + plot([timelimits(1) timelimits(2)],[ampsig(2) ampsig(2)] - mean(ampsig),'r',... + 'linewidth',SIGNIFWIDTH); + end + + if ~exist('ynumoffset') + limit = [timelimits(1:2) -max(abs([minamp maxamp])) max(abs([minamp maxamp]))]; + limit = double(limit); + ydelta = double(1/10*(limit(2)-limit(1))); + ytextoffset = double(limit(1)-1.1*ydelta); + ynumoffset = double(limit(1)-0.3*ydelta); % double for Matlab 7 + end + + t=text(ynumoffset,maxamp, num2str(maxamp,3)); + set(t,'HorizontalAlignment','right','FontSize',TICKFONT); + + t=text(ynumoffset,0, num2str(0)); + set(t,'HorizontalAlignment','right','FontSize',TICKFONT); + + t=text(ynumoffset,minamp, num2str(minamp,3)); + set(t,'HorizontalAlignment','right','FontSize',TICKFONT); + + t=text(ytextoffset,(maxamp+minamp)/2,'ERSP','Rotation',90); + set(t,'HorizontalAlignment','center','FontSize',LABELFONT); + + axtmp = axis; + dbtxt= text(1/13*(axtmp(2)-axtmp(1))+axtmp(1), ... + 11/13*(axtmp(4)-axtmp(3))+axtmp(3), ... + [num2str(baseamp,4) ' dB']); + set(dbtxt,'fontsize',TICKFONT); + drawnow; + set(ax3, 'xlim', timelimits); + set(ax3, 'ylim', [minamp(1) maxamp(1)]); + + % + %%%%%% Make coher axis below amp %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + ax4=axes('Position',... + [gcapos(1) gcapos(2) ... + gcapos(3) (image_loy/3-YGAP)*gcapos(4)]); + if isnan(maxcoh) + fac = 1; + maxcoh = 0; + while maxcoh == 0 + maxcoh = floor(YEXPAND*fac*max(cohers))/fac; % minimal decimal place + fac = 10*fac; + end + maxcoh = maxcoh + 10/fac; + if maxcoh>1 + maxcoh=1; % absolute limit + end + end + if isnan(mincoh) + mincoh = 0; + end + fprintf('Plotting the ITC trace below the ERSP\n'); + if Cohsigflag % plot coherence significance level + cohsiglims = [repmat(cohsig,1,length(times));zeros(1,length(times))]; + coh_handle = plot1trace(ax4,times,cohers,[timelimits mincoh maxcoh],cohsiglims,[],[],0); + % plot COHER, fill sorting window + else + coh_handle = plot1trace(ax4,times,cohers,[timelimits mincoh maxcoh],[],[],[],0); % plot COHER + end + if ~isnan(aligntime) + line([aligntime aligntime],[[mincoh maxcoh]*1.1],'Color','k'); + % x=median sort value + end + % set(ax4,'Xticklabel',[]); % remove tick labels from bottom of + % image + if exist('xtick') + set(ax4,'Xtick',xtick); + set(ax4,'Xticklabel',xticklabel); + end + set(ax4,'Ytick',[]); + set(ax4,'Yticklabel',[]); % remove tick labels from left of image + set(ax4,'YColor',BACKCOLOR); + + if ~isempty(verttimes) + if size(verttimes,1) == ntrials + vts=sort(verttimes); + vts = vts(ceil(ntrials/2),:); % plot median values if a matrix + else + vts = verttimes(:)'; % make verttimes a row vector + end + for vt = vts + if isnan(aligntime) + if TIMEX % overplot vt on coher + mydotstyle = DOTSTYLE; + if exist('auxcolors') & ... + length(verttimes) == length(verttimesColors) + mydotstyle = verttimesColors{find(verttimes == vt)}; + end + + plot([vt vt],[mincoh maxcoh],mydotstyle,'Linewidth',VERTWIDTH); + else + plot([min(outtrials) max(outtrials)],... + [mincoh maxcoh],DOTSTYLE,'Linewidth',VERTWIDTH); + end + else + if TIMEX % overplot realigned vt on coher + plot(repmat(median(aligntime+vt-outsort),1,2),... + [mincoh,maxcoh],DOTSTYLE,'LineWidth',VERTWIDTH); + else + plot([mincoh,maxcoh],repmat(median(aligntime+vt-outsort),1,2),... + DOTSTYLE,'LineWidth',VERTWIDTH); + end + end + end + end + + t=text(ynumoffset,0, num2str(0)); + set(t,'HorizontalAlignment','right','FontSize',TICKFONT); + + t=text(ynumoffset,maxcoh, num2str(maxcoh)); + set(t,'HorizontalAlignment','right','FontSize',TICKFONT); + + t=text(ytextoffset,maxcoh/2,'ITC','Rotation',90); + set(t,'HorizontalAlignment','center','FontSize',LABELFONT); + drawnow + + %if Cohsigflag % plot coherence significance level + %hold on + %plot([timelimits(1) timelimits(2)],[cohsig cohsig],'r',... + %'linewidth',SIGNIFWIDTH); + %end + + set(ax4,'Box','off','color',BACKCOLOR); + set(ax4,'Fontsize',TICKFONT); + if NoTimeflag==NO + if exist('NoTimesPassed')~=1 + l=xlabel('Time (ms)'); + else + l=xlabel('Frames'); + end + set(l,'Fontsize',LABELFONT); + end + axtmp = axis; + hztxt=text(10/13*(axtmp(2)-axtmp(1))+axtmp(1), ... + 8/13*(axtmp(4)-axtmp(3))+axtmp(3), ... + [num2str(coherfreq,4) ' Hz']); + set(hztxt,'fontsize',TICKFONT); + end;% NoShow +else + amps = []; % null outputs unless coherfreq specified + cohers = []; +end + +if VERS >= 8.04 + axhndls = {ax1 axcb ax2 ax3 ax4}; +else + axhndls = [ax1 axcb ax2 ax3 ax4]; +end + +if exist('ur_outsort') + outsort = ur_outsort; % restore outsort clipped values, if any +end +if nargout<1 + data = []; % don't spew out data if no args out and no ; +end + +% +%% %%%%%%%%%%%%% Plot a topoplot() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if (~isempty(topomap)) & strcmpi(NoShow, 'no') + h(12)=axes('Position',... + [gcapos(1)+0.10*gcapos(3) gcapos(2)+0.92*gcapos(4),... + 0.20*gcapos(3) 0.14*gcapos(4)]); + % h(12) = subplot('Position',[.10 .86 .20 .14]); + fprintf('Plotting a topo map in upper left.\n'); + eloc_info.plotrad = []; + if length(topomap) == 1 + try + topoplot(topomap,eloc_file,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10, 'chaninfo', eloc_info); + catch + fprintf('topoplot() plotting failed.\n'); + end; + else + try + topoplot(topomap,eloc_file,'electrodes','off', 'chaninfo', eloc_info); + catch + fprintf('topoplot() plotting failed.\n'); + end; + end; + axis('square') + if VERS >= 8.04 + axhndls = {axhndls h(12)}; + else + axhndls = [axhndls h(12)]; + end +end + +% +%% %%%%%%%%%%%%% Plot a spectrum %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +SPECFONT = 10; +if (~isempty(lospecHz)) && strcmpi(NoShow, 'no') + h(13)=axes('Position',... + [gcapos(1)+0.82*gcapos(3) ... + gcapos(2)+0.96*gcapos(4),... + 0.15*gcapos(3)*(0.8/gcapos(3))^0.5 ... + 0.10*gcapos(4)*(0.8/gcapos(4))^0.5]); + + % h(13) = subplot('Position',[.75 .88 .15 .10]); + fprintf('Plotting the data spectrum in upper right.\n'); + winlength = frames; + if winlength > 512 + for k=2:5 + if rem(winlength,k) == 0 + break + end + end + winlength = winlength/k; + end + + % [Pxx, Pxxc, F] = PSD(X,NFFT,Fs,WINDOW,NOVERLAP,P) + if exist('psd') == 2 + [Pxx,F] = psd(reshape(urdata,1,size(urdata,1)*size(urdata,2)),... + max(1024,pow2(ceil(log2(frames)))),srate,frames,0,0.05); + % [Pxx,F] = psd(reshape(urdata,1,size(urdata,1)*size(urdata,2)),512,srate,winlength,0,0.05); + else + [Pxx,F] = spec(reshape(urdata,1,size(urdata,1)*size(urdata,2)),... + max(1024,pow2(ceil(log2(frames)))),srate,frames,0); + % [Pxx,F] = spec(reshape(urdata,1,size(urdata,1)*size(urdata,2)),512,srate,winlength,0); + end; + + plot(F,10*log10(Pxx)); + goodfs = find(F>= lospecHz & F <= hispecHz); + maxgfs = max(10*log10(Pxx(goodfs))); + mingfs = min(10*log10(Pxx(goodfs))); + axis('square') + axis([lospecHz hispecHz mingfs-1 maxgfs+1]); + set(h(13),'Box','off','color',BACKCOLOR); + set(h(13),'Fontsize',SPECFONT); + set(h(13),'Xscale',SpecAxis); % added 'log' or 'linear' freq axis scaling -SM 5/31/12 + l=ylabel('dB'); + set(l,'Fontsize',SPECFONT); + if ~isnan(coherfreq) + hold on; plot([coherfreq,coherfreq],[mingfs maxgfs],'r'); + end + if VERS >= 8.04 + axhndls = {axhndls h(13)}; + else + axhndls = [axhndls h(13)]; + end +end + +% +%% %%%%%%%%%%%%% save plotting limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +limits = [min(times) max(times) minerp maxerp minamp maxamp mincoh maxcoh]; +limits = [limits baseamp coherfreq]; % add coherfreq to output limits array + +% +%% %%%%%%%%%%%%% turn on axcopy() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(NoShow, 'no') + axcopy(gcf); + % eegstr = 'img=get(gca,''''children''''); if (strcmp(img(end),''''type''''),''''image''''), img=get(img(end),''''CData''''); times=get(img(end),''''Xdata''''); clf; args = [''''limits'''' '''','''' times(1) '''','''' times(end)]; if exist(''''EEG'''')==1, args = [args '''','''' ''''srate'''' '''','''' EEG.srate]; end eegplot(img,args); end'; + % axcopy(gcf,eegstr); +end; + + +% returning outsort +if exist('outpercent') + outsort = { outsort outpercent }; +end; + +fprintf('Done.\n\n'); + +% +%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% End erpimage() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(NoShow, 'no') + axes('position',gcapos); + axis off +end; +warning on; + +return +% +%% %%%%%%%%%%%%%%%%% function plot1trace() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +function [plot_handle] = plot1trace(ax,times,trace,axlimits,signif,stdev,winlocs,erp_grid,erp_vltg_ticks) +%function [plot_handle] = plot1trace(ax,times,trace,axlimits,signif,stdev,winlocs,erp_grid,erp_vltg_ticks) +% If signif is [], plot trace +/- stdev +% Else if signif, plot trace and signif(1,:)&signif(2,:) fill. +% Else, plot trace alone. +% If winlocs not [], plot grey back image(s) in sort window +% winlocs(1,1)-> winlocs(1,end) (ms) +% ... +% winlocs(end,1)-> winlocs(end,end) (ms) + +FILLCOLOR = [.66 .76 1]; +WINFILLCOLOR = [.88 .92 1]; +ERPDATAWIDTH = 2; +ERPZEROWIDTH = 2; +axes(ax); + +if nargin<9, + erp_vltg_ticks=[]; %if erp_vltg_ticks is not empty, those will be the ticks used on the y-axis (voltage axis for ERPs) +end + +if ~isempty(winlocs) + for k=1:size(winlocs,1) + winloc = winlocs(k,:); + fillwinx = [winloc winloc(end:-1:1)]; + hannwin = makehanning(length(winloc)); + hannwin = hannwin./max(hannwin); % make max = 1 + hannwin = hannwin(:)'; % make row vector + if ~isempty(axlimits) & sum(isnan(axlimits))==0 + % fillwiny = [repmat(axlimits(3),1,length(winloc)) repmat(axlimits(4),1,length(winloc))]; + fillwiny = [hannwin*axlimits(3) hannwin*axlimits(4)]; + else + % fillwiny = [repmat(min(trace)*1.1,1,length(winloc)) repmat(max(trace)*1.1,1,length(winloc))]; + fillwiny = [hannwin*2*min(trace) hannwin*2*max(trace)]; + end + fillwh = fill(fillwinx,fillwiny, WINFILLCOLOR); hold on % plot 0+alpha + set(fillwh,'edgecolor',WINFILLCOLOR-[.00 .00 0]); % make edges NOT highlighted + end +end +if ~isempty(signif);% (2,times) array giving upper and lower signif limits + filltimes = [times times(end:-1:1)]; + if size(signif,1) ~=2 | size(signif,2) ~= length(times) + fprintf('plot1trace(): signif array must be size (2,frames)\n') + return + end + fillsignif = [signif(1,:) signif(2,end:-1:1)]; + fillh = fill(filltimes,fillsignif, FILLCOLOR); hold on % plot 0+alpha + set(fillh,'edgecolor',FILLCOLOR-[.02 .02 0]); % make edges slightly highlighted + % [plot_handle] = plot(times,signif, 'r','LineWidth',1); hold on % plot 0+alpha + % [plot_handle] = plot(times,-1*signif, 'r','LineWidth',1); hold on % plot 0-alpha +end +if ~isempty(stdev) + [st1] = plot(times,trace+stdev, 'r--','LineWidth',1); hold on % plot trace+stdev + [st2] = plot(times,trace-stdev, 'r--','LineWidth',1); hold on % plot trace-stdev +end +%linestyles={'r','m','c','b'}; +% 'LineStyle',linestyles{traceloop}); hold on +linecolor={[0 0 1],[.25 0 .75],[.75 0 .25],[1 0 0]}; +plot_handle=zeros(1,size(trace,1)); +for traceloop=1:size(trace,1), + [plot_handle(traceloop)] = plot(times,trace(traceloop,:),'LineWidth',ERPDATAWIDTH, ... + 'color',linecolor{traceloop}); hold on +end + +%Assume that multiple traces are equally sized divisions of data +switch size(trace,1), + case 2 + legend('Lower 50%','Higher 50%'); + case 3 + legend('Lowest 33%','Middle 33%','Highest 33%'); + case 4 + legend('Lowest 25%','2nd Lowest 25%','3rd Lowest 25%','Highest 25%'); +end + +if ~isempty(axlimits) && sum(isnan(axlimits))==0 + if axlimits(2)>axlimits(1) && axlimits(4)>axlimits(3) + axis([axlimits(1:2) 1.1*axlimits(3:4)]) + end + l1=line([axlimits(1:2)],[0 0], 'Color','k',... + 'linewidth',ERPZEROWIDTH); % y=zero-line + timebar=0; + l2=line([1 1]*timebar,axlimits(3:4)*1.1,'Color','k',... + 'linewidth',ERPZEROWIDTH); % x=zero-line + + %y-ticks + if isempty(erp_vltg_ticks), + shrunk_ylimits=axlimits(3:4)*.8; + ystep=(shrunk_ylimits(2)-shrunk_ylimits(1))/4; + if ystep>1, + ystep=round(ystep); + else + ord=orderofmag(ystep); + ystep=round(ystep/ord)*ord; + end + if (sign(shrunk_ylimits(2))*sign(shrunk_ylimits(1)))==1, %y shrunk_ylimits don't include 0 + erp_yticks=shrunk_ylimits(1):ystep:shrunk_ylimits(2); + else %y limits include 0 + % erp_yticks=0:ystep:shrunk_ylimits(2); %ensures 0 is a tick point + % erp_yticks=[erp_yticks [0:-ystep:shrunk_ylimits(1)]]; + erp_yticks=0:ystep:axlimits(4); %ensures 0 is a tick point + erp_yticks=[erp_yticks [0:-ystep:axlimits(3)]]; + end + if erp_grid, + set(gca,'ytick',unique(erp_yticks),'ygrid','on'); + else + set(gca,'ytick',unique(erp_yticks)); + end + else + set(gca,'ytick',erp_vltg_ticks); + end +end + +%make ERP traces on top +kids=get(gca,'children')'; +for hndl_loop=plot_handle, + id=find(kids==hndl_loop); + kids(id)=[]; + kids=[hndl_loop kids]; +end +set(gca,'children',kids'); +plot_handle=[plot_handle l1 l2]; + +% +%% %%%%%%%%%%%%%%%%% function phasedet() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% phasedet() - function used in erpimage.m +% Constructs a complex filter at frequency freq +% +function [ang,amp,win] = phasedet(data,frames,srate,nwin,freq) +% Typical values: +% frames = 768; +% srate = 256; % Hz +% nwin = [200:300]; +% freq = 10; % Hz + +data = reshape(data,[frames prod(size(data))/frames]); +% number of cycles depends on window size +% number of cycles automatically reduced if smaller window +% Note: as the number of cycles changes, the frequency shifts +% a little -- this should be fixed + +win = exp(2i*pi*freq(:)*[1:length(nwin)]/srate); +win = win .* repmat(makehanning(length(nwin))',length(freq),1); + +%tmp =gcf; figure; plot(real(win)); figure(tmp); +%fprintf('ANY NAN ************************* %d\n', any(any(isnan( data(nwin,:))))); + +tmpdata = data(nwin,:) - repmat(mean(data(nwin,:), 1), [size(data,1) 1]); +resp = win * tmpdata; +ang = angle(resp); +amp = abs(resp); + +% +%% %%%%%%%%%%%% function prctle() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +function prctl = prctle(data,pc); % return percentile of a distribution +[prows pcols] = size(pc); +if prows ~= 1 & pcols ~= 1 + error('\nerpimage(): pc must be a scalar or a vector.'); +end +if any(pc > 100) | any(pc < 0) + error('\nerpimage(): pc must be between 0 and 100'); +end +[i,j] = size(data); +sortdata = sort(data); +if i==1 | j==1 % if data is a vector + i = max(i,j); j = 1; + if i == 1, + fprintf(' prctle() note: input data is a single scalar!\n') + y = data*ones(length(pc),1); % if data is scalar, return it + return; + end + sortdata = sortdata(:); +end +pt = [0 100*((1:i)-0.5)./i 100]; +sortdata = [min(data); sortdata; max(data)]; +prctl = interp1(pt,sortdata,pc); +% +%% %%%%%%%%%%%%%%%%%%%%% function nan_mean() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% nan_mean() - Take the column means of a matrix, ignoring NaN values. +% Return significance bounds if alpha (0 < alpha< <1) is given. +% +function [out, outalpha] = nan_mean(in,alpha) +NPERM = 500; + +intrials = size(in,1); +inframes = size(in,2); +nans = find(isnan(in)); +in(nans) = 0; +sums = sum(in); +nonnans = ones(size(in)); +nonnans(nans) = 0; +nonnans = sum(nonnans); +nononnans = find(nonnans==0); +nonnans(nononnans) = 1; +out = sum(in)./nonnans; +outalpha = []; +if nargin>1 + if NPERM < round(3/alpha) + NPERM = round(3/alpha); + end + fprintf('Performing a permuration test using %d permutations to determine ERP significance thresholds... ',NPERM); + permerps = zeros(NPERM,inframes); + for n=1:NPERM + signs = sign(randn(1,intrials)'-0.5); + permerps(n,:) = sum(repmat(signs,1,inframes).*in)./nonnans; + if ~rem(n,50) + fprintf('%d ',n); + end + end + fprintf('\n'); + permerps = sort(abs(permerps)); + alpha_bnd = floor(2*alpha*NPERM); % two-sided probability threshold + outalpha = permerps(end-alpha_bnd,:); +end +out(nononnans) = NaN; +% +%% %%%%%%%%%%%%%%%%%%%%% function nan_std() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +function out = nan_std(in) + +nans = find(isnan(in)); +in(nans) = 0; + +nonnans = ones(size(in)); +nonnans(nans) = 0; +nonnans = sum(nonnans); +nononnans = find(nonnans==0); +nonnans(nononnans) = 1; + +out = sqrt((sum(in.^2)-sum(in).^2./nonnans)./(nonnans-1)); +out(nononnans) = NaN; + +% symmetric hanning function +function w = makehanning(n) +if ~rem(n,2) + w = 0.5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = 0.5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end +% +%% %%%%%%%%%%%%%%%%%%%%% function compute_percentile() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +function outpercent = compute_percentile(sortvar, percent, outtrials, winsize); +ntrials = length(sortvar); +outtrials=round(outtrials); +sortvar = [ sortvar sortvar sortvar ]; +winvals = [round(-winsize/2):round(winsize/2)]; +outpercent = zeros(size(outtrials)); +for index = 1:length(outtrials) + sortvarval = sortvar(outtrials(index)+ntrials+winvals); + sortvarval = sort(sortvarval); + outpercent(index) = sortvarval(round((length(winvals)-1)*percent)+1); +end; + +% +%% %%%%%%%%%%%%%%%%%%%%% function orderofmag() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +function ord=orderofmag(val) +%function ord=orderofmag(val) +% +% Returns the order of magnitude of the value of 'val' in multiples of 10 +% (e.g., 10^-1, 10^0, 10^1, 10^2, etc ...) +% used for computing erpimage trial axis tick labels as an alternative for +% plotting sorting variable + +val=abs(val); +if val>=1 + ord=1; + val=floor(val/10); + while val>=1, + ord=ord*10; + val=floor(val/10); + end + return; +else + ord=1/10; + val=val*10; + while val<1, + ord=ord/10; + val=val*10; + end + return; +end + +% +%% %%%%%%%%%%%%%%%%%%%%% function find_crspnd_pt() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +function y_pt=find_crspnd_pt(targ,vals,outtrials) +%function id=find_crspnd_pt(targ,vals,outtrials) +% +% Inputs: +% targ - desired value of sorting variable +% vals - a vector of observed sorting variables (possibly smoothed) +% outtrials - a vector of y-axis values corresponding to trials in the +% ERPimage (this will just be 1:n_trials if there's no +% smoothing) +% +% Output: +% y_pt - y-axis value (in units of trials) corresponding to "targ". +% If "targ" matches more than one y-axis pt, the median point is +% returned. If "targ" falls between two points, y_pt is linearly +% interpolated. +% +% Note: targ and vals should be in the same units (e.g., milliseconds) + +%find closest point above +abv=find(vals>=targ); +if isempty(abv), + %point lies outside of vals range, can't interpolate + y_pt=[]; + return +end +abv=abv(1); + +%find closest point below +blw=find(vals<=targ); +if isempty(blw), + %point lies outside of vals range, can't interpolate + y_pt=[]; + return +end +blw=blw(end); + +if (vals(abv)==vals(blw)), + %exact match + ids=find(vals==targ); + y_pt=median(outtrials(ids)); +else + %interpolate point + + %lst squares inear regression + B=regress([outtrials(abv) outtrials(blw)]',[ones(2,1) [vals(abv) vals(blw)]']); + + %predict outtrial point from target value + y_pt=[1 targ]*B; + +end + + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eventalign.m b/code/eeglab13_4_4b/functions/sigprocfunc/eventalign.m new file mode 100644 index 0000000..9c38d5e --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eventalign.m @@ -0,0 +1,31 @@ +% eventalign - function called by pop_importevent() to find the best +% sampling rate ratio to align 2 arrays of data events. +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, Dec 2003 + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 9 Feb 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function mindiff = eventalign(factor, a, b, measure) + + diffarray = abs(factor*a-b)'; + [allmins poss] = min(diffarray); + + if strcmpi(measure, 'mean') + mindiff = mean(allmins); + else + mindiff = median(allmins); + end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eventlock.m b/code/eeglab13_4_4b/functions/sigprocfunc/eventlock.m new file mode 100644 index 0000000..ad24ca3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eventlock.m @@ -0,0 +1,195 @@ +% eventlock() - DEPRECATED: Please use eegalign() instead. +% eventlock() - Time lock data epochs to specified event frames or event x-values. +% Use to timelock existing data epochs to reaction times or other events +% +% Usage: +% >> [dataout,medval,shiftframes] = eventlock(data,frames,eventframes,medval); +% >> [dataout,medval,shiftframes] = eventlock(data,xvals,eventvals,medval); +% +% Inputs for multi-channel data: +% data = input data, size(chans,frames*epochs) +% frames = scalar, frames per epoch {0 -> data length} +% eventframes = time locking event frames, size(1,epochs) +% medval = median eventframe to align to {default: median(eventvals)} +% +% Inputs for single-channel data: +% data = input data, size(frames, epochs) +% xvals = vector of epoch time-values, size(1,frames) +% OR xvals = [startval nframes srate] (ms N Hz) +% eventvals = x-values of time locking events, size(1,epochs) +% medval = median event time to align to {default: median(eventvals)} +% +% Outputs: +% dataout = shifted/sorted data out; size(dataout) = size(data) +% medval = median eventval (time or frame). Data is aligned to this. +% shifts = number of frames shifted for each epoch +% (Note: shift > 0 means shift forward|right) +% +% Note: Missing values are filled with NaN. Some toolbox functions +% ( timef(), crossf(), crosscoher() ) handle NaNs correctly. +% To truncate to non-NaN values, use +% >> dataout = matsel(dataout,frames,... +% 1+max(shifts(find(shifts>=0))):frames+min(shifts(find(shifts<=0)))); +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 8/20/99 + +% Copyright (C) 8/20/99 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 8/23/99 debugged right shifts -sm +% 8/25/99 allowed single- or multiple-channel data -sm +% 3/9/00 fixed order of dims in help msg -sm & ev +% 01-25-02 reformated help & license -ad + +function [data,medval,shifts] = eventlock(data,arg2,eventvals,medval) + +VERBOSE=0; +% +%%%%%%%%%%%%%% Reshape data to (frames,ntrials) %%%%%%%%%%%%% +% +if nargin < 3 + help eventlock + return +end +MULTICHANNEL = 0; +if length(arg2) == 1 % then assume multi-channel: size(chans,epochs*frames) + MULTICHANNEL = 1; + if arg2==0 + frames = length(eventvals); % default 1 epoch + else + frames = arg2; + end + xvals = 1:frames; +else % assume single-channel: size(frames,epochs) + MULTICHANNEL = 0; + xvals = arg2; + if length(xvals) ~= 3 + frames = length(xvals); + else + frames = xvals(2); + end +end +rows = size(data,1); +if MULTICHANNEL + ntrials = size(data,2)/frames; +else + ntrials = size(data,2); +end + +if length(xvals) == 3 % assume [startval nvals srate] format + srate = xvals(3); + endval = xvals(1)+(xvals(2)-1)*xvals(3)+1e-16; + xvals = xvals(1):1000/xvals(3):endval; + xvals = xvals(1:frames); % make sure of length! +else + srate = 1000/(xvals(2)-xvals(1)); +end + +if MULTICHANNEL + if frames*ntrials ~= size(data,2) + fprintf(... + 'Input data length (%d) is not a multiple of the eventframes length (%d).\n',... + size(data,2), frames); + return + end +elseif frames~= size(data,1) + fprintf(... + 'Input data frames (%d) is not equal to xvals length (%d).\n',... + size(data,1), length(xvals)); + return +end + +if length(eventvals) ~= ntrials + fprintf(... + 'eventlock(): Number of eventvals (%d) must equal number of trials (%d).\n',... + length(eventvals), ntrials); + return +end + +if MULTICHANNEL + fprintf('Input data is %d channels by %d frames * %d trials.\n',... + rows,frames,ntrials); +else + fprintf('Input data is %d frames by %d trials.\n',... + frames,ntrials); +end + +% +%%%%%%%%%%%%%%%%%%% Align data to eventvals %%%%%%%%%%%%%%%%%%% +% + +if MULTICHANNEL + frames = rows*frames; + data = reshape(data,frames,ntrials); +end % NB: data is now size((chans*)frames,ntrials) + +aligndata=repmat(nan,frames,ntrials); % begin with matrix of NaN's +shifts = zeros(1,ntrials); + +if ~exist('medval') | isempty(medval) + medval= median(eventvals); +end +[medval medx] = min(abs(medval-xvals)); + medval = xvals(medx); + +if MULTICHANNEL + fprintf('Aligning data to median event frame %g.\n',medval); +else % SINGLE CHANNEL + fprintf('Aligning data to median event time %g.\n',medval); +end + +for i=1:ntrials, %%%%%%%%% foreach trial %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% idx = eventvals(i); +% shft = round(medx-idx); + [tmpx idx] = min(abs(xvals-eventvals(i))); + shft = medx-idx; + +if VERBOSE;fprintf('Trial %d -shift = %d\n',i,shft);end + + shifts(i) = shft; + if MULTICHANNEL + shft = shft*rows; % shift in multiples of chans + end + + if shft>0, % shift right %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if frames > shft + aligndata((1+shft):end,i) = data(1:(end-shft),i); + else + fprintf('No eventlocked data for epoch %d - required shift too large!\n',i); + end + + elseif shft < 0 % shift left %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if frames > -shft + aligndata(1:(end+shft),i) = data((1-shft):end,i); + else + fprintf('No eventlocked data for epoch %d - required shift too large.\n',i); + end + else % shft == 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + aligndata(:,i) = data(:,i); + end +end % end trial %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +fprintf('Shifted trials by %d to %d frames.\n',min(shifts),max(shifts)); +if ~MULTICHANNEL + fprintf(' %g to %g msec.\n',... + 1000/srate*min(shifts),1000/srate*max(shifts)); +end +data = aligndata; % now data is aligned to sortvar + +if MULTICHANNEL + data = reshape(data,rows,frames/rows*ntrials); % demultiplex channels +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/eyelike.m b/code/eeglab13_4_4b/functions/sigprocfunc/eyelike.m new file mode 100644 index 0000000..002f9d4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/eyelike.m @@ -0,0 +1,29 @@ +% eyelike() - calculate a permutation matrix P and a scaling (diagonal) maxtrix S +% such that S*P*E is eyelike (so permutation acts on the rows of E). +% E must be a square matrix. +% Usage: +% >> [eyelike, S, P] = eyelike(E); +% +% Author: Benjamin Blankertz (blanker@first.gmd.de) 3/2/00 + +function [eyelikeres, S, P]= eyelike(E) + +[N, M]= size(E); +if N ~= M + fprintf('eyeLike(): input matrix must be square.\n'); + return +end + +R= E./repmat(sum(abs(E),2),1,N); +Rabs= abs(R); +P= zeros(N); +for n=1:N + [so, si]= sort(-Rabs(:)); + [chosenV, chosenH]= ind2sub([N N], si(1)); + P(chosenH,chosenV)= 1; + Rabs(chosenV,:)= repmat(-inf, 1, N); + Rabs(:,chosenH)= repmat(-inf, N, 1); +end +S= diag(1./diag(P*E)); + +eyelikeres= S*P*E; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/fastif.m b/code/eeglab13_4_4b/functions/sigprocfunc/fastif.m new file mode 100644 index 0000000..42e64d7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/fastif.m @@ -0,0 +1,39 @@ +% fastif() - fast if function. +% +% Usage: +% >> res = fastif(test, s1, s2); +% +% Input: +% test - logical test with result 0 or 1 +% s1 - result if 1 +% s2 - result if 0 +% +% Output: +% res - s1 or s2 depending on the value of the test +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function res = fastif(s1, s2, s3); + +if s1 + res = s2; +else + res = s3; +end; +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/floatread.m b/code/eeglab13_4_4b/functions/sigprocfunc/floatread.m new file mode 100644 index 0000000..ee342e2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/floatread.m @@ -0,0 +1,163 @@ +% floatread() - Read matrix from float file ssuming four byte floating point number +% Can use fseek() to read an arbitary (continguous) submatrix. +% +% Usage: >> a = floatread(filename,size,'format',offset) +% +% Inputs: +% filename - name of the file +% size - determine the number of float elements to be read and +% the dimensions of the resulting matrix. If the last element +% of 'size' is Inf, the size of the last dimension is determined +% by the file length. If size is 'square,' floatread() attempts +% to read a square 2-D matrix. +% +% Optional inputs: +% 'format' - the option FORMAT argument specifies the storage format as +% defined by fopen(). Default format ([]) is 'native'. +% offset - either the number of first floats to skip from the beginning of the +% float file, OR a cell array containing the dimensions of the original +% data matrix and a starting position vector in that data matrix. +% +% Example: % Read a [3 10] submatrix of a four-dimensional float matrix +% >> a = floatread('mydata.fdt',[3 10],'native',{[[3 10 4 5],[1,1,3,4]}); +% % Note: The 'size' and 'offset' arguments must be compatible both +% % with each other and with the size and ordering of the float file. +% +% Author: Sigurd Enghoff, CNL / Salk Institute, La Jolla, 7/1998 +% +% See also: floatwrite(), fopen() + +% Copyright (C) Sigurd Enghoff, CNL / Salk Institute, La Jolla, 7/1998 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 04-26-99 modified by Sigurd Enghoff to handle variable-sized and +% multi-dimensional data. +% 07-08-99 modified by Sigurd Enghoff, FORMAT argument added. +% 02-08-00 help updated for toolbox inclusion -sm +% 02-14-00 added segment arg -sm +% 08-14-00 added size 'square' option -sm +% 01-25-02 reformated help & license, added links -ad + +function A = floatread(fname,Asize,fform,offset) + +if nargin<2 + help floatread + return +end + +if ~exist('fform') | isempty(fform)|fform==0 + fform = 'native'; +end + +if ~exist('offset') + offset = 0; +end + +fid = fopen(fname,'rb',fform); +if fid>0 + if exist('offset') + if iscell(offset) + if length(offset) ~= 2 + error('offset must be a positive integer or a 2-item cell array'); + end + datasize = offset{1}; + startpos = offset{2}; + if length(datasize) ~= length(startpos) + error('offset must be a positive integer or a 2-item cell array'); + end + for k=1:length(datasize) + if startpos(k) < 1 | startpos(k) > datasize(k) + error('offset must be a positive integer or a 2-item cell array'); + end + end + if length(Asize)> length(datasize) + error('offset must be a positive integer or a 2-item cell array'); + end + for k=1:length(Asize)-1 + if startpos(k) ~= 1 + error('offset must be a positive integer or a 2-item cell array'); + end + end + sizedim = length(Asize); + if Asize(sizedim) + startpos(sizedim) - 1 > datasize(sizedim) + error('offset must be a positive integer or a 2-item cell array'); + end + for k=1:length(Asize)-1 + if Asize(k) ~= datasize(k) + error('offset must be a positive integer or a 2-item cell array'); + end + end + + offset = 0; + jumpfac = 1; + for k=1:length(startpos) + offset = offset + jumpfac * (startpos(k)-1); + jumpfac = jumpfac * datasize(k); + end + + elseif length(offset) > 1 + error('offset must be a positive integer or a 2-item cell array'); + end + + % perform the fseek() operation + % ----------------------------- + stts = fseek(fid,4*offset,'bof'); + + if stts ~= 0 + error('floatread(): fseek() error.'); + return + end + end + +% determine what 'square' means +% ----------------------------- + if ischar('Asize') + if iscell(offset) + if length(datasize) ~= 2 | datasize(1) ~= datasize(2) + error('size ''square'' must refer to a square 2-D matrix'); + end + Asize = [datsize(1) datasize(2)]; + elseif strcmp(Asize,'square') + fseek(fid,0,'eof'); % go to end of file + bytes = ftell(fid); % get byte position + fseek(fid,0,'bof'); % rewind + bytes = bytes/4; % nfloats + froot = sqrt(bytes); + if round(froot)*round(froot) ~= bytes + error('floatread(): filelength is not square.') + else + Asize = [round(froot) round(froot)]; + end + end + end + A = fread(fid,prod(Asize),'float'); +else + error('floatread() fopen() error.'); + return +end + +% fprintf(' %d floats read\n',prod(size(A))); + +% interpret last element of Asize if 'Inf' +% ---------------------------------------- +if Asize(end) == Inf + Asize = Asize(1:end-1); + A = reshape(A,[Asize length(A)/prod(Asize)]); +else + A = reshape(A,Asize); +end + +fclose(fid); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/floatwrite.m b/code/eeglab13_4_4b/functions/sigprocfunc/floatwrite.m new file mode 100644 index 0000000..c6eadff --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/floatwrite.m @@ -0,0 +1,89 @@ +% floatwrite() - Write data matrix to float file. +% +% Usage: >> floatwrite(data,filename, 'format') +% +% Inputs: +% data - write matrix data to specified file as four-byte floating point numbers. +% filename - name of the file +% 'format' - The option FORMAT argument specifies the storage format as +% defined by fopen. Default format is 'native'. +% 'transp|normal' - save the data transposed (.dat files) or not. +% +% Author: Sigurd Enghoff, CNL / Salk Institute, La Jolla, 7/1998 +% +% See also: floatread(), fopen() + +% Copyright (C) Sigurd Enghoff, CNL / Salk Institute, La Jolla, 7/1998 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 07-08-99 FORMAT argument added -se +% 02-08-00 new version included in toolbox -sm +% 01-25-02 reformated help & license, added links -ad + +function A = floatwrite(A, fname, fform, transp) + +if ~exist('fform') + fform = 'native'; +end +if nargin < 4 + transp = 'normal'; +end; + +if strcmpi(transp,'normal') + if strcmpi(class(A), 'mmo') + A = changefile(A, fname); + return; + elseif strcmpi(class(A), 'memmapdata') + % check file to overwrite + % ----------------------- + [fpath1 fname1 ext1] = fileparts(fname); + [fpath2 fname2 ext2] = fileparts(A.data.Filename); + if isempty(fpath1), fpath1 = pwd; end; + + fname1 = fullfile(fpath1, [fname1 ext1]); + fname2 = fullfile(fpath2, [fname2 ext2]); + if ~isempty(findstr(fname1, fname2)) + disp('Warning: raw data already saved in memory mapped file (no need to resave it)'); + return; + end; + + fid = fopen(fname,'wb',fform); + if fid == -1, error('Cannot write output file, check permission and space'); end; + if size(A,3) > 1 + for ind = 1:size(A,3) + tmpdata = A(:,:,ind); + fwrite(fid,tmpdata,'float'); + end; + else + blocks = [ 1:round(size(A,2)/10):size(A,2)]; + if blocks(end) ~= size(A,2), blocks = [blocks size(A,2)]; end; + for ind = 1:length(blocks)-1 + tmpdata = A(:, blocks(ind):blocks(ind+1)); + fwrite(fid,tmpdata,'float'); + end; + end; + else + fid = fopen(fname,'wb',fform); + if fid == -1, error('Cannot write output file, check permission and space'); end; + fwrite(fid,A,'float'); + end; +else + % save transposed + for ind = 1:size(A,1) + fwrite(fid,A(ind,:),'float'); + end; +end; +fclose(fid); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/forcelocs.m b/code/eeglab13_4_4b/functions/sigprocfunc/forcelocs.m new file mode 100644 index 0000000..4f14523 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/forcelocs.m @@ -0,0 +1,178 @@ +% forcelocs() - rotate location in 3-D so specified electrodes +% match specified locations. +% CAUTION: Only for use on electrodes in +% and remaining in the upper spherical hemisphere, +% otherwise it will work improperly. Written primarily for +% adjusting all electrodes homogenously with Cz. +% +% Usage: +% >> chanlocs = forcelocs( chanlocs ); % pop-up window mode +% >> chanlocs = forcelocs( chanlocs, loc1, loc2, ... ); +% Example: +% >> chanlocs = forcelocs( chanlocs, { 0.78, 'x', 'A1' }, { 0.023, 'x', ... +% 'B1','B2','Cz' } ); +% +% Inputs: +% chanlocs - EEGLAB channel structure. See help readlocs() +% +% Optional inputs: +% loc1 - cell array: { location, axis, channame1, channame2, .. } +% 'location' is new cartesian coordinate of channame1 along 'axis' +% 'axis' is either +% 'X' New x-coordinate of mean of channame1, channame2, +% etc. Used to calculate the X-Z plane angle by +% which to rotate all channels. +% Note that all rotations are to the corresponding positive +% Z-value, since theta=atan(z/x). +% 'Y' New x-coordinate of mean of channame1, channame2, +% etc. +% +% 'channame#' Name of channel(s) to be rotated, as they appear in +% chanlocs.label +% loc2 - same as loc1 +% +% Outputs: +% chanlocs - updated EEGLAB channel structure. +% +% +% Author: Arnaud Delorme, CNL / Salk Institute, 15 April 2003 +% +% See also: readlocs() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [chanlocs,options] = forcelocs( chanlocs, varargin) + + NENTRY = 1; % number of lines in GUI + FIELDS = { 'X' 'Y' }; + + options = []; + if nargin < 1 + help forcelocs; + return; + end; + if nargin < 2 + geom = { [0.4 1 1 0.3] }; + uilist = { { 'style' 'text' 'string' 'X/Y value' 'tag' 'valstr' } ... + { 'style' 'text' 'string' 'Coordinate' } ... + { 'style' 'text' 'string' 'Electrode list' } ... + { } }; + for index = 1:NENTRY + tag = [ 'c' int2str(index) ]; + geom = { geom{:} [0.3 1 1 0.3] }; + uilist = { uilist{:},{ 'style' 'edit' 'string' fastif(index==1, '0','') }, ... + { 'style' 'listbox' 'string' 'X (rotate X-Z plane)|Y (rotate Y-Z plane)' ... + 'callback' [ 'if get(gco, ''value'') == 1,' ... + ' set(findobj(gcbf, ''tag'', ''valstr''), ''string'', ''Y value'');' ... + 'else set(findobj(gcbf, ''tag'', ''valstr''), ''string'', ''X value'');' ... + 'end;' ] }, ... + { 'style' 'edit' 'string' fastif(index==1, 'Cz','') 'tag' tag }, ... + { 'style' 'pushbutton' 'string' 'Pick' ... + 'callback', [ 'tmp3 = get(gcbf, ''userdata'');' ... + '[tmp1 tmp2] = pop_chansel({tmp3.labels}, ''selectionmode'', ''single'');' ... + 'if ~isempty(tmp1) set(findobj(gcbf, ''tag'', ''' tag '''), ''string'', tmp2); end;' ... + 'clear tmp1 tmp2;' ] } }; + end; + + results = inputgui( geom, uilist, 'pophelp(''forcelocs'');', 'Force electrode location -- forcelocs()', chanlocs ); + if length(results) == 0, return; end; + + options = {}; + for index = 1:NENTRY + tmpi = 3*(index-1)+1; + if ~isempty(results{tmpi}) + tmpchans = parsetxt(results{tmpi+2}); + options = { options{:},{ str2num(results{tmpi}) FIELDS{results{tmpi+1}} tmpchans{:} }}; + end; + end; + else + options = varargin; + end; + + % scan all locations + % ------------------ + channelnames = lower(strvcat({chanlocs.labels})); + for index = 1:length(options) + + val = options{index}{1}; + type = options{index}{2}; + chans = getchans(options{index}(3:end), channelnames); + + % rotate X-Z plane + % ---------------- + if strcmpi(type, 'x') + curx = mean([ chanlocs(chans).X ]); + curz = mean([ chanlocs(chans).Z ]); + newx = val; + rotangle = solvesystem(curx, curz, newx); + + for chanind = 1:length(chanlocs) + [chanlocs(chanind).X chanlocs(chanind).Z]= rotation(chanlocs(chanind).X, chanlocs(chanind).Z, rotangle); + end; + chanlocs = convertlocs(chanlocs, 'cart2all'); + end; + + % rotate Y-Z plane + % ---------------- + if strcmpi(type, 'y') + cury = mean([ chanlocs(chans).Y ]); + curz = mean([ chanlocs(chans).Z ]); + newy = val; + rotangle = solvesystem(cury, curz, newy); + + for chanind = 1:length(chanlocs) + [chanlocs(chanind).Y chanlocs(chanind).Z]= rotation(chanlocs(chanind).Y, chanlocs(chanind).Z, rotangle); + end; + chanlocs = convertlocs(chanlocs, 'cart2all'); + end; + + end; + + +% get channel indices +% ------------------- +function chanlist = getchans(chanliststr, channelnames); + chanlist = []; + for index = 1:length(chanliststr) + i = strmatch (lower(chanliststr{index}), channelnames, 'exact'); + chanlist = [chanlist i]; + end; + +% function rotate coordinates +% --------------------------- +function [X,Y] = rotation(x,y,rotangle) + X = real((x+j*y)*exp(j*rotangle)); + Y = imag((x+j*y)*exp(j*rotangle)); + +% function solvesyst +% ------------------ +function theta = solvesystem(x,y,nx) + % Original Solution + %eq(1,:) = [x -y]; res(1) = nx; + %eq(2,:) = [y x]; res(2) = sqrt(x^2+y^2-nx^2); + %sol = eq\res'; + %theta = atan2(sol(2), sol(1)); + + % simplified solution + ny = sqrt(x^2+y^2-nx^2); + ang1 = angle(x+j*y); + ang2 = angle(nx+j*ny); + theta = ang2-ang1; + + % Even simpler solution Toby 03/05/2007 + % theta = atan(y/x); + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/gettempfolder.m b/code/eeglab13_4_4b/functions/sigprocfunc/gettempfolder.m new file mode 100644 index 0000000..1f44491 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/gettempfolder.m @@ -0,0 +1,47 @@ +% gettempfolder() - return the temporary folder +% +% Usage: >> folder = gettempfolder; +% +% Output: a string containing the folder if a temporary folder can be found. +% Empty if the folder cannot be found. +% +% Author: Arnaud Delorme, SCCN, UCSD, 2012 +% +% Copyright (C) Arnaud Delorme + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function tmp_fld = gettempfolder(errorflag); + +if nargin < 1 + errorflag = 0; +end; + +tmp_fld = getenv('TEMP'); +if isempty(tmp_fld) && isunix + if is_sccn && exist('/var/tmp') + tmp_fld = '/var/tmp'; + elseif exist('/tmp') == 7 + tmp_fld = '/tmp'; + else + try + mkdir('/tmp'); + tmp_fld = '/tmp'; + catch, end; + end; +end; +if isempty(tmp_fld) && errorflag + error('Cannot find a temporary folder to store data files'); +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/headplot.m b/code/eeglab13_4_4b/functions/sigprocfunc/headplot.m new file mode 100644 index 0000000..7922377 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/headplot.m @@ -0,0 +1,837 @@ +% headplot() - plot a spherically-splined EEG field map on a semi-realistic +% 3-D head model. Can 3-D rotate the head image using the left +% mouse button. +% Example: +% >> headplot example % show an example spherical 'eloc_angles' file +% >> headplot cartesian % show an example cartesian 'eloc_angles' file +% +% Setup usage (do only once for each scalp montage): +% +% >> headplot('setup', elocs, splinefile, 'Param','Value',...); +% % +% % NOTE: previous call format below is still supported +% % >> headplot('setup', elocs, splinefile, comment, type); +% +% Required Setup-mode Inputs: +% +% elocs - file of electrode locations (compatible with readlocs()), +% or EEG.chanlocs channel location structure. If the channel +% file extension is not standard, use readlocs() to load the +% data file, e.g. +% >> headplot('setup', ... +% readlocs('myfile.xxx', 'filetype', 'besa'),... +% 'splinefile'); +% splinefile - name of spline file to save spline info into. It is saved as a +% *.mat file and should be given the extension .spl . +% +% Optional Setup-mode Inputs: +% +% 'meshfile' - ['string' or structure] Matlab files containing a mesh. The +% mesh may be of different formats. It may be a Dipfit mesh as +% defined in the file standard_vol.mat. It may contain +% a structure with the fields 'vertices' and 'faces' or it +% it may contain a structure with at least two fields: +% POS - 3-D positions of vertices: +% x=left-right; y=back-front; z=up-down +% TRI1 - faces on which the scalp map should be computed +% plus possible optional fields are: +% center (optional) - 3-D center of head mesh +% TRI2 (optional) - faces in skin color +% NORM (optional) - normal for each vertex (better shading) +% 'orilocs' - ['off'|'on'] use original electrode locations on the head +% {default: 'off'} (extrapolated to spherical). Note that these +% electrode locations must be coregisted with the head mesh. +% 'transform' - [real array] Talairach-model transformation matrix to co-register +% the electrode locations with the head mesh: +% [shiftX shiftY shiftZ pitch roll yaw scaleX scaleY scaleZ] +% The transform is applied in the order shift(rotate(scale(elocs))) +% by the dipfit2.* plugin function traditionaldipfit.m +% This array is returned by coregister(). +% 'plotmeshonly' - [string] plot only mesh and electrode positions. Options are +% 'head' to plot the standard head mesh; 'sphere' to plot the +% texture of the head on a sphere; 'off' not to plot anything. +% {default: 'off'} +% 'comment' - ['string'] optional string containing comments for spline file +% {default: []} +% +% Standard-mode Usage thereafter: +% +% >> headplot(values,'spline_file','Param','Value',...) +% +% Required Standard-mode Inputs: +% +% values - vector containing a data value at each electrode position +% 'spline_file' - spline filename, computed and saved in 'setup' mode (above) +% +% Optional Standard-mode Inputs: +% +% 'meshfile' - [string] mesh file name. See file content in the setup-mode +% description above. {default: the EEGLAB head template file}. +% 'electrodes' - ['on'|'off'] -> show electrode positions {default 'on'} +% 'title' - Plot title {default: none} +% 'labels' - 2 -> plot stored electrode labels; +% 1 -> plot channel numbers; 0 -> no labels {default 0} +% 'cbar' - 0 -> Plot colorbar {default: no colorbar} +% Note: standard jet colormap) red = +;blue = -;green=0 +% h -> Colorbar axis handle (to specify headplot location) +% 'view' - Camera viewpoint in deg. [azimuth elevation] +% 'back'|'b'=[ 0 30]; 'front'|'f'=[180 30] +% 'left'|'l'=[-90 30]; 'right'|'r'=[ 90 30]; +% 'frontleft'|'bl','backright'|'br', etc., +% 'top'=[0 90], Can rotate with mouse {default [143 18]} +% 'maplimits' - 'absmax' -> make limits +/- the absolute-max +% 'maxmin' -> scale to data range +% [min,max] -> user-definined values +% {default = 'absmax'} +% 'lights' - (3,N) matrix whose rows give [x y z] pos. of each of +% N lights {default: four lights at corners} +% 'electrode3d' - ['on'|'off'] plot electrodes in 3-D. Default is 'off'. +% 'lighting' - 'off' = show wire frame head {default 'on'} +% 'material' - [see material function] {default 'dull'} +% 'colormap' - 3-column colormap matrix {default: jet(64)} +% 'verbose' - 'off' -> no msgs, no rotate3d {default: 'on'} +% 'orilocs' - [channel structure or channel file name] Use original +% channel locations instead of the one extrapolated from +% spherical locations. Note that if you use 'orilocs' +% during setup, this is not necessary here since the +% original channel location have already been saved. +% This option might be useful to show more channels than +% the ones actually used for interpolating (e.g., fiducials). +% 'transform' - [real array] homogeneous transformation matrix to apply +% to the original locations ('orilocs') before plotting them. +% +% Note: if an error is generated, headplot() may close the current figure +% +% Authors: Arnaud Delorme, Colin Humphries, Scott Makeig, SCCN/INC/UCSD, +% La Jolla, 1998- + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Copyright (C) Arnaud Delorme, Colin Humphries and Scott Makeig, +% CNL / Salk Institute, Feb. 1998 +% +% Spherical spline method: Perrin et al. (1989) Electroenceph clin Neurophys +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 12-12-98 changed electrode label lines to MarkerColor -sm +% 12-12-98 added colorbar option -sm (still graphically marred by tan rect.) +% 12-13-98 implemented colorbar option using enhanced cbar -sm +% 12-13-98 implemented 'setup' comment option -sm +% 03-20-00 added cartesian electrode locations option -sm +% 07-14-00 fixed line in calgx() -sm from -ch +% 03-23-01 documented 'cartesian' locfile option -sm +% 01-25-02 reformated help & license, added links -ad +% 03-21-02 added readlocs and the use of eloc input structure -ad + +function [HeadAxes, ColorbarHandle] = headplot(values, arg1, varargin) + +if nargin < 1 + help headplot + return +end + +%%%%%%%%%%%%%%%%%%%%%%%%%% Set Defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +icadefs % load definitions +set(gca,'Color',BACKCOLOR); +DEFAULT_MESH = ['mheadnew.mat']; % upper head model file (987K) +DEFAULT_TRANSFORM = [0 -5 0 -0.1000 0 -1.5700 1040 800 950]; % stretching in different dimensions +DEFAULT_TRANSFORM = [0 -10 0 -0.1000 0 -1.600 1100 1100 1100]; % keep spherical shape. +%DEFAULT_MESH = '/home/arno/matlab/juliehiresmesh.mat'; +%DEFAULT_MESH = ['/home/scott/matlab/old' '/newupper.mat']; % whole head model file (183K) + +DEFAULT_LIGHTS = [-125 125 80; ... + 125 125 80; ... + 125 -125 125; ... + -125 -125 125]; % default lights at four corners + +HeadCenter = [0 0 30]; +FaceColor = [.8 .55 .35]*1.1; % ~= ruddy Caucasian - pick your complexion! +MAX_ELECTRODES = 1024; +ElectDFac = 1.06; % plot electrode marker dots out from head surface +plotelecopt.NamesDFac = 1.05; % plot electrode names/numbers out from markers +plotelecopt.NamesColor = 'k'; % 'r'; +plotelecopt.NamesSize = 10; % FontSize for electrode names +plotelecopt.MarkerColor= [0.5 0.5 0.5]; +plotelecopt.electrodes3d = 'off'; + +sqaxis = 1; % if non-zero, make head proportions anatomical +title_font = 18; +if isstr(values) + values = lower(values); + if strcmp(values,'setup') + +% +%%%%%%%%%%%%%%%%%%% Perform splining file setup %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if nargin < 3 + help headplot; + return; + end; + eloc_file = arg1; + spline_file = varargin{1}; + + g = finputcheck(varargin(2:end), { 'orilocs' 'string' { 'on','off' } 'off'; + 'plotmeshonly' 'string' { 'head','off','sphere' } 'off'; + 'meshfile' { 'string','struct' } [] DEFAULT_MESH; + 'chaninfo' 'struct' [] struct([]); + 'plotchans' 'integer' [] []; + 'ica' 'string' { 'on','off' } 'off'; + 'transform' 'real' [] DEFAULT_TRANSFORM; + 'comment' 'string' [] '' }, 'headplot', 'ignore'); + if isstr(g), + error(g); + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%% + % Open electrode file + %%%%%%%%%%%%%%%%%%%%%%%%%%% + [eloc_file labels Th Rd indices] = readlocs(eloc_file); + indices = find(~cellfun('isempty', { eloc_file.X })); + + % channels to plot + % ---------------- + if isempty(g.plotchans), g.plotchans = [1:length(eloc_file)]; end; + if ~isfield(g.chaninfo, 'nosedir'), g.chaninfo(1).nosedir = '+x'; end; + indices = intersect_bc(g.plotchans, indices); + + % if ICA select subset of channels if necessary + % --------------------------------------------- + if ~isfield(g.chaninfo, 'icachansind'), g.chaninfo(1).icachansind = 1:length(eloc_file); end; + if strcmpi(g.ica, 'on'), + rmchans2 = setdiff_bc( g.chaninfo.icachansind, indices ); % channels to remove (non-plotted) + newinds = 1:length(g.chaninfo.icachansind); + allrm = []; + % remove non-plotted channels from indices + for index = 1:length(rmchans2) + chanind = find(g.chaninfo.icachansind == rmchans2(index)); + allrm = [ allrm chanind ]; + end; + + newinds(allrm) = []; + indices = newinds; + eloc_file = eloc_file(g.chaninfo.icachansind); + end; + + fprintf('Headplot: using existing XYZ coordinates\n'); + ElectrodeNames = strvcat({ eloc_file.labels }); + ElectrodeNames = ElectrodeNames(indices,:); + + Xeori = [ eloc_file(indices).X ]'; + Yeori = [ eloc_file(indices).Y ]'; + Zeori = [ eloc_file(indices).Z ]'; + + [newPOS POS TRI1 TRI2 NORM index1 center] = getMeshData(g.meshfile); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % rotate channel coordinates if necessary + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if strcmpi(lower(g.chaninfo.nosedir), '+x') + rotate = 0; + else + if strcmpi(lower(g.chaninfo.nosedir), '+y') + rotate = 3*pi/2; + elseif strcmpi(lower(g.chaninfo.nosedir), '-x') + rotate = pi; + else rotate = pi/2; + end; + allcoords = (Yeori + Xeori*sqrt(-1))*exp(sqrt(-1)*rotate); + Xeori = imag(allcoords); + Yeori = real(allcoords); + end; + newcoords = [ Xeori Yeori Zeori ]; + + %newcoords = transformcoords( [ Xe Ye Ze ], [0 -pi/16 -1.57], 100, -[6 0 46]); + %newcoords = transformcoords( [ Xeori Yeori Zeori ], g.transform(4:6), g.transform(7:9), g.transform(1:3)); + % same performed below with homogenous transformation matrix + + transmat = traditionaldipfit( g.transform ); % arno + newcoords = transmat*[ newcoords ones(size(newcoords,1),1)]'; + newcoords = newcoords(1:3,:)'; + + % original center was [6 0 16] but the center of the sphere is [0 0 30] + % which compensate (see variable Headcenter) + %newcoords = transformcoords( [ Xe Ye Ze ], -[0 0 -pi/6]); + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % normalize with respect to head center + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + newcoordsnorm = newcoords - ones(size(newcoords,1),1)*HeadCenter; + tmpnorm = sqrt(sum(newcoordsnorm.^2,2)); + Xe = newcoordsnorm(:,1)./tmpnorm; + Ye = newcoordsnorm(:,2)./tmpnorm; + Ze = newcoordsnorm(:,3)./tmpnorm; + %plotchans3d([ Xe Ye Ze], cellstr(ElectrodeNames)); return; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Calculate g(x) for electrodes + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if strcmpi(g.plotmeshonly, 'off') + fprintf('Setting up splining matrix.\n'); + enum = length(Xe); + onemat = ones(enum,1); + G = zeros(enum,enum); + for i = 1:enum + ei = onemat-sqrt((Xe(i)*onemat-Xe).^2 + (Ye(i)*onemat-Ye).^2 + ... + (Ze(i)*onemat-Ze).^2); % default was /2 and no sqrt + gx = zeros(1,enum); + for j = 1:enum + gx(j) = calcgx(ei(j)); + end + G(i,:) = gx; + end + end; + fprintf('Calculating splining matrix...\n') + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Open mesh file - contains POS and index1 + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Project head vertices onto unit sphere + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + spherePOS = newPOS-ones(size(newPOS,1),1)*HeadCenter; % recenter + nPOSnorm = sqrt(sum(spherePOS.^2,2)); + spherePOS(:,1) = spherePOS(:,1)./nPOSnorm; + spherePOS(:,2) = spherePOS(:,2)./nPOSnorm; + spherePOS(:,3) = spherePOS(:,3)./nPOSnorm; + x = spherePOS(:,1); + y = spherePOS(:,2); + z = spherePOS(:,3); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Calculate new electrode positions on head + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if strcmpi(g.orilocs, 'off') + fprintf('Computing electrode locations on head...\n'); + for i=1:length(Xe) + elect = [Xe(i) Ye(i) Ze(i)]; + dists = distance(elect,spherePOS'); + [S,I] = sort(dists); + npoints = I(1:3); % closest 3 points + diffe = newPOS(npoints,:)-spherePOS(npoints,:); + newElect(i,:) = elect+mean(diffe)*ElectDFac; + %if Ze(i) < 0 % Plot superior electrodes only. + % newElect(i,:) = [0 0 0]; % Mark lower electrodes as having + %end % an electrode position not to be plotted + end + else + fprintf('Using original electrode locations on head...\n'); + newElect = newcoords; + end; + + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % plot mesh and electrodes only + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~strcmpi(g.plotmeshonly, 'off') + if strcmpi(g.plotmeshonly, 'sphere') + newElect(:,1) = Xe; + newElect(:,2) = Ye; + newElect(:,3) = Ze; + POS(index1,:) = spherePOS; HeadCenter = [ 0 0 0 ]; + end; + plotmesh(TRI1, POS, NORM); + plotelecopt.labelflag = 0; + plotelec(newElect, ElectrodeNames, HeadCenter, plotelecopt); + rotate3d; + return; + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Calculate g(x) for sphere mesh vertices + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + fprintf('Computing %d vertices. Should take a while (see wait bar)\n',... + length(x)) + fprintf(' but doesnt have to be done again for this montage...\n'); + icadefs; + + gx = fastcalcgx(x,y,z,Xe,Ye,Ze); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Save spline file + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + comment = g.comment; + headplot_version = 2; + transform = g.transform; + try, save(spline_file, '-V6', '-mat', 'Xe', 'Ye', 'Ze', 'G', 'gx', 'newElect', ... + 'ElectrodeNames', 'indices', 'comment', 'headplot_version', 'transform'); + catch, + try, save(spline_file, '-mat', 'Xe', 'Ye', 'Ze', 'G', 'gx', 'newElect', ... + 'ElectrodeNames', 'indices', 'comment', 'headplot_version', 'transform'); + catch, error('headplot: save spline file error, out of space or file permission problem'); + end; + end; + tmpinfo = dir(spline_file); + fprintf('Saving (%dk) file %s\n',round(tmpinfo.bytes/1000), spline_file); + return + + elseif strcmp(values,'example') | strcmp(values,'demo') +% +%%%%%%%%%%%%%%%%%% Show an example electrode angles file %%%%%%%%%%%%%%%%%%%%%%%% +% + fprintf(['\nExample of a headplot() electrode angles file (spherical coords.)\n',... + 'Fields: chan_num cor_deg horiz_deg channel_name\n\n',... + ' 1 -90 -72 Fp1.\n',... + ' 2 90 72 Fp2.\n',... + ' 3 -62 -57 F3..\n',... + ' 4 62 57 F4..\n',... + ' 5 -45 0 C3..\n',... + ' 6 45 0 C4..\n',... + ' 7 -118 2 A1..\n',... + ' 8 118 -2 A2..\n',... + ' 9 -62 57 P3..\n',... + ' 10 62 -57 P4..\n',... + ' 11 -90 72 O1..\n',... + ' 12 90 -72 O2..\n',... + ' 13 -90 -36 F7..\n',... + ' 14 90 36 F8..\n',... + ' 15 -90 0 T3..\n',... + ' 16 90 0 T4..\n',... + ' 17 -90 36 T5..\n',... + ' 18 90 -36 T6..\n',... + ' 19 45 90 Fz..\n',... + ' 20 0 0 Cz..\n',... + ' 21 45 -90 Pz..\n',... + '\nA 90 deg coronal rotation points to right ear, -90 to left.\n' ,... + 'A positive horizontal rotation is counterclockwise from above.\n',... + 'Use pol2sph() to convert from topoplot() format to spherical.\n',... + 'Channel names should have 4 chars (. = space).\n',... + 'See also >> headplot cartesian\n\n\n']); + return + elseif strcmp(values,'cartesian') +% +%%%%%%%%%%%%%%%%%% Show an example cartesian electrode file %%%%%%%%%%%%%%%%%%% +% + fprintf(['\nExample of a headplot() electrode location file (cartesian coords.)\n',... + 'Fields: chan_num x y z channel_name\n\n',... + ' 1 0.4528 0.8888 -0.0694 Fp1.\n',... + 'Channel names should have 4 chars (. = space).\n',... + 'See also >> headplot example\n\n\n']); + return + else + fprintf('headplot(): Unknown first argument (%s).\n',values) + help headplot + end +else +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Make the plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if nargin < 2 + help headplot + return + end + spline_file = arg1; + + g = finputcheck( varargin, { ... + 'cbar' 'real' [0 Inf] []; % Colorbar value must be 0 or axis handle.' + 'lighting' 'string' { 'on','off' } 'on'; + 'verbose' 'string' { 'on','off' } 'on'; + 'maplimits' { 'string','real' } [] 'absmax'; + 'title' 'string' [] ''; + 'lights' 'real' [] DEFAULT_LIGHTS; + 'view' { 'string','real' } [] [143 18]; + 'colormap' 'real' [] jet(256); + 'transform' 'real' [] []; + 'meshfile' {'string','struct' } [] DEFAULT_MESH; + 'electrodes' 'string' { 'on','off' } 'on'; + 'electrodes3d' 'string' { 'on','off' } 'off'; + 'material' 'string' [] 'dull'; + 'orilocs' { 'string','struct' } [] ''; + 'labels' 'integer' [0 1 2] 0 }, 'headplot'); + if isstr(g) error(g); end; + plotelecopt.electrodes3d = g.electrodes3d; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Open head mesh and electrode spline files + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~exist(spline_file) + error(sprintf('headplot(): spline_file "%s" not found. Run headplot in "setup" mode\n',... + spline_file)); + end + load(spline_file, '-mat'); + if exist('indices'), + try, + values = values(indices); + catch, error('problem of index or electrode number with splinefile'); end; + end; + enum = length(values); + if enum ~= length(Xe) + close; + error('headplot(): Number of values in spline file should equal number of electrodes') + end + + % change electrode if necessary + % ----------------------------- + if ~isempty(g.orilocs) + eloc_file = readlocs( g.orilocs ); + fprintf('Using original electrode locations on head...\n'); + indices = find(~cellfun('isempty', { eloc_file.X } )); + newElect(:,1) = [ eloc_file(indices).X ]'; % attention inversion before + newElect(:,2) = [ eloc_file(indices).Y ]'; + newElect(:,3) = [ eloc_file(indices).Z ]'; + + % optional transformation + % ----------------------- + if ~isempty(g.transform) + transmat = traditionaldipfit( g.transform ); % arno + newElect = transmat*[ newElect ones(size(newElect,1),1)]'; + newElect = newElect(1:3,:)'; + end; + end; + + % -------------- + % load mesh file + % -------------- + [newPOS POS TRI1 TRI2 NORM index1 center] = getMeshData(g.meshfile); + + %%%%%%%%%%%%%%%%%%%%%%%%%% + % Perform interpolation + %%%%%%%%%%%%%%%%%%%%%%%%%% + + meanval = mean(values); values = values - meanval; % make mean zero + onemat = ones(enum,1); + lamd = 0.1; + C = pinv([(G + lamd);ones(1,enum)]) * [values(:);0]; % fixing division error + P = zeros(1,size(gx,1)); + for j = 1:size(gx,1) + P(j) = dot(C,gx(j,:)); + end + P = P + meanval; + + %%%%%%%%%%%%%%%%%%%%%%%%%% + % Plot surfaces + %%%%%%%%%%%%%%%%%%%%%%%%%% + cla % clear axis + HeadAxes = gca; + + W = zeros(1,size(POS,1)); + m = size(g.colormap,1); + if size(g.maplimits) == [1,2] + amin = g.maplimits(1); + amax = g.maplimits(2); + elseif strcmp(g.maplimits,'maxmin') | strcmp(g.maplimits,'minmax') + amin = min(min(abs(P)))*1.02; % 2% shrinkage keeps within color bounds + amax = max(max(abs(P)))*1.02; + elseif strcmp(g.maplimits,'absmax') + amin = min(min(abs(P)))*1.02; % 2% shrinkage keeps within color bounds + amax = max(max(abs(P)))*1.02; + amax = max(-amin, amax); + amin = -amax; + %amin = -max(max(abs(P)))*1.02; % 2% shrinkage keeps within color bounds + %amax = -amin; + end + + idx = min(m,round((m-1)*(P-amin)/(amax-amin))+1); % get colormap indices + %subplot(1,2,1); hist(P(:)); + %idx = round((m-1)*P/(amax-amin))+m/2; + %idx = max(1,min(m,idx)); % get colormap indices + %subplot(1,2,2); hist(idx(:)); + %return; + + W(index1) = idx; + colormap(g.colormap) + p1 = patch('Vertices',POS,'Faces',TRI1,'FaceVertexCdata',W(:),... + 'FaceColor','interp', 'cdatamapping', 'direct', 'tag', 'mesh'); %%%%%%%%% Plot scalp map %%%%%%%%% + if exist('NORM') == 1 & ~isempty(NORM) + set(p1, 'vertexnormals', NORM); + end; + + if ~isempty(TRI2) + FCmap = [g.colormap; g.colormap(end,:); FaceColor; FaceColor; FaceColor]; + colormap(FCmap) + W = ones(1,size(POS,1))*(m+2); + p2 = patch('Vertices',POS,'Faces',TRI2,'FaceColor','interp',... + 'FaceVertexCdata',W(:)); %%%%%%%% Plot face and lower head %%%%%% + else + p2 = []; + end; + + axis([-125 125 -125 125 -125 125]) + axis off % hide axis frame + + %%%%%%%%%%%%%%%%%%%%%%%%% + % Draw colorbar - Note: uses enhanced cbar() function by Colin Humphries + %%%%%%%%%%%%%%%%%%%%%%%%% + if ~isempty(g.cbar) + BACKCOLOR = get(gcf,'Color'); + if g.cbar == 0 + ColorbarHandle = cbar(0,3,[amin amax]); + pos = get(ColorbarHandle,'position'); % move left & shrink to match head size + set(ColorbarHandle,'position',[pos(1)-.05 pos(2)+0.13 pos(3)*0.7 pos(4)-0.26]); + else + ColorbarHandle = cbar(g.cbar,3,[amin amax]); + end + end + axes(HeadAxes); + + %%%%%%%%%%%%%%%%%%%%%%%%% + % Turn on lights + %%%%%%%%%%%%%%%%%%%%%%%%% + + if strcmp(g.lighting,'on') + set([p1 p2],'EdgeColor','none') + + for i = 1:size(g.lights,1) + hl(i) = light('Position',g.lights(i,:),'Color',[1 1 1],... + 'Style','infinite'); + end + if ~isempty(p2) + set(p2,'DiffuseStrength',.6,'SpecularStrength',0,... + 'AmbientStrength',.4,'SpecularExponent',5) + end; + set(p1,'DiffuseStrength',.6,'SpecularStrength',0,... + 'AmbientStrength',.3,'SpecularExponent',5) + lighting phong % all this gives a matte reflectance + material(g.material); + end + + %%%%%%%%%%%%%%%%%%%%%%%%% + % Set viewpoint + %%%%%%%%%%%%%%%%%%%%%%%%% + + if isstr(g.view) + switch lower(g.view) + case {'front','f'} + view(-180,30) + case {'back','b'} + view(0,30) + case {'left','l'} + view(-90,30) + case {'right','r'} + view(90,30) + case {'frontright','fr'} + view(135,30) + case {'backright','br'} + view(45,30) + case {'frontleft','fl'} + view(-135,30) + case {'backleft','bl'} + view(-45,30) + case 'top' + view(0,90) + case 'bottom' % undocumented option! + view(0,-90) + Lights = [-125 125 80; ... + 125 125 80; ... + 125 -125 125; ... + -125 -125 125; ... + 0 10 -80]; % add light from below! + otherwise + close; error(['headplot(): Invalid View value %s',g.view]) + end + else + if ~isstr(g.view) + [h,a] = size(g.view); + if h~= 1 | a~=2 + close; error('headplot(): View matrix size must be (1,2).') + end + end + view(g.view) % set camera viewpoint + end + + if strcmp(g.electrodes,'on') % plot the electrode locations + if exist('newElect') + plotelecopt.labelflag = g.labels; + plotelec(newElect, ElectrodeNames, HeadCenter, plotelecopt); + else + fprintf('Variable newElect not read from spline file.\n'); + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Turn on rotate3d, allowing rotation of the plot using the mouse + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if strcmp(g.verbose,'on') + rotate3d on; % Allow 3-D rotation of the plot by dragging the + else % left mouse button while cursor is on the plot + rotate3d off + end + % Make axis square + if sqaxis + axis image % keep the head proportions human and as large as possible + end + % Add a plot title + if ~isempty(g.title); + % title(['\n' g.title],'fontsize',title_font); + title([g.title],'fontsize',title_font); % Note: \n not interpreted by matlab-5.2 + end +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% calcgx() - function used in 'setup' +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [out] = calcgx(in) + +out = 0; +m = 4; % 4th degree Legendre polynomial +for n = 1:7 % compute 7 terms + L = legendre(n,in); + out = out + ((2*n+1)/(n^m*(n+1)^m))*L(1); +end +out = out/(4*pi); + + +%%%%%%%%%%%%%%%%%%% +function gx = fastcalcgx(x,y,z,Xe,Ye,Ze) + +onemat = ones(length(x),length(Xe)); +EI = onemat - sqrt((repmat(x,1,length(Xe)) - repmat(Xe',length(x),1)).^2 +... + (repmat(y,1,length(Xe)) - repmat(Ye',length(x),1)).^2 +... + (repmat(z,1,length(Xe)) - repmat(Ze',length(x),1)).^2); +% +gx = zeros(length(x),length(Xe)); +m = 4; +icadefs; +hwb = waitbar(0,'Computing spline file (only done once)...', 'color', BACKEEGLABCOLOR); +hwbend = 7; +for n = 1:7 + L = legendre(n,EI); + gx = gx + ((2*n+1)/(n^m*(n+1)^m))*squeeze(L(1,:,:)); + waitbar(n/hwbend,hwb); +end +gx = gx/(4*pi); +close(hwb); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% distance() - function used in 'setup' +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [out] = distance(w,p) +% w is a matrix of row vectors +% p is a matrix of column vectors + +l1 = size(w,1); +l2 = size(p,2); +out = zeros(l1,l2); + +for i = 1:l1 + x = w(i,:)'*ones(1,l2); + out(i,:) = sum((x-p).^2).^.5; +end + +% %%%%%%%%%%%%%%% +% plot electrodes +% %%%%%%%%%%%%%%% +function plotelec(newElect, ElectrodeNames, HeadCenter, opt); + + newNames = newElect*opt.NamesDFac; % Calculate electrode label positions + for i = 1:size(newElect,1) + if newElect(i,:) ~= [0 0 0] % plot radial lines to electrode sites + if strcmpi(opt.electrodes3d, 'off') + line([newElect(i,1) HeadCenter(1)],[newElect(i,2) HeadCenter(2)],... + [newElect(i,3) HeadCenter(3)],'color',opt.MarkerColor,'linewidth',1); + end; + if opt.labelflag == 1 % plot electrode numbers + t=text(newNames(i,1),newNames(i,2),newNames(i,3),int2str(i)); + set(t,'Color',opt.NamesColor,'FontSize',opt.NamesSize,'FontWeight','bold',... + 'HorizontalAlignment','center'); + + elseif opt.labelflag == 2 % plot electrode names + if exist('ElectrodeNames') + name = sprintf('%s',ElectrodeNames(i,:)); + t=text(newNames(i,1),newNames(i,2),newNames(i,3),name); + set(t,'Color',opt.NamesColor,'FontSize',opt.NamesSize,'FontWeight','bold',... + 'HorizontalAlignment','center'); + else + fprintf('Variable ElectrodeNames not read from spline file.\n'); + end + else % plot electrode markers + + if strcmpi(opt.electrodes3d, 'off') + line(newElect(:,1),newElect(:,2),newElect(:,3),'marker',... + '.','markersize',20,'color',opt.MarkerColor,'linestyle','none'); + else + [xc yc zc] = cylinder( 2, 10); + [xs ys zs] = sphere(10); + xc = [ xc; -xs(7:11,:)*2 ]; + yc = [ yc; -ys(7:11,:)*2 ]; + zc = [ zc; zs(7:11,:)*0.2+1 ]; + + hold on; + cylinderSize = 3; + colorarray = repmat(reshape(opt.MarkerColor, 1,1,3), [size(zc,1) size(zc,2) 1]); + handles = surf(xc*cylinderSize, yc*cylinderSize, zc*cylinderSize, colorarray, 'edgecolor', 'none', ... + 'backfacelighting', 'lit', 'facecolor', 'interp', 'facelighting', ... + 'phong', 'ambientstrength', 0.3); + + cylnderHeight = 1; + if newElect(i,3) < 10, addZ = -30; else addZ = 0; end; + if newElect(i,3) < -20, addZ = -60; else addZ = 0; end; + xx = newElect(i,1) - ( newElect(i,1)-HeadCenter(1) ) * 0.01 * cylnderHeight; + xxo1 = newElect(i,1) + ( newElect(i,1)-HeadCenter(1) ) * 0.01 * cylnderHeight; + yy = newElect(i,2) - ( newElect(i,2)-HeadCenter(2) ) * 0.01 * cylnderHeight; + yyo1 = newElect(i,2) + ( newElect(i,2)-HeadCenter(2) ) * 0.01 * cylnderHeight; + zz = newElect(i,3) - ( newElect(i,3)-HeadCenter(3)-addZ ) * 0.01 * cylnderHeight; + zzo1 = newElect(i,3) + ( newElect(i,3)-HeadCenter(3)-addZ ) * 0.01 * cylnderHeight; + [xc yc zc] = adjustcylinder2( handles, [xx yy zz], [xxo1 yyo1 zzo1] ); + end; + + end + end + end; + +% get mesh information +% -------------------- +function [newPOS POS TRI1 TRI2 NORM index1 center] = getMeshData(meshfile); + +if ~isstruct(meshfile) + if ~exist(meshfile) + error(sprintf('headplot(): mesh file "%s" not found\n',meshfile)); + end + fprintf('Loaded mesh file %s\n',meshfile); + try + meshfile = load(meshfile,'-mat'); + catch, + meshfile = []; + meshfile.POS = load('mheadnewpos.txt', '-ascii'); + meshfile.TRI1 = load('mheadnewtri1.txt', '-ascii'); % upper head + %try, TRI2 = load('mheadnewtri2.txt', '-ascii'); catch, end; % lower head + %index1 = load('mheadnewindex1.txt', '-ascii'); + meshfile.center = load('mheadnewcenter.txt', '-ascii'); + end; +end; + +if isfield(meshfile, 'vol') + if isfield(meshfile.vol, 'r') + [X Y Z] = sphere(50); + POS = { X*max(meshfile.vol.r) Y*max(meshfile.vol.r) Z*max(meshfile.vol.r) }; + TRI1 = []; + else + POS = meshfile.vol.bnd(1).pnt; + TRI1 = meshfile.vol.bnd(1).tri; + end; +elseif isfield(meshfile, 'bnd') + POS = meshfile.bnd(1).pnt; + TRI1 = meshfile.bnd(1).tri; +elseif isfield(meshfile, 'TRI1') + POS = meshfile.POS; + TRI1 = meshfile.TRI1; + try TRI2 = meshfile.TRI2; end % NEW + try center = meshfile.center; end % NEW +elseif isfield(meshfile, 'vertices') + POS = meshfile.vertices; + TRI1 = meshfile.faces; +else + error('Unknown Matlab mesh file'); +end; +if exist('index1') ~= 1, index1 = sort(unique(TRI1(:))); end; +if exist('TRI2') ~= 1, TRI2 = []; end; +if exist('NORM') ~= 1, NORM = []; end; +if exist('TRI1') ~= 1, error('Variable ''TRI1'' not defined in mesh file'); end; +if exist('POS') ~= 1, error('Variable ''POS'' not defined in mesh file'); end; +if exist('center') ~= 1, center = [0 0 0]; disp('Using [0 0 0] for center of head mesh'); end; +newPOS = POS(index1,:); + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/icaact.m b/code/eeglab13_4_4b/functions/sigprocfunc/icaact.m new file mode 100644 index 0000000..d95934e --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/icaact.m @@ -0,0 +1,87 @@ +% icaact() - compute ICA activation waveforms = weights*sphere*(data-meandata) +% +% Usage: >> [activations] = icaact(data,weights,datamean); +% +% Inputs: +% data = input data (chans,frames) +% weights = unmixing matrix (runica() weights*sphere) +% datamean = 0 or mean(data') (default 0); +% +% Note: If datamean==0, data means are distributed over activations. +% Use this form for plotting component projections. +% +% Output: +% activations = ICA component activation waveforms +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 4-3-97 +% +% See also: runica(), icaproj(), icavar() + +% Copyright (C) 4-3-97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 6-17-97 extended to non-square weight matrices -sm +% 1-12-01 removed sphere argument -sm +% 01-25-02 reformated help & license, added links -ad + +function [activations] = icaact(data,weights,datamean) + +if nargin < 4 + datamean = 0; +elseif nargin < 3 + help icaact + return +end + +[chans, framestot] = size(data); + +if datamean == 0, + datamean = zeros(chans,1); % single-epoch 0s +end + +if size(datamean,1) == 1 % if row vector + datamean = datamean'; % make a column vector +end +[meanchans,epochs] = size(datamean); +if epochs < 1, + fprintf('icaact(): datamean empty.\n'); + return +end +frames = fix(framestot/epochs); + +if frames < 1, + fprintf('icaact(): data empty.\n'); + return +end + +if frames*epochs ~= framestot + fprintf(... + 'icaact(): datamean epochs %d does not divide data length %d.\n',... + epochs, framestot); + return +end + +if size(datamean,1) ~= chans + fprintf('icaact(): datamean channels ~= data channels.\n'); + return +end + +w = weights; +activations = zeros(size(w,1),size(data,2)); +for e=1:epochs + activations(:,(e-1)*frames+1:e*frames) = ... + w*(data(:,(e-1)*frames+1:e*frames) - datamean(:,e)*ones(1,frames)); +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/icadefs.m b/code/eeglab13_4_4b/functions/sigprocfunc/icadefs.m new file mode 100644 index 0000000..b447636 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/icadefs.m @@ -0,0 +1,181 @@ +% icadefs() - function to read in a set of EEGLAB system-wide (i.e. lab-wide) +% or working directory-wide constants and preferences. Change the +% way these are defined in the master icadefs.m file (usually +% in dir eeglab/functions/sigprocfunc) or make a custom copy of +% the icadefs.m file in a project directory. Then, calling functions +% that call icadefs from an EEGLAB session in that working directory +% will read the local copy, which may set preferences different from +% the system-wide copy. +% +% Author: Arnaud Delorme, Scott Makeig, SCCN/INC/UCSD, La Jolla, 05-20-97 + +% Copyright (C) 05-20-97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% ---------------------------------------------------------------------- +% ------ EEGLAB DEFINITION - YOU MAY CHANGE THE TEXT BELOW ------------- +% ---------------------------------------------------------------------- + +EEGOPTION_PATH = ''; % if empty, the home folder of the current user is used + % Note that this may create problems under Windows + % when unicode characters are part of the user name + % In this case, enter the path name manually here. + +YDIR = 1; % positive potential up = 1; negative up = -1 + % for most ERP plots + +HZDIR = 'up'; % ascending freqs = 'up'; descending = 'down' + % (e.g., timef/newtimef frequency direction) + +% Checking MATLAB version +tmpvers = version; +indp = find(tmpvers == '.'); +if str2num(tmpvers(indp(1)+1)) >= 1, tmpvers = [ tmpvers(1:indp(1)) '0' tmpvers(indp(1)+1:end) ]; end; +indp = find(tmpvers == '.'); +VERS = str2num(tmpvers(1:indp(2)-1)); + +% font size +tmpComputer = computer; +tmpScreenSize = get(0, 'ScreenSize'); +retinaDisplay = false; +if tmpScreenSize(3) == 1440 && ( tmpScreenSize(3) == 878 || tmpScreenSize(3) == 900 ) + retinaDisplay = true; +end; + +% retinaDisplay = false; % uncoment this line if not retina display +if retinaDisplay && strcmpi(tmpComputer(1:3), 'MAC') + W_MAIN = findobj('tag', 'EEGLAB'); + if isempty(W_MAIN) + disp('Mac OSX retina display detected. If this is not the case uncoment line 50 of icadefs.m'); + end; + GUI_FONTSIZE = 18; % graphic interface font size + AXES_FONTSIZE = 18; % Axis labels and legend font size + TEXT_FONTSIZE = 18; % Miscellaneous font sizes +end + +% Graph Definitions +DEFAULT_COLORMAP = 'jet'; + +if VERS < 8.04 + PLOT_LINEWIDTH = 2; + PLOT_LINEWIDTH_S = 1; + + % AXES FONTSIZE + AXES_FONTSIZE = 10; % Axis labels and legend font size + AXES_FONTSIZE_S = AXES_FONTSIZE - 2; % Axis labels and legend font size Small + AXES_FONTSIZE_L = 16; % Axis labels and legend font size Large + + % GUI FONTSIZE + GUI_FONTSIZE = 10; % graphic interface font size + GUI_FONTSIZE_S = GUI_FONTSIZE - 2; % graphic interface font size Small + GUI_FONTSIZE_L = GUI_FONTSIZE + 2; % graphic interface font size Large + + % TEXT FONTSIZE + TEXT_FONTSIZE = 10; % Miscellaneous font sizes + TEXT_FONTSIZE_S = TEXT_FONTSIZE - 2; % Miscellaneous font sizes Small + TEXT_FONTSIZE_L = TEXT_FONTSIZE + 2; % Miscellaneous font sizes Large + +elseif VERS >= 8.04 + PLOT_LINEWIDTH = 1; + PLOT_LINEWIDTH_S = 0.5; + + % AXES FONTSIZE + AXES_FONTSIZE = 9; % Axis labels and legend font size + AXES_FONTSIZE_S = AXES_FONTSIZE - 2; % Axis labels and legend font size Small + AXES_FONTSIZE_L = 12.5; % Axis labels and legend font size Large + + % GUI FONTSIZE + GUI_FONTSIZE = 9; % graphic interface font size + GUI_FONTSIZE_S = GUI_FONTSIZE - 2; % graphic interface font size Small + GUI_FONTSIZE_L = GUI_FONTSIZE + 2; % graphic interface font size Large + + % TEXT FONTSIZE + TEXT_FONTSIZE = 9; % Miscellaneous font sizes + TEXT_FONTSIZE_S = TEXT_FONTSIZE - 2; % Miscellaneous font sizes Small + TEXT_FONTSIZE_L = TEXT_FONTSIZE + 2; % Miscellaneous font sizes Large +end; + +clear retinaDisplay tmpScreenSize tmpComputer tmpvers indp; + +% the eeg_options.m file also countains additional options + +% ---------------------------------------------------------------------- +% ------------------------ END OF DEFINITIONS -------------------------- +% ---------------------------------------------------------------------- + +% INSERT location of ica executable (LINUX ONLY) for binica.m below +eeglab_p = fileparts(which('eeglab')); +ICABINARY = fullfile(eeglab_p, 'functions', 'resources', 'ica_linux'); + +try + set(0,'defaultaxesfontsize',AXES_FONTSIZE); + set(0,'defaulttextfontsize',TEXT_FONTSIZE); + set(0,'DefaultUicontrolFontSize',GUI_FONTSIZE); +catch + % most likely Octave here +end; + +TUTORIAL_URL = 'http://sccn.ucsd.edu/wiki/EEGLAB'; % online version +DEFAULT_SRATE = 256.0175; % default local sampling rate (rarely used) +DEFAULT_TIMLIM = [-1000 2000]; % default local epoch limits (ms) + +% Set EEGLAB figure and GUI colors +% -------------------------------- +lowscreendepth = 0; +if ~exist('OCTAVE_VERSION') + if get(0, 'screendepth') <=8 % if mono or 8-bit color + lowscreendepth = 1; + end; +end; +if lowscreendepth + %fprintf('icadefs(): Setting display parameters for mono or 8-bit color\n'); + BACKCOLOR = [1 1 1]; % Background figure color + BACKEEGLABCOLOR = [1 1 1]; % EEGLAB main window background + GUIBUTTONCOLOR = [1 1 1]; % Buttons colors in figures + GUIPOPBUTTONCOLOR = [1 1 1]; % Buttons colors in GUI windows + GUIBACKCOLOR = [1 1 1]; % GUI background color + GUITEXTCOLOR = [0 0 0]; % GUI foreground color for text + PLUGINMENUCOLOR = [.5 0 .5]; % plugin menu color + +else % if full color screen + BACKCOLOR = [.93 .96 1]; % EEGLAB Background figure color + BACKEEGLABCOLOR = [.66 .76 1]; % EEGLAB main window background + GUIBUTTONCOLOR = BACKEEGLABCOLOR;% Buttons colors in figures + GUIPOPBUTTONCOLOR = BACKCOLOR; % Buttons colors in GUI windows + GUIBACKCOLOR = BACKEEGLABCOLOR;% EEGLAB GUI background color <--------- + GUITEXTCOLOR = [0 0 0.4]; % GUI foreground color for text + PLUGINMENUCOLOR = [.5 0 .5]; % plugin menu color +end; + + +% THE FOLLOWING PARAMETERS WILL BE DEPRECATED IN LATER VERSIONS +% ------------------------------------------------------------- + +SHRINKWARNING = 1; % Warn user about the shrink factor in topoplot() (1/0) + +MAXENVPLOTCHANS = 264; % maximum number of channels to plot in envproj.m +MAXPLOTDATACHANS = 264; % maximum number of channels to plot in dataplot.m +MAXPLOTDATAEPOCHS = 264; % maximum number of epochs to plot in dataplot.m +MAXEEGPLOTCHANS = 264; % maximum number of channels to plot in eegplot.m +MAXTOPOPLOTCHANS = 264; % maximum number of channels to plot in topoplot.m + +DEFAULT_ELOC = 'chan.locs'; % default electrode location file for topoplot.m +DEFAULT_EPOCH = 10; % default epoch width to plot in eegplot(s) (in sec) + +SC = ['binica.sc']; % Master .sc script file for binica.m + % MATLAB will use first such file found + % in its path of script directories. + % Copy to pwd to alter ICA defaults diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/icaproj.m b/code/eeglab13_4_4b/functions/sigprocfunc/icaproj.m new file mode 100644 index 0000000..03878a6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/icaproj.m @@ -0,0 +1,168 @@ +% icaproj() - project ICA component activations through the +% associated weight matrices to reconstitute the +% observed data using only the selected ICA components. +% Usage: +% >> [icaprojdata] = icaproj(data,weights,compindex,[datameans],chansout); +% +% Inputs: +% data - data matrix (chans, frames*epochs) +% weights - unmixing weight matrix (e.g., weights*sphere from runica()) +% compindex - vector of ICA component indices to project +% +% Optional inputs: +% datamean - Optional ICA row means (for each epoch) from runica() +% {default 0 -> distribute data offsets among the ICA components} +% chansout - Optional vector of channel indices to output {default: all} +% +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 11-30-96 +% +% See also: icavar(), runica() + +% Copyright (C) 11-30-96 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 11-30-96 Scott Makeig CNL / Salk Institute, La Jolla as icaproject.m +% 12-24-96 added define for verbose -sm (V1.3) +% 2-11-97 use outer product math when only one component in compindex -sm +% 3-11-97 remove row means instead of grand mean -sm +% 3-19-97 used datamean argument instead of frames/baseframes -sm +% 4-03-97 changed name to icaproj() -sm +% 6-07-97 changed order of args to conform to runica -sm +% 6-10-97 fixed data mean handling -sm +% 6-23-97 trying pseudo-inverse for non-square weights -sm +% 7-23-97 distributed baseline offset (if any) among the activations -sm +% 10-31-97 removed errcode -sm +% 12-19-00 removed sphere, shifted order of args -sm +% 05-29-01 added chansout, made more efficient -sm +% 01-25-02 reformated help & license, added links -ad + +function [icaprojdata] = icaproj(data,weights,compindex,datamean,chansout) + +verbose = 0; % default no-verbose + +if nargin<3 % need 3 args + help icaproj + return +end +if nargin<4 + datamean = 0; % default +end +if isempty(datamean) + datamean = 0; % default +end + +[chans,framestot] = size(data); +if nargin<5 + chansout = []; +end +if isempty(chansout) | chansout(1) == 0 + chansout = 1:chans; +end +if min(chansout)<1 | max(chansout)> chans + fprintf('icaproj(): chansout variable out of 1:chans range.\n') + return +end + +[mchans,epochs] = size(datamean); +frames = floor(framestot/epochs); +if epochs*frames ~= framestot | frames < 1, + fprintf(... + 'icaproj(): frames (%d) does not divide data length (%d)\n.',... + frames,framestot); + return +end + +[ncomps,cols] = size(compindex); +if cols>1, + if ncomps==1, % if row vector, + compindex = compindex'; % make col vector + ncomps = cols; + else + fprintf('icaproj(): compindex must be a vector\n'); + return + end +end +if ncomps>chans, + fprintf('icaproj(): compindex must have <= %d entries\n',chans); + return +end +for a=1:ncomps-1 + for b=a+1:ncomps + if compindex(a,1)==compindex(b,1), + fprintf('icaproj(): component index repeated in compindex\n.'); + return + end + end +end +for a=1:ncomps + if compindex(a)>chans | compindex(a)<1 + fprintf('icaproj(): component index %d out of range!\n',compindex(a)); + return + break + end +end + +if nargin<4 + datamean = 0; % default +end + +if datamean ~= 0, + % + % Remove row means, e.g. those subtracted prior to ICA training by runica() + % + if verbose==1, + fprintf('Removing data means of each channel and data epoch...\n'); + end + for e=1:epochs + data(:,(e-1)*frames+1:e*frames) = ... + data(:,(e-1)*frames+1:e*frames) - datamean(:,e)*ones(1,frames); + end; +end +if verbose == 1 + fprintf('Final input data range: %g to %g\n', ... + min(min(data)),max(max(data))); +end + +if size(weights,1) == size(weights,2) + iweights = inv(weights); % inverse weight matrix +else + iweights = pinv(weights); % pseudo-inverse weight matrix +end + +activations = weights(compindex,:)*data; % activation waveforms + % at desired components +if ncomps==1, % compute outer product only for single component projection + if verbose==1, + fprintf('icaproj(): Projecting data for ICA component %d\n',... + compindex(1)); + end +else % if ncomps > 1 + if verbose==1, + fprintf('icaproj(): Projecting data for ICA components '); + if ncomps<32 + for n=1:ncomps % for each included component + fprintf('%d ',compindex(n)); + end + else + fprintf('specified.'); + end + fprintf('\n'); % copy selected activations + end +end + +icaprojdata = iweights(chansout,compindex)*activations; +% reconstitute selected scalp data channels from selected ICA components diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/icavar.m b/code/eeglab13_4_4b/functions/sigprocfunc/icavar.m new file mode 100644 index 0000000..51c6764 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/icavar.m @@ -0,0 +1,102 @@ +% icavar() - project ICA component activations through the ICA weight matrices +% to reconstitute the observed data using selected ICA components. +% Returns time course of variance on scalp for each component. +% +% Usage: >> [srcvar] = icavar(data,weights,sphere,compnums); +% +% Inputs: +% data - data matrix returned by runica() +% weights - weight matrix returned by runica() +% sphere - sphere matrix returned by runica() (default|0 -> eye(ncomps)) +% compnums - list of component numbers (default|0 -> all) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 11-30-1996 +% +% See also: runica() + +% Copyright (C) 11-30-1996 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 04-03-97 made more efficient -sm +% 05-20-97 debugged variance calculation and made it more efficient -sm +% 06-07-97 changed order of args to conform to runica -sm +% 07-23-97 do not add back datamean to projections -sm +% 12-23-97 added compnums -sm +% 02-25-98 changed activations input to data -sm +% 07-20-98 use pinv() for inverting non-square weights -sm +% 01-25-02 reformated help & license, added links -ad + +function [srcvar] = icavar(data,weights,sphere,compnums) + +if nargin<2 + help icavar + return +end + +if size(weights,2) ~= size(sphere,1) | size(sphere,2) ~= size(data,1) + fprintf('icavar() - sizes of weights, sphere, and data incompatible.\n') + whos data weights sphere + return +end +activations = weights*sphere*data; +[ncomps,frames] = size(activations); +[wr,chans] = size(weights); % Note: ncomps may < data chans + +if nargin<4 + compnums = 0; +end +if compnums == 0, + compnums = 1:ncomps; +end +srcvar = zeros(length(compnums),frames); + +if nargin < 3 + sphere = 0; +end +if sphere == 0, + sphere = eye(ncomps); +end + +project = weights*sphere; + +if wr~=ncomps, + fprintf('icavar: Number of rows in activations and weights must be equal.\n'); + return +end + +% if wr> B = jader(X); +% >> B = jader(X,m); +% +% Notes: +% 1) If X is an nxT data matrix (n sensors, T samples) then +% B=jader(X) is a nxn separating matrix such that S=B*X is an nxT +% matrix of estimated source signals. +% 2) If B=jader(X,m), then B has size mxn so that only m sources are +% extracted. This is done by restricting the operation of jader +% to the m first principal components. +% 3) Also, the rows of B are ordered such that the columns of pinv(B) +% are in order of decreasing norm; this has the effect that the +% `most energetically significant' components appear first in the +% rows of S=B*X. +% +% Author: Jean-Francois Cardoso (cardoso@sig.enst.fr) + +% Quick notes (more at the end of this file) +% +% o this code is for REAL-valued signals. An implementation of JADE +% for both real and complex signals is also available from +% http://sig.enst.fr/~cardoso/stuff.html +% +% o This algorithm differs from the first released implementations of +% JADE in that it has been optimized to deal more efficiently +% 1) with real signals (as opposed to complex) +% 2) with the case when the ICA model does not necessarily hold. +% +% o There is a practical limit to the number of independent +% components that can be extracted with this implementation. Note +% that the first step of JADE amounts to a PCA with dimensionality +% reduction from n to m (which defaults to n). In practice m +% cannot be `very large' (more than 40, 50, 60... depending on +% available memory) +% +% o See more notes, references and revision history at the end of +% this file and more stuff on the WEB +% http://sig.enst.fr/~cardoso/stuff.html +% +% o This code is supposed to do a good job! Please report any +% problem to cardoso@sig.enst.fr + +% Copyright : Jean-Francois Cardoso. cardoso@sig.enst.fr + +function B = jadeR(X,m) + +verbose = 1 ; % Set to 0 for quiet operation + + +% Finding the number of sources +[n,T] = size(X); +if nargin==1, m=n ; end; % Number of sources defaults to # of sensors +if m>n , fprintf('jade -> Do not ask more sources than sensors here!!!\n'), return,end +if verbose, fprintf('jade -> Looking for %d sources\n',m); end ; + + + +% Self-commenting code +%===================== +if verbose, fprintf('jade -> Removing the mean value\n'); end +X = X - mean(X')' * ones(1,T); + + +%%% whitening & projection onto signal subspace +% =========================================== +if verbose, fprintf('jade -> Whitening the data\n'); end + [U,D] = eig((X*X')/T) ; + [puiss,k] = sort(diag(D)) ; + rangeW = n-m+1:n ; % indices to the m most significant directions + scales = sqrt(puiss(rangeW)) ; % scales + W = diag(1./scales) * U(1:n,k(rangeW))' ; % whitener + iW = U(1:n,k(rangeW)) * diag(scales) ; % its pseudo-inverse + X = W*X; + + +%%% Estimation of the cumulant matrices. +% ==================================== +if verbose, fprintf('jade -> Estimating cumulant matrices\n'); end + +dimsymm = (m*(m+1))/2; % Dim. of the space of real symm matrices +nbcm = dimsymm ; % number of cumulant matrices +CM = zeros(m,m*nbcm); % Storage for cumulant matrices +R = eye(m); %% +Qij = zeros(m); % Temp for a cum. matrix +Xim = zeros(1,m); % Temp +Xjm = zeros(1,m); % Temp +scale = ones(m,1)/T ; % for convenience + + + +%% I am using a symmetry trick to save storage. I should write a +%% short note one of these days explaining what is going on here. +%% +Range = 1:m ; % will index the columns of CM where to store the cum. mats. +for im = 1:m + Xim = X(im,:) ; + Qij = ((scale* (Xim.*Xim)) .* X ) * X' - R - 2 * R(:,im)*R(:,im)' ; + CM(:,Range) = Qij ; + Range = Range + m ; + for jm = 1:im-1 + Xjm = X(jm,:) ; + Qij = ((scale * (Xim.*Xjm) ) .*X ) * X' - R(:,im)*R(:,jm)' - R(:,jm)*R(:,im)' ; + CM(:,Range) = sqrt(2)*Qij ; + Range = Range + m ; + end ; +end; + +%%% joint diagonalization of the cumulant matrices +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Init +if 1, %% Init by diagonalizing a *single* cumulant matrix. It seems to save + %% some computation time `sometimes'. Not clear if initialization is + %% a good idea since Jacobi rotations are very efficient. + + if verbose, fprintf('jade -> Initialization of the diagonalization\n'); end + [V,D] = eig(CM(:,1:m)); % For instance, this one + for u=1:m:m*nbcm, % updating accordingly the cumulant set given the init + CM(:,u:u+m-1) = CM(:,u:u+m-1)*V ; + end; + CM = V'*CM; + +else, %% The dont-try-to-be-smart init + V = eye(m) ; % la rotation initiale +end; + +seuil = 1/sqrt(T)/100; % A statistically significant threshold +encore = 1; +sweep = 0; +updates = 0; +g = zeros(2,nbcm); +gg = zeros(2,2); +G = zeros(2,2); +c = 0 ; +s = 0 ; +ton = 0 ; +toff = 0 ; +theta = 0 ; + +%% Joint diagonalization proper +if verbose, fprintf('jade -> Contrast optimization by joint diagonalization\n'); end + +while encore, encore=0; + + if verbose, fprintf('jade -> Sweep #%d\n',sweep); end + sweep=sweep+1; + + for p=1:m-1, + for q=p+1:m, + + Ip = p:m:m*nbcm ; + Iq = q:m:m*nbcm ; + + %%% computation of Givens angle + g = [ CM(p,Ip)-CM(q,Iq) ; CM(p,Iq)+CM(q,Ip) ]; + gg = g*g'; + ton = gg(1,1)-gg(2,2); + toff = gg(1,2)+gg(2,1); + theta = 0.5*atan2( toff , ton+sqrt(ton*ton+toff*toff) ); + + %%% Givens update + if abs(theta) > seuil, encore = 1 ; + updates = updates + 1; + c = cos(theta); + s = sin(theta); + G = [ c -s ; s c ] ; + + pair = [p;q] ; + V(:,pair) = V(:,pair)*G ; + CM(pair,:) = G' * CM(pair,:) ; + CM(:,[Ip Iq]) = [ c*CM(:,Ip)+s*CM(:,Iq) -s*CM(:,Ip)+c*CM(:,Iq) ] ; + + %% fprintf('jade -> %3d %3d %12.8f\n',p,q,s); + + end%%of the if + end%%of the loop on q + end%%of the loop on p +end%%of the while loop +if verbose, fprintf('jade -> Total of %d Givens rotations\n',updates); end + +%%% A separating matrix +% =================== +B = V'*W ; + +%%% We permut its rows to get the most energetic components first. +%%% Here the **signals** are normalized to unit variance. Therefore, +%%% the sort is according to the norm of the columns of A = pinv(B) + +if verbose, fprintf('jade -> Sorting the components\n',updates); end +A = iW*V ; +[vars,keys] = sort(sum(A.*A)) ; +B = B(keys,:); +B = B(m:-1:1,:) ; % Is this smart ? + +% Signs are fixed by forcing the first column of B to have +% non-negative entries. +if verbose, fprintf('jade -> Fixing the signs\n',updates); end +b = B(:,1) ; +signs = sign(sign(b)+0.1) ; % just a trick to deal with sign=0 +B = diag(signs)*B ; + + +return ; + +% To do. +% - Implement a cheaper/simpler whitening (is it worth it?) +% +% Revision history: +% +%- V1.5, Dec. 24 1997 +% - The sign of each row of B is determined by letting the first +% element be positive. +% +%- V1.4, Dec. 23 1997 +% - Minor clean up. +% - Added a verbose switch +% - Added the sorting of the rows of B in order to fix in some +% reasonable way the permutation indetermination. See note 2) +% below. +% +%- V1.3, Nov. 2 1997 +% - Some clean up. Released in the public domain. +% +%- V1.2, Oct. 5 1997 +% - Changed random picking of the cumulant matrix used for +% initialization to a deterministic choice. This is not because +% of a better rationale but to make the ouput (almost surely) +% deterministic. +% - Rewrote the joint diag. to take more advantage of Matlab's +% tricks. +% - Created more dummy variables to combat Matlab's loose memory +% management. +% +%- V1.1, Oct. 29 1997. +% Made the estimation of the cumulant matrices more regular. This +% also corrects a buglet... +% +%- V1.0, Sept. 9 1997. Created. +% +% Main reference: +% @article{CS-iee-94, +% title = "Blind beamforming for non {G}aussian signals", +% author = "Jean-Fran\c{c}ois Cardoso and Antoine Souloumiac", +% HTML = "ftp://sig.enst.fr/pub/jfc/Papers/iee.ps.gz", +% journal = "IEE Proceedings-F", +% month = dec, number = 6, pages = {362-370}, volume = 140, year = 1993} +% +% Notes: +% ====== +% +% Note 1) +% +% The original Jade algorithm/code deals with complex signals in +% Gaussian noise white and exploits an underlying assumption that the +% model of independent components actually holds. This is a +% reasonable assumption when dealing with some narrowband signals. +% In this context, one may i) seriously consider dealing precisely +% with the noise in the whitening process and ii) expect to use the +% small number of significant eigenmatrices to efficiently summarize +% all the 4th-order information. All this is done in the JADE +% algorithm. +% +% In this implementation, we deal with real-valued signals and we do +% NOT expect the ICA model to hold exactly. Therefore, it is +% pointless to try to deal precisely with the additive noise and it +% is very unlikely that the cumulant tensor can be accurately +% summarized by its first n eigen-matrices. Therefore, we consider +% the joint diagonalization of the whole set of eigen-matrices. +% However, in such a case, it is not necessary to compute the +% eigenmatrices at all because one may equivalently use `parallel +% slices' of the cumulant tensor. This part (computing the +% eigen-matrices) of the computation can be saved: it suffices to +% jointly diagonalize a set of cumulant matrices. Also, since we are +% dealing with reals signals, it becomes easier to exploit the +% symmetries of the cumulants to further reduce the number of +% matrices to be diagonalized. These considerations, together with +% other cheap tricks lead to this version of JADE which is optimized +% (again) to deal with real mixtures and to work `outside the model'. +% As the original JADE algorithm, it works by minimizing a `good set' +% of cumulants. +% +% Note 2) +% +% The rows of the separating matrix B are resorted in such a way that +% the columns of the corresponding mixing matrix A=pinv(B) are in +% decreasing order of (Euclidian) norm. This is a simple, `almost +% canonical' way of fixing the indetermination of permutation. It +% has the effect that the first rows of the recovered signals (ie the +% first rows of B*X) correspond to the most energetic *components*. +% Recall however that the source signals in S=B*X have unit variance. +% Therefore, when we say that the observations are unmixed in order +% of decreasing energy, the energetic signature is found directly as +% the norm of the columns of A=pinv(B). +% +% Note 3) +% +% In experiments where JADE is run as B=jadeR(X,m) with m varying in +% range of values, it is nice to be able to test the stability of the +% decomposition. In order to help in such a test, the rows of B can +% be sorted as described above. We have also decided to fix the sign +% of each row in some arbitrary but fixed way. The convention is +% that the first element of each row of B is positive. +% +% +% Note 4) +% +% Contrary to many other ICA algorithms, JADE (or least this version) +% does not operate on the data themselves but on a statistic (the +% full set of 4th order cumulant). This is represented by the matrix +% CM below, whose size grows as m^2 x m^2 where m is the number of +% sources to be extracted (m could be much smaller than n). As a +% consequence, (this version of) JADE will probably choke on a +% `large' number of sources. Here `large' depends mainly on the +% available memory and could be something like 40 or so. One of +% these days, I will prepare a version of JADE taking the `data' +% option rather than the `statistic' option. +% +% + + +% JadeR.m ends here. + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/jointprob.m b/code/eeglab13_4_4b/functions/sigprocfunc/jointprob.m new file mode 100644 index 0000000..3084428 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/jointprob.m @@ -0,0 +1,128 @@ +% jointprob() - rejection of odd columns of a data array using +% joint probability of the values in that column (and +% using the probability distribution of all columns). +% +% Usage: +% >> [jp rej] = jointprob( signal ); +% >> [jp rej] = jointprob( signal, threshold, jp, normalize, discret); +% +% +% Inputs: +% signal - one dimensional column vector of data values, two +% dimensional column vector of values of size +% sweeps x frames or three dimensional array of size +% component x sweeps x frames. If three dimensional, +% all components are treated independently. +% threshold - Absolute threshold. If normalization is used then the +% threshold is expressed in standard deviation of the +% mean. 0 means no threshold. +% jp - pre-computed joint probability (only perform thresholding). +% Default is the empty array []. +% normalize - 0 = do not not normalize entropy. 1 = normalize entropy. +% 2 is 20% trimming (10% low and 10% high) proba. before +% normalizing. Default is 0. +% discret - discretization variable for calculation of the +% discrete probability density. Default is 1000 points. +% +% Outputs: +% jp - normalized joint probability of the single trials +% (size component x sweeps) +% rej - rejected matrix (0 and 1, size comp x sweeps) +% +% Remark: +% The exact values of joint-probability depend on the size of a time +% step and thus cannot be considered as absolute. +% +% See also: realproba() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [jp, rej] = jointprob( signal, threshold, oldjp, normalize, discret ); + +if nargin < 1 + help jointprob; + return; +end; +if nargin < 2 + threshold = 0; +end; +if nargin < 3 + oldjp = []; +end; +if nargin < 4 + normalize = 0; +end; +if nargin < 5 + discret = 1000; +end; + +if size(signal,2) == 1 % transpose if necessary + signal = signal'; +end; + +[nbchan pnts sweeps] = size(signal); +jp = zeros(nbchan,sweeps); + +if exist('oldjp') & ~isempty( oldjp ) % speed up the computation + jp = oldjp; +else + for rc = 1:nbchan + + % COMPUTE THE DENSITY FUNCTION + % ---------------------------- + [ dataProba sortbox ] = realproba( signal(rc, :), discret ); + + % compute all entropy + % ------------------- + for index=1:sweeps + datatmp = dataProba((index-1)*pnts+1:index*pnts); + jp(rc, index) = - sum( log( datatmp ) ); + % - sum( datatmp .* log( datatmp ) ); would be the entropy + end; + end; + + % normalize the last dimension + % ---------------------------- + if normalize + tmpjp = jp; + if normalize == 2, + tmpjp = sort(jp); + tmpjp = tmpjp(round(length(tmpjp)*0.1):end-round(length(tmpjp)*0.1)); + end; + try, + switch ndims( signal ) + case 2, jp = (jp-mean(tmpjp)) / std(tmpjp); + case 3, jp = (jp-mean(tmpjp,2)*ones(1,size(jp,2)))./ ... + (std(tmpjp,0,2)*ones(1,size(jp,2))); + end; + catch, error('Error while normalizing'); end; + end; +end + +% reject +% ------ +if threshold ~= 0 + if length(threshold) > 1 + rej = (threshold(1) > jp) | (jp > threshold(2)); + else + rej = abs(jp) > threshold; + end; +else + rej = zeros(size(jp)); +end; + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/kmeanscluster.m b/code/eeglab13_4_4b/functions/sigprocfunc/kmeanscluster.m new file mode 100644 index 0000000..24cb7f0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/kmeanscluster.m @@ -0,0 +1,117 @@ +function [g, c, tmp, m]=kMeansCluster(m,k,isRand) +% kMeansCluster - Simple k means clustering algorithm +% Author: Kardi Teknomo, Ph.D. +% +% Purpose: classify the objects in data matrix based on the attributes +% Criteria: minimize Euclidean distance between centroids and object points +% For more explanation of the algorithm, see http://people.revoledu.com/kardi/tutorial/kMean/index.html +% Output: matrix data plus an additional column represent the group of each object +% +% Example: m = [ 1 1; 2 1; 4 3; 5 4] or in a nice form +% m = [ 1 1; +% 2 1; +% 4 3; +% 5 4] +% k = 2 +% kMeansCluster(m,k) produces m = [ 1 1 1; +% 2 1 1; +% 4 3 2; +% 5 4 2] +% Input: +% m - required, matrix data: objects in rows and attributes in columns +% k - optional, number of groups (default = 1) +% isRand - optional, if using random initialization isRand=1, otherwise input any number (default) +% it will assign the first k data as initial centroids +% +% Local Variables +% f - row number of data that belong to group i +% c - centroid coordinate size (1:k, 1:maxCol) +% g - current iteration group matrix size (1:maxRow) +% i - scalar iterator +% maxCol - scalar number of rows in the data matrix m = number of attributes +% maxRow - scalar number of columns in the data matrix m = number of objects +% temp - previous iteration group matrix size (1:maxRow) +% z - minimum value (not needed) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin<3, isRand=0; end +if nargin<2, k=1; end +tmp = []; + +[maxRow, maxCol]=size(m); +if maxRow<=k, + y=[m, 1:maxRow]; +else + + % initial value of centroid + if isRand, + p = randperm(size(m,1)); % random initialization + for i=1:k + c(i,:)=m(p(i),:) + end + else + for i=1:k + c(i,:)=m(i,:); % sequential initialization + end + end + + temp=zeros(maxRow,1); % initialize as zero vector + + while 1, + d=DistMatrix(m,c); % calculate objcets-centroid distances + [z,g]=min(d,[],2); % find group matrix g + if g==temp, + break; % stop the iteration + else + temp=g; % copy group matrix to temporary variable + end + for i=1:k + f=find(g==i); + if f % only compute centroid if f is not empty + c(i,:)=mean(m(find(g==i),:),1); + end + end + end + + y=[m,g]; + +end + +%The Matlab function kMeansCluster above call function DistMatrix as shown in the code below. It works for multi-dimensional Euclidean distance. Learn about other type of distance here. + + function d=DistMatrix(A,B) + %%%%%%%%%%%%%%%%%%%%%%%%% + % DISTMATRIX return distance matrix between points in A=[x1 y1 ... w1] and in B=[x2 y2 ... w2] + % Copyright (c) 2005 by Kardi Teknomo, http://people.revoledu.com/kardi/ + % + % Numbers of rows (represent points) in A and B are not necessarily the same. + % It can be use for distance-in-a-slice (Spacing) or distance-between-slice (Headway), + % + % A and B must contain the same number of columns (represent variables of n dimensions), + % first column is the X coordinates, second column is the Y coordinates, and so on. + % The distance matrix is distance between points in A as rows + % and points in B as columns. + % example: Spacing= dist(A,A) + % Headway = dist(A,B), with hA ~= hB or hA=hB + % A=[1 2 3; 4 5 6; 2 4 6; 1 2 3]; B=[4 5 1; 6 2 0] + % dist(A,B)= [ 4.69 5.83; + % 5.00 7.00; + % 5.48 7.48; + % 4.69 5.83] + % + % dist(B,A)= [ 4.69 5.00 5.48 4.69; + % 5.83 7.00 7.48 5.83] + %%%%%%%%%%%%%%%%%%%%%%%%%%% + [hA,wA]=size(A); + [hB,wB]=size(B); + if wA ~= wB, error(' second dimension of A and B must be the same'); end + for k=1:wA + C{k}= repmat(A(:,k),1,hB); + D{k}= repmat(B(:,k),1,hA); + end + S=zeros(hA,hB); + for k=1:wA + S=S+(C{k}-D{k}').^2; + end + d=sqrt(S); + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/kurt.m b/code/eeglab13_4_4b/functions/sigprocfunc/kurt.m new file mode 100644 index 0000000..08354fe --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/kurt.m @@ -0,0 +1,48 @@ +% kurt() - return kurtosis of input data distribution +% +% Usage: +% >> k=kurt(data) +% +% Algorithm: +% Calculates kurtosis or normalized 4th moment of an input data vector +% Given a matrix, returns a row vector giving the kurtosis' of the columns +% (Ref: "Numerical Recipes," p. 612) +% +% Author: Martin Mckeown, CNL / Salk Institute, La Jolla, 10/2/96 + +% Copyright (C) Martin Mckeown, CNL / Salk Institute, La Jolla, 7/1996 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 2/28/97 - made to return separate kurtosis estimates of columns -Scott Makeig +% 01-25-02 reformated help & license, added links -ad + +function [k] = kurt(data) + +[r,c]=size(data); +if r==1, + kdata = data'; % if a row vector, make into a column vector + r = c; +else + kdata = data; +end +%fprintf('size of kdata = [%d,%d]\n',size(kdata,1),size(kdata,2)); + +mn = mean(kdata); % find the column means +diff = kdata-ones(r,1)*mn; % remove the column means +dsq = diff.*diff; % square the data + +k = (sum(dsq.*dsq)./std(kdata).^4)./r - 3; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/loadavg.m b/code/eeglab13_4_4b/functions/sigprocfunc/loadavg.m new file mode 100644 index 0000000..7b23f6c --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/loadavg.m @@ -0,0 +1,307 @@ +% loadavg() - loading eeg average data file from Neuroscan into +% matlab. +% Usage: +% >> [signal, variance, chan_names, ... +% pnts, rate, xmin, xmax] = loadavg( filename, version ); +% Input: +% filename - input Neuroscan .avg file +% version - [1 or 2] function version. Default is 2 which scales +% the data properly. +% +% Output: +% signal - output signal +% variance - variance of the signal +% chan_names - array that represent the name of the electrodes +% pnts - number of data points +% srate - sampling rate +% xmin - ERP onset time +% xmax - ERP final time +% +% Example: +% % load data into the array named 'signal' +% [signal]=loadavg( 'test.avg' ); +% % plot the signal for the first electrode +% plot( signal(1,:) ); +% +% Author: Arnaud Delorme (v1), Yang Zhang (v2) + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Average binary file format +% Average data is stored as 4-byte floats in vectored format for each +% channel. Each channel has a 5-byte header that is no longer used. Thus, +% after the main file header, there is an unused 5-byte header followed by +% erp.pnts of 4-byte floating point numbers for the first channel; then a +% 5-byte header for channel two followed by erp.pnts*sizeof(float) bytes, +% etc. Therefore, the total number of bytes after the main header is: +% erp.nchannels * (5 + erp.pnts*sizeof(float)). To scale a data point to +% microvolts, multiply by the channel-specific calibration factor (i.e., for +% electrode j: channel[j]->calib) and divide by the number of sweeps in the +% average (i.e., channel[j]->n). + +function [signal, variance, chan_names, pnts, rate, xmin, xmax]=loadavg( FILENAME,version) + +if nargin<1 + help loadavg + return; +end; + +if nargin < 2 || version == 2 + disp('Reading using method 2'); + [signal, variance, chan_names, pnts, rate, xmin, xmax]=loadavg_bcl( FILENAME ); + signal = signal'; + return; +end; +disp('Reading using method 1'); + +%if isempty(find(FILENAME=='.')) FILENAME=[FILENAME '.eeg']; end; + +BOOL='int16'; +ULONG='int32'; +FLOAT='float32'; +fid=fopen(FILENAME,'r','ieee-le'); +if fid<0 + fprintf(2,['Error LOADEEG: File ' FILENAME ' not found\n']); + return; +end; + +S_nsweeps_offset_total = 362; +S_nsweeps_offset_accepted = 364; +S_pnts_offset = 368; +S_nchans_offset = 370; +S_variance_offset = 375; +S_rate_offset = 376; +S_xmin_offset = 505; +S_xmax_offset = 509; +packed_sizeof_SETUP = 900; + +% read general part of the erp header and set variables +% ----------------------------------------------------- +%erp = fread(fid, 362, 'uchar'); % skip the firsts 368 bytes +%nsweeps = fread(fid, 1, 'ushort'); % number of sweeps +%erp = fread(fid, 4, 'uchar'); % skip 4 bytes +%pnts= fread(fid, 1, 'ushort'); % number of point per waveform +%chan= fread(fid, 1, 'ushort'); % number of channels +%erp = fread(fid, 4, 'uchar'); % skip 4 bytes +%rate= fread(fid, 1, 'ushort'); % sample rate (Hz) +%erp = fread(fid, 127, 'uchar'); % skip 125 bytes +%xmin= fread(fid, 1, 'float32'); % in s +%xmax= fread(fid, 1, 'float32'); % in s +%erp = fread(fid, 387, 'uchar'); % skip 387 bytes + +% read # of channels, # of samples, variance flag, and real time bounds +% --------------------------------------------------------------------- +fseek(fid, S_nsweeps_offset_accepted, 'bof'); nsweeps = fread(fid, 1, 'ushort'); +if nsweeps == 0 + fseek(fid, S_nsweeps_offset_total, 'bof'); nsweeps = fread(fid, 1, 'ushort'); +end; +fseek(fid, S_pnts_offset, 'bof'); pnts = fread(fid, 1, 'ushort'); +fseek(fid, S_nchans_offset, 'bof'); chan = fread(fid, 1, 'ushort'); +fseek(fid, S_variance_offset, 'bof'); variance_flag = fread(fid, 1, 'uchar'); +fseek(fid, S_rate_offset, 'bof'); rate = fread(fid, 1, 'ushort'); +fseek(fid, S_xmin_offset, 'bof'); xmin = fread(fid, 1, 'float32'); +fseek(fid, S_xmax_offset, 'bof'); xmax = fread(fid, 1, 'float32'); +fseek(fid, packed_sizeof_SETUP, 'bof'); + +fprintf('number of channels : %d\n', chan); +fprintf('number of points per trial : %d\n', pnts); +fprintf('sampling rate (Hz) : %f\n', rate); +fprintf('xmin (s) : %f\n', xmin); +fprintf('xmax (s) : %f\n', xmax); +fprintf('number of trials (s) : %d\n', nsweeps); +if nsweeps == 0, nsweeps = 1; end; + +% read electrode configuration +% ---------------------------- +fprintf('Electrode configuration\n'); +for elec = 1:chan + channel_label_tmp = fread(fid, 10, 'uchar'); + chan_names(elec,:) = channel_label_tmp'; + for index = 2:9 if chan_names(elec,index) == 0 chan_names(elec,index)=' '; end; end; + erp = fread(fid, 47-10, 'uchar'); + baseline(elec) = fread(fid, 1, 'ushort'); + erp = fread(fid, 10, 'uchar'); + sensitivity(elec) = fread(fid, 1, 'float32'); + erp = fread(fid, 8, 'uchar'); + calib(elec) = fread(fid, 1, 'float32'); + fprintf('%s: baseline: %d\tsensitivity: %f\tcalibration: %f\n', ... + char(chan_names(elec,1:4)), baseline(elec), sensitivity(elec), calib(elec)); + factor(elec) = calib(elec) * sensitivity(elec) / 204.8; +end; + +xsize = chan * pnts; +buf_size = chan * pnts ; % size in shorts + +count_selected = 1; +fprintf('Reserving array (can take some time)\n'); +signal = zeros( chan, pnts*nsweeps); +fprintf('Array reserved, scanning file\n'); + +signal = zeros(pnts, chan); +variance = zeros(pnts, chan); + +for elec = 1:chan + + % skip sweeps header and read data + % -------------------------------- + fseek(fid, 5, 'cof'); + signal(:, elec) = fread(fid, pnts, 'float32') * factor(elec) / nsweeps; +end; + +if variance_flag + for elec = 1:chan + variance(:, elec) = fread(fid, pnts, 'float32'); + end; +else + variance = 'novariance'; +end; + +signal = signal'; +variance = variance'; + +fclose(fid); +return; + +function [signal, variance, chan_names, pnts, rate, xmin, xmax]=loadavg_bcl(FILENAME,chanNameList) + %writed by allen zhang based on EEGLAB's loadavg.m + %2009-11-25 + % NENU,CHANGCHUN,CHINA + % update by Yang Zhang + %2011-2-28 + % NENU,Changchun, CHINA + + % revised by Yang Zhang + % 2011-4-6 + %using automatic routine to identifiy the type of the avg file to get the true nsweeps parameter + + if ~exist('chanNameList','var') + chanNameList={'all'}; + end + try + fid=fopen(FILENAME,'r','ieee-le'); + % read general part of the erp header and set variables + % ----------------------------------------------------- + fseek(fid, 362, 'cof');% skip the firsts 362 from BOF (368 bytes in orginal comment?) + % disp(ftell(fid));% 360 bytes + % hdr.nsweeps = fread(fid, 1, 'ushort'); + % disp(ftell(fid));% 362 + % hdr.compsweeps = fread(fid, 1, 'ushort');% the exact sweep numbers for eeg and single subject avg file| in grand avg file it represents the number of subjects + % hdr.acceptcnt = fread(fid, 1, 'ushort');% number of accepted sweeps also the exact sweep numbers for grand avg file + % hdr.rejectcnt = fread(fid, 1, 'ushort');%number of rejected sweeps + % disp(ftell(fid));% 368 + + compsweeps = fread(fid, 1, 'ushort');% the exact sweeps numbers for eeg file| in Grand avg file it represented number of subjects + + acceptcnt = fread(fid, 1, 'ushort');% number of accepted sweeps + rejectcnt = fread(fid, 1, 'ushort');%number of rejected sweeps + + % determine the type of avg file and choose the right value for nsweeps + if (rejectcnt+acceptcnt)~=compsweeps + disp('It''s a grand average file!!!'); + disp(['Subject number = ',num2str(compsweeps),'; sweeps = ',num2str(acceptcnt)]); + nsweeps=compsweeps; + else + disp('It''s a single subject average file!!!'); + disp(['nsweeps = ',num2str(compsweeps),'; Accepted sweeps = ',num2str(acceptcnt),'; Rejected sweeps = ',num2str(rejectcnt)]); + nsweeps=acceptcnt; + end + + + pnts=fread(fid, 1, 'ushort'); % number of point per waveform + chan=fread(fid, 1, 'ushort'); % number of channels + fseek(fid, 3, 'cof'); % skip 3 bytes + variance_flag=fread(fid, 1, 'uchar'); + rate=fread(fid, 1, 'ushort'); % sample rate (Hz) + fseek(fid, 127, 'cof'); % skip 127 bytes + xmin=fread(fid, 1, 'float32'); % in s + xmax=fread(fid, 1, 'float32'); % in s + fseek(fid, 387, 'cof'); % skip 387 bytes + + % read electrode configuration + % ---------------------------- + for elec = 1:chan + channel_label_tmp = fread(fid, 10, 'uchar'); + electrodes(elec).tmp=channel_label_tmp; + chan_names(elec,:) = channel_label_tmp'; %#ok<*AGROW> + for index = 2:9 + if chan_names(elec,index) == 0 + chan_names(elec,index)=' '; + end; + end; + fseek(fid, 61, 'cof');%skip 61 bytes + electrodes(elec).calib= fread(fid, 1, 'float32'); + + % erp = fread(fid, 47-10, 'uchar'); + % baseline(elec) = fread(fid, 1, 'ushort'); + % erp = fread(fid, 10, 'uchar'); + % sensitivity(elec) = fread(fid, 1, 'float32'); + % erp = fread(fid, 8, 'uchar'); + % electrodes(elec).calib= fread(fid, 1, 'float32'); + % + % fprintf('%s: baseline: %d\tsensitivity: %f\tcalibration: %f\n', ... + % char(chan_names(elec,1:4)), baseline(elec), sensitivity(elec), electrodes(elec).calib); + end; + + signal = zeros(pnts, chan); + variance = zeros(pnts, chan); + + for elec = 1:chan + % To scale a data point to + % microvolts, multiply by the channel-specific calibration factor (i.e., for electrode j: + % channel[j]->calib) and divide by the number of sweeps in the average (i.e., + % channel[j]->n); + % skip sweeps header and read data + % -------------------------------- + fseek(fid, 5, 'cof'); + signal(:, elec) =fread(fid, pnts, 'float32')*electrodes(elec).calib/nsweeps; + + end; + + if variance_flag + for elec = 1:chan + variance(:, elec) = fread(fid, pnts, 'float32')*electrodes(elec).calib/nsweeps;% not sure + end; + else + variance = 'novariance'; + end; + %% + if ~strcmpi(chanNameList{1},'all') + chanIDX=ones(1,chan); + for ichanList=1:numel(chanNameList) + for elec=1:chan + if strcmpi(chanNameList{ichanList},char(chan_names(elec,1:numel(chanNameList{ichanList})))) + chanIDX(elec)=0; + break; + end + end + end + + signal=signal(:,~chanIDX); + if variance_flag + variance=variance(:,~chanIDX); + end + chan_names=chan_names(~chanIDX,:); + end + % signal = signal'; + % variance = variance'; + fclose(fid); + + catch errorLOAD + disp(FILENAME); + rethrow(errorLOAD); + end + return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/loadcnt.m b/code/eeglab13_4_4b/functions/sigprocfunc/loadcnt.m new file mode 100644 index 0000000..2c2d3c2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/loadcnt.m @@ -0,0 +1,722 @@ +% loadcnt() - Load a Neuroscan continuous signal file. +% +% Usage: +% >> cnt = loadcnt(file, varargin) +% +% Inputs: +% filename - name of the file with extension +% +% Optional inputs: +% 't1' - start at time t1, default 0. Warning, events latency +% might be innacurate (this is an open issue). +% 'sample1' - start at sample1, default 0, overrides t1. Warning, +% events latency might be innacurate. +% 'lddur' - duration of segment to load, default = whole file +% 'ldnsamples' - number of samples to load, default = whole file, +% overrides lddur +% 'scale' - ['on'|'off'] scale data to microvolt (default:'on') +% 'dataformat' - ['int16'|'int32'] default is 'int16' for 16-bit data. +% Use 'int32' for 32-bit data. +% 'blockread' - [integer] by default it is automatically determined +% from the file header, though sometimes it finds an +% incorect value, so you may want to enter a value manually +% here (1 is the most standard value). +% 'memmapfile' - ['memmapfile_name'] use this option if the .cnt file +% is too large to read in conventially. The suffix of +% the memmapfile_name must be .fdt. The memmapfile +% functions process files based on their suffix, and an +% error will occur if you use a different suffix. +% 'precision': string describing data precision during loading +% process. ['single' | 'double']. If this field is +% ommitted, program will attempt to check eeglab_options. +% If that doesn't work, then it will default to 'single' +% +% Outputs: +% cnt - structure with the continuous data and other informations +% cnt.header +% cnt.electloc +% cnt.data +% cnt.tag +% +% Authors: Sean Fitzgibbon, Arnaud Delorme, 2000- +% +% Note: function original name was load_scan41.m +% +% Known limitations: +% For more see http://www.cnl.salk.edu/~arno/cntload/index.html + +% Copyright (C) 2000 Sean Fitzgibbon, +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [f,lab,ev2p] = loadcnt(filename,varargin) + +if ~isempty(varargin) + r=struct(varargin{:}); +else r = []; +end; + +try, r.t1; catch, r.t1=0; end +try, r.sample1; catch, r.sample1=[]; end +try, r.lddur; catch, r.lddur=[]; end +try, r.ldnsamples; catch, r.ldnsamples=[]; end +try, r.scale; catch, r.scale='on'; end +try, r.blockread; catch, r.blockread = []; end +try, r.dataformat; catch, r.dataformat = 'auto'; end +try, r.memmapfile; catch, r.memmapfile = ''; end + +%% DATA PRECISION CHECK +if ~isfield(r, 'precision') || isempty(r.precision) + + % Try loading eeglab defaults. Otherwise, go with single precision. + try + eeglab_options; + if option_single==1 + r.precision='single'; + else + r.precision='double'; + end % if option_single + catch + r.precision='single'; + end % try catch + +end % ~isfield(... + +sizeEvent1 = 8 ; %%% 8 bytes for Event1 +sizeEvent2 = 19 ; %%% 19 bytes for Event2 +sizeEvent3 = 19 ; %%% 19 bytes for Event3 + +type='cnt'; +if nargin ==1 + scan=0; +end + +fid = fopen(filename,'r', 'l'); +% disp(['Loading file ' filename ' ...']) + +h.rev = fread(fid,12,'char'); +h.nextfile = fread(fid,1,'long'); +h.prevfile = fread(fid,1,'ulong'); +h.type = fread(fid,1,'char'); +h.id = fread(fid,20,'char'); +h.oper = fread(fid,20,'char'); +h.doctor = fread(fid,20,'char'); +h.referral = fread(fid,20,'char'); +h.hospital = fread(fid,20,'char'); +h.patient = fread(fid,20,'char'); +h.age = fread(fid,1,'short'); +h.sex = fread(fid,1,'char'); +h.hand = fread(fid,1,'char'); +h.med = fread(fid,20, 'char'); +h.category = fread(fid,20, 'char'); +h.state = fread(fid,20, 'char'); +h.label = fread(fid,20, 'char'); +h.date = fread(fid,10, 'char'); +h.time = fread(fid,12, 'char'); +h.mean_age = fread(fid,1,'float'); +h.stdev = fread(fid,1,'float'); +h.n = fread(fid,1,'short'); +h.compfile = fread(fid,38,'char'); +h.spectwincomp = fread(fid,1,'float'); +h.meanaccuracy = fread(fid,1,'float'); +h.meanlatency = fread(fid,1,'float'); +h.sortfile = fread(fid,46,'char'); +h.numevents = fread(fid,1,'int'); +h.compoper = fread(fid,1,'char'); +h.avgmode = fread(fid,1,'char'); +h.review = fread(fid,1,'char'); +h.nsweeps = fread(fid,1,'ushort'); +h.compsweeps = fread(fid,1,'ushort'); +h.acceptcnt = fread(fid,1,'ushort'); +h.rejectcnt = fread(fid,1,'ushort'); +h.pnts = fread(fid,1,'ushort'); +h.nchannels = fread(fid,1,'ushort'); +h.avgupdate = fread(fid,1,'ushort'); +h.domain = fread(fid,1,'char'); +h.variance = fread(fid,1,'char'); +h.rate = fread(fid,1,'ushort'); % A USER CLAIMS THAT SAMPLING RATE CAN BE +h.scale = fread(fid,1,'double'); % FRACTIONAL IN NEUROSCAN WHICH IS +h.veogcorrect = fread(fid,1,'char'); % OBVIOUSLY NOT POSSIBLE HERE (BUG 606) +h.heogcorrect = fread(fid,1,'char'); +h.aux1correct = fread(fid,1,'char'); +h.aux2correct = fread(fid,1,'char'); +h.veogtrig = fread(fid,1,'float'); +h.heogtrig = fread(fid,1,'float'); +h.aux1trig = fread(fid,1,'float'); +h.aux2trig = fread(fid,1,'float'); +h.heogchnl = fread(fid,1,'short'); +h.veogchnl = fread(fid,1,'short'); +h.aux1chnl = fread(fid,1,'short'); +h.aux2chnl = fread(fid,1,'short'); +h.veogdir = fread(fid,1,'char'); +h.heogdir = fread(fid,1,'char'); +h.aux1dir = fread(fid,1,'char'); +h.aux2dir = fread(fid,1,'char'); +h.veog_n = fread(fid,1,'short'); +h.heog_n = fread(fid,1,'short'); +h.aux1_n = fread(fid,1,'short'); +h.aux2_n = fread(fid,1,'short'); +h.veogmaxcnt = fread(fid,1,'short'); +h.heogmaxcnt = fread(fid,1,'short'); +h.aux1maxcnt = fread(fid,1,'short'); +h.aux2maxcnt = fread(fid,1,'short'); +h.veogmethod = fread(fid,1,'char'); +h.heogmethod = fread(fid,1,'char'); +h.aux1method = fread(fid,1,'char'); +h.aux2method = fread(fid,1,'char'); +h.ampsensitivity = fread(fid,1,'float'); +h.lowpass = fread(fid,1,'char'); +h.highpass = fread(fid,1,'char'); +h.notch = fread(fid,1,'char'); +h.autoclipadd = fread(fid,1,'char'); +h.baseline = fread(fid,1,'char'); +h.offstart = fread(fid,1,'float'); +h.offstop = fread(fid,1,'float'); +h.reject = fread(fid,1,'char'); +h.rejstart = fread(fid,1,'float'); +h.rejstop = fread(fid,1,'float'); +h.rejmin = fread(fid,1,'float'); +h.rejmax = fread(fid,1,'float'); +h.trigtype = fread(fid,1,'char'); +h.trigval = fread(fid,1,'float'); +h.trigchnl = fread(fid,1,'char'); +h.trigmask = fread(fid,1,'short'); +h.trigisi = fread(fid,1,'float'); +h.trigmin = fread(fid,1,'float'); +h.trigmax = fread(fid,1,'float'); +h.trigdir = fread(fid,1,'char'); +h.autoscale = fread(fid,1,'char'); +h.n2 = fread(fid,1,'short'); +h.dir = fread(fid,1,'char'); +h.dispmin = fread(fid,1,'float'); +h.dispmax = fread(fid,1,'float'); +h.xmin = fread(fid,1,'float'); +h.xmax = fread(fid,1,'float'); +h.automin = fread(fid,1,'float'); +h.automax = fread(fid,1,'float'); +h.zmin = fread(fid,1,'float'); +h.zmax = fread(fid,1,'float'); +h.lowcut = fread(fid,1,'float'); +h.highcut = fread(fid,1,'float'); +h.common = fread(fid,1,'char'); +h.savemode = fread(fid,1,'char'); +h.manmode = fread(fid,1,'char'); +h.ref = fread(fid,10,'char'); +h.rectify = fread(fid,1,'char'); +h.displayxmin = fread(fid,1,'float'); +h.displayxmax = fread(fid,1,'float'); +h.phase = fread(fid,1,'char'); +h.screen = fread(fid,16,'char'); +h.calmode = fread(fid,1,'short'); +h.calmethod = fread(fid,1,'short'); +h.calupdate = fread(fid,1,'short'); +h.calbaseline = fread(fid,1,'short'); +h.calsweeps = fread(fid,1,'short'); +h.calattenuator = fread(fid,1,'float'); +h.calpulsevolt = fread(fid,1,'float'); +h.calpulsestart = fread(fid,1,'float'); +h.calpulsestop = fread(fid,1,'float'); +h.calfreq = fread(fid,1,'float'); +h.taskfile = fread(fid,34,'char'); +h.seqfile = fread(fid,34,'char'); +h.spectmethod = fread(fid,1,'char'); +h.spectscaling = fread(fid,1,'char'); +h.spectwindow = fread(fid,1,'char'); +h.spectwinlength = fread(fid,1,'float'); +h.spectorder = fread(fid,1,'char'); +h.notchfilter = fread(fid,1,'char'); +h.headgain = fread(fid,1,'short'); +h.additionalfiles = fread(fid,1,'int'); +h.unused = fread(fid,5,'char'); +h.fspstopmethod = fread(fid,1,'short'); +h.fspstopmode = fread(fid,1,'short'); +h.fspfvalue = fread(fid,1,'float'); +h.fsppoint = fread(fid,1,'short'); +h.fspblocksize = fread(fid,1,'short'); +h.fspp1 = fread(fid,1,'ushort'); +h.fspp2 = fread(fid,1,'ushort'); +h.fspalpha = fread(fid,1,'float'); +h.fspnoise = fread(fid,1,'float'); +h.fspv1 = fread(fid,1,'short'); +h.montage = fread(fid,40,'char'); +h.eventfile = fread(fid,40,'char'); +h.fratio = fread(fid,1,'float'); +h.minor_rev = fread(fid,1,'char'); +h.eegupdate = fread(fid,1,'short'); +h.compressed = fread(fid,1,'char'); +h.xscale = fread(fid,1,'float'); +h.yscale = fread(fid,1,'float'); +h.xsize = fread(fid,1,'float'); +h.ysize = fread(fid,1,'float'); +h.acmode = fread(fid,1,'char'); +h.commonchnl = fread(fid,1,'uchar'); +h.xtics = fread(fid,1,'char'); +h.xrange = fread(fid,1,'char'); +h.ytics = fread(fid,1,'char'); +h.yrange = fread(fid,1,'char'); +h.xscalevalue = fread(fid,1,'float'); +h.xscaleinterval = fread(fid,1,'float'); +h.yscalevalue = fread(fid,1,'float'); +h.yscaleinterval = fread(fid,1,'float'); +h.scaletoolx1 = fread(fid,1,'float'); +h.scaletooly1 = fread(fid,1,'float'); +h.scaletoolx2 = fread(fid,1,'float'); +h.scaletooly2 = fread(fid,1,'float'); +h.port = fread(fid,1,'short'); +h.numsamples = fread(fid,1,'ulong'); +h.filterflag = fread(fid,1,'char'); +h.lowcutoff = fread(fid,1,'float'); +h.lowpoles = fread(fid,1,'short'); +h.highcutoff = fread(fid,1,'float'); +h.highpoles = fread(fid,1,'short'); +h.filtertype = fread(fid,1,'char'); +h.filterdomain = fread(fid,1,'char'); +h.snrflag = fread(fid,1,'char'); +h.coherenceflag = fread(fid,1,'char'); +h.continuoustype = fread(fid,1,'char'); +h.eventtablepos = fread(fid,1,'ulong'); +h.continuousseconds = fread(fid,1,'float'); +h.channeloffset = fread(fid,1,'long'); +h.autocorrectflag = fread(fid,1,'char'); +h.dcthreshold = fread(fid,1,'uchar'); + +for n = 1:h.nchannels + e(n).lab = deblank(char(fread(fid,10,'char')')); + e(n).reference = fread(fid,1,'char'); + e(n).skip = fread(fid,1,'char'); + e(n).reject = fread(fid,1,'char'); + e(n).display = fread(fid,1,'char'); + e(n).bad = fread(fid,1,'char'); + e(n).n = fread(fid,1,'ushort'); + e(n).avg_reference = fread(fid,1,'char'); + e(n).clipadd = fread(fid,1,'char'); + e(n).x_coord = fread(fid,1,'float'); + e(n).y_coord = fread(fid,1,'float'); + e(n).veog_wt = fread(fid,1,'float'); + e(n).veog_std = fread(fid,1,'float'); + e(n).snr = fread(fid,1,'float'); + e(n).heog_wt = fread(fid,1,'float'); + e(n).heog_std = fread(fid,1,'float'); + e(n).baseline = fread(fid,1,'short'); + e(n).filtered = fread(fid,1,'char'); + e(n).fsp = fread(fid,1,'char'); + e(n).aux1_wt = fread(fid,1,'float'); + e(n).aux1_std = fread(fid,1,'float'); + e(n).senstivity = fread(fid,1,'float'); + e(n).gain = fread(fid,1,'char'); + e(n).hipass = fread(fid,1,'char'); + e(n).lopass = fread(fid,1,'char'); + e(n).page = fread(fid,1,'uchar'); + e(n).size = fread(fid,1,'uchar'); + e(n).impedance = fread(fid,1,'uchar'); + e(n).physicalchnl = fread(fid,1,'uchar'); + e(n).rectify = fread(fid,1,'char'); + e(n).calib = fread(fid,1,'float'); +end + +% finding if 32-bits of 16-bits file +% ---------------------------------- +begdata = ftell(fid); +if strcmpi(r.dataformat, 'auto') + + % Chris Bishop 14/01/15 + % Auto detection relies on a single byte of data that is not written + % with writecnt.m. Consequently, a CNT file read in using loadcnt and + % written using writecnt cannot automatically detect data precision. + % However, we can use other, more robust information to achieve this. + % + % 14/02/19 CWB: + % Actually, this information may not be reliable for some file types + % (e.g., those supplied by Arno D. for testing purposes). A try catch + % is probably the safest bet with an additional safeguard. + + % If two bytes (16 bit) or 4 bytes (32 bit). If we can't tell, throw an + % error. + try + % This approach relies on sensible headers. CWB has used this on + % many 32-bit datasets from SCAN 4.5, but earlier versions and + % testing 16-bit testing materials seem to have non-sensicle + % headers. So this won't work every time. + + % DataPointsPerChannel + dppc=(h.eventtablepos-begdata)./h.nchannels; + + if dppc/2==h.numsamples + r.dataformat='int16'; + elseif dppc/4==h.numsamples + r.dataformat='int32'; + else + error('loadcnt:AutoDetectionFailure', 'loadcnt failed to automatically detect data precision'); + end % if dppc./2 ... + catch + % original code commented out by CWB + r.dataformat = 'int16'; + if (h.nextfile > 0) + + % Grab informative byte that tells us if this is 32 or 16 bit + % data. Note, however, that this is *not* available in files + % generated from writecnt.m. Thus, the try statement above is + % necessary. + fseek(fid,h.nextfile+52,'bof'); + is32bit = fread(fid,1,'char'); + + if (is32bit == 1) + r.dataformat = 'int32'; + end; + + fseek(fid,begdata,'bof'); + end; % if (h.nextfile)>0 + end % try/catch +end; % if strcmpi ... + +enddata = h.eventtablepos; % after data +if strcmpi(r.dataformat, 'int16') + nums = floor((enddata-begdata)/h.nchannels/2); % floor due to bug 1254 +else nums = floor((enddata-begdata)/h.nchannels/4); +end; + +% number of sample to read +% ------------------------ +if ~isempty(r.sample1) + r.t1 = r.sample1/h.rate; +else + r.sample1 = r.t1*h.rate; +end; +if strcmpi(r.dataformat, 'int16') + startpos = r.t1*h.rate*2*h.nchannels; +else startpos = r.t1*h.rate*4*h.nchannels; +end; +if isempty(r.ldnsamples) + if ~isempty(r.lddur) + r.ldnsamples = round(r.lddur*h.rate); + else r.ldnsamples = nums; + end; +end; + +%% CWB SAMPLE NUMBER CHECK +% Verifies that the number of samples we'll load later does not exceed +% the total number of available data samples. CWB ran across this error +% when he accidentally entered a total sample number larger than the +% total number of available data points. +% +% This throws a shoe with 16-bit data. +if r.ldnsamples-r.sample1 > h.numsamples-r.sample1 && strcmpi(r.dataformat, 'int32') + tldnsamples=r.ldnsamples; + r.ldnsamples=h.numsamples-r.sample1; + warning('loadcnt:SampleError', ['User requested ' num2str(tldnsamples) ' loaded beginning at sample ' num2str(r.sample1) '.\n' ... + 'Too few samples in data (' num2str(h.numsamples-r.sample1) '). Loaded samples adjusted to ' num2str(r.ldnsamples) '.']); + clear tldnsamples; +end % r.ldnsamples-r.sample1 ... + +% channel offset +% -------------- +if ~isempty(r.blockread) + h.channeloffset = r.blockread; +end; +if h.channeloffset > 1 + fprintf('WARNING: reading data in blocks of %d, if this fails, try using option "''blockread'', 1"\n', ... + h.channeloffset); +end; + +% disp('Reading data .....') +if type == 'cnt' + + % while (ftell(fid) +1 < h.eventtablepos) + %d(:,i)=fread(fid,h.nchannels,'int16'); + %end + fseek(fid, startpos, 0); + % **** This marks the beginning of the code modified for reading + % large .cnt files + + % Switched to r.memmapfile for continuity. Check to see if the + % variable exists. If it does, then the user has indicated the + % file is too large to be processed in memory. If the variable + % is blank, the file is processed in memory. + if (~isempty(r.memmapfile)) + % open a file for writing + foutid = fopen(r.memmapfile, 'w') ; + + % This portion of the routine reads in a section of the EEG file + % and then writes it out to the harddisk. + samples_left = h.nchannels * r.ldnsamples ; + + % the size of the data block to be read is limited to 4M + % samples. This equates to 16MB and 32MB of memory for + % 16 and 32 bit files, respectively. + data_block = 4000000 ; +% max_rows = data_block / h.nchannels ; + max_rows=floor(data_block / h.nchannels ); % bug 1539 + + %warning off ; + max_written = h.nchannels * uint32(max_rows) ; + %warning on ; + + % This while look tracks the remaining samples. The + % data is processed in chunks rather than put into + % memory whole. + while (samples_left > 0) + + % Check to see if the remaining data is smaller than + % the general processing block by looking at the + % remaining number of rows. + to_read = max_rows ; + if (data_block > samples_left) + to_read = samples_left / h.nchannels ; + end ; + + % Read data in a relatively small chunk + temp_dat = fread(fid, [h.nchannels to_read], r.dataformat) ; + + % The data is then scaled using the original routine. + % In the original routine, the entire data set was scaled + % after being read in. For this version, scaling occurs + % after every chunk is read. + if strcmpi(r.scale, 'on') + disp('Scaling data .....') + %%% scaling to microvolts + for i=1:h.nchannels + bas=e(i).baseline;sen=e(i).senstivity;cal=e(i).calib; + mf=sen*(cal/204.8); + temp_dat(i,:)=(temp_dat(i,:)-bas).*mf; + end + end + + % Write out data in float32 form to the file name + % supplied by the user. + written = fwrite (foutid, temp_dat, 'float32') ; + + if (written ~= max_written) + samples_left = 0 ; + else + samples_left = samples_left - written ; + end ; + + end ; + + fclose (foutid) ; + % Set the dat variable. This gets used later by other + % EEGLAB functions. + dat = r.memmapfile ; + + % This variable tracks how the data should be read. + bReadIntoMemory = false ; + else + % The memmapfile variable is empty, read into memory. + bReadIntoMemory = true ; + end + + % This ends the modifications made to read large files. + % Everything contained within the following if statement is the + % original code. + if (bReadIntoMemory == true) + if h.channeloffset <= 1 + %% CWB: + % EEGLAB first loads the whole file and then truncates + % based on a few criteria. However, this does not work + % well with large datasets that simply CANNOT be loaded + % into memory. Modifying this section to just load in the + % appropriate section of data. + + dat=fread(fid, [h.nchannels r.ldnsamples], r.dataformat); + + %% CONVERT TO PROPER DATA PRECISION + % Change to single precision if necessary. Or double if + % the data type is not already a double. + if strcmpi(r.precision, 'single') + dat=single(dat); + elseif strcmpi(r.precision, 'double') && ~isa(dat, 'double') + dat=double(dat); + end % if strcmpi + + % original code + % CWB commented this out. +% dat=fread(fid, [h.nchannels Inf], r.dataformat); +% if size(dat,2) < r.ldnsamples +% dat=single(dat); +% r.ldnsamples = size(dat,2); +% else +% dat=single(dat(:,1:r.ldnsamples)); +% end; + else + warning('CWB has not tested this section of code, so use with caution'); + h.channeloffset = h.channeloffset/2; + % reading data in blocks + dat = zeros( h.nchannels, r.ldnsamples, 'single'); + dat(:, 1:h.channeloffset) = fread(fid, [h.channeloffset h.nchannels], r.dataformat)'; + + counter = 1; + while counter*h.channeloffset < r.ldnsamples + dat(:, counter*h.channeloffset+1:counter*h.channeloffset+h.channeloffset) = ... + fread(fid, [h.channeloffset h.nchannels], r.dataformat)'; + counter = counter + 1; + end; + end ; + + % ftell(fid) + if strcmpi(r.scale, 'on') +% disp('Scaling data .....') + %%% scaling to microvolts + for i=1:h.nchannels + bas=e(i).baseline;sen=e(i).senstivity;cal=e(i).calib; + mf=sen*(cal/204.8); + dat(i,:)=(dat(i,:)-bas).*mf; + end % end for i=1:h.nchannels + end; % end if (strcmpi(r.scale, 'on') + end ; + + ET_offset = (double(h.prevfile) * (2^32)) + double(h.eventtablepos); % prevfile contains high order bits of event table offset, eventtablepos contains the low order bits + fseek(fid, ET_offset, 'bof'); + +% disp('Reading Event Table...') + eT.teeg = fread(fid,1,'uchar'); + eT.size = fread(fid,1,'ulong'); + eT.offset = fread(fid,1,'ulong'); + + if eT.teeg==2 + nevents=eT.size/sizeEvent2; + if nevents > 0 + ev2(nevents).stimtype = []; + for i=1:nevents + ev2(i).stimtype = fread(fid,1,'ushort'); + ev2(i).keyboard = fread(fid,1,'char'); + temp = fread(fid,1,'uint8'); + ev2(i).keypad_accept = bitand(15,temp); + ev2(i).accept_ev1 = bitshift(temp,-4); + ev2(i).offset = fread(fid,1,'long'); + ev2(i).type = fread(fid,1,'short'); + ev2(i).code = fread(fid,1,'short'); + ev2(i).latency = fread(fid,1,'float'); + ev2(i).epochevent = fread(fid,1,'char'); + ev2(i).accept = fread(fid,1,'char'); + ev2(i).accuracy = fread(fid,1,'char'); + end + else + ev2 = []; + end; + elseif eT.teeg==3 % type 3 is similar to type 2 except the offset field encodes the global sample frame + nevents=eT.size/sizeEvent3; + if nevents > 0 + ev2(nevents).stimtype = []; + if r.dataformat == 'int32' + bytes_per_samp = 4; % I only have 32 bit data, unable to check whether this is necessary, + else % perhaps there is no type 3 file with 16 bit data + bytes_per_samp = 2; + end + for i=1:nevents + ev2(i).stimtype = fread(fid,1,'ushort'); + ev2(i).keyboard = fread(fid,1,'char'); + temp = fread(fid,1,'uint8'); + ev2(i).keypad_accept = bitand(15,temp); + ev2(i).accept_ev1 = bitshift(temp,-4); + os = fread(fid,1,'ulong'); + ev2(i).offset = os * bytes_per_samp * h.nchannels; + ev2(i).type = fread(fid,1,'short'); + ev2(i).code = fread(fid,1,'short'); + ev2(i).latency = fread(fid,1,'float'); + ev2(i).epochevent = fread(fid,1,'char'); + ev2(i).accept = fread(fid,1,'char'); + ev2(i).accuracy = fread(fid,1,'char'); + end + else + ev2 = []; + end; + elseif eT.teeg==1 + nevents=eT.size/sizeEvent1; + if nevents > 0 + ev2(nevents).stimtype = []; + for i=1:nevents + ev2(i).stimtype = fread(fid,1,'ushort'); + ev2(i).keyboard = fread(fid,1,'char'); + +% modified by Andreas Widmann 2005/05/12 14:15:00 + %ev2(i).keypad_accept = fread(fid,1,'char'); + temp = fread(fid,1,'uint8'); + ev2(i).keypad_accept = bitand(15,temp); + ev2(i).accept_ev1 = bitshift(temp,-4); +% end modification + + ev2(i).offset = fread(fid,1,'long'); + end; + else + ev2 = []; + end; + else + disp('Skipping event table (tag != 1,2,3 ; theoritically impossible)'); + ev2 = []; + end + +%% AT h.nextfile here. +% There's additional information at the end of this that needs to be +% written to file using writecnt in order to figure out what the +% precision is (32 or 16 bit) when reading in the file again. +% +% With modified auto precision detection above, this is no longer +% necessary. +% f.junk=fread(fid); +% f.junk=f.junk(1:end-1); % exclude the tag + +%% SAVE DATAFORMAT +% Potentially useful when writing data later, otherwise things have to be +% hardcoded. +f.dataformat=r.dataformat; + +%% GET ENDTAG +fseek(fid, -1, 'eof'); +t = fread(fid,'char'); + +f.header = h; +f.electloc = e; +f.data = dat; +f.Teeg = eT; +f.event = ev2; +f.tag=t; +% Surgical addition of number of samples +f.ldnsamples = r.ldnsamples ; + +%%%% channels labels +for i=1:h.nchannels + plab=sprintf('%c',f.electloc(i).lab); + if i>1 + lab=str2mat(lab,plab); + else + lab=plab; + end +end + +%%%% to change offest in bytes to points +if ~isempty(ev2) + if r.sample1 ~= 0 + warning('Events imported with a time shift might be innacurate'); +% fprintf(2,'Warning: events imported with a time shift might be innacurate\n'); + end; + ev2p=ev2; + ioff=900+(h.nchannels*75); %% initial offset : header + electordes desc + if strcmpi(r.dataformat, 'int16') + for i=1:nevents + ev2p(i).offset=(ev2p(i).offset-ioff)/(2*h.nchannels) - r.sample1; %% 2 short int end + end + else % 32 bits + for i=1:nevents + ev2p(i).offset=(ev2p(i).offset-ioff)/(4*h.nchannels) - r.sample1; %% 4 short int end + end + end; + f.event = ev2p; +end; + +frewind(fid); +fclose(fid); + +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/loaddat.m b/code/eeglab13_4_4b/functions/sigprocfunc/loaddat.m new file mode 100644 index 0000000..b7f62b0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/loaddat.m @@ -0,0 +1,82 @@ +% loaddat() - loading neuroscan format data file into matlab. +% +% Usage: +% >> [typeeeg, rt, response, n] = loaddat( filename ); +% +% Inputs: +% filename - input Neuroscan .dat file +% +% Outputs: +% typeeeg - type of the sweeps +% rt - reaction time of the subject +% response - response of the subject +% n - number of sweeps +% +% See also: loadeeg() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [tmptypeeeg, tmprt, tmpresponseeeg, n] = loaddat( FILENAME) + +if nargin<1 + fprintf('Not enought arguments\n'); + help loaddat + return; +end; + +BOOL='int16'; +ULONG='int32'; +FLOAT='float32'; + +fid=fopen(FILENAME,'r','ieee-le'); +if fid<0 + fprintf(2,['Error LOADEEG: File ' FILENAME ' not found\n']); + return; +end; + +% skip the first 20 lines +% ----------------------- +for index=1:20 fgetl(fid); end; + +% read the matrix +% --------------- +tmpMat = fscanf(fid, '%f', [5, inf]); +tmptypeeeg = tmpMat(3,:); +tmpresponseeeg = tmpMat(4,:); +tmprt = tmpMat(5,:); +n = size( tmpMat, 2); + +fclose(fid); +return; + + + + + + + + + + + + + + + + + + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/loadeeg.m b/code/eeglab13_4_4b/functions/sigprocfunc/loadeeg.m new file mode 100644 index 0000000..64b3fb3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/loadeeg.m @@ -0,0 +1,273 @@ +% loadeeg() - load a binary data file in Neuroscan .eeg file format. +% +% Usage: +% >> signal = loadeeg(filename); +% >> [signal, accept, typeeeg, rt, response, chan_names, pnts, ... +% ntrials, srate, xmin, xmax] = loadeeg( filename, chanlist, ... +% triallist, typerange, accepttype, rtrange, responsetype); +% +% Inputs: +% filename - [string] Input Neuroscan .eeg file +% chanlist - [integer array] Only import selected channels +% Ex: [3,4:10] {default: 'all'} +% triallist - [integer array] Only import selected trials {default: import all} +% typerange - [integer array] Only import trials of selected type +% {default: import all} +% accepttype - [integer array] Only import trials with the selected +% 'accept' field values {default: import all} +% rtrange - [float array] [min max] (ms) Only import trials with subject +% reaction times in this range {default: import all} +% responsetype - [integer array] Only import trials with selected +% response type values {default: import all} +% format - ['short'|'int32'|'auto'] data format. Neuroscan v4.3+ assume 32-bit data +% while older versions assume 16-bit. {default: 'auto' = Determine} +% +% Outputs: +% signal - Output signal of size (trials, points) +% accept - [1/0] vector of values for the accept field (one per trial) +% typeeeg - [Integer] values for the accept type (size 1,trials) +% rt - [float] values for the accept rt (size trials) +% response - [Integer] values for the accept response (size 1,trials) +% chan_names - ['string' array] channel names +% pnts - Number of time points per trial +% ntrials - Number of trials +% srate - Sampling rate (Hz) +% xmin - Trial start latency (ms) +% xmax - Trial end latency (ms) +% +% Example: +% % Load .eeg data into an array named 'signal' +% >> [signal]=loadeeg( 'test.eeg' ); +% % Plot the signal in the first channel, first trial +% >> plot( signal(1,:) ); +% +% Author: Arnaud Delorme, CNL, Salk Institute, 2001 +% +% See also: pop_loadeeg(), eeglab() + +% .eeg binary file format +% data are organised into an array of Number_of_electrode x (Number_of_points_per_trial*Number_of_sweeps) +% for a file with 32 electrodes, 700 points per trial and 300 sweeps, the resulting array is +% of 32 collumn and 700*300 rows (300 consecutive blocs of 700 points) + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [signal, accept, typeeeg, rt, response, chan_names, pnts, ... + nsweeps, rate, xmin, xmax]=loadeeg( FILENAME, chanlist, ... + TrialList, typerange, acceptype, rtrange, responsetype, format) +if nargin<1 + fprintf('Not enought arguments\n'); + help loadeeg + return; +end; +if nargin<2 chanlist='all'; end; +if nargin<3 TrialList='all'; end; +if nargin<4 typerange='all'; end; +if nargin<5 acceptype='all'; end; +if nargin<6 rtrange ='all'; end; +if nargin<7 responsetype='all'; end; +if nargin<8 format='auto'; end; +format = lower(format); + +if ~strcmpi(format, 'short') && ~strcmpi(format, 'int32') && ~strcmpi(format, 'auto'), error('loadeeg: format error'); end; + +% open file for reading +% --------------------- +fid=fopen(FILENAME,'r','ieee-le'); +if fid<0 + fprintf('Error LOADEEG: File %s not found\n', FILENAME); + return; +end; + +% determine the actual file format if auto is requested +%------------------------------------------------------ +if strcmpi(format, 'auto') + format = 'short'; + fseek(fid,12,'bof'); + nextfile = fread(fid,1,'long'); + if (nextfile > 0) + fseek(fid,nextfile+52,'bof'); + is32bit = fread(fid,1,'char'); + if (is32bit == 1) + format = 'int32' + end; + end; + frewind(fid); +end; + +% read general part of the erp header and set variables +% ----------------------------------------------------- +rev = char(fread(fid, 20, 'uchar'))'; % revision number +erp = fread(fid, 342, 'uchar'); % skip the firsts 362 from BOF (368 bytes in orginal comment?) +nsweeps = fread(fid, 1, 'ushort'); % number of sweeps +erp = fread(fid, 4, 'uchar'); % skip 4 bytes +pnts= fread(fid, 1, 'ushort'); % number of point per waveform +chan= fread(fid, 1, 'ushort'); % number of channels +erp = fread(fid, 4, 'uchar'); % skip 4 bytes +rate= fread(fid, 1, 'ushort'); % sample rate (Hz) +erp = fread(fid, 127, 'uchar'); % skip 127 bytes +xmin= fread(fid, 1, 'float32'); % in s +xmax= fread(fid, 1, 'float32'); % in s +erp = fread(fid, 387, 'uchar'); % skip 387 bytes + +fprintf('number of channels : %d\n', chan); +fprintf('number of points per trial : %d\n', pnts); +fprintf('sampling rate (Hz) : %f\n', rate); +fprintf('xmin (s) : %f\n', xmin); +fprintf('xmax (s) : %f\n', xmax); + +% read electrode configuration +% ---------------------------- +fprintf('Electrode configuration\n'); +for elec = 1:chan + channel_label_tmp = fread(fid, 10, 'uchar'); + chan_names(elec,:) = channel_label_tmp'; + for index = 2:9 if chan_names(elec,index) == 0 chan_names(elec,index)=' '; end; end; + erp = fread(fid, 47-10, 'uchar'); + baseline(elec) = fread(fid, 1, 'ushort'); + erp = fread(fid, 10, 'uchar'); + sensitivity(elec) = fread(fid, 1, 'float32'); + erp = fread(fid, 8, 'uchar'); + calib(elec) = fread(fid, 1, 'float32'); + fprintf('%s: baseline: %d\tsensitivity: %f\tcalibration: %f\n', ... + char(chan_names(elec,1:4)), baseline(elec), sensitivity(elec), calib(elec)); + factor(elec) = calib(elec) * sensitivity(elec) / 204.8; +end; +%fprintf('Electrode configuration\n'); +%for elec = 1:chan +% erp = fread(fid, 47, 'uchar'); +% baseline(elec) = fread(fid, 1, 'ushort'); +% erp = fread(fid, 10, 'uchar'); +% sensitivity(elec) = fread(fid, 1, 'float32'); +% erp = fread(fid, 8, 'uchar'); +% calib(elec) = fread(fid, 1, 'float32'); +% fprintf('baseline: %d\tsensitivity: %f\tcalibration: %f\n', baseline(elec), sensitivity(elec), calib(elec)); +% factor(elec) = calib(elec) * sensitivity(elec) / 204.8; +%end; + +xsize = chan * pnts; +buf_size = chan * pnts ; % size in shorts + +% set tags for conditions +% ----------------------- +if isstr(chanlist) && strcmpi(chanlist, 'all'), chanlist = [1:chan]; end; +if isstr(TrialList) && strcmpi(TrialList, 'all'), trialtagI = 1; else trialtagI = 0; end; +if isstr(acceptype) && strcmpi(acceptype, 'all'), acceptagI = 1; else acceptagI = 0; end; +if isstr(typerange) && strcmpi(typerange, 'all'), typetagI = 1; else typetagI = 0; end; +if isstr(responsetype) && strcmpi(responsetype, 'all'), responsetagI = 1; else responsetagI = 0; end; +if isstr(rtrange) && strcmpi(rtrange, 'all'), rttagI = 1; else rttagI = 0; end; + +count_selected = 1; +fprintf('Reserving array (can take some time)\n'); +if isstr(TrialList) + signal = zeros( chan, pnts*nsweeps); +else + signal = zeros( chan, pnts*length(TrialList)); +end; +fprintf('Array reserved, scanning file\n'); + +for sweep = 1:nsweeps + + % read sweeps header + % ------------------ + s_accept = fread(fid, 1, 'uchar'); + s_type = fread(fid, 1, 'ushort'); + s_correct = fread(fid, 1, 'ushort'); + s_rt = fread(fid, 1, 'float32'); + s_response = fread(fid, 1, 'ushort'); + s_reserved = fread(fid, 1, 'ushort'); + + unreaded_buf = 1; + + % store the sweep or reject the sweep + % ----------------------------------- + if trialtagI trialtag = 1; else trialtag = ismember_bc(sweep, TrialList); end; + if acceptagI acceptag = 1; else acceptag = ismember(s_accept, acceptype); end; + if typetagI typetag = 1; else typetag = ismember(s_type, typerange); end; + if responsetagI responsetag = 1; else responsetag = ismember_bc(s_response, responsetype); end; + if rttagI rttag = 1; else rttag = ismember(s_rt, rtrange); end; + + if typetag + if trialtag + if acceptag + if responsetag + if rttag + + buf = fread(fid, [chan pnts], format); + unreaded_buf = 0; + + % copy information to array + % ------------------------- + accept(count_selected) = s_accept; + typeeeg(count_selected) = s_type; + rt(count_selected) = s_rt; + response(count_selected) = s_response; + + % demultiplex the data buffer and convert to microvolts + % ----------------------------------------------------- + for elec = 1:chan + buf(elec, :) = (buf(elec, :)-baseline(elec)-0.0)*factor(elec); + end; + try + signal(:,[((count_selected-1)*pnts+1):count_selected*pnts]) = buf; + count_selected = count_selected + 1; + if not(mod(count_selected,10)) fprintf('%d sweeps selected out of %d\n', count_selected-1, sweep); end; + catch, + disp('Warning: File truncated, aborting file read.'); + count_selected = count_selected + 1; + break; + end; + end; + end; + end; + end; + end; + + if unreaded_buf + if strcmpi(format, 'short'), fseek(fid, buf_size*2, 'cof'); + else fseek(fid, buf_size*4, 'cof'); + end; + end; +end; +nsweeps = count_selected-1; +fclose(fid); + +% restrincting array +% --------------------------------------- +fprintf('rereservation of variables\n'); +signal = signal(chanlist, 1:(count_selected-1)*pnts); +chan_names = chan_names(chanlist,:); + +return; + + + + + + + + + + + + + + + + + + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/loadtxt.m b/code/eeglab13_4_4b/functions/sigprocfunc/loadtxt.m new file mode 100644 index 0000000..54be7c2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/loadtxt.m @@ -0,0 +1,166 @@ +% loadtxt() - load ascii text file into numeric or cell arrays +% +% Usage: +% >> array = loadtxt( filename, 'key', 'val' ...); +% +% Inputs: +% filename - name of the input file +% +% Optional inputs +% 'skipline' - number of lines to skip {default:0}. If this number is +% negative the program will only skip non-empty lines +% (can be usefull for files transmitted from one platform +% to an other, as CR may be inserted at every lines). +% 'convert' - 'on' standard text conversion, see note 1 +% 'off' no conversion, considers text only +% 'force' force conversion, NaN are returned +% for non-numeric inputs {default:'on'} +% 'delim' - ascii character for delimiters. {default:[9 32] +% i.e space and tab}. It is also possible to enter +% strings, Ex: [9 ' ' ',']. +% 'blankcell' - ['on'|'off'] extract blank cells {default:'on'} +% 'verbose' - ['on'|'off'] {default:'on'} +% 'convertmethod' - ['str2double'|'str2num'] default is 'str2double' +% 'nlines' - [integer] number of lines to read {default: all file} +% +% Outputs: +% array - cell array. If the option 'force' is given, the function +% retrun a numeric array. +% +% Notes: 1) Since it uses cell arrays, the function can handle text input. +% The function reads each token and then try to convert it to a +% number. If the conversion is unsucessfull, the string itself +% is included in the array. +% 2) The function adds empty entries for rows that contains +% fewer columns than others. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 29 March 2002 + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 29 March 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function array = loadtxt( filename, varargin ); + +if nargin < 1 + help loadtxt; + return; +end; +if ~isempty(varargin) + try, g = struct(varargin{:}); + catch, disp('Wrong syntax in function arguments'); return; end; +else + g = []; +end; + +g = finputcheck( varargin, { 'convert' 'string' { 'on';'off';'force' } 'on'; + 'skipline' 'integer' [0 Inf] 0; + 'verbose' 'string' { 'on';'off' } 'on'; + 'uniformdelim' 'string' { 'on';'off' } 'off'; + 'blankcell' 'string' { 'on';'off' } 'on'; + 'convertmethod' 'string' { 'str2double';'str2num' } 'str2double'; + 'delim' { 'integer';'string' } [] [9 32]; + 'nlines' 'integer' [] Inf }); +if isstr(g), error(g); end; +if strcmpi(g.blankcell, 'off'), g.uniformdelim = 'on'; end; +g.convert = lower(g.convert); +g.verbose = lower(g.verbose); +g.delim = char(g.delim); + +% open the file +% ------------- +if exist(filename) ~=2, error( ['file ' filename ' not found'] ); end; +fid=fopen(filename,'r','ieee-le'); +if fid<0, error( ['file ' filename ' found but error while opening file'] ); end; + +index = 0; +while index < abs(g.skipline) + tmpline = fgetl(fid); + if g.skipline > 0 | ~isempty(tmpline) + index = index + 1; + end; +end; % skip lines --------- + +inputline = fgetl(fid); +linenb = 1; +if strcmp(g.verbose, 'on'), fprintf('Reading file (lines): '); end; +while isempty(inputline) | inputline~=-1 + colnb = 1; + if ~isempty(inputline) + tabFirstpos = 1; + + % convert all delimiter to the first one + if strcmpi(g.uniformdelim, 'on') + for index = 2:length(g.delim) + inputline(find(inputline == g.delim(index))) = g.delim(1); + end; + end; + + while ~isempty(deblank(inputline)) + if strcmpi(g.blankcell,'off'), inputline = strtrim(inputline); end; + if tabFirstpos && length(inputline) > 1 && all(inputline(1) ~= g.delim), tabFirstpos = 0; end; + [tmp inputline tabFirstpos] = mystrtok(inputline, g.delim, tabFirstpos); + switch g.convert + case 'off', array{linenb, colnb} = tmp; + case 'on', + if strcmpi(g.convertmethod, 'str2double') + tmp2 = str2double(tmp); + if isnan( tmp2 ) , array{linenb, colnb} = tmp; + else array{linenb, colnb} = tmp2; + end; + else + tmp2 = str2num(tmp); + if isempty( tmp2 ) , array{linenb, colnb} = tmp; + else array{linenb, colnb} = tmp2; + end; + end; + case 'force', array{linenb, colnb} = str2double(tmp); + end; + colnb = colnb+1; + end; + linenb = linenb +1; + end; + inputline = fgetl(fid); + if linenb > g.nlines + inputline = -1; + end; + if ~mod(linenb,10) & strcmp(g.verbose, 'on'), fprintf('%d ', linenb); end; +end; +if strcmp(g.verbose, 'on'), fprintf('%d\n', linenb-1); end; +if strcmp(g.convert, 'force'), array = [ array{:} ]; end; +fclose(fid); + +% problem strtok do not consider tabulation +% ----------------------------------------- +function [str, strout, tabFirstpos] = mystrtok(strin, delim, tabFirstpos); + % remove extra spaces at the beginning + while any(strin(1) == delim) && strin(1) ~= 9 && strin(1) ~= ',' + strin = strin(2:end); + end; + % for tab and coma, consider empty cells + if length(strin) > 1 && any(strin(1) == delim) + if tabFirstpos || any(strin(2) == delim) + str = ''; + strout = strin(2:end); + if strin(2) ~= 9 && strin(2) ~= ',' + tabFirstpos = 0; + strout = strtrim(strout); + end; + else + [str, strout] = strtok(strin, delim); + end; + else + [str, strout] = strtok(strin, delim); + end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/lookupchantemplate.m b/code/eeglab13_4_4b/functions/sigprocfunc/lookupchantemplate.m new file mode 100644 index 0000000..c6ad0b6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/lookupchantemplate.m @@ -0,0 +1,37 @@ +% lookupchantemplate - look up channel template. +% +% Usage: +% [ found transform ] = lookupchantemplate( filename, template_struct); +% +% Inputs: +% filename - channel location file name +% template_struct - template strcuture as defined in dipfitdefs +% +% Outputs: +% found - [0|1] 1 if a transformation was found for this template +% transform - [array] tranditional tailairach transformation +% +% Author: Arnaud Delorme, SCCN, INC, 2007 + +function [allkeywordstrue, transform] = lookupchantemplate(chanfile, tmpl); + +if nargin < 2 + help lookupchantemplate; + return; +end; + +allkeywordstrue = 0; +transform = []; +for ind = 1:length(tmpl) + allkeywordstrue = 1; + if isempty(tmpl(ind).keywords), allkeywordstrue = 0; end; + for k = 1:length(tmpl(ind).keywords) + if isempty(findstr(lower(chanfile), lower(tmpl(ind).keywords{k}))), allkeywordstrue = 0; end; + end; + if allkeywordstrue, + transform = tmpl(ind).transform; + break; + end; +end; + + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/matsel.m b/code/eeglab13_4_4b/functions/sigprocfunc/matsel.m new file mode 100644 index 0000000..6bed03d --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/matsel.m @@ -0,0 +1,132 @@ +% matsel() - select rows, columns, and epochs from given multi-epoch data matrix +% +% Usage: +% >> [dataout] = matsel(data,frames,framelist); +% >> [dataout] = matsel(data,frames,framelist,chanlist); +% >> [dataout] = matsel(data,frames,framelist,chanlist,epochlist); +% +% Inputs: +% data - input data matrix (chans,frames*epochs) +% frames - frames (data columns) per epoch (0 -> frames*epochs) +% framelist - list of frames per epoch to select (0 -> 1:frames) +% chanlist - list of chans to select (0 -> 1:chans) +% epochlist - list of epochs to select (0 -> 1:epochs) +% +% Note: The size of dataout is (length(chanlist), length(framelist)*length(epochlist)) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 5-21-96 + +% Copyright (C) 5-21-96 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 5-25-96 added chanlist, epochlist -sm +% 10-05-97 added out of bounds tests for chanlist and framelist -sm +% 02-04-00 truncate to epochs*frames if necessary -sm +% 01-25-02 reformated help & license -ad + +function [dataout] = matsel(data,frames,framelist,chanlist,epochlist) + +if nargin<1 + help matsel + return +end + +[chans framestot] = size(data); +if isempty(data) + fprintf('matsel(): empty data matrix!?\n') + help matsel + return +end + +if nargin < 5, + epochlist = 0; +end +if nargin < 4, + chanlist = 0; +end +if nargin < 3, + fprintf('matsel(): needs at least 3 arguments.\n\n'); + return +end + +if frames == 0, + frames = framestot; +end + +if framelist == 0, + framelist = [1:frames]; +end + +framesout = length(framelist); + +if isempty(chanlist) | chanlist == 0, + chanlist = [1:chans]; +end + +chansout = length(chanlist); +epochs = floor(framestot/frames); + +if epochs*frames ~= framestot + fprintf('matsel(): data length %d was not a multiple of %d frames.\n',... + framestot,frames); + data = data(:,1:epochs*frames); +end + +if isempty(epochlist) | epochlist == 0, + epochlist = [1:epochs]; +end +epochsout = length(epochlist); + +if max(epochlist)>epochs + fprintf('matsel() error: max index in epochlist (%d) > epochs in data (%d)\n',... + max(epochlist),epochs); + return +end + +if max(framelist)>frames + fprintf('matsel() error: max index in framelist (%d) > frames per epoch (%d)\n',... + max(framelist),frames); + return +end + +if min(framelist)<1 + fprintf('matsel() error: framelist min (%d) < 1\n', min(framelist)); + return +end + +if min(epochlist)<1 + fprintf('matsel() error: epochlist min (%d) < 1\n', min(epochlist)); + return +end + +if max(chanlist)>chans + fprintf('matsel() error: chanlist max (%d) > chans (%d)\n',... + max(chanlist),chans); + return +end + +if min(chanlist)<1 + fprintf('matsel() error: chanlist min (%d) <1\n',... + min(chanlist)); + return +end + +dataout = zeros(chansout,framesout*epochsout); +for e=1:epochsout + dataout(:,framesout*(e-1)+1:framesout*e) = ... + data(chanlist,framelist+(epochlist(e)-1)*frames); +end + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/mattocell.m b/code/eeglab13_4_4b/functions/sigprocfunc/mattocell.m new file mode 100644 index 0000000..bfbd8ba --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/mattocell.m @@ -0,0 +1,42 @@ +% mattocell() - convert matrix to cell array +% +% Usage: >> C = mattocell( M ); +% +% Author: Arnaud Delorme, CNL / Salk Institute, Jan 25 2002 +% +% Note: this function overload the nnet toolbox function mattocell, +% but does not have all its capacities. You can delete the current +% function if you have the toolbox. + +% Copyright (C) Jan 25 2002 Arnaud Delorme, CNL / Salk Institute +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function C = mattocell( M, varargin ); + +if nargin < 1 + help mattocell; + return; +end; +if isempty(M) + C = []; + return; +end; +C = cell(size(M)); +for i=1:size(M,1) + for j=1:size(M,2) + C{i,j} = M(i,j); + end; +end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/metaplottopo.m b/code/eeglab13_4_4b/functions/sigprocfunc/metaplottopo.m new file mode 100644 index 0000000..3ab2aae --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/metaplottopo.m @@ -0,0 +1,348 @@ +% metaplottopo() - plot concatenated multichannel data epochs in a topographic or +% rectangular array. Uses a channel location file with the same +% format as topoplot(), or else plots data on a rectangular grid. +% +% Usage: +% >> axes = metaplottopo(data, 'key1', 'val1', 'key2', 'val2') +% +% Inputs: +% data = data consisting of consecutive epochs of (chans,frames) +% or (chans,frames,n) +% +% Optional inputs: +% 'chanlocs' = [struct] channel structure or file plot ERPs at channel +% locations. See help readlocs() for data channel format. +% 'geom' = [rows cols] plot ERP in grid (overwrite previous option). +% Grid size for rectangular matrix. Example: [6 4]. +% 'title' = [string] general plot title {def|'' -> none} +% 'chans' = vector of channel numbers to plot {def|0 -> all} +% 'axsize' = [x y] axis size {default [.07 .07]} +% 'plotfunc' = [string] plot function name. If none is entered, axes +% are created and returned. +% 'plotargs' = [cell] plotting function arguments. +% 'datapos' = [integer] position of data array in the function call. +% Default is 1. +% +% Output: +% Axes = [real] array of axes handles of the same length as the +% number of plotted channels. +% Channames = [cell] cell array of channel name for each plot +% +% Author: Arnaud Delorme, Scott Makeig, CERCO, CNRS, 2007- +% +% See also: plottopo() + +% Copyright (C) 2007, Arnaud Delorme, CERCO, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [Axes, outchannames ]= metaplottopo(data, varargin); + +% +%%%%%%%%%%%%%%%%%%%%% Graphics Settings - can be customized %%%%%%%%%%%%%%%%%% +% +LINEWIDTH = 0.7; % data line widths (can be non-integer) +FONTSIZE = 10; % font size to use for labels +CHANFONTSIZE = 7; % font size to use for channel names +TICKFONTSIZE = 8; % font size to use for axis labels +TITLEFONTSIZE = 12; % font size to use for the plot title +PLOT_WIDTH = 0.95; % 0.75, width and height of plot array on figure +PLOT_HEIGHT = 0.88; % 0.88 +gcapos = get(gca,'Position'); axis off; +PLOT_WIDTH = gcapos(3)*PLOT_WIDTH; % width and height of gca plot array on gca +PLOT_HEIGHT = gcapos(4)*PLOT_HEIGHT; +MAXCHANS = 256; % can be increased +curfig = gcf; % learn the current graphic figure number +% +%%%%%%%%%%%%%%%%%%%% Default settings - use commandline to override %%%%%%%%%%% +% +DEFAULT_AXWIDTH = 0.05; % +DEFAULT_AXHEIGHT = 0.08; % +DEFAULT_SIGN = -1; % Default - plot positive-up +ISRECT = 0; % default +ISSPEC = 0; % Default - not spectral data + +outchannames = {}; +if nargin < 1 + help metaplottopo + return +end + +if iscell(data), nchans = size(data{1},1); +else nchans = size(data,1); +end; +g = finputcheck(varargin, { 'chanlocs' '' [] ''; + 'chans' 'integer' [1 size(data,1)] [1:nchans]; + 'geom' 'integer' [1 Inf] []; + 'title' 'string' [] ''; + 'plotfunc' 'string' [] ''; + 'plotargs' 'cell' [] {}; + 'datapos' 'integer' [] 1; + 'calbar' 'real' [] []; + 'axcopycom' 'string' [] ''; + 'axsize' 'float' [0 1] [nan nan]}, 'metaplottopo' ); +if isstr(g), error(g); end; +if length(g.chans) == 1 & g.chans(1) ~= 0, error('can not plot a single ERP'); end; + +[chans,framestotal]=size(data); % data size + +% +%%%%%%%%%%%%%%% Substitute defaults for missing parameters %%%%%%%%%%%%%%%% +% + +if (isempty(g.chanlocs) || ~isfield(g.chanlocs, 'theta')) && isempty(g.geom) + n = ceil(sqrt(length(g.chans))); + g.geom = [n n]; +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% Test parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +axwidth = g.axsize(1); +axheight = g.axsize(2); +if ~isempty(g.geom) + if isnan(axheight) % if not specified + axheight = gcapos(4)/(g.geom(1)+1); + axwidth = gcapos(3)/(g.geom(2)+1); + end +else + axheight = DEFAULT_AXHEIGHT*(gcapos(4)*1.25); + axwidth = DEFAULT_AXWIDTH*(gcapos(3)*1.3); +end +fprintf('Plotting data using axis size [%g,%g]\n',axwidth,axheight); + +% +%%%%%%%%%%%%% Extend the size of the plotting area in the window %%%%%%%%%%%% +% +curfig = gcf; +h=figure(curfig); +set(h,'PaperUnits','normalized'); % use percentages to avoid US/A4 difference +set(h,'PaperPosition',[0.0235308 0.0272775 0.894169 0.909249]); % equivalent +orient portrait +axis('normal'); + +axcolor= get(0,'DefaultAxesXcolor'); % find what the default x-axis color is +vertcolor = 'k'; +horicolor = vertcolor; + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot and label specified channels %%%%%%%%%%%%%%%%%% +% + +if ~isempty(data) + if iscell(data) + data{1} = data{1}(g.chans,:); + data{2} = data{2}(g.chans,:); + else + data = data(g.chans,:); + end; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Print plot info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +figure(curfig); h=gca;title(g.title); % title plot +hold on +axis('off') + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% Read chan_locs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if isempty(g.chanlocs) || ~isfield(g.chanlocs, 'theta') % plot in a rectangular grid + ISRECT = 1; + ht = g.geom(1); + wd = g.geom(2); + if length(g.chans) > ht*wd + fprintf('metaplottopo(): (%d) channels to be plotted > grid size [%d %d]\n',... + length(g.chans),ht,wd); + return + end + halfht = (ht-1)/2; + halfwd = (wd-1)/2; + xvals = zeros(ht*wd,1); + yvals = zeros(ht*wd,1); + dist = zeros(ht*wd,1); + for j=1:ht + for i=1:wd + xvals(i+(j-1)*wd) = -halfwd+(i-1); + yvals(i+(j-1)*wd) = halfht-(j-1); + % dist(i+(j-1)*wd) = sqrt(xvals(j+(i-1)*ht).^2+yvals(j+(i-1)*ht).^2); + end + end + % maxdist = max(dist); + maxxvals = max(xvals); + maxyvals = max(yvals); + for j=1:ht + for i=1:wd + xvals(i+(j-1)*wd) = 0.499*xvals(i+(j-1)*wd)/maxxvals; + yvals(i+(j-1)*wd) = 0.499*yvals(i+(j-1)*wd)/maxyvals; + end + end + if ~exist('channames') + channames = repmat(' ',ht*wd,4); + for i=1:ht*wd + channum = num2str(i); + channames(i,1:length(channum)) = channum; + end + end + +else % read chan_locs file + % read the channel location file + % ------------------------------ + if isstruct(g.chanlocs) + nonemptychans = cellfun('isempty', { g.chanlocs.theta }); + nonemptychans = find(~nonemptychans); + [tmp channames Th Rd] = readlocs(g.chanlocs(nonemptychans)); + channames = strvcat({ g.chanlocs.labels }); + else + [tmp channames Th Rd] = readlocs(g.chanlocs); + channames = strvcat(channames); + nonemptychans = [1:length(channames)]; + end; + Th = pi/180*Th; % convert degrees to radians + Rd = Rd; + + if length(g.chans) > length(g.chanlocs), + error('metaplottopo(): data channels must be <= ''chanlocs'' channels') + end + + [yvalstmp,xvalstmp] = pol2cart(Th,Rd); % translate from polar to cart. coordinates + xvals(nonemptychans) = xvalstmp; + yvals(nonemptychans) = yvalstmp; + + % find position for other channels + % -------------------------------- + totalchans = length(g.chanlocs); + emptychans = setdiff_bc(1:totalchans, nonemptychans); + totalchans = floor(sqrt(totalchans))+1; + for index = 1:length(emptychans) + xvals(emptychans(index)) = 0.7+0.2*floor((index-1)/totalchans); + yvals(emptychans(index)) = -0.4+mod(index-1,totalchans)/totalchans; + end; + channames = channames(g.chans,:); + xvals = xvals(g.chans); + yvals = yvals(g.chans); +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% xvals = 0.5+PLOT_WIDTH*xvals; % controls width of plot array on page! +% yvals = 0.5+PLOT_HEIGHT*yvals; % controls height of plot array on page! +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if length(xvals) > 1 + xvals = (xvals-mean([max(xvals) min(xvals)]))/(max(xvals)-min(xvals)); % recenter + xvals = gcapos(1)+gcapos(3)/2+PLOT_WIDTH*xvals; % controls width of plot + % array on current axes +end; +yvals = gcapos(2)+gcapos(4)/2+PLOT_HEIGHT*yvals; % controls height of plot +% array on current axes +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot traces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +Axes = []; +fprintf('Plotting all channel...'); +for c=1:length(g.chans), %%%%%%%% for each data channel %%%%%%%%%%%%%%%%%%%%%%%%%% + + xcenter = xvals(c); if isnan(xcenter), xcenter = 0.5; end; + ycenter = yvals(c); if isnan(ycenter), ycenter = 0.5; end; + Axes = [Axes axes('Units','Normal','Position', ... + [xcenter-axwidth/2 ycenter-axheight/2 axwidth axheight])]; + hold on; + axis('off'); + %axes('Units','Normal','Position', [xcenter-axwidth/2 ycenter-axheight/2 axwidth axheight]) + %axis('off'); + + % + %%%%%%%%%%%%%%%%%%%%%%% Plot data traces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if ~isempty( g.plotfunc ) + %figure(curfig); + eval( [ 'func = @' g.plotfunc ';' ] ); + if iscell(data), tmp = { g.plotargs{1:g.datapos(1)-1} data{1}(c,:) g.plotargs{g.datapos(1):g.datapos(2)-1} data{2}(c,:) g.plotargs{g.datapos(2):end}}; + else tmp = { g.plotargs{1:g.datapos-1} data(c,:) g.plotargs{g.datapos:end} }; + end; + tmp = { tmp{:} 'title' channames(c,:) 'plotmode' 'topo'}; + feval(func, tmp{:}); + end; + outchannames{c} = deblank(channames(c,:)); +end; % c, chans / subplot + +fprintf('\n'); + +% +%%%%%%%%%%%%%%%%%%%%% Make time and amp cal bar %%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isempty(g.calbar) + ax = axes('Units','Normal','Position', [0.85 0.1 axwidth axheight]); % FIX!!!! + axes(ax) + axis('off'); + if g.calbar(3) < g.calbar(4), g.ydir = 1; + else g.calbar(5) = g.calbar(3); g.calbar(3) = []; g.ydir = -1; + end; + [xmin xmax ymin ymax] = deal(g.calbar(1), g.calbar(2),g.calbar(3), g.calbar(4)); + figure(curfig);p=plot([0 0],[ymin ymax],'color','k'); % draw vert axis at zero + if g.ydir == -1 + set(gca, 'ydir', 'reverse'); + end; + hold on + figure(curfig);p=plot([xmin xmax],[0 0],'color','k'); % draw horizontal axis + xlim([xmin xmax]); + ylim([ymin ymax]); + axis off; + + % draw text limits + % ---------------- + xdiff = xmax - xmin; + ydiff = ymax - ymin; + signx = xmin-0.15*xdiff; + figure(curfig);axis('off');h=text(double(signx),double(ymin),num2str(ymin,3)); % text ymin + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','right','Clipping','off'); + + figure(curfig);axis('off');h=text(double(signx), double(ymax),['+' num2str(ymax,3)]); % text +ymax + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','right','Clipping','off'); + + ytick = g.ydir*(-ymax-0.3*ydiff); + figure(curfig);tick = [int2str(xmin)]; h=text(double(xmin),double(ytick),tick); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + tick = 'Time (ms)'; figure(curfig);h=text(double(xmin+xdiff/2),double(ytick-0.5*g.ydir*ydiff),tick); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + tick = [int2str(xmax)]; figure(curfig);h=text(double(xmax),double(ytick),tick); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + +end; + +% 'set(gcbf, ''''unit'''', ''''pixel'''');' ... +% 'tmp = get(gcbf, ''''position'''');' ... +% 'tmp2 = get(0, ''''screensize'''');' ... +% 'if tmp(2)+500 > tmp2(4), tmp(2) = tmp2(4)-500; end;' ... +% 'set(gcbf, ''''position'''', [ tmp(1) tmp(2) 560 420]);' ... +g.axcopycom = [ 'axis on;' ... + 'tmp = get(gca, ''''userdata'''');' ... + 'if ~isempty(tmp), xlabel(tmp{1});' ... + 'ylabel(tmp{2});' ... + 'legend(tmp{3}{:}); end; clear tmp tmp2;' ]; +axcopy(gcf, g.axcopycom); % turn on popup feature +icadefs; +set(gca,'Color',BACKCOLOR); % set the background color diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/movav.m b/code/eeglab13_4_4b/functions/sigprocfunc/movav.m new file mode 100644 index 0000000..137ba01 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/movav.m @@ -0,0 +1,269 @@ +% movav() - Perform a moving average of data indexed by xvals. +% Supports use of a moving non-rectangular window. +% Can be used to resample a data matrix to any size +% (see xadv NOTE below) and to regularize sampling of +% irregularly sampled data. +% Usage: +% >> [outdata,outx] = movav(data,xvals,xwidth,xadv,firstx,lastx,xwin,nonorm); +% +% Input: +% data = input data (chans,frames) +% +% Optional inputs: +% xvals = increasing x-values for data frames (columnsa). The default +% [1:frames] is fastest {def|[]|0 -> 1:frames} +% xwidth = smoothing-window width in xvals units {def|0->(hix-lox)/4} +% xadv = window step size in xvals units. NOTE: To reduce yyy frames +% to about xxx, xadv needs to be near yyy/xxx {default|0 -> 1} +% firstx = low xval of first averaging window {def|[] -> min xvals} +% lastx = high xval of last averaging window {def|[] -> max xvals} +% xwin = vector of window values {def|0 -> ones() = square window} +% May be long. NOTE: linear interp. is NOT used between values. +% Example: gauss(1001,2) -> [0.018 ... 1.0 ... 0.018] +% nonorm = [1|0] If non-zero, do not normalize the moving sum. If +% all y values are 1s. this creates a moving histogram. +% Ex: >> [oy,ox] = movav(ones(size(x)),x,xwd,xadv,[],[],0,1); +% returns a moving histogram of xvals {default: 0} +% Outputs: +% outdata = smoothed output data (chans,outframes) +% outx = xval midpoints of successive output windows +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 10-25-97 + +% Copyright (C) 10-25-97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-20-98 fixed bug in multi-channel windowed averaging -sm +% 6-10-98 changed mean() and sum() to nanmean() and nansum() -sm +% 2-16-99 tested for stat toolbox functions nanmean() and nansum() -sm +% 9-03-01 fixed gauss() example -sm +% 01-25-02 reformated help & licenses -ad + +function [outdata,outx] = movav(data,xvals,xwidth,xadv,firstx,lastx,xwin,nonorm) + +MAXPRINT = 1; % max outframe numbers to print on tty +NEARZERO = 1e-22; % +DEFAULT_XADV = 1; % default xvals window step advance +verbose = 0; % If 1, output process info + +nanexist = 0; +if nargin<1 + help movav + return +else + [chans,frames]=size(data); +end +if chans>1 & frames == 1, + data = data'; % make row vector + tmp = chans; + chans = frames; + frames = tmp; +end +if frames < 4 + error('data are too short'); + return +end + +flag_fastave = 0; +if nargin<2 | isempty(xvals) | (numel(xvals)==1 & xvals == 0) + xvals = 1:frames; % flag default xvals + flag_fastave = 0; % TURNED OFF THIS FEATURE - LEADS TO ?? BUG AT ABOUT 287 +end % -sm 3/6/07 +if size(xvals,1)>1 & size(xvals,2)>1 + error('xvals must be a vector'); +end +xvals = xvals(:)'; % make xvals a row vector + +if frames ~= length(xvals) + error('lengths of xvals and data not equal'); +end + +if nargin < 8 | isempty(nonorm) + nonorm = 0; % default -> return moving mean +end +if abs(nonorm) > NEARZERO + nonorm = 1; +end + +if nargin < 7 | isempty(xwin) + xwin = 0; +end + +if nargin < 6 | isempty(lastx) + lastx = []; +end +if isempty(lastx), + if flag_fastave + lastx = frames; + else + lastx = max(xvals); + end +end + +if nargin<5 | isempty(firstx) + firstx = []; +end +if isempty(firstx), + if flag_fastave + firstx = 1; + else + firstx = min(xvals); + end +end + +if nargin<4 | isempty(xadv) + xadv = 0; +end +if isempty(xadv) | xadv == 0, + xadv = DEFAULT_XADV; +end + +if nargin<3 | isempty(xwidth) | xwidth==0 + xwidth = (lastx-firstx)/4; % DEFAULT XWIDTH +end + +wlen = 1; % default; +if flag_fastave==0 + if length(xwin)==1 & (xwin~=0) & (xwin~=1), % should be a vector or 0 + error('xwin not vector or 0'); + elseif size(xwin,1)>1 & size(xwin,2)>1 % not a matrix + error('xwin cannot be a matrix'); + end + if size(xwin,1)>1 + xwin = xwin'; % make row vector + end + + if xwin~=0 + wlen = length(xwin); + end +end + +%outframes = floor(0.99999+((lastx-firstx+xadv)-xwidth)/xadv); +outframes = floor(((lastx-firstx+xadv+1)-xwidth)/xadv); +if verbose + fprintf('movav() will output %d frames.\n',outframes); +end +if outframes < 1, + outframes = 1; +end +outdata = zeros(chans,outframes); +outx = zeros(1,outframes); +outxval = firstx+xwidth/2; +% +%%%%%%%%%%%%%%%%%%%%%% Print header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Performing moving averaging:\n') + fprintf('Output will be %d chans by %d frames',chans,outframes); + if wlen>1, + fprintf(' using the specified width-%d window\n',wlen); + else + fprintf(' using a width-%d square window\n',xwidth); + end + fprintf(' and a window advance of %g\n',xadv); +end +% +%%%%%%%%%%%%%%%%%%% Perform averaging %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +lox = firstx; +i = 0; % flag_fastave default +for f=1:outframes + hix = lox+xwidth; + outx(1,f)=outxval; + outxval = outxval + xadv; + if flag_fastave == 0 + i = find(xvals>=lox & xvals < hix); + end + if length(i)==0, + if f>1, + outdata(:,f) = outdata(:,f-1); % If no data, replicate + else + outdata(:,f) = zeros(chans,1); % or else output zeros + end + elseif length(xwin)==1, + if flag_fastave > 0 + outdata(:,f) = nan_mean(data(:,round(lox):round(hix))')'; + nix = length([round(lox):round(hix)]); + else + outdata(:,f) = nan_mean(data(:,i)')'; % Else average + nix = length(i); + end + if nonorm & nix % undo division by number of elements summed + outdata(:,f) = outdata(:,f)*nix; + end +% +%%%%%%%%%%%%%%%%% Windowed averaging %%%%%%%%%%%%%%%%%%%%%%%%%%% +% + else % length(xwin) > 1 + wadv=(hix-lox)/wlen; + ix = floor((xvals(i)-lox)/wadv)+1; % AG fix 3/6/07 + if length(xwin)>1 + sumx = sum(xwin(ix)); + else + sumx=1; + end + + % AG fix 3/6/7 + outdata(:,f) = nan_sum((((ones(chans,1)*xwin(ix)).*data(:,i)))')'; + if abs(sumx) > NEARZERO & nonorm == 0 + outdata(:,f) = outdata(:,f)/sumx; + end + end + lox = lox+xadv; + if (outframes> moveaxes +% >> moveaxes(fig) +% >> moveaxes off +% +% Note: clicking the left mouse button selects an axis +% dragging the left mouse button resizes a selected axis +% dragging the right mouse button copies a selected axis +% clicking the middle mouse button deselects a selected axis +% +% Authors: Colin Humphries & Scott Makeig, CNL / Salk Institute, La Jolla + +% Copyright (C) Colin Humphries & Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function moveaxes(fig) + +if nargin<1 + fig = gcf; +end + +if ~isstr(fig) + tmp = findobj('tag','moveaxes'); + if ~isempty(tmp) % turn off previous moveaxes Tags + ax = get(tmp,'children'); + set(ax,'ButtonDownFcn','','Selected','Off'); + set(tmp,'Tag','','UserData',[]); + end + + ax = findobj('parent',fig,'type','axes'); + for a=1:length(ax) % make all axes visible + axvis = get(ax(a),'visible'); + set(ax(a),'visible','on','UserData',axvis); + end + + set(ax,'ButtonDownFcn','selectmoveresize'); + set(fig,'UserData',ax,'Tag','moveaxes'); + +elseif strcmp(fig,'off') + fig=findobj('Tag','moveaxes'); + ax = get(fig,'UserData'); + for a=1:length(ax) % reset original axis visibility + axvis= get(ax(a),'UserData') + set(ax(a),'visible',axvis); + end + set(ax,'ButtonDownFcn','','Selected','off'); + set(fig,'Tag','','UserData',[]); +end + + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/mri3dplot.m b/code/eeglab13_4_4b/functions/sigprocfunc/mri3dplot.m new file mode 100644 index 0000000..41ff3a8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/mri3dplot.m @@ -0,0 +1,430 @@ +% mri3dplot() - plot 3-D density image translucently on top of the mean MR +% brain image used in dipplot(). Plot brain slices in directions +% 'top' (axial), or 'side' (sagittal), or 'rear' (coronal). +% Creates a new figure(). Smoothing uses Matlab smooth3() +% Usage: +% >> [smoothed_3ddens, mriplanes] = mri3dplot(array3d, mri, 'key', 'val', ...); +% +% Input: +% array3d - 3-D array to plot translucently on top of MRI image planes +% (e.g., as returned by dipoledensity(), unit: dipoles/cc). +% mri - [string or struct] base MR image structure (as returned by +% dipoledensity.m or mri file (matlab format or file format read +% by fcdc_read_mri. See dipplot.m help for more information. +% +% Optional inputs: +% 'mriview' - ['top'|'side'|rear'] MR image slices to plot. 'axial', +% 'coronal', and 'saggital' are also recognized keywords +% {default|[]: 'top'|'axial'}. May also be a cell array +% of such keyword (one per slice). +% 'mrislices' - [real vector] MR slice plotting coordinates in 'mriview' +% direction {default|[]: -50 to +50 in steps of 11 mm} +% 'kernel' - 3-D smoothing ht, width, & depth in voxels {default|0: none} +% > 0 -> uses gaussian kernel of std. dev. 0.65 voxels) +% 'geom' - [rows, cols] geometry of slice array in figure output +% {default: smallest enclosing near-square array} +% 'rotate' - [0|90|180|270 deg] 2-D slice image rotation {default: 90} +% 'cmap' - [float array] colormap for plotting the 3-D array +% {default: 'hot'} +% 'cmax' - [float] color palette max value {default: array3d max} +% 'cmin' - [float] color palette min value {default: 0} +% 'cbar' - ['on'|'off'] plot colorbar. Default is 'on'. +% 'subplot' - ['on'|'off'] for single slice only, plot within a sub-plot +% panel. If 'on', this automatically sets 'cbar' to 'off'. +% Default is 'off'. +% 'plotintersect' - ['on'|'off'] plot intersection between plotted slices. +% Default is 'on'. +% 'mixfact' - [float] factor for mixing the background image with the +% array3d information. Default is 0.5. +% 'mixmode' - ['add'|'overwrite'] 'add' will allow for trasnparency +% while 'overwrite' will preserve the orginal MRI image +% and overwrite the pixel showind density changes. +% +% Outputs: +% smoothed_3ddens - the plotted (optionally smoothed) 3-D density matrix +% mriplanes - cell array of the plotted MR image slices +% +% Author: Arnaud Delorme & Scott Makeig, SCCN, 10 June 2003 +% +% Example: +% dipfitdefs; +% load('-mat', template_models(1).mrifile); % load mri variable +% array = gauss3d(91,109,91); +% mri3dplot(array, mri); +% +% See also: plotmri() + +% Copyright (C) Arnaud Delorme, sccn, INC, UCSD, 2003- +% 03/29/2013 Makoto. Line 370 added to avoid negative matrix indices. +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [smoothprob3d, mriplanes] = mri3dplot(prob3d, mri, varargin) + + % REDUCEPATCH Reduce number of patch faces. + + if nargin < 1 + help mri3dplot; + return; + end; + + DEFAULT_SPACING = 11; % default MR slice interval (in mm) + translucency = 0.5; % default alpha value + mri_lim = 85; % +/- axis limits of MNI head image + + g = finputcheck( varargin, { 'mriview' { 'string','cell' } { { 'sagital','axial','coronal','top','side','rear' } {} } 'top'; + 'mixmode' 'string' { 'add','overwrite','min' } 'add'; + 'mrislices' 'float' [] []; + 'view' 'float' [] []; + 'geom' 'float' [] []; + 'cmap' 'float' [] jet(64); + 'cmax' 'float' [] []; + 'mixfact' 'float' [] 0.5; + 'cmin' 'float' [] 0; + 'plotintersect' 'string' { 'on','off' } 'on'; + 'cbar' 'string' { 'on','off' } 'on'; + 'subplot' 'string' { 'on','off' } 'off'; + 'rotate' 'integer' { 0,90,180,270 } 90; + 'kernel' 'float' [] 0; + 'addrow' 'integer' [] 0; + 'fighandle' 'integer' [] []}); + if isstr(g), error(g); end; + if isstr(g.mriview) == 1, g.plotintersect = 'off'; end; + if strcmpi(g.mriview,'sagittal'), g.mriview = 'side'; + elseif strcmpi(g.mriview,'axial'), g.mriview = 'top'; + elseif strcmpi(g.mriview,'coronal'), g.mriview = 'rear'; + end; + if strcmpi(g.subplot, 'on') % plot colorbar + g.cbar = 'off'; + end; + if isstr(mri) + try, + mri = load('-mat', mri); + mri = mri.mri; + catch, + disp('Failed to read Matlab file. Attempt to read MRI file using function read_fcdc_mri'); + try, + warning off; + mri = read_fcdc_mri(mri); + mri.anatomy = round(gammacorrection( mri.anatomy, 0.8)); + mri.anatomy = uint8(round(mri.anatomy/max(reshape(mri.anatomy, prod(mri.dim),1))*255)); + % WARNING: if using double instead of int8, the scaling is different + % [-128 to 128 and 0 is not good] + % WARNING: the transform matrix is not 1, 1, 1 on the diagonal, some slices may be + % misplaced + warning on; + catch, + error('Cannot load file using read_fcdc_mri'); + end; + end; + end; + + % normalize prob3d for 1 to ncolors and create 3-D dim + % ---------------------------------------------------- + if ~iscell(prob3d), prob3d = { prob3d }; end; + if length(prob3d) > 1 + if isempty(g.cmax), g.cmax = max(max(prob3d{1}(:)),max(prob3d{2}(:))); end; + [newprob3d{1}] = prepare_dens(prob3d{1}, g, 'abscolor'); + [newprob3d{2}] = prepare_dens(prob3d{2}, g, 'abscolor'); + else + if isempty(g.cmax), g.cmax = max(prob3d{1}(:)); end; + [newprob3d{1} maxdens1] = prepare_dens(prob3d{1}, g, 'usecmap'); + end; + fprintf('Brightest color denotes a density of: %1.6f (presumed unit: dipoles/cc)\n', g.cmax); + + % plot MRI slices + % --------------- + if isempty(g.mrislices), + g.mrislices = linspace(-50, 50, DEFAULT_SPACING); + end; + + if strcmpi(g.cbar, 'on'), add1 = 1; else add1 = 0; end; + if isempty(g.geom), + g.geom = ceil(sqrt(length(g.mrislices)+add1)); + g.geom(2) = ceil((length(g.mrislices)+add1)/g.geom)+g.addrow; + end; + + if strcmpi(g.subplot, 'off') + if isempty(g.fighandle) + fig = figure; + else + fig = g.fighandle; + clf(fig); + end + + pos = get(fig, 'position'); + set(fig, 'position', [ pos(1)+15 pos(2)+15 pos(3)/4*g.geom(1) pos(4)/3*g.geom(2) ]); + end; + + disp('Plotting...'); + + % custom view for each slice + if ~iscell( g.mriview ) + g.mriview = { g.mriview }; + g.mriview(2:length( g.mrislices )) = g.mriview(1); + end; + + newprob3dori = newprob3d; + for index = 1:length( g.mrislices ) %%%%%%% for each plotted MR image slice %%%%%%%% + + % plot intersection between plotted slices + % ---------------------------------------- + newprob3d = newprob3dori; + if strcmpi(g.plotintersect, 'on') + for index2 = setdiff_bc(1:length( g.mrislices ), index) + switch g.mriview{index2} + case 'side', coord = [ g.mrislices(index2) 0 0 1 ]; + case 'top' , coord = [ 0 0 g.mrislices(index2) 1 ]; + case 'rear', coord = [ 0 g.mrislices(index2) 0 1 ]; + end; + coord = round( pinv(mri.transform)*coord' )'; + for i = 1:length(newprob3d) + switch g.mriview{index2} + case 'side', newprob3d{i}( coord(1), :, :, :) = 0; + case 'top' , newprob3d{i}( :, :, coord(3), :) = 0; + case 'rear', newprob3d{i}( :, coord(2), :, :) = 0; + end; + end; + end; + end; + + % create axis if necessary + % ------------------------ + if strcmpi(g.subplot, 'off') + mysubplot(g.geom(1), g.geom(2), index); % get an image slice axis + end; + + % find coordinate + % --------------- + switch g.mriview{index} + case 'side', coord = [ g.mrislices(index) 0 0 1 ]; + case 'top' , coord = [ 0 0 g.mrislices(index) 1 ]; + case 'rear', coord = [ 0 g.mrislices(index) 0 1 ]; + end; + + coord = round( pinv(mri.transform)*coord' )'; + + % get MRI slice + % ------------- + switch g.mriview{index} + case 'side', mriplot = squeeze( mri.anatomy(coord(1), :, :) ); + case 'top' , mriplot = squeeze( mri.anatomy(:, :, coord(3)) ); + case 'rear', mriplot = squeeze( mri.anatomy(:, coord(2), :) ); + end; + + mriplot(:,:,2) = mriplot(:,:,1); + mriplot(:,:,3) = mriplot(:,:,1); + mriplot = rotatemat( mriplot, g.rotate ); + + % get dipole density slice + % ------------------------ + for i = 1:length(newprob3d) + switch g.mriview{index} + case 'side', densplot{i} = squeeze( newprob3d{i}(coord(1), :, :, :) ); + case 'top' , densplot{i} = squeeze( newprob3d{i}(:, :, coord(3), :) ); + case 'rear', densplot{i} = squeeze( newprob3d{i}(:, coord(2), :, :) ); + end; + densplot{i} = rotatemat( densplot{i}, g.rotate ); + end; + + if isa(mriplot, 'uint8') + % check if densplot is in uint8 + % if not - transform to uint8 + for dlen = 1:length(densplot) + if ~isa(densplot{dlen}, 'uint8') + % check if multiply by 255 (when double + % with values ranging from 0 - 1) and + % then transform to uint8 + checkval = densplot{dlen} >= 0 & densplot{dlen} <= 1; + checkval = sum(checkval(:)) == numel(densplot{dlen}); + if checkval + densplot{dlen} = uint8(densplot{dlen} * 255); %#ok + continue + end + + % check if it's ok to transform + % straight to int8 + checkval = densplot{dlen} >= 0 & densplot{dlen} <= 255; + checkval = sum(checkval(:)) == numel(densplot); + testint = isequal(densplot{dlen}, round(densplot{dlen})); + + if checkval && testint + densplot{dlen} = uint8(densplot{dlen}); %#ok + end + + end + end + clear dlen checkval testint + end; + + if length(densplot) == 1 + densplot = densplot{1}; + if strcmpi(g.mixmode, 'add') + densplot(isnan(densplot)) = 0; % do not plot colors outside the brain, as indicated by NaNs + mriplot = mriplot*g.mixfact + densplot*(1-g.mixfact); % Mix 1/2 MR image + 1/2 density image + elseif strcmpi(g.mixmode, 'overwrite') + indsnon0 = sum(densplot(:,:,:),3) > 0; + tmpmri = mriplot(:,:,1); tmpdens = densplot(:,:,1); tmpmri(indsnon0) = tmpdens(indsnon0); mriplot(:,:,1) = tmpmri; + tmpmri = mriplot(:,:,2); tmpdens = densplot(:,:,2); tmpmri(indsnon0) = tmpdens(indsnon0); mriplot(:,:,2) = tmpmri; + tmpmri = mriplot(:,:,3); tmpdens = densplot(:,:,3); tmpmri(indsnon0) = tmpdens(indsnon0); mriplot(:,:,3) = tmpmri; + elseif strcmpi(g.mixmode, 'min') + densplot(isnan(densplot)) = 0; % do not plot colors outside the brain, as indicated by NaNs + mriplot = min(mriplot, densplot); % min + end; + clear densplot; + else + densplot{1}(isnan(densplot{1})) = 0; % do not plot colors outside the brain, as indicated by NaNs + densplot{2}(isnan(densplot{2})) = 0; % do not plot colors outside the brain, as indicated by NaNs + if strcmpi(g.mixmode, 'add') + mriplot(:,:,1) = mriplot(:,:,1)*g.mixfact + densplot{1}(:,:)*(1-g.mixfact); % min + mriplot(:,:,3) = mriplot(:,:,3)*g.mixfact + densplot{2}(:,:)*(1-g.mixfact); % min + mriplot(:,:,2) = mriplot(:,:,2)*g.mixfact; % min + elseif strcmpi(g.mixmode, 'overwrite') + indsnon01 = densplot{1}(:,:,:) > 0; + indsnon02 = densplot{2}(:,:,:) > 0; + tmpmri = mriplot(:,:,1); tmpdens = densplot{1}(:,:); tmpmri(indsnon01) = tmpdens(indsnon01); mriplot(:,:,1) = tmpmri; + tmpmri = mriplot(:,:,2); tmpdens = densplot{2}(:,:); tmpmri(indsnon02) = tmpdens(indsnon02); mriplot(:,:,2) = tmpmri; + else + mriplot(:,:,1) = max(mriplot(:,:,1), densplot{1}); % min + mriplot(:,:,2) = max(mriplot(:,:,2), densplot{2}); % min + end; + end; + mriplanes{index} = mriplot; + + imagesc(mriplot); % plot [background MR image + density image] + + axis off; hold on; + + xl = xlim; + yl = ylim; + zl = zlim; + + % options = { 'FaceColor','texturemap', 'EdgeColor','none', 'CDataMapping', ... + % 'scaled','facelighting', 'none', 'facealpha', translucency}; + % h = surface( [xl(1) xl(2); xl(1) xl(2)], [yl(1) yl(1); yl(2) yl(2)], ... + % [1 1; 1 1], densplot, options{:}); + + axis equal; + if ~isempty(g.view), view(g.view); end; + tit = title( [ int2str(g.mrislices(index)) ' mm' ]); + if strcmpi(g.subplot, 'off'), set(tit, 'color', 'w'); end; + end; + + % plot colorbar + % ------------- + if strcmpi(g.cbar, 'on') % plot colorbar + + h = mysubplot(g.geom(1), g.geom(2), length(g.mrislices)+1); + pos = get(h, 'position'); + pos(1) = pos(1)+pos(3)/3; + pos(3) = pos(3)/6; + pos(2) = pos(2)+pos(4)/5; + pos(4) = pos(4)*3/5; + axis off; + h = axes('unit', 'normalized', 'position', pos); % position the colorbar + + if strcmpi(g.mixmode, 'add') + tmpmap = g.cmap/2 + ones(size(g.cmap))/4; % restrict range to [1/4, 3/4] of cmap + else + tmpmap = g.cmap; %g.cmap/2 + ones(size(g.cmap))/4; % restrict range to [1/4, 3/4] of cmap + end; + colormap(tmpmap); + cbar(h, [1:length(g.cmap)], [g.cmin g.cmax]); + box off; + set(h, 'ycolor', [0.7 0.7 0.7]); + end; + + fprintf('\n'); + if exist('fig') == 1 + if length(prob3d) == 1 + set(fig,'color', g.cmap(1,:)/2); + else + set(fig,'color', [0.0471 0.0471 0.0471]/1.3); + end; + end; +return; + +function mat = rotatemat(mat, angle); + + if angle == 0, return; end; + if ndims(mat) == 2 + if angle >= 90, mat = rot90(mat); end; + if angle >= 180, mat = rot90(mat); end; + if angle >= 270, mat = rot90(mat); end; + else + if angle >= 90, + newmat(:,:,1) = rot90(mat(:,:,1)); + newmat(:,:,2) = rot90(mat(:,:,2)); + newmat(:,:,3) = rot90(mat(:,:,3)); + mat = newmat; + end; + if angle >= 180, + newmat(:,:,1) = rot90(mat(:,:,1)); + newmat(:,:,2) = rot90(mat(:,:,2)); + newmat(:,:,3) = rot90(mat(:,:,3)); + mat = newmat; + end; + if angle >= 270, + newmat(:,:,1) = rot90(mat(:,:,1)); + newmat(:,:,2) = rot90(mat(:,:,2)); + newmat(:,:,3) = rot90(mat(:,:,3)); + mat = newmat; + end; + end; + +function [newprob3d maxdens] = prepare_dens(prob3d, g, col); + + if g.kernel ~= 0 + disp('Smoothing...'); + smoothprob3d = smooth3(prob3d, 'gaussian', g.kernel); + prob3d = smoothprob3d; + end; + + maxdens = max(prob3d(:)); + ncolors = size(g.cmap,1); + + prob3d = round((prob3d-g.cmin)/(g.cmax - g.cmin)*(ncolors-1))+1; % project desnity image into the color space: [1:ncolors] + prob3d( find(prob3d > ncolors) ) = ncolors; + prob3d( find(prob3d < 1)) = 1; % added by Makoto + newprob3d = zeros(size(prob3d,1), size(prob3d,2), size(prob3d,3), 3); + + outOfBrainMask = find(isnan(prob3d)); % place NaNs in a mask, NaNs are assumed for points outside the brain + prob3d(outOfBrainMask) = 1; + + if strcmpi(col, 'abscolor') + newprob3d = prob3d/ncolors; + else + tmp = g.cmap(prob3d,1); newprob3d(:,:,:,1) = reshape(tmp, size(prob3d)); + tmp = g.cmap(prob3d,2); newprob3d(:,:,:,2) = reshape(tmp, size(prob3d)); + tmp = g.cmap(prob3d,3); newprob3d(:,:,:,3) = reshape(tmp, size(prob3d)); + end; + +function h = mysubplot(geom1, geom2, coord); + + coord = coord-1; + horiz_border = 0; + vert_border = 0.1; + + coordy = floor(coord/geom1); + coordx = coord - coordy*geom1; + + posx = coordx/geom1+horiz_border*1/geom1/2; + posy = 1-(coordy/geom2+vert_border*1/geom2/2)-1/geom2; + width = 1/geom1*(1-horiz_border); + height = 1/geom2*(1- vert_border); + + h = axes('unit', 'normalized', 'position', [ posx posy width height ]); + %h = axes('unit', 'normalized', 'position', [ coordx/geom1 1-coordy/geom2-1/geom2 1/geom1 1/geom2 ]); + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/nan_mean.m b/code/eeglab13_4_4b/functions/sigprocfunc/nan_mean.m new file mode 100644 index 0000000..08a0eb3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/nan_mean.m @@ -0,0 +1,43 @@ +% nan_mean() - Average, not considering NaN values +% +% Usage: same as mean() + +% Author: Arnaud Delorme, CNL / Salk Institute, 16 Oct 2002 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function out = nan_mean(in, dim) + + if nargin < 1 + help nan_mean; + return; + end; + if nargin < 2 + if size(in,1) ~= 1 + dim = 1; + elseif size(in,2) ~= 1 + dim = 2; + else + dim = 3; + end; + end; + tmpin = in; + tmpin(find(isnan(in(:)))) = 0; + denom = sum(~isnan(in),dim); + denom(find(~denom)) = nan; + out = sum(tmpin, dim) ./ denom; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/openbdf.m b/code/eeglab13_4_4b/functions/sigprocfunc/openbdf.m new file mode 100644 index 0000000..26788ca --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/openbdf.m @@ -0,0 +1,201 @@ +% openbdf() - Opens an BDF File (European Data Format for Biosignals) in MATLAB (R) +% +% Usage: +% >> EDF=openedf(FILENAME) +% +% Note: About EDF -> www.biosemi.com/faq/file_format.htm +% +% Author: Alois Schloegl, 5.Nov.1998 +% +% See also: readedf() + +% Copyright (C) 1997-1998 by Alois Schloegl +% a.schloegl@ieee.org +% Ver 2.20 18.Aug.1998 +% Ver 2.21 10.Oct.1998 +% Ver 2.30 5.Nov.1998 +% +% For use under Octave define the following function +% function s=upper(s); s=toupper(s); end; + +% V2.12 Warning for missing Header information +% V2.20 EDF.AS.* changed +% V2.30 EDF.T0 made Y2K compatible until Year 2090 + +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 2 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +% Name changed for bdf files Sept 6,2002 T.S. Lorig +% Header updated for EEGLAB format (update web link too) - Arnaud Delorme 14 Oct 2002 + +function [DAT,H1]=openbdf(FILENAME) + +SLASH='/'; % defines Seperator for Subdirectories +BSLASH=setstr(92); + +cname=computer; +if cname(1:2)=='PC' SLASH=BSLASH; end; + +fid=fopen(FILENAME,'r','ieee-le'); +if fid<0 + fprintf(2,['Error LOADEDF: File ' FILENAME ' not found\n']); + return; +end; + +EDF.FILE.FID=fid; +EDF.FILE.OPEN = 1; +EDF.FileName = FILENAME; + +PPos=min([max(find(FILENAME=='.')) length(FILENAME)+1]); +SPos=max([0 find((FILENAME=='/') | (FILENAME==BSLASH))]); +EDF.FILE.Ext = FILENAME(PPos+1:length(FILENAME)); +EDF.FILE.Name = FILENAME(SPos+1:PPos-1); +if SPos==0 + EDF.FILE.Path = pwd; +else + EDF.FILE.Path = FILENAME(1:SPos-1); +end; +EDF.FileName = [EDF.FILE.Path SLASH EDF.FILE.Name '.' EDF.FILE.Ext]; + +H1=setstr(fread(EDF.FILE.FID,256,'char')'); % +EDF.VERSION=H1(1:8); % 8 Byte Versionsnummer +%if 0 fprintf(2,'LOADEDF: WARNING Version EDF Format %i',ver); end; +EDF.PID = deblank(H1(9:88)); % 80 Byte local patient identification +EDF.RID = deblank(H1(89:168)); % 80 Byte local recording identification +%EDF.H.StartDate = H1(169:176); % 8 Byte +%EDF.H.StartTime = H1(177:184); % 8 Byte +EDF.T0=[str2num(H1(168+[7 8])) str2num(H1(168+[4 5])) str2num(H1(168+[1 2])) str2num(H1(168+[9 10])) str2num(H1(168+[12 13])) str2num(H1(168+[15 16])) ]; + +% Y2K compatibility until year 2090 +if EDF.VERSION(1)=='0' + if EDF.T0(1) < 91 + EDF.T0(1)=2000+EDF.T0(1); + else + EDF.T0(1)=1900+EDF.T0(1); + end; +else ; + % in a future version, this is hopefully not needed +end; + +EDF.HeadLen = str2num(H1(185:192)); % 8 Byte Length of Header +% reserved = H1(193:236); % 44 Byte +EDF.NRec = str2num(H1(237:244)); % 8 Byte # of data records +EDF.Dur = str2num(H1(245:252)); % 8 Byte # duration of data record in sec +EDF.NS = str2num(H1(253:256)); % 8 Byte # of signals + +EDF.Label = setstr(fread(EDF.FILE.FID,[16,EDF.NS],'char')'); +EDF.Transducer = setstr(fread(EDF.FILE.FID,[80,EDF.NS],'char')'); +EDF.PhysDim = setstr(fread(EDF.FILE.FID,[8,EDF.NS],'char')'); + +EDF.PhysMin= str2num(setstr(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); +EDF.PhysMax= str2num(setstr(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); +EDF.DigMin = str2num(setstr(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); % +EDF.DigMax = str2num(setstr(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); % + +% check validity of DigMin and DigMax +if (length(EDF.DigMin) ~= EDF.NS) + fprintf(2,'Warning OPENEDF: Failing Digital Minimum\n'); + EDF.DigMin = -(2^15)*ones(EDF.NS,1); +end +if (length(EDF.DigMax) ~= EDF.NS) + fprintf(2,'Warning OPENEDF: Failing Digital Maximum\n'); + EDF.DigMax = (2^15-1)*ones(EDF.NS,1); +end +if (any(EDF.DigMin >= EDF.DigMax)) + fprintf(2,'Warning OPENEDF: Digital Minimum larger than Maximum\n'); +end +% check validity of PhysMin and PhysMax +if (length(EDF.PhysMin) ~= EDF.NS) + fprintf(2,'Warning OPENEDF: Failing Physical Minimum\n'); + EDF.PhysMin = EDF.DigMin; +end +if (length(EDF.PhysMax) ~= EDF.NS) + fprintf(2,'Warning OPENEDF: Failing Physical Maximum\n'); + EDF.PhysMax = EDF.DigMax; +end +if (any(EDF.PhysMin >= EDF.PhysMax)) + fprintf(2,'Warning OPENEDF: Physical Minimum larger than Maximum\n'); + EDF.PhysMin = EDF.DigMin; + EDF.PhysMax = EDF.DigMax; +end +EDF.PreFilt= setstr(fread(EDF.FILE.FID,[80,EDF.NS],'char')'); % +tmp = fread(EDF.FILE.FID,[8,EDF.NS],'char')'; % samples per data record +EDF.SPR = str2num(setstr(tmp)); % samples per data record + +fseek(EDF.FILE.FID,32*EDF.NS,0); + +EDF.Cal = (EDF.PhysMax-EDF.PhysMin)./ ... + (EDF.DigMax-EDF.DigMin); +EDF.Off = EDF.PhysMin - EDF.Cal .* EDF.DigMin; +tmp = find(EDF.Cal < 0); +EDF.Cal(tmp) = ones(size(tmp)); +EDF.Off(tmp) = zeros(size(tmp)); + +EDF.Calib=[EDF.Off';(diag(EDF.Cal))]; +%EDF.Calib=sparse(diag([1; EDF.Cal])); +%EDF.Calib(1,2:EDF.NS+1)=EDF.Off'; + +EDF.SampleRate = EDF.SPR / EDF.Dur; + +EDF.FILE.POS = ftell(EDF.FILE.FID); +if EDF.NRec == -1 % unknown record size, determine correct NRec + fseek(EDF.FILE.FID, 0, 'eof'); + endpos = ftell(EDF.FILE.FID); + EDF.NRec = floor((endpos - EDF.FILE.POS) / (sum(EDF.SPR) * 2)); + fseek(EDF.FILE.FID, EDF.FILE.POS, 'bof'); + H1(237:244)=sprintf('%-8i',EDF.NRec); % write number of records +end; + +EDF.Chan_Select=(EDF.SPR==max(EDF.SPR)); +for k=1:EDF.NS + if EDF.Chan_Select(k) + EDF.ChanTyp(k)='N'; + else + EDF.ChanTyp(k)=' '; + end; + if findstr(upper(EDF.Label(k,:)),'ECG') + EDF.ChanTyp(k)='C'; + elseif findstr(upper(EDF.Label(k,:)),'EKG') + EDF.ChanTyp(k)='C'; + elseif findstr(upper(EDF.Label(k,:)),'EEG') + EDF.ChanTyp(k)='E'; + elseif findstr(upper(EDF.Label(k,:)),'EOG') + EDF.ChanTyp(k)='O'; + elseif findstr(upper(EDF.Label(k,:)),'EMG') + EDF.ChanTyp(k)='M'; + end; +end; + +EDF.AS.spb = sum(EDF.SPR); % Samples per Block +bi=[0;cumsum(EDF.SPR)]; + +idx=[];idx2=[]; +for k=1:EDF.NS, + idx2=[idx2, (k-1)*max(EDF.SPR)+(1:EDF.SPR(k))]; +end; +maxspr=max(EDF.SPR); +idx3=zeros(EDF.NS*maxspr,1); +for k=1:EDF.NS, idx3(maxspr*(k-1)+(1:maxspr))=bi(k)+ceil((1:maxspr)'/maxspr*EDF.SPR(k));end; + +%EDF.AS.bi=bi; +EDF.AS.IDX2=idx2; +%EDF.AS.IDX3=idx3; + + +DAT.Head=EDF; +DAT.MX.ReRef=1; + +%DAT.MX=feval('loadxcm',EDF); + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/parsetxt.m b/code/eeglab13_4_4b/functions/sigprocfunc/parsetxt.m new file mode 100644 index 0000000..16171e6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/parsetxt.m @@ -0,0 +1,53 @@ +% parsetxt() - parse text input into cell array +% +% Usage: >> cellarray = parsetxt( txt, delims ); +% +% Inputs: +% txt - input text +% delims - optional char array of delimiters (default: [' ' ',' 9]); +% +% Note: commas, and simple quotes are ignored +% +% Author: Arnaud Delorme, CNL / Salk Institute, 18 April 2002 + +% Copyright (C) 18 April 2002 Arnaud Delorme, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function cellarray = parsetxt(txt, delims); + +if nargin < 1 + help parsetxt; + return; +end; + +if nargin < 2 + delims = [' ' ',' 9 '"' '''' ]; +end; + +cellarray = {}; +tmptxt = ''; +for index =1:length(txt) + if ~isempty(findstr(txt(index), delims)) + if ~isempty(tmptxt), cellarray = { cellarray{:}, tmptxt }; end; + tmptxt = ''; + else + tmptxt = [ tmptxt txt(index) ]; + end; +end; +if ~isempty(tmptxt) + cellarray = { cellarray{:}, tmptxt }; +end; +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/phasecoher.m b/code/eeglab13_4_4b/functions/sigprocfunc/phasecoher.m new file mode 100644 index 0000000..8c9ab3d --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/phasecoher.m @@ -0,0 +1,396 @@ +% phasecoher() - Implements inter-trial amp/coherence using Gaussian wavelets. +% Returns same data length as input frames. +% Plots results when nargin>6. Outputs have flat ends +% at data indices [1:halfwin] and [frames-halfwin:frames]. +% Usage: +% >> [amps,cohers ] = phasecoher(data,frames,srate,freq,cycles); +% >> [amps,cohers,cohsig,ampsig,allamps,allphs] ... +% = phasecoher(data,frames,... +% srate,freq,cycles,... +% alpha,times,titl,... +% warpframes, events); +% Inputs: +% data = input data, (1,frames*trials) or NB: (frames,trials) +% frames = frames per trial +% srate = sampling rate (in Hz) +% freq = frequency to work on (in Hz) +% cycles = cycles in Gaussian wavelet window (float) {3} +% alpha = (0 0.1] significance probability threshold. Requires +% >=3 output arguments. alpha=0 -> no signif {default: 0}. +% times = vector of latencies (in ms) for plotting {default: no plot} +% titl = [string] plot title {default none} +% warpframes = frame numbers of warped events (below) +% events = matrix of events in each trial, size (nevents, trials) +% as frame numbers. +% Outputs: +% amps = mean amplitude at each time point +% cohers = phase coherence at each time point [0,1] +% cohsig = coherence significance threshold (bootstrap, alpha level) +% ampsig = amplitude significance thresholds [lo high] (bootstrap, alpha level) +% allamps = amplitudes at each trial and time point (frames,trials) +% allphs = phase (deg) at each trial and time point (frames,trials) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 5-5-98 +% +% See also: erpimage() + +% Copyright (C) 5-5-98 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 5-7-98 added frames, made input data format one-row -sm +% 5-8-98 added MIN_AMP, times, PLOT_IT -sm +% 10-27-98 added cohsig, alpha -sm +% 07-24-99 added allamps -sm +% 02-29-00 added ampsig -sm +% 12-05-00 changed complex abs() to sqrt( .^2+ .^2) to avoid possible i ambiguity -sm & tpj +% 12-31-00 added ...20...40... frames fprinting -sm +% 08-17-01 added allphs option -sm +% 08-18-01 debugged cohsig plotting line (302) -sm +% 01-25-02 reformated help & license, added links -ad + +function [amps,cohers,cohsig,ampsig,allamps,allphs] = ... + phasecoher(data, frames, srate, freq, cycles, alpha, times, titl, timeStretchRef, timeStretchMarks) + +MIN_AMP = 10^-6; +DEFAULT_ALPHA = nan;% no bootstrap computed +COHSIG_REPS = 500; % default number of bootstrap surrogate coherence values + % to compute +TITLEFONT= 18; +TEXTFONT = 16; +TICKFONT = 14; +DEFAULT_CYCLES=3; +ampsig = []; % initialize for null output +cohsig = []; + +if nargin<4 + help phasecoher + return +end +if nargin<5 + cycles = DEFAULT_CYCLES; +end + +if nargin < 8 | isempty(titl) + titl = ''; +end + +if nargin < 7 | isempty(titl) | isempty(times) + PLOT_IT = 0; +elseif length(times) ~= frames + fprintf('phasecoher(): times vector length must be same as frames.\n') + return +else + PLOT_IT = 1; +end + +if nargin < 6 + alpha = nan; % no alpha given +end +if nargout > 2 & isnan(alpha) % if still want cohsig + alpha = DEFAULT_ALPHA; +elseif nargout > 2 + if alpha < 0 | alpha > 0.1 + help phasecoher + fprintf('phasecoher(): alpha out of bounds.\n'); + return + end + if alpha==0 + alpha = nan; % no bootstrap + end + if alpha*COHSIG_REPS < 5 + COHSIG_REPS = ceil(5/alpha); + fprintf(' Computing %d bootstrap replications.\n',COHSIG_REPS); + end +elseif ~isnan(alpha) + alpha = nan; % no cohsig calculation +end + +if length(frames)>1 + help phasecoher + fprintf('phasecoher(): frames should be a single integer.\n'); + return +end +if frames == 0, + frames = size(data,1); +end +trials = size(data,1)*size(data,2)/frames; +if floor(trials) ~= trials + fprintf('phasecoher(): data length not divisible by %d frames.\n',frames); + return +end + +fprintf('phasecoher(): Analyzing %d data trials of %d frames ',trials,frames); +if trials < 10 + fprintf(... + 'Low number of trials (%d) may not give accurate coherences.\n',trials) +end + +if size(freq,1)*size(freq,2)~=1 + fprintf('\nphasecoher(): only one frequency can be analyzed at a time.\n'); + help phasecoher + return +end + +if size(data,1) == 1 + data = reshape(data,frames,trials); % trials are columns +end +window = gauss(ceil(srate/freq*cycles),2); % gauss(std,+/-stds) +winlength = length(window); +halfwin = floor(winlength/2); +fprintf('\n with a moving %d-frame analysis window...',winlength); + +if frames < winlength + fprintf(... + '\nProblem: Epoch length (%d frames) too short for analysis with %g cycles!\n',... + frames, cycles); + return +end + +% +% Extend the data to minimize edge effects +% +data = [data([halfwin+1:-1:1],:); ... + data; ... + data([frames:-1:frames+1-(winlength-halfwin)],:)]; +% +% Remove epoch means +% +%data = data - ones(frames+winlength+1,1)* mean(data); % remove column means + +angleinc = cycles*2*pi/winlength; +cosx = cos(-cycles*pi:angleinc:cycles*pi); % sinusoids +cosx = cosx(1:winlength); +sinx = sin(-cycles*pi:angleinc:cycles*pi); +sinx = sinx(1:winlength); +coswin = window.*cosx; % window sinusoids +sinwin = window.*sinx; +coswin = coswin/(coswin*cosx'); % normalize windowed sinusoids +sinwin = sinwin/(sinwin*sinx'); + +% figure;plot(coswin,'r');hold on; plot(sinwin,'b'); +% iang = -cycles*pi:angleinc:cycles*pi; +% iang = iang(1:winlength); +% figure;plot(iang,[sinwin;coswin]); +amps = zeros(1,frames); +if nargout > 3 + allamps = zeros(frames,trials); +end +if nargout > 5 + allphs = zeros(frames,trials); +end +cohers = zeros(1,frames); +ix = 0:winlength-1; +% nsums = zeros(1,frames); % never called + +C = []; + +for f = 1:frames %%%%%%%%%%%%%%% frames %%%%%%%%%%%%%%%%%%%% + epoch = data(ix+f,:); + epoch = epoch - ones(winlength,1)*mean(epoch); % remove epoch means + if rem(f,50)== 0 + fprintf(' %d',f) + end + for t = 1:trials %%%%%%%%%%%%%%% trials %%%%%%%%%%%%%%%%%%% + realpart = coswin*epoch(:,t); + imagpart = sinwin*epoch(:,t); + C(f,t) = complex(realpart, imagpart); + end +end + +allamps = sqrt(C.*conj(C)); %compute all amplitudes for all frames, all trials +allphs = angle(C); %get the phase + +if exist('timeStretchRef') & exist('timeStretchMarks') & ... + length(timeStretchRef) > 0 & length(timeStretchMarks) > 0 %Added -Jean + for t=1:trials + M = timewarp(timeStretchMarks(:,t)', timeStretchRef'); + allamps(:,t) = M*allamps(:,t); + allphs(:,t) = angtimewarp(timeStretchMarks(:,t)', timeStretchRef', ... + allphs(:,t)); + end +end + +[amps, cohers, nsums]=getAmpCoh(allamps, allphs, MIN_AMP); + +% Old routine, for archeological purposes +% $$$ realcoh = zeros(1,frames); +% $$$ imagcoh = zeros(1,frames); +% $$$ for f = 1:frames %%%%%%%%%%%%%%% frames %%%%%%%%%%%%%%%%%%%% +% $$$ epoch = data(ix+f,:); +% $$$ %epoch = epoch - ones(winlength,1)*mean(epoch); % remove epoch means +% $$$ if rem(f,50)== 0 +% $$$ fprintf(' %d',f) +% $$$ end +% $$$ for t = 1:trials %%%%%%%%%%%%%%% trials %%%%%%%%%%%%%%%%%%% +% $$$ realpart = coswin*epoch(:,t); +% $$$ imagpart = sinwin*epoch(:,t); +% $$$ amp = sqrt(realpart.*realpart+imagpart.*imagpart); +% $$$ if amp >= MIN_AMP +% $$$ amps(f) = amps(f) + amp; % sum of amps +% $$$ realcoh(f) = realcoh(f) + realpart/amp; +% $$$ imagcoh(f) = imagcoh(f) + imagpart/amp; +% $$$ nsums(f) = nsums(f)+1; +% $$$ end +% $$$ if nargout > 3 +% $$$ if amp < MIN_AMP +% $$$ amp = MIN_AMP; +% $$$ end +% $$$ allamps(f,t) = amp; +% $$$ end +% $$$ if nargout > 5 +% $$$ allphs(f,t) = 180/pi*angle(realpart+i*imagpart); +% $$$ end +% $$$ end +% $$$ if nsums(f)>0 +% $$$ amps(f) = amps(f)/nsums(f); +% $$$ realcoh(f) = realcoh(f)/nsums(f); +% $$$ imagcoh(f) = imagcoh(f)/nsums(f); +% $$$ else +% $$$ amps(f) = 0; +% $$$ realcoh(f) = 0; +% $$$ imagcoh(f) = 0; +% $$$ end +% $$$ end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% $$$ cohers = sqrt(realcoh.^2+imagcoh.^2); + +fprintf('\n'); + + + + +cohsig = []; + +if ~isnan(alpha) %%%%%%%%%%%%%% Compute cohsig/ampsig %%%%%%%%%%%%%% + % ix = 0:winlength-1; % never called + bootcoher = zeros(1,COHSIG_REPS); + bootamp = zeros(1,COHSIG_REPS); + + bootallamps = zeros(COHSIG_REPS, trials); %Added -Jean + bootallphs = zeros(COHSIG_REPS, trials); %Added -Jean + + fprintf('Computing %d bootstrap coherence values... ',COHSIG_REPS); + for f = 1:COHSIG_REPS %%%%%%%%%%%%%%% Bootstrap replications %%%%%%%%%%% + if rem(f,50) == 0 + fprintf('%d ',f); + end + randoff = floor(rand(1,trials)*(frames-winlength))+1; % random offsets + + %Create randomized time-stretched allamps and allphs arrays (see above) + for t = 1:trials + bootallamps(f, t) = allamps(randoff(t), t); + bootallphs(f, t) = allphs(randoff(t), t); + end + end + + [bootamp, bootcoher]=getAmpCoh(bootallamps, bootallphs, MIN_AMP); + + fprintf('\n'); + + bootcoher = sort(bootcoher); % sort low to high + cohsig = bootcoher(round(COHSIG_REPS*(1.0-alpha))); + + bootamp = sort(bootamp); % sort low to high + ampsig = [bootamp(round(COHSIG_REPS*(alpha))) ... + bootamp(round(COHSIG_REPS*(1.0-alpha)))]; +% keyboard + +end %%%%%%%%%%%%%%%%%%%%%%%%%%%% end cohsig %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +for f=1:halfwin % pad amps, cohers to front of input data + amps(f) = amps(halfwin+1); + cohers(f) = cohers(halfwin+1); +end +for f=frames:-1:frames-halfwin % pad amps, cohers to end of input data + amps(f) = amps(frames-halfwin); + cohers(f) = cohers(frames-halfwin); +end + +if PLOT_IT %%%%%%%%%%%%%% make two-panel plot of results %%%%%%%% + + subplot(2,1,1);plot(times,amps'); + title(titl,'fontsize',TITLEFONT,'fontweight','bold'); + ylabel(['Amplitude (' num2str(freq) ' Hz)'],... + 'fontsize',TEXTFONT,'fontweight','bold'); + ax = axis; + hold on; plot([0 0],[0 1],'k'); % vertical line at time 0 + axis([ax(1) ax(2) ax(3) ax(4)*1.25]); + set(gca,'FontSize',TICKFONT); + set(gca,'FontWeight','bold'); + + subplot(2,1,2);plot(times,cohers','r'); + ylabel(['Intertrial Coherence (' num2str(freq) ' Hz)'],... + 'fontsize',TEXTFONT,'fontweight','bold'); + xlabel('Time (ms)','fontsize',TEXTFONT,'fontweight','bold'); + hold on + winstframe = floor(frames/7); + winframes = [winstframe:winstframe+winlength-1]; + wintimes = times(winframes); + ax = axis; + plot(wintimes,0.8+window*0.1,'k'); + plot(wintimes,0.8-window*0.1,'k'); + % ax2 = axis; % never called + hold on; plot([0 0],[0 1000],'k'); % vertical line at time 0 + axis([ax(1) ax(2) 0 1]); + set(gca,'fontSize',TICKFONT); + set(gca,'FontWeight','bold'); + alpha + if ~isnan(alpha) % plot coher significance + plot([wintimes(1) wintimes(end)],[cohsig cohsig],'r'); + % was [times(1) times(winframes)] !?? + end +end + + + +function [amps, cohers, nsums] = getAmpCoh(allamps, allphs, MIN_AMP) + minampfilter = allamps >= MIN_AMP; + nsums = sum(minampfilter,2); + + amps(find(nsums == 0)) = 0; %zero the amplitude if no trial shows + %significant power at that frame + cohers(find(nsums == 0)) = 0; %zero the coherence too if no trial shows + %significant power at that frame + %Now average out amplitudes over trials + % allminamps is never used. TF 04/02/2007 + %allminamps = allamps; + % nargout is never greater than 3. Bug 262. TF 04/02/2007 + %if nargout > 3 + % allminamps(~minampfilter) = MIN_AMP; + %end + allzeramps = allamps .* minampfilter; + allzeramps = allzeramps(find(nsums ~= 0),:); + amps(find(nsums ~= 0)) = sum(allzeramps,2) ./ nsums(find(nsums ~= 0)); + + %Convert angles to complex for summing + allzerphs = complex(cos(allphs), sin(allphs)) .* minampfilter; + allzerphs = allzerphs(find(nsums ~= 0), :); + cohers(find(nsums ~= 0)) = sum(allzerphs,2) ./ nsums(find(nsums ~= 0)); + cohers = sqrt(cohers .* conj(cohers)); + + function outvec = gauss(frames,sds) + +outvec = []; +if nargin < 2 + help gauss + return +end +if sds <=0 | frames < 1 + help gauss + return +end + +incr = 2*sds/(frames-1); +outvec = exp(-(-sds:incr:sds).^2); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/plotchans3d.m b/code/eeglab13_4_4b/functions/sigprocfunc/plotchans3d.m new file mode 100644 index 0000000..f53eea8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/plotchans3d.m @@ -0,0 +1,108 @@ +% plotchans3d() - Plots the 3-D configuration from a Polhemus ELP +% file. The axes of the Cartesian coordinate system are +% plotted. The nose is plotted as a bold red segment. +% Usage: +% >> plotchans3d( elpfile, zs); +% >> plotchans3d( [X,Y,Z], elecnames, zs); +% +% Inputs: +% elpfile - Polhemus ELP (electrode position) file +% [X,Y,Z] - array of 3-D coordinates +% elecnames - cell array containing the names of the electrodes +% +% Optional input: +% zs - vector of electrode indices giving the subset to print labels for +% in the plot +% +% Author: Luca A. Finelli, SCCN/INC/UCSD, La Jolla, 02/2002 +% +% See also: topoplot(), readlocs(), readelp(), +% polhemus2topo(), pop_chanedit() + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 04/01/02 changed header for help2html compatibility -ad +% 04/01/02 debuging zs -ad +% 04/01/02 adding extra optional [X,Y,Z] argument -ad + +function plotchans3d(elpfile, arg2, arg3) + +if nargin<1 + help plotchans3d; + return; +end; +zs = []; +if isstr(elpfile) + if nargin > 1 + zs = arg2; + end; + [elocstruct, elocname, X, Y, Z ] =readelp([elpfile]); +else + X = elpfile(:,1)'; + Y = elpfile(:,2)'; + Z = elpfile(:,3)'; + if nargin > 1 + elocname = arg2; + else + elocname = []; + end; + if nargin > 2 + zs = arg3; + end; +end; + +if isempty(zs) + zs = [1:length(elocname)]; +end; + +%zs =[3 7 15 26 36 46 56 64 69 71 72]; + +figure +lim=1.05*max([X Y Z]); +eps=lim/20; +plot3(X,Y,Z,'ro') +hold on + +if ~isempty(elocname) + plot3(X(zs),Y(zs),Z(zs),'b*') +end; + +plot3([0.08 0.12],[0 0],[0 0],'r','LineWidth',4) % nose +plot3([0 lim],[0 0],[0 0],'b--') % axis +plot3([0 0],[0 lim],[0 0],'g--') +plot3([0 0],[0 0],[0 lim],'r--') +plot3(0,0,0,'b+') +text(lim+eps,0,0,'X','HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',[0 0 0],... + 'FontSize',10) +text(0,lim+eps,0,'Y','HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',[0 0 0],... + 'FontSize',10) +text(0,0,lim+eps,'Z','HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',[0 0 0],... + 'FontSize',10) +box on +if ~isempty(elocname) + for i = 1:length(zs) + text(X(zs(i)),Y(zs(i)),Z(zs(i))+eps,elocname(zs(i)),'HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',[0 0 0],... + 'FontSize',10) + end +end; +%axis(repmat([-lim lim],1,3)) +axis([-lim lim -lim lim -lim*0.5 lim]) +axis equal; +rotate3d on +try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/plotcurve.m b/code/eeglab13_4_4b/functions/sigprocfunc/plotcurve.m new file mode 100644 index 0000000..ab2da3c --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/plotcurve.m @@ -0,0 +1,330 @@ +% plotcurve() - plot curve(s) with optional significance highlighting. +% +% Usage: >> plotcurve(times, data, 'key1', 'val1', 'key2', val2' ...); +% +% Required inputs: +% times - [float] vector of time indices +% data - [float] data array, size of [n x times]. If n>1 several +% curves are plotted (unless 'plotmean' option is used). +% +% Optional inputs: +% 'maskarray' = Input bootstrap limits. Can be 1-D [min max], 2-D (min +% and max for all ordinate) or 3-D (min and max for all +% ordinates at all time points). +% 'val2mask' = Value to use for generating mask. By default use data. +% 'plotmean' = ['on'|'off'] For 'curve' plots only. Average all +% frequencies given as input. Default: 'on'. +% 'highlightmode' = ['background'|'bottom'] For 'curve' plots only, +% display significant time regions either in the plot +% background or underneatht the curve. +% 'xlabel' = [string] x label +% 'ylabel' = [string] y label +% 'legend' = [cell] legend. Cell array of string, with one string +% per curve. +% 'ylim' = [min max] or [min] limits for the ordinate axis. +% 'title' = Optional figure title. If two conditions are given +% as input, title can be a cell array with two text +% string elements {none} +% 'vert' = Latencies to mark with a dotted vertical line {none} +% 'linewidth' = Line width for marktimes traces (thick=2, thin=1) {2} +% 'chanlocs' = channel location structure. +% 'plottopo' = [min max] plot topography within the time limits defined +% in this function. If several lines are given as input, one +% scalp map is plot for each line. +% 'traceinfo' = [string|cell array] information shown on the command line +% when the user click on a specific trace. Default none. +% +% Authors: Arnaud Delorme, 2004, Bhaktivedanta Institute + +% Copyright (C) 2004 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function plotcurve( times, R, varargin); + + if nargin < 2 + help plotcurve; + return; + end; + g = finputcheck( varargin, { 'maskarray' '' [] []; + 'val2mask' 'real' [] R; + 'highlightmode' 'string' { 'background','bottom' } 'background'; + 'plotmean' 'string' { 'on','off' } 'off'; + 'plotindiv' 'string' { 'on','off' } 'on'; + 'traceinfo' { 'string' 'cell' } { { } {} } 'off'; + 'logpval' 'string' { 'on','off' } 'off'; + 'title' 'string' [] ''; + 'xlabel' 'string' [] ''; + 'plotmode' 'string' {'single','topo'} 'single'; + 'ylabel' 'string' [] ''; + 'legend' 'cell' [] {}; + 'colors' 'cell' [] {}; + 'plottopotitle' 'cell' [] {}; + 'chanlocs' 'struct' [] struct; + 'ylim' 'real' [] []; + 'vert' 'real' [] []; + 'plottopo' 'real' [] []; + 'linewidth' 'real' [] 2; + 'marktimes' 'real' [] [] }); + if isstr(g), error(g); end; + % keyboard; + if isempty(g.colors), g.colors = { 'r' 'g' 'b' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' ... + 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' }; end; + if strcmpi(g.plotindiv, 'off'), g.plotmean = 'on'; end; + + if ~any(length(times) == size(R)) + try, + R = reshape(R, length(times), length(R)/length(times))'; + catch, error('Size of time input and array input does not match'); + end; + end; + + % regions of significance + % ----------------------- + if ~isempty(g.maskarray) + if length(unique(g.maskarray)) < 4 + Rregions = g.maskarray; + else + Rregions = ones(size(g.val2mask)); + switch dims(g.maskarray) + case 3, Rregions (find(g.val2mask > g.maskarray(:,:,1) & (g.val2mask < g.maskarray(:,:,2)))) = 0; + case 2, if size(g.val2mask,2) == size(g.maskarray,2) + Rregions (find(g.val2mask < g.maskarray)) = 0; + elseif size(g.val2mask,1) == size(g.maskarray,1) + Rregions(find((g.val2mask > repmat(g.maskarray(:,1),[1 length(times)])) ... + & (g.val2mask < repmat(g.maskarray(:,2),[1 length(times)])))) = 0; + else + Rregions(find((g.val2mask > repmat(g.maskarray(:,1),[1 length(times)])) ... + & (g.val2mask < repmat(g.maskarray(:,2),[1 length(times)])))) = 0; + end; + case 1, Rregions (find(g.val2mask < repmat(g.maskarray(:),[1 size(g.val2mask,2)]))) = 0; + end; + Rregions = sum(Rregions,1); + end; + else + Rregions = []; + end + + % plotting + % -------- + if size(R,1) == length(times), R = R'; end; + if strcmpi(g.plotmean, 'on') | strcmpi(g.plotindiv, 'off') + if strcmpi(g.plotindiv, 'on') + R = [ R; mean(R,1) ]; + else + R = mean(R,1); + end; + end; + ax = gca; + if ~isempty(g.maskarray) & strcmpi(g.highlightmode, 'bottom') + pos = get(gca, 'position'); + set(gca, 'position', [ pos(1)+pos(3)*0.1 pos(2)+pos(4)*0.1 pos(3)*0.9 pos(4)*0.85 ]); + end; + + % plot topographies + % ----------------- + if ~isempty(g.plottopo) + tmpax = gca; + pos = get(gca, 'position'); + set(gca, 'position', [ pos(1) pos(2) pos(3) pos(4)/2 ]); + + for index = 1:size(g.plottopo) + axes('position', [ (index-1)*pos(3)/size(g.plottopo,1)+pos(1) pos(2)+pos(4)/2 pos(3)/size(g.plottopo,1) pos(4)/2 ]); + %topoplot(g.plottopo(index,:), g.chanlocs, 'maplimits', 'minmax'); + topoplot(g.plottopo(index,:), g.chanlocs); + if ~isempty(g.plottopotitle) + title(g.plottopotitle{index}, 'interpreter', 'none'); + end; + end; + + axes(tmpax); + end; + + for ind = 1:size(R,1) + if ind == size(R,1) & strcmpi(g.plotmean, 'on') & size(R,1) > 1 + plot(times,R(ind,:), 'k', 'linewidth', 2); + elseif ~isempty(g.colors), + tmp = plot(times,R(ind,:), 'k'); + tmpcol = g.colors{mod(ind-1, length(g.colors))+1}; + if length(tmpcol) > 1, tmpstyle = tmpcol(2:end); tmpcol = tmpcol(1); else tmpstyle = '-'; end; + set(tmp, 'color', tmpcol, 'linestyle', tmpstyle); + + if ~isempty(g.traceinfo) + if isstr(g.traceinfo) && strcmpi(g.traceinfo, 'on') + set(tmp, 'ButtonDownFcn', [ 'disp(''Trace ' int2str(ind) ''');' ]); + elseif iscell(g.traceinfo) + try + set(tmp, 'ButtonDownFcn', g.traceinfo{ind}); + catch, + error('Trace info cell array does not contain the same number of element as trace in the graph') + end; + end; + end; + + % change the line style when number of plots exceed number of colors in g.colors + %lineStyles = {'-', '--',':','-.'}; + %set(tmp,'LineStyle',lineStyles{min(ceil(ind/length(g.colors)),length(lineStyles))}); + + hold on; + else plot(times,R(ind,:)); + end; + end; + + % ordinate limits + % --------------- + if isempty(g.ylim), + yll = min(reshape(R, [1 prod(size(R))])); + ylh = max(reshape(R, [1 prod(size(R))])); + yll2 = yll - (ylh-yll)/10; + ylh2 = ylh + (ylh-yll)/10; + if ~isnan(yll), g.ylim = [yll2 ylh2]; end; + end; + if ~isempty(g.ylim) & length(g.ylim) == 2 + if any(g.ylim) + ylim(g.ylim); + else + ylim([0 1]); + axis off; + box off; + end; + elseif ~isempty(g.ylim) + yl = ylim; + ylim([g.ylim yl(2)]); + end + yl = ylim; + + % highlight regions + % ----------------- + if ~isempty(g.maskarray) + axsignif = highlight(ax, times, Rregions, g.highlightmode, g.xlabel); + + % replot data (above highlighted regions) + % --------- + axes(ax); + for ind = 1:size(R,1) + if ind == size(R,1) & strcmpi(g.plotmean, 'on') & size(R,1) > 1 + plot(times,R(ind,:), 'k', 'linewidth', 2); + elseif ~isempty(g.colors), + tmp = plot(times,R(ind,:), 'k'); set(tmp, 'color', g.colors{mod(ind-1, length(g.colors))+1} ); hold on; + else plot(times,R(ind,:)); + end; + end; + if strcmpi(g.highlightmode, 'bottom'), xlabel(''); set(ax, 'xtick', []); end; + end; + box on; + + ylim(yl); + if strcmpi(g.logpval, 'on') + set(gca, 'ytickmode', 'manual', 'yticklabel', round(10.^-get(gca, 'ytick')*1000)/1000, 'ydir', 'reverse'); + end; + + % vertical lines + % -------------- + hold on + xl = xlim; + if ~isnan(g.marktimes) % plot marked time + for mt = g.marktimes(:)' + plot([mt mt],[yl(1) yl(2)],'--k','LineWidth',g.linewidth); + end + end + hold off + if ~isempty(g.vert) + for index = 1:length(g.vert) + line([g.vert(index), g.vert(index)], [yl(1) yl(2)], 'linewidth', 1, 'color', 'm'); + end; + end; + xlim([times(1) times(end)]); + + % title and legend + % ---------------- + if strcmpi(g.plotmode, 'topo') % plot in scalp array + NAME_OFFSETX = 0.1; + NAME_OFFSETY = 0.2; + xx = xlim; xmin = xx(1); xdiff = xx(2)-xx(1); xpos = double(xmin+NAME_OFFSETX*xdiff); + yy = ylim; ymax = yy(2); ydiff = yy(2)-yy(1); ypos = double(ymax-NAME_OFFSETY*ydiff); + t=text(xpos, ypos,g.title); + axis off; + line([0 0], [yl(1) yl(2)], 'linewidth', 1, 'color', 'k'); + line([xl(1) xl(2)], [0 0], 'linewidth', 1, 'color', 'k'); + set(ax, 'userdata', { g.xlabel g.ylabel g.legend }); + else + title(g.title, 'interpreter', 'none') + if ~isempty(g.legend) + hh = legend(g.legend(:)); + set(hh, 'unit', 'pixels', 'interpreter', 'none') + end; + if isempty(g.maskarray) + xlabel(g.xlabel); + end; + ylabel(g.ylabel) + end; + +% ----------------- +% highlight regions +% ----------------- +function axsignif = highlight(ax, times, regions, highlightmode, myxlabel); +color1 = [0.75 0.75 0.75]; +color2 = [0 0 0]; +yl = ylim; +yl(1) = yl(1)-max(abs(yl)); +yl(2) = yl(2)+max(abs(yl)); + +if ~strcmpi(highlightmode, 'background') + pos = get(ax, 'position'); + set(gca, 'xtick', []); + axsignif = axes('position', [pos(1) pos(2)-pos(4)*0.05 pos(3) pos(4)*0.05 ]); + plot(times, times, 'w'); + set(axsignif, 'ytick', []); + yl2 = ylim; + yl2(1) = yl2(1)-max(abs(yl2)); + yl2(2) = yl2(2)+max(abs(yl2)); + xlim([times(1) times(end)]); + xlabel(myxlabel); +else + axsignif = []; + xlabel(myxlabel); +end; + +if ~isempty(regions) + axes(ax); + in_a_region = 0; + for index=1:length(regions) + if regions(index) & ~in_a_region + tmpreg(1) = times(index); + in_a_region = 1; + end; + if (~regions(index) | index == length(regions)) & in_a_region + tmpreg(2) = times(index); + in_a_region = 0; + if strcmpi(highlightmode, 'background') + tmph = patch([tmpreg(1) tmpreg(2) tmpreg(2) tmpreg(1)], ... + [yl(1) yl(1) yl(2) yl(2)], color1); hold on; + set(tmph, 'edgecolor', color1); + else + oldax = ax; + axes(axsignif); + tmph = patch([tmpreg(1) tmpreg(2) tmpreg(2) tmpreg(1)], ... + [yl2(1) yl2(1) yl2(2) yl2(2)], color2); hold on; + set(tmph, 'edgecolor', color2); + axes(oldax); + end; + end; + end; + ylim(yl); +end; + + + function res = dims(array) + res = min(ndims(array), max(size(array,2),size(array,3))); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/plotdata.m b/code/eeglab13_4_4b/functions/sigprocfunc/plotdata.m new file mode 100644 index 0000000..0641b93 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/plotdata.m @@ -0,0 +1,569 @@ +% plotdata() - plot concatenated multichannel data epochs in two-column format +% +% Usage: >> plotdata(data) +% >> plotdata(data,frames) +% >> plotdata(data,frames,limits,title,channames,colors,rtitle,ydir) +% +% Necessary input: +% data = data consisting of consecutive epochs of (chans,frames) +% +% Optional inputs: +% frames = time frames/points per epoch {default: 0 -> data length} +% [limits] = [xmin xmax ymin ymax] (x's in ms) +% {default|0 (or both y's 0) -> use data limits) +% 'title' = plot title {default|0 -> none} +% 'channames' = channel location file or structure (see readlocs()) +% {default|0 -> channel numbers} +% 'colors' = file of color codes, 3 chars per line +% ( '.' = space) {default|0 -> default color order} +% 'rtitle' = right-side plot title {default|0 -> none} +% ydir = y-axis polarity (1 -> pos-up; -1 -> neg-up) +% {default|0 -> set from default YDIR in 'icadefs.m'} +% +% Authors: Scott Makeig, Arnaud Delorme, Tzyy-Ping Jung, +% SCCN/INC/UCSD, La Jolla, 05-01-96 +% +% See also: plottopo(), timtopo(), envtopo(), headplot(), compmap(), eegmovie() + +% Copyright (C) 05-01-96 Scott Makeig, Arnaud Delorme & Tzyy-Ping Jung, +% SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 5-1-96 from showerps.m -sm from showerp.m -tpj +% 5-3-96 added default channel numbering, frames & title -sm +% 5-17-96 added nargin tests below -sm +% 5-21-96 added right titles -sm +% 6-29-96 removed Postscript file query -sm +% 7-22-96 restored lines to fill printed page with figure -sm +% 7-29-96 added [channumbers] option for channames argument. -sm +% changed "channels" argument to "channames" in help statement above -sm +% 1-6-97 debugged min/max time and +/- printing -tpj & sm +% 3-3-97 restored previous Default axis parameters at end -sm +% 4-2-97 debugged 32-epoch plotting -sm +% 5-10-97 added no-args check -sm +% 5-20-97 read icadefs.m for MAXPLOTDATACHANS and MAXPLOTDATAEPOCHS -sm +% 6-23-97 use returns instead of errorcodes -sm +% 10-31-97 use normalized PaperUnits for US/A4 compatibility, +% fixed [xy]{min,max} printing, added clf, adding Clipping off, +% fixed scaling, added limits tests -sm & ch +% 11-19-97 removed an 'orient' command that caused problems printing -sm +% 07-15-98 added 'ydir' arg, made pos-up the default -sm +% 07-24-98 fixed 'ydir' arg, and pos-up default -sm +% 01-02-99 added warning about frames not dividing data length -sm +% 02-19-99 debugged axis limits -sm +% 11-21-01 add compatibility to load .loc files for channames -ad +% 01-25-02 reformated help & license, added links -ad +% 02-16-02 added axcopy -ad & sm +% 03-15-02 added readlocs and the use of eloc input structure -ad +% 03-15-02 added smart axcopy -ad + +function plotdata(data,frames,limits,plottitle,channels,colors,righttitle,ydr) + +if nargin < 1, + help plotdata + return +end + +% +% Set defaults +% +FONTSIZE = 12; % font size to use for labels +TICKFONTSIZE=12; % font size to use for axis labels +icadefs; % read MAXPLOTDATACHANS constant from icadefs.m + % read YDIR +if ~exist('YDIR') + fprintf('YDIR not read from ''icadefs.m'' - plotting positive-up.\n'); + YDIR = 1; +end +DEFAULT_SIGN = YDIR; % default to plotting positive-up (1) or negative-up (-1) + % Now, read sign from YDIR in icadefs.m +ISSPEC = 0; % default - 0 = not spectral data, 1 = pos-only spectra + +axcolor= get(0,'DefaultAxesXcolor'); % find what the default x-axis color is +plotfile = 'plotdata.ps'; +ls_plotfile = 'ls -l plotdata.ps'; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Substitute defaults for missing parameters %%%%% +% +SIGN = DEFAULT_SIGN; % set default ydir from YDIR in icadefs.m +if nargin < 8 + ydr = []; +end +if ~isempty(ydr)& ydr ~=0 % override default from commandline + if ydr == 1 + SIGN = 1; + else + SIGN = -1; + end +end + +if nargin < 7, + righttitle = 0; +end; +if nargin < 6 + colors = 0; +end +if nargin < 5 + channels = [1:size(data,1)]; % default channames = 1:chans +end +if nargin < 4 + plottitle = 0; %CJH +end +limitset = 0; +if nargin < 3, + limits = 0; +elseif length(limits)>1 + limitset = 1; +end +if nargin < 2, + frames = 0; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Test parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + [chans,framestotal]=size(data); % data size + if frames <=0, + frames = framestotal; % default + datasets=1; + elseif frames==1, + fprintf('plotdata: cannot plot less than 2 frames per trace.\n'); + return + datasets=1; + else + datasets = fix(framestotal/frames); % number of traces to overplot + if datasets*frames < framestotal + fprintf('\nWARNING: %d points at end of data will not be plotted.\n',... + framestotal-datasets*frames); + end + end; + + if chans>MAXPLOTDATACHANS, + fprintf('plotdata: not set up to plot more than %d channels.\n',... + MAXPLOTDATACHANS); + return + end; + if datasets>MAXPLOTDATAEPOCHS + fprintf('plotdata: not set up to plot more than %d epochs.\n',... + MAXPLOTDATAEPOCHS); + return + end; + if datasets<1 + fprintf('plotdata: cannot plot less than 1 epoch!\n'); + return + end; +% +%%%%%%%%%%%%% Extend the size of the plotting area in the window %%%%%%%%%%%% +% + curfig = gcf; + h=figure(curfig); + set(h,'Color',BACKCOLOR); % set the background color + set(h,'PaperUnits','normalized'); % use percentages to avoid US/A4 difference + set(h,'PaperPosition',[0.0235308 0.0272775 0.894169 0.909249]); % equivalent + % orient portrait + axis('normal'); +% +%%%%%%%%%%%%%%%%%%%% Read the channel names %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if isnumeric(channels) & channels(1)==0, + channels = [1:size(data,1)]; + end; + if isnumeric(channels), + channames = num2str(channels(:)); %%CJH + else + [tmp channames] = readlocs(channels); + channames = strvcat(channames{:}); + end; +% chid = fopen(channels,'r'); +% if chid <3, +% fprintf('plotdata(): cannot open file %s.\n',channels); +% return +% end; +% if isempty( findstr( lower(channels), '.loc') ) +% channames = fscanf(chid,'%s',[4 Inf]); +% channames = channames'; +% else +% channames = fscanf(chid,'%d %f %f %s',[7 128]); +% channames = char(channames(4:7,:)'); +% end; +% ii = find(channames == '.'); +% channames(ii) = ' '; + + %channames = channames'; + % [r c] = size(channames); + %for i=1:r + % for j=1:c + % if channames(i,j)=='.', + % channames(i,j)=' '; + % end; + % end; + %end; +% end; % setting channames + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Read the color names %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if colors ~=0, + if ~isstr(colors) + fprintf('plotdata(): color file name must be a string.\n'); + return + end + cid = fopen(colors,'r'); + % fprintf('cid = %d\n',cid); + if cid <3, + fprintf('plotdata: cannot open file %s.\n',colors); + return + end; + colors = fscanf(cid,'%s',[3 Inf]); + colors = colors'; + [r c] = size(colors); + for i=1:r + for j=1:c + if colors(i,j)=='.', + colors(i,j)=' '; + end; + end; + end; + else % use default color order (no yellow!) + colors =['r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ';'r ';'b ';'g ';'c ';'m ']; + colors = [colors; colors]; % make > 64 available + end; + for c=1:size(colors,1) % make white traces black unless axis color is white + if colors(c,1)=='w' & axcolor~=[1 1 1] + colors(c,1)='k'; + end + end + +% +%%%%%%%%%%%%%%%%%%%%%%% Read and adjust limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if limits==0, % == 0 or [0 0 0 0] + xmin=0; + xmax=frames-1; + ymin=min(min(data)); + ymax=max(max(data)); + yrange = ymax-ymin; + ymin = ymin - 0.00*yrange; + ymax = ymax + 0.00*yrange; + else + if length(limits)~=4, + fprintf( ... + 'plotdata: limits should be 0 or an array [xmin xmax ymin ymax].\n'); + return + end; + xmin = limits(1); + xmax = limits(2); + ymin = limits(3); + ymax = limits(4); + end; + + if xmax == 0 & xmin == 0, + x = (0:1:frames-1); + xmin = 0; + xmax = frames-1; + else + dx = (xmax-xmin)/(frames-1); + x=xmin*ones(1,frames)+dx*(0:frames-1); % compute x-values + end; + if xmax<=xmin, + fprintf('plotdata() - xmax must be > xmin.\n') + return + end + + if ymax == 0 & ymin == 0, + ymax=double(max(max(data))); + ymin=double(min(min(data))); + yrange = ymax-ymin; + % ymin = ymin - 0.00*yrange; + % ymax = ymax + 0.00*yrange; + end + if ymax<=ymin, + fprintf('plotdata() - ymax must be > ymin.\n') + return + end + + xlabel = 'Time (ms)'; + if ymin >= 0 & xmin >= 0, % For all-positive (spectral) data + ISSPEC = 1; + SIGN = 1; + fprintf('\nPlotting positive up. Assuming data are spectra.\n'); + xlabel = 'Freq (Hz)'; + ymin = 0; % plot positive-up + end; + +% +%%%%%%%%%%%%%%%%%%%%%%%% Set up plotting environment %%%%%%%%%%%%%%%%%%%%%%%%% +% + h = gcf; + % set(h,'YLim',[ymin ymax]); % set default plotting parameters + % set(h,'XLim',[xmin xmax]); + % set(h,'FontSize',18); + % set(h,'DefaultLineLineWidth',1); % for thinner postscript lines +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Print plot info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + clf; % clear the current figure + + % print plottitle over (left) sbplot 1 + if plottitle==0, + plottitle = ''; + end + if righttitle==0, + righttitle = ''; + end + + if ~isempty(righttitle) + sbplot(ceil(chans/2),2,2), h=gca;%title([righttitle], 'FontSize',FONTSIZE); % title plot and + set(h,'FontSize',FONTSIZE); % choose font size + set(h,'YLim',[ymin ymax]); % set default plotting parameters + set(h,'XLim',[xmin xmax]); + end; + + msg = ['\nPlotting %d traces of %d frames with colors: ']; + for c=1:datasets + msg = [msg colors(mod(c-1,length(colors))+1,:)]; + end + msg = [msg ' -> \n']; % print starting info on screen . . . + fprintf(... + '\n limits: [xmin,xmax,ymin,ymax] = [%4.1f %4.1f %4.2f %4.2f]\n',... + xmin,xmax,ymin,ymax); + fprintf(msg,datasets,frames); +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot traces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + + xdiff=xmax-xmin; + ydiff=ymax-ymin; + + for P=0:datasets-1, % for each data epoch + fprintf('\ntrace %d: ',P+1); + + for I=1:chans, % for each data channel + + index=(2*((rem(I-1,ceil(chans/2))+1)))-1+floor(2*(I-1)/chans); + % = 1 3 5 .. 2 4 6 .. + % plot down left side of page first + h=sbplot(ceil(chans/2),2,index); h=gca; + pos = get(h,'position'); + set(h,'position',[pos(1)-pos(4)*0.5 pos(2), pos(3),pos(4)*2]); % increase sbplot-height + + hold on; + set(h,'YLim',[ymin ymax]); % set default plotting parameters + set(h,'XLim',[xmin xmax]); + + axislcolor = get(gca,'Xcolor'); %%CJH + + % + %%%%%%%%%%%%%%%%%%%%% Plot two-sided time-series data %%%%%%%%%%%%%%%%%%% + % + if ~ISSPEC % not spectral data + + ymin = double(ymin); + ymax = double(ymax); + + if ymin == ymax, ymin = ymin-1; ymax = ymax+1; end; + plot(x,SIGN*data(I,1+P*frames:1+P*frames+frames-1),colors(mod(P,length(colors))+1)); + + if SIGN > 0 + axis([xmin xmax ymin ymax]); % set axis bounds (pos up) + else + axis([xmin xmax -1*ymax -1*ymin]); % set axis bounds (neg up) + end + + if P==datasets-1, % on last traces + if I==floor((chans+1)/2), % draw +/0 on lowest left plot + signx = double(xmin-0.04*xdiff); + + if SIGN > 0 % pos up + axis('off');hl=text(signx,ymin,num2str(ymin,3)); % text ymin + axis('off');hi=text(signx,ymax,['+' num2str(ymax,3)]); % text +ymax + else % neg up + axis('off');hl=text(signx,-1*ymin,num2str(ymin,3)); % text ymin + axis('off');hi=text(signx,-1*ymax,['+' num2str(ymax,3)]); % text +ymax + end + set(hl,'FontSize',TICKFONTSIZE); % choose font size + set(hl,'HorizontalAlignment','right','Clipping','off'); + set(hi,'FontSize',TICKFONTSIZE); % choose font size + set(hi,'HorizontalAlignment','right','Clipping','off'); + end + + if I==chans & limitset, % draw timescale on lowest right plot + ytick = double(-ymax-0.25*ydiff); + + tick = [int2str(xmin)]; h=text(xmin,ytick,tick); % min time + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + tick = [xlabel]; h=text(xmin+xdiff/2,ytick,tick); % xlabel + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + tick = [int2str(xmax)]; h=text(xmax,ytick,tick); % max time + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + end; + end; + % + %%%%%%%%%%%%%%%%%%%%% Plot spectral data positive-up [0,ymax] %%%%%%%%%%%%%%%%%%%%%%%% + % + else % ISSPEC + ymin=0; + plot(x,SIGN*data(I,1+P*frames:1+P*frames+frames-1),colors(mod(P,length(colors))+1)); + ymaxm = ymax; + + % ymin = 0.01; + % ymaxm = 10.^ceil(log(ymax)/log(10.)); + % if ymaxm/2. > ymax, + % ymaxm = ymaxm/2.; + % end; + + axis([xmin xmax ymin ymaxm]); % set axis values + + if P==datasets-1, % on last trace + if I==floor((chans+1)/2), % draw +/0 on lowest left plot + signx = xmin-0.04*xdiff; + + axis('off');h=text(signx,ymax,['+' num2str(ymax,3)]); + set(h,'FontSize',TICKFONTSIZE); + set(h,'HorizontalAlignment','right','Clipping','off'); + + axis('off');h=text(signx,0,'0'); + set(h,'FontSize',TICKFONTSIZE); + set(h,'HorizontalAlignment','right','Clipping','off'); + end; + + if I==chans, % draw freq scale on lowest right plot + ytick = -0.25*ymax; + + tick = [num2str(round(10*xmin)/10) ]; h=text(xmin,ytick,tick); + set(h,'FontSize',TICKFONTSIZE); + set(h,'HorizontalAlignment','center','Clipping','off'); + + tick = [xlabel]; h=text(xmin+xdiff/2,ytick,tick); + set(h,'FontSize',TICKFONTSIZE); + set(h,'HorizontalAlignment','center','Clipping','off'); + + tick = [num2str(round(10*xmax)/10) ]; h=text(xmax,ytick,tick); + set(h,'FontSize',TICKFONTSIZE); + set(h,'HorizontalAlignment','center','Clipping','off'); + + end; % if last chan + end % if last data + end; % if ~ISSPEC + + %%%%%%%%%%%%%%%%%%%%%%% Print channel names and lines %%%%%%%%%%%%%%%%%%%%%%%%%% + + if P==datasets-1 + if ~ISSPEC + axis('off'); + plot([0 0],[ymin ymax],'color',axislcolor); % draw vert %%CJH + % axis at time 0 + else % ISSPEC + axis('off');plot([xmin xmin],[0 ymax],'color',axislcolor); + end + + % secondx = 200; % draw second vert axis + % axis('off');plot([secondx secondx],[ymin ymax],'color',axislcolor); + + axis('off'); + plot([xmin xmax],[0 0],'color',axislcolor); % draw horizontal axis + + if ~isempty(channels), % print channames + if ~ISSPEC + if ymin <= 0 & ymax >= 0, + yht = 0; + else + yht = nan_mean(SIGN*data(I,1+P*frames:1+P*frames+frames-1)); + end + axis('off'),h=text(xmin-0.04*xdiff,double(yht),[channames(I,:)]); + set(h,'HorizontalAlignment','right'); % print before traces + set(h,'FontSize',FONTSIZE); % choose font size + + % axis('off'),h=text(xmax+0.10*xdiff,yht,[channames(I,:)]); + % set(h,'HorizontalAlignment','left'); % print after traces + + else % ISSPEC + axis('off'),h=text(xmin-0.04*xdiff,ymax/2,[channames(I,:)]); + set(h,'HorizontalAlignment','right'); % print before traces + set(h,'FontSize',FONTSIZE); % choose font size + + % axis('off'),h=text(xmax+0.10*xdiff,ymax/2,[channames(I,:)]); + % set(h,'HorizontalAlignment','left'); % print after traces + + end; + end; + end; + + fprintf(' %d',I); + end; % subplot + end; % dataset + fprintf('\n'); +% +%%%%%%%%%%%%%%%%%% Make printed figure fill page %%%%%%%%%%%%%%%%%%%%%%%%%%% +% + curfig = gcf; + h=figure(curfig); + % set(h,'PaperPosition',[0.2 0.3 7.6 10]); % stretch out the plot on the page +% +%%%%%%%%%%%%%%%%%% Restore plot environment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + % set(h,'DefaultAxesYLim',aylim); % restore previous plotting parameters + % set(h,'DefaultAxesXLim',axlim); + % set(h,'DefaultAxesFontSize',axfont); + +%%%%%%%%%%%%%%%%%% Add axcopy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if plottitle + h = textsc(plottitle, 'title'); + set(h, 'fontsize', FONTSIZE); +end; +axcopy(gcf, 'axis on'); + +if 0, % START DETOUR XXXXXXXXXXXXX +% +%%%%%%%%%%%%%%%%%% Save plot to disk if asked %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if plotfile ~= '', % + n=0; y=1; + answer = input('plotdata: Save plot as Postscript file? (y/n) '); + if answer==1, + fprintf('\nSaving figure as %s ... ',plotfile); + curfig = gcf; + h=figure(curfig); + % set(h,'PaperPosition',[0.2 0.3 7.6 10]); + % stretch out the plot on the page + eval (['print -dpsc ' plotfile]); + fprintf('saved. Move or remove file!\n'); + unix(ls_plotfile); + end + end +end % END DETOUR XXXXXXXXXXXXX + +function out = nan_mean(in) + + nans = find(isnan(in)); + in(nans) = 0; + sums = sum(in); + nonnans = ones(size(in)); + nonnans(nans) = 0; + nonnans = sum(nonnans); + nononnans = find(nonnans==0); + nonnans(nononnans) = 1; + out = sum(in)./nonnans; + out(nononnans) = NaN; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/ploterp.m b/code/eeglab13_4_4b/functions/sigprocfunc/ploterp.m new file mode 100644 index 0000000..c3f723c --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/ploterp.m @@ -0,0 +1,151 @@ +% ploterp() - plot a selected multichannel data epoch on a common timebase +% +% Usage: >> ploterp(data,frames,epoch,[limits],'title',[plotchans]); +% +% Inputs: +% data = EEG/ERP data epoch (chans,frames) +% frames = frames per epoch {default: data length} +% epoch = epoch to plot {default: 1} +% [limits] = [xmin xmax ymin ymax] (x's in ms) +% {def|0 or both y's 0 -> data limits} +% 'title' = plot title {default|0 -> none} +% plotchans = data channels to plot {default|0 -> all} +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 6-11-98 +% +% See also: timtopo() + +% Copyright (C) 6-11-98 from plotdata() Scott Makeig, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function plot_handl = ploterp(data,frames,epoch,limits,titl,plotchans) + +LABELFONT = 16; +TICKFONT = 14; +TITLEFONT = 16; + +if nargin < 1 + help ploterp + return +end + +[chans,framestot] = size(data); +icadefs; + +if nargin < 6 + plotchans = 0; +end +if plotchans==0 + plotchans = 1:chans; +end + +if nargin < 5, + titl = ''; % DEFAULT TITLE +end + +if nargin < 4, + limits = 0; +end + +if nargin < 3 + epoch = 0; +end +if epoch == 0 + epoch = 1; +end + +if nargin<2 + frames = 0; +end +if frames == 0 + frames = size(data,2); +end +if floor(framestot/frames)*frames ~= framestot + fprintf('ploterp(): frames argument does not divide data length.\n'); + return +end +if epoch*frames > framestot + fprintf('ploterp(): data does not contain %d epochs of %d frames.\n',epoch,frames); + return +end + +% +%%%%%%%%%%%%%%%%%%%%%%% Read and adjust limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if limits==0, % == 0 or [0 0 0 0] + xmin=0; + xmax=frames-1; + ymin=min(min(data)); + ymax=max(max(data)); + else + if length(limits)~=4, + fprintf( ... + 'ploterp: limits should be 0 or an array [xmin xmax ymin ymax].\n'); + return + end; + xmin = limits(1); + xmax = limits(2); + ymin = limits(3); + ymax = limits(4); + end; + + if xmax == 0 & xmin == 0, + x = (0:1:frames-1); + xmin = 0; + xmax = frames-1; + else + dx = (xmax-xmin)/(frames-1); + x=xmin*ones(1,frames)+dx*(0:frames-1); % compute x-values + end; + if xmax<=xmin, + fprintf('ploterp() - xmax must be > xmin.\n') + return + end + + if ymax == 0 & ymin == 0, + ymax=max(max(data)); + ymin=min(min(data)); + end + if ymax<=ymin, + fprintf('ploterp() - ymax must be > ymin.\n') + return + end + +sampint = (xmax-xmin)/(frames-1); % sampling interval = 1000/srate; +x = xmin:sampint:xmax; % make vector of x-values + +% +%%%%%%%%%%%%%%%%%%%%%%% Plot the data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +cla % clear the current figure axes +set(gca,'YColor',BACKCOLOR); % set the background color +set(gca,'Color',BACKCOLOR); + +set(gca,'GridLineStyle',':') +set(gca,'Xgrid','off') +set(gca,'Ygrid','on') +set(gca,'Color',BACKCOLOR,'FontSize',TICKFONT,'FontWeight','bold'); +plot_handl=plot(x,data(plotchans,(epoch-1)*frames+1:epoch*frames)); % plot the data +title(titl,'fontsize',TITLEFONT,'FontWeight','bold'); + +l= xlabel('Time (ms)'); +set(l,'FontSize',LABELFONT,'FontWeight','bold'); +l=ylabel('Potential (uV)'); +set(l,'FontSize',LABELFONT,'FontWeight','bold'); +axis([xmin xmax ymin ymax]); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/plotmesh.m b/code/eeglab13_4_4b/functions/sigprocfunc/plotmesh.m new file mode 100644 index 0000000..097bae0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/plotmesh.m @@ -0,0 +1,88 @@ +% plotmesh() - plot mesh defined by faces and vertex +% +% Usage: +% plotmesh(faces, vertex); +% +% Input: +% faces - array of N x 3. Each row defines a triangle. The 3 points +% in each row are row indices in the matrix below. +% vertex - array of M x 3 points, (x = first colum; y=second colum +% z=3rd column). Each row defines a point in 3-D. +% +% Optional input: +% normal - normal orientation for each face (for better lighting) +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, 2003 + +% Copyright (C) May 6, 2003 Arnaud Delorme, SCCN/INC/UCSD, +% arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function p1 = plotmesh(faces, vertex, normal, newfig) + + if nargin < 2 + help plotmesh; + return; + end; + + FaceColor = [.8 .55 .35]*1.1; % ~= ruddy Caucasian - pick your complexion! + + if any(any(faces == 0)), faces = faces+1; end; + %vertex(:,3) = -vertex(:,3); + %FCmap = [jet(64); FaceColor; FaceColor; FaceColor]; + %colormap(FCmap) + %W = ones(1,size(vertex,1))*(size(FCmap,1)-1); + %W = ones(1,size(vertex,1))' * FaceColor; + %size(W) + if nargin < 4 + figure; + end; + if nargin < 3 + normal = []; + end; + if isempty(normal) + p1 = patch('vertices', vertex, 'faces', faces, ... + 'facecolor', [1,.75,.65]); + else + p1 = patch('vertices', vertex, 'faces', faces, ... + 'facecolor', [1,.75,.65], 'vertexnormals', normal); + end; + % 'FaceVertexCdata',W(:), 'FaceColor','interp', 'vertexnormals', normal); + set(p1,'EdgeColor','none') + + % Lights + %Lights = [-125 125 80; ... + % 125 125 80; ... + % 125 -125 125; ... + % -125 -125 125]; % default lights at four corners + %for i = 1:size(Lights,1) + % hl(i) = light('Position',Lights(i,:),'Color',[1 1 1],... + % 'Style','infinite'); + %end + %camlight left; + lightangle(45,30); + lightangle(45+180,30); + %set(gcf, 'renderer', 'zbuffer'); % cannot use alpha then + %set(hcap, 'ambientstrength', .6); + set(p1, 'specularcolorreflectance', 0, 'specularexponent',50); + + set(p1,'DiffuseStrength',.6,'SpecularStrength',0,... + 'AmbientStrength',.4,'SpecularExponent',5); + axis equal + view(18,8); + rotate3d + axis off; + lighting phong; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/plotsphere.m b/code/eeglab13_4_4b/functions/sigprocfunc/plotsphere.m new file mode 100644 index 0000000..85e62a9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/plotsphere.m @@ -0,0 +1,113 @@ +% plotsphere() - This function is used to plot a sphere and +% project them onto specific surfaces. This may +% be used for plotting dipoles for instance. +% +% Usage: +% >> handle = plotsphere(pos, rad, 'key', 'val') +% +% Inputs: +% pos - [x y z] 3-D position of the sphere center +% rad - [real] sphere radius +% +% Optional inputs: +% 'nvert' - number of vertices. Default is 15. +% 'color' - sphere color. Default is red. +% 'proj' - [x y z] project sphere to 3-D axes. Enter NaN for not +% projecting. For instance [-40 NaN -80] will project +% the sphere on the y/z plane axis at position x=-40 and on +% the x/y plane at position z=-80. +% 'projcol' - color of projected spheres +% 'colormap' - [real] sphere colormap { default: jet } +% +% Output: +% handle - sphere graphic handle(s). If projected sphere are ploted +% handles of plotted projected spheres are also returned. +% +% Example: +% figure; plotsphere([3 2 2], 1, 'proj', [0 0 -1]); +% axis off; axis equal; lighting phong; camlight left; view([142 48]) +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2004 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Copyright (C) Arnaud Delorme, 2004 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [handles] = plotsphere(pos, rad, varargin); + + if nargin < 2 + help plotsphere; + return; + end; + + g = finputcheck(varargin, { 'color' { 'real','string' } [] [1 0 0]; + 'nvert' 'integer' [2 Inf] 15; + 'proj' 'real' [] []; + 'colormap' 'real' [] jet(64); + 'projcol' { 'real','string' } [] [0 0 0] }, 'plotsphere'); + if isstr(g), error(g); end; + + % decode color if necessary + % ------------------------- + if ~isstr(g.color) & length(g.color) == 1 + g.color = g.colormap(g.color,:); + elseif isstr(g.color) + g.color = strcol2real(g.color); + end; + if ~isstr(g.projcol) & length(g.projcol) == 1 + g.projcol = g.colormap(g.projcol,:); + elseif isstr(g.projcol) + g.projcol = strcol2real(g.projcol); + end; + + % ploting sphere + % ============== + [xstmp ystmp zs] = sphere(g.nvert); + l=sqrt(xstmp.*xstmp+ystmp.*ystmp+zs.*zs); + normals = reshape([xstmp./l ystmp./l zs./l],[g.nvert+1 g.nvert+1 3]); + xs = pos(1) + rad*ystmp; + ys = pos(2) + rad*xstmp; + zs = pos(3) + rad*zs; + colorarray = repmat(reshape(g.color , 1,1,3), [size(zs,1) size(zs,2) 1]); + hold on; + handles = surf(xs, ys, zs, colorarray, 'tag', 'tmpmov', 'EdgeColor','none', 'VertexNormals', normals, ... + 'backfacelighting', 'lit', 'facelighting', 'phong', 'facecolor', 'interp', 'ambientstrength', 0.3); + %axis off; axis equal; lighting phong; camlight left; rotate3d + + % plot projections + % ================ + if ~isempty(g.proj) + colorarray = repmat(reshape(g.projcol, 1,1,3), [size(zs,1) size(zs,2) 1]); + if ~isnan(g.proj(1)), handles(end+1) = surf(g.proj(1)*ones(size(xs)), ys, zs, colorarray, ... + 'edgecolor', 'none', 'facelighting', 'none'); end; + if ~isnan(g.proj(2)), handles(end+1) = surf(xs, g.proj(2)*ones(size(ys)), zs, colorarray, ... + 'edgecolor', 'none', 'facelighting', 'none'); end; + if ~isnan(g.proj(3)), handles(end+1) = surf(xs, ys, g.proj(3)*ones(size(zs)), colorarray, ... + 'edgecolor', 'none', 'facelighting', 'none'); end; + end; + +function color = strcol2real(color) + switch color + case 'r', color = [1 0 0]; + case 'g', color = [0 1 0]; + case 'b', color = [0 0 1]; + case 'c', color = [0 1 1]; + case 'm', color = [1 0 1]; + case 'y', color = [1 1 0]; + case 'k', color = [0 0 0]; + case 'w', color = [1 1 1]; + otherwise, error('Unknown color'); + end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/plottopo.m b/code/eeglab13_4_4b/functions/sigprocfunc/plottopo.m new file mode 100644 index 0000000..64f52d9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/plottopo.m @@ -0,0 +1,767 @@ +% plottopo() - plot concatenated multichannel data epochs in a topographic +% or +% rectangular array. Uses a channel location file with the same +% format as topoplot(), or else plots data on a rectangular grid. +% If data are all positive, they are assumed to be spectra. +% Usage: +% >> plottopo(data, 'key1', 'val1', 'key2', 'val2') +% Or +% >> plottopo(data,'chan_locs',frames,limits,title,channels,... +% axsize,colors,ydir,vert) % old function call +% Inputs: +% data = data consisting of consecutive epochs of (chans,frames) +% or (chans,frames,n) +% +% Optional inputs: +% 'chanlocs' = [struct] channel structure or file plot ERPs at channel +% locations. See help readlocs() for data channel format. +% 'geom' = [rows cols] plot ERP in grid (overwrite previous option). +% Grid size for rectangular matrix. Example: [6 4]. +% 'frames' = time frames (points) per epoch {def|0 -> data length} +% 'limits' = [xmin xmax ymin ymax] (x's in ms or Hz) {def|0 +% (or both y's 0) -> use data limits) +% 'ylim' = [ymin ymax] y axis limits. Overwrite option above. +% 'title' = [string] plot title {def|'' -> none} +% 'chans' = vector of channel numbers to plot {def|0 -> all} +% 'axsize' = [x y] axis size {default [.05 .08]} +% 'legend' = [cell array] cell array of string for the legend. Note +% the last element can be an integer to set legend +% position. +% 'showleg' = ['on'|'off'] show or hide legend. +% 'colors' = [cell array] cell array of plot aspect. E.g. { 'k' 'k--' } +% for plotting the first curve in black and the second one +% in black dashed. Can also contain additional formating. +% { { 'k' 'linewidth' 2 } 'k--' } same as above but +% the first line is bolded. +% 'ydir' = [1|-1] y-axis polarity (pos-up = 1; neg-up = -1) {def -> -1} +% 'vert' = [vector] of times (in ms or Hz) to plot vertical lines +% {def none} +% 'hori' = [vector] plot horizontal line at given ordinate values. +% 'regions' = [cell array] cell array of size nchan. Each cell contains a +% float array of size (2,n) each column defining a time region +% [low high] to be highlighted. +% 'plotfunc' = [cell] use different function for plotting data. The format +% is { funcname arg2 arg3 arg2 ... }. arg1 is taken from the +% data. +% +% Author: Scott Makeig and Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 3-2-98 +% +% See also: plotdata(), topoplot() + +% Copyright (C) 3-2-98 from plotdata() Scott Makeig, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 5-11-98 added channels arg -sm +% 7-15-98 added ydir arg, made pos-up the default -sm +% 7-23-98 debugged ydir arg and pos-up default -sm +% 12-22-99 added grid size option, changed to sbplot() order -sm +% 03-16-00 added axcopy() feature -sm & tpj +% 08-21-00 debugged axheight/axwidth setting -sm +% 01-25-02 reformated help & license, added links -ad +% 03-11-02 change the channel names ploting position and cutomize pop-up -ad +% 03-15-02 added readlocs and the use of eloc input structure -ad +% 03-15-02 debuging chanlocs structure -ad & sm + +% 'chan_locs' = file of channel locations as in >> topoplot example {grid} +% ELSE: [rows cols] grid size for rectangular matrix. Example: [6 4] +% frames = time frames (points) per epoch {def|0 -> data length} +% [limits] = [xmin xmax ymin ymax] (x's in ms or Hz) {def|0 +% (or both y's 0) -> use data limits) +% 'title' = plot title {def|0 -> none} +% channels = vector of channel numbers to plot & label {def|0 -> all} +% else, filename of ascii channel-name file +% axsize = [x y] axis size {default [.07 .07]} +% 'colors' = file of color codes, 3 chars per line +% ( '.' = space) {0 -> default color order} +% ydir = y-axis polarity (pos-up = 1; neg-up = -1) {def -> pos-up} +% vert = [vector] of times (in ms or Hz) to plot vertical lines {def none} +% hori = [vector] of amplitudes (in uV or dB) to plot horizontal lines {def none} +% + +function plottopo(data, varargin); + +% +%%%%%%%%%%%%%%%%%%%%% Graphics Settings - can be customized %%%%%%%%%%%%%%%%%% +% +LINEWIDTH = 0.7; % data line widths (can be non-integer) +FONTSIZE = 10; % font size to use for labels +CHANFONTSIZE = 7; % font size to use for channel names +TICKFONTSIZE = 8; % font size to use for axis labels +TITLEFONTSIZE = 12; % font size to use for the plot title +PLOT_WIDTH = 0.95; % 0.75, width and height of plot array on figure +PLOT_HEIGHT = 0.88; % 0.88 +gcapos = get(gca,'Position'); axis off; +PLOT_WIDTH = gcapos(3)*PLOT_WIDTH; % width and height of gca plot array on gca +PLOT_HEIGHT = gcapos(4)*PLOT_HEIGHT; +curfig = gcf; % learn the current graphic figure number +% +%%%%%%%%%%%%%%%%%%%% Default settings - use commandline to override %%%%%%%%%%% +% +DEFAULT_AXWIDTH = 0.05; % +DEFAULT_AXHEIGHT = 0.08; % +DEFAULT_SIGN = -1; % Default - plot positive-up +ISRECT = 0; % default + +if nargin < 1 + help plottopo + return +end + +if length(varargin) > 0 + if length(varargin) == 1 | ~isstr(varargin{1}) | isempty(varargin{1}) | ... + (length(varargin)>2 & ~isstr(varargin{3})) + options = { 'chanlocs' varargin{1} }; + if nargin > 2, options = { options{:} 'frames' varargin{2} }; end; + if nargin > 3, options = { options{:} 'limits' varargin{3} }; end; + if nargin > 5, options = { options{:} 'chans' varargin{5} }; end; + if nargin > 6, options = { options{:} 'axsize' varargin{6} }; end; + if nargin > 7, options = { options{:} 'colors' varargin{7} }; end; + if nargin > 8, options = { options{:} 'ydir' varargin{8} }; end; + if nargin > 9, options = { options{:} 'vert' varargin{9} }; end; + if nargin > 10,options = { options{:} 'hori' varargin{10} }; end; + if nargin > 4 & ~isequal(varargin{4}, 0), options = {options{:} 'title' varargin{4} }; end; + % , chan_locs,frames,limits,plottitle,channels,axsize,colors,ydr,vert) + else + options = varargin; + end; +else + options = varargin; +end; +g = finputcheck(options, { 'chanlocs' '' [] ''; + 'frames' 'integer' [1 Inf] size(data,2); + 'chans' { 'integer','string' } { [1 Inf] [] } 0; + 'geom' 'integer' [1 Inf] []; + 'channames' 'string' [] ''; + 'limits' 'float' [] 0; + 'ylim' 'float' [] []; + 'title' 'string' [] ''; + 'plotfunc' 'cell' [] {}; + 'axsize' 'float' [0 1] [nan nan]; + 'regions' 'cell' [] {}; + 'colors' { 'cell','string' } [] {}; + 'legend' 'cell' [] {}; + 'showleg' 'string' {'on','off'} 'on'; + 'ydir' 'integer' [-1 1] DEFAULT_SIGN; + 'vert' 'float' [] []; + 'hori' 'float' [] []}); +if isstr(g), error(g); end; +data = reshape(data, size(data,1), size(data,2), size(data,3)); +%if length(g.chans) == 1 & g.chans(1) ~= 0, error('can not plot a single ERP'); end; + +[chans,framestotal]=size(data); % data size + +% +%%%%%%%%%%%%%%% Substitute defaults for missing parameters %%%%%%%%%%%%%%%% +% + +axwidth = g.axsize(1); +if length(g.axsize) < 2 + axheight = NaN; +else + axheight = g.axsize(2); +end; +if isempty(g.chans) | g.chans == 0 + g.chans = 1:size(data,1); +elseif ~isstr(g.chans) + g.chans = g.chans; +end + +nolegend = 0; +if isempty(g.legend), nolegend = 1; end; + +if ~isempty(g.ylim) + g.limits(3:4) = g.ylim; +end; +plotgrid = 0; +if isempty(g.chanlocs) % plot in a rectangular grid + plotgrid = 1; +elseif ~isfield(g.chanlocs, 'theta') + plotgrid = 1; +end; +if length(g.chans) < 4 & ~plotgrid + disp('Not enough channels, does not use channel coordinate to plot axis'); + plotgrid = 1; +end; +if plotgrid & isempty(g.geom) + n = ceil(sqrt(length(g.chans))); + g.geom = [n ceil(length(g.chans)/n)]; +end +if ~isempty(g.geom) + plotgrid = 1; +end; +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% Test parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + icadefs; % read BACKCOLOR, MAXPLOTDATACHANS constant from icadefs.m + if g.frames <=0, + g.frames = framestotal; % default + datasets=1; + elseif g.frames==1, + fprintf('plottopo: cannot plot less than 2 frames per trace.\n'); + return + datasets=1; + else + datasets = fix(framestotal/g.frames); % number of traces to overplot + end; + + if max(g.chans) > chans + fprintf('plottopo(): max channel index > %d channels in data.\n',... + chans); + return + end + if min(g.chans) < 1 + fprintf('plottopo(): min channel index (%g) < 1.\n',... + min(g.chans)); + return + end; + if length(g.chans)>MAXPLOTDATACHANS, + fprintf('plottopo(): not set up to plot more than %d traces.\n',... + MAXPLOTDATACHANS); + return + end; + + if datasets>MAXPLOTDATAEPOCHS + fprintf('plottopo: not set up to plot more than %d epochs.\n',... + MAXPLOTDATAEPOCHS); + return + end; + if datasets<1 + fprintf('plottopo: cannot plot less than 1 epoch!\n'); + return + end; + + if ~isempty(g.geom) + if isnan(axheight) % if not specified + axheight = gcapos(4)/(g.geom(1)+1); + axwidth = gcapos(3)/(g.geom(2)+1); + end + % if chan_locs(2) > 5 + % axwidth = 0.66/(chan_locs(2)+1); + % end + else + axheight = DEFAULT_AXHEIGHT; + axwidth = DEFAULT_AXWIDTH; + end + fprintf('Plotting data using axis size [%g,%g]\n',axwidth,axheight); + + % + %%%%%%%%%%%%% Extend the size of the plotting area in the window %%%%%%%%%%%% + % + curfig = gcf; + h=figure(curfig); + set(h,'PaperUnits','normalized'); % use percentages to avoid US/A4 difference + set(h,'PaperPosition',[0.0235308 0.0272775 0.894169 0.909249]); % equivalent + orient portrait + axis('normal'); + + set(gca,'Color',BACKCOLOR); % set the background color + + axcolor= get(0,'DefaultAxesXcolor'); % find what the default x-axis color is + vertcolor = 'k'; + horicolor = vertcolor; + +% % +% %%%%%%%%%%%%%%%%%%%% Read the channel names %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% if isempty(g.channames) +% if ~isstr(g.chans) +% % g.channames = zeros(MAXPLOTDATACHANS,4); +% % for c=1:length(g.chans), +% % g.channames(c,:)= sprintf('%4d',g.chans(c)); +% % end; +% if length(g.chans) > 1 | g.chans(1) ~= 0 +% g.channames = num2str(g.chans(:)); %%CJH +% end; +% else % isstr(g.chans) +% chid = fopen(g.chans,'r'); +% if chid <3, +% fprintf('plottopo(): cannot open file %s.\n',g.chans); +% return +% else +% fprintf('plottopo(): opened file %s.\n',g.chans); +% end; +% +% %%%%%%% +% % fid=fopen('fgetl.m'); +% % while 1 +% % line = fgetl(fid); +% % if ~isstr(line), break, end +% % disp(line) +% % end +% % end +% % fclose(fid); +% %%%%%%% +% +% g.channames = fscanf(chid,'%s',[4 MAXPLOTDATACHANS]); +% g.channames = g.channames'; +% [r c] = size(g.channames); +% for i=1:r +% for j=1:c +% if g.channames(i,j)=='.', +% g.channames(i,j)=' '; +% end; +% end; +% end; +% end; % setting g.channames +% end; +% + % + %%%%%%%%%%%%%%%%%%%%%%%%% Plot and label specified channels %%%%%%%%%%%%%%%%%% + % + data = data(g.chans,:); + chans = length(g.chans); + + % + %%%%%%%%%%%%%%%%%%%%%%%%% Read the color names %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if isstr(g.colors) % filename for backward compatibility but not documented + cid = fopen(g.colors,'r'); + % fprintf('cid = %d\n',cid); + if cid <3, + fprintf('plottopo: cannot open file %s.\n',g.colors); + return + end; + g.colors = fscanf(cid,'%s',[3 MAXPLOTDATAEPOCHS]); + g.colors = g.colors'; + [r c] = size(g.colors); + for i=1:r + for j=1:c + if g.colors(i,j)=='.', + g.colors(i,j)=' '; + end; + end; + end; + g.colors = cellstr(g.colors); + for c=1:length(g.colors) % make white traces black unless axis color is white + if g.colors{c}(1)=='w' & axcolor~=[1 1 1] + g.colors{c}(1)='k'; + end + end + else % use default color order (no yellow!) + tmpcolors = { 'b' 'r' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' ... + 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm'}; + g.colors = {g.colors{:} tmpcolors{:}}; % make > 64 available + end; + % + %%%%%%%%%%%%%%%%%%%%%%% Read and adjust limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if g.limits==0, % == 0 or [0 0 0 0] + xmin=0; + xmax=g.frames-1; + % for abs max scaling: + ymax=max(max(abs(data))); + ymin=ymax*-1; + % for data limits: + %ymin=min(min(data)); + %ymax=max(max(data)); + else + if length(g.limits)~=4, + error('plottopo: limits should be 0 or an array [xmin xmax ymin ymax].\n'); + end; + xmin = g.limits(1); + xmax = g.limits(2); + ymin = g.limits(3); + ymax = g.limits(4); + end; + + if xmax == 0 & xmin == 0, + x = (0:1:g.frames-1); + xmin = 0; + xmax = g.frames-1; + else + dx = (xmax-xmin)/(g.frames-1); + x=xmin*ones(1,g.frames)+dx*(0:g.frames-1); % compute x-values + end; + if xmax<=xmin, + fprintf('plottopo() - xmax must be > xmin.\n') + return + end + + if ymax == 0 & ymin == 0, + % for abs max scaling: + ymax=max(max(abs(data))); + ymin=ymax*-1; + % for data limits: + %ymin=min(min(data)); + %ymax=max(max(data)); + end + if ymax<=ymin, + fprintf('plottopo() - ymax must be > ymin.\n') + return + end + + xlabel = 'Time (ms)'; + % + %%%%%%%%%%%%%%%%%%%%%% Set up plotting environment %%%%%%%%%%%%%%%%%%%%%%%%% + % + % h = gcf; + % set(h,'YLim',[ymin ymax]); % set default plotting parameters + % set(h,'XLim',[xmin xmax]); + % set(h,'FontSize',18); + % set(h,'DefaultLineLineWidth',1); % for thinner postscript lines + % + %%%%%%%%%%%%%%%%%%%%%%%%%% Print plot info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % clf; % clear the current figure + + % print plottitle over (left) subplot 1 + figure(curfig); h=gca;title(g.title,'FontSize',TITLEFONTSIZE); % title plot + hold on + msg = ['Plotting %d traces of %d frames with colors: ']; + + for c=1:datasets + cind = mod(c-1, length(g.colors))+1; + if iscell(g.colors{cind}) + msg = [msg '''' g.colors{cind}{1} ''' ' ]; + else + msg = [msg '''' g.colors{cind} ''' ' ]; + end; + end + msg = [msg '\n']; % print starting info on screen . . . + fprintf('limits: [xmin,xmax,ymin,ymax] = [%4.1f %4.1f %4.2f %4.2f]\n',... + xmin,xmax,ymin,ymax); + fprintf(msg,datasets,g.frames); + + set(h,'FontSize',FONTSIZE); % choose font size + set(h,'YLim',[ymin ymax]); % set default plotting parameters + set(h,'XLim',[xmin xmax]); + + axis('off') + % + %%%%%%%%%%%%%%%%%%%%%%%%%%% Read chan_locs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if plotgrid + ISRECT = 1; + ht = g.geom(1); + wd = g.geom(2); + if chans > ht*wd + fprintf('plottopo(): (%d) channels to be plotted > grid size [%d %d]\n',... + chans,ht,wd); + return + end + xvals = 0; yvals = 0; + if isempty(g.channames) + if isfield(g.chanlocs,'labels') && ~iscellstr({g.chanlocs.labels}) + g.channames = strvcat(g.chanlocs.labels); + else + g.channames = repmat(' ',ht*wd,4); + for i=1:ht*wd + channum = num2str(i); + g.channames(i,1:length(channum)) = channum; + end + end + end + + else % read chan_locs file + % read the channel location file + % ------------------------------ + if isstruct(g.chanlocs) + nonemptychans = cellfun('isempty', { g.chanlocs.theta }); + nonemptychans = find(~nonemptychans); + [tmp g.channames Th Rd] = readlocs(g.chanlocs(nonemptychans)); + g.channames = strvcat({ g.chanlocs.labels }); + else + [tmp g.channames Th Rd] = readlocs(g.chanlocs); + g.channames = strvcat(g.channames); + nonemptychans = [1:length(g.channames)]; + end; + Th = pi/180*Th; % convert degrees to radians + Rd = Rd; + + if length(g.chans) > length(g.chanlocs), + error('plottopo(): data channels must be <= ''chanlocs'' channels') + end + + [yvalstmp,xvalstmp] = pol2cart(Th,Rd); % translate from polar to cart. coordinates + xvals(nonemptychans) = xvalstmp; + yvals(nonemptychans) = yvalstmp; + + % find position for other channels + % -------------------------------- + totalchans = length(g.chanlocs); + emptychans = setdiff_bc(1:totalchans, nonemptychans); + totalchans = floor(sqrt(totalchans))+1; + for index = 1:length(emptychans) + xvals(emptychans(index)) = 0.7+0.2*floor((index-1)/totalchans); + yvals(emptychans(index)) = -0.4+mod(index-1,totalchans)/totalchans; + end; + g.channames = g.channames(g.chans,:); + xvals = xvals(g.chans); + yvals = yvals(g.chans); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % xvals = 0.5+PLOT_WIDTH*xvals; % controls width of plot array on page! + % yvals = 0.5+PLOT_HEIGHT*yvals; % controls height of plot array on page! + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if length(xvals) > 1 + if length(unique(xvals)) > 1 + xvals = (xvals-mean([max(xvals) min(xvals)]))/(max(xvals)-min(xvals)); % recenter + xvals = gcapos(1)+gcapos(3)/2+PLOT_WIDTH*xvals; % controls width of plot + % array on current axes + end; + end; + yvals = gcapos(2)+gcapos(4)/2+PLOT_HEIGHT*yvals; % controls height of plot + % array on current axes + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot traces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + xdiff=xmax-xmin; + ydiff=ymax-ymin; + + Axes = []; + for P=0:datasets-1, % for each data epoch + fprintf('trace %d: ',P+1); + + for c=1:chans, %%%%%%%% for each data channel %%%%%%%%%%%%%%%%%%%%%%%%%% + + if P>0 % subsequent pages (Axes specified) + axes(Axes(c)) + hold on; % plot down left side of page first + axis('off') + else % first page, specify axes + if plotgrid + Axes = [ Axes sbplot(g.geom(1), g.geom(2), c)]; + else + xcenter = xvals(c); + ycenter = yvals(c); + Axes = [Axes axes('Units','Normal','Position', ... + [xcenter-axwidth/2 ycenter-axheight/2 axwidth axheight])]; + end; + %axes(Axes(c)) + axis('off') + + hold on; % plot down left side of page first + % set(h,'YLim',[ymin ymax]); % set default plotting parameters + % set(h,'XLim',[xmin xmax]); + + axislcolor = get(gca,'Xcolor'); %%CJH + + axis('off'); + + % secondx = 200; % draw second vert axis + % axis('off');plot([secondx secondx],[ymin ymax],'color',axislcolor); + % + %%%%%%%%%%%%%%%%%%%%%%% Print channel names %%%%%%%%%%%%%%%%%%%%%%%%%% + % + NAME_OFFSET = -.25; + NAME_OFFSETY = .2; + if ymin <= 0 & ymax >= 0, + yht = 0; + else + yht = mean(data(c,1+P*g.frames:1+P*g.frames+g.frames-1)); + end + if ~ISRECT % print before traces + xt = double(xmin-NAME_OFFSET*xdiff); + yt = double(yht-NAME_OFFSETY*ydiff); + str = [g.channames(c,:)]; + h=text(xt,yt,str); + set(h,'HorizontalAlignment','right'); + %set(h,'FontSize',CHANFONTSIZE); % choose font size + else % ISRECT + xmn = xdiff/2+xmin; + h=text(double(xmn),double(ymax+0.05*ymax),[g.channames(c,:)]); + set(h,'HorizontalAlignment','right'); + %set(h,'FontSize',CHANFONTSIZE); % choose font size + end % ISRECT + + + % + %%%%%%%%%%%%%%%%%%%%%%% Highlight regions %%%%%%%%%%%%%%%%%%%%%%%%%% + % + if ~isempty(g.regions) + for index=1:size(g.regions{c},2) + tmpreg = g.regions{c}(:,index); + if tmpreg(1) ~= tmpreg(2) + tmph = patch([tmpreg(1) tmpreg(2) tmpreg(2) tmpreg(1)], ... + [-100 -100 100 100], [0.9 0.9 0.9]); hold on; + set(tmph, 'edgecolor', [0.9 0.9 0.9]); %,'facealpha',0.5,'edgealpha',0.5); + end; + end; + end; + + end; % P=0 + + % + %%%%%%%%%%%%%%%%%%%%%%% Plot data traces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + Pind = mod(P+1-1, length(g.colors))+1; + if ~iscell( g.colors{Pind} ), tmpcolor = { g.colors{Pind} 'linewidth' LINEWIDTH }; + else tmpcolor = g.colors{Pind}; + end; + ymn = min([ymax ymin]); + ymx = max([ymax ymin]); + if isempty(g.plotfunc) + if isstr(tmpcolor{1}) & length(tmpcolor) > 1 + plot(x,data(c,1+P*g.frames:1+P*g.frames+g.frames-1), tmpcolor{1}, tmpcolor{2:end}); + else + plot(x,data(c,1+P*g.frames:1+P*g.frames+g.frames-1), 'color', tmpcolor{:}); + end; + if g.ydir == -1 + set(gca, 'ydir', 'reverse'); + end; + axis([xmin xmax ymn ymx]); % set axis bounds + elseif P == 1 + func = eval( [ '@' g.plotfunc{1} ] ); + feval(func, data(c,:), g.plotfunc{2:end}); + end; + + if P == datasets-1 % last pass + % + %%%%%%%%%%%%%%%%%%%%%%% Plot lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + plot([0 0],[ymin ymax],'color',axislcolor); % draw vert axis at time 0 + axis('off'); + plot([xmin xmax],[0 0],'color',axislcolor); % draw horizontal axis + + % + %%%%%%%%%%%%%%%%%%%% plot vertical lines (optional) %%%%%%%%%%%%%%%%% + % + + if isempty(g.vert) + g.vert = [xmin xmax]; + ymean = (ymin+ymax)/2; + vmin = ymean-0.1*(ymean-ymin); + vmax = vmin*-1; %ymean+0.2*(ymax-ymean); + elseif ~isnan(g.vert) + ymean = (ymin+ymax)/2; + vmin = ymean-0.1*(ymean-ymin); + vmax = vmin*-1; %ymean+0.2*(ymax-ymean); + for v = g.vert + plot([v v],[vmin vmax],'color',vertcolor); % draw vertical lines + end + end + + % + %%%%%%%%%%%%%%%%%%%% plot horizontal lines (optional) %%%%%%%%%%%%%%% + % + if isempty(g.hori) + g.hori = [ymin ymax]; + end + if ~isnan(g.hori) + xmean = 0; + hmin = xmean-0.2*(xmean-xmin); + hmax = hmin*-1; %xmean+0.3*(xmax-xmean); + for v = g.hori + plot([hmin hmax],[v v], 'color',horicolor); % draw horizontal lines + end + end + + end; + + fprintf(' %d',c); % finished with channel plot + end; % c, chans / subplot + % handle legend + if nolegend, g.legend{P+1} = ['Data ' int2str(P) ]; end; + + fprintf('\n'); + end; % P / epoch + + % + %%%%%%%%%%%%%%%%%%%%% Make time and amp cal bar %%%%%%%%%%%%%%%%%%%%%%%%% + % + ax = axes('Units','Normal','Position', ... + [0.85 0.1 axwidth axheight]); % FIX!!!! + axes(ax) + axis('off'); + if xmin <=0 + figure(curfig);p=plot([0 0],[ymn ymx],'color','k'); % draw vert axis at zero + else + figure(curfig);p=plot([xmin xmin],[ymn ymx],'color','k'); % draw vert axis at zero + end + if g.ydir == -1 + set(gca, 'ydir', 'reverse'); + end; + axis([xmin xmax ymn ymx]); % set axis values + hold on + %set(p, 'Clipping','off'); % center text + figure(curfig);p=plot([xmin xmax],[0 0],'color',axislcolor); % draw horizontal axis + axis([xmin xmax ymin ymax]); % set axis values + % + %%%%%%%%%%%%%%%%%%%% plot vertical lines (optional) %%%%%%%%%%%%%%%%% + % + if ~isnan(g.vert) + for v = g.vert + figure(curfig);plot([v v],[vmin vmax],'color',vertcolor); % draw vertical lines + end + end + % + %%%%%%%%%%%%%%%%%%%% plot horizontal lines (optional) %%%%%%%%%%%%%%%%% + % + if ~isnan(g.hori) + xmean = 0; + hmin = xmean-0.2*(xmean-xmin); + hmax = hmin*-1; %xmean+0.3*(xmax-xmean); + for v = g.hori + figure(curfig);plot([hmin hmax],[v v], 'color',horicolor); % draw horizontal lines + end + end + + % secondx = 200; % draw second vert axis + % axis('off');plot([secondx secondx],[ylo ymax],'color',axislcolor); + % + %%%%%%%%%%%%%%%%%%%%% Plot negative-up %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + signx = xmin-0.15*xdiff; + figure(curfig);axis('off');h=text(double(signx),double(ymin),num2str(ymin,3)); % text ymin + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','right','Clipping','off'); + + figure(curfig);axis('off');h=text(double(signx), double(ymax),['+' num2str(ymax,3)]); % text +ymax + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','right','Clipping','off'); + + ytick = g.ydir*(-ymax-0.3*ydiff); + figure(curfig);tick = [int2str(xmin)]; h=text(double(xmin),double(ytick),tick); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + tick = [xlabel]; figure(curfig);h=text(double(xmin+xdiff/2),double(ytick-0.5*g.ydir*ydiff),tick); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + tick = [int2str(xmax)]; figure(curfig);h=text(double(xmax),double(ytick),tick); + set(h,'FontSize',TICKFONTSIZE); % choose font size + set(h,'HorizontalAlignment','center',... + 'Clipping','off'); % center text + + if length(g.legend) > 1 & strcmpi(g.showleg, 'on') + tmpleg = vararg2str(g.legend); + quotes = find(tmpleg == ''''); + for index = length(quotes):-1:1 + tmpleg(quotes(index)+1:end+1) = tmpleg(quotes(index):end); + tmpleg(quotes(index)) = ''''; + end; + tmpleg = [ 'legend(' tmpleg ');' ]; + else tmpleg = ''; + end; + com = [ 'axis on;' ... + 'clear xlabel ylabel;' tmpleg ... + 'xlabel(''''Time (ms)'''');' ... + 'ylabel(''''Potential (\muV)'''');' ]; + axcopy(gcf, com); % turn on popup feature + % + %%%%%%%%%%%%%%%%%% Make printed figure fill page %%%%%%%%%%%%%%%%%%%%%%%%%%% + % + orient tall + % curfig = gcf; + % h=figure(curfig); + % set(h,'PaperPosition',[0.2 0.3 7.6 10]); % stretch out the plot on the page + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/posact.m b/code/eeglab13_4_4b/functions/sigprocfunc/posact.m new file mode 100644 index 0000000..fba4263 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/posact.m @@ -0,0 +1,97 @@ +% posact() - Make runica() activations all RMS-positive. +% Adjust weights and inverse weight matrix accordingly. +% +% Usage: >> [actout,winvout,weightsout] = posact(data,weights,sphere) +% +% Inputs: +% data = runica() input data +% weights = runica() weights +% sphere = runica() sphere {default|0 -> eye()} +% +% Outputs: +% actout = activations reoriented to be RMS-positive +% winvout = inv(weights*sphere) reoriented to match actout +% weightsout = weights reoriented to match actout (sphere unchanged) +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 11/97 + +% Copyright (C) 11/97 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license, added links -ad + +function [actout,winvout,weightsout] = posact(data,weights,sphere) + +if nargin < 2 + help posact + return +end +if nargin < 3 + sphere = 0; +end + +[chans,frames]=size(data); +[r,c]=size(weights); +if sphere == 0 + sphere = eye(chans); +end +[sr,sc] = size(sphere); +if sc~= chans + fprintf('posact(): Sizes of sphere and data do not agree.\n') + return +elseif c~=sr + fprintf('posact(): Sizes of weights and sphere do not agree.\n') + return +end + +activations = weights*sphere*data; + +if r==c + winv = inv(weights*sphere); +else + winv = pinv(weights*sphere); +end + +[rows,cols] = size(activations); + +actout = activations; +winvout = winv; + +fprintf('Inverting negative activations: '); +for r=1:rows, + pos = find(activations(r,:)>=0); + posrms = sqrt(sum(activations(r,pos).*activations(r,pos))/length(pos)); + neg = find(activations(r,:)<0); + negrms = sqrt(sum(activations(r,neg).*activations(r,neg))/length(neg)); + if negrms>posrms + fprintf('-'); + actout(r,:) = -1*activations(r,:); + winvout(:,r) = -1*winv(:,r); + end + fprintf('%d ',r); +end +fprintf('\n'); + +if nargout>2 + if r==c, + weightsout = inv(winvout); + else + weightsout = pinv(winvout); + end + if nargin>2 % if sphere submitted + weightsout = weightsout*inv(sphere); % separate out the sphering + end +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/projtopo.m b/code/eeglab13_4_4b/functions/sigprocfunc/projtopo.m new file mode 100644 index 0000000..712ac58 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/projtopo.m @@ -0,0 +1,133 @@ +% projtopo() - plot projections of one or more ICA components along with +% the original data in a 2-d topographic array. Returns +% the data plotted. Click on subplot to examine separately. +% Usage: +% >> [projdata] = projtopo(data,weights,[compnums],'chan_locs',... +% 'title',[limits],colors,chans); +% Inputs: +% data = single epoch of runica() input data (chans,frames) +% weights = unimxing weight matrix (runica() weights*sphere) +% [compnums] = vector of component numbers to project and plot +% 'chan_locs' = channel locations file. Example: >> topoplot example +% Else [rows cols] for rectangular grid array +% Optional: +% 'title' = (short) plot title {default|0 -> none} +% [limits] = [xmin xmax ymin ymax] (x's in msec) +% {default|0|both y's 0 -> use data limits} +% colors = file of color codes, 3 chars per line ('.' = space) +% {default|0 -> default color order (black/white first)} +% chans = vector of channel numbers to plot {default|0: all} +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 04-02-98 +% +% See also: plotproj(), topoplot() + +% Copyright (C) 04-02-98 from plotproj() Scott Makeig, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Without color arg, reads filename for PROJCOLORS from icadefs.m + +% 03-15-00 added plotchans arg -sm +% 03-16-00 added axcopy() feature -sm & tpj +% 12-19-00 adjusted new icaproj() args -sm +% 12-20-00 removed argument "sphere" -sm +% 07-12-01 fixed nargin test to allow 8 args -sm & cmk +% 01-25-02 reformated help & license, added links -ad + +function [projdata] = projtopo(data,weights,compnums,chan_locs,titl,limits,colors,plotchans) + +icadefs % read default PROJCOLORS & MAXPLOTDATACHANS variables from icadefs.m +axsize = 0; % use plottopo() default +DEFAULT_TITLE = ''; +% +% Substitute for missing arguments +% +if nargin < 7, + colors = 'white1st.col'; +elseif colors==0 | isempty(colors) + colors = 'white1st.col'; +end + +if nargin < 6, + limits = 0; +end +if nargin < 5, + titl = 0; +end +if titl==0, + titl = DEFAULT_TITLE; +end + +if nargin < 4 | nargin > 8 + help projtopo + fprintf('projtopo(): requires 4-8 arguments.\n\n'); + return +end +% +% Test data size +% +[chans,framestot] = size(data); +if ~exist('plotchans') | isempty(plotchans) | plotchans==0 + plotchans = 1:chans; % default +end +frames = framestot; % assume one epoch + +[wr,wc] = size(weights); +% +% Substitute for 0 arguments +% +if compnums == 0, + compnums = [1:wr]; +end; +if size(compnums,1)>1, % handle column of compnums ! + compnums = compnums'; +end; +if length(compnums) > MAXPLOTDATACHANS, + fprintf(... + 'projtopo(): cannot plot more than %d channels of data at once.\n',... + MAXPLOTDATACHANS); + return +end; + +if max(compnums)>wr, + fprintf(... + '\n projtopo(): Component index (%d) > number of components (%d).\n', ... + max(compnums),wr); + return +end + +fprintf('Reconstructing (%d chan, %d frame) data summing %d components.\n', ... + chans,frames,length(compnums)); +% +% Compute projected data for single components +% +projdata = data; +fprintf('projtopo(): Projecting component(s) '); +for s=compnums, % for each component + fprintf('%d ',s); + proj = icaproj(data,weights,s); % let offsets distribute + projdata = [projdata proj]; % append projected data onto projdata +end; +fprintf('\n'); +% +% Make the plot +% +% >> plottopo(data,'chan_locs',frames,limits,title,channels,axsize,colors,ydir) + +plottopo(projdata,chan_locs,size(data,2),limits,titl,plotchans,axsize,colors); + % make the plottopo() plot +axcopy(gcf); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/qqdiagram.m b/code/eeglab13_4_4b/functions/sigprocfunc/qqdiagram.m new file mode 100644 index 0000000..2ab37d2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/qqdiagram.m @@ -0,0 +1,146 @@ +% qqdiagram() - Empirical quantile-quantile diagram. +% +% Description: +% The quantiles (percentiles) of the input distribution Y are plotted (Y-axis) +% against the corresponding quantiles of the input distribution X. +% If only X is given, the corresponding quantiles are plotted (Y-axis) +% against the quantiles of a Gaussian distribution ('Normal plot'). +% Two black dots indicate the lower and upper quartiles. +% If the data in X and Y belong the same distribution the plot will be linear. +% In this case,the red and black reference lines (.-.-.-.-) will overlap. +% This will be true also if the data in X and Y belong to two distributions with +% the same shape, one distribution being rescaled and shifted with respect to the +% other. +% If only X is given, a line is plotted to indicate the mean of X, and a segment +% is plotted to indicate the standard deviation of X. If the data in X are normally +% distributed, the red and black reference lines (.-.-.-.-) will overlap. +% +% Usage: +% >> ah = qqdiagram( x, y, pk ); +% +% Inputs: +% x - vector of observations +% +% Optional inputs: +% y - second vector of observation to compare the first to +% pk - the empirical quantiles will be estimated at the values in pk [0..1] +% +% Author: Luca Finelli, CNL / Salk Institute - SCCN, 20 August 2002 +% +% Reference: Stahel W., Statistische Datenanalyse, Vieweg, Braunschweig/Wiesbaden, 1995 +% +% See also: +% quantile(), signalstat(), eeglab() + +% Copyright (C) 2002 Luca Finelli, Salk/SCCN, La Jolla, CA +% +% Reference: Stahel, W. Statistische Datenanalyse, Vieweg, Braunschweig/Wiesbaden 1995 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function qqdiagram( x , y, pk ) + +if nargin < 1 + help qqdiagram; + return; +end; + +if (nargin == 3 & (any(pk > 1) | any(pk < 0))) + error('qqdiagram(): elements in pk must be between 0 and 1'); +end + +if nargin==1 + y=x; + nn=max(1000,10*length(y))+1; + x=randn(1,nn); +end + +if nargin < 3 + nx=sum(~isnan(x)); + ny=sum(~isnan(y)); + k=min(nx,ny); + pk=((1:k) - 0.5) ./ k; % values to estimate the empirical quantiles at +else + k=length(pk); +end + +if nx==k + xx=sort(x(~isnan(x))); +else + xx=quantile(x(~isnan(x)),pk); +end + +if ny==k + yy=sort(y(~isnan(y))); +else + yy=quantile(y(~isnan(y)),pk); +end + +% QQ diagram +plot(xx,yy,'+') +hold on + +% x-axis range +maxx=max(xx); +minx=min(xx); +rangex=maxx-minx; +xmin=minx-rangex/50; +xmax=maxx+rangex/50; + +% Quartiles +xqrt1=quantile(x,0.25); xqrt3=quantile(x,0.75); +yqrt1=quantile(y,0.25); yqrt3=quantile(y,0.75); + +plot([xqrt1 xqrt3],[yqrt1 yqrt3],'k-','LineWidth',2); % IQR range + +% Drawing the line +sigma=(yqrt3-yqrt1)/(xqrt3-xqrt1); +cy=(yqrt1 + yqrt3)/2; + +if nargin ==1 + maxy=max(y); + miny=min(y); + rangey=maxy-miny; + ymin=miny-rangey/50; + ymax=maxy+rangey/50; + + plot([(miny-cy)/sigma (maxy-cy)/sigma],[miny maxy],'r-.') % the line + % For normally distributed data, the slope of the plot line + % is equal to the ratio of the standard deviation of the distributions + plot([0 (maxy-mean(y))/std(y)],[mean(y) maxy],'k-.') % the ideal line + + xlim=get(gca,'XLim'); + plot([1 1],[ymin mean(y)+std(y)],'k--') + plot([1 1],[mean(y) mean(y)+std(y)],'k-','LineWidth',2) + % textx = 1.0; + % texty = mean(y)+3.0*rangey/50.0; + % text(double(textx), double(texty),' St. Dev.','horizontalalignment','center') + set(gca,'xtick',get(gca,'xtick')); % show that vertical line is at 1 sd + plot([0 0],[ymin mean(y)],'k--') + plot(xlim,[mean(y) mean(y)],'k--') + % text(double(xlim(1)), double(mean(y)+rangey/50),'Mean X') + plot([xqrt1 xqrt3],[yqrt1 yqrt3],'k.','MarkerSize',10) + set(gca,'XLim',[xmin xmax],'YLim',[ymin ymax]) + xlabel('Standard Normal Quantiles') + ylabel('X Quantiles') +else + cx=(xqrt1 + xqrt3)/2; + maxy=cy+sigma*(max(x)-cx); + miny=cy-sigma*(cx-min(x)); + + plot([min(x) max(x)],[miny maxy],'r-.'); % the line + xlabel('X Quantiles'); + ylabel('Y Quantiles'); +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/quantile.m b/code/eeglab13_4_4b/functions/sigprocfunc/quantile.m new file mode 100644 index 0000000..ae23bfd --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/quantile.m @@ -0,0 +1,85 @@ +% quantile() - computes the quantiles of the data sample from a distribution X +% +% Description: +% If F is the cumulative distribution function (CDF) of X, +% the p-th-quantile Qp of distribution X is the value for which holds +% F(x) < p, for x < Qp, and +% F(x) >= p, for x >= Qp. +% for example, for p = 0.5, Qp is the median of X. p must be in [0..1]. +% +% Usage: +% >> q = quantile( data, pc ); +% +% Inputs: +% data - vector of observations +% pc - the quantiles will be estimated at the values in pc [0..1] +% +% Outputs: +% q - pc-th-quantiles of the distribution generating the observation +% +% Authors: Scott Makeig & Luca Finelli, CNL/Salk Institute-SCCN, August 21, 2002 +% +% Note: this function overload the function from the statistics toolbox. In +% case the statistic toolbox is present, the function from the +% statistics toolbox is being called instead. +% +% See also: +% pop_sample(), eeglab() + +% Copyright (C) Scott Makeig & Luca Finelli, CNL/Salk Institute-SCCN, August 21, 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function q = quantile(data,varargin); + +% detect overloaded method in stat toolbox +curPath = fileparts(which('quantile')); +rmpath(curPath); +path2 = fileparts(which('quantile')); +addpath(curPath); +if ~isempty(path2) + addpath(path2); + q = quantile(data,varargin{:}); + return; +else + pc = varargin{1}; +end; + +if nargin < 2 + help quantile; + return; +end; + +[prows pcols] = size(pc); +if prows ~= 1 & pcols ~= 1 + error('pc must be a scalar or a vector.'); +end +if any(pc > 1) | any(pc < 0) + error('pc must be between 0 and 1'); +end +[i,j] = size(data); +sortdata = sort(data); +if i==1 | j==1 % if data is a vector + i = max(i,j); j = 1; + if i == 1, + fprintf(' quantile() note: input data is a single scalar!\n') + q = data*ones(length(pc),1); % if data is scalar, return it + return; + end + sortdata = sortdata(:); +end +pt = [0 ((1:i)-0.5)./i 1]; +sortdata = [min(data); sortdata; max(data)]; +q = interp1(pt,sortdata,pc); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readbdf.m b/code/eeglab13_4_4b/functions/sigprocfunc/readbdf.m new file mode 100644 index 0000000..75a710a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readbdf.m @@ -0,0 +1,90 @@ +% readbdf() - Loads selected Records of an EDF or BDF File (European Data Format +% for Biosignals) into MATLAB. This function is outdate +% Use the functions sopen() and sread() instead +% +% This program is deprecated (obsolete). Use the sopen() and sread() +% function instead + +% Version 2.11 +% 03.02.1998 +% Copyright (c) 1997,98 by Alois Schloegl +% a.schloegl@ieee.org + +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 2 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This program has been modified from the original version for .EDF files +% The modifications are to the number of bytes read on line 53 (from 2 to +% 3) and to the type of data read - line 54 (from int16 to bit24). Finally the name +% was changed from readedf to readbdf +% T.S. Lorig Sept 6, 2002 +% +% Header modified for eeglab() compatibility - Arnaud Delorme 12/02 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [DAT,S]=readbdf(DAT,Records,Mode) + + disp('This function is outdated'); + disp('Use the functions sopen() and sread() instead'); + return; + +if nargin<3 Mode=0; end; + +EDF=DAT.Head; +RecLen=max(EDF.SPR); + +S=NaN*zeros(RecLen,EDF.NS); +DAT.Record=zeros(length(Records)*RecLen,EDF.NS); +DAT.Valid=uint8(zeros(1,length(Records)*RecLen)); +DAT.Idx=Records(:)'; + +for nrec=1:length(Records), + + NREC=(DAT.Idx(nrec)-1); + if NREC<0 fprintf(2,'Warning READEDF: invalid Record Number %i \n',NREC);end; + + fseek(EDF.FILE.FID,(EDF.HeadLen+NREC*EDF.AS.spb*3),'bof'); + [s, count]=fread(EDF.FILE.FID,EDF.AS.spb,'bit24'); + + try, + S(EDF.AS.IDX2)=s; + catch, + error('File is incomplete (try reading begining of file)'); + end; + + %%%%% Test on Over- (Under-) Flow +% V=sum([(S'==EDF.DigMax(:,ones(RecLen,1))) + (S'==EDF.DigMin(:,ones(RecLen,1)))])==0; + V=sum([(S(:,EDF.Chan_Select)'>=EDF.DigMax(EDF.Chan_Select,ones(RecLen,1))) + ... + (S(:,EDF.Chan_Select)'<=EDF.DigMin(EDF.Chan_Select,ones(RecLen,1)))])==0; + EDF.ERROR.DigMinMax_Warning(find(sum([(S'>EDF.DigMax(:,ones(RecLen,1))) + (S'0))=1; + % invalid=[invalid; find(V==0)+l*k]; + + if floor(Mode/2)==1 + for k=1:EDF.NS, + DAT.Record(nrec*EDF.SPR(k)+(1-EDF.SPR(k):0),k)=S(1:EDF.SPR(k),k); + end; + else + DAT.Record(nrec*RecLen+(1-RecLen:0),:)=S; + end; + + DAT.Valid(nrec*RecLen+(1-RecLen:0))=V; +end; +if rem(Mode,2)==0 % Autocalib + DAT.Record=[ones(RecLen*length(Records),1) DAT.Record]*EDF.Calib; +end; + +DAT.Record=DAT.Record'; +return; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readedf.m b/code/eeglab13_4_4b/functions/sigprocfunc/readedf.m new file mode 100644 index 0000000..a28342f --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readedf.m @@ -0,0 +1,83 @@ +% readedf() - read eeg data in EDF format. +% +% Usage: +% >> [data,header] = readedf(filename); +% +% Input: +% filename - file name of the eeg data +% +% Output: +% data - eeg data in (channel, timepoint) +% header - structured information about the read eeg data +% header.length - length of header to jump to the first entry of eeg data +% header.records - how many frames in the eeg data file +% header.duration - duration (measured in second) of one frame +% header.channels - channel number in eeg data file +% header.channelname - channel name +% header.transducer - type of eeg electrods used to acquire +% header.physdime - details +% header.physmin - details +% header.physmax - details +% header.digimin - details +% header.digimax - details +% header.prefilt - pre-filterization spec +% header.samplerate - sampling rate +% +% Author: Jeng-Ren Duann, CNL/Salk Inst., 2001-12-21 + +% Copyright (C) Jeng-Ren Duann, CNL/Salk Inst., 2001-12-21 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-21-02 editing header, add help -ad + +function [data,header] = readedf(filename); + +if nargin < 1 + help readedf; + return; +end; + +fp = fopen(filename,'r','ieee-le'); +if fp == -1, + error('File not found ...!'); + return; +end + +hdr = setstr(fread(fp,256,'uchar')'); +header.length = str2num(hdr(185:192)); +header.records = str2num(hdr(237:244)); +header.duration = str2num(hdr(245:252)); +header.channels = str2num(hdr(253:256)); +header.channelname = setstr(fread(fp,[16,header.channels],'char')'); +header.transducer = setstr(fread(fp,[80,header.channels],'char')'); +header.physdime = setstr(fread(fp,[8,header.channels],'char')'); +header.physmin = str2num(setstr(fread(fp,[8,header.channels],'char')')); +header.physmax = str2num(setstr(fread(fp,[8,header.channels],'char')')); +header.digimin = str2num(setstr(fread(fp,[8,header.channels],'char')')); +header.digimax = str2num(setstr(fread(fp,[8,header.channels],'char')')); +header.prefilt = setstr(fread(fp,[80,header.channels],'char')'); +header.samplerate = str2num(setstr(fread(fp,[8,header.channels],'char')')); + +fseek(fp,header.length,-1); +data = fread(fp,'int16'); +fclose(fp); + +data = reshape(data,header.duration*header.samplerate(1),header.channels,header.records); +temp = []; +for i=1:header.records, + temp = [temp data(:,:,i)']; +end +data = temp; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readeetraklocs.m b/code/eeglab13_4_4b/functions/sigprocfunc/readeetraklocs.m new file mode 100644 index 0000000..3c24bd4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readeetraklocs.m @@ -0,0 +1,76 @@ +% readeetraklocs() - read 3-D location files saved using the EETrak +% digitizing software. +% Usage: +% >> CHANLOCS = readeetraklocs( filename ); +% +% Inputs: +% filename - [string] file name +% +% Outputs: +% CHANLOCS - EEGLAB channel location data structure. +% See help readlocs() +% +% Author: Arnaud Delorme, CNL / Salk Institute, Nov 2003 +% +% See also: readlocs() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function chanlocs = readeetraklocs( filename ) + + if nargin < 1 + help readeetraklocs; + return; + end; + + % read location file + % ------------------ + locs = loadtxt( filename ); + + % get label names + % --------------- + indlabels = []; + indpos = []; + for ind = 1:size(locs,1) + if isstr(locs{ind,1}) + if strcmpi(locs{ind,1}, 'Labels') + indlabels = ind; + end; + if strcmpi(locs{ind,1}, 'Positions') + indpos = ind; + end; + end; + end; + if isempty(indpos) | isempty(indlabels) + error('Could not find ''Labels'' or ''Position'' tag in electrode file'); + end; + + % get positions + % ------------- + positions = locs(indpos+1:indlabels-1,1:3); + labels = locs(indlabels+1:end,:); + + % create structure + % ---------------- + for index = 1:length(labels) + chanlocs(index).labels = labels{index}; + chanlocs(index).X = positions{index,1}; + chanlocs(index).Y = positions{index,2}; + chanlocs(index).Z = positions{index,3}; + end; + + chanlocs = convertlocs(chanlocs, 'cart2all'); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readegi.m b/code/eeglab13_4_4b/functions/sigprocfunc/readegi.m new file mode 100644 index 0000000..600c0c9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readegi.m @@ -0,0 +1,213 @@ +% readegi() - read EGI Simple Binary datafile (versions 2,3,4,5,6,7). +% Return header info, EEG data, and any event data. +% Usage: +% >> [head, TrialData, EventData, CatIndex] = readegi(filename, dataChunks, forceversion) +% +% Required Input: +% filename = EGI data filename +% +% Optional Input: +% dataChunks = vector containing desired frame numbers(for unsegmented +% datafiles) or segments (for segmented files). If this +% input is empty or is not provided then all data will be +% returned. +% forceversion = integer from 2 to 7 which overrides the EGI version read from the +% file header. This has been occasionally necessary in cases where +% the file format was incorrectly indicated in the header. +% Outputs: +% head = struct containing header info (see readegihdr() ) +% TrialData = EEG channel data +% EventData = event codes +% CatIndex = segment category indices +% +% Author: Cooper Roddey, SCCN, 13 Nov 2002 +% +% Note: code derived from C source code written by +% Tom Renner at EGI, Inc. +% +% See also: readegihdr() + +% Copyright (C) 2002 , Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [head, TrialData, EventData, SegmentCatIndex] = readegi(filename, dataChunks,forceversion) + +if nargin <1 | nargin > 3, + help readegi; + return; +end + +if nargout < 2 | nargout > 4, + error('2 to 4 output args required'); +end + +if ~exist('dataChunks','var') + dataChunks = []; +end + +if ~isvector(dataChunks) + error('dataChunks must either be empty or a vector'); +end + +[fid,message] = fopen(filename,'rb','b'); +if (fid < 0), + error(message); +end + +% get our header structure +fprintf('Importing binary EGI data file ...\n'); +if exist('forceversion') + head = readegihdr(fid,forceversion); +else + head = readegihdr(fid); +end + +% do we have segmented data? +segmented = 0; +switch(head.version), + case {2,4,6} + segmented = 0; + case {3,5,7} + segmented = 1; +end + +% each type of event has a dedicated "channel" +FrameVals = head.nchan + head.eventtypes; + +if (segmented) + + desiredSegments = dataChunks; + if isempty(desiredSegments), + desiredSegments = [1:head.segments]; + end + + nsegs = length(desiredSegments); + + TrialData = zeros(FrameVals,head.segsamps*nsegs); + readexpected = FrameVals*head.segsamps*nsegs; + +else + + desiredFrames = dataChunks; + if isempty(desiredFrames), + desiredFrames = [1:head.samples]; + end + + nframes = length(desiredFrames); + + TrialData = zeros(FrameVals,nframes); + readexpected = FrameVals*nframes; + +end + +% get datatype from version number +switch(head.version) + case {2,3} + datatype = 'integer*2'; + case {4,5} + datatype = 'float32'; + case {6,7} + datatype = 'float64'; + otherwise, + error('Unknown data format'); +end + +% read in epoch data +readtotal = 0; +j=0; +SegmentCatIndex = []; +if (segmented), + + for i=1:head.segments, + segcatind = fread(fid,1,'integer*2'); + segtime = fread(fid,1,'integer*4'); + + [tdata, count] = ... + fread(fid,[FrameVals,head.segsamps],datatype); + + % check if this segment is one of our desired ones + if ismember(i,desiredSegments) + + j=j+1; + SegmentCatIndex(j) = segcatind; + SegmentStartTime(j) = segtime; + + TrialData(:,[1+(j-1)*head.segsamps:j*head.segsamps]) = tdata; + + readtotal = readtotal + count; + end + + if (j >= nsegs), break; end; + + end; + +else + % read unsegmented data + + % if dataChunks is empty, read all frames + if isempty(dataChunks) + + [TrialData, readtotal] = fread(fid, [FrameVals,head.samples],datatype); + + else % grab only the desiredFrames + % This could take a while... + + for i=1:head.samples, + + [tdata, count] = fread(fid, [FrameVals,1],datatype); + + % check if this segment is a keeper + if ismember(i,desiredFrames), + j=j+1; + TrialData(:,j) = tdata; + readtotal = readtotal + count; + end + + if (j >= nframes), break; end; + + end + end +end + +fclose(fid); + +if ~isequal(readtotal, readexpected) + error('Number of values read not equal to the number expected.'); +end + +EventData = []; +if (head.eventtypes > 0), + EventData = TrialData(head.nchan+1:end,:); + TrialData = TrialData(1:head.nchan,:); +end + +% convert from A/D units to microvolts +if ( head.bits ~= 0 & head.range ~= 0 ) + TrialData = (head.range/(2^head.bits))*TrialData; +end + +% convert event codes to char +% --------------------------- +head.eventcode = char(head.eventcode); + + +%--------------------------- isvector() --------------- +function retval = isvector(V) + + s = size(V); + retval = ( length(s) < 3 ) & ( min(s) <= 1 ); + +%------------------------------------------------------ diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readegihdr.m b/code/eeglab13_4_4b/functions/sigprocfunc/readegihdr.m new file mode 100644 index 0000000..6fe36dc --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readegihdr.m @@ -0,0 +1,113 @@ +% readegihdr() - read header information from EGI (versions 2,3,4,5,6,7) data file. +% +% Usage: +% >> [head] = readegihdr(fid,forceversion) +% +% Input: +% fid - file identifier of EGI datafile +% forceversion - optional integer input to override automatic reading of version number. +% +% Output: +% head - structure containing header information. +% Structure fields are: +% version = 2,3,4,5,6,or 7 +% samp_rate = sampling rate in samples/s +% nchan = number of EEG channels +% gain = gain of amplifier +% bits = number of bits/sample +% range = abs(max. value) +% segments = number of epochs +% categories = number of categories +% catname = cell array of category names +% segsamps = number of samples/segment +% eventtypes = number of event types +% eventcode = string array of event codes +% +% Author: Cooper Roddey, SCCN, 13 Nov 2002 +% +% Note: this code derived from C source code written by +% Tom Renner at EGI, Inc. (www.egi.com) +% +% See also: readegi() + +% Copyright (C) 2002 , Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function head = readegihdr(fid,forceversion) + +if nargin < 1 + help readegihdr; + return; +end; + +head.version = fread(fid,1,'integer*4'); +if exist('forceversion') + head.version = forceversion; +end + +if ~( head.version >= 2 & head.version <= 7 ), + error('EGI Simple Binary Versions 2-7 supported only.'); +end; + +year = fread(fid,1,'integer*2'); +month = fread(fid,1,'integer*2'); +day = fread(fid,1,'integer*2'); +hour = fread(fid,1,'integer*2'); +minute = fread(fid,1,'integer*2'); +second = fread(fid,1,'integer*2'); +millisecond = fread(fid,1,'integer*4'); + +head.samp_rate = fread(fid,1,'integer*2'); +head.nchan = fread(fid,1,'integer*2'); +head.gain = fread(fid,1,'integer*2'); +head.bits = fread(fid,1,'integer*2'); +head.range = fread(fid,1,'integer*2'); + +head.samples = 0; +head.segments = 0; +head.segsamps = 0; +head.eventtypes = 0; +head.categories = 0; +head.catname = {}; +head.eventcode = ''; + +switch (head.version) + case {2,4,6} + head.samples = fread(fid, 1 ,'integer*4'); + case {3,5,7} + head.categories = fread(fid,1,'integer*2'); + if (head.categories), + for i=1:head.categories, + catname_len(i) = fread(fid,1,'uchar'); + head.catname{i} = char(fread(fid,catname_len(i),'uchar'))'; + end + end + head.segments = fread(fid,1,'integer*2'); + head.segsamps = fread(fid,1,'integer*4'); + otherwise + error('Invalid EGI version'); +end + +head.eventtypes = fread(fid,1,'integer*2'); + +if isequal(head.eventtypes,0), + head.eventcode(1,1:4) = 'none'; +else + for i = 1:head.eventtypes, + head.eventcode(i,1:4) = fread(fid,[1,4],'uchar'); + end +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readegilocs.m b/code/eeglab13_4_4b/functions/sigprocfunc/readegilocs.m new file mode 100644 index 0000000..69333a8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readegilocs.m @@ -0,0 +1,86 @@ +% readegilocs() - look up locations for EGI EEG dataset. +% +% Usage: +% >> EEG = readegilocs(EEG); +% >> EEG = readegilocs(EEG, fileloc); +% +% Inputs: +% EEG - EEGLAB data structure +% +% Optional input: +% fileloc - EGI channel location file +% +% Outputs: +% EEG - EEGLAB data structure with channel location structure +% +% Author: Arnaud Delorme, SCCN/UCSD +% +% See also: pop_readegi(), readegi() + +% Copyright (C) 12 Nov 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = readegilocs(EEG, fileloc); + +if nargin < 1 + help readegilocs; + return; +end; + +% importing channel locations +% --------------------------- +found = 1; +if nargin < 2 + switch EEG.nbchan + case { 32 33 }, fileloc = 'GSN-HydroCel-32.sfp'; + case { 64 65 }, fileloc = 'GSN65v2_0.sfp'; + case { 128 129 }, fileloc = 'GSN129.sfp'; + case { 256 257 }, fileloc = 'GSN-HydroCel-257.sfp'; + otherwise, found = 0; + end; +end; +if found + fprintf('EGI channel location automatically detected %s ********* WARNING please check that this the proper file\n', fileloc); + if EEG.nbchan == 64 || EEG.nbchan == 65 || EEG.nbchan == 256 || EEG.nbchan == 257 + fprintf( [ 'Warning: this function assumes you have a 64-channel system Version 2\n' ... + ' if this is not the case, update the channel location with the proper file' ]); + end; + % remove the last channel for 33 channels + + peeglab = fileparts(which('eeglab.m')); + fileloc = fullfile(peeglab, 'sample_locs', fileloc); + locs = readlocs(fileloc); + locs(1).type = 'FID'; + locs(2).type = 'FID'; + locs(3).type = 'FID'; + locs(end).type = 'REF'; + if EEG.nbchan == 256 || EEG.nbchan == 257 + if EEG.nbchan == 256 + chaninfo.nodatchans = locs([end]); + locs([end]) = []; + end; + elseif mod(EEG.nbchan,2) == 0, + chaninfo.nodatchans = locs([1 2 3 end]); + locs([1 2 3 end]) = []; + else + chaninfo.nodatchans = locs([1 2 3]); + locs([1 2 3]) = []; + end; % remove reference + chaninfo.filename = fileloc; + EEG.chanlocs = locs; + EEG.urchanlocs = locs; + EEG.chaninfo = chaninfo; +end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readelp.m b/code/eeglab13_4_4b/functions/sigprocfunc/readelp.m new file mode 100644 index 0000000..42b9492 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readelp.m @@ -0,0 +1,109 @@ +% readelp() - read electrode locations from an .elp (electrode positions) +% file as generated, for example, by a Polhemus tracking device +% Usage: +% >> [eloc, elocnames, X, Y, Z] = readelp(filename); +% +% Inputs: +% filename - name of the .elp file containing cartesian (XYZ) electrode +% locations +% Outputs: +% eloc - structure containing the names and locations of the channels +% elocnames - cell array containing the names of the electrodes +% X,Y,Z - vectors containing the xyz locations of the electrodes +% +% Author: Arnaud Delorme, CNL / Salk Institute, 28 Feb 2002 +% +% Note: ignores comments and the sensor type field +% Note: convert output XYZ locations to polar coordinates using cart2pol() +% +% See also: readlocs(), snapread(), floatread(), cart2pol() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 28 Feb 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [eloc, names, x, y, z] = readelp( filename ); + +if nargin < 1 + help readelp; + return; +end; + +% open file +% --------- +fid = fopen(filename, 'r'); +if fid == -1 + disp('Cannot open file'); return; +end; + +index = 1; +countfid = 1; +fidlabels = { 'Nz' 'LPA' 'RPA' }; + +needToReadNumbers = 0; +tmpstr = fgetl(fid); + +while 1 + if needToReadNumbers==1 % Has sparsed $N. + if (~isempty(str2num(tmpstr))) + tmp = sscanf(tmpstr, '%f'); + + eloc(index).X = tmp(1); x(index) = tmp(1); + eloc(index).Y = tmp(2); y(index) = tmp(2); + eloc(index).Z = tmp(3); z(index) = tmp(3); + eloc(index).type = 'EEG'; + + index = index + 1; + needToReadNumbers = 0; + end; + elseif tmpstr(1) == '%' + if tmpstr(2) == 'F' % fiducial + tmp = sscanf(tmpstr(3:end), '%f'); + + eloc(index).labels = fidlabels{countfid}; + eloc(index).X = tmp(1); x(index) = tmp(1); + eloc(index).Y = tmp(2); y(index) = tmp(2); + eloc(index).Z = tmp(3); z(index) = tmp(3); + eloc(index).type = 'FID'; + + index = index + 1; + countfid = countfid + 1; + + elseif tmpstr(2) == 'N' % regular channel + nm = strtok(tmpstr(3:end)); + if ~(strcmp(nm, 'Name') | strcmp(nm, 'Status')) + eloc(index).labels = nm; + needToReadNumbers = 1; + end; + end; + end; + + % Get the next line + tmpstr = fgetl(fid); + while isempty(tmpstr) + tmpstr = fgetl(fid); + if ~isstr(tmpstr) & tmpstr == -1 + break; + end; + end; + + if ~isstr(tmpstr) & tmpstr == -1 + break; + end; +end; + +names = { eloc.labels }; + +fclose(fid); % close the file diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readlocs.m b/code/eeglab13_4_4b/functions/sigprocfunc/readlocs.m new file mode 100644 index 0000000..0f0311a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readlocs.m @@ -0,0 +1,657 @@ +% readlocs() - read electrode location coordinates and other information from a file. +% Several standard file formats are supported. Users may also specify +% a custom column format. Defined format examples are given below +% (see File Formats). +% Usage: +% >> eloc = readlocs( filename ); +% >> EEG.chanlocs = readlocs( filename, 'key', 'val', ... ); +% >> [eloc, labels, theta, radius, indices] = ... +% readlocs( filename, 'key', 'val', ... ); +% Inputs: +% filename - Name of the file containing the electrode locations +% {default: 2-D polar coordinates} (see >> help topoplot ) +% +% Optional inputs: +% 'filetype' - ['loc'|'sph'|'sfp'|'xyz'|'asc'|'polhemus'|'besa'|'chanedit'|'custom'] +% Type of the file to read. By default the file type is determined +% using the file extension (see below under File Formats), +% 'loc' an EEGLAB 2-D polar coordinates channel locations file +% Coordinates are theta and radius (see definitions below). +% 'sph' Matlab spherical coordinates (Note: spherical +% coordinates used by Matlab functions are different +% from spherical coordinates used by BESA - see below). +% 'sfp' EGI Cartesian coordinates (NOT Matlab Cartesian - see below). +% 'xyz' Matlab/EEGLAB Cartesian coordinates (NOT EGI Cartesian). +% z is toward nose; y is toward left ear; z is toward vertex +% 'asc' Neuroscan polar coordinates. +% 'polhemus' or 'polhemusx' - Polhemus electrode location file recorded +% with 'X' on sensor pointing to subject (see below and readelp()). +% 'polhemusy' - Polhemus electrode location file recorded with +% 'Y' on sensor pointing to subject (see below and readelp()). +% 'besa' BESA-'.elp' spherical coordinates. (Not MATLAB spherical - +% see below). +% 'chanedit' - EEGLAB channel location file created by pop_chanedit(). +% 'custom' - Ascii file with columns in user-defined 'format' (see below). +% 'importmode' - ['eeglab'|'native'] for location files containing 3-D cartesian electrode +% coordinates, import either in EEGLAB format (nose pointing toward +X). +% This may not always be possible since EEGLAB might not be able to +% determine the nose direction for scanned electrode files. 'native' import +% original carthesian coordinates (user can then specify the position of +% the nose when calling the topoplot() function; in EEGLAB the position +% of the nose is stored in the EEG.chaninfo structure). {default 'eeglab'} +% 'format' - [cell array] Format of a 'custom' channel location file (see above). +% {default: if no file type is defined. The cell array contains +% labels defining the meaning of each column of the input file. +% 'channum' [positive integer] channel number. +% 'labels' [string] channel name (no spaces). +% 'theta' [real degrees] 2-D angle in polar coordinates. +% positive => rotating from nose (0) toward left ear +% 'radius' [real] radius for 2-D polar coords; 0.5 is the head +% disk radius and limit for topoplot() plotting). +% 'X' [real] Matlab-Cartesian X coordinate (to nose). +% 'Y' [real] Matlab-Cartesian Y coordinate (to left ear). +% 'Z' [real] Matlab-Cartesian Z coordinate (to vertex). +% '-X','-Y','-Z' Matlab-Cartesian coordinates pointing opposite +% to the above. +% 'sph_theta' [real degrees] Matlab spherical horizontal angle. +% positive => rotating from nose (0) toward left ear. +% 'sph_phi' [real degrees] Matlab spherical elevation angle. +% positive => rotating from horizontal (0) upwards. +% 'sph_radius' [real] distance from head center (unused). +% 'sph_phi_besa' [real degrees] BESA phi angle from vertical. +% positive => rotating from vertex (0) towards right ear. +% 'sph_theta_besa' [real degrees] BESA theta horiz/azimuthal angle. +% positive => rotating from right ear (0) toward nose. +% 'ignore' ignore column}. +% The input file may also contain other channel information fields. +% 'type' channel type: 'EEG', 'MEG', 'EMG', 'ECG', others ... +% 'calib' [real near 1.0] channel calibration value. +% 'gain' [real > 1] channel gain. +% 'custom1' custom field #1. +% 'custom2', 'custom3', 'custom4', etc. more custom fields +% 'skiplines' - [integer] Number of header lines to skip (in 'custom' file types only). +% Note: Characters on a line following '%' will be treated as comments. +% 'readchans' - [integer array] indices of electrodes to read. {default: all} +% 'center' - [(1,3) real array or 'auto'] center of xyz coordinates for conversion +% to spherical or polar, Specify the center of the sphere here, or 'auto'. +% This uses the center of the sphere that best fits all the electrode +% locations read. {default: [0 0 0]} +% Outputs: +% eloc - structure containing the channel names and locations (if present). +% It has three fields: 'eloc.labels', 'eloc.theta' and 'eloc.radius' +% identical in meaning to the EEGLAB struct 'EEG.chanlocs'. +% labels - cell array of strings giving the names of the electrodes. NOTE: Unlike the +% three outputs below, includes labels of channels *without* location info. +% theta - vector (in degrees) of polar angles of the electrode locations. +% radius - vector of polar-coordinate radii (arc_lengths) of the electrode locations +% indices - indices, k, of channels with non-empty 'locs(k).theta' coordinate +% +% File formats: +% If 'filetype' is unspecified, the file extension determines its type. +% +% '.loc' or '.locs' or '.eloc': +% polar coordinates. Notes: angles in degrees: +% right ear is 90; left ear -90; head disk radius is 0.5. +% Fields: N angle radius label +% Sample: 1 -18 .511 Fp1 +% 2 18 .511 Fp2 +% 3 -90 .256 C3 +% 4 90 .256 C4 +% ... +% Note: In previous releases, channel labels had to contain exactly +% four characters (spaces replaced by '.'). This format still works, +% though dots are no longer required. +% '.sph': +% Matlab spherical coordinates. Notes: theta is the azimuthal/horizontal angle +% in deg.: 0 is toward nose, 90 rotated to left ear. Following this, performs +% the elevation (phi). Angles in degrees. +% Fields: N theta phi label +% Sample: 1 18 -2 Fp1 +% 2 -18 -2 Fp2 +% 3 90 44 C3 +% 4 -90 44 C4 +% ... +% '.elc': +% Cartesian 3-D electrode coordinates scanned using the EETrak software. +% See readeetraklocs(). +% '.elp': +% Polhemus-.'elp' Cartesian coordinates. By default, an .elp extension is read +% as PolhemusX-elp in which 'X' on the Polhemus sensor is pointed toward the +% subject. Polhemus files are not in columnar format (see readelp()). +% '.elp': +% BESA-'.elp' spherical coordinates: Need to specify 'filetype','besa'. +% The elevation angle (phi) is measured from the vertical axis. Positive +% rotation is toward right ear. Next, perform azimuthal/horizontal rotation +% (theta): 0 is toward right ear; 90 is toward nose, -90 toward occiput. +% Angles are in degrees. If labels are absent or weights are given in +% a last column, readlocs() adjusts for this. Default labels are E1, E2, ... +% Fields: Type label phi theta +% Sample: EEG Fp1 -92 -72 +% EEG Fp2 92 72 +% EEG C3 -46 0 +% EEG C4 46 0 +% ... +% '.xyz': +% Matlab/EEGLAB Cartesian coordinates. Here. x is towards the nose, +% y is towards the left ear, and z towards the vertex. Note that the first +% column (x) is -Y in a Matlab 3-D plot, the second column (y) is X in a +% matlab 3-D plot, and the third column (z) is Z. +% Fields: channum x y z label +% Sample: 1 .950 .308 -.035 Fp1 +% 2 .950 -.308 -.035 Fp2 +% 3 0 .719 .695 C3 +% 4 0 -.719 .695 C4 +% ... +% '.asc', '.dat': +% Neuroscan-.'asc' or '.dat' Cartesian polar coordinates text file. +% '.sfp': +% BESA/EGI-xyz Cartesian coordinates. Notes: For EGI, x is toward right ear, +% y is toward the nose, z is toward the vertex. EEGLAB converts EGI +% Cartesian coordinates to Matlab/EEGLAB xyz coordinates. +% Fields: label x y z +% Sample: Fp1 -.308 .950 -.035 +% Fp2 .308 .950 -.035 +% C3 -.719 0 .695 +% C4 .719 0 .695 +% ... +% '.ced': +% ASCII file saved by pop_chanedit(). Contains multiple MATLAB/EEGLAB formats. +% Cartesian coordinates are as in the 'xyz' format (above). +% Fields: channum label theta radius x y z sph_theta sph_phi ... +% Sample: 1 Fp1 -18 .511 .950 .308 -.035 18 -2 ... +% 2 Fp2 18 .511 .950 -.308 -.035 -18 -2 ... +% 3 C3 -90 .256 0 .719 .695 90 44 ... +% 4 C4 90 .256 0 -.719 .695 -90 44 ... +% ... +% The last columns of the file may contain any other defined fields (gain, +% calib, type, custom). +% +% Fieldtrip structure: +% If a Fieltrip structure is given as input, an EEGLAB +% chanlocs structure is returned +% +% Author: Arnaud Delorme, Salk Institute, 8 Dec 2002 +% +% See also: readelp(), writelocs(), topo2sph(), sph2topo(), sph2cart() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 28 Feb 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function [eloc, labels, theta, radius, indices] = readlocs( filename, varargin ); + +if nargin < 1 + help readlocs; + return; +end; + +% NOTE: To add a new channel format: +% ---------------------------------- +% 1) Add a new element to the structure 'chanformat' (see 'ADD NEW FORMATS HERE' below): +% 2) Enter a format 'type' for the new file format, +% 3) Enter a (short) 'typestring' description of the format +% 4) Enter a longer format 'description' (possibly multiline, see ex. (1) below) +% 5) Enter format file column labels in the 'importformat' field (see ex. (2) below) +% 6) Enter the number of header lines to skip (if any) in the 'skipline' field +% 7) Document the new channel format in the help message above. +% 8) After testing, please send the new version of readloca.m to us +% at eeglab@sccn.ucsd.edu with a sample locs file. +% The 'chanformat' structure is also used (automatically) by the writelocs() +% and pop_readlocs() functions. You do not need to edit these functions. + +chanformat(1).type = 'polhemus'; +chanformat(1).typestring = 'Polhemus native .elp file'; +chanformat(1).description = [ 'Polhemus native coordinate file containing scanned electrode positions. ' ... + 'User must select the direction ' ... + 'for the nose after importing the data file.' ]; +chanformat(1).importformat = 'readelp() function'; +% --------------------------------------------------------------------------------------------------- +chanformat(2).type = 'besa'; +chanformat(2).typestring = 'BESA spherical .elp file'; +chanformat(2).description = [ 'BESA spherical coordinate file. Note that BESA spherical coordinates ' ... + 'are different from Matlab spherical coordinates' ]; +chanformat(2).skipline = 0; % some BESA files do not have headers +chanformat(2).importformat = { 'type' 'labels' 'sph_theta_besa' 'sph_phi_besa' 'sph_radius' }; +% --------------------------------------------------------------------------------------------------- +chanformat(3).type = 'xyz'; +chanformat(3).typestring = 'Matlab .xyz file'; +chanformat(3).description = [ 'Standard 3-D cartesian coordinate files with electrode labels in ' ... + 'the first column and X, Y, and Z coordinates in columns 2, 3, and 4' ]; +chanformat(3).importformat = { 'channum' '-Y' 'X' 'Z' 'labels'}; +% --------------------------------------------------------------------------------------------------- +chanformat(4).type = 'sfp'; +chanformat(4).typestring = 'BESA or EGI 3-D cartesian .sfp file'; +chanformat(4).description = [ 'Standard BESA 3-D cartesian coordinate files with electrode labels in ' ... + 'the first column and X, Y, and Z coordinates in columns 2, 3, and 4.' ... + 'Coordinates are re-oriented to fit the EEGLAB standard of having the ' ... + 'nose along the +X axis.' ]; +chanformat(4).importformat = { 'labels' '-Y' 'X' 'Z' }; +chanformat(4).skipline = 0; +% --------------------------------------------------------------------------------------------------- +chanformat(5).type = 'loc'; +chanformat(5).typestring = 'EEGLAB polar .loc file'; +chanformat(5).description = [ 'EEGLAB polar .loc file' ]; +chanformat(5).importformat = { 'channum' 'theta' 'radius' 'labels' }; +% --------------------------------------------------------------------------------------------------- +chanformat(6).type = 'sph'; +chanformat(6).typestring = 'Matlab .sph spherical file'; +chanformat(6).description = [ 'Standard 3-D spherical coordinate files in Matlab format' ]; +chanformat(6).importformat = { 'channum' 'sph_theta' 'sph_phi' 'labels' }; +% --------------------------------------------------------------------------------------------------- +chanformat(7).type = 'asc'; +chanformat(7).typestring = 'Neuroscan polar .asc file'; +chanformat(7).description = [ 'Neuroscan polar .asc file, automatically recentered to fit EEGLAB standard' ... + 'of having ''Cz'' at (0,0).' ]; +chanformat(7).importformat = 'readneurolocs'; +% --------------------------------------------------------------------------------------------------- +chanformat(8).type = 'dat'; +chanformat(8).typestring = 'Neuroscan 3-D .dat file'; +chanformat(8).description = [ 'Neuroscan 3-D cartesian .dat file. Coordinates are re-oriented to fit ' ... + 'the EEGLAB standard of having the nose along the +X axis.' ]; +chanformat(8).importformat = 'readneurolocs'; +% --------------------------------------------------------------------------------------------------- +chanformat(9).type = 'elc'; +chanformat(9).typestring = 'ASA .elc 3-D file'; +chanformat(9).description = [ 'ASA .elc 3-D coordinate file containing scanned electrode positions. ' ... + 'User must select the direction ' ... + 'for the nose after importing the data file.' ]; +chanformat(9).importformat = 'readeetraklocs'; +% --------------------------------------------------------------------------------------------------- +chanformat(10).type = 'chanedit'; +chanformat(10).typestring = 'EEGLAB complete 3-D file'; +chanformat(10).description = [ 'EEGLAB file containing polar, cartesian 3-D, and spherical 3-D ' ... + 'electrode locations.' ]; +chanformat(10).importformat = { 'channum' 'labels' 'theta' 'radius' 'X' 'Y' 'Z' 'sph_theta' 'sph_phi' ... + 'sph_radius' 'type' }; +chanformat(10).skipline = 1; +% --------------------------------------------------------------------------------------------------- +chanformat(11).type = 'custom'; +chanformat(11).typestring = 'Custom file format'; +chanformat(11).description = 'Custom ASCII file format where user can define content for each file columns.'; +chanformat(11).importformat = ''; +% --------------------------------------------------------------------------------------------------- +% ----- ADD MORE FORMATS HERE ----------------------------------------------------------------------- +% --------------------------------------------------------------------------------------------------- + +listcolformat = { 'labels' 'channum' 'theta' 'radius' 'sph_theta' 'sph_phi' ... + 'sph_radius' 'sph_theta_besa' 'sph_phi_besa' 'gain' 'calib' 'type' ... + 'X' 'Y' 'Z' '-X' '-Y' '-Z' 'custom1' 'custom2' 'custom3' 'custom4' 'ignore' 'not def' }; + +% ---------------------------------- +% special mode for getting the info +% ---------------------------------- +if isstr(filename) & strcmp(filename, 'getinfos') + eloc = chanformat; + labels = listcolformat; + return; +end; + +g = finputcheck( varargin, ... + { 'filetype' 'string' {} ''; + 'importmode' 'string' { 'eeglab','native' } 'eeglab'; + 'defaultelp' 'string' { 'besa','polhemus' } 'polhemus'; + 'skiplines' 'integer' [0 Inf] []; + 'elecind' 'integer' [1 Inf] []; + 'format' 'cell' [] {} }, 'readlocs'); +if isstr(g), error(g); end; +if ~isempty(g.format), g.filetype = 'custom'; end; + +if isstr(filename) + + % format auto detection + % -------------------- + if strcmpi(g.filetype, 'autodetect'), g.filetype = ''; end; + g.filetype = strtok(g.filetype); + periods = find(filename == '.'); + fileextension = filename(periods(end)+1:end); + g.filetype = lower(g.filetype); + if isempty(g.filetype) + switch lower(fileextension), + case {'loc' 'locs' 'eloc'}, g.filetype = 'loc'; % 5/27/2014 Ramon: 'eloc' option introduced. + case 'xyz', g.filetype = 'xyz'; + fprintf( [ 'WARNING: Matlab Cartesian coord. file extension (".xyz") detected.\n' ... + 'If importing EGI Cartesian coords, force type "sfp" instead.\n'] ); + case 'sph', g.filetype = 'sph'; + case 'ced', g.filetype = 'chanedit'; + case 'elp', g.filetype = g.defaultelp; + case 'asc', g.filetype = 'asc'; + case 'dat', g.filetype = 'dat'; + case 'elc', g.filetype = 'elc'; + case 'eps', g.filetype = 'besa'; + case 'sfp', g.filetype = 'sfp'; + otherwise, g.filetype = ''; + end; + fprintf('readlocs(): ''%s'' format assumed from file extension\n', g.filetype); + else + if strcmpi(g.filetype, 'locs'), g.filetype = 'loc'; end + if strcmpi(g.filetype, 'eloc'), g.filetype = 'loc'; end + end; + + % assign format from filetype + % --------------------------- + if ~isempty(g.filetype) & ~strcmpi(g.filetype, 'custom') ... + & ~strcmpi(g.filetype, 'asc') & ~strcmpi(g.filetype, 'elc') & ~strcmpi(g.filetype, 'dat') + indexformat = strmatch(lower(g.filetype), { chanformat.type }, 'exact'); + g.format = chanformat(indexformat).importformat; + if isempty(g.skiplines) + g.skiplines = chanformat(indexformat).skipline; + end; + if isempty(g.filetype) + error( ['readlocs() error: The filetype cannot be detected from the \n' ... + ' file extension, and custom format not specified']); + end; + end; + + % import file + % ----------- + if strcmp(g.filetype, 'asc') | strcmp(g.filetype, 'dat') + eloc = readneurolocs( filename ); + eloc = rmfield(eloc, 'sph_theta'); % for the conversion below + eloc = rmfield(eloc, 'sph_theta_besa'); % for the conversion below + if isfield(eloc, 'type') + for index = 1:length(eloc) + type = eloc(index).type; + if type == 69, eloc(index).type = 'EEG'; + elseif type == 88, eloc(index).type = 'REF'; + elseif type >= 76 & type <= 82, eloc(index).type = 'FID'; + else eloc(index).type = num2str(eloc(index).type); + end; + end; + end; + elseif strcmp(g.filetype, 'elc') + eloc = readeetraklocs( filename ); + %eloc = read_asa_elc( filename ); % from fieldtrip + %eloc = struct('labels', eloc.label, 'X', mattocell(eloc.pnt(:,1)'), 'Y', ... + % mattocell(eloc.pnt(:,2)'), 'Z', mattocell(eloc.pnt(:,3)')); + eloc = convertlocs(eloc, 'cart2all'); + eloc = rmfield(eloc, 'sph_theta'); % for the conversion below + eloc = rmfield(eloc, 'sph_theta_besa'); % for the conversion below + elseif strcmp(lower(g.filetype(1:end-1)), 'polhemus') | ... + strcmp(g.filetype, 'polhemus') + try, + [eloc labels X Y Z]= readelp( filename ); + if strcmp(g.filetype, 'polhemusy') + tmp = X; X = Y; Y = tmp; + end; + for index = 1:length( eloc ) + eloc(index).X = X(index); + eloc(index).Y = Y(index); + eloc(index).Z = Z(index); + end; + catch, + disp('readlocs(): Could not read Polhemus coords. Trying to read BESA .elp file.'); + [eloc, labels, theta, radius, indices] = readlocs( filename, 'defaultelp', 'besa', varargin{:} ); + end; + else + % importing file + % -------------- + if isempty(g.skiplines), g.skiplines = 0; end; + if strcmpi(g.filetype, 'chanedit') + array = loadtxt( filename, 'delim', 9, 'skipline', g.skiplines, 'blankcell', 'off'); + else + array = load_file_or_array( filename, g.skiplines); + end; + if size(array,2) < length(g.format) + fprintf(['readlocs() warning: Fewer columns in the input than expected.\n' ... + ' See >> help readlocs\n']); + elseif size(array,2) > length(g.format) + fprintf(['readlocs() warning: More columns in the input than expected.\n' ... + ' See >> help readlocs\n']); + end; + + % removing lines BESA + % ------------------- + if isempty(array{1,2}) + disp('BESA header detected, skipping three lines...'); + array = load_file_or_array( filename, g.skiplines-1); + if isempty(array{1,2}) + array = load_file_or_array( filename, g.skiplines-1); + end; + end; + + % xyz format, is the first col absent + % ----------------------------------- + if strcmp(g.filetype, 'xyz') + if size(array, 2) == 4 + array(:, 2:5) = array(:, 1:4); + end; + end; + + % removing comments and empty lines + % --------------------------------- + indexbeg = 1; + while isempty(array{indexbeg,1}) | ... + (isstr(array{indexbeg,1}) & array{indexbeg,1}(1) == '%' ) + indexbeg = indexbeg+1; + end; + array = array(indexbeg:end,:); + + % converting file + % --------------- + for indexcol = 1:min(size(array,2), length(g.format)) + [str mult] = checkformat(g.format{indexcol}); + for indexrow = 1:size( array, 1) + if mult ~= 1 + eval ( [ 'eloc(indexrow).' str '= -array{indexrow, indexcol};' ]); + else + eval ( [ 'eloc(indexrow).' str '= array{indexrow, indexcol};' ]); + end; + end; + end; + end; + + % handling BESA coordinates + % ------------------------- + if isfield(eloc, 'sph_theta_besa') + if isfield(eloc, 'type') + if isnumeric(eloc(1).type) + disp('BESA format detected ( Theta | Phi )'); + for index = 1:length(eloc) + eloc(index).sph_phi_besa = eloc(index).labels; + eloc(index).sph_theta_besa = eloc(index).type; + eloc(index).labels = ''; + eloc(index).type = ''; + end; + eloc = rmfield(eloc, 'labels'); + end; + end; + if isfield(eloc, 'labels') + if isnumeric(eloc(1).labels) + disp('BESA format detected ( Elec | Theta | Phi )'); + for index = 1:length(eloc) + eloc(index).sph_phi_besa = eloc(index).sph_theta_besa; + eloc(index).sph_theta_besa = eloc(index).labels; + eloc(index).labels = eloc(index).type; + eloc(index).type = ''; + eloc(index).radius = 1; + end; + end; + end; + + try + eloc = convertlocs(eloc, 'sphbesa2all'); + eloc = convertlocs(eloc, 'topo2all'); % problem with some EGI files (not BESA files) + catch, disp('Warning: coordinate conversion failed'); end; + fprintf('Readlocs: BESA spherical coords. converted, now deleting BESA fields\n'); + fprintf(' to avoid confusion (these fields can be exported, though)\n'); + eloc = rmfield(eloc, 'sph_phi_besa'); + eloc = rmfield(eloc, 'sph_theta_besa'); + + % converting XYZ coordinates to polar + % ----------------------------------- + elseif isfield(eloc, 'sph_theta') + try + eloc = convertlocs(eloc, 'sph2all'); + catch, disp('Warning: coordinate conversion failed'); end; + elseif isfield(eloc, 'X') + try + eloc = convertlocs(eloc, 'cart2all'); + catch, disp('Warning: coordinate conversion failed'); end; + else + try + eloc = convertlocs(eloc, 'topo2all'); + catch, disp('Warning: coordinate conversion failed'); end; + end; + + % inserting labels if no labels + % ----------------------------- + if ~isfield(eloc, 'labels') + fprintf('readlocs(): Inserting electrode labels automatically.\n'); + for index = 1:length(eloc) + eloc(index).labels = [ 'E' int2str(index) ]; + end; + else + % remove trailing '.' + for index = 1:length(eloc) + if isstr(eloc(index).labels) + tmpdots = find( eloc(index).labels == '.' ); + eloc(index).labels(tmpdots) = []; + end; + end; + end; + + % resorting electrodes if number not-sorted + % ----------------------------------------- + if isfield(eloc, 'channum') + if ~isnumeric(eloc(1).channum) + error('Channel numbers must be numeric'); + end; + allchannum = [ eloc.channum ]; + if any( sort(allchannum) ~= allchannum ) + fprintf('readlocs(): Re-sorting channel numbers based on ''channum'' column indices\n'); + [tmp newindices] = sort(allchannum); + eloc = eloc(newindices); + end; + eloc = rmfield(eloc, 'channum'); + end; +else + if isstruct(filename) + % detect Fieldtrip structure and convert it + % ----------------------------------------- + if isfield(filename, 'pnt') + neweloc = []; + for index = 1:length(filename.label) + neweloc(index).labels = filename.label{index}; + neweloc(index).X = filename.pnt(index,1); + neweloc(index).Y = filename.pnt(index,2); + neweloc(index).Z = filename.pnt(index,3); + end; + eloc = neweloc; + eloc = convertlocs(eloc, 'cart2all'); + else + eloc = filename; + end; + else + disp('readlocs(): input variable must be a string or a structure'); + end; +end; +if ~isempty(g.elecind) + eloc = eloc(g.elecind); +end; +if nargout > 2 + if isfield(eloc, 'theta') + tmptheta = { eloc.theta }; % check which channels have (polar) coordinates set + else tmptheta = cell(1,length(eloc)); + end; + if isfield(eloc, 'theta') + tmpx = { eloc.X }; % check which channels have (polar) coordinates set + else tmpx = cell(1,length(eloc)); + end; + + indices = find(~cellfun('isempty', tmptheta)); + indices = intersect_bc(find(~cellfun('isempty', tmpx)), indices); + indices = sort(indices); + + indbad = setdiff_bc(1:length(eloc), indices); + tmptheta(indbad) = { NaN }; + theta = [ tmptheta{:} ]; +end; +if nargout > 3 + if isfield(eloc, 'theta') + tmprad = { eloc.radius }; % check which channels have (polar) coordinates set + else tmprad = cell(1,length(eloc)); + end; + tmprad(indbad) = { NaN }; + radius = [ tmprad{:} ]; +end; + +%tmpnum = find(~cellfun('isclass', { eloc.labels }, 'char')); +%disp('Converting channel labels to string'); +for index = 1:length(eloc) + if ~isstr(eloc(index).labels) + eloc(index).labels = int2str(eloc(index).labels); + end; +end; +labels = { eloc.labels }; +if isfield(eloc, 'ignore') + eloc = rmfield(eloc, 'ignore'); +end; + +% process fiducials if any +% ------------------------ +fidnames = { 'nz' 'lpa' 'rpa' 'nasion' 'left' 'right' 'nazion' 'fidnz' 'fidt9' 'fidt10' 'cms' 'drl' }; +for index = 1:length(fidnames) + ind = strmatch(fidnames{index}, lower(labels), 'exact'); + if ~isempty(ind), eloc(ind).type = 'FID'; end; +end; + +return; + +% interpret the variable name +% --------------------------- +function array = load_file_or_array( varname, skiplines ); + if isempty(skiplines), + skiplines = 0; + end; + if exist( varname ) == 2 + array = loadtxt(varname,'verbose','off','skipline',skiplines,'blankcell','off'); + else % variable in the global workspace + % -------------------------- + try, array = evalin('base', varname); + catch, error('readlocs(): cannot find the named file or variable, check syntax'); + end; + end; +return; + +% check field format +% ------------------ +function [str, mult] = checkformat(str) + mult = 1; + if strcmpi(str, 'labels'), str = lower(str); return; end; + if strcmpi(str, 'channum'), str = lower(str); return; end; + if strcmpi(str, 'theta'), str = lower(str); return; end; + if strcmpi(str, 'radius'), str = lower(str); return; end; + if strcmpi(str, 'ignore'), str = lower(str); return; end; + if strcmpi(str, 'sph_theta'), str = lower(str); return; end; + if strcmpi(str, 'sph_phi'), str = lower(str); return; end; + if strcmpi(str, 'sph_radius'), str = lower(str); return; end; + if strcmpi(str, 'sph_theta_besa'), str = lower(str); return; end; + if strcmpi(str, 'sph_phi_besa'), str = lower(str); return; end; + if strcmpi(str, 'gain'), str = lower(str); return; end; + if strcmpi(str, 'calib'), str = lower(str); return; end; + if strcmpi(str, 'type') , str = lower(str); return; end; + if strcmpi(str, 'X'), str = upper(str); return; end; + if strcmpi(str, 'Y'), str = upper(str); return; end; + if strcmpi(str, 'Z'), str = upper(str); return; end; + if strcmpi(str, '-X'), str = upper(str(2:end)); mult = -1; return; end; + if strcmpi(str, '-Y'), str = upper(str(2:end)); mult = -1; return; end; + if strcmpi(str, '-Z'), str = upper(str(2:end)); mult = -1; return; end; + if strcmpi(str, 'custom1'), return; end; + if strcmpi(str, 'custom2'), return; end; + if strcmpi(str, 'custom3'), return; end; + if strcmpi(str, 'custom4'), return; end; + error(['readlocs(): undefined field ''' str '''']); + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readneurodat.m b/code/eeglab13_4_4b/functions/sigprocfunc/readneurodat.m new file mode 100644 index 0000000..aae62ec --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readneurodat.m @@ -0,0 +1,79 @@ +% readneurodat() - read neuroscan location file (.dat) +% +% Usage: +% >> [ CHANLOCS labels theta theta ] = readneurodat( filename ); +% +% Inputs: +% filename - file name or matlab cell array { names x_coord y_coord } +% +% Outputs: +% CHANLOCS - [structure] EEGLAB channel location data structure. See +% help readlocs() +% labels - [cell arrya] channel labels +% theta - [float array]array containing 3-D theta angle electrode +% position (in degree) +% phi - [float array]array containing 3-D phi angle electrode +% position (in degree) +% +% Author: Arnaud Delorme, CNL / Salk Institute, 28 Nov 2003 +% +% See also: readlocs(), readneurolocs() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [chanlocs, labels, theta, phi] = readneurodat(filename); + + if nargin < 1 + help readneurodat; + return; + end; + + % enter file name here + % -------------------- + %tmp = loadtxt('/home/ftp/pub/locfiles/neuroscan/cap128.dat'); + %tmp = loadtxt('/home/arno/temp/quik128.DAT'); + tmp = loadtxt(filename); + + % resort electrodes + % ----------------- + [tmp2 tmpind] = sort(celltomat(tmp(:,1))'); + tmp = tmp(tmpind,:); + + % convert to polar coordinates + % ---------------------------- + %figure; plot(celltomat(tmp(:,2)), celltomat(tmp(:,3)), '.'); + [phi,theta] = cart2pol(celltomat(tmp(:,end-1)), celltomat(tmp(:,end))); + theta = theta/513.1617*44; + phi = phi/pi*180; + + % convert to other types of coordinates + % ------------------------------------- + labels = tmp(:,end-2)'; + chanlocs = struct('labels', labels, 'sph_theta_besa', mattocell(theta)', 'sph_phi_besa', mattocell(phi)'); + chanlocs = convertlocs( chanlocs, 'sphbesa2all'); + for index = 1:length(chanlocs) + chanlocs(index).labels = num2str(chanlocs(index).labels); + end; + theta = theta/pi*180; + fprintf('Note: .dat file contain polar 2-D coordinates. EEGLAB will use these coordinates\n'); + fprintf(' to recreated 3-D coordinates.\n'); + fprintf('\n'); + fprintf('Warning: if the channels are clustered in the middle or oddly spaced removed\n'); + fprintf(' the peripheral channels and then used the optimize head function\n'); + fprintf(' in the Channel Locations GUI. It seems that sometimes the peripherals\n'); + fprintf(' are throwing off the spacing.\n'); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readneurolocs.m b/code/eeglab13_4_4b/functions/sigprocfunc/readneurolocs.m new file mode 100644 index 0000000..2a2de14 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readneurolocs.m @@ -0,0 +1,130 @@ +% readneurolocs() - read neuroscan polar location file (.asc) +% +% Usage: +% >> CHANLOCS = readneurolocs( filename ); +% >> CHANLOCS = readneurolocs( filename, 'key1', val1, ...); +% +% Inputs: +% filename - file name or matlab cell array { names x_coord y_coord } +% +% Optional inputs: +% same as caliblocs() +% note that if no optional input are provided, re-centering will be +% performed automatically and re-scaling of coordinates will be +% performed for '.asc' files (not '.dat' files). +% +% Outputs: +% CHANLOCS - EEGLAB channel location data structure. See +% help readlocs() +% +% Author: Arnaud Delorme, CNL / Salk Institute, 4 March 2003 +% +% See also: readlocs() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function chanlocs = readneurolocs( filename, varargin) + +if nargin < 1 + help readneurolocs; + return; +end; +if nargin < 2 + plottag = 0; +end; + +% read location file +% ------------------ +if isstr(filename) + locs = loadtxt( filename ); +end; + +if ~isstr(filename) || locs{1,1}(1) == ';' || size(locs,2) < 5 + if ~isstr(filename) + names = filename{1}; + x = filename{2}; + y = filename{3}; + else + if locs{1,1}(1) == ';' + % remove trailing control channels + % -------------------------------- + while isnumeric( locs{end,1} ) & locs{end,1} ~= 0 + locs = locs(1:end-1,:); + end; + + % find first numerical index + % -------------------------- + index = 1; + while isstr( locs{index,1} ) + index = index + 1; + end; + + % extract location array + % ---------------------- + nchans = size( locs, 1 ) - index +1; + chans = [locs{end-nchans+1:end, 1:5}]; + chans = reshape(chans,nchans,5); %% Added this line in order to get x = chans(:,3) + names = locs(end-nchans*2+1: end-nchans, 2); + for index = 1:length(names) + if ~isstr(names{index}) + names{index} = int2str(names{index}); + end; + end; + x = chans(:,3); + y = -chans(:,4); + else + [tmp2 tmpind] = sort( [ locs{:,1} ]); + locs = locs(tmpind,:); + y = [ locs{:,end} ]; + x = [ locs{:,end-1} ]; + x = x/513.1617*44; + y = y/513.1617*44; + names = locs(:,end-2); + end; + end; + + % second solution using angle + % --------------------------- + [phi,theta] = cart2pol(x, y); + phi = phi/pi*180; + + % convert to other types of coordinates + % ------------------------------------- + labels = names'; + chanlocs = struct('labels', labels, 'sph_theta_besa', mattocell(theta)', 'sph_phi_besa', mattocell(phi)'); %% labels instead of labels(:) + chanlocs = convertlocs( chanlocs, 'sphbesa2all'); + + for index = 1:length(chanlocs) + chanlocs(index).labels = num2str(chanlocs(index).labels); + end; + + % re-calibration + % -------------- + chanlocs = adjustlocs(chanlocs, 'autoscale', 'on', 'autorotate', 'off', varargin{:}); + +else % 5 rows, xyz positions + try + for index = 1:size(locs,1) + locs{index,3} = - locs{index,3}; + end; + chanlocs = struct('labels', locs(:,1), 'type', locs(:,2), 'X', locs(:,4), 'Y', locs(:,3), 'Z', locs(:,5)); + chanlocs = convertlocs( chanlocs, 'cart2all'); + catch + chanlocs = readlocs(filename, 'filetype', 'custom', 'format', { 'labels' 'ignore' '-Y' 'X' 'Z' }); + end; +end; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/readtxtfile.m b/code/eeglab13_4_4b/functions/sigprocfunc/readtxtfile.m new file mode 100644 index 0000000..10bea84 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/readtxtfile.m @@ -0,0 +1,46 @@ +% readtxtfile() - Read text file into a Matlab variable +% +% Usage: >> str = readtxtfile( filename ); +% +% Input: +% filename - [string] name of the file. +% +% Output: +% str - [string] content of the file. +% +% Author: Arnaud Delorme, SCCN / INC / UCSD, August 2009 + +% Copyright (C) Arnaud Delorme, August 2009 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function com = readtxtfile(filename) + + com = ''; + if ~exist(filename) + disp([ 'Cannot find option file ' filename ]); + else + fid = fopen(filename, 'r'); + if fid == -1 + disp([ 'Cannot open option file ' filename ]); + else + com = ''; + while ~feof(fid) + a = fgetl(fid); + com = [ com 10 a ]; + end; + fclose(fid); + end; + end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/realproba.m b/code/eeglab13_4_4b/functions/sigprocfunc/realproba.m new file mode 100644 index 0000000..a38e53a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/realproba.m @@ -0,0 +1,67 @@ +% realproba() - compute the effective probability of the value +% in the sample. +% +% Usage: +% >> [probaMap, probaDist ] = realproba( data, discret); +% +% Inputs: +% data - the data onto which compute the probability +% discret - discretisation factor (default: (size of data)/5) +% if 0 base the computation on a Gaussian +% approximation of the data +% +% Outputs: +% probaMap - the probabilities associated with the values +% probaDist - the probabilities distribution +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ probaMap, sortbox ] = realproba( data, bins ); + +if nargin < 1 + help realproba; + return; +end; +if nargin < 2 + bins = round(size(data,1)*size(data,2)/5); +end; + +if bins > 0 + % COMPUTE THE DENSITY FUNCTION + % ---------------------------- + SIZE = size(data,1)*size(data,2); + sortbox = zeros(1,bins); + minimum = min(data(:)); + maximum = max(data(:)); + data = floor((data - minimum )/(maximum - minimum)*(bins-1))+1; + if any(any(isnan(data))), warning('Binning failed - could be due to zeroed out channel'); end; + for index=1:SIZE + sortbox(data(index)) = sortbox(data(index))+1; + end; + probaMap = sortbox(data) / SIZE; + sortbox = sortbox / SIZE; +else + % BASE OVER ERROR FUNCTION + % ------------------------ + data = (data-mean(data(:)))./std(data(:)); + probaMap = exp(-0.5*( data.*data ))/(2*pi); + probaMap = probaMap/sum(probaMap); % because the total surface under a normalized Gaussian is 2 + sortbox = probaMap/sum(probaMap); +end; +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/rejkurt.m b/code/eeglab13_4_4b/functions/sigprocfunc/rejkurt.m new file mode 100644 index 0000000..0782c0b --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/rejkurt.m @@ -0,0 +1,126 @@ +% rejkurt() - calculation of kutosis of a 1D, 2D or 3D array and +% rejection of outliers values of the input data array +% using the discrete kutosis of the values in that dimension. +% +% Usage: +% >> [kurtosis rej] = rejkurt( signal, threshold, kurtosis, normalize); +% +% Inputs: +% signal - one dimensional column vector of data values, two +% dimensional column vector of values of size +% sweeps x frames or three dimensional array of size +% component x sweeps x frames. If three dimensional, +% all components are treated independently. +% threshold - Absolute threshold. If normalization is used then the +% threshold is expressed in standard deviation of the +% mean. 0 means no threshold. +% kurtosis - pre-computed kurtosis (only perform thresholding). Default +% is the empty array []. +% normalize - 0 = do not not normalize kurtosis. 1 = normalize kurtosis. +% 2 is 20% trimming (10% low and 10% high) kurtosis before +% normalizing. Default is 0. +% +% Outputs: +% kurtosis - normalized joint probability of the single trials +% (same size as signal without the last dimension) +% rej - rejected matrix (0 and 1, size: 1 x sweeps) +% +% Remarks: +% The exact values of kurtosis depend on the size of a time +% step and thus cannot be considered as absolute. +% This function uses the kurtosis function from the statistival +% matlab toolbox. If the statistical toolbox is not installed, +% it uses the 'kurt' function of the ICA/EEG toolbox. +% +% See also: kurt(), kurtosis() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [kurto, rej] = rejkurt( signal, threshold, oldkurtosis, normalize); + +if nargin < 1 + help rejkurt; + return; +end; +if nargin < 2 + threshold = 0; +end; +if nargin < 4 + normalize = 0; +end; +if nargin < 3 + oldkurtosis = []; +end; + +if size(signal,2) == 1 % transpose if necessary + signal = signal'; +end; + +nbchan = size(signal,1); +pnts = size(signal,2); +sweeps = size(signal,3); +kurto = zeros(nbchan,sweeps); + +if ~isempty( oldkurtosis ) % speed up the computation + kurto = oldkurtosis; +else + for rc = 1:nbchan + % compute all kurtosis + % -------------------- + for index=1:sweeps + try + kurto(rc, index) = kurtosis(signal(rc,:,index)); + catch + kurto(rc, index) = kurt(signal(rc,:,index)); + end; + end; + end; + + % normalize the last dimension + % ---------------------------- + if normalize + tmpkurt = kurto; + if normalize == 2, + tmpkurt = sort(tmpkurt); + minind = max(round(length(tmpkurt)*0.1),1); + maxind = round(length(tmpkurt)-round(length(tmpkurt)*0.1)); + if size(tmpkurt,2) == 1 + tmpkurt = tmpkurt(minind:maxind); + else tmpkurt = tmpkurt(:,minind:maxind); + end; + end; + switch ndims( signal ) + case 2, kurto = (kurto-mean(tmpkurt)) / std(tmpkurt); + case 3, kurto = (kurto-mean(tmpkurt,2)*ones(1,size(kurto,2)))./ ... + (std(tmpkurt,0,2)*ones(1,size(kurto,2))); + end; + end; +end; + +% reject +% ------ +if threshold(1) ~= 0 + if length(threshold) > 1 + rej = (threshold(1) > kurto) | (kurto > threshold(2)); + else + rej = abs(kurto) > threshold; + end; +else + rej = zeros(size(kurto)); +end; + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/rejstatepoch.m b/code/eeglab13_4_4b/functions/sigprocfunc/rejstatepoch.m new file mode 100644 index 0000000..e6c99ec --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/rejstatepoch.m @@ -0,0 +1,423 @@ +% rejstatepoch() - reject bad eeg trials based a statistical measure. Can +% be applied either to the raw eeg data or the ICA +% component activity. This is an interactive function. +% +% Usage: +% >> [ Irej, Irejdetails, n, threshold, thresholdg] = ... +% rejstatepoch( signal, rej, 'key1', value1...); +% +% Inputs: +% signal - 3 dimensional data array channel x points x trials +% (instead of channels, one might also use independent +% components). +% rej - rejection array, one value per trial and per channel or +% component (size channel x trials). +% By default, values are normalized by this +% function and trehshold is expressed in term of standard +% deviation of the mean. +% +% Optional inputs: +% 'plot' - ['on'|'off'] interactive mode or just rejection. +% In the interactive mode, it plots the normalized +% entropy of original signal (blue) and the limits +% (red) (default:'on') +% 'threshold' - percentage error threshold (default 1-0.25/nb_trials) +% for individual trials of individual channel/component. +% This treshold is expressed in term of standart +% deviation from the mean (default 5). +% 'global' - ['on'|'off'], also perform threshold on the global +% measure (by default, the mean over all channel or +% electrodes). +% 'rejglob' - rejection array, one value per trials. Use this +% argument when the global measure for all channels or +% does not correspond to their mean. +% 'thresholdg' - global threshold for the reunion of all channels +% or components. By default, it is equal to 'threshold'. +% 'normalize' - ['on'|'off'], normalize values before applying the +% treshold. Default is 'on'. +% 'plotcom' - sting command to plot single trials. Default +% is none. +% 'title' - title of the graph. Default is none. +% 'labels' - labels for electrodes (array not cell). +% +% Outputs: +% Irej - indexes of trials to be rejected +% Irejdetails - array for rejected components or channel (nb_rejected x +% nb_channel or nb_rejected x nb_components) +% n - number of trials rejected +% threshold - percentage error threshold +% thresholdg - percentage error threshold for global rejection +% +% See also: eeglab() + +% Algorithm: +% normalise the measure given as input and reject trials based on +% an uniform distribution of the data + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% userdata +% gcf : plotsig - signal to plot in the pop_out window +% pnts - number of points per epoch +% Irej - rejection of trials +% Irejelec - rejection of trials and electrodes +% labels - labels for curves +% plotwin : rej1 - rejection array (with all electrodes x trials) +% rej2 - global rejection array (size trials) +% thr1 - threshold (electrodes) +% thr2 - threshold global + +function [ Irej, Irejdetails, n, threshold, thresholdg] = rejstatepoch( signal, ... + rej, varargin); % pnts, th_E, th_rejg, command, commandplot, typetitle, E, rejg); + +if nargin < 1 + help rejstatepoch; + return; +end; + +if ~isstr( signal ) + + if nargin < 2 + help rejstatepoch; + return; + end; + + if ~isempty( varargin ), g=struct(varargin{:}); + else g= []; end; + try, g.plot; catch, g.plot='on'; end; + try, g.threshold; catch, g.threshold=5; end; + try, g.thresholdg; catch, g.thresholdg=5; end; + try, g.global; catch, g.global='on'; end; + try, g.rejglob; catch, g.rejglob=[]; end; + try, g.normalize; catch, g.normalize='on'; end; + try, g.plotcom; catch, g.plotcom=''; end; + try, g.title; catch, g.title=''; end; + try, g.labels; catch, g.labels=''; end; + + g.rej = rej; + clear rej + switch lower(g.plot) + case {'on', 'off'} ; + otherwise disp('Error: Plot must be either ''on'' or ''off'''); return; + end; + switch lower(g.global) + case {'on', 'off'} ; + otherwise disp('Error: Global must be either ''on'' or ''off'''); return; + end; + switch lower(g.normalize) + case {'on', 'off'} ; + otherwise disp('Error: Normalize must be either ''on'' or ''off'''); return; + end; + if ~isstr(g.plotcom) + disp('Error: Plotcom must be a string to evaluate'); return; + end; + if ~isstr(g.title) + disp('Error: Title must be a string'); return; + end; + try, g.threshold*2; + catch, disp('Error: Threhsold must be a number'); return; + end; + try, g.thresholdg*2; + catch, disp('Error: Threhsoldg must be a number'); return; + end; + if length(g.threshold(:)) > 1 + disp('Error: Threhsold must be a single number'); return; + end; + if length(g.thresholdg(:)) > 1 + disp('Error: Threhsoldg must be a single number'); return; + end; + if ~isempty(g.rejglob) + if length(g.rejglob) ~= size(g.rej,2) + disp('Error: Rejglob must be have the same length as rej columns'); return; + end; + else + switch lower(g.global), case 'on', g.rejglob = sum(g.rej,1); end; + end; + if size(signal,3) ~= size(g.rej,2) + disp('Error: Signal must be have the same number of element in 3rd dimension as rej have columns'); return; + end; + if isempty(g.labels) + for index = 1:size(g.rej,1) + g.labels(index,:) = sprintf('%3d', index); + end; + if ~isempty(g.rejglob) + g.labels(index+2,:) = 'g. '; + end; + end; + + switch lower(g.normalize), + case 'on', + g.rej = (g.rej-mean(g.rej,2)*ones(1, size(g.rej,2)))./ (std(g.rej, 0, 2)*ones(1, size(g.rej,2))); + switch lower(g.global), case 'on', g.rejglob = (g.rejglob(:)-mean(g.rejglob(:)))./ std(g.rejglob(:)); end; + end; + switch lower(g.global), case 'off',g.rejglob = []; end; + + % plot the buttons + % ---------------- + try, icadefs; catch, GUIBUTTONCOLOR = [0.8 0.8 0.8]; BACKCOLOR = [0.8 0.8 0.8]; end; + figure('color', BACKCOLOR); + set(gcf, 'name', 'Rejectrials'); + pos = get(gca,'position'); % plot relative to current axes + set( gca, 'tag', 'mainaxis'); + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]./100; % allow to use normalized position [0 100] for x and y + axis('off'); + + plotsig = sum(abs(signal(:,:)),1); + set(gcf, 'userdata', { plotsig, size(signal, 2), [], [] }); % the two last arguments are the rejection + + % Create axis + % ----------- + h6 = axes('Units','Normalized', 'tag', 'Plotwin', 'Position',[-10 12 120 84].*s+q); + title(g.title); + set( h6, 'userdata', { g.rej g.rejglob g.threshold g.thresholdg g.labels }); % g.rej was put twice because it is used to compute the global entropy + + % CANCEL button + % ------------- + h = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'Cancel', 'Units','Normalized','Position',... + [-15 -6 15 6].*s+q, 'callback', 'close(gcf);', 'backgroundcolor', GUIBUTTONCOLOR); + + % Entropy component text and threshold + % ------------------------------------ + makebutton( 'Single-channel', 'Plotwin' , [3 -6 27 6].*s+q, [30 -6 15 6].*s+q, 3, g.threshold, GUIBUTTONCOLOR); + makebutton( 'All-channel', 'Plotwin' , [50 -6 27 6].*s+q, [77 -6 15 6].*s+q, 4, g.thresholdg, GUIBUTTONCOLOR); + + % EEGPLOT button + % -------------- + if ~isempty(g.plotcom) + h = uicontrol(gcf, 'backgroundcolor', GUIBUTTONCOLOR, 'Style', 'pushbutton', 'string', 'EEGPLOT', 'Units','Normalized','Position',[95 -2 15 6].*s+q, ... + 'callback',['TMPEEG = get(gcbf, ''userdata'');' ... + 'TMPREJ = TMPEEG{3};' ... + 'TMPREJELEC = TMPEEG{4};' ... + g.plotcom ] ); + posaccept = [95 -10 15 6]; + else posaccept = [95 -6 15 6]; + end; + + % ACCEPT button + % ------------- + command = 'fprintf(''Rejection indices has been put in the matrix TMPREJ\n'')'; + haccept = uicontrol(gcf, 'backgroundcolor', GUIBUTTONCOLOR, 'Style', 'pushbutton', 'string', 'UPDATE', 'Units','Normalized','Position', posaccept.*s+q, ... + 'callback', [ 'set(gcbo, ''userdata'', 1);' ... %signal to signify termination + 'TMPEEG = get(gcbf, ''userdata'');' ... + 'TMPREJ = TMPEEG{3};' ... + 'TMPREJELEC = TMPEEG{4};' ... + command ] ); + + command = [ 'entwin = get(gcbf, ''currentobject'');' ... + 'tmptype = get(entwin,''type'');' ... + 'if tmptype(1) == ''l'' entwin = get(entwin, ''parent''); end;' ... + 'tagwin = get(entwin,''tag'');' ... % either entropy or kurtosis + 'switch tagwin,' ... + ' case ''Plotwin'',' ... % check if the user clicked on the right window + ' alldata = get(gcf, ''userdata'');' ... + ' plotsig = alldata{1};' ... + ' pnts = alldata{2};' ... + ' fig = figure(''position'', [100 300 600 400],''color'', [1 1 1]);' ... + ' I = alldata{3};' ... + ' sweeps = size(plotsig,2) /pnts;' ... + ' h1 = axes(''parent'', fig, ''Units'',''Normalized'', ''Position'',[0.6 0.11 0.27 0.815]);' ... + ' pos = get(entwin, ''currentpoint'');' ... + ' component = round(pos(1) / sweeps + 0.5);' ... % determine the component number + ' alldata = get(entwin, ''userdata'');' ... + ' rej = alldata{1};' ... + ' if component <= size(rej,1)' ... % component + ' rej_threshold = alldata{3};' ... + ' component = max(1,min(component, size(rej,1))); ' ... + ' rej = rej(component, :);' ... + ' titlegraph = sprintf(''' g.title ' #%d'', component);' ... + ' colorgraph = ''b'';' ... + ' else' ... % global + ' rej = alldata{2};' ... + ' rej_threshold = alldata{4};' ... + ' titlegraph = sprintf(''' g.title ' global'');' ... + ' colorgraph = ''g'';' ... + ' end;' ... + ' plot([1:length(rej)], rej, ''color'', colorgraph);' ... + ' ss = get(h1, ''xlim'');' ... + ' set(h1, ''view'', [90 90]);' ... + ' set(h1, ''xdir'', ''reverse'');' ... + ' set(h1, ''XLim'', ss);' ... + ' hold on;' ... % plot component + ' yl = get(h1, ''ylim'');' ... + ' set(h1, ''xtickmode'', ''manual'', ''xtick'', sweeps/2, ''xticklabel'', component, ''xlim'', [ 0 sweeps ]);' ... + ' title( titlegraph );' ... + ' plot( get(h1, ''xlim''), [rej_threshold rej_threshold], ''r'');' ... % plot limit + ' plot( get(h1, ''xlim''), [-rej_threshold -rej_threshold], ''r'');' ... % plot limit + ' set(h1, ''xticklabel'', []);' ... + ' hold on;' ... + ' h2 = axes(''parent'', fig,''Units'',''Normalized'', ''Position'',[0.13 0.11 0.27 0.815]);' ... + ' erpimage( plotsig, ones(1,size(plotsig,2)/pnts), [0:1/(pnts-1):1], '''', 3, 1, ''nosort'', ''noplot'');' ... + ' title(''Currentset all chans''); xlabel(''''); ylabel(''''); ' ... + ' set(gca, ''xticklabel'', []);' ... + ' hold on;' ... + ' h3 = axes(''parent'', fig,''Units'',''Normalized'', ''Position'',[0.45 0.11 0.1 0.815]);' ... + ' if any(I ~= 0)' ... + ' rejImage = (I'' * ones(1, 10))'';' ... + ' imagesc( rejImage'' );' ... + ' set(gca, ''ydir'', ''normal'');' ... + ' end;' ... + ' title(''Rejected (all)''); xlabel(''''); ylabel('''');' ... + ' set(gca, ''xticklabel'', [], ''yticklabel'', []);' ... + 'end;' ... + 'clear fig tmptype tagwin alldata rej rejImage plotsig sweeps pnts rej_threshold ss q s h1 h2 h3 pos component yl;' ]; + +% ' erpimage( rejImage(:)'', ones(1,size(I,2)), [0:1/(10-1):1], '''', 1, 0, ''nosort'', ''noplot'');' ... + set(gcf, 'WindowButtonDownFcn', command); + + rejstatepoch('draw'); + switch g.plot, + case 'on', waitfor( haccept, 'userdata'); drawnow; + end; + + threshold = g.threshold; + thresholdg = g.thresholdg; + Irej = []; + Irejdetails = []; + n = 0; + try + TMPEEG = get(gcf, 'userdata'); + Irej = TMPEEG{3}; + Irejdetails = TMPEEG{4}; + n = length(find(Irej == 1)); + + plothandler = findobj( 'parent', gcf, 'tag', 'Plotwin'); + TMPEEG = get(plothandler, 'userdata'); + threshold = TMPEEG{3}; + thresholdg = TMPEEG{4}; + close(gcf); + catch, end; +else %if signal is a string draw everything + + % retreive data + % ------------- + gcfdata = get(gcf, 'userdata'); + plotsig = gcfdata {1}; + pnts = gcfdata {2}; + sweeps = size(plotsig,2)/pnts; + + h6 = findobj('parent', gcf, 'tag', 'Plotwin'); + alldata = get(h6, 'userdata'); + g.rej = alldata {1}; + g.rejg = alldata {2}; + g.threshold = alldata {3}; + g.thresholdg = alldata {4}; + set(h6, 'userdata', alldata); + + nbchans = size(g.rej,1); + + % reject trials + % ------------- + rejelec = abs(g.rej) > g.threshold; + rej = max(rejelec,[],1); + n1 = sum(rej(:)); + if ~isempty( g.rejg ) + rej2 = abs(g.rejg) > g.thresholdg; + n2 = sum(rej2(:)); + rej = rej | rej2(:)'; + end; + fprintf('%d trials rejected (single:%d, all:%d)\n', sum(rej(:)), n1, n2); + gcfdata {3} = rej; + gcfdata {4} = rejelec; + set(gcf, 'userdata', gcfdata); + + % plot the sorted entropy curve + % ----------------------------- + plotstat( 'Plotwin'); + +end; +return; + +function plotstat( id ); + + % plot the sorted entropy curve + % ----------------------------- + h6 = findobj('parent', gcf, 'tag', id); + axes(h6); cla; + ttmp = get(gca, 'title'); + oldtitle = get(ttmp, 'string'); + + % get datas + % --------- + alldata = get(gca, 'userdata'); + g.rej = alldata {1}; + g.rejg = alldata {2}; + g.threshold = alldata {3}; + g.thresholdg = alldata {4}; + g.labels = alldata {5}; + nbchans = size(g.rej,1); + sweeps = size(g.rej,2); + + % plot datas + % ---------- + g.rej = g.rej'; plot(g.rej(:)); g.rej = g.rej'; + hold on; + yl = get(gca, 'ylim'); + + % plot vertival bars to separate components and the trehsold + % ---------------------------------------------------------- + set( gca, 'tag', id, 'ylimmode', 'manual'); + set(gca, 'xtickmode', 'manual', 'xtick', [0:sweeps:(size(g.rej(:),1)-1+2*sweeps)] + sweeps/2, ... + 'xticklabel', g.labels, 'xlim', [ 0 (size(g.rej(:),1)-1+2*sweeps)]); + plot( [1 size(g.rej(:),1)], [-g.threshold -g.threshold], 'r'); % plot threshold + plot( [1 size(g.rej(:),1)], [g.threshold g.threshold], 'r'); % plot threshold + + if ~isempty(g.rejg) % plot global ? + plot([size(g.rej(:),1)+sweeps:size(g.rej(:),1)+2*sweeps-1], g.rejg(:), 'g'); + pp = patch([size(g.rej(:),1) size(g.rej(:),1) size(g.rej(:),1)+sweeps size(g.rej(:),1)+sweeps], [yl(1)-1 yl(2)+1 yl(2)+1 yl(1)-1], get(gcf, 'color'), 'clipping', 'off'); + set(pp, 'EdgeColor', get(gcf, 'color')); + plot( [size(g.rej(:),1)+sweeps length(g.rejg)+size(g.rej(:),1)+sweeps], [-g.thresholdg -g.thresholdg], 'r'); % plot threshold + plot( [size(g.rej(:),1)+sweeps length(g.rejg)+size(g.rej(:),1)+sweeps], [g.thresholdg g.thresholdg], 'r'); % plot threshold + plot([size(g.rej(:),1)+sweeps size(g.rej(:),1)+sweeps], yl, 'k'); + else + pp = patch([size(g.rej(:),1) size(g.rej(:),1) size(g.rej(:),1)+2*sweeps size(g.rej(:),1)+2*sweeps], [yl(1)-1 yl(2)+1 yl(2)+1 yl(1)-1], get(gcf, 'color'), 'clipping', 'off'); + set(pp, 'EdgeColor', get(gcf, 'color')); + end; + for index = 0:sweeps:size(g.rej(:),1); + plot([index index], yl, 'k'); + end; + + % restore properties + title(oldtitle); + set(h6, 'userdata', alldata); + +return; + +function makebutton( string, ax, pos1, pos2, userindex, init, GUIBUTTONCOLOR ); + h = uicontrol(gcf , 'backgroundcolor', GUIBUTTONCOLOR, 'Style', 'radiobutton', 'string', string, 'value', fastif(init == 0, 0, 1), 'Units','Normalized', 'Position', pos1, ... + 'callback', [ 'textresh = findobj(''parent'', gcbf, ''tag'', ''' string ''');' ... + 'checkstatus = get(gcbo, ''value'');' ... + 'ax = findobj(''parent'', gcbf, ''tag'', ''' ax ''');' ... + 'tmpdat = get(ax, ''userdata'');' ... + 'if checkstatus' ... % change status of the textbox + ' set(textresh, ''enable'', ''on'');' ... + ' tmpdat{' int2str(userindex) '} = str2num(get(textresh, ''string''));' ... + 'else' ... + ' set(textresh, ''enable'', ''off'');' ... + ' tmpdat{' int2str(userindex) '} = 0;' ... + 'end;' ... + 'set(ax, ''userdata'' , tmpdat);' ... + 'rejstatepoch(''draw'');' ... + 'clear tmpdat ax checkstatus textresh;' ] ); + h = uicontrol(gcf, 'Style', 'edit', 'backgroundcolor', [1 1 1], 'tag', string, 'string', num2str(init), 'enable', fastif(init == 0, 'off', 'on'), 'Units','Normalized', 'Position', pos2, ... + 'callback', [ 'ax = findobj(''parent'', gcbf, ''tag'', ''' ax ''');' ... + 'tmpdat = get(ax, ''userdata'');' ... + 'tmpdat{' int2str(userindex) '} = str2num(get(gcbo, ''string''));' ... + 'set(ax, ''userdata'' , tmpdat);' ... + 'rejstatepoch(''draw'');' ... + 'clear tmpdat ax;' ] ); +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/rejtrend.m b/code/eeglab13_4_4b/functions/sigprocfunc/rejtrend.m new file mode 100644 index 0000000..01069df --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/rejtrend.m @@ -0,0 +1,94 @@ +% rejtrend() - detect linear trends in EEG activity and reject the +% epoched trials based on the accuracy of the linear +% fit. +% Usage: +% >> [rej rejE] = rejtrend( signal, winsize, maxslope, minR, step); +% +% Inputs: +% signal - 3 dimensional signal (channels x frames x trials) +% winsize - integer determining the number of consecutive points +% for the detection of linear patterns +% maxslope - maximum acceptable absolute slope of the linear trend. If the slope +% of the line fitted to a data epoch is greater than or equal to +% maxslope, that epoch is rejected (assuming a sufficient R^2 value, +% see minR below). +% minR - minimal R^2 (coefficient of determination between +% 0 and 1). The R^2 value reflects how well the data epoch is +% approximated by a line. An epoch is not rejected unless its R^2 +% value is greater than minR. +% step - step for the window. Default is 1 point (2 points +% will divide by two the computation time) +% +% Outputs: +% rej - rejected trials. Array with 0 or 1 for each trial. +% rejE - rejected rows of the rejected trials +% +% Algorithm: +% Looked for all possible windows of size 'winsize' of each trial if +% the linear fit have minimum slope and R^2 +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [rej, rejE] = rejtrend( signal, pointrange, maxslope, minstd, step); + +% This is to avoid divide-by-zero and machine errors. +SST_TOLERANCE = 1000*pointrange*1.1921e-07; + +if nargin < 3 + help rejtrend; + return; +end; +if nargin < 5 + step = pointrange; +end; +[chans pnts trials] = size(signal); +rejE = zeros( chans, trials); + +x = linspace( 1/pointrange, 1, pointrange ); +%waitbarhandle = waitbar(0,'rejtrend.m Please wait...'); +for c = 1:chans + for t = 1:trials + for w = 1:step:(pnts-pointrange+1) + y = signal(c, [w:w+pointrange-1], t); + coef = polyfit(x,y,1); + if abs(coef(1)) >= maxslope + ypred = polyval(coef,x); % predictions + dev = y - mean(y); % deviations - measure of spread + SST = sum(dev.^2); % total variation to be accounted for + if SST < SST_TOLERANCE % make sure SST is not too close to zero + SST = SST_TOLERANCE; + end + resid = y - ypred; % residuals - measure of mismatch + SSE = sum(resid.^2); % variation NOT accounted for + Rsq = 1 - SSE/SST; % percent of error explained + if Rsq > minstd + rejE( c, t ) = 1; + end + % see the page http://www.facstaff.bucknell.edu/maneval/help211/fitting.html + end + end + end + %waitbar(c/chans); +end +%close(waitbarhandle); +rej = max( rejE, [], 1); + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/reref.m b/code/eeglab13_4_4b/functions/sigprocfunc/reref.m new file mode 100644 index 0000000..bfd9712 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/reref.m @@ -0,0 +1,238 @@ +% reref() - convert common reference EEG data to some other common reference +% or to average reference +% Usage: +% >> Dataout = reref(data); % convert all channels to average reference +% >> [Dataout Chanlocs] = reref(data, refchan, 'key', 'val'); +% % convert data to new reference with options +% Inputs: +% data - 2-D or 3-D data matrix (chans,frames*epochs) +% refchan - reference channel number(s). There are three possibilities: +% 1) [] - compute average reference +% 2) [X]: re-reference to channel X +% 2) [X Y Z ...]: re-reference to the average of channel X Y Z ... +% +% Optional inputs: +% 'exclude' - [integer array] channel indices to exclude from re-referencing +% (e.g., event marker channels, etc.) +% 'keepref' - ['on'|'off'] keep reference channel in output (only usable +% when there are several references). +% 'elocs' - Current data electrode location structure (e.g., EEG.chanlocs). +% 'refloc' - Reference channel location single element structure or cell array +% {'label' theta radius} containing the name and polar coordinates +% of the current channel. Including this entry means that +% this channel will be included (reconstructed) in the +% output. +% +% Outputs: +% Dataout - Input data converted to the new reference +% Chanlocs - Updated channel locations structure +% +% Notes: 1) The average reference calculation implements two methods +% (see www.egi.com/Technotes/AverageReference.pdf) +% V'i = (Vi-Vref) - sum(Vi-Vref)/number_of_electrodes +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2009- +% previous version: Arnaud Delorme & Scott Makeig, 1999-2002 + +% Deprecated inputs: +% These inputs are still accepted but not processed. The function returns +% accurate results irrespective of the entry of these options. +% 'refstate ' - ['common'|'averef'|[indices]] Current reference condition, +% ('averef') = average reference; ('common' or 0) = common +% reference. [indices] designate the current reference channel +% or channels if present in the data {default: 'common'} +% 'method' - ['standard'|'withref'] Do not ('standard') or do ('withref') +% include reference channel data in output {def: 'standard'}. +% Note: Option 'withref' not possible when multiple ref channel +% indices are given as argument to 'refstate' (below). +% +% ICA inputs: +% These inputs are still accepted but not the ICA conversion is now +% performed from within pop_reref() +% 'icaweights' - ICA weight matrix. Note: If this is ICA weights*sphere, +% then the 'icasphere' input below should be [] or identity. +% 'icasphere' - ICA sphere matrix (if any) +% 'icachansind' - Indices of the channels used in ICA decomposition +% +% Outputs: +% Wout - ICA weight matrix (former icaweights*icasphere) +% converted to new data reference +% Sout - ICA sphere matrix converted to an identity matrix +% ICAinds - New indices of channels used in ICA decomposition +% meandata - (1,dataframes) means removed from each data point +% +% 2) In conversion of the weight matrix to a new reference +% where WS = Wts*Sph and ica_act = WS*data, then +% data = inv(WS)*ica_act; +% If R*data are the re-referenced data, +% R*data= R*inv(WS)*ica_act; +% And Wout = inv(R*inv(WS)); +% Now, Sout = eye(length(ICAinds)); +% The re-referenced ICA component maps are now the +% columns of inv(Wout), and the icasphere matrix, Sout, +% is an identity matrix. Note: inv() -> pinv() when +% PCA dimension reduction is used during ICA decomposition. + +% Copyright (C) 1999 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 12/16/99 Corrected denomiator on the suggestion of Ian Nimmo-Smith, Cambridge UK +% 01-25-02 reformated help & license -ad + +function [data, Elocs, morechans, W, S, icachansind, meandata] = reref(data, ref, varargin) + +if nargin<1 + help reref + return +end +if nargin < 2 + ref = []; +end; + +% check inputs +% ------------ +g = finputcheck(varargin, { 'icaweight' 'real' [] []; + 'icaweights' 'real' [] []; + 'icasphere' 'real' [] []; + 'icachansind' 'integer' [] []; + 'method' 'string' { 'standard','withref' } 'standard'; + 'refstate' { 'string','integer' } { { 'common','averef' } [1 size(data,1)] } 'common'; % ot used but kept for backward compatib. + 'exclude' 'integer' [1 size(data,1)] []; + 'refloc' { 'cell','struct' } { [] [] } {}; + 'keepref' 'string' {'on','off' } 'off'; + 'elocs' {'integer','struct'} [] [] }); +if isstr(g), error(g); end; +if ~isempty(g.icaweight) + g.icaweights = g.icaweight; +end; +if ~isempty(g.icaweights) + if isempty(g.icachansind), + g.icachansind = [1:size(g.icaweights,2)]; + disp('Warning: reref() output has changed slightly since EEGLAB 5.02'); + disp(' the 4th output argument is the indices of channels used for ICA instead'); + disp(' of the mean reference value (which is now output argument 5)'); + end; +end; + +if ~isempty(ref) + if ref > size(data,1) + error('reference channel index out of range'); + end; +end; + +[dim1 dim2 dim3] = size(data); +data = reshape(data, dim1, dim2*dim3); + +% single reference not present in the data +% add it as blank data channel at the end +% ---------------------------------------- +if ~isempty(g.refloc) == 1 + if ~isempty(g.elocs) + if iscell(g.refloc) + data(end+1,:) = 0; + g.elocs(end+1).labels = g.refloc{1}; + g.elocs(end ).theta = g.refloc{2}; + g.elocs(end ).radius = g.refloc{3}; + else + data(end+length(g.refloc),:) = 0; + for iLocs = 1:length(g.refloc) + g.elocs(end+1).labels = g.refloc(iLocs).labels; + fieldloc = fieldnames(g.elocs); + for ind = 1:length(fieldloc) + g.elocs(end) = setfield(g.elocs(end), fieldloc{ind}, getfield(g.refloc(iLocs), fieldloc{ind})); + end; + end; + end; + end; + [dim1 dim2 dim3] = size(data); +end; + +% exclude some channels +% --------------------- +chansin = setdiff_bc([1:dim1], g.exclude); +nchansin = length(chansin); + +% return mean data +% ---------------- +if nargout > 4 + meandata = sum(data(chansin,2))/nchansin; +end; + +% generate rereferencing matrix +% ----------------------------- +if 0 % alternate code - should work exactly the same + if isempty(ref) + ref=chansin; % average reference + end % if + chansout=chansin; + data(chansout,:)=data(chansout,:)-ones(nchansin,1)*mean(data(ref,:),1); +else + if ~isempty(ref) % not average reference + refmatrix = eye(nchansin); % begin with identity matrix + tmpref = ref; + for index = length(g.exclude):-1:1 + tmpref(find(g.exclude(index) < tmpref)) = tmpref(find(g.exclude(index) < tmpref))-1; + end; + for index = 1:length(tmpref) + refmatrix(:,tmpref(index)) = refmatrix(:,tmpref(index))-1/length(tmpref); + end; + else % compute average reference + refmatrix = eye(nchansin)-ones(nchansin)*1/nchansin; + end; + chansout = chansin; + data(chansout,:) = refmatrix*data(chansin,:); +end; + +% change reference in elocs structure +% ----------------------------------- +if ~isempty(g.elocs) + if isempty(ref) + for ind = chansin + g.elocs(ind).ref = 'average'; + end; + else + reftxt = { g.elocs(ref).labels }; + if length(reftxt) == 1, reftxt = reftxt{1}; + else + reftxt = cellfun(@(x)([x ' ']), reftxt, 'uniformoutput', false); + reftxt = [ reftxt{:} ]; + end; + for ind = chansin + g.elocs(ind).ref = reftxt; + end; + end; +end; + +% remove reference +% ---------------- +morechans = []; +if strcmpi(g.keepref, 'off') + data(ref,:) = []; + if ~isempty(g.elocs) + morechans = g.elocs(ref); + g.elocs(ref) = []; + end; +end; + +data = reshape(data, size(data,1), dim2, dim3); + +% treat optional ica parameters +% ----------------------------- +W = []; S = []; icachansind = []; +if ~isempty(g.icaweights) + disp('Warning: This function does not process ICA array anymore, use the pop_reref function instead'); +end; +Elocs = g.elocs; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/rmbase.m b/code/eeglab13_4_4b/functions/sigprocfunc/rmbase.m new file mode 100644 index 0000000..e2480b9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/rmbase.m @@ -0,0 +1,124 @@ +% rmbase() - subtract basevector channel means from multi-epoch data matrix +% +% Usage: +% >> [dataout] = rmbase(data); % remove whole-data channel means +% >> [dataout datamean] = rmbase(data,frames,basevector); +% % remove mean of basevector from each channel and epoch +% Inputs: +% data - data matrix (chans,frames*epochs) or (chans, frames, epochs); +% frames - data points per epoch {[]|0|default->data length} +% basevector - vector of baseline frames per epoch +% Ex 1:128 {[]|0|default->whole epoch} +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 2-5-96 + +% Copyright (C) 2-5-96 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 07-30-97 converted to rmbase() -sm +% 09-30-97 fixed! -sm +% 05-10-01 caught empty input data -sm +% 06-03-01 added test for length-1 basevector, added [] defaults -sm +% 01-05-02 added check for negative basevector indices -Luca Finelli +% 01-25-02 reformated help & license -ad + +function [dataout,datamean] = rmbase(data,frames,basevector) + + if nargin<3, + basevector =0; + end; + if isempty(basevector) + basevector =0; + end; + if length(basevector) == 1 & basevector(1) ~= 0 + fprintf('rmbase(): basevector should be a vector of frame indices.\n'); + return + end + + if sum(basevector<0)~= 0 + fprintf('rmbase(): basevector should be 0 or a vector of positive frame indices.\n'); + return + end + + if nargin < 2, + frames = 0; + end; + if isempty(frames) + frames =0; + end; + if nargin<1, + help rmbase; + fprintf('rmbase(): needs at least one argument.\n\n'); + return + end + if isempty(data) + fprintf('rmbase(): input data is empty.\n\n'); + return + end + + oridims = size(data); + if ndims(data) == 3, + data = reshape(data, size(data,1), size(data,2)*size(data,3)); + reshape_flag=1; + end + + [chans framestot]= size(data); + if frames ==0, + frames = framestot; + end; + epochs = fix(framestot/frames); + + if length(basevector)>framestot, + fprintf('rmbase(): length(basevector) > frames per epoch.\n\n'); + help rmbase; + return + end; + + datamean = zeros(chans,epochs); + % fprintf('removing epoch means for %d epochs\n',epochs); + + dataout = data; + for e=1:epochs + for c=1:chans + if basevector(1)~=0, + rmeans = nan_mean(double(data(c,(e-1)*frames+basevector)')); + else + rmeans = nan_mean(double(data(c,(e-1)*frames+1:e*frames)')); + %if e==1 + % fprintf('rmbase(): whole-data channel means removed. \n\n'); + %end + end; + datamean(c,e) = rmeans; + dataout(c,(e-1)*frames+1:e*frames) = data(c,(e-1)*frames+1:e*frames) - rmeans; + end; + end; + + dataout = reshape(dataout, oridims); + + +% function out = nan_mean(in) +% +% nans = find(isnan(in)); +% in(nans) = 0; +% sums = sum(in); +% nonnans = ones(size(in)); +% nonnans(nans) = 0; +% nonnans = sum(nonnans); +% nononnans = find(nonnans==0); +% nonnans(nononnans) = 1; +% out = sum(in)./nonnans; +% out(nononnans) = NaN; +% diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/runica.m b/code/eeglab13_4_4b/functions/sigprocfunc/runica.m new file mode 100644 index 0000000..04b7d6b --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/runica.m @@ -0,0 +1,1535 @@ +% runica() - Perform Independent Component Analysis (ICA) decomposition +% of input data using the logistic infomax ICA algorithm of +% Bell & Sejnowski (1995) with the natural gradient feature +% of Amari, Cichocki & Yang, or optionally the extended-ICA +% algorithm of Lee, Girolami & Sejnowski, with optional PCA +% dimension reduction. Annealing based on weight changes is +% used to automate the separation process. +% Usage: +% >> [weights,sphere] = runica(data); % train using defaults +% else +% >> [weights,sphere,compvars,bias,signs,lrates,activations] ... +% = runica(data,'Key1',Value1',...); +% Input: +% data = input data (chans,frames*epochs). +% Note that if data consists of multiple discontinuous epochs, +% each epoch should be separately baseline-zero'd using +% >> data = rmbase(data,frames,basevector); +% +% Optional keywords [argument]: +% 'extended' = [N] perform tanh() "extended-ICA" with sign estimation +% N training blocks. If N > 0, automatically estimate the +% number of sub-Gaussian sources. If N < 0, fix number of +% sub-Gaussian comps to -N [faster than N>0] (default|0 -> off) +% 'pca' = [N] decompose a principal component (default -> 0=off) +% subspace of the data. Value is the number of PCs to retain. +% 'sphering' = ['on'/'off'] flag sphering of data (default -> 'on') +% 'weights' = [W] initial weight matrix (default -> eye()) +% (Note: if 'sphering' 'off', default -> spher()) +% 'lrate' = [rate] initial ICA learning rate (<< 1) (default -> heuristic) +% 'block' = [N] ICA block size (<< datalength) (default -> heuristic) +% 'anneal' = annealing constant (0,1] (defaults -> 0.90, or 0.98, extended) +% controls speed of convergence +% 'annealdeg' = [N] degrees weight change for annealing (default -> 70) +% 'stop' = [f] stop training when weight-change < this (default -> 1e-6 +% if less than 33 channel and 1E-7 otherwise) +% 'maxsteps' = [N] max number of ICA training steps (default -> 512) +% 'bias' = ['on'/'off'] perform bias adjustment (default -> 'on') +% 'momentum' = [0 0) +% 'specgram' = [srate loHz hiHz frames winframes] decompose a complex time/frequency +% transform of the data - though not optimally. (Note: winframes must +% divide frames) (defaults [srate 0 srate/2 size(data,2) size(data,2)]) +% 'posact' = make all component activations net-positive(default 'off'} +% Requires time and memory; posact() may be applied separately. +% 'verbose' = give ascii messages ('on'/'off') (default -> 'on') +% 'logfile' = [filename] save all message in a log file in addition to showing them +% on screen (default -> none) +% 'interput' = ['on'|'off'] draw interupt figure. Default is off. +% +% Outputs: [Note: RO means output in reverse order of projected mean variance +% unless starting weight matrix passed ('weights' above)] +% weights = ICA weight matrix (comps,chans) [RO] +% sphere = data sphering matrix (chans,chans) = spher(data) +% Note that unmixing_matrix = weights*sphere {if sphering off -> eye(chans)} +% compvars = back-projected component variances [RO] +% bias = vector of final (ncomps) online bias [RO] (default = zeros()) +% signs = extended-ICA signs for components [RO] (default = ones()) +% [ -1 = sub-Gaussian; 1 = super-Gaussian] +% lrates = vector of learning rates used at each training step [RO] +% activations = activation time courses of the output components (ncomps,frames*epochs) +% +% Authors: Scott Makeig with contributions from Tony Bell, Te-Won Lee, +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky, Delorme Arnaud, +% CNL/The Salk Institute, La Jolla, 1996- + +% Uses: posact() + +% 'ncomps' = [N] number of ICA components to compute (default -> chans or 'pca' arg) +% using rectangular ICA decomposition. This parameter may return +% strange results. This is because the weight matrix is rectangular +% instead of being square. Do not use except to try to fix the problem. + +% Reference (please cite): +% +% Makeig, S., Bell, A.J., Jung, T-P and Sejnowski, T.J., +% "Independent component analysis of electroencephalographic data," +% In: D. Touretzky, M. Mozer and M. Hasselmo (Eds). Advances in Neural +% Information Processing Systems 8:145-151, MIT Press, Cambridge, MA (1996). +% +% Toolbox Citation: +% +% Makeig, Scott et al. "EEGLAB: ICA Toolbox for Psychophysiological Research". +% WWW Site, Swartz Center for Computational Neuroscience, Institute of Neural +% Computation, University of San Diego California +% , 2000. [World Wide Web Publication]. +% +% For more information: +% http://www.sccn.ucsd.edu/eeglab/icafaq.html - FAQ on ICA/EEG +% http://www.sccn.ucsd.edu/eeglab/icabib.html - mss. on ICA & biosignals +% http://www.cnl.salk.edu/~tony/ica.html - math. mss. on ICA + +% Copyright (C) 1996 Scott Makeig et al, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Edit history %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% runica() - by Scott Makeig with contributions from Tony Bell, Te-Won Lee +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky et al. +% CNL / Salk Institute 1996-00 +% 04-30-96 built from icatest.m and ~jung/.../wtwpwica.m -sm +% 07-28-97 new runica(), adds bias (default on), momentum (default off), +% extended-ICA (Lee & Sejnowski, 1997), cumulative angledelta +% (until lrate drops), keywords, signcount for speeding extended-ICA +% 10-07-97 put acos() outside verbose loop; verbose 'off' wasn't stopping -sm +% 11-11-97 adjusted help msg -sm +% 11-30-97 return eye(chans) if sphering 'off' or 'none' (undocumented option) -sm +% 02-27-98 use pinv() instead of inv() to rank order comps if ncomps < chans -sm +% 04-28-98 added 'posact' and 'pca' flags -sm +% 07-16-98 reduced length of randperm() for kurtosis subset calc. -se & sm +% 07-19-98 fixed typo in weights def. above -tl & sm +% 12-21-99 added 'specgram' option suggested by Michael Zibulevsky, UNM -sm +% 12-22-99 fixed rand() sizing inefficiency on suggestion of Mike Spratling, UK -sm +% 01-11-00 fixed rand() sizing bug on suggestion of Jack Foucher, Strasbourg -sm +% 12-18-00 test for existence of Sig Proc Tlbx function 'specgram'; improve +% 'specgram' option arguments -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 lowered default lrate and block -ad +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [weights,sphere,meanvar,bias,signs,lrates,data,y] = runica(data,varargin) % NB: Now optionally returns activations as variable 'data' -sm 7/05 + +if nargin < 1 + help runica + return +end + +[chans frames] = size(data); % determine the data size +urchans = chans; % remember original data channels +datalength = frames; +if chans<2 + fprintf('\nrunica() - data size (%d,%d) too small.\n\n', chans,frames); + return +end +% +%%%%%%%%%%%%%%%%%%%%%% Declare defaults used below %%%%%%%%%%%%%%%%%%%%%%%% +% +MAX_WEIGHT = 1e8; % guess that weights larger than this have blown up +DEFAULT_STOP = 0.000001; % stop training if weight changes below this +DEFAULT_ANNEALDEG = 60; % when angle change reaches this value, +DEFAULT_ANNEALSTEP = 0.90; % anneal by multiplying lrate by this +DEFAULT_EXTANNEAL = 0.98; % or this if extended-ICA +DEFAULT_MAXSTEPS = 512; % ]top training after this many steps +DEFAULT_MOMENTUM = 0.0; % default momentum weight + +DEFAULT_BLOWUP = 1000000000.0; % = learning rate has 'blown up' +DEFAULT_BLOWUP_FAC = 0.8; % when lrate 'blows up,' anneal by this fac +DEFAULT_RESTART_FAC = 0.9; % if weights blowup, restart with lrate + % lower by this factor +MIN_LRATE = 0.000001; % if weight blowups make lrate < this, quit +MAX_LRATE = 0.1; % guard against uselessly high learning rate +DEFAULT_LRATE = 0.00065/log(chans); + % heuristic default - may need adjustment + % for large or tiny data sets! +% DEFAULT_BLOCK = floor(sqrt(frames/4)); % heuristic default +DEFAULT_BLOCK = ceil(min(5*log(frames),0.3*frames)); % heuristic + % - may need adjustment! +% Extended-ICA option: +DEFAULT_EXTENDED = 0; % default off +DEFAULT_EXTBLOCKS = 1; % number of blocks per kurtosis calculation +DEFAULT_NSUB = 1; % initial default number of assumed sub-Gaussians + % for extended-ICA +DEFAULT_EXTMOMENTUM = 0.5; % momentum term for computing extended-ICA kurtosis +MAX_KURTSIZE = 6000; % max points to use in kurtosis calculation +MIN_KURTSIZE = 2000; % minimum good kurtosis size (flag warning) +SIGNCOUNT_THRESHOLD = 25; % raise extblocks when sign vector unchanged + % after this many steps +SIGNCOUNT_STEP = 2; % extblocks increment factor + +DEFAULT_SPHEREFLAG = 'on'; % use the sphere matrix as the default + % starting weight matrix +DEFAULT_INTERUPT = 'off'; % figure interuption +DEFAULT_PCAFLAG = 'off'; % don't use PCA reduction +DEFAULT_POSACTFLAG = 'off'; % don't use posact(), to save space -sm 7/05 +DEFAULT_VERBOSE = 1; % write ascii info to calling screen +DEFAULT_BIASFLAG = 1; % default to using bias in the ICA update rule +% +%%%%%%%%%%%%%%%%%%%%%%% Set up keyword default values %%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargout < 2, + fprintf('runica() - needs at least two output arguments.\n'); + return +end +epochs = 1; % do not care how many epochs in data + +pcaflag = DEFAULT_PCAFLAG; +sphering = DEFAULT_SPHEREFLAG; % default flags +posactflag = DEFAULT_POSACTFLAG; +verbose = DEFAULT_VERBOSE; +logfile = []; + +block = DEFAULT_BLOCK; % heuristic default - may need adjustment! +lrate = DEFAULT_LRATE; +annealdeg = DEFAULT_ANNEALDEG; +annealstep = 0; % defaults declared below +nochange = NaN; +momentum = DEFAULT_MOMENTUM; +maxsteps = DEFAULT_MAXSTEPS; + +weights = 0; % defaults defined below +ncomps = chans; +biasflag = DEFAULT_BIASFLAG; + +interupt = DEFAULT_INTERUPT; +extended = DEFAULT_EXTENDED; +extblocks = DEFAULT_EXTBLOCKS; +kurtsize = MAX_KURTSIZE; +signsbias = 0.02; % bias towards super-Gaussian components +extmomentum= DEFAULT_EXTMOMENTUM; % exp. average the kurtosis estimates +nsub = DEFAULT_NSUB; +wts_blowup = 0; % flag =1 when weights too large +wts_passed = 0; % flag weights passed as argument +% +%%%%%%%%%% Collect keywords and values from argument list %%%%%%%%%%%%%%% +% + if (nargin> 1 & rem(nargin,2) == 0) + fprintf('runica(): Even number of input arguments???') + return + end + for i = 1:2:length(varargin) % for each Keyword + Keyword = varargin{i}; + Value = varargin{i+1}; + if ~isstr(Keyword) + fprintf('runica(): keywords must be strings') + return + end + Keyword = lower(Keyword); % convert upper or mixed case to lower + + if strcmp(Keyword,'weights') | strcmp(Keyword,'weight') + if isstr(Value) + fprintf(... + 'runica(): weights value must be a weight matrix or sphere') + return + else + weights = Value; + wts_passed =1; + end + elseif strcmp(Keyword,'ncomps') + if isstr(Value) + fprintf('runica(): ncomps value must be an integer') + return + end + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + fprintf('*****************************************************************************************'); + fprintf('************** WARNING: NCOMPS OPTION OFTEN DOES NOT RETURN ACCURATE RESULTS ************'); + fprintf('************** WARNING: IF YOU FIND THE PROBLEM, PLEASE LET US KNOW ************'); + fprintf('*****************************************************************************************'); + ncomps = Value; + if ~ncomps, + ncomps = chans; + end + elseif strcmp(Keyword,'pca') + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + if isstr(Value) + fprintf(... +'runica(): pca value should be the number of principal components to retain') + return + end + pcaflag = 'on'; + ncomps = Value; + if ncomps > chans | ncomps < 1, + fprintf('runica(): pca value must be in range [1,%d]\n',chans) + return + end + chans = ncomps; + elseif strcmp(Keyword,'interupt') + if ~isstr(Value) + fprintf('runica(): interupt value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): interupt value must be on or off') + return + end + interupt = Value; + end + elseif strcmp(Keyword,'posact') + if ~isstr(Value) + fprintf('runica(): posact value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): posact value must be on or off') + return + end + posactflag = Value; + end + elseif strcmp(Keyword,'lrate') + if isstr(Value) + fprintf('runica(): lrate value must be a number') + return + end + lrate = Value; + if lrate>MAX_LRATE | lrate <0, + fprintf('runica(): lrate value is out of bounds'); + return + end + if ~lrate, + lrate = DEFAULT_LRATE; + end + elseif strcmp(Keyword,'block') | strcmp(Keyword,'blocksize') + if isstr(Value) + fprintf('runica(): block size value must be a number') + return + end + block = floor(Value); + if ~block, + block = DEFAULT_BLOCK; + end + elseif strcmp(Keyword,'stop') | strcmp(Keyword,'nochange') ... + | strcmp(Keyword,'stopping') + if isstr(Value) + fprintf('runica(): stop wchange value must be a number') + return + end + nochange = Value; + elseif strcmp(Keyword,'logfile') + if ~isstr(Value) + fprintf('runica(): logfile value must be a string') + return + end + logfile = Value; + elseif strcmp(Keyword,'maxsteps') | strcmp(Keyword,'steps') + if isstr(Value) + fprintf('runica(): maxsteps value must be an integer') + return + end + maxsteps = Value; + if ~maxsteps, + maxsteps = DEFAULT_MAXSTEPS; + end + if maxsteps < 0 + fprintf('runica(): maxsteps value (%d) must be a positive integer',maxsteps) + return + end + elseif strcmp(Keyword,'anneal') | strcmp(Keyword,'annealstep') + if isstr(Value) + fprintf('runica(): anneal step value (%2.4f) must be a number (0,1)',Value) + return + end + annealstep = Value; + if annealstep <=0 | annealstep > 1, + fprintf('runica(): anneal step value (%2.4f) must be (0,1]',annealstep) + return + end + elseif strcmp(Keyword,'annealdeg') | strcmp(Keyword,'degrees') + if isstr(Value) + fprintf('runica(): annealdeg value must be a number') + return + end + annealdeg = Value; + if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG; + elseif annealdeg > 180 | annealdeg < 0 + fprintf('runica(): annealdeg (%3.1f) is out of bounds [0,180]',... + annealdeg); + return + + end + elseif strcmp(Keyword,'momentum') + if isstr(Value) + fprintf('runica(): momentum value must be a number') + return + end + momentum = Value; + if momentum > 1.0 | momentum < 0 + fprintf('runica(): momentum value is out of bounds [0,1]') + return + end + elseif strcmp(Keyword,'sphering') | strcmp(Keyword,'sphereing') ... + | strcmp(Keyword,'sphere') + if ~isstr(Value) + fprintf('runica(): sphering value must be on, off, or none') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off') & ~strcmp(Value,'none'), + fprintf('runica(): sphering value must be on or off') + return + end + sphering = Value; + end + elseif strcmp(Keyword,'bias') + if ~isstr(Value) + fprintf('runica(): bias value must be on or off') + return + else + Value = lower(Value); + if strcmp(Value,'on') + biasflag = 1; + elseif strcmp(Value,'off'), + biasflag = 0; + else + fprintf('runica(): bias value must be on or off') + return + end + end + elseif strcmp(Keyword,'specgram') | strcmp(Keyword,'spec') + + if ~exist('specgram') < 2 % if ~exist or defined workspace variable + fprintf(... + 'runica(): MATLAB Sig. Proc. Toolbox function "specgram" not found.\n') + return + end + if isstr(Value) + fprintf('runica(): specgram argument must be a vector') + return + end + srate = Value(1); + if (srate < 0) + fprintf('runica(): specgram srate (%4.1f) must be >=0',srate) + return + end + if length(Value)>1 + loHz = Value(2); + if (loHz < 0 | loHz > srate/2) + fprintf('runica(): specgram loHz must be >=0 and <= srate/2 (%4.1f)',srate/2) + return + end + else + loHz = 0; % default + end + if length(Value)>2 + hiHz = Value(3); + if (hiHz < loHz | hiHz > srate/2) + fprintf('runica(): specgram hiHz must be >=loHz (%4.1f) and <= srate/2 (%4.1f)',loHz,srate/2) + return + end + else + hiHz = srate/2; % default + end + if length(Value)>3 + Hzframes = Value(5); + if (Hzframes<0 | Hzframes > size(data,2)) + fprintf('runica(): specgram frames must be >=0 and <= data length (%d)',size(data,2)) + return + end + else + Hzframes = size(data,2); % default + end + if length(Value)>4 + Hzwinlen = Value(4); + if rem(Hzframes,Hzwinlen) % if winlen doesn't divide frames + fprintf('runica(): specgram Hzinc must divide frames (%d)',Hzframes) + return + end + else + Hzwinlen = Hzframes; % default + end + Specgramflag = 1; % set flag to perform specgram() + + elseif strcmp(Keyword,'extended') | strcmp(Keyword,'extend') + if isstr(Value) + fprintf('runica(): extended value must be an integer (+/-)') + return + else + extended = 1; % turn on extended-ICA + extblocks = fix(Value); % number of blocks per kurt() compute + if extblocks < 0 + nsub = -1*fix(extblocks); % fix this many sub-Gauss comps + elseif ~extblocks, + extended = 0; % turn extended-ICA off + elseif kurtsize>frames, % length of kurtosis calculation + kurtsize = frames; + if kurtsize < MIN_KURTSIZE + fprintf(... + 'runica() warning: kurtosis values inexact for << %d points.\n',... + MIN_KURTSIZE); + end + end + end + elseif strcmp(Keyword,'verbose') + if ~isstr(Value) + fprintf('runica(): verbose flag value must be on or off') + return + elseif strcmp(Value,'on'), + verbose = 1; + elseif strcmp(Value,'off'), + verbose = 0; + else + fprintf('runica(): verbose flag value must be on or off') + return + end + else + fprintf('runica(): unknown flag') + return + end + end + +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize weights, etc. %%%%%%%%%%%%%%%%%%%%%%%% +% +if ~annealstep, + if ~extended, + annealstep = DEFAULT_ANNEALSTEP; % defaults defined above + else + annealstep = DEFAULT_EXTANNEAL; % defaults defined above + end +end % else use annealstep from commandline + +if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG - momentum*90; % heuristic + if annealdeg < 0, + annealdeg = 0; + end +end +if ncomps > chans | ncomps < 1 + fprintf('runica(): number of components must be 1 to %d.\n',chans); + return +end +% +%%%%%%%%%%%%%%%%%%%%% Check keyword values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if frames frames, + fprintf('runica(): block size exceeds data length!\n'); + return +elseif floor(epochs) ~= epochs, + fprintf('runica(): data length is not a multiple of the epoch length!\n'); + return +elseif nsub > ncomps + fprintf('runica(): there can be at most %d sub-Gaussian components!\n',ncomps); + return +end; + +if ~isempty(logfile) + fid = fopen(logfile, 'w'); + if fid == -1, error('Cannot open logfile for writing'); end; +else + fid = []; +end; +verb = verbose; + +if weights ~= 0, % initialize weights + % starting weights are being passed to runica() from the commandline + if chans>ncomps & weights ~=0, + [r,c]=size(weights); + if r~=ncomps | c~=chans, + fprintf('runica(): weight matrix must have %d rows, %d columns.\n', ... + chans,ncomps); + return; + end + end + icaprintf(verb,fid,'Using starting weight matrix named in argument list ...\n'); +end; + +% +% adjust nochange if necessary +% +if isnan(nochange) + if ncomps > 32 + nochange = 1E-7; + nochangeupdated = 1; % for fprinting purposes + else + nochangeupdated = 1; % for fprinting purposes + nochange = DEFAULT_STOP; + end; +else + nochangeupdated = 0; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Process the data %%%%%%%%%%%%%%%%%%%%%%%%%% +% +icaprintf(verb,fid,'\nInput data size [%d,%d] = %d channels, %d frames/n', ... + chans,frames,chans,frames); + +if strcmp(pcaflag,'on') + icaprintf(verb,fid,'After PCA dimension reduction,\n finding '); +else + icaprintf(verb,fid,'Finding '); +end +if ~extended + icaprintf(verb,fid,'%d ICA components using logistic ICA.\n',ncomps); +else % if extended +icaprintf(verb,fid,'%d ICA components using extended ICA.\n',ncomps); +if extblocks > 0 + icaprintf(verb,fid,'Kurtosis will be calculated initially every %d blocks using %d data points.\n',... + extblocks, kurtsize); +else + icaprintf(verb,fid,'Kurtosis will not be calculated. Exactly %d sub-Gaussian components assumed.\n',nsub); +end +end +icaprintf(verb,fid,'Decomposing %d frames per ICA weight ((%d)^2 = %d weights, %d frames)\n',... + floor(frames/ncomps.^2),ncomps.^2,frames); +icaprintf(verb,fid,'Initial learning rate will be %g, block size %d.\n',... + lrate,block); +if momentum>0, + icaprintf(verb,fid,'Momentum will be %g.\n',momentum); +end +icaprintf(verb,fid,'Learning rate will be multiplied by %g whenever angledelta >= %g deg.\n', ... + annealstep,annealdeg); + +if nochangeupdated + icaprintf(verb,fid,'More than 32 channels: default stopping weight change 1E-7\n'); +end; +icaprintf(verb,fid,'Training will end when wchange < %g or after %d steps.\n', nochange,maxsteps); +if biasflag, + icaprintf(verb,fid,'Online bias adjustment will be used.\n'); +else + icaprintf(verb,fid,'Online bias adjustment will not be used.\n'); +end + +% +%%%%%%%%%%%%%%%%% Remove overall row means of data %%%%%%%%%%%%%%%%%%%%%%% +% +icaprintf(verb,fid,'Removing mean of each channel ...\n'); + +%BLGBLGBLG replaced +% rowmeans = mean(data'); +% data = data - rowmeans'*ones(1,frames); % subtract row means +%BLGBLGBLG replacement starts +rowmeans = mean(data,2)'; %BLG +% data = data - rowmeans'*ones(1,frames); % subtract row means +for iii=1:size(data,1) %avoids memory errors BLG + data(iii,:)=data(iii,:)-rowmeans(iii); +end +%BLGBLGBLG replacement ends + +icaprintf(verb,fid,'Final training data range: %g to %g\n', min(min(data)),max(max(data))); + +% +%%%%%%%%%%%%%%%%%%% Perform PCA reduction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + icaprintf(verb,fid,'Reducing the data to %d principal dimensions...\n',ncomps); + + %BLGBLGBLG replaced + %[eigenvectors,eigenvalues,data] = pcsquash(data,ncomps); + % make data its projection onto the ncomps-dim principal subspace + %BLGBLGBLG replacement starts + %[eigenvectors,eigenvalues,data] = pcsquash(data,ncomps); + % no need to re-subtract row-means, it was done a few lines above! + PCdat2 = data'; % transpose data + [PCn,PCp]=size(PCdat2); % now p chans,n time points + PCdat2=PCdat2/PCn; + PCout=data*PCdat2; + clear PCdat2; + + [PCV,PCD] = eig(PCout); % get eigenvectors/eigenvalues + [PCeigenval,PCindex] = sort(diag(PCD)); + PCindex=rot90(rot90(PCindex)); + PCEigenValues=rot90(rot90(PCeigenval))'; + PCEigenVectors=PCV(:,PCindex); + %PCCompressed = PCEigenVectors(:,1:ncomps)'*data; + data = PCEigenVectors(:,1:ncomps)'*data; + + eigenvectors=PCEigenVectors; + eigenvalues=PCEigenValues; %#ok + + clear PCn PCp PCout PCV PCD PCeigenval PCindex PCEigenValues PCEigenVectors + %BLGBLGBLG replacement ends + +end + +% +%%%%%%%%%%%%%%%%%%% Perform specgram transformation %%%%%%%%%%%%%%%%%%%%%%% +% +if exist('Specgramflag') == 1 + % [P F T] = SPECGRAM(A,NFFT,Fs,WINDOW,NOVERLAP) % MATLAB Sig Proc Toolbox + % Hzwinlen = fix(srate/Hzinc); % CHANGED FROM THIS 12/18/00 -sm + + Hzfftlen = 2^(ceil(log(Hzwinlen)/log(2))); % make FFT length next higher 2^k + Hzoverlap = 0; % use sequential windows + % + % Get freqs and times from 1st channel analysis + % + [tmp,freqs,tms] = specgram(data(1,:),Hzfftlen,srate,Hzwinlen,Hzoverlap); + + fs = find(freqs>=loHz & freqs <= hiHz); + icaprintf(verb,fid,'runica(): specified frequency range too narrow, exiting!\n'); + + specdata = reshape(tmp(fs,:),1,length(fs)*size(tmp,2)); + specdata = [real(specdata) imag(specdata)]; + % fprintf(' size(fs) = %d,%d\n',size(fs,1),size(fs,2)); + % fprintf(' size(tmp) = %d,%d\n',size(tmp,1),size(tmp,2)); + % + % Loop through remaining channels + % + for ch=2:chans + [tmp] = specgram(data(ch,:),Hzwinlen,srate,Hzwinlen,Hzoverlap); + tmp = reshape((tmp(fs,:)),1,length(fs)*size(tmp,2)); + specdata = [specdata;[real(tmp) imag(tmp)]]; % channels are rows + end + % + % Print specgram confirmation and details + % + icaprintf(verb,fid,'Converted data to %d channels by %d=2*%dx%d points spectrogram data.\n',... + chans,2*length(fs)*length(tms),length(fs),length(tms)); + if length(fs) > 1 + icaprintf(verb,fid,' Low Hz %g, high Hz %g, Hz incr %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),freqs(fs(2))-freqs(fs(1)),Hzwinlen); + else + icaprintf(verb,fid,' Low Hz %g, high Hz %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),Hzwinlen); + end + % + % Replace data with specdata + % + data = specdata; + datalength=size(data,2); +end +% +%%%%%%%%%%%%%%%%%%% Perform sphering %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmp(sphering,'on'), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + icaprintf(verb,fid,'Computing the sphering matrix...\n'); + sphere = 2.0*inv(sqrtm(double(cov(data')))); % find the "sphering" matrix = spher() + if ~weights, + icaprintf(verb,fid,'Starting weights are the identity matrix ...\n'); + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights given on commandline + icaprintf(verb,fid,'Using starting weights named on commandline ...\n'); + end + icaprintf(verb,fid,'Sphering the data ...\n'); + data = sphere*data; % decorrelate the electrode signals by 'sphereing' them + +elseif strcmp(sphering,'off') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~weights % is starting weights not given + icaprintf(verb,fid,'Using the sphering matrix as the starting weight matrix ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + weights = eye(ncomps,chans)*sphere; % begin with the identity matrix + sphere = eye(chans); % return the identity matrix + else % weights ~= 0 + icaprintf(verb,fid,'Using starting weights from commandline ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + sphere = eye(chans); % return the identity matrix + end +elseif strcmp(sphering,'none') + sphere = eye(chans,chans);% return the identity matrix + if ~weights + icaprintf(verb,fid,'Starting weights are the identity matrix ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights ~= 0 + icaprintf(verb,fid,'Using starting weights named on commandline ...\n'); + icaprintf(verb,fid,'Returning the identity matrix in variable "sphere" ...\n'); + end + icaprintf(verb,fid,'Returned variable "sphere" will be the identity matrix.\n'); +end +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize ICA training %%%%%%%%%%%%%%%%%%%%%%%%% +% +lastt=fix((datalength/block-1)*block+1); +BI=block*eye(ncomps,ncomps); +delta=zeros(1,chans*ncomps); +changes = []; +degconst = 180./pi; +startweights = weights; +prevweights = startweights; +oldweights = startweights; +prevwtchange = zeros(chans,ncomps); +oldwtchange = zeros(chans,ncomps); +lrates = zeros(1,maxsteps); +onesrow = ones(1,block); +bias = zeros(ncomps,1); +signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 +for k=1:nsub + signs(k) = -1; +end +if extended & extblocks < 0, + icaprintf(verb,fid,'Fixed extended-ICA sign assignments: '); + for k=1:ncomps + icaprintf(verb,fid,'%d ',signs(k)); + end; icaprintf(verb,fid,'\n'); +end +signs = diag(signs); % make a diagonal matrix +oldsigns = zeros(size(signs)); +signcount = 0; % counter for same-signs +signcounts = []; +urextblocks = extblocks; % original value, for resets +old_kk = zeros(1,ncomps); % for kurtosis momemtum + +% +%%%%%%%% ICA training loop using the logistic sigmoid %%%%%%%%%%%%%%%%%%% +% +icaprintf(verb,fid,'Beginning ICA training ...'); +if extended, + icaprintf(verb,fid,' first training step may be slow ...\n'); +else + icaprintf(verb,fid,'\n'); +end +step=0; +laststep=0; +blockno = 1; % running block counter for kurtosis interrupts + +rand('state',sum(100*clock)); % set the random number generator state to + % a position dependent on the system clock +% interupt figure +% --------------- +if strcmpi(interupt, 'on') + fig = figure('visible', 'off'); + supergui( fig, {1 1}, [], {'style' 'text' 'string' 'Press button to interrupt runica()' }, ... + {'style' 'pushbutton' 'string' 'Interupt' 'callback' 'setappdata(gcf, ''run'', 0);' } ); + set(fig, 'visible', 'on'); + setappdata(gcf, 'run', 1); + + if strcmpi(interupt, 'on') + drawnow; + end; +end; + + +%% Compute ICA Weights +if biasflag & extended + while step < maxsteps, %%% ICA step = pass through all the data %%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + if strcmpi(interupt, 'on') + drawnow; + flag = getappdata(fig, 'run'); + if ~flag, + if ~isempty(fid), fclose(fid); end; + close; error('USER ABORT'); + end; + end; + + %% promote data block (only) to double to keep u and weights double + u=weights*double(data(:,timeperm(t:t+block-1))) + bias*onesrow; + + y=tanh(u); + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; + bias = bias + lrate*sum((-2*y)')'; % for tanh() nonlin. + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + %while step < maxsteps + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=weights*double(data(:,rp(1:kurtsize))); + else % for small data sets, + partact=weights*double(data); % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if extended & ~wts_blowup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs));; + + if lrate> MIN_LRATE + r = rank(data); % determine if data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +end +%% Compute ICA Weights +if biasflag & ~extended + while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + if strcmpi(interupt, 'on') + drawnow; + flag = getappdata(fig, 'run'); + if ~flag, + if ~isempty(fid), fclose(fid); end; + close; error('USER ABORT'); + end; + end; + + u=weights*double(data(:,timeperm(t:t+block-1))) + bias*onesrow; + y=1./(1+exp(-u)); + weights = weights + lrate*(BI+(1-2*y)*u')*weights; + bias = bias + lrate*sum((1-2*y)')'; % for logistic nonlin. % + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + if lrate> MIN_LRATE + r = rank(data); % determine if data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +end +%% Compute ICA Weights +if ~biasflag & extended + while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step through data + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + if strcmpi(interupt, 'on') + drawnow; + flag = getappdata(fig, 'run'); + if ~flag, + if ~isempty(fid), fclose(fid); end; + close; error('USER ABORT'); + end; + end; + + u=weights*double(data(:,timeperm(t:t+block-1))); % promote block to dbl + y=tanh(u); % + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + %while step < maxsteps + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=weights*double(data(:,rp(1:kurtsize))); + else % for small data sets, + partact=weights*double(data); % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if ~wts_blowup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs)); + if lrate> MIN_LRATE + r = rank(data); % find whether data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Compute ICA Weights +if ~biasflag & ~extended + while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + timeperm=randperm(datalength); % shuffle data order at each step + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + if strcmpi(interupt, 'on') + drawnow; + flag = getappdata(fig, 'run'); + if ~flag, + if ~isempty(fid), fclose(fid); end; + close; error('USER ABORT'); + end; + end; + u=weights*double(data(:,timeperm(t:t+block-1))); + y=1./(1+exp(-u)); % + weights = weights + lrate*(BI+(1-2*y)*u')*weights; + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + + blockno = blockno + 1; + if wts_blowup + break + end + end % for t=1:block:lastt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + icaprintf(verb,fid,''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + + if lrate> MIN_LRATE + r = rank(data); % find whether data rank is too low + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + places = -floor(log10(nochange)); + icaprintf(verb,fid,'step %d - lrate %5f, wchange %8.8f, angledelta %4.1f deg\n', ... + step, lrate, change, degconst*angledelta); + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + + end; % end while step < maxsteps (ICA Training) %%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +end +%% Finalize Computed Data for Output + +if strcmpi(interupt, 'on') + close(fig); +end; + + + if ~laststep + laststep = step; + end; + lrates = lrates(1,1:laststep); % truncate lrate history vector + + % + %%%%%%%%%%%%%% Orient components towards max positive activation %%%%%% + % + if nargout > 6 | strcmp(posactflag,'on') + % make activations from sphered and pca'd data; -sm 7/05 + % add back the row means removed from data before sphering + if strcmp(pcaflag,'off') + sr = sphere * rowmeans'; + for r = 1:ncomps + data(r,:) = data(r,:)+sr(r); % add back row means + end + data = weights*data; % OK in single + else + ser = sphere*eigenvectors(:,1:ncomps)'*rowmeans'; + for r = 1:ncomps + data(r,:) = data(r,:)+ser(r); % add back row means + end + data = weights*data; % OK in single + end; + end + % + % NOTE: Now 'data' are the component activations = weights*sphere*raw_data + % + % + %%%%%%%%%%%%%% If pcaflag, compose PCA and ICA matrices %%%%%%%%%%%%%%% + % + if strcmp(pcaflag,'on') + icaprintf(verb,fid,'Composing the eigenvector, weights, and sphere matrices\n'); + icaprintf(verb,fid,' into a single rectangular weights matrix; sphere=eye(%d)\n'... + ,chans); + weights= weights*sphere*eigenvectors(:,1:ncomps)'; + sphere = eye(urchans); + end + % + %%%%%% Sort components in descending order of max projected variance %%%% + % + icaprintf(verb,fid,'Sorting components in descending order of mean projected variance ...\n'); + % + %%%%%%%%%%%%%%%%%%%% Find mean variances %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % meanvar = zeros(ncomps,1); % size of the projections + if ncomps == urchans % if weights are square . . . + winv = inv(weights*sphere); + else + icaprintf(verb,fid,'Using pseudo-inverse of weight matrix to rank order component projections.\n'); + winv = pinv(weights*sphere); + end + % + % compute variances without backprojecting to save time and memory -sm 7/05 + % + meanvar = sum(winv.^2).*sum((data').^2)/((chans*frames)-1); % from Rey Ramirez 8/07 + % + %%%%%%%%%%%%%% Sort components by mean variance %%%%%%%%%%%%%%%%%%%%%%%% + % + [sortvar, windex] = sort(meanvar); + windex = windex(ncomps:-1:1); % order large to small + meanvar = meanvar(windex); + % + %%%%%%%%%%%% re-orient max(abs(activations)) to >=0 ('posact') %%%%%%%% + % + if strcmp(posactflag,'on') % default is now off to save processing and memory + icaprintf(verb,fid,'Making the max(abs(activations)) positive ...\n'); + [tmp ix] = max(abs(data')); % = max abs activations + signsflipped = 0; + for r=1:ncomps + if sign(data(r,ix(r))) < 0 + if nargout>6 % if activations are to be returned (only) + data(r,:) = -1*data(r,:); % flip activations so max(abs()) is >= 0 + end + winv(:,r) = -1*winv(:,r); % flip component maps + signsflipped = 1; + end + end + if signsflipped == 1 + weights = pinv(winv)*inv(sphere); % re-invert the component maps + end + + % [data,winvout,weights] = posact(data,weights); % overwrite data with activations + % changes signs of activations (now = data) and weights + % to make activations (data) net rms-positive + % can call this outside of runica() - though it is inefficient! + end + % + %%%%%%%%%%%%%%%%%%%%% Filter data using final weights %%%%%%%%%%%%%%%%%% + % + if nargout>6, % if activations are to be returned + icaprintf(verb,fid,'Permuting the activation wave forms ...\n'); + data = data(windex,:); % data is now activations -sm 7/05 + else + clear data + end + weights = weights(windex,:);% reorder the weight matrix + bias = bias(windex); % reorder them + signs = diag(signs); % vectorize the signs matrix + signs = signs(windex); % reorder them + + if ~isempty(fid), fclose(fid); end; % close logfile + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +return + +% printing functions +% ------------------ +function icaprintf(verb,fid, varargin); + if verb + if ~isempty(fid) + fprintf(fid, varargin{:}); + end; + fprintf(varargin{:}); + end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/runica_ml.m b/code/eeglab13_4_4b/functions/sigprocfunc/runica_ml.m new file mode 100644 index 0000000..88167e6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/runica_ml.m @@ -0,0 +1,1101 @@ +% runica() - Perform Independent Component Analysis (ICA) decomposition +% of input data using the logistic infomax ICA algorithm of +% Bell & Sejnowski (1995) with the natural gradient feature +% of Amari, Cichocki & Yang, or optionally the extended-ICA +% algorithm of Lee, Girolami & Sejnowski, with optional PCA +% dimension reduction. Annealing based on weight changes is +% used to automate the separation process. +% Usage: +% >> [weights,sphere] = runica(data); % train using defaults +% else +% >> [weights,sphere,compvars,bias,signs,lrates,activations] ... +% = runica(data,'Key1',Value1',...); +% Input: +% data = input data (chans,frames*epochs). +% Note that if data consists of multiple discontinuous epochs, +% each epoch should be separately baseline-zero'd using +% >> data = rmbase(data,frames,basevector); +% +% Optional keywords [argument]: +% 'extended' = [N] perform tanh() "extended-ICA" with sign estimation +% N training blocks. If N > 0, automatically estimate the +% number of sub-Gaussian sources. If N < 0, fix number of +% sub-Gaussian comps to -N [faster than N>0] (default|0 -> off) +% 'pca' = [N] decompose a principal component (default -> 0=off) +% subspace of the data. Value is the number of PCs to retain. +% 'ncomps' = [N] number of ICA components to compute (default -> chans or 'pca' arg) +% using rectangular ICA decomposition +% 'sphering' = ['on'/'off'] flag sphering of data (default -> 'on') +% 'weights' = [W] initial weight matrix (default -> eye()) +% (Note: if 'sphering' 'off', default -> spher()) +% 'lrate' = [rate] initial ICA learning rate (<< 1) (default -> heuristic) +% 'block' = [N] ICA block size (<< datalength) (default -> heuristic) +% 'anneal' = annealing constant (0,1] (defaults -> 0.90, or 0.98, extended) +% controls speed of convergence +% 'annealdeg' = [N] degrees weight change for annealing (default -> 70) +% 'stop' = [f] stop training when weight-change < this (default -> 1e-6 +% if less than 33 channel and 1E-7 otherwise) +% 'maxsteps' = [N] max number of ICA training steps (default -> 512) +% 'bias' = ['on'/'off'] perform bias adjustment (default -> 'on') +% 'momentum' = [0 0) +% 'specgram' = [srate loHz hiHz frames winframes] decompose a complex time/frequency +% transform of the data (Note: winframes must divide frames) +% (defaults [srate 0 srate/2 size(data,2) size(data,2)]) +% 'posact' = make all component activations net-positive(default 'on'} +% 'verbose' = give ascii messages ('on'/'off') (default -> 'on') +% +% Outputs: [Note: RO means output in reverse order of projected mean variance +% unless starting weight matrix passed ('weights' above)] +% weights = ICA weight matrix (comps,chans) [RO] +% sphere = data sphering matrix (chans,chans) = spher(data) +% Note that unmixing_matrix = weights*sphere {if sphering off -> eye(chans)} +% compvars = back-projected component variances [RO] +% bias = vector of final (ncomps) online bias [RO] (default = zeros()) +% signs = extended-ICA signs for components [RO] (default = ones()) +% [ -1 = sub-Gaussian; 1 = super-Gaussian] +% lrates = vector of learning rates used at each training step [RO] +% activations = activation time courses of the output components (ncomps,frames*epochs) +% +% Authors: Scott Makeig with contributions from Tony Bell, Te-Won Lee, +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky, Delorme Arnaud, +% CNL/The Salk Institute, La Jolla, 1996- + +% Uses: posact() + +% Reference (please cite): +% +% Makeig, S., Bell, A.J., Jung, T-P and Sejnowski, T.J., +% "Independent component analysis of electroencephalographic data," +% In: D. Touretzky, M. Mozer and M. Hasselmo (Eds). Advances in Neural +% Information Processing Systems 8:145-151, MIT Press, Cambridge, MA (1996). +% +% Toolbox Citation: +% +% Makeig, Scott et al. "EEGLAB: ICA Toolbox for Psychophysiological Research". +% WWW Site, Swartz Center for Computational Neuroscience, Institute of Neural +% Computation, University of San Diego California +% , 2000. [World Wide Web Publication]. +% +% For more information: +% http://www.sccn.ucsd.edu/eeglab/icafaq.html - FAQ on ICA/EEG +% http://www.sccn.ucsd.edu/eeglab/icabib.html - mss. on ICA & biosignals +% http://www.cnl.salk.edu/~tony/ica.html - math. mss. on ICA + +% Copyright (C) 1996 Scott Makeig et al, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Edit history %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% runica() - by Scott Makeig with contributions from Tony Bell, Te-Won Lee +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky et al. +% CNL / Salk Institute 1996-00 +% 04-30-96 built from icatest.m and ~jung/.../wtwpwica.m -sm +% 07-28-97 new runica(), adds bias (default on), momentum (default off), +% extended-ICA (Lee & Sejnowski, 1997), cumulative angledelta +% (until lrate drops), keywords, signcount for speeding extended-ICA +% 10-07-97 put acos() outside verbose loop; verbose 'off' wasn't stopping -sm +% 11-11-97 adjusted help msg -sm +% 11-30-97 return eye(chans) if sphering 'off' or 'none' (undocumented option) -sm +% 02-27-98 use pinv() instead of inv() to rank order comps if ncomps < chans -sm +% 04-28-98 added 'posact' and 'pca' flags -sm +% 07-16-98 reduced length of randperm() for kurtosis subset calc. -se & sm +% 07-19-98 fixed typo in weights def. above -tl & sm +% 12-21-99 added 'specgram' option suggested by Michael Zibulevsky, UNM -sm +% 12-22-99 fixed rand() sizing inefficiency on suggestion of Mike Spratling, UK -sm +% 01-11-00 fixed rand() sizing bug on suggestion of Jack Foucher, Strasbourg -sm +% 12-18-00 test for existence of Sig Proc Tlbx function 'specgram'; improve +% 'specgram' option arguments -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 lowered default lrate and block -ad +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [weights,sphere,meanvar,bias,signs,lrates,activations,y,loglik,wsave] = runica(data,p1,v1,p2,v2,p3,v3,p4,v4,p5,v5,p6,v6,p7,v7,p8,v8,p9,v9,p10,v10,p11,v11,p12,v12,p13,v13,p14,v14) + +if nargin < 1 + help runica + return +end + +[chans frames] = size(data); % determine the data size +urchans = chans; % remember original data channels +datalength = frames; +if chans<2 + fprintf('\nrunica() - data size (%d,%d) too small.\n\n', chans,frames); + return +end +% +%%%%%%%%%%%%%%%%%%%%%% Declare defaults used below %%%%%%%%%%%%%%%%%%%%%%%% +% +MAX_WEIGHT = 1e8; % guess that weights larger than this have blown up +DEFAULT_STOP = 1e-6; % stop training if weight changes below this +DEFAULT_ANNEALDEG = 60; % when angle change reaches this value, +DEFAULT_ANNEALSTEP = 0.95; % anneal by multiplying lrate by this +DEFAULT_EXTANNEAL = 0.95; % or this if extended-ICA +DEFAULT_MAXSTEPS = 500; % stop training after this many steps +DEFAULT_MOMENTUM = 0.0; % default momentum weight + +DEFAULT_BLOWUP = 1000000000.0; % = learning rate has 'blown up' +DEFAULT_BLOWUP_FAC = 0.8; % when lrate 'blows up,' anneal by this fac +DEFAULT_RESTART_FAC = 0.9; % if weights blowup, restart with lrate +% lower by this factor +MIN_LRATE = 0.0001; % if weight blowups make lrate < this, quit +MAX_LRATE = 0.1; % guard against uselessly high learning rate +DEFAULT_LRATE = 0.00065/log(chans); +% heuristic default - may need adjustment +% for large or tiny data sets! +% DEFAULT_BLOCK = floor(sqrt(frames/4)); % heuristic default +DEFAULT_BLOCK = ceil(min(5*log(frames),0.3*frames)); % heuristic +%DEFAULT_BLOCK = 10000; % heuristic +% - may need adjustment! +% Extended-ICA option: +DEFAULT_EXTENDED = 1; % default off +DEFAULT_EXTBLOCKS = 1; % number of blocks per kurtosis calculation +DEFAULT_NSUB = 0; % initial default number of assumed sub-Gaussians +% for extended-ICA +DEFAULT_EXTMOMENTUM = 0.5; % momentum term for computing extended-ICA kurtosis +MAX_KURTSIZE = 6000; % max points to use in kurtosis calculation +MIN_KURTSIZE = 2000; % minimum good kurtosis size (flag warning) +SIGNCOUNT_THRESHOLD = 25; % raise extblocks when sign vector unchanged +% after this many steps +SIGNCOUNT_STEP = 2; % extblocks increment factor + +DEFAULT_SPHEREFLAG = 'on'; % use the sphere matrix as the default +% starting weight matrix +DEFAULT_PCAFLAG = 'off'; % don't use PCA reduction +DEFAULT_POSACTFLAG = 'on'; % use posact() +DEFAULT_VERBOSE = 1; % write ascii info to calling screen +DEFAULT_BIASFLAG = 0; % default to using bias in the ICA update rule +% +%%%%%%%%%%%%%%%%%%%%%%% Set up keyword default values %%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargout < 2, + fprintf('runica() - needs at least two output arguments.\n'); + return +end +epochs = 1; % do not care how many epochs in data + +pcaflag = DEFAULT_PCAFLAG; +sphering = DEFAULT_SPHEREFLAG; % default flags +posactflag = DEFAULT_POSACTFLAG; +verbose = DEFAULT_VERBOSE; + +block = DEFAULT_BLOCK; % heuristic default - may need adjustment! +lrate = DEFAULT_LRATE; +annealdeg = DEFAULT_ANNEALDEG; +annealstep = 0; % defaults declared below +nochange = NaN; +momentum = DEFAULT_MOMENTUM; +maxsteps = DEFAULT_MAXSTEPS; + +weights = 0; % defaults defined below +ncomps = chans; +biasflag = DEFAULT_BIASFLAG; + +extended = DEFAULT_EXTENDED; +extblocks = DEFAULT_EXTBLOCKS; +kurtsize = MAX_KURTSIZE; +signsbias = 0.02; % bias towards super-Gaussian components +extmomentum= DEFAULT_EXTMOMENTUM; % exp. average the kurtosis estimates +nsub = DEFAULT_NSUB; +wts_blowup = 0; % flag =1 when weights too large +wts_passed = 0; % flag weights passed as argument +% +%%%%%%%%%% Collect keywords and values from argument list %%%%%%%%%%%%%%% +% +if (nargin> 1 & rem(nargin,2) == 0) + fprintf('runica(): Even number of input arguments???') + return +end +for i = 3:2:nargin % for each Keyword + Keyword = eval(['p',int2str((i-3)/2 +1)]); + Value = eval(['v',int2str((i-3)/2 +1)]); + if ~isstr(Keyword) + fprintf('runica(): keywords must be strings') + return + end + Keyword = lower(Keyword); % convert upper or mixed case to lower + + if strcmp(Keyword,'weights') | strcmp(Keyword,'weight') + if isstr(Value) + fprintf(... + 'runica(): weights value must be a weight matrix or sphere') + return + else + weights = Value; + wts_passed =1; + end + elseif strcmp(Keyword,'ncomps') + if isstr(Value) + fprintf('runica(): ncomps value must be an integer') + return + end + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + ncomps = Value; + if ~ncomps, + ncomps = chans; + end + elseif strcmp(Keyword,'pca') + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + if isstr(Value) + fprintf(... + 'runica(): pca value should be the number of principal components to retain') + return + end + pcaflag = 'on'; + ncomps = Value; + if ncomps > chans | ncomps < 1, + fprintf('runica(): pca value must be in range [1,%d]\n',chans) + return + end + chans = ncomps; + elseif strcmp(Keyword,'posact') + if ~isstr(Value) + fprintf('runica(): posact value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): posact value must be on or off') + return + end + posactflag = Value; + end + elseif strcmp(Keyword,'lrate') + if isstr(Value) + fprintf('runica(): lrate value must be a number') + return + end + lrate = Value; + if lrate>MAX_LRATE | lrate <0, + fprintf('runica(): lrate value is out of bounds'); + return + end + if ~lrate, + lrate = DEFAULT_LRATE; + end + elseif strcmp(Keyword,'block') | strcmp(Keyword,'blocksize') + if isstr(Value) + fprintf('runica(): block size value must be a number') + return + end + block = floor(Value); + if ~block, + block = DEFAULT_BLOCK; + end + elseif strcmp(Keyword,'stop') | strcmp(Keyword,'nochange') ... + | strcmp(Keyword,'stopping') + if isstr(Value) + fprintf('runica(): stop wchange value must be a number') + return + end + nochange = Value; + elseif strcmp(Keyword,'maxsteps') | strcmp(Keyword,'steps') + if isstr(Value) + fprintf('runica(): maxsteps value must be an integer') + return + end + maxsteps = Value; + if ~maxsteps, + maxsteps = DEFAULT_MAXSTEPS; + end + if maxsteps < 0 + fprintf('runica(): maxsteps value (%d) must be a positive integer',maxsteps) + return + end + elseif strcmp(Keyword,'anneal') | strcmp(Keyword,'annealstep') + if isstr(Value) + fprintf('runica(): anneal step value (%2.4f) must be a number (0,1)',Value) + return + end + annealstep = Value; + if annealstep <=0 | annealstep > 1, + fprintf('runica(): anneal step value (%2.4f) must be (0,1]',annealstep) + return + end + elseif strcmp(Keyword,'annealdeg') | strcmp(Keyword,'degrees') + if isstr(Value) + fprintf('runica(): annealdeg value must be a number') + return + end + annealdeg = Value; + if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG; + elseif annealdeg > 180 | annealdeg < 0 + fprintf('runica(): annealdeg (%3.1f) is out of bounds [0,180]',... + annealdeg); + return + + end + elseif strcmp(Keyword,'momentum') + if isstr(Value) + fprintf('runica(): momentum value must be a number') + return + end + momentum = Value; + if momentum > 1.0 | momentum < 0 + fprintf('runica(): momentum value is out of bounds [0,1]') + return + end + elseif strcmp(Keyword,'sphering') | strcmp(Keyword,'sphereing') ... + | strcmp(Keyword,'sphere') + if ~isstr(Value) + fprintf('runica(): sphering value must be on, off, or none') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off') & ~strcmp(Value,'none'), + fprintf('runica(): sphering value must be on or off') + return + end + sphering = Value; + end + elseif strcmp(Keyword,'bias') + if ~isstr(Value) + fprintf('runica(): bias value must be on or off') + return + else + Value = lower(Value); + if strcmp(Value,'on') + biasflag = 1; + elseif strcmp(Value,'off'), + biasflag = 0; + else + fprintf('runica(): bias value must be on or off') + return + end + end + elseif strcmp(Keyword,'specgram') | strcmp(Keyword,'spec') + + if ~exist('specgram') < 2 % if ~exist or defined workspace variable + fprintf(... + 'runica(): MATLAB Sig. Proc. Toolbox function "specgram" not found.\n') + return + end + if isstr(Value) + fprintf('runica(): specgram argument must be a vector') + return + end + srate = Value(1); + if (srate < 0) + fprintf('runica(): specgram srate (%4.1f) must be >=0',srate) + return + end + if length(Value)>1 + loHz = Value(2); + if (loHz < 0 | loHz > srate/2) + fprintf('runica(): specgram loHz must be >=0 and <= srate/2 (%4.1f)',srate/2) + return + end + else + loHz = 0; % default + end + if length(Value)>2 + hiHz = Value(3); + if (hiHz < loHz | hiHz > srate/2) + fprintf('runica(): specgram hiHz must be >=loHz (%4.1f) and <= srate/2 (%4.1f)',loHz,srate/2) + return + end + else + hiHz = srate/2; % default + end + if length(Value)>3 + Hzframes = Value(5); + if (Hzframes<0 | Hzframes > size(data,2)) + fprintf('runica(): specgram frames must be >=0 and <= data length (%d)',size(data,2)) + return + end + else + Hzframes = size(data,2); % default + end + if length(Value)>4 + Hzwinlen = Value(4); + if rem(Hzframes,Hzwinlen) % if winlen doesn't divide frames + fprintf('runica(): specgram Hzinc must divide frames (%d)',Hzframes) + return + end + else + Hzwinlen = Hzframes; % default + end + Specgramflag = 1; % set flag to perform specgram() + + elseif strcmp(Keyword,'extended') | strcmp(Keyword,'extend') + if isstr(Value) + fprintf('runica(): extended value must be an integer (+/-)') + return + else + extended = 1; % turn on extended-ICA + extblocks = fix(Value); % number of blocks per kurt() compute + if extblocks < 0 + nsub = -1*fix(extblocks); % fix this many sub-Gauss comps + elseif ~extblocks, + extended = 0; % turn extended-ICA off + elseif kurtsize>frames, % length of kurtosis calculation + kurtsize = frames; + if kurtsize < MIN_KURTSIZE + fprintf(... + 'runica() warning: kurtosis values inexact for << %d points.\n',... + MIN_KURTSIZE); + end + end + end + elseif strcmp(Keyword,'verbose') + if ~isstr(Value) + fprintf('runica(): verbose flag value must be on or off') + return + elseif strcmp(Value,'on'), + verbose = 1; + elseif strcmp(Value,'off'), + verbose = 0; + else + fprintf('runica(): verbose flag value must be on or off') + return + end + else + fprintf('runica(): unknown flag') + return + end +end + +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize weights, etc. %%%%%%%%%%%%%%%%%%%%%%%% +% +if ~annealstep, + if ~extended, + annealstep = DEFAULT_ANNEALSTEP; % defaults defined above + else + annealstep = DEFAULT_EXTANNEAL; % defaults defined above + end +end % else use annealstep from commandline + +if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG - momentum*90; % heuristic + if annealdeg < 0, + annealdeg = 0; + end +end +if ncomps > chans | ncomps < 1 + fprintf('runica(): number of components must be 1 to %d.\n',chans); + return +end + +if weights ~= 0, % initialize weights + % starting weights are being passed to runica() from the commandline + if verbose, + fprintf('Using starting weight matrix named in argument list ...\n') + end + if chans>ncomps & weights ~=0, + [r,c]=size(weights); + if r~=ncomps | c~=chans, + fprintf(... + 'runica(): weight matrix must have %d rows, %d columns.\n', ... + chans,ncomps); + return; + end + end +end; +% +%%%%%%%%%%%%%%%%%%%%% Check keyword values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if frames frames, + fprintf('runica(): block size exceeds data length!\n'); + return +elseif floor(epochs) ~= epochs, + fprintf('runica(): data length is not a multiple of the epoch length!\n'); + return +elseif nsub > ncomps + fprintf('runica(): there can be at most %d sub-Gaussian components!\n',ncomps); + return +end; + +% +% adjust nochange if necessary +% +if isnan(nochange) + if ncomps > 32 + nochange = 1E-7; + nochangeupdated = 1; % for fprinting purposes + else + nochangeupdated = 1; % for fprinting purposes + nochange = DEFAULT_STOP; + end; +else + nochangeupdated = 0; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Process the data %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf( ... + '\nInput data size [%d,%d] = %d channels, %d frames/n', ... + chans,frames,chans,frames); + if strcmp(pcaflag,'on') + fprintf('After PCA dimension reduction,\n finding '); + else + fprintf('Finding '); + end + if ~extended + fprintf('%d ICA components using logistic ICA.\n',ncomps); + else % if extended + fprintf('%d ICA components using extended ICA.\n',ncomps); + if extblocks > 0 + fprintf(... + 'Kurtosis will be calculated initially every %d blocks using %d data points.\n',... + extblocks, kurtsize); + else + fprintf(... + 'Kurtosis will not be calculated. Exactly %d sub-Gaussian components assumed.\n',... + nsub); + end + end + fprintf('Decomposing %d frames per ICA weight ((%d)^2 = %d weights, %d frames)\n',... + floor(frames/ncomps.^2),ncomps.^2,frames); + fprintf('Initial learning rate will be %g, block size %d.\n',... + lrate,block); + if momentum>0, + fprintf('Momentum will be %g.\n',momentum); + end + fprintf( ... + 'Learning rate will be multiplied by %g whenever angledelta >= %g deg.\n', ... + annealstep,annealdeg); + + if nochangeupdated + fprintf('More than 32 channels: default stopping weight change 1E-7\n'); + end; + fprintf('Training will end when wchange < %g or after %d steps.\n', ... + nochange,maxsteps); + if biasflag, + fprintf('Online bias adjustment will be used.\n'); + else + fprintf('Online bias adjustment will not be used.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%%% Remove overall row means %%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Removing mean of each channel ...\n'); +end +data = data - mean(data')'*ones(1,frames); % subtract row means + +if verbose, + fprintf('Final training data range: %g to %g\n', ... + min(min(data)),max(max(data))); +end +% +%%%%%%%%%%%%%%%%%%% Perform PCA reduction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + fprintf('Reducing the data to %d principal dimensions...\n',ncomps); + [eigenvectors,eigenvalues,data] = pcsquash(data,ncomps); + % make data its projection onto the ncomps-dim principal subspace +end +% +%%%%%%%%%%%%%%%%%%% Perform specgram transformation %%%%%%%%%%%%%%%%%%%%%%% +% +if exist('Specgramflag') == 1 + % [P F T] = SPECGRAM(A,NFFT,Fs,WINDOW,NOVERLAP) % MATLAB Sig Proc Toolbox + % Hzwinlen = fix(srate/Hzinc); % CHANGED FROM THIS 12/18/00 -sm + + Hzfftlen = 2^(ceil(log(Hzwinlen)/log(2))); % make FFT length next higher 2^k + Hzoverlap = 0; % use sequential windows + % + % Get freqs and times from 1st channel analysis + % + [tmp,freqs,tms] = specgram(data(1,:),Hzfftlen,srate,Hzwinlen,Hzoverlap); + + fs = find(freqs>=loHz & freqs <= hiHz); + if isempty(fs) + fprintf('runica(): specified frequency range too narrow!\n'); + return + end; + + specdata = reshape(tmp(fs,:),1,length(fs)*size(tmp,2)); + specdata = [real(specdata) imag(specdata)]; + % fprintf(' size(fs) = %d,%d\n',size(fs,1),size(fs,2)); + % fprintf(' size(tmp) = %d,%d\n',size(tmp,1),size(tmp,2)); + % + % Loop through remaining channels + % + for ch=2:chans + [tmp] = specgram(data(ch,:),Hzwinlen,srate,Hzwinlen,Hzoverlap); + tmp = reshape((tmp(fs,:)),1,length(fs)*size(tmp,2)); + specdata = [specdata;[real(tmp) imag(tmp)]]; % channels are rows + end + % + % Print specgram confirmation and details + % + fprintf(... + 'Converted data to %d channels by %d=2*%dx%d points spectrogram data.\n',... + chans,2*length(fs)*length(tms),length(fs),length(tms)); + if length(fs) > 1 + fprintf(... + ' Low Hz %g, high Hz %g, Hz incr %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),freqs(fs(2))-freqs(fs(1)),Hzwinlen); + else + fprintf(... + ' Low Hz %g, high Hz %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),Hzwinlen); + end + % + % Replace data with specdata + % + data = specdata; + datalength=size(data,2); +end +% +%%%%%%%%%%%%%%%%%%% Perform sphering %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmp(sphering,'on'), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if verbose, + fprintf('Computing the sphering matrix...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + if ~weights, + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights given on commandline + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + end + end + if verbose, + fprintf('Sphering the data ...\n'); + end + data = sphere*data; % actually decorrelate the electrode signals + +elseif strcmp(sphering,'off') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~weights + if verbose, + fprintf('Using the sphering matrix as the starting weight matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + weights = eye(ncomps,chans)*sphere; % begin with the identity matrix + sphere = eye(chans); % return the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = eye(chans); % return the identity matrix + end +elseif strcmp(sphering,'none') + sphere = eye(chans); % return the identity matrix + if ~weights + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + end + sphere = eye(chans,chans); + if verbose, + fprintf('Returned variable "sphere" will be the identity matrix.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize ICA training %%%%%%%%%%%%%%%%%%%%%%%%% +% +lastt=fix((datalength/block-1)*block+1); +BI=block*eye(ncomps,ncomps); +delta=zeros(1,chans*ncomps); +changes = []; +degconst = 180./pi; +startweights = weights; +prevweights = startweights; +oldweights = startweights; +prevwtchange = zeros(chans,ncomps); +oldwtchange = zeros(chans,ncomps); +lrates = zeros(1,maxsteps); +onesrow = ones(1,block); +bias = zeros(ncomps,1); +signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 +for k=1:nsub + signs(k) = -1; +end +if extended & extblocks < 0 & verbose, + fprintf('Fixed extended-ICA sign assignments: '); + for k=1:ncomps + fprintf('%d ',signs(k)); + end; fprintf('\n'); +end +signs = diag(signs); % make a diagonal matrix +oldsigns = zeros(size(signs));; +signcount = 0; % counter for same-signs +signcounts = []; +urextblocks = extblocks; % original value, for resets +old_kk = zeros(1,ncomps); % for kurtosis momemtum +% +%%%%%%%% ICA training loop using the logistic sigmoid %%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Beginning ICA training ...'); + if extended, + fprintf(' first training step may be slow ...\n'); + else + fprintf('\n'); + end +end +step=0; +laststep=0; +blockno = 1; % running block counter for kurtosis interrupts +logstep = 1; % iterator over log likelihood record +rand('state',sum(100*clock)); % set the random number generator state to +cost_step = 1; % record cost every cost_step iterations +% a position dependent on the system clock +while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + permute=randperm(datalength); % shuffle data order at each step + if mod(step,cost_step) == 0 & extended + loglik(logstep) = 0; + end + + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) & strcmp(get(gcf, 'tag'), 'stop') + close; error('USER ABORT'); + end; + if biasflag + u=weights*data(:,permute(t:t+block-1)) + bias*onesrow; + else + u=weights*data(:,permute(t:t+block-1)); + end + if ~extended + %%%%%%%%%%%%%%%%%%% Logistic ICA weight update %%%%%%%%%%%%%%%%%%% + y=1./(1+exp(-u)); % + weights = weights + lrate*(BI+(1-2*y)*u')*weights; % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % Tanh extended-ICA weight update + %%%%%%%%%%%%%%%%%%% Extended-ICA weight update %%%%%%%%%%%%%%%%%%% + y=tanh(u); % + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; % + + %%%%%%%%% Calculate log likelihood given our model %%%%%%%%% + if mod(step,cost_step) == 0 + subgcomp = find(diag(signs) == -1); + supergcomp = find(diag(signs) == 1); + if length(subgcomp) > 0 + if biasflag + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(log(exp(-(1/2)*(u(subgcomp,:)-bias*ones(1,length(subgcomp))-1).^2) + exp(-(1/2)*(u(subgcomp,:)-bias*ones(1,length(subgcomp))+1).^2)))); + else + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(log(exp(-(1/2)*(u(subgcomp,:)-1).^2) + exp(-(1/2)*(u(subgcomp,:)+1).^2)))); + end + end + if length(supergcomp) > 0 + if biasflag + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(-0.5*(u(supergcomp,:)-bias*ones(1,length(supergcomp))).^2 - 2*log(cosh(u(supergcomp,:)-bias*ones(1,length(supergcomp)))))); + else + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(-0.5*u(supergcomp,:).^2 - 2*log(cosh(u(supergcomp,:))))); + end + end + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + wsave{step+1} = weights; + if biasflag + if ~extended + %%%%%%%%%%%%%%%%%%%%%%%% Logistic ICA bias %%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((1-2*y)')'; % for logistic nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % extended + %%%%%%%%%%%%%%%%%%% Extended-ICA bias %%%%%%%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((-2*y)')'; % for tanh() nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + end + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if extended & ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + % + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=weights*data(:,rp(1:kurtsize)); + else % for small data sets, + partact=weights*data; % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if extended %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + + end % training block %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if mod(step,cost_step) == 0 & extended + loglik(logstep) = loglik(logstep) + log(abs(det(weights))); + logstep = logstep + 1; + end + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + fprintf(''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + if extended + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs));; + end + if lrate> MIN_LRATE + r = rank(data); + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + if verbose, + places = -floor(log10(nochange)); + if step > 2, + if ~extended, + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df, angledelta %4.1f deg\n', ... + step, lrate, places+1,places, degconst*angledelta); + else + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df, angledelta %4.1f deg, %d subgauss\n',... + step, lrate, degconst*angledelta,... + places+1,places, (ncomps-sum(diag(signs)))/2); + end + elseif ~extended + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df\n',... + step, lrate, places+1,places ); + else + ps = sprintf('step %5d - lrate %5f, wchange %%%d.%df, %d subgauss\n',... + step, lrate, places+1,places, (ncomps-sum(diag(signs)))/2); + end % step > 2 + fprintf('step %d - lrate %5f, wchange %8.8f, angledelta %5.1f deg, loglik %6.2f, nsub = %d\n', ... + step, lrate, change, degconst*angledelta, loglik(step), sum(diag(signs)==-1)); + % fprintf(ps,change); % <---- BUG !!!! + end; % if verbose + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + +end; % end training %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if ~laststep + laststep = step; +end; +lrates = lrates(1,1:laststep); % truncate lrate history vector +% +%%%%%%%%%%%%%% Orient components towards max positive activation %%%%%% +% +if strcmp(posactflag,'on') + [activations,winvout,weights] = posact(data,weights); + % changes signs of activations and weights to make activations + % net rms-positive +else + activations = weights*data; +end +% +%%%%%%%%%%%%%% If pcaflag, compose PCA and ICA matrices %%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + fprintf('Composing the eigenvector, weights, and sphere matrices\n'); + fprintf(' into a single rectangular weights matrix; sphere=eye(%d)\n'... + ,chans); + weights= weights*sphere*eigenvectors(:,1:ncomps)'; + sphere = eye(urchans); +end +% +%%%%%% Sort components in descending order of max projected variance %%%% +% +if verbose, + fprintf(... + 'Sorting components in descending order of mean projected variance ...\n'); +end +% +%%%%%%%%%%%%%%%%%%%% Find mean variances %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +meanvar = zeros(ncomps,1); % size of the projections +if ncomps == urchans % if weights are square . . . + winv = inv(weights*sphere); +else + fprintf('Using pseudo-inverse of weight matrix to rank order component projections.\n'); + winv = pinv(weights*sphere); +end +for s=1:ncomps + if verbose, + fprintf('%d ',s); % construct single-component data matrix + end + % project to scalp, then add row means + compproj = winv(:,s)*activations(s,:); + meanvar(s) = mean(sum(compproj.*compproj)/(size(compproj,1)-1)); + % compute mean variance +end % at all scalp channels +if verbose, + fprintf('\n'); +end +% +%%%%%%%%%%%%%% Sort components by mean variance %%%%%%%%%%%%%%%%%%%%%%%% +% +[sortvar, windex] = sort(meanvar); +windex = windex(ncomps:-1:1); % order large to small +meanvar = meanvar(windex); +% +%%%%%%%%%%%%%%%%%%%%% Filter data using final weights %%%%%%%%%%%%%%%%%% +% +if nargout>6, % if activations are to be returned + if verbose, + fprintf('Permuting the activation wave forms ...\n'); + end + activations = activations(windex,:); +else + clear activations +end +weights = weights(windex,:);% reorder the weight matrix +bias = bias(windex); % reorder them +signs = diag(signs); % vectorize the signs matrix +signs = signs(windex); % reorder them + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +return + + +if nargout > 7 + u=weights*data + bias*ones(1,frames); + y = zeros(size(u)); + for c=1:chans + for f=1:frames + y(c,f) = 1/(1+exp(-u(c,f))); + end + end +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/runica_ml2.m b/code/eeglab13_4_4b/functions/sigprocfunc/runica_ml2.m new file mode 100644 index 0000000..d831e6b --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/runica_ml2.m @@ -0,0 +1,1101 @@ +% runica() - Perform Independent Component Analysis (ICA) decomposition +% of input data using the logistic infomax ICA algorithm of +% Bell & Sejnowski (1995) with the natural gradient feature +% of Amari, Cichocki & Yang, or optionally the extended-ICA +% algorithm of Lee, Girolami & Sejnowski, with optional PCA +% dimension reduction. Annealing based on weight changes is +% used to automate the separation process. +% Usage: +% >> [weights,sphere] = runica(data); % train using defaults +% else +% >> [weights,sphere,compvars,bias,signs,lrates,activations] ... +% = runica(data,'Key1',Value1',...); +% Input: +% data = input data (chans,frames*epochs). +% Note that if data consists of multiple discontinuous epochs, +% each epoch should be separately baseline-zero'd using +% >> data = rmbase(data,frames,basevector); +% +% Optional keywords [argument]: +% 'extended' = [N] perform tanh() "extended-ICA" with sign estimation +% N training blocks. If N > 0, automatically estimate the +% number of sub-Gaussian sources. If N < 0, fix number of +% sub-Gaussian comps to -N [faster than N>0] (default|0 -> off) +% 'pca' = [N] decompose a principal component (default -> 0=off) +% subspace of the data. Value is the number of PCs to retain. +% 'ncomps' = [N] number of ICA components to compute (default -> chans or 'pca' arg) +% using rectangular ICA decomposition +% 'sphering' = ['on'/'off'] flag sphering of data (default -> 'on') +% 'weights' = [W] initial weight matrix (default -> eye()) +% (Note: if 'sphering' 'off', default -> spher()) +% 'lrate' = [rate] initial ICA learning rate (<< 1) (default -> heuristic) +% 'block' = [N] ICA block size (<< datalength) (default -> heuristic) +% 'anneal' = annealing constant (0,1] (defaults -> 0.90, or 0.98, extended) +% controls speed of convergence +% 'annealdeg' = [N] degrees weight change for annealing (default -> 70) +% 'stop' = [f] stop training when weight-change < this (default -> 1e-6 +% if less than 33 channel and 1E-7 otherwise) +% 'maxsteps' = [N] max number of ICA training steps (default -> 512) +% 'bias' = ['on'/'off'] perform bias adjustment (default -> 'on') +% 'momentum' = [0 0) +% 'specgram' = [srate loHz hiHz frames winframes] decompose a complex time/frequency +% transform of the data (Note: winframes must divide frames) +% (defaults [srate 0 srate/2 size(data,2) size(data,2)]) +% 'posact' = make all component activations net-positive(default 'on'} +% 'verbose' = give ascii messages ('on'/'off') (default -> 'on') +% +% Outputs: [Note: RO means output in reverse order of projected mean variance +% unless starting weight matrix passed ('weights' above)] +% weights = ICA weight matrix (comps,chans) [RO] +% sphere = data sphering matrix (chans,chans) = spher(data) +% Note that unmixing_matrix = weights*sphere {if sphering off -> eye(chans)} +% compvars = back-projected component variances [RO] +% bias = vector of final (ncomps) online bias [RO] (default = zeros()) +% signs = extended-ICA signs for components [RO] (default = ones()) +% [ -1 = sub-Gaussian; 1 = super-Gaussian] +% lrates = vector of learning rates used at each training step [RO] +% activations = activation time courses of the output components (ncomps,frames*epochs) +% +% Authors: Scott Makeig with contributions from Tony Bell, Te-Won Lee, +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky, Delorme Arnaud, +% CNL/The Salk Institute, La Jolla, 1996- + +% Uses: posact() + +% Reference (please cite): +% +% Makeig, S., Bell, A.J., Jung, T-P and Sejnowski, T.J., +% "Independent component analysis of electroencephalographic data," +% In: D. Touretzky, M. Mozer and M. Hasselmo (Eds). Advances in Neural +% Information Processing Systems 8:145-151, MIT Press, Cambridge, MA (1996). +% +% Toolbox Citation: +% +% Makeig, Scott et al. "EEGLAB: ICA Toolbox for Psychophysiological Research". +% WWW Site, Swartz Center for Computational Neuroscience, Institute of Neural +% Computation, University of San Diego California +% , 2000. [World Wide Web Publication]. +% +% For more information: +% http://www.sccn.ucsd.edu/eeglab/icafaq.html - FAQ on ICA/EEG +% http://www.sccn.ucsd.edu/eeglab/icabib.html - mss. on ICA & biosignals +% http://www.cnl.salk.edu/~tony/ica.html - math. mss. on ICA + +% Copyright (C) 1996 Scott Makeig et al, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Edit history %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% runica() - by Scott Makeig with contributions from Tony Bell, Te-Won Lee +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky et al. +% CNL / Salk Institute 1996-00 +% 04-30-96 built from icatest.m and ~jung/.../wtwpwica.m -sm +% 07-28-97 new runica(), adds bias (default on), momentum (default off), +% extended-ICA (Lee & Sejnowski, 1997), cumulative angledelta +% (until lrate drops), keywords, signcount for speeding extended-ICA +% 10-07-97 put acos() outside verbose loop; verbose 'off' wasn't stopping -sm +% 11-11-97 adjusted help msg -sm +% 11-30-97 return eye(chans) if sphering 'off' or 'none' (undocumented option) -sm +% 02-27-98 use pinv() instead of inv() to rank order comps if ncomps < chans -sm +% 04-28-98 added 'posact' and 'pca' flags -sm +% 07-16-98 reduced length of randperm() for kurtosis subset calc. -se & sm +% 07-19-98 fixed typo in weights def. above -tl & sm +% 12-21-99 added 'specgram' option suggested by Michael Zibulevsky, UNM -sm +% 12-22-99 fixed rand() sizing inefficiency on suggestion of Mike Spratling, UK -sm +% 01-11-00 fixed rand() sizing bug on suggestion of Jack Foucher, Strasbourg -sm +% 12-18-00 test for existence of Sig Proc Tlbx function 'specgram'; improve +% 'specgram' option arguments -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 lowered default lrate and block -ad +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [weights,sphere,meanvar,bias,signs,lrates,activations,y,loglik,wsave] = runica(data,p1,v1,p2,v2,p3,v3,p4,v4,p5,v5,p6,v6,p7,v7,p8,v8,p9,v9,p10,v10,p11,v11,p12,v12,p13,v13,p14,v14) + +if nargin < 1 + help runica + return +end + +[chans frames] = size(data); % determine the data size +urchans = chans; % remember original data channels +datalength = frames; +if chans<2 + fprintf('\nrunica() - data size (%d,%d) too small.\n\n', chans,frames); + return +end +% +%%%%%%%%%%%%%%%%%%%%%% Declare defaults used below %%%%%%%%%%%%%%%%%%%%%%%% +% +MAX_WEIGHT = 1e8; % guess that weights larger than this have blown up +DEFAULT_STOP = 1e-6; % stop training if weight changes below this +DEFAULT_ANNEALDEG = 60; % when angle change reaches this value, +DEFAULT_ANNEALSTEP = 0.95; % anneal by multiplying lrate by this +DEFAULT_EXTANNEAL = 0.95; % or this if extended-ICA +DEFAULT_MAXSTEPS = 500; % stop training after this many steps +DEFAULT_MOMENTUM = 0.0; % default momentum weight + +DEFAULT_BLOWUP = 1000000000.0; % = learning rate has 'blown up' +DEFAULT_BLOWUP_FAC = 0.8; % when lrate 'blows up,' anneal by this fac +DEFAULT_RESTART_FAC = 0.9; % if weights blowup, restart with lrate +% lower by this factor +MIN_LRATE = 0.0001; % if weight blowups make lrate < this, quit +MAX_LRATE = 0.1; % guard against uselessly high learning rate +DEFAULT_LRATE = 0.00065/log(chans); +% heuristic default - may need adjustment +% for large or tiny data sets! +% DEFAULT_BLOCK = floor(sqrt(frames/4)); % heuristic default +DEFAULT_BLOCK = ceil(min(5*log(frames),0.3*frames)); % heuristic +%DEFAULT_BLOCK = 10000; % heuristic +% - may need adjustment! +% Extended-ICA option: +DEFAULT_EXTENDED = 1; % default off +DEFAULT_EXTBLOCKS = 1; % number of blocks per kurtosis calculation +DEFAULT_NSUB = 0; % initial default number of assumed sub-Gaussians +% for extended-ICA +DEFAULT_EXTMOMENTUM = 0.5; % momentum term for computing extended-ICA kurtosis +MAX_KURTSIZE = 6000; % max points to use in kurtosis calculation +MIN_KURTSIZE = 2000; % minimum good kurtosis size (flag warning) +SIGNCOUNT_THRESHOLD = 25; % raise extblocks when sign vector unchanged +% after this many steps +SIGNCOUNT_STEP = 2; % extblocks increment factor + +DEFAULT_SPHEREFLAG = 'on'; % use the sphere matrix as the default +% starting weight matrix +DEFAULT_PCAFLAG = 'off'; % don't use PCA reduction +DEFAULT_POSACTFLAG = 'on'; % use posact() +DEFAULT_VERBOSE = 1; % write ascii info to calling screen +DEFAULT_BIASFLAG = 0; % default to using bias in the ICA update rule +% +%%%%%%%%%%%%%%%%%%%%%%% Set up keyword default values %%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargout < 2, + fprintf('runica() - needs at least two output arguments.\n'); + return +end +epochs = 1; % do not care how many epochs in data + +pcaflag = DEFAULT_PCAFLAG; +sphering = DEFAULT_SPHEREFLAG; % default flags +posactflag = DEFAULT_POSACTFLAG; +verbose = DEFAULT_VERBOSE; + +block = DEFAULT_BLOCK; % heuristic default - may need adjustment! +lrate = DEFAULT_LRATE; +annealdeg = DEFAULT_ANNEALDEG; +annealstep = 0; % defaults declared below +nochange = NaN; +momentum = DEFAULT_MOMENTUM; +maxsteps = DEFAULT_MAXSTEPS; + +weights = 0; % defaults defined below +ncomps = chans; +biasflag = DEFAULT_BIASFLAG; + +extended = DEFAULT_EXTENDED; +extblocks = DEFAULT_EXTBLOCKS; +kurtsize = MAX_KURTSIZE; +signsbias = 0.02; % bias towards super-Gaussian components +extmomentum= DEFAULT_EXTMOMENTUM; % exp. average the kurtosis estimates +nsub = DEFAULT_NSUB; +wts_blowup = 0; % flag =1 when weights too large +wts_passed = 0; % flag weights passed as argument +% +%%%%%%%%%% Collect keywords and values from argument list %%%%%%%%%%%%%%% +% +if (nargin> 1 & rem(nargin,2) == 0) + fprintf('runica(): Even number of input arguments???') + return +end +for i = 3:2:nargin % for each Keyword + Keyword = eval(['p',int2str((i-3)/2 +1)]); + Value = eval(['v',int2str((i-3)/2 +1)]); + if ~isstr(Keyword) + fprintf('runica(): keywords must be strings') + return + end + Keyword = lower(Keyword); % convert upper or mixed case to lower + + if strcmp(Keyword,'weights') | strcmp(Keyword,'weight') + if isstr(Value) + fprintf(... + 'runica(): weights value must be a weight matrix or sphere') + return + else + weights = Value; + wts_passed =1; + end + elseif strcmp(Keyword,'ncomps') + if isstr(Value) + fprintf('runica(): ncomps value must be an integer') + return + end + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + ncomps = Value; + if ~ncomps, + ncomps = chans; + end + elseif strcmp(Keyword,'pca') + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + if isstr(Value) + fprintf(... + 'runica(): pca value should be the number of principal components to retain') + return + end + pcaflag = 'on'; + ncomps = Value; + if ncomps > chans | ncomps < 1, + fprintf('runica(): pca value must be in range [1,%d]\n',chans) + return + end + chans = ncomps; + elseif strcmp(Keyword,'posact') + if ~isstr(Value) + fprintf('runica(): posact value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): posact value must be on or off') + return + end + posactflag = Value; + end + elseif strcmp(Keyword,'lrate') + if isstr(Value) + fprintf('runica(): lrate value must be a number') + return + end + lrate = Value; + if lrate>MAX_LRATE | lrate <0, + fprintf('runica(): lrate value is out of bounds'); + return + end + if ~lrate, + lrate = DEFAULT_LRATE; + end + elseif strcmp(Keyword,'block') | strcmp(Keyword,'blocksize') + if isstr(Value) + fprintf('runica(): block size value must be a number') + return + end + block = floor(Value); + if ~block, + block = DEFAULT_BLOCK; + end + elseif strcmp(Keyword,'stop') | strcmp(Keyword,'nochange') ... + | strcmp(Keyword,'stopping') + if isstr(Value) + fprintf('runica(): stop wchange value must be a number') + return + end + nochange = Value; + elseif strcmp(Keyword,'maxsteps') | strcmp(Keyword,'steps') + if isstr(Value) + fprintf('runica(): maxsteps value must be an integer') + return + end + maxsteps = Value; + if ~maxsteps, + maxsteps = DEFAULT_MAXSTEPS; + end + if maxsteps < 0 + fprintf('runica(): maxsteps value (%d) must be a positive integer',maxsteps) + return + end + elseif strcmp(Keyword,'anneal') | strcmp(Keyword,'annealstep') + if isstr(Value) + fprintf('runica(): anneal step value (%2.4f) must be a number (0,1)',Value) + return + end + annealstep = Value; + if annealstep <=0 | annealstep > 1, + fprintf('runica(): anneal step value (%2.4f) must be (0,1]',annealstep) + return + end + elseif strcmp(Keyword,'annealdeg') | strcmp(Keyword,'degrees') + if isstr(Value) + fprintf('runica(): annealdeg value must be a number') + return + end + annealdeg = Value; + if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG; + elseif annealdeg > 180 | annealdeg < 0 + fprintf('runica(): annealdeg (%3.1f) is out of bounds [0,180]',... + annealdeg); + return + + end + elseif strcmp(Keyword,'momentum') + if isstr(Value) + fprintf('runica(): momentum value must be a number') + return + end + momentum = Value; + if momentum > 1.0 | momentum < 0 + fprintf('runica(): momentum value is out of bounds [0,1]') + return + end + elseif strcmp(Keyword,'sphering') | strcmp(Keyword,'sphereing') ... + | strcmp(Keyword,'sphere') + if ~isstr(Value) + fprintf('runica(): sphering value must be on, off, or none') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off') & ~strcmp(Value,'none'), + fprintf('runica(): sphering value must be on or off') + return + end + sphering = Value; + end + elseif strcmp(Keyword,'bias') + if ~isstr(Value) + fprintf('runica(): bias value must be on or off') + return + else + Value = lower(Value); + if strcmp(Value,'on') + biasflag = 1; + elseif strcmp(Value,'off'), + biasflag = 0; + else + fprintf('runica(): bias value must be on or off') + return + end + end + elseif strcmp(Keyword,'specgram') | strcmp(Keyword,'spec') + + if ~exist('specgram') < 2 % if ~exist or defined workspace variable + fprintf(... + 'runica(): MATLAB Sig. Proc. Toolbox function "specgram" not found.\n') + return + end + if isstr(Value) + fprintf('runica(): specgram argument must be a vector') + return + end + srate = Value(1); + if (srate < 0) + fprintf('runica(): specgram srate (%4.1f) must be >=0',srate) + return + end + if length(Value)>1 + loHz = Value(2); + if (loHz < 0 | loHz > srate/2) + fprintf('runica(): specgram loHz must be >=0 and <= srate/2 (%4.1f)',srate/2) + return + end + else + loHz = 0; % default + end + if length(Value)>2 + hiHz = Value(3); + if (hiHz < loHz | hiHz > srate/2) + fprintf('runica(): specgram hiHz must be >=loHz (%4.1f) and <= srate/2 (%4.1f)',loHz,srate/2) + return + end + else + hiHz = srate/2; % default + end + if length(Value)>3 + Hzframes = Value(5); + if (Hzframes<0 | Hzframes > size(data,2)) + fprintf('runica(): specgram frames must be >=0 and <= data length (%d)',size(data,2)) + return + end + else + Hzframes = size(data,2); % default + end + if length(Value)>4 + Hzwinlen = Value(4); + if rem(Hzframes,Hzwinlen) % if winlen doesn't divide frames + fprintf('runica(): specgram Hzinc must divide frames (%d)',Hzframes) + return + end + else + Hzwinlen = Hzframes; % default + end + Specgramflag = 1; % set flag to perform specgram() + + elseif strcmp(Keyword,'extended') | strcmp(Keyword,'extend') + if isstr(Value) + fprintf('runica(): extended value must be an integer (+/-)') + return + else + extended = 1; % turn on extended-ICA + extblocks = fix(Value); % number of blocks per kurt() compute + if extblocks < 0 + nsub = -1*fix(extblocks); % fix this many sub-Gauss comps + elseif ~extblocks, + extended = 0; % turn extended-ICA off + elseif kurtsize>frames, % length of kurtosis calculation + kurtsize = frames; + if kurtsize < MIN_KURTSIZE + fprintf(... + 'runica() warning: kurtosis values inexact for << %d points.\n',... + MIN_KURTSIZE); + end + end + end + elseif strcmp(Keyword,'verbose') + if ~isstr(Value) + fprintf('runica(): verbose flag value must be on or off') + return + elseif strcmp(Value,'on'), + verbose = 1; + elseif strcmp(Value,'off'), + verbose = 0; + else + fprintf('runica(): verbose flag value must be on or off') + return + end + else + fprintf('runica(): unknown flag') + return + end +end + +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize weights, etc. %%%%%%%%%%%%%%%%%%%%%%%% +% +if ~annealstep, + if ~extended, + annealstep = DEFAULT_ANNEALSTEP; % defaults defined above + else + annealstep = DEFAULT_EXTANNEAL; % defaults defined above + end +end % else use annealstep from commandline + +if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG - momentum*90; % heuristic + if annealdeg < 0, + annealdeg = 0; + end +end +if ncomps > chans | ncomps < 1 + fprintf('runica(): number of components must be 1 to %d.\n',chans); + return +end + +if weights ~= 0, % initialize weights + % starting weights are being passed to runica() from the commandline + if verbose, + fprintf('Using starting weight matrix named in argument list ...\n') + end + if chans>ncomps & weights ~=0, + [r,c]=size(weights); + if r~=ncomps | c~=chans, + fprintf(... + 'runica(): weight matrix must have %d rows, %d columns.\n', ... + chans,ncomps); + return; + end + end +end; +% +%%%%%%%%%%%%%%%%%%%%% Check keyword values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if frames frames, + fprintf('runica(): block size exceeds data length!\n'); + return +elseif floor(epochs) ~= epochs, + fprintf('runica(): data length is not a multiple of the epoch length!\n'); + return +elseif nsub > ncomps + fprintf('runica(): there can be at most %d sub-Gaussian components!\n',ncomps); + return +end; + +% +% adjust nochange if necessary +% +if isnan(nochange) + if ncomps > 32 + nochange = 1E-7; + nochangeupdated = 1; % for fprinting purposes + else + nochangeupdated = 1; % for fprinting purposes + nochange = DEFAULT_STOP; + end; +else + nochangeupdated = 0; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Process the data %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf( ... + '\nInput data size [%d,%d] = %d channels, %d frames/n', ... + chans,frames,chans,frames); + if strcmp(pcaflag,'on') + fprintf('After PCA dimension reduction,\n finding '); + else + fprintf('Finding '); + end + if ~extended + fprintf('%d ICA components using logistic ICA.\n',ncomps); + else % if extended + fprintf('%d ICA components using extended ICA.\n',ncomps); + if extblocks > 0 + fprintf(... + 'Kurtosis will be calculated initially every %d blocks using %d data points.\n',... + extblocks, kurtsize); + else + fprintf(... + 'Kurtosis will not be calculated. Exactly %d sub-Gaussian components assumed.\n',... + nsub); + end + end + fprintf('Decomposing %d frames per ICA weight ((%d)^2 = %d weights, %d frames)\n',... + floor(frames/ncomps.^2),ncomps.^2,frames); + fprintf('Initial learning rate will be %g, block size %d.\n',... + lrate,block); + if momentum>0, + fprintf('Momentum will be %g.\n',momentum); + end + fprintf( ... + 'Learning rate will be multiplied by %g whenever angledelta >= %g deg.\n', ... + annealstep,annealdeg); + + if nochangeupdated + fprintf('More than 32 channels: default stopping weight change 1E-7\n'); + end; + fprintf('Training will end when wchange < %g or after %d steps.\n', ... + nochange,maxsteps); + if biasflag, + fprintf('Online bias adjustment will be used.\n'); + else + fprintf('Online bias adjustment will not be used.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%%% Remove overall row means %%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Removing mean of each channel ...\n'); +end +data = data - mean(data')'*ones(1,frames); % subtract row means + +if verbose, + fprintf('Final training data range: %g to %g\n', ... + min(min(data)),max(max(data))); +end +% +%%%%%%%%%%%%%%%%%%% Perform PCA reduction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + fprintf('Reducing the data to %d principal dimensions...\n',ncomps); + [eigenvectors,eigenvalues,data] = pcsquash(data,ncomps); + % make data its projection onto the ncomps-dim principal subspace +end +% +%%%%%%%%%%%%%%%%%%% Perform specgram transformation %%%%%%%%%%%%%%%%%%%%%%% +% +if exist('Specgramflag') == 1 + % [P F T] = SPECGRAM(A,NFFT,Fs,WINDOW,NOVERLAP) % MATLAB Sig Proc Toolbox + % Hzwinlen = fix(srate/Hzinc); % CHANGED FROM THIS 12/18/00 -sm + + Hzfftlen = 2^(ceil(log(Hzwinlen)/log(2))); % make FFT length next higher 2^k + Hzoverlap = 0; % use sequential windows + % + % Get freqs and times from 1st channel analysis + % + [tmp,freqs,tms] = specgram(data(1,:),Hzfftlen,srate,Hzwinlen,Hzoverlap); + + fs = find(freqs>=loHz & freqs <= hiHz); + if isempty(fs) + fprintf('runica(): specified frequency range too narrow!\n'); + return + end; + + specdata = reshape(tmp(fs,:),1,length(fs)*size(tmp,2)); + specdata = [real(specdata) imag(specdata)]; + % fprintf(' size(fs) = %d,%d\n',size(fs,1),size(fs,2)); + % fprintf(' size(tmp) = %d,%d\n',size(tmp,1),size(tmp,2)); + % + % Loop through remaining channels + % + for ch=2:chans + [tmp] = specgram(data(ch,:),Hzwinlen,srate,Hzwinlen,Hzoverlap); + tmp = reshape((tmp(fs,:)),1,length(fs)*size(tmp,2)); + specdata = [specdata;[real(tmp) imag(tmp)]]; % channels are rows + end + % + % Print specgram confirmation and details + % + fprintf(... + 'Converted data to %d channels by %d=2*%dx%d points spectrogram data.\n',... + chans,2*length(fs)*length(tms),length(fs),length(tms)); + if length(fs) > 1 + fprintf(... + ' Low Hz %g, high Hz %g, Hz incr %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),freqs(fs(2))-freqs(fs(1)),Hzwinlen); + else + fprintf(... + ' Low Hz %g, high Hz %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),Hzwinlen); + end + % + % Replace data with specdata + % + data = specdata; + datalength=size(data,2); +end +% +%%%%%%%%%%%%%%%%%%% Perform sphering %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmp(sphering,'on'), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if verbose, + fprintf('Computing the sphering matrix...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + if ~weights, + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights given on commandline + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + end + end + if verbose, + fprintf('Sphering the data ...\n'); + end + data = sphere*data; % actually decorrelate the electrode signals + +elseif strcmp(sphering,'off') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~weights + if verbose, + fprintf('Using the sphering matrix as the starting weight matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + weights = eye(ncomps,chans)*sphere; % begin with the identity matrix + sphere = eye(chans); % return the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = eye(chans); % return the identity matrix + end +elseif strcmp(sphering,'none') + sphere = eye(chans); % return the identity matrix + if ~weights + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + end + sphere = eye(chans,chans); + if verbose, + fprintf('Returned variable "sphere" will be the identity matrix.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize ICA training %%%%%%%%%%%%%%%%%%%%%%%%% +% +lastt=fix((datalength/block-1)*block+1); +BI=block*eye(ncomps,ncomps); +delta=zeros(1,chans*ncomps); +changes = []; +degconst = 180./pi; +startweights = weights; +prevweights = startweights; +oldweights = startweights; +prevwtchange = zeros(chans,ncomps); +oldwtchange = zeros(chans,ncomps); +lrates = zeros(1,maxsteps); +onesrow = ones(1,block); +bias = zeros(ncomps,1); +signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 +for k=1:nsub + signs(k) = -1; +end +if extended & extblocks < 0 & verbose, + fprintf('Fixed extended-ICA sign assignments: '); + for k=1:ncomps + fprintf('%d ',signs(k)); + end; fprintf('\n'); +end +signs = diag(signs); % make a diagonal matrix +oldsigns = zeros(size(signs));; +signcount = 0; % counter for same-signs +signcounts = []; +urextblocks = extblocks; % original value, for resets +old_kk = zeros(1,ncomps); % for kurtosis momemtum +% +%%%%%%%% ICA training loop using the logistic sigmoid %%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Beginning ICA training ...'); + if extended, + fprintf(' first training step may be slow ...\n'); + else + fprintf('\n'); + end +end +step=0; +laststep=0; +blockno = 1; % running block counter for kurtosis interrupts +logstep = 1; % iterator over log likelihood record +rand('state',sum(100*clock)); % set the random number generator state to +cost_step = 10; % record cost every cost_step iterations +block = 10000; +% a position dependent on the system clock +while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + permute=randperm(datalength); % shuffle data order at each step + if mod(step,cost_step) == 0 + loglik(logstep) = 0; + end + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) & strcmp(get(gcf, 'tag'), 'stop') + close; error('USER ABORT'); + end; + if biasflag + u=weights*data(:,permute(t:t+block-1)) + bias*onesrow; + else + u=weights*data(:,permute(t:t+block-1)); + end + if ~extended + %%%%%%%%%%%%%%%%%%% Logistic ICA weight update %%%%%%%%%%%%%%%%%%% + y=1./(1+exp(-u)); % + weights = weights + lrate*(BI+(1-2*y)*u')*weights; % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % Tanh extended-ICA weight update + %%%%%%%%%%%%%%%%%%% Extended-ICA weight update %%%%%%%%%%%%%%%%%%% + y=tanh(u); % + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; % + end + wsave{step+1} = weights; + if biasflag + if ~extended + %%%%%%%%%%%%%%%%%%%%%%%% Logistic ICA bias %%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((1-2*y)')'; % for logistic nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % extended + %%%%%%%%%%%%%%%%%%% Extended-ICA bias %%%%%%%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((-2*y)')'; % for tanh() nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + end + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if extended & ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + % + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=weights*data(:,rp(1:kurtsize)); + else % for small data sets, + partact=weights*data; % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if extended %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + + end % training block %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if mod(step,cost_step) == 0 + %%%%%%%%% Calculate log likelihood given our model %%%%%%%%% + loglik(logstep) = log(abs(det(weights))); + if extended + subgcomp = find(diag(signs) == -1); + supergcomp = find(diag(signs) == 1); + acts = weights*data; + if length(subgcomp) > 0 + if biasflag + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(log(exp(-(1/2)*(acts(subgcomp,:)-bias*ones(1,length(subgcomp))-1).^2) + exp(-(1/2)*(acts(subgcomp,:)-bias*ones(1,length(subgcomp))+1).^2)))); + else + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(log(exp(-(1/2)*(acts(subgcomp,:)-1).^2) + exp(-(1/2)*(acts(subgcomp,:)+1).^2)))); + end + end + if length(supergcomp) > 0 + if biasflag + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(-0.5*(acts(supergcomp,:)-bias*ones(1,length(supergcomp))).^2 - 2*log(cosh(acts(supergcomp,:)-bias*ones(1,length(supergcomp)))))); + else + loglik(logstep) = loglik(logstep) + (1/frames)*sum(sum(-0.5*acts(supergcomp,:).^2 - 2*log(cosh(acts(supergcomp,:))))); + end + end + end + logstep = logstep + 1; + end + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + fprintf(''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + if extended + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs));; + end + if lrate> MIN_LRATE + r = rank(data); + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + if verbose, + places = -floor(log10(nochange)); + if step > 2, + if ~extended, + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df, angledelta %4.1f deg\n', ... + step, lrate, places+1,places, degconst*angledelta); + else + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df, angledelta %4.1f deg, %d subgauss\n',... + step, lrate, degconst*angledelta,... + places+1,places, (ncomps-sum(diag(signs)))/2); + end + elseif ~extended + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df\n',... + step, lrate, places+1,places ); + else + ps = sprintf('step %5d - lrate %5f, wchange %%%d.%df, %d subgauss\n',... + step, lrate, places+1,places, (ncomps-sum(diag(signs)))/2); + end % step > 2 + fprintf('step %d - lrate %8.8f, wchange %8.8f, angledelta %3.1f deg, loglik %6.4f, nsub = %d\n', ... + step, lrate, change, degconst*angledelta, loglik(step), sum(diag(signs)==-1)); + % fprintf(ps,change); % <---- BUG !!!! + end; % if verbose + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + +end; % end training %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if ~laststep + laststep = step; +end; +lrates = lrates(1,1:laststep); % truncate lrate history vector +% +%%%%%%%%%%%%%% Orient components towards max positive activation %%%%%% +% +if strcmp(posactflag,'on') + [activations,winvout,weights] = posact(data,weights); + % changes signs of activations and weights to make activations + % net rms-positive +else + activations = weights*data; +end +% +%%%%%%%%%%%%%% If pcaflag, compose PCA and ICA matrices %%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + fprintf('Composing the eigenvector, weights, and sphere matrices\n'); + fprintf(' into a single rectangular weights matrix; sphere=eye(%d)\n'... + ,chans); + weights= weights*sphere*eigenvectors(:,1:ncomps)'; + sphere = eye(urchans); +end +% +%%%%%% Sort components in descending order of max projected variance %%%% +% +if verbose, + fprintf(... + 'Sorting components in descending order of mean projected variance ...\n'); +end +% +%%%%%%%%%%%%%%%%%%%% Find mean variances %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +meanvar = zeros(ncomps,1); % size of the projections +if ncomps == urchans % if weights are square . . . + winv = inv(weights*sphere); +else + fprintf('Using pseudo-inverse of weight matrix to rank order component projections.\n'); + winv = pinv(weights*sphere); +end +for s=1:ncomps + if verbose, + fprintf('%d ',s); % construct single-component data matrix + end + % project to scalp, then add row means + compproj = winv(:,s)*activations(s,:); + meanvar(s) = mean(sum(compproj.*compproj)/(size(compproj,1)-1)); + % compute mean variance +end % at all scalp channels +if verbose, + fprintf('\n'); +end +% +%%%%%%%%%%%%%% Sort components by mean variance %%%%%%%%%%%%%%%%%%%%%%%% +% +[sortvar, windex] = sort(meanvar); +windex = windex(ncomps:-1:1); % order large to small +meanvar = meanvar(windex); +% +%%%%%%%%%%%%%%%%%%%%% Filter data using final weights %%%%%%%%%%%%%%%%%% +% +if nargout>6, % if activations are to be returned + if verbose, + fprintf('Permuting the activation wave forms ...\n'); + end + activations = activations(windex,:); +else + clear activations +end +weights = weights(windex,:);% reorder the weight matrix +bias = bias(windex); % reorder them +signs = diag(signs); % vectorize the signs matrix +signs = signs(windex); % reorder them + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +return + + +if nargout > 7 + u=weights*data + bias*ones(1,frames); + y = zeros(size(u)); + for c=1:chans + for f=1:frames + y(c,f) = 1/(1+exp(-u(c,f))); + end + end +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/runica_mlb.m b/code/eeglab13_4_4b/functions/sigprocfunc/runica_mlb.m new file mode 100644 index 0000000..8820a92 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/runica_mlb.m @@ -0,0 +1,1086 @@ +% runica() - Perform Independent Component Analysis (ICA) decomposition +% of input data using the logistic infomax ICA algorithm of +% Bell & Sejnowski (1995) with the natural gradient feature +% of Amari, Cichocki & Yang, or optionally the extended-ICA +% algorithm of Lee, Girolami & Sejnowski, with optional PCA +% dimension reduction. Annealing based on weight changes is +% used to automate the separation process. +% Usage: +% >> [weights,sphere] = runica(data); % train using defaults +% else +% >> [weights,sphere,compvars,bias,signs,lrates,activations] ... +% = runica(data,'Key1',Value1',...); +% Input: +% data = input data (chans,frames*epochs). +% Note that if data consists of multiple discontinuous epochs, +% each epoch should be separately baseline-zero'd using +% >> data = rmbase(data,frames,basevector); +% +% Optional keywords [argument]: +% 'extended' = [N] perform tanh() "extended-ICA" with sign estimation +% N training blocks. If N > 0, automatically estimate the +% number of sub-Gaussian sources. If N < 0, fix number of +% sub-Gaussian comps to -N [faster than N>0] (default|0 -> off) +% 'pca' = [N] decompose a principal component (default -> 0=off) +% subspace of the data. Value is the number of PCs to retain. +% 'ncomps' = [N] number of ICA components to compute (default -> chans or 'pca' arg) +% using rectangular ICA decomposition +% 'sphering' = ['on'/'off'] flag sphering of data (default -> 'on') +% 'weights' = [W] initial weight matrix (default -> eye()) +% (Note: if 'sphering' 'off', default -> spher()) +% 'lrate' = [rate] initial ICA learning rate (<< 1) (default -> heuristic) +% 'block' = [N] ICA block size (<< datalength) (default -> heuristic) +% 'anneal' = annealing constant (0,1] (defaults -> 0.90, or 0.98, extended) +% controls speed of convergence +% 'annealdeg' = [N] degrees weight change for annealing (default -> 70) +% 'stop' = [f] stop training when weight-change < this (default -> 1e-6 +% if less than 33 channel and 1E-7 otherwise) +% 'maxsteps' = [N] max number of ICA training steps (default -> 512) +% 'bias' = ['on'/'off'] perform bias adjustment (default -> 'on') +% 'momentum' = [0 0) +% 'specgram' = [srate loHz hiHz frames winframes] decompose a complex time/frequency +% transform of the data (Note: winframes must divide frames) +% (defaults [srate 0 srate/2 size(data,2) size(data,2)]) +% 'posact' = make all component activations net-positive(default 'on'} +% 'verbose' = give ascii messages ('on'/'off') (default -> 'on') +% +% Outputs: [Note: RO means output in reverse order of projected mean variance +% unless starting weight matrix passed ('weights' above)] +% weights = ICA weight matrix (comps,chans) [RO] +% sphere = data sphering matrix (chans,chans) = spher(data) +% Note that unmixing_matrix = weights*sphere {if sphering off -> eye(chans)} +% compvars = back-projected component variances [RO] +% bias = vector of final (ncomps) online bias [RO] (default = zeros()) +% signs = extended-ICA signs for components [RO] (default = ones()) +% [ -1 = sub-Gaussian; 1 = super-Gaussian] +% lrates = vector of learning rates used at each training step [RO] +% activations = activation time courses of the output components (ncomps,frames*epochs) +% +% Authors: Scott Makeig with contributions from Tony Bell, Te-Won Lee, +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky, Delorme Arnaud, +% CNL/The Salk Institute, La Jolla, 1996- + +% Uses: posact() + +% Reference (please cite): +% +% Makeig, S., Bell, A.J., Jung, T-P and Sejnowski, T.J., +% "Independent component analysis of electroencephalographic data," +% In: D. Touretzky, M. Mozer and M. Hasselmo (Eds). Advances in Neural +% Information Processing Systems 8:145-151, MIT Press, Cambridge, MA (1996). +% +% Toolbox Citation: +% +% Makeig, Scott et al. "EEGLAB: ICA Toolbox for Psychophysiological Research". +% WWW Site, Swartz Center for Computational Neuroscience, Institute of Neural +% Computation, University of San Diego California +% , 2000. [World Wide Web Publication]. +% +% For more information: +% http://www.sccn.ucsd.edu/eeglab/icafaq.html - FAQ on ICA/EEG +% http://www.sccn.ucsd.edu/eeglab/icabib.html - mss. on ICA & biosignals +% http://www.cnl.salk.edu/~tony/ica.html - math. mss. on ICA + +% Copyright (C) 1996 Scott Makeig et al, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%% Edit history %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% runica() - by Scott Makeig with contributions from Tony Bell, Te-Won Lee +% Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky et al. +% CNL / Salk Institute 1996-00 +% 04-30-96 built from icatest.m and ~jung/.../wtwpwica.m -sm +% 07-28-97 new runica(), adds bias (default on), momentum (default off), +% extended-ICA (Lee & Sejnowski, 1997), cumulative angledelta +% (until lrate drops), keywords, signcount for speeding extended-ICA +% 10-07-97 put acos() outside verbose loop; verbose 'off' wasn't stopping -sm +% 11-11-97 adjusted help msg -sm +% 11-30-97 return eye(chans) if sphering 'off' or 'none' (undocumented option) -sm +% 02-27-98 use pinv() instead of inv() to rank order comps if ncomps < chans -sm +% 04-28-98 added 'posact' and 'pca' flags -sm +% 07-16-98 reduced length of randperm() for kurtosis subset calc. -se & sm +% 07-19-98 fixed typo in weights def. above -tl & sm +% 12-21-99 added 'specgram' option suggested by Michael Zibulevsky, UNM -sm +% 12-22-99 fixed rand() sizing inefficiency on suggestion of Mike Spratling, UK -sm +% 01-11-00 fixed rand() sizing bug on suggestion of Jack Foucher, Strasbourg -sm +% 12-18-00 test for existence of Sig Proc Tlbx function 'specgram'; improve +% 'specgram' option arguments -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 lowered default lrate and block -ad +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [weights,sphere,meanvar,bias,signs,lrates,activations,y,loglik] = runica(data,p1,v1,p2,v2,p3,v3,p4,v4,p5,v5,p6,v6,p7,v7,p8,v8,p9,v9,p10,v10,p11,v11,p12,v12,p13,v13,p14,v14) + +if nargin < 1 + help runica + return +end + +[chans frames] = size(data); % determine the data size +urchans = chans; % remember original data channels +datalength = frames; +if chans<2 + fprintf('\nrunica() - data size (%d,%d) too small.\n\n', chans,frames); + return +end +% +%%%%%%%%%%%%%%%%%%%%%% Declare defaults used below %%%%%%%%%%%%%%%%%%%%%%%% +% +MAX_WEIGHT = 1e8; % guess that weights larger than this have blown up +DEFAULT_STOP = 1e-6; % stop training if weight changes below this +DEFAULT_ANNEALDEG = 60; % when angle change reaches this value, +DEFAULT_ANNEALSTEP = 0.98; % anneal by multiplying lrate by this +DEFAULT_EXTANNEAL = 0.98; % or this if extended-ICA +DEFAULT_MAXSTEPS = 500; % stop training after this many steps +DEFAULT_MOMENTUM = 0.0; % default momentum weight + +DEFAULT_BLOWUP = 1000000000.0; % = learning rate has 'blown up' +DEFAULT_BLOWUP_FAC = 0.8; % when lrate 'blows up,' anneal by this fac +DEFAULT_RESTART_FAC = 0.9; % if weights blowup, restart with lrate +% lower by this factor +MIN_LRATE = 0.0001; % if weight blowups make lrate < this, quit +MAX_LRATE = 0.1; % guard against uselessly high learning rate +DEFAULT_LRATE = 0.00065/log(chans); +% heuristic default - may need adjustment +% for large or tiny data sets! +% DEFAULT_BLOCK = floor(sqrt(frames/4)); % heuristic default +DEFAULT_BLOCK = ceil(min(5*log(frames),0.3*frames)); % heuristic +% - may need adjustment! +% Extended-ICA option: +DEFAULT_EXTENDED = 1; % default off +DEFAULT_EXTBLOCKS = 1; % number of blocks per kurtosis calculation +DEFAULT_NSUB = 0; % initial default number of assumed sub-Gaussians +% for extended-ICA +DEFAULT_EXTMOMENTUM = 0.5; % momentum term for computing extended-ICA kurtosis +MAX_KURTSIZE = 6000; % max points to use in kurtosis calculation +MIN_KURTSIZE = 2000; % minimum good kurtosis size (flag warning) +SIGNCOUNT_THRESHOLD = 25; % raise extblocks when sign vector unchanged +% after this many steps +SIGNCOUNT_STEP = 2; % extblocks increment factor + +DEFAULT_SPHEREFLAG = 'on'; % use the sphere matrix as the default +% starting weight matrix +DEFAULT_PCAFLAG = 'off'; % don't use PCA reduction +DEFAULT_POSACTFLAG = 'on'; % use posact() +DEFAULT_VERBOSE = 1; % write ascii info to calling screen +DEFAULT_BIASFLAG = 1; % default to using bias in the ICA update rule +% +%%%%%%%%%%%%%%%%%%%%%%% Set up keyword default values %%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargout < 2, + fprintf('runica() - needs at least two output arguments.\n'); + return +end +epochs = 1; % do not care how many epochs in data + +pcaflag = DEFAULT_PCAFLAG; +sphering = DEFAULT_SPHEREFLAG; % default flags +posactflag = DEFAULT_POSACTFLAG; +verbose = DEFAULT_VERBOSE; + +block = DEFAULT_BLOCK; % heuristic default - may need adjustment! +lrate = DEFAULT_LRATE; +annealdeg = DEFAULT_ANNEALDEG; +annealstep = 0; % defaults declared below +nochange = NaN; +momentum = DEFAULT_MOMENTUM; +maxsteps = DEFAULT_MAXSTEPS; + +weights = 0; % defaults defined below +ncomps = chans; +biasflag = DEFAULT_BIASFLAG; + +extended = DEFAULT_EXTENDED; +extblocks = DEFAULT_EXTBLOCKS; +kurtsize = MAX_KURTSIZE; +signsbias = 0.02; % bias towards super-Gaussian components +extmomentum= DEFAULT_EXTMOMENTUM; % exp. average the kurtosis estimates +nsub = DEFAULT_NSUB; +wts_blowup = 0; % flag =1 when weights too large +wts_passed = 0; % flag weights passed as argument +% +%%%%%%%%%% Collect keywords and values from argument list %%%%%%%%%%%%%%% +% +if (nargin> 1 & rem(nargin,2) == 0) + fprintf('runica(): Even number of input arguments???') + return +end +for i = 3:2:nargin % for each Keyword + Keyword = eval(['p',int2str((i-3)/2 +1)]); + Value = eval(['v',int2str((i-3)/2 +1)]); + if ~isstr(Keyword) + fprintf('runica(): keywords must be strings') + return + end + Keyword = lower(Keyword); % convert upper or mixed case to lower + + if strcmp(Keyword,'weights') | strcmp(Keyword,'weight') + if isstr(Value) + fprintf(... + 'runica(): weights value must be a weight matrix or sphere') + return + else + weights = Value; + wts_passed =1; + end + elseif strcmp(Keyword,'ncomps') + if isstr(Value) + fprintf('runica(): ncomps value must be an integer') + return + end + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + ncomps = Value; + if ~ncomps, + ncomps = chans; + end + elseif strcmp(Keyword,'pca') + if ncomps < urchans & ncomps ~= Value + fprintf('runica(): Use either PCA or ICA dimension reduction'); + return + end + if isstr(Value) + fprintf(... + 'runica(): pca value should be the number of principal components to retain') + return + end + pcaflag = 'on'; + ncomps = Value; + if ncomps > chans | ncomps < 1, + fprintf('runica(): pca value must be in range [1,%d]\n',chans) + return + end + chans = ncomps; + elseif strcmp(Keyword,'posact') + if ~isstr(Value) + fprintf('runica(): posact value must be on or off') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off'), + fprintf('runica(): posact value must be on or off') + return + end + posactflag = Value; + end + elseif strcmp(Keyword,'lrate') + if isstr(Value) + fprintf('runica(): lrate value must be a number') + return + end + lrate = Value; + if lrate>MAX_LRATE | lrate <0, + fprintf('runica(): lrate value is out of bounds'); + return + end + if ~lrate, + lrate = DEFAULT_LRATE; + end + elseif strcmp(Keyword,'block') | strcmp(Keyword,'blocksize') + if isstr(Value) + fprintf('runica(): block size value must be a number') + return + end + block = floor(Value); + if ~block, + block = DEFAULT_BLOCK; + end + elseif strcmp(Keyword,'stop') | strcmp(Keyword,'nochange') ... + | strcmp(Keyword,'stopping') + if isstr(Value) + fprintf('runica(): stop wchange value must be a number') + return + end + nochange = Value; + elseif strcmp(Keyword,'maxsteps') | strcmp(Keyword,'steps') + if isstr(Value) + fprintf('runica(): maxsteps value must be an integer') + return + end + maxsteps = Value; + if ~maxsteps, + maxsteps = DEFAULT_MAXSTEPS; + end + if maxsteps < 0 + fprintf('runica(): maxsteps value (%d) must be a positive integer',maxsteps) + return + end + elseif strcmp(Keyword,'anneal') | strcmp(Keyword,'annealstep') + if isstr(Value) + fprintf('runica(): anneal step value (%2.4f) must be a number (0,1)',Value) + return + end + annealstep = Value; + if annealstep <=0 | annealstep > 1, + fprintf('runica(): anneal step value (%2.4f) must be (0,1]',annealstep) + return + end + elseif strcmp(Keyword,'annealdeg') | strcmp(Keyword,'degrees') + if isstr(Value) + fprintf('runica(): annealdeg value must be a number') + return + end + annealdeg = Value; + if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG; + elseif annealdeg > 180 | annealdeg < 0 + fprintf('runica(): annealdeg (%3.1f) is out of bounds [0,180]',... + annealdeg); + return + + end + elseif strcmp(Keyword,'momentum') + if isstr(Value) + fprintf('runica(): momentum value must be a number') + return + end + momentum = Value; + if momentum > 1.0 | momentum < 0 + fprintf('runica(): momentum value is out of bounds [0,1]') + return + end + elseif strcmp(Keyword,'sphering') | strcmp(Keyword,'sphereing') ... + | strcmp(Keyword,'sphere') + if ~isstr(Value) + fprintf('runica(): sphering value must be on, off, or none') + return + else + Value = lower(Value); + if ~strcmp(Value,'on') & ~strcmp(Value,'off') & ~strcmp(Value,'none'), + fprintf('runica(): sphering value must be on or off') + return + end + sphering = Value; + end + elseif strcmp(Keyword,'bias') + if ~isstr(Value) + fprintf('runica(): bias value must be on or off') + return + else + Value = lower(Value); + if strcmp(Value,'on') + biasflag = 1; + elseif strcmp(Value,'off'), + biasflag = 0; + else + fprintf('runica(): bias value must be on or off') + return + end + end + elseif strcmp(Keyword,'specgram') | strcmp(Keyword,'spec') + + if ~exist('specgram') < 2 % if ~exist or defined workspace variable + fprintf(... + 'runica(): MATLAB Sig. Proc. Toolbox function "specgram" not found.\n') + return + end + if isstr(Value) + fprintf('runica(): specgram argument must be a vector') + return + end + srate = Value(1); + if (srate < 0) + fprintf('runica(): specgram srate (%4.1f) must be >=0',srate) + return + end + if length(Value)>1 + loHz = Value(2); + if (loHz < 0 | loHz > srate/2) + fprintf('runica(): specgram loHz must be >=0 and <= srate/2 (%4.1f)',srate/2) + return + end + else + loHz = 0; % default + end + if length(Value)>2 + hiHz = Value(3); + if (hiHz < loHz | hiHz > srate/2) + fprintf('runica(): specgram hiHz must be >=loHz (%4.1f) and <= srate/2 (%4.1f)',loHz,srate/2) + return + end + else + hiHz = srate/2; % default + end + if length(Value)>3 + Hzframes = Value(5); + if (Hzframes<0 | Hzframes > size(data,2)) + fprintf('runica(): specgram frames must be >=0 and <= data length (%d)',size(data,2)) + return + end + else + Hzframes = size(data,2); % default + end + if length(Value)>4 + Hzwinlen = Value(4); + if rem(Hzframes,Hzwinlen) % if winlen doesn't divide frames + fprintf('runica(): specgram Hzinc must divide frames (%d)',Hzframes) + return + end + else + Hzwinlen = Hzframes; % default + end + Specgramflag = 1; % set flag to perform specgram() + + elseif strcmp(Keyword,'extended') | strcmp(Keyword,'extend') + if isstr(Value) + fprintf('runica(): extended value must be an integer (+/-)') + return + else + extended = 1; % turn on extended-ICA + extblocks = fix(Value); % number of blocks per kurt() compute + if extblocks < 0 + nsub = -1*fix(extblocks); % fix this many sub-Gauss comps + elseif ~extblocks, + extended = 0; % turn extended-ICA off + elseif kurtsize>frames, % length of kurtosis calculation + kurtsize = frames; + if kurtsize < MIN_KURTSIZE + fprintf(... + 'runica() warning: kurtosis values inexact for << %d points.\n',... + MIN_KURTSIZE); + end + end + end + elseif strcmp(Keyword,'verbose') + if ~isstr(Value) + fprintf('runica(): verbose flag value must be on or off') + return + elseif strcmp(Value,'on'), + verbose = 1; + elseif strcmp(Value,'off'), + verbose = 0; + else + fprintf('runica(): verbose flag value must be on or off') + return + end + else + fprintf('runica(): unknown flag') + return + end +end + +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize weights, etc. %%%%%%%%%%%%%%%%%%%%%%%% +% +if ~annealstep, + if ~extended, + annealstep = DEFAULT_ANNEALSTEP; % defaults defined above + else + annealstep = DEFAULT_EXTANNEAL; % defaults defined above + end +end % else use annealstep from commandline + +if ~annealdeg, + annealdeg = DEFAULT_ANNEALDEG - momentum*90; % heuristic + if annealdeg < 0, + annealdeg = 0; + end +end +if ncomps > chans | ncomps < 1 + fprintf('runica(): number of components must be 1 to %d.\n',chans); + return +end + +if weights ~= 0, % initialize weights + % starting weights are being passed to runica() from the commandline + if verbose, + fprintf('Using starting weight matrix named in argument list ...\n') + end + if chans>ncomps & weights ~=0, + [r,c]=size(weights); + if r~=ncomps | c~=chans, + fprintf(... + 'runica(): weight matrix must have %d rows, %d columns.\n', ... + chans,ncomps); + return; + end + end +end; +% +%%%%%%%%%%%%%%%%%%%%% Check keyword values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if frames frames, + fprintf('runica(): block size exceeds data length!\n'); + return +elseif floor(epochs) ~= epochs, + fprintf('runica(): data length is not a multiple of the epoch length!\n'); + return +elseif nsub > ncomps + fprintf('runica(): there can be at most %d sub-Gaussian components!\n',ncomps); + return +end; + +% +% adjust nochange if necessary +% +if isnan(nochange) + if ncomps > 32 + nochange = 1E-7; + nochangeupdated = 1; % for fprinting purposes + else + nochangeupdated = 1; % for fprinting purposes + nochange = DEFAULT_STOP; + end; +else + nochangeupdated = 0; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Process the data %%%%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf( ... + '\nInput data size [%d,%d] = %d channels, %d frames/n', ... + chans,frames,chans,frames); + if strcmp(pcaflag,'on') + fprintf('After PCA dimension reduction,\n finding '); + else + fprintf('Finding '); + end + if ~extended + fprintf('%d ICA components using logistic ICA.\n',ncomps); + else % if extended + fprintf('%d ICA components using extended ICA.\n',ncomps); + if extblocks > 0 + fprintf(... + 'Kurtosis will be calculated initially every %d blocks using %d data points.\n',... + extblocks, kurtsize); + else + fprintf(... + 'Kurtosis will not be calculated. Exactly %d sub-Gaussian components assumed.\n',... + nsub); + end + end + fprintf('Decomposing %d frames per ICA weight ((%d)^2 = %d weights, %d frames)\n',... + floor(frames/ncomps.^2),ncomps.^2,frames); + fprintf('Initial learning rate will be %g, block size %d.\n',... + lrate,block); + if momentum>0, + fprintf('Momentum will be %g.\n',momentum); + end + fprintf( ... + 'Learning rate will be multiplied by %g whenever angledelta >= %g deg.\n', ... + annealstep,annealdeg); + + if nochangeupdated + fprintf('More than 32 channels: default stopping weight change 1E-7\n'); + end; + fprintf('Training will end when wchange < %g or after %d steps.\n', ... + nochange,maxsteps); + if biasflag, + fprintf('Online bias adjustment will be used.\n'); + else + fprintf('Online bias adjustment will not be used.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%%% Remove overall row means %%%%%%%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Removing mean of each channel ...\n'); +end +data = data - mean(data')'*ones(1,frames); % subtract row means + +if verbose, + fprintf('Final training data range: %g to %g\n', ... + min(min(data)),max(max(data))); +end +% +%%%%%%%%%%%%%%%%%%% Perform PCA reduction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + fprintf('Reducing the data to %d principal dimensions...\n',ncomps); + [eigenvectors,eigenvalues,data] = pcsquash(data,ncomps); + % make data its projection onto the ncomps-dim principal subspace +end +% +%%%%%%%%%%%%%%%%%%% Perform specgram transformation %%%%%%%%%%%%%%%%%%%%%%% +% +if exist('Specgramflag') == 1 + % [P F T] = SPECGRAM(A,NFFT,Fs,WINDOW,NOVERLAP) % MATLAB Sig Proc Toolbox + % Hzwinlen = fix(srate/Hzinc); % CHANGED FROM THIS 12/18/00 -sm + + Hzfftlen = 2^(ceil(log(Hzwinlen)/log(2))); % make FFT length next higher 2^k + Hzoverlap = 0; % use sequential windows + % + % Get freqs and times from 1st channel analysis + % + [tmp,freqs,tms] = specgram(data(1,:),Hzfftlen,srate,Hzwinlen,Hzoverlap); + + fs = find(freqs>=loHz & freqs <= hiHz); + if isempty(fs) + fprintf('runica(): specified frequency range too narrow!\n'); + return + end; + + specdata = reshape(tmp(fs,:),1,length(fs)*size(tmp,2)); + specdata = [real(specdata) imag(specdata)]; + % fprintf(' size(fs) = %d,%d\n',size(fs,1),size(fs,2)); + % fprintf(' size(tmp) = %d,%d\n',size(tmp,1),size(tmp,2)); + % + % Loop through remaining channels + % + for ch=2:chans + [tmp] = specgram(data(ch,:),Hzwinlen,srate,Hzwinlen,Hzoverlap); + tmp = reshape((tmp(fs,:)),1,length(fs)*size(tmp,2)); + specdata = [specdata;[real(tmp) imag(tmp)]]; % channels are rows + end + % + % Print specgram confirmation and details + % + fprintf(... + 'Converted data to %d channels by %d=2*%dx%d points spectrogram data.\n',... + chans,2*length(fs)*length(tms),length(fs),length(tms)); + if length(fs) > 1 + fprintf(... + ' Low Hz %g, high Hz %g, Hz incr %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),freqs(fs(2))-freqs(fs(1)),Hzwinlen); + else + fprintf(... + ' Low Hz %g, high Hz %g, window length %d\n',freqs(fs(1)),freqs(fs(end)),Hzwinlen); + end + % + % Replace data with specdata + % + data = specdata; + datalength=size(data,2); +end +% +%%%%%%%%%%%%%%%%%%% Perform sphering %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if strcmp(sphering,'on'), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if verbose, + fprintf('Computing the sphering matrix...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + if ~weights, + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights given on commandline + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + end + end + if verbose, + fprintf('Sphering the data ...\n'); + end + data = sphere*data; % actually decorrelate the electrode signals + +elseif strcmp(sphering,'off') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~weights + if verbose, + fprintf('Using the sphering matrix as the starting weight matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = 2.0*inv(sqrtm(cov(data'))); % find the "sphering" matrix = spher() + weights = eye(ncomps,chans)*sphere; % begin with the identity matrix + sphere = eye(chans); % return the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + sphere = eye(chans); % return the identity matrix + end +elseif strcmp(sphering,'none') + sphere = eye(chans); % return the identity matrix + if ~weights + if verbose, + fprintf('Starting weights are the identity matrix ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + weights = eye(ncomps,chans); % begin with the identity matrix + else % weights ~= 0 + if verbose, + fprintf('Using starting weights named on commandline ...\n'); + fprintf('Returning the identity matrix in variable "sphere" ...\n'); + end + end + sphere = eye(chans,chans); + if verbose, + fprintf('Returned variable "sphere" will be the identity matrix.\n'); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%% Initialize ICA training %%%%%%%%%%%%%%%%%%%%%%%%% +% +lastt=fix((datalength/block-1)*block+1); +BI=block*eye(ncomps,ncomps); +delta=zeros(1,chans*ncomps); +changes = []; +degconst = 180./pi; +startweights = weights; +prevweights = startweights; +oldweights = startweights; +prevwtchange = zeros(chans,ncomps); +oldwtchange = zeros(chans,ncomps); +lrates = zeros(1,maxsteps); +onesrow = ones(1,block); +bias = zeros(ncomps,1); +signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 +for k=1:nsub + signs(k) = -1; +end +if extended & extblocks < 0 & verbose, + fprintf('Fixed extended-ICA sign assignments: '); + for k=1:ncomps + fprintf('%d ',signs(k)); + end; fprintf('\n'); +end +signs = diag(signs); % make a diagonal matrix +oldsigns = zeros(size(signs));; +signcount = 0; % counter for same-signs +signcounts = []; +urextblocks = extblocks; % original value, for resets +old_kk = zeros(1,ncomps); % for kurtosis momemtum +% +%%%%%%%% ICA training loop using the logistic sigmoid %%%%%%%%%%%%%%%%%%% +% +if verbose, + fprintf('Beginning ICA training ...'); + if extended, + fprintf(' first training step may be slow ...\n'); + else + fprintf('\n'); + end +end +step=0; +laststep=0; +blockno = 1; % running block counter for kurtosis interrupts +logstep = 1; % iterator over log likelihood record +rand('state',sum(100*clock)); % set the random number generator state to +cost_step = 1; % record cost every cost_step iterations +% a position dependent on the system clock +while step < maxsteps, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + permute=randperm(datalength); % shuffle data order at each step + loglik(logstep) = 0; + for t=1:block:lastt, %%%%%%%%% ICA Training Block %%%%%%%%%%%%%%%%%%% + pause(0); + if ~isempty(get(0, 'currentfigure')) & strcmp(get(gcf, 'tag'), 'stop') + close; error('USER ABORT'); + end; + if biasflag + u=weights*data(:,permute(t:t+block-1)) + bias*onesrow; + else + u=weights*data(:,permute(t:t+block-1)); + end + if ~extended + %%%%%%%%%%%%%%%%%%% Logistic ICA weight update %%%%%%%%%%%%%%%%%%% + y=1./(1+exp(-u)); % + weights = weights + lrate*(BI+(1-2*y)*u')*weights; % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % Tanh extended-ICA weight update + %%%%%%%%%%%%%%%%%%% Extended-ICA weight update %%%%%%%%%%%%%%%%%%% + y=tanh(u); % + weights = weights + lrate*(BI-signs*y*u'-u*u')*weights; % + + %%%%%%%%% Calculate log likelihood given our model %%%%%%%%% + if mod(step,cost_step) == 0 + subgcomp = find(diag(signs) == -1); + supergcomp = find(diag(signs) == 1); + loglik(logstep) = loglik(logstep) + sum(sum(log(exp(-(1/2)*(u(subgcomp,:)-1).^2) + exp(-(1/2)*(u(subgcomp,:)+1).^2)))); + loglik(logstep) = loglik(logstep) + sum(sum(-0.5*u(supergcomp,:).^2 - 2*log(cosh(u(supergcomp,:))))); + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + if biasflag + if ~extended + %%%%%%%%%%%%%%%%%%%%%%%% Logistic ICA bias %%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((1-2*y)')'; % for logistic nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + else % extended + %%%%%%%%%%%%%%%%%%% Extended-ICA bias %%%%%%%%%%%%%%%%%%%%%%%%%%%% + bias = bias + lrate*sum((-2*y)')'; % for tanh() nonlin. % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end + end + + if momentum > 0 %%%%%%%%% Add momentum %%%%%%%%%%%%%%%%%%%%%%%%%%%% + weights = weights + momentum*prevwtchange; + prevwtchange = weights-prevweights; + prevweights = weights; + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if max(max(abs(weights))) > MAX_WEIGHT + wts_blowup = 1; + change = nochange; + end + if extended & ~wts_blowup + % + %%%%%%%%%%% Extended-ICA kurtosis estimation %%%%%%%%%%%%%%%%%%%%% + % + if extblocks > 0 & rem(blockno,extblocks) == 0, + % recompute signs vector using kurtosis + if kurtsize < frames % 12-22-99 rand() size suggestion by M. Spratling + rp = fix(rand(1,kurtsize)*datalength); % pick random subset + % Accout for the possibility of a 0 generation by rand + ou = find(rp == 0); + while ~isempty(ou) % 1-11-00 suggestion by J. Foucher + rp(ou) = fix(rand(1,length(ou))*datalength); + ou = find(rp == 0); + end + partact=weights*data(:,rp(1:kurtsize)); + else % for small data sets, + partact=weights*data; % use whole data + end + m2=mean(partact'.^2).^2; + m4= mean(partact'.^4); + kk= (m4./m2)-3.0; % kurtosis estimates + if extmomentum + kk = extmomentum*old_kk + (1.0-extmomentum)*kk; % use momentum + old_kk = kk; + end + signs=diag(sign(kk+signsbias)); % pick component signs + if signs == oldsigns, + signcount = signcount+1; + else + signcount = 0; + end + oldsigns = signs; + signcounts = [signcounts signcount]; + if signcount >= SIGNCOUNT_THRESHOLD, + extblocks = fix(extblocks * SIGNCOUNT_STEP);% make kurt() estimation + signcount = 0; % less frequent if sign + end % is not changing + end % extblocks > 0 & . . . + end % if extended %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + blockno = blockno + 1; + if wts_blowup + break + end + + end % training block %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + loglik(logstep) = loglik(logstep) + log(abs(det(weights))); + logstep = logstep + 1; + + if ~wts_blowup + oldwtchange = weights-oldweights; + step=step+1; + % + %%%%%%% Compute and print weight and update angle changes %%%%%%%%% + % + lrates(1,step) = lrate; + angledelta=0.; + delta=reshape(oldwtchange,1,chans*ncomps); + change=delta*delta'; + end + % + %%%%%%%%%%%%%%%%%%%%%% Restart if weights blow up %%%%%%%%%%%%%%%%%%%% + % + if wts_blowup | isnan(change)|isinf(change), % if weights blow up, + fprintf(''); + step = 0; % start again + change = nochange; + wts_blowup = 0; % re-initialize variables + blockno = 1; + lrate = lrate*DEFAULT_RESTART_FAC; % with lower learning rate + weights = startweights; % and original weight matrix + oldweights = startweights; + change = nochange; + oldwtchange = zeros(chans,ncomps); + delta=zeros(1,chans*ncomps); + olddelta = delta; + extblocks = urextblocks; + prevweights = startweights; + prevwtchange = zeros(chans,ncomps); + lrates = zeros(1,maxsteps); + bias = zeros(ncomps,1); + if extended + signs = ones(1,ncomps); % initialize signs to nsub -1, rest +1 + for k=1:nsub + signs(k) = -1; + end + signs = diag(signs); % make a diagonal matrix + oldsigns = zeros(size(signs));; + end + if lrate> MIN_LRATE + r = rank(data); + if r 2 + angledelta=acos((delta*olddelta')/sqrt(change*oldchange)); + end + if verbose, + places = -floor(log10(nochange)); + if step > 2, + if ~extended, + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df, angledelta %4.1f deg\n', ... + step, lrate, places+1,places, degconst*angledelta); + else + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df, angledelta %4.1f deg, %d subgauss\n',... + step, lrate, degconst*angledelta,... + places+1,places, (ncomps-sum(diag(signs)))/2); + end + elseif ~extended + ps = sprintf('step %d - lrate %5f, wchange %%%d.%df\n',... + step, lrate, places+1,places ); + else + ps = sprintf('step %5d - lrate %5f, wchange %%%d.%df, %d subgauss\n',... + step, lrate, places+1,places, (ncomps-sum(diag(signs)))/2); + end % step > 2 + fprintf('step %d - lrate %5f, wchange %8.8f, angledelta %5.1f deg, loglik %6.2f, nsub = %d\n', ... + step, lrate, change, degconst*angledelta, loglik(step), sum(diag(signs)==-1)); + % fprintf(ps,change); % <---- BUG !!!! + end; % if verbose + % + %%%%%%%%%%%%%%%%%%%% Save current values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + changes = [changes change]; + oldweights = weights; + % + %%%%%%%%%%%%%%%%%%%% Anneal learning rate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if degconst*angledelta > annealdeg, + lrate = lrate*annealstep; % anneal learning rate + olddelta = delta; % accumulate angledelta until + oldchange = change; % annealdeg is reached + elseif step == 1 % on first step only + olddelta = delta; % initialize + oldchange = change; + end + % + %%%%%%%%%%%%%%%%%%%% Apply stopping rule %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if step >2 & change < nochange, % apply stopping rule + laststep=step; + step=maxsteps; % stop when weights stabilize + elseif change > DEFAULT_BLOWUP, % if weights blow up, + lrate=lrate*DEFAULT_BLOWUP_FAC; % keep trying + end; % with a smaller learning rate + end; % end if weights in bounds + +end; % end training %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if ~laststep + laststep = step; +end; +lrates = lrates(1,1:laststep); % truncate lrate history vector +% +%%%%%%%%%%%%%% Orient components towards max positive activation %%%%%% +% +if strcmp(posactflag,'on') + [activations,winvout,weights] = posact(data,weights); + % changes signs of activations and weights to make activations + % net rms-positive +else + activations = weights*data; +end +% +%%%%%%%%%%%%%% If pcaflag, compose PCA and ICA matrices %%%%%%%%%%%%%%% +% +if strcmp(pcaflag,'on') + fprintf('Composing the eigenvector, weights, and sphere matrices\n'); + fprintf(' into a single rectangular weights matrix; sphere=eye(%d)\n'... + ,chans); + weights= weights*sphere*eigenvectors(:,1:ncomps)'; + sphere = eye(urchans); +end +% +%%%%%% Sort components in descending order of max projected variance %%%% +% +if verbose, + fprintf(... + 'Sorting components in descending order of mean projected variance ...\n'); +end +% +%%%%%%%%%%%%%%%%%%%% Find mean variances %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +meanvar = zeros(ncomps,1); % size of the projections +if ncomps == urchans % if weights are square . . . + winv = inv(weights*sphere); +else + fprintf('Using pseudo-inverse of weight matrix to rank order component projections.\n'); + winv = pinv(weights*sphere); +end +for s=1:ncomps + if verbose, + fprintf('%d ',s); % construct single-component data matrix + end + % project to scalp, then add row means + compproj = winv(:,s)*activations(s,:); + meanvar(s) = mean(sum(compproj.*compproj)/(size(compproj,1)-1)); + % compute mean variance +end % at all scalp channels +if verbose, + fprintf('\n'); +end +% +%%%%%%%%%%%%%% Sort components by mean variance %%%%%%%%%%%%%%%%%%%%%%%% +% +[sortvar, windex] = sort(meanvar); +windex = windex(ncomps:-1:1); % order large to small +meanvar = meanvar(windex); +% +%%%%%%%%%%%%%%%%%%%%% Filter data using final weights %%%%%%%%%%%%%%%%%% +% +if nargout>6, % if activations are to be returned + if verbose, + fprintf('Permuting the activation wave forms ...\n'); + end + activations = activations(windex,:); +else + clear activations +end +weights = weights(windex,:);% reorder the weight matrix +bias = bias(windex); % reorder them +signs = diag(signs); % vectorize the signs matrix +signs = signs(windex); % reorder them + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +return + +% +%%%%%%%%%%%%%%%%%% return nonlinearly-transformed data %%%%%%%%%%%%%%%% +% +if nargout > 7 + u=weights*data + bias*ones(1,frames); + y = zeros(size(u)); + for c=1:chans + for f=1:frames + y(c,f) = 1/(1+exp(-u(c,f))); + end + end +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/sbplot.m b/code/eeglab13_4_4b/functions/sigprocfunc/sbplot.m new file mode 100644 index 0000000..56feb37 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/sbplot.m @@ -0,0 +1,135 @@ +% sbplot() - create axes in arbitrary subplot grid positions and sizes +% +% Usage: >> axis_handle = sbplot(v,h,index) +% >> axis_handle = sbplot(v,h,[index1 index2]) +% >> axis_handle = sbplot(v,h,[index1 index2],axprop,..) +% >> axis_handle = sbplot(v,h,[index1 index2],'ax',handle,axprop,..) +% +% Inputs: +% v,h - Integers giving the vertical and horizontal ranks of the tiling. +% index - Either a single subplot index, in which case the command +% is equivalent to subplot, or a two-element vector giving +% the indices of two corners of the sbplot() area according +% to subplot() convention (e.g., left-to-right, top-to-bottom). +% axprop - Any axes property(s), e.g., >> sbplot(3,3,3,'color','w') +% handle - Following keyword 'ax', sbplot tiles the given axes handle +% instead of the whole figure +% +% Output: +% axis_handle - matlab axis handle +% +% Note: +% sbplot is essentially the same as the subplot command except that +% sbplot axes may span multiple tiles. Also, sbplot() will not erase +% underlying axes. +% +% Examples: >> sbplot(3,3,6);plot(rand(1,10),'g'); +% >> sbplot(3,3,[7 2]);plot(rand(1,10),'r'); +% >> sbplot(8,7,47);plot(rand(1,10),'b'); +% +% Authors: Colin Humphries, Arnaud Delorme & Scott Makeig, SCCN/INC/UCSD, La Jolla, June, 1998 + +% Copyright (C) June 1998, Colin Humphries & Scott Makeig, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% reformatted by Scott Makeig, 6/10/98 +% 12/22/00 test nargin<3 -sm +% 01/21/01 added (recursive) axes option 'ax' -sm +% 01-25-02 reformated help & licence -ad + +function [out] = sbplot(m,n,gridpos,varargin) % varargin is std. matlab arg list + +if nargin<3 + error(' requires >=3 arguments'); +end + +if nargin>3 & strcmp(varargin{1},'ax') + pos = get(varargin{2},'Position'); % sbplot(3,1,[2 3]) -> 0.4111 0.1100 0.4939 0.815 + varargin = {varargin{3:end}}; +else + pos = get(gcf,'DefaultAxesPosition'); % [0.1300 0.1100 0.7750 0.815] +end + +Xpad = pos(1); % lower-left distance from left side of figure +Ypad = pos(2); % lower-left distance from bottom of figure + +Xlen = pos(3); % axes width +Ylen = pos(4); % axes height + +if n == 2 + xspace = Xlen*0.27/(n-0.27); % xspace between axes as per subplot +else + xspace = (0.9*Xlen)*0.27/(n-0.9*0.27); +end + +if m == 2 + yspace = Ylen*0.27/(m-0.27); % yspace between axes as per subplot +else % WHY Xlen (.775) instead of Ylen (.815) ?? + yspace = (0.9*Ylen)*0.27/(m-0.9*0.27); +end + +xlength = (Xlen-xspace*(n-1))/n; % axes width +ylength = (Ylen-yspace*(m-1))/m; % axes height + +% Convert tile indices to grid positions +if length(gridpos) == 1 + xgridpos(1) = mod(gridpos,n); % grid position + if xgridpos(1) == 0 + xgridpos(1) = n; + end + xgridpos(2) = 1; % grid length + ygridpos(1) = m-ceil(gridpos/n)+1; % grid position + ygridpos(2) = 1; % grid length +else + xgridpos(1) = mod(gridpos(1),n); + if xgridpos(1) == 0 + xgridpos(1) = n; + end + tmp = mod(gridpos(2),n); + if tmp == 0 + tmp = n; + end + if tmp > xgridpos(1) + xgridpos(2) = tmp-xgridpos(1)+1; + else + xgridpos(2) = xgridpos(1)-tmp+1; + xgridpos(1) = tmp; + end + + ygridpos(1) = m-ceil(gridpos(1)/n)+1; + tmp = m-ceil(gridpos(2)/n)+1; + if tmp > ygridpos(1) + ygridpos(2) = tmp-ygridpos(1)+1; + else + ygridpos(2) = ygridpos(1)-tmp+1; + ygridpos(1) = tmp; + end +end + +% Calculate axes coordinates +position(1) = Xpad+xspace*(xgridpos(1)-1)+xlength*(xgridpos(1)-1); +position(2) = Ypad+yspace*(ygridpos(1)-1)+ylength*(ygridpos(1)-1)-0.03; +position(3) = xspace*(xgridpos(2)-1)+xlength*xgridpos(2); +position(4) = yspace*(ygridpos(2)-1)+ylength*ygridpos(2); + +% Create new axes +ax = axes('Position',position,varargin{:}); + +% Output axes handle +if nargout > 0 + out = ax; +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/shuffle.m b/code/eeglab13_4_4b/functions/sigprocfunc/shuffle.m new file mode 100644 index 0000000..188710b --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/shuffle.m @@ -0,0 +1,68 @@ +% shuffle() - shuffle a given dimension in an array +% +% Usage: >> Y = shuffle(X) +% >> [Y = shuffle(X, DIM) +% +% Inputs: +% X - input array +% DIM - dimension index (default is firt non-singleton dimention) +% +% Outputs: +% Y - shuffled array +% I - forward indices (Y = X(I) if 1D) +% J - reverse indices (X(J) = Y if 1D) +% +% Author: Arnaud Delorme, SCCN/INC/UCSD USA, Dec 2000 + +% Copyright (C) Arnaud Delorme, SCCN/INC/UCSD USA, Dec 2000 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [x, i, j]=shuffle( y, dim) + +if nargin < 1 + help shuffle; + return; +end; +if nargin < 2 + if size(y,1) ~= 1 + dim = 1; + else + if size(y,2) ~= 1 + dim = 2; + else + dim = 3; + end; + end; +end; + +r =size(y, dim); +a = rand(1,r); +[tmp i] = sort(a); +switch dim + case 1 + x = y(i,:,:,:,:); + case 2 + x = y(:,i,:,:,:); + case 3 + x = y(:,:,i,:,:); + case 4 + x = y(:,:,:,i,:); + case 5 + x = y(:,:,:,:,i); +end; +[tmp j] = sort(i); % unshuffle + +return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/signalstat.m b/code/eeglab13_4_4b/functions/sigprocfunc/signalstat.m new file mode 100644 index 0000000..fdfe1dc --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/signalstat.m @@ -0,0 +1,456 @@ +% signalstat() - Computes and plots statistical characteristics of a signal, +% including the data histogram, a fitted normal distribution, +% a normal ditribution fitted on trimmed data, a boxplot, and +% the QQ-diagram. The estimates value are printed in a panel and +% can be read as output. Optionally, a topographic map (see TOPOPLOT) +% can be plotted. +% The boxplot and the Kolmogorov-Smirnov test require the +% MATLAB Statistics Toolbox. +% +% Usage: +% >> signalstat( data ) +% >> signalstat( data, plotlab, dlabel, percent ); +% >> [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh] = ... +% signalstat( data, plotlab, dlabel, percent, dlabel2, map, chan_locs ); +% +% Inputs: +% data - data vector +% +% Optional inputs: +% plotlab - 1: default->plot | 0: ->no plot +% dlabel - A label for the data ([]: default->'Potential [µV]') +% percent - percentage of data to exclude for trimmed mean & SD ([]:default->5) +% Excluded is 'percent'/2 high % and 'percent'/2 low % +% dlabel2 - A title label for the statistics table +% map - Data vector to be displayed as topographic map. If a single integer, +% only the corresponding electrode location is displayed +% chan_locs - name of an EEG electrode position file (See >> topoplot example for format). +% Can also be a structure (see >> help pop_editset) +% +% Outputs: +% M,SD - mean and standard deviation +% sk,k - skewness and excess kurtosis +% med - median +% zlow,zhi - low and high 'percent/2'-Percentile ('percent/2'/100-Quantile) +% tM,tSD - trimmed mean and SD, removing datazhigh +% tndx - index of the data retained after trimming +% ksh - output flag of the Kolmogorov-Smirnov test at level p=0.05 +% 0: data could be normally distributed; 1: data are not normally distributed +% -1: test could not be executed +% +% Author: Luca Finelli, CNL / Salk Institute - SCCN, 2 August 2002 +% +% See also: +% pop_signalstat(), qqdiagram(), eeglab() + +% Copyright (C) 2002 Luca Finelli, Salk/SCCN, La Jolla, CA + +% Note: +% QQDIAGRAM IS EQUIVALENT TO PERCENTILE/PERCENTILE PLOT +% X = EEG.data(5,:); % data +% Y = randn(1, 1000); % gaussan random distribution +% figure; qqdiagram(X, Y, 2); +% figure; plot(prctile(X,2), prctile(Y,2)); + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [M,SD,sk,k,med,zlow,zhi,tM,tSD,tndx,ksh] = signalstat( data, plotlab, dlabel, percent, dlabel2, map, chan_locs); + +M=[]; SD=[]; sk=[]; k=[]; med=[]; zlow=[]; zhi=[]; tM=[]; tSD=[]; tndx=[]; ksh=[]; + +istats=1; +hs = help('stats'); +if isempty(hs) | ~strcmp(hs(3:20),'Statistics Toolbox') + disp('signalstat() note: the boxplot (not shown) requires the MATLAB Statistics Toolbox'); + istats=0; +end + +if (nargin<8 & nargin>5) & min(size(map))~=1 + error('signalstat(): the map input must be a vector') +end + +if nargin<7 & nargin>5 + disp('signalstat(): no location file for the topographic map') + help signalstat; + return +end + +if nargin < 6 + map = []; +end + +if nargin < 5 + dlabel2 = ''; +end + +if nargin>3 + if isempty(percent) + percent=5; + end + if any(percent > 100) | any(percent < 0) + error('signalstat(): percent must be between 0 and 100'); + end +end + +if nargin < 4 + percent = 5; +end + +if (nargin < 3 | isempty(dlabel)) + dlabel='Potential [µV]'; +end + +if nargin < 2 + plotlab=1; +end; + +if ~isnumeric(plotlab) + error('signalstat(): plotlab must be numeric'); +end; + +if plotlab ~= 0 & plotlab ~= 1 + error('signalstat(): plotlab must be 0 or 1'); +end; +if nargin < 1 + help signalstat; + return; +end; + +if ndims(data)>2 + error('signalstat(): data must be a vector (1-dim signal)') +end + +if ~isreal(data) + error('signalstat(): data cannot be complex') +end + +fprintf('signalstat(): computing statistics...\n'); + +% Statistical characteristics +%---------------------------- +pnts=length(data); % number of data points +rg=max(data)-min(data); + +M=mean(data); % mean +med=median(data); % median + +vr=var(data); % variance (N-1 normalized) +SD=std(data); % standard deviation + +if istats + sk=skewness(data,0); % skewness (third central moment divided by + % the cube of the standard deviation) + k=kurtosis(data,0)-3; % kurtosis (fourth central moment divided by + % fourth power of the standard deviation) +else + sk=NaN; + k=kurt(data)-3; +end + +% Checks on skewness and kurtosis +%-------------------------------- +sklab='Distribution is symmetric'; +if sk>0.01 + sklab='Distribution is right-skewed'; +elseif sk < -0.01 + sklab='Distribution is left-skewed'; +end + +klab=''; +if k>0.01 + klab='Distribution is super-Gaussian'; % i.e. kurtosis bigger then Gaussian +elseif k < -0.01 + klab='Distribution is sub-Gaussian'; +end + +% Estimates without the highest and lowest 'percent'/2 % of data +%--------------------------------------------------------------- +pc=percent/100; + +zlow = quantile(data,(pc / 2)); % low quantile +zhi = quantile(data,1 - pc / 2); % high quantile +tndx = find((data >= zlow & data <= zhi & ~isnan(data))); + +tM=mean(data(tndx)); % mean with excluded pc/2*100% of highest and lowest values +tSD=std(data(tndx)); % trimmed SD + +% Selected central tendency estimator +%------------------------------------ +cte=M; + +% Normal fit +%----------- +if istats + alpha=0.05; % 1-alpha confidence interval + [muhat,sigmahat,muci,sigmaci] = normfit(data,alpha); +end + +nbins=max(50,round(pnts/100)); +[nel,binpos]=hist(data,nbins); +dx=binpos(2)-binpos(1); % bin width + +datafit=normpdf(binpos,cte,SD); % estimated pdf +datafit=datafit*pnts*dx; + +tdatafit=normpdf(binpos,cte,tSD); % estimated pdf with trimmed SD +tdatafit=tdatafit*pnts*dx; + +%datarnd=normrnd(cte,sigmahat,1,pnts); % synthetic data + +if istats + % Goodness-of-fit hypothesis test + %-------------------------------- + kstail = 0; % 0 = 2-sided test + + CDF=normcdf(data,cte,sigmahat); % estimated cdf + + [ksh,ksp,ksstat,kscv] = kstest(data,[data', CDF'],alpha,kstail); % Kolmogorov-Smirnov test + + kstestlab='Kolmogorov-Smirnov test: verified Gaussian'; + kscol=[0.2 1 0.2]; + if ksh + kstestlab='Kolmogorov-Smirnov test: not Gaussian'; + kscol=[.7 .3 .3]; + end +end + +% Graphics +%------------------------------------- + +if plotlab + figure + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + COLOR = [0.56 .66 .9]; + set(gcf,'NumberTitle','off','Name','Signal statistics -- signalstat()') + fwidth=800; % figure size in pixels + fheight=600; + + funits=get(0,'Units'); + set(0,'Units','Pixel') + scnsize=get(0,'ScreenSize'); + fpos=[round((scnsize(3)-fwidth)/2),round((scnsize(4)-fheight)/2),fwidth,fheight]; + set(0,'Units',funits) + + set(gcf,'Position',fpos) + + % Plotting the histogram + %------------------------ + subplot(2,2,1) + + hist(data,nbins); % 'XLim',[-125 125] + uapos = get(gca,'Position'); + xlim = get(gca,'XLim'); + set(gca,'FontSize',14) + xlabel(dlabel) + title('Data Histogram and Fitted Normal PDF') + + % HM=pnts*normpdf(M,muhat,sigmahat)/2; % FWHM height + % plot([cte-sd cte+sd],[HM HM],'r--','LineWidth',2) + + % Overplotting a normal distribution + %----------------------------------- + hold on + h1=plot(binpos,datafit,'c','LineWidth',2); + set(gca,'XLim',xlim) + + % Overplotting a normal distribution from trimmed SD + %--------------------------------------------------- + h2=plot(binpos,tdatafit,'y'); + ymin=get(gca,'YLim'); + plot([zlow zlow],[0 ymin(2)/20],'y','LineWidth',2) % low percentile + plot([zhi zhi], [0 ymin(2)/20],'y','LineWidth',2) % high percentile + set(gca,'XLim',xlim) + + % Overplotting a mean and zero line + %---------------------------------- + % xmin=get(gca,'XLim'); + % ymin=get(gca,'YLim'); + plot([0 0],ymin,'k') + h3=plot([cte cte],ymin,'r--','LineWidth',2); + set(gca,'Color',COLOR,'XMinorTick','on','XLim',xlim) + + if istats + set(gca,'XTick',[]) + elseif ~istats & strcmp(dlabel,'Potential [µV]') + set(gca,'XTick',[-125, -75, -25, 0, 25, 75, 125],... + 'XTickLabel',['-125' ; ' -75' ; ' -25' ; ' 0 ' ; ' 25 ' ; ' 75 ' ; ' 125']) + end + + if strcmp(dlabel,'Potential [µV]') + set(gca,'XLim',[-125 125]) + end + + set(gca,'FontSize',10) + H=[h1 h2 h3]; + legend(H,'Gaussian fit','Trimmed G.fit','Mean') + legend boxoff + + zoom off + + % Boxplot + %-------------------- + if istats + subplot(2,2,3) + + boxplot(data,1,'+',0,1.5) + lapos=get(gca,'Position'); + set(gca,'Position', [uapos(1) uapos(2)-uapos(4)/3 uapos(3) uapos(4)/3]) + nlapos=get(gca,'Position'); + hold on + ymin2=get(gca,'YLim'); + plot([0 0],[0 ymin2(2)],'k') + plot([cte cte],[0 ymin(2)],'r--','LineWidth',2) + set(gca,'FontSize',14,'XMinorTick','on') + set(gca,'XLim',xlim) + + if strcmp(dlabel,'Potential [µV]') + set(gca,'XTick',[-125 -75 -25 0 25 75 125],... + 'XTickLabel',['-125' ; ' -75' ; ' -25' ; ' 0 ' ; ' 25 ' ; ' 75 ' ; ' 125'],... + 'XLim',[-125 125]) + end + + xlabel(dlabel) + ylabel('') + zoom off + end + + % QQ plot + %-------- + subplot(2,2,2) + + qqdiagram(data) + apos=get(gca,'Position'); + set(gca,'Position', [1-uapos(1)-uapos(3) uapos(2)-uapos(4)/3 (uapos(3)) (uapos(4)+uapos(4)/3)]) + set(gca,'XTick',[-4 -2 0 2 4]) + xmin=get(gca,'XLim'); + ymin=get(gca,'YLim'); + hold on + plot([xmin(1) xmin(1)+diff(xmin)/20],[zlow zlow],'y-','LineWidth',2) + plot([xmin(1) xmin(1)+diff(xmin)/20],[zhi zhi] ,'y-','LineWidth',2) + set(gca,'XLim',xmin); + %plot([0 0],ymin,'k--') + set(gca,'FontSize',14) + xlabel('Standard Normal Quantiles [Std.Dev.]') + if strcmp(dlabel,'Potential [µV]') + ylabel('Ordered Observations [µV]') + elseif strcmp(dlabel,'Component Activity') + ylabel('Ordered Observations [rel. µV]') + else + ylabel('Ordered Observations') + end + + title('QQ Plot (Data vs Standard Normal)') + set(gca,'Color',COLOR) + + % TOPO plot + %--------- + if (~isempty(map)) + sbplot(7,9,6) + % th=axes('Position',[]); + % subplot('Position',[.10 .86 .20 .14]); + fprintf('signalstat(): plotting a topographic map...\n'); + if length(map) == 1 + topoplot(map,chan_locs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10); + else + topoplot(map,chan_locs,'electrodes','off'); + end; + axis('square') + end + + % Color schemes + %-------------- + nero = [0 0 0]; + bordeau = [0.7 0.3 0.3]; + rosso = [1 0 0]; + roschi1 = [1 .3 0.4]; + giallo1 = [1 .9 0]; + arancio = [1 .5 .3]; + verchi1 = [0.2 1 0.2]; + verchi2 = [0.7 1 0.7]; + verchi3 = [0.4 1 0.4]; + verscu1 = [0.1 0.7 0.2]; + bluchi1 = [0.4 0.9 1]; + bluchi2 = [.2 .5 .7]; + grichia = [.95 .95 .95]; + + % Data axis + %------------ + bgcolor=COLOR; + + dah = axes('Position',[uapos(1) .1 1-2*uapos(1) .25]); + set(dah,'Box','on','Color',bgcolor,'XTick',[],'YTick',[],'FontName','Courier','FontSize',12,'FontWeight','demi') + title(dlabel2,'FontWeight','bold','FontSize',14,'FontName','Arial'); + text(0.05,0.9,['Mean: ' num2str(M,3)] ,'Color',bordeau,'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.05,0.8,['Trimmed mean: ' num2str(tM,3)] ,'Color',giallo1,'FontName','Courier','FontSize',12,'FontWeight','demi') + + text(0.05,0.5,['Standard dev.: ' num2str(SD,4)] ,'Color',bordeau,'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.05,0.4,['Trimmed st.d.: ' num2str(tSD,4)],'Color',giallo1,'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.05,0.3,['Variance: ' num2str(vr,4)] ,'Color',giallo1,'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.05,0.2,['Range: ' num2str(rg,4)] ,'Color',giallo1,'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.05,0.1,['Data points: ' num2str(pnts)] ,'Color',bordeau,'FontName','Courier','FontSize',12,'FontWeight','demi') + + text(0.4,0.9,[num2str(percent/2/100,'%1.3f') '-quantile: ' num2str(zlow,3)] ,'Color',verchi2,... + 'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.4,0.8,['0.5 -quantile: ',num2str(med,3),' (median)'],'Color',verchi1,'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.4,0.7,[num2str((100-percent/2)/100,'%1.3f') '-quantile: ' num2str(zhi,3)] ,'Color',verchi2,... + 'FontName','Courier','FontSize',12,'FontWeight','demi') + + text(0.4,0.3,['Excess kurtosis: ' num2str(k, 3) ' (near 0 if Gaussian)'] ,'Color',verchi1,... + 'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.4,0.2,klab,'Color',verchi2,'FontName','Courier','FontSize',12,'FontWeight','demi') + + if istats + text(0.4,0.5,['Skewness: ' num2str(sk,3) ' (near 0 if Gaussian)'] ,'Color',verchi1,... + 'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.4,0.4,sklab,'Color',verchi2,'FontName','Courier','FontSize',12,'FontWeight','demi') + text(0.4,0.1,kstestlab,'Color',kscol,'FontName','Courier','FontSize',12,'FontWeight','demi') + end + axcopy; +end + +%-------------------------------------------------- +% clone of the normpdf function of the stat toolbox +function fitvals = normpdf(myvals,mymean,mystd) +if nargin < 3, + mystd = 1; +end +if nargin < 2; + mymean = 0; +end +if length(mymean) < length(myvals) + tmpmean = mymean; + mymean = zeros(size(myvals)); + mymean(:) = tmpmean; +end; +if length(mystd) < length(myvals) + tmpmean = mystd; + mystd = zeros(size(myvals)); + mystd(:) = tmpmean; +end; +mymean(1:10); +mystd(1:10); + +fitvals = zeros(size(myvals)); +tmp = find(mystd > 0); +if any(tmp) + myvalsn = (myvals(tmp) - mymean(tmp)) ./ mystd(tmp); + fitvals(tmp) = exp(-0.5 * myvalsn .^2) ./ (sqrt(2*pi) .* mystd(tmp)); +end +tmp1 = find(mystd <= 0); +if any(tmp1) + tmp2 = NaN; + fitvals(tmp1) = tmp2(ones(size(tmp1))); +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/slider.m b/code/eeglab13_4_4b/functions/sigprocfunc/slider.m new file mode 100644 index 0000000..6eabc9e --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/slider.m @@ -0,0 +1,145 @@ +% slider() - add slider to a figure +% +% Usage: +% >> slider( handler, horiz, vert, horizmag, vertmag); +% +% Inputs: +% handler - figure handler (for the current figure, use gcf) +% horiz - [0|1] add a horizontal slider +% vert - [0|1] add a horizontal slider +% horizmag - magnify the width of the figure before adding the slider. +% Default is 1. +% vertmag - magnify the height of the figure before adding the slider. +% Default is 1. +% allowsup - [0|1] allow suppression of slider by the 'x' button. +% Default is 1. +% +% Note: +% clicking on the 'x' the right corner restores the original setting +% +% Example: figure; plot(1:10); slider(gcf, 1, 1, 2, 2); +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function slider( handler, horiz, vert, horizmag, vertmag, allowsup); + +if nargin < 2 + help slider; + return; +end; +if nargin < 3 + vert = 0; +end; +if nargin < 4 + horizmag = 1; +end; +if nargin < 5 + vertmag = 1; +end; +if nargin < 6 + allowsup = 1; +end; + +pos = get(gcf, 'position'); +width = 5/pos(3)*400; +height = 5/pos(4)*400; + +pos = get(gca,'position'); % plot relative to current axes +q = [0.13 0.11 0 0]; +s = [0.0077 0.0081 0.0077 0.0081]; +if vert + h = uicontrol('Parent',handler, ... + 'style', 'slider', 'Units','Normalized', 'userdata', 1, 'value', 1, ... + 'Position', [113-width -9 width 119].*s+q, 'tag', 'winslider', ... + 'string','vertslider', 'callback', ... + ['if isempty(gcbf), fig = gcf; else fig = gcbf; end;' ... + 'h = findobj(''parent'', fig);' ... + 'h2 = findobj(''parent'', fig, ''tag'', ''winslider'');' ... + 'h = setdiff_bc( h, h2);' ... + 'curobj = findobj(''parent'', fig, ''string'', ''vertslider'');' ... + 'shift = get(curobj, ''userdata'') - get(curobj, ''value'');' ... + 'set( curobj, ''userdata'', get(curobj, ''value''));' ... + 'for i = 1:length(h),' ... + ' curpos = get( h(i), ''position'');' ... + ' set( h(i), ''position'', [ curpos(1) curpos(2)+' num2str(vertmag-1) '*shift curpos(3:end)]);' ... + 'end;' ... + 'clear h2 h shift i curpos fig curobj;'] ); +end; + +if horiz + hz = uicontrol('Parent',handler, ... + 'style', 'slider', 'Units','Normalized', 'userdata', 1, 'value', 1, ... + 'Position', [-17 -19+height 125 height].*s+q, 'tag', 'winslider', ... + 'string','horizslider', 'callback', ... + ['if isempty(gcbf), fig = gcf; else fig = gcbf; end;' ... + 'h = findobj(''parent'', fig);' ... + 'h2 = findobj(''parent'', fig, ''tag'', ''winslider'');' ... + 'h = setdiff_bc( h, h2);' ... + 'curobj = findobj(''parent'', fig, ''string'', ''horizslider'');' ... + 'shift = get(curobj, ''userdata'') - get(curobj, ''value'');' ... + 'set( curobj, ''userdata'', get(curobj, ''value''));' ... + 'for i = 1:length(h),' ... + ' curpos = get( h(i), ''position'');' ... + ' set( h(i), ''position'', [ curpos(1)+' num2str(horizmag-1) '*shift curpos(2:end)]);' ... + 'end;' ... + 'clear h2 h shift i curpos fig curobj;'] ); +end; + +% button to remove the slider +% --------------------------- +but = uicontrol( 'style', 'pushbutton', 'Units','Normalized', ... + 'string', 'x', 'position', [113-width -19+height width height].*s+q, 'tag', 'winslider', 'callback', ... + ['hx = findobj(''parent'', gcbf, ''tag'', ''winslider'');' ... % put slider to their extremities + 'hx = setdiff_bc(hx, gcbo);' ... + 'set(hx, ''value'', 1);' ... + 'eval(get(hx(1), ''callback''));' ... + 'if length(hx) >1, eval(get(hx(2), ''callback'')); end;' ... + 'h = findobj(''parent'', gcbf);' ... % recompute positions + 'for i = 1:length(h),' ... + ' curpos = get( h(i), ''position'');' ... + ' set( h(i), ''position'', [(curpos(1)+(' num2str(horizmag) '-1))/' num2str(horizmag) ' (curpos(2)+(' num2str(vertmag) '-1))/' num2str(vertmag) ' curpos(3)/' num2str(horizmag) ' curpos(4)/' num2str(vertmag) ']);' ... + 'end;' ... + 'clear h hx curpos;' ... + 'delete( findobj(''parent'', gcbf, ''tag'', ''winslider'') );' ]); + +if ~allowsup + set(but, 'enable', 'off'); +end; + +% magnify object in the window +% ---------------------------- +h = findobj('parent', handler); +set( h, 'units', 'normalized'); +h2 = findobj('parent', handler, 'tag', 'winslider'); +h = setdiff_bc( h, h2); +for i = 1:length(h) + curpos = get( h(i), 'position'); + set( h(i), 'position', [curpos(1)*horizmag-(horizmag-1) curpos(2)*vertmag-(vertmag-1) curpos(3)*horizmag curpos(4)*vertmag]); +end; + +if horiz + % set the horizontal axis to 0 + % ---------------------------- + set(hz, 'value', 0); + eval(get(hz, 'callback')); +end; +return; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/snapread.m b/code/eeglab13_4_4b/functions/sigprocfunc/snapread.m new file mode 100644 index 0000000..62c2721 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/snapread.m @@ -0,0 +1,152 @@ +% snapread() - Read data in Snap-Master Standard Binary Data File Format +% Reads Snap-Master header and data matrix (nchans,nframes). +% Ref: Users Guide, Snap-Master for Windows (1997) p. 4-19 +% Usage: +% >> data = snapread(filename); % read .SMA file data +% >> [data,params,events,head] = snapread(filename,seekframes); +% % save parameters, event list +% Inputs: +% filename = string containing whole filename of .SMA file to read +% seekframes = skip this many initial time points {default 0} +% Output: +% data = data matrix, size(nchans,nframes) +% params = [nchannels, nframes, srate] +% events = vector of event frames (lo->hi transitions on event channel); +% See source to set EVENT_CHANNEL and EVENT_THRESH. +% head = complete char file header +% +% Authors: Scott Makeig & Tzyy-Ping Jung, SCCN/INC/UCSD, La Jolla, January 31, 2000 + +% Copyright (C) January 31, 2000 from plotdata() Scott Makeig & Tzyy-Ping Jung, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Scott Makeig & Tzyy-Ping Jung, CNL / Salk Institute / January 31, 2000 +% 7-13-00 fixed fprintf count print bug -sm +% 7-13-00 added arg seekframes -sm & ss +% 7-13-00 added test for file length -sm & ss +% 2-15-02 change close('all') to fclose('all') -ad +% 2-15-02 reformated help & license -ad + +function [data,params,events,head] = snapread(file,seekframes) + +EVENT_CHANNEL = 1; % This channel assumed to store event pulses only! +EVENT_THRESH = 2.3; % Default event threshold (may need to adjust!!!!) + +if nargin < 2 + seekframes = 0; +end +data = []; +events = []; +params = []; +head = []; +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Open file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +fid = fopen(file,'r', 'ieee-le'); +if fid<1 + fprintf('\nsnapread(): Could not open file %s.\n\n',file) + return +else + fprintf('\n Opened file %s for reading...\n',file); +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%% Read header %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Read header and extract info + +numbegin=0; +head = []; +while ~numbegin, + line =fgets(fid); + head = [head line]; + if (length(line)>=8 & line(1:8)=='"NCHAN%"') + nchans=str2num(line(findstr(line,'=')+1:end-1)); + end + if (length(line)>= 12 & line(1:12)=='"NUM.POINTS"') + nframes=str2num(line(findstr(line,'=')+1:end-1)); + end + if (length(line)>= 10 & line(1:10)=='"ACT.FREQ"') + srate=str2num(line(findstr(line,'=')+1:end-1)); + end + if (length(line)>= 4 & line(1:4)=='"TR"') + head = head(1:length(head)-length(line)); + line =fgets(fid); % get the time and date stamp line + numbegin=1; + end +end +params = [nchans, nframes, srate]; +fprintf(' Number of channels: %d\n',nchans); +fprintf(' Number of data points: %d\n',nframes); +fprintf(' Sampling rate: %3.1f Hz\n',srate); + +fseek(fid,1,0); % skip final hex-AA char + +% +%%%%%%%%%%%%%%%%%%% Test for correct file length %%%%%%%%%%%%%%%%%%%% +% +datstart = ftell(fid); % save current position in file +fseek(fid,0,'eof'); % go to file end +datend = ftell(fid); % report position +discrep = (datend-datstart) - nchans*nframes*4; +if discrep ~= 0 + fprintf(' ***> Note: File length does not match header information!\n') + fprintf(' Difference: %g frames\n',discrep/(4*nchans)); +end +fseek(fid,datstart,'bof'); % seek back to data start +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Read data %%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if seekframes > 0 + fprintf(' Omitting first %d frames of data.\n',seekframes) + fprintf('moving %d bytes\n',seekframes*nchans*4); + fsq = fseek(fid,seekframes*nchans*4,'cof') + if fsq<0 + fsqerr = ferror(fid); + fprintf('fseek() error: %s\n',fsqerr); + return + end +end + +[data count] = fread(fid,[nchans,nframes],'float'); % read data frame +if count2 + fprintf(' Finding event transitions (>%g) on channel %d ...\n',... + EVENT_THRESH,EVENT_CHANNEL); + events = zeros(EVENT_CHANNEL,nframes); + for n=2:nframes + if abs(data(EVENT_CHANNEL,n-1)) < EVENT_THRESH ... + & abs(data(EVENT_CHANNEL,n)) > EVENT_THRESH + events(n) = 1; + end + end + fprintf(' Total of %d events found.\n',sum(events)); + data = data(2:nchans,:); % eliminate channel 1 + fprintf(' Event channel %d removed from output.\n',EVENT_CHANNEL); + params(1) = nchans-1; +end +fprintf('\n'); +fclose('all'); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/sobi.m b/code/eeglab13_4_4b/functions/sigprocfunc/sobi.m new file mode 100644 index 0000000..95baaef --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/sobi.m @@ -0,0 +1,173 @@ +% sobi() - Second Order Blind Identification (SOBI) by joint diagonalization of +% correlation matrices. THIS CODE ASSUMES TEMPORALLY CORRELATED SIGNALS, +% and uses correlations across times in performing the signal separation. +% Thus, estimated time delayed covariance matrices must be nonsingular +% for at least some time delays. +% Usage: +% >> winv = sobi(data); +% >> [winv,act] = sobi(data,n,p); +% Inputs: +% data - data matrix of size [m,N] ELSE of size [m,N,t] where +% m is the number of sensors, +% N is the number of samples, +% t is the number of trials (avoid epoch boundaries) +% n - number of sources {Default: n=m} +% p - number of correlation matrices to be diagonalized +% {Default: min(100, N/3)} Note that for non-ideal data, +% the authors strongly recommend using at least 100 time delays. +% +% Outputs: +% winv - Matrix of size [m,n], an estimate of the *mixing* matrix. Its +% columns are the component scalp maps. NOTE: This is the inverse +% of the usual ICA unmixing weight matrix. Sphering (pre-whitening), +% used in the algorithm, is incorporated into winv. i.e., +% +% >> icaweights = pinv(winv); icasphere = eye(m); +% +% act - matrix of dimension [n,N] an estimate of the source activities +% +% >> data = winv * act; +% [size m,N] [size m,n] [size n,N] +% >> act = pinv(winv) * data; +% +% Authors: A. Belouchrani and A. Cichocki (references: See function body) +% Note: Adapted by Arnaud Delorme and Scott Makeig to process data epochs by +% computing covariances while respecting epoch boundaries. + +% REFERENCES: +% A. Belouchrani, K. Abed-Meraim, J.-F. Cardoso, and E. Moulines, ``Second-order +% blind separation of temporally correlated sources,'' in Proc. Int. Conf. on +% Digital Sig. Proc., (Cyprus), pp. 346--351, 1993. +% +% A. Belouchrani and K. Abed-Meraim, ``Separation aveugle au second ordre de +% sources correlees,'' in Proc. Gretsi, (Juan-les-pins), +% pp. 309--312, 1993. +% +% A. Belouchrani, and A. Cichocki, +% Robust whitening procedure in blind source separation context, +% Electronics Letters, Vol. 36, No. 24, 2000, pp. 2050-2053. +% +% A. Cichocki and S. Amari, +% Adaptive Blind Signal and Image Processing, Wiley, 2003. + +function [H,S,D]=sobi(X,n,p), + +% Authors note: For non-ideal data, use at least p=100 the time-delayed covariance matrices. +DEFAULT_LAGS = 100; + +[m,N,ntrials]=size(X); + +if nargin<1 | nargin > 3 + + help sobi + +elseif nargin==1, + + n=m; % Source detection (hum...) + p=min(DEFAULT_LAGS,ceil(N/3)); % Number of time delayed correlation matrices to be diagonalized + +elseif nargin==2, + + p=min(DEFAULT_LAGS,ceil(N/3)); % Default number of correlation matrices to be diagonalized + % Use < DEFAULT_LAGS delays if necessary for short data epochs +end; + +% +% Make the data zero mean +% +X(:,:)=X(:,:)-kron(mean(X(:,:)')',ones(1,N*ntrials)); + +% +% Pre-whiten the data based directly on SVD +% +[UU,S,VV]=svd(X(:,:)',0); +Q= pinv(S)*VV'; +X(:,:)=Q*X(:,:); + +% Alternate whitening code +% Rx=(X*X')/T; +% if mepsil ; + encore=encore | oui ; + if oui , % Update the M and V matrices + colp=M(:,p:m:pm); + colq=M(:,q:m:pm); + M(:,p:m:pm)=c*colp+sr*colq; + M(:,q:m:pm)=c*colq-sc*colp; + rowp=M(p,:); + rowq=M(q,:); + M(p,:)=c*rowp+sc*rowq; + M(q,:)=c*rowq-sr*rowp; + temp=V(:,p); + V(:,p)=c*V(:,p)+sr*V(:,q); + V(:,q)=c*V(:,q)-sc*temp; + end%% if + end%% q loop + end%% p loop + step_n=step_n+1; +fprintf('%d step\n',step_n); +end%% while + +% +% Estimate the mixing matrix +% +H = pinv(Q)*V; + +% +% Estimate the source activities +% +if nargout>1 + S=V'*X(:,:); % estimated source activities +end + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/spec.m b/code/eeglab13_4_4b/functions/sigprocfunc/spec.m new file mode 100644 index 0000000..2789435 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/spec.m @@ -0,0 +1,113 @@ +% spec() - power spectrum. This function replaces psd() function if the signal +% processing toolbox is not present. It uses the timef() function. +% +% Usage: +% >> [power freqs] = spec(X); +% >> [power freqs] = spec(X, nfft, fs, win, overlap); +% +% Inputs: +% X - data +% nfft - zero padding to length nfft +% fs - sampling frequency +% win - window size +% overlap - window overlap +% +% Outputs: +% power - spectral estimate (amplitude not dB) +% freqs - frequency array +% +% Note: this function is just an approximation of the psd() (not pwelch) +% method. We strongly recommend to use the psd function if you have +% access to it. +% +% Known problems: +% 1) normalization formula was determined manually by comparing +% with the output of the psd function on about 100 examples. +% 2) In case only one time window is necessary, the overlapping factor +% will be increased so that at least 2 windows are presents (the +% timef function cannot use a single time window). +% 3) FOR FILTERED DATA, THE POWER OVER THE FILTERED REGION IS WRONG +% (TOO HIGH) +% 4) the result of this function differs (in scale) from the pwelch +% function since the normalization is different for pwelch. +% +% Author: Arnaud Delorme, SCCN, Dec 2, 2003 + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [power, freqs] = spec(X, nfft, fs, win, overlap); + +if nargin < 1 + help spec; + return; +end; + +% default parameters +% ------------------ +if nargin < 2 + nfft = 256; +else + nfft = pow2(nextpow2(nfft)); +end; +nfft = min(length(X), nfft); +if nargin < 3 + fs = 2; +end; +if nargin < 4 + win = nfft; +else + win = pow2(nextpow2(win)); +end; +if win > length(X) + win = length(X); +end; +if log2(win) ~= round(log2(win)) + win = pow2(floor(log2(win))); +end; +if nargin < 5 + overlap = 0; +end; + +% compute corresponding parameters for timef +% ------------------------------------------ +padratio = pow2(nextpow2(nfft/win)); +timesout = floor(length(X)/(win-overlap)); +if timesout <= 1, timesout = 2; end; + +[ersp itc mbase times freqs] = timef(X(:)', length(X), [0 length(X)]/fs*1000, fs, ... + 0, 'padratio', padratio, 'timesout', timesout, 'winsize', win, 'maxfreq', fs/2, ... + 'plotersp', 'off', 'plotitc', 'off', 'baseline', NaN, 'verbose', 'off'); + +ersp = 10.^(ersp/10); % back to amplitude +power = mean(ersp,2)*2.7/win; % this formula is a best approximation (I couldn't find the actual one) + % in practice the difference with psd is less than 0.1 dB +%power = 10*log10(power); +if nargout < 1 + hold on; + h = plot(freqs, 10*log10(power)); + set(h, 'linewidth', 2); +end; +return; + +figure; +stdv = std(ersp, [], 2); +h = plot(freqs, power+stdv, 'r:'); +set(h, 'linewidth', 2); +h = plot(freqs, power-stdv, 'r:'); +set(h, 'linewidth', 2); +xlabel('Frequency (Hz)'); +ylabel('Power (log)'); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/spectopo.m b/code/eeglab13_4_4b/functions/sigprocfunc/spectopo.m new file mode 100644 index 0000000..fce30eb --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/spectopo.m @@ -0,0 +1,945 @@ +% spectopo() - Plot the mean log spectrum of a set of data epochs at all channels +% as a bundle of traces. At specified frequencies, plot the relative +% topographic distribution of power. If available, uses pwelch() from +% the Matlab signal processing toolbox, else the EEGLAB spec() function. +% Plots the mean spectrum for all of the supplied data, not just +% the pre-stimulus baseline. +% Usage: +% >> spectopo(data, frames, srate); +% >> [spectra,freqs,speccomp,contrib,specstd] = ... +% spectopo(data, frames, srate, 'key1','val1', 'key2','val2' ...); +% Inputs: +% data = If 2-D (nchans,time_points); % may be a continuous single epoch, +% else a set of concatenated data epochs, else a 3-D set of data +% epochs (nchans,frames,epochs) +% frames = frames per epoch {default|0 -> data length} +% srate = sampling rate per channel (Hz) +% +% Optional 'keyword',[argument] input pairs: +% 'freq' = [float vector (Hz)] vector of frequencies at which to plot power +% scalp maps, or else a single frequency at which to plot component +% contributions at a single channel (see also 'plotchan'). +% 'chanlocs' = [electrode locations filename or EEG.chanlocs structure]. +% For format, see >> topoplot example +% 'limits' = [xmin xmax ymin ymax cmin cmax] axis limits. Sets x, y, and color +% axis limits. May omit final values or use NaNs. +% Ex: [0 60 NaN NaN -10 10], [0 60], ... +% Default color limits are symmetric around 0 and are different +% for each scalp map {default|all NaN's: from the data limits} +% 'title' = [quoted string] plot title {default: none} +% 'freqfac' = [integer] ntimes to oversample -> frequency resolution {default: 2} +% 'nfft' = [integer] length to zero-pad data to. Overwrites 'freqfac' above. +% 'winsize' = [integer] window size in data points {default: from data} +% 'overlap' = [integer] window overlap in data points {default: 0} +% 'percent' = [float 0 to 100] percent of the data to sample for computing the +% spectra. Values < 100 speed up the computation. {default: 100}. +% 'freqrange' = [min max] frequency range to plot. Changes x-axis limits {default: +% 1 Hz for the min and Nyquist (srate/2) for the max. If specified +% power distribution maps are plotted, the highest mapped frequency +% determines the max freq}. +% 'reref' = ['averef'|'off'] convert data to average reference {default: 'off'} +% 'mapnorm' = [float vector] If 'data' contain the activity of an independant +% component, this parameter should contain its scalp map. In this case +% the spectrum amplitude will be scaled to component RMS scalp power. +% Useful for comparing component strengths {default: none} +% 'boundaries' = data point indices of discontinuities in the signal {default: none} +% 'plot' = ['on'|'off'] 'off' -> disable plotting {default: 'on'} +% 'rmdc' = ['on'|'off'] 'on' -> remove DC {default: 'off'} +% 'plotmean' = ['on'|'off'] 'on' -> plot the mean channel spectrum {default: 'off'} +% 'plotchans' = [integer array] plot only specific channels {default: all} +% +% Optionally plot component contributions: +% 'weights' = ICA unmixing matrix. Here, 'freq' (above) must be a single frequency. +% ICA maps of the N ('nicamaps') components that account for the most +% power at the selected frequency ('freq') are plotted along with +% the spectra of the selected channel ('plotchan') and components +% ('icacomps'). +% 'plotchan' = [integer] channel at which to compute independent conmponent +% contributions at the selected frequency ('freq'). If 0, plot RMS +% power at all channels. {defatul|[] -> channel with highest power +% at specified 'freq' (above)). Do not confuse with +% 'plotchans' which select channels for plotting. +% 'mapchans' = [int vector] channels to plot in topoplots {default: all} +% 'mapframes'= [int vector] frames to plot {default: all} +% 'nicamaps' = [integer] number of ICA component maps to plot {default: 4}. +% 'icacomps' = [integer array] indices of ICA component spectra to plot ([] -> all). +% 'icamode' = ['normal'|'sub'] in 'sub' mode, instead of computing the spectra of +% individual ICA components, the function computes the spectrum of +% the data minus their contributions {default: 'normal'} +% 'icamaps' = [integer array] force plotting of selected ICA compoment maps +% {default: [] = the 'nicamaps' largest contributing components}. +% 'icawinv' = [float array] inverse component weight or mixing matrix. Normally, +% this is computed by inverting the ICA unmixing matrix 'weights' (above). +% However, if any components were removed from the supplied 'weights'mapchans +% then the component maps will not be correctly drawn and the 'icawinv' +% matrix should be supplied here {default: from component 'weights'} +% 'memory' = ['low'|'high'] a 'low' setting will use less memory for computing +% component activities, will take longer {default: 'high'} +% +% Replotting options: +% 'specdata' = [freq x chan array ] spectral data +% 'freqdata' = [freq] array of frequencies +% +% Topoplot options: +% other 'key','val' options are propagated to topoplot() for map display +% (See >> help topoplot) +% +% Outputs: +% spectra = (nchans,nfreqs) power spectra (mean power over epochs), in dB +% freqs = frequencies of spectra (Hz) +% speccomp = component spectra (ncomps,nfreqs). Warning, only the function +% only computes the spectrum of the components given as input using +% the 'icacomps' parameter. Other component spectrum are filled +% with 0. +% contrib = contribution of each component (if 'icamode' is 'normal', relative +% variance, if 'icamode' is 'sub', percent variance accounted for) +% specstd = spectrum standard deviation in dB +% +% Notes: The original input format is still functional for backward compatibility. +% psd() has been replaced by pwelch() (see Matlab note 24750 on their web site) +% +% Authors: Scott Makeig, Arnaud Delorme & Marissa Westerfield, +% SCCN/INC/UCSD, La Jolla, 3/01 +% +% See also: timtopo(), envtopo(), tftopo(), topoplot() + +% Copyright (C) 3/01 Scott Makeig & Arnaud Delorme & Marissa Westerfield, SCCN/INC/UCSD, +% scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-20-01 added limits arg -sm +% 01-25-02 reformated help & license -ad +% 02-15-02 scaling by epoch number line 108 - ad, sm & lf +% 03-15-02 add all topoplot options -ad +% 03-18-02 downsampling factor to speed up computation -ad +% 03-27-02 downsampling factor exact calculation -ad +% 04-03-02 added axcopy -sm + +% Uses: MATLAB pwelch(), changeunits(), topoplot(), textsc() + +function [eegspecdB,freqs,compeegspecdB,resvar,specstd] = spectopo(data,frames,srate,varargin) + +% formerly: ... headfreqs,chanlocs,limits,titl,freqfac, percent, varargin) + +icadefs; +LOPLOTHZ = 1; % low Hz to plot +FREQFAC = 2; % approximate frequencies/Hz (default) +allcolors = { [0 0.7500 0.7500] + [1 0 0] + [0 0.5000 0] + [0 0 1] + [0.2500 0.2500 0.2500] + [0.7500 0.7500 0] + [0.7500 0 0.7500] }; % colors from real plots }; + +if nargin<3 + help spectopo + return +end +if nargin <= 3 | isstr(varargin{1}) + % 'key' 'val' sequence + fieldlist = { 'freq' 'real' [] [] ; + 'specdata' 'real' [] [] ; + 'freqdata' 'real' [] [] ; + 'chanlocs' '' [] [] ; + 'freqrange' 'real' [0 srate/2] [] ; + 'memory' 'string' {'low','high'} 'high' ; + 'plot' 'string' {'on','off'} 'on' ; + 'plotmean' 'string' {'on','off'} 'off' ; + 'title' 'string' [] ''; + 'limits' 'real' [] [nan nan nan nan nan nan]; + 'freqfac' 'integer' [] FREQFAC; + 'percent' 'real' [0 100] 100 ; + 'reref' 'string' { 'averef','off','no' } 'off' ; + 'boundaries' 'integer' [] [] ; + 'nfft' 'integer' [1 Inf] [] ; + 'winsize' 'integer' [1 Inf] [] ; + 'overlap' 'integer' [1 Inf] 0 ; + 'icamode' 'string' { 'normal','sub' } 'normal' ; + 'weights' 'real' [] [] ; + 'mapnorm' 'real' [] [] ; + 'plotchan' 'integer' [1:size(data,1)] [] ; + 'plotchans' 'integer' [1:size(data,1)] [] ; + 'nicamaps' 'integer' [] 4 ; + 'icawinv' 'real' [] [] ; + 'icacomps' 'integer' [] [] ; + 'icachansind' 'integer' [] [1:size(data,1)] ; % deprecated + 'icamaps' 'integer' [] [] ; + 'rmdc' 'string' {'on','off'} 'off'; + 'mapchans' 'integer' [1:size(data,1)] [] + 'mapframes' 'integer' [1:size(data,2)] []}; + + [g varargin] = finputcheck( varargin, fieldlist, 'spectopo', 'ignore'); + if isstr(g), error(g); end; + if ~isempty(g.freqrange), g.limits(1:2) = g.freqrange; end; + if ~isempty(g.weights) + if isempty(g.freq) | length(g.freq) > 2 + if ~isempty(get(0,'currentfigure')) & strcmp(get(gcf, 'tag'), 'spectopo'), close(gcf); end; + error('spectopo(): for computing component contribution, one must specify a (single) frequency'); + end; + end; +else + if ~isnumeric(data) + error('spectopo(): Incorrect call format (see >> help spectopo).') + end + if ~isnumeric(frames) | round(frames) ~= frames + error('spectopo(): Incorrect call format (see >> help spectopo).') + end + if ~isnumeric(srate) % 3rd arg must be the sampling rate in Hz + error('spectopo(): Incorrect call format (see >> help spectopo).') + end + + if nargin > 3, g.freq = varargin{1}; + else g.freq = []; + end; + if nargin > 4, g.chanlocs = varargin{2}; + else g.chanlocs = []; + end; + if nargin > 5, g.limits = varargin{3}; + else g.limits = [nan nan nan nan nan nan]; + end; + if nargin > 6, g.title = varargin{4}; + else g.title = ''; + end; + if nargin > 7, g.freqfac = varargin{5}; + else g.freqfac = FREQFAC; + end; + if nargin > 8, g.percent = varargin{6}; + else g.percent = 100; + end; + if nargin > 10, g.reref = 'averef'; + else g.reref = 'off'; + end; + g.weights = []; + g.icamaps = []; +end; +if g.percent > 1 + g.percent = g.percent/100; % make it from 0 to 1 +end; +if ~isempty(g.freq) & isempty(g.chanlocs) + error('spectopo(): needs channel location information'); +end; +if isempty(g.weights) && ~isempty(g.plotchans) + data = data(g.plotchans,:); + if ~isempty(g.chanlocs) + g.chanlocs = g.chanlocs(g.plotchans); + end; +end; + +if strcmpi(g.rmdc, 'on') + data = data - repmat(mean(data,2), [ 1 size(data,2) 1]); +end +data = reshape(data, size(data,1), size(data,2)*size(data,3)); + +if frames == 0 + frames = size(data,2); % assume one epoch +end + +%if ~isempty(g.plotchan) & g.plotchan == 0 & strcmpi(g.icamode, 'sub') +% if ~isempty(get(0,'currentfigure')) & strcmp(get(gcf, 'tag'), 'spectopo'), close(gcf); end; +% error('Cannot plot data component at all channels (option not implemented)'); +%end; + +if ~isempty(g.freq) & min(g.freq)<0 + if ~isempty(get(0,'currentfigure')) & strcmp(get(gcf, 'tag'), 'spectopo'), close(gcf); end; + fprintf('spectopo(): freqs must be >=0 Hz\n'); + return +end + +g.chanlocs2 = g.chanlocs; +if ~isempty(g.specdata) + eegspecdB = g.specdata; + freqs = g.freqdata; +else + epochs = round(size(data,2)/frames); + if frames*epochs ~= size(data,2) + error('Spectopo: non-integer number of epochs'); + end + if ~isempty(g.weights) + ncompsori = size(g.weights,1); + if isempty(g.icawinv) + g.icawinv = pinv(g.weights); % maps + end; + if ~isempty(g.icacomps) + g.weights = g.weights(g.icacomps, :); + g.icawinv = g.icawinv(:,g.icacomps); + else + g.icacomps = [1:size(g.weights,1)]; + end; + end; + compeegspecdB = []; + resvar = NaN; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % compute channel spectra using pwelch() + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + epoch_subset = ones(1,epochs); + if g.percent ~= 1 & epochs == 1 + fprintf('Selecting the first %2.1f%% of data for analysis...\n', g.percent*100); + frames = round(size(data,2)*g.percent); + data = data(:, 1:frames); + g.boundaries(find(g.boundaries > frames)) = []; + if ~isempty(g.boundaries) + g.boundaries(end+1) = frames; + end; + end; + if g.percent ~= 1 & epochs > 1 + epoch_subset = zeros(1,epochs); + nb = ceil( g.percent*epochs); + while nb>0 + index = ceil(rand*epochs); + if ~epoch_subset(index) + epoch_subset(index) = 1; + nb = nb-1; + end; + end; + epoch_subset = find(epoch_subset == 1); + fprintf('Randomly selecting %d of %d data epochs for analysis...\n', length(epoch_subset),epochs); + else + epoch_subset = find(epoch_subset == 1); + end; + if isempty(g.weights) + %%%%%%%%%%%%%%%%%%%%%%%%%%% + % compute data spectra + %%%%%%%%%%%%%%%%%%%%%%%%%%% + fprintf('Computing spectra') + [eegspecdB freqs specstd] = spectcomp( data, frames, srate, epoch_subset, g); + if ~isempty(g.mapnorm) % normalize by component map RMS power (if data contain 1 component + disp('Scaling spectrum by component RMS of scalp map power'); + eegspecdB = sqrt(mean(g.mapnorm.^4)) * eegspecdB; + % the idea is to take the RMS of the component activity (compact) projected at each channel + % spec = sqrt( power(g.mapnorm(1)*compact).^2 + power(g.mapnorm(2)*compact).^2 + ...) + % spec = sqrt( g.mapnorm(1)^4*power(compact).^2 + g.mapnorm(1)^4*power(compact).^2 + ...) + % spec = sqrt( g.mapnorm(1)^4 + g.mapnorm(1)^4 + ... )*power(compact) + end; + + tmpc = find(eegspecdB(:,1)); % > 0 power chans + tmpindices = find(eegspecdB(:,1) == 0); + if ~isempty(tmpindices) + zchans = int2str(tmpindices); % 0-power chans + else zchans = []; + end; + if length(tmpc) ~= size(eegspecdB,1) + fprintf('\nWarning: channels [%s] have 0 values, so will be omitted from the display', ... + zchans); + eegspecdB = eegspecdB(tmpc,:); + if ~isempty(specstd), specstd = specstd(tmpc,:); end + if ~isempty(g.chanlocs) + g.chanlocs2 = g.chanlocs(tmpc); + end + end; + eegspecdB = 10*log10(eegspecdB); + specstd = 10*log10(specstd); + fprintf('\n'); + else + % compute data spectrum + if isempty(g.plotchan) | g.plotchan == 0 + fprintf('Computing spectra') + [eegspecdB freqs specstd] = spectcomp( data, frames, srate, epoch_subset, g); + fprintf('\n'); % log below + else + fprintf('Computing spectra at specified channel') + g.reref = 'off'; + [eegspecdB freqs specstd] = spectcomp( data(g.plotchan,:), frames, srate, epoch_subset, g); + fprintf('\n'); % log below + end; + g.reref = 'off'; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % select channels and spectra + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if isempty(g.plotchan) % find channel of minimum power + [tmp indexfreq] = min(abs(g.freq-freqs)); + [tmp g.plotchan] = min(eegspecdB(:,indexfreq)); + fprintf('Channel %d has maximum power at %g\n', g.plotchan, g.freq); + eegspecdBtoplot = eegspecdB(g.plotchan, :); + elseif g.plotchan == 0 + fprintf('Computing RMS power at all channels\n'); + eegspecdBtoplot = sqrt(mean(eegspecdB.^2,1)); % RMS before log as for components + else + eegspecdBtoplot = eegspecdB; + end; + tmpc = find(eegspecdB(:,1)); % > 0 power chans + zchans = int2str(find(eegspecdB(:,1) == 0)); % 0-power chans + if length(tmpc) ~= size(eegspecdB,1) + fprintf('\nWarning: channels [%s] have 0 values, so will be omitted from the display', ... + zchans); + eegspecdB = eegspecdB(tmpc,:); + if ~isempty(specstd), specstd = specstd(tmpc,:); end + if ~isempty(g.chanlocs) + g.chanlocs2 = g.chanlocs(tmpc); + end + end; + specstd = 10*log10(specstd); + eegspecdB = 10*log10(eegspecdB); + eegspecdBtoplot = 10*log10(eegspecdBtoplot); + + %%%%%%%%%%%%%%%%%%%%%%%%%%% + % compute component spectra + %%%%%%%%%%%%%%%%%%%%%%%%%%% + newweights = g.weights; + if strcmp(g.memory, 'high') & strcmp(g.icamode, 'normal') + fprintf('Computing component spectra: ') + [compeegspecdB freqs] = spectcomp( newweights*data(:,:), frames, srate, epoch_subset, g); + else % in case out of memory error, multiply conmponent sequencially + if strcmp(g.icamode, 'sub') & ~isempty(g.plotchan) & g.plotchan == 0 + % scan all electrodes + fprintf('Computing component spectra at each channel: ') + for index = 1:size(data,1) + g.plotchan = index; + [compeegspecdB(:,:,index) freqs] = spectcomp( data, frames, srate, epoch_subset, g, newweights); + end; + g.plotchan = 0; + else + fprintf('Computing component spectra: ') + [compeegspecdB freqs] = spectcomp( data, frames, srate, epoch_subset, g, newweights); + end; + end; + fprintf('\n'); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % rescale spectra with respect to projection (rms = root mean square) + % all channels: component_i power = rms(inverseweigths(component_i)^2)*power(activation_component_i); + % one channel: component_i power = inverseweigths(channel_j,component_i)^2)*power(activation_component_i); + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if strcmpi(g.icamode, 'normal') + for index = 1:size(compeegspecdB,1) + if g.plotchan == 0 % normalize by component scalp map power + compeegspecdB(index,:) = 10*log10( sqrt(mean(g.icawinv(:,index).^4)) * compeegspecdB(index,:) ); + else + compeegspecdB(index,:) = 10*log10( g.icawinv(g.plotchan,index)^2 * compeegspecdB(index,:) ); + end; + end; + else % already spectrum of data-components + compeegspecdB = 10*log10( compeegspecdB ); + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%% + % select components to plot + %%%%%%%%%%%%%%%%%%%%%%%%%%% + if isempty(g.icamaps) + [tmp indexfreq] = min(abs(g.freq-freqs)); + g.icafreqsval = compeegspecdB(:, indexfreq); + [g.icafreqsval g.icamaps] = sort(g.icafreqsval); + if strcmp(g.icamode, 'normal') + g.icamaps = g.icamaps(end:-1:1); + g.icafreqsval = g.icafreqsval(end:-1:1); + end; + if g.nicamaps < length(g.icamaps), g.icamaps = g.icamaps(1:g.nicamaps); end; + else + [tmp indexfreq] = min(abs(g.freq-freqs)); + g.icafreqsval = compeegspecdB(g.icamaps, indexfreq); + end; + end; +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% compute axis and caxis g.limits +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if length(g.limits)<1 | isnan(g.limits(1)) + g.limits(1) = LOPLOTHZ; +end + +if ~isempty(g.freq) + if length(g.limits)<2 | isnan(g.limits(2)) + maxheadfreq = max(g.freq); + if rem(maxheadfreq,5) ~= 0 + g.limits(2) = 5*ceil(maxheadfreq/5); + else + g.limits(2) = maxheadfreq*1.1; + end + end + + g.freq = sort(g.freq); % Determine topoplot frequencies + freqidx = zeros(1,length(g.freq)); % Do not interpolate between freqs + for f=1:length(g.freq) + [tmp fi] = min(abs(freqs-g.freq(f))); + freqidx(f)=fi; + end + +else % no freq specified + + if isnan(g.limits(2)) + g.limits(2) = srate/2; + end; +end; + +[tmp maxfreqidx] = min(abs(g.limits(2)-freqs)); % adjust max frequency +[tmp minfreqidx] = min(abs(g.limits(1)-freqs)); % adjust min frequency + +if length(g.limits)<3|isnan(g.limits(3)) + reallimits(1) = min(min(eegspecdB(:,minfreqidx:maxfreqidx))); +else + reallimits(1) = g.limits(3); +end +if length(g.limits)<4|isnan(g.limits(4)) + reallimits(2) = max(max(eegspecdB(:,minfreqidx:maxfreqidx))); + dBrange = reallimits(2)-reallimits(1); % expand range a bit beyond data g.limits + reallimits(1) = reallimits(1)-dBrange/7; + reallimits(2) = reallimits(2)+dBrange/7; +else + reallimits(2) = g.limits(4); +end + +if length(g.limits)<5 % default caxis plotting g.limits + g.limits(5) = nan; +end +if length(g.limits)<6 + g.limits(6) = nan; +end + +if isnan(g.limits(5))+isnan(g.limits(6)) == 1 + fprintf('spectopo(): limits 5 and 6 must either be given or nan\n'); + return +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% plot spectrum of each channel +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if strcmpi(g.plot, 'on') + mainfig = gca; axis off; + if ~isempty(g.freq) + specaxes = sbplot(3,4,[5 12], 'ax', mainfig); + end; + + if isempty(g.weights) + %pl=plot(freqs(1:maxfreqidx),eegspecdB(:,1:maxfreqidx)'); % old command + if strcmpi(g.plotmean, 'on'), specdata = mean(eegspecdB,1); % average channels + else specdata = eegspecdB; + end; + for index = 1:size(specdata,1) % scan channels + tmpcol = allcolors{mod(index, length(allcolors))+1}; + command = [ 'disp(''Channel ' int2str(index) ''')' ]; + pl(index)=plot(freqs(1:maxfreqidx),specdata(index,1:maxfreqidx)', ... + 'color', tmpcol, 'ButtonDownFcn', command); hold on; + end; + else + for index = 1:size(eegspecdBtoplot,1) + tmpcol = allcolors{mod(index, length(allcolors))+1}; + command = [ 'disp(''Channel ' int2str(g.plotchan(index)) ''')' ]; + pl(index)=plot(freqs(1:maxfreqidx),eegspecdBtoplot(index,1:maxfreqidx)', ... + 'color', tmpcol, 'ButtonDownFcn', command); hold on; + end; + end; + set(pl,'LineWidth',2); + set(gca,'TickLength',[0.02 0.02]); + try, + axis([freqs(minfreqidx) freqs(maxfreqidx) reallimits(1) reallimits(2)]); + catch, disp('Could not adjust axis'); end; + xl=xlabel('Frequency (Hz)'); + set(xl,'fontsize',AXES_FONTSIZE_L); + % yl=ylabel('Rel. Power (dB)'); + yl=ylabel('Power 10*log_{10}(\muV^{2}/Hz)'); + set(yl,'fontsize',AXES_FONTSIZE_L); + set(gca,'fontsize',AXES_FONTSIZE_L) + box off; +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% plot component contribution % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +colrs = {'r','b','g','m','c'}; % component spectra trace colors +if ~isempty(g.weights) + if strcmpi(g.plot, 'on') + if strcmpi(g.icamode, 'sub') + set(pl,'LineWidth',5, 'color', 'k'); + else + set(pl, 'linewidth', 2, 'color', 'k'); + end; + + hold on; + for f=1:length(g.icamaps) + colr = colrs{mod((f-1),5)+1}; + command = [ 'disp(''Component ' int2str(g.icamaps(f)) ''')' ]; + pl2(index)=plot(freqs(1:maxfreqidx),compeegspecdB(g.icamaps(f),1:maxfreqidx)', ... + 'color', colr, 'ButtonDownFcn', command); hold on; + end + othercomps = setdiff_bc(1:size(compeegspecdB,1), g.icamaps); + if ~isempty(othercomps) + for index = 1:length(othercomps) + tmpcol = allcolors{mod(index, length(allcolors))+1}; + command = [ 'disp(''Component ' int2str(othercomps(index)) ''')' ]; + pl(index)=plot(freqs(1:maxfreqidx),compeegspecdB(othercomps(index),1:maxfreqidx)', ... + 'color', tmpcol, 'ButtonDownFcn', command); hold on; + end; + end; + if length(g.limits)<3|isnan(g.limits(3)) + newaxis = axis; + newaxis(3) = min(newaxis(3), min(min(compeegspecdB(:,1:maxfreqidx)))); + newaxis(4) = max(newaxis(4), max(max(compeegspecdB(:,1:maxfreqidx)))); + axis(newaxis); + end; + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % indicate component contribution % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + maxdatadb = max(eegspecdBtoplot(:,freqidx(1))); + [tmp indexfreq] = min(abs(g.freq-freqs)); + for index = 1:length(g.icacomps) + if strcmp(g.icamode, 'normal') + % note: maxdatadb = eegspecdBtoplot (RMS power of data) + resvar(index) = 100*exp(-(maxdatadb-compeegspecdB(index, indexfreq))/10*log(10)); + fprintf('Component %d percent relative variance:%6.2f\n', g.icacomps(index), resvar(index)); + else + if g.plotchan == 0 + resvartmp = []; + for chan = 1:size(eegspecdB,1) % scan channels + resvartmp(chan) = 100 - 100*exp(-(eegspecdB(chan,freqidx(1))-compeegspecdB(index, indexfreq, chan))/10*log(10)); + end; + resvar(index) = mean(resvartmp); % mean contribution for all channels + stdvar(index) = std(resvartmp); + fprintf('Component %d percent variance accounted for:%6.2f ± %3.2f\n', ... + g.icacomps(index), resvar(index), stdvar(index)); + else + resvar(index) = 100 - 100*exp(-(maxdatadb-compeegspecdB(index, indexfreq))/10*log(10)); + fprintf('Component %d percent variance accounted for:%6.2f\n', g.icacomps(index), resvar(index)); + end; + end; + end; + + % for icamode=sub and plotchan == 0 -> take the RMS power of all channels + % ----------------------------------------------------------------------- + if ndims(compeegspecdB) == 3 + compeegspecdB = exp( compeegspecdB/10*log(10) ); + compeegspecdB = sqrt(mean(compeegspecdB.^2,3)); % RMS before log (dim1=comps, dim2=freqs, dim3=chans) + compeegspecdB = 10*log10( compeegspecdB ); + end; + +end; + +if ~isempty(g.freq) & strcmpi(g.plot, 'on') + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % plot vertical lines through channel trace bundle at each headfreq + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if isempty(g.weights) + for f=1:length(g.freq) + hold on; + plot([freqs(freqidx(f)) freqs(freqidx(f))], ... + [min(eegspecdB(:,freqidx(f))) max(eegspecdB(:,freqidx(f)))],... + 'k','LineWidth',2.5); + end; + else + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % plot vertical line at comp analysis freq + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + mincompdB = min([min(eegspecdB(:,freqidx(1))) min(compeegspecdB(:,freqidx(1)))]); + maxcompdB = max([max(eegspecdB(:,freqidx(1))) max(compeegspecdB(:,freqidx(1)))]); + hold on; + plot([freqs(freqidx(1)) freqs(freqidx(1))],[mincompdB maxcompdB],'k', 'LineWidth',2.5); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%% + % create axis for topoplot + %%%%%%%%%%%%%%%%%%%%%%%%%% + tmpmainpos = get(gca, 'position'); + headax = zeros(1,length(g.freq)); + for f=1:length(g.freq)+length(g.icamaps) + headax(f) = sbplot(3,length(g.freq)+length(g.icamaps),f, 'ax', mainfig); + axis([-1 1 -1 1]); + + %axis x coords and use + tmppos = get(headax(f), 'position'); + allaxcoords(f) = tmppos(1); + allaxuse(f) = 0; + end + large = sbplot(1,1,1, 'ax', mainfig); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % compute relative positions on plot + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ~isempty(g.weights) + freqnormpos = tmpmainpos(1) + tmpmainpos(3)*(freqs(freqidx(1))-g.limits(1))/(g.limits(2)-g.limits(1)); + for index = 1:length(g.icamaps)+1 + [realpos(index) allaxuse] = closestplot( freqnormpos, allaxcoords, allaxuse ); + end; + + % put the channel plot a liitle bit higher + tmppos = get(headax(realpos(1)), 'position'); + tmppos(2) = tmppos(2)+0.04; + set(headax(realpos(1)), 'position', tmppos); + else + realpos = 1:length(g.freq); % indices giving order of plotting positions + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % plot connecting lines using changeunits() + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + for f=1:length(g.freq)+length(g.icamaps) + if ~isempty(g.weights) + if f>length(g.freq) % special case of ICA components + from = changeunits([freqs(freqidx(1)),g.icafreqsval(f-1)],specaxes,large); + %g.icafreqsval contains the sorted frequency values at the specified frequency + else + from = changeunits([freqs(freqidx(f)),maxcompdB],specaxes,large); + end; + else + from = changeunits([freqs(freqidx(f)),max(eegspecdB(:,freqidx(f)))],specaxes,large); + end; + pos = get(headax(realpos(f)),'position'); + to = changeunits([0,0],headax(realpos(f)),large)+[0 -min(pos(3:4))/2.5]; + hold on; + if f<=length(g.freq) + colr = 'k'; + else + colr = colrs{mod((f-2),5)+1}; + end + li(realpos(f)) = plot([from(1) to(1)],[from(2) to(2)],colr,'LineWidth',PLOT_LINEWIDTH_S); + axis([0 1 0 1]); + axis off; + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % plot selected channel head using topoplot() + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + fprintf('Plotting scalp distributions: ') + for f=1:length(g.freq) + axes(headax(realpos(f))); + + topodata = eegspecdB(:,freqidx(f))-nan_mean(eegspecdB(:,freqidx(f))); + + if isnan(g.limits(5)), + maplimits = 'absmax'; + else + maplimits = [g.limits(5) g.limits(6)]; + end; + + % + % If 1 channel in g.plotchan + % + + if ~isempty(g.plotchan) & g.plotchan ~= 0 + % if ~isempty(varargin) % if there are extra topoplot() flags + % topoplot(g.plotchan,g.chanlocs,'electrodes','off', ... + % 'style', 'blank', 'emarkersize1chan', 10, varargin{:}); + % else + topoplot(g.plotchan,g.chanlocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10); + % end + if isstruct(g.chanlocs) + tl=title(g.chanlocs(g.plotchan).labels); + else + tl=title([ 'c' int2str(g.plotchan)]); + end; + + else % plot all channels in g.plotchans + + if isempty(g.mapframes) | g.mapframes == 0 + g.mapframes = 1:size(eegspecdB,1); % default to plotting all chans + end + if ~isempty(varargin) + topoplot(topodata(g.mapframes),g.chanlocs2,'maplimits',maplimits, varargin{:}); + else + topoplot(topodata(g.mapframes),g.chanlocs2,'maplimits',maplimits); + end + if f= 3 + tmp = compeegspecdB; + compeegspecdB = zeros(ncompsori, size(tmp,2)); + compeegspecdB(g.icacomps,:) = tmp; +end; + +%%%%%%%%%%%%%%%% +% Turn on axcopy (disabled to allow to click on curves) +%%%%%%%%%%%%%%%% +if strcmpi(g.plot, 'on') + disp('Click on each trace for channel/component index'); + axcopy(gcf, 'if ~isempty(get(gca, ''''userdata'''')), eval(get(gca, ''''userdata'''')); end;'); + % will not erase the commands for the curves +end; + +%%%%%%%%%%%%%%%% +% Plot color bar +%%%%%%%%%%%%%%%% +function plotcolbar(g) + cb=cbar; + pos = get(cb,'position'); + set(cb,'position',[pos(1) pos(2) 0.03 pos(4)]); + set(cb,'fontsize',12); + try + if isnan(g.limits(5)) + ticks = get(cb,'ytick'); + [tmp zi] = find(ticks == 0); + ticks = [ticks(1) ticks(zi) ticks(end)]; + set(cb,'ytick',ticks); + set(cb,'yticklabel',strvcat('-',' ','+')); + end + catch, end; % in a single channel is plotted + +%%%%%%%%%%%%%%%%%%%%%%% +% function closest plot +%%%%%%%%%%%%%%%%%%%%%%% +function [index, usedplots] = closestplot(xpos, xcentercoords, usedplots); + notused = find(usedplots == 0); + xcentercoords = xcentercoords(notused); + [tmp index] = min(abs(xcentercoords-xpos)); + index = notused(index); + usedplots(index) = 1; + return; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% function computing spectrum +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [eegspecdB, freqs, specstd] = spectcomp( data, frames, srate, epoch_subset, g, newweights); + if exist('newweights') == 1 + nchans = size(newweights,1); + else + nchans = size(data,1); + end; + %fftlength = 2^round(log(srate)/log(2))*g.freqfac; + if isempty(g.winsize) + winlength = max(pow2(nextpow2(frames)-3),4); %*2 since diveded by 2 later + winlength = min(winlength, 512); + winlength = max(winlength, 256); + winlength = min(winlength, frames); + else + winlength = g.winsize; + end; + if isempty(g.nfft) + fftlength = 2^(nextpow2(winlength))*g.freqfac; + else + fftlength = g.nfft; + end; +% usepwelch = 1; + usepwelch = license('checkout','Signal_Toolbox'); % 5/22/2014 Ramon +% if ~license('checkout','Signal_Toolbox'), + if ~usepwelch, + fprintf('\nSignal processing toolbox (SPT) absent: spectrum computed using the pwelch()\n'); + fprintf('function from Octave which is suposedly 100%% compatible with the Matlab pwelch function\n'); + end; + fprintf(' (window length %d; fft length: %d; overlap %d):\n', winlength, fftlength, g.overlap); + + for c=1:nchans % scan channels or components + if exist('newweights') == 1 + if strcmp(g.icamode, 'normal') + tmpdata = newweights(c,:)*data; % component activity + else % data - component contribution + tmpdata = data(g.plotchan,:) - (g.icawinv(g.plotchan,c)*newweights(c,:))*data; + end; + else + tmpdata = data(c,:); % channel activity + end; + if strcmp(g.reref, 'averef') + tmpdata = averef(tmpdata); + end; + for e=epoch_subset + if isempty(g.boundaries) + if usepwelch + [tmpspec,freqs] = pwelch(matsel(tmpdata,frames,0,1,e),... + winlength,g.overlap,fftlength,srate); + else + [tmpspec,freqs] = spec(matsel(tmpdata,frames,0,1,e),fftlength,srate,... + winlength,g.overlap); + end; + %[tmpspec,freqs] = psd(matsel(tmpdata,frames,0,1,e),fftlength,srate,... + % winlength,g.overlap); + if c==1 & e==epoch_subset(1) + eegspec = zeros(nchans,length(freqs)); + specstd = zeros(nchans,length(freqs)); + end + eegspec(c,:) = eegspec(c,:) + tmpspec'; + specstd(c,:) = specstd(c,:) + tmpspec'.^2; + else + g.boundaries = round(g.boundaries); + for n=1:length(g.boundaries)-1 + if g.boundaries(n+1) - g.boundaries(n) >= winlength % ignore segments of less than winlength + if usepwelch + [tmpspec,freqs] = pwelch(tmpdata(e,g.boundaries(n)+1:g.boundaries(n+1)),... + winlength,g.overlap,fftlength,srate); + else + [tmpspec,freqs] = spec(tmpdata(e,g.boundaries(n)+1:g.boundaries(n+1)),... + fftlength,srate,winlength,g.overlap); + end; + if exist('eegspec') ~= 1 + eegspec = zeros(nchans,length(freqs)); + specstd = zeros(nchans,length(freqs)); + end + eegspec(c,:) = eegspec(c,:) + tmpspec'* ... + ((g.boundaries(n+1)-g.boundaries(n)+1)/g.boundaries(end)); + specstd(c,:) = eegspec(c,:) + tmpspec'.^2 * ... + ((g.boundaries(n+1)-g.boundaries(n)+1)/g.boundaries(end)); + end; + end + end; + end + fprintf('.') + end + + n = length(epoch_subset); + eegspecdB = eegspec/n; % normalize by the number of sections + if n>1 % normalize standard deviation by the number of sections + specstd = sqrt( (specstd + eegspec.^2/n)/(n-1) ); + else specstd = []; + end; + return; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/sph2topo.m b/code/eeglab13_4_4b/functions/sigprocfunc/sph2topo.m new file mode 100644 index 0000000..bb8fa75 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/sph2topo.m @@ -0,0 +1,94 @@ +% sph2topo() - Convert from a 3-column headplot file in spherical coordinates +% to 3-column topoplot() locs file in polar (not cylindrical) coords. +% Used for topoplot() and other 2-D topographic plotting programs. +% Assumes a spherical coordinate system in which horizontal angles +% have a range [-180,180] deg, with zero pointing to the right ear. +% In the output polar coordinate system, zero points to the nose. +% See >> help readlocs +% Usage: +% >> [chan_num,angle,radius] = sph2topo(input,shrink_factor,method); +% +% Inputs: +% input = [channo,az,horiz] = chan_number, azumith (deg), horiz. angle (deg) +% When az>0, horiz=0 -> right ear, 90 -> nose +% When az<0, horiz=0 -> left ear, -90 -> nose +% shrink_factor = arc_length shrinking factor>=1 (deprecated). +% 1 -> plot edge is 90 deg azimuth {default}; +% 1.5 -> plot edge is +/-135 deg azimuth See +% >> help topoplot(). +% method = [1|2], optional. 1 is for Besa compatibility, 2 is for +% compatibility with Matlab function cart2sph(). Default is 2 +% +% Outputs: +% channo = channel number (as in input) +% angle = horizontal angle (0 -> nose; 90 -> right ear; -90 -> left ear) +% radius = arc_lengrh from vertex (Note: 90 deg az -> 0.5/shrink_factor); +% By topoplot() convention, radius=0.5 is the nasion-ear_canal plane. +% Use topoplot() 'plotrad' to plot chans with abs(az) > 90 deg. +% +% Author: Scott Makeig & Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 6/12/98 +% +% See also: cart2topo(), topo2sph() + +% Copyright (C) 6/12/98 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% corrected left/right orientation mismatch, Blair Hicks 6/20/98 +% changed name sph2pol() -> sph2topo() for compatibility -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 changed computation so that it works with sph2topo -ad + +function [channo,angle,radius] = sph2topo(input,factor, method) + +chans = size(input,1); +angle = zeros(chans,1); +radius = zeros(chans,1); + +if nargin < 1 + help sph2topo + return +end + +if nargin< 2 + factor = 0; +end +if factor==0 + factor = 1; +end +if factor < 1 + help sph2topo + return +end + +if size(input,2) ~= 3 + help sph2topo + return +end + +channo = input(:,1); +az = input(:,2); +horiz = input(:,3); + +if exist('method')== 1 & method == 1 + radius = abs(az/180)/factor; + i = find(az>=0); + angle(i) = 90-horiz(i); + i = find(az<0); + angle(i) = -90-horiz(i); +else + angle = -horiz; + radius = 0.5 - az/180; +end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/spher.m b/code/eeglab13_4_4b/functions/sigprocfunc/spher.m new file mode 100644 index 0000000..9f22aa5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/spher.m @@ -0,0 +1,20 @@ +% spher() - return the sphering matrix for given input data +% +% Usage: +% +% >> sphere_matrix = spher(data); +% +% Reference: T. Bell (1996) - - - +% + +% S. Makeig CNL / Salk Institute, La Jolla CA 7-17-97 + +function sphere = spher(data) + + +if nargin<1 | size(data,1)<1 + help spher + return +end + +sphere = 2.0*inv(sqrtm(cov(data'))); % return the "sphering" matrix diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/spherror.m b/code/eeglab13_4_4b/functions/sigprocfunc/spherror.m new file mode 100644 index 0000000..ecb0e8a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/spherror.m @@ -0,0 +1,30 @@ +% spherror() - chancenter() sub function to compute minimum distance +% of Cartesian coordinates to a sphere +% +% Author: Scott Makeig, CNL / Salk Institute, 2000 + +% Copyright (C) Scott Makeig, CNL / Salk Institute, 2000 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function wobble = spherror(center,x,y,z) + +% 03/14/02 corrected wobble calculation -lf + +x = x - center(1); % center the points at (0,0,0) +y = y - center(2); +z = z - center(3); +radius = (sqrt(x.^2+y.^2+z.^2)); % distances from the center +wobble = std(radius-mean(radius)); % test if xyz values are on a sphere diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/strmultiline.m b/code/eeglab13_4_4b/functions/sigprocfunc/strmultiline.m new file mode 100644 index 0000000..b43f9e9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/strmultiline.m @@ -0,0 +1,100 @@ +% strmultiline() - format a long string as a multi-line string. +% +% Usage: +% >> strout = strmultiline( strin, maxlen, delimiter); +% +% Inputs: +% strin - one-line or several-line string +% maxlen - maximum line length +% delimiter - enter 10 here to separate lines with character 10. Default is +% empty: lines are on different rows of the returned array. +% Outputs: +% strout - string with multiple line +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2005 +% +% See also: eegfilt(), eegfiltfft(), eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function strout = strmultiline( strinori, maxlen, delimiter); + +if nargin < 1 + help strmultiline; + return; +end; +if nargin < 3 + delimiter = []; +end; + +% first format input string +% ------------------------- +if ~isempty(find(strinori == 10)) + tmpinds = [1 find(strinori == 10)+1 length(strinori)]; + strinori = [ ' ' strinori ' ' ]; + for ind = 2:length(tmpinds) + allstrs{ind} = strinori(tmpinds(ind-1)+1:tmpinds(ind)-1); + if isempty(allstrs{ind}), allstrs{ind} = ' '; end; + end; + strinori = strvcat(allstrs{:}); +end; +if size(strinori,2) < maxlen, strout = strinori; return; end; + +strout = []; +for index = 1:size(strinori,1) % scan lines + strin = deblank(strinori(index, :)); + lines = {}; + count = 1; + curline = ''; + + while ~isempty( strin ) + [tok strin] = strtok(strin); + if length(curline) + length(tok) +1 > maxlen + lines{count} = curline; + curline = ''; + count = count + 1; + end; + if isempty(curline) curline = tok; + else curline = [ curline ' ' tok ]; + end; + end; + if ~isempty(curline), lines{count} = curline; end; + + % type of delimiter + % ----------------- + if isempty(delimiter) + if ~isempty(lines) + strouttmp = strvcat(lines{:}); + else strouttmp = ''; + end; + if isempty(strouttmp) + strouttmp = ones(1,maxlen)*' '; + elseif size(strouttmp, 2) < maxlen + strouttmp(:,end+1:maxlen) = ' '; + end; + strout = strvcat(strout, strouttmp); + else + strouttmp = lines{1}; + for index = 2:length(lines) + strouttmp = [ strouttmp 10 lines{index} ]; + end; + if index == 1, strout = strouttmp; + else strout = [ strout 10 strouttmp ]; + end; + end; +end; + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/textsc.m b/code/eeglab13_4_4b/functions/sigprocfunc/textsc.m new file mode 100644 index 0000000..fd5e2ea --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/textsc.m @@ -0,0 +1,75 @@ +% textsc() - places text in screen coordinates and places +% a title at the top of the figure. +% +% Usage: +% H = textsc(X,Y,TXT) places the text string, TXT +% at the normalized coordinates X and Y. H is the +% handle to the text object. +% +% H = textsc(TXT,'title') places a title at the top +% of the figure window. This is useful when you +% want to place a single title above multiple +% subplots. +% +% Notes: textsc creates an invisible AXES which occupies +% the entire FIGURE. The units of the AXES are +% normalized (range from 0 to 1). textsc checks +% all the children of the current FIGURE to determine +% if an AXES exist which meets these criteria already +% exist. If one does, then it places the text relative +% to that AXES. +% +% Author: John L. Galenski, January 21, 1994 + +% Written by John L. Galenski III +% All Rights Reserved January 21, 1994 +% LDM031695jlg + +function H = textsc(x,y,txt); + +% Basic error checking +if nargin < 2 + y = 'title'; +end + +% Check to see if AXES already exist +ch = get(gcf,'Children'); +if ~isempty(ch) + try + ind = cellfun(@(x)isequal('axes', x), get(ch, 'type')); + catch + ind = cellfun(@(x)isequal('axes', x), {get(ch, 'type')}); % fix Joe Dien bug 1538 + end; + if any(ind), ch = gca; end; +end; + +ax = findobj(gcf,'Type','axes','Tag','TEXTSC'); +if isempty(ax) + ax = axes('Units','Normal','Position',[0 0 1 1], ... + 'Visible','Off','Tag','TEXTSC'); +else + axes(ax) +end + +% Place the text +if isstr(y) && isstr(x) && strcmp(lower(y),'title') % Subplot title + txt = x; + x = .5; + tmp = text('Units','normal','String','tmp','Position',[0 0 0]); + ext = get(tmp,'Extent'); + delete(tmp) + H = ext(4); + y = 1 - .60*H; +end +h = text(x,y,txt,'VerticalAlignment','Middle', ... + 'HorizontalAlignment','Center','interpreter', 'none' ); + +% Make the original AXES current +if ~isempty(ch) + set(gcf,'CurrentAxes',ch); +end + +% Check for output +if nargout == 1 + H = h; +end diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/timefdetails.m b/code/eeglab13_4_4b/functions/sigprocfunc/timefdetails.m new file mode 100644 index 0000000..fec99ca --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/timefdetails.m @@ -0,0 +1,258 @@ +% timefdetails() - details of the timef() function for time/frequency analysis +% of multiple epochs of single-channel event-related data. +% +% Global Description: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% timef() performs normalized time/frequency averaging using either +% FFT-, wavelet-, or multitaper DFT estimates. The wavelets are N-cycle +% Hanning-windowed sinusoids. (Note: To substitute for hanning() windowing +% gauss() or other windowing, replace the timef.m reference to hanning()). +% +% By default, the two image panels of the output plot show, respectively, the +% event-related spectral perturbation (ERSP) and inter-trial coherence (ITC) +% of the input data. +% +% The ERSP: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The ERSP (S. Makeig, Electroencephalogr Clin Neurophysiol 86:283-93, 1993) +% shows mean log event-loced deviations from epoch-mean (or baseline-mean) power +% at each frequency. If bootstrap statistics are computed (via the 'alpha' +% probability input parameter), (time, freq) points with non-significant +% differences from 0 are colored green in the image (but not in the 'ersp' +% output variable - use the output 'erspboot' variable to re-mask the 'ersp' +% output if desired). The baseline mean spectrum removed from each epoch +% is available as output parameter "powbase". Note that log(power) differences +% are equivalent to log(power ratios) between baseline and observed spectra, +% meaning the implicit ERSP model is one of (multiplicative) amplitude modulation +% of the EEG/MEG spectrum by e.g. subcortical and/or intra-cortical influences. +% +% In the default view, the thin bottom panel below the upper (ERSP) image shows +% the ERSP envelope (the most positive and most negative values at each output +% time point). The thin left panel shows the mean (or baseline) log spectrum +% (blue trace). When bootstrap statistics are computed (via the "alpha" argument), +% the left panel (green trace) also shows the bootstrap significant levels (+/-) +% at each frequency. +% +% The ITC: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% (Inter-trial Coherence, cf. Tallon-Baudry et al., "Phase-locking factor") +% The lower panel shows the degree of tendency for spectral phase at each +% (time, freq) point to repeat across the data epochs. If bootstrap statistics +% are computed (as per the 'alpha' input parameter), non-significant points +% are colored green (but again not in the 'itc' output variable - use the +% itcboot output to re-mask if desired in later plotting). +% +% The lower thin panel shows the time-domain average (ERP) of the input data +% (blue) plus a zero-line (green). The average (ERP) is created principally by +% partial phase resetting of the EEG as measured by the ITC. (While phase resetting +% dominates, event-related spectral power changes (as measured by the ERSP) +% may also play a minor role). The thin left panel shows the frequency-mean ITC +% (blue trace) and, if bootstrap statistics are computed, the ITC significance +% limits at each frequency (green trace). +% +% ITC Math Derivation: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% By definition, linear coherence is +% R=mean(Fxy)/sqrt(mean(abs(Fxx))*mean(abs(Fyy))); +% where Fxy is the cross-spectrum (FxFy*) and Fxx and Fyy the autospectra of +% processes x and y. We define the phase coherence to be +% R=mean(Fxy/(abs(Fxx))*abs(Fyy)); % mean of individually normed Fxy +% To derive the ITC, we consider y to be a stimulus-locked process +% such that, at each time and frequency, angle(Fyy) = 0 and abs(Fyy) = 1. +% Thus Pxy = Pxx, and the (complex) inter-trial phase coherence between x and +% the constant stimulus-locked process y is +% ITC=mean(Pxx/abs(Pxx)); +% +% USAGE: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% >> [ersp,itc,powbase,times,freqs,erspboot,itcboot] ... +% = timef(data,frames,tlimits,srate,cycles,... +% 'key1',value1,'key2',value2, ... ); +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% NOTE: +% * Left-click on subplots to view and zoom in separate windows (uses axcopy()). +% +% Required Inputs: +% data = Single-channel data vector (1,frames*ntrials) (required) +% +% frames = Frames per trial {750} +% Here, a frame is a data point (one channel at one time point) and the data +% is assumed to be composed of concatenated epochs of the same length (frames). +% +% tlimits = [mintime maxtime] (ms) Epoch time limits {[-1000 2000]} +% These should be the starting and ending times of the input epochs. +% +% srate = data sampling rate (Hz) {250} +% This is sample rate per channel (i.e., data frames per second). +% +% cycles = >0 -> Number of cycles in each analysis wavelet +% =0 -> Use FFTs (with constant window length) {0} +% If [wavecycles factor] -> wavelet cycles increase with frequency +% beginning at wavecyles (0 no increase, +% standard wavelets; factor=0 -> fixed epoch length, as in FFT. +% OR multitaper decomposition (with 'mtaper'). +% Here, the user chooses either to use the FFT method (fixed window size +% for all frequencies) or the wavelet DFT method (the data window length +% depends inversely on the frequency, e.g. '3' means that the data +% windows will each be three cycles wide (at each frequency). A higher +% number here (e.g., '5') will narrow the frequency band and widen the +% time window. +% +% Optional Inter-Irial Coherence Type: +% 'type' = ['coher'|'phasecoher'] Compute either linear coherence +% ('coher') or phase coherence ('phasecoher') also known +% as the phase coupling factor {'phasecoher'}. +% +% Optional Detrending: +% 'detret' = ['on'|'off'], Detrend data in time. {'off'} +% 'detrep' = ['on'|'off'], Detrend data across trials (at each time point +% compute the linear trend across the set of ordered trials and +% remove it; not that this also subtract the ERP) {'off'} +% +% Optional FFT/DFT Parameters: +% 'winsize' = If cycles==0: data subwindow length (fastest is 2^n < frames); +% If cycles >0: *longest* window length to use. This determines +% the lowest output frequency {default: ~frames/8} +% When cycles>0, winsize determines the lowest computed frequency. For example, +% with srate=100 and cycles=3, a winsize of 100 means that 3 cycles must fit +% within a 1-sec ( 100-sample) window. So, the lowest output frequency is 3 Hz. +% +% When cycles=0, winsize is the length of data in each FFT window. This may be +% extended with zeroes (to give more output frequencies) using padratio (below). +% +% 'timesout' = Number of output times (int0), this gives the number of frequencies per Hz. +% +% 'maxfreq' = Maximum frequency (Hz) to plot (& to output, if cycles>0) +% If cycles==0, all FFT frequencies are output. {50} +% 'baseline' = Spectral baseline end-time (in ms). Use NaN for no baseline +% removal{0} +% 'powbase' = Baseline spectrum to log-subtract. 'baseline' parameter is +% ignored if this parameter is used {def|NaN->from data} +% This is useful only when you want to use a known baseline spectrum (e.g. from +% another condition) instead of using the actual mean baseline spectrum of the data. +% Otherwise, leave this out or specify as 'NaN' (not a number). +% +% Optional Multitaper Parameters: +% 'mtaper' = If [N W], performs multitaper decomposition. +% (N is the time resolution and W the frequency resolution; +% maximum taper number is 2NW-1). Overwrites 'winsize' and +% 'padratio'. +% If [N W K], forces the use of K Slepian tapers (if possible). +% Phase is calculated using standard methods. +% The use of mutitaper with wavelets (cycles>0) is not +% recommended (as multiwavelets are not implemented). +% Uses Matlab functions DPSS, PMTM. {no multitaper} +% +% Optional Bootstrap Parameters: +% 'alpha' = If non-0, compute two-tailed bootstrap significance prob. +% level. Show non-signif. output values as green. {0} +% This optional parameter lengthens the computation time but gives bootstrap +% estimates of which ERSP and ITC values are significantly different from 0, +% by setting to 0 (green) all non-significant values in the ERSP and ITC images. +% Normal values for alpha are 0 ([], or none) -> no bootstrap computation, or +% 0.01 (which should allow about 1% of random images to appear "significant" +% +% 'naccu' = Number of bootstrap replications to accumulate {200} +% 'baseboot' = Bootstrap baseline subtract (0 -> use 'baseline'; +% 1 -> use whole trial) {0} +% Optional Scalp Map Plotting Parameters: +% 'topovec' = Scalp topography (map) to plot {none} +% 'elocs' = Electrode location file for scalp map {no default} +% File should be ascii in format of >> topoplot example +% This is an optional map-plotting feature. Given an input map vector +% (one weight at each channel, and a electrode location file, timef() plots +% a topoplot()-style 2-d scalp map on the left side of the figure. See +% >> topoplot example % for the format of the electrode location file. +% +% Other Optional Plotting Parameters: +% 'vert' = [vector of ms times] -> plot vertical dashed lines {0 only} +% Use this to add extra vertical dashed lines at significant epoch times. +% Time 0 is marked by default. +% +% 'plotersp' = ['on'|'off'] Plot power spectral perturbations {'on'} +% 'plotitc' = ['on'|'off'] Plot inter trial coherence {'on'} +% 'title' = Optional figure title {none} +% +% 'pboot' = Bootstrap power limits (e.g., from timef()) {from data} +% 'rboot' = Bootstrap ITC limits (e.g., from timef()) {from data} +% These are useful if you want to apply significance limits from another condition +% to new data. {default|NaN, compute from data} +% +% 'linewidth' = Line width for 'marktimes' traces (thick=2, thin=1) {2} +% 'axesfont' = Axes text font size {10} +% 'titlefont' = Title text font size {8} +% +% Outputs: +% ersp = Matrix (nfreqs,timesout) of log spectral diffs. from baseline (dB) +% itc = Matrix (nfreqs,timesout) of inter-trial phase coherence (range: [0 1]) +% Note that when cycles=0, nfreqs is total number of FFT frequencies, which +% typically include frequencies higher than maxfreq. When cycles>0, *no* extra +% (higher) frequencies are computed. +% +% powbase = Baseline power spectrum (removed to compute the ERSP) +% times = Vector of output times (subwindow centers) (in ms). +% freqs = Vector of frequency bin centers (in Hz). +% +% erspboot = Matrix (2,nfreqs) of [lower;upper] ERSP significance diffs. +% itcboot = Matrix (2,nfreqs) of [lower;upper] ITC thresholds (abs., not diffs) +% Note that the itcboot lower bound is practically meaningless. +% +% Plot description: +% Assuming both 'plotersp' and 'plotitc' options are 'on' (= default). The upper panel +% presents the data ERSP (Event-Related Spectral Perturbation) in dB, with mean baseline +% spectral activity (in dB) subtracted. Use "'baseline', NaN" to prevent timef() from +% removing the baseline. The lower panel presents the data ITC (Inter-Trial Coherence). +% Click on any plot axes to pop up a new window (using 'axcopy()') +% -- Upper left marginal panel presents the mean spectrum during the baseline period +% (blue), and when significance is set, the significance threshold at each frequency +% (dotted green-black trace). +% -- The marginal panel under the ERSP image shows the maximum (green) and minimum +% (blue) ERSP values relative to baseline power at each frequency. +% -- The lower left marginal panel shows mean ITC across the imaged time range (blue), +% and when significance is set, the significance threshold (dotted green-black). +% -- The marginal panel under the ITC image shows the ERP (which is produced by ITC +% across the data spectral pass band). +% +% Author: Sigurd Enghoff, Arnaud Delorme & Scott Makeig +% CNL / Salk Institute 1998- | SCCN/INC, UCSD 2002- +% +% See also: crossf() - event-related cross-spectral coherence between two input +% time series. +% +% History: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% timef() was coded by Sigurd Enghoff and Scott Makeig at The Salk +% Institute, La Jolla CA in August, 1998, using methods developed +% in Makeig, 1993. Arno Delorme added the multitaper option, recoded +% the function to use 'keyword','parameter' argument pairs, and added the +% 'type' argument with advice from Joern Anemueller at SCCN/Institute for +% Neural Computation, UCSD in early 2002. + +% Copyright (C) 8/01/00 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/timtopo.m b/code/eeglab13_4_4b/functions/sigprocfunc/timtopo.m new file mode 100644 index 0000000..fd0eae3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/timtopo.m @@ -0,0 +1,493 @@ +% timtopo() - plot all channels of a data epoch on the same axis +% and map its scalp map(s) at selected latencies. +% Usage: +% >> timtopo(data, chan_locs); +% >> timtopo(data, chan_locs, 'key', 'val', ...); +% Inputs: +% data = (channels,frames) single-epoch data matrix +% chan_locs = channel location file or EEG.chanlocs structure. +% See >> topoplot example for file format. +% +% Optional ordered inputs: +% 'limits' = [minms maxms minval maxval] data limits for latency (in ms) and y-values +% (assumes uV) {default|0 -> use [0 npts-1 data_min data_max]; +% else [minms maxms] or [minms maxms 0 0] -> use +% [minms maxms data_min data_max] +% 'plottimes' = [vector] latencies (in ms) at which to plot scalp maps +% {default|NaN -> latency of maximum variance} +% 'title' = [string] plot title {default|0 -> none} +% 'plotchans' = vector of data channel(s) to plot. Note that this does not +% affect scalp topographies {default|0 -> all} +% 'voffsets' = vector of (plotting-unit) distances vertical lines should extend +% above the data (in special cases) {default -> all = standard} +% +% Optional keyword, arg pair inputs (must come after the above): +% 'topokey','val' = optional topoplot() scalp map plotting arguments. See >> help topoplot +% +% Author: Scott Makeig, SCCN/INC/UCSD, La Jolla, 1-10-98 +% +% See also: envtopo(), topoplot() + +% Copyright (C) 1-10-98 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 5-31-00 added o-time line and possibility of plotting 1 channel -sm & mw +% 11-02-99 added maplimits arg -sm +% 01-22-01 added to help message -sm +% 01-25-02 reformated help & license, added link -ad +% 03-15-02 add all topoplot options -ad + +function M = timtopo(data, chan_locs, varargin) + +MAX_TOPOS = 24; + +if nargin < 1 %should this be 2? + help timtopo; + return +end + +[chans,frames] = size(data); +icadefs; + +% +% if nargin > 2 +% if ischar(limits) +% varargin = { limits,plottimes,titl,plotchans,voffsets varargin{:} }; +% +% else +% varargin = { 'limits' limits 'plottimes' plottimes 'title' titl 'plotchans' plotchans 'voffsets' voffsets varargin{:} }; +% end; +% end; + + + +if nargin > 2 && ~ischar(varargin{1}) + options = {}; + if length(varargin) > 0, options = { options{:} 'limits' varargin{1} }; end; + if length(varargin) > 1, options = { options{:} 'plottimes' varargin{2} }; end; + if length(varargin) > 2, options = { options{:} 'title' varargin{3} }; end; + if length(varargin) > 3, options = { options{:} 'plotchans' varargin{4} }; end; + if length(varargin) > 4, options = { options{:} 'voffsets' varargin{5} }; end; + if length(varargin) > 5, options = { options{:} varargin{6:end} }; end; +else + options = varargin; +end; + +fieldlist = { 'limits' 'real' [] 0; + 'plottimes' 'real' [] []; + 'title' 'string' [] ''; + 'plotchans' 'integer' [1:size(data,1)] 0; + 'voffsets' 'real' [] [] ;}; +[g topoargs] = finputcheck(options, fieldlist, 'timtopo', 'ignore'); + +if ischar(g), error(g); end; +%Set Defaults +if isempty(g.title), g.title = ''; end; +if isempty(g.voffsets) || g.voffsets == 0, g.voffsets = zeros(1,MAX_TOPOS); end; +if isempty(g.plotchans) || isequal(g.plotchans,0), g.plotchans = 1:chans; end; +plottimes_set=1; % flag variable +if isempty(g.plottimes) || any(isnan(g.plottimes)), plottimes_set = 0;end; +limitset = 0; %flag variable +if isempty(g.limits), g.limits = 0; end; +if length(g.limits)>1, limitset = 1; end; + + +% if nargin < 7 | voffsets == 0 +% voffsets = zeros(1,MAX_TOPOS); +% end +% +% if nargin < 6 +% plotchans = 0; +% end +% +% if plotchans==0 +% plotchans = 1:chans; +% end +% +% if nargin < 5, +% titl = ''; % DEFAULT NO TITLE +% end +% +% plottimes_set=1; % flag variable +% if nargin< 4 | isempty(plottimes) | any(isnan(plottimes)) +% plottimes_set = 0; +% end +% +% limitset = 0; +% if nargin < 3, +% limits = 0; +% elseif length(limits)>1 +% limitset = 1; +% end + +if nargin < 2 %if first if-statement is changed to 2 should this be 3? + chan_locs = 'chan.locs'; % DEFAULT CHAN_FILE +end +if isnumeric(chan_locs) && chan_locs == 0, + chan_locs = 'chan.locs'; % DEFAULT CHAN_FILE +end + + + % + %%%%%%%%%%%%%%%%%%%%%%% Read and adjust limits %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % defaults: limits == 0 or [0 0 0 0] + if ( length(g.limits) == 1 & g.limits==0) | (length(g.limits)==4 & ~any(g.limits)) + xmin=0; + xmax=frames-1; + ymin=min(min(data)); + ymax=max(max(data)); + elseif length(g.limits) == 2 % [minms maxms] only + ymin=min(min(data)); + ymax=max(max(data)); + xmin = g.limits(1); + xmax = g.limits(2); + elseif length(g.limits) == 4 + xmin = g.limits(1); + xmax = g.limits(2); + if any(g.limits([3 4])) + ymin = g.limits(3); + ymax = g.limits(4); + else % both 0 + ymin=min(min(data)); + ymax=max(max(data)); + end + else + fprintf('timtopo(): limits format not correct. See >> help timtopo.\n'); + return + end; + + if xmax == 0 & xmin == 0, + x = (0:1:frames-1); + xmin = 0; + xmax = frames-1; + else + dx = (xmax-xmin)/(frames-1); + x=xmin*ones(1,frames)+dx*(0:frames-1); % compute x-values + end; + if xmax<=xmin, + fprintf('timtopo() - in limits, maxms must be > minms.\n') + return + end + + if ymax == 0 & ymin == 0, + ymax=max(max(data)); + ymin=min(min(data)); + end + if ymax<=ymin, + fprintf('timtopo() - in limits, maxval must be > minmval.\n') + return + end + +sampint = (xmax-xmin)/(frames-1); % sampling interval = 1000/srate; +x = xmin:sampint:xmax; % make vector of x-values + +% +%%%%%%%%%%%%%%% Compute plot times/frames %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if plottimes_set == 0 + [mx plotframes] = max(sum(data.*data)); + % default plotting frame has max variance + if nargin< 4 | isempty(g.plottimes) + g.plottimes = x(plotframes); + else + g.plottimes(find(isnan(g.plottimes))) = x(plotframes); + end; + plottimes_set = 1; +end; + +if plottimes_set == 1 + ntopos = length(g.plottimes); + if ntopos > MAX_TOPOS + fprintf('timtopo(): too many plottimes - only first %d will be shown!\n',MAX_TOPOS); + g.plottimes = g.plottimes(1:MAX_TOPOS); + ntopos = MAX_TOPOS; + end + + if max(g.plottimes) > xmax | min(g.plottimes)< xmin + fprintf(... +'timtopo(): at least one plottimes value outside of epoch latency range - cannot plot.\n'); + return + end + + g.plottimes = sort(g.plottimes); % put map latencies in ascending order, + % else map lines would cross. + xshift = [x(2:frames) xmax+1]; % 5/22/2014 Ramon: '+1' was added to avoid errors when time== max(x) in line 231 + plotframes = ones(size(g.plottimes)); + for t = 1:ntopos + time = g.plottimes(t); + plotframes(t) = find(time>=x & time < xshift); + end +end + +vlen = length(g.voffsets); % extend voffsets if necessary +i=1; +while vlen< ntopos + g.voffsets = [g.voffsets g.voffsets(i)]; + i=i+1; + vlen=vlen+1; +end + +% +%%%%%%%%%%%%%%%% Compute title and axes font sizes %%%%%%%%%%%%%%% +% +pos = get(gca,'Position'); +axis('off') +cla % clear the current axes +if pos(4)>0.70 + titlefont= 16; + axfont = 16; +elseif pos(4)>0.40 + titlefont= 14; + axfont = 14; +elseif pos(4)>0.30 + titlefont= 12; + axfont = 12; +elseif pos(4)>0.22 + titlefont= 10; + axfont = 10; +else + titlefont= 8; + axfont = 8; +end + +% +%%%%%%%%%%%%%%%% Compute topoplot head width and separation %%%%%%%%%%%%%%% +% +head_sep = 0.2; +topowidth = pos(3)/((6*ntopos-1)/5); % width of each topoplot +if topowidth> 0.25*pos(4) % dont make too large (more than 1/4 of axes width)! + topowidth = 0.25*pos(4); +end + +halfn = floor(ntopos/2); +if rem(ntopos,2) == 1 % odd number of topos + topoleft = pos(3)/2 - (ntopos/2+halfn*head_sep)*topowidth; +else % even number of topos + topoleft = pos(3)/2 - ((halfn)+(halfn-1)*head_sep)*topowidth; +end +topoleft = topoleft - 0.01; % adjust left a bit for colorbar + +if max(plotframes) > frames | min(plotframes) < 1 + fprintf('Requested map frame %d is outside data range (1-%d)\n',max(plotframes),frames); + return +end + +% +%%%%%%%%%%%%%%%%%%%% Print times and frames %%%%%%%%%%%%%%%%%%%%%%%%%% +% + +fprintf('Scalp maps will show latencies: '); +for t=1:ntopos + fprintf('%4.0f ',g.plottimes(t)); +end +fprintf('\n'); +fprintf(' at frames: '); +for t=1:ntopos + fprintf('%4d ',plotframes(t)); +end +fprintf('\n'); + +% +%%%%%%%%%%%%%%%%%%%%%%% Plot the data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% +%%%%%%%%%%%% site the plot at bottom of the figure %%%%%%%%%%%%%%%%%% +% +axdata = axes('Units','Normalized','Position',[pos(1) pos(2) pos(3) 0.6*pos(4)],'FontSize',axfont); +set(axdata,'Color',BACKCOLOR); + +g.limits = get(axdata,'Ylim'); +set(axdata,'GridLineStyle',':') +set(axdata,'Xgrid','off') +set(axdata,'Ygrid','on') +axes(axdata) +axcolor = get(gcf,'Color'); +set(axdata,'Color',BACKCOLOR); +pl=plot(x,data(g.plotchans,:)'); % plot the data +if length(g.plotchans)==1 + set(pl,'color','k'); + set(pl,'linewidth',2); +end +xl= xlabel('Latency (ms)'); +set(xl,'FontSize',axfont); +yl=ylabel('Potential (\muV)'); +set(yl,'FontSize',axfont,'FontAngle','normal'); +axis([xmin xmax ymin ymax]); +hold on + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot zero time line %%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if xmin<0 & xmax>0 + plot([0 0],[ymin ymax],'k:','linewidth',1.5); +else + fprintf('xmin %g and xmax %g do not cross time 0.\n',xmin,xmax) +end +% +%%%%%%%%%%%%%%%%%%%%%%%%% Draw vertical lines %%%%%%%%%%%%%%%%%%%%%%%%%% +% +width = xmax-xmin; +height = ymax-ymin; +lwidth = 1.5; % increment line thickness + +for t=1:ntopos % dfraw vertical lines through the data at topoplot frames + if length(g.plotchans)>1 | g.voffsets(t) + l1 = plot([g.plottimes(t) g.plottimes(t)],... + [min(data(g.plotchans,plotframes(t))) ... + g.voffsets(t) + max(data(g.plotchans,plotframes(t)))],'w'); % white underline behind + set(l1,'linewidth',2); + l1 = plot([g.plottimes(t) g.plottimes(t)],... + [min(data(g.plotchans,plotframes(t))) ... + g.voffsets(t) + max(data(g.plotchans,plotframes(t)))],'b'); % blue line + set(l1,'linewidth',lwidth); + end +end +% +%%%%%%%%%%%%%%%%%%%%%%%%% Draw oblique lines %%%%%%%%%%%%%%%%%%%%%%%%%% +% +axall = axes('Position',pos,... + 'Visible','Off','FontSize',axfont); % whole-gca invisible axes +axes(axall) +set(axall,'Color',BACKCOLOR); +axis([0 1 0 1]) + axes(axall) + axis([0 1 0 1]); + set(gca,'Visible','off'); % make whole-figure axes invisible + +for t=1:ntopos % draw oblique lines through to the topoplots + maxdata = max(data(:,plotframes(t))); % max data value at plotframe + axtp = axes('Units','Normalized','Position',... + [pos(1)+topoleft+(t-1)*(1+head_sep)*topowidth ... + pos(2)+0.66*pos(4) ... + topowidth ... + topowidth*(1+head_sep)]); % this will be the topoplot axes + % topowidth]); % this will be the topoplot axes + axis([-1 1 -1 1]); + + from = changeunits([g.plottimes(t),maxdata],axdata,axall); % data axes + to = changeunits([0,-0.74],axtp,axall); % topoplot axes + delete(axtp); + axes(axall); % whole figure axes + l1 = plot([from(1) to(1)],[from(2) to(2)]); + set(l1,'linewidth',lwidth); + + hold on + set(axall,'Visible','off'); + axis([0 1 0 1]); +end +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot the topoplots %%%%%%%%%%%%%%%%%%%%%%%%%% +% +topoaxes = zeros(1,ntopos); +for t=1:ntopos + % [pos(3)*topoleft+pos(1)+(t-1)*(1+head_sep)*topowidth ... + axtp = axes('Units','Normalized','Position',... + [topoleft+pos(1)+(t-1)*(1+head_sep)*topowidth ... + pos(2)+0.66*pos(4) ... + topowidth topowidth*(1+head_sep)]); + axes(axtp) % topoplot axes + topoaxes(t) = axtp; % save axes handles + cla + + if topowidth<0.12 + topoargs = { topoargs{:} 'electrodes' 'off' }; + end + topoplot( data(:,plotframes(t)),chan_locs, topoargs{:}); + + % Else make a 3-D headplot + % + % headplot(data(:,plotframes(t)),'chan.spline'); + + timetext = [num2str(g.plottimes(t),'%4.0f')]; + % timetext = [num2str(plottimes(t),'%4.0f') ' ms']; % add ' ms' + text(0.00,0.80,timetext,'FontSize',axfont-3,'HorizontalAlignment','Center'); % ,'fontweight','bold'); +end + +% +%%%%%%%%%%%%%%%%%%% Plot a topoplot colorbar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +axcb = axes('Position',[pos(1)+pos(3)*0.995 pos(2)+0.62*pos(4) pos(3)*0.02 pos(4)*0.09]); +h=cbar(axcb); % colorbar axes +pos_cb = get(axcb,'Position'); +set(h,'Ytick',[]); + +axes(axall) +set(axall,'Color',axcolor); +% +%%%%%%%%%%%%%%%%%%%%% Plot the color bar '+' and '-' %%%%%%%%%%%%%%%%%%%%%%%%%% +% +text(0.986,0.695,'+','FontSize',axfont,'HorizontalAlignment','Center'); +text(0.986,0.625,'-','FontSize',axfont,'HorizontalAlignment','Center'); + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot the plot title if any %%%%%%%%%%%%%%%%%%%%%%%%%% +% +% plot title between data panel and topoplots (to avoid crowding at top of +% figure), on the left +ttl = text(0.03,0.635,g.title,'FontSize',titlefont,'HorizontalAlignment','left'); % 'FontWeight','Bold'); + +% textent = get(ttl,'extent'); +% titlwidth = textent(3); +% ttlpos = get(ttl,'position'); +% set(ttl,'position',[ ttlpos(2), ttlpos(3)]); + +axes(axall) +set(axall,'layer','top'); % bring component lines to top +for t = 1:ntopos + set(topoaxes(t),'layer','top'); % bring topoplots to very top +end + + if ~isempty(varargin) + try, + if ~isempty( strmatch( 'absmax', varargin)) + text(0.86,0.624,'0','FontSize',axfont,'HorizontalAlignment','Center'); + end; + catch, end; + end + +% +% Turn on axcopy() +% + +% clicking on ERP pop_up topoplot +% ------------------------------- +disp('Click on ERP waveform to show scalp map at specific latency'); + +dat.times = x; +dat.erp = data; +dat.chanlocs = chan_locs; +dat.options = topoargs; +dat.srate = (size(data,2)-1)/(x(end)-x(1))*1000; +dat.axes = axtp; +dat.line = l1; + +cb_code = [ 'tmppos = get(gca, ''currentpoint'');' ... + 'dattmp = get(gcf, ''userdata'');' ... + 'set(dattmp.line, ''visible'', ''off'');' ... + 'axes(dattmp.axes); cla;' ... + 'latpoint = round((tmppos(1)-dattmp.times(1))/1000*dattmp.srate);' ... + 'topoplot(dattmp.erp(:,latpoint), dattmp.chanlocs, dattmp.options{:});' ... + 'title(sprintf(''%.0f ms'', tmppos(1)));' ... + 'clear latpoint dattmp;' ... + ]; +axcopy; + +set(gcf, 'userdata', dat); +set(axdata, 'ButtonDownFcn', cb_code); %windowbuttondownfcn', cb_code); +set(pl, 'ButtonDownFcn', cb_code); + +%axcopy(gcf, cb_code); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/topo2sph.m b/code/eeglab13_4_4b/functions/sigprocfunc/topo2sph.m new file mode 100644 index 0000000..ce6d196 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/topo2sph.m @@ -0,0 +1,126 @@ +% topo2sph() - convert a topoplot() style 2-D polar-coordinate +% channel locations file to a 3-D spherical-angle +% file for use with headplot() +% Usage: +% >> [c h] = topo2sph('eloc_file','eloc_outfile', method, unshrink); +% >> [c h] = topo2sph( topoarray, method, unshrink ); +% +% Inputs: +% 'eloc_file' = filename of polar 2-D electrode locations file used by +% topoplot(). See >> topoplot example or cart2topo() +% 'eloc_outfile' = output file of 3-D electrode locations in spherical angle +% coords. for use in headplot(). +% topoarray = polar array of 2-D electrode locations, with polar angle +% in the first column and radius in the second one. +% method = [1|2] 1 is for Besa compatibility, 2 is for +% compatibility with Matlab function cart2sph(). {default: 2} +% unshrink = [0> help topoplot +% Outputs: +% c = coronal rotation +% h = horizontal rotation +% +% Author: Scott Makeig & Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 1999 +% +% See also: sph2topo(), cart2topo() + +% Copyright (C) 1999 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-16-00 changed name to topo2sph() for compatibility with cart2topo() -sm +% 01-25-02 reformated help & license -ad +% 03-22-02 complete remodeling for returning arguments and taking arrays -ad + +function [c, h] = topo2sph(eloc_locs,eloc_angles, method, unshrink) + +MAXCHANS = 1024; + +if nargin < 1 + help topo2sph; + return; +end; +if nargin > 1 && ~isstr(eloc_angles) + if nargin > 2 + unshrink = method; + end; + method = eloc_angles; +else + method = 2; +end; + +if isstr(eloc_locs) + fid = fopen(eloc_locs); + if fid<1, + fprintf('topo2sph()^G: cannot open eloc_loc file (%s)\n',eloc_locs) + return + end + E = fscanf(fid,'%d %f %f %s',[7 MAXCHANS]); + E = E'; + fclose(fid); +else + E = eloc_locs; + E = [ ones(size(E,1),1) E ]; +end; + +if nargin > 1 & isstr(eloc_angles) + if exist(eloc_angles)==2, + fprintf('topo2sph: eloc_angles file (%s) already exists and will be erased.\n',eloc_angles); + end + + fid = fopen(eloc_angles,'a'); + if fid<1, + fprintf('topo2sph()^G: cannot open eloc_angles file (%s)\n',eloc_angles) + return + end +end; + +if method == 2 + t = E(:,2); % theta + r = E(:,3); % radius + h = -t; % horizontal rotation + c = (0.5-r)*180; +else + for e=1:size(E,1) + % (t,r) -> (c,h) + + t = E(e,2); % theta + r = E(e,3); % radius + r = r*unshrink; + if t>=0 + h(e) = 90-t; % horizontal rotation + else + h(e) = -(90+t); + end + if t~=0 + c(e) = sign(t)*180*r; % coronal rotation + else + c(e) = 180*r; + end + end; + t = t'; + r = r'; +end; + +for e=1:size(E,1) + if nargin > 1 & isstr(eloc_angles) + chan = E(e,4:7); + fprintf('%d %g %g %s\n',E(e,1),c(e),h(e),chan); + fprintf(fid,'%d %g %g %s\n',E(e,1),c(e),h(e),chan); + end; +end + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/topoplot.m b/code/eeglab13_4_4b/functions/sigprocfunc/topoplot.m new file mode 100644 index 0000000..d0e6fb9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/topoplot.m @@ -0,0 +1,1658 @@ +% topoplot() - plot a topographic map of a scalp data field in a 2-D circular view +% (looking down at the top of the head) using interpolation on a fine +% cartesian grid. Can also show specified channnel location(s), or return +% an interpolated value at an arbitrary scalp location (see 'noplot'). +% By default, channel locations below head center (arc_length 0.5) are +% shown in a 'skirt' outside the cartoon head (see 'plotrad' and 'headrad' +% options below). Nose is at top of plot; left is left; right is right. +% Using option 'plotgrid', the plot may be one or more rectangular grids. +% Usage: +% >> topoplot(datavector, EEG.chanlocs); % plot a map using an EEG chanlocs structure +% >> topoplot(datavector, 'my_chan.locs'); % read a channel locations file and plot a map +% >> topoplot('example'); % give an example of an electrode location file +% >> [h grid_or_val plotrad_or_grid, xmesh, ymesh]= ... +% topoplot(datavector, chan_locs, 'Input1','Value1', ...); +% Required Inputs: +% datavector - single vector of channel values. Else, if a vector of selected subset +% (int) channel numbers -> mark their location(s) using 'style' 'blank'. +% chan_locs - name of an EEG electrode position file (>> topoplot example). +% Else, an EEG.chanlocs structure (>> help readlocs or >> topoplot example) +% Optional inputs: +% 'maplimits' - 'absmax' -> scale map colors to +/- the absolute-max (makes green 0); +% 'maxmin' -> scale colors to the data range (makes green mid-range); +% [lo.hi] -> use user-definined lo/hi limits +% {default: 'absmax'} +% 'style' - 'map' -> plot colored map only +% 'contour' -> plot contour lines only +% 'both' -> plot both colored map and contour lines +% 'fill' -> plot constant color between contour lines +% 'blank' -> plot electrode locations only {default: 'both'} +% 'electrodes' - 'on','off','labels','numbers','ptslabels','ptsnumbers'. To set the 'pts' +% marker,,see 'Plot detail options' below. {default: 'on' -> mark electrode +% locations with points ('.') unless more than 64 channels, then 'off'}. +% 'plotchans' - [vector] channel numbers (indices) to use in making the head plot. +% {default: [] -> plot all chans} +% 'chantype' - cell array of channel type(s) to plot. Will also accept a single quoted +% string type. Channel type for channel k is field EEG.chanlocs(k).type. +% If present, overrides 'plotchans' and also 'chaninfo' with field +% 'chantype'. Ex. 'EEG' or {'EEG','EOG'} {default: all, or 'plotchans' arg} +% 'plotgrid' - [channels] Plot channel data in one or more rectangular grids, as +% specified by [channels], a position matrix of channel numbers defining +% the topographic locations of the channels in the grid. Zero values are +% given the figure background color; negative integers, the color of the +% polarity-reversed channel values. Ex: >> figure; ... +% >> topoplot(values,'chanlocs','plotgrid',[11 12 0; 13 14 15]); +% % Plot a (2,3) grid of data values from channels 11-15 with one empty +% grid cell (top right) {default: no grid plot} +% 'nosedir' - ['+X'|'-X'|'+Y'|'-Y'] direction of nose {default: '+X'} +% 'chaninfo' - [struct] optional structure containing fields 'nosedir', 'plotrad' +% and/or 'chantype'. See these (separate) field definitions above, below. +% {default: nosedir +X, plotrad 0.5, all channels} +% 'plotrad' - [0.15<=float<=1.0] plotting radius = max channel arc_length to plot. +% See >> topoplot example. If plotrad > 0.5, chans with arc_length > 0.5 +% (i.e. below ears-eyes) are plotted in a circular 'skirt' outside the +% cartoon head. See 'intrad' below. {default: max(max(chanlocs.radius),0.5); +% If the chanlocs structure includes a field chanlocs.plotrad, its value +% is used by default}. +% 'headrad' - [0.15<=float<=1.0] drawing radius (arc_length) for the cartoon head. +% NOTE: Only headrad = 0.5 is anatomically correct! 0 -> don't draw head; +% 'rim' -> show cartoon head at outer edge of the plot {default: 0.5} +% 'intrad' - [0.15<=float<=1.0] radius of the scalp map interpolation area (square or +% disk, see 'intsquare' below). Interpolate electrodes in this area and use +% this limit to define boundaries of the scalp map interpolated data matrix +% {default: max channel location radius} +% 'intsquare' - ['on'|'off'] 'on' -> Interpolate values at electrodes located in the whole +% square containing the (radius intrad) interpolation disk; 'off' -> Interpolate +% values from electrodes shown in the interpolation disk only {default: 'on'}. +% 'conv' - ['on'|'off'] Show map interpolation only out to the convext hull of +% the electrode locations to minimize extrapolation. {default: 'off'} +% 'noplot' - ['on'|'off'|[rad theta]] do not plot (but return interpolated data). +% Else, if [rad theta] are coordinates of a (possibly missing) channel, +% returns interpolated value for channel location. For more info, +% see >> topoplot 'example' {default: 'off'} +% 'verbose' - ['on'|'off'] comment on operations on command line {default: 'on'}. +% +% Plot detail options: +% 'drawaxis' - ['on'|'off'] draw axis on the top left corner. +% 'emarker' - Matlab marker char | {markerchar color size linewidth} char, else cell array +% specifying the electrode 'pts' marker. Ex: {'s','r',32,1} -> 32-point solid +% red square. {default: {'.','k',[],1} where marker size ([]) depends on the number +% of channels plotted}. +% 'emarker2' - {markchans}|{markchans marker color size linewidth} cell array specifying +% an alternate marker for specified 'plotchans'. Ex: {[3 17],'s','g'} +% {default: none, or if {markchans} only are specified, then {markchans,'o','r',10,1}} +% 'hcolor' - color of the cartoon head. Use 'hcolor','none' to plot no head. {default: 'k' = black} +% 'shading' - 'flat','interp' {default: 'flat'} +% 'numcontour' - number of contour lines {default: 6} +% 'contourvals' - values for contour {default: same as input values} +% 'pmask' - values for masking topoplot. Array of zeros and 1 of the same size as the input +% value array {default: []} +% 'color' - color of the contours {default: dark grey} +% 'whitebk ' - ('on'|'off') make the background color white (e.g., to print empty plotgrid channels) +% {default: 'off'} +% 'gridscale' - [int > 32] size (nrows) of interpolated scalp map data matrix {default: 67} +% 'colormap' - (n,3) any size colormap {default: existing colormap} +% 'circgrid' - [int > 100] number of elements (angles) in head and border circles {201} +% 'emarkercolor' - cell array of colors for 'blank' option. +% 'plotdisk' - ['on'|'off'] plot disk instead of dots for electrodefor 'blank' option. Size of disk +% is controled by input values at each electrode. If an imaginary value is provided, +% plot partial circle with red for the real value and blue for the imaginary one. +% +% Dipole plotting options: +% 'dipole' - [xi yi xe ye ze] plot dipole on the top of the scalp map +% from coordinate (xi,yi) to coordinates (xe,ye,ze) (dipole head +% model has radius 1). If several rows, plot one dipole per row. +% Coordinates returned by dipplot() may be used. Can accept +% an EEG.dipfit.model structure (See >> help dipplot). +% Ex: ,'dipole',EEG.dipfit.model(17) % Plot dipole(s) for comp. 17. +% 'dipnorm' - ['on'|'off'] normalize dipole length {default: 'on'}. +% 'diporient' - [-1|1] invert dipole orientation {default: 1}. +% 'diplen' - [real] scale dipole length {default: 1}. +% 'dipscale' - [real] scale dipole size {default: 1}. +% 'dipsphere' - [real] size of the dipole sphere. {default: 85 mm}. +% 'dipcolor' - [color] dipole color as Matlab code code or [r g b] vector +% {default: 'k' = black}. +% Outputs: +% handle - handle of the colored surface.If +% contour only is plotted, then is the handle of +% the countourgroup. (If no surface or contour is plotted, +% return "gca", the handle of the current plot) +% grid_or_val - [matrix] the interpolated data image (with off-head points = NaN). +% Else, single interpolated value at the specified 'noplot' arg channel +% location ([rad theta]), if any. +% plotrad_or_grid - IF grid image returned above, then the 'plotrad' radius of the grid. +% Else, the grid image +% xmesh, ymesh - x and y values of the returned grid (above) +% +% Chan_locs format: +% See >> topoplot 'example' +% +% Examples: +% +% To plot channel locations only: +% >> figure; topoplot([],EEG.chanlocs,'style','blank','electrodes','labelpoint','chaninfo',EEG.chaninfo); +% +% Notes: - To change the plot map masking ring to a new figure background color, +% >> set(findobj(gca,'type','patch'),'facecolor',get(gcf,'color')) +% - Topoplots may be rotated. From the commandline >> view([deg 90]) {default: [0 90]) +% +% Authors: Andy Spydell, Colin Humphries, Arnaud Delorme & Scott Makeig +% CNL / Salk Institute, 8/1996-/10/2001; SCCN/INC/UCSD, Nov. 2001 - +% +% See also: timtopo(), envtopo() + +% Deprecated options: +% 'shrink' - ['on'|'off'|'force'|factor] Deprecated. 'on' -> If max channel arc_length +% > 0.5, shrink electrode coordinates towards vertex to plot all channels +% by making max arc_length 0.5. 'force' -> Normalize arc_length +% so the channel max is 0.5. factor -> Apply a specified shrink +% factor (range (0,1) = shrink fraction). {default: 'off'} +% 'electcolor' {'k'} ... electrode marking details and their {defaults}. +% 'emarker' {'.'}|'emarkersize' {14}|'emarkersizemark' {40}|'efontsize' {var} - +% electrode marking details and their {defaults}. +% 'ecolor' - color of the electrode markers {default: 'k' = black} +% 'interplimits' - ['electrodes'|'head'] 'electrodes'-> interpolate the electrode grid; +% 'head'-> interpolate the whole disk {default: 'head'}. + +% Unimplemented future options: + +% Copyright (C) Colin Humphries & Scott Makeig, CNL / Salk Institute, Aug, 1996 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Topoplot Version 2.1 +% Early development history: +% Begun by Andy Spydell and Scott Makeig, NHRC, 7-23-96 +% 8-96 Revised by Colin Humphries, CNL / Salk Institute, La Jolla CA +% -changed surf command to imagesc (faster) +% -can now handle arbitrary scaling of electrode distances +% -can now handle non integer angles in chan_locs +% 4-4-97 Revised again by Colin Humphries, reformatted by SM +% -added parameters +% -changed chan_locs format +% 2-26-98 Revised by Colin +% -changed image back to surface command +% -added fill and blank styles +% -removed extra background colormap entry (now use any colormap) +% -added parameters for electrode colors and labels +% -now each topoplot axes use the caxis command again. +% -removed OUTPUT parameter +% 3-11-98 changed default emarkersize, improve help msg -sm +% 5-24-01 made default emarkersize vary with number of channels -sm +% 01-25-02 reformated help & license, added link -ad +% 03-15-02 added readlocs and the use of eloc input structure -ad +% 03-25-02 added 'labelpoint' options and allow Values=[] -ad &sm +% 03-25-02 added details to "Unknown parameter" warning -sm & ad + +function [handle,Zi,grid,Xi,Yi] = topoplot(Values,loc_file,varargin) + +% +%%%%%%%%%%%%%%%%%%%%%%%% Set defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +icadefs % read defaults MAXTOPOPLOTCHANS and DEFAULT_ELOC and BACKCOLOR +if ~exist('BACKCOLOR') % if icadefs.m does not define BACKCOLOR + BACKCOLOR = [.93 .96 1]; % EEGLAB standard +end +whitebk = 'off'; % by default, make gridplot background color = EEGLAB screen background color + +persistent warningInterp; + +plotgrid = 'off'; +plotchans = []; +noplot = 'off'; +handle = []; +Zi = []; +chanval = NaN; +rmax = 0.5; % actual head radius - Don't change this! +INTERPLIMITS = 'head'; % head, electrodes +INTSQUARE = 'on'; % default, interpolate electrodes located though the whole square containing + % the plotting disk +default_intrad = 1; % indicator for (no) specified intrad +MAPLIMITS = 'absmax'; % absmax, maxmin, [values] +GRID_SCALE = 67; % plot map on a 67X67 grid +CIRCGRID = 201; % number of angles to use in drawing circles +AXHEADFAC = 1.3; % head to axes scaling factor +CONTOURNUM = 6; % number of contour levels to plot +STYLE = 'both'; % default 'style': both,straight,fill,contour,blank +HEADCOLOR = [0 0 0]; % default head color (black) +CCOLOR = [0.2 0.2 0.2]; % default contour color +ELECTRODES = []; % default 'electrodes': on|off|label - set below +MAXDEFAULTSHOWLOCS = 64;% if more channels than this, don't show electrode locations by default +EMARKER = '.'; % mark electrode locations with small disks +ECOLOR = [0 0 0]; % default electrode color = black +EMARKERSIZE = []; % default depends on number of electrodes, set in code +EMARKERLINEWIDTH = 1; % default edge linewidth for emarkers +EMARKERSIZE1CHAN = 20; % default selected channel location marker size +EMARKERCOLOR1CHAN = 'red'; % selected channel location marker color +EMARKER2CHANS = []; % mark subset of electrode locations with small disks +EMARKER2 = 'o'; % mark subset of electrode locations with small disks +EMARKER2COLOR = 'r'; % mark subset of electrode locations with small disks +EMARKERSIZE2 = 10; % default selected channel location marker size +EMARKER2LINEWIDTH = 1; +EFSIZE = get(0,'DefaultAxesFontSize'); % use current default fontsize for electrode labels +HLINEWIDTH = 2; % default linewidth for head, nose, ears +BLANKINGRINGWIDTH = .035;% width of the blanking ring +HEADRINGWIDTH = .007;% width of the cartoon head ring +SHADING = 'flat'; % default 'shading': flat|interp +shrinkfactor = []; % shrink mode (dprecated) +intrad = []; % default interpolation square is to outermost electrode (<=1.0) +plotrad = []; % plotting radius ([] = auto, based on outermost channel location) +headrad = []; % default plotting radius for cartoon head is 0.5 +squeezefac = 1.0; +MINPLOTRAD = 0.15; % can't make a topoplot with smaller plotrad (contours fail) +VERBOSE = 'off'; +MASKSURF = 'off'; +CONVHULL = 'off'; % dont mask outside the electrodes convex hull +DRAWAXIS = 'off'; +PLOTDISK = 'off'; +CHOOSECHANTYPE = 0; +ContourVals = Values; +PMASKFLAG = 0; +COLORARRAY = { [1 0 0] [0.5 0 0] [0 0 0] }; +%COLORARRAY2 = { [1 0 0] [0.5 0 0] [0 0 0] }; +gb = [0 0]; +COLORARRAY2 = { [gb 0] [gb 1/4] [gb 2/4] [gb 3/4] [gb 1] }; + +%%%%%% Dipole defaults %%%%%%%%%%%% +DIPOLE = []; +DIPNORM = 'on'; +DIPSPHERE = 85; +DIPLEN = 1; +DIPSCALE = 1; +DIPORIENT = 1; +DIPCOLOR = [0 0 0]; +NOSEDIR = '+X'; +CHANINFO = []; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% +%%%%%%%%%%%%%%%%%%%%%%% Handle arguments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargin< 1 + help topoplot; + return +end + +% calling topoplot from Fieldtrip +% ------------------------------- +fieldtrip = 0; +if nargin < 2, loc_file = []; end; +if isstruct(Values) | ~isstruct(loc_file), fieldtrip == 1; end; +if isstr(loc_file), if exist(loc_file) ~= 2, fieldtrip == 1; end; end; +if fieldtrip + error('Wrong calling format, are you trying to use the topoplot Fieldtrip function?'); +end; + +nargs = nargin; +if nargs == 1 + if isstr(Values) + if any(strcmp(lower(Values),{'example','demo'})) + fprintf(['This is an example of an electrode location file,\n',... + 'an ascii file consisting of the following four columns:\n',... + ' channel_number degrees arc_length channel_name\n\n',... + 'Example:\n',... + ' 1 -18 .352 Fp1 \n',... + ' 2 18 .352 Fp2 \n',... + ' 5 -90 .181 C3 \n',... + ' 6 90 .181 C4 \n',... + ' 7 -90 .500 A1 \n',... + ' 8 90 .500 A2 \n',... + ' 9 -142 .231 P3 \n',... + '10 142 .231 P4 \n',... + '11 0 .181 Fz \n',... + '12 0 0 Cz \n',... + '13 180 .181 Pz \n\n',... + ... + 'In topoplot() coordinates, 0 deg. points to the nose, positive\n',... + 'angles point to the right hemisphere, and negative to the left.\n',... + 'The model head sphere has a circumference of 2; the vertex\n',... + '(Cz) has arc_length 0. Locations with arc_length > 0.5 are below\n',... + 'head center and are plotted outside the head cartoon.\n',... + 'Option plotrad controls how much of this lower-head "skirt" is shown.\n',... + 'Option headrad controls if and where the cartoon head will be drawn.\n',... + 'Option intrad controls how many channels will be included in the interpolation.\n',... + ]) + return + end + end +end +if nargs < 2 + loc_file = DEFAULT_ELOC; + if ~exist(loc_file) + fprintf('default locations file "%s" not found - specify chan_locs in topoplot() call.\n',loc_file) + error(' ') + end +end +if isempty(loc_file) + loc_file = 0; +end +if isnumeric(loc_file) & loc_file == 0 + loc_file = DEFAULT_ELOC; +end + +if nargs > 2 + if ~(round(nargs/2) == nargs/2) + error('Odd number of input arguments??') + end + for i = 1:2:length(varargin) + Param = varargin{i}; + Value = varargin{i+1}; + if ~isstr(Param) + error('Flag arguments must be strings') + end + Param = lower(Param); + switch Param + case 'conv' + CONVHULL = lower(Value); + if ~strcmp(CONVHULL,'on') & ~strcmp(CONVHULL,'off') + error('Value of ''conv'' must be ''on'' or ''off''.'); + end + case 'colormap' + if size(Value,2)~=3 + error('Colormap must be a n x 3 matrix') + end + colormap(Value) + case 'plotdisk' + PLOTDISK = lower(Value); + if ~strcmp(PLOTDISK,'on') & ~strcmp(PLOTDISK,'off') + error('Value of ''plotdisk'' must be ''on'' or ''off''.'); + end + case 'intsquare' + INTSQUARE = lower(Value); + if ~strcmp(INTSQUARE,'on') & ~strcmp(INTSQUARE,'off') + error('Value of ''intsquare'' must be ''on'' or ''off''.'); + end + case 'emarkercolors' + COLORARRAY = Value; + case {'interplimits','headlimits'} + if ~isstr(Value) + error('''interplimits'' value must be a string') + end + Value = lower(Value); + if ~strcmp(Value,'electrodes') & ~strcmp(Value,'head') + error('Incorrect value for interplimits') + end + INTERPLIMITS = Value; + case 'verbose' + VERBOSE = Value; + case 'nosedir' + NOSEDIR = Value; + if isempty(strmatch(lower(NOSEDIR), { '+x', '-x', '+y', '-y' })) + error('Invalid nose direction'); + end; + case 'chaninfo' + CHANINFO = Value; + if isfield(CHANINFO, 'nosedir'), NOSEDIR = CHANINFO.nosedir; end; + if isfield(CHANINFO, 'shrink' ), shrinkfactor = CHANINFO.shrink; end; + if isfield(CHANINFO, 'plotrad') & isempty(plotrad), plotrad = CHANINFO.plotrad; end; + if isfield(CHANINFO, 'chantype') + chantype = CHANINFO.chantype; + if ischar(chantype), chantype = cellstr(chantype); end + CHOOSECHANTYPE = 1; + end + case 'chantype' + chantype = Value; + CHOOSECHANTYPE = 1; + if ischar(chantype), chantype = cellstr(chantype); end + if ~iscell(chantype), error('chantype must be cell array. e.g. {''EEG'', ''EOG''}'); end + case 'drawaxis' + DRAWAXIS = Value; + case 'maplimits' + MAPLIMITS = Value; + case 'masksurf' + MASKSURF = Value; + case 'circgrid' + CIRCGRID = Value; + if isstr(CIRCGRID) | CIRCGRID<100 + error('''circgrid'' value must be an int > 100'); + end + case 'style' + STYLE = lower(Value); + case 'numcontour' + CONTOURNUM = Value; + case 'electrodes' + ELECTRODES = lower(Value); + if strcmpi(ELECTRODES,'pointlabels') | strcmpi(ELECTRODES,'ptslabels') ... + | strcmpi(ELECTRODES,'labelspts') | strcmpi(ELECTRODES,'ptlabels') ... + | strcmpi(ELECTRODES,'labelpts') + ELECTRODES = 'labelpoint'; % backwards compatability + elseif strcmpi(ELECTRODES,'pointnumbers') | strcmpi(ELECTRODES,'ptsnumbers') ... + | strcmpi(ELECTRODES,'numberspts') | strcmpi(ELECTRODES,'ptnumbers') ... + | strcmpi(ELECTRODES,'numberpts') | strcmpi(ELECTRODES,'ptsnums') ... + | strcmpi(ELECTRODES,'numspts') + ELECTRODES = 'numpoint'; % backwards compatability + elseif strcmpi(ELECTRODES,'nums') + ELECTRODES = 'numbers'; % backwards compatability + elseif strcmpi(ELECTRODES,'pts') + ELECTRODES = 'on'; % backwards compatability + elseif ~strcmp(ELECTRODES,'off') ... + & ~strcmpi(ELECTRODES,'on') ... + & ~strcmp(ELECTRODES,'labels') ... + & ~strcmpi(ELECTRODES,'numbers') ... + & ~strcmpi(ELECTRODES,'labelpoint') ... + & ~strcmpi(ELECTRODES,'numpoint') + error('Unknown value for keyword ''electrodes'''); + end + case 'dipole' + DIPOLE = Value; + case 'dipsphere' + DIPSPHERE = Value; + case 'dipnorm' + DIPNORM = Value; + case 'diplen' + DIPLEN = Value; + case 'dipscale' + DIPSCALE = Value; + case 'contourvals' + ContourVals = Value; + case 'pmask' + ContourVals = Value; + PMASKFLAG = 1; + case 'diporient' + DIPORIENT = Value; + case 'dipcolor' + DIPCOLOR = Value; + case 'emarker' + if ischar(Value) + EMARKER = Value; + elseif ~iscell(Value) | length(Value) > 4 + error('''emarker'' argument must be a cell array {marker color size linewidth}') + else + EMARKER = Value{1}; + end + if length(Value) > 1 + ECOLOR = Value{2}; + end + if length(Value) > 2 + EMARKERSIZE = Value{3}; + end + if length(Value) > 3 + EMARKERLINEWIDTH = Value{4}; + end + case 'emarker2' + if ~iscell(Value) | length(Value) > 5 + error('''emarker2'' argument must be a cell array {chans marker color size linewidth}') + end + EMARKER2CHANS = abs(Value{1}); % ignore channels < 0 + if length(Value) > 1 + EMARKER2 = Value{2}; + end + if length(Value) > 2 + EMARKER2COLOR = Value{3}; + end + if length(Value) > 3 + EMARKERSIZE2 = Value{4}; + end + if length(Value) > 4 + EMARKER2LINEWIDTH = Value{5}; + end + case 'shrink' + shrinkfactor = Value; + case 'intrad' + intrad = Value; + if isstr(intrad) | (intrad < MINPLOTRAD | intrad > 1) + error('intrad argument should be a number between 0.15 and 1.0'); + end + case 'plotrad' + plotrad = Value; + if isstr(plotrad) | (plotrad < MINPLOTRAD | plotrad > 1) + error('plotrad argument should be a number between 0.15 and 1.0'); + end + case 'headrad' + headrad = Value; + if isstr(headrad) & ( strcmpi(headrad,'off') | strcmpi(headrad,'none') ) + headrad = 0; % undocumented 'no head' alternatives + end + if isempty(headrad) % [] -> none also + headrad = 0; + end + if ~isstr(headrad) + if ~(headrad==0) & (headrad < MINPLOTRAD | headrad>1) + error('bad value for headrad'); + end + elseif ~strcmpi(headrad,'rim') + error('bad value for headrad'); + end + case {'headcolor','hcolor'} + HEADCOLOR = Value; + case {'contourcolor','ccolor'} + CCOLOR = Value; + case {'electcolor','ecolor'} + ECOLOR = Value; + case {'emarkersize','emsize'} + EMARKERSIZE = Value; + case {'emarkersize1chan','emarkersizemark'} + EMARKERSIZE1CHAN= Value; + case {'efontsize','efsize'} + EFSIZE = Value; + case 'shading' + SHADING = lower(Value); + if ~any(strcmp(SHADING,{'flat','interp'})) + error('Invalid shading parameter') + end + if strcmpi(SHADING,'interp') && isempty(warningInterp) + warning('Using interpolated shading in scalp topographies prevent to export them as vectorized figures'); + warningInterp = 1; + end; + case 'noplot' + noplot = Value; + if ~isstr(noplot) + if length(noplot) ~= 2 + error('''noplot'' location should be [radius, angle]') + else + chanrad = noplot(1); + chantheta = noplot(2); + noplot = 'on'; + end + end + case 'gridscale' + GRID_SCALE = Value; + if isstr(GRID_SCALE) | GRID_SCALE ~= round(GRID_SCALE) | GRID_SCALE < 32 + error('''gridscale'' value must be integer > 32.'); + end + case {'plotgrid','gridplot'} + plotgrid = 'on'; + gridchans = Value; + case 'plotchans' + plotchans = Value(:); + if find(plotchans<=0) + error('''plotchans'' values must be > 0'); + end + % if max(abs(plotchans))>max(Values) | max(abs(plotchans))>length(Values) -sm ??? + case {'whitebk','whiteback','forprint'} + whitebk = Value; + otherwise + error(['Unknown input parameter ''' Param ''' ???']) + end + end +end + +if strcmpi(whitebk, 'on') + BACKCOLOR = [ 1 1 1 ]; +end; + +if isempty(find(strcmp(varargin,'colormap'))) + cmap = colormap(DEFAULT_COLORMAP); +else + cmap = colormap; +end +cmaplen = size(cmap,1); + +if strcmp(STYLE,'blank') % else if Values holds numbers of channels to mark + if length(Values) < length(loc_file) + ContourVals = zeros(1,length(loc_file)); + ContourVals(Values) = 1; + Values = ContourVals; + end; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% test args for plotting an electrode grid %%%%%%%%%%%%%%%%%%%%%% +% +if strcmp(plotgrid,'on') + STYLE = 'grid'; + gchans = sort(find(abs(gridchans(:))>0)); + + % if setdiff(gchans,unique(gchans)) + % fprintf('topoplot() warning: ''plotgrid'' channel matrix has duplicate channels\n'); + % end + + if ~isempty(plotchans) + if intersect(gchans,abs(plotchans)) + fprintf('topoplot() warning: ''plotgrid'' and ''plotchans'' have channels in common\n'); + end + end +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% misc arg tests %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if isempty(ELECTRODES) % if electrode labeling not specified + if length(Values) > MAXDEFAULTSHOWLOCS % if more channels than default max + ELECTRODES = 'off'; % don't show electrodes + else % else if fewer chans, + ELECTRODES = 'on'; % do + end +end + +if isempty(Values) + STYLE = 'blank'; +end +[r,c] = size(Values); +if r>1 & c>1, + error('input data must be a single vector'); +end +Values = Values(:); % make Values a column vector +ContourVals = ContourVals(:); % values for contour + +if ~isempty(intrad) & ~isempty(plotrad) & intrad < plotrad + error('intrad must be >= plotrad'); +end + +if ~strcmpi(STYLE,'grid') % if not plot grid only + +% +%%%%%%%%%%%%%%%%%%%% Read the channel location information %%%%%%%%%%%%%%%%%%%%%%%% +% + if isstr(loc_file) + [tmpeloc labels Th Rd indices] = readlocs( loc_file); + elseif isstruct(loc_file) % a locs struct + [tmpeloc labels Th Rd indices] = readlocs( loc_file ); + % Note: Th and Rd correspond to indices channels-with-coordinates only + else + error('loc_file must be a EEG.locs struct or locs filename'); + end + Th = pi/180*Th; % convert degrees to radians + allchansind = 1:length(Th); + + + if ~isempty(plotchans) + if max(plotchans) > length(Th) + error('''plotchans'' values must be <= max channel index'); + end + end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% channels to plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isempty(plotchans) + plotchans = intersect_bc(plotchans, indices); +end; +if ~isempty(Values) & ~strcmpi( STYLE, 'blank') & isempty(plotchans) + plotchans = indices; +end +if isempty(plotchans) & strcmpi( STYLE, 'blank') + plotchans = indices; +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% filter for channel type(s), if specified %%%%%%%%%%%%%%%%%%%%% +% + +if CHOOSECHANTYPE, + newplotchans = eeg_chantype(loc_file,chantype); + plotchans = intersect_bc(newplotchans, plotchans); +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% filter channels used for components %%%%%%%%%%%%%%%%%%%%% +% +if isfield(CHANINFO, 'icachansind') & ~isempty(Values) & length(Values) ~= length(tmpeloc) + + % test if ICA component + % --------------------- + if length(CHANINFO.icachansind) == length(Values) + + % if only a subset of channels are to be plotted + % and ICA components also use a subject of channel + % we must find the new indices for these channels + + plotchans = intersect_bc(CHANINFO.icachansind, plotchans); + tmpvals = zeros(1, length(tmpeloc)); + tmpvals(CHANINFO.icachansind) = Values; + Values = tmpvals; + tmpvals = zeros(1, length(tmpeloc)); + tmpvals(CHANINFO.icachansind) = ContourVals; + ContourVals = tmpvals; + + end; +end; + +% +%%%%%%%%%%%%%%%%%%% last channel is reference? %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if length(tmpeloc) == length(Values) + 1 % remove last channel if necessary + % (common reference channel) + if plotchans(end) == length(tmpeloc) + plotchans(end) = []; + end; + +end; + +% +%%%%%%%%%%%%%%%%%%% remove infinite and NaN values %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if length(Values) > 1 + inds = union_bc(find(isnan(Values)), find(isinf(Values))); % NaN and Inf values + plotchans = setdiff_bc(plotchans, inds); +end; +if strcmp(plotgrid,'on') + plotchans = setxor(plotchans,gchans); % remove grid chans from head plotchans +end + +[x,y] = pol2cart(Th,Rd); % transform electrode locations from polar to cartesian coordinates +plotchans = abs(plotchans); % reverse indicated channel polarities +allchansind = allchansind(plotchans); +Th = Th(plotchans); +Rd = Rd(plotchans); +x = x(plotchans); +y = y(plotchans); +labels = labels(plotchans); % remove labels for electrodes without locations +labels = strvcat(labels); % make a label string matrix +if ~isempty(Values) & length(Values) > 1 + Values = Values(plotchans); + ContourVals = ContourVals(plotchans); +end; + +% +%%%%%%%%%%%%%%%%%% Read plotting radius from chanlocs %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if isempty(plotrad) & isfield(tmpeloc, 'plotrad'), + plotrad = tmpeloc(1).plotrad; + if isstr(plotrad) % plotrad shouldn't be a string + plotrad = str2num(plotrad) % just checking + end + if plotrad < MINPLOTRAD | plotrad > 1.0 + fprintf('Bad value (%g) for plotrad.\n',plotrad); + error(' '); + end + if strcmpi(VERBOSE,'on') & ~isempty(plotrad) + fprintf('Plotting radius plotrad (%g) set from EEG.chanlocs.\n',plotrad); + end +end; +if isempty(plotrad) + plotrad = min(1.0,max(Rd)*1.02); % default: just outside the outermost electrode location + plotrad = max(plotrad,0.5); % default: plot out to the 0.5 head boundary +end % don't plot channels with Rd > 1 (below head) + +if isempty(intrad) + default_intrad = 1; % indicator for (no) specified intrad + intrad = min(1.0,max(Rd)*1.02); % default: just outside the outermost electrode location +else + default_intrad = 0; % indicator for (no) specified intrad + if plotrad > intrad + plotrad = intrad; + end +end % don't interpolate channels with Rd > 1 (below head) +if isstr(plotrad) | plotrad < MINPLOTRAD | plotrad > 1.0 + error('plotrad must be between 0.15 and 1.0'); +end + +% +%%%%%%%%%%%%%%%%%%%%%%% Set radius of head cartoon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if isempty(headrad) % never set -> defaults + if plotrad >= rmax + headrad = rmax; % (anatomically correct) + else % if plotrad < rmax + headrad = 0; % don't plot head + if strcmpi(VERBOSE, 'on') + fprintf('topoplot(): not plotting cartoon head since plotrad (%5.4g) < 0.5\n',... + plotrad); + end + end +elseif strcmpi(headrad,'rim') % force plotting at rim of map + headrad = plotrad; +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Shrink mode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isempty(shrinkfactor) | isfield(tmpeloc, 'shrink'), + if isempty(shrinkfactor) & isfield(tmpeloc, 'shrink'), + shrinkfactor = tmpeloc(1).shrink; + if strcmpi(VERBOSE,'on') + if isstr(shrinkfactor) + fprintf('Automatically shrinking coordinates to lie above the head perimter.\n'); + else + fprintf('Automatically shrinking coordinates by %3.2f\n', shrinkfactor); + end; + end + end; + + if isstr(shrinkfactor) + if strcmpi(shrinkfactor, 'on') | strcmpi(shrinkfactor, 'force') | strcmpi(shrinkfactor, 'auto') + if abs(headrad-rmax) > 1e-2 + fprintf(' NOTE -> the head cartoon will NOT accurately indicate the actual electrode locations\n'); + end + if strcmpi(VERBOSE,'on') + fprintf(' Shrink flag -> plotting cartoon head at plotrad\n'); + end + headrad = plotrad; % plot head around outer electrodes, no matter if 0.5 or not + end + else % apply shrinkfactor + plotrad = rmax/(1-shrinkfactor); + headrad = plotrad; % make deprecated 'shrink' mode plot + if strcmpi(VERBOSE,'on') + fprintf(' %g%% shrink applied.'); + if abs(headrad-rmax) > 1e-2 + fprintf(' Warning: With this "shrink" setting, the cartoon head will NOT be anatomically correct.\n'); + else + fprintf('\n'); + end + end + end +end; % if shrink + +% +%%%%%%%%%%%%%%%%% Issue warning if headrad ~= rmax %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if headrad ~= 0.5 & strcmpi(VERBOSE, 'on') + fprintf(' NB: Plotting map using ''plotrad'' %-4.3g,',plotrad); + fprintf( ' ''headrad'' %-4.3g\n',headrad); + fprintf('Warning: The plotting radius of the cartoon head is NOT anatomically correct (0.5).\n') +end +% +%%%%%%%%%%%%%%%%%%%%% Find plotting channels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +pltchans = find(Rd <= plotrad); % plot channels inside plotting circle + +if strcmpi(INTSQUARE,'on') % interpolate channels in the radius intrad square + intchans = find(x <= intrad & y <= intrad); % interpolate and plot channels inside interpolation square +else + intchans = find(Rd <= intrad); % interpolate channels in the radius intrad circle only +end + +% +%%%%%%%%%%%%%%%%%%%%% Eliminate channels not plotted %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +allx = x; +ally = y; +intchans; % interpolate using only the 'intchans' channels +pltchans; % plot using only indicated 'plotchans' channels + +if length(pltchans) < length(Rd) & strcmpi(VERBOSE, 'on') + fprintf('Interpolating %d and plotting %d of the %d scalp electrodes.\n', ... + length(intchans),length(pltchans),length(Rd)); +end; + + +% fprintf('topoplot(): plotting %d channels\n',length(pltchans)); +if ~isempty(EMARKER2CHANS) + if strcmpi(STYLE,'blank') + error('emarker2 not defined for style ''blank'' - use marking channel numbers in place of data'); + else % mark1chans and mark2chans are subsets of pltchans for markers 1 and 2 + [tmp1 mark1chans tmp2] = setxor(pltchans,EMARKER2CHANS); + [tmp3 tmp4 mark2chans] = intersect_bc(EMARKER2CHANS,pltchans); + end +end + +if ~isempty(Values) + if length(Values) == length(Th) % if as many map Values as channel locs + intValues = Values(intchans); + intContourVals = ContourVals(intchans); + Values = Values(pltchans); + ContourVals = ContourVals(pltchans); + end; +end; % now channel parameters and values all refer to plotting channels only + +allchansind = allchansind(pltchans); +intTh = Th(intchans); % eliminate channels outside the interpolation area +intRd = Rd(intchans); +intx = x(intchans); +inty = y(intchans); +Th = Th(pltchans); % eliminate channels outside the plotting area +Rd = Rd(pltchans); +x = x(pltchans); +y = y(pltchans); + +labels= labels(pltchans,:); +% +%%%%%%%%%%%%%%% Squeeze channel locations to <= rmax %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +squeezefac = rmax/plotrad; +intRd = intRd*squeezefac; % squeeze electrode arc_lengths towards the vertex +Rd = Rd*squeezefac; % squeeze electrode arc_lengths towards the vertex + % to plot all inside the head cartoon +intx = intx*squeezefac; +inty = inty*squeezefac; +x = x*squeezefac; +y = y*squeezefac; +allx = allx*squeezefac; +ally = ally*squeezefac; +% Note: Now outermost channel will be plotted just inside rmax + +else % if strcmpi(STYLE,'grid') + intx = rmax; inty=rmax; +end % if ~strcmpi(STYLE,'grid') + +% +%%%%%%%%%%%%%%%% rotate channels based on chaninfo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if strcmpi(lower(NOSEDIR), '+x') + rotate = 0; +else + if strcmpi(lower(NOSEDIR), '+y') + rotate = 3*pi/2; + elseif strcmpi(lower(NOSEDIR), '-x') + rotate = pi; + else rotate = pi/2; + end; + allcoords = (inty + intx*sqrt(-1))*exp(sqrt(-1)*rotate); + intx = imag(allcoords); + inty = real(allcoords); + allcoords = (ally + allx*sqrt(-1))*exp(sqrt(-1)*rotate); + allx = imag(allcoords); + ally = real(allcoords); + allcoords = (y + x*sqrt(-1))*exp(sqrt(-1)*rotate); + x = imag(allcoords); + y = real(allcoords); +end; + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Make the plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~strcmpi(STYLE,'blank') % if draw interpolated scalp map + if ~strcmpi(STYLE,'grid') % not a rectangular channel grid + % + %%%%%%%%%%%%%%%% Find limits for interpolation %%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if default_intrad % if no specified intrad + if strcmpi(INTERPLIMITS,'head') % intrad is 'head' + xmin = min(-rmax,min(intx)); xmax = max(rmax,max(intx)); + ymin = min(-rmax,min(inty)); ymax = max(rmax,max(inty)); + + else % INTERPLIMITS = rectangle containing electrodes -- DEPRECATED OPTION! + xmin = max(-rmax,min(intx)); xmax = min(rmax,max(intx)); + ymin = max(-rmax,min(inty)); ymax = min(rmax,max(inty)); + end + else % some other intrad specified + xmin = -intrad*squeezefac; xmax = intrad*squeezefac; % use the specified intrad value + ymin = -intrad*squeezefac; ymax = intrad*squeezefac; + end + % + %%%%%%%%%%%%%%%%%%%%%%% Interpolate scalp map data %%%%%%%%%%%%%%%%%%%%%%%% + % + xi = linspace(xmin,xmax,GRID_SCALE); % x-axis description (row vector) + yi = linspace(ymin,ymax,GRID_SCALE); % y-axis description (row vector) + + try + [Xi,Yi,Zi] = griddata(inty,intx,double(intValues),yi',xi,'v4'); % interpolate data + [Xi,Yi,ZiC] = griddata(inty,intx,double(intContourVals),yi',xi,'v4'); % interpolate data + catch, + [Xi,Yi,Zi] = griddata(inty,intx,intValues',yi,xi'); % interpolate data (Octave) + [Xi,Yi,ZiC] = griddata(inty,intx,intContourVals',yi,xi'); % interpolate data + end; + % + %%%%%%%%%%%%%%%%%%%%%%% Mask out data outside the head %%%%%%%%%%%%%%%%%%%%% + % + mask = (sqrt(Xi.^2 + Yi.^2) <= rmax); % mask outside the plotting circle + ii = find(mask == 0); + Zi(ii) = NaN; % mask non-plotting voxels with NaNs + ZiC(ii) = NaN; % mask non-plotting voxels with NaNs + grid = plotrad; % unless 'noplot', then 3rd output arg is plotrad + % + %%%%%%%%%% Return interpolated value at designated scalp location %%%%%%%%%% + % + if exist('chanrad') % optional first argument to 'noplot' + chantheta = (chantheta/360)*2*pi; + chancoords = round(ceil(GRID_SCALE/2)+GRID_SCALE/2*2*chanrad*[cos(-chantheta),... + -sin(-chantheta)]); + if chancoords(1)<1 ... + | chancoords(1) > GRID_SCALE ... + | chancoords(2)<1 ... + | chancoords(2)>GRID_SCALE + error('designated ''noplot'' channel out of bounds') + else + chanval = Zi(chancoords(1),chancoords(2)); + grid = Zi; + Zi = chanval; % return interpolated value instead of Zi + end + end + % + %%%%%%%%%%%%%%%%%%%%%%%%%% Return interpolated image only %%%%%%%%%%%%%%%%% + % + if strcmpi(noplot, 'on') + if strcmpi(VERBOSE,'on') + fprintf('topoplot(): no plot requested.\n') + end + return; + end + % + %%%%%%%%%%%%%%%%%%%%%%% Calculate colormap limits %%%%%%%%%%%%%%%%%%%%%%%%%% + % + if isstr(MAPLIMITS) + if strcmp(MAPLIMITS,'absmax') + amax = max(max(abs(Zi))); + amin = -amax; + elseif strcmp(MAPLIMITS,'maxmin') | strcmp(MAPLIMITS,'minmax') + amin = min(min(Zi)); + amax = max(max(Zi)); + else + error('unknown ''maplimits'' value.'); + end + elseif length(MAPLIMITS) == 2 + amin = MAPLIMITS(1); + amax = MAPLIMITS(2); + else + error('unknown ''maplimits'' value'); + end + delta = xi(2)-xi(1); % length of grid entry + + end % if ~strcmpi(STYLE,'grid') + % + %%%%%%%%%%%%%%%%%%%%%%%%%% Scale the axes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + %cla % clear current axis + hold on + h = gca; % uses current axes + + % instead of default larger AXHEADFAC + if squeezefac<0.92 & plotrad-headrad > 0.05 % (size of head in axes) + AXHEADFAC = 1.05; % do not leave room for external ears if head cartoon + % shrunk enough by the 'skirt' option + end + + set(gca,'Xlim',[-rmax rmax]*AXHEADFAC,'Ylim',[-rmax rmax]*AXHEADFAC); + % specify size of head axes in gca + + unsh = (GRID_SCALE+1)/GRID_SCALE; % un-shrink the effects of 'interp' SHADING + + % + %%%%%%%%%%%%%%%%%%%%%%%% Plot grid only %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if strcmpi(STYLE,'grid') % plot grid only + + % + % The goal below is to make the grid cells square - not yet achieved in all cases? -sm + % + g1 = size(gridchans,1); + g2 = size(gridchans,2); + gmax = max([g1 g2]); + Xi = linspace(-rmax*g2/gmax,rmax*g2/gmax,g1+1); + Xi = Xi+rmax/g1; Xi = Xi(1:end-1); + Yi = linspace(-rmax*g1/gmax,rmax*g1/gmax,g2+1); + Yi = Yi+rmax/g2; Yi = Yi(1:end-1); Yi = Yi(end:-1:1); % by trial and error! + % + %%%%%%%%%%% collect the gridchans values %%%%%%%%%%%%%%%%%%%%%%%%%%% + % + gridvalues = zeros(size(gridchans)); + for j=1:size(gridchans,1) + for k=1:size(gridchans,2) + gc = gridchans(j,k); + if gc > 0 + gridvalues(j,k) = Values(gc); + elseif gc < 0 + gridvalues(j,k) = -Values(gc); + else + gridvalues(j,k) = nan; % not-a-number = no value + end + end + end + % + %%%%%%%%%%% reset color limits for grid plot %%%%%%%%%%%%%%%%%%%%%%%%% + % + if isstr(MAPLIMITS) + if strcmp(MAPLIMITS,'maxmin') | strcmp(MAPLIMITS,'minmax') + amin = min(min(gridvalues(~isnan(gridvalues)))); + amax = max(max(gridvalues(~isnan(gridvalues)))); + elseif strcmp(MAPLIMITS,'absmax') + % 11/21/2005 Toby edit + % This should now work as specified. Before it only crashed (using + % "plotgrid" and "maplimits>absmax" options). + amax = max(max(abs(gridvalues(~isnan(gridvalues))))); + amin = -amax; + %amin = -max(max(abs([amin amax]))); + %amax = max(max(abs([amin amax]))); + else + error('unknown ''maplimits'' value'); + end + elseif length(MAPLIMITS) == 2 + amin = MAPLIMITS(1); + amax = MAPLIMITS(2); + else + error('unknown ''maplimits'' value'); + end + % + %%%%%%%%%% explicitly compute grid colors, allowing BACKCOLOR %%%%%% + % + gridvalues = 1+floor(cmaplen*(gridvalues-amin)/(amax-amin)); + gridvalues(find(gridvalues == cmaplen+1)) = cmaplen; + gridcolors = zeros([size(gridvalues),3]); + for j=1:size(gridchans,1) + for k=1:size(gridchans,2) + if ~isnan(gridvalues(j,k)) + gridcolors(j,k,:) = cmap(gridvalues(j,k),:); + else + if strcmpi(whitebk,'off') + gridcolors(j,k,:) = BACKCOLOR; % gridchans == 0 -> background color + % This allows the plot to show 'space' between separate sub-grids or strips + else % 'on' + gridcolors(j,k,:) = [1 1 1]; BACKCOLOR; % gridchans == 0 -> white for printing + end + end + end + end + + % + %%%%%%%%%% draw the gridplot image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + handle=imagesc(Xi,Yi,gridcolors); % plot grid with explicit colors + axis square + % + %%%%%%%%%%%%%%%%%%%%%%%% Plot map contours only %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + elseif strcmp(STYLE,'contour') % plot surface contours only + [cls chs] = contour(Xi,Yi,ZiC,CONTOURNUM,'k'); + handle = chs; % handle to a contourgroup object + % for h=chs, set(h,'color',CCOLOR); end + % + %%%%%%%%%%%%%%%%%%%%%%%% Else plot map and contours %%%%%%%%%%%%%%%%%%%%%%%%% + % + elseif strcmp(STYLE,'both') % plot interpolated surface and surface contours + if strcmp(SHADING,'interp') + tmph = surface(Xi*unsh,Yi*unsh,zeros(size(Zi))-0.1,Zi,... + 'EdgeColor','none','FaceColor',SHADING); + else % SHADING == 'flat' + tmph = surface(Xi-delta/2,Yi-delta/2,zeros(size(Zi))-0.1,Zi,... + 'EdgeColor','none','FaceColor',SHADING); + end + if strcmpi(MASKSURF, 'on') + set(tmph, 'visible', 'off'); + handle = tmph; + end; + + warning off; + if ~PMASKFLAG + [cls chs] = contour(Xi,Yi,ZiC,CONTOURNUM,'k'); + else + ZiC(find(ZiC > 0.5 )) = NaN; + [cls chs] = contourf(Xi,Yi,ZiC,0,'k'); + subh = get(chs, 'children'); + for indsubh = 1:length(subh) + numfaces = size(get(subh(indsubh), 'XData'),1); + set(subh(indsubh), 'FaceVertexCData', ones(numfaces,3), 'Cdatamapping', 'direct', 'facealpha', 0.5, 'linewidth', 2); + end; + end; + handle = tmph; % surface handle + for h=chs, set(h,'color',CCOLOR); end + warning on; + % + %%%%%%%%%%%%%%%%%%%%%%%% Else plot map only %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + elseif strcmp(STYLE,'straight') | strcmp(STYLE,'map') % 'straight' was former arg + + if strcmp(SHADING,'interp') % 'interp' mode is shifted somehow... but how? + tmph = surface(Xi*unsh,Yi*unsh,zeros(size(Zi)),Zi,'EdgeColor','none',... + 'FaceColor',SHADING); + else + tmph = surface(Xi-delta/2,Yi-delta/2,zeros(size(Zi)),Zi,'EdgeColor','none',... + 'FaceColor',SHADING); + end + if strcmpi(MASKSURF, 'on') + set(tmph, 'visible', 'off'); + handle = tmph; + end; + handle = tmph; % surface handle + % + %%%%%%%%%%%%%%%%%% Else fill contours with uniform colors %%%%%%%%%%%%%%%%%% + % + elseif strcmp(STYLE,'fill') + [cls chs] = contourf(Xi,Yi,Zi,CONTOURNUM,'k'); + + handle = chs; % handle to a contourgroup object + + % for h=chs, set(h,'color',CCOLOR); end + % <- 'not line objects.' Why does 'both' work above??? + + else + error('Invalid style') + end + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set color axis %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % +% caxis([amin amax]); % set coloraxis + +% 7/30/2014 Ramon: +-5% for the color limits were added +cax_sgn = sign([amin amax]); % getting sign +caxis([amin+cax_sgn(1)*(0.05*abs(amin)) amax+cax_sgn(2)*(0.05*abs(amax))]); % Adding 5% to the color limits + +else % if STYLE 'blank' +% +%%%%%%%%%%%%%%%%%%%%%%% Draw blank head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + if strcmpi(noplot, 'on') + if strcmpi(VERBOSE,'on') + fprintf('topoplot(): no plot requested.\n') + end + return; + end + %cla + hold on + + set(gca,'Xlim',[-rmax rmax]*AXHEADFAC,'Ylim',[-rmax rmax]*AXHEADFAC) + % pos = get(gca,'position'); + % fprintf('Current axes size %g,%g\n',pos(3),pos(4)); + + if strcmp(ELECTRODES,'labelpoint') | strcmp(ELECTRODES,'numpoint') + text(-0.6,-0.6, ... + [ int2str(length(Rd)) ' of ' int2str(length(tmpeloc)) ' electrode locations shown']); + text(-0.6,-0.7, [ 'Click on electrodes to toggle name/number']); + tl = title('Channel locations'); + set(tl, 'fontweight', 'bold'); + end; +end % STYLE 'blank' + +if exist('handle') ~= 1 + handle = gca; +end; + +if ~strcmpi(STYLE,'grid') % if not plot grid only + +% +%%%%%%%%%%%%%%%%%%% Plot filled ring to mask jagged grid boundary %%%%%%%%%%%%%%%%%%%%%%%%%%% +% +hwidth = HEADRINGWIDTH; % width of head ring +hin = squeezefac*headrad*(1- hwidth/2); % inner head ring radius + +if strcmp(SHADING,'interp') + rwidth = BLANKINGRINGWIDTH*1.3; % width of blanking outer ring +else + rwidth = BLANKINGRINGWIDTH; % width of blanking outer ring +end +rin = rmax*(1-rwidth/2); % inner ring radius +if hin>rin + rin = hin; % dont blank inside the head ring +end + +if strcmp(CONVHULL,'on') %%%%%%%%% mask outside the convex hull of the electrodes %%%%%%%%% + cnv = convhull(allx,ally); + cnvfac = round(CIRCGRID/length(cnv)); % spline interpolate the convex hull + if cnvfac < 1, cnvfac=1; end; + CIRCGRID = cnvfac*length(cnv); + + startangle = atan2(allx(cnv(1)),ally(cnv(1))); + circ = linspace(0+startangle,2*pi+startangle,CIRCGRID); + rx = sin(circ); + ry = cos(circ); + + allx = allx(:)'; % make x (elec locations; + to nose) a row vector + ally = ally(:)'; % make y (elec locations, + to r? ear) a row vector + erad = sqrt(allx(cnv).^2+ally(cnv).^2); % convert to polar coordinates + eang = atan2(allx(cnv),ally(cnv)); + eang = unwrap(eang); + eradi =spline(linspace(0,1,3*length(cnv)), [erad erad erad], ... + linspace(0,1,3*length(cnv)*cnvfac)); + eangi =spline(linspace(0,1,3*length(cnv)), [eang+2*pi eang eang-2*pi], ... + linspace(0,1,3*length(cnv)*cnvfac)); + xx = eradi.*sin(eangi); % convert back to rect coordinates + yy = eradi.*cos(eangi); + yy = yy(CIRCGRID+1:2*CIRCGRID); + xx = xx(CIRCGRID+1:2*CIRCGRID); + eangi = eangi(CIRCGRID+1:2*CIRCGRID); + eradi = eradi(CIRCGRID+1:2*CIRCGRID); + xx = xx*1.02; yy = yy*1.02; % extend spline outside electrode marks + + splrad = sqrt(xx.^2+yy.^2); % arc radius of spline points (yy,xx) + oob = find(splrad >= rin); % enforce an upper bound on xx,yy + xx(oob) = rin*xx(oob)./splrad(oob); % max radius = rin + yy(oob) = rin*yy(oob)./splrad(oob); % max radius = rin + + splrad = sqrt(xx.^2+yy.^2); % arc radius of spline points (yy,xx) + oob = find(splrad < hin); % don't let splrad be inside the head cartoon + xx(oob) = hin*xx(oob)./splrad(oob); % min radius = hin + yy(oob) = hin*yy(oob)./splrad(oob); % min radius = hin + + ringy = [[ry(:)' ry(1) ]*(rin+rwidth) yy yy(1)]; + ringx = [[rx(:)' rx(1) ]*(rin+rwidth) xx xx(1)]; + + ringh2= patch(ringy,ringx,ones(size(ringy)),BACKCOLOR,'edgecolor','none'); hold on + + % plot(ry*rmax,rx*rmax,'b') % debugging line + +else %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% mask the jagged border around rmax %%%%%%%%%%%%%%%5%%%%%% + + circ = linspace(0,2*pi,CIRCGRID); + rx = sin(circ); + ry = cos(circ); + ringx = [[rx(:)' rx(1) ]*(rin+rwidth) [rx(:)' rx(1)]*rin]; + ringy = [[ry(:)' ry(1) ]*(rin+rwidth) [ry(:)' ry(1)]*rin]; + + if ~strcmpi(STYLE,'blank') + ringh= patch(ringx,ringy,0.01*ones(size(ringx)),BACKCOLOR,'edgecolor','none'); hold on + end + % plot(ry*rmax,rx*rmax,'b') % debugging line +end + + %f1= fill(rin*[rx rX],rin*[ry rY],BACKCOLOR,'edgecolor',BACKCOLOR); hold on + %f2= fill(rin*[rx rX*(1+rwidth)],rin*[ry rY*(1+rwidth)],BACKCOLOR,'edgecolor',BACKCOLOR); + +% Former line-style border smoothing - width did not scale with plot +% brdr=plot(1.015*cos(circ).*rmax,1.015*sin(circ).*rmax,... % old line-based method +% 'color',HEADCOLOR,'Linestyle','-','LineWidth',HLINEWIDTH); % plot skirt outline +% set(brdr,'color',BACKCOLOR,'linewidth',HLINEWIDTH + 4); % hide the disk edge jaggies + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot cartoon head, ears, nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if headrad > 0 % if cartoon head to be plotted +% +%%%%%%%%%%%%%%%%%%% Plot head outline %%%%%%%%%%%%%%%%%%%%%%%%%%% +% +headx = [[rx(:)' rx(1) ]*(hin+hwidth) [rx(:)' rx(1)]*hin]; +heady = [[ry(:)' ry(1) ]*(hin+hwidth) [ry(:)' ry(1)]*hin]; + +if ~isstr(HEADCOLOR) | ~strcmpi(HEADCOLOR,'none') + %ringh= patch(headx,heady,ones(size(headx)),HEADCOLOR,'edgecolor',HEADCOLOR,'linewidth', HLINEWIDTH); hold on + headx = [rx(:)' rx(1)]*hin; + heady = [ry(:)' ry(1)]*hin; + ringh= plot(headx,heady); + set(ringh, 'color',HEADCOLOR,'linewidth', HLINEWIDTH); hold on +end + +% rx = sin(circ); rX = rx(end:-1:1); +% ry = cos(circ); rY = ry(end:-1:1); +% for k=2:2:CIRCGRID +% rx(k) = rx(k)*(1+hwidth); +% ry(k) = ry(k)*(1+hwidth); +% end +% f3= fill(hin*[rx rX],hin*[ry rY],HEADCOLOR,'edgecolor',HEADCOLOR); hold on +% f4= fill(hin*[rx rX*(1+hwidth)],hin*[ry rY*(1+hwidth)],HEADCOLOR,'edgecolor',HEADCOLOR); + +% Former line-style head +% plot(cos(circ).*squeezefac*headrad,sin(circ).*squeezefac*headrad,... +% 'color',HEADCOLOR,'Linestyle','-','LineWidth',HLINEWIDTH); % plot head outline + +% +%%%%%%%%%%%%%%%%%%% Plot ears and nose %%%%%%%%%%%%%%%%%%%%%%%%%%% +% + base = rmax-.0046; + basex = 0.18*rmax; % nose width + tip = 1.15*rmax; + tiphw = .04*rmax; % nose tip half width + tipr = .01*rmax; % nose tip rounding + q = .04; % ear lengthening + EarX = [.497-.005 .510 .518 .5299 .5419 .54 .547 .532 .510 .489-.005]; % rmax = 0.5 + EarY = [q+.0555 q+.0775 q+.0783 q+.0746 q+.0555 -.0055 -.0932 -.1313 -.1384 -.1199]; + sf = headrad/plotrad; % squeeze the model ears and nose + % by this factor + if ~isstr(HEADCOLOR) | ~strcmpi(HEADCOLOR,'none') + plot3([basex;tiphw;0;-tiphw;-basex]*sf,[base;tip-tipr;tip;tip-tipr;base]*sf,... + 2*ones(size([basex;tiphw;0;-tiphw;-basex])),... + 'Color',HEADCOLOR,'LineWidth',HLINEWIDTH); % plot nose + plot3(EarX*sf,EarY*sf,2*ones(size(EarX)),'color',HEADCOLOR,'LineWidth',HLINEWIDTH) % plot left ear + plot3(-EarX*sf,EarY*sf,2*ones(size(EarY)),'color',HEADCOLOR,'LineWidth',HLINEWIDTH) % plot right ear + end +end + +% +% %%%%%%%%%%%%%%%%%%% Show electrode information %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + plotax = gca; + axis square % make plotax square + axis off + + pos = get(gca,'position'); + xlm = get(gca,'xlim'); + ylm = get(gca,'ylim'); + % textax = axes('position',pos,'xlim',xlm,'ylim',ylm); % make new axes so clicking numbers <-> labels + % will work inside head cartoon patch + % axes(textax); + axis square % make textax square + + pos = get(gca,'position'); + set(plotax,'position',pos); + + xlm = get(gca,'xlim'); + set(plotax,'xlim',xlm); + + ylm = get(gca,'ylim'); + set(plotax,'ylim',ylm); % copy position and axis limits again + +axis equal; +set(gca, 'xlim', [-0.525 0.525]); set(plotax, 'xlim', [-0.525 0.525]); +set(gca, 'ylim', [-0.525 0.525]); set(plotax, 'ylim', [-0.525 0.525]); + +%get(textax,'pos') % test if equal! +%get(plotax,'pos') +%get(textax,'xlim') +%get(plotax,'xlim') +%get(textax,'ylim') +%get(plotax,'ylim') + + if isempty(EMARKERSIZE) + EMARKERSIZE = 10; + if length(y)>=160 + EMARKERSIZE = 3; + elseif length(y)>=128 + EMARKERSIZE = 3; + elseif length(y)>=100 + EMARKERSIZE = 3; + elseif length(y)>=80 + EMARKERSIZE = 4; + elseif length(y)>=64 + EMARKERSIZE = 5; + elseif length(y)>=48 + EMARKERSIZE = 6; + elseif length(y)>=32 + EMARKERSIZE = 8; + end + end +% +%%%%%%%%%%%%%%%%%%%%%%%% Mark electrode locations only %%%%%%%%%%%%%%%%%%%%%%%%%% +% +ELECTRODE_HEIGHT = 2.1; % z value for plotting electrode information (above the surf) + +if strcmp(ELECTRODES,'on') % plot electrodes as spots + if isempty(EMARKER2CHANS) + hp2 = plot3(y,x,ones(size(x))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE,'linewidth',EMARKERLINEWIDTH); + else % plot markers for normal chans and EMARKER2CHANS separately + hp2 = plot3(y(mark1chans),x(mark1chans),ones(size((mark1chans)))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE,'linewidth',EMARKERLINEWIDTH); + hp2b = plot3(y(mark2chans),x(mark2chans),ones(size((mark2chans)))*ELECTRODE_HEIGHT,... + EMARKER2,'Color',EMARKER2COLOR,'markerfacecolor',EMARKER2COLOR,'linewidth',EMARKER2LINEWIDTH,'markersize',EMARKERSIZE2); + end +% +%%%%%%%%%%%%%%%%%%%%%%%% Print electrode labels only %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +elseif strcmp(ELECTRODES,'labels') % print electrode names (labels) + for i = 1:size(labels,1) + text(double(y(i)),double(x(i)),... + ELECTRODE_HEIGHT,labels(i,:),'HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',ECOLOR,... + 'FontSize',EFSIZE) + end +% +%%%%%%%%%%%%%%%%%%%%%%%% Mark electrode locations plus labels %%%%%%%%%%%%%%%%%%% +% +elseif strcmp(ELECTRODES,'labelpoint') + if isempty(EMARKER2CHANS) + hp2 = plot3(y,x,ones(size(x))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE,'linewidth',EMARKERLINEWIDTH); + else + hp2 = plot3(y(mark1chans),x(mark1chans),ones(size((mark1chans)))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE,'linewidth',EMARKERLINEWIDTH); + hp2b = plot3(y(mark2chans),x(mark2chans),ones(size((mark2chans)))*ELECTRODE_HEIGHT,... + EMARKER2,'Color',EMARKER2COLOR,'markerfacecolor',EMARKER2COLOR,'linewidth',EMARKER2LINEWIDTH,'markersize',EMARKERSIZE2); + end + for i = 1:size(labels,1) + hh(i) = text(double(y(i)+0.01),double(x(i)),... + ELECTRODE_HEIGHT,labels(i,:),'HorizontalAlignment','left',... + 'VerticalAlignment','middle','Color', ECOLOR,'userdata', num2str(allchansind(i)), ... + 'FontSize',EFSIZE, 'buttondownfcn', ... + ['tmpstr = get(gco, ''userdata'');'... + 'set(gco, ''userdata'', get(gco, ''string''));' ... + 'set(gco, ''string'', tmpstr); clear tmpstr;'] ); + end +% +%%%%%%%%%%%%%%%%%%%%%%% Mark electrode locations plus numbers %%%%%%%%%%%%%%%%%%% +% +elseif strcmp(ELECTRODES,'numpoint') + if isempty(EMARKER2CHANS) + hp2 = plot3(y,x,ones(size(x))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE,'linewidth',EMARKERLINEWIDTH); + else + hp2 = plot3(y(mark1chans),x(mark1chans),ones(size((mark1chans)))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE,'linewidth',EMARKERLINEWIDTH); + hp2b = plot3(y(mark2chans),x(mark2chans),ones(size((mark2chans)))*ELECTRODE_HEIGHT,... + EMARKER2,'Color',EMARKER2COLOR,'markerfacecolor',EMARKER2COLOR,'linewidth',EMARKER2LINEWIDTH,'markersize',EMARKERSIZE2); + end + for i = 1:size(labels,1) + hh(i) = text(double(y(i)+0.01),double(x(i)),... + ELECTRODE_HEIGHT,num2str(allchansind(i)),'HorizontalAlignment','left',... + 'VerticalAlignment','middle','Color', ECOLOR,'userdata', labels(i,:) , ... + 'FontSize',EFSIZE, 'buttondownfcn', ... + ['tmpstr = get(gco, ''userdata'');'... + 'set(gco, ''userdata'', get(gco, ''string''));' ... + 'set(gco, ''string'', tmpstr); clear tmpstr;'] ); + end +% +%%%%%%%%%%%%%%%%%%%%%% Print electrode numbers only %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +elseif strcmp(ELECTRODES,'numbers') + for i = 1:size(labels,1) + text(double(y(i)),double(x(i)),... + ELECTRODE_HEIGHT,int2str(allchansind(i)),'HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',ECOLOR,... + 'FontSize',EFSIZE) + end +% +%%%%%%%%%%%%%%%%%%%%%% Mark emarker2 electrodes only %%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +elseif strcmp(ELECTRODES,'off') & ~isempty(EMARKER2CHANS) + hp2b = plot3(y(mark2chans),x(mark2chans),ones(size((mark2chans)))*ELECTRODE_HEIGHT,... + EMARKER2,'Color',EMARKER2COLOR,'markerfacecolor',EMARKER2COLOR,'linewidth',EMARKER2LINEWIDTH,'markersize',EMARKERSIZE2); +end +% +%%%%%%%% Mark specified electrode locations with red filled disks %%%%%%%%%%%%%%%%%%%%%% +% +try, + if strcmpi(STYLE,'blank') % if mark-selected-channel-locations mode + for kk = 1:length(1:length(x)) + if abs(Values(kk)) + if PLOTDISK + angleRatio = real(Values(kk))/(real(Values(kk))+imag(Values(kk)))*360; + radius = real(Values(kk))+imag(Values(kk)); + allradius = [0.02 0.03 0.037 0.044 0.05]; + radius = allradius(radius); + hp2 = disk(y(kk),x(kk),radius, [1 0 0], 0 , angleRatio, 16); + if angleRatio ~= 360 + hp2 = disk(y(kk),x(kk),radius, [0 0 1], angleRatio, 360, 16); + end; + else + tmpcolor = COLORARRAY{max(1,min(Values(kk), length(COLORARRAY)))}; + hp2 = plot3(y(kk),x(kk),ELECTRODE_HEIGHT,EMARKER,'Color', tmpcolor, 'markersize', EMARKERSIZE1CHAN); + hp2 = disk(y(kk),x(kk),0.04, tmpcolor, 0, 360, 10); + end; + end; + end + end +catch, end; +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot dipole(s) on the scalp map %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isempty(DIPOLE) + hold on; + tmp = DIPOLE; + if isstruct(DIPOLE) + if ~isfield(tmp,'posxyz') + error('dipole structure is not an EEG.dipfit.model') + end + DIPOLE = []; % Note: invert x and y from dipplot usage + DIPOLE(:,1) = -tmp.posxyz(:,2)/DIPSPHERE; % -y -> x + DIPOLE(:,2) = tmp.posxyz(:,1)/DIPSPHERE; % x -> y + DIPOLE(:,3) = -tmp.momxyz(:,2); + DIPOLE(:,4) = tmp.momxyz(:,1); + else + DIPOLE(:,1) = -tmp(:,2); % same for vector input + DIPOLE(:,2) = tmp(:,1); + DIPOLE(:,3) = -tmp(:,4); + DIPOLE(:,4) = tmp(:,3); + end; + for index = 1:size(DIPOLE,1) + if ~any(DIPOLE(index,:)) + DIPOLE(index,:) = []; + end + end; + DIPOLE(:,1:4) = DIPOLE(:,1:4)*rmax*(rmax/plotrad); % scale radius from 1 -> rmax (0.5) + DIPOLE(:,3:end) = (DIPOLE(:,3:end))*rmax/100000*(rmax/plotrad); + if strcmpi(DIPNORM, 'on') + for index = 1:size(DIPOLE,1) + DIPOLE(index,3:4) = DIPOLE(index,3:4)/norm(DIPOLE(index,3:end))*0.2; + end; + end; + DIPOLE(:, 3:4) = DIPORIENT*DIPOLE(:, 3:4)*DIPLEN; + + PLOT_DIPOLE=1; + if sum(DIPOLE(1,3:4).^2) <= 0.00001 + if strcmpi(VERBOSE,'on') + fprintf('Note: dipole is length 0 - not plotted\n') + end + PLOT_DIPOLE = 0; + end + if 0 % sum(DIPOLE(1,1:2).^2) > plotrad + if strcmpi(VERBOSE,'on') + fprintf('Note: dipole is outside plotting area - not plotted\n') + end + PLOT_DIPOLE = 0; + end + if PLOT_DIPOLE + for index = 1:size(DIPOLE,1) + hh = plot( DIPOLE(index, 1), DIPOLE(index, 2), '.'); + set(hh, 'color', DIPCOLOR, 'markersize', DIPSCALE*30); + hh = line( [DIPOLE(index, 1) DIPOLE(index, 1)+DIPOLE(index, 3)]', ... + [DIPOLE(index, 2) DIPOLE(index, 2)+DIPOLE(index, 4)]',[10 10]); + set(hh, 'color', DIPCOLOR, 'linewidth', DIPSCALE*30/7); + end; + end; +end; + +end % if ~ 'gridplot' + +% +%%%%%%%%%%%%% Plot axis orientation %%%%%%%%%%%%%%%%%%%% +% +if strcmpi(DRAWAXIS, 'on') + axes('position', [0 0.85 0.08 0.1]); + axis off; + coordend1 = sqrt(-1)*3; + coordend2 = -3; + coordend1 = coordend1*exp(sqrt(-1)*rotate); + coordend2 = coordend2*exp(sqrt(-1)*rotate); + + line([5 5+round(real(coordend1))]', [5 5+round(imag(coordend1))]', 'color', 'k'); + line([5 5+round(real(coordend2))]', [5 5+round(imag(coordend2))]', 'color', 'k'); + if round(real(coordend2))<0 + text( 5+round(real(coordend2))*1.2, 5+round(imag(coordend2))*1.2-2, '+Y'); + else text( 5+round(real(coordend2))*1.2, 5+round(imag(coordend2))*1.2, '+Y'); + end; + if round(real(coordend1))<0 + text( 5+round(real(coordend1))*1.2, 5+round(imag(coordend1))*1.2+1.5, '+X'); + else text( 5+round(real(coordend1))*1.2, 5+round(imag(coordend1))*1.2, '+X'); + end; + set(gca, 'xlim', [0 10], 'ylim', [0 10]); +end; + +% +%%%%%%%%%%%%% Set EEGLAB background color to match head border %%%%%%%%%%%%%%%%%%%%%%%% +% +try, + set(gcf, 'color', BACKCOLOR); + catch, +end; + +hold off +axis off +return + +% +%%%%%%%%%%%%% Draw circle %%%%%%%%%%%%%%%%%%%%%%%% +% +function h2 = disk(X, Y, radius, colorfill, oriangle, endangle, segments) + A = linspace(oriangle/180*pi, endangle/180*pi, segments-1); + if endangle-oriangle == 360 + A = linspace(oriangle/180*pi, endangle/180*pi, segments); + h2 = patch( [X + cos(A)*radius(1)], [Y + sin(A)*radius(end)], zeros(1,segments)+3, colorfill); + else A = linspace(oriangle/180*pi, endangle/180*pi, segments-1); + h2 = patch( [X X + cos(A)*radius(1)], [Y Y + sin(A)*radius(end)], zeros(1,segments)+3, colorfill); + end; + set(h2, 'FaceColor', colorfill); + set(h2, 'EdgeColor', 'none'); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/transformcoords.m b/code/eeglab13_4_4b/functions/sigprocfunc/transformcoords.m new file mode 100644 index 0000000..99dc8f6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/transformcoords.m @@ -0,0 +1,126 @@ +% transformcoords() - Select nazion and inion in anatomical MRI images. +% +% Usage: +% mewcoords = transformcoords(coords, rotate, scale, center, reverse); +% +% Inputs: +% coords - array of 3-D coordinates (3 by N or N by 3) +% rotate - [pitch roll yaw] rotate in 3-D using pitch (x plane), +% roll (y plane) and yaw (z plane). An empty array does +% not perform any rotation. +% scale - [scalex scaley scalez] scale axis. A single numeric +% input scale all the dimentions the same. Default 1 +% does not scale. +% shifts - [x y z] shift coordinates (after rotation and scaling). +% Default [0 0 0] does not move the center. +% reverse - [0|1] when set to 1 perform the reverse transformation, +% first moving to the old center, unscaling, and unrotating. +% Default is 0. +% +% Output: +% newcoords - coordinates after rotating, scaling and recentering +% +% Author: Arnaud Delorme, Salk, SCCN, UCSD, CA, March 23, 2004 + +% Copyright (C) 2004 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function coords = transformcoords(coords, rotate, scale, center, reverse); + + if nargin < 2 + help transformcoords; + return; + end; + if nargin < 3 + scale =1; + end; + if nargin < 4 + center = [0 0 0]; + end; + if nargin < 5 + reverse = 0; + end; + if size(coords, 1) ~= 3 + coords = coords'; + trp = 1; + else + trp = 0; + end; + if size(coords, 1) ~= 3 + error('Number of columns must be 3 for the coordinate input'); + end; + if length(rotate) > 0 & length(rotate) ~= 3 + error('rotate parameter must have 3 values'); + end; + + % decode parameters + % ----------------- + centx = -center(1); + centy = -center(2); + centz = -center(3); + if length(scale) == 1 + scale = [scale scale scale]; + end; + scalex = scale(1); + scaley = scale(2); + scalez = scale(3); + if length(rotate) < 3 + rotate = [0 0 0] + end; + pitch = rotate(1); + roll = rotate(2); + yaw = rotate(3); + + + if ~reverse + % pitch roll yaw rotation + % ----------------------- + % pitch (x-axis); roll = y axis rotation; yaw = z axis + % see http://bishopw.loni.ucla.edu/AIR5/homogenous.html + cp = cos(pitch); sp = sin(pitch); + cr = cos(roll); sr = sin(roll); + cy = cos(yaw); sy = sin(yaw); + rot3d = [ cy*cr+sy*sp*sr sy*cr-cy*sp*sr cp*sr ; + -sy*cp cy*cp sp ; + sy*sp*cr-cy*sr -cy*sp*cr-sy*sr cp*cr ]; + coords = rot3d*coords; + + % scaling and centering + % --------------------- + coords(1,:) = coords(1,:)*scalex-centx; + coords(2,:) = coords(2,:)*scaley-centy; + coords(3,:) = coords(3,:)*scalez-centz; + else + % unscaling and uncentering + % ------------------------- + coords(1,:) = (coords(1,:)+centx)/scalex; + coords(2,:) = (coords(2,:)+centy)/scaley; + coords(3,:) = (coords(3,:)+centz)/scalez; + + % pitch roll yaw rotation + % ----------------------- + cp = cos(-pitch); sp = sin(-pitch); + cr = cos(-roll); sr = sin(-roll); + cy = cos(-yaw); sy = sin(-yaw); + rot3d = [ cy*cr+sy*sp*sr sy*cr-cy*sp*sr cp*sr ; + -sy*cp cy*cp sp ; + sy*sp*cr-cy*sr -cy*sp*cr-sy*sr cp*cr ]; + coords = rot3d*coords; + end; + + if trp + coords = coords'; + end; diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/trial2eegplot.m b/code/eeglab13_4_4b/functions/sigprocfunc/trial2eegplot.m new file mode 100644 index 0000000..329a546 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/trial2eegplot.m @@ -0,0 +1,46 @@ +% trial2eegplot() - convert eeglab format to eeplot format of rejection window +% +% Usage: +% >> eegplotarray = trial2eegplot(rej, rejE, points, color); +% +% Inputs: +% rej - rejection vector (0 and 1) with one value per trial +% rejE - electrode rejection array (size nb_elec x trials) also +% made of 0 and 1. +% points - number of points per trials +% color - color of the windows for eegplot() +% +% Outputs: +% eegplotarray - array defining windows which is compatible with +% the function eegplot() +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eegtresh(), eeglab(), eegplot(), pop_rejepoch() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% ---------------------------------------------------------- +function rejeegplot = trial2eegplot( rej, rejE, pnts, color) + rej = find(rej>0); + rejE = rejE(:, rej)'; + rejeegplot = zeros(length(rej), size(rejE,2)+5); + rejeegplot(:, 6:end) = rejE; + rejeegplot(:, 1) = (rej(:)-1)*pnts; + rejeegplot(:, 2) = rej(:)*pnts-1; + rejeegplot(:, 3:5) = ones(size(rejeegplot,1),1)*color; +return diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/uigetfile2.m b/code/eeglab13_4_4b/functions/sigprocfunc/uigetfile2.m new file mode 100644 index 0000000..97c511a --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/uigetfile2.m @@ -0,0 +1,75 @@ +% uigetfile2() - same as uigetfile but remember folder location. +% +% Usage: >> uigetfile2(...) +% +% Inputs: Same as uigetfile +% +% Author: Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004 +% Thanks to input from Bas Kortmann +% +% Copyright (C) Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004 + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function varargout = uigetfile2(varargin); + + if nargin < 1 + help uigetfile2; + return; + end; + + % remember old folder + %% search for the (mat) file which contains the latest used directory + % ------------------- + olddir = pwd; + try, + eeglab_options; + if option_rememberfolder + tmp_fld = getenv('TEMP'); + if isempty(tmp_fld) & isunix + if exist('/tmp') == 7 + tmp_fld = '/tmp'; + end; + end; + if exist(fullfile(tmp_fld,'eeglab.cfg')) + load(fullfile(tmp_fld,'eeglab.cfg'),'Path','-mat'); + s = ['cd([''' Path '''])']; + if exist(Path) == 7, eval(s); end; + end; + end; + catch, end; + + %% Show the open dialog and save the latest directory to the file + % --------------------------------------------------------------- + [varargout{1} varargout{2}] = uigetfile(varargin{:}); + try, + if option_rememberfolder + if varargout{1} ~= 0 + Path = varargout{2}; + try, save(fullfile(tmp_fld,'eeglab.cfg'),'Path','-mat','-V6'); % Matlab 7 + catch, + try, save(fullfile(tmp_fld,'eeglab.cfg'),'Path','-mat'); + catch, error('uigetfile2: save error, out of space or file permission problem'); + end + end + if isunix + eval(['cd ' tmp_fld]); + system('chmod 777 eeglab.cfg'); + end + end; + end; + catch, end; + cd(olddir) + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/uiputfile2.m b/code/eeglab13_4_4b/functions/sigprocfunc/uiputfile2.m new file mode 100644 index 0000000..dbf57ba --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/uiputfile2.m @@ -0,0 +1,78 @@ +% uiputfile2() - same as uigputfile but remember folder location. +% +% Usage: >> uiputfile2(...) +% +% Inputs: Same as uiputfile +% +% Author: Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004 +% Thanks to input from Bas Kortmann +% +% Copyright (C) Arnaud Delorme & Hilit Serby, Scott Makeig, SCCN, UCSD, 2004 + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function varargout = uiputfile2(varargin); + + if nargin < 1 + help uiputfile2; + return; + end; + + % remember old folder + %% search for the (mat) file which contains the latest used directory + % ------------------- + olddir = pwd; + try, + eeglab_options; + if option_rememberfolder + tmp_fld = getenv('TEMP'); + if isempty(tmp_fld) & isunix + if exist('/tmp') == 7 + tmp_fld = '/tmp'; + end; + end; + if exist(fullfile(tmp_fld,'eeglab.cfg')) + load(fullfile(tmp_fld,'eeglab.cfg'),'Path','-mat'); + s = ['cd([''' Path '''])']; + if exist(Path) == 7, eval(s); end; + end; + end; + catch, end; + + %% Show the open dialog and save the latest directory to the file + % --------------------------------------------------------------- + [varargout{1} varargout{2}] = uiputfile(varargin{:}); + try, + if option_rememberfolder + if varargout{1} ~= 0 + Path = varargout{2}; + try, save(fullfile(tmp_fld,'eeglab.cfg'),'Path','-mat','-V6'); % Matlab 7 + catch, + try, save(fullfile(tmp_fld,'eeglab.cfg'),'Path','-mat'); + catch, error('uigetfile2: save error, out of space or file permission problem'); + end + end + if isunix + eval(['cd ' tmp_fld]); + system('chmod 777 eeglab.cfg'); + end + end; + end; + catch, end; + cd(olddir) + + + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/uisettxt.m b/code/eeglab13_4_4b/functions/sigprocfunc/uisettxt.m new file mode 100644 index 0000000..29e4d8b --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/uisettxt.m @@ -0,0 +1,19 @@ +function uisettxt(fig, tag, str, varargin); + +alltmpobj = findobj(fig, 'tag', tag); +for tmpobj = alltmpobj' + tmppos = get(tmpobj, 'position'); + delete(tmpobj); + axes('position', tmppos); + axis('off'); + + if ~iscell(str), str = { str }; end; + maxX = 0; + for index = 1:length(str) + tmp = text(index, 0, str{index}); + maxX = index+1; + set(tmp, 'tag', tag, varargin{:}); + end; + xlim([0 maxX]); +end; + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/voltype.m b/code/eeglab13_4_4b/functions/sigprocfunc/voltype.m new file mode 100644 index 0000000..c1c7341 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/voltype.m @@ -0,0 +1,30 @@ +% VOLTYPE determines the type of volume conduction model +% +% Use as +% [type] = voltype(vol) +% to get a string describing the type, or +% [flag] = voltype(vol, desired) +% to get a boolean value. +% +% See also COMPUTE_LEADFIELD + +% Copyright (C) 2007, Robert Oostenveld +% +function [type] = voltype(vol, desired) + +if isfield(vol, 'type') + type = vol.type; +elseif isfield(vol, 'r') && prod(size(vol.r))==1 + type = 'singlesphere'; +elseif isfield(vol, 'r') && isfield(vol, 'o') && all(size(vol.r)==size(vol.o)) + type = 'multisphere'; +elseif isfield(vol, 'r') + type = 'concentric'; +elseif isfield(vol, 'bnd') + type = 'bem'; +end + +if nargin>1 + type = strcmp(type, desired); +end + diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/white1st.col b/code/eeglab13_4_4b/functions/sigprocfunc/white1st.col new file mode 100644 index 0000000..0663624 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/white1st.col @@ -0,0 +1,64 @@ +w.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. +m.. +c.. +r.. +g.. +b.. diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/writecnt.m b/code/eeglab13_4_4b/functions/sigprocfunc/writecnt.m new file mode 100644 index 0000000..e3c5467 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/writecnt.m @@ -0,0 +1,526 @@ +% writecnt() - Write a Neuroscan continuous signal file. +% +% Usage: +% >> writecnt(filename, CNT-dataset, varargin) +% +% Inputs: +% filename - name of the file with extension +% dataset - name of the CNT-dataset, a structure with the following fields +% cntdataset.header +% cntdataset.electloc +% cntdataset.data +% cntdataset.Teeg +% cntdataset.event +% cntdataset.tag +% cntdataset.endtag +% +% optional fields +% cntdataset.dataformat: 'int32' or 'int16' +% +% Optional inputs: +% 'header': bool, write header. (default=true) +% 'electrodes': bool, write electrode information. (default=true) +% 'data': bool, write data (default=true) +% 'eventtable': bool, write event table (default=true) +% 'endtag': bool, write end tag (default=true) +% 'append': bool, append requested information to end of file. +% (default=false) Requires that file exists. +% 't1' - start at time t1, default 0; ERROR WITH NONZERO VALUES +% 'sample1' - start at sample1, default 0, overrides t1 ERROR WITH NONZERO VALUES +% 'lddur' - duration of segment to load, default = whole file +% 'ldnsamples' - number of samples to load, default = whole file, +% overrides lddur +% 'scale' - ['on'|'off'] scale data to microvolt (default:'on') +% 'dataformat' - ['int16'|'int32'] default is 'int16' for 16-bit data. +% Use 'int32' for 32-bit data. +% +% Outputs: +% file - file containing NeuroScan CNT file with the continuous +% data and other information +% +% Authors: Sean Fitzgibbon, Arnaud Delorme, Michiel Vestjens and +% and Chris Bishop 2000-2014. Maintained by Chris Bishop +% (cwbishop_at_ucdavis.edu). +% +% Known limitations: +% For more see http://www.cnl.salk.edu/~arno/cntload/index.html + +% Copyright (C) 2000 Sean Fitzgibbon, +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function f = writecnt(filename,cntdataset,varargin) + +if ~isempty(varargin) + WriteOptions=struct(varargin{:}); +else WriteOptions = []; +end; + +try, WriteOptions.t1; catch, WriteOptions.t1=0; end +try, WriteOptions.sample1; catch, WriteOptions.sample1=[]; end +try, WriteOptions.lddur; catch, WriteOptions.lddur=[]; end +try, WriteOptions.ldnsamples; catch, WriteOptions.ldnsamples=[]; end +try, WriteOptions.scale; catch, WriteOptions.scale='on'; end +try, WriteOptions.dataformat; catch, WriteOptions.dataformat='int16'; end + +%% CATCH FOR KNOWN ERRORS WITH NON ZERO T1 and SAMPLE1 +if WriteOptions.t1~=0 || (~isempty(WriteOptions.sample1) && WriteOptions.sample1~=0) + error('writecnt:NonzeroStartPosition', 'writecnt cannot deal with nonzero write positions.'); +end % if WriteOptions + +%% ADDITIONAL CHECKS BY CWB +% Set defaults for optional inputs +if ~isfield(WriteOptions, 'header') || isempty(WriteOptions.header), WriteOptions.header=true; end +if ~isfield(WriteOptions, 'electrodes') || isempty(WriteOptions.electrodes), WriteOptions.electrodes=true; end +if ~isfield(WriteOptions, 'data') || isempty(WriteOptions.data), WriteOptions.data=true; end +if ~isfield(WriteOptions, 'eventtable') || isempty(WriteOptions.eventtable), WriteOptions.eventtable=true; end +if ~isfield(WriteOptions, 'append') || isempty(WriteOptions.append), WriteOptions.append=false; end +if ~isfield(WriteOptions, 'endtag') || isempty(WriteOptions.endtag), WriteOptions.endtag=true; end + +%% SIZE OF EVENT DATA (differs based on version of SCAN) +sizeEvent1 = 8 ; %%% 8 bytes for Event1 +sizeEvent2 = 19 ; %%% 19 bytes for Event2 + +type='cnt'; +if nargin ==1 + scan=0; +end + +h = cntdataset.header; +e = cntdataset.electloc; +dat = cntdataset.data; +eT = cntdataset.Teeg; +ev2 = cntdataset.event; +t = cntdataset.tag; +if ~isfield(cntdataset,'endtag') + endtag=[]; +else + endtag=cntdataset.endtag; +end + +%% APPEND DATA? +% If not, then open data for general writing +if WriteOptions.append + fid=fopen(filename,'a+'); +% display('Appending requested information ...'); +else + fid = fopen(filename,'w'); +end % if WriteOptions.append + + +% disp(['Writing file ' filename ' ...']) + +% HEADER : 900 bytes => Starts at 0h, finishes with 383h. +if WriteOptions.header + fwrite(fid,h.rev,'char'); + fwrite(fid,h.nextfile,'long'); + fwrite(fid,h.prevfile,'long'); + fwrite(fid,h.type,'char'); + fwrite(fid,h.id,'char'); + fwrite(fid,h.oper,'char'); + fwrite(fid,h.doctor,'char'); + fwrite(fid,h.referral,'char'); + fwrite(fid,h.hospital,'char'); + fwrite(fid,h.patient,'char'); + fwrite(fid,h.age,'short'); + fwrite(fid,h.sex,'char'); + fwrite(fid,h.hand,'char'); + fwrite(fid,h.med,'char'); + fwrite(fid,h.category,'char'); + fwrite(fid,h.state,'char'); + fwrite(fid,h.label,'char'); + fwrite(fid,h.date,'char'); + fwrite(fid,h.time,'char'); + fwrite(fid,h.mean_age,'float'); + fwrite(fid,h.stdev,'float'); + fwrite(fid,h.n,'short'); + fwrite(fid,h.compfile,'char'); + fwrite(fid,h.spectwincomp,'float'); + fwrite(fid,h.meanaccuracy,'float'); + fwrite(fid,h.meanlatency,'float'); + fwrite(fid,h.sortfile,'char'); + fwrite(fid,h.numevents,'int'); + fwrite(fid,h.compoper,'char'); + fwrite(fid,h.avgmode,'char'); + fwrite(fid,h.review,'char'); + fwrite(fid,h.nsweeps,'ushort'); + fwrite(fid,h.compsweeps,'ushort'); + fwrite(fid,h.acceptcnt,'ushort'); + fwrite(fid,h.rejectcnt,'ushort'); + fwrite(fid,h.pnts,'ushort'); + fwrite(fid,h.nchannels,'ushort'); + fwrite(fid,h.avgupdate,'ushort'); + fwrite(fid,h.domain,'char'); + fwrite(fid,h.variance,'char'); + fwrite(fid,h.rate,'ushort'); + fwrite(fid,h.scale,'double'); + fwrite(fid,h.veogcorrect,'char'); + fwrite(fid,h.heogcorrect,'char'); + fwrite(fid,h.aux1correct,'char'); + fwrite(fid,h.aux2correct,'char'); + fwrite(fid,h.veogtrig,'float'); + fwrite(fid,h.heogtrig,'float'); + fwrite(fid,h.aux1trig,'float'); + fwrite(fid,h.aux2trig,'float'); + fwrite(fid,h.heogchnl,'short'); + fwrite(fid,h.veogchnl,'short'); + fwrite(fid,h.aux1chnl,'short'); + fwrite(fid,h.aux2chnl,'short'); + fwrite(fid,h.veogdir,'char'); + fwrite(fid,h.heogdir,'char'); + fwrite(fid,h.aux1dir,'char'); + fwrite(fid,h.aux2dir,'char'); + fwrite(fid,h.veog_n,'short'); + fwrite(fid,h.heog_n,'short'); + fwrite(fid,h.aux1_n,'short'); + fwrite(fid,h.aux2_n,'short'); + fwrite(fid,h.veogmaxcnt,'short'); + fwrite(fid,h.heogmaxcnt,'short'); + fwrite(fid,h.aux1maxcnt,'short'); + fwrite(fid,h.aux2maxcnt,'short'); + fwrite(fid,h.veogmethod,'char'); + fwrite(fid,h.heogmethod,'char'); + fwrite(fid,h.aux1method,'char'); + fwrite(fid,h.aux2method,'char'); + fwrite(fid,h.ampsensitivity,'float'); + fwrite(fid,h.lowpass,'char'); + fwrite(fid,h.highpass,'char'); + fwrite(fid,h.notch,'char'); + fwrite(fid,h.autoclipadd,'char'); + fwrite(fid,h.baseline,'char'); + fwrite(fid,h.offstart,'float'); + fwrite(fid,h.offstop,'float'); + fwrite(fid,h.reject,'char'); + fwrite(fid,h.rejstart,'float'); + fwrite(fid,h.rejstop,'float'); + fwrite(fid,h.rejmin,'float'); + fwrite(fid,h.rejmax,'float'); + fwrite(fid,h.trigtype,'char'); + fwrite(fid,h.trigval,'float'); + fwrite(fid,h.trigchnl,'char'); + fwrite(fid,h.trigmask,'short'); + fwrite(fid,h.trigisi,'float'); + fwrite(fid,h.trigmin,'float'); + fwrite(fid,h.trigmax,'float'); + fwrite(fid,h.trigdir,'char'); + fwrite(fid,h.autoscale,'char'); + fwrite(fid,h.n2,'short'); + fwrite(fid,h.dir,'char'); + fwrite(fid,h.dispmin,'float'); + fwrite(fid,h.dispmax,'float'); + fwrite(fid,h.xmin,'float'); + fwrite(fid,h.xmax,'float'); + fwrite(fid,h.automin,'float'); + fwrite(fid,h.automax,'float'); + fwrite(fid,h.zmin,'float'); + fwrite(fid,h.zmax,'float'); + fwrite(fid,h.lowcut,'float'); + fwrite(fid,h.highcut,'float'); + fwrite(fid,h.common,'char'); + fwrite(fid,h.savemode,'char'); + fwrite(fid,h.manmode,'char'); + fwrite(fid,h.ref,'char'); + fwrite(fid,h.rectify,'char'); + fwrite(fid,h.displayxmin,'float'); + fwrite(fid,h.displayxmax,'float'); + fwrite(fid,h.phase,'char'); + fwrite(fid,h.screen,'char'); + fwrite(fid,h.calmode,'short'); + fwrite(fid,h.calmethod,'short'); + fwrite(fid,h.calupdate,'short'); + fwrite(fid,h.calbaseline,'short'); + fwrite(fid,h.calsweeps,'short'); + fwrite(fid,h.calattenuator,'float'); + fwrite(fid,h.calpulsevolt,'float'); + fwrite(fid,h.calpulsestart,'float'); + fwrite(fid,h.calpulsestop,'float'); + fwrite(fid,h.calfreq,'float'); + fwrite(fid,h.taskfile,'char'); + fwrite(fid,h.seqfile,'char'); + fwrite(fid,h.spectmethod,'char'); + fwrite(fid,h.spectscaling,'char'); + fwrite(fid,h.spectwindow,'char'); + fwrite(fid,h.spectwinlength,'float'); + fwrite(fid,h.spectorder,'char'); + fwrite(fid,h.notchfilter,'char'); + fwrite(fid,h.headgain,'short'); + fwrite(fid,h.additionalfiles,'int'); + fwrite(fid,h.unused,'char'); + fwrite(fid,h.fspstopmethod,'short'); + fwrite(fid,h.fspstopmode,'short'); + fwrite(fid,h.fspfvalue,'float'); + fwrite(fid,h.fsppoint,'short'); + fwrite(fid,h.fspblocksize,'short'); + fwrite(fid,h.fspp1,'ushort'); + fwrite(fid,h.fspp2,'ushort'); + fwrite(fid,h.fspalpha,'float'); + fwrite(fid,h.fspnoise,'float'); + fwrite(fid,h.fspv1,'short'); + fwrite(fid,h.montage,'char'); + fwrite(fid,h.eventfile,'char'); + fwrite(fid,h.fratio,'float'); + fwrite(fid,h.minor_rev,'char'); + fwrite(fid,h.eegupdate,'short'); + fwrite(fid,h.compressed,'char'); + fwrite(fid,h.xscale,'float'); + fwrite(fid,h.yscale,'float'); + fwrite(fid,h.xsize,'float'); + fwrite(fid,h.ysize,'float'); + fwrite(fid,h.acmode,'char'); + fwrite(fid,h.commonchnl,'uchar'); + fwrite(fid,h.xtics,'char'); + fwrite(fid,h.xrange,'char'); + fwrite(fid,h.ytics,'char'); + fwrite(fid,h.yrange,'char'); + fwrite(fid,h.xscalevalue,'float'); + fwrite(fid,h.xscaleinterval,'float'); + fwrite(fid,h.yscalevalue,'float'); + fwrite(fid,h.yscaleinterval,'float'); + fwrite(fid,h.scaletoolx1,'float'); + fwrite(fid,h.scaletooly1,'float'); + fwrite(fid,h.scaletoolx2,'float'); + fwrite(fid,h.scaletooly2,'float'); + fwrite(fid,h.port,'short'); + fwrite(fid,h.numsamples,'ulong'); + fwrite(fid,h.filterflag,'char'); + fwrite(fid,h.lowcutoff,'float'); + fwrite(fid,h.lowpoles,'short'); + fwrite(fid,h.highcutoff,'float'); + fwrite(fid,h.highpoles,'short'); + fwrite(fid,h.filtertype,'char'); + fwrite(fid,h.filterdomain,'char'); + fwrite(fid,h.snrflag,'char'); + fwrite(fid,h.coherenceflag,'char'); + fwrite(fid,h.continuoustype,'char'); + fwrite(fid,h.eventtablepos,'long'); + fwrite(fid,h.continuousseconds,'float'); + fwrite(fid,h.channeloffset,'long'); + fwrite(fid,h.autocorrectflag,'char'); + fwrite(fid,h.dcthreshold,'uchar'); % = 383H +end % if WriteOptions.header + +% ELECT.DESCRIPTIONS : 75*n.channels bytes. +% Starts with 384h, finishes with (899+75*nchannels)dec +% 10 channels: 671h % 12 channels: 707h +% 24 channels: A8Bh % 32 channels: CE3h +% 64 channels: 1643h % 128 channels: 2903h + +if WriteOptions.electrodes + for n = 1:h.nchannels + lablength = fwrite(fid,e(n).lab,'char'); + fwrite(fid,e(n).reference,'char',10-lablength); + fwrite(fid,e(n).skip,'char'); + fwrite(fid,e(n).reject,'char'); + fwrite(fid,e(n).display,'char'); + fwrite(fid,e(n).bad,'char'); + fwrite(fid,e(n).n,'ushort'); + fwrite(fid,e(n).avg_reference,'char'); + fwrite(fid,e(n).clipadd,'char'); + fwrite(fid,e(n).x_coord,'float'); + fwrite(fid,e(n).y_coord,'float'); + fwrite(fid,e(n).veog_wt,'float'); + fwrite(fid,e(n).veog_std,'float'); + fwrite(fid,e(n).snr,'float'); + fwrite(fid,e(n).heog_wt,'float'); + fwrite(fid,e(n).heog_std,'float'); + fwrite(fid,e(n).baseline,'short'); + fwrite(fid,e(n).filtered,'char'); + fwrite(fid,e(n).fsp,'char'); + fwrite(fid,e(n).aux1_wt,'float'); + fwrite(fid,e(n).aux1_std,'float'); + fwrite(fid,e(n).senstivity,'float'); + fwrite(fid,e(n).gain,'char'); + fwrite(fid,e(n).hipass,'char'); + fwrite(fid,e(n).lopass,'char'); + fwrite(fid,e(n).page,'uchar'); + fwrite(fid,e(n).size,'uchar'); + fwrite(fid,e(n).impedance,'uchar'); + fwrite(fid,e(n).physicalchnl,'uchar'); + fwrite(fid,e(n).rectify,'char'); + fwrite(fid,e(n).calib,'float'); + end % for +end % if WriteOptions.electrodes + +%% SET FILE POINTER TO END OF HEADER INFORMATION +% Need to advance the pointer in the event that the header and/or +% electrodes have not been written (or have already been written to +% file) since the file pointer position is used to determine the +% beginning of the data. +% +% This is a bit clunky, but ensures that 'append' mode works properly +% when calculated the number of data points to write. +fseek(fid, 900+75*h.nchannels, 'bof'); +% finding if 32-bits of 16-bits file +% ---------------------------------- +begdata = ftell(fid); +enddata = h.eventtablepos; % after data +if strcmpi(WriteOptions.dataformat, 'int16') + nums = (enddata-begdata)/h.nchannels/2; +else nums = (enddata-begdata)/h.nchannels/4; +end; + +% number of sample to write +% ------------------------- +if ~isempty(WriteOptions.sample1) + WriteOptions.t1 = WriteOptions.sample1/h.rate; +else + WriteOptions.sample1 = WriteOptions.t1*h.rate; +end; +if strcmpi(WriteOptions.dataformat, 'int16') + startpos = WriteOptions.t1*h.rate*2*h.nchannels; +else startpos = WriteOptions.t1*h.rate*4*h.nchannels; +end; +if isempty(WriteOptions.ldnsamples) + if ~isempty(WriteOptions.lddur) + WriteOptions.ldnsamples = round(WriteOptions.lddur*h.rate); + else WriteOptions.ldnsamples = nums; + end; +end; + +% scaling data from microvolts +% ---------------------------- +if strcmpi(WriteOptions.scale, 'on') +% disp('Scaling data .....') + for i=1:h.nchannels + bas=e(i).baseline; + sen=e(i).senstivity; + cal=e(i).calib; + mf=sen*(cal/204.8); + dat(i,:)=(dat(i,:)/mf)+bas; + end +end + + +% write data +% ---------- + +% disp('Writing data .....') +if type == 'cnt' + + if WriteOptions.data + channel_off = h.channeloffset/2; + + fseek(fid, startpos, 0); + if channel_off <= 1 + for temploop =1:WriteOptions.ldnsamples; + fwrite(fid, dat(1:h.nchannels, temploop), WriteOptions.dataformat)'; + end; + else + for temploop =1:h.nchannels; + fwrite(fid, dat(temploop, 1:channel_off), WriteOptions.dataformat)'; + end; + + counter = 1; + while counter*channel_off < WriteOptions.ldnsamples + + for temploop =1:h.nchannels; + fwrite(fid, dat(temploop, counter*channel_off+1:counter*channel_off+channel_off), WriteOptions.dataformat)'; + end; + counter = counter + 1; + end; + end; + end % if WriteOptions.data + + if WriteOptions.eventtable + % write event table + % ----------------- + frewind(fid); + fseek(fid,h.eventtablepos,'bof'); + + disp('Writing Event Table...') + fwrite(fid,eT.teeg,'uchar'); + fwrite(fid,eT.size,'ulong'); + fwrite(fid,eT.offset,'ulong'); + + if eT.teeg==2 + nevents=eT.size/sizeEvent2; + elseif eT.teeg==1 + nevents=eT.size/sizeEvent1; + else + disp('No !!! teeg <> 2 and teeg <> 1'); + ev2 = []; + end % if eT.teeg==2 + + %%%% to change offset in points back to bytes + if ~isempty(ev2) + ev2p=ev2; + ioff=900+(h.nchannels*75); %% initial offset : header + electordes desc + + % 140219 CWB: Writing events to file in byte form depends on + % data precision. Need to select the correct data precision + % here. + if strcmpi(WriteOptions.dataformat, 'int16') + NBYTES=2; + elseif strcmpi(WriteOptions.dataformat, 'int32') + NBYTES=4; + end % if strcmpi + + for i=1:nevents + ev2p(i).offset=((ev2p(i).offset + WriteOptions.sample1)*NBYTES*h.nchannels) +ioff; %% 2 short int end + end + ev2 = ev2p; + end; % if ~isempty(ev2) + + if eT.teeg==2 + nevents=eT.size/sizeEvent2; + for i=1:nevents + ev2(i).stimtype = fwrite(fid,ev2(i).stimtype,'ushort'); + ev2(i).keyboard = fwrite(fid,ev2(i).keyboard,'char'); + ev2(i).keypad_accept = fwrite(fid,ev2(i).keypad_accept,'char'); + ev2(i).offset = fwrite(fid,ev2(i).offset,'long'); + ev2(i).type = fwrite(fid,ev2(i).type,'short'); + ev2(i).code = fwrite(fid,ev2(i).code,'short'); + ev2(i).latency = fwrite(fid,ev2(i).latency,'float'); + ev2(i).epochevent = fwrite(fid,ev2(i).epochevent,'char'); + ev2(i).accept = fwrite(fid,ev2(i).accept,'char'); + ev2(i).accuracy = fwrite(fid,ev2(i).accuracy,'char'); + end % for i=1:nevents + elseif eT.teeg==1 + nevents=eT.size/sizeEvent1; + for i=1:nevents + ev2(i).stimtype = fwrite(fid,ev2(i).stimtype,'ushort'); + ev2(i).keyboard = fwrite(fid,ev2(i).keyboard,'char'); + ev2(i).keypad_accept = fwrite(fid,ev2(i).keypad_accept,'char'); + ev2(i).offset = fwrite(fid,ev2(i).offset,'long'); + end % for i=1:nevents + else + disp('No !!! teeg <> 2 and teeg <> 1'); + ev2 = []; + end %if/elseif/else + end % if WriteOptions.eventtable +end % if type=='cnt' + +%% WE ARE AT h.nextfile position here +% So there has to be additional information at the end of the CNT file +% that is NOT read in by loadcnt.m but we ultimately need in order to +% rewrite the file. +% +% Ah, there IS more information that loadcnt is not actually reading, +% although it depends on some of it to determine if the data are 16 or 32 +% bit. +% +% CWB put this information in a junk field (cntdataset.junk) that can be +% written if it's present. +if WriteOptions.endtag + if size(endtag,1)>1 + fwrite(fid,endtag); + else + fwrite(fid,t,'char'); + end +end % if WriteOptions.endtag + +fclose(fid); +% disp(['Finished writing file ' filename ' ...']) diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/writeeeg.m b/code/eeglab13_4_4b/functions/sigprocfunc/writeeeg.m new file mode 100644 index 0000000..ac755b1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/writeeeg.m @@ -0,0 +1,231 @@ +% writeeeg - Generating CNT/EDF/BDF/GDF-files using BIOSIG toolbox. Note +% that the CNT file format is not fully functional. See also the +% writecnt.m Matlab function (there is no fully working +% Neuroscan writing function to our knowledge). +% +% writeeeg( filename, data, srate, 'key', 'val') +% +% Inputs: +% filename - [string] filename +% data - [float] continuous or epoched data (channels x times x +% epochs) +% srate - [float] sampling rate in Hz +% +% Optional keys: +% 'TYPE' - ['GDF'|'EDF'|'BDF'|'CFWB'|'CNT'] file format for writing +% default is 'EDF'. +% 'EVENT' - event structure (BIOSIG or EEGLAB format) +% 'Label' - cell array of channel labels. Warning, this input is +% case sensitive. +% 'SPR' - [integer] sample per block, default is 1000 +% +% Other optional keys: +% 'Patient.id' - [string] person identification, max 80 char +% 'Patient.Sex' - [0|1|2] 0: undefined (default), 1: male, 2: female +% 'Patient.Birthday' - Default [1951 05 13 0 0 0]; +% 'Patient.Name' - [string] default 'anonymous' for privacy protection +% 'Patient.Handedness' - [0|1|2|3] 0: unknown (default), 1:left, 2:right, +% 3: equal +% 'Patient.Weight' - [integer] default 0, undefined +% 'Patient.Height' - [integer] default 0, undefined +% 'Patient.Impairment.Heart' - [integer] 0: unknown 1: NO 2: YES 3: pacemaker +% 'Patient.Impairment.Visual' - [integer] 0: unknown 1: NO 2: YES +% 3: corrected (with visual aid) +% 'Patient.Smoking' - [integer] 0: unknown 1: NO 2: YES +% 'Patient.AlcoholAbuse' - [integer] 0: unknown 1: NO 2: YES +% 'Patient.DrugAbuse' - [integer] 0: unknown 1: NO 2: YES +% +% 'Manufacturer.Name - [string] default is 'BioSig/EEGLAB' +% 'Manufacturer.Model - [string] default is 'writeeeg.m' +% 'Manufacturer.Version - [string] default is current version in CVS repository +% 'Manufacturer.SerialNumber - [string] default is '00000000' +% +% 'T0' - recording time [YYYY MM DD hh mm ss.ccc] +% 'RID' - [string] StudyID/Investigation, default is empty +% 'REC.Hospital - [string] default is empty +% 'REC.Techician - [string] default is empty +% 'REC.Equipment - [string] default is empty +% 'REC.IPaddr - [integer array] IP address of recording system. Default is +% [127,0,0,1] +% +% Author: Arnaud Delorme, SCCN, UCSD/CERCO, 2009 +% Based on BIOSIG, sopen and swrite + +% Copyright (C) 22 March 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function HDR = writeeeg(filename, x, srate, varargin) + +% decode structures +HDR = []; +for i=1:2:length( varargin ) + str = varargin{i}; + val = varargin{i+1}; + ind = strfind(str, '.'); + if length(ind) == 2 + HDR = setfield(HDR, varargin{i}(1:ind(1)-1), {1}, varargin{i}(ind(1)+1:ind(2)-1), ... + {1}, varargin{i}(ind(2)+1:end), val); + elseif length(ind) == 1 + HDR = setfield(HDR, varargin{i}(1:ind-1), {1}, varargin{i}(ind+1:end), val); + else + HDR = setfield(HDR, varargin{i}, varargin{i+1}); + end; +end; + +HDR.FileName = filename; +HDR.FLAG.UCAL = 0; + +% select file format +if ~isfield(HDR, 'EVENT'), HDR.EVENT = []; end; +if ~isfield(HDR, 'TYPE'), HDR.TYPE ='GDF'; end; +if ~isfield(HDR, 'Patient') HDR.Patient = []; end; +if ~isfield(HDR.Patient, 'ID') HDR.Patient.ID = 'P0000'; end; +if ~isfield(HDR.Patient, 'Sex') HDR.Patient.Sex = 0; end; +if ~isfield(HDR.Patient, 'Name') HDR.Patient.Name = 'Anonymous'; end; +if ~isfield(HDR.Patient, 'Handedness') HDR.Patient.Handedness = 0; end;% unknown, 1:left, 2:right, 3: equal + +% description of recording device +if ~isfield(HDR,'Manufacturer') HDR.Manufacturer = []; end; +if ~isfield(HDR.Manufacturer, 'Name'), HDR.Manufacturer.Name = 'BioSig/EEGLAB'; end; +if ~isfield(HDR.Manufacturer, 'Model'), HDR.Manufacturer.Model = 'writeeeg.m'; end; +if ~isfield(HDR.Manufacturer, 'Version'), HDR.Manufacturer.Version = '$Revision'; end; +if ~isfield(HDR.Manufacturer, 'SerialNumber'), HDR.Manufacturer.SerialNumber = '00000000'; end; + +% recording identification, max 80 char. +if ~isfield(HDR,'RID') HDR.RID = ''; end; %StudyID/Investigation [consecutive number]; +if ~isfield(HDR,'REC') HDR.REC = []; end; +if ~isfield(HDR.REC, 'Hospital') HDR.REC.Hospital = ''; end; +if ~isfield(HDR.REC, 'Techician') HDR.REC.Techician = ''; end; +if ~isfield(HDR.REC, 'Equipment') HDR.REC.Equipment = ''; end; +if ~isfield(HDR.REC, 'IPaddr') HDR.REC.IPaddr = [127,0,0,1]; end; % IP address of recording system +if ~isfield(HDR.Patient, 'Weight') HDR.Patient.Weight = 0; end; % undefined +if ~isfield(HDR.Patient, 'Height') HDR.Patient.Height = 0; end; % undefined +if ~isfield(HDR.Patient, 'Birthday') HDR.Patient.Birthday = [1951 05 13 0 0 0]; end; % undefined +if ~isfield(HDR.Patient, 'Impairment') HDR.Patient.Impairment = []; end; +if ~isfield(HDR.Patient.Impairment, 'Heart') HDR.Patient.Impairment.Heart = 0; end; % 0: unknown 1: NO 2: YES 3: pacemaker +if ~isfield(HDR.Patient.Impairment, 'Visual') HDR.Patient.Impairment.Visual = 0; end; % 0: unknown 1: NO 2: YES 3: corrected (with visual aid) +if ~isfield(HDR.Patient,'Smoking') HDR.Patient.Smoking = 0; end; % 0: unknown 1: NO 2: YES +if ~isfield(HDR.Patient,'AlcoholAbuse') HDR.Patient.AlcoholAbuse = 0; end; % 0: unknown 1: NO 2: YES +if ~isfield(HDR.Patient,'DrugAbuse') HDR.Patient.DrugAbuse = 0; end; % 0: unknown 1: NO 2: YES + +% recording time [YYYY MM DD hh mm ss.ccc] +if ~isfield(HDR,'T0') HDR.T0 = clock; end; +if ~isfield(HDR,'SPR') HDR.SPR = size(x,2); end; +if isfield(HDR,'label') HDR.Label = HDR.label; HDR = rmfield(HDR, 'label'); end; +if HDR.SPR > 1000, HDR.SPR = round(srate); end; + +% channel identification, max 80 char. per channel +if ~isfield(HDR,'Label') + for i = 1:size(x,1) + chans{i} = sprintf('Chan %d', i); + end; + HDR.Label = chans; +end; +if iscell(HDR.Label), HDR.Label = char(HDR.Label{:}); end; + +if ~isempty(HDR.EVENT) + if ~isfield(HDR.EVENT, 'TYP') + EVENT = []; + EVENT.CHN = zeros(length(HDR.EVENT),1); + EVENT.TYP = zeros(length(HDR.EVENT),1); + EVENT.POS = zeros(length(HDR.EVENT),1); + EVENT.DUR = ones( length(HDR.EVENT),1); + EVENT.VAL = zeros(length(HDR.EVENT),1)*NaN; + if isfield(HDR.EVENT, 'type') + for index = 1:length(HDR.EVENT) + HDR.EVENT(index).type = num2str(HDR.EVENT(index).type); + end; + alltypes = unique_bc( { HDR.EVENT.type } ); + end; + for i = 1:length(HDR.EVENT) + if isfield(HDR.EVENT, 'type') + ind = str2num(HDR.EVENT(i).type); + if isempty(ind) + ind = strmatch(HDR.EVENT(i).type, alltypes, 'exact'); + end; + EVENT.TYP(i) = ind; + end; + if isfield(HDR.EVENT, 'latency') + EVENT.POS(i) = HDR.EVENT(i).latency; + end; + if isfield(HDR.EVENT, 'duration') + EVENT.DUR(i) = HDR.EVENT(i).duration; + end; + end; + HDR.EVENT = EVENT; + HDR.EVENT.SampleRate = srate; + end; +end; + +% reformat data +HDR.NRec = size(x,3); +x = double(x); +x = reshape(x, [size(x,1) size(x,2)*size(x,3) ]); + +% recreate event channel +if isempty(HDR.EVENT) + HDR.EVENT.POS = []; + HDR.EVENT.TYP = []; + HDR.EVENT.POS = []; + HDR.EVENT.DUR = []; + HDR.EVENT.VAL = []; + HDR.EVENT.CHN = []; +elseif ~strcmpi(HDR.TYPE, 'GDF') % GDF can save events + disp('Recreating event channel'); + x(end+1,:) = 0; + x(end,round(HDR.EVENT.POS')) = HDR.EVENT.TYP'; + HDR.Label = char(HDR.Label, 'Status'); + HDR.EVENT.POS = []; +end; + +% number of channels +HDR.NS = size(x,1); + +if ~isfield(HDR,'Transducer') + HDR.Transducer = cell(1,HDR.NS); + HDR.Transducer(:) = { '' }; +end; +if ~isfield(HDR,'PhysDim') + HDR.PhysDim = cell(1,HDR.NS); + HDR.PhysDim(:) = { 'uV' }; +end; + +% Duration of one block in seconds +HDR.SampleRate = srate; +HDR.Dur = HDR.SPR/HDR.SampleRate; + +% define datatypes and scaling factors +HDR.PhysMax = max(x, [], 2); +HDR.PhysMin = min(x, [], 2); +if strcmp(HDR.TYPE, 'GDF') + HDR.GDFTYP = 16*ones(1,HDR.NS); % float32 + HDR.DigMax = ones(HDR.NS,1)*100; % FIXME: What are the correct values for float32? + HDR.DigMin = zeros(HDR.NS,1); +else + HDR.GDFTYP = 3*ones(1,HDR.NS); % int16 + HDR.DigMin = repmat(-2^15, size(HDR.PhysMin)); + HDR.DigMax = repmat(2^15-1, size(HDR.PhysMax)); +end + +HDR.Filter.Lowpass = zeros(1,HDR.NS)*NaN; +HDR.Filter.Highpass = zeros(1,HDR.NS)*NaN; +HDR.Filter.Notch = zeros(1,HDR.NS)*NaN; + +HDR.VERSION = 2.11; + +HDR = sopen(HDR,'w'); +HDR = swrite(HDR, x'); +HDR = sclose(HDR); diff --git a/code/eeglab13_4_4b/functions/sigprocfunc/writelocs.m b/code/eeglab13_4_4b/functions/sigprocfunc/writelocs.m new file mode 100644 index 0000000..449b533 --- /dev/null +++ b/code/eeglab13_4_4b/functions/sigprocfunc/writelocs.m @@ -0,0 +1,226 @@ +% writelocs() - write a file containing channel location, type and gain information +% +% Usage: +% >> writelocs( chanstruct, filename ); +% >> writelocs( chanstruct, filename, 'key', 'val' ); +% +% Inputs: +% chanstruct - EEG.chanlocs data structure returned by readlocs() containing +% channel location, type and gain information. +% filename - File name for saving channel location, type and gain information +% +% Optional inputs: +% 'filetype' - ['loc'|'sph'|'sfp'|'xyz'|'polhemus'|'besa'|'chanedit'|'custom'] +% Type of the file to write. By default the file type is indicated +% by the file extension. +% 'loc' - An EEGLAB 2-D polar coordinates channel locations file +% Coordinates are theta and radius (see definitions below). +% 'sph' - A Matlab spherical coordinates file (Note: spherical +% coordinates used by Matlab functions are different +% from spherical coordinates used in BESA - see below). +% 'sfp' - EGI cartesian coordinates (not Matlab cartesian - see below). +% 'xyz' - MATLAB/EEGLAB cartesian coordinates (Not EGI cartesian; +% z is toward nose; y is toward left ear; z is toward vertex). +% 'polhemus' or 'polhemusx' - Polhemus electrode location file recorded with +% 'X' on sensor pointing to subject (see below and readelp()). +% 'polhemusy' - Polhemus electrode location file recorded with +% 'Y' on sensor pointing to subject (see below and readelp()). +% 'besa' - BESA'(.elp') spherical coordinate file. (Not MATLAB spherical +% - see below). +% 'chanedit' - EEGLAB channel location files created by pop_chanedit(). +% 'custom' - Ascii files with columns in user-defined 'format' (see below). +% 'format' - [cell array] Format of a 'custom' channel location file (see above). +% Default if no file type is defined. The cell array contains +% labels defining the meaning of each column of the input file. +% 'channum' [positive integer] channel number +% 'labels' [string] channel name (no spaces) +% 'theta' [real degrees] 2-D angle in polar coordinates. +% positive => rotating from nose (0) toward left ear +% 'radius' [real] radius in 2-D polar coords (0.5 is disk limits) +% 'X' [real] Matlab-cartesian X coordinate (to nose) +% 'Y' [real] Matlab-cartesian Y coordinate (to left ear) +% 'Z' [real] Matlab-cartesian Z coordinate (to vertex) +% '-X','-Y','-Z' Matlab-cartesian coordinates pointing away from above +% 'sph_theta' [real degrees] Matlab spherical horizontal angle. +% positive => rotating from nose (0) toward left ear. +% 'sph_phi' [real degrees] Matlab spherical elevation angle; +% positive => rotating from horizontal (0) upwards. +% 'sph_radius' [real] distance from head center (unused) +% 'sph_phi_besa' [real degrees] BESA phi angle from vertical. +% positive => rotating from vertex (0) towards right ear. +% 'sph_theta_besa' [real degrees] BESA theta horiz/azimuthal angle. +% positive => rotating from right ear (0) toward nose. +% The input file may also contain other channel information fields +% 'type' channel type: 'EEG', 'MEG', 'EMG', 'ECG', others ... +% 'calib' [real near 1.0] channel calibration value. +% 'gain' [real > 1] channel gain. +% 'custom1' custom field #1. +% 'custom2', 'custom3', 'custom4' more custom fields. +% 'unicoord' - ['on'|'off'] Uniformize all coordinates. Default 'on'. +% 'header' - ['on'|'off'] Add a header comment line with the name of each column. +% Comment lines begin with '%'. Default is 'off'. +% 'customheader' - [string] Add a custom header at the beginning of the file and +% preceded by '%'. If used with 'header' set to 'on', +% the column names will be insterted after the custom header. +% 'elecind' - [integer array] Indices of channels to export. +% Default is all channels. +% +% Note: for file formats, see readlocs() help (>> help readlocs) +% +% Author: Arnaud Delorme, Salk Institute, 16 Dec 2002 +% +% See also: readlocs(), readelp() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 28 Feb 2002 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function writelocs( chans, filename, varargin ); + +if nargin < 2 + help writelocs; + return; +end; + +% get infos from readlocs +% ----------------------- +%[listtype formatinfo listcolformat formatskip] = readlocs('getinfos'); +[chanformat listcolformat] = readlocs('getinfos'); +indformat = []; +for index = 1:length(chanformat), + if ~isstr(chanformat(index).importformat) + indformat = [ indformat index ]; + end; + if isempty(chanformat(index).skipline), chanformat(index).skipline = 0; end; +end; +listtype = { chanformat(indformat).type }; +formatinfo = { chanformat(indformat).importformat }; +formatskip = [ chanformat(indformat).skipline ]; + +g = finputcheck( varargin, ... + { 'filetype' 'string' listtype 'loc'; + 'header' 'string' { 'on','off' } 'off'; + 'customheader' 'string' [] ''; + 'elecind' 'integer' [1 Inf] []; + 'unicoord' 'string' { 'on','off' } 'on'; + 'format' 'cell' [] {} }, 'writelocs'); +if isstr(g), error(g); end; + +if strcmpi(g.unicoord, 'on') + disp('Uniformizing coordinates'); + chans = convertlocs(chans, 'auto', 'verbose', 'off'); +end; + +% select channels +% --------------- +if ~isempty(g.elecind) + chans = chans(g.elecind); +end; + +% finding types of input +% ---------------------- +if isempty(g.format) + indexformat = strmatch(lower(g.filetype), listtype, 'exact'); + g.format = formatinfo{indexformat}; + g.skipline = formatskip(indexformat); +else + g.skipline = 0; +end; + +% creating file +% ------------- +fid = fopen(filename, 'w'); + +% exporting header +% ---------------- +if ~isempty(g.customheader) + allstrs = cellstr(g.customheader); + for index=1:length(allstrs) + fprintf(fid, '%s\n', allstrs{index}); + end; +end; +if strcmpi(g.header, 'on') | g.skipline == 2 + for index=1:length(g.format) + fprintf(fid, '%8s\t', g.format{index}); + end; + fprintf(fid, '\n'); + for index=1:length(g.format) + fprintf(fid, '%8s\t', char(ones(1,8)*45)); + end; + fprintf(fid, '\n'); +end; +if g.skipline == 1 + fprintf(fid, '%d\n', length(chans)); +end; + +% writing infos +% ------------- +for indexchan = 1:length(chans) + for index=1:length(g.format) + [str, mult] = checkformat(g.format{index}); + if strcmpi(str, 'channum') + fprintf(fid, '%d', indexchan); + else + if ~isfield(chans, str) + error([ 'Non-existant field: ''' str '''' ]); + end; + eval( [ 'chanval = chans(indexchan).' str ';' ] ); + if isstr(chanval), fprintf(fid, '%8s', chanval); + else + if abs(mult*chanval) > 1E-10 + fprintf(fid, '%8s', num2str(mult*chanval,5)); + else + fprintf(fid, '%8s', '0'); + end; + end; + end; + if index ~= length(g.format) + fprintf(fid, '\t'); + end; + end; + fprintf(fid, '\n'); +end; +fclose(fid); + +return; + +% check field format +% ------------------ +function [str, mult] = checkformat(str) + mult = 1; + if strcmpi(str, 'labels'), str = lower(str); return; end; + if strcmpi(str, 'channum'), str = lower(str); return; end; + if strcmpi(str, 'theta'), str = lower(str); return; end; + if strcmpi(str, 'radius'), str = lower(str); return; end; + if strcmpi(str, 'sph_theta'), str = lower(str); return; end; + if strcmpi(str, 'sph_phi'), str = lower(str); return; end; + if strcmpi(str, 'sph_radius'), str = lower(str); return; end; + if strcmpi(str, 'sph_theta_besa'), str = lower(str); return; end; + if strcmpi(str, 'sph_phi_besa'), str = lower(str); return; end; + if strcmpi(str, 'gain'), str = lower(str); return; end; + if strcmpi(str, 'calib'), str = lower(str); return; end; + if strcmpi(str, 'type') , str = lower(str); return; end; + if strcmpi(str, 'X'), str = upper(str); return; end; + if strcmpi(str, 'Y'), str = upper(str); return; end; + if strcmpi(str, 'Z'), str = upper(str); return; end; + if strcmpi(str, '-X'), str = upper(str(2:end)); mult = -1; return; end; + if strcmpi(str, '-Y'), str = upper(str(2:end)); mult = -1; return; end; + if strcmpi(str, '-Z'), str = upper(str(2:end)); mult = -1; return; end; + if strcmpi(str, 'custum1'), return; end; + if strcmpi(str, 'custum2'), return; end; + if strcmpi(str, 'custum3'), return; end; + if strcmpi(str, 'custum4'), return; end; + error(['writelocs: undefined field ''' str '''']); + diff --git a/code/eeglab13_4_4b/functions/statistics/README.txt b/code/eeglab13_4_4b/functions/statistics/README.txt new file mode 100644 index 0000000..95343c0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/README.txt @@ -0,0 +1,54 @@ +Resampling statistical toolkit +------------------------------ +This package contains a set of functions for inferiential statistics +using resampling methods. Data are organized into arrays so multiple +tests can be run at once. This package is part of the EEGLAB +public software for electro-encephalography analysis and is distributed +under the GNU GPL license. + +Requirements +------------ +Matlab is required. For parametric statistics, the statistics Matlab +toolbox is required, although it is not required for resampling methods. + +Quickstart +---------- +Compute a paired t-test between 10 subjects in 2 conditions +for a time (100 points) x electrode (64 electrodes) design. + +cond1 = rand(100,64,10); % the last dimension contains 10 subjects +cond2 = rand(100,64,10)+0.2; + +[t df p] = statcond({ cond1 cond2 }); % parametric test (uses statistic toolbox) +[t df p] = statcond({ cond1 cond2 }, 'mode', 'bootstrap', 'naccu', 1000); % bootstrap +[t df p] = statcond({ cond1 cond2 }, 'mode', 'perm', 'naccu', 1000); % permunation + +Bootstrap and permutation take about 5.2 second on a Macbook pro at 2Gz +(that's 6.4 millions t-test and there is not a single loop). You then may +use the included fdr.m function to correct for multiple comparaisons + +p = fdr(p); + +For more information see the help message of each m function. + +Content +------- +statcond - main function to compute paired or unpaired t-test, 1-way anova and 2-way anova +fdr - implement False Detection Rate method to correct for multiple comparisons +teststat - function testing the statcond function output +ttest_cell - computes paired t-test +ttest2_cell - computes unpaired t-test +anova1_cell - Anova 1-way unpaired (same as anova1 from the statistics toolbox) +anova1rm_cell - Anova repeated measures 1-way (paired) +anova2_cell - Anova 2-way unpaired (same as anova2 from the statistics toolbox) +anova1rm_cell - Anova repeated measures 2-way (paired) +combinedata - combine different conditions, support function for statcond + +The latest revision of these function may be checked out using SVN at + +http://sccn.ucsd.edu/repos/software/eeglab/functions/statistics/ + +Arnaud Delorme, PhD +June 19th 2010 +University of San Diego California, USA +CNRS, University of Toulouse Paul Sabatier, France diff --git a/code/eeglab13_4_4b/functions/statistics/anova1_cell.m b/code/eeglab13_4_4b/functions/statistics/anova1_cell.m new file mode 100644 index 0000000..61304e4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/anova1_cell.m @@ -0,0 +1,141 @@ +% anova1_cell() - compute F-values in cell array using ANOVA. +% +% Usage: +% >> [F df] = anova1_cell( data ); +% +% Inputs: +% data = data consisting of PAIRED arrays to be compared. The last +% dimension of the data array is used to compute ANOVA. +% Outputs: +% F - F-value +% df - degree of freedom (array) +% +% Note: the advantage over the ANOVA1 function of Matlab statistical +% toolbox is that this function works on arrays (see examples). Note +% also that you still need the statistical toolbox to assess +% significance using the fcdf() function. The other advantage is that +% this function will work with complex numbers. +% +% Example: +% a = { rand(1,10) rand(1,10) rand(1,10) } +% [F df] = anova1_cell(a) +% signif = 1-fcdf(F, df(1), df(2)) +% +% % for comparison +% anova1( [ a{1,1}' a{1,2}' a{1,3}' ]) % look in the graph for the F value +% +% b = { [ a{1,1}; a{1,1} ] [ a{1,2}; a{1,2} ] [ a{1,3}; a{1,3} ] } +% [F df] = anova1_cell(b) +% +% c{1,1} = reshape(repmat(b{1,1}, [2 1]),2,2,10); +% c{1,2} = reshape(repmat(b{1,2}, [2 1]),2,2,10); +% c{1,3} = reshape(repmat(b{1,3}, [2 1]),2,2,10); +% [F df] = anova1_cell(c) +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2005 +% +% Reference: +% Schaum's outlines in statistics (3rd edition). 1999. Mc Graw-Hill. + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [F, df] = anova1_cell(data) + + % This function does not return + % correct values (see bug 336) + % It should be fixed with Schaum's outlines p363 + % but requires some work. It now calls + % anova2_cell which returns correct values + + warning off; + [ F tmp tmp2 df] = anova2_cell(data); + warning on; + return; + + % compute all means and all std + % ----------------------------- + nd = myndims( data{1} ); + if nd == 1 + + for i = 1:length(data) + n( i) = length(data{i}); + m( i) = mymean( data{i}); + sd(i) = mystd( data{i}); + end; + nt = sum(n); + n = n'; + m = m'; + sd = sd'; + + elseif nd == 2 + + for i = 1:length(data) + n( :,i) = ones(size(data{i},1) * size(data{i},2), 'single'); + m( :,i) = mymean( data{i},2); + sd(:,i) = mystd( data{i},[],2); + end; + nt = sum(n(1,:)); + + elseif nd == 3 + + for i = 1:length(data) + n( :,:,i) = ones(size(data{i},1),size(data{i},2) * size(data{i},3), 'single'); + m( :,:,i) = mymean( data{i},3); + sd(:,:,i) = mystd( data{i},[],3); + end; + nt = sum(n(1,1,:)); + + elseif nd == 4 + + for i = 1:length(data) + n( :,:,:,i) = ones(size(data{i},1),size(data{i},2), size(data{i},3) * size(data{i},4), 'single'); + m( :,:,:,i) = mymean( data{i},4); + sd(:,:,:,i) = mystd( data{i},[],4); + end; + nt = sum(n(1,1,1,:)); + + end; + + mt = mean(m,nd); + ng = length(data); % number of conditions + + VinterG = ( sum( n.*(m.^2), nd ) - nt*mt.^2 )/(ng-1); + VwithinG = sum( (n-1).*(sd.^2), nd )/(nt-ng); + F = VinterG./VwithinG; + df = [ ng-1 ng*(size(data{1},nd)-1) ]; + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + +function res = mymean( data, varargin) % deal with complex numbers + res = mean( data, varargin{:}); + if ~isreal(data) + res = abs( res ); + end; + +function res = mystd( data, varargin) % deal with complex numbers + res = std( abs(data), varargin{:}); diff --git a/code/eeglab13_4_4b/functions/statistics/anova1rm_cell.m b/code/eeglab13_4_4b/functions/statistics/anova1rm_cell.m new file mode 100644 index 0000000..8313857 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/anova1rm_cell.m @@ -0,0 +1,114 @@ +% anova1rm_cell() - compute F-values in cell array using repeated measure +% ANOVA. +% +% Usage: +% >> [FC dfc] = anova2rm_cell( data ); +% +% Inputs: +% data = data consisting of PAIRED arrays to be compared. The last +% dimension of the data array is used to compute ANOVA. +% Outputs: +% FC - F-value for columns +% dfc - degree of freedom for columns +% +% Note: this function is inspired from rm_anova available at +% http://www.mathworks.se/matlabcentral/fileexchange/6874-two-way-rep +% eated-measures-anova +% +% Example: +% a = { rand(1,10) rand(1,10) rand(1,10) } +% [FC dfc] = anova1rm_cell(a) +% signifC = 1-fcdf(FC, dfc(1), dfc(2)) +% +% % for comparison +% [F1 F2 FI df1 df2 dfi] = anova1rm_cell(a); +% F2 +% +% c = { rand(200,400,10) rand(200,400,10) }; +% [FC dfc] = anova2rm_cell(c) % computes 200x400 ANOVAs +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2010 + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [fA dfApair] = anova1rm_cell(data) + +% compute all means and all std +% ----------------------------- +a = length(data); +nd = myndims( data{1} ); +sz = size( data{1} ); +n = size( data{1} ,nd); +AS = zeros([ sz(1:nd-1) a n ], 'single'); +sq = zeros([ sz(1:nd-1) 1], 'single'); + +% only for paired stats +% --------------------- +for ind1 = 1:a + switch nd + case 1, AS(ind1,:) = AS(ind1,:) + reshape(data{ind1},[sz(1:nd-1) 1 n]); + case 2, AS(:,ind1,:) = AS(:,ind1,:) + reshape(data{ind1},[sz(1:nd-1) 1 n]); + case 3, AS(:,:,ind1,:) = AS(:,:,ind1,:) + reshape(data{ind1},[sz(1:nd-1) 1 n]); + case 4, AS(:,:,:,ind1,:) = AS(:,:,:,ind1,:) + reshape(data{ind1},[sz(1:nd-1) 1 n]); + case 5, AS(:,:,:,:,ind1,:) = AS(:,:,:,:,ind1,:) + reshape(data{ind1},[sz(1:nd-1) 1 n]); + case 6, AS(:,:,:,:,:,ind1,:) = AS(:,:,:,:,:,ind1,:) + reshape(data{ind1},[sz(1:nd-1) 1 n]); + case 7, AS(:,:,:,:,:,:,ind1,:) = AS(:,:,:,:,:,:,ind1,:) + reshape(data{ind1},[sz(1:nd-1) 1 n]); + otherwise error('Dimension not supported'); + end; + sq = sq + sum(data{ind1}.^2,nd); +end; +dimA = nd+1; +dimB = nd; + +A = sum(AS,dimA); % sum across columns, so result is 1xs row vector +S = sum(AS,dimB); % sum across columns, so result is 1xs row vector +T = sum(sum(S,dimB),dimA); % could sum either A or B or S, choice is arbitrary + +% degrees of freedom +dfA = a-1; +dfAS = (a-1)*(n-1); + +% bracket terms (expected value) +expA = sum(A.^2,dimB)./n; +expS = sum(S.^2,dimA)./a; +expAS = sum(sum(AS.^2,dimB),dimA); +expT = T.^2 / (a*n); + +% sums of squares +ssA = expA - expT; +ssAS = expAS - expA - expS + expT; + +% mean squares +msA = ssA / dfA; +msAS = ssAS / dfAS; + +% f statistic +fA = msA ./ msAS; +dfApair = [dfA dfAS]; + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; diff --git a/code/eeglab13_4_4b/functions/statistics/anova2_cell.m b/code/eeglab13_4_4b/functions/statistics/anova2_cell.m new file mode 100644 index 0000000..e1abbf5 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/anova2_cell.m @@ -0,0 +1,235 @@ +% anova2_cell() - compute F-values in cell array using ANOVA. +% +% Usage: +% >> [FC FR FI dfc dfr dfi] = anova2_cell( data ); +% +% Inputs: +% data = data consisting of PAIRED arrays to be compared. The last +% dimension of the data array is used to compute ANOVA. +% Outputs: +% FC - F-value for columns. +% FR - F-value for rows. +% FI - F-value for interaction. +% dfc - degree of freedom for columns. +% dfr - degree of freedom for rows. +% dfi - degree of freedom for interaction. +% +% Note: the advantage over the ANOVA2 function of Matlab statistical +% toolbox is that this function works on arrays (see examples). Note +% also that you still need the statistical toolbox to assess +% significance using the fcdf() function. The other advantage is that +% this function will work with complex numbers. +% +% Example: +% a = { rand(1,10) rand(1,10) rand(1,10); rand(1,10) rand(1,10) rand(1,10) } +% [FC FR FI dfc dfr dfi] = anova2_cell(a) +% signifC = 1-fcdf(FC, dfc(1), dfc(2)) +% signifR = 1-fcdf(FR, dfr(1), dfr(2)) +% signifI = 1-fcdf(FI, dfi(1), dfi(2)) +% +% % for comparison +% anova2( [ a{1,1}' a{1,2}' a{1,3}'; a{2,1}' a{2,2}' a{2,3}' ], 10) +% +% b = { [ a{1,1}; a{1,1} ] [ a{1,2}; a{1,2} ] [ a{1,3}; a{1,3} ]; +% [ a{2,1}; a{2,1} ] [ a{2,2}; a{2,2} ] [ a{2,3}; a{2,3} ] } +% [FC FR FI dfc dfr dfi] = anova2_cell(b) +% +% c{1,1} = reshape(repmat(b{1,1}, [2 1]),2,2,10); +% c{1,2} = reshape(repmat(b{1,2}, [2 1]),2,2,10); +% c{1,3} = reshape(repmat(b{1,3}, [2 1]),2,2,10); +% c{2,3} = reshape(repmat(b{2,3}, [2 1]),2,2,10); +% c{2,2} = reshape(repmat(b{2,2}, [2 1]),2,2,10); +% c{2,1} = reshape(repmat(b{2,1}, [2 1]),2,2,10) +% [FC FR FI dfc dfr dfi] = anova2_cell(c) +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2005 +% +% Reference: +% Schaum's outlines in statistics (3rd edition). 1999. Mc Graw-Hill. + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [FC, FR, FI, freeC, freeR, freeI] = anova2_cell(data) + + % compute all means and all std + % ----------------------------- + a = size(data,1); + b = size(data,2); + nd = myndims( data{1} ); + c = size(data{1}, nd); + sz = size(data{1}); + + % dataabs if for complex data only + % -------------------------------- + dataabs = data; + if ~isreal(data{1}) + for i = 1:a + for ii = 1:b + dataabs{i,ii} = abs(data{i,ii}); + end; + end; + end; + + VE = zeros( [ sz(1:end-1) 1], 'single' ); + m = zeros( [ sz(1:end-1) size(data) ], 'single' ); + for i = 1:a + for ii = 1:b + tmpm = mymean(data{i,ii}, nd); + switch nd + case 1, m(i,ii) = tmpm; + case 2, m(:,i,ii) = tmpm; + case 3, m(:,:,i,ii) = tmpm; + case 4, m(:,:,:,i,ii) = tmpm; + case 5, m(:,:,:,:,i,ii) = tmpm; + case 6, m(:,:,:,:,:,i,ii) = tmpm; + case 7, m(:,:,:,:,:,:,i,ii) = tmpm; + otherwise error('Dimension not supported'); + end; + VE = VE+sum( bsxfun(@minus, dataabs{i,ii}, tmpm).^2, nd); + end; + end; + X = mean(mean(m,nd+1),nd); + Xj = mean(m,nd+1); + Xk = mean(m,nd); + VR = b*c*sum( bsxfun(@minus, Xj, X).^2, nd); + VC = a*c*sum( bsxfun(@minus, Xk, X).^2, nd+1 ); + VI = c*sum( sum( bsxfun(@plus, bsxfun(@minus, bsxfun(@minus, m, Xj), Xk), X).^2, nd+1 ), nd ); + +% before bsxfun +% VR = b*c*sum( (Xj-repmat(X, [ones(1,nd-1) size(Xj,nd )])).^2, nd ); +% VC = a*c*sum( (Xk-repmat(X, [ones(1,nd ) size(Xk,nd+1)])).^2, nd+1 ); +% +% Xj = repmat(Xj, [ones(1,nd) size(m,nd+1) ]); +% Xk = repmat(Xk, [ones(1,nd-1) size(m,nd) 1]); +% VI = c*sum( sum( ( m - Xj - Xk + repmat(X, [ones(1,nd-1) size(m,nd) size(m,nd+1)]) ).^2, nd+1 ), nd ); + +% if nd == 1 +% +% VE = 0; +% m = zeros( size(data), 'single' ); +% for i = 1:a +% for ii = 1:b +% m(i,ii) = mymean(data{i,ii}); +% VE = VE+sum( (dataabs{i,ii}-m(i,ii)).^2 ); +% end; +% end; +% X = mean(mean(m)); +% Xj = mean(m,2); +% Xk = mean(m,1); +% VR = b*c*sum( (Xj-X).^2 ); +% VC = a*c*sum( (Xk-X).^2 ); +% +% Xj = repmat(Xj, [1 size(m,2) ]); +% Xk = repmat(Xk, [size(m,1) 1]); +% VI = c*sum( sum( ( m - Xj - Xk + X ).^2 ) ); +% +% elseif nd == 2 +% +% VE = zeros( size(data{1},1),1, 'single'); +% m = zeros( [ size(data{1},1) size(data) ], 'single' ); +% for i = 1:a +% for ii = 1:b +% tmpm = mymean(data{i,ii}, 2); +% m(:,i,ii) = tmpm; +% VE = VE+sum( (dataabs{i,ii}-repmat(tmpm, [1 size(data{i,ii},2)])).^2, 2); +% end; +% end; +% X = mean(mean(m,3),2); +% Xj = mean(m,3); +% Xk = mean(m,2); +% VR = b*c*sum( (Xj-repmat(X, [1 size(Xj,2)])).^2, 2 ); +% VC = a*c*sum( (Xk-repmat(X, [1 1 size(Xk,3)])).^2, 3 ); +% +% Xj = repmat(Xj, [1 1 size(m,3) ]); +% Xk = repmat(Xk, [1 size(m,2) 1]); +% VI = c*sum( sum( ( m - Xj - Xk + repmat(X, [1 size(m,2) size(m,3)]) ).^2, 3), 2 ); +% +% elseif nd == 3 +% +% VE = zeros( size(data{1},1), size(data{1},2), 'single' ); +% m = zeros( [ size(data{1},1) size(data{1},2) size(data) ], 'single' ); +% for i = 1:a +% for ii = 1:b +% tmpm = mymean(data{i,ii}, 3); +% m(:,:,i,ii) = tmpm; +% VE = VE+sum( (dataabs{i,ii}-repmat(tmpm, [1 1 size(data{i,ii},3)])).^2, 3); +% end; +% end; +% X = mean(mean(m,4),3); +% Xj = mean(m,4); +% Xk = mean(m,3); +% VR = b*c*sum( (Xj-repmat(X, [1 1 size(Xj,3) ])).^2, 3 ); +% VC = a*c*sum( (Xk-repmat(X, [1 1 1 size(Xk,4)])).^2, 4 ); +% +% Xj = repmat(Xj, [1 1 1 size(m,4) ]); +% Xk = repmat(Xk, [1 1 size(m,3) 1]); +% VI = c*sum( sum( ( m - Xj - Xk + repmat(X, [1 1 size(m,3) size(m,4)]) ).^2, 4 ), 3 ); +% +% else % nd == 4 +% +% VE = zeros( size(data{1},1), size(data{1},2), size(data{1},3), 'single' ); +% m = zeros( [ size(data{1},1) size(data{1},2) size(data{1},3) size(data) ], 'single' ); +% for i = 1:a +% for ii = 1:b +% tmpm = mymean(data{i,ii}, 4); +% m(:,:,:,i,ii) = tmpm; +% VE = VE+sum( (dataabs{i,ii}-repmat(tmpm, [1 1 1 size(data{i,ii},4)])).^2, 4); +% end; +% end; +% X = mean(mean(m,5),4); +% Xj = mean(m,5); +% Xk = mean(m,4); +% VR = b*c*sum( (Xj-repmat(X, [1 1 1 size(Xj,4) ])).^2, 4 ); +% VC = a*c*sum( (Xk-repmat(X, [1 1 1 1 size(Xk,5)])).^2, 5 ); +% +% Xj = repmat(Xj, [1 1 1 1 size(m,5) ]); +% Xk = repmat(Xk, [1 1 1 size(m,4) 1]); +% VI = c*sum( sum( ( m - Xj - Xk + repmat(X, [1 1 1 size(m,4) size(m,5)]) ).^2, 5 ), 4 ); +% +% end; + + SR2 = VR/(a-1); + SC2 = VC/(b-1); + SI2 = VI/(a-1)/(b-1); + SE2 = VE/(a*b*(c-1)); + + FR = SR2./SE2; % rows + FC = SC2./SE2; % columns + FI = SI2./SE2; % interaction + + freeR = [ a-1 a*b*(c-1) ]; + freeC = [ b-1 a*b*(c-1) ]; + freeI = [ (a-1)*(b-1) a*b*(c-1) ]; + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + +function res = mymean( data, varargin) % deal with complex numbers + res = mean( data, varargin{:}); + if ~isreal(data) + res = abs( res ); + end; diff --git a/code/eeglab13_4_4b/functions/statistics/anova2rm_cell.m b/code/eeglab13_4_4b/functions/statistics/anova2rm_cell.m new file mode 100644 index 0000000..3f07faa --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/anova2rm_cell.m @@ -0,0 +1,195 @@ +% anova2rm_cell() - compute F-values in cell array using repeated measure +% ANOVA. +% +% Usage: +% >> [FC FR FI dfc dfr dfi] = anova2rm_cell( data ); +% +% Inputs: +% data = data consisting of PAIRED arrays to be compared. The last +% dimension of the data array is used to compute ANOVA. +% Outputs: +% FC - F-value for columns. +% FR - F-value for rows. +% FI - F-value for interaction. +% dfc - degree of freedom for columns. +% dfr - degree of freedom for rows. +% dfi - degree of freedom for interaction. +% +% Note: this function is inspired from rm_anova available at +% http://www.mathworks.se/matlabcentral/fileexchange/6874-two-way-rep +% eated-measures-anova +% It allows for fast computation of about 20 thousands ANOVA per +% second. It is different from anova2_cell which mimics the ANOVA +% fonction from the Matlab statistical toolbox. This function +% computes true repeated measure ANOVA. +% +% Example: +% a = { rand(1,10) rand(1,10) rand(1,10); rand(1,10) rand(1,10) rand(1,10) } +% [FC FR FI dfc dfr dfi] = anova2rm_cell(a) +% signifC = 1-fcdf(FC, dfc(1), dfc(2)) +% signifR = 1-fcdf(FR, dfr(1), dfr(2)) +% signifI = 1-fcdf(FI, dfi(1), dfi(2)) +% +% % for comparison +% z = zeros(10,1); o = ones(10,1); t = ones(10,1)*2; +% rm_anova2( [ a{1,1}';a{1,2}';a{1,3}';a{2,1}';a{2,2}';a{2,3}' ], ... +% repmat([1:10]', [6 1]), [o;o;o;z;z;z], [z;o;t;z;o;t], {'a','b'}) +% +% c = { rand(200,400,10) rand(200,400,10); ... +% rand(200,400,10) rand(200,400,10)}; +% [FC FR FI dfc dfr dfi] = anova2rm_cell(c) % computes 200x400 ANOVAs +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2010 + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [fA fB fAB dfApair dfBpair dfABpair] = anova2rm_cell(data) + +% compute all means and all std +% ----------------------------- +a = size(data,1); +b = size(data,2); +nd = myndims( data{1} ); +n = size( data{1} ,nd); + +% only for paired stats +% --------------------- +if nd == 1 + AB = zeros(a,b,'single'); + AS = zeros(a,n,'single'); + BS = zeros(b,n,'single'); + sq = single(0); + for ind1 = 1:a + for ind2 = 1:b + AB(ind1,ind2) = sum(data{ind1,ind2}); + AS(ind1,:) = AS(ind1,:) + data{ind1,ind2}'; + BS(ind2,:) = BS(ind2,:) + data{ind1,ind2}'; + sq = sq + sum(data{ind1,ind2}.^2); + end; + end; + dimA = 2; + dimB = 1; +elseif nd == 2 + AB = zeros(size(data{1},1),a,b,'single'); + AS = zeros(size(data{1},1),a,n,'single'); + BS = zeros(size(data{1},1),b,n,'single'); + sq = zeros(size(data{1},1),1,'single'); + for ind1 = 1:a + for ind2 = 1:b + AB(:,ind1,ind2) = sum(data{ind1,ind2},nd); + AS(:,ind1,:) = AS(:,ind1,:) + reshape(data{ind1,ind2},size(data{1},1),1,n); + BS(:,ind2,:) = BS(:,ind2,:) + reshape(data{ind1,ind2},size(data{1},1),1,n); + sq = sq + sum(data{ind1,ind2}.^2,nd); + end; + end; + dimA = 3; + dimB = 2; +elseif nd == 3 + AB = zeros(size(data{1},1),size(data{1},2),a,b,'single'); + AS = zeros(size(data{1},1),size(data{1},2),a,n,'single'); + BS = zeros(size(data{1},1),size(data{1},2),b,n,'single'); + sq = zeros(size(data{1},1),size(data{1},2),'single'); + for ind1 = 1:a + for ind2 = 1:b + AB(:,:,ind1,ind2) = sum(data{ind1,ind2},nd); + AS(:,:,ind1,:) = AS(:,:,ind1,:) + reshape(data{ind1,ind2},size(data{1},1),size(data{1},2),1,n); + BS(:,:,ind2,:) = BS(:,:,ind2,:) + reshape(data{ind1,ind2},size(data{1},1),size(data{1},2),1,n); + sq = sq + sum(data{ind1,ind2}.^2,nd); + end; + end; + dimA = 4; + dimB = 3; +elseif nd == 4 + AB = zeros(size(data{1},1),size(data{1},2),size(data{1},3),a,b,'single'); + AS = zeros(size(data{1},1),size(data{1},2),size(data{1},3),a,n,'single'); + BS = zeros(size(data{1},1),size(data{1},2),size(data{1},3),b,n,'single'); + sq = zeros(size(data{1},1),size(data{1},2),size(data{1},3),'single'); + for ind1 = 1:a + for ind2 = 1:b + AB(:,:,:,ind1,ind2) = sum(data{ind1,ind2},nd); + AS(:,:,:,ind1,:) = AS(:,:,:,ind1,:) + reshape(data{ind1,ind2},size(data{1},1),size(data{1},2),size(data{1},3),1,n); + BS(:,:,:,ind2,:) = BS(:,:,:,ind2,:) + reshape(data{ind1,ind2},size(data{1},1),size(data{1},2),size(data{1},3),1,n); + sq = sq + sum(data{ind1,ind2}.^2,nd); + end; + end; + dimA = 5; + dimB = 4; +end; + +A = sum(AB,dimA); % sum across columns, so result is ax1 column vector +B = sum(AB,dimB); % sum across rows, so result is 1xb row vector +S = sum(AS,dimB); % sum across columns, so result is 1xs row vector +T = sum(sum(A,dimB),dimA); % could sum either A or B or S, choice is arbitrary + +% degrees of freedom +dfA = a-1; +dfB = b-1; +dfAB = (a-1)*(b-1); +dfS = n-1; +dfAS = (a-1)*(n-1); +dfBS = (b-1)*(n-1); +dfABS = (a-1)*(b-1)*(n-1); + +% bracket terms (expected value) +expA = sum(A.^2,dimB)./(b*n); +expB = sum(B.^2,dimA)./(a*n); +expAB = sum(sum(AB.^2,dimA),dimB)./n; +expS = sum(S.^2,dimA)./(a*b); +expAS = sum(sum(AS.^2,dimB),dimA)./b; +expBS = sum(sum(BS.^2,dimB),dimA)./a; +expY = sq; %sum(Y.^2); +expT = T.^2 / (a*b*n); + +% sums of squares +ssA = expA - expT; +ssB = expB - expT; +ssAB = expAB - expA - expB + expT; +ssS = expS - expT; +ssAS = expAS - expA - expS + expT; +ssBS = expBS - expB - expS + expT; +ssABS = expY - expAB - expAS - expBS + expA + expB + expS - expT; +ssTot = expY - expT; + +% mean squares +msA = ssA / dfA; +msB = ssB / dfB; +msAB = ssAB / dfAB; +msS = ssS / dfS; +msAS = ssAS / dfAS; +msBS = ssBS / dfBS; +msABS = ssABS / dfABS; + +% f statistic +fA = msA ./ msAS; +fB = msB ./ msBS; +fAB = msAB ./ msABS; +dfApair = [dfA dfAS]; +dfBpair = [dfB dfBS]; +dfABpair = [dfAB dfABS]; + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; diff --git a/code/eeglab13_4_4b/functions/statistics/concatdata.m b/code/eeglab13_4_4b/functions/statistics/concatdata.m new file mode 100644 index 0000000..c13923c --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/concatdata.m @@ -0,0 +1,111 @@ +% concatdata - concatenate data stored into a cell array into a single +% array. only concatenate along the last dimension +% Usage: +% [dataarray len dims] = concatata(cellarraydata); +% +% Input: +% cellarraydata - cell array containing data +% +% Output: +% dataarray - single array containing all data +% len - limits of each array +% dim - dimension of the orginal array +% +% Example: +% a = rand(3, 4, 3, 10); +% b = rand(3, 4, 3, 4); +% c = rand(3, 4, 3, 3); +% [ alldata len ] = concatdata({ a b c}); +% % alldata is size [ 3 4 3 17 ] +% % len contains [ 0 10 14 17 ] +% % to access array number i, type "alldata(len(i)+1:len(i+1)) +% +% Author: Arnaud Delorme, CERCO/CNRS & SCCN/INC/UCSD, 2009- + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ datac, alllen, dims ] = concatdata(data); + + alllen = cellfun('size', data, myndims(data{1}) ); % by chance, pick up the last dimension + dims = size(data); + alllen = [ 0 alllen(:)' ]; + switch myndims(data{1}) + case 1, + datac = zeros(sum(alllen),1, 'single'); + + for i = 1:prod(dims) + alllen(i+1) = alllen(i+1) + alllen(i); + datac(alllen(i)+1:alllen(i+1)) = data{i}; + end; + case 2, + datac = zeros(size(data{1},1), sum(alllen), 'single'); + + for i = 1:prod(dims) + alllen(i+1) = alllen(i+1) + alllen(i); + datac(:,alllen(i)+1:alllen(i+1)) = data{i}; + end; + case 3, + datac = zeros(size(data{1},1), size(data{1},2), sum(alllen), 'single'); + + for i = 1:prod(dims) + alllen(i+1) = alllen(i+1) + alllen(i); + datac(:,:,alllen(i)+1:alllen(i+1)) = data{i}; + end; + case 4, + datac = zeros(size(data{1},1), size(data{1},2), size(data{1},3), sum(alllen), 'single'); + + for i = 1:prod(dims) + alllen(i+1) = alllen(i+1) + alllen(i); + datac(:,:,:,alllen(i)+1:alllen(i+1)) = data{i}; + end; + case 5, + datac = zeros(size(data{1},1), size(data{1},2), size(data{1},3), size(data{1},4), sum(alllen), 'single'); + + for i = 1:prod(dims) + alllen(i+1) = alllen(i+1) + alllen(i); + datac(:,:,:,:,alllen(i)+1:alllen(i+1)) = data{i}; + end; + case 6, + datac = zeros(size(data{1},1), size(data{1},2), size(data{1},3), size(data{1},4),size(data{1},5), sum(alllen), 'single'); + + for i = 1:prod(dims) + alllen(i+1) = alllen(i+1) + alllen(i); + datac(:,:,:,:,:,alllen(i)+1:alllen(i+1)) = data{i}; + end; + case 7, + datac = zeros(size(data{1},1), size(data{1},2), size(data{1},3), size(data{1},4), size(data{1},5), size(data{1},6), sum(alllen), 'single'); + + for i = 1:prod(dims) + alllen(i+1) = alllen(i+1) + alllen(i); + datac(:,:,:,:,:,:,alllen(i)+1:alllen(i+1)) = data{i}; + end; + end; + + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/statistics/corrcoef_cell.m b/code/eeglab13_4_4b/functions/statistics/corrcoef_cell.m new file mode 100644 index 0000000..7f59302 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/corrcoef_cell.m @@ -0,0 +1,111 @@ +% corrcoef_cell() - compute pairwise correlations using arrays and +% cell array inputs. +% +% Usage: +% >> c = corrcoef_cell( data ); +% >> c = corrcoef_cell( data ); +% +% Inputs: +% data - [cell array] data consisting of PAIRED arrays to be compared. +% The last dimension of embeded data arrays is used to compute +% correlation (see examples). +% Outputs: +% c - Correlation values. Same size as data without the last dimension. +% +% Note: the main advantage over the corrcoef Matlab function is the +% capacity to compute millions of pairwise correlations per second. +% +% Example: +% a = { rand(1,10) rand(1,10) }; +% c1 = corrcoef_cell(a); +% c2 = corrcoef(a{1}, a{2}); +% % in this case, c1 is equal to c2(2) +% +% a = { rand(200,300,100) rand(200,300,100) }; +% c = corrcoef_cell(a); +% % the call above would require 200 x 300 calls to the corrcoef function +% % and be about 1000 times slower +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2010 + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function c = corrcoef_cell(a,b); + +if nargin < 1 + help corrcoef_cell; + return; +end; + +if nargin < 2 + b = a{2}; + a = a{1}; +end; + +nd = myndims(a); +if nd == 1 + aa = a-mean(a); + bb = b-mean(b); + cv = aa'*bb/(10-1); + cva = aa'*aa/(10-1); + cvb = bb'*bb/(10-1); + + c = cv/sqrt(cva*cvb); +elseif nd == 2 % ND=2, 3, and 4 could be replaced with a single line + aa = bsxfun(@minus, a, mean(a,2)); + bb = bsxfun(@minus, b, mean(b,2)); + %aa = a-repmat(mean(a,2),[1 size(a,2)]); + %bb = b-repmat(mean(b,2),[1 size(a,2)]); + cv = sum(aa.*bb,2); + cva = sum(aa.*aa,2); + cvb = sum(bb.*bb,2); + + c = cv./sqrt(cva.*cvb); +elseif nd == 3 + aa = bsxfun(@minus, a, mean(a,3)); + bb = bsxfun(@minus, b, mean(b,3)); + %aa = a-repmat(mean(a,3),[1 1 size(a,3)]); + %bb = b-repmat(mean(b,3),[1 1 size(a,3)]); + cv = sum(aa.*bb,3); + cva = sum(aa.*aa,3); + cvb = sum(bb.*bb,3); + + c = cv./sqrt(cva.*cvb); +elseif nd == 4 + aa = bsxfun(@minus, a, mean(a,4)); + bb = bsxfun(@minus, b, mean(b,4)); + %aa = a-repmat(mean(a,4),[1 1 1 size(a,4)]); + %bb = b-repmat(mean(b,4),[1 1 1 size(a,4)]); + cv = sum(aa.*bb,4); + cva = sum(aa.*aa,4); + cvb = sum(bb.*bb,4); + + c = cv./sqrt(cva.*cvb); +end; + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; diff --git a/code/eeglab13_4_4b/functions/statistics/fdr.m b/code/eeglab13_4_4b/functions/statistics/fdr.m new file mode 100644 index 0000000..8ceb3b0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/fdr.m @@ -0,0 +1,69 @@ +% fdr() - compute false detection rate mask +% +% Usage: +% >> [p_fdr, p_masked] = fdr( pvals, alpha); +% +% Inputs: +% pvals - vector or array of p-values +% alpha - threshold value (non-corrected). If no alpha is given +% each p-value is used as its own alpha and FDR corrected +% array is returned. +% fdrtype - ['parametric'|'nonParametric'] FDR type. Default is +% 'parametric'. +% +% Outputs: +% p_fdr - pvalue used for threshold (based on independence +% or positive dependence of measurements) +% p_masked - p-value thresholded. Same size as pvals. +% +% Author: Arnaud Delorme, SCCN, 2008- +% Based on a function by Tom Nichols +% +% Reference: Bejamini & Yekutieli (2001) The Annals of Statistics + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [pID, p_masked] = fdr(pvals, q, fdrType); + +if nargin < 3, fdrType = 'parametric'; end; +if isempty(pvals), pID = []; return; end; +p = sort(pvals(:)); +V = length(p); +I = (1:V)'; + +cVID = 1; +cVN = sum(1./(1:V)); + +if nargin < 2 + pID = ones(size(pvals)); + thresholds = exp(linspace(log(0.1),log(0.000001), 100)); + for index = 1:length(thresholds) + [tmp p_masked] = fdr(pvals, thresholds(index)); + pID(p_masked) = thresholds(index); + end; +else + if strcmpi(fdrType, 'parametric') + pID = p(max(find(p<=I/V*q/cVID))); % standard FDR + else + pID = p(max(find(p<=I/V*q/cVN))); % non-parametric FDR + end; +end; +if isempty(pID), pID = 0; end; + +if nargout > 1 + p_masked = pvals<=pID; +end; diff --git a/code/eeglab13_4_4b/functions/statistics/stat_surrogate_ci.m b/code/eeglab13_4_4b/functions/statistics/stat_surrogate_ci.m new file mode 100644 index 0000000..3f85596 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/stat_surrogate_ci.m @@ -0,0 +1,99 @@ +% compute empirical p-vals under the null hypothesis that observed samples +% come from a given surrogate distribution. P-values for Type I error in +% rejecting the null hypothesis are obtained by finding the proportion of +% samples in the distribution that +% (a) are larger than the observed sample (one-sided test) +% (b) are larger or smaller than the observed sample (two-sided test). +% +% Inputs: +% distribution: [d1 x d2 x ... x dM x N] matrix of surrogate samples. +% distribution(i,j,k,...,:) is a collection of N samples +% from a surrogate distribution. +% alpha: [float] alpha value. Default +% tail: can be 'one' or 'both' indicating a one-tailed or +% two-tailed test. Can also be 'lower' or 'upper'. +% Outputs: +% +% ci: [2 x d1 x d2 x ... x dM] matrix of confidence interval +% +% Author: Tim Mullen and Arnaud Delorme, SCCN/INC/UCSD + +% This function is part of the Source Information Flow Toolbox (SIFT) +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function ci = stat_surrogate_ci(distribution,alpha,tail) + +if nargin<3 + tail = 'both'; +end + +if nargin<2 + alpha = 0.05; +end + +% reshape matrix +% -------------- +nd = size(distribution); +if length(nd) == 2 && nd(2) == 1, nd(2) = []; end; +ndori = nd; +nd = nd(1:end-1); +if isempty(nd), nd = 1; end; +distribution = reshape(distribution, [prod(nd) size(distribution,myndims(distribution))]); + +% append observed to last dimension of surrogate distribution +numDims = myndims(distribution); + +% number of samples +N = size(distribution, numDims); + +% sort along last dimension (replications) +[tmpsort idx] = sort( distribution, numDims,'ascend'); + +if strcmpi(tail, 'both'), alpha = alpha/2; end; + +low = round(alpha*N); +high = N-low; +switch lower(tail) + case 'upper' + cilow = mean(tmpsort, numDims); + cihigh = tmpsort(:,high); + case 'lower' + cilow = tmpsort(:,low+1); + cihigh = mean(tmpsort, numDims); + case { 'both' 'one' } + cilow = tmpsort(:,low+1); + cihigh = tmpsort(:,high); + otherwise + error('Unknown tail option'); +end + +ci = reshape(cilow, [1 size(cilow)]); +ci(2,:) = cihigh; +ci = reshape(ci, [2 ndori(1:end-1) 1]); + +% get the number of dimensions in a matrix +function val = myndims(a) +if ndims(a) > 2 + val = ndims(a); +else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; +end; diff --git a/code/eeglab13_4_4b/functions/statistics/stat_surrogate_pvals.m b/code/eeglab13_4_4b/functions/statistics/stat_surrogate_pvals.m new file mode 100644 index 0000000..f74bb02 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/stat_surrogate_pvals.m @@ -0,0 +1,75 @@ +function pvals = stat_surrogate_pvals(distribution,observed,tail) +% compute empirical p-vals under the null hypothesis that observed samples +% come from a given surrogate distribution. P-values for Type I error in +% rejecting the null hypothesis are obtained by finding the proportion of +% samples in the distribution that +% (a) are larger than the observed sample (one-sided test) +% (b) are larger or smaller than the observed sample (two-sided test). +% +% This function is based on Arnaud Delorme's statcond:compute_pvals() +% function from EEGLAB +% +% Inputs: +% +% distribution: [d1 x d2 x ... x dM x N] matrix of surrogate samples. +% distribution(i,j,k,...,:) is a collection of N samples +% from a surrogate distribution. +% observed: [d1 x d2 x ... x dM] matrix of observations. +% tail: can be 'one' or 'both' indicating a one-tailed or +% two-tailed test +% Outputs: +% +% pvals: [d1 x d2 x ... x dM] matrix of p-values specifying +% probability of Type I error in rejecting the null +% hypothesis +% +% Author: Tim Mullen and Arnaud Delorme, SCCN/INC/UCSD + +% This function is part of the Source Information Flow Toolbox (SIFT) +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +numDims = myndims(distribution); + +% append observed to last dimension of surrogate distribution +distribution = cat(numDims,distribution,observed); + +numDims = myndims(distribution); + +% sort along last dimension (replications) +[tmp idx] = sort( distribution, numDims,'ascend'); +[tmp mx] = max( idx,[], numDims); + +len = size(distribution, numDims ); +pvals = 1-(mx-0.5)/len; +if strcmpi(tail, 'both') + pvals = min(pvals, 1-pvals); + pvals = 2*pvals; +end; + + +% get the number of dimensions in a matrix +function val = myndims(a) +if ndims(a) > 2 + val = ndims(a); +else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/statistics/statcond.m b/code/eeglab13_4_4b/functions/statistics/statcond.m new file mode 100644 index 0000000..2a306a6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/statcond.m @@ -0,0 +1,555 @@ +% statcond() - compare two or more data conditions statistically using +% standard parametric or nonparametric permutation-based ANOVA +% (1-way or 2-way) or t-test methods. Parametric testing uses +% fcdf() from the Matlab Statistical Toolbox. +% Usage: +% >> [stats, df, pvals, surrog] = statcond( data, 'key','val'... ); +% +% Inputs: +% data = one-or two-dimensional cell array of data matrices. +% For nonparametric, permutation-based testing, the +% last dimension of the data arrays (which may be of up to +% 4 dimensions) is permuted across conditions, either in +% a 'paired' fashion (not changing the, e.g., subject or +% trial order in the last dimension) or in an umpaired +% fashion (not respecting this order). If the number of +% elements in the last dimension is not the same across +% conditions, the 'paired' option is turned 'off'. Note: +% All other dimensions MUST be constant across conditions. +% For example, consider a (1,3) cell array of matrices +% of size (100,20,x) each holding a (100,20) time/frequency +% transform from each of x subjects. Only the last dimension +% (here x, the number of subjects) may differ across the +% three conditions. +% The test used depends on the size of the data array input. +% When the data cell array has 2 columns and the data are +% paired, a paired t-test is performed; when the data are +% unpaired, an unpaired t-test is performed. If 'data' +% has only one row (paired or unpaired) and more than 2 +% columns, a one-way ANOVA is performed. If the data cell +% array contains several rows and columns, and the data is +% paired, a two-way repeated measure ANOVA is performed. +% NOTE THAT IF THE DATA is unpaired, EEGLAB will use a +% balanced 1 or 2 way ANOVA and parametric results might not +% be meaningful (bootstrap and permstatcondutation should be fine). +% +% Optional inputs: +% 'paired' = ['on'|'off'] pair the data array {default: 'on' unless +% the last dimension of data array is of different lengths}. +% For two independent variables, this input is a cell array, +% for example { 'on' 'off' } indicating that the first +% independent variable is paired and the second is not. +% 'method' = ['perm'|'bootstrap'|'param'] method for computing the p-values: +% 'param' or 'parametric' = parametric testing (standard ANOVA +% or t-test); +% 'perm' or 'permutation' = non-parametric testing using +% surrogate data +% 'bootstrap' = non-parametric bootstrap +% made by permuting the input data {default: 'param'} +% 'naccu' = [integer] Number of surrogate data copies to use in 'perm' +% or 'bootstrap' method estimation (see above) {default: 200}. +% 'verbose' = ['on'|'off'] print info on the command line {default: 'on'}. +% 'variance' = ['homegenous'|'inhomogenous'] this option is exclusively +% for parametric statistics using unpaired t-test. It allows +% to compute a more accurate value for the degree of freedom +% using the formula for inhomogenous variance (see +% ttest2_cell function). Default is 'inhomegenous'. +% 'surrog' = surrogate data array (see output). +% 'stats' = F- or T-value array (see output). +% 'tail' = ['one'|'two'] run one-tailed (F-test) or two tailed +% (T-test). This option is only relevant when using the +% 'surrog' input. Otherwise it is ignored. +% 'forceanova' = ['on'|'off'] force the use of ANOVA calculation even +% for 2x1 designs. Default is 'off'. +% 'alpha' = [float] p-value threshold value. Allow returning +% confidence intervals and mask (requires structoutput below). +% 'structoutput' = ['on'|'off'] return an output structure instead of +% the regular output. Allow to output mask and confidence +% intervals. +% +% Legacy parameters: +% 'threshold' - now 'alpha' +% 'mode' - now 'method' +% +% Outputs: +% stats = F- or T-value array of the same size as input data without +% the last dimension. A T value is returned only when the data +% includes exactly two conditions. +% df = degrees of freedom, a (2,1) vector, when F-values are returned +% pvals = array of p-values. Same size as input data without the last +% data dimension. All returned p-values are two-tailed. +% surrog = surrogate data array (same size as input data with the last +% dimension filled with a number ('naccu') of surrogate data sets. +% +% Important note: When a two-way ANOVA is performed, outputs are cell arrays +% with three elements: output(1) = row effects; +% output(2) = column effects; output(3) = interactions +% between rows and columns. +% +% Examples: +% >> a = { rand(1,10) rand(1,10)+0.5 }; % pseudo 'paired' data vectors +% [t df pvals] = statcond(a); % perform paired t-test +% pvals = +% 5.2807e-04 % standard t-test probability value +% % Note: for different rand() outputs, results will differ. +% +% [t df pvals surog] = statcond(a, 'method', 'perm', 'naccu', 2000); +% pvals = +% 0.0065 % nonparametric t-test using 2000 permuted data sets +% +% a = { rand(2,11) rand(2,10) rand(2,12)+0.5 }; % pseudo 'unpaired' +% [F df pvals] = statcond(a); % perform an unpaired ANOVA +% pvals = +% 0.00025 % p-values for difference between columns +% 0.00002 % for each data row +% +% a = { rand(3,4,10) rand(3,4,10) rand(3,4,10); ... +% rand(3,4,10) rand(3,4,10) rand(3,4,10)+0.5 }; +% % pseudo (2,3)-condition data array, each entry containing +% % ten (3,4) data matrices +% [F df pvals] = statcond(a); % perform a paired 2-way ANOVA +% % Output: +% pvals{1} % a (3,4) matrix of p-values; effects across rows +% pvals{2} % a (3,4) matrix of p-values; effects across colums +% pvals{3} % a (3,4) matrix of p-values; interaction effects +% % across rows and columns +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2005- +% With thanks to Robert Oostenveld for fruitful discussions +% and advice on this function. +% +% See also: anova1_cell(), anova2_cell(), anova2rm_cell, fcdf() + +% perform a paired t-test +% ----------------------- +% a = { rand(2,10) rand(2,10) }; +% [t df pval] = statcond(a); pval +% [h p t stat] = ttest( a{1}(1,:), a{2}(1,:)); p +% [h p t stat] = ttest( a{1}(2,:), a{2}(2,:)); p +% +% compare significance levels +% -------------------------- +% a = { rand(1,10) rand(1,10) }; +% [F df pval] = statcond(a, 'method', 'perm', 'naccu', 200); pval +% [h p t stat] = ttest( a{1}(1,:), a{2}(1,:)); p + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ ori_vals, df, pvals, surrogval ] = statcond( data, varargin ); + + if nargin < 1 + help statcond; + return; + end; + try, warning('off', 'MATLAB:divideByZero'); catch, end; + + if exist('finputcheck') + g = finputcheck( varargin, { 'naccu' 'integer' [1 Inf] 200; + 'method' 'string' { 'param','parametric','perm','permutation','bootstrap' } 'param'; + 'mode' 'string' { } ''; + 'paired' 'string' { 'on','off' } 'on'; + 'surrog' { 'real','cell' } [] []; + 'stats' { 'real','cell' } [] []; + 'structoutput' 'string' { 'on','off' } 'off'; + 'forceanova' 'string' { 'on','off' } 'off'; + 'arraycomp' 'string' { 'on','off' } 'on'; + 'alpha' 'real' [] NaN; + 'tail' 'string' { 'one','both','upper','lower'} 'both'; + 'variance' 'string' { 'homogenous','inhomogenous' } 'inhomogenous'; + 'returnresamplingarray' 'string' { 'on','off' } 'off'; + 'verbose' 'string' { 'on','off' } 'on' }, 'statcond'); + if isstr(g), error(g); end; + else + g = struct(varargin{:}); + if ~isfield(g, 'naccu'), g.naccu = 200; end; + if ~isfield(g, 'method'), g.method = 'param'; end; + if ~isfield(g, 'paired'), g.paired = 'on'; end; + if ~isfield(g, 'surrog'), g.surrog = []; end; + if ~isfield(g, 'orivals'), g.orivals = []; end; + if ~isfield(g, 'arraycomp'), g.arraycomp = 'on'; end; + if ~isfield(g, 'verbose'), g.verbose = 'on'; end; + if ~isfield(g, 'tail'), g.tail = 'both'; end; + if ~isfield(g, 'variance'), g.variance = 'homogenous'; end; + if ~isfield(g, 'structoutput'), g.structoutput = 'on'; end; + if ~isfield(g, 'returnresamplingarray'), g.returnresamplingarray = 'off'; end; + end; + if ~isempty(g.mode), g.method = g.mode; end; + + if strcmpi(g.method, 'parametric'), g.method = 'param'; end; + if strcmpi(g.method, 'permutation'), g.method = 'perm'; end; + if strcmpi(g.verbose, 'on'), verb = 1; else verb = 0; end; + if strcmp(g.method, 'param' ) && exist('fcdf') ~= 2 + myfprintf('on',['statcond(): parametric testing requires fcdf() \n' ... + ' from the Matlab StatsticaL Toolbox.\n' ... + ' Running nonparametric permutation tests\n.']); + g.method = 'perm'; + end + if size(data,2) == 1, data = transpose(data); end; % cell array transpose + g.naccu = round(g.naccu); + + % reshape matrices + % ---------------- + nd = size(data{1}); + nd = nd(1:end-1); + for index = 1:prod(size(data)) + data{index} = reshape(data{index}, [prod(nd) size(data{index},myndims(data{index}))]); + end; + + if ~strcmpi(g.method, 'param') && isempty(g.surrog) + tmpsize = size(data{1}); + surrogval = zeros([ tmpsize(1:end-1) g.naccu ], 'single'); + else surrogval = []; + end; + + % check for NaNs or Inf + % --------------------- + for iDat = 1:length(data(:)) + if any(isnan(reshape(data{iDat}, prod(size(data{iDat})),1))) || ... + any(isinf(reshape(data{iDat}, prod(size(data{iDat})),1))) + error('Statcond: One of the input array contains NaNs or Infinite values'); + end; + end; + + % bootstrap flag + % -------------- + if strcmpi(g.method, 'bootstrap'), bootflag = 1; + else bootflag = 0; + end; + + if isempty(g.surrog) + % test if data can be paired + % -------------------------- + if length(unique(cellfun('size', data, ndims(data{1}) ))) > 1 + g.paired = 'off'; + end; + if strcmpi(g.paired, 'on') + pairflag = 1; + else pairflag = 0; + end; + + % return resampling array + % ----------------------- + if strcmpi(g.returnresamplingarray, 'on') + [ datavals datalen datadims ] = concatdata( data ); + if strcmpi(g.arraycomp, 'on') + ori_vals = surrogdistrib( data, 'method', g.method, 'pairing', g.paired, 'naccu', g.naccu); + else + ori_vals = surrogdistrib( data, 'method', g.method, 'pairing', g.paired); + end; + return; + end; + + % text output + % ----------- + myfprintf(verb,'%d x %d, ', size(data,1), size(data,2)); + if strcmpi(g.paired, 'on') + myfprintf(verb,'paired data, '); + else myfprintf(verb,'unpaired data, '); + end; + if size(data,1) == 1 && size(data,2) == 2 + myfprintf(verb,'computing T values\n'); + else myfprintf(verb,'computing F values\n'); + end; + if size(data,1) > 1 + if strcmpi(g.paired, 'on') + myfprintf(verb,'Using 2-way repeated measure ANOVA\n'); + else myfprintf(verb,'Using balanced 2-way ANOVA (not suitable for parametric testing, only bootstrap)\n'); + end; + elseif size(data,2) > 2 + if strcmpi(g.paired, 'on') + myfprintf(verb,'Using 1-way repeated measure ANOVA\n'); + else myfprintf(verb,'Using balanced 1-way ANOVA (equivalent to Matlab anova1)\n'); + end; + else + if strcmpi(g.paired, 'on') + myfprintf(verb,'Using paired t-test\n'); + else myfprintf(verb,'Using unpaired t-test\n'); + end; + end; + if ~strcmpi(g.method, 'param') + if bootflag, myfprintf(verb,'Bootstraps (of %d):', g.naccu); + else myfprintf(verb,'Permutations (of %d):', g.naccu); + end; + end; + end; + + tail = g.tail; + if isempty(g.surrog) + if size(data,1) == 1, % only one row + + if size(data,2) == 2 && strcmpi(g.forceanova, 'off') + + % paired t-test (very fast) + % ------------- + [ori_vals df] = ttest_cell_select(data, g.paired, g.variance); + + if strcmpi(g.method, 'param') + + % Check if exist tcd.m file from the Statistics Toolbox (Bug 1352 ) + if exist('tcdf','file') == 2 & license('test', 'Statistics_Toolbox') + pvals = 2*tcdf(-abs(ori_vals), df); + else + pvals = 2*mytcdf(-abs(ori_vals), df); + end + + pvals = reshape(pvals, size(pvals)); + else + if strcmpi(g.arraycomp, 'on') + try + myfprintf(verb,'...'); + res = surrogdistrib( data, 'method', g.method, 'pairing', g.paired, 'naccu', g.naccu); + surrogval = ttest_cell_select( res, g.paired, g.variance); + catch, + lasterr + myfprintf(verb,'\nSuperfast array computation failed because of memory limitation, reverting to standard computation'); + g.arraycomp = 'off'; + end; + end; + if strcmpi(g.arraycomp, 'off') + [res precomp] = surrogdistrib( data, 'method', g.method, 'pairing', g.paired); + for index = 1:g.naccu + res = surrogdistrib( {}, 'precomp', precomp); + if mod(index, 10) == 0, myfprintf(verb,'%d ', index); end; + if mod(index, 100) == 0, myfprintf(verb,'\n'); end; + if myndims(res{1}) == 1 + surrogval(index) = ttest_cell_select(res, g.paired, g.variance); + else surrogval(:,index) = ttest_cell_select(res, g.paired, g.variance); + end; + end; + end; + end; + else + % one-way ANOVA (paired) this is equivalent to unpaired t-test + % ------------- + tail = 'one'; + [ori_vals df] = anova1_cell_select( data, g.paired ); + if strcmpi(g.method, 'param') + pvals = 1-fcdf(ori_vals, df(1), df(2)); + else + if strcmpi(g.arraycomp, 'on') + try + myfprintf(verb,'...'); + res = surrogdistrib( data, 'method', g.method, 'pairing', g.paired, 'naccu', g.naccu); + surrogval = anova1_cell_select( res, g.paired ); + catch, + myfprintf(verb,'\nSuperfast array computation failed because of memory limitation, reverting to standard computing'); + g.arraycomp = 'off'; + end; + end; + if strcmpi(g.arraycomp, 'off') + [res precomp] = surrogdistrib( data, 'method', g.method, 'pairing', g.paired); + for index = 1:g.naccu + if mod(index, 10) == 0, myfprintf(verb,'%d ', index); end; + if mod(index, 100) == 0, myfprintf(verb,'\n'); end; + + res = surrogdistrib( {}, 'precomp', precomp); + if myndims(data{1}) == 1 + surrogval(index) = anova1_cell_select( res, g.paired ); + else surrogval(:,index) = anova1_cell_select( res, g.paired ); + end; + end; + end; + end; + end; + else + % two-way ANOVA (paired or unpaired) + % ---------------------------------- + tail = 'one'; + [ ori_vals{1} ori_vals{2} ori_vals{3} df{1} df{2} df{3} ] = anova2_cell_select( data, g.paired ); + if strcmpi(g.method, 'param') + pvals{1} = 1-fcdf(ori_vals{1}, df{1}(1), df{1}(2)); + pvals{2} = 1-fcdf(ori_vals{2}, df{2}(1), df{2}(2)); + pvals{3} = 1-fcdf(ori_vals{3}, df{3}(1), df{3}(2)); + else + surrogval = { surrogval surrogval surrogval }; + dataori = data; + if strcmpi(g.arraycomp, 'on') + try + myfprintf(verb,'...'); + res = surrogdistrib( data, 'method', g.method, 'pairing', g.paired, 'naccu', g.naccu); + [ surrogval{1} surrogval{2} surrogval{3} ] = anova2_cell_select( res, g.paired ); + catch, + myfprintf(verb,'\nSuperfast array computation failed because of memory limitation, reverting to standard computing'); + g.arraycomp = 'off'; + end; + end; + if strcmpi(g.arraycomp, 'off') + [res precomp] = surrogdistrib( data, 'method', g.method, 'pairing', g.paired); + for index = 1:g.naccu + if mod(index, 10) == 0, myfprintf(verb,'%d ', index); end; + if mod(index, 100) == 0, myfprintf(verb,'\n'); end; + + res = surrogdistrib( {}, 'precomp', precomp); + if myndims(data{1}) == 1 + [ surrogval{1}(index) surrogval{2}(index) surrogval{3}(index) ] = anova2_cell_select( res, g.paired ); + else [ surrogval{1}(:,index) surrogval{2}(:,index) surrogval{3}(:,index) ] = anova2_cell_select( res, g.paired ); + end; + end; + end; + end; + end; + myfprintf(verb,'\n'); + else + surrogval = g.surrog; + ori_vals = g.stats; + df = []; + end; + + % compute p-values + % ---------------- + if ~strcmpi(g.method, 'param') + if iscell( surrogval ) + pvals{1} = stat_surrogate_pvals(surrogval{1}, ori_vals{1}, tail); + pvals{2} = stat_surrogate_pvals(surrogval{2}, ori_vals{2}, tail); + pvals{3} = stat_surrogate_pvals(surrogval{3}, ori_vals{3}, tail); + else + pvals = stat_surrogate_pvals(surrogval, ori_vals, tail); + end; + try, warning('on', 'MATLAB:divideByZero'); catch, end; + end; + + [ ori_vals, pvals ] = reshape_results( nd, ori_vals, pvals); + [ surrogval ] = reshape_results( [nd g.naccu], surrogval); + + % confidence intervals + % -------------------- + if ~isnan(g.alpha) + outputstruct.ci = stat_surrogate_ci(surrogval, g.alpha, tail); + if strcmpi(g.structoutput, 'off') + disp('Warning: returning confidence interval requires an output structure'); + end; + if iscell(pvals) + for ind = 1:length(pvals) + outputstruct.mask{ind} = pvals{ind} < g.alpha; + end; + else + outputstruct.mask = pvals < g.alpha; + end; + end; + + % create a structure for outputing values + % --------------------------------------- + if strcmpi(g.structoutput, 'on') + outputstruct.method = g.method; + outputstruct.pval = pvals; + outputstruct.df = df; + outputstruct.surrog = surrogval; + if length(data(:)) == 2 + outputstruct.t = ori_vals; + else outputstruct.f = ori_vals; + end; + outputstruct.stat = ori_vals; + ori_vals = outputstruct; + end; + +% compute ANOVA 2-way +% ------------------- +function [f1 f2 f3 df1 df2 df3] = anova2_cell_select( res, paired); + if strcmpi(paired,'on') + [f1 f2 f3 df1 df2 df3] = anova2rm_cell( res ); + else + [f1 f2 f3 df1 df2 df3] = anova2_cell( res ); + end; + +% compute ANOVA 1-way +% ------------------- +function [f df] = anova1_cell_select( res, paired); + if strcmpi(paired,'on') + [f df] = anova1rm_cell( res ); + else + [f df] = anova1_cell( res ); + end; + +% compute t-test +% ------------------- +function [t df] = ttest_cell_select( res, paired, homogenous); + if strcmpi(paired,'on') + [t df] = ttest_cell( res{1}, res{2}); + else + [t df] = ttest2_cell( res{1}, res{2}, homogenous); + end; + +% function to compute the number of dimensions +% -------------------------------------------- +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + +% function for verbose messages +% ----------------------------- +function myfprintf(verb, varargin) + if verb + fprintf(varargin{:}); + end; + +% function to replace tcdf +% ------------------------ +function p = mytcdf(x,v) + +if length(v) == 1, + v = repmat(v, size(x)); +end; + +x2 = x.^2; +inds1 = (v < x2); +inds2 = (v >= x2); +if any(inds1(:)), p(inds1) = betainc(v(inds1) ./ (v(inds1) + x2(inds1)), v(inds1)/2, 0.5, 'lower') / 2; end; +if any(inds2(:)), p(inds2) = betainc(x2(inds2) ./ (v(inds2) + x2(inds2)), 0.5, v(inds2)/2, 'upper') / 2; end; +inds = (x > 0); +if any(inds) + p(inds) = 1 - p(inds); +end; + +inds = (v > 1e7); +if any(inds(:)), p(inds) = normcum(x(inds)); end; + +p(x == 0) = 0.5; +if isempty(p) + p = ones(size(x)); +else + p = reshape(p, size(x)); +end; +function [p] = normcum(z) +p = 0.5 * erfc(-z ./ sqrt(2)); + +% reshape results +% --------------- +function varargout = reshape_results(nd, varargin) + if length(varargin) > 1 + for index = 1:length(varargin) + varargout{index} = reshape_results(nd, varargin{index}); + end; + elseif iscell(varargin{1}) + for index = 1:length(varargin{1}) + varargout{1}{index} = reshape_results(nd, varargin{1}{index}); + end; + else + if ~isempty(varargin{1}) + if length(nd) == 1, nd = [ nd 1 ]; end; + varargout{1} = reshape(varargin{1}, nd); + else varargout{1} = []; + end; + end; diff --git a/code/eeglab13_4_4b/functions/statistics/statcondfieldtrip.m b/code/eeglab13_4_4b/functions/statistics/statcondfieldtrip.m new file mode 100644 index 0000000..d6b4ee1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/statcondfieldtrip.m @@ -0,0 +1,383 @@ +% statcondfiledtrip() - same as statcond except that it uses the fieldtrip +% statistical functions. This is useful to perform +% a wider variety of corrections for multiple +% comparisons for instance. +% Usage: +% >> [stats, df, pvals, surrog] = statcond( data, 'key','val'... ); +% Inputs: +% data = same as for statcond() +% +% Optional inputs: +% 'paired' = ['on'|'off'] pair the data array {default: 'on' unless +% the last dimension of data array is of different lengths}. +% 'method' = ['permutation'|'parametric'] method for computing the p-values: +% 'parametric' = parametric testing (standard ANOVA or t-test); +% 'permutation' = non-parametric testing using surrogate data +% made by permuting the input data. Note that if 'bootstrap' +% is given as input, it is interpreted as 'permutation' +% Default is 'parametric'. Note that 'parametric' +% corresponds to the 'analytic' method of Fieldtrip and +% 'permutation' correspond to the 'montecarlo' method. +% 'naccu' = this input is passed on as 'numrandomization' to Fieldtrip +% 'neighbours' = Fieldtrip channel neighbour structure to perfom statistics +% and cluster correction for multiple comparisons accross +% channels. +% 'alpha' = [float] p-value threshold value. Allow returning +% confidence intervals and mask (requires structoutput below). +% 'structoutput' = ['on'|'off'] return an output structure instead of +% the regular output. Allow to output mask and confidence +% intervals. +% +% Fieldtrip options: +% Any option to the freqanalysis, the statistics_montecarlo, the +% statistics_analysis, statistics_stat, statistics_glm may be used +% using 'key', val argument pairs. +% +% Outputs: +% stats = F- or T-value array of the same size as input data without +% the last dimension. A T value is returned only when the data +% includes exactly two conditions. +% df = degrees of freedom, a (2,1) vector, when F-values are returned +% pvals = array of p-values. Same size as input data without the last +% data dimension. All returned p-values are two-tailed. +% surrog = surrogate data array (same size as input data with the last +% dimension filled with a number ('naccu') of surrogate data sets. +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2005- +% With thanks to Robert Oostenveld for fruitful discussions +% and advice on this function. +% +% See also: freqanalysis(), statistics_montecarlol() + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function [ ori_vals, df, pvals ] = statcondfieldtrip( data, varargin ); + + if nargin < 1 + help statcondfieldtrip; + return; + end; + + [g cfgparams] = finputcheck( varargin, { 'naccu' '' [] []; + 'method' 'string' { } 'param'; + 'mode' 'string' { } ''; % deprecated (old method) + 'chanlocs' 'struct' { } struct([]); + 'chandim' 'integer' [] 0; + 'alpha' 'real' [] NaN; + 'neighbours' 'struct' { } struct([]); + 'structoutput' 'string' { 'on','off' } 'off'; +% 'method' 'string' { } 'analytic'; % 'montecarlo','analytic','stat','glm' + 'paired' 'string' { 'on','off' } 'on' }, 'statcond', 'ignore'); + if isstr(g), error(g); end; + if ~isempty(g.mode), g.method = g.mode; end; + if strcmpi(g.method, 'parametric'), g.method = 'param'; end; + if strcmpi(g.method, 'permutation'), g.method = 'montecarlo'; end; + if ~isempty(g.neighbours) && isempty(g.chanlocs) + g.chanlocs = struct('labels', { g.neighbours(:).label }); + end; + if size(data,2) == 1, data = transpose(data); end; % cell array transpose + alphaset = fastif(isnan(g.alpha) || isempty(g.alpha), 0, 1); + + % remove first dimension for all input if necessary + % necessary for scalp topographies which are given as 1 x nelec x subj + % ------------------------------------------------- + ndim = size(data{1}); + if size(data{1},1) == 1 + for index = 1:length(data(:)) + data{index} = squeeze(data{index}); + end; + end; + tmpsize = size(data{1}); + + % find the channel dimension if any + % --------------------------------- + if ~isempty(g.neighbours) && g.chandim == 0 + for index = 1:ndims(data{1}) + if size(data{1},index) == length(g.neighbours); + if g.chandim == 0 + g.chandim = index; + else + error('Multiple possibilities for the channel dimension, please specify manually'); + end; + end; + end; + end; + + % cfg configuration for Fieldtrip + % ------------------------------- + cfg = struct(cfgparams{:}); + cfg.method = g.method; + if strcmpi(g.method, 'param') || strcmpi(g.method, 'parametric') + cfg.method = 'analytic'; + elseif strcmpi(g.method, 'perm') && strcmpi(g.method, 'permutation') || strcmpi(g.method, 'bootstrap') + cfg.method = 'montecarlo'; + end; + if ~isempty(g.neighbours) + cfg.neighbours = g.neighbours; + end; + if isfield(cfg, 'mcorrect') + cfg.correctm = cfg.mcorrect; + else cfg.mcorrect = []; + end; + cfg.feedback = 'no'; + cfg.ivar = 1; + cfg.alpha = fastif(alphaset, g.alpha, 0.05); + cfg.numrandomization = g.naccu; + + % test if data can be paired + % -------------------------- + if length(unique(cellfun('size', data, ndims(data{1}) ))) > 1 + g.paired = 'off'; + end; + fprintf('%d x %d, ', size(data,1), size(data,2)); + if strcmpi(g.paired, 'on') + fprintf('paired data, '); + else fprintf('unpaired data, '); + end; + if size(data,1) == 1 & size(data,2) == 2 + fprintf('computing T values\n'); + else fprintf('computing F values\n'); + end; + + % set randomizations + % ------------------ + if strcmpi(cfg.method, 'montecarlo') && isempty(cfg.numrandomization) + cfg.numrandomization = 200; + if ~strcmpi(cfg.mcorrect, 'no'), cfg.numrandomization = cfg.numrandomization*20; end; + end; + cfg.correcttail = 'alpha'; + + if size(data,1) == 1, % only one row + + if size(data,2) == 2 & strcmpi(g.paired, 'on') + + % paired t-test (very fast) + % ------------- + cfg.statistic = 'depsamplesT'; + [newdata design1 design2 design3] = makefieldtripdata(data, g.chandim, g.chanlocs); + cfg.design = [ design1; design3 ]; + cfg.uvar = 2; + stat = ft_freqstatistics(cfg, newdata{:}); + if isfield(stat, 'df') + df = stat.df; + else df = []; + end; + + elseif size(data,2) == 2 & strcmpi(g.paired, 'off') + + % paired t-test (very fast) + % ------------- + cfg.statistic = 'indepsamplesT'; + [newdata design1] = makefieldtripdata(data, g.chandim, g.chanlocs); + cfg.design = design1; + stat = ft_freqstatistics(cfg, newdata{:}); + if isfield(stat, 'df') + df = stat.df; + else df = []; + end; + + elseif strcmpi(g.paired, 'on') + + % one-way ANOVA (paired) this is equivalent to unpaired t-test + % ------------- + cfg.tail = 1; + cfg.correcttail = 'no'; + cfg.statistic = 'depsamplesF'; + [newdata design1 design2 design3] = makefieldtripdata(data, g.chandim, g.chanlocs); + cfg.design = [ design1; design3 ]; + cfg.uvar = 2; + stat = ft_freqstatistics(cfg, newdata{:}); + if isfield(stat, 'dfnum') + df = [stat.dfnum stat.dfdenom]; + else df = []; + end; + + else + % one-way ANOVA (unpaired) + % ------------- + cfg.tail = 1; + cfg.correcttail = 'no'; + cfg.statistic = 'indepsamplesF'; + [newdata design1] = makefieldtripdata(data, g.chandim, g.chanlocs); + cfg.design = [ design1 ]; + warning off; + stat = ft_freqstatistics(cfg, newdata{:}); + warning on; + if isfield(stat, 'dfnum') + df = [stat.dfnum stat.dfdenom]; + else df = []; + end; + + end; + + else + if strcmpi(g.paired, 'on') + + % two-way ANOVA (paired) + % ------------- + cfg.tail = 1; + cfg.correcttail = 'no'; + cfg.statistic = 'anovan'; + [newdata design1 design2 design3] = makefieldtripdata(data, g.chandim, g.chanlocs); + cfg.design = [ design1; design2; design3 ]; + cfg.effect = 'X1*X2'; + cfg.ivar = [1 2]; + cfg.uvar = 3; + stat = ft_freqstatistics(cfg, newdata{:}); + ori_vals = stat.stat; + if isfield(stat, 'df') + df = stat.df; + else df = []; + end; + + else + + % two-way ANOVA (unpaired) + % ------------- + cfg.tail = 1; + cfg.correcttail = 'no'; + cfg.statistic = 'anovan'; + cfg.clustercritval = 4.5416; % 95 percentile of n =10000; a = { rand(n,10) rand(n,10); rand(n,10) rand(n,10) }; [F df p ] = statcondfieldtrip(a, 'paired', 'off'); + [newdata design1 design2] = makefieldtripdata(data, g.chandim, g.chanlocs); + if ~isempty(g.chanlocs) + for index = 1:length(newdata) + newdata{index}.powspctrm = squeeze(newdata{index}.powspctrm); + newdata{index}.label = { g.chanlocs.labels }; + newdata{index}.freq = 1; + end; + end; + cfg + newdata{1} + cfg.design = [ design1; design2 ]; + cfg.effect = 'X1*X2'; + cfg.ivar = [1 2]; + stat = ft_freqstatistics(cfg, newdata{:}); + ori_vals = stat.stat; + df = stat.df; + + end; + end; + + ori_vals = stat.stat; + pvals = stat.prob; + + if size(ori_vals,1) ~= size(data{1},1) && size(ori_vals,1) == 1 + ori_vals = reshape(ori_vals, size(ori_vals,2), size(ori_vals,3), size(ori_vals,4)); + pvals = reshape(pvals , size(pvals ,2), size(pvals ,3), size(pvals ,4)); + if isfield(stat, 'mask') + stat.mask = reshape(stat.mask , size(stat.mask ,2), size(stat.mask ,3), size(stat.mask ,4)); + end; + end; + + if strcmpi(g.structoutput, 'on') + outputstruct.mask = stat.mask; + outputstruct.pval = pvals; + if length(data(:)) == 2 + outputstruct.t = ori_vals; + else outputstruct.f = ori_vals; + end; + outputstruct.stat = ori_vals; +% outputstruct.method = g.method; +% outputstruct.pval = pvals; +% outputstruct.df = df; +% outputstruct.surrog = surrogval; +% if length(data(:)) == 2 +% outputstruct.t = ori_vals; +% else outputstruct.f = ori_vals; +% end; + ori_vals = outputstruct; + end; + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + +function [newdata, design1, design2, design3] = makefieldtripdata(data, chandim, chanlocs); + + newdata = {}; + swapdim = []; + for i = 1:length(data(:)) + + newdata{i}.dimord = 'rpt_chan_freq_time'; + switch myndims(data{1}) + case 1, + newdata{i}.powspctrm = data{i}; + + case 2, + if chandim + newdata{i}.powspctrm = transpose(data{i}); + else newdata{i}.powspctrm = reshape(transpose(data{i}), size(data{i},2), 1, size(data{i},1)); + end; + + case 3, + if chandim == 2 % chandim can be 1 or 2 + swapdim = [2 1]; + end; + if chandim + newdata{i}.powspctrm = permute(data{i}, [3 1 2]); + else newdata{i}.powspctrm = permute(data{i}, [3 4 1 2]); % 4 is a singleton dimension + end; + + case 4, + newdata{i}.powspctrm = permute(data{i}, [4 1 2 3]); + end; + + newdata{i}.label = cell(1,size(newdata{i}.powspctrm,2)); + newdata{i}.label(:) = { 'cz' }; + for ic = 1:length(newdata{i}.label) + newdata{i}.label{ic} = [ 'c' num2str(ic) ]; + end; + newdata{i}.freq = [1:size(newdata{i}.powspctrm,3)]; + newdata{i}.time = [1:size(newdata{i}.powspctrm,4)]; + + % below in case channels are specified + % not that statistics are done on time x frequencies or channels + % so time x frequency x channels do not work yet here + if ~isempty(chanlocs) + newdata{i}.powspctrm = squeeze(newdata{i}.powspctrm); + newdata{i}.label = { chanlocs.labels }; + newdata{i}.freq = 1; + newdata{i}.time = 1; + end; + if isempty(chanlocs) && size(newdata{i}.powspctrm,2) ~= 1 + newdata{i}.dimord = 'rpt_freq_time'; + end; + end; + + design1 = []; + design2 = []; + design3 = []; + for i = 1:size(data,2) + for j = 1:size(data,1) + nrepeat = size(data{i}, ndims(data{i})); + ij = j+(i-1)*size(data,1); + design1 = [ design1 ones(1, nrepeat)*i ]; + design2 = [ design2 ones(1, nrepeat)*j ]; + design3 = [ design3 [1:nrepeat] ]; + end; + end; + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/statistics/surrogdistrib.m b/code/eeglab13_4_4b/functions/statistics/surrogdistrib.m new file mode 100644 index 0000000..6be6917 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/surrogdistrib.m @@ -0,0 +1,165 @@ +% surrogdistrib - Build surrogate distribution +% +% surrog = surrogdistrib(data, varargin); +% +% Inputs: +% data - [cell] data arrays for which to compute a surrogate +% distribution. +% +% Optional inputs: +% 'method' - ['bootstrap'|'perm'] use either 'bootstrap' or 'permutation' +% method. Bootstrap performs draws with replacement and +% permutation performs draws without replacement. Default +% is 'perm'. +% 'pairing' - ['on'|'off'] pair the data arrays. +% 'naccu' - [integer] number of surrogate. Default is 1. +% 'precomp' - cell array containing precomputed value for speeding up +% mulitple calls +% +% Output: +% surrog - surrogate distribution +% precomp - cell array containing precomputed value for speeding up +% mulitple calls +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2005- + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [res precomp ] = surrogdistrib(data, varargin) + +if nargin < 1 + help surrogdistrib, + return; +end; + +if ~strcmpi(varargin{1}, 'precomp') + opt = finputcheck(varargin, { 'naccu' 'integer' [1 Inf] 1; + 'method' 'string' { 'perm','permutation','bootstrap' } 'perm'; + 'pairing' 'string' { 'on','off' } 'on'; + 'precomp' 'cell' {} {} }, 'surrogdistrib'); + if isstr(opt), error(opt); end; + if strcmpi(opt.method, 'permutation'), opt.method = 'perm'; end; + if strcmpi(opt.method, 'bootstrap'), bootflag = 1; + else bootflag = 0; + end; + if strcmpi(opt.pairing, 'on') + pairflag = 1; + else pairflag = 0; + end; +else + opt.precomp = varargin{2}; +end; + +% concatenate data +% ---------------- +if isempty(opt.precomp) + [ datavals datalen datadims ] = concatdata( data ); + precomp = { datavals datalen datadims bootflag pairflag opt.naccu}; +else + precomp = opt.precomp; + datavals = precomp{1}; + datalen = precomp{2}; + datadims = precomp{3}; + bootflag = precomp{4}; + pairflag = precomp{5}; + opt.naccu = precomp{6}; +end; + +% compute surrogate distribution +% ------------------------------ +if opt.naccu > 1 + res = supersurrogate( datavals, datalen, datadims, bootflag, pairflag, opt.naccu); +else + res = surrogate( datavals, datalen, datadims, bootflag, pairflag); +end; + +function res = supersurrogate(dat, lens, dims, bootstrapflag, pairedflag, naccu); % for increased speed only shuffle half the indices + + % recompute indices in set and target cell indices + % ------------------------------------------------ + ncond = length(lens)-1; + nsubj = lens(2); + if bootstrapflag + if pairedflag + indswap = mod( repmat([1:lens(end)],[naccu 1]) + ceil(rand(naccu,lens(end))*length(lens))*lens(2)-1, lens(end) )+1; + else indswap = ceil(rand(naccu,lens(end))*lens(end)); + end; + else + if pairedflag + [tmp idx] = sort(rand(naccu,nsubj,ncond),3); + indswap = ((idx)-1)*nsubj + repmat( repmat([1:nsubj], [naccu 1 1]),[1 1 ncond]); + indswap = reshape(indswap, [naccu lens(end)]); + else + [tmp indswap] = sort(rand(naccu, lens(end)),2); + end; + end; + + for i = 1:length(lens)-1 + if myndims(dat) == 1 + res{i} = reshape(dat(indswap(:,lens(i)+1:lens(i+1))), naccu, lens(i+1)-lens(i)); + else res{i} = reshape(dat(:,indswap(:,lens(i)+1:lens(i+1))), size(dat,1), naccu, lens(i+1)-lens(i)); + end; + end; + res = reshape(res, dims); + +function res = surrogate(dataconcat, lens, dims, bootstrapflag, pairedflag); % for increased speed only shuffle half the indices + + % recompute indices in set and target cell indices + % ------------------------------------------------ + if bootstrapflag + if pairedflag + indswap = mod( [1:lens(end)]+ ceil(rand(1,lens(end))*length(lens))*lens(2)-1, lens(end) )+1; + else indswap = ceil(rand(1,lens(end))*lens(end)); + end; + else + if pairedflag + indswap = [1:lens(end)]; + indswap = reshape(indswap, [lens(2) length(lens)-1]); + for i = 1:size(indswap,1) % shuffle each row + [tmp idx] = sort(rand(1,size(indswap,2))); + indswap(i,:) = indswap(i,idx); + end; + indswap = reshape(indswap, [1 lens(2)*(length(lens)-1)]); + else + oriindices = [1:lens(end)]; % just shuffle indices + [tmp idx] = sort(rand(1,length(oriindices))); + indswap = oriindices(idx); + end; + end; + + res = {}; + for i = 1:length(lens)-1 + if myndims(dataconcat) == 1 + res{i} = dataconcat(indswap(lens(i)+1:lens(i+1))); + else res{i} = dataconcat(:,indswap(lens(i)+1:lens(i+1))); + end; + end; + res = reshape(res, dims); + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/statistics/teststat.m b/code/eeglab13_4_4b/functions/statistics/teststat.m new file mode 100644 index 0000000..43fff60 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/teststat.m @@ -0,0 +1,409 @@ +% teststat - EEGLAB statistical testing function +% +% Statistics are critical for inference testing in Science. It is thus +% primordial to make sure than all the statistics implemented are +% robust and at least bug free. Statistical function using complex +% formulas are inherently prone to bugs. EEGLAB functions are all the +% more prone to bugs given that they only use complex Matlab code to +% avoid loops and speed up computation. +% +% This test function does not garantee that EEGLAB statistical functions +% are bug free. It does assure though that bugs are unlikely and minor +% if they are present. +% +% This function test 3 things. +% +% * First, it checks that for vector inputs the EEGLAB functions return +% the same output as other reference functions from the Matlab statistical +% toolbox or from other packages tested against the SPSS software for +% repeated measure ANOVA (rm_anova2 function). +% +% * Second, it checks that array inputs with different number of dimensions +% (from 1 to 3) the EEGLAB function return the same output. +% +% * Third, it checks that the permutation and bootstrap methods shuffle +% the data properly by running multiple tests. + +function teststat; + +% testing paired t-test +% --------------------- +a = { rand(1,10) rand(1,10)+0.5 }; +[t df pvals surog] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[h p tmp stats] = ttest(a{1}, a{2}); +fprintf('Statistics paired statcond t-value %2.2f df=%d p=%0.4f\n', t, df, pvals); +fprintf('Statistics paired ttest func. t-value %2.2f df=%d p=%0.4f\n', stats.tstat, stats.df, p); +assertsame([t stats.tstat], [df stats.df], [pvals p]); +disp('--------------------'); + +% testing unpaired t-test +% ----------------------- +[t df pvals surog] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[h p tmp stats] = ttest2(a{1}, a{2}); +fprintf('Statistics paired statcond t-value %2.2f df=%d p=%0.4f\n', t, df, pvals); +fprintf('Statistics paired ttest2 func. t-value %2.2f df=%d p=%0.4f\n', stats.tstat, stats.df, p); +assertsame([t stats.tstat], [df stats.df], [pvals p]); +disp('--------------------'); + +% testing paired 1-way ANOVA +% -------------------------- +a = { rand(1,10) rand(1,10) rand(1,10)+0.2; rand(1,10) rand(1,10)+0.2 rand(1,10) }; +[F df pvals surog] = statcond(a(1,:), 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +z = zeros(10,1); o = ones(10,1); t = ones(10,1)*2; +stats = rm_anova2( [ a{1,1}';a{1,2}';a{1,3}'], repmat([1:10]', [3 1]), [o;o;o], [z;o;t], {'a','b'}); +fprintf('Statistics 1-way paired statcond F-value %2.2f df1=%d df2=%d p=%0.4f\n', F, df(1), df(2), pvals); +fprintf('Statistics 1-way paired rm_avova2 func. F-value %2.2f df1=%d df2=%d p=%0.4f\n', stats{3,5}, stats{3,3}, stats{6,3}, stats{3,6}); +assertsame([F stats{3,5}], [df(1) stats{3,3}], [df(2) stats{6,3}], [pvals stats{3,6}]); +disp('--------------------'); + +% testing paired 2-way ANOVA +% -------------------------- +[F df pvals surog] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +z = zeros(10,1); o = ones(10,1); t = ones(10,1)*2; +stats = rm_anova2( [ a{1,1}';a{1,2}';a{1,3}';a{2,1}';a{2,2}';a{2,3}' ], ... + repmat([1:10]', [6 1]), [o;o;o;z;z;z], [z;o;t;z;o;t], {'a','b'}); +fprintf('Statistics 2-way paired statcond F-value %2.2f df1=%d df2=%d p=%0.4f\n', F{3}, df{3}(1), df{3}(2), pvals{3}); +fprintf('Statistics 2-way paired rm_avova2 func. F-value %2.2f df1=%d df2=%d p=%0.4f\n', stats{4,5}, stats{4,3}, stats{7,3}, stats{4,6}); +assertsame([F{3} stats{4,5}], [df{3}(1) stats{4,3}], [df{3}(2) stats{7,3}], [pvals{3} stats{4,6}]); +disp('--------------------'); + +% testing 1-way unpaired ANOVA +% ---------------------------- +[F df pvals surog] = statcond(a(1,:), 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[p stats] = anova1( [ a{1,1}' a{1,2}' a{1,3}' ],{}, 'off'); +fprintf('Statistics 1-way unpaired statcond F-value %2.2f df1=%d df2=%d p=%0.4f\n', F, df(1), df(2), pvals); +fprintf('Statistics 1-way unpaired anova1 func. F-value %2.2f df1=%d df2=%d p=%0.4f\n', stats{2,5}, stats{2,3}, stats{3,3}, stats{2,6}); +assertsame([F stats{2,5}], [df(1) stats{2,3}], [df(2) stats{3,3}], [pvals stats{2,6}]); +disp('--------------------'); + +% testing 2-way unpaired ANOVA +% ---------------------------- +[F df pvals surog] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[p stats] = anova2( [ a{1,1}' a{1,2}' a{1,3}'; a{2,1}' a{2,2}' a{2,3}' ], 10, 'off'); +fprintf('Statistics 2-way paired statcond F-value %2.2f df1=%d df2=%d p=%0.4f\n', F{3}, df{3}(1), df{3}(2), pvals{3}); +fprintf('Statistics 1-way unpaired anova2 func. F-value %2.2f df1=%d df2=%d p=%0.4f\n', stats{4,5}, stats{4,3}, stats{5,3}, stats{4,6}); +assertsame([F{3} stats{4,5}], [df{3}(1) stats{4,3}], [df{3}(2) stats{5,3}], [pvals{3} stats{4,6}]); +disp('--------------------'); + +% testing different dimensions in statcond +% ---------------------------------------- +a = { rand(1,10) rand(1,10)+0.5 rand(1,10)}; +b = { rand(10,10) rand(10,10)+0.5 rand(10,10)}; b{1}(4,:) = a{1}; b{2}(4,:) = a{2}; b{3}(4,:) = a{3}; +c = { rand(5,10,10) rand(5,10,10)+0.5 rand(5,10,10)}; c{1}(2,4,:) = a{1}; c{2}(2,4,:) = a{2}; c{3}(2,4,:) = a{3}; +d = { rand(2,5,10,10) rand(2,5,10,10)+0.5 rand(2,5,10,10)}; d{1}(1,2,4,:) = a{1}; d{2}(1,2,4,:) = a{2}; d{3}(1,2,4,:) = a{3}; +[t1 df1 pvals1] = statcond(a(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t2 df2 pvals2] = statcond(b(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t3 df3 pvals3] = statcond(c(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t4 df4 pvals4] = statcond(d(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +fprintf('Statistics paired statcond t-test dim1 t-value %2.2f df=%d p=%0.4f\n', t1, df1, pvals1); +fprintf('Statistics paired statcond t-test dim2 t-value %2.2f df=%d p=%0.4f\n', t2(4), df2, pvals2(4)); +fprintf('Statistics paired statcond t-test dim3 t-value %2.2f df=%d p=%0.4f\n', t3(2,4), df3, pvals3(2,4)); +fprintf('Statistics paired statcond t-test dim4 t-value %2.2f df=%d p=%0.4f\n', t4(1,2,4), df4, pvals4(1,2,4)); +assertsame([t1 t2(4) t3(2,4) t4(1,2,4)], [df1 df2 df3 df4], [pvals1 pvals2(4) pvals3(2,4) pvals4(1,2,4)]); +disp('--------------------'); +[t1 df1 pvals1] = statcond(a(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t2 df2 pvals2] = statcond(b(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t3 df3 pvals3] = statcond(c(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t4 df4 pvals4] = statcond(d(1:2), 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +fprintf('Statistics unpaired statcond t-test dim1 t-value %2.2f df=%d p=%0.4f\n', t1, df1, pvals1); +fprintf('Statistics unpaired statcond t-test dim2 t-value %2.2f df=%d p=%0.4f\n', t2(4), df2, pvals2(4)); +fprintf('Statistics unpaired statcond t-test dim3 t-value %2.2f df=%d p=%0.4f\n', t3(2,4), df3, pvals3(2,4)); +fprintf('Statistics unpaired statcond t-test dim4 t-value %2.2f df=%d p=%0.4f\n', t4(1,2,4), df4, pvals4(1,2,4)); +assertsame([t1 t2(4) t3(2,4) t4(1,2,4)], [df1 df2 df3 df4], [pvals1 pvals2(4) pvals3(2,4) pvals4(1,2,4)]); +disp('--------------------'); +[t1 df1 pvals1] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t2 df2 pvals2] = statcond(b, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t3 df3 pvals3] = statcond(c, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t4 df4 pvals4] = statcond(d, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +fprintf('Statistics paired statcond anova 1-way dim1 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t1, df1(1), df1(2), pvals1); +fprintf('Statistics paired statcond anova 1-way dim2 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t2(4), df2(1), df2(2), pvals2(4)); +fprintf('Statistics paired statcond anova 1-way dim3 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t3(2,4), df3(1), df3(2), pvals3(2,4)); +fprintf('Statistics paired statcond anova 1-way dim4 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t4(1,2,4), df4(1), df4(2), pvals4(1,2,4)); +assertsame([t1 t2(4) t3(2,4) t4(1,2,4)], [df1 df2 df3 df4], [pvals1 pvals2(4) pvals3(2,4) pvals4(1,2,4)]); +disp('--------------------'); +[t1 df1 pvals1] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t2 df2 pvals2] = statcond(b, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t3 df3 pvals3] = statcond(c, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t4 df4 pvals4] = statcond(d, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +fprintf('Statistics unpaired statcond anova 1-way dim1 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t1, df1(1), df1(2), pvals1); +fprintf('Statistics unpaired statcond anova 1-way dim2 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t2(4), df2(1), df2(2), pvals2(4)); +fprintf('Statistics unpaired statcond anova 1-way dim3 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t3(2,4), df3(1), df3(2), pvals3(2,4)); +fprintf('Statistics unpaired statcond anova 1-way dim4 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t4(1,2,4), df4(1), df4(2), pvals4(1,2,4)); +assertsame([t1 t2(4) t3(2,4) t4(1,2,4)], [df1 df2 df3 df4], [pvals1 pvals2(4) pvals3(2,4) pvals4(1,2,4)]); +disp('--------------------'); +a(2,:) = a; a{1} = a{1}/2; +b(2,:) = b; b{1} = b{1}/2; +c(2,:) = c; c{1} = c{1}/2; +d(2,:) = d; d{1} = d{1}/2; +[t1 df1 pvals1] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t2 df2 pvals2] = statcond(b, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t3 df3 pvals3] = statcond(c, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +[t4 df4 pvals4] = statcond(d, 'mode', 'param', 'verbose', 'off', 'paired', 'on'); +fprintf('Statistics paired statcond anova 2-way dim1 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t1{3}, df1{3}(1), df1{3}(2), pvals1{3}); +fprintf('Statistics paired statcond anova 2-way dim2 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t2{3}(4), df2{3}(1), df2{3}(2), pvals2{3}(4)); +fprintf('Statistics paired statcond anova 2-way dim3 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t3{3}(2,4), df3{3}(1), df3{3}(2), pvals3{3}(2,4)); +fprintf('Statistics paired statcond anova 2-way dim4 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t4{3}(1,2,4), df4{3}(1), df4{3}(2), pvals4{3}(1,2,4)); +assertsame([t1{3} t2{3}(4) t3{3}(2,4) t4{3}(1,2,4)], [df1{3}(1) df2{3}(1) df3{3}(1) df4{3}(1)], [df1{3}(2) df2{3}(2) df3{3}(2) df4{3}(2)], [pvals1{3} pvals2{3}(4) pvals3{3}(2,4) pvals4{3}(1,2,4)]); +disp('--------------------'); +[t1 df1 pvals1] = statcond(a, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t2 df2 pvals2] = statcond(b, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t3 df3 pvals3] = statcond(c, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +[t4 df4 pvals4] = statcond(d, 'mode', 'param', 'verbose', 'off', 'paired', 'off'); +fprintf('Statistics unpaired statcond anova 2-way dim1 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t1{3}, df1{3}(1), df1{3}(2), pvals1{3}); +fprintf('Statistics unpaired statcond anova 2-way dim2 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t2{3}(4), df2{3}(1), df2{3}(2), pvals2{3}(4)); +fprintf('Statistics unpaired statcond anova 2-way dim3 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t3{3}(2,4), df3{3}(1), df3{3}(2), pvals3{3}(2,4)); +fprintf('Statistics unpaired statcond anova 2-way dim4 t-value %2.2f df1=%d df2=%d p=%0.4f\n', t4{3}(1,2,4), df4{3}(1), df4{3}(2), pvals4{3}(1,2,4)); +assertsame([t1{3} t2{3}(4) t3{3}(2,4) t4{3}(1,2,4)], [df1{3}(1) df2{3}(1) df3{3}(1) df4{3}(1)], [df1{3}(2) df2{3}(2) df3{3}(2) df4{3}(2)], [pvals1{3} pvals2{3}(4) pvals3{3}(2,4) pvals4{3}(1,2,4)]); +disp('--------------------'); + +% testing shuffling and permutation for bootstrap +% ----------------------------------------------- +clear a; +m1 = [1:10]; +m2 = [1:10]+100; +m3 = [1:10]+1000; +a{1} = { m1 m2 }; +a{2} = { m1 m2 m3 }; +a{3} = { [ zeros(9,10); m1] [ zeros(9,10); m2] }; +a{4} = { [ zeros(9,10); m1] [ zeros(9,10); m2] [ zeros(9,10); m3] }; +tmpa = zeros(9,8,10); tmpa(end,end,:) = m1; +tmpb = zeros(9,8,10); tmpb(end,end,:) = m2; +tmpc = zeros(9,8,10); tmpc(end,end,:) = m3; +a{5} = { tmpa tmpb }; +a{6} = { tmpa tmpb tmpc }; + +for method = 1:2 + if method == 2, opt = {'arraycomp', 'off'}; else opt = {}; end; + for dim = 1:length(a) + [sa1] = statcond(a{dim}, 'mode', 'bootstrap', 'verbose', 'off', 'paired', 'on', 'returnresamplingarray', 'on', opt{:}, 'naccu', 10); + [sa2] = statcond(a{dim}, 'mode', 'perm' , 'verbose', 'off', 'paired', 'on', 'returnresamplingarray', 'on', opt{:}, 'naccu', 10); + [sa3] = statcond(a{dim}, 'mode', 'bootstrap', 'verbose', 'off', 'paired', 'off', 'returnresamplingarray', 'on', opt{:}, 'naccu', 10); + [sa4] = statcond(a{dim}, 'mode', 'perm' , 'verbose', 'off', 'paired', 'off', 'returnresamplingarray', 'on', opt{:}, 'naccu', 10); + + % select data + nd = ndims(sa1{1}); + if nd == 2 && size(sa1{1},2) > 1 + for t=1:length(sa1), + sa1{t} = sa1{t}(end,:); + sa2{t} = sa2{t}(end,:); + sa3{t} = sa3{t}(end,:); + sa4{t} = sa4{t}(end,:); + end; + elseif nd == 3 + for t=1:length(sa1), + sa1{t} = squeeze(sa1{t}(end,end,:)); + sa2{t} = squeeze(sa2{t}(end,end,:)); + sa3{t} = squeeze(sa3{t}(end,end,:)); + sa4{t} = squeeze(sa4{t}(end,end,:)); + end; + elseif nd == 4 + for t=1:length(sa1), + sa1{t} = squeeze(sa1{t}(end,end,end,:)); + sa2{t} = squeeze(sa2{t}(end,end,end,:)); + sa3{t} = squeeze(sa3{t}(end,end,end,:)); + sa4{t} = squeeze(sa4{t}(end,end,end,:)); + end; + end; + + % for paired bootstrap, we make sure that the resampling has only shuffled between conditions + % for instance [101 2 1003 104 ...] is an acceptable sequence + if all(rem(sa1{1}(:)',10) == [1:9 0]) && all(rem(sa1{2}(:)',10) == [1:9 0]) + fprintf('Bootstrap paired dim%d resampling method %d Pass\n', dim, method); + else error('Bootstrap paired resampling Error'); + end; + % for paired permutation, in addition, we make sure that the sum accross condition is constant + % which is not true for bootstrap + msa = meansa(sa2); msa = msa(:)-msa(1); + if all(rem(sa1{1}(:)',10) == [1:9 0]) && all(rem(sa1{2}(:)',10) == [1:9 0]) && ... + all(round(msa) == [0:9]') && length(unique(sa2{1})) == 10 && length(unique(sa2{2})) == 10 + fprintf('Permutation paired dim%d resampling method %d Pass\n', dim, method); + else error('Permutation paired resampling Error'); + end; + % for unpaired bootstrap, only make sure there are enough unique + % values + if length(unique(sa3{1})) > 3 && length(unique(sa3{2})) > 3 + fprintf('Bootstrap unpaired dim%d reampling method %d Pass\n', dim, method); + else error('Bootstrap unpaired reampling Error'); + end; + % for unpaired permutation, the number of unique values must be 10 + % and the sum must be constant (not true for bootstrap) + if length(unique(sa4{1})) == 10 && length(unique(sa4{2})) == 10 && ( floor(mean(meansa(sa4))) == 55 || floor(mean(meansa(sa4))) == 372 ) + fprintf('Permutation unpaired dim%d reampling method %d Pass\n', dim, method); + else error('Permutation unpaired reampling Error'); + end; + + disp('------------------------'); + end; +end; + +% function to check +function assertsame(varargin) + +for ind = 1:length(varargin) + if length(varargin{1}) > 2 + for tmpi = 1:length(varargin{1})-1 + assertsame(varargin{1}(tmpi:tmpi+1)); + end; + return; + else + if (varargin{ind}(1)-varargin{ind}(2)) > abs(mean(varargin{ind}))*0.01 + error('Test failed'); + end; + end; +end; +disp('Test pass'); + +function [meanmat] = meansa(mat) + +meanmat = zeros(size(mat{1})); +for index = 1:length(mat) + meanmat = meanmat+mat{index}/length(mat); +end; + +function stats = rm_anova2(Y,S,F1,F2,FACTNAMES) +% +% function stats = rm_anova2(Y,S,F1,F2,FACTNAMES) +% +% Two-factor, within-subject repeated measures ANOVA. +% For designs with two within-subject factors. +% +% Parameters: +% Y dependent variable (numeric) in a column vector +% S grouping variable for SUBJECT +% F1 grouping variable for factor #1 +% F2 grouping variable for factor #2 +% F1name name (character array) of factor #1 +% F2name name (character array) of factor #2 +% +% Y should be a 1-d column vector with all of your data (numeric). +% The grouping variables should also be 1-d numeric, each with same +% length as Y. Each entry in each of the grouping vectors indicates the +% level # (or subject #) of the corresponding entry in Y. +% +% Returns: +% stats is a cell array with the usual ANOVA table: +% Source / ss / df / ms / F / p +% +% Notes: +% Program does not do any input validation, so it is up to you to make +% sure that you have passed in the parameters in the correct form: +% +% Y, S, F1, and F2 must be numeric vectors all of the same length. +% +% There must be at least one value in Y for each possible combination +% of S, F1, and F2 (i.e. there must be at least one measurement per +% subject per condition). +% +% If there is more than one measurement per subject X condition, then +% the program will take the mean of those measurements. +% +% Aaron Schurger (2005.02.04) +% Derived from Keppel & Wickens (2004) "Design and Analysis" ch. 18 +% + +% +% Revision history... +% +% 11 December 2009 (Aaron Schurger) +% +% Fixed error under "bracket terms" +% was: expY = sum(Y.^2); +% now: expY = sum(sum(sum(MEANS.^2))); +% + +stats = cell(4,5); + +F1_lvls = unique_bc(F1); +F2_lvls = unique_bc(F2); +Subjs = unique_bc(S); + +a = length(F1_lvls); % # of levels in factor 1 +b = length(F2_lvls); % # of levels in factor 2 +n = length(Subjs); % # of subjects + +INDS = cell(a,b,n); % this will hold arrays of indices +CELLS = cell(a,b,n); % this will hold the data for each subject X condition +MEANS = zeros(a,b,n); % this will hold the means for each subj X condition + +% Calculate means for each subject X condition. +% Keep data in CELLS, because in future we may want to allow options for +% how to compute the means (e.g. leaving out outliers > 3stdev, etc...). +for i=1:a % F1 + for j=1:b % F2 + for k=1:n % Subjs + INDS{i,j,k} = find(F1==F1_lvls(i) & F2==F2_lvls(j) & S==Subjs(k)); + CELLS{i,j,k} = Y(INDS{i,j,k}); + MEANS(i,j,k) = mean(CELLS{i,j,k}); + end + end +end + +% make tables (see table 18.1, p. 402) +AB = reshape(sum(MEANS,3),a,b); % across subjects +AS = reshape(sum(MEANS,2),a,n); % across factor 2 +BS = reshape(sum(MEANS,1),b,n); % across factor 1 + +A = sum(AB,2); % sum across columns, so result is ax1 column vector +B = sum(AB,1); % sum across rows, so result is 1xb row vector +S = sum(AS,1); % sum across columns, so result is 1xs row vector +T = sum(sum(A)); % could sum either A or B or S, choice is arbitrary + +% degrees of freedom +dfA = a-1; +dfB = b-1; +dfAB = (a-1)*(b-1); +dfS = n-1; +dfAS = (a-1)*(n-1); +dfBS = (b-1)*(n-1); +dfABS = (a-1)*(b-1)*(n-1); + +% bracket terms (expected value) +expA = sum(A.^2)./(b*n); +expB = sum(B.^2)./(a*n); +expAB = sum(sum(AB.^2))./n; +expS = sum(S.^2)./(a*b); +expAS = sum(sum(AS.^2))./b; +expBS = sum(sum(BS.^2))./a; +expY = sum(sum(sum(MEANS.^2))); %sum(Y.^2); +expT = T^2 / (a*b*n); + +% sums of squares +ssA = expA - expT; +ssB = expB - expT; +ssAB = expAB - expA - expB + expT; +ssS = expS - expT; +ssAS = expAS - expA - expS + expT; +ssBS = expBS - expB - expS + expT; +ssABS = expY - expAB - expAS - expBS + expA + expB + expS - expT; +ssTot = expY - expT; + +% mean squares +msA = ssA / dfA; +msB = ssB / dfB; +msAB = ssAB / dfAB; +msS = ssS / dfS; +msAS = ssAS / dfAS; +msBS = ssBS / dfBS; +msABS = ssABS / dfABS; + +% f statistic +fA = msA / msAS; +fB = msB / msBS; +fAB = msAB / msABS; + +% p values +pA = 1-fcdf(fA,dfA,dfAS); +pB = 1-fcdf(fB,dfB,dfBS); +pAB = 1-fcdf(fAB,dfAB,dfABS); + +% return values +stats = {'Source','SS','df','MS','F','p';... + FACTNAMES{1}, ssA, dfA, msA, fA, pA;... + FACTNAMES{2}, ssB, dfB, msB, fB, pB;... + [FACTNAMES{1} ' x ' FACTNAMES{2}], ssAB, dfAB, msAB, fAB, pAB;... + [FACTNAMES{1} ' x Subj'], ssAS, dfAS, msAS, [], [];... + [FACTNAMES{1} ' x Subj'], ssBS, dfBS, msBS, [], [];... + [FACTNAMES{1} ' x ' FACTNAMES{2} ' x Subj'], ssABS, dfABS, msABS, [], []}; + + return + diff --git a/code/eeglab13_4_4b/functions/statistics/ttest2_cell.m b/code/eeglab13_4_4b/functions/statistics/ttest2_cell.m new file mode 100644 index 0000000..3cd08cb --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/ttest2_cell.m @@ -0,0 +1,139 @@ +% ttest2_cell() - compute unpaired t-test. Allow fast computation of +% multiple t-test using matrix manipulation. +% +% Usage: +% >> [F df] = ttest2_cell( { a b } ); +% >> [F df] = ttest2_cell(a, b); +% >> [F df] = ttest2_cell(a, b, 'inhomogenous'); +% +% Inputs: +% a,b = data consisting of UNPAIRED arrays to be compared. The last +% dimension of the data array is used to compute the t-test. +% 'inhomogenous' = use computation for the degree of freedom using +% inhomogenous variance. By default the computation of +% the degree of freedom is done with homogenous +% variances. +% +% Outputs: +% T - T-value +% df - degree of freedom (array) +% +% Example: +% a = { rand(1,10) rand(1,10)+0.5 } +% [T df] = ttest2_cell(a) +% signif = 2*tcdf(-abs(T), df(1)) +% +% % for comparison, the same using the Matlab t-test function +% [h p ci stats] = ttest2(a{1}', a{2}'); +% [ stats.tstat' p] +% +% % fast computation (fMRI scanner volume 100x100x100 and 10 control +% % subjects and 12 test subjects). The computation itself takes 0.5 +% % seconds instead of half an hour using the standard approach (1000000 +% % loops and Matlab t-test function) +% a = rand(100,100,100,10); b = rand(100,100,100,10); +% [F df] = ttest_cell({ a b }); +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2005 +% (thank you to G. Rousselet for providing the formula for +% inhomogenous variances). +% +% Reference: +% Schaum's outlines in statistics (3rd edition). 1999. Mc Graw-Hill. +% Howel, Statistical Methods for Psychology. 2009. Wadsworth Publishing. + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [tval, df] = ttest2_cell(a,b,c) % assumes equal variances + + if nargin < 1 + help ttest2_cell; + return; + end; + + homogenous = 'homogenous'; + if nargin > 1 && isstr(b) + homogenous = b; + end; + if nargin > 2 && isstr(c) + homogenous = c; + end; + if iscell(a), + b = a{2}; + a = a{1}; + end; + if ~strcmpi(homogenous, 'inhomogenous') && ~strcmpi(homogenous, 'homogenous') + error('Value for homogenous parameter can only be ''homogenous'' or ''inhomogenous'''); + end; + + nd = myndims(a); + na = size(a, nd); + nb = size(b, nd); + meana = mymean(a, nd); + meanb = mymean(b, nd); + + if strcmpi(homogenous, 'inhomogenous') + % inhomogenous variance from Howel, 2009, "Statistical Methods for Psychology" + % thank you to G. Rousselet for providing these formulas + m = meana - meanb; + s1 = var(a,0,nd) ./ na; + s2 = var(b,0,nd) ./ nb; + se = sqrt(s1 + s2); + sd = sqrt([s1.*na, s2.*nb]); + tval = m ./ se; + + df = ((s1 + s2).^2) ./ ((s1.^2 ./ (na-1) + s2.^2 ./ (nb-1))); + else + sda = mystd(a, [], nd); + sdb = mystd(b, [], nd); + sp = sqrt(((na-1)*sda.^2+(nb-1)*sdb.^2)/(na+nb-2)); + tval = (meana-meanb)./sp/sqrt(1/na+1/nb); + df = na+nb-2; + end; + + % check values againg Matlab statistics toolbox + % [h p ci stats] = ttest2(a', b'); + % [ tval stats.tstat' ] + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + +function res = mymean( data, varargin) % deal with complex numbers + res = mean( data, varargin{:}); + if ~isreal(data) + res = abs( res ); + end; + +function res = mystd( data, varargin) % deal with complex numbers + if ~isreal(data) + res = std( abs(data), varargin{:}); + else + res = sqrt(sum( bsxfun(@minus, data, mean( data, varargin{2})).^2, varargin{2})/(size(data,varargin{2})-1)); % 8 percent speedup + %res = std( data, varargin{:}); + end; + + diff --git a/code/eeglab13_4_4b/functions/statistics/ttest_cell.m b/code/eeglab13_4_4b/functions/statistics/ttest_cell.m new file mode 100644 index 0000000..7a6e529 --- /dev/null +++ b/code/eeglab13_4_4b/functions/statistics/ttest_cell.m @@ -0,0 +1,97 @@ +% ttest_cell() - compute paired t-test. Allow fast computation of +% multiple t-test using matrix manipulation. +% +% Usage: +% >> [F df] = ttest_cell( { a b } ); +% >> [F df] = ttest_cell(a, b); +% +% Inputs: +% a,b = data consisting of PAIRED arrays to be compared. The last +% dimension of the data array is used to compute the t-test. +% Outputs: +% T - T-value +% df - degree of freedom (array) +% +% Example: +% a = { rand(1,10) rand(1,10)+0.5 } +% [T df] = ttest_cell(a) +% signif = 1-tcdf(T, df(1)) +% +% % for comparison, the same using the Matlab t-test function +% [h p ci stats] = ttest(a{1}', b{1}'); +% [ stats.tstat' p] +% +% % fast computation (fMRI scanner volume 100x100x100 and 10 subjects in +% % two conditions). The computation itself takes 0.5 seconds instead of +% % half an hour using the standard approach (1000000 loops and Matlab +% % t-test function) +% a = rand(100,100,100,10); b = rand(100,100,100,10); +% [F df] = ttest_cell({ a b }); +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2005 +% +% Reference: +% Schaum's outlines in statistics (3rd edition). 1999. Mc Graw-Hill. + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [tval, df] = ttest_cell(a,b) + + if nargin < 1 + help ttest_cell; + return; + end; + + if iscell(a), b = a{2}; a = a{1}; end; + tmpdiff = a-b; + diff = mymean(tmpdiff, myndims(a)); + sd = mystd( tmpdiff,[], myndims(a)); + tval = diff./sd*sqrt(size(a, myndims(a))); + df = size(a, myndims(a))-1; + + % check values againg Matlab statistics toolbox + %[h p ci stats] = ttest(a', b'); + % [ tval stats.tstat' ] + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + +function res = mymean( data, varargin) % deal with complex numbers + res = mean( data, varargin{:}); + if ~isreal(data) + res = abs( res ); + end; + +function res = mystd( data, varargin) % deal with complex numbers + if ~isreal(data) + res = std( abs(data), varargin{:}); + else + res = sqrt(sum( bsxfun(@minus, data, mean( data, varargin{2})).^2, varargin{2})/(size(data,varargin{2})-1)); % 8 percent speedup + %res = std( data, varargin{:}); + end; + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/compute_ersp_times.m b/code/eeglab13_4_4b/functions/studyfunc/compute_ersp_times.m new file mode 100644 index 0000000..78f9140 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/compute_ersp_times.m @@ -0,0 +1,46 @@ +% compute_ERSP_times() - computes the widest possible ERSP/ITC time window, +% which depends on requested ERSP/ITC parameters such as epoch limits, +% frequency range, wavelet parameters, sampling rate and frequency +% resolution that are used by timef(). +% This helper function is called by pop_preclust() & std_ersp(). +% Example: +% [time_range, winsize] = compute_ersp_times(cycles, ALLEEG(seti).srate, ... +% [ALLEEG(seti).xmin ALLEEG(seti).xmax]*1000, freq(1),padratio); +% +% Authors: Hilit Serby & Arnaud Delorme, SCCN, INC, UCSD, Feb 03, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, Feb 03, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [time_range, winsize] = compute_ERSP_times(cycles, srate, epoch_lim, lowfreq, padratio) + +if cycles == 0 %FFT option + if ~exist('padratio') + error('You must enter padratio value for FFT ERSP'); + end + lowfreq = lowfreq*padratio; + t = 1/lowfreq;%time window in sec + winsize = t*srate;%time window in points + %time window in points (must be power of 2) for FFT + winsize =pow2(nextpow2(winsize)); + %winsize =2^round(log2(winsize)); +else %wavelet + t = cycles(1)/lowfreq; %time window in sec + winsize = round(t*srate); %time window in points +end + +time_range(1) = epoch_lim(1) + .5*t*1000; +time_range(2) = epoch_lim(2) - .5*t*1000; diff --git a/code/eeglab13_4_4b/functions/studyfunc/neural_net.m b/code/eeglab13_4_4b/functions/studyfunc/neural_net.m new file mode 100644 index 0000000..f1c0f2d --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/neural_net.m @@ -0,0 +1,16 @@ +% neural_net() - computes clusters using Matlab Neural Net toolbox. +% Alternative clustering algorithm to kmeans(). +% This is a helper function called from pop_clust(). + +function [IDX,C] = neural_net(clustdata,clus_num) + +nmin = min(clustdata); +nmax = max(clustdata); +net = newc([nmin ;nmax].',clus_num); +net = train(net,(clustdata).'); +Y = sim(net,(clustdata).'); +IDX = vec2ind(Y); +C = zeros(clus_num,size(clustdata,2)); +for k = 1:clus_num + C(k,:) = sum(clustdata(find(IDX == k),:)); +end diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_chanplot.m b/code/eeglab13_4_4b/functions/studyfunc/pop_chanplot.m new file mode 100644 index 0000000..24f1adf --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_chanplot.m @@ -0,0 +1,509 @@ +% pop_chanplot() - graphic user interface (GUI)-based function with plotting +% options for visualizing. Only channel measures (e.g., spectra, +% ERPs, ERSPs, ITCs) that have been computed and saved in the study EEG +% datasets can be visualized. These can be computed using the GUI-based +% pop_precomp(). +% Usage: +% >> STUDY = pop_chanplot(STUDY, ALLEEG); +% Inputs: +% ALLEEG - Top-level EEGLAB vector of loaded EEG structures for the dataset(s) +% in the STUDY. ALLEEG for a STUDY set is typically loaded using +% pop_loadstudy(), or in creating a new STUDY, using pop_createstudy(). +% STUDY - EEGLAB STUDY set comprising some or all of the EEG +% datasets in ALLEEG. +% +% Outputs: +% STUDY - The input STUDY set structure modified according to specified user edits, +% if any. Plotted channel measure means (maps, ERSPs, etc.) are added to +% the STUDY structure after they are first plotted to allow quick replotting. +% +% Graphic interface buttons: +% "Select channel to plot" - [list box] Displays available channels to plot (format is +% 'channel name (number of channels)'). The presented channels depend s +% on the optional input variable 'channels'. Selecting (clicking on) a +% channel from the list will display the selected channel channels in the +% "Select channel(s) to plot" list box. Use the plotting buttons below +% to plot selected measures of the selected channel. +% "Select channel(s) to plot" - [list box] Displays the ICA channels of the currently +% selected channel (in the "Select channel to plot" list box). Each channel +% has the format: 'subject name, channel index'. +% "Plot channel properties" - [button] Displays in one figure all the mean channel measures +% (e.g., dipole locations, scalp maps, spectra, etc.) that were calculated +% and saved in the EEG datsets. If there is more than one condition, the ERP +% and the spectrum will have different colors for each condition. The ERSP +% and ITC plots will show only the first condition; clicking on the subplot +% will open a new figure with the different conditions displayed together. +% Uses the command line function std_propplot(). +% "Plot ERSPs" - [button] Displays the channel channel ERSPs. +% If applied to a channel, channel ERSPs are plotted in one figure +% (per condition) with the channel mean ERSP. If "All # channel centroids" +% option is selected, plots all average ERSPs of the channels in one figure +% per condition. If applied to channels, display the ERSP images of specified +% channel channels in separate figures, using one figure for all conditions. +% Uses the command line functions std_erspplot(). +% "Plot ITCs" - [button] Same as "Plot ERSPs" but with ITC. +% Uses the command line functions std_itcplot(). +% "Plot spectra" - [button] Displays the channel channel spectra. +% If applied to a channel, displays channel spectra plus the average channel +% spectrum in bold. For a specific channel, displays the channel channel +% spectra plus the average channel spectrum (in bold) in one figure per condition. +% If the "All # channel centroids" option is selected, displays the average +% spectrum of all channels in the same figure, with spectrum for different +% conditions (if any) plotted in different colors. +% If applied to channels, displays the spectrum of specified channel +% channels in separate figures using one figure for all conditions. +% Uses the command line functions std_specplot(). +% "Plot ERPs" - [button] Same as "Plot spectra" but for ERPs. +% Uses the command line functions std_erpplot(). +% "Plot ERPimage" - [button] Same as "Plot ERP" but for ERPimave. +% Uses the command line functions std_erpimplot(). +% +% Authors: Arnaud Delorme, Scott Makeig, SCCN/INC/UCSD, October 11, 2004 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Coding notes: Useful information on functions and global variables used. + +function [STUDY, com] = pop_chanplot(varargin) + +icadefs; +com = []; +if ~isstr(varargin{1}) + if nargin < 2 + error('pop_chanplot(): You must provide ALLEEG and STUDY structures'); + end + STUDY = varargin{1}; + STUDY.etc.erpparams.topotime = []; % [] for channels and NaN for components + STUDY.etc.specparams.topofreq = []; % NaN -> GUI disabled + STUDY.etc.erspparams.topotime = []; + STUDY.etc.erspparams.topofreq = []; + STUDY.etc.erpimparams.topotime = []; + STUDY.etc.erpimparams.topotrial = []; + + % test path + % --------- + pathwarn = 'off'; + if ~strcmpi(pwd, STUDY.filepath) && ~strcmpi(pwd, STUDY.filepath(1:end-1)) + if length(STUDY.datasetinfo(1).filepath) < 1 + pathwarn = 'on'; + elseif STUDY.datasetinfo(1).filepath(1) == '.' + pathwarn = 'on'; + end; + end; + if strcmpi(pathwarn, 'on') + warndlg2(strvcat('You have changed your working path and data files are', ... + 'no longer available; Cancel, and go back to your STUDY folder'), 'warning'); + end; + + STUDY.tmphist = ''; + ALLEEG = varargin{2}; + if ~isfield(STUDY, 'changrp') + STUDY = std_changroup(STUDY, ALLEEG); + disp('Warning: history not saved for group creation'); + elseif isempty(STUDY.changrp) + STUDY = std_changroup(STUDY, ALLEEG); + disp('Warning: history not saved for group creation'); + end; + + show_chan = ['pop_chanplot(''showchan'',gcf);']; + show_onechan = ['pop_chanplot(''showchanlist'',gcf);']; + plot_chan_maps = ['pop_chanplot(''topoplot'',gcf); ']; + plot_onechan_maps = ['pop_chanplot(''plotchantopo'',gcf); ']; + plot_chan_ersps = ['pop_chanplot(''erspplot'',gcf); ']; + plot_onechan_ersps = ['pop_chanplot(''plotchanersp'',gcf); ']; + plot_chan_itcs = ['pop_chanplot(''itcplot'',gcf); ']; + plot_onechan_itcs = ['pop_chanplot(''plotchanitc'',gcf); ']; + plot_chan_erpim = ['pop_chanplot(''erpimageplot'',gcf); ']; + plot_onechan_erpim = ['pop_chanplot(''plotchanerpimage'',gcf); ']; + plot_chan_spectra = ['pop_chanplot(''specplot'',gcf); ']; + plot_onechan_spectra = ['pop_chanplot(''plotchanspec'',gcf); ']; + plot_chan_erp = ['pop_chanplot(''erpplot'',gcf); ']; + plot_onechan_erp = ['pop_chanplot(''plotchanerp'',gcf); ']; + plot_chan_dip = ['pop_chanplot(''dipplot'',gcf); ']; + plot_onechan_dip = ['pop_chanplot(''plotchandip'',gcf); ']; + plot_chan_sum = ['pop_chanplot(''plotsum'',gcf); ']; + plot_onechan_sum = ['pop_chanplot(''plotonechanum'',gcf); ']; + rename_chan = ['pop_chanplot(''renamechan'',gcf);']; + move_onechan = ['pop_chanplot(''movecomp'',gcf);']; + move_outlier = ['pop_chanplot(''moveoutlier'',gcf);']; + create_chan = ['pop_chanplot(''createchan'',gcf);']; + reject_outliers = ['pop_chanplot(''rejectoutliers'',gcf);']; + merge_channels = ['pop_chanplot(''mergechannels'',gcf);']; + erp_opt = ['pop_chanplot(''erp_opt'',gcf);']; + spec_opt = ['pop_chanplot(''spec_opt'',gcf);']; + erpim_opt = ['pop_chanplot(''erpim_opt'',gcf);']; + ersp_opt = ['pop_chanplot(''ersp_opt'',gcf);']; + stat_opt = ['pop_chanplot(''stat_opt'',gcf);']; + create_group = ['pop_chanplot(''create_group'',gcf);']; + edit_group = ['pop_chanplot(''edit_group'',gcf);']; + delete_group = ['pop_chanplot(''delete_group'',gcf);']; + saveSTUDY = [ 'set(findobj(''parent'', gcbf, ''userdata'', ''save''), ''enable'', fastif(get(gcbo, ''value'')==1, ''on'', ''off''));' ]; + browsesave = [ '[filename, filepath] = uiputfile2(''*.study'', ''Save STUDY with .study extension -- pop_chan()''); ' ... + 'set(faindobj(''parent'', gcbf, ''tag'', ''studyfile''), ''string'', [filepath filename]);' ]; + sel_all_chans = ['pop_chanplot(''sel_all_chans'',gcf);']; + + % list of channel groups + % ---------------------- + show_options = {}; + for index = 1:length(STUDY.changrp) + show_options{end+1} = [ 'All ' STUDY.changrp(index).name ]; + end; + + % enable buttons + % -------------- + filename = STUDY.design(STUDY.currentdesign).cell(1).filebase; + if exist([filename '.datspec']) , spec_enable = 'on'; else spec_enable = 'off'; end; + if exist([filename '.daterp'] ) , erp_enable = 'on'; else erp_enable = 'off'; end; + if exist([filename '.datersp']) , ersp_enable = 'on'; else ersp_enable = 'off'; end; + if exist([filename '.datitc']) , itc_enable = 'on'; else itc_enable = 'off'; end; + if exist([filename '.daterpim']),erpim_enable = 'on'; else erpim_enable = 'off'; end; + + if isfield(ALLEEG(1).dipfit, 'model'), dip_enable = 'on'; else dip_enable = 'off'; end; + + % userdata below + % -------------- + fig_arg{1}{1} = ALLEEG; + fig_arg{1}{2} = STUDY; + fig_arg{1}{3} = STUDY.changrp; + fig_arg{1}{4} = { STUDY.changrp.name }; + fig_arg{2} = length(STUDY.changrp); + + std_line = [0.9 0.35 0.9]; + geometry = { [4] [1] [0.6 0.35 0.1 0.1 0.9] std_line std_line std_line std_line std_line std_line }; + str_name = sprintf('STUDY name ''%s'' - ''%s''', STUDY.name, STUDY.design(STUDY.currentdesign).name); + if length(str_name) > 80, str_name = [ str_name(1:80) '...''' ]; end; + + uilist = { ... + {'style' 'text' 'string' str_name 'FontWeight' 'Bold' 'HorizontalAlignment' 'center'} {} ... + {'style' 'text' 'string' 'Select channel to plot' 'FontWeight' 'Bold' } ... + {'style' 'pushbutton' 'string' 'Sel. all' 'callback' sel_all_chans } {} {} ... + {'style' 'text' 'string' 'Select subject(s) to plot' 'FontWeight' 'Bold'} ... + {'style' 'listbox' 'string' show_options 'value' 1 'max' 2 'tag' 'chan_list' 'Callback' show_chan } ... + {'style' 'pushbutton' 'enable' 'on' 'string' [ 'STATS' 10 'params' ] 'callback' stat_opt } ... + {'style' 'listbox' 'string' '' 'tag' 'chan_onechan' 'max' 2 'min' 1 'callback' show_onechan } ... + {'style' 'pushbutton' 'enable' erp_enable 'string' 'Plot ERPs' 'Callback' plot_chan_erp} ... + {'style' 'pushbutton' 'enable' erp_enable 'string' 'Params' 'Callback' erp_opt } ... + {'style' 'pushbutton' 'enable' erp_enable 'string' 'Plot ERP(s)' 'Callback' plot_onechan_erp} ... + {'style' 'pushbutton' 'enable' spec_enable 'string' 'Plot spectra' 'Callback' plot_chan_spectra} ... + {'style' 'pushbutton' 'enable' spec_enable 'string' 'Params' 'Callback' spec_opt } ... + {'style' 'pushbutton' 'enable' spec_enable 'string' 'Plot spectra' 'Callback' plot_onechan_spectra} ... + {'style' 'pushbutton' 'enable' erpim_enable 'string' 'Plot ERPimage' 'Callback' plot_chan_erpim } ... + {'style' 'pushbutton' 'enable' erpim_enable 'string' 'Params' 'Callback' erpim_opt } ... + {'style' 'pushbutton' 'enable' erpim_enable 'string' 'Plot ERPimage(s)' 'Callback' plot_onechan_erpim } ... + {'style' 'pushbutton' 'enable' ersp_enable 'string' 'Plot ERSPs' 'Callback' plot_chan_ersps} ... + {'vertexpand' 2.15 'style' 'pushbutton' 'enable' ersp_enable 'string' 'Params' 'Callback' ersp_opt } ... + {'style' 'pushbutton' 'enable' ersp_enable 'string' 'Plot ERSP(s)' 'Callback' plot_onechan_ersps}... + {'style' 'pushbutton' 'enable' itc_enable 'string' 'Plot ITCs' 'Callback' plot_chan_itcs} { } ... + {'style' 'pushbutton' 'enable' itc_enable 'string' 'Plot ITC(s)' 'Callback' plot_onechan_itcs}... + }; + % {'style' 'pushbutton' 'string' 'Plot channel properties' 'Callback' plot_chan_sum} {} ... + %{'style' 'pushbutton' 'string' 'Plot channel properties (soon)' 'Callback' plot_onechan_sum 'enable' 'off'} + + % additional UI given on the command line + % --------------------------------------- + geomvert = [ 1 0.5 1 5 1 1 1 1 1]; + if nargin > 2 + addui = varargin{3}; + if ~isfield(addui, 'uilist') + error('Additional GUI definition (argument 4) requires the field "uilist"'); + end; + if ~isfield(addui, 'geometry') + addui.geometry = mat2cell(ones(1,length(addui.uilist))); + end; + uilist = { uilist{:}, addui.uilist{:} }; + geometry = { geometry{:} addui.geometry{:} }; + geomvert = [ geomvert ones(1,length(addui.geometry)) ]; + end; + [out_param userdat] = inputgui( 'geometry' , geometry, 'uilist', uilist, ... + 'helpcom', 'pophelp(''pop_chanplot'')', ... + 'title', 'View and edit current channels -- pop_chanplot()' , 'userdata', fig_arg, ... + 'geomvert', geomvert, 'eval', show_chan ); + + if ~isempty(userdat) + ALLEEG = userdat{1}{1}; + STUDY = userdat{1}{2}; + end + + % history + % ------- + com = STUDY.tmphist; + STUDY = rmfield(STUDY, 'tmphist'); + +else + hdl = varargin{2}; %figure handle + userdat = get(varargin{2}, 'userdat'); + ALLEEG = userdat{1}{1}; + STUDY = userdat{1}{2}; + cls = userdat{1}{3}; + allchans = userdat{1}{4}; + + changrp = get(findobj('parent', hdl, 'tag', 'chan_list') , 'value'); + onechan = get(findobj('parent', hdl, 'tag', 'chan_onechan'), 'value'); + + try + switch varargin{1} + + case {'topoplot', 'erspplot','itcplot','specplot', 'erpplot', 'erpimageplot' } + changrpstr = allchans(changrp); + plotting_option = varargin{1}; + plotting_option = [ plotting_option(1:end-4) 'plot' ]; + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''channels'',' vararg2str({changrpstr}) ');' ]; + % update Study history + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + + case {'plotchanersp','plotchanitc','plotchanspec', 'plotchanerp','plotchanerpimage' } + changrpstr = allchans(changrp); + + %if length(changrp) > 1 + % subject = STUDY.subject{onechan-1}; + %else + % changrpstruct = STUDY.changrp(changrp); + % allsubjects = unique_bc({ STUDY.datasetinfo([ changrpstruct.setinds{:} ]).subject }); + % subject = allsubjects{onechan-1}; + %end; + + plotting_option = varargin{1}; + plotting_option = [ plotting_option(9:end) 'plot' ]; + if onechan(1) ~= 1 % check that not all onechan in channel are requested + subject = STUDY.design(STUDY.currentdesign).cases.value{onechan-1}; + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''channels'',' vararg2str({changrpstr}) ', ''subject'', ''' subject ''' );' ]; + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + else + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''channels'',' vararg2str({changrpstr}) ', ''plotsubjects'', ''on'' );' ]; + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + + case 'stat_opt' % save the list of selected channels + [STUDY com] = pop_statparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'erp_opt' % save the list of selected channels + [STUDY com] = pop_erpparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'spec_opt' % save the list of selected channels + [STUDY com] = pop_specparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'ersp_opt' % save the list of selected channels + [STUDY com] = pop_erspparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'erpim_opt' % save the list of selected channels + [STUDY com] = pop_erpimparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'showchanlist' % save the list of selected channels + if length(changrp) == 1 + STUDY.changrp(changrp).selected = onechan; + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'showchan' + cind = get(findobj('parent', hdl, 'tag', 'chan_list') , 'value'); + changrp = STUDY.changrp(cind); + + % Find datasets availaible + % ------------------------ + %setind = STUDY.setind .* (changrp.chaninds > 0); % set to 0 the cell not + %% % containing any electrode + %allchansets = unique_bc( setind(find(setind(:))) ); + + % Generate channel list + % --------------------- + chanid{1} = 'All subjects'; + if length(changrp) == 1 + allsubjects = unique_bc({ STUDY.design(STUDY.currentdesign).cell([ changrp.setinds{:} ]).case }); + for l = 1:length(allsubjects) + chanid{end+1} = [ allsubjects{l} ' ' changrp.name ]; + end; + else + for l = 1:length(STUDY.design(STUDY.currentdesign).cases.value) + chanid{end+1} = [ STUDY.design(STUDY.currentdesign).cases.value{l} ]; + end; + end; + + selected = 1; + if isfield(changrp, 'selected') & length(cind) == 1 + if ~isempty(STUDY.changrp(cind).selected) + selected = min(STUDY.changrp(cind).selected, 1+length(chanid)); + STUDY.changrp(cind).selected = selected; + end; + end; + + set(findobj('parent', hdl, 'tag', 'chan_onechan'), 'value', selected, 'String', chanid); + + case 'sel_all_chans' + set(findobj('parent', hdl, 'tag', 'chan_list'), 'value', [1:length(STUDY.changrp)]); + + % Generate channel list + % --------------------- + chanid{1} = 'All subjects'; + for l = 1:length(STUDY.design(STUDY.currentdesign).cases.value) + chanid{end+1} = [ STUDY.design(STUDY.currentdesign).cases.value{l} ' All' ]; + end; + selected = 1; + set(findobj('parent', hdl, 'tag', 'chan_onechan'), 'value', selected, 'String', chanid); + + case 'plotsum' + changrpstr = allchans(changrp); + [STUDY] = std_propplot(STUDY, ALLEEG, allchans(changrp)); + a = ['STUDY = std_propplot(STUDY, ALLEEG, ' vararg2str({ allchans(changrp) }) ' );' ]; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + + case 'create_group' + channames = { STUDY.changrp(changrp).name }; + for i=1:length(channames), channames{i} = [ ' ' channames{i} ]; end; + channamestr = strcat(channames{:}); + res = inputdlg2({ 'Name of channel group', 'Channels to group' }, 'Create channel group', 1, { '' channamestr(2:end) }); + if isempty(res), return; end; + STUDY.changrp(end+1).name = res{1}; + allchans(end+1) = { res{1} }; + chanlabels = parsetxt(res{2}); + if length(chanlabels) == 1 + warndlg2('Cannot create a channel group with a single channel'); + return; + end; + STUDY.changrp(end).channels = chanlabels; + tmp = std_chanlookup( STUDY, ALLEEG, STUDY.changrp(end)); + STUDY.changrp(end).chaninds = tmp.chaninds; + userdat{1}{2} = STUDY; + userdat{1}{4} = allchans; + set(hdl, 'userdat',userdat); + + % list of channel groups + % ---------------------- + tmpobj = findobj('parent', hdl, 'tag', 'chan_list'); + tmptext = get(tmpobj, 'string'); + tmptext{end+1} = [ 'All ' STUDY.changrp(end).name ]; + set(tmpobj, 'string', tmptext, 'value', length(tmptext)); + + case 'edit_group' + if length(changrp) > 1, return; end; + if length(STUDY.changrp(changrp).channels) < 2, return; end; + channames = STUDY.changrp(changrp).channels; + for i=1:length(channames), channames{i} = [ ' ' channames{i} ]; end; + channamestr = strcat(channames{:}); + res = inputdlg2({ 'Name of channel group', 'Channels to group' }, 'Create channel group', ... + 1, { STUDY.changrp(changrp).name channamestr(2:end) }); + if isempty(res), return; end; + STUDY.changrp(end+1).name = ''; + STUDY.changrp(changrp) = STUDY.changrp(end); + STUDY.changrp(end) = []; + STUDY.changrp(changrp).name = res{1}; + allchans(changrp) = { res{1} }; + chanlabels = parsetxt(res{2}); + STUDY.changrp(changrp).channels = chanlabels; + tmp = std_chanlookup( STUDY, ALLEEG, STUDY.changrp(end)); + STUDY.changrp(changrp).chaninds = tmp.chaninds; + userdat{1}{2} = STUDY; + userdat{1}{4} = allchans; + set(hdl, 'userdat',userdat); + + % list of channel groups + % ---------------------- + show_options = {}; + for index = 1:length(STUDY.changrp) + show_options{end+1} = [ 'All ' STUDY.changrp(index).name ]; + end; + tmpobj = findobj('parent', hdl, 'tag', 'chan_list'); + set(tmpobj, 'string', show_options, 'value', changrp); + + case 'delete_group' + if length(changrp) > 1, return; end; + if length(STUDY.changrp(changrp).channels) < 2, return; end; + STUDY.changrp(changrp) = []; + + % list of channel groups + % ---------------------- + show_options = {}; + for index = 1:length(STUDY.changrp) + show_options{end+1} = [ 'All ' STUDY.changrp(index).name ]; + end; + tmpobj = findobj('parent', hdl, 'tag', 'chan_list'); + set(tmpobj, 'string', show_options, 'value', changrp-1); + + case 'renamechan' + STUDY.saved = 'no'; + chan_name_list = get(findobj('parent', hdl, 'tag', 'chan_list'), 'String'); + chan_num = get(findobj('parent', hdl, 'tag', 'chan_list'), 'Value') -1; + if chan_num == 0 % 'all subjects' option + return; + end + % Don't rename 'Notchan' and 'Outliers' channels. + if strncmpi('Notchan',STUDY.channel(cls(chan_num)).name,8) | strncmpi('Outliers',STUDY.channel(cls(chan_num)).name,8) | ... + strncmpi('Parentchannel',STUDY.channel(cls(chan_num)).name,13) + warndlg2('The Parentchannel, Outliers, and Notchan channels cannot be renamed'); + return; + end + old_name = STUDY.channel(cls(chan_num)).name; + rename_param = inputgui( { [1] [1] [1]}, ... + { {'style' 'text' 'string' ['Rename ' old_name] 'FontWeight' 'Bold'} {'style' 'edit' 'string' '' 'tag' 'chan_rename' } {} }, ... + '', 'Rename channel - from pop_chanplot()' ); + if ~isempty(rename_param) %if not canceled + new_name = rename_param{1}; + STUDY = std_renamechan(STUDY, ALLEEG, cls(chan_num), new_name); + % update Study history + a = ['STUDY = std_renamechan(STUDY, ALLEEG, ' num2str(cls(chan_num)) ', ' STUDY.channel(cls(chan_num)).name ');']; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + + new_name = [ STUDY.channel(cls(chan_num)).name ' (' num2str(length(STUDY.channel(cls(chan_num)).onechan)) ' ICs)']; + chan_name_list{chan_num+1} = renamechan( chan_name_list{chan_num+1}, new_name); + set(findobj('parent', hdl, 'tag', 'chan_list'), 'String', chan_name_list); + set(findobj('parent', hdl, 'tag', 'chan_rename'), 'String', ''); + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update STUDY + end + end + catch + eeglab_error; + end; +end + +function newname = renamechan(oldname, newname); + + tmpname = deblank(oldname(end:-1:1)); + strpos = strfind(oldname, tmpname(end:-1:1)); + + newname = [ oldname(1:strpos-1) newname ]; diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_clust.m b/code/eeglab13_4_4b/functions/studyfunc/pop_clust.m new file mode 100644 index 0000000..c4288fc --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_clust.m @@ -0,0 +1,375 @@ +% pop_clust() - select and run a clustering algorithm on components from an EEGLAB STUDY +% structure of EEG datasets. Clustering data should be prepared beforehand using +% pop_preclust() and/or std_preclust(). The number of clusters must be +% specified in advance. If called in gui mode, the pop_clustedit() window +% appears when the clustering is complete to display clustering results +% and allow the user to review and edit them. +% Usage: +% >> STUDY = pop_clust( STUDY, ALLEEG); % pop up a graphic interface +% >> STUDY = pop_clust( STUDY, ALLEEG, 'key1', 'val1', ...); % no pop-up +% Inputs: +% STUDY - an EEGLAB STUDY set containing some or all of the EEG sets in ALLEEG. +% ALLEEG - a vector of loaded EEG dataset structures of all sets in the STUDY set. +% +% Optional Inputs: +% 'algorithm' - ['kmeans'|'kmeanscluster'|'Neural Network'] algorithm to be used for +% clustering. The 'kmeans' options requires the statistical toolbox. The +% 'kmeanscluster' option is included in EEGLAB. The 'Neural Network' +% option requires the Matlab Neural Net toolbox {default: 'kmeans'} +% 'clus_num' - [integer] the number of desired clusters (must be > 1) {default: 20} +% 'outliers' - [integer] identify outliers further than the given number of standard +% deviations from any cluster centroid. Inf --> identify no such outliers. +% {default: Inf from the command line; 3 for 'kmeans' from the pop window} +% 'save' - ['on' | 'off'] save the updated STUDY to disk {default: 'off'} +% 'filename' - [string] if save option is 'on', save the STUDY under this file name +% {default: current STUDY filename} +% 'filepath' - [string] if save option is 'on', will save the STUDY in this directory +% {default: current STUDY filepath} +% Outputs: +% STUDY - as input, but modified adding the clustering results. +% +% Graphic interface buttons: +% "Clustering algorithm" - [list box] display/choose among the available clustering +% algorithms. +% "Number of clusters to compute" - [edit box] the number of desired clusters (>2) +% "Identify outliers" - [check box] check to detect outliers. +% "Save STUDY" - [check box] check to save the updated STUDY after clustering +% is performed. If no file entered, overwrites the current STUDY. +% +% See also pop_clustedit(), pop_preclust(), std_preclust(), pop_clust() +% +% Authors: Hilit Serby & Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, October 11, 2004, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Coding notes: Useful information on functions and global variables used. + +function [STUDY, ALLEEG, command] = pop_clust(STUDY, ALLEEG, varargin) + +command = ''; +if nargin < 2 + help pop_clust; + return; +end; + +if isempty(STUDY.etc) + error('No pre-clustering information, pre-cluster first!'); +end; +if ~isfield(STUDY.etc, 'preclust') + error('No pre-clustering information, pre-cluster first!'); +end; +if isempty(STUDY.etc.preclust) + error('No pre-clustering information, pre-cluster first!'); +end; + +% check that the path to the stat toolbox comes first (conflict +% with Fieldtrip) +kmeansPath = fileparts(which('kmeans')); +if ~isempty(kmeansPath) + rmpath(kmeansPath); + addpath(kmeansPath); +end; + +if isempty(varargin) %GUI call + + % remove clusters below clustering level (done also after GUI) + % -------------------------------------- + rmindex = []; + clustlevel = STUDY.etc.preclust.clustlevel; + nameclustbase = STUDY.cluster(clustlevel).name; + if clustlevel == 1 + rmindex = [2:length(STUDY.cluster)]; + else + for index = 2:length(STUDY.cluster) + if strcmpi(STUDY.cluster(index).parent{1}, nameclustbase) & ~strncmpi('Notclust',STUDY.cluster(index).name,8) + rmindex = [ rmindex index ]; + end; + end; + end; + + if length(STUDY.cluster) > 2 & ~isempty(rmindex) + resp = questdlg2('Clustering again will delete the last clustering results', 'Warning', 'Cancel', 'Ok', 'Ok'); + if strcmpi(resp, 'cancel'), return; end; + end; + + alg_options = {'Kmeans (stat. toolbox)' 'Neural Network (stat. toolbox)' 'Kmeanscluster (no toolbox)' }; %'Hierarchical tree' + set_outliers = ['set(findobj(''parent'', gcbf, ''tag'', ''outliers_std''), ''enable'', fastif(get(gcbo, ''value''), ''on'', ''off''));'... + 'set(findobj(''parent'', gcbf, ''tag'', ''std_txt''), ''enable'', fastif(get(gcbo, ''value''), ''on'', ''off''));']; + algoptions = [ 'set(findobj(''parent'', gcbf, ''userdata'', ''kmeans''), ''enable'', fastif(get(gcbo, ''value'')==1, ''on'', ''off''));' ]; + saveSTUDY = [ 'set(findobj(''parent'', gcbf, ''userdata'', ''save''), ''enable'', fastif(get(gcbo, ''value'')==1, ''on'', ''off''));' ]; + browsesave = [ '[filename, filepath] = uiputfile2(''*.study'', ''Save STUDY with .study extension -- pop_clust()''); ' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''studyfile''), ''string'', [filepath filename]);' ]; + if ~exist('kmeans'), valalg = 3; else valalg = 1; end; + + strclust = ''; + if STUDY.etc.preclust.clustlevel > length(STUDY.cluster) + STUDY.etc.preclust.clustlevel = 1; + end; + if STUDY.etc.preclust.clustlevel == 1 + strclust = [ 'Performing clustering on cluster ''' STUDY.cluster(STUDY.etc.preclust.clustlevel).name '''' ]; + else + strclust = [ 'Performing sub-clustering on cluster ''' STUDY.cluster(STUDY.etc.preclust.clustlevel).name '''' ]; + end; + + numClust = ceil(mean(cellfun(@length, { STUDY.datasetinfo.comps }))); + if numClust > 2, numClustStr = num2str(numClust); + else numClustStr = '10'; + end; + + clust_param = inputgui( { [1] [1] [1 1] [1 0.5 0.5 ] [ 1 0.5 0.5 ] }, ... + { {'style' 'text' 'string' strclust 'fontweight' 'bold' } {} ... + {'style' 'text' 'string' 'Clustering algorithm:' } ... + {'style' 'popupmenu' 'string' alg_options 'value' valalg 'tag' 'clust_algorithm' 'Callback' algoptions } ... + {'style' 'text' 'string' 'Number of clusters to compute:' } ... + {'style' 'edit' 'string' numClustStr 'tag' 'clust_num' } {} ... + {'style' 'checkbox' 'string' 'Separate outliers (enter std.)' 'tag' 'outliers_on' 'value' 0 'Callback' set_outliers 'userdata' 'kmeans' 'enable' 'on' } ... + {'style' 'edit' 'string' '3' 'tag' 'outliers_std' 'enable' 'off' } {} },... + 'pophelp(''pop_clust'')', 'Set clustering algorithm -- pop_clust()' , [] , 'normal', [ 1 .5 1 1 1]); + + if ~isempty(clust_param) + + % removing previous cluster information + % ------------------------------------- + if ~isempty(rmindex) + fprintf('Removing child clusters of ''%s''...\n', nameclustbase); + STUDY.cluster(rmindex) = []; + STUDY.cluster(clustlevel).child = []; + if clustlevel == 1 & length(STUDY.cluster) > 1 + STUDY.cluster(1).child = { STUDY.cluster(2).name }; % "Notclust" cluster + end; + end; + + clus_alg = alg_options{clust_param{1}}; + clus_num = str2num(clust_param{2}); + outliers_on = clust_param{3}; + stdval = clust_param{4}; + + outliers = []; + try + clustdata = STUDY.etc.preclust.preclustdata; + catch + error('Error accesing preclustering data. Perform pre-clustering.'); + end; + command = '[STUDY] = pop_clust(STUDY, ALLEEG,'; + + if ~isempty(findstr(clus_alg, 'Kmeanscluster')), clus_alg = 'kmeanscluster'; end; + if ~isempty(findstr(clus_alg, 'Kmeans ')), clus_alg = 'kmeans'; end; + if ~isempty(findstr(clus_alg, 'Neural ')), clus_alg = 'neural network'; end; + + disp('Clustering ...'); + + switch clus_alg + case { 'kmeans' 'kmeanscluster' } + command = sprintf('%s %s%s%s %d %s', command, '''algorithm'',''', clus_alg, ''',''clus_num'', ', clus_num, ','); + if outliers_on + command = sprintf('%s %s %s %s', command, '''outliers'', ', stdval, ','); + [IDX,C,sumd,D,outliers] = robust_kmeans(clustdata,clus_num,str2num(stdval),5,lower(clus_alg)); + [STUDY] = std_createclust(STUDY, ALLEEG, 'clusterind', IDX, 'algorithm', {'robust_kmeans', clus_num}); + else + if strcmpi(clus_alg, 'kmeans') + [IDX,C,sumd,D] = kmeans(clustdata,clus_num,'replicates',10,'emptyaction','drop'); + else + %[IDX,C,sumd,D] = kmeanscluster(clustdata,clus_num); + [C,IDX,sumd] =kmeans_st(real(clustdata),clus_num,150); + end; + [STUDY] = std_createclust(STUDY, ALLEEG, 'clusterind', IDX, 'algorithm', {'Kmeans', clus_num}); + end + case 'Hierarchical tree' + %[IDX,C] = hierarchical_tree(clustdata,clus_num); + %[STUDY] = std_createclust(STUDY,IDX,C, {'Neural Network', clus_num}); + case 'neural network' + [IDX,C] = neural_net(clustdata,clus_num); + [STUDY] = std_createclust(STUDY, ALLEEG, 'clusterind', IDX, 'algorithm', {'Neural Network', clus_num}); + command = sprintf('%s %s %d %s', command, '''algorithm'', ''Neural Network'',''clus_num'', ', clus_num, ','); + end + disp('Done.'); + + % If save updated STUDY to disk + save_on = 0; % old option to save STUDY + if save_on + command = sprintf('%s %s', command, '''save'', ''on'','); + if ~isempty(clust_param{6}) + [filepath filename ext] = fileparts(clust_param{6}); + command = sprintf('%s%s%s%s%s%s', command, '''filename'', ''', [filename ext], ', ''filepath'', ''', filepath, ''');' ); + STUDY = pop_savestudy(STUDY, ALLEEG, 'filename', [filename ext], 'filepath', filepath); + else + command(end:end+1) = ');'; + if (~isempty(STUDY.filename)) & (~isempty(STUDY.filepath)) + STUDY = pop_savestudy(STUDY, ALLEEG, 'filename', STUDY.filename, 'filepath', STUDY.filepath); + else + STUDY = pop_savestudy(STUDY, ALLEEG); + end + end + else + command(end:end+1) = ');'; + end + + % Call menu to plot clusters (use EEGLAB menu which include std_envtopo) + eval( [ get(findobj(findobj('tag', 'EEGLAB'), 'Label', 'Edit/plot clusters'), 'callback') ] ); + %[STUDY com] = pop_clustedit(STUDY, ALLEEG); + command = [ command LASTCOM ]; + end + +else %command line call + % remove clusters below clustering level (done also after GUI) + % -------------------------------------- + rmindex = []; + clustlevel = STUDY.etc.preclust.clustlevel; + nameclustbase = STUDY.cluster(clustlevel).name; + if clustlevel == 1 + rmindex = [2:length(STUDY.cluster)]; + else + for index = 2:length(STUDY.cluster) + if strcmpi(STUDY.cluster(index).parent{1}, nameclustbase) & ~strncmpi('Notclust',STUDY.cluster(index).name,8) + rmindex = [ rmindex index ]; + end; + end; + end; + if ~isempty(rmindex) + fprintf('Removing child clusters of ''%s''...\n', nameclustbase); + STUDY.cluster(rmindex) = []; + STUDY.cluster(clustlevel).child = []; + if clustlevel == 1 & length(STUDY.cluster) > 1 + STUDY.cluster(1).child = { STUDY.cluster(2).name }; % "Notclust" cluster + end; + end; + + %default values + algorithm = 'kmeans'; + clus_num = 20; + save = 'off'; + filename = STUDY.filename; + filepath = STUDY.filepath; + outliers = Inf; % default std is Inf - no outliers + + if mod(length(varargin),2) ~= 0 + error('pop_clust(): input variables must be specified in pairs: keywords, values'); + end + + for k = 1:2:length(varargin) + switch(varargin{k}) + case 'algorithm' + algorithm = varargin{k+1}; + case 'clus_num' + clus_num = varargin{k+1}; + case 'outliers' + outliers = varargin{k+1}; + case 'save' + save = varargin{k+1}; + case 'filename' + filename = varargin{k+1}; + case 'filepath' + filepath = varargin{k+1}; + end + end + if clus_num < 2 + clus_num = 2; + end + + clustdata = STUDY.etc.preclust.preclustdata; + switch lower(algorithm) + case { 'kmeans' 'kmeanscluster' } + if outliers == Inf + if strcmpi(algorithm, 'kmeans') + [IDX,C,sumd,D] = kmeans(clustdata,clus_num,'replicates',10,'emptyaction','drop'); + else + [IDX,C,sumd,D] = kmeanscluster(clustdata,clus_num); + end; + [STUDY] = std_createclust(STUDY, ALLEEG, 'clusterind', IDX, 'algorithm', {'Kmeans', clus_num}); + else + [IDX,C,sumd,D,outliers] = robust_kmeans(clustdata,clus_num,outliers,5, algorithm); + [STUDY] = std_createclust(STUDY, ALLEEG, 'clusterind', IDX, 'algorithm', {'robust_kmeans', clus_num}); + end + case 'neural network' + [IDX,C] = neural_net(clustdata,clus_num); + [STUDY] = std_createclust(STUDY, ALLEEG, 'clusterind', IDX, 'algorithm', {'Neural Network', clus_num}); + otherwise + disp('pop_clust: unknown algorithm return'); + return + end + % If save updated STUDY to disk + if strcmpi(save,'on') + if (~isempty(STUDY.filename)) & (~isempty(STUDY.filepath)) + STUDY = pop_savestudy(STUDY, 'filename', STUDY.filename, 'filepath', STUDY.filepath); + else + STUDY = pop_savestudy(STUDY); + end + end +end +STUDY.saved = 'no'; + + +% IDX - index of cluster for each component. Ex: 63 components and 2 +% clusters: IDX will be a 61x1 vector of 1 and 2 (and 0=outlisers) +% C - centroid for clusters. If 2 clusters, size will be 2 x +% width of the preclustering matrix +function [STUDY] = std_createclust2_old(STUDY,IDX,C, algorithm) + +% Find the next available cluster index +% ------------------------------------- +clusters = []; +cls = size(C,1); % number of cluster = number of row of centroid matrix +nc = 0; % index of last cluster +for k = 1:length(STUDY.cluster) + ti = strfind(STUDY.cluster(k).name, ' '); + tmp = STUDY.cluster(k).name(ti(end) + 1:end); + nc = max(nc,str2num(tmp)); + % check if there is a cluster of Notclust components + if strcmp(STUDY.cluster(k).parent,STUDY.cluster(STUDY.etc.preclust.clustlevel).name) + STUDY.cluster(k).preclust.preclustparams = STUDY.etc.preclust.preclustparams; + clusters = [clusters k]; + end +end +len = length(STUDY.cluster); + +if ~isempty(find(IDX==0)) %outliers exist + firstind = 0; + nc = nc + 1; + len = len + 1; +else + firstind = 1; +end + +% create all clusters +% ------------------- +for k = firstind:cls + + % cluster name + % ------------ + if k == 0 + STUDY.cluster(len).name = [ 'outlier ' num2str(k+nc)]; + else STUDY.cluster(k+len).name = [ 'Cls ' num2str(k+nc)]; + end + + % find indices + % ------------ + tmp = find(IDX==k); % IDX contains the cluster index for each component + STUDY.cluster(k+len).sets = STUDY.cluster(STUDY.etc.preclust.clustlevel).sets(:,tmp); + STUDY.cluster(k+len).comps = STUDY.cluster(STUDY.etc.preclust.clustlevel).comps(tmp); + STUDY.cluster(k+len).algorithm = algorithm; + STUDY.cluster(k+len).parent{end+1} = STUDY.cluster(STUDY.etc.preclust.clustlevel).name; + STUDY.cluster(k+len).child = []; + STUDY.cluster(k+len).preclust.preclustdata = STUDY.etc.preclust.preclustdata(tmp,:); + STUDY.cluster(k+len).preclust.preclustparams = STUDY.etc.preclust.preclustparams; + STUDY.cluster(k+len).preclust.preclustcomps = STUDY.etc.preclust.preclustcomps; + + %update parents clusters with cluster child indices + % ------------------------------------------------- + STUDY.cluster(STUDY.etc.preclust.clustlevel).child{end+1} = STUDY.cluster(k+nc).name; +end + +clusters = [ clusters firstind+len:cls+len];%the new created clusters indices. diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_clustedit.m b/code/eeglab13_4_4b/functions/studyfunc/pop_clustedit.m new file mode 100644 index 0000000..1889602 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_clustedit.m @@ -0,0 +1,942 @@ +% pop_clustedit() - graphic user interface (GUI)-based function with editing and plotting +% options for visualizing and manipulating an input STUDY structure. +% Only component measures (e.g., dipole locations, scalp maps, spectra, +% ERPs, ERSPs, ITCs) that have been computed and saved in the study EEG +% datasets can be visualized. These can be computed during pre-clustering +% using the GUI-based function pop_preclust() or the equivalent command +% line functions std_preclust(). To use dipole locations for clustering, +% they must first be stored in the EEG dataset structures using dipfit(). +% Supported cluster editing functions include new cluster creation, cluster +% merging, outlier rejection, and cluster renaming. Components can also be +% moved from one cluster to another or to the outlier cluster. +% Usage: +% >> STUDY = pop_clustedit(STUDY, ALLEEG, clusters, addui, addgeom); +% Inputs: +% ALLEEG - Top-level EEGLAB vector of loaded EEG structures for the dataset(s) +% in the STUDY. ALLEEG for a STUDY set is typically loaded using +% pop_loadstudy(), or in creating a new STUDY, using pop_createstudy(). +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% +% Optional inputs: +% clusters - [integer vector] of cluster numbers. These clusters will be visualized +% and manipulated in the pop_clustedit() graphic interface. There are +% restrictions on which clusters can be loaded together. The clusters must +% either originate from the same clustering (same pre_clustering() and +% subsequent pop_clust() execution), or they must all be leaf clusters +% (i.e., clusters with no child clusters) {default: all leaf clusters}. +% addui - [struct] additional uicontrols entries for the graphic +% interface. Must contains the fiels "uilist", "geometry". +% +% Outputs: +% STUDY - The input STUDY set structure modified according to specified user edits, +% if any. Plotted cluster measure means (maps, ERSPs, etc.) are added to +% the STUDY structure after they are first plotted to allow quick replotting. +% +% Graphic interface buttons: +% "Select cluster to plot" - [list box] Displays available clusters to plot (format is +% 'cluster name (number of components)'). The presented clusters depend +% on the optional input variable 'clusters'. Selecting (clicking on) a +% cluster from the list will display the selected cluster components in the +% "Select component(s) to plot" list box. Use the plotting buttons below +% to plot selected measures of the selected cluster. Additional editing +% options (renaming the cluster, rejecting outliers, moving components to +% another cluster) are also available. The option 'All N cluster centroids' +% at the top of the list displays all the clusters in the list except the +% 'Notcluster', 'Outlier' and 'ParentCluster' clusters. Selecting this option +% will plot the cluster centroids (i.e. ERP, ERSP, ...) in a single figure. +% "Select component(s) to plot" - [list box] Displays the ICA components of the currently +% selected cluster (in the "Select cluster to plot" list box). Each component +% has the format: 'subject name, component index'. Multiple components can be +% selected from the list. Use the plotting buttons below to plot different +% measures of the selected components on different figures. Selecting the +% "All components" option is equivalent to using the cluster plotting buttons. +% Additional editing options are reassigning the selected components to +% another cluster or moving them to the outlier cluster. +% "Plot Cluster properties" - [button] Displays in one figure all the mean cluster measures +% (e.g., dipole locations, scalp maps, spectra, etc.) that were calculated +% and saved in the EEG datsets. If there is more than one condition, the ERP +% and the spectrum will have different colors for each condition. The ERSP +% and ITC plots will show only the first condition; clicking on the subplot +% will open a new figure with the different conditions displayed together. +% Uses the command line function std_propplot(). +% "Plot scalp maps" - [button] Displays the scalp maps of cluster components. +% If applied to a cluster, scalp maps of the cluster components +% are plotted along with the cluster mean scalp map in one figure. +% If "All # cluster centroids" option is selected, all cluster scalp map +% means are plotted in the same figure. If applied to components, displays +% the scalp maps of the specified cluster components in separate figures. +% Uses the command line functions std_topoplot(). +% "Plot ERSPs" - [button] Displays the cluster component ERSPs. +% If applied to a cluster, component ERSPs are plotted in one figure +% (per condition) with the cluster mean ERSP. If "All # cluster centroids" +% option is selected, plots all average ERSPs of the clusters in one figure +% per condition. If applied to components, display the ERSP images of specified +% cluster components in separate figures, using one figure for all conditions. +% Uses the command line functions std_erspplot(). +% "Plot ITCs" - [button] Same as "Plot ERSPs" but with ITC. +% Uses the command line functions std_itcplot(). +% "Plot dipoles" - [button] Displays the dipoles of the cluster components. +% If applied to a cluster, plots the cluster component dipoles (in blue) +% plus the average cluster dipole (in red). If "All # cluster centroids" option +% is selected, all cluster plots are displayed in one figure each cluster in +% a separate subplot. If applied to components, displays the ERSP images of the +% specified cluster. For specific components displays components dipole (in blue) +% plus the average cluster dipole (in Red) in separate figures. +% Uses the command line functions std_dipplot(). +% "Plot spectra" - [button] Displays the cluster component spectra. +% If applied to a cluster, displays component spectra plus the average cluster +% spectrum in bold. For a specific cluster, displays the cluster component +% spectra plus the average cluster spectrum (in bold) in one figure per condition. +% If the "All # cluster centroids" option is selected, displays the average +% spectrum of all clusters in the same figure, with spectrum for different +% conditions (if any) plotted in different colors. +% If applied to components, displays the spectrum of specified cluster +% components in separate figures using one figure for all conditions. +% Uses the command line functions std_specplot(). +% "Plot ERPs" - [button] Same as "Plot spectra" but for ERPs. +% Uses the command line functions std_erpplot(). +% "Plot ERPimage" - [button] Same as "Plot ERP" but for ERPimave. +% Uses the command line functions std_erpimplot(). +% "Create new cluster" - [button] Creates a new empty cluster. +% Opens a popup window in which a name for the new cluster can be entered. +% If no name is given the default name is 'Cls #', where '#' is the next +% available cluster number. For changes to take place, press the popup +% window 'OK' button, else press the 'Cancel' button. After the empty +% cluster is created, components can be moved into it using, +% 'Reassign selected component(s)' (see below). Uses the command line +% function std_createclust(). +% "Rename selected cluster" - [button] Renames a cluster using the selected (mnemonic) name. +% Opens a popup window in which a new name for the selected cluster can be +% entered. For changes to take place, press the popup window 'OK' button, +% else press the 'Cancel' button. Uses the command line function std_renameclust(). +% "Reject outlier components" - [button] rejects outlier components to an outlier cluster. +% Opens a popup window to specify the outlier threshold. Move outlier +% components that are more than x standard deviations devs from the +% cluster centroid to an outlier cluster. For changes to take place, +% press the popup window 'OK' button, else press the 'Cancel' button. +% Uses the command line function std_rejectoutliers(). +% "Merge clusters" - [button] Merges several clusters into one cluster. +% Opens a popup window in which the clusters to merge may be specified +% An optional name can be given to the merged cluster. If no name is given, +% the default name is 'Cls #', where '#' is the next available cluster number. +% For changes to take place, press the popup window 'OK' button, else press +% the 'Cancel' button. Uses the command line function std_mergeclust(). +% "Remove selected outlier component(s)" - [button] Moves selected component(s) to the +% outlier cluster. The components that will be moved are the ones selected +% in the "Select component(s) to plot" list box. Opens a popup window in which +% a list of the selected component(s) is presented. For changes to take place, +% press the popup window 'OK' button, else press the 'Cancel' button. +% Uses the command line function std_moveoutlier(). +% "Reassign selected component(s)" - [button] Moves selected component(s) from one cluster +% to another. The components that will reassign are the ones selected in the +% "Select component(s) to plot" list box. Opens a popup window in which +% a list of possible clusters to which to move the selected component(s) is +% presented. For changes to take place, press the popup window 'OK' button, +% else press the 'Cancel' button. Uses the command line function std_movecomp(). +% "Save STUDY set to disk" - [check box] Saves the STUDY set structure modified according +% to specified user edits to the disk. If no file name is entered will +% overwrite the current STUDY set file. +% +% See also: pop_preclust(), pop_clust(). +% +% Authors: Arnaud Delorme, Hilit Serby, Scott Makeig, SCCN/INC/UCSD, October 11, 2004 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, October 11, 2004, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Coding notes: Useful information on functions and global variables used. + +function [STUDY, com] = pop_clustedit(varargin) +icadefs; + +if nargin < 2 + help pop_clustedit; + return; +end + +if ~isstr(varargin{1}) + STUDY = varargin{1}; + STUDY.etc.erpparams.topotime = NaN; % [] for channels and NaN for components + STUDY.etc.specparams.topofreq = NaN; % NaN -> GUI disabled + STUDY.etc.erspparams.topotime = NaN; + STUDY.etc.erspparams.topofreq = NaN; + STUDY.etc.erpimparams.topotime = NaN; + STUDY.etc.erpimparams.topotrial = NaN; + STUDY.tmphist = ''; + ALLEEG = varargin{2}; + clus_comps = 0; % the number of clustered components + if nargin > 2 && ~isempty(varargin{3}) % load specific clusters + cls = varargin{3}; %cluster numbers + N = length(cls); %number of clusters + + % Check clusters are either from the same level (same parents) or are + % all leaf clusters. + % Check all input clusters have the same parent + + sameparent = 1; + for k = 1: N + % Assess the number of clustered components + if (~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8)) & (~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13)) + clus_comps = clus_comps + length(STUDY.cluster(cls(k)).comps); + end + if k == 1 + parent = STUDY.cluster(cls(k)).parent; + else + if isempty(parent) % if the first cluster was the parent cluster + parent = STUDY.cluster(cls(k)).parent; + end + % For any other case verify that all clusters have the same parents + if ~(sum(strcmp(STUDY.cluster(cls(k)).parent, parent)) == length(parent)) % different parent + if ~strcmp(STUDY.cluster(cls(k)).parent,'manual') & ~strcmp(parent, 'manual') + % if nither is an empty cluster (which was created manually) + sameparent = 0; % then the clusters have different parents + end + end + end + end + + % If not same parent check if all leaf clusters + % --------------------------------------------- + if ~sameparent + for k = 1: N %check if all leaves + if ~isempty(STUDY.cluster(cls(k)).child) + error([ 'pop_clustedit(): All clusters must be from the same level \n' ... + ' (i.e., have the same parents or not be child clusters)' ]); + end + end + end + + % ploting text etc ... + % -------------------- + num_cls = 0; + for k = 1:N + show_options{k+1} = [STUDY.cluster(cls(k)).name ' (' num2str(length(STUDY.cluster(cls(k)).comps)) ' ICs)']; + if (~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8)) & (~strncmpi('Outliers',STUDY.cluster(cls(k)).name,8)) & ... + (~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13)) + num_cls = num_cls + 1; + end + end + show_options{1} = ['All ' num2str(num_cls) ' cluster centroids']; + + else % load leaf clusters + + sameparent = 1; + cls = []; + for k = 2:length(STUDY.cluster) + if isempty(STUDY.cluster(k).child) + if isempty(cls) + parent = STUDY.cluster(k).parent; + elseif ~isempty(STUDY.cluster(k).parent) | ~isempty(parent) % if not both empty + % Check if all parents are the same + if ~(sum(strcmp(STUDY.cluster(k).parent, parent)) == length(parent)) % different parent + if ~strcmp(STUDY.cluster(k).parent,'manual') & ~strcmp(parent, 'manual') + sameparent = 0; + end + end + end + cls = [ cls k]; + if ~strncmpi('Notclust',STUDY.cluster(k).name,8) + clus_comps = clus_comps + length(STUDY.cluster(k).comps); + end + end + end + + + % Plot clusters hierarchically + % ---------------------------- + num_cls = 0; + cls = 1:length(STUDY.cluster); + N = length(cls); %number of clusters + + show_options{1} = [STUDY.cluster(1).name ' (' num2str(length(STUDY.cluster(1).comps)) ' ICs)']; + cls(1) = 1; + count = 2; + for index1 = 1:length(STUDY.cluster(1).child) + + indclust1 = strmatch( STUDY.cluster(1).child(index1), { STUDY.cluster.name }, 'exact'); + show_options{count} = [' ' STUDY.cluster(indclust1).name ' (' num2str(length(STUDY.cluster(indclust1).comps)) ' ICs)']; + cls(count) = indclust1; + count = count+1; + + for index2 = 1:length( STUDY.cluster(indclust1).child ) + indclust2 = strmatch( STUDY.cluster(indclust1).child(index2), { STUDY.cluster.name }, 'exact'); + show_options{count} = [' ' STUDY.cluster(indclust2).name ' (' num2str(length(STUDY.cluster(indclust2).comps)) ' ICs)']; + cls(count) = indclust2; + count = count+1; + + for index3 = 1:length( STUDY.cluster(indclust2).child ) + indclust3 = strmatch( STUDY.cluster(indclust2).child(index3), { STUDY.cluster.name }, 'exact'); + show_options{count} = [' ' STUDY.cluster(indclust3).name ' (' num2str(length(STUDY.cluster(indclust3).comps)) ' ICs)']; + cls(count) = indclust3; + count = count+1; + end; + end; + end; + show_options = { ['All cluster centroids'] show_options{:} }; + end + all_comps = length(STUDY.cluster(1).comps); + + show_clust = [ 'pop_clustedit(''showclust'',gcf);']; + show_comps = [ 'pop_clustedit(''showcomplist'',gcf);']; + plot_clus_maps = [ 'pop_clustedit(''topoplot'',gcf); ']; + plot_comp_maps = [ 'pop_clustedit(''plotcomptopo'',gcf); ']; + plot_clus_ersps = ['pop_clustedit(''erspplot'',gcf); ']; + plot_comp_ersps = ['pop_clustedit(''plotcompersp'',gcf); ']; + plot_clus_itcs = ['pop_clustedit(''itcplot'',gcf); ']; + plot_comp_itcs = ['pop_clustedit(''plotcompitc'',gcf); ']; + plot_clus_erpim = ['pop_clustedit(''erpimageplot'',gcf); ']; + plot_comp_erpim = ['pop_clustedit(''plotcomperpimage'',gcf); ']; + plot_clus_spectra = ['pop_clustedit(''specplot'',gcf); ']; + plot_comp_spectra = ['pop_clustedit(''plotcompspec'',gcf); ']; + plot_clus_erp = ['pop_clustedit(''erpplot'',gcf); ']; + plot_comp_erp = ['pop_clustedit(''plotcomperp'',gcf); ']; + plot_clus_dip = ['pop_clustedit(''dipplot'',gcf); ']; + plot_comp_dip = ['pop_clustedit(''plotcompdip'',gcf); ']; + plot_clus_sum = ['pop_clustedit(''plotsum'',gcf); ']; + plot_comp_sum = ['pop_clustedit(''plotcompsum'',gcf); ']; + rename_clust = ['pop_clustedit(''renameclust'',gcf);']; + move_comp = ['pop_clustedit(''movecomp'',gcf);']; + move_outlier = ['pop_clustedit(''moveoutlier'',gcf);']; + create_clus = ['pop_clustedit(''createclust'',gcf);']; + reject_outliers = ['pop_clustedit(''rejectoutliers'',gcf);']; + merge_clusters = ['pop_clustedit(''mergeclusters'',gcf);']; + dip_opt = ['pop_clustedit(''dip_opt'',gcf);']; + erp_opt = ['pop_clustedit(''erp_opt'',gcf);']; + spec_opt = ['pop_clustedit(''spec_opt'',gcf);']; + ersp_opt = ['pop_clustedit(''ersp_opt'',gcf);']; + erpim_opt = ['pop_clustedit(''erpim_opt'',gcf);']; + stat_opt = ['pop_clustedit(''stat_opt'',gcf);']; + saveSTUDY = [ 'set(findobj(''parent'', gcbf, ''userdata'', ''save''), ''enable'', fastif(get(gcbo, ''value'')==1, ''on'', ''off''));' ]; + browsesave = [ '[filename, filepath] = uiputfile2(''*.study'', ''Save STUDY with .study extension -- pop_clust()''); ' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''studyfile''), ''string'', [filepath filename]);' ]; + + % Create default ERSP / ITC time/freq. paramters + % ---------------------------------------------- + if isempty(ALLEEG) + error('STUDY contains no datasets'); + end + + % enable buttons + % -------------- + filename = STUDY.design(STUDY.currentdesign).cell(1).filebase; + if exist([filename '.icaspec']) , spec_enable = 'on'; else spec_enable = 'off'; end; + if exist([filename '.icaerp'] ) , erp_enable = 'on'; else erp_enable = 'off'; end; + if exist([filename '.icaerpim'] ), erpim_enable = 'on'; else erpim_enable = 'off'; end; + if exist([filename '.icaersp']) , ersp_enable = 'on'; else ersp_enable = 'off'; end; + filename = fullfile( ALLEEG(1).filepath, ALLEEG(1).filename(1:end-4)); + if exist([filename '.icatopo']), scalp_enable = 'on'; else scalp_enable = 'off'; end; + + if isfield(ALLEEG(1).dipfit, 'model'), dip_enable = 'on'; else dip_enable = 'off'; end; + + % userdata below + % -------------- + fig_arg{1}{1} = ALLEEG; + fig_arg{1}{2} = STUDY; + fig_arg{1}{3} = cls; + fig_arg{2} = N; + + str_name = sprintf('STUDY ''%s'' - ''%s'' component clusters', STUDY.name, STUDY.design(STUDY.currentdesign).name); + if length(str_name) > 80, str_name = [ str_name(1:80) '...''' ]; end; + if length(cls) > 1, vallist = 1; else vallist = 2; end; + geomline = [1 0.35 1]; + geometry = { [4 .1 .1 .1 .1] [1] geomline geomline geomline geomline geomline geomline geomline geomline ... + geomline geomline [1] geomline geomline geomline }; + geomvert = [ 1 .5 1 3 1 1 1 1 1 1 1 1 1 1 1 1]; + uilist = { ... + {'style' 'text' 'string' str_name ... + 'FontWeight' 'Bold' 'HorizontalAlignment' 'center'} {} {} {} {} {} ... + {'style' 'text' 'string' 'Select cluster to plot' 'FontWeight' 'Bold' } {} ... + {'style' 'text' 'string' 'Select component(s) to plot ' 'FontWeight' 'Bold'} ... + {'style' 'listbox' 'string' show_options 'value' vallist 'tag' 'clus_list' 'Callback' show_clust } ... + {'style' 'pushbutton' 'enable' 'on' 'string' 'STATS' 'Callback' stat_opt } ... + {'style' 'listbox' 'string' '' 'tag' 'clust_comp' 'max' 2 'min' 1 'callback' show_comps } ... + {'style' 'pushbutton' 'enable' scalp_enable 'string' 'Plot scalp maps' 'Callback' plot_clus_maps} {} ... + {'style' 'pushbutton' 'enable' scalp_enable 'string' 'Plot scalp map(s)' 'Callback' plot_comp_maps}... + {'style' 'pushbutton' 'enable' dip_enable 'string' 'Plot dipoles' 'Callback' plot_clus_dip} ... + {'style' 'pushbutton' 'enable' erp_enable 'string' 'Params' 'Callback' dip_opt } ... + {'style' 'pushbutton' 'enable' dip_enable 'string' 'Plot dipole(s)' 'Callback' plot_comp_dip}... + {'style' 'pushbutton' 'enable' erp_enable 'string' 'Plot ERPs' 'Callback' plot_clus_erp} ... + {'style' 'pushbutton' 'enable' erp_enable 'string' 'Params' 'Callback' erp_opt } ... + {'style' 'pushbutton' 'enable' erp_enable 'string' 'Plot ERP(s)' 'Callback' plot_comp_erp} ... + {'style' 'pushbutton' 'enable' spec_enable 'string' 'Plot spectra' 'Callback' plot_clus_spectra} ... + {'style' 'pushbutton' 'enable' spec_enable 'string' 'Params' 'Callback' spec_opt } ... + {'style' 'pushbutton' 'enable' spec_enable 'string' 'Plot spectra' 'Callback' plot_comp_spectra} ... + {'style' 'pushbutton' 'enable' erpim_enable 'string' 'Plot ERPimage' 'Callback' plot_clus_erpim} ... + {'style' 'pushbutton' 'enable' erpim_enable 'string' 'Params' 'Callback' erpim_opt } ... + {'style' 'pushbutton' 'enable' erpim_enable 'string' 'Plot ERPimage(s)' 'Callback' plot_comp_erpim} ... + {'style' 'pushbutton' 'enable' ersp_enable 'string' 'Plot ERSPs' 'Callback' plot_clus_ersps} ... + {'vertexpand' 2.1 'style' 'pushbutton' 'enable' ersp_enable 'string' 'Params' 'Callback' ersp_opt } ... + {'style' 'pushbutton' 'enable' ersp_enable 'string' 'Plot ERSP(s)' 'Callback' plot_comp_ersps} ... + {'style' 'pushbutton' 'enable' ersp_enable 'string' 'Plot ITCs' 'Callback' plot_clus_itcs} { } ... + {'style' 'pushbutton' 'enable' ersp_enable 'string' 'Plot ITC(s)' 'Callback' plot_comp_itcs} ... + {} {}... %{'style' 'pushbutton' 'string' 'Plot cluster properties' 'Callback' plot_clus_sum 'enable' 'off'} {} ... + {'style' 'pushbutton' 'string' 'Plot component properties' 'Callback' plot_comp_sum 'enable' 'off'} ... % nima, was off + {} ... + {'style' 'pushbutton' 'string' 'Create new cluster' 'Callback' create_clus} {} ... + {'style' 'pushbutton' 'string' 'Reassign selected component(s)' 'Callback' move_comp} ... + {'style' 'pushbutton' 'string' 'Rename selected cluster' 'Callback' rename_clust } {} ... + {'style' 'pushbutton' 'string' 'Remove selected outlier comps.' 'Callback' move_outlier} ... + {'style' 'pushbutton' 'string' 'Merge clusters' 'Callback' merge_clusters 'enable' 'off' } {} ... + {'style' 'pushbutton' 'string' 'Auto-reject outlier components' 'Callback' reject_outliers 'enable' 'off' } }; + + % additional UI given on the command line + % --------------------------------------- + if nargin > 3 + addui = varargin{4}; + if ~isfield(addui, 'uilist') + error('Additional GUI definition (argument 4) requires the field "uilist"'); + end; + if ~isfield(addui, 'geometry') + addui.geometry = mat2cell(ones(1,length(addui.uilist))); + end; + uilist = { uilist{:}, addui.uilist{:} }; + geometry = { geometry{:} addui.geometry{:} }; + geomvert = [ geomvert ones(1,length(addui.geometry)) ]; + end; + + [out_param userdat] = inputgui( 'geometry' , geometry, 'uilist', uilist, ... + 'helpcom', 'pophelp(''pop_clustoutput'')', ... + 'title', 'View and edit current component clusters -- pop_clustedit()' , 'userdata', fig_arg, ... + 'geomvert', geomvert, 'eval', show_clust ); + + if ~isempty(userdat) + ALLEEG = userdat{1}{1}; + STUDY = userdat{1}{2}; + end + + % history + % ------- + com = STUDY.tmphist; + STUDY = rmfield(STUDY, 'tmphist'); + +else + hdl = varargin{2}; %figure handle + userdat = get(varargin{2}, 'userdat'); + ALLEEG = userdat{1}{1}; + STUDY = userdat{1}{2}; + cls = userdat{1}{3}; + + clus = get(findobj('parent', hdl, 'tag', 'clus_list'), 'value'); + comp_ind = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'Value'); + if clus == 1 & length(cls) == 1 + warndlg2('No cluster', 'No cluster'); + return; + end; + + try + switch varargin{1} + + case {'plotcomptopo', 'plotcompersp','plotcompitc','plotcompspec', 'plotcomperp', 'plotcompdip', 'plotcomperpimage'} + plotting_option = varargin{1}; + plotting_option = [ plotting_option(9:end) 'plot' ]; + if (clus ~= 1 ) %specific cluster + if comp_ind(1) ~= 1 % check that not all comps in cluster are requested + subject = STUDY.datasetinfo( STUDY.cluster(cls(clus-1)).sets(1,comp_ind-1)).subject; + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''clusters'',' num2str(cls(clus-1)) ', ''comps'', ' num2str(comp_ind-1) ' );' ]; + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + else + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''clusters'',' num2str(cls(clus-1)) ', ''plotsubjects'', ''on'' );' ]; + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + end + else + comp_list = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'String'); + comp_name = comp_list(comp_ind); + for ci = 1:length(comp_name) + num_comps = 0; + tmp = strfind(comp_name{ci},''''); + clust_name = comp_name{ci}(tmp(1)+1:tmp(end)-1); + for k = 1:length(cls) + if ~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8) & ~strncmpi('Outliers',STUDY.cluster(cls(k)).name,8) & ... + (~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13)) + if strcmpi(STUDY.cluster(cls(k)).name, clust_name) + cind = comp_ind(ci) - num_comps; % component index in the cluster + subject = STUDY.datasetinfo( STUDY.cluster(cls(k)).sets(1,cind)).subject; + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''clusters'',' num2str(cls(k)) ', ''comps'',' num2str(cind) ' );' ]; + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + break; + else + num_comps = num_comps + length(STUDY.cluster(cls(k)).comps); + end + end + end + end + end + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + + case {'topoplot', 'erspplot', 'itcplot', 'specplot', 'erpplot', 'dipplot', 'erpimageplot' } + plotting_option = varargin{1}; + plotting_option = [ plotting_option(1:end-4) 'plot' ]; + if (clus ~= 1 ) % specific cluster option + if ~isempty(STUDY.cluster(cls(clus-1)).comps) + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''clusters'',' num2str(cls(clus-1)) ');' ]; + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + end + else % all clusters + % All clusters does not include 'Notclust' 'ParentCluster' and 'Outliers' clusters. + tmpcls = []; + for k = 1:length(cls) + if ~strncmpi(STUDY.cluster(cls(k)).name,'Notclust',8) & ~strncmpi(STUDY.cluster(cls(k)).name,'Outliers',8) & ... + (~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13)) & ~isempty(STUDY.cluster(cls(k)).comps) + tmpcls = [ tmpcls cls(k)]; + end + end + a = ['STUDY = std_' plotting_option '(STUDY,ALLEEG,''clusters'',[' num2str(tmpcls) ']);' ]; + %if strcmpi(plotting_option, 'dipplot'), a = [a(1:end-2) ',''mode'', ''together'');' ]; end; + eval(a); STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + end + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + + case 'dip_opt' % save the list of selected chaners + [STUDY com] = pop_dipparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'erp_opt' % save the list of selected chaners + [STUDY com] = pop_erpparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'stat_opt' % save the list of selected chaners + [STUDY com] = pop_statparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'spec_opt' % save the list of selected channels + [STUDY com] = pop_specparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'erpim_opt' % save the list of selected channels + [STUDY com] = pop_erpimparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'ersp_opt' % save the list of selected channels + [STUDY com] = pop_erspparams(STUDY); + if ~isempty(com) + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, com); + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'showcomplist' % save the list of selected clusters + clust = get(findobj('parent', hdl, 'tag', 'clus_list') , 'value'); + comp = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'value'); + N = userdat{2}; + count = 1; + if clust ~= 1 %specific cluster + STUDY.cluster(cls(clust-1)).selected = comp; + end; + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update information (STUDY) + + case 'showclust' + cind = get(findobj('parent', hdl, 'tag', 'clus_list'), 'value'); + N = userdat{2}; + count = 1; + selected = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'value'); + if cind ~= 1 %specific cluster + len = length(STUDY.cluster(cls(cind-1)).comps); + compid = cell(len+1,1); + compid{1} = 'All components'; + % Convert from components numbering to the indexing form 'setXcomY' + for l = 1:len % go over the components of the cluster + if ~isnan(STUDY.cluster(cls(cind-1)).sets(1,l)) + subject = STUDY.datasetinfo(STUDY.cluster(cls(cind-1)).sets(1,l)).subject; + compid{l+1} = [ subject ' IC' num2str(STUDY.cluster(cls(cind-1)).comps(1,l)) ]; + end + end + if isfield(STUDY.cluster, 'selected') + if ~isempty(STUDY.cluster(cls(cind-1)).selected) + selected = min(STUDY.cluster(cls(cind-1)).selected, 1+length(STUDY.cluster(cls(cind-1)).comps(1,:))); + STUDY.cluster(cls(cind-1)).selected = selected; + end; + end; + + else % All clusters accept 'Notclust' and 'Outliers' + count = 1; + for k = 1: length(cls) + if ~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8) & ~strncmpi('Outliers',STUDY.cluster(cls(k)).name,8) & ... + (~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13)) + for l = 1: length(STUDY.cluster(cls(k)).comps) + if ~isnan(STUDY.cluster(cls(k)).sets(1,l)) + subject = STUDY.datasetinfo(STUDY.cluster(cls(k)).sets(1,l)).subject; % This line chokes on NaNs. TF 2007.05.31 + compid{count} = [ '''' STUDY.cluster(cls(k)).name ''' comp. ' ... + num2str(l) ' (' subject ' IC' num2str(STUDY.cluster(cls(k)).comps(l)) ')']; + count = count +1; + end + end + end + end + end + if selected > length(compid), selected = 1; end; + set(findobj('parent', hdl, 'tag', 'clust_comp'), 'value', selected, 'String', compid); + + case 'plotsum' + if clus ~= 1 % specific cluster option + [STUDY] = std_propplot(STUDY, ALLEEG, 'cluster', cls(clus-1)); + % update Study history + a = ['STUDY = std_propplot(STUDY, ALLEEG, ''cluster'', ' num2str(cls(clus-1)) ' );' ]; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + else % all clusters + % All clusters does not include 'Notclust' and 'Outliers' clusters. + tmpcls = []; + for k = 1:length(cls) + if ~strncmpi(STUDY.cluster(cls(k)).name,'Notclust',8) & ~strncmpi(STUDY.cluster(cls(k)).name,'Outliers',8) & ... + (~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13)) + tmpcls = [tmpcls cls(k)]; + end + end + [STUDY] = std_propplot(STUDY, ALLEEG, 'cluster', tmpcls); + % update Study history + a = ['STUDY = std_propplot(STUDY, ALLEEG, ''cluster'', [' num2str(tmpcls) '] );' ]; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + end + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + + case 'plotcompsum' + for ci = 1 : length(comp_ind) + % place holder for component properties % nima + end + + case 'renameclust' + STUDY.saved = 'no'; + clus_name_list = get(findobj('parent', hdl, 'tag', 'clus_list'), 'String'); + clus_num = get(findobj('parent', hdl, 'tag', 'clus_list'), 'Value') -1; + if clus_num == 0 % 'all clusters' option + return; + end + % Don't rename 'Notclust' and 'Outliers' clusters. + if strncmpi('Notclust',STUDY.cluster(cls(clus_num)).name,8) | strncmpi('Outliers',STUDY.cluster(cls(clus_num)).name,8) | ... + strncmpi('ParentCluster',STUDY.cluster(cls(clus_num)).name,13) + warndlg2('The ParentCluster, Outliers, and Notclust clusters cannot be renamed'); + return; + end + old_name = STUDY.cluster(cls(clus_num)).name; + rename_param = inputgui( { [1] [1] [1]}, ... + { {'style' 'text' 'string' ['Rename ' old_name] 'FontWeight' 'Bold'} {'style' 'edit' 'string' '' 'tag' 'clus_rename' } {} }, ... + '', 'Rename cluster - from pop_clustedit()' ); + if ~isempty(rename_param) %if not canceled + new_name = rename_param{1}; + STUDY = std_renameclust(STUDY, ALLEEG, cls(clus_num), new_name); + % update Study history + a = ['STUDY = std_renameclust(STUDY, ALLEEG, ' num2str(cls(clus_num)) ', ' STUDY.cluster(cls(clus_num)).name ');']; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + + new_name = [ STUDY.cluster(cls(clus_num)).name ' (' num2str(length(STUDY.cluster(cls(clus_num)).comps)) ' ICs)']; + clus_name_list{clus_num+1} = renameclust( clus_name_list{clus_num+1}, new_name); + set(findobj('parent', hdl, 'tag', 'clus_list'), 'String', clus_name_list); + set(findobj('parent', hdl, 'tag', 'clus_rename'), 'String', ''); + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); %update STUDY + end + + case 'movecomp' + STUDY.saved = 'no'; + old_clus = get(findobj('parent', hdl, 'tag', 'clus_list'), 'value') -1; + comp_ind = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'Value'); + if old_clus == 0 % 'all clusters' option + return; + end + % Don't reassign components of 'Notclust' or the 'ParentCluster'. + if strncmpi('ParentCluster',STUDY.cluster(cls(old_clus)).name,13) + warndlg2('Cannot reassign components of ''ParentCluster''.'); + return; + end + old_name = STUDY.cluster(cls(old_clus)).name; + ncomp = length(comp_ind); % number of selected components + optionalcls =[]; + for k = 1:length(cls) + if (~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13)) & (k~= old_clus) + optionalcls = [optionalcls cls(k)]; + end + end + reassign_param = inputgui( { [1] [1] [1]}, ... + { {'style' 'text' 'string' strvcat(['Reassign ' fastif(ncomp >1, [num2str(length(comp_ind)) ' currently selected components'], ... + 'currently selected component') ], ... + [' from ' old_name ' to the cluster selected below']) 'FontWeight' 'Bold'} ... + {'style' 'listbox' 'string' {STUDY.cluster(optionalcls).name} 'tag' 'new_clus'} {} }, ... + '', 'Reassign cluster - from pop_clustedit()' ,[] , 'normal', [2 3 1] ); + if ~isempty(reassign_param) %if not canceled + new_clus = reassign_param{1}; + comp_to_disp = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'String'); + if strcmp(comp_to_disp{comp_ind(1)},'All components') + warndlg2('Cannot move all the components of the cluster - abort move components', 'Aborting move components'); + return; + end + STUDY = std_movecomp(STUDY, ALLEEG, cls(old_clus), optionalcls(new_clus), comp_ind - 1); + % update Study history + a = ['STUDY = std_movecomp(STUDY, ALLEEG, ' num2str(cls(old_clus)) ', ' num2str(optionalcls(new_clus)) ', [' num2str(comp_ind - 1) ']);']; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + newind = find(cls == optionalcls(new_clus)); + + % update GUI + % ---------- + clus_name_list = get(findobj('parent', hdl, 'tag', 'clus_list'), 'String'); + newname = [STUDY.cluster(optionalcls(new_clus)).name ' (' num2str(length(STUDY.cluster(optionalcls(new_clus)).comps)) ' ICs)']; + clus_name_list{newind+1} = renameclust( clus_name_list{newind+1}, newname); + newname = [STUDY.cluster(cls(old_clus)).name ' (' num2str(length(STUDY.cluster(cls(old_clus)).comps)) ' ICs)']; + clus_name_list{old_clus+1} = renameclust( clus_name_list{old_clus+1}, newname); + set( findobj('parent', hdl, 'tag', 'clus_list'), 'String', clus_name_list); + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + pop_clustedit('showclust',hdl); + end + + case 'moveoutlier' + STUDY.saved = 'no'; + old_clus = get(findobj('parent', hdl, 'tag', 'clus_list'), 'value') -1; + comp_ind = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'Value'); + if ~isempty(find(comp_ind ==1)) + warndlg2('Cannot remove all the cluster components'); + return; + end + if old_clus == 0 % 'all clusters' option + return; + end + if strncmpi('Notclust',STUDY.cluster(cls(old_clus)).name,8) | strncmpi('ParentCluster',STUDY.cluster(cls(old_clus)).name,13) % There are no outliers to 'Notclust' + warndlg2('Cannot reassign components of ''Notclust'' or ''ParentCluster''.'); + return; + end + comp_list = get(findobj('parent', hdl, 'tag', 'clust_comp'), 'String'); + ncomp = length(comp_ind); + old_name = STUDY.cluster(cls(old_clus)).name; + if strncmpi('Outliers',STUDY.cluster(cls(old_clus)).name,8) % There are no outliers of 'Outliers' + warndlg2('Cannot use ''Outliers'' clusters for this option.'); + return; + end + reassign_param = inputgui( { [1] [1] [1]}, ... + { {'style' 'text' 'string' ['Remove ' fastif(ncomp >1, [num2str(length(comp_ind)) ' currently selected components below '], 'currently selected component below ') ... + 'from ' old_name ' to its outlier cluster?'] 'FontWeight' 'Bold'} ... + {'style' 'listbox' 'string' {comp_list{comp_ind}} 'tag' 'new_clus'} {} }, ... + '', 'Remove outliers - from pop_clustedit()' ,[] , 'normal', [1 3 1] ); + if ~isempty(reassign_param) %if not canceled + STUDY = std_moveoutlier(STUDY, ALLEEG, cls(old_clus), comp_ind - 1); + clus_name_list = get(findobj('parent', hdl, 'tag', 'clus_list'), 'String'); + outlier_clust = std_findoutlierclust(STUDY,cls(old_clus)); %find the outlier cluster for this cluster + oind = find(cls == outlier_clust); % the outlier clust index (if already exist) in the cluster list GUI + if ~isempty(oind) % the outlier clust is already presented in the cluster list GUI + newname = [STUDY.cluster(outlier_clust).name ' (' num2str(length(STUDY.cluster(outlier_clust).comps)) ' ICs)']; + clus_name_list{oind+1} = renameclust( clus_name_list{oind+1}, newname); + elseif outlier_clust == length(STUDY.cluster) % update the list with the Outlier cluster (if didn't exist before) + clus_name_list{end+1} = [STUDY.cluster(outlier_clust).name ' (' num2str(length(STUDY.cluster(outlier_clust).comps)) ' ICs)']; + userdat{2} = userdat{2} + 1; % update N, number of clusters in edit window + cls(end +1) = length(STUDY.cluster); % update the GUI clusters list with the outlier cluster + userdat{1}{3} = cls; % update cls, the cluster indices in edit window + end + newname = [STUDY.cluster(cls(old_clus)).name ' (' num2str(length(STUDY.cluster(cls(old_clus)).comps)) ' ICs)']; + clus_name_list{old_clus+1} = renameclust(clus_name_list{old_clus+1}, newname); + set(findobj('parent', hdl, 'tag', 'clus_list'), 'String', clus_name_list); + % update Study history + a = ['STUDY = std_moveoutlier(STUDY, ALLEEG, ' num2str(cls(old_clus)) ', [' num2str(comp_ind - 1) ']);']; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + pop_clustedit('showclust',hdl); + end + + case 'rejectoutliers' + STUDY.saved = 'no'; + clus = get(findobj('parent', hdl, 'tag', 'clus_list'), 'Value') -1; + if clus + std_name = STUDY.cluster(cls(clus)).name; + % Cannot reject outliers from 'Notclust', 'ParentCluster' and 'Outlier' clusters + if strncmpi('Notclust',std_name,8) | strncmpi('ParentCluster', std_name,13) | ... + strncmpi('Outliers',std_name,8) + warndlg2('Cannot reject outliers of ''Notclust'' or ''Outliers'' or ''ParentCluster'' clusters.'); + return; + end + clusters = cls(clus); + else + std_name = 'All clusters'; + clusters = []; + for k = 1:length(cls) + if ~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8) & ~strncmpi('Outliers',STUDY.cluster(cls(k)).name,8) & ... + ~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13) + clusters = [ clusters cls(k)]; + end + end + end + reject_param = inputgui( { [1] [1] [4 1 2] [1]}, ... + { {'style' 'text' 'string' ['Reject "' std_name '" outliers ' ] 'FontWeight' 'Bold'} {} ... + {'style' 'text' 'string' 'Move outlier components that are more than'} {'style' 'edit' 'string' '3' 'tag' 'outliers_std' } ... + {'style' 'text' 'string' 'standard deviations' } ... + {'style' 'text' 'string' [ 'from the "' std_name '" centroid to an outlier cluster.']} }, ... + '', 'Reject outliers - from pop_clustedit()' ); + if ~isempty(reject_param) %if not canceled + ostd = reject_param{1}; % the requested outlier std + [STUDY] = std_rejectoutliers(STUDY, ALLEEG, clusters, str2num(ostd)); + % update Study history + a = ['STUDY = std_rejectoutliers(STUDY, ALLEEG, [ ' num2str(clusters) ' ], ' ostd ');']; + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + clus_name_list = get(findobj('parent', hdl, 'tag', 'clus_list'), 'String'); + for k = 1:length(clusters) + outlier_clust = std_findoutlierclust(STUDY,clusters(k)); %find the outlier cluster for this cluster + oind = find(cls == outlier_clust); % the outlier clust index (if already exist) in the cluster list GUI + if ~isempty(oind) % the outlier clust is already presented in the cluster list GUI + newname = [STUDY.cluster(outlier_clust).name ' (' num2str(length(STUDY.cluster(outlier_clust).comps)) ' ICs)']; + clus_name_list{oind+1} = renameclust( clus_name_list{oind+1}, newname); + else % update the list with the outlier cluster + clus_name_list{end+1} = [STUDY.cluster(outlier_clust).name ' (' num2str(length(STUDY.cluster(outlier_clust).comps)) ' ICs)']; + userdat{2} = userdat{2} + 1; % update N, number of clusters in edit window + cls(end +1) = outlier_clust; % update the GUI clusters list with the outlier cluster + userdat{1}{3} = cls; % update cls, the cluster indices in edit window + end + clsind = find(cls == clusters(k)); + newname = [STUDY.cluster(clusters(k)).name ' (' num2str(length(STUDY.cluster(clusters(k)).comps)) ' ICs)']; + clus_name_list{clsind+1} = renameclust( clus_name_list{clsind+1}, newname); + set(findobj('parent', hdl, 'tag', 'clus_list'), 'String', clus_name_list); + end + % If outlier cluster doesn't exist in the GUI window add it + userdat{1}{2} = STUDY; + set(hdl, 'userdat',userdat); + pop_clustedit('showclust',hdl); + end + + case 'createclust' + STUDY.saved = 'no'; + create_param = inputgui( { [1] [1 1] [1]}, ... + { {'style' 'text' 'string' 'Create new empty cluster' 'FontWeight' 'Bold'} ... + {'style' 'text' 'string' 'Enter cluster name:'} {'style' 'edit' 'string' '' } {} }, ... + '', 'Create new empty cluster - from pop_clustedit()' ); + if ~isempty(create_param) %if not canceled + clus_name = create_param{1}; % the name of the new cluster + [STUDY] = std_createclust(STUDY, ALLEEG, 'name', clus_name); + % Update cluster list + clus_name_list = get(findobj('parent', hdl, 'tag', 'clus_list'), 'String'); + clus_name_list{end+1} = [STUDY.cluster(end).name ' (0 ICs)']; %update the cluster list with the new cluster + % update the first option on the GUI list : 'All 10 cluster centroids' + % with the new number of cluster centroids + ti = strfind(clus_name_list{1},'cluster'); %get the number of clusters centroid + cent = num2str(str2num(clus_name_list{1}(5:ti-2))+1); % new number of centroids + clus_name_list{1} = [clus_name_list{1}(1:4) cent clus_name_list{1}(ti-1:end)]; %update list + set(findobj('parent', hdl, 'tag', 'clus_list'), 'String', clus_name_list); + % update Study history + if isempty(clus_name) + a = ['STUDY = std_createclust(STUDY, ALLEEG);']; + else + a = ['STUDY = std_createclust(STUDY, ALLEEG, ''name'', ' clus_name ');']; + end + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + userdat{1}{2} = STUDY; + userdat{2} = userdat{2} + 1; % update N, the number of cluster options in edit window + cls(end +1) = length(STUDY.cluster); % update the GUI clusters list with the new cluster + userdat{1}{3} = cls; % update cls, the cluster indices in edit window + set(hdl, 'userdat',userdat); %update STUDY, cls and N + end + + case 'mergeclusters' + STUDY.saved = 'no'; + clus_names = get(findobj('parent', hdl, 'tag', 'clus_list'), 'string') ; + optionalcls =[]; + for k = 2:length(clus_names) + if (~strncmpi('Notclust',clus_names{k},8)) & (~strncmpi('Outliers',clus_names{k},8)) & ... + (~strncmpi('ParentCluster',clus_names{k},13)) + optionalcls = [optionalcls k]; + end + end + reassign_param = inputgui( { [1] [1] [1] [2 1] [1]}, ... + { {'style' 'text' 'string' 'Select clusters to Merge' 'FontWeight' 'Bold'} ... + {'style' 'listbox' 'string' clus_names(optionalcls) 'tag' 'new_clus' 'max' 3 'min' 1} {} ... + {'style' 'text' 'string' 'Optional, enter a name for the merged cluster:' 'FontWeight' 'Bold'} ... + {'style' 'edit' 'string' ''} {} }, ... + '', 'Merge clusters - from pop_clustedit()' ,[] , 'normal', [1 3 1 1 1] ); + if ~isempty(reassign_param) + std_mrg = cls(optionalcls(reassign_param{1})-1); + name = reassign_param{2}; + allleaves = 1; + N = userdat{2}; + for k = 1: N %check if all leaves + if ~isempty(STUDY.cluster(cls(k)).child) + allleaves = 0; + end + end + [STUDY] = std_mergeclust(STUDY, ALLEEG, std_mrg, name); + % + % update Study history + % + if isempty(name) + a = ['STUDY = std_mergeclust(STUDY, ALLEEG, [' num2str(std_mrg) ']);']; + else + a = ['STUDY = std_mergeclust(STUDY, ALLEEG, [' num2str(std_mrg) '], ' name ');']; + end + STUDY.tmphist = sprintf('%s\n%s', STUDY.tmphist, a); + userdat{1}{2} = STUDY; + % + % Replace the merged clusters with the one new merged cluster + % in the GUI if all clusters are leaves + % + if allleaves + % + % Update cluster list + % + clus_names{end+1} = [STUDY.cluster(end).name ' (' num2str(length(STUDY.cluster(end).comps)) ' ICs)']; + % + % update the cluster list with the new cluster + % + clus_names([optionalcls(reassign_param{1})]) = []; + cls = setdiff_bc(cls, std_mrg); % remove from the GUI clusters list the merged clusters + cls(end+1) = length(STUDY.cluster); % update the GUI clusters list with the new cluster + N = length(cls); + % + % update the first option on the GUI list : 'All 10 cluster centroids' + % with the new number of cluster centroids + % + ti = strfind(clus_names{1},'cluster'); %get the number of clusters centroid + cent = num2str(str2num(clus_names{1}(5:ti-2))+1- length(std_mrg)); % new number of centroids + clus_names{1} = [clus_names{1}(1:4) cent clus_names{1}(ti-1:end)]; %update list + set(findobj('parent', hdl, 'tag', 'clus_list'), 'String', clus_names); + % + % update Study history + % + userdat{2} = N; % update N, the number of cluster options in edit window + userdat{1}{3} = cls; % update cls, the cluster indices in edit window + end + set(hdl, 'userdat',userdat); %update information (STUDY) + pop_clustedit('showclust',hdl); + end + end + catch + eeglab_error; + end; +end + +function newname = renameclust(oldname, newname); + + tmpname = deblank(oldname(end:-1:1)); + strpos = strfind(oldname, tmpname(end:-1:1)); + + newname = [ oldname(1:strpos-1) newname ]; + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_dipparams.m b/code/eeglab13_4_4b/functions/studyfunc/pop_dipparams.m new file mode 100644 index 0000000..c6f943b --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_dipparams.m @@ -0,0 +1,86 @@ +% pop_dipparams() - Set plotting parameters for dipoles. +% +% Usage: +% >> STUDY = pop_dipparams(STUDY, 'key', 'val'); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% +% Optional inputs: +% 'axistight' - ['on'|'off'] Plot closest MRI slide. Default is 'off'. +% 'projimg' - ['on'|'off'] lot dipoles projections on each axix. Default is 'off'. +% 'projlines' - ['on'|'off'] Plot projection lines. Default is 'off'. +% +% See also: std_dipplot() +% +% Authors: Arnaud Delorme + +% Copyright (C) Arnaud Delorme, 20013 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY, com ] = pop_dipparams(STUDY, varargin); + +STUDY = default_params(STUDY); +TMPSTUDY = STUDY; +com = ''; +if isempty(varargin) + + val_axistight = fastif(strcmpi(STUDY.etc.dipparams.axistight,'on'), 1, 0); + val_projimg = fastif(strcmpi(STUDY.etc.dipparams.projimg,'on'), 1, 0); + val_projlines = fastif(strcmpi(STUDY.etc.dipparams.projlines,'on'), 1, 0); + + uilist = { ... + {'style' 'checkbox' 'tag' 'axistight' 'value' val_axistight } { 'style' 'text' 'string' 'Plot closest MRI slide' } ... + {'style' 'checkbox' 'tag' 'projlines' 'value' val_projlines } { 'style' 'text' 'string' 'Plot projection lines' } ... + {'style' 'checkbox' 'tag' 'projimg' 'value' val_projimg } { 'style' 'text' 'string' 'Plot dipoles projections' } }; + + [out_param userdat tmp res] = inputgui( 'geometry' , { [0.1 1] [0.1 1] [0.1 1] }, 'uilist', uilist, 'geomvert', [1 1 1], ... + 'title', 'ERP plotting options -- pop_dipparams()'); + if isempty(res), return; end; + + % decode inputs + % ------------- + res.axistight = fastif(res.axistight, 'on', 'off'); + res.projimg = fastif(res.projimg , 'on', 'off'); + res.projlines = fastif(res.projlines, 'on', 'off'); + + % build command call + % ------------------ + options = {}; + if ~strcmpi( res.axistight, STUDY.etc.dipparams.axistight), options = { options{:} 'axistight' res.axistight }; end; + if ~strcmpi( res.projimg, STUDY.etc.dipparams.projimg ), options = { options{:} 'projimg' res.projimg }; end; + if ~strcmpi( res.projlines, STUDY.etc.dipparams.projlines), options = { options{:} 'projlines' res.projlines }; end; + if ~isempty(options) + STUDY = pop_dipparams(STUDY, options{:}); + com = sprintf('STUDY = pop_dipparams(STUDY, %s);', vararg2str( options )); + end; +else + if strcmpi(varargin{1}, 'default') + STUDY = default_params(STUDY); + else + for index = 1:2:length(varargin) + if ~isempty(strmatch(varargin{index}, fieldnames(STUDY.etc.dipparams), 'exact')) + STUDY.etc.dipparams = setfield(STUDY.etc.dipparams, varargin{index}, varargin{index+1}); + end; + end; + end; +end; + +function STUDY = default_params(STUDY) + if ~isfield(STUDY.etc, 'dipparams'), STUDY.etc.dipparams = []; end; + if ~isfield(STUDY.etc.dipparams, 'axistight'), STUDY.etc.dipparams.axistight = 'off'; end; + if ~isfield(STUDY.etc.dipparams, 'projimg'), STUDY.etc.dipparams.projimg = 'off'; end; + if ~isfield(STUDY.etc.dipparams, 'projlines'), STUDY.etc.dipparams.projlines = 'off'; end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_erpimparams.m b/code/eeglab13_4_4b/functions/studyfunc/pop_erpimparams.m new file mode 100644 index 0000000..5bb86e0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_erpimparams.m @@ -0,0 +1,150 @@ +% pop_erpimparams() - Set plotting and statistics parameters for +% computing and plotting STUDY mean ERPimages and measure +% statistics. Settings are stored within the STUDY +% structure (STUDY.etc.erpimparams) which is used +% whenever plotting is performed by the function +% std_erpimage(). +% Usage: +% >> STUDY = pop_erpimparams(STUDY, 'key', 'val', ...); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% +% Erpimage plotting options: +% 'timerange' - [min max] erpim/ITC plotting latency range in ms. +% {default: the whole output latency range}. +% 'trialrange' - [min max] erpim/ITC plotting frequency range in ms. +% {default: the whole output frequency range} +% 'topotime' - [float] plot scalp map at specific time. A time range may +% also be provide and the erpim will be averaged over the +% given time range. Requires 'topofreq' below to be set. +% 'topotrial' - [float] plot scalp map at specific trial in ERPimage. As +% above a trial range may also be provided. +% +% Authors: Arnaud Delorme, CERCO, CNRS, 2006- + +% Copyright (C) Arnaud Delorme, 2006 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY, com ] = pop_erpimparams(STUDY, varargin); + +STUDY = default_params(STUDY); +TMPSTUDY = STUDY; +com = ''; +if isempty(varargin) + + vis = fastif(isnan(STUDY.etc.erpimparams.topotime), 'off', 'on'); + uilist = { ... + {'style' 'text' 'string' 'ERPimage plotting options' 'fontweight' 'bold' 'tag', 'erpim' } ... + {'style' 'text' 'string' 'Time range in ms [Low High]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpimparams.timerange) 'tag' 'timerange' } ... + {'style' 'text' 'string' 'Plot scalp map at time [ms]' 'visible' vis} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpimparams.topotime) 'tag' 'topotime' 'visible' vis } ... + {'style' 'text' 'string' 'Trial range [Low High]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpimparams.trialrange) 'tag' 'trialrange' } ... + {'style' 'text' 'string' 'Plot scalp map at trial(s)' 'visible' vis} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpimparams.topotrial) 'tag' 'topotrial' 'visible' vis } ... + {'style' 'text' 'string' 'Color limits [Low High]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpimparams.colorlimits) 'tag' 'colorlimits' } ... + {'style' 'text' 'string' '' } ... + {'style' 'text' 'string' '' } }; + evalstr = 'set(findobj(gcf, ''tag'', ''erpim''), ''fontsize'', 12);'; + cbline = [0.07 1.1]; + otherline = [ 0.6 .4 0.6 .4]; + geometry = { 1 otherline otherline otherline }; + enablecond = fastif(length(STUDY.design(STUDY.currentdesign).variable(1).value)>1, 'on', 'off'); + enablegroup = fastif(length(STUDY.design(STUDY.currentdesign).variable(2).value)>1, 'on', 'off'); + + [out_param userdat tmp res] = inputgui( 'geometry' , geometry, 'uilist', uilist, ... + 'title', 'Set Erpimage plotting parameters -- pop_erpimparams()', 'eval', evalstr); + if isempty(res), return; end; + + % decode input + % ------------ + res.topotime = str2num( res.topotime ); + res.topotrial = str2num( res.topotrial ); + res.timerange = str2num( res.timerange ); + res.trialrange = str2num( res.trialrange ); + res.colorlimits = str2num( res.colorlimits ); + + % build command call + % ------------------ + options = {}; + if ~isequal(res.topotime , STUDY.etc.erpimparams.topotime), options = { options{:} 'topotime' res.topotime }; end; + if ~isequal(res.topotrial, STUDY.etc.erpimparams.topotrial), options = { options{:} 'topotrial' res.topotrial }; end; + if ~isequal(res.timerange , STUDY.etc.erpimparams.timerange), options = { options{:} 'timerange' res.timerange }; end; + if ~isequal(res.trialrange, STUDY.etc.erpimparams.trialrange), options = { options{:} 'trialrange' res.trialrange }; end; + if ~isequal(res.colorlimits, STUDY.etc.erpimparams.colorlimits), options = { options{:} 'colorlimits' res.colorlimits }; end; + if ~isempty(options) + STUDY = pop_erpimparams(STUDY, options{:}); + com = sprintf('STUDY = pop_erpimparams(STUDY, %s);', vararg2str( options )); + end; +else + if strcmpi(varargin{1}, 'default') + STUDY = default_params(STUDY); + else + allfields = fieldnames(STUDY.etc.erpimparams); + for index = 1:2:length(varargin) + if ~isempty(strmatch(varargin{index}, allfields, 'exact')) + STUDY.etc.erpimparams = setfield(STUDY.etc.erpimparams, varargin{index}, varargin{index+1}); + else + if ~isequal(varargin{index}, 'datatype') && ~isequal(varargin{index}, 'channels') + inderpimopt = strmatch(varargin{index}, STUDY.etc.erpimparams.erpimageopt(1:2:end), 'exact'); + if ~isempty(inderpimopt) + STUDY.etc.erpimparams.erpimageopt{2*inderpimopt} = varargin{index+1}; + else + STUDY.etc.erpimparams.erpimageopt = { STUDY.etc.erpimparams.erpimageopt{:} varargin{index}, varargin{index+1} }; + end; + end; + end; + end; + end; +end; + +% scan clusters and channels to remove erpimdata info if timerange etc. have changed +% --------------------------------------------------------------------------------- +if ~isequal(STUDY.etc.erpimparams.timerange, TMPSTUDY.etc.erpimparams.timerange) | ... + ~isequal(STUDY.etc.erpimparams.trialrange, TMPSTUDY.etc.erpimparams.trialrange) + rmfields = { 'erpimdata' 'erpimtimes' 'erpimtrials' 'erpimevents' }; + for iField = 1:length(rmfields) + if isfield(STUDY.cluster, rmfields{iField}) + STUDY.cluster = rmfield(STUDY.cluster, rmfields{iField}); + end; + if isfield(STUDY.changrp, rmfields{iField}) + STUDY.changrp = rmfield(STUDY.changrp, rmfields{iField}); + end; + end; +end; + +function STUDY = default_params(STUDY) + if ~isfield(STUDY.etc, 'erpimparams'), STUDY.etc.erpimparams = []; end; + if ~isfield(STUDY.etc.erpimparams, 'erpimageopt'), STUDY.etc.erpimparams.erpimageopt = {}; end; + if ~isfield(STUDY.etc.erpimparams, 'sorttype' ), STUDY.etc.erpimparams.sorttype = ''; end; + if ~isfield(STUDY.etc.erpimparams, 'sortwin' ), STUDY.etc.erpimparams.sortwin = []; end; + if ~isfield(STUDY.etc.erpimparams, 'sortfield' ), STUDY.etc.erpimparams.sortfield = 'latency'; end; + + if ~isfield(STUDY.etc.erpimparams, 'rmcomps' ), STUDY.etc.erpimparams.rmcomps = []; end; + if ~isfield(STUDY.etc.erpimparams, 'interp' ), STUDY.etc.erpimparams.interp = []; end; + + if ~isfield(STUDY.etc.erpimparams, 'timerange' ), STUDY.etc.erpimparams.timerange = []; end; + if ~isfield(STUDY.etc.erpimparams, 'trialrange' ), STUDY.etc.erpimparams.trialrange = []; end; + if ~isfield(STUDY.etc.erpimparams, 'topotime' ), STUDY.etc.erpimparams.topotime = []; end; + if ~isfield(STUDY.etc.erpimparams, 'topotrial' ), STUDY.etc.erpimparams.topotrial = []; end; + if ~isfield(STUDY.etc.erpimparams, 'colorlimits'), STUDY.etc.erpimparams.colorlimits = []; end; + + if ~isfield(STUDY.etc.erpimparams, 'concatenate'), STUDY.etc.erpimparams.concatenate = 'off'; end; + if ~isfield(STUDY.etc.erpimparams, 'nlines'), STUDY.etc.erpimparams.nlines = 20; end; + if ~isfield(STUDY.etc.erpimparams, 'smoothing'), STUDY.etc.erpimparams.smoothing = 10; end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_erpparams.m b/code/eeglab13_4_4b/functions/studyfunc/pop_erpparams.m new file mode 100644 index 0000000..4883c16 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_erpparams.m @@ -0,0 +1,174 @@ +% pop_erpparams() - Set plotting and statistics parameters for cluster ERP +% plotting +% Usage: +% >> STUDY = pop_erpparams(STUDY, 'key', 'val'); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% +% Input: +% 'topotime' - [real] Plot ERP scalp maps at one specific latency (ms). +% A latency range [min max] may also be defined (the +% ERP is then averaged over the interval) {default: []} +% 'filter' - [real] low pass filter the ERP curves at a given +% frequency threshold. Default is no filtering. +% 'timerange' - [min max] ERP plotting latency range in ms. +% {default: the whole epoch} +% 'ylim' - [min max] ERP limits in microvolts {default: from data} +% 'plotgroups' - ['together'|'apart'] 'together' -> plot subject groups +% on the same axis in different colors, else ('apart') +% on different axes. {default: 'apart'} +% 'plotconditions' - ['together'|'apart'] 'together' -> plot conditions +% on the same axis in different colors, else ('apart') +% on different axes. Note: Keywords 'plotgroups' and +% 'plotconditions' may not both be set to 'together'. +% {default: 'together'} +% 'averagechan' - ['on'|'off'] average data channels when several are +% selected. +% +% See also: std_erpplot() +% +% Authors: Arnaud Delorme, CERCO, CNRS, 2006- + +% Copyright (C) Arnaud Delorme, 2006 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY, com ] = pop_erpparams(STUDY, varargin); + +STUDY = default_params(STUDY); +TMPSTUDY = STUDY; +com = ''; +if isempty(varargin) + + enablecond = fastif(length(STUDY.design(STUDY.currentdesign).variable(1).value)>1, 'on', 'off'); + enablegroup = fastif(length(STUDY.design(STUDY.currentdesign).variable(2).value)>1, 'on', 'off'); + plotconditions = fastif(strcmpi(STUDY.etc.erpparams.plotconditions, 'together'), 1, 0); + plotgroups = fastif(strcmpi(STUDY.etc.erpparams.plotgroups,'together'), 1, 0); + radio_averagechan = fastif(strcmpi(STUDY.etc.erpparams.averagechan,'on'), 1, 0); + radio_scalptopo = fastif(isempty(STUDY.etc.erpparams.topotime), 0, 1); + if radio_scalptopo, radio_averagechan = 0; end; + if radio_scalptopo+radio_averagechan == 0, radio_scalparray = 1; else radio_scalparray = 0; end; + + cb_radio = [ 'set(findobj(gcbf, ''userdata'', ''radio''), ''value'', 0);' ... + 'set(gcbo, ''value'', 1);' ... + 'set(findobj(gcbf, ''tag'', ''topotime''), ''string'', '''');' ]; + cb_edit = [ 'set(findobj(gcbf, ''userdata'', ''radio''), ''value'', 0);' ... + 'set(findobj(gcbf, ''tag'', ''scalptopotext''), ''value'', 1);' ]; + uilist = { ... + {'style' 'text' 'string' 'ERP plotting options' 'fontweight' 'bold' 'fontsize', 12} ... + {} {'style' 'text' 'string' 'Time limits (ms) [low high]' } ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpparams.timerange) 'tag' 'timerange' } ... + {} {'style' 'text' 'string' 'Plot limits [low high]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpparams.ylim) 'tag' 'ylim' } ... + {} {'style' 'text' 'string' 'Lowpass plotted data [Hz]' } ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpparams.filter) 'tag' 'filter' } ... + {} ... + {'style' 'text' 'string' 'ERP plotting format' 'fontweight' 'bold' 'fontsize', 12} ... + {} {'style' 'checkbox' 'string' 'Plot first variable on the same panel' 'value' plotconditions 'enable' enablecond 'tag' 'plotconditions' } ... + {} {'style' 'checkbox' 'string' 'Plot second variable on the same panel' 'value' plotgroups 'enable' enablegroup 'tag' 'plotgroups' } ... + {} ... + {'style' 'text' 'string' 'Multiple channels selection' 'fontweight' 'bold' 'tag', 'spec' 'fontsize', 12} ... + {} {'style' 'radio' 'string' 'Plot channels in scalp array' 'value' radio_scalparray 'tag' 'scalparray' 'userdata' 'radio' 'callback' cb_radio} { } ... + {} {'style' 'radio' 'string' 'Plot topography at time (ms)' 'value' radio_scalptopo 'tag' 'scalptopotext' 'userdata' 'radio' 'callback' cb_radio} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erpparams.topotime) 'tag' 'topotime' 'callback' cb_edit } ... + {} {'style' 'radio' 'string' 'Average selected channels' 'value' radio_averagechan 'tag' 'averagechan' 'userdata' 'radio' 'callback' cb_radio} { } }; + cbline = [0.07 1.1]; + otherline = [ 0.07 0.6 .3]; + chanline = [ 0.07 0.8 0.3]; + geometry = { 1 otherline otherline otherline 1 1 cbline cbline 1 1 chanline chanline chanline }; + geomvert = [1.2 1 1 1 0.5 1.2 1 1 0.5 1.2 1 1 1 ]; + + % component plotting + % ------------------ + if isnan(STUDY.etc.erpparams.topotime) + geometry(end-4:end) = []; + geomvert(end-4:end) = []; + uilist(end-10:end) = []; + end; + + [out_param userdat tmp res] = inputgui( 'geometry' , geometry, 'uilist', uilist, 'geomvert', geomvert, ... + 'title', 'ERP plotting options -- pop_erpparams()'); + if isempty(res), return; end; + + % decode inputs + % ------------- + %if res.plotgroups & res.plotconditions, warndlg2('Both conditions and group cannot be plotted on the same panel'); return; end; + if res.plotgroups, res.plotgroups = 'together'; else res.plotgroups = 'apart'; end; + if res.plotconditions , res.plotconditions = 'together'; else res.plotconditions = 'apart'; end; + if ~isfield(res, 'topotime'), res.topotime = STUDY.etc.erpparams.topotime; + else res.topotime = str2num( res.topotime ); + end; + res.timerange = str2num( res.timerange ); + res.ylim = str2num( res.ylim ); + res.filter = str2num( res.filter ); + if ~isfield(res, 'averagechan'), res.averagechan = STUDY.etc.erpparams.averagechan; + elseif res.averagechan, res.averagechan = 'on'; else res.averagechan = 'off'; + end; + + % build command call + % ------------------ + options = {}; + if ~strcmpi( char(res.filter), char(STUDY.etc.erpparams.filter)), options = { options{:} 'filter' res.filter }; end; + if ~strcmpi( res.plotgroups, STUDY.etc.erpparams.plotgroups), options = { options{:} 'plotgroups' res.plotgroups }; end; + if ~strcmpi( res.plotconditions , STUDY.etc.erpparams.plotconditions ), options = { options{:} 'plotconditions' res.plotconditions }; end; + if ~isequal(res.ylim , STUDY.etc.erpparams.ylim), options = { options{:} 'ylim' res.ylim }; end; + if ~isequal(res.timerange , STUDY.etc.erpparams.timerange) , options = { options{:} 'timerange' res.timerange }; end; + if ~isequal(res.averagechan, STUDY.etc.erpparams.averagechan), options = { options{:} 'averagechan' res.averagechan }; end; + if (all(isnan(res.topotime)) & all(~isnan(STUDY.etc.erpparams.topotime))) | ... + (all(~isnan(res.topotime)) & all(isnan(STUDY.etc.erpparams.topotime))) | ... + (all(~isnan(res.topotime)) & ~isequal(res.topotime, STUDY.etc.erpparams.topotime)) + options = { options{:} 'topotime' res.topotime }; + end; + if ~isempty(options) + STUDY = pop_erpparams(STUDY, options{:}); + com = sprintf('STUDY = pop_erpparams(STUDY, %s);', vararg2str( options )); + end; +else + if strcmpi(varargin{1}, 'default') + STUDY = default_params(STUDY); + else + for index = 1:2:length(varargin) + if ~isempty(strmatch(varargin{index}, fieldnames(STUDY.etc.erpparams), 'exact')) + STUDY.etc.erpparams = setfield(STUDY.etc.erpparams, varargin{index}, varargin{index+1}); + end; + end; + end; +end; + +% scan clusters and channels to remove erpdata info if timerange has changed +% ---------------------------------------------------------- +if ~isequal(STUDY.etc.erpparams.timerange, TMPSTUDY.etc.erpparams.timerange) + rmfields = { 'erpdata' 'erptimes' }; + for iField = 1:length(rmfields) + if isfield(STUDY.cluster, rmfields{iField}) + STUDY.cluster = rmfield(STUDY.cluster, rmfields{iField}); + end; + if isfield(STUDY.changrp, rmfields{iField}) + STUDY.changrp = rmfield(STUDY.changrp, rmfields{iField}); + end; + end; +end; + +function STUDY = default_params(STUDY) + if ~isfield(STUDY.etc, 'erpparams'), STUDY.etc.erpparams = []; end; + if ~isfield(STUDY.etc.erpparams, 'topotime'), STUDY.etc.erpparams.topotime = []; end; + if ~isfield(STUDY.etc.erpparams, 'filter'), STUDY.etc.erpparams.filter = []; end; + if ~isfield(STUDY.etc.erpparams, 'timerange'), STUDY.etc.erpparams.timerange = []; end; + if ~isfield(STUDY.etc.erpparams, 'ylim' ), STUDY.etc.erpparams.ylim = []; end; + if ~isfield(STUDY.etc.erpparams, 'plotgroups') , STUDY.etc.erpparams.plotgroups = 'apart'; end; + if ~isfield(STUDY.etc.erpparams, 'plotconditions') , STUDY.etc.erpparams.plotconditions = 'apart'; end; + if ~isfield(STUDY.etc.erpparams, 'averagechan') , STUDY.etc.erpparams.averagechan = 'off'; end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_erspparams.m b/code/eeglab13_4_4b/functions/studyfunc/pop_erspparams.m new file mode 100644 index 0000000..e972591 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_erspparams.m @@ -0,0 +1,156 @@ +% pop_erspparams() - Set plotting and statistics parameters for +% computing and plotting STUDY mean (and optionally +% single-trial) ERSP and ITC measures and measure +% statistics. Settings are stored within the STUDY +% structure (STUDY.etc.erspparams) which is used +% whenever plotting is performed by the function +% std_erspplot(). +% Usage: +% >> STUDY = pop_erspparams(STUDY, 'key', 'val', ...); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% +% ERSP/ITC image plotting options: +% 'timerange' - [min max] ERSP/ITC plotting latency range in ms. +% {default: the whole output latency range}. +% 'freqrange' - [min max] ERSP/ITC plotting frequency range in ms. +% {default: the whole output frequency range} +% 'ersplim' - [mindB maxdB] ERSP plotting limits in dB +% {default: from [ERSPmin,ERSPmax]} +% 'itclim' - [minitc maxitc] ITC plotting limits (range: [0,1]) +% {default: from [0,ITC data max]} +% 'topotime' - [float] plot scalp map at specific time. A time range may +% also be provide and the ERSP will be averaged over the +% given time range. Requires 'topofreq' below to be set. +% 'topofreq' - [float] plot scalp map at specific frequencies. As above +% a frequency range may also be provided. +% 'subbaseline' - ['on'|'off'] subtract the same baseline across conditions +% for ERSP (not ITC). When datasets with different conditions +% are recorded simultaneously, a common baseline spectrum +% should be used. Note that this also affects the +% results of statistics {default: 'on'} +% 'maskdata' - ['on'|'off'] when threshold is not NaN, and 'groupstats' +% or 'condstats' (above) are 'off', masks the data +% for significance. +% +% See also: std_erspplot(), std_itcplot() +% +% Authors: Arnaud Delorme, CERCO, CNRS, 2006- + +% Copyright (C) Arnaud Delorme, 2006 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY, com ] = pop_erspparams(STUDY, varargin); + +STUDY = default_params(STUDY); +TMPSTUDY = STUDY; +com = ''; +if isempty(varargin) + + subbaseline = fastif(strcmpi(STUDY.etc.erspparams.subbaseline,'on'), 1, 0); + vis = fastif(isnan(STUDY.etc.erspparams.topotime), 'off', 'on'); + + uilist = { ... + {'style' 'text' 'string' 'ERSP/ITC plotting options' 'fontweight' 'bold' 'tag', 'ersp' } ... + {'style' 'text' 'string' 'Time range in ms [Low High]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erspparams.timerange) 'tag' 'timerange' } ... + {'style' 'text' 'string' 'Plot scalp map at time [ms]' 'visible' vis} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erspparams.topotime) 'tag' 'topotime' 'visible' vis } ... + {'style' 'text' 'string' 'Freq. range in Hz [Low High]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erspparams.freqrange) 'tag' 'freqrange' } ... + {'style' 'text' 'string' 'Plot scalp map at freq. [Hz]' 'visible' vis} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erspparams.topofreq) 'tag' 'topofreq' 'visible' vis } ... + {'style' 'text' 'string' 'Power limits in dB [Low High]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erspparams.ersplim) 'tag' 'ersplim' } ... + {'style' 'text' 'string' 'ITC limit (0-1) [High]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.erspparams.itclim) 'tag' 'itclim' } ... + {} {'style' 'checkbox' 'string' 'Compute common ERSP baseline (assumes additive baseline)' 'value' subbaseline 'tag' 'subbaseline' } }; + evalstr = 'set(findobj(gcf, ''tag'', ''ersp''), ''fontsize'', 12);'; + cbline = [0.07 1.1]; + otherline = [ 0.6 .4 0.6 .4]; + geometry = { 1 otherline otherline otherline cbline }; + enablecond = fastif(length(STUDY.design(STUDY.currentdesign).variable(1).value)>1, 'on', 'off'); + enablegroup = fastif(length(STUDY.design(STUDY.currentdesign).variable(2).value)>1, 'on', 'off'); + + [out_param userdat tmp res] = inputgui( 'geometry' , geometry, 'uilist', uilist, 'skipline', 'off', ... + 'title', 'Set ERSP/ITC plotting parameters -- pop_erspparams()', 'eval', evalstr); + if isempty(res), return; end; + + % decode input + % ------------ + if res.subbaseline, res.subbaseline = 'on'; else res.subbaseline = 'off'; end; + res.topotime = str2num( res.topotime ); + res.topofreq = str2num( res.topofreq ); + res.timerange = str2num( res.timerange ); + res.freqrange = str2num( res.freqrange ); + res.ersplim = str2num( res.ersplim ); + res.itclim = str2num( res.itclim ); + + % build command call + % ------------------ + options = {}; + if ~strcmpi( res.subbaseline , STUDY.etc.erspparams.subbaseline ), options = { options{:} 'subbaseline' res.subbaseline }; end; + if ~isequal(res.topotime , STUDY.etc.erspparams.topotime), options = { options{:} 'topotime' res.topotime }; end; + if ~isequal(res.topofreq , STUDY.etc.erspparams.topofreq), options = { options{:} 'topofreq' res.topofreq }; end; + if ~isequal(res.ersplim , STUDY.etc.erspparams.ersplim), options = { options{:} 'ersplim' res.ersplim }; end; + if ~isequal(res.itclim , STUDY.etc.erspparams.itclim), options = { options{:} 'itclim' res.itclim }; end; + if ~isequal(res.timerange, STUDY.etc.erspparams.timerange), options = { options{:} 'timerange' res.timerange }; end; + if ~isequal(res.freqrange, STUDY.etc.erspparams.freqrange), options = { options{:} 'freqrange' res.freqrange }; end; + if ~isempty(options) + STUDY = pop_erspparams(STUDY, options{:}); + com = sprintf('STUDY = pop_erspparams(STUDY, %s);', vararg2str( options )); + end; +else + if strcmpi(varargin{1}, 'default') + STUDY = default_params(STUDY); + else + for index = 1:2:length(varargin) + if ~isempty(strmatch(varargin{index}, fieldnames(STUDY.etc.erspparams), 'exact')) + STUDY.etc.erspparams = setfield(STUDY.etc.erspparams, varargin{index}, varargin{index+1}); + end; + end; + end; +end; + +% scan clusters and channels to remove erspdata info if timerange etc. have changed +% --------------------------------------------------------------------------------- +if ~isequal(STUDY.etc.erspparams.timerange, TMPSTUDY.etc.erspparams.timerange) | ... + ~isequal(STUDY.etc.erspparams.freqrange, TMPSTUDY.etc.erspparams.freqrange) | ... + ~isequal(STUDY.etc.erspparams.subbaseline, TMPSTUDY.etc.erspparams.subbaseline) + rmfields = { 'erspdata' 'ersptimes' 'erspfreqs' 'erspbase' 'erspdatatrials' 'ersptimes' 'erspfreqs' 'erspsubjinds' 'ersptrialinfo' ... + 'itcdata' 'itctimes' 'itcfreqs' 'itcdatatrials' 'itctimes' 'itcfreqs' 'itcsubjinds' 'itctrialinfo' }; + for iField = 1:length(rmfields) + if isfield(STUDY.cluster, rmfields{iField}) + STUDY.cluster = rmfield(STUDY.cluster, rmfields{iField}); + end; + if isfield(STUDY.changrp, rmfields{iField}) + STUDY.changrp = rmfield(STUDY.changrp, rmfields{iField}); + end; + end; +end; + +function STUDY = default_params(STUDY) + if ~isfield(STUDY.etc, 'erspparams'), STUDY.etc.erspparams = []; end; + if ~isfield(STUDY.etc.erspparams, 'topotime'), STUDY.etc.erspparams.topotime = []; end; + if ~isfield(STUDY.etc.erspparams, 'topofreq'), STUDY.etc.erspparams.topofreq = []; end; + if ~isfield(STUDY.etc.erspparams, 'timerange'), STUDY.etc.erspparams.timerange = []; end; + if ~isfield(STUDY.etc.erspparams, 'freqrange'), STUDY.etc.erspparams.freqrange = []; end; + if ~isfield(STUDY.etc.erspparams, 'ersplim' ), STUDY.etc.erspparams.ersplim = []; end; + if ~isfield(STUDY.etc.erspparams, 'itclim' ), STUDY.etc.erspparams.itclim = []; end; + if ~isfield(STUDY.etc.erspparams, 'maskdata' ), STUDY.etc.erspparams.maskdata = 'off'; end; %deprecated + if ~isfield(STUDY.etc.erspparams, 'subbaseline' ), STUDY.etc.erspparams.subbaseline = 'off'; end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_loadstudy.m b/code/eeglab13_4_4b/functions/studyfunc/pop_loadstudy.m new file mode 100644 index 0000000..cae06eb --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_loadstudy.m @@ -0,0 +1,171 @@ +% pop_loadstudy() - load an existing EEGLAB STUDY set of EEG datasets plus +% its corresponding ALLEEG structure. Calls std_loadalleeg(). +% Usage: +% >> [STUDY ALLEEG] = pop_loadstudy; % pop up a window to collect filename +% >> [STUDY ALLEEG] = pop_loadstudy( 'key', 'val', ...); % no pop-up +% +% Optional inputs: +% 'filename' - [string] filename of the STUDY set file to load. +% 'filepath' - [string] filepath of the STUDY set file to load. +% +% Outputs: +% STUDY - the requested STUDY set structure. +% ALLEEG - the corresponding ALLEEG structure containing +% the (loaded) STUDY EEG datasets. +% +% See also: std_loadalleeg(), pop_savestudy() +% +% Authors: Hilit Serby & Arnaud Delorme, SCCN, INC, UCSD, September 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, Spetember 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Coding notes: Useful information on functions and global variables used. + + +function [STUDY, ALLEEG, com] = pop_loadstudy(varargin) + +STUDY = []; +ALLEEG = []; +com = ''; +if isempty(varargin) + [filename, filepath] = uigetfile2('*.study', 'Load a STUDY -- pop_loadstudy()'); + if filename(1) == 0, return; end; + if ~strncmp(filename(end-5:end), '.study',6) + if isempty(strfind(filename,'.')) + filename = [filename '.study']; + else + filename = [filename(1:strfind(filename,'.')-1) '.study']; + end + end +else + filepath = ''; + if nargin == 1 + varargin = { 'filename' varargin{:} }; + end; + for k = 1:2:length(varargin) + switch varargin{k} + case 'filename' + filename = varargin{k+1}; + case 'filepath' + filepath = varargin{k+1}; + end + end +end + +if ~isempty(filename) + STUDYfile = fullfile(filepath,filename); + try + load('-mat', STUDYfile); + catch + error(['pop_loadstudy(): STUDY set file ''STUDYfile'' not loaded -- check filename and path']); + end + [filepath filename ext] = fileparts(STUDYfile); + STUDY.filename = [filename ext]; + STUDY.etc.oldfilepath = STUDY.filepath; + STUDY.filepath = filepath; +else + error(['pop_loadstudy(): No STUDY set file provided.']); +end + +ALLEEG = std_loadalleeg(STUDY); + +% Update the pointers from STUDY to the ALLEEG datasets +for k = 1:length(STUDY.datasetinfo) + STUDY.datasetinfo(k).index = k; + STUDY.datasetinfo(k).filename = ALLEEG(k).filename; + STUDY.datasetinfo(k).filepath = ALLEEG(k).filepath; +end + +if ~isfield(STUDY, 'changrp'), STUDY.changrp = []; end; +[STUDY ALLEEG] = std_checkset(STUDY, ALLEEG); + +if ~isfield(STUDY, 'changrp') || isempty(STUDY.changrp) + if std_uniformfiles(STUDY, ALLEEG) == 0 + STUDY = std_changroup(STUDY, ALLEEG); + else STUDY = std_changroup(STUDY, ALLEEG, [], 'interp'); + end; +end; + +% Update the design path +for inddes = 1:length(STUDY.design) + for indcell = 1:length(STUDY.design(inddes).cell) + pathname = STUDY.datasetinfo(STUDY.design(inddes).cell(indcell).dataset(1)).filepath; + filebase = STUDY.design(inddes).cell(indcell).filebase; + tmpinds1 = find(filebase == '/'); + tmpinds2 = find(filebase == '\'); + if ~isempty(tmpinds1) + STUDY.design(inddes).cell(indcell).filebase = fullfile(pathname, filebase(tmpinds1(end)+1:end)); + elseif ~isempty(tmpinds2) + STUDY.design(inddes).cell(indcell).filebase = fullfile(pathname, filebase(tmpinds2(end)+1:end)); + else STUDY.design(inddes).cell(indcell).filebase = fullfile(pathname, filebase ); + end; + end; +end; + +% check for corrupted ERSP ICA data files +% A corrupted file is present if +% - components have been selected +% - .icaersp or .icaitc files are present +% - the .trialindices field is missing from these files +try + %% check for corrupted ERSP ICA data files + ncomps1 = cellfun(@length, { STUDY.datasetinfo.comps }); + ncomps2 = cellfun(@(x)(size(x,1)), { ALLEEG.icaweights }); + if any(~isempty(ncomps1)) + if any(ncomps1 ~= ncomps2) + warningshown = 0; + + for des = 1:length(STUDY.design) + for iCell = 1:length(STUDY.design(des).cell) + if ~warningshown + if exist( [ STUDY.design(des).cell(iCell).filebase '.icaersp' ] ) + warning('off', 'MATLAB:load:variableNotFound'); + tmp = load('-mat', [ STUDY.design(des).cell(iCell).filebase '.icaersp' ], 'trialindices'); + warning('on', 'MATLAB:load:variableNotFound'); + if ~isfield(tmp, 'trialindices') + warningshown = 1; + warndlg( [ 'Warning: ICA ERSP or ITC data files computed with old version of EEGLAB for design ' int2str(des) 10 ... + '(and maybe other designs). These files may be corrupted and must be recomputed.' ], 'Important EEGLAB warning', 'nonmodal'); + end; + end; + if warningshown == 0 && exist( [ STUDY.design(des).cell(iCell).filebase '.icaitc' ] ) + tmp = load('-mat', [ STUDY.design(des).cell(iCell).filebase '.icaersp' ], 'trialindices'); + if ~isfield(tmp, 'trialindices') + warningshown = 1; + warndlg( [ 'Warning: ICA ERSP or ITC data files computed with old version of EEGLAB for design ' int2str(des) 10 ... + '(and maybe other designs). These files may be corrupted and must be recomputed.' ], 'Important EEGLAB warning', 'modal'); + end; + end; + end; + end; + end; + end; + end; +catch, + disp('Warning: failed to test STUDY file version'); +end; + +TMP = STUDY.datasetinfo; +STUDY = std_maketrialinfo(STUDY, ALLEEG); +if ~isequal(STUDY.datasetinfo, TMP) + disp('STUDY Warning: the trial information collected from datasets has changed'); +end; +std_checkfiles(STUDY, ALLEEG); +STUDY.saved = 'yes'; +STUDY = std_selectdesign(STUDY, ALLEEG, STUDY.currentdesign); + +com = sprintf('[STUDY ALLEEG] = pop_loadstudy(''filename'', ''%s'', ''filepath'', ''%s'');', STUDY.filename, STUDY.filepath); diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_preclust.m b/code/eeglab13_4_4b/functions/studyfunc/pop_preclust.m new file mode 100644 index 0000000..9bf6a8a --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_preclust.m @@ -0,0 +1,565 @@ +% pop_preclust() - prepare STUDY components' location and activity measures for later clustering. +% Collect information in an interactive pop-up query window. To pre-cluster +% from the commandline, use std_preclust(). After data entry into the pop window, +% selected measures (one or more from options: ERP, dipole locations, spectra, +% scalp maps, ERSP, and ITC) are computed for each dataset in the STUDY +% set, unless they already present. After all requested measures are computed +% and saved in the STUDY datasets, a PCA matrix (by runica() with 'pca' option) +% is constructed (this is the feature reduction step). This matrix will be used +% as input to the clustering algorithm in pop_clust(). pop_preclust() allows +% selection of a subset of components to cluster. This subset may either be +% user-specified, all components with dipole model residual variance lower than +% a defined threshold (see dipfit()), or components from an already existing cluster +% (for hierarchical clustering). The EEG datasets in the ALLEEG structure are +% updated; then the updated EEG sets are saved to disk. Calls std_preclust(). +% Usage: +% >> [STUDY, ALLEEG] = pop_preclust(STUDY, ALLEEG); % pop up interactive window +% >> [STUDY, ALLEEG] = pop_preclust(STUDY, ALLEEG, clustind); % sub-cluster +% +% Inputs: +% STUDY - STUDY set structure containing (loaded) EEG dataset structures +% ALLEEG - ALLEEG vector of EEG structures, else a single EEG dataset. +% clustind - (single) cluster index to sub-cluster, Hhierarchical clustering may be +% useful, for example, to separate a bilteral cluster into left and right +% hemisphere sub-clusters. Should be empty for whole STUDY (top level) clustering +% {default: []} +% Outputs: +% STUDY - the input STUDY set with added pre-clustering data for use by pop_clust() +% ALLEEG - the input ALLEEG vector of EEG dataset structures modified by adding +% pre-clustering data (pointers to .mat files that hold cluster measure information). +% +% Authors: Arnaud Delorme, Hilit Serby & Scott Makeig, SCCN, INC, UCSD, May 13, 2004- +% +% See also: std_preclust() + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, May 13,2004, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, ALLEEG, com] = pop_preclust(varargin) + +com = ''; + +if ~isstr(varargin{1}) %intial settings + if length(varargin) < 2 + error('pop_preclust(): needs both ALLEEG and STUDY structures'); + end + STUDY = varargin{1}; + ALLEEG = varargin{2}; + if length(varargin) >= 3 + if length(varargin{3}) > 1 + error('pop_preclust(): To cluster components from several clusters, merge them first!'); + end + cluster_ind = varargin{3}; + else + cluster_ind = []; + end + + scalp_options = {'Use channel values' 'Use Laplacian values' 'Use Gradient values'} ; + + if isempty(ALLEEG) + error('STUDY contains no datasets'); + end + + if any(isnan(STUDY.cluster(1).sets(:))) + warndlg2( [ 'FOR CLUSTERING, YOU MAY ONLY USE DIPOLE OR SCALP MAP CLUSTERING.' 10 ... + 'This is because some datasets do not have ICA pairs. Look for NaN values in ' 10 ... + 'STUDY.cluster(1).sets which indicate missing datasets. Each column in this ' 10 ... + 'array indicate datasets with common ICA decompositions' ]); + end; + if length(STUDY.design(STUDY.currentdesign).cases.value) ~= length(STUDY.subject) + warndlg2( [ 'GO BACK TO THE DESIGN INTERFACE AND SELECT A DESIGN THAT ' 10 ... + 'INCLUDES ALL DATASETS. Some subjects or datasets have been excluded' 10 ... + 'in the current design. ICA clusters are common to all designs, so all' 10 ... + 'all datasets must be included for clustering. After clustering, you' 10 ... + 'will then be able to select a different design (and keep the clustered' 10 ... + 'components) if you wish to exclude a subject or group of dataset.' ]); + return; + end + + % cluster text + % ------------ + % load leaf clusters + num_cls = 0; + cls = 1:length(STUDY.cluster); + N = length(cls); %number of clusters + + show_options{1} = [STUDY.cluster(1).name ' (' num2str(length(STUDY.cluster(1).comps)) ' ICs)']; + cls(1) = 1; + count = 2; + for index1 = 1:length(STUDY.cluster(1).child) + + indclust1 = strmatch( STUDY.cluster(1).child(index1), { STUDY.cluster.name }, 'exact'); + show_options{count} = [' ' STUDY.cluster(indclust1).name ' (' num2str(length(STUDY.cluster(indclust1).comps)) ' ICs)']; + cls(count) = indclust1; + count = count+1; + + for index2 = 1:length( STUDY.cluster(indclust1).child ) + indclust2 = strmatch( STUDY.cluster(indclust1).child(index2), { STUDY.cluster.name }, 'exact'); + show_options{count} = [' ' STUDY.cluster(indclust2).name ' (' num2str(length(STUDY.cluster(indclust2).comps)) ' ICs)']; + cls(count) = indclust2; + count = count+1; + + for index3 = 1:length( STUDY.cluster(indclust2).child ) + indclust3 = strmatch( STUDY.cluster(indclust2).child(index3), { STUDY.cluster.name }, 'exact'); + show_options{count} = [' ' STUDY.cluster(indclust3).name ' (' num2str(length(STUDY.cluster(indclust3).comps)) ' ICs)']; + cls(count) = indclust3; + count = count+1; + end; + end; + end; + + % callbacks + % --------- + erspparams_str = [ '''cycles'', [3 0.5], ''padratio'', 1' ]; + specparams_str = ''; + show_clust = [ 'pop_preclust(''showclust'',gcf);']; + show_comps = [ 'pop_preclust(''showcomplist'',gcf);']; + help_spectopo = ['pophelp(''spectopo'')']; + set_spectra = ['pop_preclust(''setspec'',gcf);']; + set_erp = ['pop_preclust(''seterp'',gcf);']; + set_scalp = ['pop_preclust(''setscalp'',gcf);']; + set_dipole = ['pop_preclust(''setdipole'',gcf);']; + set_ersp = ['pop_preclust(''setersp'',gcf);']; + set_itc = ['pop_preclust(''setitc'',gcf);']; + set_secpca = ['pop_preclust(''setsec'',gcf);']; + + set_mpcluster = ['tmp_preclust(''mpcluster'',gcf);']; % nima + + help_clusteron = ['pophelp(''std_helpselecton'');']; + help_ersp = ['pophelp(''pop_timef'')']; + preclust_PCA = ['pop_preclust(''preclustOK'',gcf);']; + ersp_params = ['pop_preclust(''erspparams'',gcf);']; + ersp_edit = ['pop_preclust(''erspedit'',gcf);']; + test_ersp = ['pop_precomp(''testersp'',gcf);']; + itc_edit = 'set(findobj(gcbf, ''tag'', ''ersp_params''), ''string'', get(gcbo, ''string''));'; + ersp_edit = 'set(findobj(gcbf, ''tag'', ''itc_params'' ), ''string'', get(gcbo, ''string''));'; + + saveSTUDY = [ 'set(findobj(''parent'', gcbf, ''userdata'', ''save''), ''enable'', fastif(get(gcbo, ''value'')==1, ''on'', ''off''));' ]; + browsesave = [ '[filename, filepath] = uiputfile2(''*.study'', ''Save STUDY with .study extension -- pop_preclust()''); ' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''studyfile''), ''string'', [filepath filename]);' ]; + str_name = ['Build pre-clustering matrix for STUDY set: ' STUDY.name '' ]; + str_time = ''; + help_secpca = [ 'warndlg2(strvcat(''This is the final number of dimensions (otherwise use the sum'',' ... + '''of dimensions for all the selected options). See tutorial for more info''), ''Final number of dimensions'');' ]; + + gui_spec = { ... + {'style' 'text' 'string' str_name 'FontWeight' 'Bold' 'horizontalalignment' 'left'} ... + {'style' 'text' 'string' 'Select the cluster to refine by sub-clustering (any existing sub-hierarchy will be overwritten)' } {} ... + {'style' 'listbox' 'string' show_options 'value' 1 'tag' 'clus_list' 'Callback' show_clust 'max' 1 } {} {} ... + {'style' 'text' 'string' 'Note: Only measures that have been precomputed may be used for clustering.'} ... + {'style' 'text' 'string' 'Measures Dims. Norm. Rel. Wt.' 'FontWeight' 'Bold'} ... + {'style' 'checkbox' 'string' '' 'tag' 'spectra_on' 'value' 0 'Callback' set_spectra 'userdata' '1'} ... + {'style' 'text' 'string' 'spectra' 'horizontalalignment' 'center' } ... + {'style' 'edit' 'string' '10' 'tag' 'spectra_PCA' 'enable' 'off' 'userdata' 'specP'} ... + {'style' 'checkbox' 'string' '' 'tag' 'spectra_norm' 'value' 1 'enable' 'off' 'userdata' 'specP' } ... + {'style' 'edit' 'string' '1' 'tag' 'spectra_weight' 'enable' 'off' 'userdata' 'specP'} ... + {'style' 'text' 'string' 'Freq.range [Hz]' 'tag' 'spectra_freq_txt' 'userdata' 'spec' 'enable' 'off' } ... + {'style' 'edit' 'string' '3 25' 'tag' 'spectra_freq_edit' 'userdata' 'spec' 'enable' 'off' } { } { } ... + {'style' 'checkbox' 'string' '' 'tag' 'erp_on' 'value' 0 'Callback' set_erp 'userdata' '1'} ... + {'style' 'text' 'string' 'ERPs' 'horizontalalignment' 'center' } ... + {'style' 'edit' 'string' '10' 'tag' 'erp_PCA' 'enable' 'off' 'userdata' 'erpP'} ... + {'style' 'checkbox' 'string' '' 'tag' 'erp_norm' 'value' 1 'enable' 'off' 'userdata' 'erpP' } ... + {'style' 'edit' 'string' '1' 'tag' 'erp_weight' 'enable' 'off' 'userdata' 'erpP'} ... + {'style' 'text' 'string' 'Time range [ms]' 'tag' 'erp_time_txt' 'userdata' 'erp' 'enable' 'off' } ... + {'style' 'edit' 'string' str_time 'tag' 'erp_time_edit' 'userdata' 'erp' 'enable' 'off' } { } { }... + {'style' 'checkbox' 'string' '' 'tag' 'dipole_on' 'value' 0 'Callback' set_dipole 'userdata' '1'} ... + {'style' 'text' 'string' 'dipoles' 'HorizontalAlignment' 'center' } ... + {'style' 'text' 'string' '3' 'enable' 'off' 'userdata' 'dipoleP' } ... + {'style' 'checkbox' 'string' '' 'tag' 'locations_norm' 'value' 1 'enable' 'off' 'userdata' 'dipoleP'} ... + {'style' 'edit' 'string' '10' 'tag' 'locations_weight' 'enable' 'off' 'userdata' 'dipoleP'} {} {} {} {} ... + {'style' 'checkbox' 'string' '' 'tag' 'scalp_on' 'value' 0 'Callback' set_scalp 'userdata' '1'} ... + {'style' 'text' 'string' 'scalp maps' 'HorizontalAlignment' 'center' } ... + {'style' 'edit' 'string' '10' 'tag' 'scalp_PCA' 'enable' 'off' 'userdata' 'scalpP'} ... + {'style' 'checkbox' 'string' '' 'tag' 'scalp_norm' 'value' 1 'enable' 'off' 'userdata' 'scalpP'} ... + {'style' 'edit' 'string' '1' 'tag' 'scalp_weight' 'enable' 'off' 'userdata' 'scalpP'} ... + {'style' 'popupmenu' 'string' scalp_options 'value' 1 'tag' 'scalp_choice' 'enable' 'off' 'userdata' 'scalp' } {} ... + {'style' 'checkbox' 'string' 'Absolute values' 'value' 1 'tag' 'scalp_absolute' 'enable' 'off' 'userdata' 'scalp' } {} ... + {'style' 'checkbox' 'string' '' 'tag' 'ersp_on' 'value' 0 'Callback' set_ersp 'userdata' '1'} ... + {'style' 'text' 'string' 'ERSPs' 'horizontalalignment' 'center' } ... + {'style' 'edit' 'string' '10' 'tag' 'ersp_PCA' 'enable' 'off' 'userdata' 'erspP'} ... + {'style' 'checkbox' 'string' '' 'tag' 'ersp_norm' 'value' 1 'enable' 'off' 'userdata' 'erspP'} ... + {'style' 'edit' 'string' '1' 'tag' 'ersp_weight' 'enable' 'off' 'userdata' 'erspP'} ... + {'style' 'text' 'string' 'Time range [ms]' 'tag' 'ersp_time_txt' 'userdata' 'ersp' 'enable' 'off' } ... + {'style' 'edit' 'string' str_time 'tag' 'ersp_time_edit' 'userdata' 'ersp' 'enable' 'off' } ... + {'style' 'text' 'string' 'Freq. range [Hz]' 'tag' 'ersp_time_txt' 'userdata' 'ersp' 'enable' 'off' } ... + {'style' 'edit' 'string' str_time 'tag' 'ersp_freq_edit' 'userdata' 'ersp' 'enable' 'off' } ... + {'style' 'checkbox' 'string' '' 'tag' 'itc_on' 'value' 0 'Callback' set_itc 'userdata' '1'} ... + {'style' 'text' 'string' 'ITCs' 'horizontalalignment' 'center' } ... + {'style' 'edit' 'string' '10' 'tag' 'itc_PCA' 'enable' 'off' 'userdata' 'itcP'} ... + {'style' 'checkbox' 'string' '' 'tag' 'itc_norm' 'value' 1 'enable' 'off' 'userdata' 'itcP'} ... + {'style' 'edit' 'string' '1' 'tag' 'itc_weight' 'enable' 'off' 'userdata' 'itcP'} ... + {'style' 'text' 'string' 'Time range [ms]' 'tag' 'itc_time_txt' 'userdata' 'itcP' 'enable' 'off' } ... + {'style' 'edit' 'string' str_time 'tag' 'itc_time_edit' 'userdata' 'itcP' 'enable' 'off' } ... + {'style' 'text' 'string' 'Freq. range [Hz]' 'tag' 'itc_time_txt' 'userdata' 'itcP' 'enable' 'off' } ... + {'style' 'edit' 'string' str_time 'tag' 'itc_freq_edit' 'userdata' 'itcP' 'enable' 'off' } ... + {} ... + {'style' 'checkbox' 'string' '' 'tag' 'sec_on' 'Callback' set_secpca 'value' 0} ... + {'style' 'text' 'string' 'Final dimensions' } ... + {'style' 'edit' 'string' '10' 'enable' 'off' 'tag' 'sec_PCA' 'userdata' 'sec' } ... + {} {'style' 'pushbutton' 'string' 'Help' 'tag' 'finalDimHelp' 'callback' help_secpca } {} {} {} {} }; + + +% {'link2lines' 'style' 'text' 'string' '' } {} {} {} ... +% {'style' 'text' 'string' 'Time/freq. parameters' 'tag' 'ersp_push' 'value' 1 'enable' 'off' 'userdata' 'ersp' 'Callback' ersp_params} ... +% {'style' 'edit' 'string' erspparams_str 'tag' 'ersp_params' 'enable' 'off' 'userdata' 'ersp' 'Callback' ersp_edit}... +% {'style' 'text' 'string' 'Time/freq. parameters' 'tag' 'itc_push' 'value' 1 'enable' 'off' 'userdata' 'itc' 'Callback' ersp_params} ... +% {'style' 'edit' 'string' erspparams_str 'tag' 'itc_params' 'enable' 'off' 'userdata' 'itc' 'Callback' itc_edit}% {'style' 'checkbox' 'string' '' 'tag' 'preclust_PCA' 'Callback' preclust_PCA 'value' 0} ... +% {'style' 'text' 'string' 'Do not prepare dataset for clustering at this time.' 'FontWeight' 'Bold' } {} ... + + fig_arg{1} = { ALLEEG STUDY cls }; + geomline = [0.5 2 1 0.5 1 2 1 2 1 ]; + geometry = { [1] [1] [1 1 1] [1] [1] ... + [3] geomline geomline geomline [0.5 2 1 0.5 1 2.9 .1 2.9 .1 ] geomline geomline [1] geomline }; + geomvert = [ 1 1 3 1 1 1 1 1 1 1 1 1 0.5 1 ]; + + %if length(show_options) < 3 + % gui_spec(2:6) = { {} ... + % { 'style' 'text' 'string' [ 'Among the pre-selected components (Edit study),' ... + % 'remove those which dipole res. var, exceed' ] 'tag' 'dipole_select_on' } ... + % {'style' 'edit' 'string' '0.15' 'horizontalalignment' 'center' 'tag' 'dipole_rv'} ... + % {'style' 'text' 'string' '(empty=all)'} {} }; + % geometry{3} = [2.5 0.25 0.4]; + % geomvert(3) = 1; + %end; + + [preclust_param, userdat2, strhalt, os] = inputgui( 'geometry', geometry, 'uilist', gui_spec, 'geomvert', geomvert, ... + 'helpcom', ' pophelp(''std_preclust'')', ... + 'title', 'Select and compute component measures for later clustering -- pop_preclust()', ... + 'userdata', fig_arg); + if isempty(preclust_param), return; end; + + options = { STUDY, ALLEEG }; + + % precluster on what? + % ------------------- + options{3} = cls(os.clus_list); % hierarchical clustering + + %if ~(os.preclust_PCA) %create PCA data for clustering + %preclust_command = '[STUDY ALLEEG] = eeg_createdata(STUDY, ALLEEG, '; + %end + + % Spectrum option is on + % -------------------- + if os.spectra_on== 1 + options{end+1} = { 'spec' 'npca' str2num(os.spectra_PCA) 'norm' os.spectra_norm ... + 'weight' str2num(os.spectra_weight) 'freqrange' str2num(os.spectra_freq_edit) }; + end + + % ERP option is on + % ---------------- + if os.erp_on == 1 + options{end+1} = { 'erp' 'npca' str2num(os.erp_PCA) 'norm' os.erp_norm ... + 'weight' str2num(os.erp_weight) 'timewindow' str2num(os.erp_time_edit) }; + end + + % Scalp maps option is on + % ---------------------- + if os.scalp_on == 1 + if os.scalp_absolute %absolute maps + abso = 1; + else abso = 0; + end + if (os.scalp_choice == 2) %Laplacian scalp maps + options{end+1} = { 'scalpLaplac' 'npca' str2num(os.scalp_PCA) 'norm' os.scalp_norm ... + 'weight' str2num(os.scalp_weight) 'abso' abso }; + elseif (os.scalp_choice == 3) %Gradient scalp maps + options{end+1} = { 'scalpGrad' 'npca' str2num(os.scalp_PCA) 'norm' os.scalp_norm, ... + 'weight' str2num(os.scalp_weight) 'abso' abso }; + elseif (os.scalp_choice == 1) %scalp map case + options{end+1} = { 'scalp' 'npca' str2num(os.scalp_PCA) 'norm' os.scalp_norm, ... + 'weight' str2num(os.scalp_weight) 'abso' abso }; + end + end + + % Dipole option is on + % ------------------- + if os.dipole_on == 1 + options{end+1} = { 'dipoles' 'norm' os.locations_norm 'weight' str2num(os.locations_weight) }; + end + + % ERSP option is on + % ----------------- + if os.ersp_on == 1 + options{end+1} = { 'ersp' 'npca' str2num(os.ersp_PCA) 'freqrange' str2num(os.ersp_freq_edit) ... + 'timewindow' str2num(os.ersp_time_edit) 'norm' os.ersp_norm 'weight' str2num(os.ersp_weight) }; + end + + % ITC option is on + % ---------------- + if os.itc_on == 1 + options{end+1} = { 'itc' 'npca' str2num(os.itc_PCA) 'freqrange' str2num(os.itc_freq_edit) 'timewindow' ... + str2num(os.itc_time_edit) 'norm' os.itc_norm 'weight' str2num(os.itc_weight) }; + end + + % ERSP option is on + % ----------------- + if os.sec_on == 1 + options{end+1} = { 'finaldim' 'npca' str2num(os.sec_PCA) }; + end + + % evaluate command + % ---------------- + if length(options) == 3 + warndlg2('No measure selected: aborting.'); + return; + end; + + [STUDY ALLEEG] = std_preclust(options{:}); + com = sprintf('[STUDY ALLEEG] = std_preclust(STUDY, ALLEEG, %s);', vararg2str(options(3:end))); + + % save updated STUDY to the disk + % ------------------------------ +% if os.saveSTUDY == 1 +% if ~isempty(os.studyfile) +% [filepath filename ext] = fileparts(os.studyfile); +% STUDY.filename = [ filename ext ]; +% STUDY.filepath = filepath; +% end; +% STUDY = pop_savestudy(STUDY, ALLEEG, 'filename', STUDY.filename, 'filepath', STUDY.filepath); +% com = sprintf('%s\nSTUDY = pop_savestudy(STUDY, ALLEEG, %s);', com, ... +% vararg2str( { 'filename', STUDY.filename, 'filepath', STUDY.filepath })); +% end +else + hdl = varargin{2}; %figure handle + userdat = get(varargin{2}, 'userdat'); + ALLEEG = userdat{1}{1}; + STUDY = userdat{1}{2}; + cls = userdat{1}{3}; + N = length(cls); + + switch varargin{1} + + case 'setspec' + set_spec = get(findobj('parent', hdl, 'tag', 'spectra_on'), 'value'); + set(findobj('parent', hdl, 'userdata', 'spec'), 'enable', fastif(set_spec,'on','off')); + PCA_on = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); + if PCA_on + set(findobj('parent', hdl, 'userdata', 'specP'), 'enable', 'off'); + else + set(findobj('parent', hdl, 'userdata', 'specP'), 'enable', fastif(set_spec,'on','off')); + end + + case 'mpcluster' % nima + mpclust = get(findobj('parent', hdl, 'tag', 'mpclust'), 'value'); + if mpclust + set(findobj('parent', hdl, 'tag', 'spectra_PCA'), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'spectra_norm'), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'spectra_weight'), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'erp_PCA' ), 'visible','off'); + set(findobj('parent', hdl, 'tag','erp_norm' ), 'visible','off'); + set(findobj('parent', hdl, 'tag','erp_weight' ), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'locations_norm' ), 'visible','off'); + set(findobj('parent', hdl, 'tag','locations_weight'), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'scalp_PCA'), 'visible','off'); + set(findobj('parent', hdl, 'tag','scalp_norm' ), 'visible','off'); + set(findobj('parent', hdl, 'tag','scalp_weight'), 'visible','off'); + set(findobj('parent', hdl, 'tag','ersp_PCA'), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'ersp_norm'), 'visible','off'); + set(findobj('parent', hdl, 'tag','ersp_weight' ), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'itc_PCA'), 'visible','off'); + set(findobj('parent', hdl, 'tag','itc_norm'), 'visible','off'); + set(findobj('parent', hdl, 'tag','itc_weight'), 'visible','off'); + + + set(findobj('parent', hdl, 'tag','sec_PCA'), 'visible','off'); + set(findobj('parent', hdl, 'tag','sec_on'), 'visible','off'); + set(findobj('parent', hdl, 'userdata' ,'dipoleP'), 'visible','off'); + set(findobj('parent', hdl, 'string','Final dimensions'), 'visible','off'); + set(findobj('parent', hdl, 'tag','finalDimHelp' ), 'visible','off'); + set(findobj('parent', hdl, 'tag','spectra_freq_txt'), 'visible','off'); + set(findobj('parent', hdl, 'tag','spectra_freq_edit'), 'visible','off'); + + %% these are made invisible for now, but in future we might use them in the new method + set(findobj('parent', hdl, 'tag','erp_time_txt'), 'visible','off'); + set(findobj('parent', hdl, 'tag','erp_time_edit'), 'visible','off'); + set(findobj('parent', hdl, 'tag','scalp_choice'), 'visible','off'); + set(findobj('parent', hdl, 'tag', 'scalp_absolute'), 'visible','off'); + set(findobj('parent', hdl, 'tag','ersp_time_txt'), 'visible','off'); + set(findobj('parent', hdl, 'tag','ersp_time_edit'), 'visible','off'); + set(findobj('parent', hdl, 'tag','ersp_freq_edit'), 'visible','off'); + set(findobj('parent', hdl, 'tag','itc_time_txt'), 'visible','off'); + set(findobj('parent', hdl, 'tag','itc_time_edit'), 'visible','off'); + set(findobj('parent', hdl, 'tag','itc_freq_edit'), 'visible','off'); + + set(findobj('parent', hdl, 'string','Measures Dims. Norm. Rel. Wt.'), 'string','Measures'); + else + set(findobj('parent', hdl, 'tag', 'spectra_PCA'), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'spectra_norm'), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'spectra_weight'), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'erp_PCA' ), 'visible','on'); + set(findobj('parent', hdl, 'tag','erp_norm' ), 'visible','on'); + set(findobj('parent', hdl, 'tag','erp_weight' ), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'locations_norm' ), 'visible','on'); + set(findobj('parent', hdl, 'tag','locations_weight'), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'scalp_PCA'), 'visible','on'); + set(findobj('parent', hdl, 'tag','scalp_norm' ), 'visible','on'); + set(findobj('parent', hdl, 'tag','scalp_weight'), 'visible','on'); + set(findobj('parent', hdl, 'tag','ersp_PCA'), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'ersp_norm'), 'visible','on'); + set(findobj('parent', hdl, 'tag','ersp_weight' ), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'itc_PCA'), 'visible','on'); + set(findobj('parent', hdl, 'tag','itc_norm'), 'visible','on'); + set(findobj('parent', hdl, 'tag','itc_weight'), 'visible','on'); + + + set(findobj('parent', hdl, 'tag','sec_PCA'), 'visible','on'); + set(findobj('parent', hdl, 'tag','sec_on'), 'visible','on'); + set(findobj('parent', hdl, 'userdata' ,'dipoleP'), 'visible','on'); + set(findobj('parent', hdl, 'string','Final dimensions'), 'visible','on'); + set(findobj('parent', hdl, 'tag','finalDimHelp' ), 'visible','on'); + set(findobj('parent', hdl, 'tag','spectra_freq_txt'), 'visible','on'); + set(findobj('parent', hdl, 'tag','spectra_freq_edit'), 'visible','on'); + + %% these are made invisible for now, but in future we might use them in the new method + set(findobj('parent', hdl, 'tag','erp_time_txt'), 'visible','on'); + set(findobj('parent', hdl, 'tag','erp_time_edit'), 'visible','on'); + set(findobj('parent', hdl, 'tag','scalp_choice'), 'visible','on'); + set(findobj('parent', hdl, 'tag', 'scalp_absolute'), 'visible','on'); + set(findobj('parent', hdl, 'tag','ersp_time_txt'), 'visible','on'); + set(findobj('parent', hdl, 'tag','ersp_time_edit'), 'visible','on'); + set(findobj('parent', hdl, 'tag','ersp_freq_edit'), 'visible','on'); + set(findobj('parent', hdl, 'tag','itc_time_txt'), 'visible','on'); + set(findobj('parent', hdl, 'tag','itc_time_edit'), 'visible','on'); + set(findobj('parent', hdl, 'tag','itc_freq_edit'), 'visible','on'); + + set(findobj('parent', hdl, 'string','Measures to Cluster on:'), 'string','Load Dims. Norm. Rel. Wt.'); + set(findobj('parent', hdl, 'string','Measures'), 'string', 'Measures Dims. Norm. Rel. Wt.'); + end; + + +% set_mpcluster = get(findobj('parent', hdl, 'tag', 'spectra_on'), 'value'); +% set(findobj('parent', hdl, 'userdata', 'spec'), 'enable', fastif(set_spec,'on','off')); +% PCA_on = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); +% if PCA_on +% set(findobj('parent', hdl, 'userdata', 'specP'), 'enable', 'off'); +% else +% set(findobj('parent', hdl, 'userdata', 'specP'), 'enable', fastif(set_spec,'on','off')); +% end + + + + case 'seterp' + set_erp = get(findobj('parent', hdl, 'tag', 'erp_on'), 'value'); + set(findobj('parent', hdl, 'userdata', 'erp'), 'enable', fastif(set_erp,'on','off')); + PCA_on = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); + if PCA_on + set(findobj('parent', hdl, 'userdata', 'erpP'), 'enable', 'off'); + else + set(findobj('parent', hdl, 'userdata', 'erpP'), 'enable', fastif(set_erp,'on','off')); + end + case 'setscalp' + set_scalp = get(findobj('parent', hdl, 'tag', 'scalp_on'), 'value'); + set(findobj('parent', hdl, 'userdata', 'scalp'), 'enable', fastif(set_scalp,'on','off')); + PCA_on = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); + if PCA_on + set(findobj('parent', hdl, 'userdata', 'scalpP'), 'enable', 'off'); + else + set(findobj('parent', hdl, 'userdata', 'scalpP'), 'enable', fastif(set_scalp,'on','off')); + end + case 'setdipole' + set_dipole = get(findobj('parent', hdl, 'tag', 'dipole_on'), 'value'); + set(findobj('parent', hdl, 'userdata', 'dipole'), 'enable', fastif(set_dipole,'on','off')); + PCA_on = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); + if PCA_on + set(findobj('parent', hdl, 'userdata', 'dipoleP'), 'enable','off'); + else + set(findobj('parent', hdl, 'userdata', 'dipoleP'), 'enable', fastif(set_dipole,'on','off')); + end + case 'setersp' + set_ersp = get(findobj('parent', hdl, 'tag', 'ersp_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'ersp'), 'enable', fastif(set_ersp,'on','off')); + PCA_on = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); + if PCA_on + set(findobj('parent', hdl,'userdata', 'erspP'), 'enable', 'off'); + else + set(findobj('parent', hdl,'userdata', 'erspP'), 'enable', fastif(set_ersp,'on','off')); + end + set_itc = get(findobj('parent', hdl, 'tag', 'itc_on'), 'value'); + set(findobj('parent', hdl,'tag', 'ersp_push'), 'enable', fastif(set_itc,'off','on')); + set(findobj('parent', hdl,'tag', 'ersp_params'), 'enable', fastif(set_itc,'off','on')); + if (set_itc & (~set_ersp) ) + set(findobj('parent', hdl,'tag', 'itc_push'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'itc_params'), 'enable', 'on'); + end + case 'setitc' + set_itc = get(findobj('parent', hdl, 'tag', 'itc_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'itc'), 'enable', fastif(set_itc,'on','off')); + PCA_on = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); + if PCA_on + set(findobj('parent', hdl,'userdata', 'itcP'), 'enable','off'); + else + set(findobj('parent', hdl,'userdata', 'itcP'), 'enable', fastif(set_itc,'on','off')); + end + set_ersp = get(findobj('parent', hdl, 'tag', 'ersp_on'), 'value'); + set(findobj('parent', hdl,'tag', 'itc_push'), 'enable', fastif(set_ersp,'off','on')); + set(findobj('parent', hdl,'tag', 'itc_params'), 'enable', fastif(set_ersp,'off','on')); + if (set_ersp & (~set_itc) ) + set(findobj('parent', hdl,'tag', 'ersp_push'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'ersp_params'), 'enable', 'on'); + end + case 'setsec' + set_sec = get(findobj('parent', hdl, 'tag', 'sec_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'sec'), 'enable', fastif(set_sec,'on','off')); + case 'erspparams' + ersp = userdat{2}; + [ersp_paramsout, erspuserdat, strhalt, erspstruct] = inputgui( { [1] [3 1] [3 1] [3 1] [3 1] [3 1] [1]}, ... + { {'style' 'text' 'string' 'ERSP and ITC time/freq. parameters' 'FontWeight' 'Bold'} ... + {'style' 'text' 'string' 'Frequency range [Hz]' 'tag' 'ersp_freq' } ... + {'style' 'edit' 'string' ersp.f 'tag' 'ersp_f' 'Callback' ERSP_timewindow } ... + {'style' 'text' 'string' 'Wavelet cycles (see >> help timef())' 'tag' 'ersp_cycle' } ... + {'style' 'edit' 'string' ersp.c 'tag' 'ersp_c' 'Callback' ERSP_timewindow} ... + {'style' 'text' 'string' 'Significance level (< 0.1)' 'tag' 'ersp_alpha' } ... + {'style' 'edit' 'string' ersp.a 'tag' 'ersp_a'} ... + {'style' 'text' 'string' 'timef() padratio' 'tag' 'ersp_pad' } ... + {'style' 'edit' 'string' ersp.p 'tag' 'ersp_p' 'Callback' ERSP_timewindow} ... + {'style' 'text' 'string' 'Desired time window within the indicated latency range [ms]' 'tag' 'ersp_trtxt' } ... + {'style' 'edit' 'string' ersp.t 'tag' 'ersp_timewindow' 'Callback' ERSP_timewindow} {} }, ... + 'pophelp(''pop_timef'')', 'Select clustering ERSP and ITC time/freq. parameters -- pop_preclust()'); + if ~isempty(ersp_paramsout) + ersp.f = erspstruct(1).ersp_f; + ersp.c = erspstruct(1).ersp_c; + ersp.p = erspstruct(1).ersp_p; + ersp.a = erspstruct(1).ersp_a; + ersp.t = erspstruct(1).ersp_timewindow; + userdat{2} = ersp; + set(findobj('parent', hdl, 'tag', 'ersp_params'), 'string', ... + [' ''frange'', [' ersp.f '], ''cycles'', [' ... + ersp.c '], ''alpha'', ' ersp.a ', ''padratio'', ' ersp.p ', ''tlimits'', [' ersp.t ']']); + set(findobj('parent', hdl, 'tag', 'itc_params'), 'string', ... + [' ''frange'', [' ersp.f '], ''cycles'', [' ... + ersp.c '], ''alpha'', ' ersp.a ', ''padratio'', ' ersp.p ', ''tlimits'', [' ersp.t ']']); + set(hdl, 'userdat',userdat); + end + case 'preclustOK' + set_PCA = get(findobj('parent', hdl, 'tag', 'preclust_PCA'), 'value'); + set_ersp = get(findobj('parent', hdl, 'tag', 'ersp_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'erspP'), 'enable', fastif(~set_PCA & set_ersp,'on','off')); + set_itc = get(findobj('parent', hdl, 'tag', 'itc_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'itcP'), 'enable', fastif(~set_PCA & set_itc,'on','off')); + set_erp = get(findobj('parent', hdl, 'tag', 'erp_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'erpP'), 'enable', fastif(~set_PCA & set_erp,'on','off')); + set_spec = get(findobj('parent', hdl, 'tag', 'spectra_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'specP'), 'enable', fastif(~set_PCA & set_spec,'on','off')); + set_scalp = get(findobj('parent', hdl, 'tag', 'scalp_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'scalpP'), 'enable', fastif(~set_PCA & set_scalp,'on','off')); + set_dipole = get(findobj('parent', hdl, 'tag', 'dipole_on'), 'value'); + set(findobj('parent', hdl,'userdata', 'dipoleP'), 'enable', fastif(~set_PCA & set_dipole,'on','off')); + set(findobj('parent', hdl,'tag', 'chosen_component'), 'enable', fastif(~set_PCA,'on','off')); + set(findobj('parent', hdl,'tag', 'dipole_rv'), 'enable', fastif(~set_PCA,'on','off')); + set(findobj('parent', hdl,'tag', 'compstd_str'), 'enable', fastif(~set_PCA,'on','off')); + end +end +STUDY.saved = 'no'; diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_precomp.m b/code/eeglab13_4_4b/functions/studyfunc/pop_precomp.m new file mode 100644 index 0000000..115e417 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_precomp.m @@ -0,0 +1,425 @@ +% pop_precomp() - precompute measures (spectrum, ERP, ERSP) for a collection of data +% channels. Calls std_precomp(). +% Usage: +% >> [STUDY, ALLEEG] = pop_precomp(STUDY, ALLEEG); % pop up interactive window +% Inputs: +% STUDY - STUDY set structure containing (loaded) EEG dataset structures +% ALLEEG - ALLEEG vector of EEG structures, else a single EEG dataset. +% +% Outputs: +% STUDY - the input STUDY set with added pre-clustering data for use by pop_clust() +% ALLEEG - the input ALLEEG vector of EEG dataset structures modified by adding +% pre-clustering data (pointers to .mat files that hold cluster measure information). +% +% Authors: Arnaud Delorme, CERCO, CNRS, 2006- +% +% See also: std_precomp() + +% Copyright (C) Arnaud Delorme, CERCO, CNRS, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, ALLEEG, com] = pop_precomp(varargin) + +com = ''; + +if ~isstr(varargin{1}) %intial settings + if length(varargin) < 2 + error('pop_precomp(): needs both ALLEEG and STUDY structures'); + end + STUDY = varargin{1}; + ALLEEG = varargin{2}; + comps = false; + if nargin > 2 + if strcmpi(varargin{3}, 'components') + comps = true; + end; + end; + + if isempty(ALLEEG) + error('STUDY contains no datasets'); + end + + % callbacks + % --------- + erspparams_str = [ '''cycles'', [3 0.8], ''nfreqs'', 100, ''ntimesout'', 200' ]; + specparams_str = '''specmode'', ''fft'', ''logtrials'', ''off'''; + erpimageparams_str = '''nlines'', 10,''smoothing'', 10'; + set_ersp = ['pop_precomp(''setersp'',gcf);']; + test_ersp = ['pop_precomp(''testersp'',gcf);']; + set_itc = ['pop_precomp(''setitc'',gcf);']; + set_spec = ['pop_precomp(''setspec'',gcf);']; + set_erp = ['pop_precomp(''seterp'',gcf);']; + set_erpimage = ['pop_precomp(''seterpimage'',gcf);']; + test_spec = ['pop_precomp(''testspec'',gcf);']; + test_erpimage = ['pop_precomp(''testerpimage'',gcf);']; + chanlist = ['pop_precomp(''chanlist'',gcf);']; + chanlist = 'warndlg2([ ''You need to compute measures on all data channels.'' 10 ''This functionality is under construction.'']);'; + chaneditbox = ['pop_precomp(''chaneditbox'',gcf);']; + warninterp = ''; %['warndlg2(''EEGLAB will crash when plotting a given channel if it is missing in one dataset'');' ]; + cb_ica1 = ''; %[ 'if get(gcbo, ''value''), set(findobj(gcbf, ''tag'', ''rmica2_on''), ''value'', 0); end;' ]; + cb_ica2 = ''; %[ 'if get(gcbo, ''value''), set(findobj(gcbf, ''tag'', ''rmica1_on''), ''value'', 0); end;' ]; + + geomline = [0.35 6]; + if comps == true + str_name = sprintf('Pre-compute component measures for STUDY ''%s'' - ''%s''', ... + STUDY.name, STUDY.design(STUDY.currentdesign).name); + if length(str_name) > 80, str_name = [ str_name(1:80) '...' ]; end; + guiadd1 = { {'style' 'checkbox' 'string' '' 'tag' 'compallersp' 'value' 1 } ... + {'style' 'text' 'string' 'Compute ERP/spectrum/ERSP only for components selected by RV (set) or for all components (unset)' } }; + guiadd2 = { {'style' 'checkbox' 'string' '' 'tag' 'scalp_on' 'value' 0 } ... + {'style' 'text' 'string' 'Scalp maps' } }; + geomadd1 = { geomline }; + geomvertadd1 = [ 1 ]; + geomadd2 = { geomline }; + else + str_name = sprintf('Pre-compute channel measures for STUDY ''%s'' - ''%s''', ... + STUDY.name, STUDY.design(STUDY.currentdesign).name); + if length(str_name) > 80, str_name = [ str_name(1:80) '...''' ]; end; + guiadd1 = { {'style' 'text' 'string' 'Channel list (default:all)' 'FontWeight' 'Bold'} ... + {'Style' 'edit' 'string' '' 'tag' 'chans' 'callback' chaneditbox 'enable' 'off' }, ... + {'style' 'pushbutton' 'string' '...', 'enable' fastif(isempty(ALLEEG(1).chanlocs), 'off', 'on') ... + 'callback' chanlist }, ... + {'style' 'checkbox' 'string' '' 'tag' 'interpolate_on' 'value' 1 'callback' warninterp } ... + {'style' 'text' 'string' 'Spherical interpolation of missing channels (performed after optional ICA removal below)' } ... + {'style' 'checkbox' 'string' ' ' 'tag' 'rmica1_on' 'value' 0 'callback' cb_ica1 } ... + {'style' 'text' 'string' 'Remove ICA artifactual components pre-tagged in each dataset' } ... + {'style' 'checkbox' 'string' [ ' ' 10 ' ' ] 'tag' 'rmica2_on' 'value' 0 'callback' cb_ica2 } ... + {'style' 'text' 'string' [ 'Remove artifactual ICA cluster or clusters (hold shift key)' 10 ' ' ] } ... + {'style' 'listbox' 'string' { STUDY.cluster.name } 'value' 1 'max' 2 'tag' 'rmica2_val'} }; + guiadd2 = {}; + geomadd1 = { [2 3 0.5] geomline geomline [0.35 4 2] }; + geomvertadd1 = [ 1 1 1 2 ]; + geomadd2 = { }; + end; + + gui_spec = { ... + {'style' 'text' 'string' str_name 'FontWeight' 'Bold' 'horizontalalignment' 'left'}, ... + {'style' 'text' 'string' '(warning: define your STUDY designs first as precomputation is specific to a given STUDY design)' } {}, ... + guiadd1{:}, ... + {} {'style' 'text' 'string' 'List of measures to precompute' 'FontWeight' 'Bold' 'horizontalalignment' 'left'}, ... + {'style' 'checkbox' 'string' '' 'tag' 'erp_on' 'value' 0 'Callback' set_erp } , ... + {'style' 'text' 'string' 'ERPs' }, {}, ... + {'style' 'text' 'string' 'Baseline ([min max] in ms)' 'tag' 'erp_text' 'enable' 'off'}... + {'style' 'edit' 'string' '' 'tag' 'erp_base' 'enable' 'off' }, { }, ... + {'style' 'checkbox' 'string' '' 'tag' 'spectra_on' 'value' 0 'Callback' set_spec }, ... + {'style' 'text' 'string' 'Power spectrum' }, {}, ... + {'style' 'text' 'string' 'Spectopo parameters' 'tag' 'spec_push' 'enable' 'off'}... + {'style' 'edit' 'string' specparams_str 'tag' 'spec_params' 'enable' 'off' }, ... + {'style' 'pushbutton' 'string' 'Test' 'tag' 'spec_test' 'enable' 'off' 'callback' test_spec}... + {'style' 'checkbox' 'string' '' 'tag' 'erpimage_on' 'value' 0 'Callback' set_erpimage }, ... + {'style' 'text' 'string' 'ERP-image' }, {}, ... + {'style' 'text' 'string' 'ERP-image parameters' 'tag' 'erpimage_push' 'enable' 'off'}... + {'style' 'edit' 'string' erpimageparams_str 'tag' 'erpimage_params' 'enable' 'off' }, ... + {'style' 'pushbutton' 'string' 'Test' 'tag' 'erpimage_test' 'enable' 'off' 'callback' test_erpimage}... + {'style' 'checkbox' 'string' '' 'tag' 'ersp_on' 'value' 0 'Callback' set_ersp } , ... + {'style' 'text' 'string' 'ERSPs' 'horizontalalignment' 'center' }, {}, ... + {'vertshift' 'style' 'text' 'string' 'Time/freq. parameters' 'tag' 'ersp_push' 'value' 1 'enable' 'off'}, ... + {'vertshift' 'style' 'edit' 'string' erspparams_str 'tag' 'ersp_params' 'enable' 'off'}... + {'vertshift' 'style' 'pushbutton' 'string' 'Test' 'tag' 'ersp_test' 'enable' 'off' 'callback' test_ersp }... + {'style' 'checkbox' 'string' '' 'tag' 'itc_on' 'value' 0 'Callback' set_itc }, ... + {'style' 'text' 'string' 'ITCs' 'horizontalalignment' 'center' }, {'link2lines' 'style' 'text' 'string' '' } {} {} {}, ... + guiadd2{:}, ... + {}, ... + {'style' 'checkbox' 'string' 'Save single-trial measures for single-trial statistics (beta) - requires disk space' 'tag' 'savetrials_on' 'value' 0 } {}, ... + {'style' 'checkbox' 'string' 'Overwrite files on disk' 'tag' 'recomp_on' 'value' 1 } {}, ... + }; + + %{'style' 'checkbox' 'string' '' 'tag' 'precomp_PCA' 'Callback' precomp_PCA 'value' 0} ... + %{'style' 'text' 'string' 'Do not prepare dataset for clustering at this time.' 'FontWeight' 'Bold' } {} ... + + % find the list of all channels + % ----------------------------- + allchans = { }; + keepindex = 0; + for index = 1:length(ALLEEG) + tmpchanlocs = ALLEEG(index).chanlocs; + tmpchans = { tmpchanlocs.labels }; + allchans = unique_bc({ allchans{:} tmpchanlocs.labels }); + if length(allchans) == length(tmpchans), keepindex = index; end; + end; + if keepindex, tmpchanlocs = ALLEEG(keepindex).chanlocs; allchans = { tmpchanlocs.labels }; end; + + chanlist = {}; + firsttimeersp = 1; + fig_arg = { ALLEEG STUDY allchans chanlist firsttimeersp }; + geomline1 = [0.40 1.3 0.1 2 2.4 0.65 ]; + geomline2 = [0.40 0.9 0.5 2 2.4 0.65 ]; + geometry = { [1] [1] [1] geomadd1{:} [1] [1] geomline1 geomline1 geomline1 geomline2 geomline2 geomadd2{:} 1 [1 0.1] [1 0.1] }; + geomvert = [ 1 1 0.5 geomvertadd1 0.5 1 1 1 1 1 1 1 fastif(length(geomadd2) == 1,1,[]) 1 1]; + [precomp_param, userdat2, strhalt, os] = inputgui( 'geometry', geometry, 'uilist', gui_spec, 'geomvert', geomvert, ... + 'helpcom', ' pophelp(''std_precomp'')', ... + 'title', 'Select and compute component measures for later clustering -- pop_precomp()', ... + 'userdata', fig_arg); + if isempty(precomp_param), return; end; + + if comps == 1 + options = { STUDY ALLEEG 'components' }; + else + options = { STUDY ALLEEG userdat2{4} }; + end + if ~isfield(os, 'interpolate_on'), os.interpolate_on = 0; end; + if ~isfield(os, 'scalp_on'), os.scalp_on = 0; end; + if ~isfield(os, 'compallersp'), os.compallersp = 1; end; + warnflag = 0; + + % rm_ica option is on + % ------------------- + if isfield(os, 'rmica1_on') + if os.rmica1_on == 1 + options = { options{:} 'rmicacomps' 'on' }; + end + end; + + % remove ICA cluster + % ------------------ + if isfield(os, 'rmica2_on') + if os.rmica2_on == 1 + options = { options{:} 'rmclust' os.rmica2_val }; + end + end; + + % interpolate option is on + % ------------------------ + if os.savetrials_on == 1 + options = { options{:} 'savetrials' 'on' }; + end + + % interpolate option is on + % ------------------------ + if os.interpolate_on == 1 + options = { options{:} 'interp' 'on' }; + end + + % compallersp option is on + % ------------------------ + if os.compallersp == 0 + options = { options{:} 'allcomps' 'on' }; + end + + % recompute option is on + % ---------------------- + if os.recomp_on == 1 + options = { options{:} 'recompute' 'on' }; + end + + % ERP option is on + % ---------------- + if os.erp_on == 1 + options = { options{:} 'erp' 'on' }; + if ~isempty(os.erp_base) + options = { options{:} 'erpparams' { 'rmbase' str2num(os.erp_base) } }; + end + warnflag = checkFilePresent(STUDY, 'erp', comps, warnflag, os.recomp_on); + end + + % SCALP option is on + % ---------------- + if os.scalp_on == 1 + options = { options{:} 'scalp' 'on' }; + end + + % Spectrum option is on + % -------------------- + if os.spectra_on== 1 + tmpparams = eval( [ '{' os.spec_params '}' ] ); + options = { options{:} 'spec' 'on' 'specparams' tmpparams }; + warnflag = checkFilePresent(STUDY, 'spec', comps, warnflag, os.recomp_on); + end + + % ERPimage option is on + % -------------------- + if os.erpimage_on== 1 + tmpparams = eval( [ '{' os.erpimage_params '}' ] ); + options = { options{:} 'erpim' 'on' 'erpimparams' tmpparams }; + warnflag = checkFilePresent(STUDY, 'erpim', comps, warnflag, os.recomp_on); + end + + % ERSP option is on + % ----------------- + if os.ersp_on == 1 + tmpparams = eval( [ '{' os.ersp_params '}' ] ); + options = { options{:} 'ersp' 'on' 'erspparams' tmpparams }; + warnflag = checkFilePresent(STUDY, 'ersp', comps, warnflag, os.recomp_on); + end + + % ITC option is on + % ---------------- + if os.itc_on == 1 + tmpparams = eval( [ '{' os.ersp_params '}' ] ); + options = { options{:} 'itc' 'on' }; + if os.ersp_on == 0, options = { options{:} 'erspparams' tmpparams }; end; + warnflag = checkFilePresent(STUDY, 'itc', comps, warnflag, os.recomp_on); + end + + % evaluate command + % ---------------- + if length(options) == 4 + warndlg2('No measure selected: aborting.'); + return; + end; + [STUDY ALLEEG] = std_precomp(options{:}); + com = sprintf('[STUDY ALLEEG] = std_precomp(STUDY, ALLEEG, %s);', vararg2str(options(3:end))); + +else + hdl = varargin{2}; %figure handle + userdat = get(varargin{2}, 'userdata'); + ALLEEG = userdat{1}; + STUDY = userdat{2}; + allchans = userdat{3}; + chansel = userdat{4}; + firsttimeersp = userdat{5}; + + switch varargin{1} + + case 'chanlist' + [tmp tmp2 tmp3] = pop_chansel(allchans, 'select', chansel); + if ~isempty(tmp) + set(findobj('parent', hdl, 'tag', 'chans'), 'string', tmp2); + userdat{4} = tmp3; + end; + set(hdl, 'userdata',userdat); + + case 'chaneditbox' + userdat{4} = parsetxt(get(findobj('parent', hdl, 'tag', 'chans'), 'string')); + set(hdl, 'userdata',userdat); + + case { 'setitc' 'setersp' } + set_itc = get(findobj('parent', hdl, 'tag', 'itc_on'), 'value'); + set_ersp = get(findobj('parent', hdl, 'tag', 'ersp_on'), 'value'); + if (~set_ersp & ~set_itc ) + set(findobj('parent', hdl,'tag', 'ersp_push'), 'enable', 'off'); + set(findobj('parent', hdl,'tag', 'ersp_params'), 'enable', 'off'); + set(findobj('parent', hdl,'tag', 'ersp_test'), 'enable', 'off'); + else + set(findobj('parent', hdl,'tag', 'ersp_push'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'ersp_params'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'ersp_test'), 'enable', 'on'); + end + userdat{5} = 0; + set(hdl, 'userdata',userdat); + if firsttimeersp + warndlg2(strvcat('Checking both ''ERSP'' and ''ITC'' does not require further', ... + 'computing time. However it requires disk space')); + end; + + case 'setspec' + set_spec = get(findobj('parent', hdl, 'tag', 'spectra_on'), 'value'); + if set_spec + set(findobj('parent', hdl,'tag', 'spec_push'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'spec_params'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'spec_test'), 'enable', 'on'); + else set(findobj('parent', hdl,'tag', 'spec_push'), 'enable', 'off'); + set(findobj('parent', hdl,'tag', 'spec_params'), 'enable', 'off'); + set(findobj('parent', hdl,'tag', 'spec_test'), 'enable', 'off'); + end + + case 'seterpimage' + set_spec = get(findobj('parent', hdl, 'tag', 'erpimage_on'), 'value'); + if set_spec + set(findobj('parent', hdl,'tag', 'erpimage_push'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'erpimage_params'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'erpimage_test'), 'enable', 'on'); + else set(findobj('parent', hdl,'tag', 'erpimage_push'), 'enable', 'off'); + set(findobj('parent', hdl,'tag', 'erpimage_params'), 'enable', 'off'); + set(findobj('parent', hdl,'tag', 'erpimage_test'), 'enable', 'off'); + end + + case 'seterp' + set_erp = get(findobj('parent', hdl, 'tag', 'erp_on'), 'value'); + if set_erp + set(findobj('parent', hdl,'tag', 'erp_text'), 'enable', 'on'); + set(findobj('parent', hdl,'tag', 'erp_base'), 'enable', 'on'); + else set(findobj('parent', hdl,'tag', 'erp_text'), 'enable', 'off'); + set(findobj('parent', hdl,'tag', 'erp_base'), 'enable', 'off'); + end + + case 'testspec' + try, + spec_params = eval([ '{' get(findobj('parent', hdl, 'tag', 'spec_params'), 'string') '}' ]); + + TMPEEG = eeg_checkset(ALLEEG(1), 'loaddata'); + [ X f ] = std_spec(TMPEEG, 'channels', { TMPEEG.chanlocs(1).labels }, 'trialindices', { [1:min(20,TMPEEG.trials)] }, 'recompute', 'on', 'savefile', 'off', spec_params{:}); + figure; plot(f, X); + xlabel('Frequencies (Hz)'); + ylabel('Power'); + xlim([min(f) max(f)]); + tmplim = ylim; + text( TMPEEG.srate/4, mean(tmplim)+(max(tmplim)-min(tmplim))/3, ... + strvcat('This is a test plot performed on', ... + 'the first 20 trials of the first', ... + 'dataset (1 line per channel).', ... + 'Frequency range may be adjusted', ... + 'after computation')); + icadefs; + set(gcf, 'color', BACKCOLOR); + catch, warndlg2('Error while calling function, check parameters'); end; + + case 'testersp' + try, + ersp_params = eval([ '{' get(findobj('parent', hdl, 'tag', 'ersp_params'), 'string') '}' ]); + tmpstruct = struct(ersp_params{:}); + [ tmpX tmpt tmpf ersp_params ] = std_ersp(ALLEEG(1), 'channels', 1, 'trialindices', { [1:min(20,ALLEEG(1).trials)] }, 'type', 'ersp', 'recompute', 'on', 'savefile', 'off', ersp_params{:}); + std_plottf(tmpt, tmpf, { tmpX }); + catch, warndlg2('Error while calling function, check parameters'); end; + + case 'testerpimage' + try, + erpimage_params = eval([ '{' get(findobj('parent', hdl, 'tag', 'erpimage_params'), 'string') '}' ]); + tmpstruct = struct(erpimage_params{:}); + erpimstruct = std_erpimage(ALLEEG(1), 'channels', 1, 'recompute', 'on', 'savefile', 'off', erpimage_params{:}); + figure; pos = get(gcf, 'position'); pos(3)=pos(3)*2; set(gcf, 'position', pos); + subplot(1,2,1); + tftopo(erpimstruct.chan1, erpimstruct.times, 1:size(erpimstruct.chan1,1), 'ylabel', 'Trials'); + subplot(1,2,2); + text( 0.2, 0.8, strvcat( 'This is a test plot performed on', ... + 'the first channel of the first', ... + 'dataset.', ... + ' ', ... + 'Time and trial range may be', ... + 'adjusted after computation.'), 'fontsize', 18); + axis off; + icadefs; + set(gcf, 'color', BACKCOLOR); + catch, warndlg2('Error while calling function, check parameters'); end; + + end; +end +STUDY.saved = 'no'; + +% check if file is present +% ------------------------ +function warnflag = checkFilePresent(STUDY, datatype, comps, warnflag, recompute); + + if ~recompute, return; end; + if warnflag, return; end; % warning has already been issued + + if comps + dataFilename = [ STUDY.design(STUDY.currentdesign).cell(1).filebase '.ica' datatype ]; + else dataFilename = [ STUDY.design(STUDY.currentdesign).cell(1).filebase '.dat' datatype ]; + end; + if exist(dataFilename) + textmsg = [ 'WARNING: SOME DATAFILES ALREADY EXIST, OVERWRITE THEM?' 10 ... + '(if you have another STUDY using the same datasets, it might overwrite its' 10 ... + 'precomputed data files. Instead, use a single STUDY and create multiple designs).' ]; + res = questdlg2(textmsg, 'Precomputed datafiles already present on disk', 'No', 'Yes', 'Yes'); + if strcmpi(res, 'No') + error('User aborded precomputing measures'); + end; + end; + warnflag = 1; + + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_savestudy.m b/code/eeglab13_4_4b/functions/studyfunc/pop_savestudy.m new file mode 100644 index 0000000..7f85c85 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_savestudy.m @@ -0,0 +1,135 @@ +% pop_savestudy() - save a STUDY structure to a disk file +% +% Usage: +% >> STUDY = pop_savestudy( STUDY, EEG ); % pop up and interactive window +% >> STUDY = pop_savestudy( STUDY, EEG, 'key', 'val', ...); % no pop-up +% +% Inputs: +% STUDY - STUDY structure. +% EEG - Array of datasets contained in the study. +% +% Optional inputs: +% 'filename' - [string] name of the STUDY file {default: STUDY.filename} +% 'filepath' - [string] path of the STUDY file {default: STUDY.filepath} +% 'savemode' - ['resave'|'standard'] in resave mode, the file name in +% the study is being used to resave it. +% +% Note: the parameter EEG is currenlty not being used. In the future, this function +% will check if any of the datasets of the study have been modified and +% have to be resaved. +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, September 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, Spetember 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, EEG, com] = pop_savestudy(STUDY, EEG, varargin); + +com = ''; +if nargin < 1 + help pop_savestudy; + return; +end; +if isempty(STUDY) , error('pop_savestudy(): cannot save empty STUDY'); end; +if length(STUDY) >1, error('pop_savestudy(): cannot save multiple STUDY sets'); end; + +% backward compatibility +% ---------------------- +if nargin > 1 + if isstr(EEG) + options = { EEG varargin{:} }; + else + options = varargin; + end; +end; + +if nargin < 3 + % pop up window to ask for file type + % ---------------------------------- + [filename, filepath] = uiputfile2('*.study', ... + 'Save STUDY with .study extension -- pop_savestudy()'); + if isequal(filename,0), return; end; + if ~strncmp(filename(end-5:end), '.study',6) + if isempty(strfind(filename,'.')) + filename = [filename '.study']; + else + filename = [filename(1:strfind(filename,'.')-1) '.study']; + end + end + options = { 'filename' filename 'filepath' filepath }; +end + +% decoding parameters +% ------------------- +g = finputcheck(options, { 'filename' 'string' [] STUDY.filename; + 'filepath' 'string' [] STUDY.filepath; + 'savemode' 'string' { 'standard','resave' } 'standard' }); +if isstr(g), error(g); end; + +% fields to remove +% ---------------- +fields = { 'erptimes' 'erpdata' ... + 'specfreqs' 'specdata' ... + 'erspdata' 'ersptimes' 'erspfreqs' 'erspdatatrials' 'erspsubjinds' 'erspbase' 'ersptrialinfo' ... + 'itcdata' 'itcfreqs' 'itctimes' ... + 'erpimdata' 'erpimevents' 'erpimtrials' 'erpimtimes' }; +for fInd = 1:length(fields) + if isfield(STUDY.changrp, fields{fInd}) + STUDY.changrp = rmfield(STUDY.changrp, fields{fInd}); + end; + if isfield(STUDY.changrp, fields{fInd}) + STUDY.cluster = rmfield(STUDY.cluster, fields{fInd}); + end; +end; + +% resave mode +% ----------- +STUDY.saved = 'yes'; +if strcmpi(g.savemode, 'resave') + disp('Re-saving study file'); + g.filename = STUDY.filename; + g.filepath = STUDY.filepath; +end; + +if isempty(g.filename) + disp('pop_savestudy(): no STUDY filename: make sure the STUDY has a filename'); + return; +end +if ~strncmp(g.filename(end-5:end), '.study',6) + if isempty(strfind(g.filename,'.')) + g.filename = [g.filename '.study']; + else + g.filename = [g.filename(1:strfind(g.filename,'.')-1) '.study']; + end +end + +% [filepath filenamenoext ext] = fileparts(varargin{1}); +% filename = [filenamenoext '.study']; % make sure a .study extension + +STUDY.filepath = g.filepath; +STUDY.filename = g.filename; +STUDYfile = fullfile(STUDY.filepath,STUDY.filename); +STUDYTMP = STUDY; +STUDY = std_rmalldatafields(STUDY); +eeglab_options; +if option_saveversion6, save('-v6' , STUDYfile, 'STUDY'); +else save('-v7.3' , STUDYfile, 'STUDY'); +end; +STUDY = STUDYTMP; + +% history +% ------- +com = sprintf('[STUDY EEG] = pop_savestudy( %s, %s, %s);', inputname(1), inputname(2), vararg2str(options)); diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_specparams.m b/code/eeglab13_4_4b/functions/studyfunc/pop_specparams.m new file mode 100644 index 0000000..c3f318e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_specparams.m @@ -0,0 +1,174 @@ +% pop_specparams() - Set plotting and statistics parameters for computing +% STUDY component spectra. +% Usage: +% >> STUDY = pop_specparams(STUDY, 'key', 'val'); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% +% Plot options: +% 'topofreq' - [real] Plot Spectrum scalp maps at one specific freq. (Hz). +% A frequency range [min max] may also be defined (the +% spectrum is then averaged over the interval) {default: []} +% 'freqrange' - [min max] spectral frequency range (in Hz) to plot. +% {default: whole frequency range} . +% 'ylim' - [mindB maxdB] spectral plotting limits in dB +% {default: from data} +% 'plotgroups' - ['together'|'apart'] 'together' -> plot subject groups +% on the same figure in different colors, else ('apart') on +% different figures {default: 'apart'} +% 'plotconditions' - ['together'|'apart'] 'together' -> plot conditions +% on the same figure in different colors, else ('apart') +% on different figures. Note: keywords 'plotgroups' and +% 'plotconditions' cannot both be set to 'together'. +% {default: 'apart'} +% 'subtractsubjectmean' - ['on'|'off'] subtract individual subject mean +% from each spectrum before plotting and computing +% statistics. Default is 'off'. +% 'averagechan' - ['on'|'off'] average data channels when several are +% selected. +% +% See also: std_specplot() +% +% Authors: Arnaud Delorme, CERCO, CNRS, 2006- + +% Copyright (C) Arnaud Delorme, CERCO +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY, com ] = pop_specparams(STUDY, varargin); + +STUDY = default_params(STUDY); +TMPSTUDY = STUDY; +com = ''; +if isempty(varargin) + + enablecond = fastif(length(STUDY.design(STUDY.currentdesign).variable(1).value)>1, 'on', 'off'); + enablegroup = fastif(length(STUDY.design(STUDY.currentdesign).variable(2).value)>1, 'on', 'off'); + plotconditions = fastif(strcmpi(STUDY.etc.specparams.plotconditions, 'together'), 1, 0); + plotgroups = fastif(strcmpi(STUDY.etc.specparams.plotgroups,'together'), 1, 0); + submean = fastif(strcmpi(STUDY.etc.specparams.subtractsubjectmean,'on'), 1, 0); + radio_averagechan = fastif(strcmpi(STUDY.etc.specparams.averagechan,'on'), 1, 0); + radio_scalptopo = fastif(isempty(STUDY.etc.specparams.topofreq), 0, 1); + if radio_scalptopo, radio_averagechan = 0; end; + if radio_scalptopo+radio_averagechan == 0, radio_scalparray = 1; else radio_scalparray = 0; end; + + cb_radio = [ 'set(findobj(gcbf, ''userdata'', ''radio''), ''value'', 0);' ... + 'set(gcbo, ''value'', 1);' ... + 'set(findobj(gcbf, ''tag'', ''topofreq''), ''string'', '''');' ]; + cb_edit = [ 'set(findobj(gcbf, ''userdata'', ''radio''), ''value'', 0);' ... + 'set(findobj(gcbf, ''tag'', ''scalptopotext''), ''value'', 1);' ]; + + uilist = { ... + {'style' 'text' 'string' 'Spectrum plotting options' 'fontweight' 'bold' 'fontsize', 12} ... + {} {'style' 'text' 'string' 'Frequency [low_Hz high_Hz]' } ... + {'style' 'edit' 'string' num2str(STUDY.etc.specparams.freqrange) 'tag' 'freqrange' } ... + {} {'style' 'text' 'string' 'Plot limits [low high]'} ... + {'style' 'edit' 'string' num2str(STUDY.etc.specparams.ylim) 'tag' 'ylim' } ... + {} {'style' 'checkbox' 'string' 'Subtract individual subject mean spectrum' 'value' submean 'tag' 'submean' } ... + {} ... + {'style' 'text' 'string' 'Spectrum plotting format' 'fontweight' 'bold' 'fontsize', 12} ... + {} {'style' 'checkbox' 'string' 'Plot first variable on the same panel' 'value' plotconditions 'enable' enablecond 'tag' 'plotconditions' } ... + {} {'style' 'checkbox' 'string' 'Plot second variable on the same panel' 'value' plotgroups 'enable' enablegroup 'tag' 'plotgroups' } ... + {} ... + {'style' 'text' 'string' 'Multiple channels selection' 'fontweight' 'bold' 'fontsize', 12} ... + {} {'style' 'radio' 'string' 'Plot channels in scalp array' 'value' radio_scalparray 'tag' 'scalparray' 'userdata' 'radio' 'callback' cb_radio} { } ... + {} {'style' 'radio' 'string' 'Plot topography at freq. (Hz)' 'value' radio_scalptopo 'tag' 'scalptopotext' 'userdata' 'radio' 'callback' cb_radio} ... + {'style' 'edit' 'string' num2str(STUDY.etc.specparams.topofreq) 'tag' 'topofreq' 'callback' cb_edit } ... + {} {'style' 'radio' 'string' 'Average selected channels' 'value' radio_averagechan 'tag' 'averagechan' 'userdata' 'radio' 'callback' cb_radio} { } }; + cbline = [0.07 1.1]; + otherline = [ 0.07 0.6 .3]; + chanline = [ 0.07 0.8 0.3]; + geometry = { 1 otherline otherline cbline 1 1 cbline cbline 1 1 chanline chanline chanline }; + geomvert = [1.2 1 1 1 0.5 1.2 1 1 0.5 1.2 1 1 1 ]; + + % component plotting + % ------------------ + if isnan(STUDY.etc.specparams.topofreq) + geometry(end-4:end) = []; + geomvert(end-4:end) = []; + uilist(end-10:end) = []; + end; + + [out_param userdat tmp res] = inputgui( 'geometry' , geometry, 'uilist', uilist, 'geomvert', geomvert, ... + 'title', 'Spectrum plotting options -- pop_specparams()'); + if isempty(res), return; end; + + % decode inputs + % ------------- + %if res.plotgroups & res.plotconditions, warndlg2('Both conditions and group cannot be plotted on the same panel'); return; end; + if res.submean , res.submean = 'on'; else res.submean = 'off'; end; + if res.plotgroups, res.plotgroups = 'together'; else res.plotgroups = 'apart'; end; + if res.plotconditions , res.plotconditions = 'together'; else res.plotconditions = 'apart'; end; + if ~isfield(res, 'topofreq'), res.topofreq = STUDY.etc.specparams.topofreq; + else res.topofreq = str2num( res.topofreq ); + end; + if ~isfield(res, 'averagechan'), res.averagechan = STUDY.etc.specparams.averagechan; + elseif res.averagechan, res.averagechan = 'on'; else res.averagechan = 'off'; + end; + res.freqrange = str2num( res.freqrange ); + res.ylim = str2num( res.ylim ); + + % build command call + % ------------------ + options = {}; + if ~strcmpi( res.plotgroups, STUDY.etc.specparams.plotgroups), options = { options{:} 'plotgroups' res.plotgroups }; end; + if ~strcmpi( res.plotconditions , STUDY.etc.specparams.plotconditions ), options = { options{:} 'plotconditions' res.plotconditions }; end; + if ~strcmpi( res.submean , STUDY.etc.specparams.subtractsubjectmean ), options = { options{:} 'subtractsubjectmean' res.submean }; end; + if ~isequal(res.topofreq, STUDY.etc.specparams.topofreq), options = { options{:} 'topofreq' res.topofreq }; end; + if ~isequal(res.ylim, STUDY.etc.specparams.ylim), options = { options{:} 'ylim' res.ylim }; end; + if ~isequal(res.freqrange, STUDY.etc.specparams.freqrange), options = { options{:} 'freqrange' res.freqrange }; end; + if ~isequal(res.averagechan, STUDY.etc.specparams.averagechan), options = { options{:} 'averagechan' res.averagechan }; end; + if ~isempty(options) + STUDY = pop_specparams(STUDY, options{:}); + com = sprintf('STUDY = pop_specparams(STUDY, %s);', vararg2str( options )); + end; +else + + if strcmpi(varargin{1}, 'default') + STUDY = default_params(STUDY); + else + for index = 1:2:length(varargin) + if ~isempty(strmatch(varargin{index}, fieldnames(STUDY.etc.specparams), 'exact')) + STUDY.etc.specparams = setfield(STUDY.etc.specparams, varargin{index}, varargin{index+1}); + end; + end; + end; +end; + +% scan clusters and channels to remove specdata info if freqrange has changed +% ---------------------------------------------------------- +if ~isequal(STUDY.etc.specparams.freqrange, TMPSTUDY.etc.specparams.freqrange) | ... + ~isequal(STUDY.etc.specparams.subtractsubjectmean, TMPSTUDY.etc.specparams.subtractsubjectmean) + rmfields = { 'specdata' 'specfreqs' }; + for iField = 1:length(rmfields) + if isfield(STUDY.cluster, rmfields{iField}) + STUDY.cluster = rmfield(STUDY.cluster, rmfields{iField}); + end; + if isfield(STUDY.changrp, rmfields{iField}) + STUDY.changrp = rmfield(STUDY.changrp, rmfields{iField}); + end; + end; +end; + +function STUDY = default_params(STUDY) + if ~isfield(STUDY.etc, 'specparams'), STUDY.etc.specparams = []; end; + if ~isfield(STUDY.etc.specparams, 'topofreq'), STUDY.etc.specparams.topofreq = []; end; + if ~isfield(STUDY.etc.specparams, 'freqrange'), STUDY.etc.specparams.freqrange = []; end; + if ~isfield(STUDY.etc.specparams, 'ylim' ), STUDY.etc.specparams.ylim = []; end; + if ~isfield(STUDY.etc.specparams, 'subtractsubjectmean' ), STUDY.etc.specparams.subtractsubjectmean = 'off'; end; + if ~isfield(STUDY.etc.specparams, 'plotgroups'), STUDY.etc.specparams.plotgroups = 'apart'; end; + if ~isfield(STUDY.etc.specparams, 'plotconditions'), STUDY.etc.specparams.plotconditions = 'apart'; end; + if ~isfield(STUDY.etc.specparams, 'averagechan') , STUDY.etc.specparams.averagechan = 'off'; end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_statparams.m b/code/eeglab13_4_4b/functions/studyfunc/pop_statparams.m new file mode 100644 index 0000000..a8c49e3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_statparams.m @@ -0,0 +1,351 @@ +% pop_statparams() - helper function for pop_erspparams, pop_erpparams, and +% pop_specparams. +% +% Usage: +% >> struct = pop_statparams(struct, 'default'); +% >> struct = pop_statparams(struct, 'key', 'val', ...); +% +% Inputs: +% struct - parameter structure. When called with the 'default' +% option only, the function creates all the fields in +% the structure and populate these fields with default +% values. +% +% Statistics options: +% 'groupstats' - ['on'|'off'] Compute statistics across subject +% groups {default: 'off'} +% 'condstats' - ['on'|'off'] Compute statistics across data +% conditions {default: 'off'} +% 'statistics' - ['param'|'perm'|'bootstrap'] Type of statistics to compute +% 'param' for parametric (t-test/anova); 'perm' for +% permutation-based and 'bootstrap' for bootstrap +% {default: 'param'} +% 'singletrials' - ['on'|'off'] use single trials to compute statistics. +% This requires the measure to be computed with the +% 'savetrials', 'on' option. +% +% EEGLAB statistics: +% 'method' - ['parametric'|'permutation'|'bootstrap'] statistical +% method. See help statcond for more information. +% 'naccu' - [integer] Number of surrogate data averages to use in +% surrogate statistics. For instance, if p<0.01, +% use naccu>200. For p<0.001, naccu>2000. If a 'threshold' +% (not NaN) is set below and 'naccu' is too low, it will +% be automatically increased. (This keyword is currently +% only modifiable from the command line, not from the gui). +% 'alpha' - [NaN|alpha] Significance threshold (01, 'on', 'off'); + opt.enablegroup = fastif(length(STUDY.design(STUDY.currentdesign).variable(2).value)>1, 'on', 'off'); + opt.enablesingletrials = 'on'; + + % encode parameters + % ----------------- + paramstruct = STUDY.etc.statistics; + eeglabStatvalues = { 'param' 'perm' 'bootstrap' }; + fieldtripStatvalues = { 'analytic' 'montecarlo' }; + mCorrectList = { 'none' 'bonferoni' 'holms' 'fdr' 'max' 'cluster' }; + condstats = fastif(strcmpi(paramstruct.condstats, 'on'), 1, 0); + groupstats = fastif(strcmpi(paramstruct.groupstats,'on'), 1, 0); + statmode = fastif(strcmpi(paramstruct.singletrials,'on'), 1, 0); + eeglabThresh = fastif(isnan(paramstruct.eeglab.alpha),'exact', num2str(paramstruct.eeglab.alpha)); + fieldtripThresh = fastif(isnan(paramstruct.fieldtrip.alpha),'exact', num2str(paramstruct.fieldtrip.alpha)); + eeglabStat = strmatch(paramstruct.eeglab.method, eeglabStatvalues); + fieldtripStat = strmatch(paramstruct.fieldtrip.method, fieldtripStatvalues); + eeglabRand = fastif(isempty(paramstruct.eeglab.naccu), 'auto', num2str(paramstruct.eeglab.naccu)); + fieldtripRand = fastif(isempty(paramstruct.fieldtrip.naccu), 'auto', num2str(paramstruct.fieldtrip.naccu)); + eeglabMcorrect = strmatch(paramstruct.eeglab.mcorrect, mCorrectList); + fieldtripMcorrect = strmatch(paramstruct.fieldtrip.mcorrect, mCorrectList); + fieldtripClust = paramstruct.fieldtrip.clusterparam; + fieldtripChan = paramstruct.fieldtrip.channelneighborparam; + combootstrap = [ 'warndlg2( strvcat(''Warning: bootstrap is selected. Bootstrap currently'',' ... + '''overestimates significance by a factor of 2 for paired data '',' ... + '''(unpaired data is working properly). You should use'',' ... + '''permutation instead of bootstrap if you have paired data.'') );' ]; + cb_bootstrap = [ 'if get(gcbo, ''value'') == 3,' combootstrap ' end;' ]; + cb_help_neighbor = 'pophelp(''ft_prepare_neighbours'');'; + cb_help_cluster = 'pophelp(''ft_statistics_montecarlo'');'; + cb_textSyntax = 'try, eval( [ ''{'' get(gcbo, ''string'') ''};'' ]); catch, warndlg2(''Syntax error''); end;'; + if strcmpi(opt.enablecond , 'off') && condstats == 1, condstats = 0; end; + if strcmpi(opt.enablegroup, 'off') && groupstats == 1, groupstats = 0; end; + + % callback for randomization selection + % ------------------------------------ + cbSelectRandEeglab = [ 'set(findobj(gcbf, ''tag'', ''eeglabnaccu''), ''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''eeglabnaccutext''),''enable'', ''on'');' ]; + cbUnselectRandEeglab = [ 'set(findobj(gcbf, ''tag'', ''eeglabnaccu''), ''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''eeglabnaccutext''),''enable'', ''off'');' ]; + cbSelectRandFieldtrip = [ 'set(findobj(gcbf, ''tag'', ''fieldtripnaccu''), ''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''fieldtripnaccutext''),''enable'', ''on'');' ]; + cbUnselectRandFieldtrip = [ 'set(findobj(gcbf, ''tag'', ''fieldtripnaccu''), ''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''fieldtripnaccutext''),''enable'', ''off'');' ]; + cbSetFullMcorrectFieldtrip = 'set(findobj(gcbf, ''tag'', ''fieldtripmcorrect''), ''string'', ''Do not correct for multiple comparisons|Use Bonferoni correction|Use Holms correction|Use FDR correction|Use max correction|Use cluster correction (CC)'');'; + cbUnsetFullMcorrectFieldtrip = 'set(findobj(gcbf, ''tag'', ''fieldtripmcorrect''), ''value'', min(4, get(findobj(gcbf, ''tag'', ''fieldtripmcorrect''), ''value'')), ''string'', ''Do not correct for multiple comparisons|Use Bonferoni correction|Use Holms correction|Use FDR correction'');'; + cb_eeglab_statlist = [ 'if get(findobj(gcbf, ''tag'', ''stateeglab'' ),''value'') > 1,' cbSelectRandEeglab ',else,' cbUnselectRandEeglab ',end;' ]; + cb_fieldtrip_statlist = [ 'if get(findobj(gcbf, ''tag'', ''statfieldtrip'' ),''value'') > 1,' cbSelectRandFieldtrip cbSetFullMcorrectFieldtrip ',else,' cbUnselectRandFieldtrip cbUnsetFullMcorrectFieldtrip ',end;' ]; + + % callback for activating clusters inputs + % --------------------------------------- + cb_select_cluster = [ 'set(findobj(gcbf, ''tag'', ''clustertext1''),''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''clustertext2''),''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterhelp1''),''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterhelp2''),''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterchan'' ),''enable'', ''on'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterstat'' ),''enable'', ''on'');' ]; + cb_unselect_cluster = [ 'set(findobj(gcbf, ''tag'', ''clustertext1''),''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''clustertext2''),''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterhelp1''),''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterhelp2''),''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterchan'' ),''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''clusterstat'' ),''enable'', ''off'');' ]; + cb_fieldtrip_mcorrect = [ cb_fieldtrip_statlist 'if get(findobj(gcbf, ''tag'', ''fieldtripmcorrect'' ),''value'') == 6,' cb_select_cluster ',else,' cb_unselect_cluster ',end;' cb_fieldtrip_statlist]; % cb_fieldtrip_statlist repeated on purpose + + % callback for activating eeglab/fieldtrip + % ---------------------------------------- + enable_eeglab = [ 'set(findobj(gcbf, ''userdata'', ''eeglab'') ,''enable'', ''on'');' ... + 'set(findobj(gcbf, ''userdata'', ''fieldtrip''),''enable'', ''off'');' ... + 'set(findobj(gcbf, ''tag'', ''but_eeglab'') ,''value'', 1);' ... + 'set(findobj(gcbf, ''tag'', ''but_fieldtrip''),''value'', 0);' cb_eeglab_statlist ]; + + enable_fieldtrip=[ 'if get(findobj(gcbf, ''tag'', ''condstats''), ''value'') && get(findobj(gcbf, ''tag'', ''groupstats''), ''value''),' ... + enable_eeglab ... + 'warndlg2(strvcat(''Switching to EEGLAB statistics since'',''Fieldtrip cannot perform 2-way statistics''));' ... + 'else,' ... + ' set(findobj(gcbf, ''userdata'', ''eeglab'') ,''enable'', ''off'');' ... + ' set(findobj(gcbf, ''userdata'', ''fieldtrip''),''enable'', ''on'');' ... + ' set(findobj(gcbf, ''tag'', ''but_fieldtrip''),''value'', 1);' ... + ' set(findobj(gcbf, ''tag'', ''but_eeglab'') ,''value'', 0);' cb_fieldtrip_mcorrect ... + 'end;']; + + cb_select_fieldtrip = [ 'if get(findobj(gcbf, ''tag'', ''but_fieldtrip''),''value''),' enable_fieldtrip ',else,' enable_eeglab ',end;' ]; + cb_select_eeglab = [ 'if get(findobj(gcbf, ''tag'', ''but_eeglab''),''value''),,' enable_eeglab ',else,' enable_fieldtrip ',end;' ]; + + if strcmpi(paramstruct.mode, 'eeglab'), evalstr = enable_eeglab; + else evalstr = enable_fieldtrip; + end; + inds = findstr('gcbf', evalstr); + evalstr(inds+2) = []; + + % special case if Fieldtrip is not installed + if ~fieldtripInstalled + strFieldtrip = 'Use Fieldtrip statistics (to use install "Fieldtrip-lite" using File > Manage EEGLAB extensions)'; + fieldtripEnable = 'off'; + cb_select_eeglab = 'set(findobj(gcbf, ''tag'', ''but_eeglab''),''value'', 1)'; + else + strFieldtrip = 'Use Fieldtrip statistics'; + fieldtripEnable = 'on'; + end; + + opt.uilist = { ... + {'style' 'text' 'string' 'General statistical parameters' 'fontweight' 'bold' } ... + {} {'style' 'checkbox' 'string' 'Compute 1st independent variable statistics' 'value' condstats 'enable' opt.enablecond 'callback' cb_select_fieldtrip 'tag' 'condstats' } ... + {} {'style' 'checkbox' 'string' 'Compute 2nd independent variable statistics' 'value' groupstats 'enable' opt.enablegroup 'callback' cb_select_fieldtrip 'tag' 'groupstats' } ... + {} {'style' 'checkbox' 'string' 'Use single trials (when available)' 'value' statmode 'tag' 'singletrials' 'enable' opt.enablesingletrials } ... + {} ... + {'style' 'checkbox' 'string' 'Use EEGLAB statistics' 'fontweight' 'bold' 'tag' 'but_eeglab' 'callback' cb_select_eeglab } ... + {} {'style' 'popupmenu' 'string' 'Use parametric statistics|Use permutation statistics|Use bootstrap statistics' 'tag' 'stateeglab' 'value' eeglabStat 'listboxtop' eeglabStat 'callback' [ cb_eeglab_statlist cb_bootstrap ] 'userdata' 'eeglab' } ... + {'style' 'text' 'string' 'Statistical threshold (p-value)' 'userdata' 'eeglab'} ... + {'style' 'edit' 'string' eeglabThresh 'tag' 'eeglabalpha' 'userdata' 'eeglab' } ... + {} {'style' 'popupmenu' 'string' 'Do not correct for multiple comparisons|Use Bonferoni correction|Use Holms correction|Use FDR correction' 'value' eeglabMcorrect 'listboxtop' eeglabMcorrect 'tag' 'eeglabmcorrect' 'userdata' 'eeglab' } ... + {'style' 'text' 'string' ' Randomization (n)' 'userdata' 'eeglab' 'tag' 'eeglabnaccutext' } ... + {'style' 'edit' 'string' eeglabRand 'userdata' 'eeglab' 'tag' 'eeglabnaccu' } ... + {} ... + {'style' 'checkbox' 'string' strFieldtrip 'enable' fieldtripEnable 'fontweight' 'bold' 'tag' 'but_fieldtrip' 'callback' cb_select_fieldtrip } ... + {} {'style' 'popupmenu' 'string' 'Use analytic/parametric statistics|Use montecarlo/permutation statistics' 'tag' 'statfieldtrip' 'value' fieldtripStat 'listboxtop' fieldtripStat 'callback' cb_fieldtrip_mcorrect 'userdata' 'fieldtrip' } ... + {'style' 'text' 'string' 'Statistical threshold (p-value)' 'userdata' 'fieldtrip' } ... + {'style' 'edit' 'string' fieldtripThresh 'tag' 'fieldtripalpha' 'userdata' 'fieldtrip' } ... + {} {'style' 'popupmenu' 'string' 'Do not correct for multiple comparisons|Use Bonferoni correction|Use Holms correction|Use FDR correction|Use max correction|Use cluster correction (CC)' 'tag' 'fieldtripmcorrect' 'value' fieldtripMcorrect 'listboxtop' fieldtripMcorrect 'callback' cb_fieldtrip_mcorrect 'userdata' 'fieldtrip' } ... + {'style' 'text' 'string' ' Randomization (n)' 'userdata' 'fieldtrip' 'tag' 'fieldtripnaccutext' } ... + {'style' 'edit' 'string' fieldtripRand 'userdata' 'fieldtrip' 'tag' 'fieldtripnaccu' } ... + {} {'style' 'text' 'string' 'CC channel neighbor parameters' 'userdata' 'fieldtrip' 'tag' 'clustertext1' } ... + { 'style' 'edit' 'string' fieldtripChan 'userdata' 'fieldtrip' 'tag' 'clusterchan' 'callback' cb_textSyntax } ... + { 'style' 'pushbutton' 'string' 'help' 'callback' cb_help_neighbor 'userdata' 'fieldtrip' 'tag' 'clusterhelp1' } ... + {} {'style' 'text' 'string' 'CC clustering parameters' 'userdata' 'fieldtrip' 'tag' 'clustertext2' } ... + { 'style' 'edit' 'string' fieldtripClust 'userdata' 'fieldtrip' 'tag' 'clusterstat' 'callback' cb_textSyntax } ... + { 'style' 'pushbutton' 'string' 'help' 'callback' cb_help_cluster 'userdata' 'fieldtrip' 'tag' 'clusterhelp2' } ... + }; + + if eeglabStat == 3, + eval(combootstrap); + end; + + cbline = [0.07 1.1]; + otherline = [ 0.7 0.6 .5]; + eeglabline = [ 0.7 0.6 .5]; + opt.geometry = { [1] cbline cbline cbline [1] [1] [0.07 0.51 0.34 0.13] [0.07 0.6 0.25 0.13] ... + [1] [1] [0.07 0.51 0.34 0.13] [0.07 0.6 0.25 0.13] [0.13 0.4 0.4 0.1] [0.13 0.4 0.4 0.1] }; + + [out_param userdat tmp res] = inputgui( 'geometry' , opt.geometry, 'uilist', opt.uilist, ... + 'title', 'Set statistical parameters -- pop_statparams()','eval', evalstr); + if isempty(res), return; end; + + % decode paramters + % ---------------- + if res.groupstats, res.groupstats = 'on'; else res.groupstats = 'off'; end; + if res.condstats , res.condstats = 'on'; else res.condstats = 'off'; end; + if res.singletrials, res.singletrials = 'on'; else res.singletrials = 'off'; end; + res.eeglabalpha = str2num(res.eeglabalpha); + res.fieldtripalpha = str2num(res.fieldtripalpha); + if isempty(res.eeglabalpha) ,res.eeglabalpha = NaN; end; + if isempty(res.fieldtripalpha),res.fieldtripalpha = NaN; end; + res.stateeglab = eeglabStatvalues{res.stateeglab}; + res.statfieldtrip = fieldtripStatvalues{res.statfieldtrip}; + res.eeglabmcorrect = mCorrectList{res.eeglabmcorrect}; + res.fieldtripmcorrect = mCorrectList{res.fieldtripmcorrect}; + res.mode = fastif(res.but_eeglab, 'eeglab', 'fieldtrip'); + res.eeglabnaccu = str2num(res.eeglabnaccu); + if ~isstr(res.fieldtripnaccu) || ~strcmpi(res.fieldtripnaccu, 'all') + res.fieldtripnaccu = str2num(res.fieldtripnaccu); + end; + + % build command call + % ------------------ + options = {}; + if ~strcmpi( res.groupstats, paramstruct.groupstats), options = { options{:} 'groupstats' res.groupstats }; end; + if ~strcmpi( res.condstats , paramstruct.condstats ), options = { options{:} 'condstats' res.condstats }; end; + if ~strcmpi( res.singletrials, paramstruct.singletrials ), options = { options{:} 'singletrials' res.singletrials }; end; + if ~strcmpi( res.mode , paramstruct.mode), options = { options{:} 'mode' res.mode }; end; % statistics + if ~isequal( res.eeglabnaccu , paramstruct.eeglab.naccu), options = { options{:} 'naccu' res.eeglabnaccu }; end; + if ~strcmpi( res.stateeglab , paramstruct.eeglab.method), options = { options{:} 'method' res.stateeglab }; end; % statistics + if ~strcmpi( res.eeglabmcorrect , paramstruct.eeglab.mcorrect), options = { options{:} 'mcorrect' res.eeglabmcorrect }; end; + if ~isequal( res.fieldtripnaccu , paramstruct.fieldtrip.naccu), options = { options{:} 'fieldtripnaccu' res.fieldtripnaccu }; end; + if ~strcmpi( res.statfieldtrip , paramstruct.fieldtrip.method), options = { options{:} 'fieldtripmethod' res.statfieldtrip }; end; + if ~strcmpi( res.fieldtripmcorrect , paramstruct.fieldtrip.mcorrect), options = { options{:} 'fieldtripmcorrect' res.fieldtripmcorrect }; end; + if ~strcmpi( res.clusterstat , paramstruct.fieldtrip.clusterparam), options = { options{:} 'fieldtripclusterparam' res.clusterstat }; end; + if ~strcmpi( res.clusterchan , paramstruct.fieldtrip.channelneighborparam), options = { options{:} 'fieldtripchannelneighborparam' res.clusterchan }; end; + if ~(isnan(res.eeglabalpha(1)) && isnan(paramstruct.eeglab.alpha(1))) && ~isequal(res.eeglabalpha, paramstruct.eeglab.alpha) % threshold + options = { options{:} 'alpha' res.eeglabalpha }; + end; + if ~(isnan(res.fieldtripalpha(1)) && isnan(paramstruct.fieldtrip.alpha(1))) && ~isequal(res.fieldtripalpha, paramstruct.fieldtrip.alpha) % threshold + options = { options{:} 'fieldtripalpha' res.fieldtripalpha }; + end; + + if ~isempty(options) + STUDY = pop_statparams(STUDY, options{:}); + com = sprintf('STUDY = pop_statparams(STUDY, %s);', vararg2str( options )); + end; +else + % interpret parameters + % -------------------- + if isfield(STUDY, 'etc') + paramstruct = STUDY.etc.statistics; isstudy = true; + else paramstruct = STUDY; + if isempty(paramstruct), paramstruct = default_stats([]); end; + isstudy = false; + end; + + if isempty(varargin) || strcmpi(varargin{1}, 'default') + paramstruct = default_stats(paramstruct); + else + for index = 1:2:length(varargin) + v = varargin{index}; + if strcmpi(v, 'statistics'), v = 'method'; end; % backward compatibility + if strcmpi(v, 'threshold' ), v = 'alpha'; end; % backward compatibility + + if strcmpi(v, 'alpha') || strcmpi(v, 'method') || strcmpi(v, 'naccu') || strcmpi(v, 'mcorrect') + paramstruct = setfield(paramstruct, 'eeglab', v, varargin{index+1}); + elseif ~isempty(findstr('fieldtrip', v)) + v2 = v(10:end); + paramstruct = setfield(paramstruct, 'fieldtrip', v2, varargin{index+1}); + if strcmpi(v2, 'channelneighborparam') + paramstruct.fieldtrip.channelneighbor = []; % reset neighbor matrix if parameter change + end; + else + if (~isempty(paramstruct) && ~isempty(strmatch(v, fieldnames(paramstruct), 'exact'))) || ~isstudy + paramstruct = setfield(paramstruct, v, varargin{index+1}); + end; + end; + end; + end; + + if isfield(STUDY, 'etc') + STUDY.etc.statistics = paramstruct; + else STUDY = paramstruct; + end; +end; + +% default parameters +% ------------------ +function paramstruct = default_stats(paramstruct) + +if ~isfield(paramstruct, 'groupstats'), paramstruct.groupstats = 'off'; end; +if ~isfield(paramstruct, 'condstats' ), paramstruct.condstats = 'off'; end; +if ~isfield(paramstruct, 'singletrials' ), paramstruct.singletrials = 'off'; end; +if ~isfield(paramstruct, 'mode' ), paramstruct.mode = 'eeglab'; end; +if ~isfield(paramstruct, 'eeglab'), paramstruct.eeglab = []; end; +if ~isfield(paramstruct, 'fieldtrip'), paramstruct.fieldtrip = []; end; +if ~isfield(paramstruct.eeglab, 'naccu'), paramstruct.eeglab.naccu = []; end; +if ~isfield(paramstruct.eeglab, 'alpha' ), paramstruct.eeglab.alpha = NaN; end; +if ~isfield(paramstruct.eeglab, 'method'), paramstruct.eeglab.method = 'param'; end; +if ~isfield(paramstruct.eeglab, 'mcorrect'), paramstruct.eeglab.mcorrect = 'none'; end; +if ~isfield(paramstruct.fieldtrip, 'naccu'), paramstruct.fieldtrip.naccu = []; end; +if ~isfield(paramstruct.fieldtrip, 'method'), paramstruct.fieldtrip.method = 'analytic'; end; +if ~isfield(paramstruct.fieldtrip, 'alpha'), paramstruct.fieldtrip.alpha = NaN; end; +if ~isfield(paramstruct.fieldtrip, 'mcorrect'), paramstruct.fieldtrip.mcorrect = 'none'; end; +if ~isfield(paramstruct.fieldtrip, 'clusterparam'), paramstruct.fieldtrip.clusterparam = '''clusterstatistic'',''maxsum'''; end; +if ~isfield(paramstruct.fieldtrip, 'channelneighbor'), paramstruct.fieldtrip.channelneighbor = []; end; +if ~isfield(paramstruct.fieldtrip, 'channelneighborparam'), paramstruct.fieldtrip.channelneighborparam = '''method'',''triangulation'''; end; +if strcmpi(paramstruct.eeglab.mcorrect, 'benferoni'), paramstruct.eeglab.mcorrect = 'bonferoni'; end; +if strcmpi(paramstruct.eeglab.mcorrect, 'no'), paramstruct.eeglab.mcorrect = 'none'; end; +if strcmpi(paramstruct.fieldtrip.mcorrect, 'no'), paramstruct.fieldtrip.mcorrect = 'none'; end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_study.m b/code/eeglab13_4_4b/functions/studyfunc/pop_study.m new file mode 100644 index 0000000..0fa88b1 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_study.m @@ -0,0 +1,660 @@ +% pop_study() - create a new STUDY set structure defining a group of related EEG datasets. +% The STUDY set also contains information about each of the datasets: the +% subject code, subject group, experimental condition, and session. This can +% be provided interactively in a pop-up window or be automatically filled +% in by the function. Defaults: Assume a different subject for each +% dataset and only one condition; leave subject group and session fields +% empty. Additional STUDY information about the STUDY name, task and +% miscellaneous notes can also be saved in the STUDY structure. +% Usage: +% >> [ STUDY ALLEEG ] = pop_study([],[], 'gui', 'on'); % create new study interactively +% >> [ STUDY ALLEEG ] = pop_study(STUDY, ALLEEG, 'gui', 'on'); % edit study interactively +% >> [ STUDY ALLEEG ] = pop_study(STUDY, ALLEEG, 'key', 'val', ...); % edit study +% +% Optional Inputs: +% STUDY - existing study structure. +% ALLEEG - vector of EEG dataset structures to be included in the STUDY. +% +% Optional Inputs: +% All "'key', 'val'" inputs of std_editset() may be used. +% +% Outputs: +% STUDY - new STUDY set comprising some or all of the datasets in +% ALLEEG, plus other information about the experiments. +% ALLEEG - an updated ALLEEG structure including the STUDY datasets. +% +% Graphic interface buttons: +% "STUDY set name" - [edit box] name for the STUDY structure {default: ''} +% "STUDY set task name" - [edit box] name for the task performed by the subject {default: ''} +% "STUDY set notes" - [edit box] notes about the experiment, the datasets, the STUDY, +% or anything else to store with the rest of the STUDY information +% {default: ''} +% "subject" - [edit box] subject code associated with the dataset. If no +% subject code is provided, each dataset will assumed to be from +% a different subject {default: 'S1', 'S2', ..., 'Sn'} +% "session" - [edit box] dataset session. If no session information is +% provided, all datasets that belong to one subject are assumed to +% have been recorded within one session {default: []} +% "condition" - [edit box] dataset condition. If no condition code is provided, +% all datasets are assumed to be from the same condition {default:[]} +% "group" - [edit box] the subject group the dataset belongs to. If no group +% is provided, all subjects and datasets are assumed to belong to +% the same group. {default: []} +% "Save this STUDY set to disk file" - [check box] If checked, save the new STUDY set +% structure to disk. If no filename is provided, a window will +% pop up to ask for it. +% +% See also: std_editset, pop_loadstudy(), pop_preclust(), pop_clust() +% +% Authors: Arnaud Delorme, Hilit Serby, Scott Makeig, SCCN, INC, UCSD, July 22, 2005 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, July 22, 2005, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Coding notes: Useful information on functions and global variables used. + +function [STUDY, ALLEEG, com] = pop_study(STUDY, ALLEEG, varargin) + +com = ''; + +if nargin < 1 + help pop_study; + return; +end + +% type of call (gui, script or internal) +% -------------------------------------- +mode = 'internal_command'; +if ~isstr(STUDY) %intial settings + mode = 'script'; + if nargin > 2 + for index = 1:length(varargin) + if isstr(varargin{index}) + if strcmpi(varargin{index}, 'gui') + mode = 'gui'; + end; + end; + end; + end; +end; + +if isempty(STUDY) + newstudy = 1; + STUDY.name = ''; + STUDY.task = ''; + STUDY.notes = ''; + STUDY.filename = ''; + STUDY.cluster = []; + STUDY.history = 'STUDY = [];'; +else + newstudy = 0; +end; + +if strcmpi(mode, 'script') % script mode + [STUDY ALLEEG] = std_editset(STUDY, ALLEEG, varargin{:}); + return; +elseif strcmpi(mode, 'gui') % GUI mode + % show warning if necessary + % ------------------------- + if isreal(ALLEEG) + if ALLEEG == 0 + res = questdlg2( strvcat('Datasets currently loaded will be removed from EEGLAB memory.', ... + 'Are you sure you want to continue?'), ... + 'Discard loaded EEGLAB datasets?', 'Cancel', 'Yes', 'Yes'); + if strcmpi(res, 'cancel'), return; end; + end; + ALLEEG = []; + end; + + % set initial datasetinfo + % ----------------------- + if isfield(STUDY, 'datasetinfo') + datasetinfo = STUDY.datasetinfo; + different = 0; + for k = 1:length(ALLEEG) + if ~strcmpi(datasetinfo(k).filename, ALLEEG(k).filename), different = 1; break; end; + if ~strcmpi(datasetinfo(k).subject, ALLEEG(k).subject), different = 1; break; end; + if ~strcmpi(datasetinfo(k).condition, ALLEEG(k).condition), different = 1; break; end; + if ~strcmpi(char(datasetinfo(k).group), char(ALLEEG(k).group)), different = 1; break; end; + if datasetinfo(k).session ~= ALLEEG(k).session, different = 1; break; end; + end + if different + info = 'from_STUDY_different_from_ALLEEG'; + else + info = 'from_STUDY'; + end; + if ~isfield(datasetinfo, 'comps'); + datasetinfo(1).comps = []; + end; + else + info = 'from_ALLEEG'; + if length(ALLEEG) > 0 + datasetinfo(length(ALLEEG)).filename = []; + datasetinfo(length(ALLEEG)).filepath = []; + datasetinfo(length(ALLEEG)).subject = []; + datasetinfo(length(ALLEEG)).session = []; + datasetinfo(length(ALLEEG)).condition = []; + datasetinfo(length(ALLEEG)).group = []; + for k = 1:length(ALLEEG) + datasetinfo(k).filename = ALLEEG(k).filename; + datasetinfo(k).filepath = ALLEEG(k).filepath; + datasetinfo(k).subject = ALLEEG(k).subject; + datasetinfo(k).session = ALLEEG(k).session; + datasetinfo(k).condition = ALLEEG(k).condition; + datasetinfo(k).group = ALLEEG(k).group; + end + if ~isfield(datasetinfo, 'comps'); + datasetinfo(1).comps = []; + end; + else + datasetinfo = []; + end; + end; + + nextpage = 'pop_study(''nextpage'', gcbf);'; + prevpage = 'pop_study(''prevpage'', gcbf);'; + delset = 'pop_study(''clear'', gcbf, get(gcbo, ''userdata''));'; + loadset = 'pop_study(''load'', gcbf, get(guiind, ''userdata''), get(guiind, ''string'')); clear guiind;'; + loadsetedit = [ 'guiind = gcbo;' loadset ]; + subcom = 'pop_study(''subject'' , gcbf, get(gcbo, ''userdata''), get(gcbo, ''string''));'; + sescom = 'pop_study(''session'' , gcbf, get(gcbo, ''userdata''), get(gcbo, ''string''));'; + condcom = 'pop_study(''condition'', gcbf, get(gcbo, ''userdata''), get(gcbo, ''string''));'; + grpcom = 'pop_study(''group'' , gcbf, get(gcbo, ''userdata''), get(gcbo, ''string''));'; + compcom = 'pop_study(''component'', gcbf, get(gcbo, ''userdata''), get(gcbo, ''string''));'; + cb_del = 'pop_study(''delclust'' , gcbf, ''showwarning'');'; + cb_dipole = 'pop_study(''dipselect'', gcbf, ''showwarning'');'; + + browsestudy = [ '[filename, filepath] = uiputfile2(''*.study'', ''Use exsiting STUDY set to import dataset information -- pop_study()''); ' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''usestudy_file''), ''string'', [filepath filename]);' ]; + saveSTUDY = [ 'set(findobj(''parent'', gcbf, ''userdata'', ''save''), ''enable'', fastif(get(gcbo, ''value'')==1, ''on'', ''off''));' ]; + browsesave = [ '[filename, filepath] = uiputfile2(''*.study'', ''Save STUDY with .study extension -- pop_clust()''); ' ... + 'if filename ~= 0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''studyfile''), ''string'', [filepath filename]);' ... + 'end;' ... + 'clear filename filepath;' ]; + + texthead = fastif(newstudy, 'Create a new STUDY set', 'Edit STUDY set information - remember to save changes'); + guispec = { ... + {'style' 'text' 'string' texthead 'FontWeight' 'Bold' 'HorizontalAlignment' 'center'} ... + {} {'style' 'text' 'string' 'STUDY set name:' } { 'style' 'edit' 'string' STUDY.name 'tag' 'study_name' } ... + {} {'style' 'text' 'string' 'STUDY set task name:' } { 'style' 'edit' 'string' STUDY.task 'tag' 'study_task' } ... + {} {'style' 'text' 'string' 'STUDY set notes:' } { 'style' 'edit' 'string' STUDY.notes 'tag' 'study_notes' } {}... + {} ... + {'style' 'text' 'string' 'dataset filename' 'userdata' 'addt'} {'style' 'text' 'string' 'browse' 'userdata' 'addt'} ... + {'style' 'text' 'string' 'subject' 'userdata' 'addt'} ... + {'style' 'text' 'string' 'session' 'userdata' 'addt'} ... + {'style' 'text' 'string' 'condition' 'userdata' 'addt'} ... + {'style' 'text' 'string' 'group' 'userdata' 'addt'} ... + {'style' 'pushbutton' 'string' 'Select by r.v.' 'userdata' 'addt' 'callback' cb_dipole } ... + {} }; + guigeom = { [1] [0.2 1 3.5] [0.2 1 3.5] [0.2 1 3.5] [1] [0.2 1.05 0.35 0.4 0.35 0.6 0.4 0.6 0.3]}; + + % create edit boxes + % ----------------- + for index = 1:10 + guigeom = { guigeom{:} [0.2 1 0.2 0.5 0.2 0.5 0.5 0.5 0.3] }; + select_com = ['[inputname, inputpath] = uigetfile2(''*.set;*.SET'', ''Choose dataset to add to STUDY -- pop_study()'');'... + 'if inputname ~= 0,' ... + ' guiind = findobj(''parent'', gcbf, ''tag'', ''set' int2str(index) ''');' ... + ' set( guiind,''string'', [inputpath inputname]);' ... + loadset ... + 'end; clear inputname inputpath;']; + numstr = int2str(index); + guispec = { guispec{:}, ... + {'style' 'text' 'string' numstr 'tag' [ 'num' int2str(index) ] 'userdata' index }, ... + {'style' 'edit' 'string' '' 'tag' [ 'set' int2str(index) ] 'userdata' index 'callback' loadsetedit}, ... + {'style' 'pushbutton' 'string' '...' 'tag' [ 'brw' int2str(index) ] 'userdata' index 'Callback' select_com}, ... + {'style' 'edit' 'string' '' 'tag' [ 'sub' int2str(index) ] 'userdata' index 'Callback' subcom}, ... + {'style' 'edit' 'string' '' 'tag' [ 'sess' int2str(index) ] 'userdata' index 'Callback' sescom}, ... + {'style' 'edit' 'string' '' 'tag' [ 'cond' int2str(index) ] 'userdata' index 'Callback' condcom}, ... + {'style' 'edit' 'string' '' 'tag' [ 'group' int2str(index) ] 'userdata' index 'Callback' grpcom}, ... + {'style' 'pushbutton' 'string' 'All comp.' 'tag' [ 'comps' int2str(index) ] 'userdata' index 'Callback' compcom}, ... + {'style' 'pushbutton' 'string' 'CLear' 'tag' [ 'clear' int2str(index) ] 'userdata' index 'callback' delset} }; + end; + + if strcmpi(info, 'from_STUDY_different_from_ALLEEG') + text1 = 'Dataset info (condition, group, ...) differs from study info. [set] = Overwrite dataset info for each dataset on disk.'; + value_cb = 0; + else + text1 = 'Update dataset info - datasets stored on disk will be overwritten (unset = Keep study info separate).'; + value_cb = 1; + end; + guispec = { guispec{:}, ... + {'style' 'text' 'string' 'Important note: Removed datasets will not be saved before being deleted from EEGLAB memory' }, ... + {}, ... + {'style' 'pushbutton' 'string' '<' 'Callback' prevpage 'userdata' 'addt'}, ... + {'style' 'text' 'string' 'Page 1' 'tag' 'page' 'horizontalalignment' 'center' }, ... + {'style' 'pushbutton' 'string' '>' 'Callback' nextpage 'userdata' 'addt'}, {}, ... + {}, ... + {'style' 'checkbox' 'value' value_cb 'tag' 'copy_to_dataset' }, ... + {'style' 'text' 'string' text1 }, ... + {'style' 'checkbox' 'value' 0 'tag' 'delclust' 'callback' cb_del }, ... + {'style' 'text' 'string' 'Delete cluster information (to allow loading new datasets, set new components for clustering, etc.)' } }; + guigeom = { guigeom{:} [1] [1 0.2 0.3 0.2 1] [1] [0.14 3] [0.14 3] }; + +% if ~isempty(STUDY.filename) +% guispec{end-3} = {'style' 'checkbox' 'string' '' 'value' 0 'tag' 'studyfile' }; +% guispec{end-2} = {'style' 'text' 'string' 'Re-save STUDY. Uncheck and use menu File > Save study as to save under a new filename'}; +% guispec(end-1) = []; +% guigeom{end-1} = [0.14 3]; +% end; + + fig_arg{1} = ALLEEG; % datasets + fig_arg{2} = datasetinfo; % datasetinfo + fig_arg{3} = 1; % page + fig_arg{4} = {}; % all commands + fig_arg{5} = (length(STUDY.cluster) > 1); % are cluster present + fig_arg{6} = STUDY; % are cluster present + + % generate GUI + % ------------ + optiongui = { 'geometry', guigeom, ... + 'uilist' , guispec, ... + 'helpcom' , 'pophelp(''pop_study'')', ... + 'title' , 'Create a new STUDY set -- pop_study()', ... + 'userdata', fig_arg, ... + 'eval' , 'pop_study(''delclust'', gcf); pop_study(''redraw'', gcf);' }; + [result, userdat2, strhalt, outstruct] = inputgui( 'mode', 'noclose', optiongui{:}); + if isempty(result), return; end; + if ~isempty(get(0, 'currentfigure')) currentfig = gcf; end; + + while test_wrong_parameters(currentfig) + [result, userdat2, strhalt, outstruct] = inputgui( 'mode', currentfig, optiongui{:}); + if isempty(result), return; end; + end; + close(currentfig); + + % convert GUI selection to options + % -------------------------------- + allcom = simplifycom(userdat2{4}); + options = {}; + if ~strcmpi(result{1}, STUDY.name ), options = { options{:} 'name' result{1} }; end; + if ~strcmpi(result{2}, STUDY.task ), options = { options{:} 'task' result{2} }; end; + if ~strcmpi(result{3}, STUDY.notes), options = { options{:} 'notes' result{3} }; end; + if ~isempty(allcom), options = { options{:} 'commands' allcom }; end; +% if isnumeric(outstruct(1).studyfile) +% if outstruct(1).studyfile == 1, options = { options{:} 'resave' 'on' }; end; +% else +% if ~isempty(outstruct(1).studyfile), options = { options{:} 'filename' outstruct(1).studyfile }; end; +% end; + if outstruct(1).copy_to_dataset == 1 + options = { options{:} 'updatedat' 'on' }; + eeglab_options; + if option_storedisk + options = { options{:} 'savedat' 'on' }; + end; + else options = { options{:} 'updatedat' 'off' }; + end; + if outstruct(1).delclust == 1 + options = { options{:} 'rmclust' 'on' }; + end; + + % check channel labels + % -------------------- + ALLEEG = userdat2{1}; + if isfield(ALLEEG, 'chanlocs') + allchans = { ALLEEG.chanlocs }; + if any(cellfun('isempty', allchans)) + txt = strvcat('Some datasets do not have channel labels. Do you wish to generate', ... + 'channel labels automatically for all datasets ("1" for channel 1,', ... + '"2" for channel 2, ...). Datasets will be overwritten on disk.', ... + 'If you abort, the STUDY will not be created.'); + res = questdlg2(txt, 'Dataset format problem', 'Yes', 'No, abort', 'Yes'); + if strcmpi(res, 'yes'), options = { options{:} 'addchannellabels' 'on' 'savedat' 'on'}; + else return; + end; + end; + end; + + % run command and create history + % ------------------------------ + com = sprintf( '[STUDY ALLEEG] = std_editset( STUDY, ALLEEG, %s );\n[STUDY ALLEEG] = std_checkset(STUDY, ALLEEG);', vararg2str(options) ); + [STUDY ALLEEG] = std_editset(STUDY, ALLEEG, options{:}); + +else % internal command + + com = STUDY; + hdl = ALLEEG; %figure handle + + % userdata info + % ------------- + userdat = get(hdl, 'userdata'); + ALLEEG = userdat{1}; + datasetinfo = userdat{2}; + page = userdat{3}; + allcom = userdat{4}; + clusterpresent = userdat{5}; + STUDY = userdat{6}; + + switch com + case 'subject' + guiindex = varargin{1}; + realindex = guiindex+(page-1)*10; + + datasetinfo(realindex).subject = varargin{2}; + if get(findobj(hdl, 'tag', 'copy_to_dataset'), 'value') + ALLEEG(realindex).subject = varargin{2}; + end; + allcom = { allcom{:}, { 'index' realindex 'subject' varargin{2} } }; + userdat{1} = ALLEEG; + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + + case 'session' + guiindex = varargin{1}; + realindex = guiindex+(page-1)*10; + datasetinfo(realindex).session = str2num(varargin{2}); + if get(findobj(hdl, 'tag', 'copy_to_dataset'), 'value') + ALLEEG(realindex).session = str2num(varargin{2}); + end; + allcom = { allcom{:}, { 'index' realindex 'session' str2num(varargin{2}) } }; + userdat{1} = ALLEEG; + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + + case 'group' + guiindex = varargin{1}; + realindex = guiindex+(page-1)*10; + datasetinfo(realindex).group = varargin{2}; + if get(findobj(hdl, 'tag', 'copy_to_dataset'), 'value') + ALLEEG(realindex).group = varargin{2}; + end; + allcom = { allcom{:}, { 'index' realindex 'group' varargin{2} } }; + userdat{1} = ALLEEG; + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + + case 'condition' + guiindex = varargin{1}; + realindex = guiindex+(page-1)*10; + datasetinfo(realindex).condition = varargin{2}; + if get(findobj(hdl, 'tag', 'copy_to_dataset'), 'value') + ALLEEG(realindex).conditon = varargin{2}; + end; + allcom = { allcom{:}, { 'index' realindex 'condition' varargin{2} } }; + userdat{1} = ALLEEG; + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + + case 'dipselect' + STUDY.datasetinfo = datasetinfo; + + res = inputdlg2_with_checkbox( { strvcat('Enter maximum residual (topo map - dipole proj.) var. (in %)', ... + 'NOTE: This will delete any existing component clusters!') }, ... + 'pop_study(): Pre-select components', 1, { '15' },'pop_study' ); + + if isempty(res), return; end; + if res{2} == 1 + STUDY = std_editset(STUDY, ALLEEG, 'commands', { 'inbrain', 'on', 'dipselect' str2num(res{1})/100 'return' }); + allcom = { allcom{:}, { 'inbrain', 'on', 'dipselect' str2num(res{1})/100 } }; + else + STUDY = std_editset(STUDY, ALLEEG, 'commands', { 'inbrain', 'off','dipselect' str2num(res{1})/100 'return' }); + allcom = { allcom{:}, { 'inbrain', 'off', 'dipselect' str2num(res{1})/100 } }; + end; + + datasetinfo = STUDY.datasetinfo; + + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + set(findobj(hdl, 'tag', 'delclust'), 'value', 1); + pop_study('delclust', hdl); + pop_study('redraw', hdl); + + case 'component' + guiindex = varargin{1}; + realindex = guiindex+(page-1)*10; + + for index = 1:size(ALLEEG(realindex).icaweights,1) + complist{index} = [ 'IC ' int2str(index) ]; + end; + [tmps,tmpv] = listdlg2('PromptString', 'Select components', 'SelectionMode', ... + 'multiple', 'ListString', strvcat(complist), 'initialvalue', datasetinfo(realindex).comps); + if tmpv ~= 0 % no cancel + + % find other subjects with the same session + % ----------------------------------------- + for index = 1:length(datasetinfo) + if realindex == index | (strcmpi(datasetinfo(index).subject, datasetinfo(realindex).subject) & ... + ~isempty(datasetinfo(index).subject) & ... + isequal( datasetinfo(index).session, datasetinfo(realindex).session ) ) + datasetinfo(index).comps = tmps; + allcom = { allcom{:}, { 'index' index 'comps' tmps } }; + set(findobj('tag', [ 'comps' int2str(index) ]), ... + 'string', formatbut(tmps), 'horizontalalignment', 'left'); + end; + end; + + end; + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + pop_study('redraw', hdl); + + case 'clear' + guiindex = varargin{1}; + realindex = guiindex+(page-1)*10; + + datasetinfo(realindex).filename = ''; + datasetinfo(realindex).filepath = ''; + datasetinfo(realindex).subject = ''; + datasetinfo(realindex).session = []; + datasetinfo(realindex).condition = ''; + datasetinfo(realindex).group = ''; + datasetinfo(realindex).comps = []; + + allcom = { allcom{:}, { 'remove' realindex } }; + userdat{1} = ALLEEG; + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + pop_study('redraw', hdl); + + case 'nextpage' + userdat{3} = page+1; + set(hdl, 'userdata', userdat); + pop_study('redraw', hdl); + + case 'prevpage' + userdat{3} = max(1,page-1); + set(hdl, 'userdata', userdat); + pop_study('redraw', hdl); + + case 'load' + guiindex = varargin{1}; + filename = varargin{2}; + realindex = guiindex+(page-1)*10; + + % load dataset + % ------------ + TMPEEG = pop_loadset('filename', filename, 'loadmode', 'info'); + ALLEEG = eeg_store(ALLEEG, eeg_checkset(TMPEEG), realindex); + + % update datasetinfo structure + % ---------------------------- + datasetinfo(realindex).filename = ALLEEG(realindex).filename; + datasetinfo(realindex).filepath = ALLEEG(realindex).filepath; + datasetinfo(realindex).subject = ALLEEG(realindex).subject; + datasetinfo(realindex).session = ALLEEG(realindex).session; + datasetinfo(realindex).condition = ALLEEG(realindex).condition; + datasetinfo(realindex).group = ALLEEG(realindex).group; + datasetinfo(realindex).comps = []; + + allcom = { allcom{:}, { 'index' realindex 'load' filename } }; + userdat{1} = ALLEEG; + userdat{2} = datasetinfo; + userdat{4} = allcom; + set(hdl, 'userdata', userdat); + pop_study('redraw', hdl); + + case 'delclust' + if clusterpresent + if ~get(findobj(hdl, 'tag', 'delclust'), 'value') + for k = 1:10 + set(findobj('parent', hdl, 'tag',['set' num2str(k)]), 'style', 'text'); + set(findobj('parent', hdl, 'tag',['comps' num2str(k)]), 'enable', 'off'); + set(findobj('parent', hdl, 'tag',['sess' num2str(k)]), 'enable', 'off'); + set(findobj('parent', hdl, 'tag',['brw' num2str(k)]), 'enable', 'off'); + end; + else + for k = 1:10 + set(findobj('parent', hdl, 'tag',['set' num2str(k)]), 'style', 'edit'); + set(findobj('parent', hdl, 'tag',['comps' num2str(k)]), 'enable', 'on'); + set(findobj('parent', hdl, 'tag',['sess' num2str(k)]), 'enable', 'on'); + set(findobj('parent', hdl, 'tag',['brw' num2str(k)]), 'enable', 'on'); + end; + end; + else + set(findobj(hdl, 'tag', 'delclust'), 'value', 0) + if nargin > 2 + warndlg2('No cluster present'); + end; + end; + + case 'redraw' + for k = 1:10 + kk = k+(page-1)*10; % real index + if kk > length(datasetinfo) + set(findobj('parent', hdl, 'tag',['num' num2str(k)]), 'string', int2str(kk)); + set(findobj('parent', hdl, 'tag',['set' num2str(k)]), 'string', ''); + set(findobj('parent', hdl, 'tag',['sub' num2str(k)]), 'string',''); + set(findobj('parent', hdl, 'tag',['sess' num2str(k)]), 'string',''); + set(findobj('parent', hdl, 'tag',['cond' num2str(k)]), 'string',''); + set(findobj('parent', hdl, 'tag',['comps' num2str(k)]), 'string',''); + set(findobj('parent', hdl, 'tag',['group' num2str(k)]), 'string',''); + else + set(findobj('parent', hdl, 'tag',['num' num2str(k)]), 'string', int2str(kk)); + set(findobj('parent', hdl, 'tag',['set' num2str(k)]), 'string', fullfile(char(datasetinfo(kk).filepath), char(datasetinfo(kk).filename))); + set(findobj('parent', hdl, 'tag',['sub' num2str(k)]), 'string', datasetinfo(kk).subject); + set(findobj('parent', hdl, 'tag',['sess' num2str(k)]), 'string', int2str(datasetinfo(kk).session)); + set(findobj('parent', hdl, 'tag',['cond' num2str(k)]), 'string', datasetinfo(kk).condition); + set(findobj('parent', hdl, 'tag',['comps' num2str(k)]), 'string', formatbut(datasetinfo(kk).comps)); + set(findobj('parent', hdl, 'tag',['group' num2str(k)]), 'string', datasetinfo(kk).group); + end; + end + if page<10 + pagestr = [ ' Page ' int2str(page) ]; + else pagestr = [ 'Page ' int2str(page) ]; + end; + set(findobj('parent', hdl, 'tag','page'), 'string', pagestr ); + end +end; + +% remove empty elements in allcom +% ------------------------------- +function allcom = simplifycom(allcom); + + for index = length(allcom)-1:-1:1 + if strcmpi(allcom{index}{1}, 'index') & strcmpi(allcom{index+1}{1}, 'index') + if allcom{index}{2} == allcom{index+1}{2} % same dataset index + allcom{index}(end+1:end+length(allcom{index+1})-2) = allcom{index+1}(3:end); + allcom(index+1) = []; + end; + end; + end; + +% test for wrong parameters +% ------------------------- +function bool = test_wrong_parameters(hdl) + userdat = get(hdl, 'userdata'); + datasetinfo = userdat{2}; + datastrinfo = userdat{1}; + + bool = 0; + for index = 1:length(datasetinfo) + if ~isempty(datasetinfo(index).filename) + if isempty(datasetinfo(index).subject) & bool == 0 + bool = 1; warndlg2('All datasets must have a subject name or code', 'Error'); + end; + end; + end; + + nonempty = cellfun('isempty', { datasetinfo.filename }); + anysession = any(~cellfun('isempty', { datasetinfo(nonempty).session })); + allsession = all(~cellfun('isempty', { datasetinfo(nonempty).session })); + anycondition = any(~cellfun('isempty', { datasetinfo(nonempty).condition })); + allcondition = all(~cellfun('isempty', { datasetinfo(nonempty).condition })); + anygroup = any(~cellfun('isempty', { datasetinfo(nonempty).group })); + allgroup = all(~cellfun('isempty', { datasetinfo(nonempty).group })); + anydipfit = any(~cellfun('isempty', { datastrinfo(nonempty).dipfit})); + alldipfit = all(~cellfun('isempty', { datastrinfo(nonempty).dipfit})); + + if anygroup & ~allgroup + bool = 1; warndlg2('If one dataset has a group label, they must all have one', 'Error'); + end; + if anycondition & ~allcondition + bool = 1; warndlg2('If one dataset has a condition label, they must all have one', 'Error'); + end; + if anysession & ~allsession + bool = 1; warndlg2('If one dataset has a session index, they must all have one', 'Error'); + end; + if anydipfit & ~alldipfit + bool = 1; warndlg2('Dipole''s data across datasets is not uniform'); + end; +function strbut = formatbut(complist) + if isempty(complist) + strbut = 'All comp.'; + else + if length(complist) > 3, strbut = [ 'Comp.: ' int2str(complist(1:2)) ' ...' ]; + else strbut = [ 'Comp.: ' int2str(complist) ]; + end; + end; + + +%---------------------- helper functions ------------------------------------- + +function [result] = inputdlg2_with_checkbox(Prompt,Title,LineNo,DefAns,funcname); + +if nargin < 4 + help inputdlg2; + return; +end; +if nargin < 5 + funcname = ''; +end; + +if length(Prompt) ~= length(DefAns) + error('inputdlg2: prompt and default answer cell array must have the smae size'); +end; + +geometry = {}; +listgui = {}; + +% determine if vertical or horizontal +% ----------------------------------- +geomvert = []; +for index = 1:length(Prompt) + geomvert = [geomvert size(Prompt{index},1) 1]; % default is vertical geometry +end; +if all(geomvert == 1) & length(Prompt) > 1 + geomvert = []; % horizontal +end; + +for index = 1:length(Prompt) + if ~isempty(geomvert) % vertical + geometry = { geometry{:} [ 1] [1 ]}; + else + geometry = { geometry{:} [ 1 0.6 ]}; + end; + listgui = { listgui{:} { 'Style', 'text', 'string', Prompt{index}} ... + { 'Style', 'edit', 'string', DefAns{index} } { 'Style', 'checkbox', 'string','Keep only in-brain dipoles (requires Fieldtrip extension).','value',1 } }; +end; +geometry = [1 1 1];geomvert = [2 1 1]; +result = inputgui(geometry, listgui, ['pophelp(''' funcname ''');'], Title, [], 'normal', geomvert); diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_studydesign.m b/code/eeglab13_4_4b/functions/studyfunc/pop_studydesign.m new file mode 100644 index 0000000..8c06989 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_studydesign.m @@ -0,0 +1,524 @@ +% pop_studydesign() - create a STUDY design structure. +% +% Usage: +% >> [STUDY, ALLEEG] = pop_studydesign(STUDY, ALLEEG, key1, val1, ...); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% +% Optional inputs: +% +% Authors: Arnaud Delorme, April 2010 + +% Copyright (C) Arnaud Delorme & Scott Makeig, SCCN/INC/UCSD, October 11, 2004, smakeig@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY allcom] = pop_studydesign(STUDY, ALLEEG, designind, varargin); + +allcom = ''; +if nargin < 2 + help pop_studydesign; + return; +end; + +if nargin < 3 && ~isstr(STUDY) + + %% create GUI + [ usrdat.factors usrdat.factorvals usrdat.factsubj] = std_getindvar(STUDY, 'both', 1); + + usrdat.factors = { 'None' usrdat.factors{:} }; + usrdat.factorvals = { {} usrdat.factorvals{:} }; + usrdat.factsubj = { {} usrdat.factsubj{:} }; + usrdat.subjects = STUDY.subject; + usrdat.datasetinfo = STUDY.datasetinfo; + usrdat.design = STUDY.design; + usrdat.filepath = STUDY.filepath; + for ind = 1:length(usrdat.design) + usrdat.design(ind).deletepreviousfiles = 0; + end; + + % build menu + popupselectsubj = { 'Select all subjects' }; + for ind1 = 1:length(usrdat.factors) + if ~isempty(usrdat.factsubj{ind1}) + if any(cellfun(@length, usrdat.factsubj{ind1}) ~= length(usrdat.subjects)) + for ind2 = 1:length(usrdat.factorvals{ind1}) + if ~iscell(usrdat.factorvals{ind1}{ind2}) % not a combined value + tmpval = encodevals(usrdat.factorvals{ind1}(ind2)); + popupselectsubj{end+1} = [ num2str(usrdat.factors{ind1}) ' - ' tmpval{1} ]; + end; + end; + end; + end; + end; + + cb_rename = 'pop_studydesign(''rename'', gcbf);'; + cb_add = 'pop_studydesign(''add'', gcbf);'; + cb_del = 'pop_studydesign(''del'', gcbf);'; + cb_listboxfact1 = 'pop_studydesign(''selectfact'', gcf, 0);'; + cb_listboxfact2 = 'pop_studydesign(''selectfact'', gcf, 1);'; + cb_selectsubj = 'pop_studydesign(''selectsubj'', gcbf);'; + cb_combinevals1 = 'pop_studydesign(''combinevals'', gcbf, 0);'; + cb_combinevals2 = 'pop_studydesign(''combinevals'', gcbf, 1);'; + cb_lbval = 'pop_studydesign(''updatedesign'', gcbf);'; + cb_selectdesign = 'pop_studydesign(''selectdesign'', gcbf);'; + cb_selectdata = 'pop_studydesign(''selectdatatrials'', gcbf);'; + cb_selectfolder = 'pop_studydesign(''selectfolder'', gcbf);'; + cb_setfolder = 'pop_studydesign(''updatedesign'', gcbf);'; + uilist = { { 'style' 'text' 'string' 'Select STUDY design' 'fontweight' 'bold' } ... + { 'style' 'listbox' 'string' { usrdat.design.name } 'tag' 'listboxdesign' 'callback' cb_selectdesign 'value' STUDY.currentdesign } ... + { 'style' 'pushbutton' 'string' 'Add design' 'callback' cb_add } ... + { 'style' 'pushbutton' 'string' 'Rename design' 'callback' cb_rename } ... + { 'style' 'pushbutton' 'string' 'Delete design' 'callback' cb_del } ... + { 'style' 'text' 'string' 'Subjects' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Independent variable 1 ' 'fontweight' 'bold' } ... + { 'style' 'text' 'string' 'Independent variable 2 ' 'fontweight' 'bold' } ... + { 'style' 'listbox' 'string' usrdat.subjects 'tag' 'lbsubj' 'min' 0 'max' 2 'value' 1 'callback' cb_lbval } ... + { 'style' 'listbox' 'string' usrdat.factors 'tag' 'lbfact0' 'callback' cb_listboxfact1 'value' 2 } ... + { 'style' 'listbox' 'string' usrdat.factors 'tag' 'lbfact1' 'callback' cb_listboxfact2 'value' 1 } ... + { 'style' 'text' 'string' 'Ind. var. 1 values ' } ... + { 'style' 'text' 'string' 'Ind. var. 2 values' } ... + { 'style' 'listbox' 'string' '' 'tag' 'lbval0' 'min' 0 'max' 2 'callback' cb_lbval } ... + { 'style' 'listbox' 'string' '' 'tag' 'lbval1' 'min' 0 'max' 2 'callback' cb_lbval } ... + { 'style' 'popupmenu' 'string' popupselectsubj 'tag' 'popupselect' 'callback' cb_selectsubj } ... + { 'style' 'pushbutton' 'string' 'Combine selected values' 'tag' 'combine1' 'callback' cb_combinevals1 } ... + { 'style' 'pushbutton' 'string' 'Combine selected values' 'tag' 'combine2' 'callback' cb_combinevals2 } ... + { 'style' 'popupmenu' 'string' 'Paired statistics|Unpaired statistics' 'tag' 'lbpair0' 'callback' cb_lbval } ... + { 'style' 'popupmenu' 'string' 'Paired statistics|Unpaired statistics' 'tag' 'lbpair1' 'callback' cb_lbval } ... + { 'style' 'pushbutton' 'string' 'Use only specific datasets/trials' 'callback' cb_selectdata } ... + { 'style' 'edit' 'string' '' 'tag' 'edit_selectdattrials' 'callback' cb_lbval } ... + { 'style' 'text' 'string' 'Store pre-computed files in folder' } ... + { 'style' 'edit' 'string' '' 'tag' 'edit_storedir' 'callback' cb_setfolder } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cb_selectfolder } ... + { 'style' 'checkbox' 'string' 'Delete all pre-computed datafiles associated with this specific STUDY design' 'tag' 'chk_del' 'callback' cb_lbval } ... + { 'style' 'checkbox' 'string' 'Save the STUDY' 'tag' 'chk_save' 'value' 1 } }; +% { 'style' 'checkbox' 'string' 'Paired statistics' 'tag' 'lbpair0' 'callback' cb_lbval } ... +% { 'style' 'checkbox' 'string' 'Paired statistics' 'tag' 'lbpair1' 'callback' cb_lbval } ... + + geometry = { {3 18 [1 1] [2 1] } ... + {3 18 [1 2] [2 3] } ... + {3 18 [3 2] [1 1] } ... + {3 18 [3 3] [1 1] } ... + {3 18 [3 4] [1 1] } ... + {3 18 [1 5] [1 1] } ... + {3 18 [2 5] [1 1] } ... + {3 18 [3 5] [1 1] } ... + {3 18 [1 6] [1 8] } ... + {3 18 [2 6] [0.98 3] } ... + {3 18 [3 6] [0.98 3] } ... + {3 18 [2 9] [1 1] } ... + {3 18 [3 9] [1 1] } ... + {3 18 [2 10] [0.98 3] } ... + {3 18 [3 10] [0.98 3] } ... + {3 18 [1 14] [1 1] } ... + {3 18 [2 13] [1 1] } ... + {3 18 [3 13] [1 1] } ... + {3 18 [2 14] [1 1] } ... + {3 18 [3 14] [1 1] } ... + {3 18 [1 15.5] [1.3 1] } ... + {3 18 [2.25 15.5] [1.7 1] } ... + {3 18 [1 16.5] [1.3 1] } ... + {3 18 [2.25 16.5] [1.2 1] } ... + {3 18 [3.45 16.5] [0.55 1] } ... + {3 18 [1 17.5] [3 1] } ... + {3 18 [1 19] [3 1] } ... + }; + + for i = 1:length(geometry), geometry{i}{3} = geometry{i}{3}-1; end; + streval = [ 'pop_studydesign(''selectdesign'', gcf);' ]; + [tmp usrdat tmp2 result] = inputgui('uilist', uilist, 'title', 'Edit STUDY design -- pop_studydesign()', 'helpbut', 'Web help', 'helpcom', 'web(''http://sccn.ucsd.edu/wiki/Chapter_03:_Working_with_STUDY_designs'', ''-browser'')', 'geom', geometry, 'userdata', usrdat, 'eval', streval); + if isempty(tmp), return; end; + + % call std_makedesign + % ------------------- + des = usrdat.design; + allcom = ''; + if length(des) < length(STUDY.design) + for index = length(des)+1:length(STUDY.design) + fprintf('Deleting STUDY design %d\n', index); + com = 'STUDY.design(index).name = '';'; eval(com); + allcom = [ allcom 10 com ]; + end; + end; + for index = 1:length(des) + tmpdes = rmfield(des(index), 'deletepreviousfiles'); + rmfiles = fastif(des(index).deletepreviousfiles, 'limited', 'off'); + if index > length(STUDY.design) || ~isequal(STUDY.design(index), tmpdes) || strcmpi(rmfiles, 'on') + fprintf('Updating/creating STUDY design %d\n', index); + + % test if file exist and issue warning + if length(STUDY.design) >= index && isfield('cell', STUDY.design) && ~isempty(STUDY.design(index).cell) && ... + ~isempty(dir([ STUDY.design(index).cell(1).filebase '.*' ])) && strcmpi(rmfiles, 'off') + if ~isequal(tmpdes.variable(1).label, STUDY.design(index).variable(1).label) || ... + ~isequal(tmpdes.variable(2).label, STUDY.design(index).variable(2).label) || ... + ~isequal(tmpdes.include, STUDY.design(index).include) || ... + ~isequal(tmpdes.variable(1).value, STUDY.design(index).variable(1).value) || ... + ~isequal(tmpdes.cases.value, STUDY.design(index).cases.value) || ... + ~isequal(tmpdes.variable(2).value, STUDY.design(index).variable(2).value) + res = questdlg2(strvcat([ 'Precomputed data files exist for design ' int2str(index) '.' ], ' ', ... + 'Modifying this design without deleting the associated files', ... + 'might mean that they will stay on disk and will be unusable'), ... + 'STUDY design warning', 'Abort', 'Continue', 'Continue'); + if strcmpi(res, 'Abort'), return; end; + end; + end; + [STUDY com] = std_makedesign(STUDY, ALLEEG, index, tmpdes, 'delfiles', rmfiles); + allcom = [ allcom 10 com ]; + else + fprintf('STUDY design %d not modified\n', index); + end; + end; + if result.listboxdesign ~= STUDY.currentdesign + fprintf('Selecting STUDY design %d\n', result.listboxdesign); + com = sprintf('STUDY = std_selectdesign(STUDY, ALLEEG, %d);', result.listboxdesign); eval(com); + allcom = [ allcom 10 com ]; + end; + if result.chk_save == 1 + fprintf('Resaving STUDY\n'); + [STUDY ALLEEG com] = pop_savestudy(STUDY, ALLEEG, 'savemode', 'resave'); + allcom = [ allcom 10 com ]; + end; + if ~isempty(allcom), allcom(1) = []; end; + +elseif isstr(STUDY) + com = STUDY; + fig = ALLEEG; + usrdat = get(fig, 'userdata'); + datinfo = usrdat.datasetinfo; + des = usrdat.design; + filepath = usrdat.filepath; + + switch com + % summary of callbacks + % case 'add', Add new study design + % case 'del', Delete study design + % case 'rename', Rename study design + % + % case 'selectdesign', select a specific design + % case 'updatedesign', update the study information (whenever the + % user click on a button + % + % case 'selectfact', select a specific ind. var. (update value listboxes) + % case 'combinevals', combine values in value listboxes + % case 'selectsubj', select specific subjects + % + % case 'selectdatatrials', new GUI to select specific dataset and trials + % case 'selectdatatrialssel', % select in the GUI above + % case 'selectdatatrialsadd', % add new selection in the GUI above + + case 'add', % Add new study design + inde = find( cellfun(@isempty,{ des.name })); + if isempty(inde), inde = length(des)+1; end; + des(inde(1)) = des(1); + des(inde(1)).name = sprintf('Design %d', inde(1)); + set(findobj(fig, 'tag', 'listboxdesign'), 'string', { des.name }, 'value', inde(1)); + usrdat.design = des; + set(fig, 'userdata', usrdat); + pop_studydesign( 'selectstudy', fig); + return; + + case 'del', % Delete study design + val = get(findobj(fig, 'tag', 'listboxdesign'), 'value'); + if val == 1 + warndlg2('The first STUDY design cannot be removed, only modified'); + return; + end; + des(val).name = ''; + set(findobj(fig, 'tag', 'listboxdesign'), 'value', 1, 'string', { des.name } ); + usrdat.design = des; + set(fig, 'userdata', usrdat); + pop_studydesign( 'selectstudy', fig); + return; + + case 'rename', % Rename study design + val = get(findobj(fig, 'tag', 'listboxdesign'), 'value'); + strs = get(findobj(fig, 'tag', 'listboxdesign'), 'string'); + result = inputdlg2( { 'Study design name: ' }, ... + 'Rename Study Design', 1, { strs{val} }, 'pop_studydesign'); + if isempty(result), return; end; + des(val).name = result{1}; + set(findobj(fig, 'tag', 'listboxdesign'), 'string', { des.name } ); + + case 'selectdesign', % select a specific design + val = get(findobj(fig, 'tag', 'listboxdesign'), 'value'); + if isempty(des(val).name) + set(findobj(fig, 'tag', 'lbfact0'), 'string', '', 'value', 1); + set(findobj(fig, 'tag', 'lbfact1'), 'string', '', 'value', 1); + set(findobj(fig, 'tag', 'lbval0') , 'string', '', 'value', 1); + set(findobj(fig, 'tag', 'lbval1') , 'string', '', 'value', 1); + set(findobj(fig, 'tag', 'lbpair0'), 'value', 1); + set(findobj(fig, 'tag', 'lbpair1'), 'value', 1); + set(findobj(fig, 'tag', 'lbsubj') , 'value' , 1, 'string', ''); + set(findobj(fig, 'tag', 'chk_del'), 'value', des(val).deletepreviousfiles ); + set(findobj(fig, 'tag', 'edit_selectdattrials'), 'string', '' ); + % do not change file path + return; + end; + val1 = strmatch(des(val).variable(1).label, usrdat.factors, 'exact'); if isempty(val1), val1 = 1; end; + val2 = strmatch(des(val).variable(2).label, usrdat.factors, 'exact'); if isempty(val2), val2 = 1; end; + set(findobj(fig, 'tag', 'lbfact0'), 'string', usrdat.factors, 'value', val1); + set(findobj(fig, 'tag', 'lbfact1'), 'string', usrdat.factors, 'value', val2); + valfact1 = strmatchmult(des(val).variable(1).value, usrdat.factorvals{val1}); + valfact2 = strmatchmult(des(val).variable(2).value, usrdat.factorvals{val2}); + if isempty(valfact1), listboxtop1 = 1; else listboxtop1 = valfact1(1); end; + if isempty(valfact2), listboxtop2 = 1; else listboxtop2 = valfact2(1); end; + set(findobj(fig, 'tag', 'lbval0'), 'string', encodevals(usrdat.factorvals{val1}), 'value', valfact1, 'listboxtop', listboxtop1); + set(findobj(fig, 'tag', 'lbval1'), 'string', encodevals(usrdat.factorvals{val2}), 'value', valfact2, 'listboxtop', listboxtop2); + valsubj = strmatchmult(des(val).cases.value, usrdat.subjects); + set(findobj(fig, 'tag', 'lbsubj'), 'string', usrdat.subjects, 'value', valsubj); + if isempty(des(val).include), str = ''; else str = vararg2str(des(val).include); end; + set(findobj(fig, 'tag', 'chk_del'), 'value', des(val).deletepreviousfiles ); + set(findobj(fig, 'tag', 'edit_selectdattrials'), 'string', str ); + set(findobj(fig, 'tag', 'popupselect'), 'value', 1 ); + set(findobj(fig, 'tag', 'lbpair0'), 'value', fastif(isequal(des(val).variable(1).pairing,'on'),1,2)); + set(findobj(fig, 'tag', 'lbpair1'), 'value', fastif(isequal(des(val).variable(2).pairing,'on'),1,2)); + if ~isfield(des, 'filepath') || isempty(des(val).filepath), des(val).filepath = ''; end; + set(findobj(fig, 'tag', 'edit_storedir'), 'string', des(val).filepath); + + case 'updatedesign', % update the study information (whenever the user click on a button) + val = get(findobj(fig, 'tag', 'listboxdesign'), 'value'); + val1 = get(findobj(fig, 'tag', 'lbfact0'), 'value'); + val2 = get(findobj(fig, 'tag', 'lbfact1'), 'value'); + valf1 = get(findobj(fig, 'tag', 'lbval0'), 'value'); + valf2 = get(findobj(fig, 'tag', 'lbval1'), 'value'); + valp1 = get(findobj(fig, 'tag', 'lbpair0'), 'value'); + valp2 = get(findobj(fig, 'tag', 'lbpair1'), 'value'); + vals = get(findobj(fig, 'tag', 'lbsubj'), 'value'); + valchk = get(findobj(fig, 'tag', 'chk_del'), 'value'); + filep = get(findobj(fig, 'tag', 'edit_storedir'), 'string'); + strs = get(findobj(fig, 'tag', 'edit_selectdattrials'), 'string'); + valpaired = { 'on' 'off' }; + + if ~strcmpi(des(val).variable(1).label, usrdat.factors{val1}) + des(val).variable(1).label = usrdat.factors{val1}; + des(val).variable(1).value = usrdat.factorvals{val1}(valf1); + end; + if ~strcmpi(des(val).variable(2).label, usrdat.factors{val2}) + des(val).variable(2).label = usrdat.factors{val2}; + des(val).variable(2).value = usrdat.factorvals{val2}(valf2); + end; + if ~isequal(mysort(des(val).variable(1).value), mysort(usrdat.factorvals{val1}(valf1))) + des(val).variable(1).value = usrdat.factorvals{val1}(valf1); + end; + if ~isequal(mysort(des(val).variable(2).value), mysort(usrdat.factorvals{val2}(valf2))) + des(val).variable(2).value = usrdat.factorvals{val2}(valf2); + end; + if ~isequal(mysort(des(val).cases.value), mysort(usrdat.subjects(vals))) + des(val).cases.value = usrdat.subjects(vals); + end; + if ~isequal(des(val).variable(1).pairing, valpaired{valp1}) + des(val).variable(1).pairing = valpaired{valp1}; + end; + if ~isequal(des(val).variable(2).pairing, valpaired{valp2}) + des(val).variable(2).pairing = valpaired{valp2}; + end; + if ~isequal(des(val).deletepreviousfiles, valchk) + des(val).deletepreviousfiles = 1; + end; + if ~isfield(des, 'filepath') || ~isequal(des(val).filepath, filep) + des(val).filepath = filep; + end; + if ~isequal(des(val).include, strs) + try, + des(val).include = eval( [ '{' strs '}' ]); + catch, + disp('Error while decoding list of parameters'); + des(val).include = {}; + set(findobj(fig, 'tag', 'edit_selectdattrials'), 'string', ''); + end; + end; + + case 'selectfact', % select a specific ind. var. (update value listboxes) + factval = designind; + val = get(findobj(fig, 'tag', 'listboxdesign'), 'value'); + val1 = get(findobj(fig, 'tag', [ 'lbfact' num2str(factval) ]), 'value'); + val2 = get(findobj(fig, 'tag', [ 'lbfact' num2str(~factval) ]), 'value'); +% if val1 == val2 && val1 ~= 1 +% warndlg2('Cannot select twice the same independent variable'); +% val1 = 1; +% set(findobj(fig, 'tag', [ 'lbfact' num2str(factval) ]), 'value', val1); +% end; + valfact = [1:length(usrdat.factorvals{val1})]; + set(findobj(fig, 'tag', ['lbval' num2str(factval) ]), 'string', encodevals(usrdat.factorvals{val1}), 'value', valfact, 'listboxtop', 1); + pop_studydesign('updatedesign', fig); + return; + + case 'combinevals', % combine values in value listboxes + factval = designind; + val1 = get(findobj(fig, 'tag', [ 'lbfact' num2str(factval) ]), 'value'); + vals = get(findobj(fig, 'tag', [ 'lbval' num2str(factval) ]), 'value'); + strs = get(findobj(fig, 'tag', [ 'lbval' num2str(factval) ]), 'string'); + if length(vals) == 1 + warndlg2('You need to select several values to combine them'); + return; + end; + if ~iscell(usrdat.factorvals{val1}) + warndlg2('Cannot combine values from numerical variables'); + return; + end; + % combine values for string and integers + if isstr(usrdat.factorvals{val1}{1}) || iscell(usrdat.factorvals{val1}{1}) + tmpcell = {}; + for indCell = vals(:)' + if iscell(usrdat.factorvals{val1}{indCell}) + tmpcell = { tmpcell{:} usrdat.factorvals{val1}{indCell}{:} }; + else + tmpcell = { tmpcell{:} usrdat.factorvals{val1}{indCell} }; + end; + end; + usrdat.factorvals{val1}{end+1} = unique_bc(tmpcell); + else + usrdat.factorvals{val1}{end+1} = unique_bc([ usrdat.factorvals{val1}{vals} ]); + end; + set(findobj(fig, 'tag', ['lbval' num2str(factval) ]), 'string', encodevals(usrdat.factorvals{val1})); + + case 'selectsubj', % select specific subjects + val = get(findobj(fig, 'tag', 'popupselect'), 'value'); + str = get(findobj(fig, 'tag', 'popupselect'), 'string'); + str = str{val}; + if val == 1, + subjbox = get(findobj(fig, 'tag', 'lbsubj'), 'string'); + set(findobj(fig, 'tag', 'lbsubj'), 'value', [1:length(subjbox)]); + return; + end; + indunders = findstr( ' - ', str); + factor = str(1:indunders-1); + factorval = str(indunders+3:end); + + % select subjects + eval( [ 'allsetvals = { datinfo.' factor '};' ]); + indset = strmatch(factorval, allsetvals, 'exact'); + subjects = unique_bc( { datinfo(indset).subject } ); + + % change the subject listbox + val = get(findobj(fig, 'tag', 'popupselect'), 'value'); + subjbox = get(findobj(fig, 'tag', 'lbsubj'), 'string'); + indsubj = []; + for ind = 1:length(subjects); + indsubj(ind) = strmatch(subjects{ind}, subjbox, 'exact'); + end; + set(findobj(fig, 'tag', 'lbsubj'), 'value', indsubj); + set(findobj(fig, 'tag', 'popupselect'), 'value', 1); + pop_studydesign('updatedesign', fig); + return; + %set(findobj(get(gcbf, ''userdata''), ''tag'', ''edit_selectdattrials'' + + case 'selectdatatrials', % select specific dataset and trials + cb_sel = 'pop_studydesign(''selectdatatrialssel'',gcbf);'; + cb_add = 'pop_studydesign(''selectdatatrialsadd'',gcbf);'; + uilist = { { 'style' 'text' 'string' strvcat('Press ''Add'' to add data', 'selection. Multiple variables', 'are combined using AND.') } ... + { 'style' 'text' 'string' 'Select data based on variable', 'fontweight' 'bold' } ... + { 'style' 'listbox' 'string' usrdat.factors 'tag' 'lbfact2' 'callback' cb_sel 'value' 1 } ... + { 'style' 'text' 'string' 'Select data based on value(s)' 'fontweight' 'bold' } ... + { 'style' 'listbox' 'string' encodevals(usrdat.factorvals{1}) 'tag' 'lbval2' 'min' 0 'max' 2} }; + cb_renamehelp = [ 'set(findobj(gcf, ''tag'', ''help''), ''string'', ''Add'');' ... + 'set(findobj(gcf, ''tag'', ''cancel''), ''string'', ''Erase'', ''callback'', ''set(findobj(''''tag'''', ''''edit_selectdattrials''''), ''''string'''', '''''''');'');' ... + 'set(findobj(gcf, ''tag'', ''ok''), ''string'', ''Close'');' ]; + usrdat.fig = fig; + inputgui('uilist', uilist, 'geometry', { [1] [1] [1] [1] [1] }, 'geomvert', [2 1 2.5 1 2.5], ... + 'helpcom', cb_add, 'userdata', usrdat, 'eval', cb_renamehelp); + pop_studydesign('updatedesign', fig); + return; + + case 'selectdatatrialssel', % select in the GUI above + val1 = get(findobj(fig, 'tag', 'lbfact2'), 'value'); + valfact = [1:length(usrdat.factorvals{val1})]; + tmpval = get(findobj(fig, 'tag', 'lbval2'), 'value'); + if max(tmpval) > max(valfact) + set(findobj(fig, 'tag', 'lbval2'), 'value', valfact, 'string', encodevals(usrdat.factorvals{val1})); + else + set(findobj(fig, 'tag', 'lbval2'), 'string', encodevals(usrdat.factorvals{val1}), 'value', valfact); + end; + return; + + case 'selectfolder', + res = uigetdir; + if ~isempty(findstr(filepath, res)) && findstr(filepath, res) == 1 + res = res(length(filepath)+2:end); + end; + if res(1) == 0, return; end; + set(findobj(fig, 'tag', 'edit_storedir'), 'string', res); + pop_studydesign('updatedesign', fig); + return; + + case 'selectdatatrialsadd', % Add button in the GUI above + val1 = get(findobj(fig, 'tag', 'lbfact2'), 'value'); + val2 = get(findobj(fig, 'tag', 'lbval2') , 'value'); + objedit = findobj(usrdat.fig, 'tag', 'edit_selectdattrials'); + str = get(objedit, 'string'); + if ~isempty(str), str = [ str ',' ]; end; + set(objedit, 'string', [ str vararg2str( { usrdat.factors{val1} usrdat.factorvals{val1}(val2) }) ]); + return; + + end; + usrdat.design = des; + set(fig, 'userdata', usrdat); +end; + +function res = strmatchmult(a, b); + if isempty(b), res = []; return; end; + res = zeros(1,length(a)); + for index = 1:length(a) + tmpi = std_indvarmatch(a{index}, b); + res(index) = tmpi(1); % in case there is a duplicate + end; + %[tmp ind] = mysetdiff(b, a); + %res = setdiff_bc([1:length(b)], ind); + +function cellarray = mysort(cellarray) + return; % was crashing for combinations of selection + % also there is no reason the order should be different + if ~isempty(cellarray) && isstr(cellarray{1}) + cellarray = sort(cellarray); + end; + +function [cellout inds ] = mysetdiff(cell1, cell2); + if (~isempty(cell1) && isstr(cell1{1})) || (~isempty(cell2) && isstr(cell2{1})) + [ cellout inds ] = setdiff_bc(cell1, cell2); + else [ cellout inds ] = setdiff_bc([ cell1{:} ], [ cell2{:} ]); + cellout = mattocell(cellout); + end; + +% encode string an numerical values for list boxes +function cellout = encodevals(cellin) + if isempty(cellin) + cellout = {}; + elseif ~iscell(cellin) + cellout = { num2str(cellin) }; + elseif ischar(cellin{1}) || iscell(cellin{1}) + for index = 1:length(cellin) + if isstr(cellin{index}) + cellout{index} = cellin{index}; + else + cellout{index} = cellin{index}{1}; + for indcell = 2:length(cellin{index}) + cellout{index} = [ cellout{index} ' & ' cellin{index}{indcell} ]; + end; + end; + end; + else + for index = 1:length(cellin) + if length(cellin{index}) == 1 + cellout{index} = num2str(cellin{index}); + else + cellout{index} = num2str(cellin{index}(1)); + for indcell = 2:length(cellin{index}) + cellout{index} = [ cellout{index} ' & ' num2str(cellin{index}(indcell)) ]; + end; + end; + end; + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/pop_studyerp.m b/code/eeglab13_4_4b/functions/studyfunc/pop_studyerp.m new file mode 100644 index 0000000..958c47e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/pop_studyerp.m @@ -0,0 +1,196 @@ +% pop_studyerp() - create a simple design for ERP analysis +% +% Usage: +% >> [STUDY ALLEEG] = pop_studyerp; % pop up interface +% +% Outputs: +% STUDY - an EEGLAB STUDY set of loaded EEG structures +% ALLEEG - ALLEEG vector of one or more loaded EEG dataset structures +% +% Author: Arnaud Delorme, SCCN, UCSD, 2011- +% +% See also: eeg_checkset() + +% Copyright (C) 15 Feb 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY ALLEEG com ] = pop_studyerp; + +% first GUI, get the number of conditions and subjects +% ---------------------------------------------------- +textinfo = [ 'This interface creates a simple STUDY and ' 10 ... + 'computes its condition grand average ERPs.' 10 ... + 'For each subject, trials for each condition' 10 ... + 'must first be stored in a separate dataset.' 10 ... + 'Create other STUDY using the standard editor.' ]; +guispec = { ... + {'style' 'text' 'string' 'Create simple ERP STUDY' ... + 'FontWeight' 'Bold' 'fontsize', 12} ... + { 'style' 'text' 'string' textinfo } ... + {'style' 'text' 'string' 'Number of conditions:' } ... + {'style' 'edit' 'string' '1' 'tag' 'cond' } { } ... + {'style' 'text' 'string' 'Number of subjects:' } ... + {'style' 'edit' 'string' '15' 'tag' 'subjects' } { } }; +guigeom = { [1] [1] [1 0.3 0.4] [1 0.3 0.4] }; + +optiongui = { 'geometry', guigeom, 'uilist' , guispec, ... + 'geomvert', [ 1 4 1 1], ... + 'helpcom' , 'pophelp(''pop_studyerp'')', ... + 'title' , 'Create a new STUDY set -- pop_studyerp()' }; +[result, userdat2, strhalt, outstruct] = inputgui(optiongui{:}); +STUDY = []; +ALLEEG = []; +com = ''; +if isempty(result), return; end; + +nSubjects = str2num(outstruct.subjects); +nConds = str2num(outstruct.cond); + +% second GUI, enter the datasets +% ------------------------------ +guispec = { ... + {'style' 'text' 'string' 'Create simple ERP STUDY' 'FontWeight' 'Bold' 'fontsize', 12} ... + {} ... + {} {'style' 'text' 'string' 'STUDY set name:' } { 'style' 'edit' 'string' '' 'tag' 'study_name' } ... + {} }; +guigeom = { [1] [1] [0.2 1 3.5] [1] }; + +% define conditions +% ----------------- +guigeom{end+1} = []; +for icond = 1:nConds + if icond == 1, guigeom{end} = [ guigeom{end} 1 0.2]; + else guigeom{end} = [ guigeom{end} 0.1 1 0.2]; + end; + if icond > 1, guispec{end+1} = {}; end; + guispec = { guispec{:}, {'style' 'text' 'string' [ 'Condition ' num2str(icond) ' name'] } {} }; +end; + +% edit boxes for conditions +% ------------------------- +guigeom{end+1} = []; +for icond = 1:nConds + if icond == 1, guigeom{end} = [ guigeom{end} 1 0.2]; + else guigeom{end} = [ guigeom{end} 0.1 1 0.2]; + end; + if icond > 1, guispec{end+1} = {}; end; + guispec = { guispec{:}, {'style' 'edit' 'string' '' 'tag' [ 'cond' num2str(icond) ] } {} }; +end; +guispec{end+1} = {}; +guigeom{end+1} = [1]; + +% define dataset headers +% ---------------------- +guigeom{end+1} = []; +for icond = 1:nConds + if icond == 1, guigeom{end} = [ guigeom{end} 1 0.2]; + else guigeom{end} = [ guigeom{end} 0.1 1 0.2]; + end; + if icond > 1, guispec{end+1} = {}; end; + guispec = { guispec{:}, {'style' 'text' 'string' ['Condition ' num2str(icond) ' datasets' ] } {} }; +end; + +% create edit boxes +% ----------------- +for index = 1:nSubjects + guigeom{end+1} = []; + for icond = 1:nConds + if icond == 1, guigeom{end} = [ guigeom{end} 1 0.2]; + else guigeom{end} = [ guigeom{end} 0.1 1 0.2]; + end; + select_com = ['[inputname, inputpath] = uigetfile2(''*.set;*.SET'', ''Choose dataset to add to STUDY -- pop_study()'');'... + 'if inputname ~= 0,' ... + ' guiind = findobj(''parent'', gcbf, ''tag'', ''set' int2str(icond) '_' int2str(index) ''');' ... + ' set( guiind,''string'', fullfile(inputpath, inputname));' ... + 'end; clear inputname inputpath;']; + if icond > 1, guispec{end+1} = {}; end; + guispec = { guispec{:}, ... + {'style' 'edit' 'string' '' 'tag' [ 'set' int2str(icond) '_' int2str(index) ] }, ... + {'style' 'pushbutton' 'string' '...' 'Callback' select_com } }; + end; +end; + +% last text +% --------- +textinfo = [ 'When using more than 1 condition, datasets on each line must correspond to the same subject.' ]; +guispec = { guispec{:}, {}, {'style' 'text' 'string' textinfo } }; +guigeom = { guigeom{:} [1] [1] }; + +optiongui = { 'geometry', guigeom, ... + 'uilist' , guispec, ... + 'helpcom' , 'pophelp(''pop_studyerp'')', ... + 'title' , 'Create a new STUDY set -- pop_studyerp()' }; +[result, userdat2, strhalt, outstruct] = inputgui(optiongui{:}); +if isempty(result), return; end; + +% decode outstruct and build call to std_editset +% ---------------------------------------------- +options = { 'name' outstruct.study_name 'updatedat' 'off' }; +commands = {}; +for icond = 1:nConds + + % check that condition name is defined + tagCond = ['cond' int2str(icond) ]; + if isempty(outstruct.(tagCond)) + outstruct.(tagCond) = [ 'condition ' int2str(icond) ]; + end; + + for index = 1:nSubjects + tagSet = [ 'set' int2str(icond) '_' int2str(index) ]; + subject = sprintf('S%2.2d', index); + + if ~isempty(outstruct.(tagSet)) + commands = { commands{:}, {'index' nConds*index+icond-1 'load' outstruct.(tagSet) 'subject' subject 'condition' outstruct.(tagCond) } }; + end; + end; +end; +options = { options{:}, 'commands', commands }; + +% call std_editset to create the STUDY +% ------------------------------------ +com1 = sprintf( '[STUDY ALLEEG] = std_editset( STUDY, ALLEEG, %s );', vararg2str(options) ); +[STUDY ALLEEG] = std_editset(STUDY, ALLEEG, options{:}); +if exist([ STUDY.design(STUDY.currentdesign).cell(1).filebase '.daterp' ]) + textmsg = [ 'WARNING: SOME ERP DATAFILES ALREADY EXIST, OVERWRITE THEM?' 10 ... + '(if you have another STUDY using the same datasets, it might overwrite its' 10 ... + 'precomputed data files. Instead, use a single STUDY and create multiple designs).' ]; + res = questdlg2(textmsg, 'Precomputed datafiles already present on disk', 'No', 'Yes', 'Yes'); + if strcmpi(res, 'No') + error('User aborded precomputing ERPs'); + end; +end; + +% call std_precomp for ERP (channels) +% ----------------------------------- +com2 = '[STUDY ALLEEG] = std_precomp(STUDY, ALLEEG, ''channels'', ''interpolate'', ''on'', ''recompute'',''on'',''erp'',''on'');'; +[STUDY ALLEEG] = std_precomp(STUDY, ALLEEG, 'channels','interp', 'on', 'recompute','on','erp','on'); + +% call std_erpplot to plot ERPs (channels) +% ---------------------------------------- +com3 = 'tmpchanlocs = ALLEEG(1).chanlocs; STUDY = std_erpplot(STUDY, ALLEEG, ''channels'', { tmpchanlocs.labels }, ''plotconditions'', ''together'');'; +tmpchanlocs = ALLEEG(1).chanlocs; +STUDY = std_erpplot(STUDY, ALLEEG, 'channels', { tmpchanlocs.labels }, 'plotconditions', 'together'); +pos = get(gcf, 'position'); +set(gcf, 'position', [10 pos(2) pos(3)*2 pos(4)*2]); + +% call the STUDY plotting interface +% --------------------------------- +disp('Press OK to close plotting interface and save the STUDY'); +disp('If you press CANCEL, the whole STUDY will be lost.'); +[STUDY com4] = pop_chanplot(STUDY, ALLEEG); + +com = sprintf('%s\n%s\n%s\n%s', com1, com2, com3, com4); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/robust_kmeans.m b/code/eeglab13_4_4b/functions/studyfunc/robust_kmeans.m new file mode 100644 index 0000000..1de102c --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/robust_kmeans.m @@ -0,0 +1,86 @@ +% robust_kmeans() - an extension of Matlab kmeans() that removes outlier +% components from all clusters. +% This is a helper function called from pop_clust(). + +function [IDX,C,sumd,D,outliers] = robust_kmeans(data,N,STD,MAXiter,method) +% data - pre-clustering data matrix. +% N - number of wanted clusters. + +if nargin < 5 + method = 'kmeans'; +end; + +flag = 1; +not_outliers = 1:size(data,1); +old_outliers = []; +if strcmpi(method, 'kmeans') + [IDX,C,sumd,D] = kmeans(data,N,'replicates',30,'emptyaction','drop'); % Cluster using K-means algorithm +else + [IDX,C,sumd,D] = kmeanscluster(data,N); % Cluster using K-means algorithm +end; +if STD >= 2 % STD for returned outlier + rSTD = STD -1; +else + rSTD = STD; +end +loop = 0; + +while flag + loop = loop + 1; + std_all = []; + ref_D = 0; + for k = 1:N + tmp = ['cls' num2str(k) ' = find(IDX==' num2str(k) ')''; ' ]; %find the component indices belonging to each cluster (cls1 = ...). + eval(tmp); + tmp = ['std' num2str(k) ' = std(D(cls' num2str(k) ' ,' num2str(k) ')); ' ]; %compute the std of each cluster + eval(tmp); + std_all = [std_all ['std' num2str(k) ' ']]; + tmp = [ 'ref_D = ' num2str(ref_D) ' + mean(D(cls' num2str(k) ' ,' num2str(k) '));' ]; + eval(tmp); + end + std_all = [ '[ ' std_all ' ]' ]; + std_all = eval(std_all); + + % Find the outliers + % Outlier definition - its distance from its cluster center is bigger + % than STD times the std of the cluster, as long as the distance is bigger + % than the mean distance times STD (avoid problems where all points turn to be outliers). + outliers = []; + ref_D = ref_D/N; + for k = 1:N + tmp = ['cls' num2str(k) '(find(D(find(IDX==' num2str(k) ')'' , ' num2str(k) ') > ' num2str(STD) '*std' num2str(k) ')); ' ]; + optionalO = eval(tmp); + Oind = find(D(optionalO,k) > ref_D*STD); + outliers = [outliers optionalO(Oind)]; + end + if isempty(outliers) | (loop == MAXiter) + flag = 0; + end + l = length(old_outliers); + returned_outliers = []; + + + for k = 1:l + tmp = sum((C-ones(N,1)*data(old_outliers(k),:)).^2,2)'; % Find the distance of each former outlier to the current cluster + if isempty(find(tmp <= std_all*rSTD)) %Check if the outlier is still an outlier (far from each cluster center more than STD-1 times its std). + returned_outliers = [returned_outliers old_outliers(k)]; + end; + end + outliers = not_outliers(outliers); + outliers = [outliers returned_outliers ]; + tmp = ones(1,size(data,1)); + tmp(outliers) = 0; + not_outliers = (find(tmp==1)); + + if strcmpi(method, 'kmeans') + [IDX,C,sumd,D] = kmeans(data(not_outliers,:),N,'replicates',30,'emptyaction','drop'); + else + [IDX,C,sumd,D] = kmeanscluster(data(not_outliers,:),N); + end; + old_outliers = outliers; + old_IDX = zeros(size(data,1),1); + old_IDX(sort(not_outliers)) = IDX; + +end + +IDX = old_IDX; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_cell2setcomps.m b/code/eeglab13_4_4b/functions/studyfunc/std_cell2setcomps.m new file mode 100644 index 0000000..b706bd9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_cell2setcomps.m @@ -0,0 +1,88 @@ +% std_cell2setcomps - convert .sets and .comps to cell array. The .sets and +% .comps format is useful for GUI but the cell array +% format is used for plotting and statistics. +% +% Usage: +% [ struct sets comps ] = std_cell2setcomps(STUDY, clustind); +% +% Author: Arnaud Delorme, CERCO/CNRS, UCSD, 2009- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ tmpstruct setlist complist ] = std_cell2setcomps(STUDY, ALLEEG, setinds, allinds) + +if nargin < 4 + tmpstruct = STUDY.cluster(setinds); + sets = STUDY.cluster(setinds).setinds; + inds = STUDY.cluster(setinds).allinds; +else + tmpstruct = []; + sets = setinds; + inds = allinds; +end; + +% initialize flag array +% --------------------- +flag = cell(size(inds)); +for i = 1:size(inds,1) + for j = 1:size(inds,2) + flag{i,j} = zeros(size(inds{i,j})); + end; +end; + +% find datasets with common ICA decompositions +clusters = std_findsameica(ALLEEG); + +setlist = []; +complist = []; +count = 1; +for i = 1:size(inds,1) + for j = 1:size(inds,2) + for ind = 1:length(inds{i,j}) + if ~flag{i,j}(ind) + + % found one good component + complist(count) = inds{i,j}(ind); + %if complist(count) == 12, dfds; end; + + % search for the same component in other datasets + for c = 1:length(clusters) + if any(clusters{c} == sets{i,j}(ind)) + + setlist(:,count) = clusters{c}'; + + % flag all of these datasets + for i2 = 1:size(inds,1) + for j2 = 1:size(inds,2) + for ind2 = 1:length(sets{i2,j2}) + if any(sets{i2,j2}(ind2) == clusters{c}) && complist(count) == inds{i2, j2}(ind2) + flag{i2,j2}(ind2) = 1; + end; + end; + end; + end; + end; + end; + + count = count+1; + + end; + end; + end; +end; +tmpstruct.sets = setlist; +tmpstruct.comps = complist; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_centroid.m b/code/eeglab13_4_4b/functions/studyfunc/std_centroid.m new file mode 100644 index 0000000..3c898b6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_centroid.m @@ -0,0 +1,319 @@ +% std_centroid() - compute cluster centroid in EEGLAB dataset STUDY. +% Compute and store the centroid(s) (i.e., mean(s)) +% for some combination of six measures on specified +% clusters in a STUDY. Possible measures include: scalp +% maps, ERPs, spectra, ERSPs, ITCs, dipole_locations +% Usage: +% >> [STUDY, centroid] = std_centroid(STUDY, ALLEEG, ... +% clusters, measure1, measure2, ...); +% +% Inputs: +% STUDY - STUDY set +% ALLEEG - ALLEEG dataset vector (else an EEG dataset) containing the STUDY +% datasets, typically created using load_ALLEEG(). +% clusters - [vector] of cluster indices. Computes measure means for the +% specified clusters. {deffault|[]: compute means for all +% STUDY clusters} +% measure(s) - ['erp'|'spec'|'scalp'|'dipole'|'itc'|'ersp']. +% The measures(s) for which to calculate the cluster centroid(s): +% 'erp' -> mean ERP of each cluster. +% 'dipole' -> mean dipole of each cluster. +% 'spec' -> mean spectrum of each cluster (baseline removed). +% 'scalp' -> mean topoplot scalp map of each cluster. +% 'ersp' -> mean ERSP of each cluster. +% 'itc' -> mean ITC of each cluster. +% If [], re-compute the centroid for whichever centroids +% have previously been computed. +% Outputs: +% STUDY - input STUDY structure with computed centroids added. +% If the requested centroids already exist, overwites them. +% centroid - cell array of centroid structures, each cell corrasponding +% to a different cluster requested in 'clusters' (above). +% fields of 'centroid' may include centroid.erp, centroid.dipole, +% etc. (as above). The structure is similar as the output +% of the std_readdata() function (with some fields +% about the cluster name and index missing). +% Examples: +% +% >> [STUDY, centroid] = std_centroid(STUDY, ALLEEG,[], 'scalp'); +% % For each of the clusters in STUDY, compute a mean scalp map. +% % The centroids are saved in the STUDY structure as entries in array +% % STUDY.cluster(k).centroid.scalp. The centroids are also returned in +% % a cell array the size of the clusters (i.e., in: centroid(k).scalp). +% +% >> [STUDY, centroid] = std_centroid(STUDY, ALLEEG,5,'spec','scalp'); +% % Same as above, but now compute only two centroids for Cluster 5. +% % The returned 'centroid' has two fields: centroid.scalp and centroid.spec +% +% Authors: Hilit Serby & Arnaud Delorme, SCCN, INC, UCSD, Feb 03, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, Feb 03, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Coding notes: Useful information on functions and global variables used. + +function [STUDY, centroid] = std_centroid(STUDY,ALLEEG, clsind, varargin); + + if nargin < 3 + help std_centroid; + return + end + + if isempty(clsind) + for k = 2: length(STUDY.cluster) %don't include the ParentCluster + if ~strncmpi('Notclust',STUDY.cluster(k).name,8) + % don't include 'Notclust' clusters + clsind = [clsind k]; + end + end + end + %defult values +erpC =0; +specC =0 ; +scalpC = 0; +dipoleC = 0; +itcC = 0; +erspC = 0; + +commands = {}; +if isempty(varargin) + if isfield(STUDY.cluster(clsind(1)).centroid,'scalp') + commands{end+1} = 'scalp'; + end + if isfield(STUDY.cluster(clsind(1)).centroid,'spec') + commands{end+1} = 'spec'; + end + if isfield(STUDY.cluster(clsind(1)).centroid,'erp') + commands{end+1} = 'erp'; + end + if isfield(STUDY.cluster(clsind(1)).centroid,'ersp') + commands{end+1} = 'ersp'; + end + if isfield(STUDY.cluster(clsind(1)).centroid,'itc') + commands{end+1} = 'itc'; + end + if isfield(STUDY.cluster(clsind(1)).centroid,'dipole') + commands{end+1} = 'dipole'; + end +else + commands = varargin; +end + +Ncond = length(STUDY.condition); +if Ncond == 0 + Ncond = 1; +end +centroid = cell(length(clsind),1); +fprintf('Computing '); +for k = 1:length(clsind) + for l = 1:Ncond + for ind = 1:length(commands) + ctr = commands{ind}; + switch ctr + case 'scalp' + centroid{k}.scalp = 0; + scalpC = 1; + if (l ==1) & (k ==1) + fprintf('scalp '); + end + case 'erp' + centroid{k}.erp{l} = 0; + erpC = 1; + if (l ==1) & (k ==1) + fprintf('erp '); + end + case 'spec' + centroid{k}.spec{l} = 0; + specC = 1; + if (l ==1) & (k ==1) + fprintf('spectrum '); + end + case 'ersp' + centroid{k}.ersp{l} = 0; + centroid{k}.ersp_limits{l} = 0; + erspC =1; + if (l ==1) & (k ==1) + fprintf('ersp '); + end + case 'itc' + centroid{k}.itc{l} = 0; + centroid{k}.itc_limits{l} = 0; + itcC = 1; + if (l ==1) & (k ==1) + fprintf('itc '); + end + case 'dipole' + dipoleC =1; + if (l ==1) & (k ==1) + fprintf('dipole '); + end + end + end + end +end +fprintf('centroid (only done once)\n'); +if itcC | erspC | specC | erpC | scalpC + for clust = 1:length(clsind) %go over all requested clusters + for cond = 1:Ncond %compute for all conditions + for k = 1:length(STUDY.cluster(clsind(clust)).comps) % go through all components + comp = STUDY.cluster(clsind(clust)).comps(k); + abset = STUDY.cluster(clsind(clust)).sets(cond,k); + if scalpC & cond == 1 %scalp centroid, does not depend on condition + grid = std_readtopo(ALLEEG, abset, comp); + if isempty(grid) + return; + end + centroid{clust}.scalp = centroid{clust}.scalp + grid; + end + if erpC %erp centroid + [erp, t] = std_readerp(ALLEEG, abset, comp, STUDY.preclust.erpclusttimes); + fprintf('.'); + if isempty(erp) + return; + end + if (cond==1) & (k==1) + all_erp = zeros(length(erp),length(STUDY.cluster(clsind(clust)).comps)); + end + all_erp(:,k) = erp'; + if k == length(STUDY.cluster(clsind(clust)).comps) + [all_erp pol] = std_comppol(all_erp); + centroid{clust}.erp{cond} = mean(all_erp,2); + centroid{clust}.erp_times = t; + end + end + if specC %spec centroid + [spec, f] = std_readspec(ALLEEG, abset, comp, STUDY.preclust.specclustfreqs); + fprintf('.'); + if isempty(spec) + return; + end + centroid{clust}.spec{cond} = centroid{clust}.spec{cond} + spec; + centroid{clust}.spec_freqs = f; + end + if erspC %ersp centroid + fprintf('.'); + if cond == 1 + tmpabset = STUDY.cluster(clsind(clust)).sets(:,k); + [ersp, logfreqs, timevals] = std_readersp(ALLEEG, tmpabset, comp, STUDY.preclust.erspclusttimes, ... + STUDY.preclust.erspclustfreqs ); + if isempty(ersp) + return; + end + for m = 1:Ncond + centroid{clust}.ersp{m} = centroid{clust}.ersp{m} + ersp(:,:,m); + centroid{clust}.ersp_limits{m} = max(floor(max(max(abs(ersp(:,:,m))))), centroid{clust}.ersp_limits{m}); + end + centroid{clust}.ersp_freqs = logfreqs; + centroid{clust}.ersp_times = timevals; + end + end + if itcC %itc centroid + fprintf('.'); + [itc, logfreqs, timevals] = std_readitc(ALLEEG, abset, comp, STUDY.preclust.erspclusttimes, ... + STUDY.preclust.erspclustfreqs ); + if isempty(itc) + return; + end + centroid{clust}.itc{cond} = centroid{clust}.itc{cond} + itc; + centroid{clust}.itc_limits{cond} = max(floor(max(max(abs(itc)))), centroid{clust}.itc_limits{cond}); %ersp image limits + centroid{clust}.itc_freqs = logfreqs; + centroid{clust}.itc_times = timevals; + end + end + end + if ~scalpC + fprintf('\n'); + end; + end +end + +if dipoleC %dipole centroid + for clust = 1:length(clsind) + max_r = 0; + len = length(STUDY.cluster(clsind(clust)).comps); + tmppos = 0; + tmpmom = 0; + tmprv = 0; + ndip = 0; + for k = 1:len + fprintf('.'); + comp = STUDY.cluster(clsind(clust)).comps(k); + abset = STUDY.cluster(clsind(clust)).sets(1,k); + if ~isfield(ALLEEG(abset), 'dipfit') + warndlg2(['No dipole information available in dataset ' num2str(abset) ], 'Aborting compute centroid dipole'); + return; + end + if ~isempty(ALLEEG(abset).dipfit.model(comp).posxyz) + ndip = ndip +1; + tmppos = tmppos + ALLEEG(abset).dipfit.model(comp).posxyz; + tmpmom = tmpmom + ALLEEG(abset).dipfit.model(comp).momxyz; + tmprv = tmprv + ALLEEG(abset).dipfit.model(comp).rv; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') + if isfield(ALLEEG(abset).dipfit, 'hdmfile') %dipfit 2 spherical model + load('-mat', ALLEEG(abset).dipfit.hdmfile); + max_r = max(max_r, max(vol.r)); + else % old version of dipfit + max_r = max(max_r,max(ALLEEG(abset).dipfit.vol.r)); + end + end + end + end + centroid{clust}.dipole.posxyz = tmppos/ndip; + centroid{clust}.dipole.momxyz = tmpmom/ndip; + centroid{clust}.dipole.rv = tmprv/ndip; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') & (~isfield(ALLEEG(abset).dipfit, 'hdmfile')) %old dipfit + centroid{clust}.dipole.maxr = max_r; + end + STUDY.cluster(clsind(clust)).centroid.dipole = centroid{clust}.dipole; + end +end + +%updat STUDY +for clust = 1:length(clsind) %go over all requested clusters + for cond = 1:Ncond + ncomp = length(STUDY.cluster(clsind(clust)).comps); + if scalpC & cond == 1%scalp centroid + centroid{clust}.scalp = centroid{clust}.scalp/ncomp; + STUDY.cluster(clsind(clust)).centroid.scalp = centroid{clust}.scalp ; + end + if erpC + STUDY.cluster(clsind(clust)).centroid.erp{cond} = centroid{clust}.erp{cond}; + STUDY.cluster(clsind(clust)).centroid.erp_times = centroid{clust}.erp_times; + end + if specC + centroid{clust}.spec{cond} = centroid{clust}.spec{cond}/ncomp; + STUDY.cluster(clsind(clust)).centroid.spec{cond} = centroid{clust}.spec{cond}; + STUDY.cluster(clsind(clust)).centroid.spec_freqs = centroid{clust}.spec_freqs; + end + if erspC %ersp centroid + centroid{clust}.ersp{cond} = centroid{clust}.ersp{cond}/ncomp; + STUDY.cluster(clsind(clust)).centroid.ersp{cond} = centroid{clust}.ersp{cond}; + STUDY.cluster(clsind(clust)).centroid.ersp_limits{cond} = floor(0.75*centroid{clust}.ersp_limits{cond}); + %[round(0.9*min(cell2mat({centroid{clust}.ersp_limits{cond,:}}))) round(0.9*max(cell2mat({centroid{clust}.ersp_limits{cond,:}})))]; + STUDY.cluster(clsind(clust)).centroid.ersp_freqs = centroid{clust}.ersp_freqs; + STUDY.cluster(clsind(clust)).centroid.ersp_times = centroid{clust}.ersp_times; + end + if itcC + centroid{clust}.itc{cond} = centroid{clust}.itc{cond}/ncomp; + STUDY.cluster(clsind(clust)).centroid.itc{cond} = centroid{clust}.itc{cond} ; + STUDY.cluster(clsind(clust)).centroid.itc_limits{cond} = floor(0.75*centroid{clust}.itc_limits{cond});%round(0.9*max(cell2mat({centroid{clust}.itc_limits{cond,:}}))); + STUDY.cluster(clsind(clust)).centroid.itc_freqs = centroid{clust}.itc_freqs; + STUDY.cluster(clsind(clust)).centroid.itc_times = centroid{clust}.itc_times; + end + + end +end +fprintf('\n'); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_changroup.m b/code/eeglab13_4_4b/functions/studyfunc/std_changroup.m new file mode 100644 index 0000000..86d5e86 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_changroup.m @@ -0,0 +1,133 @@ +% std_changroup() - Create channel groups for plotting. +% +% Usage: +% >> STUDY = std_changroup(STUDY, ALLEEG); +% >> STUDY = std_changroup(STUDY, ALLEEG, chanlocs, 'interp'); +% Inputs: +% ALLEEG - Top-level EEGLAB vector of loaded EEG structures for the dataset(s) +% in the STUDY. ALLEEG for a STUDY set is typically loaded using +% pop_loadstudy(), or in creating a new STUDY, using pop_createstudy(). +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% chanlocs - EEGLAB channel structure. Only construct the STUDY.changrp +% structure for a subset of channels. +% 'interp' - optional input in case channel locations are interpolated +% +% Outputs: +% STUDY - The input STUDY set structure modified according to specified user +% edits, if any. The STUDY.changrp structure is created. It contains as +% many elements as there are channels. For example, STUDY.changrp(1) +% is the first channel. Fields of the changrp structure created at this +% point are +% STUDY.changrp.name : name of the channel group +% STUDY.changrp.channels : cell array containing channel labels +% for the group. +% STUDY.changrp.setinds : indices of datasets containing the +% selected channels. +% STUDY.changrp.allinds : indices of channels within the datasets +% above. +% +% Authors: Arnaud Delorme, CERCO, 2006 + +% Copyright (C) Arnaud Delorme, CERCO, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_changroup(STUDY, ALLEEG, alllocs, interp); + +if nargin < 4 + interp = 'off'; +end; + +% union of all channel structures +% ------------------------------- +inputloc = 0; +if nargin >= 3 + if ~isempty(alllocs) + inputloc = 1; + end; +end; +if ~inputloc + alllocs = eeg_mergelocs(ALLEEG.chanlocs); +end; + +% create group for each electrode +% ------------------------------- +if isstruct(alllocs) + alllocs = { alllocs.labels }; +end; +STUDY.changrp = []; +for indc = 1:length(alllocs) + STUDY.changrp(indc).name = alllocs{indc}; + STUDY.changrp(indc).channels = { alllocs{indc} }; + tmp = std_chanlookupnew( STUDY, ALLEEG, STUDY.changrp(indc), interp); + STUDY.changrp(indc).setinds = tmp.setinds; + STUDY.changrp(indc).allinds = tmp.allinds; + STUDY.changrp(indc).centroid = []; +end; + +% if strcmpi(interp, 'off') +% if length(unique( cellfun(@length, { ALLEEG.chanlocs }))) ~= 1 +% STUDY.changrpstatus = 'some channels missing in some datasets'; +% else STUDY.changrpstatus = 'all channels present in all datasets'; +% end; +% else STUDY.changrpstatus = 'all channels present in all datasets - interpolated'; +% end; + +%STUDY.changrp(indc).name = [ 'full montage' ]; +%STUDY.changrp(indc).channels = { alllocs.labels }; +%tmp = std_chanlookup( STUDY, ALLEEG, STUDY.changrp(indc)); +%STUDY.changrp(indc).chaninds = tmp.chaninds; +return; + +% find datasets and channel indices +% --------------------------------- +function changrp = std_chanlookupnew( STUDY, ALLEEG, changrp, interp); + + setinfo = STUDY.design(STUDY.currentdesign).cell; + allconditions = STUDY.design(STUDY.currentdesign).variable(1).value; + allgroups = STUDY.design(STUDY.currentdesign).variable(2).value; + nc = max(length(allconditions),1); + ng = max(length(allgroups), 1); + changrp.allinds = cell( nc, ng ); + changrp.setinds = cell( nc, ng ); + for index = 1:length(setinfo) + % get index of independent variables + % ---------------------------------- + condind = std_indvarmatch( setinfo(index).value{1}, allconditions); + grpind = std_indvarmatch( setinfo(index).value{2}, allgroups ); + if isempty(allconditions), condind = 1; end; + if isempty(allgroups), grpind = 1; end; + + % scan all channel labels + % ----------------------- + if strcmpi(interp, 'off') + datind = setinfo(index).dataset; + tmpchanlocs = ALLEEG(datind(1)).chanlocs; + tmplocs = { tmpchanlocs.labels }; + for indc = 1:length(changrp.channels) % usually just one channel + ind = strmatch( changrp.channels{indc}, tmplocs, 'exact'); + if length(ind) > 1, error([ 'Duplicate channel label ''' tmplocs{ind(1)} ''' for dataset ' int2str(datind) ]); end; + if ~isempty(ind) + changrp.allinds{ condind, grpind } = [ changrp.allinds{ condind, grpind } ind ]; + changrp.setinds{ condind, grpind } = [ changrp.setinds{ condind, grpind } index ]; + end; + end; + else % interpolation is "on", all channels for all datasets + alllocs = { STUDY.changrp.name }; + ind = strmatch( changrp.name, alllocs, 'exact'); + changrp.allinds{ condind, grpind } = [ changrp.allinds{ condind, grpind } ind ]; + changrp.setinds{ condind, grpind } = [ changrp.setinds{ condind, grpind } index ]; + end; + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_chaninds.m b/code/eeglab13_4_4b/functions/studyfunc/std_chaninds.m new file mode 100644 index 0000000..376995e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_chaninds.m @@ -0,0 +1,57 @@ +% std_chaninds() - look up channel indices in a STUDY +% +% Usage: +% >> inds = std_chaninds(STUDY, channames); +% >> inds = std_chaninds(EEG, channames); +% >> inds = std_chaninds(chanlocs, channames); +% Inputs: +% STUDY - studyset structure containing a changrp substructure. +% EEG - EEG structure containing channel location structure +% chanlocs - channel location structure +% channames - [cell] channel names +% +% Outputs: +% inds - [integer array] channel indices +% +% Author: Arnaud Delorme, CERCO, 2006- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function finalinds = std_chaninds(instruct, channames); + + finalinds = []; + if isfield(instruct, 'chanlocs') + EEG = instruct; + tmpchanlocs = EEG.chanlocs; + tmpallchans = lower({ tmpchanlocs.labels }); + elseif isfield(instruct, 'filename') + tmpallchans = lower({ instruct.changrp.name }); + else + tmpallchans = instruct; + end; + if ~iscell(channames), channames = { channames }; end; + + if isempty(channames), finalinds = [1:length(tmpallchans)]; return; end; + for c = 1:length(channames) + if isnumeric(channames) + chanind = channames(c); + else + chanind = strmatch( lower(channames{c}), tmpallchans, 'exact'); + if isempty(chanind), warning(sprintf([ 'Channel "%s" and maybe others was not' 10 'found in pre-computed data file' ], channames{c})); end; + end; + finalinds = [ finalinds chanind ]; + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_chantopo.m b/code/eeglab13_4_4b/functions/studyfunc/std_chantopo.m new file mode 100644 index 0000000..00382fa --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_chantopo.m @@ -0,0 +1,254 @@ +% std_chantopo() - plot ERP/spectral/ERSP topoplot at a specific +% latency/frequency. +% Usage: +% >> std_chantopo( data, 'key', 'val', ...) +% Inputs: +% data - [cell array] mean data for each subject group and/or data +% condition. These arrays are usually returned by function +% std_erspplot and std_erpplot. For example +% +% >> data = { [1x64x12] [1x64x12 }; % 2 groups of 12 subjects, 64 channels +% >> std_chantopo(data, 'chanlocs', 'chanlocfile.txt'); +% +% Scalp map plotting option (mandatory): +% 'chanlocs' - [struct] channel location structure +% +% Other scalp map plotting options: +% 'chanlocs' - [struct] channel location structure +% 'topoplotopt' - [cell] topoplot options. Default is { 'style', 'both', +% 'shading', 'interp' }. See topoplot help for details. +% 'ylim' - [min max] ordinate limits for ERP and spectrum plots +% {default: all available data} +% 'caxis' - [min max] same as above +% +% Optional display parameters: +% 'datatype' - ['erp'|'spec'] data type {default: 'erp'} +% 'titles' - [cell array of string] titles for each of the subplots. +% { default: none} +% 'subplotpos' - [addr addc posr posc] perform ploting in existing figure. +% Add "addr" rows, "addc" columns and plot the scalp +% topographies starting at position (posr,posc). +% +% Statistics options: +% 'groupstats' - [cell] One p-value array per group {default: {}} +% 'condstats' - [cell] One p-value array per condition {default: {}} +% 'interstats' - [cell] Interaction p-value arrays {default: {}} +% 'threshold' - [NaN|real<<1] Significance threshold. NaN -> plot the +% p-values themselves on a different figure. When possible, +% significance regions are indicated below the data. +% {default: NaN} +% 'binarypval' - ['on'|'off'] if a threshold is set, show only significant +% channels as red dots. Default is 'off'. +% +% Author: Arnaud Delorme, CERCO, CNRS, 2006- +% +% See also: pop_erspparams(), pop_erpparams(), pop_specparams(), statcond() + +function std_chantopo(data, varargin) + +pgroup = []; +pcond = []; +pinter = []; +if nargin < 2 + help std_chantopo; + return; +end; + +opt = finputcheck( varargin, { 'ylim' 'real' [] []; + 'titles' 'cell' [] cell(20,20); + 'threshold' 'real' [] NaN; + 'chanlocs' 'struct' [] struct('labels', {}); + 'groupstats' 'cell' [] {}; + 'condstats' 'cell' [] {}; + 'interstats' 'cell' [] {}; + 'subplotpos' 'integer' [] []; + 'topoplotopt' 'cell' [] { 'style', 'both' }; + 'binarypval' 'string' { 'on','off' } 'on'; + 'datatype' 'string' { 'ersp','itc','erp','spec' } 'erp'; + 'caxis' 'real' [] [] }, 'std_chantopo', 'ignore'); %, 'ignore'); +if isstr(opt), error(opt); end; +if ~isempty(opt.ylim), opt.caxis = opt.ylim; end; +if isnan(opt.threshold), opt.binarypval = 'off'; end; +if strcmpi(opt.binarypval, 'on'), opt.ptopoopt = { 'style' 'blank' }; else opt.ptopoopt = opt.topoplotopt; end; + +% remove empty entries +datapresent = ~cellfun(@isempty, data); +for c = size(data,1):-1:1, if sum(datapresent(c,:)) == 0, data(c,:) = []; opt.titles(c,:) = []; if ~isempty(opt.groupstats), opt.groupstats(c) = []; end; end; end; +for g = size(data,2):-1:1, if sum(datapresent(:,g)) == 0, data(:,g) = []; opt.titles(:,g) = []; if ~isempty(opt.condstats ), opt.condstats( g) = []; end; end; end; + +nc = size(data,1); +ng = size(data,2); +if nc >= ng, opt.transpose = 'on'; +else opt.transpose = 'off'; +end; + +% plotting paramters +% ------------------ +if ng > 1 & ~isempty(opt.groupstats), addc = 1; else addc = 0; end; +if nc > 1 & ~isempty(opt.condstats ), addr = 1; else addr = 0; end; +if ~isempty(opt.subplotpos), + if strcmpi(opt.transpose, 'on'), opt.subplotpos = opt.subplotpos([2 1 4 3]); end; + addr = opt.subplotpos(1); + addc = opt.subplotpos(2); + posr = opt.subplotpos(4); + posc = opt.subplotpos(3); +else posr = 0; + posc = 0; +end; + +% compute significance mask +% ------------------------- +if ~isempty(opt.interstats), pinter = opt.interstats{3}; end; + +if ~isnan(opt.threshold(1)) && ( ~isempty(opt.groupstats) || ~isempty(opt.condstats) ) + pcondplot = opt.condstats; + pgroupplot = opt.groupstats; + pinterplot = pinter; + maxplot = 1; +else + for ind = 1:length(opt.condstats), pcondplot{ind} = -log10(opt.condstats{ind}); end; + for ind = 1:length(opt.groupstats), pgroupplot{ind} = -log10(opt.groupstats{ind}); end; + if ~isempty(pinter), pinterplot = -log10(pinter); end; + maxplot = 3; +end; + +% adjust figure size +% ------------------ +if isempty(opt.subplotpos) + fig = figure('color', 'w'); + pos = get(fig, 'position'); + set(fig, 'position', [ pos(1)+15 pos(2)+15 pos(3)/2.5*(nc+addr), pos(4)/2*(ng+addc) ]); + pos = get(fig, 'position'); + if strcmpi(opt.transpose, 'off'), set(gcf, 'position', [ pos(1) pos(2) pos(4) pos(3)]); + else set(gcf, 'position', pos); + end; +end + +% topoplot +% -------- +tmpc = [inf -inf]; +for c = 1:nc + for g = 1:ng + hdl(c,g) = mysubplot(nc+addr, ng+addc, g + posr + (c-1+posc)*(ng+addc), opt.transpose); + if ~isempty(data{c,g}) + tmpplot = double(mean(data{c,g},3)); + if ~all(isnan(tmpplot)) + if ~isreal(tmpplot), error('This function cannot plot complex values'); end; + topoplot( tmpplot, opt.chanlocs, opt.topoplotopt{:}); + if isempty(opt.caxis) + tmpc = [ min(min(tmpplot), tmpc(1)) max(max(tmpplot), tmpc(2)) ]; + else + caxis(opt.caxis); + end; + title(opt.titles{c,g}, 'interpreter', 'none'); + else + axis off; + end; + else + axis off; + end; + + % statistics accross groups + % ------------------------- + if g == ng & ng > 1 & ~isempty(opt.groupstats) + hdl(c,g+1) = mysubplot(nc+addr, ng+addc, g + posr + 1 + (c-1+posc)*(ng+addc), opt.transpose); + topoplot( pgroupplot{c}, opt.chanlocs, opt.ptopoopt{:}); + title(opt.titles{c,g+1}); + caxis([-maxplot maxplot]); + end; + end; +end; + +% color scale +% ----------- +if isempty(opt.caxis) + for c = 1:nc + for g = 1:ng + axes(hdl(c,g)); + caxis(tmpc); + end; + end; +end; + +for g = 1:ng + % statistics accross conditions + % ----------------------------- + if ~isempty(opt.condstats) && nc > 1 + hdl(nc+1,g) = mysubplot(nc+addr, ng+addc, g + posr + (c+posc)*(ng+addc), opt.transpose); + topoplot( pcondplot{g}, opt.chanlocs, opt.ptopoopt{:}); + title(opt.titles{nc+1,g}); + caxis([-maxplot maxplot]); + end; +end; + +% statistics accross group and conditions +% --------------------------------------- +if ~isempty(opt.condstats) && ~isempty(opt.groupstats) && ng > 1 && nc > 1 + hdl(nc+1,ng+1) = mysubplot(nc+addr, ng+addc, g + posr + 1 + (c+posc)*(ng+addc), opt.transpose); + topoplot( pinterplot, opt.chanlocs, opt.ptopoopt{:}); + title(opt.titles{nc+1,ng+1}); + caxis([-maxplot maxplot]); +end; + +% color bars +% ---------- +axes(hdl(nc,ng)); +cbar_standard(opt.datatype, ng); +if isnan(opt.threshold(1)) && (nc ~= size(hdl,1) || ng ~= size(hdl,2)) + axes(hdl(end,end)); + cbar_signif(ng, maxplot); +end; + +% remove axis labels +% ------------------ +for c = 1:size(hdl,1) + for g = 1:size(hdl,2) + if g ~= 1 && size(hdl,2) ~=1, ylabel(''); end; + if c ~= size(hdl,1) && size(hdl,1) ~= 1, xlabel(''); end; + end; +end; + +% colorbar for ERSP and scalp plot +% -------------------------------- +function cbar_standard(datatype, ng); + pos = get(gca, 'position'); + tmpc = caxis; + fact = fastif(ng == 1, 40, 20); + tmp = axes('position', [ pos(1)+pos(3)+pos(3)/fact pos(2) pos(3)/fact pos(4) ]); + set(gca, 'unit', 'normalized'); + if strcmpi(datatype, 'itc') + cbar(tmp, 0, tmpc, 10); ylim([0.5 1]); + else cbar(tmp, 0, tmpc, 5); + end; + +% colorbar for significance +% ------------------------- +function cbar_signif(ng, maxplot); + % Retrieving Defaults + icadefs; + + pos = get(gca, 'position'); + tmpc = caxis; + fact = fastif(ng == 1, 40, 20); + tmp = axes('position', [ pos(1)+pos(3)+pos(3)/fact pos(2) pos(3)/fact pos(4) ]); + map = colormap(DEFAULT_COLORMAP); + n = size(map,1); + cols = [ceil(n/2):n]'; + image([0 1],linspace(0,maxplot,length(cols)),[cols cols]); + %cbar(tmp, 0, tmpc, 5); + tick = linspace(0, maxplot, maxplot+1); + set(gca, 'ytickmode', 'manual', 'YAxisLocation', 'right', 'xtick', [], ... + 'ytick', tick, 'yticklabel', round(10.^-tick*1000)/1000); + xlabel(''); + colormap(DEFAULT_COLORMAP); + +% mysubplot (allow to transpose if necessary) +% ------------------------------------------- +function hdl = mysubplot(nr,nc,ind,transp); + + r = ceil(ind/nc); + c = ind -(r-1)*nc; + if strcmpi(transp, 'on'), hdl = subplot(nc,nr,(c-1)*nr+r); + else hdl = subplot(nr,nc,(r-1)*nc+c); + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_checkconsist.m b/code/eeglab13_4_4b/functions/studyfunc/std_checkconsist.m new file mode 100644 index 0000000..49603d0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_checkconsist.m @@ -0,0 +1,66 @@ +% std_checkconsist() - Create channel groups for plotting. +% +% Usage: +% >> boolval = std_checkconsist(STUDY, 'uniform', 'condition'); +% >> boolval = std_checkconsist(STUDY, 'uniform', 'group'); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% 'uniform' - ['condition'|'group'] check if there is one group +% condition per subject +% Outputs: +% boolval - [0|1] 1 if uniform +% +% Authors: Arnaud Delorme, CERCO, 2009 + +% Copyright (C) Arnaud Delorme, CERCO, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [boolval npersubj] = std_checkconsist(STUDY, varargin); + +if nargin < 3 + help std_checkconsist; + return; +end; + +opt = struct(varargin{:}); + +if strcmpi(opt.uniform, 'condition') + allvals = { STUDY.datasetinfo.condition }; + vallist = STUDY.condition; +elseif strcmpi(opt.uniform, 'group') + allvals = { STUDY.datasetinfo.group }; + vallist = STUDY.group; +elseif strcmpi(opt.uniform, 'session') + allvals = { STUDY.datasetinfo.session }; + allvals = cellfun(@num2str, allvals, 'uniformoutput', false); + vallist = STUDY.session; + if isempty(vallist), boolval = 1; return; end; + vallist = cellfun(@num2str, mattocell(vallist), 'uniformoutput', false); +else + error('unknown option'); +end; + +if isempty(vallist), boolval = 1; return; end; + +for index = 1:length(vallist) + tmplist = strmatch( vallist{index}, allvals, 'exact'); + vallen(index) = length(unique( { STUDY.datasetinfo(tmplist).subject } )); +end; +if length(unique(vallen)) == 1 + boolval = 1; +else boolval = 0; +end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_checkfiles.m b/code/eeglab13_4_4b/functions/studyfunc/std_checkfiles.m new file mode 100644 index 0000000..888f13e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_checkfiles.m @@ -0,0 +1,174 @@ +% std_checkfiles() - Check all STUDY files consistency +% +% Usage: +% >> boolval = std_checkfiles(STUDY, ALLEEG); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - All EEGLAB datasets +% +% Outputs: +% boolval - [0|1] 1 if uniform +% +% Authors: Arnaud Delorme, CERCO, 2010- + +% Copyright (C) Arnaud Delorme, CERCO +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [boolval npersubj] = std_checkfiles(STUDY, ALLEEG); + +if nargin < 2 + help std_checkfiles; + return; +end; +return; + +filetypes = { 'daterp' 'datspec' 'datersp' 'datitc' 'dattimef' ... + 'icaerp' 'icaspec' 'icaersp' 'icaitc' 'icatopo' }; + +% set channel interpolation mode +% ------------------------------ +uniformchannels = std_uniformsetinds( STUDY ); + +disp('---------------------------------------------'); +disp('Checking data files integrity and consistency'); +passall = 1; +for index = 1:length(filetypes) + + % scan datasets + % ------------- + [ tmpstruct compinds filepresent ] = std_fileinfo(ALLEEG, filetypes{index}); + if ~isempty(tmpstruct) + fprintf('Files of type "%s" detected, checking...', filetypes{index}); + end; + + % check if the structures are equal + % --------------------------------- + notequal = any(~filepresent); + if ~isempty(tmpstruct) + if any(filepresent == 0) + fprintf(' Error, some files inconsistent or missing\n'); + notequal = 1; + passall = 0; + else + firstpass = 1; + fields = fieldnames(tmpstruct); + for f_ind = 1:length(fields) + + firstval = getfield(tmpstruct, {1}, fields{f_ind}); + for dat = 2:length(tmpstruct) + tmpval = getfield(tmpstruct, {dat}, fields{f_ind}); + if ~isequal(firstval, tmpval) + + % check for NaNs + if iscell(firstval) && iscell(tmpval) + for cind = 1:length(firstval) + if isreal(firstval{cind}) && ~isempty(firstval{cind}) && isnan(firstval{cind}(1)) + firstval{cind} = 'NaN'; + end; + end; + for cind = 1:length(tmpval) + if isreal(tmpval{cind}) && ~isempty(tmpval{cind}) && isnan(tmpval{cind}(1)) + tmpval{cind} = 'NaN'; + end; + end; + end; + + if ~isequal(firstval, tmpval) + if ~strcmpi(fields{f_ind}, 'labels') || strcmpi(uniformchannels, 'on') + if firstpass == 1, fprintf('\n'); firstpass = 0; end; + fprintf(' Error, difference accross data files for field "%s"\n', fields{f_ind}); + notequal = 1; + passall = 0; + break; + end; + end; + end; + end; + end; + end; + end; + + % check the consistency of changrp and cluster with saved information + % ------------------------------------------------------------------- + if isempty(tmpstruct), notequal = 1; end; + if filetypes{index}(1) == 'd' && notequal == 0 + % scan all channel labels + % ----------------------- + if isfield(tmpstruct(1), 'labels') + for cind = 1:length(STUDY.changrp) + if notequal == 0 + for inddat = 1:length(ALLEEG) + tmpind = cellfun(@(x)(find(x == inddat)), STUDY.changrp(cind).setinds(:), 'uniformoutput', false); + indnonempty = find(~cellfun(@isempty, tmpind(:))); + if ~isempty(indnonempty) + tmpchan = STUDY.changrp(cind).allinds{indnonempty}(tmpind{indnonempty}); % channel index for dataset inddat + + tmpchan2 = strmatch(STUDY.changrp(cind).name, tmpstruct(inddat).labels, 'exact'); % channel index in file + if ~isempty(tmpchan2) || ~strcmpi(filetypes{index}, 'datspec') % the last statement is because channel labels did not use to be saved in spec files + if ~isequal(tmpchan2, tmpchan) + fprintf('\nError: channel index in STUDY.changrp(%d) for dataset %d is "%d" but "%d" in data files\n', cind, inddat, tmpchan, tmpchan2); + notequal = 1; + break; + end; + end; + end; + end; + end; + end; + end; + elseif notequal == 0 && ~isempty(STUDY.cluster) % components + % check that the cell structures are present + % ------------------------------------------ + if ~isfield(STUDY.cluster, 'setinds') + STUDY.cluster(1).setinds = []; + STUDY.cluster(1).allinds = []; + end; + for cind = 1:length(STUDY.cluster) + if isempty(STUDY.cluster(cind).setinds) + STUDY.cluster(cind) = std_setcomps2cell(STUDY, cind); + end; + end; + for cind = 1:length(STUDY.cluster) + if notequal == 0 + for inddat = 1:length(ALLEEG) + tmpind = cellfun(@(x)(find(x == inddat)), STUDY.cluster(cind).setinds(:), 'uniformoutput', false); + indnonempty = find(~cellfun(@isempty, tmpind(:))); + tmpcomp = []; + for jind = 1:length(indnonempty) + tmpcomp = [ tmpcomp STUDY.cluster(cind).allinds{indnonempty(jind)}(tmpind{indnonempty(jind)}) ]; + end; + + if ~isempty(setdiff(tmpcomp, compinds{inddat})) + if ~(isempty(compinds{inddat}) && strcmpi(filetypes{index}, 'icatopo')) + fprintf('\nError: some components in clusters %d are absent from .%s files\n', cind, filetypes{index}); + notequal = 1; + passall = 0; + break; + end; + end; + end; + end; + end; + end; + if notequal == 0, fprintf(' Pass\n'); end; +end; + +if ~passall + disp('**** Recompute any measure above not receiving a "Pass" by') + disp('**** calling menu items "STUDY > Precompute Channel/Component measures" '); + disp('**** and by selecting the "Recompute even if present on disk" checkbox'); +end; +disp('Checking completed.'); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_checkset.m b/code/eeglab13_4_4b/functions/studyfunc/std_checkset.m new file mode 100644 index 0000000..f8e086b --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_checkset.m @@ -0,0 +1,328 @@ +% std_checkset() - check STUDY set consistency +% +% Usage: >> [STUDY, ALLEEG] = std_checkset(STUDY, ALLEEG); +% +% Input: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of EEG datasets included in the STUDY structure +% +% Output: +% STUDY - a new STUDY set containing some or all of the datasets in ALLEEG, +% plus additional information from the optional inputs above. +% ALLEEG - an EEGLAB vector of EEG sets included in the STUDY structure +% +% Authors: Arnaud Delorme & Hilit Serby, SCCN, INC, UCSD, November 2005 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, ALLEEG, command] = std_checkset(STUDY, ALLEEG, option); + +if nargin < 2 + help std_checkset; + return; +end; +command = ''; + +if isempty(STUDY), return; end; +studywasempty = 0; + +modif = 0; +if ~isfield(STUDY, 'name'), STUDY.name = ''; modif = 1; end; +if ~isfield(STUDY, 'task'), STUDY.task = ''; modif = 1; end; +if ~isfield(STUDY, 'notes'), STUDY.notes = ''; modif = 1; end; +if ~isfield(STUDY, 'filename'), STUDY.filename = ''; modif = 1; end; +if ~isfield(STUDY, 'filepath'), STUDY.filepath = ''; modif = 1; end; +if ~isfield(STUDY, 'history'), STUDY.history = ''; modif = 1; end; +if ~isfield(STUDY, 'subject'), STUDY.subject = {}; modif = 1; end; +if ~isfield(STUDY, 'group'), STUDY.group = {}; modif = 1; end; +if ~isfield(STUDY, 'session'), STUDY.session = {}; modif = 1; end; +if ~isfield(STUDY, 'condition'), STUDY.condition = {}; modif = 1; end; +if ~isfield(STUDY, 'setind'), STUDY.setind = {}; modif = 1; end; +if ~isfield(STUDY, 'etc'), STUDY.etc = []; modif = 1; end; +if ~isfield(STUDY, 'etc.warnmemory'), STUDY.etc.warnmemory = 1; modif = 1; end; +if ~isfield(STUDY, 'preclust'), STUDY.preclust = []; modif = 1; end; +if ~isfield(STUDY, 'datasetinfo'), STUDY.datasetinfo = []; modif = 1; end; +if ~isfield(STUDY.etc, 'version'), STUDY.etc.version = []; modif = 1; end; +if ~isfield(STUDY.preclust, 'erpclusttimes' ), STUDY.preclust.erpclusttimes = []; modif = 1; end; +if ~isfield(STUDY.preclust, 'specclustfreqs' ), STUDY.preclust.specclustfreqs = []; modif = 1; end; +if ~isfield(STUDY.preclust, 'erspclustfreqs' ), STUDY.preclust.erspclustfreqs = []; modif = 1; end; +if ~isfield(STUDY.preclust, 'erspclusttimes' ), STUDY.preclust.erspclusttimes = []; modif = 1; end; +if ~isfield(STUDY.datasetinfo, 'comps') & ~isempty(STUDY.datasetinfo), STUDY.datasetinfo(1).comps = []; modif = 1; end; +if ~isfield(STUDY.datasetinfo, 'index') & ~isempty(STUDY.datasetinfo), STUDY.datasetinfo(1).index = []; modif = 1; end; + +% all summary fields +% ------------------ +try, subject = unique_bc({ STUDY.datasetinfo.subject }); +catch, + subject = ''; + disp('Important warning: some datasets do not have subject codes; some functions may crash!'); +end; +try, group = unique_bc({ STUDY.datasetinfo.group }); +catch, + group = {}; + % disp('Important warning: some datasets do not have group codes; some functions may crash!'); +end; +try, condition = unique_bc({ STUDY.datasetinfo.condition }); +catch, + condition = {}; + disp('Important warning: some datasets do not have condition codes; some functions may crash!'); +end; +try, session = unique_bc([STUDY.datasetinfo.session]); +catch, + session = ''; + % disp('Important warning: some datasets do not have session numbers; some functions may crash!'); +end; +if ~isequal(STUDY.subject, subject ), STUDY.subject = subject; modif = 1; end; +if ~isequal(STUDY.group, group ), STUDY.group = group; modif = 1; end; +if ~isequal(STUDY.condition, condition), STUDY.condition = condition; modif = 1; end; +if ~isequal(STUDY.session, session ), STUDY.session = session; modif = 1; end; + +% check dataset info consistency +% ------------------------------ +for k = 1:length(STUDY.datasetinfo) + if ~strcmpi(STUDY.datasetinfo(k).filename, ALLEEG(k).filename) + STUDY.datasetinfo(k).filename = ALLEEG(k).filename; modif = 1; + fprintf('Warning: file name has changed for dataset %d and the study has been updated\n', k); + fprintf(' to discard this change in the study, reload it from disk\n'); + end; +end; + +% recompute setind array (setind is deprecated but we keep it anyway) +% ------------------------------------------------------------------- +setind = []; +sameica = std_findsameica(ALLEEG); +for index = 1:length(sameica) + setind(length(sameica{index}):-1:1,index) = sameica{index}'; +end; +setind(find(setind == 0)) = NaN; +if any(isnan(setind)) + warndlg('Warning: non-uniform set of dataset, some function might not work'); +end +if ~isequal(setind, STUDY.setind), STUDY.setind = setind; modif = 1; end; + +% check that dipfit is present in all datasets +% -------------------------------------------- +for cc = 1:length(sameica) + idat = []; + for tmpi = 1:length(sameica{cc}) + if isfield(ALLEEG(sameica{cc}(tmpi)).dipfit, 'model') + idat = sameica{cc}(tmpi); + end; + end; + if ~isempty(idat) + for tmpi = 1:length(sameica{cc}) + if ~isfield(ALLEEG(sameica{cc}(tmpi)).dipfit, 'model') + ALLEEG(sameica{cc}(tmpi)).dipfit = ALLEEG(idat).dipfit; + ALLEEG(sameica{cc}(tmpi)).saved = 'no'; + fprintf('Warning: no ICA dipoles for dataset %d, using dipoles from dataset %d (same ICA)\n', sameica{cc}(tmpi), idat); + end; + end; + end; +end; + +% put in fake channels if channel labels are missing +% -------------------------------------------------- +chanlabels = { ALLEEG.chanlocs }; +if any(cellfun(@isempty, chanlabels)) + if any(~cellfun(@isempty, chanlabels)) + disp('********************************************************************'); + disp(' IMPORTANT WARNING: SOME DATASETS DO NOT HAVE CHANNEL LABELS AND '); + disp(' SOME OTHERs HAVE CHANNEL LABELS. GENERATING CHANNEL LABELS FOR '); + disp(' THE FORMER DATASETS (THIS SHOULD PROBABLY BE FIXED BY THE USER).'); + disp('********************************************************************'); + end; + disp('Generating channel labels for all datasets...'); + for currentind = 1:length(ALLEEG) + for ind = 1:ALLEEG(currentind).nbchan + ALLEEG(currentind).chanlocs(ind).labels = int2str(ind); + end; + end; + ALLEEG(currentind).saved = 'no'; +end; + +if length( unique( [ ALLEEG.srate ] )) > 1 + disp('********************************************************************'); + disp(' IMPORTANT WARNING: SOME DATASETS DO NOT HAVE THE SAME SAMPLING '); + disp(' RATE AND THIS WILL MAKE MOST OF THE STUDY FUNCTIONS CRASH. THIS'); + disp(' SHOULD PROBABLY BE FIXED BY THE USER.'); + disp('********************************************************************'); +end; + +% check cluster array +% ------------------- +rebuild_design = 0; +if ~isfield(STUDY, 'cluster'), STUDY.cluster = []; modif = 1; end; +if ~isfield(STUDY, 'changrp'), STUDY.changrp = []; modif = 1; end; +if isempty(STUDY.changrp) && isempty(STUDY.cluster) + rebuild_design = 1; +end; +if isfield(STUDY.cluster, 'sets'), + if max(STUDY.cluster(1).sets(:)) > length(STUDY.datasetinfo) + disp('Warning: Some datasets had been removed from the STUDY, clusters have been reinitialized'); + STUDY.cluster = []; + end; +end; +if ~studywasempty + if isempty(STUDY.cluster) + modif = 1; + [STUDY] = std_createclust(STUDY, ALLEEG, 'parentcluster', 'on'); + end; + if length(STUDY.cluster(1).child) == length(STUDY.cluster)-1 && length(STUDY.cluster) > 1 + newchild = { STUDY.cluster(2:end).name }; + if ~isequal(STUDY.cluster(1).child, newchild) + STUDY.cluster(1).child = newchild; + end; + end; +end; + +% create STUDY design if it is not present +% ---------------------------------------- +if ~studywasempty + if isfield(STUDY.datasetinfo, 'trialinfo') + alltrialinfo = { STUDY.datasetinfo.trialinfo }; + if any(cellfun(@isempty, alltrialinfo)) && any(~cellfun(@isempty, alltrialinfo)) + disp('Rebuilding trial information structure for STUDY'); + STUDY = std_maketrialinfo(STUDY, ALLEEG); % some dataset do not have trialinfo and + % some other have it, remake it for everybody + end; + end; + if ~isfield(STUDY, 'design') || isempty(STUDY.design) || ~isfield(STUDY.design, 'name') + STUDY = std_maketrialinfo(STUDY, ALLEEG); + STUDY = std_makedesign(STUDY, ALLEEG); + STUDY = std_selectdesign(STUDY, ALLEEG,1); + rebuild_design = 0; + else + if isfield(STUDY.design, 'indvar1') + STUDY = std_convertdesign(STUDY, ALLEEG); + end; + + % convert combined independent variable values + % between dash to cell array of strings + % ------------------------------------- + for inddes = 1:length(STUDY.design) + for indvar = 1:length(STUDY.design(inddes).variable) + for indval = 1:length(STUDY.design(inddes).variable(indvar).value) + STUDY.design(inddes).variable(indvar).value{indval} = convertindvarval(STUDY.design(inddes).variable(indvar).value{indval}); + end; + end; + for indcell = 1:length(STUDY.design(inddes).cell) + for indval = 1:length(STUDY.design(inddes).cell(indcell).value) + STUDY.design(inddes).cell(indcell).value{indval} = convertindvarval(STUDY.design(inddes).cell(indcell).value{indval}); + end; + end; + for indinclude = 1:length(STUDY.design(inddes).include) + if iscell(STUDY.design(inddes).include{indinclude}) + for indval = 1:length(STUDY.design(inddes).include{indinclude}) + STUDY.design(inddes).include{indinclude}{indval} = convertindvarval(STUDY.design(inddes).include{indinclude}{indval}); + end; + end; + end; + + % check for duplicate entries in filebase + % --------------------------------------- + if length( { STUDY.design(inddes).cell.filebase } ) > length(unique({ STUDY.design(inddes).cell.filebase })) + if ~isempty(findstr('design_', STUDY.design(inddes).cell(1).filebase)) + error('There is a problem with your STUDY, contact EEGLAB support'); + else + fprintf('Duplicate entry detected in Design %d, reinitializing design\n', inddes); + [STUDY com] = std_makedesign(STUDY, ALLEEG, inddes, STUDY.design(inddes), 'defaultdesign', 'forceoff'); + end + end; + end; + end; + + if rebuild_design % in case datasets have been added or removed + STUDY = std_rebuilddesign(STUDY, ALLEEG); + end; + + % scan design to fix old paring format + % ------------------------------------ + for design = 1:length(STUDY.design) + for var = 1:length(STUDY.design(design).variable) + if isstr(STUDY.design(design).variable(1).pairing) + if strcmpi(STUDY.design(design).variable(1).pairing, 'paired') + STUDY.design(design).variable(1).pairing = 'on'; + elseif strcmpi(STUDY.design(design).variable(1).pairing, 'unpaired') + STUDY.design(design).variable(1).pairing = 'off'; + end; + end; + if isstr(STUDY.design(design).variable(2).pairing) + if strcmpi(STUDY.design(design).variable(2).pairing, 'paired') + STUDY.design(design).variable(2).pairing = 'on'; + elseif strcmpi(STUDY.design(design).variable(2).pairing, 'unpaired') + STUDY.design(design).variable(2).pairing = 'off'; + end; + end; + end; + end; + + % add filepath field if absent + for ind = 1:length(STUDY.design) + if ~isfield(STUDY.design, 'filepath') || (isnumeric(STUDY.design(ind).filepath) && isempty(STUDY.design(ind).filepath)) + STUDY.design(ind).filepath = ''; + STUDY.saved = 'no'; + modif = 1; + end; + end; + + % check that ICA is present and if it is update STUDY.datasetinfo + allcompsSTUDY = { STUDY.datasetinfo.comps }; + allcompsALLEEG = { ALLEEG.icaweights }; + if all(cellfun(@isempty, allcompsSTUDY)) && ~all(cellfun(@isempty, allcompsALLEEG)) + for index = 1:length(STUDY.datasetinfo) + STUDY.datasetinfo(index).comps = [1:size(ALLEEG(index).icaweights,1)]; + end; + end; + + % make channel groups + % ------------------- + if ~isfield(STUDY, 'changrp') || isempty(STUDY.changrp) + STUDY = std_changroup(STUDY, ALLEEG); + modif = 1; + end; +end; + + +% determine if there has been any change +% -------------------------------------- +if modif; + STUDY.saved = 'no'; + command = '[STUDY ALLEEG] = std_checkset(STUDY, ALLEEG);'; + addToHistory = true; + % check duplicate + if length(STUDY.history) >= length(command) && strcmpi(STUDY.history(end-length(command)+1:end), command) + addToHistory = false; + end; + if addToHistory + STUDY.history = sprintf('%s\n%s', STUDY.history, command); + end; +end; + +% convert combined independent variables +% -------------------------------------- +function val = convertindvarval(val); +if isstr(val) + inddash = findstr(' - ', val); + if isempty(inddash), return; end; + inddash = [ -2 inddash length(val)+1]; + for ind = 1:length(inddash)-1 + newval{ind} = val(inddash(ind)+3:inddash(ind+1)-1); + end; + val = newval; +end; + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_clustmaxelec.m b/code/eeglab13_4_4b/functions/studyfunc/std_clustmaxelec.m new file mode 100644 index 0000000..bd026bc --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_clustmaxelec.m @@ -0,0 +1,63 @@ +% std_clustmaxelec() - function to find the electrode with maximum absolute projection +% for each component of a cluster +% Usage: +% >> [STUDY, ALLEEG] = std_clustmaxelec(STUDY, ALLEEG, clustind); +% +% Inputs: +% STUDY - STUDY set structure containing (loaded) EEG dataset structures +% ALLEEG - ALLEEG vector of EEG structures, else a single EEG dataset. +% clustind - (single) cluster index +% +% Outputs: +% eleclist - [cell] electrode list +% setlist - [integer] set indices for the cluster +% complist - [integer] component indices for the cluster +% +% Authors: Claire Braboszcz & Arnaud Delorme , CERCO, UPS/CRNS, 2011 + +% Copyright (C) Claire Braboszcz, CERCO, UPS/CRNS, 2011 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function std_clustmaxelec(STUDY, ALLEEG, clusterind); + +if nargin < 1 + help findicmaxelec; + return; +end; + +fprintf('Finding electrodes with max weight for cluster %d\n', clusterind); +fprintf('-------------------------------------------------\n'); + +for index = 1:length(STUDY.cluster(clusterind).comps) + set = STUDY.cluster(clusterind).sets(1,index); + comp = STUDY.cluster(clusterind).comps( index); + + [tmp maxelec] = max( abs(ALLEEG(set).icawinv(:, comp)) ); + indelec = ALLEEG(set).icachansind(maxelec); + maxallelec{index} = ALLEEG(set).chanlocs(indelec).labels; + allelec = unique_bc(maxallelec); + + fprintf('The electrode with the max weight for component %d of dataset %d is "%s"\n', comp, set, maxallelec{index}); +end; + + +for indelec=1:length(allelec) + nbelec{indelec} = length(find(strcmp(allelec{indelec}, maxallelec) == 1)); + + fprintf('Number of occurrence of electrode %s: %d\n', allelec{indelec}, nbelec{indelec}); +end; + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_clustread.m b/code/eeglab13_4_4b/functions/studyfunc/std_clustread.m new file mode 100644 index 0000000..eeed60b --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_clustread.m @@ -0,0 +1,238 @@ +% std_clustread() - this function has been replaced by std_readdata() for +% consistency. Please use std_readdata() instead. +% load one or more requested measures +% ['erp'|'spec'|'ersp'|'itc'|'dipole'|'map'] +% for all components of a specified cluster. +% Calls std_readerp(), std_readersp(), etc. +% Usage: +% >> clustinfo = std_clustread(STUDY,ALLEEG, cluster, infotype, condition); +% Inputs: +% STUDY - studyset structure containing some or all files in ALLEEG +% ALLEEG - vector of loaded EEG datasets +% cluster - cluster number in STUDY +% infotype - ['erp'|'spec'|'ersp'|'itc'|'dipole'|'map'] type of stored +% cluster information to read. May also be a cell array of +% these types, for example: { 'erp' 'map' 'dipole' } +% condition - STUDY condition number to read {default: all} +% +% Output: +% clustinfo - structure of specified cluster information: +% clustinfo.name % cluster name +% clustinfo.clusternum % cluster index +% clustinfo.condition % index of the condition asked for +% +% clustinfo.comp[] % array of component indices +% clustinfo.subject{} % cell array of component subject codes +% clustinfo.group{} % cell array of component group codes +% +% clustinfo.erp[] % (ncomps, ntimes) array of component ERPs +% clustinfo.erp_times[] % vector of ERP epoch latencies +% +% clustinfo.spec[] % (ncomps, nfreqs) array of component spectra +% clustinfo.spec_freqs[]% vector of spectral frequencies +% +% clustinfo.ersp[] % (ncomps,ntimes,nfreqs) array of component ERSPs +% clustinfo.ersp_times[]% vector of ERSP latencies +% clustinfo.ersp_freqs[]% vector of ERSP frequencies +% +% clustinfo.itc[] % (ncomps,ntimes,nfreqs) array of component ITCs +% clustinfo.itc_times[] % vector of ITC latencies +% clustinfo.itc_freqs[] % vector of ITC frequencies +% +% clustinfo.scalp[] % (ncomps,65,65) array of component scalp map grids +% clustinfo.xi[] % abscissa values for columns of the scalp maps +% clustinfo.yi[] % ordinate values for rows of the scalp maps +% +% clustinfo.dipole % array of component dipole information structs +% % with same format as EEG.dipfit.model +% Example: +% % To plot the ERPs for all components in cluster 3 of a loaded STUDY +% >> clustinfo = std_clustread(STUDY, ALLEEG, 3, 'erp'); +% figure; plot(clustinfo.erp_times, clustinfo.erp); +% +% See also: std_readerp(), std_readspec(), std_readersp(), std_readitc(), std_readtopo() +% +% Authors: Hilit Serby, Scott Makeig & Arnaud Delorme, SCCN/INC/UCSD, 2005- +% +% RCS-recorded version number, date, editor and comments +function clustinfo = std_clustread(STUDY,ALLEEG, cluster, infotype, condition); + + help std_clustread; + return; + +if nargin < 4 + help std_clustread; + return; +end +if nargin < 5 + condition = [1:length(STUDY.condition)]; % default +end + +if ~iscell(infotype), + infotype = { infotype }; +end; + +clustinfo = []; +clustinfo.name = STUDY.cluster(cluster).name; +clustinfo.clusternum = cluster; +clustinfo.comps = STUDY.cluster(cluster).comps; +clustinfo.condition = condition; + +ncomps = length(STUDY.cluster(cluster).comps); +for k = 1:ncomps %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for each channel | component %%%%%%%%%%%%%% + + for n = 1:length(condition) %%%%%%%%%%%%%%%%%%%%%%%% for each STUDY condition %%%%%%%%%%%%%% + + abset = [STUDY.datasetinfo(STUDY.cluster(cluster).sets(condition(n),k)).index]; + comp = STUDY.cluster(cluster).comps(k); + clustinfo.subject{k} = STUDY.datasetinfo(STUDY.cluster(cluster).sets(condition(n),k)).subject; + clustinfo.group{k} = STUDY.datasetinfo(STUDY.cluster(cluster).sets(condition(n),k)).group; + + for index = 1:length(infotype) %%%%%%%%%%%%%% for each information type %%%%%%%%%%%%%%%% + switch infotype{index} + case 'erp' + [erp, t] = std_readerp(ALLEEG, abset, comp, STUDY.preclust.erpclusttimes); + clustinfo.erp_times = t; + clustinfo.erp{n,k} = erp; + + case 'spec' + [spec, f] = std_readspec(ALLEEG, abset, comp, STUDY.preclust.specclustfreqs); + clustinfo.spec_freqs = f; + clustinfo.spec{n,k} = spec; + + case 'ersp' + if n == 1 + abset = [STUDY.datasetinfo(STUDY.cluster(cluster).sets(condition,k)).index]; + [ersp, logfreqs, timevals] = std_readersp(ALLEEG, abset, comp, ... + STUDY.preclust.erspclusttimes, STUDY.preclust.erspclustfreqs); + for cc = 1:length(condition) + clustinfo.ersp{condition(cc), k} = ersp(:,:,cc); + end; + clustinfo.ersp_freqs = logfreqs; + clustinfo.ersp_times = timevals; + end; + case 'itc' + [itc, logfreqs, timevals] = std_readitc(ALLEEG, abset, comp, ... + STUDY.preclust.erspclusttimes, STUDY.preclust.erspclustfreqs ); + clustinfo.itc_freqs = logfreqs; + clustinfo.itc_times = timevals; + clustinfo.itc{n,k} = itc; + + case 'dipole' + if n == 1, clustinfo.dipole(k) = ALLEEG(abset).dipfit.model(comp); end; + + case { 'map' 'scalp' 'topo' } + if n == 1 + [grid, yi, xi] = std_readtopo(ALLEEG, abset, comp); + if k == 1 + clustinfo.xi = xi; + clustinfo.yi = yi; + end + clustinfo.scalp{k} = grid; + end; + otherwise, error('Unrecognized ''infotype'' entry'); + end; % switch + end; + end; % infotype +end % comp + +% FUTURE HEADER +% std_clustread() - return detailed information and (any) requested component +% measures for all components of a specified cluster. Restrict +% component info to components from specified subjects, groups, +% sessions, and/or conditions. Use in scripts handling results +% of component clustering. Called by cluster plotting +% functions: std_envtopo(), std_erpplot(), std_erspplot(), ... +% Usage: +% >> clsinfo = std_clustread(STUDY, ALLEEG, cluster); % use defaults +% >> clsinfo = std_clustread(STUDY, ALLEEG, cluster, ... +% 'keyword1', keyval1, ... +% 'keyword2', keyval2, ...); +% Inputs: +% STUDY - studyset structure containing some or all files in ALLEEG +% ALLEEG - vector of loaded EEG datasets including those in STUDY +% cluster - cluster number in STUDY to return information for +% +% Optional keywords - and values: IMPLEMENT !! +% 'measure' - ['erp'|'spec'|'ersp'|'itc'|'dipole'|'topo'] stored +% cluster measure(s) to read. May also be a cell array of +% these, for example: { 'erp' 'map' 'dipole' }. +% Else 'all', meaning all measures available. +% Else 'cls', meaning all measures clustered on. +% Else [], for none {default: 'cls'} +% 'condition' - STUDY condition 'name' or {'names'} to read, +% Else 'all' {default: 'all'} +% 'condnum'' - STUDY condition [number(s)] to read, +% Else 0 -> all {default: 0} +% 'subject' - STUDY subjects 'name' or {'names'} to read, +% Else 'all' {default: 'all'} +% 'subjnum' - STUDY subjects [number(s)] to read, +% Else 0 -> all {default: 0} +% 'group' - STUDY subject group 'name' or {'names'} to read, +% Else 'all' {default: 'all'} +% 'groupnum' - STUDY subject group [number(s)] to read, +% Else 0 -> all {default: 0} +% 'session' - STUDY session [number(s)] to read, +% Else 0 -> all {default: 0} +% +% Output: +% clsinfo - structure containing information about cluster components in fields: +% +% .clustername % cluster name +% .clusternum % cluster index +% +% .dataset % {(conditions,components) cell array} component dataset indices +% in the input ALLEEG array +% .component % [(1,components) int array] component decomposition indices +% .subject % {(1,components) cell array} component subject codes +% .subjectnum % [(1,components) int array] component subject indices +% .group % {(1,components) cell array} component group codes +% .groupnum % [(1,components) int array] component group indices +% +% .condition % {(1,components) cell array} component condition codes +% .conditionnum % [(1,components) int array] component condition indices +% .session % [(1,components) int array] component session indices +% +% .erp % {(conditions, components) cell array} +% (1, latencies) component ERPs CHECK DIM +% .erp_times % [num vector] ERP epoch latencies (s) +% +% .spec % {(conditions, components) cell array} +% (1,frequencies) component spectra CHECK DIM +% .spec_freqs % [num vector] spectral frequencies (Hz) +% +% .ersp % {(conditions, components) cell array} +% (freqs,latencies) component ERSPs CHECK DIM +% .ersp_times % [num vector] ERSP epoch latencies (s) +% .ersp_freqs % [num vector] ERSP frequencies (Hz) +% +% .itc % {(conditions, components) cell array} +% (freqs,latencies) component ITCs CHECK DIM +% .itc_times % [num vector] ITC epoch latencies (s) +% .itc_freqs % [num vector] ITC frequencies (Hz) +% +% .topo % {(1,components) cell array} +% (65,65) component topo map grids CHECK DIM +% .xi % [vector] topo grid abscissa values +% .yi % [vector] topo grid ordinate values +% +% .dipole % [struct array] component dipole information +% % structures with same format as "EEG.dipfit.model" +% % See >> help dipfit CHECK HELP +% Example: +% % To plot the ERPs for all Cluster-3 components in a one-condition STUDY +% % +% clsinfo3 = std_clustread(STUDY, ALLEEG, 3, 'measure', 'erp'); % assume 1 condition +% times = clsinfo3.erp_times; figure; plot(times, clsinfo3.erp'); +% % +% % To plot ERPs for only those Cluster-3 components from subjects in group 'female' +% % +% feminfo3 = std_clustread(STUDY, ALLEEG, 3, 'measure', 'erp', 'group', 'female'); +% figure; plot(times, feminfo3.erp'); +% % +% % Alternatively, to extract 'female' subject components from clsinfo3 above +% % +% femidx = find(strcmp({clsinfo3.group},'female')); +% figure; plot(times, clustinfo.erp(femidx,:)'); CHECK EXAMPLE +% +% Authors: Hilit Serby, Scott Makeig, Toby Fernsler & Arnaud Delorme, SCCN/INC/UCSD, 2005- diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_comppol.m b/code/eeglab13_4_4b/functions/studyfunc/std_comppol.m new file mode 100644 index 0000000..d12a119 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_comppol.m @@ -0,0 +1,67 @@ +% std_comppol() - inverse component polarity in a component cluster +% +% Usage: [compout pol] = std_comppol(compin); +% +% Inputs: +% compin - component scalp maps, one per column. +% +% Outputs: +% compout - component scalp maps some of them with inverted +% polarities, one per column. +% pol - logical vector of component with inverted +% polarities (same length as the number of rows in +% compin) +% +% Author: Arnaud Delorme & Hilit Serby, SCCN, INC, UCSD, 2004 + +% Copyright (C) 2004 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [compin, pol] = std_comppol(compin); + +if nargin < 1 + help std_comppol; + return; +end; + +% remove the NaN +% -------------- +for index = 1:size(compin,2) + compin(isnan(compin(:,index)),:) =[]; +end; + +% run several iterations +% ---------------------- +pol = ones(1,size(compin,2)); +for repeat=1:3 + compave = mean(compin,2); + for index = 1:size(compin,2) + + % remove diagonal and put 0 and 1 + % ------------------------------- + if ~all(compin(:,index) == 0) + r = corrcoef(compave, compin(:,index) ); + else r = zeros(2,2); + end; + + % invert component polarities + % --------------------------- + if r(2) < 0 + compin(:,index) = -compin(:,index); + pol(index) = -pol(index); + end; + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_convertdesign.m b/code/eeglab13_4_4b/functions/studyfunc/std_convertdesign.m new file mode 100644 index 0000000..138c643 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_convertdesign.m @@ -0,0 +1,28 @@ +% std_convertdesign - temporary function converting STUDY design legacy +% format to new format. + +function STUDY = std_convertdesign(STUDY,ALLEEG); + +for index = 1:length(STUDY.design) + design(index).name = STUDY.design(index).name; + design(index).variable(1).label = STUDY.design(index).indvar1; + design(index).variable(2).label = STUDY.design(index).indvar2; + design(index).variable(1).value = STUDY.design(index).condition; + design(index).variable(2).value = STUDY.design(index).group; + design(index).variable(1).pairing = STUDY.design(index).statvar1; + design(index).variable(2).pairing = STUDY.design(index).statvar2; + design(index).cases.label = 'subject'; + design(index).cases.value = STUDY.design(index).subject; + design(index).include = STUDY.design(index).includevarlist; + setinfo = STUDY.design(index).setinfo; + for c = 1:length(setinfo) + design(index).cell(c).dataset = setinfo(c).setindex; + design(index).cell(c).trials = setinfo(c).trialindices; + design(index).cell(c).value = { setinfo(c).condition setinfo(c).group }; + design(index).cell(c).case = setinfo(c).subject; + design(index).cell(c).filebase = setinfo(c).filebase; + end; +end; + +STUDY.design = design; +STUDY = std_selectdesign(STUDY, ALLEEG, STUDY.currentdesign); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_createclust.m b/code/eeglab13_4_4b/functions/studyfunc/std_createclust.m new file mode 100644 index 0000000..c07e84c --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_createclust.m @@ -0,0 +1,265 @@ +% std_createclust() - dreate a new empty cluster. After creation, components +% may be (re)assigned to it using std_movecomp(). +% Usage: +% >> [STUDY] = std_createclust(STUDY, ALLEEG, 'key', val); +% Inputs: +% STUDY - STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - vector of EEG datasets included in the STUDY, typically created +% using load_ALLEEG(). +% +% Optional inputs: +% 'name' - ['string'] name of the new cluster {default: 'Cls #', where +% '#' is the next available cluster number} +% 'clusterind' - [integer] cluster for each of the component. Ex: 61 components +% and 2 clusters: 'clusterind' will be a 61x1 vector of 1 and +% 2 (and 0=outlisers) +% 'centroid' - centroid for clusters. If 2 clusters, size will be 2 x +% width of the preclustering matrix. This is a deprecated +% functionality. +% 'algorithm' - [cell] algorithm parameters used to obtain the clusters +% 'parentcluster' - ['on'|'off'] use the parent cluster (cluster 1) to +% perform clustering (this cluster contains all the selected +% components by default). Otherwise, the cluster defined in +% STUDY.etc.preclust.clustlevel is used as parent. +% +% Outputs: +% STUDY - the input STUDY set structure modified with the new cluster. +% +% Example: +% >> [STUDY] = std_createclust(STUDY, ALLEEG, 'name', 'eye_movements', ... +% 'clusterind', [0 1 0 1 0 1], 'parentcluster', 'on'); +% % Create a new cluster named 'eye_movements' with components 2, 4, and +% % of 6 the default parent cluster defined in +% +% See also pop_clustedit(), std_movecomp() +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 07, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY] = std_createclust(STUDY, ALLEEG, varargin) + +if nargin< 2 + help std_createclust; + return; +end; + +% decoding options for backward compatibility +% ------------------------------------------- +options = {}; +if length(varargin) > 0 && ~isstr(varargin{1}) + % STUDY, IDX, algorithm, parentClusterNumber + if isnumeric(ALLEEG) + options = { options{:} 'clusterind' ALLEEG }; + if nargin > 3, options = { options{:} 'centroid' varargin{1} }; end; + if nargin > 4, options = { options{:} 'algorithm' varargin{2} }; end; + ALLEEG = []; + end; +elseif length(varargin) < 2 + options = { options{:} 'name' varargin{1} }; +else + options = varargin; +end; +opt = finputcheck(options, { 'name' 'string' [] 'Cls'; + 'clusterind' 'integer' [] length(STUDY.cluster)+1; + 'parentcluster' 'string' { 'on','off' } 'off'; + 'algorithm' 'cell' [] {}; + 'ignore0' 'string' { 'on','off' } 'off'; + 'centroid' 'real' [] [] }, 'std_createclust'); +if isstr(opt), error(opt); end; + +% opt.clusterind - index of cluster for each component. Ex: 63 components and 2 +% clusters: opt.clusterind will be a 61x1 vector of 1 and 2 (and 0=outlisers) +% C - centroid for clusters. If 2 clusters, size will be 2 x +% width of the preclustering matrix + +if strcmpi(opt.parentcluster, 'on') + firstind = 1; + cls = 1; + sameica = std_findsameica(ALLEEG); + sets = []; + comps = []; + STUDY.cluster = []; + for index = 1:length(sameica) + newcomps = STUDY.datasetinfo(sameica{index}(1)).comps; + if isempty(newcomps), newcomps = [1:size(ALLEEG(sameica{index}(1)).icaweights,1)]; end; + comps = [ comps newcomps ]; + sets(length(sameica{index}):-1:1,end+1:end+length(newcomps)) = repmat( sameica{index}', [1 length(newcomps) ] ); + end; + sets(find(sets == 0)) = NaN; + STUDY.cluster(1).name = 'Parentcluster 1'; + STUDY.cluster(1).sets = sets; + STUDY.cluster(1).comps = comps; + STUDY.cluster(1).parent = {}; + STUDY.cluster(1).child = {}; + STUDY.cluster.preclust.preclustparams = []; + STUDY.cluster.preclust.preclustdata = []; + if isfield(STUDY, 'design') && ~isempty(STUDY.design) + STUDY.cluster = std_setcomps2cell(STUDY, 1); + end; +else + % Find the next available cluster index + % ------------------------------------- + cls = min(max(opt.clusterind), length(unique(opt.clusterind))); + nc = 0; % index of last cluster + for k = 1:length(STUDY.cluster) + ti = strfind(STUDY.cluster(k).name, ' '); + tmp = STUDY.cluster(k).name(ti(end) + 1:end); + nc = max(nc,str2num(tmp)); + % check if there is a cluster of Notclust components + if isfield(STUDY.etc, 'preclust') && isfield(STUDY.etc.preclust, 'preclustparams') + if ~isempty(STUDY.cluster(k).parent) + %strcmp(STUDY.cluster(k).parent,STUDY.cluster(STUDY.etc.preclust.clustlevel).name) + STUDY.cluster(k).preclust.preclustparams = STUDY.etc.preclust.preclustparams; + end; + end + end + len = length(STUDY.cluster); + + if ~isempty(find(opt.clusterind==0)) && strcmpi(opt.ignore0, 'off') %outliers exist + firstind = 0; + nc = nc + 1; + len = len + 1; + else + firstind = 1; + end + + % create clustlevel if it does not exist + % -------------------------------------- + if ~isfield(STUDY.etc, 'preclust') + STUDY.etc.preclust.clustlevel = 1; + STUDY.etc.preclust.preclustdata = []; + elseif ~isfield(STUDY.etc.preclust, 'clustlevel') + STUDY.etc.preclust.clustlevel = 1; + STUDY.etc.preclust.preclustdata = []; + end; + + % create all clusters + % ------------------- + for k = firstind:cls + + % cluster name + % ------------ + if k == 0 + STUDY.cluster(len).name = [ 'outlier ' num2str(k+nc)]; + else STUDY.cluster(k+len).name = [ opt.name ' ' num2str(k+nc)]; + end + + % find indices + % ------------ + tmp = find(opt.clusterind==k); % opt.clust.erind contains the cluster index for each component + STUDY.cluster(k+len).sets = STUDY.cluster(STUDY.etc.preclust.clustlevel).sets(:,tmp); + STUDY.cluster(k+len).comps = STUDY.cluster(STUDY.etc.preclust.clustlevel).comps(tmp); + STUDY.cluster(k+len).algorithm = opt.algorithm; + STUDY.cluster(k+len).parent{end+1} = STUDY.cluster(STUDY.etc.preclust.clustlevel).name; + STUDY.cluster(k+len).child = []; + if ~isempty(STUDY.etc.preclust.preclustdata) && all(tmp <= size(STUDY.etc.preclust.preclustdata,1)) + STUDY.cluster(k+len).preclust.preclustdata = STUDY.etc.preclust.preclustdata(tmp,:); + STUDY.cluster(k+len).preclust.preclustparams = STUDY.etc.preclust.preclustparams; + else STUDY.cluster(k+len).preclust.preclustdata = []; + end; + STUDY.cluster(k+len) = std_setcomps2cell(STUDY, k+len); + + %update parents clusters with cluster child indices + % ------------------------------------------------- + STUDY.cluster(STUDY.etc.preclust.clustlevel).child{end+1} = STUDY.cluster(k+nc).name; + end +end; + + +% Find out the highst cluster id number (in cluster name), to find +% next available cluster index + + +% % find max cluster ID +% +% max_id = 0; +% if ~isfield(STUDY, 'cluster'), STUDY.cluster = []; end; +% for k = 1:length(STUDY.cluster) +% ti = strfind(STUDY.cluster(k).name, ' '); +% clus_id = STUDY.cluster(k).name(ti(end) + 1:end); +% max_id = max(max_id, str2num(clus_id)); +% end +% max_id = max_id + 1; +% opt.name = sprintf('%s %d', opt.name, max_id); +% clustind = length(STUDY.cluster)+1; +% % Initialize the new cluster fields. +% if length(STUDY.cluster) > 0 +% STUDY.cluster(clustind).parent{1} = STUDY.cluster(1).name; +% if ~iscell(STUDY.cluster(1).child) +% STUDY.cluster(1).child = { opt.name }; +% else STUDY.cluster(1).child = { STUDY.cluster(1).child{:} opt.name }; +% end; +% else +% STUDY.cluster(clustind).parent{1} = 'manual'; % update parent cluster if exists. +% end; +% STUDY.cluster(clustind).name = opt.name; +% STUDY.cluster(clustind).child = []; +% STUDY.cluster(clustind).comps = []; +% STUDY.cluster(clustind).sets = []; +% STUDY.cluster(clustind).algorithm = []; +% STUDY.cluster(clustind).centroid = []; +% STUDY.cluster(clustind).preclust.preclustparams = []; +% STUDY.cluster(clustind).preclust.preclustdata = []; +% +% if (~isempty(opt.datasets) | ~isempty(opt.subjects)) & ~isempty(opt.components) +% +% % convert subjects to dataset indices +% % ----------------------------------- +% if ~isempty(opt.subjects) +% if length(opt.subjects) ~= length(opt.components) +% error('If subjects are specified, the length of the cell array must be the same as for the components'); +% end; +% alls = { ALLEEG.subject }; +% for index = 1:length(opt.subjects) +% tmpinds = strmatch(opt.subjects{index}, alls, 'exact'); +% if isempty(tmpinds) +% error('Cannot find subject'); +% end; +% opt.datasets(1:length(tmpinds),index) = tmpinds; +% end; +% opt.datasets(opt.datasets(:) == 0) = NaN; +% end; +% +% % deal with cell array inputs +% % --------------------------- +% if iscell(opt.components) +% newcomps = []; +% newdats = []; +% for ind1 = 1:length(opt.components) +% for ind2 = 1:length(opt.components{ind1}) +% if iscell(opt.datasets) +% newdats = [ newdats opt.datasets{ind1}' ]; +% else newdats = [ newdats opt.datasets(:,ind1) ]; +% end; +% newcomps = [ newcomps opt.components{ind1}(ind2) ]; +% end; +% end; +% opt.datasets = newdats; +% opt.components = newcomps; +% end; +% +% % create .sets, .comps, .setinds, .allinds fields +% % ----------------------------------------------- +% [tmp setinds allinds] = std_setcomps2cell( STUDY, opt.datasets, opt.components); +% STUDY.cluster(clustind).setinds = setinds; +% STUDY.cluster(clustind).allinds = allinds; +% STUDY.cluster(clustind) = std_cell2setcomps( STUDY, ALLEEG, clustind); +% STUDY.cluster(clustind) = std_setcomps2cell( STUDY, clustind); +% %[ STUDY.cluster(finalinds(ind)) setinds allinds ] = +% %std_setcomps2cell(STUDY, finalinds(ind)); +% end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_dipoleclusters.m b/code/eeglab13_4_4b/functions/studyfunc/std_dipoleclusters.m new file mode 100644 index 0000000..516f507 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_dipoleclusters.m @@ -0,0 +1,257 @@ +% std_dipoleclusters - Plots clusters of ICs as colored dipoles in MRI +% images (side, rear, top and oblique angles possible) +% +% std_dipoleclusters(STUDY,ALLEEG,'key1',value1, 'key2',value2, ... ); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% +% Optional inputs: +% 'clusters' - [vector of numbers] list of clusters to plot in same head space +% 'title' - [string] figure title +% 'viewnum' - [vector] list of views to plot: 1=top, 2=side, 3=rear, 4 is an oblique view; +% length(viewnum) gives the number of subplots that will be produced and the +% values within the vector tell the orientation and order of views +% 'rowcolplace' - [rows cols subplot] If plotting into an existing figure, specify the number of rows, +% columns and the subplot number to start plotting dipole panels. +% 'colors' - [vector or matrix] if 1 x 3 vector of RGB values, this will plot all dipoles as the +% same color. ex. [1 0 0] is red, [0 0 1] is blue, [0 1 0] is green. +% If a matrix, should be n x 3, with the number of rows equal to the number +% of clusters to be plotted and the columns should be RGB values for each. +% If [], will plot clusters as 'jet' colorscale from the first to the last cluster +% requested (therefore an alternate way to control dipole color is to input a specific +% order of clusters). +% [] will assign colors from hsv color scale. +% 'centroid' - ['only', 'add', 'off'] 'only' will plot only cluster centroids, 'add' will superimpose +% centroids over cluster dipoles, 'off' will skip centroid plotting and only plot +% cluster-member dipoles. +% +% Authors: Julie Onton, SCCN/INC UCSD, June 2009 + +% Copyright (C) Julie Onton, SCCN/INC/UCSD, October 11, 2009 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function std_dipoleclusters(STUDY,ALLEEG, varargin); + +if nargin < 2 + help std_dipoleclusters; + return; +end; + +% Set default values------------------------------------------------------------------------ + if strcmp(STUDY.cluster(2),'outlier 2') % don't plot outlier cluster #2 + clustvec = [3:length(STUDY.cluster)]; % plot all clusters in STUDY + else + clustvec = [2:length(STUDY.cluster)]; % plot all clusters in STUDY + end; + onecolor = []; + colvec = []; + centroid = 'off'; + viewnum = [1:4]; % plot all views and oblique + rowcolplace = [2 2 1]; % 2 X 2 figure starting in subplot 1 + figureon = 1; % plot on a new figure + ttl = ''; % no title + %--------------------------------------------------------------------------------- + for k = 3:2:nargin + switch varargin{k-2} + case 'clusters' + clusters = varargin{k-1}; % redefine from all to specified clusters + case 'title' + ttl = varargin{k-1}; + case 'viewnum', + viewnum = varargin{k-1}; + case 'rowcolplace' %, mode = varargin{k-1}; % what is mode? JO + rowcolplace = varargin{k-1}; + if length(rowcolplace) < 3 + fprintf('\nThe variable ''rowcolplace'' must contain 3 values.\n'); + return; + end; + row = rowcolplace(1); + col = rowcolplace(2); + place = rowcolplace(3); + figureon = 0; % don't pop a new figure if plotting into existing fig + case 'colors' + colvec = varargin{k-1}; + case 'centroid' + centroid = varargin{k-1}; + end + end + % adjust color matrix for dipoles:--------------- + if isempty(colvec) + cols = jet(length(clusters));% default colors + else + cols = colvec; % input RGB colors + end; + + % extract IC cluster and data path info from STUDY structure + clear clustcps fullpaths gdcomps + x = cell(1,length(unique({STUDY.datasetinfo.subject}))); + subjs = unique_bc({STUDY.datasetinfo.subject}); + origlist = cell(1,length(unique({STUDY.datasetinfo.subject}))); + sets = cell(1,length(unique({STUDY.datasetinfo.subject}))); + for clust = 1:length(STUDY.cluster) + clustcps{clust} = x; + for st = 1:size(STUDY.cluster(clust).sets,2) + currset = STUDY.cluster(clust).sets(1,st); + currcomp = STUDY.cluster(clust).comps(1,st); + subjidx = strmatch(STUDY.datasetinfo(currset).subject,subjs); + clustcps{clust}{subjidx}(end+1) = currcomp; + origlist{subjidx} = [origlist{subjidx} currcomp]; + [origlist{subjidx} idx] = unique_bc(origlist{subjidx}); + sets{subjidx} = currset; + end; + end; + %----------------------------------------------------------- + % extract dipole info for ALL ICs to be plotted subj by subj + for nx = 1:length(origlist) + dipsources = []; + if ~isempty(origlist{nx}) + EEG = ALLEEG(sets{nx}); % call in a dataset from subj + if isfield(EEG.dipfit.model,'diffmap') + EEG.dipfit.model = rmfield(EEG.dipfit.model,'diffmap'); + end; + if isfield(EEG.dipfit.model,'active') + EEG.dipfit.model = rmfield(EEG.dipfit.model,'active'); + end; + if isfield(EEG.dipfit.model,'select') + EEG.dipfit.model = rmfield(EEG.dipfit.model,'select'); + end; + dipsources.posxyz = EEG.dipfit.model(origlist{nx}(1)).posxyz; + dipsources.momxyz = EEG.dipfit.model(origlist{nx}(1)).momxyz; + dipsources.rv = EEG.dipfit.model(origlist{nx}(1)).rv;p=1; + + for w = 1:length(origlist{nx}) + dipsources(1,p).posxyz = EEG.dipfit.model(origlist{nx}(w)).posxyz; + dipsources(1,p).momxyz = EEG.dipfit.model(origlist{nx}(w)).momxyz; + dipsources(1,p).rv = EEG.dipfit.model(origlist{nx}(w)).rv; + p=p+1; + end; + allbesa1{nx} = dipsources; new = 0; + end; + end; + + %----------------------------------------------------------- + % collect cluster dipole info from extracted dipole infos (above) + %%%%%%%%%%%%%%%%%%%%%%%%% + new = 1; pp=1; bic = 1; + centrstr = struct('posxyz',[0 0 0],'momxyz',[0 0 0],'rv',0); + for clst =1:length(clusters) + clust = clusters(clst); + centr = []; + centr2 = []; + for nx = 1:length(clustcps{clust}) + if ~isempty(clustcps{clust}{nx}) + for k = 1:length(clustcps{clust}{nx}) + if new == 1 + allbesa = allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))); + centr = [centr; allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(1,:)]; + if size(allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz,1) > 1& allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,1) ~= 0 % actual values, not zero + if allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,2) > 0 % on the wrong side, switch with centr1 + centr2 = [centr2;allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,:)]; + centr2(end,2) = centr2(end,2)*-1; centr1(end,2) = centr1(end,2)*-1; + else + centr2 = [centr2;allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,:)]; + end; + end; + new = 0; + else + allbesa(1,end+1) = allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))); + centr = [centr; allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(1,:)]; + if size(allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz,1) > 1 & allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,1) ~= 0 % actual values, not zero + if allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,2) > 0 % on the wrong side, switch with centr1 + centr2 = [centr2; allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,:)]; + centr2(end,2) = centr2(end,2)*-1; centr1(end,2) = centr1(end,2)*-1; + else + centr2 = [centr2;allbesa1{nx}(find(origlist{nx} == clustcps{clust}{nx}(k))).posxyz(2,:)]; + end; + end; + end; + colset{pp} = cols(clst,:); pp = pp+1; + end; + end; + end; + if length(allbesa) > 1 + centr = mean(centr,1); + centr2 = mean(centr2,1); + centrstr(clst).posxyz = centr; + centrstr(clst).momxyz = allbesa(end).momxyz(1,:); + centrstr(clst).rv = 2; + centcols{clst} = cols(clst,:); + centcols2{clst} = cols(clst,:)/5; + if ~isempty(find(centr2)) + centrstr2(bic).posxyz = centr2; + centrstr2(bic).momxyz = allbesa(end).momxyz(1,:); + centrstr2(bic).rv = 2; + bic = bic + 1; % separate count for bilaterals + end; + end; + end; + if figureon == 1 + figure; row = 2; col = 2; place= 1; + end; + %------------------------------------------- + % PLOT the clusster dipoles: + + + if length(allbesa) > 1 + for sbpt = 1:length(viewnum) + if sbpt < 4 + prjimg = 'off'; + else + prjimg = 'on'; + end; + sbplot(row,col,place) + if strcmp(centroid,'only') + dipplot(centrstr,'image','mri','gui','off','dipolelength',0,'dipolesize',40,'normlen','on','spheres','on','color',centcols,'projlines','off','projimg',prjimg,'coordformat',EEG.dipfit.coordformat);hold on; view(90,0); + if ~isempty(find(centrstr2(1).posxyz)) % only if there were bilaterals + dipplot(centrstr2,'image','mri','gui','off','dipolelength',0,'dipolesize',40,'normlen','on','spheres','on','color',centcols,'projlines','off','projimg',prjimg,'coordformat',EEG.dipfit.coordformat);hold on; view(90,0); camzoom(.8) + else + camzoom(1) + end; + elseif strcmp(centroid,'add') + dipplot(allbesa,'image','mri','gui','off','dipolelength',0,'dipolesize',25,'normlen','on','spheres','on','color',colset,'projlines','off','projimg',prjimg,'coordformat',EEG.dipfit.coordformat);hold on; view(90,0); + dipplot(centrstr,'image','mri','gui','off','dipolelength',0,'dipolesize',40,'normlen','on','spheres','on','color',centcols2,'projlines','off','projimg',prjimg,'coordformat',EEG.dipfit.coordformat);hold on; view(90,0); camzoom(.8) + if ~isempty(find(centrstr2(1).posxyz)) % only if there were bilaterals + dipplot(centrstr2,'image','mri','gui','off','dipolelength',0,'dipolesize',40,'normlen','on','spheres','on','color',centcols2,'projlines','off','projimg',prjimg,'coordformat',EEG.dipfit.coordformat);hold on; view(90,0);camzoom(.8) + else + camzoom(1) + end; + else + dipplot(allbesa,'image','mri','gui','off','dipolelength',0,'dipolesize',25,'normlen','on','spheres','on','color',colset,'projlines','off','projimg',prjimg,'coordformat',EEG.dipfit.coordformat);hold on; view(90,0); camzoom(1.1) + end; + if viewnum(sbpt) == 3 + view(0,0) + elseif viewnum(sbpt) == 1 + view(0,90) + elseif viewnum(sbpt) == 4 + view(63,22); + end; + place = place+1; + end; + if ~isempty(ttl) + if sbpt == 4 % if oblique + ph = text(-75,-75,125,ttl); set(ph,'color','r'); + elseif sbpt == 1 % 2d image: + ph = text(-50,110,125,ttl); set(ph,'color','r'); + elseif sbpt == 2 % 2d image: + ph = text(-75,-75,125,ttl); set(ph,'color','r'); + elseif sbpt == 3 % 2d image: + ph = text(-100,-50,130,ttl); set(ph,'color','r'); + end; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_dipplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_dipplot.m new file mode 100644 index 0000000..1018191 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_dipplot.m @@ -0,0 +1,582 @@ +% std_dipplot() - Commandline function to plot cluster component dipoles. Dipoles for each +% named cluster is displayed in a separate figure. To view all the clustered +% components in the STUDY on the same figure (in a separate subplot), all +% STUDY clusters must be requested. +% To visualize dipoles, they first must be stored in the EEG dataset structures +% using dipfit(). Only components that have dipole locations will be displayed, +% along with the cluster mean dipole (in red). +% Usage: +% >> [STUDY] = std_dipplot(STUDY, ALLEEG, clusters); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in +% the STUDY. ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% +% Optional inputs: +% 'clusters' - [numeric vector | 'all'] -> specific cluster numbers to plot. +% 'all' -> plot all clusters in STUDY. +% {default: 'all'}. +% 'comps' - [numeric vector] -> indices of the cluster components to plot. +% 'all' -> plot all the components in the cluster +% {default: 'all'}. +% 'mode' - ['together'|'apart'] Display all requested cluster on one +% figure ('together') or separate figures ('apart'). +% 'together'-> plot all 'clusters' in one figure (without the gui). +% 'apart' -> plot each cluster in a separate figure. Note that +% this parameter has no effect if the 'comps' option (above) is used. +% {default: 'together'} +% 'figure' - ['on'|'off'] plots on a new figure ('on') or plots on current +% figure ('off'). If 'figure','off' does not display gui controls, +% Useful for incomporating a cluster dipplot into a complex figure. +% {default: 'on'}. +% 'groups' - ['on'|'off'] use different colors for different groups. +% {default: 'off'}. +% Outputs: +% STUDY - the input STUDY set structure modified with plotted cluster +% mean dipole, to allow quick replotting (unless cluster means +% already exists in the STUDY). +% Example: +% >> [STUDY] = std_dipplot(STUDY,ALLEEG, 'clusters', 5, 'mode', 'apart', 'figure', 'off'); +% % Plot cluster-5 component dipoles (in blue), plus ther mean dipole (in red), +% % on an exisiting (gui-less) figure. +% +% See also pop_clustedit(), dipplot() +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 +% 'groups' added by Makoto Miyakoshi on June 2012. + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 08, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_dipplot(STUDY, ALLEEG, varargin) + +% Set default values +cls = []; % plot all clusters in STUDY +figureon = 1; % plot on a new figure +mode = 'apart'; + +STUDY = pop_dipparams(STUDY, 'default'); +opt_dipplot = {'projlines',STUDY.etc.dipparams.projlines, 'axistight', STUDY.etc.dipparams.axistight, 'projimg', STUDY.etc.dipparams.projimg, 'normlen', 'on', 'pointout', 'on', 'verbose', 'off', 'dipolelength', 0,'spheres','on'}; + +%, 'spheres', 'on' +groupval = 'off'; +for k = 3:2:nargin + switch varargin{k-2} + case 'clusters' + if isnumeric(varargin{k-1}) + cls = varargin{k-1}; + if isempty(cls) + cls = 2:length(STUDY.cluster); + end + else + if isstr(varargin{k-1}) & strcmpi(varargin{k-1}, 'all') + cls = 2:length(STUDY.cluster); + else + error('std_dipplot: ''clusters'' input takes either specific clusters (numeric vector) or keyword ''all''.'); + end + end + if length(cls) == 1, mode = 'apart'; else mode = 'together'; end; + case 'comps' + STUDY = std_plotcompdip(STUDY, ALLEEG, cls, varargin{k-1}, opt_dipplot{:}); + return; + case 'plotsubjects', % do nothing + case 'mode', mode = varargin{k-1}; + case 'groups', groupval = varargin{k-1}; + case 'figure' + if strcmpi(varargin{k-1},'off') + opt_dipplot{end + 1} = 'gui'; + opt_dipplot{end + 1} = 'off'; + figureon = 0; + end + end +end +% select clusters to plot +% ----------------------- +if isempty(cls) + tmp =[]; + cls = 2:length(STUDY.cluster); % plot all clusters in STUDY + for k = 1: length(cls) + % don't include 'Notclust' clusters + if ~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8) & ~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13) + tmp = [tmp cls(k)]; + end + end + cls = tmp; +end; + +if strcmpi(mode, 'apart') % case each cluster on a separate figure + for clus = 1: length(cls) % For each cluster requested + if length(STUDY.cluster(cls(clus)).comps) > 0 % check there are comps in cluster + max_r = 0; + clear cluster_dip_models; + len = length(STUDY.cluster(cls(clus)).comps); + ndip = 0; + dip_ind = []; + if ~isfield(STUDY.cluster(cls(clus)),'dipole') + STUDY = std_centroid(STUDY,ALLEEG, cls(clus) , 'dipole'); + elseif isempty(STUDY.cluster(cls(clus)).dipole) + STUDY = std_centroid(STUDY,ALLEEG, cls(clus) , 'dipole'); + end + for k = 1:len + abset = STUDY.datasetinfo(STUDY.cluster(cls(clus)).sets(1,k)).index; + subject = STUDY.datasetinfo(STUDY.cluster(cls(clus)).sets(1,k)).subject; + if ~isfield(ALLEEG(abset), 'dipfit') + warndlg2(['No dipole information available in dataset ' ALLEEG(abset).filename ' , abort plotting'], 'Aborting plot dipoles'); + return; + end + comp = STUDY.cluster(cls(clus)).comps(k); + cluster_dip_models(k).posxyz = ALLEEG(abset).dipfit.model(comp).posxyz; + cluster_dip_models(k).momxyz = ALLEEG(abset).dipfit.model(comp).momxyz; + cluster_dip_models(k).rv = ALLEEG(abset).dipfit.model(comp).rv; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') + if isfield(ALLEEG(abset).dipfit, 'hdmfile') %dipfit 2 spherical model + load('-mat', ALLEEG(abset).dipfit.hdmfile); + max_r = max(max_r, max(vol.r)); + else % old version of dipfit + max_r = max(max_r,max(ALLEEG(abset).dipfit.vol.r)); + end + end + comp_to_disp{k} = [subject ', ' 'IC' num2str(comp) ]; + if ~isempty(cluster_dip_models(k).posxyz) + ndip = ndip +1; + dip_ind = [dip_ind k]; + end + end % finished going over cluster comps + + STUDY.cluster(cls(clus)).dipole = computecentroid(cluster_dip_models); + cluster_dip_models(end + 1) = STUDY.cluster(cls(clus)).dipole; + + % additional options + % ------------------ + dip_color = cell(1,ndip+1); + dip_color(1:ndip) = {'b'}; + dip_color(end) = {'r'}; + options = opt_dipplot; + options{end+1} = 'mri'; + options{end+1} = ALLEEG(abset).dipfit.mrifile; + options{end+1} = 'coordformat'; + options{end+1} = ALLEEG(abset).dipfit.coordformat; + options{end+1} = 'dipnames'; + options{end+1} = {comp_to_disp{dip_ind } [STUDY.cluster(cls(clus)).name ' mean']}; + options{end+1} = 'color'; + options{end+1} = dip_color; + + % if 'groups'==1, overwrite cluster_dip_models, dip_color and dipnames in option -makoto + if strcmpi(groupval, 'on') + [cluster_dip_models, options] = dipgroups(ALLEEG, STUDY, cls, comp_to_disp, cluster_dip_models, options); + break + end + + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') + options{end+1} = 'sphere'; + options{end+1} = max_r; + else + options{end+1} = 'meshdata'; + options{end+1} = ALLEEG(abset).dipfit.hdmfile; + end + if ndip < 6 && strcmpi(options{1}, 'projlines') && length(cls) == 1 % less than 6 dipoles, project lines + options{2} = 'on'; + end + + if figureon + dipplot(cluster_dip_models, options{:}); + fig_h = gcf; + set(fig_h,'Name', [STUDY.cluster(cls(clus)).name ' - ' num2str(length(unique(STUDY.cluster(cls(clus)).sets(1,:)))) ... + ' sets - ' num2str(length(STUDY.cluster(cls(clus)).comps)) ' components (' num2str(ndip) ' dipoles)' ],'NumberTitle','off'); + else + dipplot(cluster_dip_models, options{:},'view', [0.5 -0.5 0.5]); + for gind = 1:length(options) % remove the 'gui' 'off' option + if isstr(options{gind}) + if strfind(options{gind}, 'gui') + break; + end + end + end + options(gind:gind+1) = []; + dipinfo.dipmod = cluster_dip_models; + dipinfo.op = options; + diptitle = [STUDY.cluster(cls(clus)).name ', ' num2str(length(unique(STUDY.cluster(cls(clus)).sets(1,:)))) ' sets -' ... + num2str(length(STUDY.cluster(cls(clus)).comps)) ' components (' num2str(ndip) ' dipoles)' ]; + dipinfo.title = diptitle; + set(gcf, 'UserData', dipinfo); + set(gca,'UserData', dipinfo); + rotate3d off; + axcopy(gca, ['dipinfo = get(gca, ''''UserData''''); dipplot(dipinfo.dipmod, dipinfo.op{:}); set(gcf, ''''Name'''', dipinfo.title,''''NumberTitle'''',''''off''''); ']); + end + end % finished the if condition that cluster isn't empty + end % finished going over requested clusters +end + +if strcmpi(mode, 'together') % case all clusters are plotted in the same figure (must be a new figure) + N = length(cls); + rowcols(2) = ceil(sqrt(N)); % Number of rows in the subplot figure. + rowcols(1) = ceil(N/rowcols(2)); + fig_h = figure; + orient tall + set(fig_h,'Color', 'black'); + set(fig_h,'Name', 'All clusters dipoles','NumberTitle','off'); + set(fig_h, 'resize','off'); + for l = 1:N + len = length(STUDY.cluster(cls(l)).comps); + max_r = 0; + clear cluster_dip_models; + if ~isfield(STUDY.cluster(cls(l)),'dipole') + STUDY = std_centroid(STUDY,ALLEEG, cls(l), 'dipole'); + elseif isempty(STUDY.cluster(cls(l)).dipole) + STUDY = std_centroid(STUDY,ALLEEG, cls(l), 'dipole'); + end + for k = 1: len + abset = STUDY.datasetinfo(STUDY.cluster(cls(l)).sets(1,k)).index; + if ~isfield(ALLEEG(abset), 'dipfit') + warndlg2(['No dipole information available in dataset ' num2str(abset) ' , abort plotting'], 'Aborting plot dipoles'); + return; + end + comp = STUDY.cluster(cls(l)).comps(k); + cluster_dip_models(k).posxyz = ALLEEG(abset).dipfit.model(comp).posxyz; + cluster_dip_models(k).momxyz = ALLEEG(abset).dipfit.model(comp).momxyz; + cluster_dip_models(k).rv = ALLEEG(abset).dipfit.model(comp).rv; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') + if isfield(ALLEEG(abset).dipfit, 'hdmfile') %dipfit 2 spherical model + load('-mat', ALLEEG(abset).dipfit.hdmfile); + max_r = max(max_r, max(vol.r)); + else % old version of dipfit + max_r = max(max_r,max(ALLEEG(abset).dipfit.vol.r)); + end + end + end % finished going over cluster comps + STUDY.cluster(cls(l)).dipole = computecentroid(cluster_dip_models); + cluster_dip_models(end + 1) = STUDY.cluster(cls(l)).dipole; + dip_color = cell(1,length(cluster_dip_models)); + dip_color(1:end-1) = {'b'}; + dip_color(end) = {'r'}; + options = opt_dipplot; + options{end + 1} = 'gui'; + options{end + 1} = 'off'; + options{end+1} = 'mri'; + options{end+1} = ALLEEG(abset).dipfit.mrifile; + options{end+1} = 'coordformat'; + options{end+1} = ALLEEG(abset).dipfit.coordformat; + options{end+1} = 'color'; + options{end+1} = dip_color; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') + options{end+1} = 'sphere'; + options{end+1} = max_r; + else + options{end+1} = 'meshdata'; + options{end+1} = ALLEEG(abset).dipfit.hdmfile; + end + subplot(rowcols(1),rowcols(2),l) , + dipplot(cluster_dip_models, options{:}); + title([ STUDY.cluster(cls(l)).name ' (' num2str(length(unique(STUDY.cluster(cls(l)).sets(1,:)))) ' Ss, ' num2str(length(STUDY.cluster(cls(l)).comps)),' ICs)'],'color','white'); + %diptitle = [STUDY.cluster(cls(l)).name ', ' num2str(length(unique(STUDY.cluster(cls(l)).sets(1,:)))) 'Ss']; + %title(diptitle, 'Color', 'white'); + % Complex axcopy + %if l == 1 + % for gind = 1:length(options) % remove the 'gui' 'off' option + % if isstr(options{gind}) + % if strfind(options{gind}, 'gui') + % break; + % end + % end + % end + % options(gind:gind+1) = []; + %end + %dipinfo.dipmod = cluster_dip_models; + %dipinfo.op = options; + %dipinfo.title = diptitle; + %set(gcf, 'UserData', dipinfo); + %set(gca,'UserData', dipinfo); + %axcopy(gcf, ['dipinfo = get(gca, ''''UserData''''); dipplot(dipinfo.dipmod, dipinfo.op{:}); set(gcf, ''''Name'''', dipinfo.title,''''NumberTitle'''',''''off'''');']); + end %finished going over all clusters + set(fig_h, 'resize','on'); +end % finished case of 'all' clusters +% std_plotcompdip() - Commandline function, to visualizing cluster components dipoles. +% Displays the dipoles of specified cluster components with the cluster mean +% dipole on separate figures. +% To visualize dipoles they first must be stored in the EEG dataset structures +% using dipfit(). Only components that have a dipole locations will be displayed, +% along with the cluster mean dipole in red. +% Usage: +% >> [STUDY] = std_plotcompdip(STUDY, ALLEEG, cluster, comps); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in the STUDY. +% ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% cluster - single cluster number. +% +% Optional inputs: +% comps - [numeric vector] -> indices of the cluster components to plot. +% 'all' -> plot all the components in the cluster {default: 'all'}. +% +% Outputs: +% STUDY - the input STUDY set structure modified with plotted cluster +% dipole mean, to allow quick replotting (unless cluster mean +% already existed in the STUDY). +% +% Example: +% >> cluster = 4; comps= 1; +% >> [STUDY] = std_plotcompdip(STUDY,ALLEEG, cluster, comps); +% Plots component 1 dipole in blue with the cluster 4 mean dipole in red. +% +% See also pop_clustedit, dipfit, std_dipplot +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 08, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_plotcompdip(STUDY, ALLEEG, cls, comp_ind, varargin) +if ~exist('cls') + error('std_plotcompdip: you must provide a cluster number as an input.'); +end +if isempty(cls) + error('std_plotcompdip: you must provide a cluster number as an input.'); +end +if nargin == 3 % no components indices were given + % Default plot all components of the cluster + [STUDY] = std_dipplot(STUDY, ALLEEG, 'clusters', cls); + return +end + +for ci = 1:length(comp_ind) + abset = STUDY.datasetinfo(STUDY.cluster(cls).sets(1,comp_ind(ci))).index; + comp = STUDY.cluster(cls).comps(comp_ind(ci)); + subject = STUDY.datasetinfo(STUDY.cluster(cls).sets(1,comp_ind(ci))).subject; + if ~isfield(ALLEEG(abset), 'dipfit') + warndlg2(['No dipole information available in dataset ' num2str(abset) ' , abort plotting'], 'Aborting plot dipoles'); + return; + end + if length(comp_ind) == 1 & isempty(ALLEEG(abset).dipfit.model(comp).posxyz) + warndlg2(strvcat('There is no dipole information available in', ... + [ 'dataset ' num2str(abset) ' for this component, abort plotting']), 'Aborting plot dipoles'); + return; + end; + if ~isfield(STUDY.cluster(cls),'dipole') + STUDY = std_centroid(STUDY,ALLEEG, cls , 'dipole'); + elseif isempty(STUDY.cluster(cls).dipole) + STUDY = std_centroid(STUDY,ALLEEG, cls , 'dipole'); + end + comp_to_disp = [subject ' / ' 'IC' num2str(comp) ]; + cluster_dip_models.posxyz = ALLEEG(abset).dipfit.model(comp).posxyz; + cluster_dip_models.momxyz = ALLEEG(abset).dipfit.model(comp).momxyz; + cluster_dip_models.rv = ALLEEG(abset).dipfit.model(comp).rv; + cluster_dip_models(2) = STUDY.cluster(cls).dipole; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') + if isfield(ALLEEG(abset).dipfit, 'hdmfile') %dipfit 2 spherical model + load('-mat', ALLEEG(abset).dipfit.hdmfile); + max_r = max(vol.r); + else + max_r = max(ALLEEG(abset).dipfit.vol.r); + end + dipplot(cluster_dip_models, 'sphere', max_r, 'mri', ALLEEG(abset).dipfit.mrifile,'coordformat', ALLEEG(abset).dipfit.coordformat , ... + 'normlen' ,'on', 'pointout' ,'on','color', {'b', 'r'}, 'dipnames', {comp_to_disp [ STUDY.cluster(cls).name ' mean' ] },... + 'spheres', 'on', 'verbose', 'off', varargin{:}); + else + dipplot(cluster_dip_models, 'meshdata', ALLEEG(abset).dipfit.hdmfile, 'mri', ALLEEG(abset).dipfit.mrifile,'coordformat', ALLEEG(abset).dipfit.coordformat , ... + 'normlen' ,'on', 'pointout' ,'on','color', {'b', 'r'}, 'dipnames', {comp_to_disp [STUDY.cluster(cls).name ' mean']}, ... + 'spheres', 'on', 'verbose', 'off', varargin{:}); + end + fig_h = gcf; + set(fig_h,'Name', [subject ' / ' 'IC' num2str(comp) ', ' STUDY.cluster(cls).name],'NumberTitle','off'); +end + +% ----------------------- +% load all dipoles and +% compute dipole centroid +% DEVELOPMENT: this function +% should be the only one to +% access dipole information +% ----------------------- +function STUDY = std_centroid(STUDY,ALLEEG, clsind, tmp); + + for clust = 1:length(clsind) + max_r = 0; + len = length(STUDY.cluster(clsind(clust)).comps); + tmppos = [ 0 0 0 ]; + tmpmom = [ 0 0 0 ]; + tmprv = 0; + ndip = 0; + for k = 1:len + fprintf('.'); + comp = STUDY.cluster(clsind(clust)).comps(k); + abset = STUDY.cluster(clsind(clust)).sets(1,k); + if ~isfield(ALLEEG(abset), 'dipfit') + warndlg2(['No dipole information available in dataset ' num2str(abset) ], 'Aborting compute centroid dipole'); + return; + end + if ~isempty(ALLEEG(abset).dipfit.model(comp).posxyz) + ndip = ndip +1; + posxyz = ALLEEG(abset).dipfit.model(comp).posxyz; + momxyz = ALLEEG(abset).dipfit.model(comp).momxyz; + if size(posxyz,1) == 2 + if all(posxyz(2,:) == [ 0 0 0 ]) + posxyz(2,:) = []; + momxyz(2,:) = []; + end; + end; + tmppos = tmppos + mean(posxyz,1); + tmpmom = tmpmom + mean(momxyz,1); + tmprv = tmprv + ALLEEG(abset).dipfit.model(comp).rv; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') + if isfield(ALLEEG(abset).dipfit, 'hdmfile') %dipfit 2 spherical model + load('-mat', ALLEEG(abset).dipfit.hdmfile); + max_r = max(max_r, max(vol.r)); + else % old version of dipfit + max_r = max(max_r,max(ALLEEG(abset).dipfit.vol.r)); + end + end + end + end + centroid{clust}.dipole.posxyz = tmppos/ndip; + centroid{clust}.dipole.momxyz = tmpmom/ndip; + centroid{clust}.dipole.rv = tmprv/ndip; + if strcmpi(ALLEEG(abset).dipfit.coordformat, 'spherical') & (~isfield(ALLEEG(abset).dipfit, 'hdmfile')) %old dipfit + centroid{clust}.dipole.maxr = max_r; + end + STUDY.cluster(clsind(clust)).dipole = centroid{clust}.dipole; + end + fprintf('\n'); + +% -------------------------------- +% new function to compute centroid +% was programmed to debug the function +% above but is now used in the code +% -------------------------------- +function dipole = computecentroid(alldipoles) + + max_r = 0; + len = length(alldipoles); + dipole.posxyz = [ 0 0 0 ]; + dipole.momxyz = [ 0 0 0 ]; + dipole.rv = 0; + ndip = 0; + count = 0; + warningon = 1; + for k = 1:len + if size(alldipoles(k).posxyz,1) == 2 + if all(alldipoles(k).posxyz(2,:) == [ 0 0 0 ]) + alldipoles(k).posxyz(2,:) = []; + alldipoles(k).momxyz(2,:) = []; + end; + end; + if ~isempty(alldipoles(k).posxyz) + dipole.posxyz = dipole.posxyz + mean(alldipoles(k).posxyz,1); + dipole.momxyz = dipole.momxyz + mean(alldipoles(k).momxyz,1); + dipole.rv = dipole.rv + alldipoles(k).rv; + count = count+1; + elseif warningon + disp('Some components do not have dipole information'); + warningon = 0; + end; + end + dipole.posxyz = dipole.posxyz/count; + dipole.momxyz = dipole.momxyz/count; + dipole.rv = dipole.rv/count; + if isfield(alldipoles, 'maxr') + dipole.maxr = alldipoles(1).max_r; + end; + +function [cluster_dip_models, options] = dipgroups(ALLEEG, STUDY, cls, comp_to_disp, cluster_dip_models, options); + + % first, extract the subject number + for n = 1:length(comp_to_disp) + subjectnum(n,1) = str2num(comp_to_disp{n}(1:3)); + end + + % second, extract group info + for n = 1:length(subjectnum) + subj_group{n,1} = ALLEEG(1,subjectnum(n)).group; + end + + % third, replace the group names with numbers + for n = 1:length(subj_group) + for m = 1:length(STUDY.group) + if strcmp(subj_group{n,1}, STUDY.group{1,m}) + subj_groupnum(n,1) = m; + break + end + end + end + + % fourth, compute centroid for each group + for n = 1:length(STUDY.group) + samegroupIC = find(subj_groupnum==n); + cluster_dip_models(1,length(subj_groupnum)+n) = computecentroid(cluster_dip_models(1, samegroupIC)); + end + + % fifth, use subj_groupnum as a type of dipole color + + %%%%%%%%%%%%%%%%%%%%% color list %%%%%%%%%%%%%%%%%%%%% + % This color list was developped for std_envtopo + % 16 colors names officially supported by W3C specification for HTML + colors{1,1} = [1 1 1]; % White + colors{2,1} = [1 1 0]; % Yellow + colors{3,1} = [1 0 1]; % Fuchsia + colors{4,1} = [1 0 0]; % Red + colors{5,1} = [0.75 0.75 0.75]; % Silver + colors{6,1} = [0.5 0.5 0.5]; % Gray + colors{7,1} = [0.5 0.5 0]; % Olive + colors{8,1} = [0.5 0 0.5]; % Purple + colors{9,1} = [0.5 0 0]; % Maroon + colors{10,1} = [0 1 1]; % Aqua + colors{11,1} = [0 1 0]; % Lime + colors{12,1} = [0 0.5 0.5]; % Teal + colors{13,1} = [0 0.5 0]; % Green + colors{14,1} = [0 0 1]; % Blue + colors{15,1} = [0 0 0.5]; % Navy + colors{16,1} = [0 0 0]; % Black + % Silver is twice brighter because silver is used for a background color + colors{5,1} = [0.875 0.875 0.875]; + % Choosing and sorting 12 colors for line plot, namely Red, Blue, Green, Fuchsia, Lime, Aqua, Maroon, Olive, Purple, Teal, Navy, and Gray + selectedcolors = colors([4 13 14 3 11 10 9 7 8 12 15 6]); + + % determine the new dip colors + for n = 1:length(subj_groupnum) + dip_color{1,n}=selectedcolors{subj_groupnum(n,1)+1}; + end + for n = 1:length(STUDY.group) + dip_color{1,end+1}= selectedcolors{n+1}; + end + + for n = 1:length(options) + if strcmp(options{1,n}, 'color') + options{1,n+1} = dip_color; + elseif strcmp(options{1,n}, 'dipnames') + dipnames = options{1,n+1}; + for m = 1:length(STUDY.group) + dipnames{1,length(subj_groupnum)+m}= [STUDY.group{1,m} ' mean']; + end + options{1,n+1} = dipnames; + end + end + + + + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_editset.m b/code/eeglab13_4_4b/functions/studyfunc/std_editset.m new file mode 100644 index 0000000..7e30d18 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_editset.m @@ -0,0 +1,393 @@ +% std_editset() - modify a STUDY set structure. +% +% Usage: +% >> [STUDY, ALLEEG] = std_editset(STUDY, ALLEEG, key1, val1, ...); +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% +% Optional inputs: +% 'commands' - {cell_array} change STUDY (see command description and +% example below. +% 'name' - [string] specify a (mnemonic) name for the STUDY structure. +% {default: ''} +% 'task' - [string] attach a description of the experimental task(s) +% performed by the STUDY subjects {default: ''}. +% 'filename' - [string] filename for the STUDY set. +% 'filepath' - [string] file path (directory/folder) in which the STUDY file +% will be saved. +% 'addchannellabels' - ['on'|'off'] add channel labels ('1', '2', '3', ...) +% to all datasets of a STUDY to ensure that all STUDY functions +% will work {default: 'off' unless no dataset has channel +% locations and then it is automatically set to on} +% 'notes' - [string] notes about the experiment, the datasets, the STUDY, +% or anything else to store with the STUDY itself {default: ''}. +% 'updatedat' - ['on'|'off'] update 'subject' 'session' 'condition' and/or +% 'group' fields of STUDY dataset(s). +% 'savedat' - ['on'|'off'] re-save datasets +% 'inbrain' - ['on'|'off'] select components for clustering from all STUDY +% datasets with equivalent dipoles located inside the brain volume. +% Dipoles are selected based on their residual variance and their +% location {default: 'off'} +% 'resave' - ['on'|'off'] save or resave STUDY {default: 'off'} +% +% Each of the 'commands' (above) is a cell array composed of any of the following: +% 'index' - [integer] modify/add dataset index. Note that if a +% dataset is added and that this leaves some indices not +% populated, the dataset is automatically set to the last +% empty index. For instance creating a STUDY with a single +% dataset at index 10 will result with a STUDY with a +% single dataset at index 1. +% 'remove' - [integer] remove dataset index. +% 'subject' - [string] subject code. +% 'condition' - [string] dataset condition. +% 'session ' - [integer] dataset session number. +% 'group' - [string] dataset group. +% 'load' - [filename] load dataset from specified filename +% 'dipselect' - [float<1] select components for clustering from all STUDY +% datasets with dipole model residual var. below this value. +% 'inbrain' - ['on'|'off'] same as above. This option may also be +% placed in the command list (preceeding the 'dipselect' +% option). +% +% Outputs: +% STUDY - a new STUDY set containing some or all of the datasets in ALLEEG, +% plus additional information from the optional inputs above. +% ALLEEG - a vector of EEG datasets included in the STUDY structure +% +% See also: pop_createstudy(), std_loadalleeg(), pop_clust(), pop_preclust(), +% eeg_preclust(), eeg_createdata() +% +% Authors: Arnaud Delorme, Hilit Serby, SCCN/INC/UCSD, October , 2004- + +% Copyright (C) Arnaud Delorme & Scott Makeig, SCCN/INC/UCSD, October 11, 2004, smakeig@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, ALLEEG] = std_editset(STUDY, ALLEEG, varargin) + +if (nargin < 3) + help std_editset; + return; +end; + +% decode input parameters +% ----------------------- +g = finputcheck(varargin, { 'updatedat' 'string' { 'on','off' } 'off'; + 'name' 'string' { } ''; + 'task' 'string' { } ''; + 'notes' 'string' { } ''; + 'filename' 'string' { } ''; + 'filepath' 'string' { } ''; + 'resave' 'string' { 'on','off','info' } 'off'; + 'savedat' 'string' { 'on','off' } 'off'; + 'addchannellabels' 'string' { 'on','off' } 'off'; + 'rmclust' 'string' { 'on','off' } 'on'; + 'inbrain' 'string' { 'on','off' } 'off'; + 'commands' 'cell' {} {} }, 'std_editset'); +if isstr(g), error(g); end; + +if isempty(STUDY), STUDY.history = 'STUDY = [];'; end; +if ~isempty(g.name), STUDY.name = g.name; end +if ~isempty(g.task), STUDY.task = g.task; end +if ~isempty(g.notes), STUDY.notes = g.notes; end + +% default addchannellabels +% ------------------------ +if ~isempty(ALLEEG) + allchanlocs = { ALLEEG.chanlocs }; + if all(cellfun( @isempty, allchanlocs)) + g.addchannellabels = 'on'; + else + if any(cellfun( @isempty, allchanlocs)) + error( [ 'Some datasets have channel locations and some other don''t' 10 ... + 'the STUDY is not homogenous and cannot be created.' ]); + end; + end; +end; + +% make one cell array with commands +% --------------------------------- +allcoms = {}; +if ~isempty(g.commands) + if iscell(g.commands{1}) + for k = 1:length(g.commands) + % put index field first + indindex = strmatch('index', lower(g.commands{k}(1:2:end))); + if ~isempty(indindex) + tmpcom = { 'index' g.commands{k}{2*(indindex-1)+1+1} g.commands{k}{:} }; + else tmpcom = g.commands{k}; + end; + allcoms = { allcoms{:} tmpcom{:} }; + end; + else + allcoms = g.commands; + end; +end; +g.commands = allcoms; + +% add 'dipselect' command if 'inbrain' option is selected +% --------------------------------- +dipselectExists = false; +for k = 1:2:length(g.commands) + if strcmp(g.commands{k},'dipselect') + dipselectExists = true; + end; +end; +if strcmp(g.inbrain,'on') && ~dipselectExists + g.commands{length(g.commands)+1} = 'dipselect'; + g.commands{length(g.commands)+1} = 0.15; +end; + +% copy values +% ----------- +if ~isfield(STUDY, 'datasetinfo') + for realindex = 1:length(ALLEEG) + if ~isempty(ALLEEG(realindex).data) + [tmppath tmpfile tmpext] = fileparts( fullfile(ALLEEG(realindex).filepath, ALLEEG(realindex).filename) ); + STUDY.datasetinfo(realindex).filepath = tmppath; + STUDY.datasetinfo(realindex).filename = [ tmpfile tmpext ]; + STUDY.datasetinfo(realindex).subject = ALLEEG(realindex).subject; + STUDY.datasetinfo(realindex).session = ALLEEG(realindex).session; + STUDY.datasetinfo(realindex).condition = ALLEEG(realindex).condition; + STUDY.datasetinfo(realindex).group = ALLEEG(realindex).group; + end; + end; +end; + +% execute commands +% ---------------- +currentind = 1; +rmlist = []; +for k = 1:2:length(g.commands) + + switch g.commands{k} + case 'index' + currentind = g.commands{k+1}; + case 'subject' + STUDY.datasetinfo(currentind).subject = g.commands{k+1}; + case 'comps' + STUDY.datasetinfo(currentind).comps = g.commands{k+1}; + case 'condition' + STUDY.datasetinfo(currentind).condition = g.commands{k+1}; + case 'group' + STUDY.datasetinfo(currentind).group = g.commands{k+1}; + case 'session' + STUDY.datasetinfo(currentind).session = g.commands{k+1}; + case 'session' + STUDY.datasetinfo(currentind).session = g.commands{k+1}; + case 'remove' + % create empty structure + allfields = fieldnames(ALLEEG); + tmpfields = allfields; + tmpfields(:,2) = cell(size(tmpfields)); + tmpfields = tmpfields'; + ALLEEG(g.commands{k+1}) = struct(tmpfields{:}); + + % create empty structure + allfields = fieldnames(STUDY.datasetinfo); + tmpfields = allfields; + tmpfields(:,2) = cell(size(tmpfields)); + tmpfields = tmpfields'; + STUDY.datasetinfo(g.commands{k+1}) = struct(tmpfields{:}); + + if isfield(STUDY.datasetinfo, 'index') + STUDY.datasetinfo = rmfield(STUDY.datasetinfo, 'index'); + end; + STUDY.datasetinfo(1).index = []; + STUDY.changrp = []; + case 'return', return; + case 'inbrain' + g.inbrain = g.commands{k+1}; + case 'dipselect' + STUDY = std_checkset(STUDY, ALLEEG); + rv = g.commands{k+1}; + clusters = std_findsameica(ALLEEG); + + for cc = 1:length(clusters) + + idat = 0; + for tmpi = 1:length(clusters{cc}) + if isfield(ALLEEG(clusters{cc}(tmpi)).dipfit, 'model') + idat = clusters{cc}(tmpi); + end; + end; + + indleft = []; + if rv ~= 1 + if idat ~= 0 + if strcmp(g.inbrain,'on') + fprintf('Selecting dipoles with less than %%%2.1f residual variance and removing dipoles outside brain volume in dataset ''%s''\n', ... + 100*rv, ALLEEG(idat).setname); + indleft = eeg_dipselect(ALLEEG(idat), rv*100,'inbrain'); + else + fprintf('Selecting dipoles with less than %%%2.1f residual variance in dataset ''%s''\n', ... + 100*rv, ALLEEG(idat).setname); + indleft = eeg_dipselect(ALLEEG(idat), rv*100,'rv'); + end; + else + fprintf('No dipole information found in ''%s'' dataset, using all components\n', ALLEEG.setname) + end + end; + for tmpi = 1:length(clusters{cc}) + STUDY.datasetinfo(clusters{cc}(tmpi)).comps = indleft; + end; + end; + STUDY.cluster = []; + STUDY = std_checkset(STUDY, ALLEEG); % recreate parent dataset + + case 'load' + TMPEEG = std_loadalleeg( { g.commands{k+1} } ); + ALLEEG = eeg_store(ALLEEG, eeg_checkset(TMPEEG), currentind); + ALLEEG(currentind).saved = 'yes'; + + % update datasetinfo structure + % ---------------------------- + [tmppath tmpfile tmpext] = fileparts( fullfile(ALLEEG(currentind).filepath, ... + ALLEEG(currentind).filename) ); + STUDY.datasetinfo(currentind).filepath = tmppath; + STUDY.datasetinfo(currentind).filename = [ tmpfile tmpext ]; + STUDY.datasetinfo(currentind).subject = ALLEEG(currentind).subject; + STUDY.datasetinfo(currentind).session = ALLEEG(currentind).session; + STUDY.datasetinfo(currentind).condition = ALLEEG(currentind).condition; + STUDY.datasetinfo(currentind).group = ALLEEG(currentind).group; + STUDY.datasetinfo(currentind).index = currentind; + otherwise, error(sprintf('Unknown command %s', g.commands{k})); + end +end + +% add channel labels automatically +% ------------------------------- +if strcmpi(g.addchannellabels, 'on') + disp('Generating channel labels for all datasets...'); + for currentind = 1:length(ALLEEG) + for ind = 1:ALLEEG(currentind).nbchan + ALLEEG(currentind).chanlocs(ind).labels = int2str(ind); + end; + end; + ALLEEG(currentind).saved = 'no'; + g.savedat = 'on'; +end; + +% update ALLEEG structure? +% ------------------------ +if strcmpi(g.updatedat, 'on') + for currentind = 1:length(ALLEEG) + if ~strcmpi(ALLEEG(currentind).subject, STUDY.datasetinfo(currentind).subject) + ALLEEG(currentind).subject = STUDY.datasetinfo(currentind).subject; + ALLEEG(currentind).saved = 'no'; + end; + if ~strcmpi(ALLEEG(currentind).condition, STUDY.datasetinfo(currentind).condition) + ALLEEG(currentind).condition = STUDY.datasetinfo(currentind).condition; + ALLEEG(currentind).saved = 'no'; + end; + if ~isequal(ALLEEG(currentind).session, STUDY.datasetinfo(currentind).session) + ALLEEG(currentind).session = STUDY.datasetinfo(currentind).session; + ALLEEG(currentind).saved = 'no'; + end; + if ~strcmpi(char(ALLEEG(currentind).group), char(STUDY.datasetinfo(currentind).group)) + ALLEEG(currentind).group = STUDY.datasetinfo(currentind).group; + ALLEEG(currentind).saved = 'no'; + end; + end; +end; + +% remove empty datasets (cannot be done above because some empty datasets +% might not have been removed) +% --------------------- +rmindex = []; +for index = 1:length(STUDY.datasetinfo) + if isempty(STUDY.datasetinfo(index).subject) && isempty(ALLEEG(index).nbchan) + rmindex = [ rmindex index ]; + end; +end; +STUDY.datasetinfo(rmindex) = []; +ALLEEG(rmindex) = []; +for index = 1:length(STUDY.datasetinfo) + STUDY.datasetinfo(index).index = index; +end; + +% remove empty ALLEEG structures +% ------------------------------ +while length(ALLEEG) > length(STUDY.datasetinfo) + ALLEEG(end) = []; +end; +%[ ALLEEG STUDY.datasetinfo ] = remove_empty(ALLEEG, STUDY.datasetinfo); + +% save datasets if necessary +% -------------------------- +if strcmpi(g.savedat, 'on') + for index = 1:length(ALLEEG) + if isempty(ALLEEG(index).filename) + fprintf('Cannot resave ALLEEG(%d) because the dataset has no filename\n', index); + else + TMP = pop_saveset(ALLEEG(index), 'savemode', 'resave'); + ALLEEG = eeg_store(ALLEEG, TMP, index); + ALLEEG(index).saved = 'yes'; + end; + end; +end; + +% remove cluster information if necessary +% --------------------------------------- +if strcmpi(g.rmclust, 'on') + STUDY.cluster = []; +end; + +% save study if necessary +% ----------------------- +if ~isempty(g.commands) + STUDY.changrp = []; + STUDY.cluster = []; +% if ~isempty(STUDY.design) +% [STUDY] = std_createclust(STUDY, ALLEEG, 'parentcluster', 'on'); +% end; +end; +[STUDY ALLEEG] = std_checkset(STUDY, ALLEEG); +if ~isempty(g.filename), + [STUDY.filepath STUDY.filename ext] = fileparts(fullfile( g.filepath, g.filename )); + STUDY.filename = [ STUDY.filename ext ]; + g.resave = 'on'; +end +if strcmpi(g.resave, 'on') + STUDY = pop_savestudy(STUDY, ALLEEG, 'savemode', 'resave'); +end; + +% --------------------- +% remove empty elements +% --------------------- +function [ALLEEG, datasetinfo] = remove_empty(ALLEEG, datasetinfo); + + rmindex = []; + for index = 1:length(datasetinfo) + if isempty(datasetinfo(index).subject) && isempty(ALLEEG(index).nbchan) + rmindex = [ rmindex index ]; + end; + end; + datasetinfo(rmindex) = []; + ALLEEG(rmindex) = []; + for index = 1:length(datasetinfo) + datasetinfo(index).index = index; + end; + + % remove empty ALLEEG structures + % ------------------------------ + while length(ALLEEG) > length(datasetinfo) + ALLEEG(end) = []; + end; + + + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_erp.m b/code/eeglab13_4_4b/functions/studyfunc/std_erp.m new file mode 100644 index 0000000..e9266e4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_erp.m @@ -0,0 +1,253 @@ +% std_erp() - Constructs and returns channel or ICA activation ERPs for a dataset. +% Saves the ERPs into a Matlab file, [dataset_name].icaerp, for +% data channels or [dataset_name].icaerp for ICA components, +% in the same directory as the dataset file. If such a file +% already exists, loads its information. +% Usage: +% >> [erp, times] = std_erp(EEG, 'key', 'val', ...); +% Inputs: +% EEG - a loaded epoched EEG dataset structure. May be an array +% of such structure containing several datasets. +% +% Optional inputs: +% 'components' - [numeric vector] components of the EEG structure for which +% activation ERPs will be computed. Note that because +% computation of ERP is so fast, all components ERP are +% computed and saved. Only selected component +% are returned by the function to Matlab +% {default|[] -> all} +% 'channels' - [cell array] channels of the EEG structure for which +% activation ERPs will be computed. Note that because +% computation of ERP is so fast, all channels ERP are +% computed and saved. Only selected channels +% are returned by the function to Matlab +% {default|[] -> none} +% 'recompute' - ['on'|'off'] force recomputing ERP file even if it is +% already on disk. +% 'trialindices' - [cell array] indices of trials for each dataset. +% Default is all trials. +% 'recompute' - ['on'|'off'] force recomputing data file even if it is +% already on disk. +% 'rmcomps' - [integer array] remove artifactual components (this entry +% is ignored when plotting components). This entry contains +% the indices of the components to be removed. Default is none. +% 'interp' - [struct] channel location structure containing electrode +% to interpolate (this entry is ignored when plotting +% components). Default is no interpolation. +% 'fileout' - [string] name of the file to save on disk. The default +% is the same name (with a different extension) as the +% dataset given as input. +% 'savetrials' - ['on'|'off'] save single-trials ERSP. Requires a lot of disk +% space (dataset space on disk times 10) but allow for refined +% single-trial statistics. +% +% ERP specific options: +% 'rmbase' - [min max] remove baseline. This option does not affect +% the original datasets. +% +% Outputs: +% erp - ERP for the requested ICA components in the selected +% latency window. ERPs are scaled by the RMS over of the +% component scalp map projection over all data channels. +% times - vector of times (epoch latencies in ms) for the ERP +% +% File output: +% [dataset_file].icaerp % component erp file +% OR +% [dataset_file].daterp % channel erp file +% +% See also: std_spec(), std_ersp(), std_topo(), std_preclust() +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, January, 2005 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [X, t] = std_erp(EEG, varargin); %comps, timerange) + +if nargin < 1 + help std_erp; + return; +end; + +% decode inputs +% ------------- +if ~isempty(varargin) + if ~isstr(varargin{1}) + varargin = { varargin{:} [] [] }; + if all(varargin{1} > 0) + options = { 'components' varargin{1} 'timerange' varargin{2} }; + else + options = { 'channels' -varargin{1} 'timerange' varargin{2} }; + end; + else + options = varargin; + end; +else + options = varargin; +end; + +g = finputcheck(options, { 'components' 'integer' [] []; + 'channels' 'cell' {} {}; + 'rmbase' 'real' [] []; + 'trialindices' { 'integer','cell' } [] []; + 'rmcomps' 'cell' [] cell(1,length(EEG)); + 'fileout' 'string' [] ''; + 'savetrials' 'string' { 'on','off' } 'off'; + 'interp' 'struct' { } struct([]); + 'timerange' 'real' [] []; % the timerange option is deprecated and has no effect + 'recompute' 'string' { 'on','off' } 'off' }, 'std_erp'); +if isstr(g), error(g); end; +if isempty(g.trialindices), g.trialindices = cell(length(EEG)); end; +if ~iscell(g.trialindices), g.trialindices = { g.trialindices }; end; +if isfield(EEG,'icaweights') + numc = size(EEG(1).icaweights,1); +else + error('EEG.icaweights not found'); +end +if isempty(g.components) + g.components = 1:numc; +end + +% % THIS SECTION WOULD NEED TO TEST THAT THE PARAMETERS ON DISK ARE CONSISTENT +% +% % filename +% % -------- +if isempty(g.fileout), g.fileout = fullfile(EEG(1).filepath, EEG(1).filename(1:end-4)); end; +if ~isempty(g.channels) + filenameshort = [ g.fileout '.daterp']; + prefix = 'chan'; +else + filenameshort = [ g.fileout '.icaerp']; + prefix = 'comp'; +end; +%filename = fullfile( EEG(1).filepath, filenameshort); +filename = filenameshort; + +% ERP information found in datasets +% --------------------------------- +if exist(filename) & strcmpi(g.recompute, 'off') + + fprintf('File "%s" found on disk, no need to recompute\n', filenameshort); + setinfo.filebase = g.fileout; + if strcmpi(prefix, 'comp') + [X tmp t] = std_readfile(setinfo, 'components', g.components, 'timelimits', g.timerange, 'measure', 'erp'); + else + [X tmp t] = std_readfile(setinfo, 'channels', g.channels, 'timelimits', g.timerange, 'measure', 'erp'); + end; + if ~isempty(X), return; end; + +end + +% No ERP information found +% ------------------------ +% if isstr(EEG.data) +% TMP = eeg_checkset( EEG, 'loaddata' ); % load EEG.data and EEG.icaact +% else +% TMP = EEG; +% end +% & isempty(TMP.icaact) +% TMP.icaact = (TMP.icaweights*TMP.icasphere)* ... +% reshape(TMP.data(TMP.icachansind,:,:), [ length(TMP.icachansind) size(TMP.data,2)*size(TMP.data,3) ]); +% TMP.icaact = reshape(TMP.icaact, [ size(TMP.icaact,1) size(TMP.data,2) size(TMP.data,3) ]); +%end; +%if strcmpi(prefix, 'comp'), X = TMP.icaact; +%else X = TMP.data; +%end; +options = {}; +if ~isempty(g.rmcomps), options = { options{:} 'rmcomps' g.rmcomps }; end; +if ~isempty(g.interp), options = { options{:} 'interp' g.interp }; end; +if isempty(g.channels) + X = eeg_getdatact(EEG, 'component', [1:size(EEG(1).icaweights,1)], 'trialindices', g.trialindices ); +else X = eeg_getdatact(EEG, 'channel' , [1:EEG(1).nbchan], 'trialindices', g.trialindices, 'rmcomps', g.rmcomps, 'interp', g.interp); +end; + +% Remove baseline mean +% -------------------- +pnts = EEG(1).pnts; +trials = size(X,3); +timevals = EEG(1).times; +if ~isempty(g.timerange) + disp('Warning: the ''timerange'' option is deprecated and has no effect'); +end; +if ~isempty(X) + if ~isempty(g.rmbase) + disp('Removing baseline...'); + options = { options{:} 'rmbase' g.rmbase }; + [tmp timebeg] = min(abs(timevals - g.rmbase(1))); + [tmp timeend] = min(abs(timevals - g.rmbase(2))); + if ~isempty(timebeg) + X = rmbase(X,pnts, [timebeg:timeend]); + else + X = rmbase(X,pnts); + end + end + X = reshape(X, [ size(X,1) pnts trials ]); + if strcmpi(prefix, 'comp') + if strcmpi(g.savetrials, 'on') + X = repmat(sqrt(mean(EEG(1).icawinv.^2))', [1 EEG(1).pnts size(X,3)]) .* X; + else + X = repmat(sqrt(mean(EEG(1).icawinv.^2))', [1 EEG(1).pnts]) .* mean(X,3); % calculate ERP + end; + elseif strcmpi(g.savetrials, 'off') + X = mean(X, 3); + end; +end; + +% Save ERPs in file (all components or channels) +% ---------------------------------------------- +if isempty(timevals), timevals = linspace(EEG(1).xmin, EEG(1).xmax, EEG(1).pnts)*1000; end; % continuous data +fileNames = computeFullFileName( { EEG.filepath }, { EEG.filename }); +if strcmpi(prefix, 'comp') + savetofile( filename, timevals, X, 'comp', 1:size(X,1), options, {}, fileNames, g.trialindices); + %[X,t] = std_readerp( EEG, 1, g.components, g.timerange); +else + if ~isempty(g.interp) + savetofile( filename, timevals, X, 'chan', 1:size(X,1), options, { g.interp.labels }, fileNames, g.trialindices); + else + tmpchanlocs = EEG(1).chanlocs; + savetofile( filename, timevals, X, 'chan', 1:size(X,1), options, { tmpchanlocs.labels }, fileNames, g.trialindices); + end; + %[X,t] = std_readerp( EEG, 1, g.channels, g.timerange); +end; + +% compute full file names +% ----------------------- +function res = computeFullFileName(filePaths, fileNames); +for index = 1:length(fileNames) + res{index} = fullfile(filePaths{index}, fileNames{index}); +end; + +% ------------------------------------- +% saving ERP information to Matlab file +% ------------------------------------- +function savetofile(filename, t, X, prefix, comps, params, labels, dataFiles, dataTrials); + + disp([ 'Saving ERP file ''' filename '''' ]); + allerp = []; + for k = 1:length(comps) + allerp = setfield( allerp, [ prefix int2str(comps(k)) ], squeeze(X(k,:,:))); + end; + if nargin > 6 && ~isempty(labels) + allerp.labels = labels; + end; + allerp.times = t; + allerp.datatype = 'ERP'; + allerp.parameters = params; + allerp.datafiles = dataFiles; + allerp.datatrials = dataTrials; + + std_savedat(filename, allerp); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_erpimage.m b/code/eeglab13_4_4b/functions/studyfunc/std_erpimage.m new file mode 100644 index 0000000..4e60863 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_erpimage.m @@ -0,0 +1,254 @@ +% std_erpimage() - Compute ERP images and save them on disk. +% +% Usage: +% >> std_erpimage( EEG, 'key', 'val', ...); +% +% Inputs: +% EEG - a loaded epoched EEG dataset structure. May be an array +% of such structure containing several datasets. +% +% Optional inputs: +% 'components' - [numeric vector] components of the EEG structure for which +% the measure will be computed {default|[] -> all} +% 'channels' - [cell array] channels of the EEG structure for which +% activation ERPs will be computed {default|[] -> none} +% 'trialindices' - [cell array] indices of trials for each dataset. +% Default is all trials. +% 'recompute' - ['on'|'off'] force recomputing data file even if it is +% already on disk. +% 'rmcomps' - [integer array] remove artifactual components (this entry +% is ignored when plotting components). This entry contains +% the indices of the components to be removed. Default is none. +% 'interp' - [struct] channel location structure containing electrode +% to interpolate ((this entry is ignored when plotting +% components). Default is no interpolation. +% 'fileout' - [string] name of the file to save on disk. The default +% is the same name (with a different extension) as the +% dataset given as input. +% +% ERPimage options: +% 'concatenate' - ['on'|'off'] concatenate single trial of different +% subjects for plotting ERPimages ('on'). The default +% ('off') computes an ERPimage for each subject and then +% averages these ERPimages. This allows to perform +% statistics (the 'on' options does not allow statistics). +% 'smoothing' - Smoothing parameter (number of trials). {Default: 10} +% erpimage() equivalent: 'avewidth' +% 'nlines' - Number of lines for ERPimage. erpaimge() equivalent is +% 'decimate'. Note that this parameter must be larger than +% the minimum number of trials in each design cell +% {Default: 10} +% 'sorttype' - Sorting event type(s) ([int vector]; []=all). See Notes below. +% Either a string or an integer. +% 'sortwin' - Sorting event window [start, end] in milliseconds ([]=whole epoch) +% 'sortfield' - Sorting field name. {default: latency}. +% 'erpimageopt' - erpimage() options, separated by commas (Ex: 'erp', 'cbar'). +% {Default: none}. For further details see >> erpimage help +% Outputs: +% erpimagestruct - structure containing ERPimage information that is +% been saved on disk. +% +% Files are saved on disk. +% [dataset_file].icaerpim % component ERPimage file +% OR +% [dataset_file].daterpim % channel ERPimage file +% +% Author: Arnaud Delorme, SCCN & CERCO, CNRS, 2011- + +% Copyright (C) 2011 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function allerpimage = std_erpimage( EEG, varargin); + +if nargin < 1 + help std_erpimage; + return; +end + +allerpimage = []; +[opt moreopts] = finputcheck( varargin, { ... + 'components' 'integer' [] []; + 'channels' { 'cell','integer' } { [] [] } {}; + 'trialindices' { 'integer','cell' } [] []; + 'recompute' 'string' { 'on','off' } 'off'; + 'savefile' 'string' { 'on','off' } 'on'; + 'fileout' 'string' [] ''; + 'rmcomps' 'cell' [] cell(1,length(EEG)); + 'interp' 'struct' { } struct([]); + 'nlines' '' [] 10; + 'smoothing' '' [] 10; + 'sorttype' '' {} ''; + 'sortwin' '' {} []; + 'sortfield' '' {} 'latency'; + 'concatenate' 'string' { 'on','off' } 'off'; + 'erpimageopt' 'cell' {} {}}, ... + 'std_erpimage', 'ignore'); +if isstr(opt), error(opt); end; +if length(EEG) == 1 && isempty(opt.trialindices), opt.trialindices = { [1:EEG.trials] }; end; +if isempty(opt.trialindices), opt.trialindices = cell(length(EEG)); end; +if ~iscell(opt.trialindices), opt.trialindices = { opt.trialindices }; end; +if isfield(EEG,'icaweights') + numc = size(EEG(1).icaweights,1); +else + error('EEG.icaweights not found'); +end +if isempty(opt.components) + opt.components = 1:numc; +end + +% filename +% -------- +if isempty(opt.fileout), opt.fileout = fullfile(EEG(1).filepath, EEG(1).filename(1:end-4)); end; +if ~isempty(opt.channels) + filenameshort = [ opt.fileout '.daterpim']; + prefix = 'chan'; + if iscell(opt.channels) + if ~isempty(opt.interp) + opt.indices = eeg_chaninds(opt.interp, opt.channels, 0); + else + opt.indices = eeg_chaninds(EEG(1), opt.channels, 0); + for ind = 2:length(EEG) + if ~isequal(eeg_chaninds(EEG(ind), opt.channels, 0), opt.indices) + error([ 'Channel information must be consistant when ' 10 'several datasets are merged for a specific design' ]); + end; + end; + end; + else + opt.indices = opt.channels; + end; +else + opt.indices = opt.components; + filenameshort = [ opt.fileout '.icaerpim']; + prefix = 'comp'; +end; +filename = filenameshort; + +% ERP information found in datasets +% --------------------------------- +if exist(filename) && strcmpi(opt.recompute, 'off') + fprintf('File "%s" found on disk, no need to recompute\n', filenameshort); + return; +end + +allerpimage = []; +if strcmpi(opt.concatenate, 'off') + % compute ERP images + % ------------------ + if isempty(opt.channels) + X = eeg_getdatact(EEG, 'component', opt.indices, 'trialindices', opt.trialindices ); + else X = eeg_getdatact(EEG, 'channel' , opt.indices, 'trialindices', opt.trialindices, 'rmcomps', opt.rmcomps, 'interp', opt.interp); + end; + if ~isempty(opt.sorttype) + events = eeg_getepochevent(EEG, 'type', opt.sorttype, 'timewin', opt.sortwin, 'fieldname', opt.sortfield, 'trials', opt.trialindices); + else events = []; + end; + + % reverse engeeneering the number of lines for ERPimage + finallines = opt.nlines; + if ~isempty(events) + if all(isnan(events)) + error('Cannot sort trials for one of the dataset'); + end; + lastx = sum(~isnan(events)); + else lastx = size(X,3); + end; + if lastx < finallines + floor((opt.smoothing-1)/2) + 3 + error('The default number of ERPimage lines is too large for one of the dataset'); + end; + firstx = 1; + xwidth = opt.smoothing; + %xadv = lastx/finallines; + nout = finallines; %floor(((lastx-firstx+xadv+1)-xwidth)/xadv); + nlines = (lastx-xwidth)/(nout-0.5)*i; % make it imaginary + %nlines = ceil(lastx/((lastx-firstx+1-xwidth)/(nout-1))); + + if 0 + % testing conversion back and forth + % --------------------------------- + for lastx = 20:300 + for xwidth = 1:19 + for nlines = (xwidth+1):100 + + nout = floor(((lastx+nlines)-xwidth)/nlines); + realnlines = (lastx-xwidth)/(nout-0.5); + noutreal = floor(((lastx+realnlines)-xwidth)/realnlines); + + if nout ~= noutreal + error('Wrong conversion 2'); + end; + + end; + end; + end; + end; + + clear tmperpimage eventvals; + parfor index = 1:size(X,1) + [tmpX tmpevents] = erpimage(squeeze(X(index,:,:)), events, EEG(1).times, '', opt.smoothing, nlines, 'noplot', 'on', opt.erpimageopt{:}, moreopts{:}); + if isempty(events), tmpevents = []; end; + eventvals{index} = tmpevents; + tmperpimage{index} = tmpX'; + end; + allerpimage.events = eventvals{1}; + for index = 1:size(X,1) + allerpimage.([ prefix int2str(opt.indices(index)) ]) = tmperpimage{index}; + end; +else + % generate dynamic loading commands + % --------------------------------- + for dat = 1:length(EEG) + filenames{dat} = fullfile(EEG(1).filepath, EEG(1).filename); + end; + allerpimage.times = EEG(1).times; + for index = 1:length(opt.indices) + if ~isempty(opt.channels) + com = sprintf('squeeze(eeg_getdatact(%s, ''interp'', chanlocsforinterp));', vararg2str( { filenames 'channel' , opt.indices(index), 'rmcomps', opt.rmcomps, 'trialindices', opt.trialindices } )); + else com = sprintf('squeeze(eeg_getdatact(%s));', vararg2str( { filenames 'component', opt.indices(index), 'trialindices', opt.trialindices } )); + end; + allerpimage = setfield(allerpimage, [ prefix int2str(opt.indices(index)) ], com); + end; + allerpimage = setfield(allerpimage, 'chanlocsforinterp', opt.interp); + if ~isempty(opt.sorttype) + events = eeg_getepochevent(EEG, 'type', opt.sorttype, 'timewin', opt.sortwin, 'fieldname', opt.sortfield, 'trials', opt.trialindices); + %geteventcom = sprintf('eeg_getepochevent(%s);', vararg2str( { filenames 'type', opt.sorttype, 'timewin', opt.sortwin, 'fieldname', opt.sortfield } )); + else events = []; + end; + allerpimage = setfield(allerpimage, 'events', events); +end; +allerpimage.times = EEG(1).times; +allerpimage.parameters = varargin; +allerpimage.datatype = 'ERPIMAGE'; +allerpimage.datafiles = computeFullFileName( { EEG.filepath }, { EEG.filename }); +allerpimage.datatrials = opt.trialindices; + +% Save ERPimages in file (all components or channels) +% ---------------------------------------------- +if strcmpi(opt.savefile, 'on') + if strcmpi(prefix, 'comp') + std_savedat(filename, allerpimage); + else + tmpchanlocs = EEG(1).chanlocs; + allerpimage.labels = opt.channels; + std_savedat(filename, allerpimage); + end; +end; + +% compute full file names +% ----------------------- +function res = computeFullFileName(filePaths, fileNames); +for index = 1:length(fileNames) + res{index} = fullfile(filePaths{index}, fileNames{index}); +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_erpimageplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_erpimageplot.m new file mode 100644 index 0000000..c1dfa4e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_erpimageplot.m @@ -0,0 +1,146 @@ +% std_erpimageplot() - Commandline function to plot cluster ERPimage or channel erpimage. +% +% Usage: +% >> [STUDY] = std_erpimageplot(STUDY, ALLEEG, key1, val1, key2, val2); +% >> [STUDY data times freqs pgroup pcond pinter] = ... +% std_erpimageplot(STUDY, ALLEEG ...); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the datasets in the STUDY. +% Note: ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% +% Additional help: +% Inputs and output of this function are strictly identical to the std_erspplot(). +% See the help message of this function for more information. +% +% See also: std_erspplot() +% +% Authors: Arnaud Delorme, UCSD/CERCO, August, 2011- + +% Copyright (C) Arnaud Delorme, arno@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, allitc, alltimes, allfreqs, pgroup, pcond, pinter, events] = std_erpimageplot(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_erpimageplot; + return; +end; + +events = []; +STUDY = pop_erpimparams(STUDY, 'default'); +if strcmpi(STUDY.etc.erpimparams.concatenate, 'off') + + % use std_erspplot for stats when concatenate is off + [STUDY allitc alltimes allfreqs pgroup pcond pinter events] = std_erspplot(STUDY, ALLEEG, 'datatype', 'erpim', varargin{:}); + +else + params = STUDY.etc.erpimparams; + [ opt moreparams ] = finputcheck( varargin, { ... + 'design' 'integer' [] STUDY.currentdesign; + 'topotime' 'real' [] params.topotime; + 'topotrial' 'real' [] params.topotrial; + 'timerange' 'real' [] params.timerange; + 'trialrange' 'real' [] params.trialrange; + 'colorlimits' 'real' [] params.colorlimits; % ERPimage + 'statistics' 'string' [] params.statistics; + 'groupstats' 'string' [] params.groupstats; + 'condstats' 'string' [] params.condstats; + 'threshold' 'real' [] params.threshold; + 'naccu' 'integer' [] params.naccu; + 'mcorrect' 'string' [] params.mcorrect; + 'erpimageopt' 'cell' [] params.erpimageopt; + 'concatenate' 'string' { 'on','off' } params.concatenate; + 'channels' 'cell' [] {}; + 'clusters' 'integer' [] []; + 'comps' {'integer','string'} [] []; % for backward compatibility + 'plotsubjects' 'string' { 'on','off' } 'off'; + 'plotmode' 'string' { 'normal','condensed','none' } 'normal'; + 'subject' 'string' [] '' }, 'std_erpimageplot', 'ignore'); + + if ~isempty(opt.topotime) && ~isempty(opt.topotrial) + error('Cannot plot topography when ERP-image is in trial concatenation mode'); + end; + if ~isempty(opt.trialrange) + error('Cannot select trial range when ERP-image is in trial concatenation mode'); + end; + if strcmpi(opt.groupstats, 'on') || strcmpi(opt.condstats, 'on') + disp('Warning: cannot perform statistics when ERP-image is in trial concatenation mode'); + end; + + % options + if ~isempty(opt.colorlimits), options = { 'caxis' opt.colorlimits opt.erpimageopt{:} }; + else options = { 'cbar' 'on' opt.erpimageopt{:} }; + end; + + if ~isempty(opt.channels) + [STUDY allerpimage alltimes alltrials tmp events] = std_readersp(STUDY, ALLEEG, 'channels', opt.channels, 'infotype', 'erpim', 'subject', opt.subject, ... + 'concatenate', 'on', 'timerange', opt.timerange, 'design', opt.design); + + % get figure title + % ---------------- + locs = eeg_mergelocs(ALLEEG.chanlocs); + locs = locs(std_chaninds(STUDY, opt.channels)); + allconditions = STUDY.design(opt.design).variable(1).value; + allgroups = STUDY.design(opt.design).variable(2).value; + alltitles = std_figtitle('condnames', allconditions, 'cond2names', allgroups, 'chanlabels', { locs.labels }, ... + 'subject', opt.subject, 'valsunit', 'ms', 'datatype', 'ERPIM'); + + figure; + for iCond = 1:length(allconditions) + for iGroup = 1:length(allgroups) + tmpevents = events{iCond, iGroup}; + if isempty(tmpevents), tmpevents = zeros(1, size(allerpimage{iCond, iGroup},2)); end; + subplot(length(allconditions), length(allgroups), (iCond-1)*length(allgroups) + iGroup); + + % use color scale for last plot + if ~isempty(opt.colorlimits) && iCond == length(allconditions) && iGroup == length(allgroups) + options = { options{:} 'cbar' 'on' }; + end; + erpimage(allerpimage{iCond, iGroup}, tmpevents, alltimes, alltitles{iCond, iGroup}, params.smoothing, params.nlines, options{:}); + end; + end; + + else + for cInd = 1:length(opt.clusters) + [STUDY allerpimage alltimes alltrials tmp events] = std_readersp(STUDY, ALLEEG, 'clusters', opt.clusters(cInd), 'infotype', 'erpim', 'subject', opt.subject, ... + 'concatenate', 'on', 'timerange', opt.timerange, 'design', opt.design); + % get figure title + % ---------------- + locs = eeg_mergelocs(ALLEEG.chanlocs); + locs = locs(std_chaninds(STUDY, opt.channels)); + allconditions = STUDY.design(opt.design).variable(1).value; + allgroups = STUDY.design(opt.design).variable(2).value; + alltitles = std_figtitle('condnames', allconditions, 'cond2names', allgroups, 'clustname', STUDY.cluster(opt.clusters(cInd)).name, ... + 'subject', opt.subject, 'valsunit', 'ms', 'datatype', 'ERPIM'); + + figure; + for iCond = 1:length(allconditions) + for iGroup = 1:length(allgroups) + tmpevents = events{iCond, iGroup}; + if isempty(tmpevents), tmpevents = zeros(1, size(allerpimage{iCond, iGroup},2)); end; + subplot(length(allconditions), length(allgroups), (iCond-1)*length(allgroups) + iGroup); + + % use color scale for last plot + if ~isempty(opt.colorlimits) && iCond == length(allconditions) && iGroup == length(allgroups) + options = { options{:} 'cbar' 'on' }; + end; + erpimage(allerpimage{iCond, iGroup}, tmpevents, alltimes, alltitles{iCond, iGroup}, params.smoothing, params.nlines, options{:}); + end; + end; + end; + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_erpplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_erpplot.m new file mode 100644 index 0000000..0935295 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_erpplot.m @@ -0,0 +1,376 @@ +% std_erpplot() - Command line function to plot STUDY cluster component ERPs. Either +% displays grand mean ERPs for all requested clusters in the same figure, +% with ERPs for different conditions (if any) plotted in different colors. +% Else, displays ERP for each specified cluster in separate figures +% (per condition), each containing the cluster component ERPs plus +% the grand mean cluster ERP (in bold). ERPs can be plotted only if +% component ERPs were computed and saved in the STUDY EEG +% datasets. +% These can be computed during pre-clustering using the gui-based +% function pop_preclust() or the equivalent command line functions +% eeg_createdata() and eeg_preclust(). Called by pop_clustedit(). +% and std_propplot(). +% Usage: +% >> [STUDY] = std_erpplot(STUDY, ALLEEG, key1, val1, key2, val2); +% >> [STUDY erpdata erptimes pgroup pcond pinter] = std_erpplot(STUDY, ALLEEG, ...); +% +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the datasets included +% in the STUDY. A STUDY set ALLEEG is typically created by load_ALLEEG(). +% Optional inputs for channel plotting: +% 'channels' - [numeric vector] specific channel group to plot. By +% default, the grand mean channel ERP is plotted (using the +% same format as for the cluster component means described +% above). Default is to plot all channels. +% 'subject' - [numeric vector] In 'changrp' mode (above), index of +% the subject(s) to plot. Else by default, plot all components +% in the cluster. +% 'plotsubjects' - ['on'|'off'] When 'on', plot ERP of all subjects. +% 'noplot' - ['on'|'off'] When 'on', only return output values. Default +% is 'off'. +% 'topoplotopt' - [cell array] options for topoplot plotting. +% +% Optional inputs for component plotting: +% 'clusters' - [numeric vector|'all'] indices of clusters to plot. +% If no component indices ('comps' below) are given, the average +% ERPs of the requested clusters are plotted in the same figure, +% with ERPs for different conditions (and groups if any) plotted +% in different colors. In 'comps' (below) mode, ERPS for each +% specified cluster are plotted in separate figures (one per +% condition), each overplotting cluster component ERPs plus the +% average cluster ERP in bold. Note this parameter has no effect +% if the 'comps' option (below) is used. {default: 'all'} +% 'comps' - [numeric vector|'all'] indices of the cluster components to plot. +% Note that 'comps', 'all' is equivalent to 'plotsubjects', 'on'. +% +% Other optional inputs: +% 'key','val' - All optional inputs to pop_erpparams() are also accepted here +% to plot subset of time, statistics etc. The values used by default +% are the ones set using pop_erpparams() and stored in the +% STUDY structure. +% +% Outputs: +% STUDY - the input STUDY set structure with plotted cluster mean +% ERPs data to allow quick replotting +% erpdata - [cell] ERP data for each condition, group and subjects. +% size of cell array is [nconds x ngroups]. Size of each element +% is [times x subjects] for data channels or [times x components] +% for component clusters. This array may be gicen as input +% directly to the statcond() function or std_stats function +% to compute statistics. +% erptimes - [array] ERP time point latencies. +% pgroup - [array or cell] p-values group statistics. Output of the +% statcond() function. +% pcond - [array or cell] condition statistics. Output of the statcond() +% function. +% pinter - [array or cell] groups x conditions statistics. Output of +% statcond() function. +% +% Example: +% >> [STUDY] = std_erpplot(STUDY,ALLEEG, 'clusters', 2, 'comps', 'all'); +% % Plot cluster-2 component ERPs plus the mean ERP in bold. +% +% See also pop_clustedit(), pop_preclust(), eeg_createdata(), eeg_preclust(). std_propplot() +% +% Authors: Arnaud Delorme, CERCO, August, 2006- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, erpdata, alltimes, pgroup, pcond, pinter] = std_erpplot(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_erpplot; + return; +end; +erpdata = []; alltimes = []; +pgroup = []; pcond = []; pinter = []; + +% find datatype and default options +% --------------------------------- +dtype = 'erp'; +for ind = 1:2:length(varargin) + if strcmpi(varargin{ind}, 'datatype') + dtype = varargin{ind+1}; + end; +end; + +% get parameters +% -------------- +eval( [ 'tmp = pop_' dtype 'params(STUDY, varargin{:});' ... + 'params = tmp.etc.' dtype 'params; clear tmp;' ] ); +statstruct.etc = STUDY.etc; +statstruct.design = STUDY.design; %added by behnam +statstruct.currentdesign = STUDY.currentdesign; %added by behnam +statstruct = pop_statparams(statstruct, varargin{:}); +stats = statstruct.etc.statistics; +stats.fieldtrip.channelneighbor = struct([]); % asumes one channel or 1 component + +% potentially missing fields +% -------------------------- +fields = { 'filter' 'subtractsubjectmean' 'timerange' 'freqrange' 'topotime' 'topofreq' 'averagechan'}; +defaultval = { [] 'off' [] [] [] [] }; +for ind=1:length(fields) + if ~isfield(params, fields{ind}), + params = setfield(params, fields{ind}, defaultval{ind}); + end; +end; + +% decode parameters +% ----------------- +if isempty(varargin) + tmplocs = eeg_mergelocs(ALLEEG.chanlocs); + options.channels = { tmplocs.labels }; +else + options = mystruct(varargin); +end; +options = myrmfield( options, myfieldnames(params)); +options = myrmfield( options, myfieldnames(stats)); +options = myrmfield( options, { 'threshold' 'statistics' } ); % for backward compatibility +opt = finputcheck( options, ... + { 'design' 'integer' [] STUDY.currentdesign; + 'plotstderr' 'string' [] 'off'; + 'channels' 'cell' [] {}; + 'clusters' 'integer' [] []; + 'datatype' 'string' { 'erp','spec' } 'erp'; + 'mode' 'string' [] ''; % for backward compatibility (now used for statistics) + 'comps' { 'string','integer' } [] []; % for backward compatibility + 'statmode' 'string' { 'subjects','common','trials' } 'subjects'; % ignored + 'plotmode' 'string' { 'normal','condensed' } 'normal'; + 'unitx' 'string' { 'ms','Hz' } 'ms'; + 'plotsubjects' 'string' { 'on','off' } 'off'; + 'noplot' 'string' { 'on','off' } 'off'; + 'topoplotopt' 'cell' {} { 'style' 'both' }; + 'subject' 'string' [] '' }, 'std_erpplot'); +if isstr(opt), error(opt); end; + +if isstr(opt.comps), opt.comps = []; opt.plotsubjects = 'on'; end; +if ~isempty(params.topofreq) && strcmpi(opt.datatype, 'spec'), params.topotime = params.topofreq; end; +if ~isempty(params.freqrange), params.timerange = params.freqrange; end; +datatypestr = upper(opt.datatype); +if strcmpi(datatypestr, 'spec'), datatypestr = 'Spectrum'; end; + +% ======================================================================= +% below this line, all the code should be non-specific to ERP or spectrum +% ======================================================================= + +allconditions = STUDY.design(opt.design).variable(1).value; +allgroups = STUDY.design(opt.design).variable(2).value; +paired = { STUDY.design(opt.design).variable(1).pairing ... + STUDY.design(opt.design).variable(2).pairing }; +stats.paired = paired; + +% for backward compatibility +% -------------------------- +if strcmpi(opt.mode, 'comps'), opt.plotsubjects = 'on'; end; +if strcmpi(stats.singletrials, 'off') && ((~isempty(opt.subject) || ~isempty(opt.comps))) + if strcmpi(stats.condstats, 'on') || strcmpi(stats.groupstats, 'on') + stats.groupstats = 'off'; + stats.condstats = 'off'; + disp('No statistics for single subject/component, to get statistics compute single-trial measures'); + end; +end; + +if ~isnan(params.topotime) & length(opt.channels) < 5 + warndlg2(strvcat('ERP parameters indicate that you wish to plot scalp maps', 'Select at least 5 channels to plot topography')); + return; +end; + +plotcurveopt = {}; +if length(opt.clusters) > 1 + plotcurveopt = { 'figure' 'off' }; + params.plotconditions = 'together'; + params.plotgroups = 'together'; + stats.condstats = 'off'; + stats.groupstats = 'off'; +end; +% if length(opt.channels) > 1 && strcmpi(opt.plotconditions, 'together') && strcmpi(opt.plotgroups, 'together') +% plotcurveopt = { 'figure' 'off' }; +% opt.plotconditions = 'together'; +% opt.plotgroups = 'together'; +% opt.condstats = 'off'; +% opt.groupstats = 'off'; +% end; +alpha = fastif(strcmpi(stats.mode, 'eeglab'), stats.eeglab.alpha, stats.fieldtrip.alpha); +mcorrect = fastif(strcmpi(stats.mode, 'eeglab'), stats.eeglab.mcorrect, stats.fieldtrip.mcorrect); +method = fastif(strcmpi(stats.mode, 'eeglab'), stats.eeglab.method, ['Fieldtrip ' stats.fieldtrip.method ]); +plotcurveopt = { plotcurveopt{:} ... + 'ylim', params.ylim, ... + 'threshold', alpha ... + 'unitx' opt.unitx, ... + 'filter', params.filter, ... + 'plotgroups', params.plotgroups, ... + 'plotconditions', params.plotconditions }; + +% channel plotting +% ---------------- +if ~isempty(opt.channels) + + chaninds = 1:length(opt.channels); + + if strcmpi(opt.datatype, 'erp') + [STUDY erpdata alltimes] = std_readerp(STUDY, ALLEEG, 'channels', opt.channels(chaninds), 'timerange', params.timerange, ... + 'subject', opt.subject, 'singletrials', stats.singletrials, 'design', opt.design); + else + [STUDY erpdata alltimes] = std_readspec(STUDY, ALLEEG, 'channels', opt.channels(chaninds), 'freqrange', params.freqrange, ... + 'rmsubjmean', params.subtractsubjectmean, 'subject', opt.subject, 'singletrials', stats.singletrials, 'design', opt.design); + end; + if strcmpi(params.averagechan, 'on') && length(chaninds) > 1 + for index = 1:length(erpdata(:)) + erpdata{index} = squeeze(mean(erpdata{index},2)); + end; + end; + if isempty(erpdata), return; end; + + % select specific time + % -------------------- + if ~isempty(params.topotime) & ~isnan(params.topotime) + [tmp ti1] = min(abs(alltimes-params.topotime(1))); + [tmp ti2] = min(abs(alltimes-params.topotime(end))); + for condind = 1:length(erpdata(:)) + if ~isempty(erpdata{condind}) + erpdata{condind} = mean(erpdata{condind}(ti1:ti2,:,:),1); + end; + end; + end; + + % compute statistics + % ------------------ + if (isempty(params.topotime) || any(isnan(params.topotime))) && length(alpha) > 1 + alpha = alpha(1); + end; + if ~isempty(params.topotime) && all(~isnan(params.topotime)) + statstruct = std_prepare_neighbors(statstruct, ALLEEG, 'channels', opt.channels); + stats.fieldtrip.channelneighbor = statstruct.etc.statistics.fieldtrip.channelneighbor; + end; + [pcond pgroup pinter] = std_stat(erpdata, stats); + if (~isempty(pcond) && length(pcond{1}) == 1) || (~isempty(pgroup) && length(pgroup{1}) == 1), pcond = {}; pgroup = {}; pinter = {}; end; % single subject STUDY + if length(opt.channels) > 5 && ndims(erpdata{1}) < 3, pcond = {}; pgroup = {}; pinter = {}; end; % topo plotting for single subject + if strcmpi(opt.noplot, 'on') return; end; + + % get titles (not included in std_erspplot because it is not possible + % to merge channels for that function + % ----------------------------------- + locs = eeg_mergelocs(ALLEEG.chanlocs); + locs = locs(std_chaninds(STUDY, opt.channels(chaninds))); + if strcmpi(params.averagechan, 'on') && length(chaninds) > 1 + chanlabels = { locs.labels }; + chanlabels(2,:) = {','}; + chanlabels(2,end) = {''}; + locs(1).labels = [ chanlabels{:} ]; + locs(2:end) = []; + end; + [alltitles alllegends ] = std_figtitle('threshold', alpha, 'mcorrect', mcorrect, 'condstat', stats.condstats, 'cond2stat', stats.groupstats, ... + 'statistics', method, 'condnames', allconditions, 'plotsubjects', opt.plotsubjects, 'cond2names', allgroups, 'chanlabels', { locs.labels }, ... + 'subject', opt.subject, 'valsunit', opt.unitx, 'vals', params.topotime, 'datatype', datatypestr, 'cond2group', params.plotgroups, 'condgroup', params.plotconditions); + + % plot + % ---- + if ~isempty(params.topotime) && all(~isnan(params.topotime)) + std_chantopo(erpdata, 'groupstats', pgroup, 'condstats', pcond, 'interstats', pinter, 'caxis', params.ylim, ... + 'chanlocs', locs, 'threshold', alpha, 'titles', alltitles, 'topoplotopt', opt.topoplotopt); + else + std_plotcurve(alltimes, erpdata, 'groupstats', pgroup, 'legend', alllegends, 'condstats', pcond, 'interstats', pinter, ... + 'chanlocs', locs, 'titles', alltitles, 'plotsubjects', opt.plotsubjects, 'plotstderr', opt.plotstderr, ... + 'condnames', allconditions, 'groupnames', allgroups, plotcurveopt{:}); + end; + + set(gcf,'name',['Channel ' datatypestr ]); + axcopy(gca); +else + % plot component + % -------------- + if length(opt.clusters) > 1, figure('color', 'w'); end; + nc = ceil(sqrt(length(opt.clusters))); + nr = ceil(length(opt.clusters)/nc); + comp_names = {}; + + for index = 1:length(opt.clusters) + + if length(opt.clusters) > 1, subplot(nr,nc,index); end; + if strcmpi(opt.datatype, 'erp') + [STUDY erpdata alltimes] = std_readerp(STUDY, ALLEEG, 'clusters', opt.clusters(index), 'timerange', params.timerange, ... + 'component', opt.comps, 'singletrials', stats.singletrials, 'design', opt.design); + else + [STUDY erpdata alltimes] = std_readspec(STUDY, ALLEEG, 'clusters', opt.clusters(index), 'freqrange', params.freqrange, ... + 'rmsubjmean', params.subtractsubjectmean, 'component', opt.comps, 'singletrials', stats.singletrials, 'design', opt.design); + end; + if isempty(erpdata), return; end; + + % plot specific component + % ----------------------- + if ~isempty(opt.comps) + comp_names = { STUDY.cluster(opt.clusters(index)).comps(opt.comps) }; + opt.subject = STUDY.datasetinfo(STUDY.cluster(opt.clusters(index)).sets(1,opt.comps)).subject; + end; + stats.paired = paired; + [pcond pgroup pinter] = std_stat(erpdata, stats); + if strcmpi(opt.noplot, 'on'), return; end; + + [alltitles alllegends ] = std_figtitle('threshold', alpha, 'plotsubjects', opt.plotsubjects, 'mcorrect', mcorrect, 'condstat', stats.condstats, 'cond2stat', stats.groupstats, ... + 'statistics', method, 'condnames', allconditions, 'cond2names', allgroups, 'clustname', STUDY.cluster(opt.clusters(index)).name, 'compnames', comp_names, ... + 'subject', opt.subject, 'valsunit', opt.unitx, 'vals', params.topotime, 'datatype', datatypestr, 'cond2group', params.plotgroups, 'condgroup', params.plotconditions); + + if length(opt.clusters) > 1 && index < length(opt.clusters), alllegends = {}; end; + std_plotcurve(alltimes, erpdata, 'condnames', allconditions, 'legend', alllegends, 'groupnames', allgroups, 'plotstderr', opt.plotstderr, ... + 'titles', alltitles, 'groupstats', pgroup, 'condstats', pcond, 'interstats', pinter, ... + 'plotsubjects', opt.plotsubjects, plotcurveopt{:}); + end; + + set(gcf,'name', ['Component ' datatypestr ] ); + axcopy(gca); +end; + +% remove fields and ignore fields who are absent +% ---------------------------------------------- +function s = myrmfield(s, f); + +for index = 1:length(f) + if isfield(s, f{index}) + s = rmfield(s, f{index}); + end; +end; + +% convert to structure (but take into account cells) +% -------------------------------------------------- +function s = mystruct(v); + +for index=1:length(v) + if iscell(v{index}) + v{index} = { v{index} }; + end; +end; +try + s = struct(v{:}); +catch, error('Parameter error'); end; + +% convert to structure (but take into account cells) +% -------------------------------------------------- +function s = myfieldnames(v); + +s = fieldnames(v); +if isfield(v, 'eeglab') + s2 = fieldnames(v.eeglab); + s = { s{:} s2{:} }; +end; +if isfield(v, 'fieldtrip') + s3 = fieldnames(v.fieldtrip); + for index=1:length(s3) + s3{index} = [ 'fieldtrip' s3{index} ]; + end; + s = { s{:} s3{:} }; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_ersp.m b/code/eeglab13_4_4b/functions/studyfunc/std_ersp.m new file mode 100644 index 0000000..2949934 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_ersp.m @@ -0,0 +1,437 @@ +% std_ersp() - Compute ERSP and/or ITC transforms for ICA components +% or data channels of a dataset. Save results into Matlab +% float files. +% +% Function description: +% The function computes the mean ERSP or ITC for the selected +% dataset ICA components or data channels in the requested +% frequency range and time window (the two are dependent). +% Frequencies are equally log spaced. Options specify component +% numbers, desired frequency range, time window length, +% frequency resolution, significance level, and wavelet +% cycles. See >> help newtimef and >> timef details +% +% Two Matlab files are saved (for ERSP and ITC). These contain +% the ERSP|ITC image, plus the transform parameters +% used to compute them. Saves the computed dataset mean images +% in dataset-name files with extensions '.icaersp' and '.icaitc' +% for ICA components or '.datersp', '.datitc' for data channels. +% Usage: +% >> [X times logfreqs ] = std_ersp(EEG, 'key', 'val', ...); +% Inputs: +% EEG - a loaded epoched EEG dataset structure. May be an array +% of such structure containing several datasets. +% +% Other inputs: +% 'trialindices' - [cell array] indices of trials for each dataset. +% Default is EMPTY (no trials). NEEDS TO BE SET. +% 'components' - [numeric vector] components of the EEG structure for which +% activation spectrum will be computed. Note that because +% computation of ERP is so fast, all components spectrum are +% computed and saved. Only selected component +% are returned by the function to Matlab +% {default|[] -> all} +% 'channels' - [cell array] channels of the EEG structure for which +% activation spectrum will be computed. Note that because +% computation of ERP is so fast, all channels spectrum are +% computed and saved. Only selected channels +% are returned by the function to Matlab +% {default|[] -> none} +% 'recompute' - ['on'|'off'] force recomputing ERP file even if it is +% already on disk. +% 'recompute' - ['on'|'off'] force recomputing data file even if it is +% already on disk. +% 'rmcomps' - [integer array] remove artifactual components (this entry +% is ignored when plotting components). This entry contains +% the indices of the components to be removed. Default is none. +% 'interp' - [struct] channel location structure containing electrode +% to interpolate ((this entry is ignored when plotting +% components). Default is no interpolation. +% 'fileout' - [string] name of the file to save on disk. The default +% is the same name (with a different extension) as the +% dataset given as input. +% 'savetrials' - ['on'|'off'] save single-trials ERSP. Requires a lot of disk +% space (dataset space on disk times 10) but allow for refined +% single-trial statistics. +% 'savefile' - ['on'|'off'] save file or simply return measures. +% Default is to save files ('on'). +% 'getparams' - ['on'|'off'] return optional parameters for the newtimef +% function (and do not compute anything). This argument is +% obsolete (default is 'off'). +% +% ERSP optional inputs: +% 'type' - ['ersp'|'itc'|'ersp&itc'] save ERSP, ITC, or both data +% types to disk {default: 'ersp'} +% 'freqs' - [minHz maxHz] the ERSP/ITC frequency range to compute +% and return. {default: 3 to EEG sampling rate divided by 3} +% 'timelimits' - [minms maxms] time window (in ms) to compute. +% {default: whole input epoch}. +% 'cycles' - [wavecycles (factor)]. If 0 -> DFT (constant window length +% across frequencies). +% If >0 -> the number of cycles in each analysis wavelet. +% If [wavecycles factor], wavelet cycles increase with +% frequency, beginning at wavecyles. (0 < factor < 1) +% factor = 0 -> fixed epoch length (DFT, as in FFT). +% factor = 1 -> no increase (standard wavelets) +% {default: [0]} +% 'padratio' - (power of 2). Multiply the number of output frequencies +% by dividing their frequency spacing through 0-padding. +% Output frequency spacing is (low_freq/padratio). +% 'alpha' - If in (0, 1), compute two-tailed permutation-based +% probability thresholds and use these to mask the output +% ERSP/ITC images {default: NaN} +% 'powbase' - [ncomps,nfreqs] optional input matrix giving baseline power +% spectra (not dB power, see >> help timef). +% For use in repeated calls to timef() using the same baseine +% {default|[] -> none; data windows centered before 0 latency} +% +% Other optional inputs: +% This function will take any of the newtimef() optional inputs (for instance +% to compute log-space frequencies)... +% +% Outputs: +% X - the masked log ERSP/ITC of the requested ICA components/channels +% in the selected frequency and time range. Note that for +% optimization reasons, this parameter is now empty or 0. X +% thus must be read from the datafile saved on disk. +% times - vector of time points for which the ERSPs/ITCs were computed. +% logfreqs - vector of (equally log spaced) frequencies (in Hz) at which the +% log ERSP/ITC was evaluated. +% parameters - parameters given as input to the newtimef function. +% +% Files written or modified: +% [dataset_filename].icaersp <-- saved component ERSPs +% [dataset_filename].icaitc <-- saved component ITCs +% [dataset_filename].icatimef <-- saved component single +% trial decompositions. +% OR for channels +% [dataset_filename].datersp <-- saved channel ERSPs +% [dataset_filename].datitc <-- saved channel ITCs +% [dataset_filename].dattimef <-- saved channel single +% trial decompositions. +% Example: +% % Create mean ERSP and ITC images on disk for all comps from +% % dataset EEG use three-cycle wavelets (at 3 Hz) to more than +% % three-cycle wavelets at 50 Hz. See >> help newtimef +% % Return the (equally log-freq spaced, probability-masked) ERSP. +% >> [Xersp, times, logfreqs] = std_ersp(EEG, ... +% 'type', 'ersp', 'freqs', [3 50], 'cycles', [3 0.5]); +% +% See also: timef(), std_itc(), std_erp(), std_spec(), std_topo(), std_preclust() +% +% Authors: Arnaud Delorme, Hilit Serby, SCCN, INC, UCSD, January, 2005- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [X, times, logfreqs, parameters] = std_ersp(EEG, varargin) + +if nargin < 1 + help std_ersp; + return; +end; + +X = []; +options = {}; +if length(varargin) > 1 + if ~isstr(varargin{1}) + if length(varargin) > 0, options = { options{:} 'components' varargin{1} }; end; + if length(varargin) > 1, options = { options{:} 'freqs' varargin{2} }; end; + if length(varargin) > 2, options = { options{:} 'timewindow' varargin{3} }; end; + if length(varargin) > 3, options = { options{:} 'cycles' varargin{4} }; end; + if length(varargin) > 4, options = { options{:} 'padratio' varargin{5} }; end; + if length(varargin) > 5, options = { options{:} 'alpha' varargin{6} }; end; + if length(varargin) > 6, options = { options{:} 'type' varargin{7} }; end; + if length(varargin) > 7, options = { options{:} 'powbase' varargin{8} }; end; + else + options = varargin; + end; +end; + +[g timefargs] = finputcheck(options, { ... + 'components' 'integer' [] []; + 'channels' { 'cell','integer' } { [] [] } {}; + 'powbase' 'real' [] []; + 'trialindices' { 'integer','cell' } [] []; + 'savetrials' 'string' { 'on','off' } 'off'; + 'plot' 'string' { 'on','off' } 'off'; % not documented for debugging purpose + 'recompute' 'string' { 'on','off' } 'off'; + 'getparams' 'string' { 'on','off' } 'off'; + 'savefile' 'string' { 'on','off' } 'on'; + 'timewindow' 'real' [] []; % ignored, deprecated + 'fileout' 'string' [] ''; + 'timelimits' 'real' [] [EEG(1).xmin EEG(1).xmax]*1000; + 'cycles' 'real' [] [3 .5]; + 'padratio' 'real' [] 1; + 'freqs' 'real' [] [0 EEG(1).srate/2]; + 'rmcomps' 'cell' [] cell(1,length(EEG)); + 'interp' 'struct' { } struct([]); + 'freqscale' 'string' [] 'log'; + 'alpha' 'real' [] NaN; + 'type' 'string' { 'ersp','itc','both','ersp&itc' } 'both'}, 'std_ersp', 'ignore'); +if isstr(g), error(g); end; +if isempty(g.trialindices), g.trialindices = cell(length(EEG)); end; +if ~iscell(g.trialindices), g.trialindices = { g.trialindices }; end; + +% checking input parameters +% ------------------------- +if isempty(g.components) & isempty(g.channels) + if isempty(EEG(1).icaweights) + error('EEG.icaweights not found'); + end + g.components = 1:size(EEG(1).icaweights,1); + disp('Computing ERSP with default values for all components of the dataset'); +end + +% select ICA components or data channels +% -------------------------------------- +if isempty(g.fileout), g.fileout = fullfile(EEG(1).filepath, EEG(1).filename(1:end-4)); end; +if ~isempty(g.components) + g.indices = g.components; + prefix = 'comp'; + filenameersp = [ g.fileout '.icaersp' ]; + filenameitc = [ g.fileout '.icaitc' ]; + filenametrials = [ g.fileout '.icatimef' ]; + if ~isempty(g.channels) + error('Cannot compute ERSP/ITC for components and channels at the same time'); + end; +elseif ~isempty(g.channels) + if iscell(g.channels) + if ~isempty(g.interp) + g.indices = eeg_chaninds(g.interp, g.channels, 0); + else + g.indices = eeg_chaninds(EEG(1), g.channels, 0); + for ind = 2:length(EEG) + if ~isequal(eeg_chaninds(EEG(ind), g.channels, 0), g.indices) + error([ 'Channel information must be consistant when ' 10 'several datasets are merged for a specific design' ]); + end; + end; + end; + else + g.indices = g.channels; + end; + prefix = 'chan'; + filenameersp = [ g.fileout '.datersp' ]; + filenameitc = [ g.fileout '.datitc' ]; + filenametrials = [ g.fileout '.dattimef' ]; +end; + +powbaseexist = 1; % used also later +if isempty(g.powbase) | isnan(g.powbase) + powbaseexist = 0; + g.powbase = NaN*ones(length(g.indices),1); % default for timef() +end; +if size(g.powbase,1) ~= length(g.indices) + error('powbase should be of size (ncomps,nfreqs)'); +end + +% Check if ERSP/ITC information found in datasets and if fits requested parameters +% ---------------------------------------------------------------------------- +if exist( filenameersp ) & strcmpi(g.recompute, 'off') + fprintf('Use existing file for ERSP: %s\n', filenameersp); + return; +end; +% tmpersp = load( '-mat', filenameersp, 'parameters'); % AND IT SHOULD BE USED HERE TOO - ARNO +% params = struct(tmpersp.parameters{:}); +% if ~isequal(params.cycles, g.cycles) ... +% | (g.padratio ~= params.padratio) ... +% | ( (g.alpha~= params.alpha) & ~( isnan(g.alpha) & isnan(params.alpha)) ) +% % if not computed with the requested parameters, recompute ERSP/ITC +% % i.e., continue +% else +% disp('File ERSP/ITC data already present, computed with the same parameters: no need to recompute...'); +% return; % no need to compute ERSP/ITC +% end +%end; + +% Compute ERSP parameters +% ----------------------- +parameters = { 'cycles', g.cycles, 'padratio', g.padratio, ... + 'alpha', g.alpha, 'freqscale', g.freqscale, timefargs{:} }; +defaultlowfreq = 3; +[time_range] = compute_ersp_times(g.cycles, EEG(1).srate, ... + [EEG(1).xmin EEG(1).xmax]*1000 , defaultlowfreq, g.padratio); +if time_range(1) < time_range(2) && g.freqs(1) == 0 + g.freqs(1) = defaultlowfreq; % for backward compatibility +end +parameters = { parameters{:} 'freqs' g.freqs }; +if strcmpi(g.plot, 'off') + parameters = { parameters{:} 'plotersp', 'off', 'plotitc', 'off', 'plotphase', 'off' }; +end; +if powbaseexist & time_range(1) >= 0 + parameters{end+1} = 'baseboot'; + parameters{end+1} = 0; + fprintf('No pre-0 baseline spectral estimates: Using whole epoch for timef() "baseboot"\n'); +end + +% return parameters +% ----------------- +if strcmpi(g.getparams, 'on') + X = []; times = []; logfreqs = []; + if strcmpi(g.savetrials, 'on') + parameters = { parameters{:} 'savetrials', g.savetrials }; + end; + return; +end; + +% No usable ERSP/ITC information available +% --------------------------------- +% tmpdata = []; +% for index = 1:length(EEG) +% if isstr(EEG(index).data) +% TMP = eeg_checkset( EEG(index), 'loaddata' ); % load EEG.data and EEG.icaact +% else +% TMP = EEG; +% end +% if ~isempty(g.components) +% if isempty(TMP.icaact) % make icaact if necessary +% TMP.icaact = (TMP.icaweights*TMP.icasphere)* ... +% reshape(TMP.data(TMP.icachansind,:,:), [ length(TMP.icachansind) size(TMP.data,2)*size(TMP.data,3) ]); +% end; +% tmpdata = reshape(TMP.icaact, [ size(TMP.icaact,1) size(TMP.data,2) size(TMP.data,3) ]); +% tmpdata = tmpdata(g.indices, :,:); +% else +% if isempty(tmpdata) +% tmpdata = TMP.data(g.indices,:,:); +% else +% tmpdata(:,:,end+1:end+size(TMP.data,3)) = TMP.data(g.indices,:,:); +% end; +% end; +% end; + +options = {}; +if ~isempty(g.rmcomps), options = { options{:} 'rmcomps' g.rmcomps }; end; +if ~isempty(g.interp), options = { options{:} 'interp' g.interp }; end; +if isempty(g.channels) + X = eeg_getdatact(EEG, 'component', g.indices, 'trialindices', g.trialindices ); +else X = eeg_getdatact(EEG, 'channel' , g.indices, 'trialindices', g.trialindices, 'rmcomps', g.rmcomps, 'interp', g.interp); +end; + +% frame range +% ----------- +pointrange1 = round(max((g.timelimits(1)/1000-EEG(1).xmin)*EEG(1).srate, 1)); +pointrange2 = round(min(((g.timelimits(2)+1000/EEG(1).srate)/1000-EEG(1).xmin)*EEG(1).srate, EEG(1).pnts)); +pointrange = [pointrange1:pointrange2]; + +% Compute ERSP & ITC +% ------------------ +all_ersp = []; +all_trials = []; +all_itc = []; +for k = 1:length(g.indices) % for each (specified) component + if k>size(X,1), break; end; % happens for components + if powbaseexist + tmpparams = parameters; + tmpparams{end+1} = 'powbase'; + tmpparams{end+1} = g.powbase(k,:); + else + tmpparams = parameters; + end; + + % Run timef() to get ERSP + % ------------------------ + timefdata = reshape(X(k,pointrange,:), 1, length(pointrange)*size(X,3)); + if strcmpi(g.plot, 'on'), figure; end; + flagEmpty = 0; + if isempty(timefdata) + flagEmpty = 1; + timefdata = rand(1,length(pointrange)); + end; + [logersp,logitc,logbase,times,logfreqs,logeboot,logiboot,alltfX] ... + = newtimef( timefdata, length(pointrange), g.timelimits, EEG(1).srate, tmpparams{2:end}); + %figure; newtimef( TMP.data(32,:), EEG.pnts, [EEG.xmin EEG.xmax]*1000, EEG.srate, cycles, 'freqs', freqs); + %figure; newtimef( timefdata, length(pointrange), g.timelimits, EEG.srate, cycles, 'freqs', freqs); + if flagEmpty + logersp = []; + logitc = []; + logbase = []; + logeboot = []; + logiboot = []; + alltfX = []; + end; + if strcmpi(g.plot, 'on'), return; end; + + all_ersp = setfield( all_ersp, [ prefix int2str(g.indices(k)) '_ersp' ], single(logersp )); + all_ersp = setfield( all_ersp, [ prefix int2str(g.indices(k)) '_erspbase' ], single(logbase )); + all_ersp = setfield( all_ersp, [ prefix int2str(g.indices(k)) '_erspboot' ], single(logeboot)); + all_itc = setfield( all_itc , [ prefix int2str(g.indices(k)) '_itc' ], single(logitc )); + all_itc = setfield( all_itc , [ prefix int2str(g.indices(k)) '_itcboot' ], single(logiboot)); + + if strcmpi(g.savetrials, 'on') + all_trials = setfield( all_trials, [ prefix int2str(g.indices(k)) '_timef' ], single( alltfX )); + end; +end +X = logersp; + +% Save ERSP into file +% ------------------- +all_ersp.freqs = logfreqs; +all_ersp.times = times; +all_ersp.datatype = 'ERSP'; +all_ersp.datafiles = computeFullFileName( { EEG.filepath }, { EEG.filename }); +all_ersp.datatrials = g.trialindices; + +all_itc.freqs = logfreqs; +all_itc.times = times; +all_itc.parameters = parameters; +all_itc.datatype = 'ITC'; +all_itc.datafiles = computeFullFileName( { EEG.filepath }, { EEG.filename }); +all_itc.datatrials = g.trialindices; + +all_trials.freqs = logfreqs; +all_trials.times = times; +all_trials.parameters = { options{:} parameters{:} }; +all_trials.datatype = 'TIMEF'; +all_trials.datafiles = computeFullFileName( { EEG.filepath }, { EEG.filename }); +all_trials.datatrials = g.trialindices; + +if powbaseexist + all_ersp.parameters = { parameters{:}, 'baseline', g.powbase }; +else + all_ersp.parameters = parameters; +end; +if ~isempty(g.channels) + if ~isempty(g.interp) + all_ersp.chanlabels = { g.interp(g.indices).labels }; + all_itc.chanlabels = { g.interp(g.indices).labels }; + all_trials.chanlabels = { g.interp(g.indices).labels }; + elseif ~isempty(EEG(1).chanlocs) + tmpchanlocs = EEG(1).chanlocs; + all_ersp.chanlabels = { tmpchanlocs(g.indices).labels }; + all_itc.chanlabels = { tmpchanlocs(g.indices).labels }; + all_trials.chanlabels = { tmpchanlocs(g.indices).labels }; + end; +end; + +if strcmpi(g.savefile, 'on') + if strcmpi(g.type, 'both') | strcmpi(g.type, 'ersp') | strcmpi(g.type, 'ersp&itc') + std_savedat( filenameersp, all_ersp); + end; + if strcmpi(g.type, 'both') | strcmpi(g.type, 'itc') | strcmpi(g.type, 'ersp&itc') + std_savedat( filenameitc , all_itc ); + end; + if strcmpi(g.savetrials, 'on') + std_savedat( filenametrials , all_trials ); + end; +end; + +% compute full file names +% ----------------------- +function res = computeFullFileName(filePaths, fileNames); +for index = 1:length(fileNames) + res{index} = fullfile(filePaths{index}, fileNames{index}); +end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_erspplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_erspplot.m new file mode 100644 index 0000000..18ae846 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_erspplot.m @@ -0,0 +1,395 @@ +% std_erspplot() - plot STUDY cluster ERSPs. Displays either mean cluster ERSPs, +% or else all cluster component ERSPs plus the mean cluster +% ERSP in one figure per condition. The ERSPs can be plotted +% only if component ERSPs were computed and saved in the +% EEG datasets in the STUDY. These may either be computed +% during pre-clustering using the gui-based function +% pop_preclust(), or via the equivalent commandline functions +% eeg_createdata() and eeg_preclust(). Called by pop_clustedit(). +% Usage: +% >> [STUDY] = std_erspplot(STUDY, ALLEEG, key1, val1, key2, val2); +% >> [STUDY erspdata ersptimes erspfreqs pgroup pcond pinter] = ... +% std_erspplot(STUDY, ALLEEG ...); +% +% Inputs: +% STUDY - STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global vector of EEG structures for the datasets included +% in the STUDY. ALLEEG for a STUDY set is typically created +% using load_ALLEEG(). +% either 'channels' or 'cluster' inputs are also mandatory. +% +% Optional inputs for channel plotting: +% 'channels' - [numeric vector] specific channel group to plot. By +% default, the grand mean channel ERSP is plotted (using the +% same format as for the cluster component means described above) +% 'subject' - [numeric vector] In 'changrp' mode (above), index of +% the subject(s) to plot. Else by default, plot all components +% in the cluster. +% 'plotsubjects' - ['on'|'off'] When 'on', plot ERSP of all subjects. +% 'noplot' - ['on'|'off'] When 'on', only return output values. Default +% is 'off'. +% +% Optional inputs: +% 'clusters' - [numeric vector|'all'] indices of clusters to plot. +% If no component indices ('comps' below) are given, the average +% ERSPs of the requested clusters are plotted in the same figure, +% with ERSPs for different conditions (and groups if any) plotted +% in different colors. In 'comps' (below) mode, ERSP for each +% specified cluster are plotted in separate figures (one per +% condition), each overplotting cluster component ERSP plus the +% average cluster ERSP in bold. Note this parameter has no effect +% if the 'comps' option (below) is used. {default: 'all'} +% 'comps' - [numeric vector|'all'] indices of the cluster components to plot. +% Note that 'comps', 'all' is equivalent to 'plotsubjects', 'on'. +% +% Other optional inputs: +% 'plotmode' - ['normal'|'condensed'|'none'] 'normal' -> plot in a new figure; +% 'condensed' -> plot all curves in the current figure in a +% condensed fashion. 'none' toggles off plotting {default: 'normal'} +% 'key','val' - All optional inputs to pop_specparams() are also accepted here +% to plot subset of time, statistics etc. The values used by default +% are the ones set using pop_specparams() and stored in the +% STUDY structure. +% Output: +% STUDY - the input STUDY set structure with the plotted cluster +% mean ERSPs added to allow quick replotting +% erspdata - [cell] ERSP data for each condition, group and subjects. +% size of cell array is [nconds x ngroups]. Size of each element +% is [freqs x times x subjects] for data channels or +% [freqs x times x components] for component clusters. This +% array may be gicen as input directly to the statcond() f +% unction or std_stats() function to compute statistics. +% ersptimes - [array] ERSP time point latencies. +% erspfreqs - [array] ERSP point frequency values. +% pgroup - [array or cell] p-values group statistics. Output of the +% statcond() function. +% pcond - [array or cell] condition statistics. Output of the statcond() +% function. +% pinter - [array or cell] groups x conditions statistics. Output of +% statcond() function. +% +% Example: +% >> [STUDY] = std_erspplot(STUDY,ALLEEG, 'clusters', 'all', ... +% 'mode', 'together'); +% % Plot the mean ERSPs of all clusters in STUDY together +% % on the same figure. +% +% Known limitations: when plotting multiple clusters, the output +% contains the last plotted cluster. +% +% See also: pop_clustedit(), pop_preclust(), eeg_createdata(), eeg_preclust(), pop_clustedit() +% +% Authors: Arnaud Delorme, CERCO, August, 2006 + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, allersp, alltimes, allfreqs, pgroup, pcond, pinter events] = std_erspplot(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_erspstatplot; + return; +end; + +% find datatype and default options +% --------------------------------- +dtype = 'ersp'; +for ind = 1:2:length(varargin) + if strcmpi(varargin{ind}, 'datatype') + dtype = varargin{ind+1}; + end; +end; +if strcmpi(dtype, 'erpim') + STUDY = pop_erpimparams(STUDY, varargin{:}); + params = STUDY.etc.erpimparams; +else STUDY = pop_erspparams( STUDY, varargin{:}); + params = STUDY.etc.erspparams; +end; + +% get parameters +% -------------- +statstruct.etc = STUDY.etc; +statstruct.design = STUDY.design; %added by behnam +statstruct.currentdesign = STUDY.currentdesign; %added by behnam +statstruct = pop_statparams(statstruct, varargin{:}); +stats = statstruct.etc.statistics; +stats.fieldtrip.channelneighbor = struct([]); % asumes one channel or 1 component + +% potentially missing fields +% -------------------------- +fields = { 'freqrange' []; + 'topofreq' []; + 'topotrial' []; + 'singletrials' 'off' + 'trialrange' [] + 'concatenate' 'off'; + 'colorlimits' []; + 'ersplim' []; + 'itclim' []; + 'maskdata' 'off'; + 'subbaseline' 'off' }; +for ind=1:size(fields,1) + if ~isfield(params, fields{ind,1}), + params = setfield(params, fields{ind,1}, fields{ind,2}); + end; +end; + +% decode input parameters +% ----------------------- +options = mystruct(varargin); +options = myrmfield( options, myfieldnames(params)); +options = myrmfield( options, myfieldnames(stats)); +options = myrmfield( options, { 'threshold' 'statistics' } ); % for backward compatibility +[ opt moreparams ] = finputcheck( options, { ... + 'design' 'integer' [] STUDY.currentdesign; + 'caxis' 'real' [] []; + 'statmode' 'string' [] ''; % deprecated + 'channels' 'cell' [] {}; + 'clusters' 'integer' [] []; + 'datatype' 'string' { 'itc','ersp','pac' 'erpim' } 'ersp'; + 'plottf' 'real' [] []; + 'mode' 'string' [] ''; % for backward compatibility (now used for statistics) + 'comps' {'integer','string'} [] []; % for backward compatibility + 'plotsubjects' 'string' { 'on','off' } 'off'; + 'noplot' 'string' { 'on','off' } 'off'; + 'plotmode' 'string' { 'normal','condensed','none' } 'normal'; + 'subject' 'string' [] '' }, ... + 'std_erspstatplot', 'ignore'); +if isstr(opt), error(opt); end; +if strcmpi(opt.noplot, 'on'), opt.plotmode = 'none'; end; +if isempty(opt.caxis), + if strcmpi(opt.datatype, 'ersp') + opt.caxis = params.ersplim; + elseif strcmpi(opt.datatype, 'itc') && ~isempty(params.itclim) + opt.caxis = [-params.itclim(end) params.itclim(end)]; + end; +end; + +allconditions = STUDY.design(opt.design).variable(1).value; +allgroups = STUDY.design(opt.design).variable(2).value; +paired = { STUDY.design(opt.design).variable(1).pairing ... + STUDY.design(opt.design).variable(2).pairing }; +stats.paired = paired; + +% for backward compatibility +% -------------------------- +if strcmpi(opt.datatype, 'erpim'), + params.topofreq = params.topotrial; + opt.caxis = params.colorlimits; + valunit = 'trials'; +else + valunit = 'Hz'; +end; +if isempty(opt.plottf) && ~isempty(params.topofreq) && ~isempty(params.topotime) && ~isnan(params.topofreq(1)) && ~isnan(params.topotime(1)) + params.plottf = [ params.topofreq(1) params.topofreq(end) params.topotime(1) params.topotime(end) ]; +else params.plottf = opt.plottf; +end; +%if strcmpi(opt.mode, 'comps'), opt.plotsubjects = 'on'; end; %deprecated +if strcmpi(stats.singletrials, 'off') && ((~isempty(opt.subject) || ~isempty(opt.comps))) + if strcmpi(stats.condstats, 'on') || strcmpi(stats.groupstats, 'on') + stats.groupstats = 'off'; + stats.condstats = 'off'; + disp('No statistics for single subject/component'); + end; +end; + +if length(opt.comps) == 1 + stats.condstats = 'off'; stats.groupstats = 'off'; + disp('Statistics cannot be computed for single component'); +end; + +alpha = fastif(strcmpi(stats.mode, 'eeglab'), stats.eeglab.alpha, stats.fieldtrip.alpha); +mcorrect = fastif(strcmpi(stats.mode, 'eeglab'), stats.eeglab.mcorrect, stats.fieldtrip.mcorrect); +method = fastif(strcmpi(stats.mode, 'eeglab'), stats.eeglab.method, ['Fieldtrip ' stats.fieldtrip.method ]); +plottfopt = { ... + 'ersplim', opt.caxis, ... + 'threshold', alpha, ... + 'maskdata', params.maskdata }; +if ~isempty(params.plottf) && length(opt.channels) < 5 + warndlg2(strvcat('ERSP/ITC parameters indicate that you wish to plot scalp maps', 'Select at least 5 channels to plot topography')); + return; +end; + +% plot single scalp map +% --------------------- +if ~isempty(opt.channels) + + [STUDY allersp alltimes allfreqs tmp events unitPower] = std_readersp(STUDY, ALLEEG, 'channels', opt.channels, 'infotype', opt.datatype, 'subject', opt.subject, ... + 'singletrials', stats.singletrials, 'subbaseline', params.subbaseline, 'timerange', params.timerange, 'freqrange', params.freqrange, 'design', opt.design, 'concatenate', params.concatenate); + + % select specific time and freq + % ----------------------------- + if ~isempty(params.plottf) + if length(params.plottf) < 3, + params.plottf(3:4) = params.plottf(2); + params.plottf(2) = params.plottf(1); + end; + [tmp fi1] = min(abs(allfreqs-params.plottf(1))); + [tmp fi2] = min(abs(allfreqs-params.plottf(2))); + [tmp ti1] = min(abs(alltimes-params.plottf(3))); + [tmp ti2] = min(abs(alltimes-params.plottf(4))); + for index = 1:length(allersp(:)) + allersp{index} = mean(mean(allersp{index}(fi1:fi2,ti1:ti2,:,:),1),2); + allersp{index} = reshape(allersp{index}, [1 size(allersp{index},3) size(allersp{index},4) ]); + end; + + % prepare channel neighbor matrix for Fieldtrip + statstruct = std_prepare_neighbors(statstruct, ALLEEG, 'channels', opt.channels); + stats.fieldtrip.channelneighbor = statstruct.etc.statistics.fieldtrip.channelneighbor; + + params.plottf = { params.plottf(1:2) params.plottf(3:4) }; + [pcond pgroup pinter] = std_stat(allersp, stats); + if (~isempty(pcond) && length(pcond{1}) == 1) || (~isempty(pgroup) && length(pgroup{1}) == 1), pcond = {}; pgroup = {}; pinter = {}; end; % single subject STUDY + else + [pcond pgroup pinter] = std_stat(allersp, stats); + if (~isempty(pcond ) && (size( pcond{1},1) == 1 || size( pcond{1},2) == 1)) || ... + (~isempty(pgroup) && (size(pgroup{1},1) == 1 || size(pgroup{1},2) == 1)), + pcond = {}; pgroup = {}; pinter = {}; + disp('No statistics possible for single subject STUDY'); + end; % single subject STUDY + end + + % plot specific channel(s) + % ------------------------ + if ~strcmpi(opt.plotmode, 'none') + locs = eeg_mergelocs(ALLEEG.chanlocs); + locs = locs(std_chaninds(STUDY, opt.channels)); + + if ~isempty(params.plottf) + alltitles = std_figtitle('threshold', alpha, 'mcorrect', mcorrect, 'condstat', stats.condstats, 'cond2stat', stats.groupstats, ... + 'statistics', method, 'condnames', allconditions, 'cond2names', allgroups, 'chanlabels', { locs.labels }, ... + 'subject', opt.subject, 'valsunit', { valunit 'ms' }, 'vals', params.plottf, 'datatype', upper(opt.datatype)); + std_chantopo(allersp, 'groupstats', pgroup, 'condstats', pcond, 'interstats', pinter, 'caxis', opt.caxis, ... + 'chanlocs', locs, 'threshold', alpha, 'titles', alltitles); + else + if length(opt.channels) > 1 & ~strcmpi(opt.plotmode, 'none'), figure; opt.plotmode = 'condensed'; end; + nc = ceil(sqrt(length(opt.channels))); + nr = ceil(length(opt.channels)/nc); + for index = 1:max(cellfun(@(x)(size(x,3)), allersp(:))) + if length(opt.channels) > 1, try, subplot(nr,nc,index, 'align'); catch, subplot(nr,nc,index); end; end; + tmpersp = cell(size(allersp)); + for ind = 1:length(allersp(:)) + if ~isempty(allersp{ind}) + tmpersp{ind} = squeeze(allersp{ind}(:,:,index,:)); + end; + end; + alltitles = std_figtitle('threshold', alpha, 'mcorrect', mcorrect, 'condstat', stats.condstats, 'cond2stat', stats.groupstats, ... + 'statistics', method, 'condnames', allconditions, 'cond2names', allgroups, 'chanlabels', { locs(index).labels }, ... + 'subject', opt.subject, 'datatype', upper(opt.datatype), 'plotmode', opt.plotmode); + std_plottf(alltimes, allfreqs, tmpersp, 'datatype', opt.datatype, 'titles', alltitles, ... + 'groupstats', pgroup, 'condstats', pcond, 'interstats', pinter, 'plotmode', ... + opt.plotmode, 'unitcolor', unitPower, 'chanlocs', ALLEEG(1).chanlocs, 'events', events, plottfopt{:}); + end; + end; + end; +else + + if length(opt.clusters) > 1 & ~strcmpi(opt.plotmode, 'none'), figure; opt.plotmode = 'condensed'; end; + nc = ceil(sqrt(length(opt.clusters))); + nr = ceil(length(opt.clusters)/nc); + comp_names = {}; + + if length(opt.clusters) > 1 && ( strcmpi(stats.condstats, 'on') || strcmpi(stats.groupstats, 'on')) + stats.condstats = 'off'; stats.groupstats = 'off'; + end; + + for index = 1:length(opt.clusters) + + [STUDY allersp alltimes allfreqs tmp events unitPower] = std_readersp(STUDY, ALLEEG, 'clusters', opt.clusters(index), 'infotype', opt.datatype, ... + 'component', opt.comps, 'singletrials', stats.singletrials, 'subbaseline', params.subbaseline, 'timerange', params.timerange, 'freqrange', params.freqrange, 'design', opt.design, 'concatenate', params.concatenate); + if length(opt.clusters) > 1, try, subplot(nr,nc,index, 'align'); catch, subplot(nr,nc,index); end; end; + + % plot specific component + % ----------------------- + if ~isempty(opt.comps) + comp_names = { STUDY.cluster(opt.clusters(index)).comps(opt.comps) }; + opt.subject = STUDY.datasetinfo(STUDY.cluster(opt.clusters(index)).sets(1,opt.comps)).subject; + end; + + % select specific time and freq + % ----------------------------- + if ~isempty(params.plottf) + if length(params.plottf) < 3, + params.plottf(3:4) = params.plottf(2); + params.plottf(2) = params.plottf(1); + end; + [tmp fi1] = min(abs(allfreqs-params.plottf(1))); + [tmp fi2] = min(abs(allfreqs-params.plottf(2))); + [tmp ti1] = min(abs(alltimes-params.plottf(3))); + [tmp ti2] = min(abs(alltimes-params.plottf(4))); + for index = 1:length(allersp(:)) + allersp{index} = mean(mean(allersp{index}(fi1:fi2,ti1:ti2,:,:),1),2); + allersp{index} = reshape(allersp{index}, [1 size(allersp{index},3) size(allersp{index},4) ]); + end; + end + + [pcond pgroup pinter] = std_stat(allersp, stats); + + % plot specific component + % ----------------------- + if index == length(opt.clusters), opt.legend = 'on'; end; + if ~strcmpi(opt.plotmode, 'none') + alltitles = std_figtitle('threshold', alpha, 'mcorrect', mcorrect, 'condstat', stats.condstats, 'cond2stat', stats.groupstats, ... + 'statistics', method, 'condnames', allconditions, 'cond2names', allgroups, 'clustname', STUDY.cluster(opt.clusters(index)).name, 'compnames', comp_names, ... + 'subject', opt.subject, 'datatype', upper(opt.datatype), 'plotmode', opt.plotmode); + + std_plottf(alltimes, allfreqs, allersp, 'datatype', opt.datatype, ... + 'groupstats', pgroup, 'condstats', pcond, 'interstats', pinter, 'plotmode', ... + opt.plotmode, 'titles', alltitles, ... + 'events', events, 'unitcolor', unitPower, 'chanlocs', ALLEEG(1).chanlocs, plottfopt{:}); + end; + end; +end; + +% remove fields and ignore fields who are absent +% ---------------------------------------------- +function s = myrmfield(s, f); + +for index = 1:length(f) + if isfield(s, f{index}) + s = rmfield(s, f{index}); + end; +end; + +% convert to structure (but take into account cells) +% -------------------------------------------------- +function s = mystruct(v); + +for index=1:length(v) + if iscell(v{index}) + v{index} = { v{index} }; + end; +end; +try + s = struct(v{:}); +catch, error('Parameter error'); end; + +% convert to structure (but take into account cells) +% -------------------------------------------------- +function s = myfieldnames(v); + +s = fieldnames(v); +if isfield(v, 'eeglab') + s2 = fieldnames(v.eeglab); + s = { s{:} s2{:} }; +end; +if isfield(v, 'fieldtrip') + s3 = fieldnames(v.fieldtrip); + for index=1:length(s3) + s3{index} = [ 'fieldtrip' s3{index} ]; + end; + s = { s{:} s3{:} }; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_figtitle.m b/code/eeglab13_4_4b/functions/studyfunc/std_figtitle.m new file mode 100644 index 0000000..80afcc0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_figtitle.m @@ -0,0 +1,278 @@ +% std_figtitle() - Generate plotting figure titles in a cell array +% +% Usage: +% >> celltxt = std_figtitle(key1, val1, key2, val2); +% +% Inputs: +% 'subject' - [string] Subject name +% 'datatype' - [string] data type (For example 'erp') +% 'chanlabels' - [cell array or string] channel names +% 'compnames' - [cell array or string] component names +% 'condnames' - [cell array] names of conditions +% 'cond2names' - [cell array] names of conditions +% 'vals' - [cell array or real array] value for plot panel (for +% example, 0 ms) +% 'valsunit' - [cell array or string] unit value (i.e. ms) +% +% Optional statistical titles: +% 'condstat' - ['on'|'off'] default is 'off' +% 'cond2stat' - ['on'|'off'] default is 'off' +% 'mcorrect' - [string] correction for multiple comparisons. Default is +% empty. +% 'statistics' - [string] type of statictics +% 'threshold' - [real] treshold value +% +% Optional grouping: +% 'condgroup' - ['on'|'off'] group conditions together default is 'off' +% 'cond2group' - ['on'|'off'] default is 'off' +% +% Outputs: +% celltxt - cell array of text string, one for each set of condition +% +% Example: +% std_figtitle('subject', 'toto', 'condnames', { 'test1' 'test2' }, ... +% 'vals' , { [100] [4] }, 'valsunit', { 'ms' 'Hz' }) +% +% Authors: Arnaud Delorme, SCCN/UCSD, Feb 2010 + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [all_titles alllegends ] = std_figtitle(varargin) + +if nargin < 1 + help std_figtitle; + return; +end; + +alllegends = {}; +opt = finputcheck( varargin, { 'chanlabels' {'cell','string'} [] {}; + 'condnames' {'cell','string'} [] ''; + 'cond2names' {'cell','string'} [] ''; + 'condstat' 'string' {'on','off'} 'off'; + 'cond2stat' 'string' {'on','off'} 'off'; + 'condgroup' 'string' {'on','off','together','apart'} 'off'; + 'cond2group' 'string' {'on','off','together','apart'} 'off'; + 'plotmode' 'string' {'normal','condensed'} 'normal'; + 'plotsubjects' 'string' {'on','off'} 'off'; + 'threshold' 'real' [] NaN; + 'statistics' 'string' [] ''; + 'mcorrect' 'string' [] ''; + 'datatype' 'string' [] ''; + 'clustname' 'string' [] ''; + 'compnames' {'cell','string'} [] {}; + 'vals' {'cell','real'} [] {}; % just for titles + 'valsunit' {'cell','string'} [] {}; % just for titles + 'subject' 'string' [] '' }, 'std_figtitle'); %, 'ignore'); +if isstr(opt), error(opt); end; +if ~iscell(opt.vals), opt.vals = { opt.vals }; end; +ncori = length(opt.condnames); +nc2ori = length(opt.cond2names); +if ~isempty(opt.vals) && ~isempty(opt.vals{1}) && ~isnan(opt.vals{1}(1)), opt.condgroup = 'off'; opt.cond2group = 'off'; end; +if strcmpi(opt.plotmode, 'condensed'), opt.condgroup = 'on'; opt.cond2group = 'on'; end; +if strcmpi(opt.plotsubjects, 'on'), opt.condgroup = 'off'; opt.cond2group = 'off'; end; +if strcmpi(opt.plotsubjects, 'on') + opt.condgroup = 'apart'; + opt.cond2group = 'apart'; +end; +if strcmpi(opt.condgroup, 'on'), opt.condgroup = 'together'; end; +if strcmpi(opt.cond2group, 'on'), opt.cond2group = 'together'; end; + +if strcmpi(opt.condgroup, 'together') && strcmpi(opt.cond2stat, 'on'), opt.condgroup = 'apart'; end; +if strcmpi(opt.cond2group, 'together') && strcmpi(opt.condstat , 'on') , opt.cond2group = 'apart'; end; +if ~( strcmpi(opt.condgroup, 'together') && strcmpi(opt.cond2group, 'together') ) + if strcmpi(opt.condgroup, 'together'), alllegends = opt.condnames ; opt.condnames = ''; end; + if strcmpi(opt.cond2group, 'together'), alllegends = opt.cond2names; opt.cond2names = ''; end; +end; +if ~iscell(opt.valsunit), opt.valsunit = { opt.valsunit }; end; +if ~iscell(opt.chanlabels), opt.chanlabels = { opt.chanlabels }; end; +if ~iscell(opt.condnames), opt.condnames = { opt.condnames }; end; +if ~iscell(opt.cond2names), opt.cond2names = { opt.cond2names }; end; +if isempty(opt.condnames), opt.condnames{1} = ''; end; +if isempty(opt.cond2names), opt.cond2names{1} = ''; end; + +for c1 = 1:length(opt.condnames) + for c2 = 1:length(opt.cond2names) + + % value (ms or Hz) + % ---------------- + fig_title1 = ''; + for i = 1:length(opt.vals) + if ~isempty(opt.vals{i}) && ~isnan(opt.vals{i}(1)) + if opt.vals{i}(1) == opt.vals{i}(end), fig_title1 = [ num2str(opt.vals{i}(1)) '' opt.valsunit{i} fig_title1]; + else fig_title1 = [ num2str(opt.vals{i}(1)) '-' num2str(opt.vals{i}(2)) '' opt.valsunit{i} fig_title1 ]; + end; + if length(opt.vals) > i, fig_title1 = [ ' & ' fig_title1 ]; end; + end; + end; + + % conditions + % ---------- + if ~isempty(opt.condnames{c1}) + fig_title1 = [ value2str(opt.condnames{c1}) ', ' fig_title1]; + end; + if ~isempty(opt.cond2names{c2}) + fig_title1 = [ value2str(opt.cond2names{c2}) ', ' fig_title1]; + end; + + % channel labels, component name, subject name and datatype + % --------------------------------------------------------- + fig_title2 = ''; + if length( opt.chanlabels ) == 1 && ~isempty( opt.chanlabels{1} ) + fig_title2 = [ opt.chanlabels{1} ', ' fig_title2 ]; + end; + + % cluster and component name + % -------------------------- + if ~isempty( opt.clustname ) + if ~isempty( opt.compnames ) + if iscell( opt.compnames ) + compstr = [ 'C' num2str(opt.compnames{min(c1,size(opt.compnames,1)),min(c2,size(opt.compnames,2))}) ]; + else compstr = [ opt.compnames ]; + end; + else compstr = ''; + end; + if ~isempty( opt.subject ) + if ~isempty( compstr ) + fig_title2 = [ opt.subject '/' compstr ', ' fig_title2 ]; + else fig_title2 = [ opt.subject ', ' fig_title2 ]; + end; + elseif ~isempty( compstr ) + fig_title2 = [ compstr ', ' fig_title2 ]; + end; + + if ~isempty( opt.datatype ) + fig_title2 = [ opt.clustname ' ' opt.datatype ', ' fig_title2 ]; + else fig_title2 = [ opt.clustname ', ' fig_title2 ]; + end; + + else + if ~isempty( opt.compnames ) + if iscell( opt.compnames ) + else fig_title2 = [ 'C' num2str(opt.compnames{c1,c2}) ', ' fig_title2 ]; + fig_title2 = [ opt.compnames ', ' fig_title2 ]; + end; + end; + + % subject and data type + % --------------------- + if ~isempty( opt.subject ) + if ~isempty( opt.datatype ) + fig_title2 = [ opt.subject ' ' opt.datatype ', ' fig_title2 ]; + else fig_title2 = [ opt.subject ', ' fig_title2 ]; + end; + elseif ~isempty( opt.datatype ) + fig_title2 = [ opt.datatype ' - ' fig_title2 ]; + end; + end; + + if strcmpi(opt.cond2group, 'together') && strcmpi(opt.condgroup, 'together') + fig_title = fig_title2; + if ~isempty(fig_title1) && length(fig_title1) > 1 && strcmpi(fig_title1(end-1:end), ', '), fig_title1(end-1:end) = []; end; + if ~isempty(fig_title1) && length(fig_title1) > 1 && strcmpi(fig_title1(end-1:end), '- '), fig_title1(end-1:end) = []; end; + alllegends{c1, c2} = fig_title1; + else + fig_title = [ fig_title2 fig_title1 ]; + end; + if ~isempty(fig_title) && length(fig_title) > 1 && strcmpi(fig_title(end-1:end), ', '), fig_title(end-1:end) = []; end; + if ~isempty(fig_title) && length(fig_title) > 1 && strcmpi(fig_title(end-1:end), '- '), fig_title(end-1:end) = []; end; + all_titles{c1,c2} = fig_title; + + end; +end; +if ~isempty(alllegends) + alllegends = alllegends'; + alllegends = alllegends(:)'; + + % convert legends to string if necessary + % -------------------------------------- + for ileg = 1:length(alllegends), + alllegends{ileg} = value2str(alllegends{ileg}); + end; +end; + +% statistic titles +% ---------------- +if isnan(opt.threshold), + basicstat = '(p-value)'; +else + if length(opt.threshold) >= 1 + basicstat = sprintf([ '(p<%.' thresh_pres(opt.threshold(1)) 'f)'], opt.threshold(1)); + end; + if length(opt.threshold) >= 2 + basicstat = [ basicstat(1:end-1) sprintf([' red;p<%.' thresh_pres(opt.threshold(2)) 'f brown)'], opt.threshold(2)) ]; + end; + if length(opt.threshold) >= 3 + basicstat = [ basicstat(1:end-1) sprintf([';\np<%.' thresh_pres(opt.threshold(3)) 'f black)' ], opt.threshold(3)) ]; + end; +end; +if ~isempty(opt.statistics), basicstat = [ basicstat ' ' opt.statistics ]; end; +if ~isempty(opt.mcorrect) && ~strcmpi(opt.mcorrect, 'none'), basicstat = [ basicstat ' with ' opt.mcorrect ]; end; +if strcmpi(opt.condstat, 'on') + rown = size(all_titles,1)+1; + for c2 = 1:length(opt.cond2names) + all_titles{rown, c2} = [ value2str(opt.cond2names{c2}) ' ' basicstat ]; + end; +end; +if strcmpi(opt.cond2stat, 'on') + coln = size(all_titles,2)+1; + for c1 = 1:length(opt.condnames) + all_titles{c1, coln} = [ value2str(opt.condnames{c1}) ' ' basicstat ]; + end; +end; +if strcmpi(opt.condstat, 'on') && strcmpi(opt.cond2stat, 'on') + all_titles{rown, coln} = [ 'Interaction ' basicstat ]; +end; + +function pres = thresh_pres(thresh_pres); + if (round(thresh_pres*100)-thresh_pres*100) == 0 + pres = 2; + elseif (round(thresh_pres*1000)-thresh_pres*1000) == 0 + pres = 3; + else + pres = -round(log10(thresh_pres))+1; + end; + pres = num2str(pres); + +% convert +% ------- +function str = value2str(value) + + if isstr(value) + str = value; + elseif isnumeric(value) + if length(value) == 1 + str = num2str(value); + else + str = num2str(value(1)); + if length(value) <= 5 + for ind = 2:length(value) + str = [ str ' & ' num2str(value(ind)) ]; + end; + else + str = [ str ' & ' num2str(value(2)) ' & ...' ]; + end; + end; + else % cell array + str = value{1}; + for ind = 2:length(value) + str = [ str ' & ' value{ind} ]; + end; + end; + + + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_filecheck.m b/code/eeglab13_4_4b/functions/studyfunc/std_filecheck.m new file mode 100644 index 0000000..12c3cbc --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_filecheck.m @@ -0,0 +1,189 @@ +% std_filecheck() - Check if ERSP or SPEC file contain specific parameters. +% This file must contain a Matlab structure with a field +% named 'parameter'. The content of this field will be +% compared to the 'params' input. If they are identical +% the output flag will indicate that recomputing this +% file is not necessary. If they are different, the user +% is queried ('guion' option) to see if he wishes to use +% the new parameters and recompute the file (not done in +% this function) or if he wishes to use the parameters +% of the file on disk. +% +% Usage: +% >> [ recompflag params ] = std_filecheck(filename, params, mode, ignorefields); +% +% Inputs: +% filename - [string] file containing a given measure (ERSP data for +% instance). +% params - [cell array or structure] cell array of parameters or +% structure. This is compared to the 'parameters' field +% in the data file. +% mode - ['guion'|'usedisk'|'recompute'] 'guion' query the user +% if the disk and input parameters are different. The +% outcome may be either 'usedisk' or 'recompute'. See +% recompflag output for more information. +% ignorefields - [cell array] list fields to ignore +% +% Outputs: +% recompflag - ['same'|'different'|'recompute'|'usedisk'|'cancel'] 'same' +% (resp. 'different') indicates that the parameters in the +% data file are identical (resp. different). 'recompute' +% indicate that the measure should be recomputed and the +% file has been erased. 'usedisk' indicate that the user +% wishes (from the GUI) to use the version on disk. +% params - [structure] final parameter. This is usually identical +% to the 'params' input unless the user choose to use +% parameters from the file on disk. These are then +% copied to this output structure. +% +% Authors: Arnaud Delorme, 2006- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2006, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ res, params2 ] = std_filecheck(filename, params2, guiflag, ignorefields); + + if nargin < 2 + help std_filecheck; + return; + end; + if nargin < 3 + guiflag = 'guion'; + end; + if nargin < 4 + ignorefields = {}; + end; + + if ~exist( filename ), res = guiflag; return; end; + + params1 = load('-mat', filename, 'parameters'); + params1 = finputcheck( params1.parameters, { 'tmp' 'real' [] NaN}, '', 'ignore'); % allow to tackle duplicate fields + params1 = rmfield(params1, 'tmp'); + if iscell(params2), params2 = struct(params2{:}); end; + + % test if the fields are different + % -------------------------------- + params1 = orderfields(params1); + params2 = orderfields(params2); + fields1 = fieldnames( params1 ); fields1 = setdiff_bc( fields1, ignorefields); + fields2 = fieldnames( params2 ); fields2 = setdiff_bc( fields2, ignorefields); + allfields = union_bc(fields1, fields2); + + % make fields the same + % -------------------- + res = 'same'; + if ~isequal( fields1, fields2 ), + for ind = 1:length(allfields) + if strcmpi(allfields{ind}, 'plotitc'), adsfads; end; + if ~isfield( params1, allfields{ind}) + if isstr(getfield(params2, allfields{ind})) + params1 = setfield(params1, allfields{ind}, ''); + else params1 = setfield(params1, allfields{ind}, []); + end; + res = 'different'; + end; + if ~isfield( params2, allfields{ind}) + if isstr(getfield(params1, allfields{ind})) + params2 = setfield(params2, allfields{ind}, ''); + else params2 = setfield(params2, allfields{ind}, []); + end; + res = 'different'; + end; + end; + end; + + % data type + % --------- + if ~isempty(strmatch('cycles', allfields)), strcom = 'ERSP'; + else strcom = 'SPECTRAL'; + end; + + % compare fields + % -------------- + txt = {}; + for ind = 1:length(allfields) + if ~strcmp(allfields{ind},'baseline') + val1 = getfield(params1, allfields{ind}); + val2 = getfield(params2, allfields{ind}); + val1str = fastif(isempty(val1), 'not set', vararg2str({val1(1:min(3, length(val1)))})); + val2str = fastif(isempty(val2), 'not set', vararg2str({val2(1:min(3, length(val2)))})); + + tmptxt = sprintf(' ''%s'' is %s in the file (vs. %s)', allfields{ind}, val1str, val2str); + if length(val1) ~= length(val2) + res = 'different'; + txt{end+1} = tmptxt; + elseif ~isequal(val1, val2) + if ~isnan(val1) & ~isnan(val2) + res = 'different'; + txt{end+1} = tmptxt; + end + end + end + end + + % build gui or return + % ------------------- + if strcmpi(guiflag, 'usedisk'), + if isempty(txt) + params2 = params1; + res = 'usedisk'; + disp(['Using file on disk: ' filename ]); + return; + else + strvcat(txt{:}) + error([ 'Two ' strcom ' files had different parameters and the ' strcom ' function' 10 ... + 'cannot handle that. We suggest that you delete all files. See command line details' ]); + end; + elseif strcmpi(guiflag, 'recompute'), + res = 'recompute'; + disp(['Deleting and recomputing file: ' filename ]); + return; + elseif strcmpi(res, 'same') & ( strcmpi(guiflag, 'guion') | strcmpi(guiflag, 'same') ) + disp(['Using file on disk: ' filename ]); + return; + end; + + set_yes = [ 'set(findobj(''parent'', gcbf, ''tag'', ''ersp_no''), ''value'', 0);']; + set_no = [ 'set(findobj(''parent'', gcbf, ''tag'', ''ersp_yes''), ''value'', 0);' ]; + textgui1 = strvcat( [ upper(strcom) ' info exists in file: ' filename ], ... + 'However, as detailed below, it does not fit with the requested values:'); + textgui2 = strvcat(txt{:}); + + %textgui2 = ['wavelet cycles - [' num2str(params1.cycles(1)) ' ' num2str(params2.cycles(2)) ... + % '] instead of [' num2str(params1.cycles(1)) ' ' num2str(params2.cycles(2)) ... + % '], padratio - ' num2str(params1.padratio) ' instead of ' num2str(param2.padratio) ... + % ', and bootstrap significance - ' num2str(params1.alpha) ' instead of ' num2str(params2.alpha) ]; + + uilist = { {'style' 'text' 'string' textgui1 } ... + {'style' 'text' 'string' textgui2 } {} ... + {'style' 'text' 'string' ['Would you like to recompute ' upper(strcom) ' and overwrite those values?' ]} ... + {'style' 'checkbox' 'tag' 'ersp_yes' 'string' 'Yes, recompute' 'value' 1 'Callback' set_yes } ... + {'style' 'checkbox' 'tag' 'ersp_no' 'string' 'No, use data file parameters (and existing ERSP info)' 'value' 0 'Callback' set_no } }; + + ersp_ans = inputgui('geometry', {[1] [1] [1] [1] [0.5 1] }, 'geomvert', [2 max(length(txt),1)*0.7 1 1 1 1], 'uilist', uilist, ... + 'helpcom', '', 'title', ['Recalculate ' upper(strcom) ' parameters -- part of std_ersp()']); + + if isempty(ersp_ans), res = 'cancel'; return; end; + if find(celltomat(ersp_ans)) == 2 % use existing ERSP info from this dataset + disp(['Using file on disk: ' filename ]); + params2 = params1; + res = 'usedisk'; + else % Over write data in dataset + disp(['Deleting and recomputing file: ' filename ]); + res = 'recompute'; + %delete(filename); + end + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_fileinfo.m b/code/eeglab13_4_4b/functions/studyfunc/std_fileinfo.m new file mode 100644 index 0000000..dbc1d58 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_fileinfo.m @@ -0,0 +1,93 @@ +% std_fileinfo() - Check uniform channel distribution accross datasets +% +% Usage: +% >> [struct filepresent] = std_fileinfo(ALLEEG); +% Inputs: +% ALLEEG - EEGLAB ALLEEG structure +% +% Outputs: +% struct - structure of the same length as the ALLEEG variable +% containing all the fields in the datafiles +% filepresent - array of 0 and 1 indicating if the file is present for +% each dataset +% +% Authors: Arnaud Delorme, SCCN/UCSD, CERCO/CNRS, 2010- + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [tmpstructout compinds filepresent] = std_fileinfo( ALLEEG, filetype ); + + firstpass = 1; + notequal = 0; + compinds = {}; + tmpstructout = []; + filepresent = zeros(1,length(ALLEEG)); + for dat = 1:length(ALLEEG) + + filename = fullfile(ALLEEG(dat).filepath, [ ALLEEG(dat).filename(1:end-3) filetype ]); + thisfilepresent = exist(filename); + if thisfilepresent && firstpass == 1 + %fprintf('Files of type "%s" detected, checking...', filetype); + elseif firstpass == 1 + notequal = 1; + end; + firstpass = 0; + filepresent(dat) = thisfilepresent; + + if filepresent(dat) + try + warning('off', 'MATLAB:load:variableNotFound'); + tmptmpstruct = load( '-mat', filename, 'times', 'freqs', 'parameters', 'labels', 'chanlabels' ); + warning('on', 'MATLAB:load:variableNotFound'); + catch + passall = 0; + fprintf(' Error\n'); + break; + end; + + % rename chanlabels and store structure + if isfield(tmptmpstruct, 'chanlabels') + tmptmpstruct.labels = tmptmpstruct.chanlabels; + tmptmpstruct = rmfield(tmptmpstruct, 'chanlabels'); + end; + + if filetype(1) ~= 'd' % ICA components + allvars = whos('-file', filename); + tmpinds = []; + for cind = 1:length(allvars) + str = allvars(cind).name(5:end); + ind_ = find(str == '_'); + if ~isempty(ind_), str(ind_:end) = []; end; + tmpinds = [ tmpinds str2num(str) ]; + end; + compinds(dat) = { unique(tmpinds) }; + elseif ~isfield(tmptmpstruct, 'labels') + allvars = whos('-file', filename); + allvarnames = { allvars.name }; + tmptmpstruct.labels = allvarnames(strmatch('chan', allvarnames)); + end; + try, + tmpstruct(dat) = tmptmpstruct; + catch, + passall = 0; + break; + end; + end; + end; + if exist('tmpstruct') == 1 + tmpstructout = tmpstruct; + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_findoutlierclust.m b/code/eeglab13_4_4b/functions/studyfunc/std_findoutlierclust.m new file mode 100644 index 0000000..85573ad --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_findoutlierclust.m @@ -0,0 +1,13 @@ +% std_findoutlierclust() - determine whether an outlier cluster already exists +% for a specified cluster. If so, return the outlier cluster index. +% If not, return zero. This helper function is called by +% pop_clustedit(), std_moveoutlier(), std_renameclust(). + +function outlier_clust = std_findoutlierclust(STUDY,clust) +outlier_clust = 0; +outlier_name = [ 'Outliers ' STUDY.cluster(clust).name ' ' ]; +for k = 1:length(STUDY.cluster) + if strncmpi(outlier_name,STUDY.cluster(k).name,length(outlier_name)) + outlier_clust = k; + end +end diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_findsameica.m b/code/eeglab13_4_4b/functions/studyfunc/std_findsameica.m new file mode 100644 index 0000000..98342cb --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_findsameica.m @@ -0,0 +1,59 @@ +% std_findsameica() - find groups of datasets with identical ICA decomposiotions +% +% Usage: +% >> clusters = std_findsameica(ALLEEG); +% >> clusters = std_findsameica(ALLEEG,icathreshold); +% Inputs: +% ALLEEG - a vector of loaded EEG dataset structures of all sets in the STUDY set. +% icathreshold - Threshold to compare icaweights +% +% Outputs: +% cluster - cell array of groups of datasets +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, July 2009- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Coding notes: Useful information on functions and global variables used. + +function cluster = std_findsameica(ALLEEG, varargin); + +% 6/2/2014 Ramon : Allow ica threshold as input. +if nargin == 1 + icathreshold = 2e-5; +elseif nargin == 2; + icathreshold = varargin{1}; +end + +cluster = { [1] }; +for index = 2:length(ALLEEG) + + found = 0; + for c = 1:length(cluster) + if all(size(ALLEEG(cluster{c}(1)).icaweights) == size(ALLEEG(index).icaweights)) + %if isequal(ALLEEG(cluster{c}(1)).icaweights, ALLEEG(index).icaweights) + if sum(sum(abs(ALLEEG(cluster{c}(1)).icaweights-ALLEEG(index).icaweights))) < icathreshold + cluster{c}(end+1) = index; + found = 1; + break; + end; + end; + end; + if ~found + cluster{end+1} = index; + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_getdataset.m b/code/eeglab13_4_4b/functions/studyfunc/std_getdataset.m new file mode 100644 index 0000000..52f57dd --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_getdataset.m @@ -0,0 +1,162 @@ +% std_getdataset() - Constructs and returns EEG dataset from STUDY design. +% +% Usage: +% >> EEG = std_getdataset(STUDY, ALLEEG, 'key', 'val', ...); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% +% Optional inputs: +% 'design' - [numeric vector] STUDY design index. Default is to use +% the current design. +% 'rmcomps' - [integer array] remove artifactual components (this entry +% is ignored when plotting components). This entry contains +% the indices of the components to be removed. Default is none. +% 'rmclust' - [integer array] which cluster(s) to remove from the data +% Default is none. +% 'interp' - [struct] channel location structure containing electrode +% to interpolate ((this entry is ignored when plotting +% components). Default is no interpolation. +% 'cell' - [integer] index of the STUDY design cell to convert to +% an EEG dataset. Default is the first cell. +% 'onecomppercluster' - ['on'|'off'] when 'on' enforces one component per +% cluster. Default is 'off'. +% 'interpcomponent' - ['on'|'off'] when 'on' interpolating component +% scalp maps. Default is 'off'. +% 'cluster' - [integer] which cluster(s). When this option is being +% used, only the component contained in the selected +% clusters are being loaded in the dataset. +% 'checkonly' - ['on'|'off'] use in conjunction with the option above. +% When 'on', no dataset is returned. Default is 'off'. +% +% Outputs: +% EEG - EEG dataset structure corresponding to the selected +% STUDY design cell (element) +% complist - list of components selected +% +% Example to build the dataset corresponding to the first cell of the first +% design: +% EEG = std_getdataset(STUDY, ALLEEG, 'design', 1, 'cell', 1); +% +% Example to check that all datasets in the design have exactly one +% component per cluster for cluster 2, 3, 4 and 5. +% std_getdataset(STUDY, ALLEEG, 'design', 1, 'cell', +% [1:length(STUDY.design(1).cell)], 'cluster', [2 3 4 5], 'checkonly', 'on'); +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, January, 2012 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 12, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEGOUT listcomp rmlistcomp] = std_getdataset(STUDY, ALLEEG, varargin); + +if nargin < 2 + help std_getdataset; + return; +end; + +opt = finputcheck( varargin, { 'design' 'integer' [] STUDY.currentdesign; + 'interp' 'struct' { } struct([]); + 'rmcomps' 'integer' [] []; + 'cluster' 'integer' [] []; + 'rmclust' 'integer' [] []; + 'onecomppercluster' 'string' {'on' 'off'} 'off'; + 'interpcomponent' 'string' {'on' 'off'} 'off'; + 'checkonly' 'string' {'on' 'off'} 'off'; + 'cell' 'integer' [] 1 }, 'std_getdataset'); +% 'mode' 'string' { 'channels' 'components' } 'channels'; +if isstr(opt), error(opt); end; + +if length(opt.cell) > 1 + % recursive call if more than one dataset + % --------------------------------------- + indcell = strmatch('cell', varargin(1:2:end)); + for index = 1:length(opt.cell) + varargin{2*indcell} = index; + EEGOUT(index) = std_getdataset(STUDY, ALLEEG, varargin{:}); + end; +else + mycell = STUDY.design(opt.design).cell(opt.cell); + + % find components in non-artifactual cluster + if ~isempty(opt.cluster) + listcomp = []; + for index = 1:length(opt.cluster) + clsset = STUDY.cluster(opt.cluster(index)).sets; + clscomp = STUDY.cluster(opt.cluster(index)).comps; + + [indrow indcomp] = find(clsset == mycell.dataset(1)); + if length(indcomp) ~= 1 && strcmpi(opt.onecomppercluster, 'on') + error(sprintf('Dataset %d must have exactly 1 components in cluster %d', mycell.dataset(1), opt.cluster(index))); + end; + listcomp = [listcomp clscomp(indcomp')]; + end; + end; + + % find components in artifactual clusters + if ~isempty(opt.rmclust) + rmlistcomp = []; + for index = 1:length(opt.rmclust) + clsset = STUDY.cluster(opt.rmclust(index)).sets; + clscomp = STUDY.cluster(opt.rmclust(index)).comps; + [indrow indcomp] = find(clsset == mycell.dataset(1)); + rmlistcomp = [rmlistcomp clscomp(indcomp')]; + end; + if ~isempty(opt.rmcomps) + disp('Both ''rmclust'' and ''rmcomps'' are being set. Artifact components will be merged'); + end; + opt.rmcomps = [ opt.rmcomps rmlistcomp ]; + end; + rmlistcomp = opt.rmcomps; + if strcmpi(opt.checkonly, 'on'), EEGOUT = 0; return; end; + + % get data + EEG = ALLEEG(mycell.dataset); + EEGOUT = EEG(1); + EEGOUT.data = eeg_getdatact(EEG, 'channel', [], 'trialindices', mycell.trials, 'rmcomps', opt.rmcomps, 'interp', opt.interp); + EEGOUT.trials = size(EEGOUT.data,3); + EEGOUT.nbchan = size(EEGOUT.data,1); + if ~isempty(opt.interp) + EEGOUT.chanlocs = opt.interp; + end; + EEGOUT.event = []; + EEGOUT.epoch = []; + EEGOUT.filename = mycell.filebase; + EEGOUT.condition = mycell.value{1}; + EEGOUT.group = mycell.value{2}; + EEGOUT.subject = mycell.case; + if ~isempty(opt.cluster) + if ~isempty(opt.interp) && strcmpi(opt.interpcomponent, 'on') + TMPEEG = EEGOUT; + TMPEEG.chanlocs = EEG(1).chanlocs; + TMPEEG.data = EEG(1).icawinv; + TMPEEG.nbchan = size(TMPEEG.data,1); + TMPEEG.pnts = size(TMPEEG.data,2); + TMPEEG.trials = 1; + TMPEEG = eeg_interp(TMPEEG, opt.interp, 'spherical'); + EEGOUT.icawinv = TMPEEG.data(:, listcomp); + else + EEGOUT.icawinv = EEGOUT.icawinv(:, listcomp); + end; + EEGOUT.icaact = eeg_getdatact(EEG, 'component', listcomp, 'trialindices', mycell.trials ); + EEGOUT.icaweights = EEGOUT.icaweights(listcomp,:); + EEGOUT.etc.clustid = { STUDY.cluster(opt.cluster).name }; % name of each cluster + EEGOUT.etc.clustcmpid = listcomp; % index of each component in original ICA matrix + else + EEGOUT = eeg_checkset(EEGOUT); + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_getindvar.m b/code/eeglab13_4_4b/functions/studyfunc/std_getindvar.m new file mode 100644 index 0000000..87cbaa8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_getindvar.m @@ -0,0 +1,174 @@ +% std_getindvar - get independent variables of a STUDY +% +% Usage: +% [indvar indvarvals] = std_getindvar(STUDY); +% [indvar indvarvals] = std_getindvar(STUDY, mode, scandesign); +% +% Input: +% STUDY - EEGLAB STUDY structure +% mode - ['datinfo'|'trialinfo'|'both'] get independent variables +% linked to STUDY.datasetinfo, STUDY.datasetinfo.trialinfo or +% both. Default is 'both'. +% scandesign - [0|1] scan STUDY design for additional combinations of +% independent variable values. Default is 0. +% +% Output: +% indvar - [cell array] cell array of independent variable names +% indvarvals - [cell array] cell array of independent variable values +% +% Authors: A. Delorme, CERCO/CNRS and SCCN/UCSD, 2010- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2010, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ factor factorvals subjects ] = std_getindvar(STUDY, mode, scandesign) + +if nargin < 1 + help std_getindvar; + return; +end; + +factor = {}; +factorvals = {}; +subjects = {}; +if nargin < 2, mode = 'both'; end; +if nargin < 3, scandesign = 0; end; +countfact = 1; +setinfo = STUDY.datasetinfo; + +if strcmpi(mode, 'datinfo') || strcmpi(mode, 'both') + % get trial info + ff = fieldnames(setinfo); + ff = setdiff_bc(ff, { 'filepath' 'filename' 'subject' 'index' 'ncomps' 'comps' 'trialinfo' }); + for index = 1:length(ff) + if isstr(getfield(setinfo(1), ff{index})) + eval( [ 'tmpvals = unique_bc({ setinfo.' ff{index} '});' ] ); + if length(tmpvals) > 1 + factor{ countfact} = ff{index}; + factorvals{countfact} = tmpvals; + + % get subject for each factor value + for c = 1:length(tmpvals) + eval( [ 'datind = strmatch(tmpvals{c}, { setinfo.' ff{index} '}, ''exact'');' ] ); + subjects{ countfact}{c} = unique_bc( { setinfo(datind).subject } ); + end; + countfact = countfact + 1; + end; + else + eval( [ 'tmpvals = unique_bc([ setinfo.' ff{index} ']);' ] ); + if length(tmpvals) > 1 + factor{ countfact} = ff{index}; + factorvals{countfact} = mattocell(tmpvals); + + % get subject for each factor value + for c = 1:length(tmpvals) + eval( [ 'datind = find(tmpvals(c) == [ setinfo.' ff{index} ']);' ] ); + subjects{ countfact}{c} = unique_bc( { setinfo(datind).subject } ); + end; + countfact = countfact + 1; + end; + end; + end; +end; + +% add ind. variables for trials +% ----------------------------- +if strcmpi(mode, 'trialinfo') || strcmpi(mode, 'both') + % add trial info + if isfield(setinfo, 'trialinfo') + ff = fieldnames(setinfo(1).trialinfo); + for index = 1:length(ff) + % check if any of the datasets are using string for event type + allFieldsPresent = cellfun(@(x)(isfield(x, ff{index})), { setinfo.trialinfo }); + allFirstVal = cellfun(@(x)(getfield(x, ff{index})), { setinfo(allFieldsPresent).trialinfo }, 'uniformoutput', false); + + if any(cellfun(@isstr, allFirstVal)) + alltmpvals = {}; + for ind = 1:length(setinfo) + if isfield(setinfo(ind).trialinfo, ff{index}) + eval( [ 'tmpTrialVals = { setinfo(ind).trialinfo.' ff{index} ' };' ] ); + if isnumeric(tmpTrialVals{1}) + % convert to string if necessary + tmpTrialVals = cellfun(@num2str, tmpTrialVals, 'uniformoutput', false); + end; + tmpvals = unique_bc(tmpTrialVals); + else tmpvals = {}; + end; + if isempty(alltmpvals) + alltmpvals = tmpvals; + else + alltmpvals = { alltmpvals{:} tmpvals{:} }; + end; + end; + alltmpvals = unique_bc(alltmpvals); + if length(alltmpvals) > 1 + factor{ countfact} = ff{index}; + factorvals{countfact} = alltmpvals; + subjects{ countfact} = {}; + countfact = countfact + 1; + end; + else + alltmpvals = []; + for ind = 1:length(setinfo) + if isfield(setinfo(ind).trialinfo, ff{index}) + eval( [ 'tmpvals = unique_bc([ setinfo(ind).trialinfo.' ff{index} ' ]);' ] ); + else tmpvals = []; + end; + alltmpvals = [ alltmpvals tmpvals ]; + end; + alltmpvals = unique_bc(alltmpvals); + if length(alltmpvals) > 1 + factor{ countfact} = ff{index}; + factorvals{countfact} = mattocell(alltmpvals); + subjects{ countfact} = {}; + countfact = countfact + 1; + end; + end; + end; + end; +end; + +% scan existing design for additional combinations +% ------------------------------------------------ +if scandesign + for desind = 1:length(STUDY.design) + pos1 = strmatch(STUDY.design(desind).variable(1).label, factor, 'exact'); + pos2 = strmatch(STUDY.design(desind).variable(2).label, factor, 'exact'); + if ~isempty(pos1), add1 = mysetdiff(STUDY.design(desind).variable(1).value, factorvals{pos1}); else add1 = []; end; + if ~isempty(pos2), add2 = mysetdiff(STUDY.design(desind).variable(2).value, factorvals{pos2}); else add2 = []; end; + if ~isempty(add1), factorvals{pos1} = { factorvals{pos1}{:} add1{:} }; end; + if ~isempty(add2), factorvals{pos2} = { factorvals{pos2}{:} add2{:} }; end; + end; +end; + +function cellout = mysetdiff(cell1, cell2); + + if isstr(cell2{1}) + indcell = cellfun(@iscell, cell1); + else indcell = cellfun(@(x)(length(x)>1), cell1); + end; + cellout = cell1(indcell); + +% if isstr(cell1{1}) && isstr(cell2{1}) +% cellout = setdiff_bc(cell1, cell2); +% elseif ~isstr(cell1{1}) && ~isstr(cell2{1}) +% cellout = mattocell(setdiff( [ cell1{:} ], [ cell2{:} ])); +% elseif isstr(cell1{1}) && ~isstr(cell2{1}) +% cellout = setdiff_bc(cell1, cellfun(@(x)(num2str(x)),cell2, 'uniformoutput', false)); +% elseif ~isstr(cell1{1}) && isstr(cell2{1}) +% cellout = setdiff_bc(cellfun(@(x)(num2str(x)),cell1, 'uniformoutput', false), cell2); +% end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_indvarmatch.m b/code/eeglab13_4_4b/functions/studyfunc/std_indvarmatch.m new file mode 100644 index 0000000..3780a12 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_indvarmatch.m @@ -0,0 +1,75 @@ +% std_indvarmatch - match independent variable value in a list of values +% +% Usage: +% indices = std_indvarmatch(value, valuelist); +% +% Input: +% value - [string|real|cell] value to be matched +% valuelist - [cell array] cell array of string, numerical values or +% cell array +% +% Output: +% indices - [integer] numerical indices +% +% Example: +% std_indvarmatch( 3, { 3 4 [2 3] }); +% std_indvarmatch( [2 3], { 3 4 [2 3] }); +% std_indvarmatch( [2 3], { 3 4 2 4 3 }); +% std_indvarmatch( 'test1', { 'test1' 'test2' { 'test1' 'test2' } }); +% std_indvarmatch( { 'test1' 'test2' }, { 'test1' 'test2' { 'test1' 'test2' } }); +% std_indvarmatch( { 'test1' 'test2' }, { 'test1' 'test2' 'test3' 'test1' }); +% +% Author: Arnaud Delorme, CERCO/CNRS, UCSD, 2009- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function indices = std_indvarmatch(val, allvals); + +indices = []; +if nargin < 1 + help std_indvarmatch; + return; +end; + +% match values +% ------------ +if all(cellfun(@isstr, allvals)) % string + if ~iscell(val) + indices = strmatch( val, allvals, 'exact')'; + else + for indcell = 1:length(val) + indices = [ indices std_indvarmatch(val{indcell}, allvals) ]; + end; + end; +elseif all(cellfun(@length, allvals) == 1) % numerical + if length(val) == 1 + indices = find( val == [allvals{:}]); + else + for ind = 1:length(val) + indices = [ indices std_indvarmatch(val(ind), allvals) ]; + end; + end; +else + % mixed with cell array + indices = []; + for index = 1:length(allvals) + if isequal(val, allvals{index}) + indices = [indices index]; + end; + end; +end; +return; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_interp.m b/code/eeglab13_4_4b/functions/studyfunc/std_interp.m new file mode 100644 index 0000000..64ed485 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_interp.m @@ -0,0 +1,176 @@ +% std_interp() - interpolate, if needed, a list of named data channels +% for all datasets included in a STUDY. Currently assumes +% that all channels have uniform locations across datasets. +% +% Usage: >> [STUDY ALLEEG] = std_interp(STUDY, ALLEEG, chans, method); +% +% Inputs: +% STUDY - EEGLAB STUDY structure +% ALLEEG - EEGLAB vector containing all EEG dataset structures in the STUDY. +% chans - [Cell array] cell array of channel names (labels) to interpolate +% into the data if they are missing from one of the datasets. +% method - [string] griddata() method to use for interpolation. +% See >> help eeg_interp() {default:'spherical'} +% +% Important limitation: +% This function currently presuposes that all datasets have the same channel +% locations (with various channels from a standard set possibly missing). +% If this is not the case, the interpolation will not be performed. +% +% Output: +% STUDY - study structure. +% ALLEEG - updated datasets. +% +% Author: Arnaud Delorme, CERCO, CNRS, August 2006- +% +% See also: eeg_interp() + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Deprecated: +% - [chanlocs structure] channel location structure containing +% a full channel structure (missing channels in the current +% dataset are interpolated). + +function [STUDY, ALLEEG] = std_interp(STUDY, ALLEEG, chans, method); + +if nargin < 2 + help std_interp; + return; +end; +if nargin < 3 + chans = []; +end; +if nargin < 4 + method = 'spherical'; +end; + +% union of all channel structures +% ------------------------------- +alllocs = eeg_mergelocs(ALLEEG.chanlocs); + +% check electrode names to interpolate +% ------------------------------------ +if iscell(chans) + alllabs = lower({ alllocs.labels }); + for index = 1:length(chans) + tmpind = strmatch(lower(chans{index}), alllabs, 'exact'); + if isempty(tmpind) + error( sprintf('Channel named ''%s'' not found in any dataset', chans{index})); + end; + end; +end; + +% read all STUDY datasets and interpolate electrodes +% --------------------------------------------------- +for index = 1:length(STUDY.datasetinfo) + tmpind = STUDY.datasetinfo(index).index; + tmplocs = ALLEEG(tmpind).chanlocs; + + % build electrode location structure for interpolation + % ---------------------------------------------------- + [tmp tmp2 id1] = intersect_bc({tmplocs.labels}, {alllocs.labels}); + if isempty(chans) + interplocs = alllocs; + elseif iscell(chans) + [tmp tmp2 id2] = intersect_bc( chans, {alllocs.labels}); + interplocs = alllocs(union(id1, id2)); + else + interplocs = chans; + end; + + if length(interplocs) ~= length(tmplocs) + + % search for position of electrode in backup structure + % ---------------------------------------------- + extrachans = []; + if isfield(ALLEEG(tmpind).chaninfo, 'nodatchans') + if isfield(ALLEEG(tmpind).chaninfo.nodatchans, 'labels') + extrachans = ALLEEG(tmpind).chaninfo.nodatchans; + end; + end; + tmplabels = { tmplocs.labels }; + for i=1:length(interplocs) + ind = strmatch( interplocs(i).labels, tmplabels, 'exact'); + if ~isempty(ind) + interplocs(i) = tmplocs(ind); % this is necessary for polhemus + elseif ~isempty(extrachans) + ind = strmatch( interplocs(i).labels, { extrachans.labels }, 'exact'); + if ~isempty(ind) + fprintf('Found position of %s in chaninfo structure\n', interplocs(i).labels); + interplocs(i) = extrachans(ind); + end; + end; + end; + + % perform interpolation + % --------------------- + EEG = eeg_retrieve(ALLEEG, index); + EEG = eeg_checkset(EEG); + EEG = eeg_interp(EEG, interplocs, method); + EEG.saved = 'no'; + EEG = pop_saveset(EEG, 'savemode', 'resave'); + + % update dataset in EEGLAB + % ------------------------ + if isstr(ALLEEG(tmpind).data) + tmpdata = ALLEEG(tmpind).data; + [ ALLEEG EEG ] = eeg_store(ALLEEG, EEG, tmpind); + ALLEEG(tmpind).data = tmpdata; + ALLEEG(tmpind).saved = 'yes'; + clear EEG; + else + [ ALLEEG EEG ] = eeg_store(ALLEEG, EEG, tmpind); + ALLEEG(tmpind).saved = 'yes'; + end; + else + fprintf('No need for interpolation for dataset %d\n', tmpind); + end; +end; + + +function checkchans(STUDY, ALLEEG) + + % Check to see if all the channels have the same coordinates + % (check only the theta field) + % ---------------------------------------------------------- + for index = 1:length(STUDY.datasetinfo) + tmpind = STUDY.datasetinfo(index).index; + tmplocs = ALLEEG(tmpind).chanlocs; + [tmp id1 id2] = intersect_bc({tmplocs.labels}, {alllocs.labels}); + for ind = 1:length(id1) + if tmplocs(id1(ind)).theta ~= alllocs(id2(ind)).theta + + % find datasets with different coordinates + % ---------------------------------------- + for ind2 = 1:length(STUDY.datasetinfo) + tmplocs2 = ALLEEG(ind2).chanlocs; + tmpmatch = strmatch(alllocs(id2(ind)).labels, { tmplocs2.labels }, 'exact'); + if ~isempty(tmpmatch) + if alllocs(id2(ind)).theta == tmplocs2(tmpmatch).theta + datind = ind2; + break; + end; + end; + end; + + error(sprintf( [ 'Dataset %d and %d do not have the same channel location\n' ... + 'for electrode ''%s''' ], datind, tmpind, tmplocs(id1(ind)).labels)); + end; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_itcplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_itcplot.m new file mode 100644 index 0000000..a3b5fac --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_itcplot.m @@ -0,0 +1,49 @@ +% std_itcplot() - Commandline function to plot cluster ITCs. Either displays mean cluster +% ITCs, or else all cluster component ITCs, plus the mean cluster ITC, in +% one figure per cluster and condition. ITCs can be visualized only if +% component ITCs were calculated and saved in the STUDY EEG datasets. +% These can be computed during pre-clustering using the gui-based function +% pop_preclust(), or via the equivalent commandline functions +% eeg_createdata() and eeg_preclust(). Called by pop_clustedit(). +% Usage: +% >> [STUDY] = std_itcplot(STUDY, ALLEEG, key1, val1, key2, val2); +% >> [STUDY itcdata itctimes itcfreqs pgroup pcond pinter] = ... +% std_itcplot(STUDY, ALLEEG ...); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the datasets in the STUDY. +% Note: ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% +% Additional help: +% Inputs and output of this function are strictly identical to the std_erspplot(). +% See the help message of this function for more information. std_itcplot() +% plots the ITC while std_erspplot() plots the ERSP. +% +% See also: std_erspplot(), pop_clustedit(), pop_preclust() +% +% Authors: Arnaud Delorme, CERCO, August, 2006- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, allitc, alltimes, allfreqs, pgroup, pcond, pinter] = std_itcplot(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_itcplot; + return; +end; + +[STUDY allitc alltimes allfreqs pgroup pcond pinter ] = std_erspplot(STUDY, ALLEEG, 'datatype', 'itc', varargin{:}); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_loadalleeg.m b/code/eeglab13_4_4b/functions/studyfunc/std_loadalleeg.m new file mode 100644 index 0000000..0849c3e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_loadalleeg.m @@ -0,0 +1,159 @@ +% std_loadalleeg() - constructs an ALLEEG structure, given the paths and file names +% of all the EEG datasets that will be loaded into the ALLEEG +% structure. The EEG datasets may be loaded without their EEG.data +% (see the pop_editoptions() function), so many datasets can be +% loaded simultaneously. The loaded EEG datasets have dataset +% information and a (filename) pointer to the data. +% Usage: +% % Load sseveral EEG datasets into an ALLEEG structure. +% >> ALLEEG = std_loadalleeg(paths,datasets) ; +% >> ALLEEG = std_loadalleeg(STUDY) ; +% Inputs: +% paths - [cell array of strings] cell array with all the datasets paths. +% datasets - [cell array of strings] cell array with all the datasets file names. +% +% Output: +% ALLEEG - an EEGLAB data structure, which holds the loaded EEG sets +% (can also be one EEG set). +% Example: +% >> paths = {'/home/eeglab/data/sub1/','/home/eeglab/data/sub2/', ... +% >> '/home/eeglab/data/sub3/', '/home/eeglab/data/sub6/'}; +% >> datasets = { 'visattS1', 'visattS2', 'visattS3', 'visattS4'}; +% >> ALLEEG = std_loadalleeg(paths,datasets) ; +% +% See also: pop_loadstudy(), pop_study() +% +% Authors: Hilit Serby, Arnaud Delorme, SCCN, INC, UCSD, October , 2004 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, October 11, 2004, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function ALLEEG = std_loadalleeg(varargin) + + if nargin < 1 + help std_loadalleeg; + return; + end; + + genpath = ''; + oldgenpath = ''; + if isstruct(varargin{1}) + datasets = {varargin{1}.datasetinfo.filename}; + try, + paths = {varargin{1}.datasetinfo.filepath}; + catch, + paths = cell(1,length(datasets)); + paths(:) = { '' }; + end; + genpath = varargin{1}.filepath; + if isfield(varargin{1}.etc, 'oldfilepath') + oldgenpath = varargin{1}.etc.oldfilepath; + end; + else + paths = varargin{1}; + if nargin > 1 + datasets = varargin{2}; + else + datasets = paths; + paths = cell(size(datasets)); + end; + end + + set = 1; + ALLEEG = []; + + eeglab_options; + + % read datasets + % ------------- + warnfold = 'off'; + for dset = 1:length(paths) + if ~isempty(paths{dset}) + comp = computer; + if paths{dset}(2) == ':' & ~strcmpi(comp(1:2), 'PC') + paths{dset} = [ filesep paths{dset}(4:end) ]; + paths{dset}(find(paths{dset} == '\')) = filesep; + end; + end; + + [sub2 sub1] = fileparts(char(paths{dset})); + [sub3 sub2] = fileparts(sub2); + + % priority is given to relative path of the STUDY if STUDY has moved + if ~isequal(genpath, oldgenpath) && ~isempty(oldgenpath) + disp('Warning: STUDY moved since last saved, trying to load data files using relative path'); + if ~isempty(strfind(char(paths{dset}), oldgenpath)) + relativePath = char(paths{dset}(length(oldgenpath)+1:end)); + relativePath = fullfile(genpath, relativePath); + else + disp('Important warning: relative path cannot calculated, make sure the correct data files are loaded'); + relativePath = char(paths{dset}); + end; + else + relativePath = char(paths{dset}); + end; + + % load data files + if exist(fullfile(relativePath, datasets{dset})) == 2 + EEG = pop_loadset('filename', datasets{dset}, 'filepath', relativePath, 'loadmode', 'info', 'check', 'off'); + elseif exist(fullfile(char(paths{dset}), datasets{dset})) == 2 + EEG = pop_loadset('filename', datasets{dset}, 'filepath', char(paths{dset}), 'loadmode', 'info', 'check', 'off'); + elseif exist( fullfile(genpath, datasets{dset})) == 2 + [tmpp tmpf ext] = fileparts(fullfile(genpath, datasets{dset})); + EEG = pop_loadset('filename', [tmpf ext], 'filepath',tmpp, 'loadmode', 'info', 'check', 'off'); + warnfold = 'on'; + elseif exist( fullfile(genpath, sub1, datasets{dset})) == 2 + [tmpp tmpf ext] = fileparts(fullfile(genpath, sub1, datasets{dset})); + EEG = pop_loadset('filename', [tmpf ext], 'filepath',tmpp, 'loadmode', 'info', 'check', 'off'); + warnfold = 'on'; + elseif exist( fullfile(genpath, sub2, datasets{dset})) == 2 + [tmpp tmpf ext] = fileparts(fullfile(genpath, sub2, datasets{dset})); + EEG = pop_loadset('filename', [tmpf ext], 'filepath',tmpp, 'loadmode', 'info', 'check', 'off'); + warnfold = 'on'; + elseif exist( fullfile(genpath, sub2, sub1, datasets{dset})) == 2 + [tmpp tmpf ext] = fileparts(fullfile(genpath, sub2, sub1, datasets{dset})); + EEG = pop_loadset('filename', [tmpf ext], 'filepath',tmpp, 'loadmode', 'info', 'check', 'off'); + warnfold = 'on'; + elseif exist(lower(fullfile(char(paths{dset}), datasets{dset}))) == 2 + EEG = pop_loadset('filename', lower(datasets{dset}), 'filepath',lower(char(paths{dset})), 'loadmode', 'info', 'check', 'off'); + else + txt = [ sprintf('The dataset %s is missing\n', datasets{dset}) 10 ... + 'Is it possible that it might have been deleted?' 10 ... + 'If this is the case, re-create the STUDY using the remaining datasets' ]; + error(txt); + end; + + EEG = eeg_checkset(EEG); + if ~option_storedisk + EEG = eeg_checkset(EEG, 'loaddata'); + elseif ~isstr(EEG.data) + EEG.data = 'in set file'; + EEG.icaact = []; + end; + + [ALLEEG EEG] = eeg_store(ALLEEG, EEG, 0, 'notext'); + end + ALLEEG = eeg_checkset(ALLEEG); + + if strcmpi(warnfold, 'on') & ~strcmpi(pwd, genpath) + disp('Changing current path to STUDY path...'); + cd(genpath); + end; + if strcmpi(warnfold, 'on') + disp('This STUDY has a relative path set for the datasets'); + disp('so the current path MUST remain the STUDY path'); + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_makedesign.m b/code/eeglab13_4_4b/functions/studyfunc/std_makedesign.m new file mode 100644 index 0000000..4367477 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_makedesign.m @@ -0,0 +1,438 @@ +% std_makedesign() - create a new or edit an existing STUDY.design by +% selecting specific factors to include in subsequent +% 1x2 or 2x2 STUDY measures and statistical computations +% for this design. A STUDY may have many factors +% (task or stimulus conditions, subject groups, session +% numbers, trial types, etc.), but current EEGLAB +% STUDY statistics functions apply only to at most two +% (paired or unpaired) factors. A STUDY.design may +% also be (further) restricted to include only specific +% subjects, datasets, or trial types. +% Usage: +% >> [STUDY] = std_makedesign(STUDY, ALLEEG); % create a default design +% >> [STUDY] = std_makedesign(STUDY, ALLEEG, designind, 'key', 'val' ...); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% designind - [integer > 0] index (number) of the new STUDY design {default: 1} +% +% Optional inputs: +% 'name' - ['string'] mnemonic design name (ex: 'Targets only') +% {default: 'Design d', where d = designind} +% 'variable1' - ['string'] - first independent variable or contrast. Must +% be a field name in STUDY.datasetinfo or in +% STUDY.datasetinfo.trialinfo. Typical choices include (task +% or other) 'condition', (subject) 'group', (subject) 'session', +% or other condition/group/session factors in STUDY.datasetinfo +% -- for example (subject factor) 'gender' or (condition factor) +% 'timeofday', etc. If trial type variables are defined in +% STUDY.datasetinfo.trialinfo, they may also be used here +% -- for example, 'stimcolor'. However, in this case datasets +% consist of heterogeneous sets of trials of different types, +% so many dataset Plot and Tools menu items may not give +% interpretable results and will thus be made unavailable for +% selection {default: 'condition'} +% 'pairing1' - ['on'|'off'] the nature of the 'variable1' contrast. +% For example, to compare two conditions recorded from the +% same group of 10 subjects, the 'variable1','condition' design +% elements are paired ('on') since each dataset for one +% condition has a corresponding dataset from the same subject +% in the second condition. If the two conditions were recorded +% from different groups of subjects, the variable1 'condition' +% would be unpaired ('off') {default: 'on'} +% 'values1' - {cell array of 'strings'} - 'variable1' instances to include +% in the design. For example, if 'variable1' is 'condition'and +% three values for 'condition' (e.g., 'a' , 'b', and 'c') +% are listed in STUDY.datasetinfo, then 'indval1', { 'a' 'b' } +% will contrast conditions 'a' and 'b', and datasets for +% condition 'c' will be ignored. To combine conditions, use +% nested '{}'s. For example, to combine conditions 'a' and +% 'b' into one condition and contrast it to condition 'c', +% specify 'indval1', { { 'a' 'b' } 'c' } {default: all values +% of 'variable1' in STUDY.datasetinfo} +% 'variable2' - ['string'] - second independent variable name, if any. Typically, +% this might refer to ('unpaired') subject group or (typically +% 'paired') session number, etc. +% 'pairing2' - ['on'|'off'] type of statistics for variable2 +% (default: 'on'} +% 'values2' - {cell array of 'strings'} - variable2 values to include in the +% design {default: all}. Here, 'var[12]' must be field names +% in STUDY.datasetinfo or STUDY.datasetinfo.trialinfo. +% 'datselect' - {cell array} select specific datasets and/or trials: 'datselect', +% {'var1' {'vals'} 'var2' {'vas'}}. Selected datasets must +% meet all the specified conditions. For example, 'datselect', +% { 'condition' { 'a' 'b' } 'group' { 'g1' 'g2' } } will +% select only datasets from conditions 'a' OR 'b' AND only +% subjects in groups 'g1' OR 'g2'. If 'subjselect' is also +% specified, only datasets meeting both criteria are included. +% 'variable1' and 'variable2' will only consider +% the values after they have passed through 'datselect' and +% 'subjselect'. For instance, if conditions { 'a' 'b' 'c' } +% exist and conditions 'a' is removed by 'datselect', the only +% two conditions that will be considered are 'b' and 'c' +% (which is then equivalent to using 'variable1vals' to specify +% values for the 'condition' factor. Calls function +% std_selectdataset() {default: select all datasets} +% 'subjselect' - {cell array} subject codes of specific subjects to include +% in the STUDY design {default: all subjects in the specified +% conditions, groups, etc.} If 'datselect' is also specified, +% only datasets meeting both criteria are included. +% 'rmfiles' - ['on'|'off'] remove from the STUDY all data measure files +% NOT included in this design. Selecting this option will +% remove all the old measure files associated with the previous +% definition of this design. {default: 'off'} +% 'filepath' - [string] file path for saving precomputed files. Default is +% empty meaning it is in the same folder as the data. +% 'delfiles' - ['on'|'off'|'limited'] delete data files +% associated with the design specified as parameter. 'on' +% delete all data files related to the design. 'limited' +% deletes all data files contained in the design. 'limited' +% will not delete data files from other STUDY using the same +% files. Default is 'off'. +% +% Output: +% STUDY - The input STUDY with a new design added and designated +% as the current design. +% +% Examples: +% STUDY = std_makedesign(STUDY, ALLEEG); % make default design +% +% % create design with 1 independent variable equal to 'condition' +% STUDY = std_makedesign(STUDY, ALLEEG, 2, 'variable1', 'condition'); +% +% % create design with 1 independent variable equal to 'condition' +% % but only consider the sub-condition 'stim1' and 'stim2' - of course +% % such conditions must be present in the STUDY +% STUDY = std_makedesign(STUDY, ALLEEG, 2, 'variable1', 'condition', ... +% 'values1', { 'stim1' 'stim2' }); +% +% % create design and only include subject 's1' and 's2' +% STUDY = std_makedesign(STUDY, ALLEEG, 2, 'variable1', 'condition', ... +% 'subjselect', { 's1' 's2' }); +% +% Author: Arnaud Delorme, Institute for Neural Computation UCSD, 2010- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY com] = std_makedesign(STUDY, ALLEEG, designind, varargin) + +if nargin < 2 + help std_makedesign; + return; +end; +if nargin < 3 + designind = 1; +end; + +defdes.name = sprintf('STUDY.design %d', designind); +defdes.cases.label = 'subject'; +defdes.cases.value = {}; +defdes.variable(1).label = 'condition'; +defdes.variable(2).label = 'group'; +defdes.variable(1).value = {}; +defdes.variable(2).value = {}; +defdes.variable(1).pairing = 'on'; +defdes.variable(2).pairing = 'on'; +defdes.filepath = ''; +defdes.include = {}; +orivarargin = varargin; +if ~isempty(varargin) && isstruct(varargin{1}) + defdes = varargin{1}; + varargin(1) = []; +end; +if isempty(defdes.filepath), defdes.filepath = ''; end; +opt = finputcheck(varargin, {'variable1' 'string' [] defdes.variable(1).label; + 'variable2' 'string' [] defdes.variable(2).label; + 'values1' {'real','cell' } [] defdes.variable(1).value; + 'values2' {'real','cell' } [] defdes.variable(2).value; + 'pairing1' 'string' [] defdes.variable(1).pairing; + 'pairing2' 'string' [] defdes.variable(2).pairing; + 'name' 'string' {} defdes.name; + 'filepath' 'string' {} defdes.filepath; + 'datselect' 'cell' {} defdes.include; + 'dataselect' 'cell' {} {}; + 'subjselect' 'cell' {} defdes.cases.value; + 'delfiles' 'string' { 'on','off', 'limited' } 'off'; + 'verbose' 'string' { 'on','off' } 'on'; + 'defaultdesign' 'string' { 'on','off','forceoff'} fastif(nargin < 3, 'on', 'off') }, ... + 'std_makedesign'); +if isstr(opt), error(opt); end; +if ~isempty(opt.dataselect), opt.datselect = opt.dataselect; end; +if strcmpi(opt.variable1, 'none'), opt.variable1 = ''; end; +if strcmpi(opt.variable2, 'none'), opt.variable2 = ''; end; +%if iscell(opt.values1), for i = 1:length(opt.values1), if iscell(opt.values1{i}), opt.values1{i} = cell2str(opt.values1{i}); end; end; end; +%if iscell(opt.values2), for i = 1:length(opt.values2), if iscell(opt.values2{i}), opt.values2{i} = cell2str(opt.values2{i}); end; end; end; + +% build command list for history +% ------------------------------ +listcom = { 'variable1' opt.variable1 'variable2' opt.variable2 'name' opt.name 'pairing1' opt.pairing1 'pairing2' opt.pairing2 'delfiles' opt.delfiles 'defaultdesign' opt.defaultdesign }; +if ~isempty(opt.values1), listcom = { listcom{:} 'values1' opt.values1 }; end; +if ~isempty(opt.values2), listcom = { listcom{:} 'values2' opt.values2 }; end; +if ~isempty(opt.subjselect), listcom = { listcom{:} 'subjselect' opt.subjselect }; end; +if ~isempty(opt.datselect), listcom = { listcom{:} 'datselect' opt.datselect }; end; +if ~isempty(opt.filepath), listcom = { listcom{:} 'filepath' opt.filepath }; end; +if ~isempty(opt.datselect), listcom = { listcom{:} 'datselect' opt.datselect }; end; + +% select specific subjects +% ------------------------ +datsubjects = { STUDY.datasetinfo.subject }; +if ~isempty(opt.subjselect) + allsubjects = opt.subjselect; +else + allsubjects = unique_bc( datsubjects ); +end; + +% delete design files +% --------------------- +if strcmpi(opt.delfiles, 'on') + myfprintf(opt.verbose, 'Deleting all files pertaining to design %d\n', designind); + for index = 1:length(ALLEEG) + files = fullfile(ALLEEG(index).filepath, sprintf(opt.verbose, 'design%d*.*', designind)); + files = dir(files); + for indf = 1:length(files) + delete(fullfile(ALLEEG(index).filepath, files(indf).name)); + end; + end; +elseif strcmpi(opt.delfiles, 'limited') + myfprintf(opt.verbose, 'Deleting all files for STUDY design %d\n', designind); + for index = 1:length(STUDY.design(designind).cell) + filedir = [ STUDY.design(designind).cell(index).filebase '.dat*' ]; + filepath = fileparts(filedir); + files = dir(filedir); + for indf = 1:length(files) + %disp(fullfile(filepath, files(indf).name)); + delete(fullfile(filepath, files(indf).name)); + end; + end; + for index = 1:length(STUDY.design(designind).cell) + filedir = [ STUDY.design(designind).cell(index).filebase '.ica*' ]; + filepath = fileparts(filedir); + files = dir(filedir); + for indf = 1:length(files) + %disp(fullfile(filepath, files(indf).name)); + delete(fullfile(filepath, files(indf).name)); + end; + end; +end; + +% check inputs +% ------------ +[indvars indvarvals ] = std_getindvar(STUDY); +if isfield(STUDY.datasetinfo, 'trialinfo') + alltrialinfo = { STUDY.datasetinfo.trialinfo }; + dattrialselect = cellfun(@(x)([1:length(x)]), alltrialinfo, 'uniformoutput', false); +else alltrialinfo = cell(length(STUDY.datasetinfo)); + for i=1:length(ALLEEG), dattrialselect{i} = [1:ALLEEG(i).trials]; end; +end; + +% get values for each independent variable +% ---------------------------------------- +m1 = strmatch(opt.variable1, indvars, 'exact'); if isempty(m1), opt.variable1 = ''; end; +m2 = strmatch(opt.variable2, indvars, 'exact'); if isempty(m2), opt.variable2 = ''; end; +if isempty(opt.values1) && ~isempty(opt.variable1), opt.values1 = indvarvals{m1}; end; +if isempty(opt.values2) && ~isempty(opt.variable2), opt.values2 = indvarvals{m2}; end; +if isempty(opt.variable1), opt.values1 = { '' }; end; +if isempty(opt.variable2), opt.values2 = { '' }; end; + +% preselect data +% -------------- +datselect = [1:length(STUDY.datasetinfo)]; +if ~isempty(opt.datselect) + myfprintf(opt.verbose, 'Data preselection for STUDY design\n'); + for ind = 1:2:length(opt.datselect) + [ dattmp dattrialstmp ] = std_selectdataset( STUDY, ALLEEG, opt.datselect{ind}, opt.datselect{ind+1}); + datselect = intersect_bc(datselect, dattmp); + dattrialselect = intersectcell(dattrialselect, dattrialstmp); + end; +end; +datselect = intersect_bc(datselect, strmatchmult(allsubjects, datsubjects)); + +% get the dataset and trials for each of the ind. variable +% -------------------------------------------------------- +ns = length(allsubjects); +nf1 = max(1,length(opt.values1)); +nf2 = max(1,length(opt.values2)); +myfprintf(opt.verbose, 'Building STUDY design\n'); +for n1 = 1:nf1, [ dats1{n1} dattrials1{n1} ] = std_selectdataset( STUDY, ALLEEG, opt.variable1, opt.values1{n1}, fastif(strcmpi(opt.verbose, 'on'), 'verbose', 'silent')); end; +for n2 = 1:nf2, [ dats2{n2} dattrials2{n2} ] = std_selectdataset( STUDY, ALLEEG, opt.variable2, opt.values2{n2}, fastif(strcmpi(opt.verbose, 'on'), 'verbose', 'silent')); end; + +% detect files from old format +% ---------------------------- +if ~strcmpi(opt.defaultdesign, 'forceoff') && isempty(opt.filepath) + if designind == 1 + if strcmpi(opt.defaultdesign, 'off') + if isfield(STUDY, 'design') && ( ~isfield(STUDY.design, 'cell') || ~isfield(STUDY.design(1).cell, 'filebase') ) + opt.defaultdesign = 'on'; + end; + end; + if isempty(dir(fullfile(ALLEEG(1).filepath, [ ALLEEG(1).filename(1:end-4) '.dat*' ]))) && ... + isempty(dir(fullfile(ALLEEG(1).filepath, [ ALLEEG(1).filename(1:end-4) '.ica*' ]))) + opt.defaultdesign = 'off'; + end; + else + opt.defaultdesign = 'off'; + end; +else + opt.defaultdesign = 'off'; +end; + +% scan subjects and conditions +% ---------------------------- +count = 1; +for n1 = 1:nf1 + for n2 = 1:nf2 + % create design for this set of conditions and subject + % ---------------------------------------------------- + datasets = intersect_bc(intersect(dats1{n1}, dats2{n2}), datselect); + if ~isempty(datasets) + subjects = unique_bc(datsubjects(datasets)); + for s = 1:length(subjects) + datsubj = datasets(strmatch(subjects{s}, datsubjects(datasets), 'exact')); + des.cell(count).dataset = datsubj; + des.cell(count).trials = intersectcell(dattrialselect(datsubj), dattrials1{n1}(datsubj), dattrials2{n2}(datsubj)); + des.cell(count).value = { opt.values1{n1} opt.values2{n2} }; + des.cell(count).case = subjects{s}; + defaultFile = fullfile(ALLEEG(datsubj(1)).filepath, ALLEEG(datsubj(1)).filename(1:end-4)); + dirres1 = dir( [ defaultFile '.dat*' ] ); + dirres2 = dir( [ defaultFile '.ica*' ] ); + if strcmpi(opt.defaultdesign, 'on') && (~isempty(dirres1) || ~isempty(dirres2)) && isempty(opt.filepath) + des.cell(count).filebase = defaultFile; + else + if isempty(rmblk(opt.values1{n1})), txtval = rmblk(opt.values2{n2}); + elseif isempty(rmblk(opt.values2{n2})) txtval = rmblk(opt.values1{n1}); + else txtval = [ rmblk(opt.values1{n1}) '_' rmblk(opt.values2{n2}) ]; + end; + if ~isempty(txtval), txtval = [ '_' txtval ]; end; + if ~isempty(subjects{s}), txtval = [ '_' rmblk(subjects{s}) txtval ]; end; + if isempty(opt.filepath), tmpfilepath = ALLEEG(datsubj(1)).filepath; else tmpfilepath = opt.filepath; end; + des.cell(count).filebase = fullfile(tmpfilepath, [ 'design' int2str(designind) txtval ] ); + des.cell(count).filebase = checkfilelength(des.cell(count).filebase); + end; + count = count+1; + end; + end; + end; +end; + +% create other fields for the design +% ---------------------------------- +if exist('des') ~= 1 + error( [ 'One of your design is empty. This could be because the datasets/subjects/trials' 10 ... + 'you have selected do not contain any of the selected independent variables values.' 10 ... + 'Check your data and datasets carefully for any missing information.' ]); +else + % check for duplicate entries in filebase + % --------------------------------------- + if length( { des.cell.filebase } ) > length(unique({ des.cell.filebase })) + if ~isempty(findstr('design_', des.cell(1).filebase)) + error('There is a problem with your STUDY, contact EEGLAB support'); + else + disp('Duplicate entry detected in new design, reinitializing design with new file names'); + if length(dbstack) > 10 + error('There is probably an issue with the folder names - move the files and try again'); + end; + [STUDY com] = std_makedesign(STUDY, ALLEEG, designind, orivarargin{:}, 'defaultdesign', 'forceoff'); + return; + end + end; + + %allval1 = unique_bc(cellfun(@(x)x{1}, { des.cell.value }, 'uniformoutput', false)); + %allval2 = unique_bc(cellfun(@(x)x{2}, { des.cell.value }, 'uniformoutput', false)); + des.name = opt.name; + des.filepath = opt.filepath; + des.variable(1).label = opt.variable1; + des.variable(2).label = opt.variable2; + des.variable(1).pairing = opt.pairing1; + des.variable(2).pairing = opt.pairing2; + des.variable(1).value = opt.values1; + des.variable(2).value = opt.values2; + des.include = opt.datselect; + des.cases.label = 'subject'; + des.cases.value = unique_bc( { des.cell.case }); +end; + +fieldorder = { 'name' 'filepath' 'variable' 'cases' 'include' 'cell' }; +des = orderfields(des, fieldorder); +try, + STUDY.design = orderfields(STUDY.design, fieldorder); +catch, + STUDY.design = []; +end; + +if ~isfield(STUDY, 'design') || isempty(STUDY.design) + STUDY.design = des; +else + STUDY.design(designind) = des; % fill STUDY.design +end; + +% select the new design in the STUDY output +% ----------------------------------------- +STUDY.currentdesign = designind; +STUDY = std_selectdesign(STUDY, ALLEEG, designind); + +% build output command +% -------------------- +com = sprintf('STUDY = std_makedesign(STUDY, ALLEEG, %d, %s);', designind, vararg2str( listcom ) ); + +% --------------------------------------------------- + +% return intersection of cell arrays +% ---------------------------------- +function res = intersectcell(a, b, c); +if nargin > 2 + res = intersectcell(a, intersectcell(b, c)); +else + for index = 1:length(a) + res{index} = intersect_bc(a{index}, b{index}); + end; +end; + +% perform multi strmatch +% ---------------------- +function res = strmatchmult(a, b); + res = []; + for index = 1:length(a) + res = [ res strmatch(a{index}, b, 'exact')' ]; + end; + +% remove blanks +% ------------- +function res = rmblk(a); + if iscell(a), a = cell2str(a); end; + if ~isstr(a), a = num2str(a); end; + res = a; + res(find(res == ' ')) = '_'; + res(find(res == '\')) = '_'; + res(find(res == '/')) = '_'; + res(find(res == ':')) = '_'; + res(find(res == ';')) = '_'; + res(find(res == '"')) = '_'; + +function strval = cell2str(vals); + strval = vals{1}; + for ind = 2:length(vals) + strval = [ strval ' - ' vals{ind} ]; + end; + +function tmpfile = checkfilelength(tmpfile); + if length(tmpfile) > 120, + tmpfile = tmpfile(1:120); + end; + +function myfprintf(verbose, varargin); + if strcmpi(verbose, 'on'), fprintf(varargin{:}); end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_maketrialinfo.m b/code/eeglab13_4_4b/functions/studyfunc/std_maketrialinfo.m new file mode 100644 index 0000000..9a29c81 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_maketrialinfo.m @@ -0,0 +1,127 @@ +% std_maketrialinfo() - create trial information structure using the +% .epoch structure of EEGLAB datasets +% +% Usage: +% >> STUDY = std_maketrialinfo(STUDY, ALLEEG); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% +% Inputs: +% STUDY - EEGLAB STUDY set updated. The fields which is created or +% updated is STUDY.datasetinfo.trialinfo +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, April 2010 + +% Copyright (C) Arnaud Delorme arno@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_maketrialinfo(STUDY, ALLEEG); + +%% test if .epoch field exist in ALLEEG structure +epochfield = cellfun(@isempty, { ALLEEG.epoch }); +if any(epochfield) + fprintf('Warning: some datasets are continuous and trial information cannot be created\n'); + return; +end; + +%% check if conversion of event is necessary +ff = {}; +flagConvert = true; +for index = 1:length(ALLEEG), ff = union(ff, fieldnames(ALLEEG(index).event)); end; +for iField = 1:length(ff) + + fieldChar = zeros(1,length(ALLEEG))*NaN; + for index = 1:length(ALLEEG) + if isfield(ALLEEG(index).event, ff{iField}) + if ischar(ALLEEG(index).event(1).(ff{iField})) + fieldChar(index) = 1; + else fieldChar(index) = 0; + end; + end; + end; + if ~all(fieldChar(~isnan(fieldChar)) == 1) && ~all(fieldChar(~isnan(fieldChar)) == 0) + % need conversion to char + for index = 1:length(ALLEEG) + if fieldChar(index) == 0 + if flagConvert, disp('Warning: converting some event fields to strings - this may be slow'); flagConvert = false; end; + for iEvent = 1:length(ALLEEG(index).event) + ALLEEG(index).event(iEvent).(ff{iField}) = num2str(ALLEEG(index).event(iEvent).(ff{iField})); + end; + end; + end; + end +end; + +%% Make trial info +for index = 1:length(ALLEEG) + tmpevent = ALLEEG(index).event; + eventlat = abs(eeg_point2lat( [ tmpevent.latency ], [ tmpevent.epoch ], ALLEEG(index).srate, [ALLEEG(index).xmin ALLEEG(index).xmax])); + events = ALLEEG(index).event; + ff = fieldnames(events); + ff = setdiff_bc(ff, { 'latency' 'urevent' 'epoch' }); + trialinfo = []; + + % process time locking event fields + % --------------------------------- + indtle = find(eventlat < 0.02); + epochs = [ events(indtle).epoch ]; + extractepoch = true; + if length(epochs) ~= ALLEEG(index).trials + + % special case where there are not the same number of time-locking + % event as there are data epochs + if length(unique(epochs)) ~= ALLEEG(index).trials + extractepoch = false; + disp('std_maketrialinfo: not the same number of time-locking events as trials, trial info ignored'); + else + % pick one event per epoch + [tmp tmpind] = unique_bc(epochs(end:-1:1)); % reversing the array ensures the first event gets picked + tmpind = length(epochs)+1-tmpind; + indtle = indtle(tmpind); + if length(indtle) ~= ALLEEG(index).trials + extractepoch = false; + disp('std_maketrialinfo: not the same number of time-locking events as trials, trial info ignored'); + end; + end; + end; + if extractepoch + commands = {}; + for f = 1:length(ff) + eval( [ 'eventvals = {events(indtle).' ff{f} '};' ]); + %if isnumeric(eventvals{1}) + % eventvals = cellfun(@num2str, eventvals, 'uniformoutput', false); + %end; + commands = { commands{:} ff{f} eventvals }; + end; + trialinfo = struct(commands{:}); + STUDY.datasetinfo(index).trialinfo = trialinfo; + end; + +% % same as above but 10 times slower +% for e = 1:length(ALLEEG(index).event) +% if eventlat(e) < 0.0005 % time locking event only +% epoch = events(e).epoch; +% for f = 1:length(ff) +% fieldval = getfield(events, {e}, ff{f}); +% trialinfo = setfield(trialinfo, {epoch}, ff{f}, fieldval); +% end; +% end; +% end; +end; + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_mergeclust.m b/code/eeglab13_4_4b/functions/studyfunc/std_mergeclust.m new file mode 100644 index 0000000..19c67e4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_mergeclust.m @@ -0,0 +1,87 @@ +% std_mergeclust() - Commandline function, to merge several clusters. +% Usage: +% >> [STUDY] = std_mergeclust(STUDY, ALLEEG, mrg_cls, name); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in the STUDY. +% ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% mrg_cls - clusters indexes to merge. +% Optional inputs: +% name - [string] a mnemonic cluster name for the merged cluster. +% {default: 'Cls #', where '#' is the next available cluster number}. +% +% Outputs: +% STUDY - the input STUDY set structure modified with the merged cluster. +% +% Example: +% >> mrg_cls = [3 7 9]; name = 'eyes'; +% >> [STUDY] = std_mergecluster(STUDY,ALLEEG, mrg_cls, name); +% Merge clusters 3, 7 and 9 to a new cluster named 'eyes'. +% +% See also pop_clustedit +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, July, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, July 11, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_mergeclust(STUDY, ALLEEG, mrg_cls, varargin) + +if isempty(varargin) | strcmpi(varargin,'') + name = 'Cls'; +else + name = varargin{1}; +end + +% Cannot merge clusters if any of the clusters is a 'Notclust' or 'Outlier' +% cluster, or if has children +comps = []; +sets = []; +for k = 1:length(mrg_cls) + if strncmpi('Notclust',STUDY.cluster(mrg_cls(k)).name,8) | strncmpi('Outliers',STUDY.cluster(mrg_cls(k)).name,8) | ... + ~isempty(STUDY.cluster(mrg_cls(k)).child) + warndlg2([ 'std_mergeclust: cannot merge clusters if one of the clusters '... + 'is a ''Notclust'' or ''Outliers'' cluster, or if it has children clusters.']); + end + parent{k} = STUDY.cluster(mrg_cls(k)).name; + comps = [comps STUDY.cluster(mrg_cls(k)).comps]; + sets = [sets STUDY.cluster(mrg_cls(k)).sets]; +end + +%sort by sets +[tmp,sind] = sort(sets(1,:)); +sets = sets(:,sind); +comps = comps(sind); +% sort component indexes within a set +diffsets = unique_bc(sets(1,:)); +for k = 1:length(diffsets) + ci = find(sets(1,:) == diffsets(k)); % find the compnents belonging to each set + [tmp,cind] = sort(comps(ci)); + comps(ci) = comps(ci(cind)); +end + +% Create a new empty cluster +[STUDY] = std_createclust(STUDY, ALLEEG, name); +% Update merge cluster with parent clusters +STUDY.cluster(end).parent = parent; +STUDY.cluster(end).sets = sets; % Update merge cluster with merged component sets +STUDY.cluster(end).comps = comps; % Update merge cluster with the merged components +for k = 1:length(mrg_cls) % update the merge cluster as a child for the parent clusters + STUDY.cluster(mrg_cls(k)).child{end + 1} = STUDY.cluster(end).name; +end +STUDY = std_selectdesign(STUDY, ALLEEG, STUDY.currentdesign); + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_movecomp.m b/code/eeglab13_4_4b/functions/studyfunc/std_movecomp.m new file mode 100644 index 0000000..60a3849 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_movecomp.m @@ -0,0 +1,136 @@ +% std_movecomp() - Move ICA component(s) from one cluster to another. +% +% Usage: +% >> [STUDY] = std_movecomp(STUDY, ALLEEG, from_cluster, to_cluster, comps); +% Inputs: +% STUDY - STUDY structure comprising all or some of the EEG datasets in ALLEEG. +% ALLEEG - vector of EEG structures in the STUDY, typically created using +% load_ALLEEG(). +% from_cluster - index of the cluster components are to be moved from. +% to_cluster - index of the cluster components are to be moved to. +% comps - [int vector] indices of from_cluster components to move. +% +% Outputs: +% STUDY - input STUDY structure with modified component reassignments. +% +% Example: +% >> [STUDY] = std_movecomp(STUDY, ALLEEG, 10, 7, [2 7]); +% % Move components 2 and 7 of Cluster 10 to Cluster 7. +% +% See also: pop_clustedit +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 07, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_movecomp(STUDY, ALLEEG, old_clus, new_clus, comps) +icadefs; + +% Cannot move components if clusters have children clusters +if ~isempty(STUDY.cluster(old_clus).child) | ~isempty(STUDY.cluster(new_clus).child) + warndlg2('Cannot move components if clusters have children clusters!' , 'Aborting move components'); + return; +end +if isempty(STUDY.cluster(old_clus).parent) | isempty(STUDY.cluster(new_clus).parent) % The Parent cluster + warndlg2('Cannot move components to or from the Parent cluster - off all components in STUDY!' , 'Aborting move components'); + return; +end +% Cannot move components if clusters have different parent +% clusters (didn'y come from the same level of clustering), +% unless the cluster, components are moved to, is an empty new cluster. +if (length(STUDY.cluster(old_clus).parent) ~= length(STUDY.cluster(new_clus).parent)) & ~strcmp(STUDY.cluster(new_clus).parent, 'manual') + warndlg2(strvcat('Cannot move components if clusters have different parent clusters!', ... + 'This limitation will be fixed in the future'), 'Aborting move components'); + return; +end +% Check if all parents are the same +if (~strcmp(STUDY.cluster(new_clus).parent, 'manual')) + if ~(sum(strcmp(STUDY.cluster(old_clus).parent, STUDY.cluster(new_clus).parent)) == length(STUDY.cluster(new_clus).parent))% different parent + warndlg2(strvcat('Cannot move components if clusters have different parent clusters!', ... + 'This limitation will be fixed in the future') , 'Aborting move components'); + return; + end +end +for ci = 1:length(comps) + comp = STUDY.cluster(old_clus).comps(comps(ci)); + sets = STUDY.cluster(old_clus).sets(:,comps(ci)); + fprintf('Moving component %d from cluster %d to cluster %d, centroids will be recomputed\n',comp, old_clus, new_clus); + + %update new cluster + indcomp = length(STUDY.cluster(new_clus).comps)+1; + STUDY.cluster(new_clus).comps(indcomp) = comp;%with comp index + STUDY.cluster(new_clus).sets(:,indcomp) = sets; %with set indices + if strcmpi(STUDY.cluster(new_clus).parent, 'manual') + STUDY.cluster(new_clus).preclust.preclustparams = STUDY.cluster(old_clus).preclust.preclustparams; + STUDY.cluster(new_clus).parent = STUDY.cluster(old_clus).parent; + STUDY.cluster(find(strcmp({STUDY.cluster.name},STUDY.cluster(new_clus).parent))).child{end+1} = STUDY.cluster(new_clus).name; + end + + % update preclustering array + % -------------------------- + if strncmpi('Notclust',STUDY.cluster(old_clus).name,8) + STUDY.cluster(new_clus).preclust.preclustparams = []; + STUDY.cluster(new_clus).preclust.preclustdata = []; + STUDY.cluster(new_clus).preclust.preclustcomp = []; + disp('Important warning: pre-clustering information removed for target cluster'); + disp('(this is because the component moved had no pre-clustering data associated to it)'); + elseif ~strncmpi('Notclust',STUDY.cluster(new_clus).name,8) + STUDY.cluster(new_clus).preclust.preclustdata(indcomp,:) = STUDY.cluster(old_clus).preclust.preclustdata(comps(ci),:); %with preclustdata + end; + + % sort by sets + % ------------ + [tmp,sind] = sort(STUDY.cluster(new_clus).sets(1,:)); + STUDY.cluster(new_clus).sets = STUDY.cluster(new_clus).sets(:,sind); + STUDY.cluster(new_clus).comps = STUDY.cluster(new_clus).comps(sind); + if ~isempty(STUDY.cluster(new_clus).preclust.preclustdata) + STUDY.cluster(new_clus).preclust.preclustdata(sind,:) = STUDY.cluster(new_clus).preclust.preclustdata(:,:); + end +end +%STUDY.cluster(new_clus).centroid = []; % remove centroid +STUDY = rm_centroid(STUDY, new_clus); +STUDY = rm_centroid(STUDY, old_clus); + +% Remove data from old cluster +% left_comps - are all the components of the cluster after the +% components that were moved to the new cluster were removed. +left_comps = find(~ismember([1:length(STUDY.cluster(old_clus).comps)],comps)); +STUDY.cluster(old_clus).comps = STUDY.cluster(old_clus).comps(left_comps); +STUDY.cluster(old_clus).sets = STUDY.cluster(old_clus).sets(:,left_comps); +if ~isempty(STUDY.cluster(old_clus).preclust.preclustdata) + try, + STUDY.cluster(old_clus).preclust.preclustdata = STUDY.cluster(old_clus).preclust.preclustdata(left_comps,:); + catch, % this generates an unknown error but I was not able to reproduce it - AD Sept. 26, 2009 + end; +end; + +% update the component indices +% ---------------------------- +STUDY = std_selectdesign(STUDY, ALLEEG, STUDY.currentdesign); +disp('Done.'); + +% remove cluster information +% -------------------------- +function STUDY = rm_centroid(STUDY, clsindex) + + keepfields = { 'name' 'parent' 'child' 'comps' 'sets' 'algorithm' 'preclust' }; + allfields = fieldnames(STUDY.cluster); + for index = 1:length(allfields) + if isempty(strmatch(allfields{index}, keepfields)) + STUDY.cluster = setfield( STUDY.cluster, { clsindex }, allfields{index}, []); + end; + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_moveoutlier.m b/code/eeglab13_4_4b/functions/studyfunc/std_moveoutlier.m new file mode 100644 index 0000000..01521b2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_moveoutlier.m @@ -0,0 +1,62 @@ +% std_moveoutlier() - Commandline function, to reassign specified outlier component(s) +% from a cluster to its outlier cluster. +% Usage: +% >> STUDY = std_moveoutlier(STUDY, ALLEEG, from_cluster, comps); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in the STUDY. +% ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% from_cluster - cluster number, the cluster outlier components are moved from. +% comps - [numeric vector] component indices in the from_cluster to move. +% +% Outputs: +% STUDY - the input STUDY set structure modified with the components reassignment. +% +% Example: +% >> from_cluster = 10; comps = [2 7]; +% >> STUDY = std_movecomp(STUDY,ALLEEG, from_cluster, to_cluster, comps); +% Components 2 and 7 of cluster 10 are moved to the its outlier cluster ('Outliers Cls 10'). +% +% See also pop_clustedit +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 07, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_moveoutlier(STUDY, ALLEEG, old_clus, comps) + +% Cannot move components if the cluster is either a 'Notclust' or +% 'Outliers' cluster +if strncmpi('Notclust',STUDY.cluster(old_clus).name,8) | strncmpi('Outliers',STUDY.cluster(old_clus).name,8) + warndlg2('std_moveoutlier: cannot move components from Notclust or Outliers cluster'); + return; +end + +% Cannot move components if clusters have children clusters +if ~isempty(STUDY.cluster(old_clus).child) + warndlg2('Cannot move components if cluster has children clusters!' , 'Aborting remove outliers'); + return; +end + +outlier_clust = std_findoutlierclust(STUDY,old_clus); %find the outlier cluster for this cluster +if outlier_clust == 0 %no such cluster exist + STUDY = std_createclust(STUDY, ALLEEG, ['Outliers ' STUDY.cluster(old_clus).name]); %create an outlier cluster + outlier_clust = length(STUDY.cluster); +end + +%move the compnents to the outliers cluster +STUDY = std_movecomp(STUDY, ALLEEG, old_clus, outlier_clust, comps); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_movie.m b/code/eeglab13_4_4b/functions/studyfunc/std_movie.m new file mode 100644 index 0000000..8722dee --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_movie.m @@ -0,0 +1,132 @@ +% std_topomovie - make movie in the frequency domain +% +% Usage: +% >> [STUDY] = std_movie(STUDY, ALLEEG, key1, val1, key2, val2, ...); +% +% Inputs: +% STUDY - STUDY structure comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - vector of EEG dataset structures for the dataset(s) in the STUDY, +% typically created using load_ALLEEG(). +% 'channels' - [numeric vector] specific channel group to plot. By +% default, the grand mean channel spectrum is plotted (using the +% same format as for the cluster component means described above) +% 'moviemode' - ['erp'|'spec'|'ersptime'] movie mode. Currently only +% 'spec' is implemented. +% 'erspfreq' - [min max] frequency range when making movie of ERSP. The +% ERSP values are averaged over the selected frequency +% range. Not implemented +% 'limitbeg' - [min max] limits at the beginning of the movie +% 'limitend' - [min max] limits at the end of the movie +% 'freqslim' - [freqs] array of landmark frequencies to set color +% limits. +% 'movieparams' - [low inc high] lower limit, higher limit and increment. If +% increment is omited, movie is generate at every possible +% increment (max freq resolution or max time resolution) +% +% Authors: Arnaud Delorme, CERCO, August, 2006 +% +% See also: std_specplot(), std_erppplot(), std_erspplot() + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, M] = std_movie(STUDY, ALLEEG, varargin); + +if nargin < 2 + help std_specplot; + return; +end; + +[opt addparams ] = finputcheck( varargin, ... + { 'erspfreq' 'real' [] []; + 'movieparams' 'real' [] []; + 'channels' 'cell' [] {}; + 'freqslim' 'real' [] []; + 'limitbeg' 'real' [] []; + 'limitend' 'real' [] []; + 'moviemode' 'string' { 'ersptime','erp','spec' } 'spec' }, 'std_movie', 'ignore'); + +if isstr(opt), error(opt); end; +tmpchanlocs = ALLEEG(1).chanlocs; +if isempty(opt.channels), opt.channels = { tmpchanlocs.labels }; end; +if ~strcmpi(opt.moviemode, 'spec'), error('Only spec has been implemented so far'); end; + +% read data once +% -------------- +STUDY = std_specplot(STUDY, ALLEEG, 'channels', opt.channels, 'topofreq', [10 11]); close; + +% find first data channel with info +% --------------------------------- +for cind = 1:length(STUDY.changrp) + if ~isempty(STUDY.changrp(cind).specdata), break; end; +end; + +% generate movie +% -------------- +if isempty(opt.movieparams), + opt.movieparams(1) = STUDY.changrp(cind).specfreqs(1); + opt.movieparams(2) = STUDY.changrp(cind).specfreqs(end); +end; +if length(opt.movieparams) == 2 + opt.movieparams(3) = opt.movieparams(2); + opt.movieparams(2) = STUDY.changrp(cind).specfreqs(2)-STUDY.changrp(cind).specfreqs(1); +end; +if length(opt.movieparams) == 3 + opt.movieparams = [opt.movieparams(1):opt.movieparams(2):opt.movieparams(3)]; +end; + +% find limits +% ----------- +if isempty(opt.limitbeg) + [STUDY specdata] = std_specplot(STUDY, ALLEEG, 'channels', opt.channels, 'topofreq', opt.movieparams(1)); close; + opt.limitbeg = [ min(specdata{1}) max(specdata{1}) ]; + [STUDY specdata] = std_specplot(STUDY, ALLEEG, 'channels', opt.channels, 'topofreq', opt.movieparams(end)); close; + opt.limitend = [ min(specdata{1}) max(specdata{1}) ]; +end; +lowlims = linspace(opt.limitbeg(1), opt.limitend(1), length(opt.movieparams)); +highlims = linspace(opt.limitbeg(2), opt.limitend(2), length(opt.movieparams)); + +% limits at specific frequencies +% ------------------------------ +if ~isempty(opt.freqslim) + if opt.freqslim(1) ~= opt.movieparams(1) , opt.freqslim = [ opt.movieparams(1) opt.freqslim ]; end; + if opt.freqslim(end) ~= opt.movieparams(end), opt.freqslim = [ opt.freqslim opt.movieparams(end) ]; end; + + for ind = 1:length(opt.freqslim) + [tmp indf(ind)] = min(abs(opt.freqslim(ind) - opt.movieparams)); + [STUDY specdata] = std_specplot(STUDY, ALLEEG, 'channels', opt.channels, 'topofreq', opt.movieparams(indf(ind))); close; + minimum(ind) = min(specdata{1}); + maximum(ind) = max(specdata{1}); + end; + indf(1) = 0; + lowlims = [ ]; + highlims = [ ]; + for ind = 2:length(opt.freqslim) + lowlims = [lowlims linspace(minimum(ind-1), minimum(ind), indf(ind)-indf(ind-1)) ]; + highlims = [highlims linspace(maximum(ind-1), maximum(ind), indf(ind)-indf(ind-1)) ]; + end; +end; + +% make movie +% ---------- +for ind = 1:length(opt.movieparams) + STUDY = std_specplot(STUDY, ALLEEG, 'channels', opt.channels, 'topofreq', opt.movieparams(ind), 'caxis', [lowlims(ind) highlims(ind)]); + pos = get(gcf, 'position'); + set(gcf, 'position', [pos(1) pos(2) pos(3)*2 pos(4)*2]); + M(ind) = getframe(gcf); + close; +end; +figure; axis off; movie(M); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_pac.m b/code/eeglab13_4_4b/functions/studyfunc/std_pac.m new file mode 100644 index 0000000..a6efa19 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_pac.m @@ -0,0 +1,323 @@ +% std_pac() - Compute or read PAC data (Phase Amplitude Coupling). +% +% Usage: +% >> [X times logfreqs ] = std_pac(EEG, 'key', 'val', ...); +% Inputs: +% EEG - an EEG dataset structure. +% +% Optional inputs: +% 'components1'- [numeric vector] components in the EEG structure used +% for spectral amplitude in PAC {default|[]: all } +% 'components2'- [numeric vector] components in the EEG structure used +% for phase in PAC {default|[]: all } +% 'channels1' - [numeric vector or cell array of channel labels] channels +% in the EEG structure for spectral amplitude in PAC +% {default|[]: no channels} +% 'channels2' - [numeric vector or cell array of channel labels] channels +% in the EEG structure for phase in PAC +% {default|[]: no channels} +% 'freqs' - [minHz maxHz] the PAC frequency range to compute power. +% {default: 12 to EEG sampling rate divided by 2} +% 'cycles' - [wavecycles (factor)]. If 0 -> DFT (constant window length +% across frequencies). +% If >0 -> the number of cycles in each analysis wavelet. +% If [wavecycles factor], wavelet cycles increase with +% frequency, beginning at wavecyles. (0 < factor < 1) +% factor = 0 -> fixed epoch length (DFT, as in FFT). +% factor = 1 -> no increase (standard wavelets) +% {default: [0]} +% 'freqphase' - [valHz] single number for computing the phase at a given +% frequency. +% 'cyclephase' - [valcycle] single cycle number. +% 'timewindow' - [minms maxms] time window (in ms) to plot. +% {default: all output latencies} +% 'padratio' - (power of 2). Multiply the number of output frequencies +% by dividing their frequency spacing through 0-padding. +% Output frequency spacing is (low_freq/padratio). +% 'recompute' - ['on'|'off'] 'on' forces recomputation of PAC. +% {default: 'off'} +% +% Other optional inputs: +% This function will take any of the newtimef() optional inputs (for instance +% to compute log-space frequencies)... +% +% Outputs: +% X - the PAC of the requested ICA components/channels +% in the selected frequency and time range. +% times - vector of time points for which the PAC were computed. +% freqs - vector of frequencies (in Hz) at which the +% PAC was evaluated. +% +% Files written or modified: +% [dataset_filename].icapac <-- saved component PAC +% OR for channels +% [dataset_filename].datpac <-- saved channel PAC +% +% See also: timef(), std_itc(), std_erp(), std_spec(), std_topo(), std_preclust() +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, July, 2009- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [X, times, freqs, parameters] = std_pac(EEG, varargin) + +if nargin < 1 + help std_pac; + return; +end; + +options = {}; +[g timefargs] = finputcheck(varargin, { ... + 'components1' 'integer' [] []; + 'channels1' { 'cell','integer' } { [],[] } {}; + 'components2' 'integer' [] []; + 'channels2' { 'cell','integer' } { [],[] } {}; + 'outputfile' 'string' [] ''; + 'powbase' 'real' [] []; + 'plot' 'string' { 'on','off' } 'off'; + 'recompute' 'string' { 'on','off' } 'off'; + 'getparams' 'string' { 'on','off' } 'off'; + 'timerange' 'real' [] []; + 'freqrange' 'real' [] []; + 'padratio' 'real' [] 1; + 'freqs' 'real' [] [12 EEG.srate/2]; + 'cycles' 'real' [] [8]; + 'freqphase' 'real' [] [5]; + 'cyclephase' 'real' [] [3]; + 'interp' 'struct' { } struct([]); + 'rmcomps' 'integer' [] []; + 'freqscale' 'string' [] 'log' }, 'std_pac', 'ignore'); +if isstr(g), error(g); end; + +% checking input parameters +% ------------------------- +if isempty(g.components1) & isempty(g.channels1) + if isempty(EEG(1).icaweights) + error('EEG.icaweights not found'); + end + g.components1 = 1:size(EEG(1).icaweights,1); + g.components2 = 1:size(EEG(1).icaweights,1); + disp('Computing PAC with default values for all components of the dataset'); +end + +% select ICA components or data channels +% -------------------------------------- +if ~isempty(g.outputfile) + filenamepac = fullfile('', [ g.outputfile '.datpac' ]); + g.indices1 = std_chaninds(EEG, g.channels1); + g.indices2 = std_chaninds(EEG, g.channels2); + prefix = 'chan'; +elseif ~isempty(g.components1) + g.indices1 = g.components1; + g.indices2 = g.components2; + prefix = 'comp'; + filenamepac = fullfile(EEG.filepath, [ EEG.filename(1:end-3) 'icapac' ]); + if ~isempty(g.channels1) + error('Cannot compute PAC for components and channels at the same time'); + end; +elseif ~isempty(g.channels1) + g.indices1 = std_chaninds(EEG, g.channels1); + g.indices2 = std_chaninds(EEG, g.channels2); + prefix = 'chan'; + filenamepac = fullfile(EEG.filepath, [ EEG.filename(1:end-3) 'datpac' ]); +end; + +% Compute PAC parameters +% ----------------------- +parameters = { 'wavelet', g.cycles, 'padratio', g.padratio, ... + 'freqs2', g.freqphase, 'wavelet2', g.cyclephase, 'freqscale', g.freqscale, timefargs{:} }; +if length(g.freqs)>0, parameters = { parameters{:} 'freqs' g.freqs }; end; + +% Check if PAC information found in datasets and if fits requested parameters +% ---------------------------------------------------------------------------- +if exist( filenamepac ) & strcmpi(g.recompute, 'off') + fprintf('Use existing file for PAC: %s\n', filenamepac); + if ~isempty(g.components1) + [X, times, freqs, parameters] = std_readpac(EEG, 1, g.indices1, g.indices2, g.timerange, g.freqrange); + else [X, times, freqs, parameters] = std_readpac(EEG, 1, -g.indices1, -g.indices2, g.timerange, g.freqrange); + end; + return; +end; + +% return parameters +% ----------------- +if strcmpi(g.getparams, 'on') + X = []; times = []; freqs = []; + return; +end; + +options = {}; +if ~isempty(g.components1) + tmpdata = eeg_getdatact(EEG, 'component', [1:size(EEG(1).icaweights,1)]); +else + EEG.data = eeg_getdatact(EEG, 'channel', [1:EEG.nbchan], 'rmcomps', g.rmcomps); + if ~isempty(g.rmcomps), options = { options{:} 'rmcomps' g.rmcomps }; end; + if ~isempty(g.interp), + EEG = eeg_interp(EEG, g.interp, 'spherical'); + options = { options{:} 'interp' g.interp }; + end; + tmpdata = EEG.data; +end; + +% Compute PAC +% ----------- +all_pac = []; +for k = 1:length(g.indices1) % for each (specified) component + for l = 1:length(g.indices2) % for each (specified) component + tmpparams = parameters; + + % Run pac() to get PAC + % -------------------- + timefdata1 = tmpdata(g.indices1(k),:,:); + timefdata2 = tmpdata(g.indices2(l),:,:); + if strcmpi(g.plot, 'on'), figure; end; + %[logersp,logitc,logbase,times,logfreqs,logeboot,logiboot,alltfX] ... + [pacvals, times, freqs1, freqs2] = pac( timefdata1, timefdata2, EEG(1).srate, 'tlimits', [EEG.xmin EEG.xmax]*1000, tmpparams{1:end}); + all_pac = setfield( all_pac, [ prefix int2str(g.indices1(k)) '_' int2str(g.indices2(l)) '_pac' ], squeeze(single(pacvals ))); + end; +end + +% Save PAC into file +% ------------------ +all_pac.freqs = freqs1; +all_pac.times = times; +all_pac.datatype = 'PAC'; +all_pac.parameters = tmpparams; + +if ~isempty(g.channels1) + if ~isempty(EEG(1).chanlocs) + tmpchanlocs = EEG(1).chanlocs; + all_pac.chanlabels1 = { tmpchanlocs(g.indices1).labels }; + all_pac.chanlabels2 = { tmpchanlocs(g.indices2).labels }; + end; +end; + +std_savedat( filenamepac , all_pac ); +if ~isempty(g.components1) + [X, times, freqs, parameters] = std_readpac(EEG, 1, g.indices1, g.indices2, g.timerange, g.freqrange); +else [X, times, freqs, parameters] = std_readpac(EEG, 1, -g.indices1, -g.indices2, g.timerange, g.freqrange); +end; + +% -------------------------------------------------------- +% -------------------- READ PAC DATA --------------------- +% -------------------------------------------------------- +function [pacvals, freqs, timevals, params] = std_readpac(ALLEEG, abset, comp1, comp2, timewindow, freqrange); + +if nargin < 5 + timewindow = []; +end; +if nargin < 6 + freqrange = []; +end; + +% multiple entry +% -------------- +if length(comp1) > 1 | length(comp2) > 1 + for index1 = 1:length(comp1) + for index2 = 1:length(comp2) + [tmppac, freqs, timevals, params] = std_readpac(ALLEEG, abset, comp1(index1), comp2(index2), timewindow, freqrange); + pacvals(index1,index2,:,:,:) = tmppac; + end; + end; + return; +end; + +for k = 1: length(abset) + + if comp1 < 0 + filename = fullfile( ALLEEG(abset(k)).filepath,[ ALLEEG(abset(k)).filename(1:end-3) 'datpac']); + comp1 = -comp1; + comp2 = -comp2; + prefix = 'chan'; + else + filename = fullfile( ALLEEG(abset(k)).filepath,[ ALLEEG(abset(k)).filename(1:end-3) 'icapac']); + prefix = 'comp'; + end; + try + tmppac = load( '-mat', filename, 'parameters', 'times', 'freqs'); + catch + error( [ 'Cannot read file ''' filename '''' ]); + end; + + tmppac.parameters = removedup(tmppac.parameters); + params = struct(tmppac.parameters{:}); + params.times = tmppac.times; + params.freqs = tmppac.freqs; + if isempty(comp1) + pacvals = []; + freqs = []; + timevals = []; + return; + end; + tmppac = load( '-mat', filename, 'parameters', 'times', 'freqs', ... + [ prefix int2str(comp1) '_' int2str(comp2) '_pac']); + + pacall{k} = double(getfield(tmppac, [ prefix int2str(comp1) '_' int2str(comp2) '_pac'])); + tlen = length(tmppac.times); + flen = length(tmppac.freqs); + +end + +% select plotting or clustering time/freq range +% --------------------------------------------- +if ~isempty(timewindow) + if timewindow(1) > tmppac.times(1) | timewindow(end) < tmppac.times(end) + maxind = max(find(tmppac.times <= timewindow(end))); + minind = min(find(tmppac.times >= timewindow(1))); + else + minind = 1; + maxind = tlen; + end +else + minind = 1; + maxind = tlen; +end +if ~isempty(freqrange) + if freqrange(1) > exp(1)^tmppac.freqs(1) | freqrange(end) < exp(1)^tmppac.freqs(end) + fmaxind = max(find(tmppac.freqs <= freqrange(end))); + fminind = min(find(tmppac.freqs >= freqrange(1))); + else + fminind = 1; + fmaxind = flen; + end +else + fminind = 1; + fmaxind = flen; +end + +% return parameters +% ---------------- +for cond = 1:length(abset) + try + pac = pacall{cond}(fminind:fmaxind,minind:maxind); + catch + pac = pacall{cond}; % for 'method', 'latphase' + end; + pacvals(:,:,cond) = pac; +end; +freqs = tmppac.freqs(fminind:fmaxind); +timevals = tmppac.times(minind:maxind); + +% remove duplicates in the list of parameters +% ------------------------------------------- +function cella = removedup(cella) + [tmp indices] = unique_bc(cella(1:2:end)); + if length(tmp) ~= length(cella)/2 + %fprintf('Warning: duplicate ''key'', ''val'' parameter(s), keeping the last one(s)\n'); + end; + cella = cella(sort(union(indices*2-1, indices*2))); + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_pacplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_pacplot.m new file mode 100644 index 0000000..9a99093 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_pacplot.m @@ -0,0 +1,44 @@ +% std_pacplot() - Commandline function to plot cluster PAC +% (phase-amplitude coupling). +% +% Usage: +% >> [STUDY] = std_pacplot(STUDY, ALLEEG, key1, val1, key2, val2); +% >> [STUDY itcdata itctimes itcfreqs pgroup pcond pinter] = ... +% std_pacplot(STUDY, ALLEEG ...); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the datasets in the STUDY. +% Note: ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% +% Additional help: +% Inputs and output of this function are strictly identical to the std_erspplot(). +% See the help message of this function for more information. +% +% See also: std_erspplot(), pop_clustedit(), pop_preclust() +% +% Authors: Arnaud Delorme, CERCO, July, 2009- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, allpac, alltimes, allfreqs, pgroup, pcond, pinter] = std_pacplot(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_pacplot; + return; +end; + +[STUDY allpac alltimes allfreqs pgroup pcond pinter ] = std_erspplot(STUDY, ALLEEG, 'datatype', 'pac', varargin{:}); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_plot.m b/code/eeglab13_4_4b/functions/studyfunc/std_plot.m new file mode 100644 index 0000000..cc1e88e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_plot.m @@ -0,0 +1,24 @@ +% std_plot() - This function is outdated. Use std_plottf() to plot time/ +% frequency decompositions and function std_plotcurve() to +% plot erp and spectrum. + +% Copyright (C) 2006 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [pgroup, pcond, pinter] = std_plot(allx, data, varargin) + +help std_plot; +return; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_plotcurve.m b/code/eeglab13_4_4b/functions/studyfunc/std_plotcurve.m new file mode 100644 index 0000000..f0fa66e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_plotcurve.m @@ -0,0 +1,550 @@ +% std_plotcurve() - plot ERP or spectral traces for a STUDY component +% or channel cluster +% Usage: +% >> std_plotcurve( axvals, data, 'key', 'val', ...) +% Inputs: +% axvals - [vector or cell array] axis values for the data. +% data - [cell array] mean data for each subject group and/or data +% condition. For example, to plot mean ERPs from a STUDY +% for epochs of 800 frames in two conditions from three groups +% of 12 subjects: +% +% >> data = { [800x12] [800x12] [800x12];... % 3 groups, cond 1 +% [800x12] [800x12] [800x12] }; % 3 groups, cond 2 +% >> std_plotcurve(erp_ms,data); +% +% By default, parametric statistics are computed across subjects +% in the three groups. (group,condition) ERP averages are plotted. +% See below and >> help statcond +% for more information about the statistical computations. For +% plotting multiple channels, use the second dimension. For +% example data = { [800x64x12] [800x64x12] } for 12 subjects, +% 64 channels and 800 data points. The 'chanlocs' option must be +% used as well to specify channel positions. +% +% Optional display parameters: +% 'datatype' - ['erp'|'spec'] data type {default: 'erp'} +% 'titles' - [cell array of string] titles for each of the subplots. +% { default: none} +% +% Statistics options: +% 'groupstats' - [cell] One p-value array per group {default: {}} +% 'condstats' - [cell] One p-value array per condition {default: {}} +% 'interstats' - [cell] Interaction p-value arrays {default: {}} +% 'threshold' - [NaN|real<<1] Significance threshold. NaN -> plot the +% p-values themselves on a different figure. When possible, +% significance regions are indicated below the data. +% {default: NaN} +% +% Curve plotting options (ERP and spectrum): +% 'plotgroups' - ['together'|'apart'] 'together' -> plot mean results +% for subject groups in the same figure panel in different +% colors. 'apart' -> plot group results on different figure +% panels {default: 'apart'} +% 'plotconditions' - ['together'|'apart'] 'together' -> plot mean results +% for data conditions on the same figure panel in +% different +% colors. 'apart' -> plot conditions on different figure +% panel. Note: 'plotgroups' and 'plotconditions' arguments +% cannot both be 'together' {default: 'apart'} +% 'legend' - ['on'|'off'] turn plot legend on/off {default: 'off'} +% 'colors' - [cell] cell array of colors +% 'plotdiff' - ['on'|'off'] plot difference between two groups +% or conditions plotted together. +% 'plotstderr' - ['on'|'off'|'diff'|'nocurve'|'diffnocurve'] plots in +% a surface indicating the standard error. 'diff' only +% does it for the difference (requires 'plotdiff' 'on' +% above). 'nocurve' does not plot the mean. This functionality +% does not work for all data configuration {default: 'off'} +% 'figure' - ['on'|'off'] creates a new figure ('on'). The 'off' mode +% plots all of the groups and conditions on the same pannel. +% 'plotsubjects' - ['on'|'off'] overplot traces for individual components +% or channels {default: 'off'} +% 'singlesubject' - ['on'|'off'] set to 'on' to plot single subject. +% {default: 'off'} +% 'ylim' - [min max] ordinate limits for ERP and spectrum plots +% {default: all available data} +% +% Scalp map plotting options: +% 'chanlocs' - [struct] channel locations structure +% +% Author: Arnaud Delorme, CERCO, CNRS, 2006- +% +% See also: pop_erspparams(), pop_erpparams(), pop_specparams(), statcond() + +function std_plotcurve(allx, data, varargin) + +pgroup = []; +pcond = []; +pinter = []; +if nargin < 2 + help std_plotcurve; + return; +end; + +opt = finputcheck( varargin, { 'ylim' 'real' [] []; + 'filter' 'real' [] []; + 'threshold' 'real' [] NaN; + 'unitx' 'string' [] 'ms'; + 'chanlocs' 'struct' [] struct('labels', {}); + 'plotsubjects' 'string' { 'on','off' } 'off'; + 'condnames' 'cell' [] {}; % just for legends + 'groupnames' 'cell' [] {}; % just for legends + 'groupstats' 'cell' [] {}; + 'condstats' 'cell' [] {}; + 'interstats' 'cell' [] {}; + 'titles' 'cell' [] {}; + 'colors' 'cell' [] {}; + 'figure' 'string' { 'on','off' } 'on'; + 'plottopo' 'string' { 'on','off' } 'off'; + 'plotstderr' 'string' { 'on','off','diff','nocurve' } 'off'; + 'plotdiff' 'string' { 'on','off' } 'off'; + 'legend' { 'string','cell' } { { 'on','off' } {} } 'off'; + 'datatype' 'string' { 'ersp','itc','erp','spec' } 'erp'; + 'plotgroups' 'string' { 'together','apart' } 'apart'; + 'plotmode' 'string' { 'test','condensed' } 'test'; % deprecated + 'plotconditions' 'string' { 'together','apart' } 'apart' }, 'std_plotcurve'); + +% opt.figure = 'off'; % test by nima +if isstr(opt), error(opt); end; +opt.singlesubject = 'off'; +if length(opt.chanlocs) > 1, opt.plottopo = 'on'; end; +if strcmpi(opt.plottopo, 'on') && size(data{1},3) == 1, opt.singlesubject = 'on'; end; +%if size(data{1},2) == 1, opt.singlesubject = 'on'; end; +if all(all(cellfun('size', data, 2)==1)) opt.singlesubject = 'on'; end; +if any(any(cellfun('size', data, 2)==1)), opt.groupstats = {}; opt.condstats = {}; end; +if strcmpi(opt.datatype, 'spec'), opt.unit = 'Hz'; end; +if strcmpi(opt.plotsubjects, 'on') + opt.plotgroups = 'apart'; + opt.plotconditions = 'apart'; +end; +if strcmpi(opt.plotconditions, 'together') && ~isempty(opt.groupstats), opt.plotconditions = 'apart'; end; +if strcmpi(opt.plotgroups, 'together') && ~isempty(opt.condstats) , opt.plotgroups = 'apart'; end; +if isstr(opt.legend), opt.legend = {}; end; +if isempty(opt.titles), opt.titles = cell(10,10); opt.titles(:) = { '' }; end; +if length(data(:)) == length(opt.legend(:)), + opt.legend = reshape(opt.legend, size(data))'; + opt.legend(cellfun(@isempty, data)) = []; + opt.legend = (opt.legend)'; +end; + +% color matrix +% ----------------------- +onecol = { 'b' 'b' 'b' 'b' 'b' 'b' 'b' 'b' 'b' 'b' }; +manycol = { 'b' 'g' 'm' 'c' 'r' 'k' 'y' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' ... + 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' 'r' 'b' 'g' 'c' 'm' }; +modifier = { '-' '--' '-.' ':' '-' '--' '-.' ':' '-' '--' '-.' ':' }; +if strcmpi(opt.plotgroups, 'together') || strcmpi(opt.plotconditions, 'together') || strcmpi(opt.figure, 'off') + col = manycol; +else col = onecol; +end; +if ~isempty(opt.colors), col = opt.colors; end; + +nonemptycell = find(~cellfun(@isempty, data)); +maxdim = max(length(data(:)), size(data{nonemptycell(1)}, ndims(data{nonemptycell(1)}))); +if strcmpi(opt.plotsubjects, 'off') + + % both group and conditions together + if strcmpi(opt.plotconditions, 'together') && strcmpi(opt.plotgroups, 'together') + dim1 = max(size(data)); + dim2 = min(size(data)); + coldata = col([1:dim1]); + for iRow = 2:dim2 + coldata(iRow,:) = coldata(1,:); + for iCol = 1:dim1 + coldata{iRow,iCol} = [ coldata{iRow,iCol} modifier{iRow} ]; + end; + end; + if size(coldata,1) ~= size(data,1), coldata = coldata'; end; + else + coldata = manycol; + end; + + %coldata = col(mod([0:maxdim-1], length(col))+1); + %coldata = col(mod([0:maxdim-1], length(col))+1); + %coldata = reshape(coldata(1:length(data(:))), size(data)); +else + coldata = cell(size(data)); +end; + +% remove empty entries +% -------------------- +datapresent = ~cellfun(@isempty, data); +if size(data,1) > 1, for c = size(data,1):-1:1, if sum(datapresent(c,:)) == 0, data(c,:) = []; coldata(c,:) = []; if ~strcmpi(opt.plotconditions, 'together') opt.titles(c,:) = []; end; if ~isempty(opt.groupstats), opt.groupstats(c) = []; end; end; end; end; +if size(data,2) > 1, for g = size(data,2):-1:1, if sum(datapresent(:,g)) == 0, data(:,g) = []; coldata(:,g) = []; if ~strcmpi(opt.plotgroups , 'together') opt.titles(:,g) = []; end; if ~isempty(opt.condstats ), opt.condstats( g) = []; end; end; end; end; +if strcmpi(opt.plotsubjects, 'off'), tmpcol = coldata'; tmpcol = tmpcol(:)'; end; + +% number of columns and rows to plot +% ---------------------------------- +nc = size(data,1); +ng = size(data,2); +if strcmpi(opt.plotgroups, 'together'), ngplot = 1; else ngplot = ng; end; +if strcmpi(opt.plotconditions, 'together'), ncplot = 1; else ncplot = nc; end; +if nc >= ng, opt.subplot = 'transpose'; +else opt.subplot = 'normal'; +end; +if isempty(opt.condnames) + for c=1:nc, opt.condnames{c} = sprintf('Cond. %d', c); end; + if nc == 1, opt.condnames = { '' }; end; +end; +if isempty(opt.groupnames) + for g=1:ng, opt.groupnames{g} = sprintf('Group. %d', g); end; + if ng == 1, opt.groupnames = { '' }; end; +end; + +% plotting paramters +% ------------------ +if ng > 1 && ~isempty(opt.groupstats), addc = 1; else addc = 0; end; +if nc > 1 && ~isempty(opt.condstats ), addr = 1; else addr = 0; end; +if length(opt.threshold) > 1, opt.threshold = opt.threshold(1); end; +if strcmpi(opt.singlesubject, 'off') ... + && ( ~isempty(opt.condstats) || ~isempty(opt.groupstats) ) % only for curves + plottag = 0; + if strcmpi(opt.plotgroups, 'together') && isempty(opt.condstats) && ~isempty(opt.groupstats) && ~isnan(opt.threshold), addc = 0; plottag = 1; end; + if strcmpi(opt.plotconditions , 'together') && ~isempty(opt.condstats) && isempty(opt.groupstats) && ~isnan(opt.threshold), addr = 0; plottag = 1; end; + if ~isnan(opt.threshold) && plottag == 0 && strcmpi(opt.figure, 'on') + disp('Warning: cannot plot condition/group on the same panel while using a fixed'); + disp(' threshold, unless you only compute statistics for ether groups or conditions'); + opt.plotgroups = 'apart'; + opt.plotconditions = 'apart'; + end; +end; + +% resize data to match points x channels x subjects +% or points x 1 x components +% ------------------------------------------------- +for index = 1:length(data(:)) + if length(opt.chanlocs) ~= size(data{index},2) && (length(opt.chanlocs) == 1 || isempty(opt.chanlocs)) + data{index} = reshape(data{index}, [ size(data{index},1) 1 size(data{index},2) ]); + end; +end; + +% compute significance mask +% -------------------------- +if ~isempty(opt.interstats), pinter = opt.interstats{3}; end; + +if ~isnan(opt.threshold) && ( ~isempty(opt.groupstats) || ~isempty(opt.condstats) ) + pcondplot = opt.condstats; + pgroupplot = opt.groupstats; + pinterplot = pinter; + maxplot = 1; +else + for ind = 1:length(opt.condstats), pcondplot{ind} = -log10(opt.condstats{ind}); end; + for ind = 1:length(opt.groupstats), pgroupplot{ind} = -log10(opt.groupstats{ind}); end; + if ~isempty(pinter), pinterplot = -log10(pinter); end; + maxplot = 3; +end; + +% labels +% ------ +if strcmpi(opt.unitx, 'ms'), xlab = 'Time (ms)'; ylab = 'Potential (\muV)'; +else xlab = 'Frequency (Hz)'; ylab = 'Power (10*log_{10}(\muV^{2}))'; +end; +if ~isnan(opt.threshold), statopt = { 'xlabel' xlab }; +else statopt = { 'logpval' 'on' 'xlabel' xlab 'ylabel' '-log10(p)' 'ylim' [0 maxplot] }; +end; + +% adjust figure size +% ------------------ +if strcmpi(opt.figure, 'on') + figure('color', 'w'); + pos = get(gcf, 'position'); + basewinsize = 200/max(nc,ng)*3; + if strcmpi(opt.plotgroups, 'together') pos(3) = 200*(1+addc); + else pos(3) = 200*(ng+addc); + end; + if strcmpi(opt.plotconditions , 'together') pos(4) = 200*(1+addr); + else pos(4) = 200*(nc+addr); + end; + if strcmpi(opt.subplot, 'transpose'), set(gcf, 'position', [ pos(1) pos(2) pos(4) pos(3)]); + else set(gcf, 'position', pos); + end; +else + opt.subplot = 'noplot'; +end; + +tmplim = [Inf -Inf]; +colcount = 1; % only when plotting all conditions on the same figure +tmpcol = col; +for c = 1:ncplot + for g = 1:ngplot + if strcmpi(opt.figure, 'off'), tmpcol(1) = []; end; % knock off colors + if strcmpi(opt.plotgroups, 'together'), hdl(c,g)=mysubplot(ncplot+addr, ngplot+addc, 1 + (c-1)*(ngplot+addc), opt.subplot); ci = g; + elseif strcmpi(opt.plotconditions, 'together'), hdl(c,g)=mysubplot(ncplot+addr, ngplot+addc, g, opt.subplot); ci = c; + else hdl(c,g)=mysubplot(ncplot+addr, ngplot+addc, g + (c-1)*(ngplot+addc), opt.subplot); ci = 1; + end; + + if ~isempty(data{c,g}) + + % read all data from one condition or group + % ----------------------------------------- + dimreduced_sizediffers = 0; + if ncplot ~= nc && ngplot ~= ng + maxdim = max(max(cellfun(@(x)(size(x, ndims(x))), data))); + for cc = 1:size(data,1) + for gg = 1:size(data,2) + tmptmpdata = real(data{cc,gg}); + if cc == 1 && gg == 1, tmpdata = NaN*zeros([size(tmptmpdata,1) size(tmptmpdata,2) maxdim length(data(:))]); end; + tmpdata(:,:,1:size(tmptmpdata,3),gg+((cc-1)*ng)) = tmptmpdata; + end; + end; + elseif ncplot ~= nc % plot conditions together + for ind = 2:size(data,1), if any(size(data{ind,1}) ~= size(data{1})), dimreduced_sizediffers = 1; end; end; + for cc = 1:nc + tmptmpdata = real(data{cc,g}); + if dimreduced_sizediffers + tmptmpdata = nan_mean(tmptmpdata,ndims(tmptmpdata)); % average across last dim + end; + if cc == 1 && ndims(tmptmpdata) == 3, tmpdata = zeros([size(tmptmpdata) nc]); end; + if cc == 1 && ndims(tmptmpdata) == 2, tmpdata = zeros([size(tmptmpdata) 1 nc]); end; + tmpdata(:,:,:,cc) = tmptmpdata; + end; + elseif ngplot ~= ng % plot groups together + for ind = 2:size(data,2), if any(size(data{1,ind}) ~= size(data{1})), dimreduced_sizediffers = 1; end; end; + for gg = 1:ng + tmptmpdata = real(data{c,gg}); + if dimreduced_sizediffers + tmptmpdata = nan_mean(tmptmpdata,ndims(tmptmpdata)); + end; + if gg == 1 && ndims(tmptmpdata) == 3, tmpdata = zeros([size(tmptmpdata) ng]); end; + if gg == 1 && ndims(tmptmpdata) == 2, tmpdata = zeros([size(tmptmpdata) 1 ng]); end; + tmpdata(:,:,:,gg) = tmptmpdata; + end; + else + tmpdata = real(data{c,g}); + end; + + % plot difference + % --------------- + if ~strcmpi(opt.plotdiff, 'off') + if ngplot ~= ng || ncplot ~= nc + if size(tmpdata,3) == 2 + tmpdata(:,:,end+1) = tmpdata(:,:,2)-tmpdata(:,:,1); + opt.legend{end+1} = [ opt.legend{2} '-' opt.legend{1} ]; + elseif size(tmpdata,4) == 2 + tmpdata(:,:,:,end+1) = tmpdata(:,:,:,2)-tmpdata(:,:,:,1); + opt.legend{end+1} = [ opt.legend{2} '-' opt.legend{1} ]; + else + disp('Cannot plot difference, more than 2 indep. variable values'); + end; + else + disp('Cannot plot difference, indep. variable value must be plotted together'); + end; + end; + + if ~isempty(opt.filter), tmpdata = myfilt(tmpdata, 1000/(allx(2)-allx(1)), 0, opt.filter); end; + + % plotting options + % ---------------- + plotopt = { allx }; + % ------------------------------------------------------------- + % tmpdata is of size "points x channels x subject x conditions" + % or "points x 1 x components x conditions" + % ------------------------------------------------------------- + if ~dimreduced_sizediffers && strcmpi(opt.plotsubjects, 'off') % average accross subjects + tmpstd = squeeze(real(std(tmpdata,[],3)))/sqrt(size(tmpdata,3)); tmpstd = squeeze(permute(tmpstd, [2 1 3])); tmpdata = squeeze(real(nan_mean(tmpdata,3))); + end; + tmpdata = squeeze(permute(tmpdata, [2 1 3 4])); + % ----------------------------------------------------------------- + % tmpdata is now of size "channels x points x subject x conditions" + % ----------------------------------------------------------------- + if strcmpi(opt.plottopo, 'on'), highlight = 'background'; else highlight = 'bottom'; end; + if strcmpi(opt.plotgroups, 'together') && isempty(opt.condstats) && ... + ~isnan(opt.threshold) && ~isempty(opt.groupstats) + plotopt = { plotopt{:} 'maskarray' }; + tmpdata = { tmpdata pgroupplot{c}' }; + elseif strcmpi(opt.plotconditions, 'together') && isempty(opt.groupstats) && ... + ~isnan(opt.threshold) && ~isempty(opt.condstats) + plotopt = { plotopt{:} 'maskarray' }; + tmpdata = { tmpdata pcondplot{g}' }; + end; + plotopt = { plotopt{:} 'highlightmode', highlight }; + if strcmpi(opt.plotsubjects, 'on') + plotopt = { plotopt{:} 'plotmean' 'on' 'plotindiv' 'on' }; + else + plotopt = { plotopt{:} 'plotmean' 'off' }; + end; + plotopt = { plotopt{:} 'ylim' opt.ylim 'xlabel' xlab 'ylabel' ylab }; + if ncplot ~= nc || ngplot ~= ng + plotopt = { plotopt{:} 'legend' opt.legend }; + end; + + if strcmpi(opt.plottopo, 'on') && length(opt.chanlocs) > 1 + metaplottopo(tmpdata, 'chanlocs', opt.chanlocs, 'plotfunc', 'plotcurve', ... + 'plotargs', { plotopt{:} }, 'datapos', [2 3], 'title', opt.titles{c,g}); + elseif iscell(tmpdata) + plotcurve( allx, tmpdata{1}, 'colors', tmpcol, 'maskarray', tmpdata{2}, plotopt{3:end}, 'title', opt.titles{c,g}); + else + if isempty(findstr(opt.plotstderr, 'nocurve')) + plotcurve( allx, tmpdata, 'colors', tmpcol, plotopt{2:end}, 'traceinfo', 'on', 'title', opt.titles{c,g}); + end; + if ~strcmpi(opt.plotstderr, 'off') + if ~dimreduced_sizediffers + if ~isempty(findstr(opt.plotstderr, 'diff')), begind = 3; else begind = 1; end; + set(gcf, 'renderer', 'OpenGL') + for tmpi = begind:size(tmpdata,1) + hold on; chandle = fillcurves( allx, tmpdata(tmpi,:)-tmpstd(tmpi,:), tmpdata(tmpi,:)+tmpstd(tmpi,:), tmpcol{tmpi}); hold on; + numfaces = size(get(chandle(1), 'Vertices'),1); + set(chandle(1), 'FaceVertexCData', repmat([1 1 1], [numfaces 1]), 'Cdatamapping', 'direct', 'facealpha', 0.3, 'edgecolor', 'none'); + end; + else + disp('Some conditions have more subjects than others, cannot plot standard error'); + end; + end; + end; + end; + + if strcmpi(opt.plottopo, 'off'), % only non-topographic + xlim([allx(1) allx(end)]); hold on; + if isempty(opt.ylim) + tmp = ylim; + tmplim = [ min(tmplim(1), tmp(1)) max(tmplim(2), tmp(2)) ]; + else + ylim(opt.ylim); + end; + end; + + % statistics accross groups + % ------------------------- + if g == ngplot && ng > 1 && ~isempty(opt.groupstats) + if ~strcmpi(opt.plotgroups, 'together') || ~isempty(opt.condstats) || isnan(opt.threshold) + if strcmpi(opt.plotgroups, 'together'), mysubplot(ncplot+addr, ngplot+addc, 2 + (c-1)*(ngplot+addc), opt.subplot); ci = g; + elseif strcmpi(opt.plotconditions, 'together'), mysubplot(ncplot+addr, ngplot+addc, ngplot + 1, opt.subplot); ci = c; + else mysubplot(ncplot+addr, ngplot+addc, ngplot + 1 + (c-1)*(ngplot+addc), opt.subplot); ci = 1; + end; + if strcmpi(opt.plotconditions, 'together'), condnames = 'Conditions'; else condnames = opt.condnames{c}; end; + if ~isnan(opt.threshold) + if strcmpi(opt.plottopo, 'on'), + metaplottopo({zeros(size(pgroupplot{c}')) pgroupplot{c}'}, 'chanlocs', opt.chanlocs, 'plotfunc', 'plotcurve', ... + 'plotargs', { allx 'maskarray' statopt{:} }, 'datapos', [2 3], 'title', opt.titles{c, g+1}); + else plotcurve(allx, zeros(size(allx)), 'maskarray', mean(pgroupplot{c},2), 'ylim', [0.1 1], 'title', opt.titles{c, g+1}, statopt{:}); + end; + else + if strcmpi(opt.plottopo, 'on'), + metaplottopo(pgroupplot{c}', 'chanlocs', opt.chanlocs, 'plotfunc', 'plotcurve', ... + 'plotargs', { allx statopt{:} }, 'datapos', [2 3], 'title', opt.titles{c, g+1}); + else plotcurve(allx, mean(pgroupplot{c},2), 'title', opt.titles{c, g+1}, statopt{:}); + end; + end; + end; + end; + end; +end; + +for g = 1:ng + % statistics accross conditions + % ----------------------------- + if ~isempty(opt.condstats) && nc > 1 + if ~strcmpi(opt.plotconditions, 'together') || ~isempty(opt.groupstats) || isnan(opt.threshold) + if strcmpi(opt.plotgroups, 'together'), mysubplot(ncplot+addr, ngplot+addc, 1 + c*(ngplot+addc), opt.subplot); ci = g; + elseif strcmpi(opt.plotconditions, 'together'), mysubplot(ncplot+addr, ngplot+addc, g + ngplot+addc, opt.subplot); ci = c; + else mysubplot(ncplot+addr, ngplot+addc, g + c*(ngplot+addc), opt.subplot); ci = 1; + end; + if strcmpi(opt.plotgroups, 'together'), groupnames = 'Groups'; else groupnames = opt.groupnames{g}; end; + if ~isnan(opt.threshold) + if strcmpi(opt.plottopo, 'on'), + metaplottopo({zeros(size(pcondplot{g}')) pcondplot{g}'}, 'chanlocs', opt.chanlocs, 'plotfunc', 'plotcurve', ... + 'plotargs', { allx 'maskarray' statopt{:} }, 'datapos', [2 3], 'title', opt.titles{end, g}); + else plotcurve(allx, zeros(size(allx)), 'maskarray', mean(pcondplot{g},2), 'ylim', [0.1 1], 'title', opt.titles{end, g}, statopt{:}); + end; + else + if strcmpi(opt.plottopo, 'on'), + metaplottopo(pcondplot{g}', 'chanlocs', opt.chanlocs, 'plotfunc', 'plotcurve', ... + 'plotargs', { allx statopt{:} }, 'datapos', [2 3], 'title', opt.titles{end, g}); + else plotcurve(allx, mean(pcondplot{g},2), 'title', opt.titles{end, g}, statopt{:}); + end; + end; + end; + end; +end; + +% statistics accross group and conditions +% --------------------------------------- +if ~isempty(opt.groupstats) && ~isempty(opt.condstats) && ng > 1 && nc > 1 + mysubplot(ncplot+addr, ngplot+addc, ngplot + 1 + ncplot*(ngplot+addr), opt.subplot); + if ~isnan(opt.threshold) + if strcmpi(opt.plottopo, 'on'), + metaplottopo({zeros(size(pinterplot')) pinterplot'}, 'chanlocs', opt.chanlocs, 'plotfunc', 'plotcurve', ... + 'plotargs', { allx 'maskarray' statopt{:} }, 'datapos', [2 3], 'title', opt.titles{end, end}); + else plotcurve(allx, zeros(size(allx)), 'maskarray', mean(pinterplot,2), 'ylim', [0.1 1], 'title', opt.titles{end, end}, statopt{:}); + xlabel(xlab); ylabel('-log10(p)'); + end; + else + if strcmpi(opt.plottopo, 'on'), + metaplottopo(pinterplot', 'chanlocs', opt.chanlocs, 'plotfunc', 'plotcurve', ... + 'plotargs', { allx statopt{:} }, 'datapos', [2 3], 'title', opt.titles{end, end}); + else plotcurve(allx, mean(pinterplot,2), 'title', opt.titles{end, end}, statopt{:}); + end; + end; +end; + +% axis limit +% ---------- +for c = 1:ncplot + for g = 1:ngplot + if isempty(opt.ylim) && strcmpi(opt.plottopo, 'off') + set(hdl(c,g), 'ylim', tmplim); + end; + end; +end; + +if strcmpi(opt.plottopo, 'off') && length(hdl(:)) > 1 + axcopy; + % remove axis labels (for most but not all) + % ------------------ + if strcmpi(opt.subplot, 'transpose') + for c = 1:size(hdl,2) + for g = 1:size(hdl,1) + axes(hdl(g,c)); + if c ~= 1 && size(hdl,2) ~=1, xlabel(''); legend off; end; + if g ~= 1 && size(hdl,1) ~= 1, ylabel(''); legend off; end; + end; + end; + else + for c = 1:size(hdl,1) + for g = 1:size(hdl,2) + axes(hdl(c,g)); + if g ~= 1 && size(hdl,2) ~=1, ylabel(''); legend off; end; + if c ~= size(hdl,1) && size(hdl,1) ~= 1, xlabel(''); legend off; end; + end; + end; + end; +end; + + +% mysubplot (allow to transpose if necessary) +% ------------------------------------------- +function hdl = mysubplot(nr,nc,ind,subplottype); + + r = ceil(ind/nc); + c = ind -(r-1)*nc; + if strcmpi(subplottype, 'transpose'), hdl = subplot(nc,nr,(c-1)*nr+r); + elseif strcmpi(subplottype, 'normal'), hdl = subplot(nr,nc,(r-1)*nc+c); + elseif strcmpi(subplottype, 'noplot'), hdl = gca; + else error('Unknown subplot type'); + end; + +% rapid filtering for ERP +% ----------------------- +function tmpdata2 = myfilt(tmpdata, srate, lowpass, highpass); + bscorrect = 1; + if bscorrect + % Getting initial baseline + bs_val1 = mean(tmpdata,1); + bs1 = repmat(bs_val1, size(tmpdata,1), 1); + end + + % Filtering + tmpdata2 = reshape(tmpdata, size(tmpdata,1), size(tmpdata,2)*size(tmpdata,3)*size(tmpdata,4)); + tmpdata2 = eegfiltfft(tmpdata2',srate, lowpass, highpass)'; + tmpdata2 = reshape(tmpdata2, size(tmpdata,1), size(tmpdata,2), size(tmpdata,3), size(tmpdata,4)); + + if bscorrect + % Getting after-filter baseline + bs_val2 = mean(tmpdata2,1); + bs2 = repmat(bs_val2, size(tmpdata2,1), 1); + + % Correcting the baseline + realbs = bs1-bs2; + tmpdata2 = tmpdata2 + realbs; + end \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_plottf.m b/code/eeglab13_4_4b/functions/studyfunc/std_plottf.m new file mode 100644 index 0000000..292d8cb --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_plottf.m @@ -0,0 +1,362 @@ +% std_plottf() - plot ERSP/ITC images a component +% or channel cluster in a STUDY. Also allows plotting scalp +% maps. +% Usage: +% >> std_plottf( times, freqs, data, 'key', 'val', ...) +% Inputs: +% times - [vector] latencies in ms of the data points. +% freqs - [vector] frequencies in Hz of the data points. +% data - [cell array] mean data for each subject group and/or data +% condition. For example, to plot mean ERPs from a STUDY +% for epochs of 800 frames in two conditions from three groups +% of 12 subjects: +% +% >> data = { [800x12] [800x12] [800x12];... % 3 groups, cond 1 +% [800x12] [800x12] [800x12] }; % 3 groups, cond 2 +% >> std_plottf(erp_ms,data); +% +% By default, parametric statistics are computed across subjects +% in the three groups. (group,condition) ERP averages are plotted. +% See below and >> help statcond +% for more information about the statistical computations. +% +% Optional display parameters: +% 'datatype' - ['ersp'|'itc'] data type {default: 'ersp'} +% 'titles' - [cell array of string] titles for each of the subplots. +% { default: none} +% +% Statistics options: +% 'groupstats' - ['on'|'off'] Compute (or not) statistics across groups. +% {default: 'off'} +% 'condstats' - ['on'|'off'] Compute (or not) statistics across groups. +% {default: 'off'} + +% 'threshold' - [NaN|real<<1] Significance threshold. NaN -> plot the +% p-values themselves on a different figure. When possible, +% significance regions are indicated below the data. +% {default: NaN} +% 'maskdata' - ['on'|'off'] when threshold is non-NaN and not both +% condition and group statistics are computed, the user +% has the option to mask the data for significance. +% {defualt: 'off'} +% +% Other plotting options: +% 'plotmode' - ['normal'|'condensed'] statistics plotting mode: +% 'condensed' -> plot statistics under the curves +% (when possible); 'normal' -> plot them in separate +% axes {default: 'normal'} +% 'freqscale' - ['log'|'linear'|'auto'] frequency plotting scale. This +% will only change the ordinate not interpolate the data. +% If you change this option blindly, your frequency scale +% might be innacurate {default: 'auto'} +% 'ylim' - [min max] ordinate limits for ERP and spectrum plots +% {default: all available data} +% +% ITC/ERSP image plotting options: +% 'tftopoopt' - [cell array] tftopo() plotting options (ERSP and ITC) +% 'caxis' - [min max] color axis (ERSP, ITC, scalp maps) +% +% Scalp map plotting options: +% 'chanlocs' - [struct] channel location structure +% +% Author: Arnaud Delorme, CERCO, CNRS, 2006- +% +% See also: pop_erspparams(), pop_erpparams(), pop_specparams(), statcond() + +% Copyright (C) 2006 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [pgroup, pcond, pinter] = std_plottf(timevals, freqs, data, varargin) + +pgroup = []; +pcond = []; +pinter = []; +if nargin < 2 + help std_plottf; + return; +end; + +opt = finputcheck( varargin, { 'titles' 'cell' [] cellfun(@num2str, cell(20,20), 'uniformoutput', false); + 'caxis' 'real' [] []; + 'ersplim' 'real' [] []; % same as above + 'itclim' 'real' [] []; % same as above + 'ylim' 'real' [] []; + 'tftopoopt' 'cell' [] {}; + 'threshold' 'real' [] NaN; + 'unitx' 'string' [] 'ms'; % just for titles + 'unitcolor' 'string' {} 'dB'; + 'chanlocs' 'struct' [] struct('labels', {}); + 'freqscale' 'string' { 'log','linear','auto' } 'auto'; + 'events' 'cell' [] {}; + 'groupstats' 'cell' [] {}; + 'condstats' 'cell' [] {}; + 'interstats' 'cell' [] {}; + 'maskdata' 'string' { 'on','off' } 'off'; + 'datatype' 'string' { 'ersp','itc' 'erpim' } 'ersp'; + 'plotmode' 'string' { 'normal','condensed' } 'normal' }, 'std_plottf'); +if isstr(opt), error(opt); end; +if all(all(cellfun('size', data, 3)==1)) opt.singlesubject = 'on'; end; + +% remove empty entries +datapresent = ~cellfun(@isempty, data); +for c = size(data,1):-1:1, if sum(datapresent(c,:)) == 0, data(c,:) = []; opt.titles(c,:) = []; if ~isempty(opt.groupstats), opt.groupstats(c) = []; end; end; end; +for g = size(data,2):-1:1, if sum(datapresent(:,g)) == 0, data(:,g) = []; opt.titles(:,g) = []; if ~isempty(opt.condstats ), opt.condstats( g) = []; end; end; end; + +if ~isempty(opt.groupstats) & ~isempty(opt.condstats) & strcmpi(opt.maskdata, 'on') + disp('Cannot use ''maskdata'' option with both condition stat. and group stat. on'); + disp('Disabling statistics'); + opt.groupstats = {}; opt.condstats = {}; opt.maskdata = 'off'; +end; +if ~isempty(opt.ersplim), opt.caxis = opt.ersplim; end; +if ~isempty(opt.itclim), opt.caxis = opt.itclim; end; +onecol = { 'b' 'b' 'b' 'b' 'b' 'b' 'b' 'b' 'b' 'b' }; +manycol = { 'b' 'r' 'g' 'k' 'c' 'y' }; + +nc = size(data,1); +ng = size(data,2); +if nc >= ng, opt.transpose = 'on'; +else opt.transpose = 'off'; +end; + +% test log frequencies +% -------------------- +if length(freqs) > 2 & strcmpi(opt.freqscale, 'auto') + midfreq = (freqs(3)+freqs(1))/2; + if midfreq*.9999 < freqs(2) & midfreq*1.0001 > freqs(2), opt.freqscale = 'linear'; + else opt.freqscale = 'log'; + end; +end; + +% condensed plot +% -------------- +if strcmpi(opt.plotmode, 'condensed') + meanplot = zeros(size(data{1},1), size(data{1},2)); + count = 0; + for c = 1:nc + for g = 1:ng + if ~isempty(data{c,g}) + meanplot = meanplot + mean(data{c,g},3); + count = count+1; + end; + end; + end; + meanplot = meanplot/count; + options = { 'chanlocs', opt.chanlocs, 'electrodes', 'off', 'cbar', 'on', ... + 'cmode', 'separate', opt.tftopoopt{:} }; + if strcmpi(opt.datatype, 'erpim'), options = { options{:} 'ylabel' 'Trials' }; end; + if strcmpi(opt.freqscale, 'log'), options = { options{:} 'logfreq', 'native' }; end; + tftopo( meanplot', timevals, freqs, 'title', opt.titles{1}, options{:}); + currentHangle = gca; + if ~isempty( opt.caxis ) + caxis( currentHangle, opt.caxis ) + end + colorbarHandle = cbar; + title(colorbarHandle,opt.unitcolor); + axes(currentHangle); + return; +end; + +% plotting paramters +% ------------------ +if ng > 1 && ~isempty(opt.groupstats), addc = 1; else addc = 0; end; +if nc > 1 && ~isempty(opt.condstats ), addr = 1; else addr = 0; end; + +% compute significance mask +% -------------------------- +if ~isempty(opt.interstats), pinter = opt.interstats{3}; end; + +if ~isnan(opt.threshold) && ( ~isempty(opt.groupstats) || ~isempty(opt.condstats) ) + pcondplot = opt.condstats; + pgroupplot = opt.groupstats; + pinterplot = pinter; + maxplot = 1; +else + for ind = 1:length(opt.condstats), pcondplot{ind} = -log10(opt.condstats{ind}); end; + for ind = 1:length(opt.groupstats), pgroupplot{ind} = -log10(opt.groupstats{ind}); end; + if ~isempty(pinter), pinterplot = -log10(pinter); end; + maxplot = 3; +end; + +% ------------------------------- +% masking for significance of not +% ------------------------------- +statmask = 0; +if strcmpi(opt.maskdata, 'on') && ~isnan(opt.threshold) && ... + (~isempty(opt.condstats) || ~isempty(opt.condstats)) + addc = 0; addr = 0; statmask = 1; +end; + +% ------------------------- +% plot time/frequency image +% ------------------------- +options = { 'chanlocs', opt.chanlocs, 'electrodes', 'off', 'cbar', 'off', ... + 'cmode', 'separate', opt.tftopoopt{:} }; +if strcmpi(opt.freqscale, 'log'), options = { options{:} 'logfreq', 'native' }; end; +if strcmpi(opt.datatype, 'erpim'), options = { options{:} 'ylabel' 'Trials' }; end; + +% adjust figure size +% ------------------ +fig = figure('color', 'w'); +pos = get(fig, 'position'); +set(fig, 'position', [ pos(1)+15 pos(2)+15 pos(3)/2.5*(nc+addr), pos(4)/2*(ng+addc) ]); +pos = get(fig, 'position'); +if strcmpi(opt.transpose, 'off'), set(gcf, 'position', [ pos(1) pos(2) pos(4) pos(3)]); +else set(gcf, 'position', pos); +end; + +tmpc = [inf -inf]; +for c = 1:nc + for g = 1:ng + hdl(c,g) = mysubplot(nc+addr, ng+addc, g + (c-1)*(ng+addc), opt.transpose); + if ~isempty(data{c,g}) + tmpplot = mean(data{c,g},3); + if ~isreal(tmpplot(1)), tmpplot = abs(tmpplot); end; + if statmask, + if ~isempty(opt.condstats), tmpplot(find(pcondplot{g}(:) == 0)) = 0; + else tmpplot(find(pgroupplot{c}(:) == 0)) = 0; + end; + end; + if ~isempty(opt.events) + tmpevents = mean(opt.events{c,g},2); + else tmpevents = []; + end; + tftopo( tmpplot, timevals, freqs, 'events', tmpevents, 'title', opt.titles{c,g}, options{:}); + + if isempty(opt.caxis) && ~isempty(tmpc) + warning off; + tmpc = [ min(min(tmpplot(:)), tmpc(1)) max(max(tmpplot(:)), tmpc(2)) ]; + warning on; + else + if ~isempty(opt.caxis) + caxis(opt.caxis); + end; + end; + + if c > 1 + ylabel(''); + end; + end; + + % statistics accross groups + % ------------------------- + if g == ng && ng > 1 && ~isempty(opt.groupstats) && ~isinf(pgroupplot{c}(1)) && ~statmask + hdl(c,g+1) = mysubplot(nc+addr, ng+addc, g + 1 + (c-1)*(ng+addc), opt.transpose); + tftopo( pgroupplot{c}, timevals, freqs, 'title', opt.titles{c,g+1}, options{:}); + caxis([-maxplot maxplot]); + end; + end; +end; + +for g = 1:ng + % statistics accross conditions + % ----------------------------- + if ~isempty(opt.condstats) && ~isinf(pcondplot{g}(1)) && ~statmask && nc > 1 + hdl(nc+1,g) = mysubplot(nc+addr, ng+addc, g + c*(ng+addc), opt.transpose); + tftopo( pcondplot{g}, timevals, freqs, 'title', opt.titles{nc+1,g}, options{:}); + caxis([-maxplot maxplot]); + end; +end; + +% color scale +% ----------- +if isempty(opt.caxis) + tmpc = [-max(abs(tmpc)) max(abs(tmpc))]; + for c = 1:nc + for g = 1:ng + axes(hdl(c,g)); + if ~isempty(tmpc) + caxis(tmpc); + end; + end; + end; +end; + +% statistics accross group and conditions +% --------------------------------------- +if ~isempty(opt.groupstats) && ~isempty(opt.condstats) && ng > 1 && nc > 1 + hdl(nc+1,ng+1) = mysubplot(nc+addr, ng+addc, g + 1 + c*(ng+addr), opt.transpose); + tftopo( pinterplot, timevals, freqs, 'title', opt.titles{nc+1,ng+1}, options{:}); + caxis([-maxplot maxplot]); + ylabel(''); +end; + +% color bars +% ---------- +axes(hdl(nc,ng)); +cbar_standard(opt.datatype, ng, opt.unitcolor); +if isnan(opt.threshold) && (nc ~= size(hdl,1) || ng ~= size(hdl,2)) + ind = find(hdl(end:-1:1)); + axes(hdl(end-ind(1)+1)); + cbar_signif(ng, maxplot); +end; + +% mysubplot (allow to transpose if necessary) +% ------------------------------------------- +function hdl = mysubplot(nr,nc,ind,transp); + + r = ceil(ind/nc); + c = ind -(r-1)*nc; + if strcmpi(transp, 'on'), hdl = subplot(nc,nr,(c-1)*nr+r); + else hdl = subplot(nr,nc,(r-1)*nc+c); + end; + +% colorbar for ERSP and scalp plot +% -------------------------------- +function cbar_standard(datatype, ng, unitcolor); + pos = get(gca, 'position'); + tmpc = caxis; + fact = fastif(ng == 1, 40, 20); + tmp = axes('position', [ pos(1)+pos(3)+max(pos(3)/fact,0.006) pos(2) max(pos(3)/fact,0.01) pos(4) ]); + set(gca, 'unit', 'normalized'); + if strcmpi(datatype, 'itc') + cbar(tmp, 0, tmpc, 10); ylim([0.5 1]); + title('ITC','fontsize',10,'fontweight','normal'); + elseif strcmpi(datatype, 'erpim') + cbar(tmp, 0, tmpc, 5); + else + cbar(tmp, 0, tmpc, 5); + title(unitcolor); + end; + + +% colorbar for significance +% ------------------------- +function cbar_signif(ng, maxplot); + % Retrieving Defaults + icadefs; + + pos = get(gca, 'position'); + tmpc = caxis; + fact = fastif(ng == 1, 40, 20); + tmp = axes('position', [ pos(1)+pos(3)+max(pos(3)/fact,0.006) pos(2) max(pos(3)/fact,0.01) pos(4) ]); + map = colormap(DEFAULT_COLORMAP); + n = size(map,1); + cols = [ceil(n/2):n]'; + image([0 1],linspace(0,maxplot,length(cols)),[cols cols]); + %cbar(tmp, 0, tmpc, 5); + tick = linspace(0, maxplot, maxplot+1); + set(gca, 'ytickmode', 'manual', 'YAxisLocation', 'right', 'xtick', [], ... + 'ytick', tick, 'yticklabel', round(10.^-tick*1000)/1000); + xlabel(''); + colormap(DEFAULT_COLORMAP); + +% rapid filtering for ERP +% ----------------------- +function tmpdata2 = myfilt(tmpdata, lowpass, highpass, factor, filtertype) + + tmpdata2 = reshape(tmpdata, size(tmpdata,1), size(tmpdata,2)*size(tmpdata,3)*size(tmpdata,4)); + tmpdata2 = eegfiltfft(tmpdata2',lowpass, highpass, factor, filtertype)'; + tmpdata2 = reshape(tmpdata2, size(tmpdata,1), size(tmpdata,2), size(tmpdata,3), size(tmpdata,4)); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_preclust.m b/code/eeglab13_4_4b/functions/studyfunc/std_preclust.m new file mode 100644 index 0000000..1ad1879 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_preclust.m @@ -0,0 +1,503 @@ +% std_preclust() - select measures to be included in computation of a preclustering array. +% This array is used by pop_clust() to find component clusters from a +% specified parent cluster. +% Selected measures (dipole location, ERPs, spectra, scalp maps, ERSPs, +% and/or ITCs) should already be precomputed using pop-precomp(). Each +% feature dimension is reduced by PCA decomposition. These PCA matrices +% (one per measure) are concatenated and used as input to the clustering +% algorithm in pop_clust(). Follow with pop_clust(). +% See Example below: +% +% >> [STUDY,ALLEEG] = std_preclust(STUDY,ALLEEG); % prepare to cluster all comps +% % in all sets on all measures +% +% >> [STUDY,ALLEEG] = std_preclust(STUDY,ALLEEG, clustind, preproc1, preproc2...); +% % prepare to cluster specifed +% % cluster on specified measures +% Required inputs: +% STUDY - an EEGLAB STUDY set of loaded EEG structures +% ALLEEG - ALLEEG vector of one or more loaded EEG dataset structures +% +% Optional inputs: +% clustind - a cluster index for further (hierarchical) clustering - +% for example to cluster a spectrum-based mu-rhythm cluster into +% dipole location-based left mu and right mu sub-clusters. +% Should be empty for first stage (whole-STUDY) clustering {default: []} +% +% preproc - {'command' 'key1' val1 'key2' val2 ...} component clustering measures to prepare +% +% * 'command' = component measure to compute: +% 'erp' = cluster on the component ERPs, +% 'dipoles' = cluster on the component [X Y Z] dipole locations +% 'spec' = cluster on the component log activity spectra (in dB) +% (with the baseline mean dB spectrum subtracted). +% 'scalp' = cluster on component (topoplot()) scalp maps +% (or on their absolute values), +% 'scalpLaplac' = cluster on component (topoplot()) laplacian scalp maps +% (or on their absolute values), +% 'scalpGrad' = cluster on the (topoplot()) scalp map gradients +% (or on their absolute values), +% 'ersp' = cluster on components ERSP. (requires: 'cycles', +% 'freqrange', 'padratio', 'timewindow', 'alpha'). +% 'itc' = cluster on components ITC.(requires: 'cycles', +% 'freqrange', 'padratio', 'timewindow', 'alpha'). +% 'finaldim' = final number of dimensions. Enables second-level PCA. +% By default this command is not used (see Example below). +% +% * 'key' optional keywords and [valuess] used to compute the above 'commands': +% 'npca' = [integer] number of principal components (PCA dimension) of +% the selected measures to retain for clustering. {default: 5} +% 'norm' = [0|1] 1 -> normalize the PCA components so the variance of +% first principal component is 1 (useful when using several +% clustering measures - 'ersp','scalp',...). {default: 1} +% 'weight' = [integer] weight with respect to other clustering measures. +% 'freqrange' = [min max] frequency range (in Hz) to include in activity +% spectrum, 'ersp', and 'itc' measures. +% 'timewindow' = [min max] time window (in sec) to include in 'erp', +% 'ersp', and 'itc' measures. +% 'abso' = [0|1] 1 = use absolute values of topoplot(), gradient, or +% Laplacian maps {default: 1} +% 'funarg' = [cell array] optional function arguments for mean spectrum +% calculation (>> help spectopo) {default: none} +% Outputs: +% STUDY - the input STUDY set with pre-clustering data added, for use by pop_clust() +% ALLEEG - the input ALLEEG vector of EEG dataset structures, modified by adding preprocessing +% data as pointers to Matlab files that hold the pre-clustering component measures. +% +% Example: +% >> [STUDY ALLEEG] = std_preclust(STUDY, ALLEEG, [],... +% { 'spec' 'npca' 10 'norm' 1 'weight' 1 'freqrange' [ 3 25 ] } , ... +% { 'erp' 'npca' 10 'norm' 1 'weight' 2 'timewindow' [ 350 500 ] } ,... +% { 'scalp' 'npca' 10 'norm' 1 'weight' 2 'abso' 1 } , ... +% { 'dipoles' 'norm' 1 'weight' 15 } , ... +% { 'ersp' 'npca' 10 'freqrange' [ 3 25 ] 'cycles' [ 3 0.5 ] 'alpha' 0.01 .... +% 'padratio' 4 'timewindow' [ -1600 1495 ] 'norm' 1 'weight' 1 } ,... +% { 'itc' 'npca' 10 'freqrange' [ 3 25 ] 'cycles' [ 3 0.5 ] 'alpha' 0.01 ... +% 'padratio' 4 'timewindow' [ -1600 1495 ] 'norm' 1 'weight' 1 }, ... +% { 'finaldim' 'npca' 10 }); +% +% % This prepares, for initial clustering, all components in the STUDY datasets +% % except components with dipole model residual variance (see function +% % std_editset() for how to select such components). +% % Clustering will be based on the components' mean spectra in the [3 25] Hz +% % frequency range, on the components' ERPs in the [350 500] ms time window, +% % on the (absolute-value) component scalp maps, on the equivalent dipole +% % locations, and on the component mean ERSP and ITC images. +% % The final keyword specifies final PCA dimension reduction to 10 +% % principal dimensions. See the clustering tutorial for more details. +% +% Authors: Arnaud Delorme, Hilit Serby & Scott Makeig, SCCN, INC, UCSD, May 13, 2004 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, May 13,2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY, ALLEEG ] = std_preclust(STUDY, ALLEEG, cluster_ind, varargin) + + if nargin < 2 + help std_preclust; + return; + end; + + if nargin == 2 + cluster_ind = 1; % default to clustering the whole STUDY + end + + % check dataset length consistency before computing + % ------------------------------------------------- + pnts = ALLEEG(STUDY.datasetinfo(1).index).pnts; + srate = ALLEEG(STUDY.datasetinfo(1).index).srate; + xmin = ALLEEG(STUDY.datasetinfo(1).index).xmin; + xmax = ALLEEG(STUDY.datasetinfo(1).index).xmax; + for index = 1:length(STUDY.datasetinfo) + ind = STUDY.datasetinfo(index).index; + if srate ~= ALLEEG(ind).srate, error(sprintf('Dataset %d does not have the same sampling rate as dataset 1', ind)); end; + if ~all([ ALLEEG.trials ] == 1) + if abs(xmin-ALLEEG(ind).xmin) > 1e-7, warning(sprintf('Dataset %d does not have the same time limit as dataset 1', ind)); end; + if abs(xmax-ALLEEG(ind).xmax) > 1e-7, warning(sprintf('Dataset %d does not have the same time limit as dataset 1', ind)); end; + if pnts ~= ALLEEG(ind).pnts, error(sprintf('Dataset %d does not have the same number of point as dataset 1', ind)); end; + end; + end; + + % Get component indices that are part of the cluster + % -------------------------------------------------- + if isempty(cluster_ind) + cluster_ind = 1; + end; + if length(cluster_ind) ~= 1 + error('Only one cluster can be sub-clustered. To sub-cluster multiple clusters, first merge them.'); + end + +% % the goal of this code below is to find the components in the cluster +% % of interest for each set of condition +% for k = 1:size(STUDY.setind,2) +% % Find the first entry in STUDY.setind(:,k) that is non-NaN. We only need one since +% % components are the same across conditions. +% for ri = 1:size(STUDY.setind,1) +% if ~isnan(STUDY.setind(ri,k)), break; end +% end +% sind = find(STUDY.cluster(cluster_ind).sets(ri,:) == STUDY.setind(ri,k)); +% succompind{k} = STUDY.cluster(cluster_ind).comps(sind); +% end; +% for ind = 1:size(STUDY.setind,2) +% succompind{ind} = succompind{ind}(find(succompind{ind})); % remove zeros +% % (though there should not be any? -Arno) +% succompind{ind} = sort(succompind{ind}); % sort the components +% end; + + % scan all commands to see if file exist + % -------------------------------------- +% for index = 1:length(varargin) % scan commands +% strcom = varargin{index}{1}; +% if strcmpi(strcom, 'scalp') || strcmpi(strcom, 'scalplaplac') || strcmpi(strcom, 'scalpgrad') +% strcom = 'topo'; +% end; +% if ~strcmpi(strcom, 'dipoles') && ~strcmpi(strcom, 'finaldim') +% tmpfile = fullfile( ALLEEG(1).filepath, [ ALLEEG(1).filename(1:end-3) 'ica' strcom ]); +% if exist(tmpfile) ~= 2 +% %error([ 'Could not find "' upper(strcom) '" file, they must be precomputed' ]); +% end; +% end; +% end; + + % Decode input arguments + % ---------------------- + update_flag = 0; + rv = 1; + secondlevpca = Inf; + indrm = []; + for index = 1:length(varargin) % scan commands + strcom = varargin{index}{1}; + if strcmpi(strcom,'dipselect') + update_flag = 1; + rv = varargin{index}{3}; + indrm = [indrm index]; %remove this command + elseif strcmpi(strcom,'finaldim') % second level pca + secondlevpca = varargin{index}{3}; + indrm = [indrm index]; %remove this command + end + end + varargin(indrm) = []; %remove commands + + % Scan which component to remove (no dipole info) + % ----------------------------------------------- + if update_flag % dipole information is used to select components + error('Update flag is obsolete'); + end; + + % scan all commands + % ----------------- + clustdata = []; + erspquery = 0; + for index = 1:length(varargin) + + % decode inputs + % ------------- + strcom = varargin{index}{1}; + if any(strcom == 'X'), disp('character ''X'' found in command'); end; + %defult values + npca = NaN; + norm = 1; + weight = 1; + freqrange = []; + timewindow = []; + abso = 1; + fun_arg = []; + savetrials = 'off'; + recompute = 'on'; + for subind = 2:2:length(varargin{index}) + switch varargin{index}{subind} + case 'npca' + npca = varargin{index}{subind+1}; + case 'norm' + norm = varargin{index}{subind+1}; + case 'weight' + weight = varargin{index}{subind+1}; + case 'freqrange' + freqrange = varargin{index}{subind+1}; + case 'timewindow' + timewindow = varargin{index}{subind+1}; + case 'abso' + abso = varargin{index}{subind+1}; + case 'savetrials' + error('You may now use the function std_precomp to precompute measures'); + case 'cycles' + error('You may now use the function std_precomp to precompute measures'); + case 'alpha' + error('You may now use the function std_precomp to precompute measures'); + case 'padratio' + error('You may now use the function std_precomp to precompute measures'); + otherwise + fun_arg{length(fun_arg)+1} = varargin{index}{subind+1}; + end + end + + % scan datasets + % ------------- + if strcmpi(strcom, 'scalp'), scalpmodif = 'none'; + elseif strcmpi(strcom, 'scalpLaplac'), scalpmodif = 'laplacian'; + else scalpmodif = 'gradient'; + end; + + % check that all datasets are in preclustering for current design + % --------------------------------------------------------------- + tmpstruct = std_setcomps2cell(STUDY, STUDY.cluster(cluster_ind).sets, STUDY.cluster(cluster_ind).comps); + alldatasets = unique_bc(STUDY.cluster(cluster_ind).sets(:)); + + if length(alldatasets) < length(STUDY.datasetinfo) && cluster_ind == 1 + error( [ 'Some datasets not included in preclustering' 10 ... + 'because of partial STUDY design. You need to' 10 ... + 'use a STUDY design that includes all datasets.' ]); + end; + + for si = 1:size(STUDY.cluster(cluster_ind).sets,2) + + % test consistency of the .set structure + % -------------------------------------- + if strcmpi(strcom, 'erp') || strcmpi(strcom, 'spec') || strcmpi(strcom, 'ersp') || strcmpi(strcom, 'itc') + if any(isnan(STUDY.cluster(cluster_ind).sets(:))) + error( [ 'std_preclust error: some datasets do not have ICA pairs.' 10 ... + 'Look for NaN values in STUDY.cluster(1).sets which' 10 ... + 'indicate missing datasets. FOR CLUSTERING, YOU MAY ONLY' 10 ... + 'USE DIPOLE OR SCALP MAP CLUSTERING.' ]); + end; + end; + + switch strcom + + % select ica component ERPs + % ------------------------- + case 'erp', + % read and concatenate all cells for this specific set + % of identical ICA decompositions + STUDY.cluster = checkcentroidfield(STUDY.cluster, 'erp', 'erp_times'); + tmpstruct = std_setcomps2cell(STUDY, STUDY.cluster(cluster_ind).sets(:,si), STUDY.cluster(cluster_ind).comps(si)); + cellinds = [ tmpstruct.setinds{:} ]; + compinds = [ tmpstruct.allinds{:} ]; + cells = STUDY.design(STUDY.currentdesign).cell(cellinds); + fprintf('Pre-clustering array row %d, adding ERP for design %d cell(s) [%s] component %d ...\n', si, STUDY.currentdesign, int2str(cellinds), compinds(1)); + X = std_readfile( cells, 'components', compinds, 'timelimits', timewindow, 'measure', 'erp'); + X = abs(X(:)'); % take the absolute value of the ERP to avoid polarities issues + + % select ica scalp maps + % -------------------------- + case { 'scalp' 'scalpLaplac' 'scalpGrad' } + idat = STUDY.datasetinfo(STUDY.cluster(cluster_ind).sets(:,si)).index; + icomp = STUDY.cluster(cluster_ind).comps(si); + fprintf('Pre-clustering array row %d, adding interpolated scalp maps for dataset %d component %d...\n', si, idat, icomp); + X = std_readtopo(ALLEEG, idat, icomp, scalpmodif, 'preclust'); + + % select ica comp spectra + % ----------------------- + case 'spec', + % read and concatenate all cells for this specific set + % of identical ICA decompositions + STUDY.cluster = checkcentroidfield(STUDY.cluster, 'spec', 'spec_freqs'); + tmpstruct = std_setcomps2cell(STUDY, STUDY.cluster(cluster_ind).sets(:,si), STUDY.cluster(cluster_ind).comps(si)); + cellinds = [ tmpstruct.setinds{:} ]; + compinds = [ tmpstruct.allinds{:} ]; + cells = STUDY.design(STUDY.currentdesign).cell(cellinds); + fprintf('Pre-clustering array row %d, adding spectrum for design %d cell(s) [%s] component %d ...\n', si, STUDY.currentdesign, int2str(cellinds), compinds(1)); + X = std_readfile( cells, 'components', compinds, 'freqlimits', freqrange, 'measure', 'spec'); + if size(X,2) > 1, X = X - repmat(mean(X,2), [1 size(X,2)]); end; + X = X - repmat(mean(X,1), [size(X,1) 1]); + X = X(:)'; + + % select dipole information + % ------------------------- + case 'dipoles' + idat = STUDY.datasetinfo(STUDY.cluster(cluster_ind).sets(1,si)).index; + icomp = STUDY.cluster(cluster_ind).comps(si); + fprintf('Pre-clustering array row %d, adding dipole for dataset %d component %d...\n', si, idat, icomp); + try + % select among 3 sub-options + % -------------------------- + ldip = 1; + if size(ALLEEG(idat).dipfit.model(icomp).posxyz,1) == 2 % two dipoles model + if any(ALLEEG(idat).dipfit.model(icomp).posxyz(1,:)) ... + && any(ALLEEG(idat).dipfit.model(icomp).posxyz(2,:)) %both dipoles exist + % find the leftmost dipole + [garb ldip] = max(ALLEEG(idat).dipfit.model(icomp).posxyz(:,2)); + elseif any(ALLEEG(idat).dipfit.model(icomp).posxyz(2,:)) + ldip = 2; % the leftmost dipole is the only one that exists + end + end + X = ALLEEG(idat).dipfit.model(icomp).posxyz(ldip,:); + catch + error([ sprintf('Some dipole information is missing (e.g. component %d of dataset %d)', icomp, idat) 10 ... + 'Components are not assigned a dipole if residual variance is too high so' 10 ... + 'in the STUDY info editor, remember to select component by residual' 10 ... + 'variance (column "select by r.v.") prior to preclustering them.' ]); + end + + % cluster on ica ersp / itc values + % -------------------------------- + case {'ersp', 'itc' } + % read and concatenate all cells for this specific set + % of identical ICA decompositions + STUDY.cluster = checkcentroidfield(STUDY.cluster, 'ersp', 'ersp_times', 'ersp_freqs', 'itc', 'itc_times', 'itc_freqs'); + tmpstruct = std_setcomps2cell(STUDY, STUDY.cluster(cluster_ind).sets(:,si), STUDY.cluster(cluster_ind).comps(si)); + cellinds = [ tmpstruct.setinds{:} ]; + compinds = [ tmpstruct.allinds{:} ]; + cells = STUDY.design(STUDY.currentdesign).cell(cellinds); + fprintf('Pre-clustering array row %d, adding %s for design %d cell(s) [%s] component %d ...\n', si, upper(strcom), STUDY.currentdesign, int2str(cellinds), compinds(1)); + X = std_readfile( cells, 'components', compinds, 'timelimits', timewindow, 'measure', strcom); + end; + + % copy data in the array + % ---------------------- + if ~isreal(X) X = abs(X); end; % for ITC data + X = reshape(X, 1, numel(X)); + if si == 1, data = zeros(size(STUDY.cluster(cluster_ind).sets,2),length(X)); end; + data(si,:) = X; + try + data(si,:) = X; + catch, + error([ 'This type of pre-clustering requires that all subjects' 10 ... + 'be represented for all combination of selected independent' 10 ... + 'variables in the current STUDY design. In addition, for each' 10 ... + 'different ICA decomposition included in the STUDY (some' 10 ... + 'datasets may have the same decomposition), at least one' 10 ... + 'dataset must be represented.' ]); + end; + end; % end scan datasets + + % adjust number of PCA values + % --------------------------- + if isnan(npca), npca = 5; end; % default number of components + if npca >= size(data,2) + % no need to run PCA, just copy the data. + % But still run it to "normalize" coordinates + % -------------------------------------- + npca = size(data,2); + end; + if npca >= size(data,1) % cannot be more than the number of components + npca = size(data,1); + end; + if ~strcmp(strcom, 'dipoles') + fprintf('PCA dimension reduction to %d for command ''%s'' (normalize:%s; weight:%d)\n', ... + npca, strcom, fastif(norm, 'on', 'off'), weight); + else + fprintf('Retaining the three-dimensional dipole locations (normalize:%s; weight:%d)\n', ... + fastif(norm, 'on', 'off'), weight); + end + + % run PCA to reduce data dimension + % -------------------------------- + switch strcom + case {'ersp','itc'} + dsflag = 1; + while dsflag + try, + clustdatatmp = runpca( double(data.'), npca, 1); + dsflag = 0; + catch, + % downsample frequency by 2 and times by 2 + % ---------------------------------------- + data = data(:,1:2:end); + %idat = STUDY.datasetinfo(STUDY.setind(1)).index; + %[ tmp freqs times ] = std_readersp( ALLEEG, idat, succompind{1}(1)); + %[data freqs times ] = erspdownsample(data,4, freqs,times,Ncond); + if strcmp(varargin{index}(end-1) , 'downsample') + varargin{index}(end) = {celltomat(varargin{index}(end)) + 4}; + else + varargin{index}(end+1) = {'downsample'}; + varargin{index}(end+1) = {4}; + end + end + end + clustdatatmp = clustdatatmp.'; + case 'dipoles' + % normalize each cordinate by the std dev of the radii + normval = std(sqrt(data(:,1).^2 + data(:,2).^2 + data(:,3).^2)); + clustdatatmp = data./normval; + norm = 0; + case 'erp' + clustdatatmp = runpca( double(data.'), npca, 1); + clustdatatmp = abs(clustdatatmp.'); + otherwise + clustdatatmp = runpca( double(data.'), npca, 1); + clustdatatmp = clustdatatmp.'; + end + + if norm %normalize the first pc std to 1 + normval = std(clustdatatmp(:,1)); + for icol = 1:size(clustdatatmp,2) + clustdatatmp(:,icol) = clustdatatmp(:,icol) /normval; + end; + end; + if weight ~= 1 + clustdata(:,end+1:end+size(clustdatatmp,2)) = clustdatatmp * weight; + else + clustdata(:,end+1:end+size(clustdatatmp,2)) = clustdatatmp; + end + + if strcmpi(strcom, 'itc') | strcmpi(strcom, 'ersp') + erspmode = 'already_computed'; + end; + end + + % Compute a second PCA of the already PCA'd data if there are too many PCA dimensions. + % ------------------------------------------------------------------------------------ + if size(clustdata,2) > secondlevpca + fprintf('Performing second-level PCA: reducing dimension from %d to %d \n', ... + size(clustdata,2), secondlevpca); + clustdata = runpca( double(clustdata.'), secondlevpca, 1); + clustdata = clustdata.'; + end + + STUDY.etc.preclust.preclustdata = clustdata; + STUDY.etc.preclust.preclustparams = varargin; + if isfield(STUDY.etc.preclust, 'preclustcomps') + STUDY.etc.preclust = rmfield(STUDY.etc.preclust, 'preclustcomps'); + end; + + % The preclustering level is equal to the parent cluster that the components belong to. + if ~isempty(cluster_ind) + STUDY.etc.preclust.clustlevel = cluster_ind; + else + STUDY.etc.preclust.clustlevel = 1; % No parent cluster (cluster on all components in STUDY). + end + +return + +% erspdownsample() - down samples component ERSP/ITC images if the +% PCA operation in the clustering feature reduction step fails. +% This is a helper function called by eeg_preclust(). + +function [dsdata, freqs, times] = erspdownsample(data, n, freqs,times,cond) + len = length(freqs)*length(times); %size of ERSP + nlen = ceil(length(freqs)/2)*ceil(length(times)/2); %new size of ERSP + dsdata = zeros(size(data,1),cond*nlen); + for k = 1:cond + tmpdata = data(:,1+(k-1)*len:k*len); + for l = 1:size(data,1) % go over components + tmpersp = reshape(tmpdata(l,:)',length(freqs),length(times)); + tmpersp = downsample(tmpersp.', n/2).'; %downsample times + tmpersp = downsample(tmpersp, n/2); %downsample freqs + dsdata(l,1+(k-1)*nlen:k*nlen) = tmpersp(:)'; + end + end + +% the function below checks the precense of the centroid field +function cluster = checkcentroidfield(cluster, varargin); + for kk = 1:length(cluster) + if ~isfield('centroid', cluster(kk)), cluster(kk).centroid = []; end; + for vi = 1:length(varargin) + if isfield(cluster(kk).centroid, varargin{vi}) + cluster(kk).centroid = rmfield(cluster(kk).centroid, varargin{vi}); + end; + end; + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_precomp.m b/code/eeglab13_4_4b/functions/studyfunc/std_precomp.m new file mode 100644 index 0000000..820b3ce --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_precomp.m @@ -0,0 +1,574 @@ +% std_precomp() - Precompute measures (ERP, spectrum, ERSP, ITC) for channels in a +% study. If channels are interpolated before computing the measures, +% the updated EEG datasets are also saved to disk. Called by +% pop_precomp(). Follow with pop_plotstudy(). See Example below. +% Usage: +% >> [STUDY ALLEEG customRes] = std_precomp(STUDY, ALLEEG, chanorcomp, 'key', 'val', ...); +% +% Required inputs: +% STUDY - an EEGLAB STUDY set of loaded EEG structures +% ALLEEG - ALLEEG vector of one or more loaded EEG dataset structures +% chanorcomp - ['components'|'channels'| or channel cell array] The string +% 'components' forces the program to precompute all selected +% measures for components. The string 'channels' forces the +% program to compute all measures for all channels. +% A channel cell array containing channel labels will precompute +% the selected measures. Note that the name of the channel is +% not case-sensitive. +% Optional inputs: +% 'design' - [integer] use specific study index design to compute measure. +% 'cell' - [integer] compute measure only for a give data file. +% 'erp' - ['on'|'off'] pre-compute ERPs for each dataset. +% 'spec' - ['on'|'off'] pre-compute spectrum for each dataset. +% Use 'specparams' to set spectrum parameters. +% 'ersp' - ['on'|'off'] pre-compute ERSP for each dataset. +% Use 'erspparams' to set time/frequency parameters. +% 'itc' - ['on'|'off'] pre-compute ITC for each dataset. +% Use 'erspparams' to set time/frequency parameters. +% 'scalp' - ['on'|'off'] pre-compute scalp maps for components. +% 'allcomps' - ['on'|'off'] compute ERSP/ITC for all components ('off' +% only use pre-selected components in the pop_study interface). +% 'erpparams' - [cell array] Parameters for the std_erp function. See +% std_erp for more information. +% 'specparams' - [cell array] Parameters for the std_spec function. See +% std_spec for more information. +% 'erspparams' - [cell array] Optional arguments for the std_ersp function. +% 'erpimparams' - [cell array] Optional argument for std_erpimage. See +% std_erpimage for the list of arguments. +% 'recompute' - ['on'|'off'] force recomputing ERP file even if it is +% already on disk. +% 'rmicacomps' - ['on'|'off'|'processica'] remove ICA components pre-selected in +% each dataset (EEGLAB menu item, "Tools > Reject data using ICA +% > Reject components by map). This option is ignored when +% precomputing measures for ICA clusters. Default is 'off'. +% 'processica' forces to process ICA components instead of +% removing them. +% 'rmclust' - [integer array] remove selected ICA component clusters. +% For example, ICA component clusters containing +% artifacts. This option is ignored when precomputing +% measures for ICA clusters. +% 'savetrials' - ['on'|'off'] save single-trials ERSP. Requires a lot of disk +% space (dataset space on disk times 10) but allow for refined +% single-trial statistics. +% 'customfunc' - [function_handle] execute a specific function on each +% EEGLAB dataset of the selected STUDY design. The fist +% argument to the function is an EEGLAB dataset. Example is +% @(EEG)mean(EEG.data,3) +% This will compute the ERP for the STUDY design. EEG is the +% EEGLAB dataset corresponding to each cell design. It +% corresponds to a dataset computed dynamically based on +% the design selection. If 'rmclust', 'rmicacomps' or 'interp' +% are being used, the channel data is affected +% accordingly. Anonymous and non-anonymous functions may be +% used. The output is returned in CustomRes or saved on +% disk. The output of the custom function may be an numerical +% array or a structure. +% 'customparams' - [cell array] Parameters for the custom function above. +% 'customfileext' - [string] file extension for saving custom data. Use +% function to read custom data. If left empty, the +% result is returned in the customRes output. Note that +% if the custom function does not return a structure, +% the data is automatically saved in a variable named +% 'data'. +% 'customclusters' - [integer array] load only specific clusters. This is +% used with SIFT. chanorcomp 3rd input must be 'components'. +% +% Outputs: +% ALLEEG - the input ALLEEG vector of EEG dataset structures, modified +% by adding preprocessing data as pointers to Matlab files that +% hold the pre-clustering component measures. +% STUDY - the input STUDY set with pre-clustering data added, +% for use by pop_clust() +% customRes - cell array of custom results (one cell for each pair of +% independent variables as defined in the STUDY design). +% If a custom file extension is specified, this variable +% is empty as the function assumes that the result is too +% large to hold in memory. +% +% Example: +% >> [STUDY ALLEEG customRes] = std_precomp(STUDY, ALLEEG, { 'cz' 'oz' }, 'interp', ... +% 'on', 'erp', 'on', 'spec', 'on', 'ersp', 'on', 'erspparams', ... +% { 'cycles' [ 3 0.5 ], 'alpha', 0.01, 'padratio' 1 }); +% +% % This prepares, channels 'cz' and 'oz' in the STUDY datasets. +% % If a data channel is missing in one dataset, it will be +% % interpolated (see eeg_interp()). The ERP, spectrum, ERSP, and +% % ITC for each dataset is then computed. +% +% Example of custom call: +% The function below computes the ERP of the EEG data for each channel and plots it. +% >> [STUDY ALLEEG customres] = std_precomp(STUDY, ALLEEG, 'channels', 'customfunc', @(EEG,varargin)(mean(EEG.data,3)')); +% >> std_plotcurve([1:size(customres{1},1)], customres, 'chanlocs', eeg_mergelocs(ALLEEG.chanlocs)); % plot data +% +% The function below uses a data file to store the information then read +% the data and eventyally plot it +% >> [STUDY ALLEEG customres] = std_precomp(STUDY, ALLEEG, 'channels', 'customfunc', @(EEG,varargin)(mean(EEG.data,3)), 'customfileext', 'tmperp'); +% >> erpdata = std_readcustom(STUDY, ALLEEG, 'tmperp'); +% >> std_plotcurve([1:size(erpdata{1})], erpdata, 'chanlocs', eeg_mergelocs(ALLEEG.chanlocs)); % plot data +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, 2006- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2006, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY, ALLEEG customRes ] = std_precomp(STUDY, ALLEEG, chanlist, varargin) + + if nargin < 2 + help std_precomp; + return; + end; + + if nargin == 2 + chanlist = 'channels'; % default to clustering the whole STUDY + end + customRes = []; + Ncond = length(STUDY.condition); + if Ncond == 0 + Ncond = 1; + end + + g = finputcheck(varargin, { 'erp' 'string' { 'on','off' } 'off'; + 'interp' 'string' { 'on','off' } 'off'; + 'ersp' 'string' { 'on','off' } 'off'; + 'recompute' 'string' { 'on','off' } 'off'; + 'spec' 'string' { 'on','off' } 'off'; + 'erpim' 'string' { 'on','off' } 'off'; + 'scalp' 'string' { 'on','off' } 'off'; + 'allcomps' 'string' { 'on','off' } 'off'; + 'itc' 'string' { 'on','off' } 'off'; + 'savetrials' 'string' { 'on','off' } 'off'; + 'rmicacomps' 'string' { 'on','off','processica' } 'off'; + 'cell' 'integer' [] []; + 'design' 'integer' [] STUDY.currentdesign; + 'rmclust' 'integer' [] []; + 'rmbase' 'integer' [] []; % deprecated, for backward compatibility purposes, not documented + 'specparams' 'cell' {} {}; + 'erpparams' 'cell' {} {}; + 'customfunc' {'function_handle' 'integer' } { { } {} } []; + 'customparams' 'cell' {} {}; + 'customfileext' 'string' [] ''; + 'customclusters' 'integer' [] []; + 'erpimparams' 'cell' {} {}; + 'erspparams' 'cell' {} {}}, 'std_precomp'); + if isstr(g), error(g); end; + if ~isempty(g.rmbase), g.erpparams = { g.erpparams{:} 'rmbase' g.rmbase }; end; + + % union of all channel structures + % ------------------------------- + computewhat = 'channels'; + if isstr(chanlist) + if strcmpi(chanlist, 'channels') + chanlist = []; + else % components + computewhat = 'components'; + if strcmpi(g.allcomps, 'on') + chanlist = {}; + for index = 1:length(STUDY.datasetinfo) + chanlist = { chanlist{:} [1:size(ALLEEG(STUDY.datasetinfo(index).index).icaweights,1)] }; + end; + else + chanlist = { STUDY.datasetinfo.comps }; + end; + end; + end; + if isempty(chanlist) + alllocs = eeg_mergelocs(ALLEEG.chanlocs); + chanlist = { alllocs.labels }; + elseif ~isnumeric(chanlist{1}) + alllocs = eeg_mergelocs(ALLEEG.chanlocs); + [tmp c1 c2] = intersect_bc( lower({ alllocs.labels }), lower(chanlist)); + [tmp c2] = sort(c2); + alllocs = alllocs(c1(c2)); + end; + + % test if interp and reconstruct channel list + % ------------------------------------------- + if strcmpi(computewhat, 'channels') + if strcmpi(g.interp, 'on') + STUDY.changrp = []; + STUDY = std_changroup(STUDY, ALLEEG, chanlist, 'interp'); + g.interplocs = alllocs; + else + STUDY.changrp = []; + STUDY = std_changroup(STUDY, ALLEEG, chanlist); + g.interplocs = struct([]); + end; + end; + + % components or channels + % ---------------------- + if strcmpi(computewhat, 'channels') + curstruct = STUDY.changrp; + else curstruct = STUDY.cluster; + end; + + % compute custom measure + % ---------------------- + if ~isempty(g.customfunc) + nc = max(length(STUDY.design(g.design).variable(1).value),1); + ng = max(length(STUDY.design(g.design).variable(2).value),1); + allinds = curstruct(1).allinds; % same for all channels and components (see std_selectdesign) + setinds = curstruct(1).setinds; % same for all channels and components (see std_selectdesign) + if ~isempty(g.customclusters) + allinds = curstruct(g.customclusters).allinds; % same for all channels and components (see std_selectdesign) + setinds = curstruct(g.customclusters).setinds; % same for all channels and components (see std_selectdesign) + end; + + for cInd = 1:nc + for gInd = 1:ng + if ~isempty(setinds{cInd,gInd}) + desset = STUDY.design(g.design).cell(setinds{cInd,gInd}(:)); + for iDes = 1:length(desset) + if strcmpi(computewhat, 'channels') + [tmpchanlist opts] = getchansandopts(STUDY, ALLEEG, chanlist, desset(iDes).dataset, g); + TMPEEG = std_getdataset(STUDY, ALLEEG, 'design', g.design, 'cell', setinds{cInd,gInd}(iDes), opts{:}); % trial indices included in cell selection + else TMPEEG = std_getdataset(STUDY, ALLEEG, 'design', g.design, 'cell', setinds{cInd,gInd}(iDes), 'cluster', g.customclusters); + end; + addopts = { 'savetrials', g.savetrials, 'recompute', g.recompute }; % not currently used + + tmpData = feval(g.customfunc, TMPEEG, g.customparams{:}); + if isempty(g.customfileext) + resTmp(:,:,iDes) = tmpData; + else + fileName = [ desset(iDes).filebase '.' g.customfileext ]; + clear data; + data.data = tmpData; + data.datafile = computeFullFileName( { ALLEEG(desset(iDes).dataset).filepath }, { ALLEEG(desset(iDes).dataset).filename }); + data.datatrials = desset(iDes).trials; + data.datatype = upper(g.customfileext); + if ~isempty(g.customparams) data.parameters = g.customparams; end; + std_savedat(fileName, data); + end; + end; + if isempty(g.customfileext) + customRes{cInd,gInd} = resTmp; + end; + clear resTmp; + end; + end; + end; + end; + + % compute ERPs + % ------------ + if strcmpi(g.erp, 'on') + % check dataset consistency + % ------------------------- + allPnts = [ALLEEG([STUDY.design(g.design).cell.dataset]).pnts]; + if iscell(allPnts), allPnts = [ allPnts{:} ]; end; + if length(unique(allPnts)) > 1 + error([ 'Cannot compute ERPs because datasets' 10 'do not have the same number of data points' ]) + end; + + for index = 1:length(STUDY.design(g.design).cell) + if ~isempty(g.cell) + desset = STUDY.design(g.design).cell(g.cell); + else desset = STUDY.design(g.design).cell(index); + end; + addopts = { 'savetrials', g.savetrials, 'recompute', g.recompute, 'fileout', desset.filebase, 'trialindices', desset.trials }; + if strcmpi(computewhat, 'channels') + [tmpchanlist opts] = getchansandopts(STUDY, ALLEEG, chanlist, desset.dataset, g); + std_erp(ALLEEG(desset.dataset), 'channels', tmpchanlist, opts{:}, addopts{:}, g.erpparams{:}); + else + if length(desset.dataset)>1 && ~isequal(chanlist{desset.dataset}) + error(['ICA decompositions must be identical if' 10 'several datasets are concatenated to build' 10 'the design, abording' ]); + end; + std_erp(ALLEEG(desset.dataset), 'components', chanlist{desset.dataset(1)}, addopts{:}, g.erpparams{:}); + end; + if ~isempty(g.cell), break; end; + end; + if isfield(curstruct, 'erpdata') + curstruct = rmfield(curstruct, 'erpdata'); + curstruct = rmfield(curstruct, 'erptimes'); + end; + end; + + % compute spectrum + % ---------------- + if strcmpi(g.spec, 'on') + % check dataset consistency + % ------------------------- + for index = 1:length(STUDY.design(g.design).cell) + if ~isempty(g.cell) + desset = STUDY.design(g.design).cell(g.cell); + else desset = STUDY.design(g.design).cell(index); + end; + addopts = { 'savetrials', g.savetrials, 'recompute', g.recompute, 'fileout', desset.filebase, 'trialindices', desset.trials }; + if strcmpi(computewhat, 'channels') + [tmpchanlist opts] = getchansandopts(STUDY, ALLEEG, chanlist, desset.dataset, g); + std_spec(ALLEEG(desset.dataset), 'channels', tmpchanlist, opts{:}, addopts{:}, g.specparams{:}); + else + if length(desset.dataset)>1 && ~isequal(chanlist{desset.dataset}) + error(['ICA decompositions must be identical if' 10 'several datasets are concatenated to build' 10 'the design, abording' ]); + end; + std_spec(ALLEEG(desset.dataset), 'components', chanlist{desset.dataset(1)}, addopts{:}, g.specparams{:}); + end; + if ~isempty(g.cell), break; end; + end; + if isfield(curstruct, 'specdata') + curstruct = rmfield(curstruct, 'specdata'); + curstruct = rmfield(curstruct, 'specfreqs'); + end; + end; + + % compute spectrum + % ---------------- + if strcmpi(g.erpim, 'on') + % check dataset consistency + % ------------------------- + allPnts = [ALLEEG([STUDY.design(g.design).cell.dataset]).pnts]; + if iscell(allPnts), allPnts = [ allPnts{:} ]; end; + if length(unique(allPnts)) > 1 + error([ 'Cannot compute ERSPs/ITCs because datasets' 10 'do not have the same number of data points' ]) + end; + + % check consistency with parameters on disk + % ----------------------------------------- + guimode = 'guion'; + tmpparams = {}; + tmpparams = g.erpimparams; + if strcmpi(g.recompute, 'off') + for index = 1:length(STUDY.design(g.design).cell) + desset = STUDY.design(g.design).cell(index); + if strcmpi(computewhat, 'channels') + filename = [ desset.filebase '.daterpim']; + else filename = [ desset.filebase '.icaerpim']; + end; + [guimode, g.erpimparams] = std_filecheck(filename, g.erpimparams, guimode, { 'fileout' 'recompute', 'channels', 'components', 'trialindices'}); + if strcmpi(guimode, 'cancel'), return; end; + end; + if strcmpi(guimode, 'usedisk') || strcmpi(guimode, 'same'), g.recompute = 'off'; + else g.recompute = 'on'; + end; + if ~isempty(g.erpimparams) && isstruct(g.erpimparams) + tmpparams = fieldnames(g.erpimparams); tmpparams = tmpparams'; + tmpparams(2,:) = struct2cell(g.erpimparams); + end; + end; + + % set parameters in ERPimage parameters + % ------------------------------------- + STUDY = pop_erpimparams(STUDY, tmpparams{:}); % a little trashy as the function pop_erpimparams does not check the fields + + % compute ERPimages + % ----------------- + for index = 1:length(STUDY.design(g.design).cell) + if ~isempty(g.cell) + desset = STUDY.design(g.design).cell(g.cell); + else desset = STUDY.design(g.design).cell(index); + end; + addopts = { 'recompute', g.recompute, 'fileout', desset.filebase, 'trialindices', desset.trials }; + if strcmpi(computewhat, 'channels') + [tmpchanlist opts] = getchansandopts(STUDY, ALLEEG, chanlist, desset.dataset, g); + std_erpimage(ALLEEG(desset.dataset), 'channels', tmpchanlist, opts{:}, addopts{:}, tmpparams{:}); + else + if length(desset.dataset)>1 && ~isequal(chanlist{desset.dataset}) + error(['ICA decompositions must be identical if' 10 'several datasets are concatenated to build' 10 'the design, abording' ]); + end; + std_erpimage(ALLEEG(desset.dataset), 'components', chanlist{desset.dataset(1)}, addopts{:}, tmpparams{:}); + end; + if ~isempty(g.cell), break; end; + end; + if isfield(curstruct, 'erpimdata') + curstruct = rmfield(curstruct, 'erpimdata'); + curstruct = rmfield(curstruct, 'erpimtimes'); + curstruct = rmfield(curstruct, 'erpimtrials'); + curstruct = rmfield(curstruct, 'erpimevents'); + end; + end; + + % compute component scalp maps + % ---------------------------- + if strcmpi(g.scalp, 'on') && ~strcmpi(computewhat, 'channels') + for index = 1:length(STUDY.datasetinfo) + + % find duplicate + % -------------- + found = []; + ind1 = STUDY.datasetinfo(index).index; + inds = strmatch(STUDY.datasetinfo(index).subject, { STUDY.datasetinfo(1:index-1).subject }); + for index2 = 1:length(inds) + ind2 = STUDY.datasetinfo(inds(index2)).index; + if isequal(ALLEEG(ind1).icawinv, ALLEEG(ind2).icawinv) + found = ind2; + end; + end; + + % make link if duplicate + % ---------------------- + fprintf('Computing/checking topo file for dataset %d\n', ind1); + if ~isempty(found) + tmpfile1 = fullfile( ALLEEG(index).filepath, [ ALLEEG(index).filename(1:end-3) 'icatopo' ]); + tmp.file = fullfile( ALLEEG(found).filepath, [ ALLEEG(found).filename(1:end-3) 'icatopo' ]); + std_savedat(tmpfile1, tmp); + else + std_topo(ALLEEG(index), chanlist{index}, 'none', 'recompute', g.recompute); + end; + end; + if isfield(curstruct, 'topo') + curstruct = rmfield(curstruct, 'topo'); + curstruct = rmfield(curstruct, 'topox'); + curstruct = rmfield(curstruct, 'topoy'); + curstruct = rmfield(curstruct, 'topoall'); + curstruct = rmfield(curstruct, 'topopol'); + end; + end; + + % compute ERSP and ITC + % -------------------- + if strcmpi(g.ersp, 'on') || strcmpi(g.itc, 'on') + % check dataset consistency + % ------------------------- + allPnts = [ALLEEG([STUDY.design(g.design).cell.dataset]).pnts]; + if iscell(allPnts), allPnts = [ allPnts{:} ]; end; + if length(unique(allPnts)) > 1 + error([ 'Cannot compute ERSPs/ITCs because datasets' 10 'do not have the same number of data points' ]) + end; + + if strcmpi(g.ersp, 'on') & strcmpi(g.itc, 'on'), type = 'both'; + elseif strcmpi(g.ersp, 'on') , type = 'ersp'; + else type = 'itc'; + end; + + % check for existing files + % ------------------------ + guimode = 'guion'; + [ tmpX tmpt tmpf g.erspparams ] = std_ersp(ALLEEG(1), 'channels', 1, 'type', type, 'recompute', 'on', 'getparams', 'on', 'savetrials', g.savetrials, g.erspparams{:}); + if strcmpi(g.recompute, 'off') + for index = 1:length(STUDY.design(g.design).cell) + desset = STUDY.design(g.design).cell(index); + if strcmpi(computewhat, 'channels') + filename = [ desset.filebase '.datersp']; + else filename = [ desset.filebase '.icaersp']; + end; + [guimode, g.erspparams] = std_filecheck(filename, g.erspparams, guimode, { 'plotitc' 'plotersp' 'plotphase' }); + if strcmpi(guimode, 'cancel'), return; end; + end; + if strcmpi(guimode, 'usedisk') || strcmpi(guimode, 'same'), g.recompute = 'off'; + else g.recompute = 'on'; + end; + end; + + % check for existing files + % ------------------------ + if isempty(g.erspparams), + tmpparams = {}; + elseif iscell(g.erspparams), + tmpparams = g.erspparams; + else + tmpparams = fieldnames(g.erspparams); tmpparams = tmpparams'; + tmpparams(2,:) = struct2cell(g.erspparams); + end; + tmpparams = { tmpparams{:} 'recompute' g.recompute }; + for index = 1:length(STUDY.design(g.design).cell) + if ~isempty(g.cell) + desset = STUDY.design(g.design).cell(g.cell); + else desset = STUDY.design(g.design).cell(index); + end; + if strcmpi(computewhat, 'channels') + [tmpchanlist opts] = getchansandopts(STUDY, ALLEEG, chanlist, desset.dataset, g); + std_ersp(ALLEEG(desset.dataset), 'channels', tmpchanlist, 'type', type, 'fileout', desset.filebase, 'trialindices', desset.trials, opts{:}, tmpparams{:}); + else + if length(desset.dataset)>1 && ~isequal(chanlist{desset.dataset}) + error(['ICA decompositions must be identical if' 10 'several datasets are concatenated to build' 10 'the design, abording' ]); + end; + std_ersp(ALLEEG(desset.dataset), 'components', chanlist{desset.dataset(1)}, 'type', type, 'fileout', desset.filebase, 'trialindices', desset.trials, tmpparams{:}); + end; + if ~isempty(g.cell), break; end; + end; + if isfield(curstruct, 'erspdata') + curstruct = rmfield(curstruct, 'erspdata'); + curstruct = rmfield(curstruct, 'ersptimes'); + curstruct = rmfield(curstruct, 'erspfreqs'); + end; + if isfield(curstruct, 'itcdata') + curstruct = rmfield(curstruct, 'itcdata'); + curstruct = rmfield(curstruct, 'itctimes'); + curstruct = rmfield(curstruct, 'itcfreqs'); + end; + end; + + % components or channels + % ---------------------- + if strcmpi(computewhat, 'channels') + STUDY.changrp = curstruct; + else STUDY.cluster = curstruct; + end; + + return; + + % find components in cluster for specific dataset + % ----------------------------------------------- + function rmcomps = getclustcomps(STUDY, rmclust, settmpind); + + rmcomps = cell(1,length(settmpind)); + for idat = 1:length(settmpind) % scan dataset for which to find component clusters + for rmi = 1:length(rmclust) % scan clusters + comps = STUDY.cluster(rmclust(rmi)).comps; + sets = STUDY.cluster(rmclust(rmi)).sets; + indmatch = find(sets(:) == settmpind(idat)); + indmatch = ceil(indmatch/size(sets,1)); % get the column number + rmcomps{idat} = [rmcomps{idat} comps(indmatch(:)') ]; + end; + rmcomps{idat} = sort(rmcomps{idat}); + end; + + % make option array and channel list (which depend on interp) for any type of measure + % ---------------------------------------------------------------------- + function [tmpchanlist, opts] = getchansandopts(STUDY, ALLEEG, chanlist, idat, g); + + opts = { }; + + if ~isempty(g.rmclust) || strcmpi(g.rmicacomps, 'on') || strcmpi(g.rmicacomps, 'processica') + rmcomps = cell(1,length(idat)); + if ~isempty(g.rmclust) + rmcomps = getclustcomps(STUDY, g.rmclust, idat); + end; + if strcmpi(g.rmicacomps, 'on') + for ind = 1:length(idat) + rmcomps{ind} = union_bc(rmcomps{ind}, find(ALLEEG(idat(1)).reject.gcompreject)); + end; + elseif strcmpi(g.rmicacomps, 'processica') + for ind = 1:length(idat) + rmcomps{ind} = union_bc(rmcomps{ind}, find(~ALLEEG(idat(1)).reject.gcompreject)); + end; + end; + opts = { opts{:} 'rmcomps' rmcomps }; + end; + if strcmpi(g.interp, 'on') + tmpchanlist = chanlist; + allocs = eeg_mergelocs(ALLEEG.chanlocs); + [tmp1 tmp2 neworder] = intersect_bc( {allocs.labels}, chanlist); + [tmp1 ordertmp2] = sort(tmp2); + neworder = neworder(ordertmp2); + opts = { opts{:} 'interp' allocs(neworder) }; + else + newchanlist = []; + tmpchanlocs = ALLEEG(idat(1)).chanlocs; + chanlocs = { tmpchanlocs.labels }; + for i=1:length(chanlist) + newchanlist = [ newchanlist strmatch(chanlist{i}, chanlocs, 'exact') ]; + end; + tmpchanlocs = ALLEEG(idat(1)).chanlocs; + tmpchanlist = { tmpchanlocs(newchanlist).labels }; + end; + + % compute full file names + % ----------------------- + function res = computeFullFileName(filePaths, fileNames); + for index = 1:length(fileNames) + res{index} = fullfile(filePaths{index}, fileNames{index}); + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_precomp_worker.m b/code/eeglab13_4_4b/functions/studyfunc/std_precomp_worker.m new file mode 100644 index 0000000..a4062b4 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_precomp_worker.m @@ -0,0 +1,74 @@ +% std_precomp_worker() - allow dispatching ERSP to be computed in parallel +% on a given cluster. +% Usage: +% >> feature = std_precomp_worker(filename, varargin); +% +% Inputs: +% filename - STUDY file name +% +% Optional inputs: +% Optional inputs are the same as for the std_precomp function. Note that +% this function can currently only compute ERSP and ITC. The argument +% 'cell' must be defined so a given node will only compute the measure on +% one cell (one cell per node). +% output trials {default: whole measure range} +% Output: +% feature - data structure containing ERSP and/or ITC +% +% Author: Arnaud Delorme, SCCN, UCSD, 2012- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function feature = std_precomp_worker(filename, varargin) + +if nargin < 2 + help std_precomp_worker; + return; +end; + +g = struct(varargin{2:end}); + +% load dataset +% ------------ +[STUDY ALLEEG] = pop_loadstudy('filename', filename); +if ~isfield(g, 'design'), g.design = STUDY.currentdesign; end; +if isfield(g, 'erp') || isfield(g, 'spec') || isfield(g, 'erpim') || isfield(g, 'scalp') + error('This function is currently designed to compute time-frequency decompositions only'); +end; +if ~isfield(g, 'ersp') && ~isfield(g, 'itc') + error('You must compute either ERSP or ITC when using the EC2 cluster'); +end; + +% run std_precomp (THIS IS THE PART WE WANT TO PARALELIZE) +% --------------- +% for index = 1:length(STUDY.design(g.design).cell) +% [STUDY ALLEEG] = std_precomp(STUDY, ALLEEG, varargin{:}, 'cell', index); +% end; +std_precomp(STUDY, ALLEEG, varargin{:}); + +filebase = STUDY.design(g.design).cell(g.cell).filebase; +if isfield(g, 'channel') + fileERSP = [ filebase '.datersp' ]; + fileITC = [ filebase '.datitc' ]; + if exist(fileERSP), feature.ersp = load('-mat', fileERSP); end; + if exist(fileITC ), feature.itc = load('-mat', fileITC ); end; +else + fileERSP = [ filebase '.icaersp' ]; + fileITC = [ filebase '.icaitc' ]; + if exist(fileERSP), feature.ersp = load('-mat', fileERSP); end; + if exist(fileITC ), feature.itc = load('-mat', fileITC ); end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_prepare_neighbors.m b/code/eeglab13_4_4b/functions/studyfunc/std_prepare_neighbors.m new file mode 100644 index 0000000..fe70962 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_prepare_neighbors.m @@ -0,0 +1,108 @@ +% std_prepare_neighbors() - prepare Fieldtrip channel neighbor structure. +% Only prepare the structure if necessary based +% on statistical options in STUDY.etc.statistics. +% Use the 'force' option to force preparing the +% matrix. +% +% Usage: +% >> [STUDY neighbors] = std_prepare_neighbors( STUDY, ALLEEG, 'key', val) +% +% Inputs: +% STUDY - an EEGLAB STUDY set of loaded EEG structures +% ALLEEG - ALLEEG vector of one or more loaded EEG dataset structures +% +% Optional inputs: +% 'force' - ['on'|'off'] force generating the structure irrespective +% of the statistics options selected. Default is 'off'. +% 'channels' - [cell] list of channels to include in the matrix +% 'method' - [string] method for preparing. See ft_prepare_neighbors +% 'neighbordist' - [float] max distance. See ft_prepare_neighbors +% +% Note: other ft_prepare_neighbors fields such as template, layout may +% also be used as optional keywords. +% +% Outputs: +% STUDY - an EEGLAB STUDY set of loaded EEG structures +% neighbors - Fieldtrip channel neighbour structure +% +% Author: Arnaud Delorme, SCCN, UCSD, 2012- +% +% See also: statcondfieldtrip() + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY neighbors] = std_prepare_neighbors(STUDY, ALLEEG, varargin); + +neighbors = []; +if nargin < 2 + return; +end; + +[opt addopts] = finputcheck( varargin, { 'force' 'string' { 'on','off' } 'off'; + 'channels' 'cell' {} {} }, 'std_stat', 'ignore'); + +if strcmpi(opt.force, 'on') || (strcmpi(STUDY.etc.statistics.fieldtrip.mcorrect, 'cluster') && ... + strcmpi(STUDY.etc.statistics.mode, 'fieldtrip') && (strcmpi(STUDY.etc.statistics.groupstats, 'on') || strcmpi(STUDY.etc.statistics.condstats, 'on'))) + + EEG = eeg_emptyset; + EEG.chanlocs = eeg_mergelocs(ALLEEG.chanlocs); + if isempty(EEG.chanlocs) + disp('std_prepare_neighbors: cannot prepare channel neighbour structure because of empty channel structures'); + return; + end; + + if ~isempty(STUDY.etc.statistics.fieldtrip.channelneighbor) && isempty(addopts) && ... + length(STUDY.etc.statistics.fieldtrip.channelneighbor) == length(EEG.chanlocs) + + disp('Using stored channel neighbour structure'); + neighbors = STUDY.etc.statistics.fieldtrip.channelneighbor; + + else + + if ~isempty(opt.channels) + indChans = eeg_chaninds(EEG, opt.channels); + EEG.chanlocs = EEG.chanlocs(indChans); + end; + + EEG.nbchan = length(EEG.chanlocs); + EEG.data = zeros(EEG.nbchan,100,1); + EEG.trials = 1; + EEG.pnts = 100; + EEG.xmin = 0; + EEG.srate = 1; + EEG.xmax = 99; + EEG = eeg_checkset(EEG); + tmpcfg = eeglab2fieldtrip(EEG, 'preprocessing', 'none'); + + % call the function that find channel neighbors + % --------------------------------------------- + addparams = eval( [ '{' STUDY.etc.statistics.fieldtrip.channelneighborparam '}' ]); + for index = 1:2:length(addparams) + tmpcfg = setfield(tmpcfg, addparams{index}, addparams{index+1}); + end; + for index = 1:2:length(addopts) + tmpcfg = setfield(tmpcfg, addopts{index}, addopts{index+1}); + end; + warning off; + cfg.neighbors = ft_prepare_neighbours(tmpcfg, tmpcfg); + warning on; + neighbors = cfg.neighbors; + + end; + + STUDY.etc.statistics.fieldtrip.channelneighbor = neighbors; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_propplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_propplot.m new file mode 100644 index 0000000..ab6d4b2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_propplot.m @@ -0,0 +1,206 @@ +% std_propplot() - Command line function to plot component cluster +% properties for a STUDY set. +% Displays mean cluster scalp map, ERP, ERSP; +% dipole model, spectrum, and ITC in one figure +% per cluster. Only meaasures computed during +% pre-clustering (by pop_preclust() or std_preclust()) +% are plotted. Called by pop_clustedit(). +% Leaves the plotted grand mean cluster measures +% in STUDY.cluster for quick replotting. +% Usage: +% >> [STUDY] = std_propplot(STUDY, ALLEEG, clusters); +% Inputs: +% STUDY - STUDY set including some or all EEG datasets in ALLEEG. +% ALLEEG - vector of EEG dataset structures including the datasets +% in the STUDY. Yypically created using load_ALLEEG(). +% +% Optional inputs: +% clusters - [numeric vector | 'all'] -> cluster numbers to plot. +% Else 'all' -> make plots for all clusters in the STUDY +% {default: 'all'}. +% Outputs: +% STUDY - the input STUDY set structure modified with the plotted +% cluster mean properties to allow quick replotting (unless +% cluster means already existed in the STUDY). +% Example: +% % Plot mean properties of Cluster 5 in one figure. +% >> [STUDY] = std_propplot(STUDY,ALLEEG, 5); +% +% See also: pop_clustedit() +% +% Authors: Arnaud Delorme, Hilit Serby, Scott Makeig, SCCN/INC/UCSD, 2005 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_propplot(STUDY, ALLEEG, varargin) + +icadefs; % read EEGLAB defaults +warningon = 0; + +if iscell(varargin{1}) % channel plotting + chans = varargin{1}; + for k = 1: length(chans); + figure + orient tall + set(gcf,'Color', BACKCOLOR); + subplot(2,2,1), + try, + STUDY = std_erpplot(STUDY,ALLEEG, 'channels', chans(k), 'mode', 'together', 'plotmode', 'condensed' ); + erpAxisHangle = gca; + catch + axis off; text(0.5, 0.5, 'No ERP information', 'horizontalalignment', 'center'); + warningon = 1; + end + subplot(2,2,2), + try, + [STUDY] = std_erspplot(STUDY,ALLEEG, 'channels', chans(k), 'mode', 'together', 'plotmode', 'condensed' ); + catch, + axis off; text(0.5, 0.5, 'No ERSP information', 'horizontalalignment', 'center'); + warningon = 1; + end + subplot(2,2,3), + try, + STUDY = std_specplot(STUDY,ALLEEG, 'channels', chans(k), 'mode', 'together', 'plotmode', 'condensed'); + catch + axis off; text(0.5, 0.5, 'No spectral information', 'horizontalalignment', 'center'); + warningon = 1; + end + subplot(2,2,4), + try, + [STUDY] = std_itcplot(STUDY,ALLEEG, 'channels', chans(k), 'mode', 'together', 'plotmode', 'condensed' ); + catch, + axis off; text(0.5, 0.5, 'No ITC information', 'horizontalalignment', 'center'); + warningon = 1; + end + + %subplot('position', [0.77 0.16 0.15 0.28]), + maintitle = ['Channel ''' chans{k} ''' average properties' ]; + a = textsc(maintitle, 'title'); + set(a, 'fontweight', 'bold'); + + if warningon + disp('Some properties could not be plotted. To plot these properties, first'); + disp('include them in pre-clustering. There, specify 0 dimensions if you do'); + disp('now want a property (scalp map, ERSP, etc...) to be included'); + disp('in the clustering procedure. See the clustering tutorial.'); + end; + + end % Finished all conditions + return; +end; + +% Set default values +cls = 1:length(STUDY.cluster); % plot all clusters in STUDY + +if length(varargin) > 0 + if length(varargin) == 1, varargin{2} = varargin{1}; end; % backward compatibility + if isnumeric(varargin{2}) + cls = varargin{2}; + elseif isstr(varargin{2}) & strcmpi(varargin{2}, 'all') + cls = 1:length(STUDY.cluster); + else + error('cluster input should be either a vector of cluster indices or the keyword ''all''.'); + end +end + +len = length(cls); +% Plot clusters mean properties +for k = 1: len + if k == 1 + try + % optional 'CreateCancelBtn', 'delete(gcbf); error(''USER ABORT'');', + h_wait = waitbar(0,['Computing cluster properties ...'], 'Color', BACKEEGLABCOLOR,'position', [300, 200, 300, 48]); + catch % for Matlab 5.3 + h_wait = waitbar(0,['Computing cluster properties ...'],'position', [300, 200, 300, 48]); + end + end + warningon = 0; + figure + orient tall + set(gcf,'Color', BACKCOLOR); + subplot(2,3,1), + try, + STUDY = std_topoplot(STUDY,ALLEEG, 'clusters', cls(k), 'mode', 'together', 'figure', 'off'); + catch + axis off; text(0.5, 0.5, 'No scalp map information', 'horizontalalignment', 'center'); + warningon = 1; + end + waitbar(k/(len*6),h_wait) + subplot(2,3,2), + try, + STUDY = std_erpplot(STUDY,ALLEEG, 'clusters', cls(k), 'mode', 'together', 'plotmode', 'condensed' ); + erpAxisHangle = gca; + catch + axis off; text(0.5, 0.5, 'No ERP information', 'horizontalalignment', 'center'); + warningon = 1; + end + waitbar((k*2)/(len*6),h_wait) + subplot(2,3,3), + try, + [STUDY] = std_erspplot(STUDY,ALLEEG, 'clusters', cls(k), 'mode', 'together', 'plotmode', 'condensed' ); + catch, + axis off; text(0.5, 0.5, 'No ERSP information', 'horizontalalignment', 'center'); + warningon = 1; + end + waitbar((k*3)/(len*6),h_wait) + axes('unit', 'normalized', 'position', [0.1 0.16 0.2 0.28]); %subplot(2,3,4), + try, + STUDY = std_dipplot(STUDY,ALLEEG, 'clusters', cls(k), 'mode', 'apart', 'figure', 'off'); set(gcf,'Color', BACKCOLOR); + catch + axis off; text(0.5, 0.5, 'No dipole information', 'horizontalalignment', 'center'); + warningon = 1; + end + waitbar((k*4)/(len*6),h_wait) + subplot(2,3,5), + try, + STUDY = std_specplot(STUDY,ALLEEG, 'clusters', cls(k), 'mode', 'together', 'plotmode', 'condensed'); + catch + axis off; text(0.5, 0.5, 'No spectral information', 'horizontalalignment', 'center'); + warningon = 1; + end + waitbar((k*5)/(len*6),h_wait) + subplot(2,3,6), + try, + [STUDY] = std_itcplot(STUDY,ALLEEG, 'clusters', cls(k), 'mode', 'together', 'plotmode', 'condensed' ); + catch, + axis off; text(0.5, 0.5, 'No ITC information', 'horizontalalignment', 'center'); + warningon = 1; + end + waitbar((k*6)/(len*6),h_wait); + %subplot('position', [0.77 0.16 0.15 0.28]), + maintitle = ['Cluster ''' STUDY.cluster(cls(k)).name ''' mean properties (' num2str(length(STUDY.cluster(cls(k)).comps)) ' comps).' ]; + a = textsc(maintitle, 'title'); + set(a, 'fontweight', 'bold'); + set(gcf,'name',maintitle); + if warningon + disp('Some properties could not be plotted. To plot these properties, first'); + disp('include them in pre-clustering. There, specify 0 dimensions if you do'); + disp('not want a property (scalp map, ERSP, etc...) to be included'); + disp('in the clustering procedure. See the clustering tutorial.'); + end; + +end % Finished all conditions + +if ishandle(erpAxisHangle) % make sure it is a valid graphics handle + legend(erpAxisHangle,'off'); + + + set(erpAxisHangle,'YTickLabelMode','auto'); + set(erpAxisHangle,'YTickMode','auto'); +end; +delete(h_wait) + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_pvaf.m b/code/eeglab13_4_4b/functions/studyfunc/std_pvaf.m new file mode 100644 index 0000000..0383772 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_pvaf.m @@ -0,0 +1,72 @@ +% std_pvaf() - Compute 'percent variance accounted for' (pvaf) by specified +% ICA component clusters. This function computes eeg_pvaf on each +% of the component of the cluster and then average them. See +% eeg_pvaf for more information. This function uses the +% Usage: +% >> [pvaf pvafs] = std_pvaf(STUDY, ALLEEG, cluster, 'key', 'val'); +% Inputs: +% EEG - EEGLAB dataset. Must have icaweights, icasphere, icawinv, icaact. +% comps - vector of component indices to sum {default|[] -> progressive mode} +% In progressive mode, comps is first [1], then [1 2], etc. up to +% [1:size(EEG.icaweights,2)] (all components); here, the plot shows pvaf. +% +% Optional inputs: +% 'design' - [integer] selected design. Default is the current design. +% 'rmcomps' - [integer array] remove artifactual components (this entry +% is ignored when plotting components). This entry contains +% the indices of the components to be removed. Default is none. +% 'interp' - [struct] channel location structure containing electrode +% to interpolate ((this entry is ignored when plotting +% components). Default is no interpolation. +% Other optional inputs are the same as eeg_pvaf() +% +% Outputs: +% pvaf - (real) percent total variance accounted for by the summed +% back-projection of the requested clusters. +% pvafs - [vector] pvaf for each of the cell of the selected design. +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2012- + +% Copyright (C) 2012 Arnaud Delorme, SCCN, INC, UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [pvafAve pvafs] = std_pvaf(STUDY, ALLEEG, cluster, varargin); + +if nargin < 3 + help std_pvaf; + return; +end; + +[opt addOptions] = finputcheck(varargin, { 'design' 'integer' [] STUDY.currentdesign; + 'rmclust' 'integer' [] []; + 'interp' 'struct' { } struct([]); + 'rmcomps' 'cell' [] cell(1,length(ALLEEG)) }, 'std_pvaf', 'ignore'); +if isstr(opt), error(opt); end; + +DES = STUDY.design(opt.design); +for iCell = 1:length(DES.cell) + [EEG complist rmlistcomp] = std_getdataset(STUDY, ALLEEG, 'cell', iCell, 'cluster', cluster, 'interp', opt.interp, ... + 'rmcomps', opt.rmcomps{iCell}, 'rmclust', opt.rmclust, 'interpcomponent', 'on' ); + %EEG = std_getdataset(STUDY, ALLEEG, 'cell', iCell); + if ~isempty(EEG.icaweights) + pvafs(iCell) = eeg_pvaf(EEG, [1:size(EEG.icaweights,1)], addOptions{:}); + %pvafs(iCell) = eeg_pvaf(EEG, complist, 'artcomps', rmlistcomp, addOptions{:}); + else pvafs(iCell) = NaN; + end; +end; +pvafAve = nan_mean(pvafs); + + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readcustom.m b/code/eeglab13_4_4b/functions/studyfunc/std_readcustom.m new file mode 100644 index 0000000..c11b72e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readcustom.m @@ -0,0 +1,114 @@ +% std_readcustom() - Read custom data structure for file save on disk. +% +% Usage: +% >> data = std_readcustom(STUDY, ALLEEG, fileext, 'key', 'val', ...); +% +% Required inputs: +% STUDY - an EEGLAB STUDY set of loaded EEG structures +% ALLEEG - ALLEEG vector of one or more loaded EEG dataset structures +% fileext - [string] file extension (without '.') +% +% Optional inputs: +% 'design' - [integer] use specific study index design to compute measure. +% Default is to use the default design. +% 'datafield' - [string or cell] extract only specific variables from the data +% files. By default, all fields are loaded. Use '*' to match +% patterns. If more than 1 variable is selected, data is +% placed in a structure named data. +% 'eegfield' - [string] copy data to a field of an EEG structure and return +% EEG structure. Default is to return the data itself. +% 'eegrmdata' - ['on'|'off'] when option above is used, remove data from +% EEG structures before returning them. Default is 'on'. +% +% Outputs: +% data - cell array containing data organized according to the selected +% design. +% +% Example: +% % assuming ERP have been computed for the currently selected design +% data = std_readcustom(STUDY, ALLEEG, 'daterp', 'datafield', 'chan1'); +% data = cellfun(@(x)x', siftdata, 'uniformoutput', false); % transpose data +% std_plotcurve([1:size(data{1})], data); % plot data +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, 2013- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2013, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ returndata ] = std_readcustom(STUDY, ALLEEG, fileext, varargin) + + if nargin < 2 + help std_sift; + return; + end; + + [g arguments] = finputcheck(varargin, { 'design' 'integer' [] STUDY.currentdesign; + 'datafield' { 'string' 'cell' } [] {}; + 'eegfield' 'string' [] ''; + 'eegrmdata' 'string' { 'on' 'off' } 'on' }, 'std_sift', 'mode', 'ignore'); + if isstr(g), error(g); end; + if ~iscell(g.datafield), g.datafield = { g.datafield }; end; + + % Scan design and save data + % ------------------------- + nc = max(length(STUDY.design(g.design).variable(1).value),1); + ng = max(length(STUDY.design(g.design).variable(2).value),1); + + for cInd = 1:nc + for gInd = 1:ng + + % find the right cell in the design + cellInds = []; + for index = 1:length(STUDY.design(g.design).cell) + condind = std_indvarmatch( STUDY.design(g.design).cell(index).value{1}, STUDY.design(g.design).variable(1).value); + grpind = std_indvarmatch( STUDY.design(g.design).cell(index).value{2}, STUDY.design(g.design).variable(2).value); + if isempty(STUDY.design(g.design).variable(1).value), condind = 1; end; + if isempty(STUDY.design(g.design).variable(2).value), grpind = 1; end; + if cInd == condind && gInd == grpind + cellInds = [ cellInds index ]; + end; + end; + + desset = STUDY.design(g.design).cell(cellInds); + clear EEGTMP data; + for iDes = 1:length(desset) + + % load data on disk + tmpData = load('-mat', [ STUDY.design(g.design).cell(cellInds(iDes)).filebase '.' fileext ], g.datafield{:}); + + % put data in EEG structure if necessary + if ~isempty(g.eegfield) + EEGTMPTMP = std_getdataset(STUDY, ALLEEG, 'design', g.design, 'cell', cellInds(iDes)); + if strcmpi(g.eegrmdata, 'on'), EEGTMPTMP.data = []; EEGTMPTMP.icaact = []; end; + EEGTMPTMP.(g.eegfield) = tmpData; + EEGTMP(iDes) = EEGTMPTMP; + elseif length(g.datafield) == 1 + if ~isstr(tmpData.(g.datafield{1})), error('Field content cannot be a string'); end; + data(iDes,:,:,:) = tmpData.(g.datafield{1}); + elseif isfield(tmpData, 'data') && isempty(g.datafield) + data(iDes,:,:,:) = tmpData.data; + else + data(iDes) = tmpData; + end; + end; + data = shiftdim(data,1); + if ~isempty(g.eegfield) + returndata{cInd,gInd} = EEGTMP; + else + returndata{cInd,gInd} = data; + end; + end; + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readdata.m b/code/eeglab13_4_4b/functions/studyfunc/std_readdata.m new file mode 100644 index 0000000..4fa47d2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readdata.m @@ -0,0 +1,664 @@ +% std_readdata() - LEGACY FUNCTION, SHOULD NOT BE USED ANYMORE. INSTEAD +% USE std_readerp, std_readspec, ... +% load one or more requested measures +% ['erp'|'spec'|'ersp'|'itc'|'dipole'|'map'] +% for all components of a specified cluster. +% Called by cluster plotting functions +% std_envtopo(), std_erpplot(), std_erspplot(), ... +% Usage: +% >> [STUDY, clustinfo, finalinds] = std_readdata(STUDY, ALLEEG); +% % return all measures +% >> [STUDY, clustinfo, finalinds] = std_readdata(STUDY, ALLEEG, ... +% cluster, infotype,varargin); +% Inputs: +% STUDY - studyset structure containing some or all files in ALLEEG +% ALLEEG - vector of loaded EEG datasets +% +% Optional inputs: +% 'infotype' - ['erp'|'spec'|'ersp'|'itc'|'dipole'|'map'|'data'|'event'] +% type of stored data or cluster information to read. May +% also be a cell array of these types, for example: { 'erp' +% 'map' 'dipole' }. {default: 'erp'} +% 'channels' - [cell] list of channels to import {default: all} +% 'clusters' - [integer] list of clusters to import {[]|default: all but +% the parent cluster (1) and any 'NotClust' clusters} +% 'freqrange' - [min max] frequency range {default: whole measure range} +% 'timerange' - [min max] time range {default: whole measure epoch} +% 'statmode' - ['individual'|'trials'] statistical mode for ERSP (also +% specify what type of data to import -- mean (of individual +% subjects), or trials. This functionality is still unstable +% for 'trials' { default: 'individual'} +% 'rmsubjmean' - ['on'|'off'] remove mean subject spectrum from every component +% or channel spectrum, making them easier to compare +% { default: 'off' } +% 'subbaseline' - ['on'|'off'] remove all condition and spectrum baselines +% for ERSP data { default: 'on' } +% +% Optional inputs for events: +% 'type','timewin','fieldname' - optional parameters for the function +% eeg_geteventepoch may also be used to select specific +% events. +% +% Optional inputs for raw data: +% 'rmclust' - [integer] list of artifact cluster indices to subtract +% when reading raw data. +% +% Output: +% STUDY - (possibly) updated STUDY structure +% clustinfo - structure of specified cluster information. +% This is the same as STUDY.cluster(cluster_number) +% Fields: +% clustinfo.erpdata % (ncomps, ntimes) array of component ERPs +% clustinfo.erptimes % vector of ERP epoch latencies (ms) +% +% clustinfo.specdata % (ncomps, nfreqs) array of component spectra +% clustinfo.specfreqs % vector of spectral frequencies (Hz) +% +% clustinfo.erspdata % (ncomps,ntimes,nfreqs) array of component ERSPs +% clustinfo.ersptimes % vector of ERSP latencies (ms) +% clustinfo.erspfreqs % vector of ERSP frequencie (Hz) +% +% clustinfo.itcdata % (ncomps,ntimes,nfreqs) array of component ITCs +% clustinfo.itctimes % vector of ITC latencies (ms) +% clustinfo.itc_freqs % vector of ITC frequencies (Hz) +% +% clustinfo.topo % (ncomps,65,65) array of component scalp map grids +% clustinfo.topox % abscissa values for columns of the scalp maps +% clustinfo.topoy % ordinate values for rows of the scalp maps +% +% clustinfo.data % raw data arrays +% clustinfo.datatimes % time point for raw data +% clustinfo.datasortvals % sorting values (one per trial) +% clustinfo.datacontinds % dataset indices (contacted for all trials) +% +% clustinfo.dipole % array of component dipole information structs +% % with the same format as EEG.dipfit.model +% +% finalinds - either the cluster(s) or channel(s) indices selected. +% +% Example: +% % To obtain the ERPs for all Cluster-3 components from a STUDY +% % +% [STUDY clustinfo] = std_readdata(STUDY, ALLEEG, 'clusters',3, 'infotype','erp'); +% figure; plot(clustinfo.erptimes, mean(clustinfo.erpdata,2)); +% +% Author: Arnaud Delorme, CERCO, 2006- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, clustinfo, finalinds] = std_readdata(STUDY, ALLEEG, varargin); + +if nargin < 2 + help std_readdata; + return; +end +if nargin < 3 + channel = {}; +end + +[opt moreopts] = finputcheck( varargin, { ... + 'type' { 'string','cell' } { [] [] } ''; + 'timewin' 'real' [] [-Inf Inf]; + 'fieldname' 'string' [] 'latency'; + 'condition' 'cell' [] {}; + 'channels' 'cell' [] {}; + 'clusters' 'integer' [] []; + 'rmclust' 'integer' [] []; + 'freqrange' 'real' [] []; + 'timerange' 'real' [] []; + 'statmode' 'string' { 'subjects','individual','common','trials' } 'individual'; + 'rmicacomps' 'string' { 'on','off' } 'off'; + 'subbaseline' 'string' { 'on','off' } 'off'; + 'rmsubjmean' 'string' { 'on','off' } 'off'; + 'singletrials' 'string' { 'on','off' } 'on'; + 'infotype' 'string' { 'erp','spec','ersp','itc','map','topo','dipole','scalp','data','event','' } '' }, ... + 'std_readdata', 'ignore'); +if isstr(opt), error(opt); end; +if isempty(opt.infotype), disp('No measure selected, returning ERPs'); opt.infotype = 'erp'; end; + +if strcmpi(opt.infotype, 'erp'), + STUDY = pop_erpparams(STUDY, 'default'); + if isempty(opt.timerange), opt.timerange = STUDY.etc.erpparams.timerange; end; +elseif strcmpi(opt.infotype, 'spec'), + STUDY = pop_specparams(STUDY, 'default'); + if isempty(opt.freqrange), opt.freqrange = STUDY.etc.specparams.freqrange; end; +elseif strcmpi(opt.infotype, 'ersp') | strcmpi(opt.infotype, 'itc') + STUDY = pop_erspparams(STUDY, 'default'); + if isempty(opt.freqrange), opt.freqrange = STUDY.etc.erspparams.freqrange; end; + if isempty(opt.timerange), opt.timerange = STUDY.etc.erspparams.timerange; end; + if strcmpi(opt.statmode, 'individual') | strcmpi(opt.statmode, 'subjects'), opt.statmode = STUDY.etc.erspparams.statmode;end; + if strcmpi(opt.subbaseline, 'on'), opt.subbaseline = STUDY.etc.erspparams.subbaseline; end; +end; + +nc = max(length(STUDY.condition),1); +ng = max(length(STUDY.group),1); +zero = single(0); +tmpver = version; +if tmpver(1) == '6' | tmpver(1) == '5' + zero = double(zero); +end; + +% find channel indices +% -------------------- +if ~isempty(opt.channels) + finalinds = std_chaninds(STUDY, opt.channels); +else + finalinds = opt.clusters; +end; + +% read topography with another function +% ------------------------------------- +if strcmpi(opt.infotype, 'map') | strcmpi(opt.infotype, 'scalp') | strcmpi(opt.infotype, 'topo') + [STUDY tmpclust] = std_readtopoclust(STUDY, ALLEEG, opt.clusters); + clustinfo = []; + for index = 1:length(tmpclust) + if index == 1, clustinfo = tmpclust{index}; + else clustinfo(index) = tmpclust{index}; + end; + end; + return; +end; + +% read indices for removing component clusters from data +% ------------------------------------------------------ +% NOT USED ANY MORE +if ~isempty(opt.rmclust) + for ind = 1:length(opt.rmclust) + [tmp setindsrm{ind} allindsrm{ind}] = std_setinds2cell(STUDY, opt.rmclust(ind)); + end; +end; + +for ind = 1:length(finalinds) + + % find indices + % ------------ + if ~isempty(opt.channels) + tmpstruct = STUDY.changrp(finalinds(ind)); + alldatasets = 1:length(STUDY.datasetinfo); + %allchanorcomp = -tmpstruct.chaninds; + allinds = tmpstruct.allinds; + for i=1:length(allinds(:)), allinds{i} = -allinds{i}; end; % invert sign for reading + setinds = tmpstruct.setinds; + else + % Use the 3 lines below and comment the last one when ready + % to switch and remove all .comps and .inds + %tmpstruct = STUDY.cluster(finalinds(ind)); + %allinds = tmpstruct.allinds; + %setinds = tmpstruct.setinds; + [ tmpstruct setinds allinds ] = std_setcomps2cell(STUDY, finalinds(ind)); + %[ STUDY.cluster(finalinds(ind)) ] = std_setcomps2cell(STUDY, finalinds(ind)); + %STUDY.cluster(finalinds(ind)) = std_cell2setcomps( STUDY, ALLEEG, finalinds(ind)); + %[ STUDY.cluster(finalinds(ind)) setinds allinds ] = std_setcomps2cell(STUDY, finalinds(ind)); + end; + + dataread = 0; + switch opt.infotype + case 'event', + % check if data is already here + % ----------------------------- + if isfield(tmpstruct, 'datasortvals') + if ~isempty(tmpstruct.datasortvals) + dataread = 1; + end; + end; + + if ~dataread + % reserve arrays + % -------------- + datasortvals = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + datacontinds = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + for c = 1:nc + for g = 1:ng + datasortvals{c, g} = repmat(zero, [1, sum([ ALLEEG(setinds{c,g}).trials ] )]); + datacontinds{c, g} = repmat(zero, [1, sum([ ALLEEG(setinds{c,g}).trials ] )]); + end; + end; + + % read the data and select channels + % --------------------------------- + if ~isempty(opt.type) + fprintf('Reading events:'); + for c = 1:nc + for g = 1:ng + counttrial = 1; + for indtmp = 1:length(allinds{c,g}) + tmpdata = eeg_getepochevent(ALLEEG(setinds{c,g}(indtmp)), ... + 'type', opt.type, 'timewin', opt.timewin, 'fieldname', opt.fieldname); + datasortvals{c, g}(:,counttrial:counttrial+ALLEEG(setinds{c,g}(indtmp)).trials-1) = squeeze(tmpdata); + datacontinds{c, g}(:,counttrial:counttrial+ALLEEG(setinds{c,g}(indtmp)).trials-1) = setinds{c,g}(indtmp); + counttrial = counttrial+ALLEEG(setinds{c,g}(indtmp)).trials; + fprintf('.'); + end; + end; + end; + end; + fprintf('\n'); + tmpstruct.datasortvals = datasortvals; + tmpstruct.datacontinds = datacontinds; + end; + + case 'data', + % check if data is already here + % ----------------------------- + if isfield(tmpstruct, 'data') + if ~isempty(tmpstruct.data) + dataread = 1; + end; + end; + + if ~dataread + % reserve arrays + % -------------- + alldata = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + for c = 1:nc + for g = 1:ng + alldata{c, g} = repmat(zero, [ALLEEG(1).pnts, sum([ ALLEEG(setinds{c,g}).trials ] )]); + end; + end; + + % read the data and select channels + % --------------------------------- + fprintf('Reading data/activity:'); + for c = 1:nc + for g = 1:ng + counttrial = 1; + for indtmp = 1:length(allinds{c,g}) + settmpind = STUDY.datasetinfo(setinds{c,g}(indtmp)).index; % current dataset + + if isempty(opt.channels) + tmpdata = eeg_getdatact(ALLEEG(settmpind), 'component', allinds{c,g}(indtmp), 'verbose', 'off'); + elseif isempty(opt.rmclust) & strcmpi(opt.rmicacomps, 'off') + tmpdata = eeg_getdatact(ALLEEG(settmpind), 'channel', -allinds{c,g}(indtmp), 'verbose', 'off'); + elseif strcmpi(opt.rmicacomps, 'on') + rmcomps = find(ALLEEG(settmpind).reject.gcompreject); + tmpdata = eeg_getdatact(ALLEEG(settmpind), 'channel', -allinds{c,g}(indtmp), 'rmcomps', rmcomps, 'verbose', 'off'); + else + rmcomps = getclustcomps(STUDY, opt.rmclust, settmpind); + tmpdata = eeg_getdatact(ALLEEG(settmpind), 'channel', -allinds{c,g}(indtmp), 'rmcomps', rmcomps, 'verbose', 'off'); + end; + + alldata{c, g}(:,counttrial:counttrial+ALLEEG(setinds{c,g}(indtmp)).trials-1) = squeeze(tmpdata); + counttrial = counttrial+ALLEEG(setinds{c,g}(indtmp)).trials; + fprintf('.'); + end; + end; + end; + fprintf('\n'); + tmpstruct.datatimes = ALLEEG(1).times; + tmpstruct.data = alldata; + end; + + case 'erp', + disp('std_readdata is a legacy function, it should not be used to read ERP data, use std_readerp instead'); + + % check if data is already here + % ----------------------------- + if isfield(tmpstruct, 'erpdata') + if isequal( STUDY.etc.erpparams.timerange, opt.timerange) & ~isempty(tmpstruct.erpdata) + dataread = 1; + end; + end; + + if ~dataread + % reserve arrays + % -------------- + allerp = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + tmpind = 1; while(isempty(setinds{tmpind})), tmpind = tmpind+1; end; + [ tmp alltimes ] = std_readerp( ALLEEG, setinds{tmpind}(1), allinds{tmpind}(1), opt.timerange); + for c = 1:nc + for g = 1:ng + allerp{c, g} = repmat(zero, [length(alltimes), length(allinds{c,g})]); + end; + end; + + % read the data and select channels + % --------------------------------- + fprintf('Reading ERP data:'); + for c = 1:nc + for g = 1:ng + for indtmp = 1:length(allinds{c,g}) + [ tmperp alltimes ] = std_readerp( ALLEEG, setinds{c,g}(indtmp), allinds{c,g}(indtmp), opt.timerange); + allerp{c, g}(:,indtmp) = tmperp(:); + fprintf('.'); + end; + end; + end; + fprintf('\n'); + tmpstruct.erptimes = alltimes; + tmpstruct.erpdata = allerp; + end; + + case 'spec', + disp('std_readdata is a legacy function, it should not be used to read SPECTRUM data, use std_readspec instead'); + % check if data is already here + % ----------------------------- + if isfield(tmpstruct, 'specdata') + if isequal( STUDY.etc.specparams.freqrange, opt.freqrange) & ~isempty(tmpstruct.specdata) + dataread = 1; + end; + end; + + if ~dataread + % reserve arrays + % -------------- + allspec = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + filetype = 'spec'; + tmpind = 1; while(isempty(setinds{tmpind})), tmpind = tmpind+1; end; + try, + [ tmp allfreqs ] = std_readspec( ALLEEG, setinds{tmpind}(1), allinds{tmpind}(1), opt.freqrange); + catch + filetype = 'ersp'; + disp('Cannot find spectral file, trying ERSP baseline file instead'); + [ tmpersp allfreqs alltimes tmpparams tmpspec] = std_readersp( ALLEEG, setinds{tmpind}(1), allinds{tmpind}(1), [], opt.freqrange); + end; + for c = 1:nc + for g = 1:ng + allspec{c, g} = repmat(zero, [length(allfreqs), length(allinds{c,g}) ]); + end; + end; + + % read the data and select channels + % --------------------------------- + if strcmpi(filetype, 'spec') + fprintf('Reading Spectrum data...'); + for c = 1:nc + for g = 1:ng + allspec{c, g} = std_readspec( ALLEEG, setinds{c,g}(:), allinds{c,g}(:), opt.freqrange)'; + end; + end; + else % std_readersp cannot be converted to read multiple datasets since it subtracts data between conditions + fprintf('Reading Spectrum data:'); + for c = 1:nc + for g = 1:ng + for indtmp = 1:length(allinds{c,g}) + [ tmpersp allfreqs alltimes tmpparams tmpspec] = std_readersp( ALLEEG, setinds{c,g}(indtmp), allinds{c,g}(indtmp), [], opt.freqrange); + allspec{c, g}(:,indtmp) = 10*log(tmpspec(:)); + fprintf('.'); + end; + end; + end; + end; + fprintf('\n'); + + % remove mean of each subject across groups and conditions + if strcmpi(opt.rmsubjmean, 'on') & ~isempty(opt.channels) + disp('Removing mean spectrum accross subjects'); + for indtmp = 1:length(allinds{c,g}) % scan subjects + meanspec =zeros(size( allspec{1, 1}(:,indtmp) )); + for c = 1:nc + for g = 1:ng + meanspec = meanspec + allspec{c, g}(:,indtmp)/(nc*ng); + end; + end; + for c = 1:nc + for g = 1:ng + allspec{c, g}(:,indtmp) = allspec{c, g}(:,indtmp) - meanspec; % subtractive model + % allspec{c, g}(:,indtmp) = allspec{c, g}(:,indtmp)./meanspec; % divisive model + end; + end; + end; + end; + + tmpstruct.specfreqs = allfreqs; + tmpstruct.specdata = allspec; + end; + + case { 'ersp' 'itc' 'pac' }, + disp('std_readdata is a legacy function, it should not be used to read ERSP/ITC data, use std_readersp instead'); + % check if data is already here + % ----------------------------- + if strcmpi(opt.infotype, 'ersp') + if isfield(tmpstruct, 'erspdata') + if isequal( STUDY.etc.erspparams.timerange, opt.timerange) & ... + isequal( STUDY.etc.erspparams.freqrange, opt.freqrange) & ~isempty(tmpstruct.erspdata) + dataread = 1; + end; + end; + elseif strcmpi(opt.infotype, 'itc') + if isfield(tmpstruct, 'itcdata') + if isequal( STUDY.etc.erspparams.timerange, opt.timerange) & ... + isequal( STUDY.etc.erspparams.freqrange, opt.freqrange) & ~isempty(tmpstruct.itcdata) + dataread = 1; + end; + end; + else + if isfield(tmpstruct, 'pacdata') + dataread = 1; + end; + end; + + if ~dataread + % find total nb of trials + % ----------------------- + if strcmpi(opt.statmode, 'trials') + tottrials = cell( length(STUDY.condition), length(STUDY.group) ); + for index = 1:length( STUDY.datasetinfo ) + condind = strmatch( STUDY.datasetinfo(index).condition, STUDY.condition ); + grpind = strmatch( STUDY.datasetinfo(index).group , STUDY.group ); + if isempty(tottrials{condind, grpind}), tottrials{condind, grpind} = ALLEEG(index).trials; + else tottrials{condind, grpind} = tottrials{condind, grpind} + ALLEEG(index).trials; + end; + end; + end; + + % reserve arrays + % -------------- + ersp = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + erspbase = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + erspinds = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); + tmpind = 1; while(isempty(setinds{tmpind})), tmpind = tmpind+1; end; + [ tmp allfreqs alltimes ] = std_readersp( ALLEEG, setinds{tmpind}(1), Inf*allinds{tmpind}(1), opt.timerange, opt.freqrange); + for c = 1:nc + for g = 1:ng + ersp{c, g} = repmat(zero, [length(alltimes), length(allfreqs), length(allinds{c,g}) ]); + erspbase{c, g} = repmat(zero, [ 1, length(allfreqs), length(allinds{c,g}) ]); + if strcmpi(opt.statmode, 'trials') + ersp{ c, g} = repmat(zero, [length(alltimes), length(allfreqs), tottrials{c, g} ]); + count{c, g} = 1; + end; + end; + end; + + % read the data and select channels + % --------------------------------- + fprintf('Reading all %s data:', upper(opt.infotype)); + for c = 1:nc + for g = 1:ng + for indtmp = 1:length(allinds{c,g}) + try % this 'try' is a poor solution the problem of attempting + % to read specific channel/component data that doesn't exist + % called below by: allinds{c,g}(indtmp) + if strcmpi(opt.statmode, 'trials') + [ tmpersp allfreqs alltimes tmpparams] = std_readtimef( ALLEEG, setinds{c,g}(indtmp), allinds{c,g}(indtmp), ... + opt.timerange, opt.freqrange); + indices = [count{c, g}:count{c, g}+size(tmpersp,3)-1]; + ersp{ c, g}(:,:,indices) = permute(tmpersp, [2 1 3]); + erspinds{c, g}(1:2,indtmp) = [ count{c, g} count{c, g}+size(tmpersp,3)-1 ]; + count{c, g} = count{c, g}+size(tmpersp,3); + if size(tmpersp,3) ~= ALLEEG(STUDY.datasetinfo(index).index).trials + error( sprintf('Wrong number of trials in datafile for dataset %d\n', STUDY.datasetinfo(index).index)); + end; + elseif strcmpi(opt.infotype, 'itc') + [ tmpersp allfreqs alltimes tmpparams] = std_readitc( ALLEEG, setinds{c,g}(indtmp), allinds{c,g}(indtmp), ... + opt.timerange, opt.freqrange); + ersp{c, g}(:,:,indtmp) = abs(permute(tmpersp , [2 1])); + elseif strcmpi(opt.infotype, 'pac') + [ tmpersp allfreqs alltimes tmpparams] = std_readpac( ALLEEG, setinds{c,g}(indtmp), allinds{c,g}(indtmp), ... + opt.timerange, opt.freqrange); + ersp{c, g}(:,:,indtmp) = abs(permute(tmpersp , [2 1])); + else + [ tmpersp allfreqs alltimes tmpparams tmperspbase] = std_readersp( ALLEEG, setinds{c,g}(indtmp), allinds{c,g}(indtmp), ... + opt.timerange, opt.freqrange); + ersp{c, g}( :,:,indtmp) = permute(tmpersp , [2 1]); + erspbase{c, g}(:,:,indtmp) = 10*log(permute(tmperspbase, [2 1])); + end + catch + end + fprintf('.'); + end; + end; + end; + fprintf('\n'); + + % compute ERSP or ITC if trial mode + % (since only the timef have been loaded) + % --------------------------------------- + if strcmpi(opt.statmode, 'trials') + for c = 1:nc + for g = 1:ng + if strcmpi(opt.infotype, 'itc') + ersp{c,g} = ersp{c,g}./abs(ersp{c,g}); + else + ersp{c,g} = 20*log10(abs(ersp{c,g})); + % remove baseline (each trial baseline is removed => could + % also be the average across all data trials) + [tmp indl] = min( abs(alltimes-0) ); + erspbase{c,g} = mean(ersp{c,g}(1:indl,:,:,:)); + ersp{c,g} = ersp{c,g} - repmat(erspbase{c,g}, [size(ersp{c,g},1) 1 1 1]); + end; + end; + end; + end; + + % compute average baseline across groups and conditions + % ----------------------------------------------------- + if strcmpi(opt.subbaseline, 'on') & strcmpi(opt.infotype, 'ersp') + disp('Recomputing baseline...'); + for g = 1:ng % ng = number of groups + for c = 1:nc % nc = number of components + if strcmpi(opt.statmode, 'trials') + if c == 1, meanpowbase = abs(mean(erspbase{c,g}/nc,3)); + else meanpowbase = meanpowbase + abs(mean(erspbase{c,g}/nc,3)); + end; + else + if c == 1, meanpowbase = abs(erspbase{c,g}/nc); + else meanpowbase = meanpowbase + abs(erspbase{c,g}/nc); + end; + end; + end; + + % subtract average baseline + % ------------------------- + for c = 1:nc + if strcmpi(opt.statmode, 'trials'), tmpmeanpowbase = repmat(meanpowbase, [length(alltimes) 1 tottrials{c,g}]); + else tmpmeanpowbase = repmat(meanpowbase, [length(alltimes) 1 1]); + end; + ersp{c,g} = ersp{c,g} - repmat(abs(erspbase{c,g}), [length(alltimes) 1 1 1]) + tmpmeanpowbase; + end; + clear meanpowbase; + end; + end; + + if strcmpi(opt.statmode, 'common') + % collapse the two last dimensions before computing significance + % i.e. 18 subject with 4 channels -> same as 4*18 subjects + % -------------------------------------------------------------- + disp('Using all channels for statistics...'); + for c = 1:nc + for g = 1:ng + ersp{c,g} = reshape( ersp{c,g}, size(ersp{c,g},1), size(ersp{c,g},2), size(ersp{c,g},3)*size(ersp{c,g},4)); + end; + end; + end; + + % copy data to structure + % ---------------------- + if strcmpi(opt.infotype, 'ersp') + tmpstruct.erspfreqs = allfreqs; + tmpstruct.ersptimes = alltimes; + tmpstruct.erspdata = ersp; + tmpstruct.erspbase = erspbase; + if strcmpi(opt.statmode, 'trials') + tmpstruct.erspsubjinds = erspinds; + end; + elseif strcmpi(opt.infotype, 'itc') + tmpstruct.itcfreqs = allfreqs; + tmpstruct.itctimes = alltimes; + tmpstruct.itcdata = ersp; + if strcmpi(opt.statmode, 'trials') + tmpstruct.itcsubjinds = erspinds; + end; + else + tmpstruct.pacfreqs = allfreqs; + tmpstruct.pactimes = alltimes; + tmpstruct.pacdata = ersp; + end; + end; + case 'dipole', + fprintf('Reading dipole data...\n'); +% old format EEGLAB 8.3 +% alldips = {}; +% for c = 1:nc +% for g = 1:ng +% for indtmp = 1:size(tmpstruct.sets,2) +% alldips{c, g}(indtmp).posxyz = ALLEEG(tmpstruct.sets(1,indtmp)).dipfit.model(tmpstruct.comps(1,indtmp)).posxyz; +% alldips{c, g}(indtmp).momxyz = ALLEEG(tmpstruct.sets(1,indtmp)).dipfit.model(tmpstruct.comps(1,indtmp)).momxyz; +% alldips{c, g}(indtmp).rv = ALLEEG(tmpstruct.sets(1,indtmp)).dipfit.model(tmpstruct.comps(1,indtmp)).rv; +% end; +% end; +% end; +% tmpstruct.dipoles = alldips; + alldips = []; + for indtmp = 1:size(tmpstruct.sets,2) + alldips(indtmp).posxyz = ALLEEG(tmpstruct.sets(1,indtmp)).dipfit.model(tmpstruct.comps(1,indtmp)).posxyz; + alldips(indtmp).momxyz = ALLEEG(tmpstruct.sets(1,indtmp)).dipfit.model(tmpstruct.comps(1,indtmp)).momxyz; + alldips(indtmp).rv = ALLEEG(tmpstruct.sets(1,indtmp)).dipfit.model(tmpstruct.comps(1,indtmp)).rv; + end; + tmpstruct.alldipoles = alldips; + + case { 'map' 'scalp' 'topo' } + % this is currenlty being done by the function std_readtopoclust + % at the beginning of this function + otherwise, error('Unrecognized ''infotype'' entry'); + end; % end switch + + % copy results to structure + % ------------------------- + fieldnames = { 'erpdata' 'erptimes' 'specdata' 'specfreqs' 'erspdata' 'erspbase' 'erspfreqs' 'ersptimes' ... + 'itcfreqs' 'itctimes' 'itcdata' 'erspsubjinds' 'itcsubjinds' 'allinds' 'setinds' 'dipoles' 'alldipoles' ... + 'data' 'datatimes' 'datasortvals' 'datacontinds' }; + for f = 1:length(fieldnames) + if isfield(tmpstruct, fieldnames{f}), + tmpdata = getfield(tmpstruct, fieldnames{f}); + if ~isempty(opt.channels) + STUDY.changrp = setfield(STUDY.changrp, { finalinds(ind) }, fieldnames{f}, tmpdata); + else STUDY.cluster = setfield(STUDY.cluster, { finalinds(ind) }, fieldnames{f}, tmpdata); + end; + end; + end; +end; + +% return structure +% ---------------- +if ~isempty(opt.channels) + clustinfo = STUDY.changrp(finalinds); +else clustinfo = STUDY.cluster(finalinds); +end; + +% find components in cluster for specific dataset +% ----------------------------------------------- +function rmcomps = getclustcomps(STUDY, rmclust, settmpind); + +rmcomps = [ ]; +for rmi = 1:length(rmclust) + findind = find(settmpind == STUDY.cluster(rmclust(rmi)).setinds{c,g}); + rmcomps = [ rmcomps STUDY.cluster(rmclust(rmi)).allinds{c,g}(findind) ]; +end; + + + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readerp.m b/code/eeglab13_4_4b/functions/studyfunc/std_readerp.m new file mode 100644 index 0000000..24087ed --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readerp.m @@ -0,0 +1,375 @@ +% std_readerp() - load ERP measures for data channels or +% for all components of a specified cluster. +% Called by plotting functions +% std_envtopo(), std_erpplot(), std_erspplot(), ... +% Usage: +% >> [STUDY, datavals, times, setinds, cinds] = ... +% std_readerp(STUDY, ALLEEG, varargin); +% Inputs: +% STUDY - studyset structure containing some or all files in ALLEEG +% ALLEEG - vector of loaded EEG datasets +% +% Optional inputs: +% 'design' - [integer] read files from a specific STUDY design. Default +% is empty (use current design in STUDY.currentdesign). +% 'channels' - [cell] list of channels to import {default: none} +% 'clusters' - [integer] list of clusters to import {[]|default: all but +% the parent cluster (1) and any 'NotClust' clusters} +% 'singletrials' - ['on'|'off'] load single trials spectral data (if +% available). Default is 'off'. +% 'subject' - [string] select a specific subject {default:all} +% 'component' - [integer] select a specific component in a cluster +% {default:all} +% +% ERP specific optional inputs: +% 'timerange' - [min max] time range {default: whole measure range} +% 'componentpol' - ['on'|'off'] invert ERP component sign based on +% scalp map match with component scalp map centroid. +% {default:'on'} +% +% Output: +% STUDY - updated studyset structure +% datavals - [cell array] erp data (the cell array size is +% condition x groups) +% times - [float array] array of time values +% setinds - [cell array] datasets indices +% cinds - [cell array] channel or component indices +% +% Example: +% std_precomp(STUDY, ALLEEG, { ALLEEG(1).chanlocs.labels }, 'erp', 'on'); +% [erp times] = std_readerp(STUDY, ALLEEG, 'channels', { ALLEEG(1).chanlocs(1).labels }); +% +% Author: Arnaud Delorme, CERCO, 2006- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, datavals, xvals, setinds, allinds] = std_readerp(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_readerp; + return; +end +if ~isstruct(ALLEEG) + % old calling format + % ------------------ + EEG = STUDY(ALLEEG); + filename = fullfile(EEG.filepath, EEG.filename(1:end-4)); + comporchan = varargin{1}; + options = {'measure', 'erp'}; + if length(varargin) > 1, options = { options{:} 'timelimits', varargin{2} }; end; + if comporchan(1) > 0 + [datavals tmp xvals] = std_readfile(filename, 'components',comporchan, options{:}); + else + [datavals tmp xvals] = std_readfile(filename, 'channels', comporchan, options{:}); + end; + STUDY = datavals'; + datavals = xvals; + return; +end; + +STUDY = pop_erpparams(STUDY, 'default'); +STUDY = pop_specparams(STUDY, 'default'); +[opt moreopts] = finputcheck( varargin, { ... + 'design' 'integer' [] STUDY.currentdesign; + 'channels' 'cell' [] {}; + 'clusters' 'integer' [] []; + 'timerange' 'real' [] STUDY.etc.erpparams.timerange; + 'freqrange' 'real' [] STUDY.etc.specparams.freqrange; + 'datatype' 'string' { 'erp','spec' } 'erp'; + 'rmsubjmean' 'string' { 'on','off' } 'off'; + 'singletrials' 'string' { 'on','off' } 'off'; + 'componentpol' 'string' { 'on','off' } 'on'; + 'component' 'integer' [] []; + 'subject' 'string' [] '' }, ... + 'std_readerp', 'ignore'); +if isstr(opt), error(opt); end; +nc = max(length(STUDY.design(opt.design).variable(1).value),1); +ng = max(length(STUDY.design(opt.design).variable(2).value),1); +paired1 = STUDY.design(opt.design).variable(1).pairing; +paired2 = STUDY.design(opt.design).variable(2).pairing; + +dtype = opt.datatype; + +% find channel indices +% -------------------- +if ~isempty(opt.channels) + allChangrp = lower({ STUDY.changrp.name }); + finalinds = std_chaninds(STUDY, opt.channels); +else finalinds = opt.clusters; +end; + +for ind = 1:length(finalinds) % scan channels or components + + % find indices + % ------------ + if ~isempty(opt.channels) + tmpstruct = STUDY.changrp(finalinds(ind)); + allinds = tmpstruct.allinds; + setinds = tmpstruct.setinds; + else + tmpstruct = STUDY.cluster(finalinds(ind)); + allinds = tmpstruct.allinds; + setinds = tmpstruct.setinds; + end; + + % check if data is already here + % ----------------------------- + dataread = 0; + if strcmpi(dtype, 'erp'), eqtf = isequal( STUDY.etc.erpparams.timerange, opt.timerange); + else eqtf = isequal(STUDY.etc.specparams.freqrange, opt.freqrange) && ... + isequal( STUDY.etc.specparams.subtractsubjectmean, opt.rmsubjmean); + end; + if strcmpi(opt.singletrials,'off') + if isfield(tmpstruct, [ dtype 'data' ]) && ~isempty(getfield(tmpstruct, [ dtype 'data' ])) && eqtf + dataread = 1; + end; + else + if isfield(tmpstruct, [ dtype 'datatrials' ]) && eqtf + tmpdat = getfield(tmpstruct, [ dtype 'datatrials' ]); + range = fastif( strcmpi(dtype, 'erp'), 'erptimes', 'specfreqs'); + if ~isempty(opt.channels) && ~isempty(tmpdat) && strcmpi(getfield(tmpstruct, [ dtype 'trialinfo' ]), opt.subject) + if size(tmpdat{1},2) == length(getfield(tmpstruct, range)) + dataread = 1; + end; + elseif isempty(opt.channels) && isequal(getfield(tmpstruct, [ dtype 'trialinfo' ]), opt.component) + if size(tmpdat{1},2) == length(getfield(tmpstruct, range)) + dataread = 1; + end; + end; + end; + end; + + if ~dataread + % reserve arrays + % -------------- + alldata = cell( nc, ng ); + setinfoIndices = cell( nc, ng ); + tmpind = 1; while(isempty(setinds{tmpind})), tmpind = tmpind+1; end; + setinfo = STUDY.design(opt.design).cell; + tmpchanlocs = ALLEEG(setinfo(1).dataset(1)).chanlocs; + chanlab = { tmpchanlocs.labels }; + nonemptyindex = ~cellfun(@isempty, allinds); + nonemptyindex = find(nonemptyindex(:)); + optGetparams = { 'measure', dtype, 'getparamonly', 'on', 'singletrials', opt.singletrials, 'timelimits', opt.timerange, 'freqlimits', opt.freqrange, 'setinfoinds', 1}; + if ~isempty(opt.channels), [ tmp params xvals] = std_readfile(setinfo(setinds{nonemptyindex(1)}(1)), optGetparams{:}, 'channels' , allChangrp(allinds{nonemptyindex(1)}(1))); + else [ tmp params xvals] = std_readfile(setinfo(setinds{nonemptyindex(1)}(1)), optGetparams{:}, 'components', allinds{nonemptyindex(1)}(1)); + end; + + % read the data and select channels + % --------------------------------- + fprintf([ 'Reading ' dtype ' data...' ]); + if strcmpi(dtype, 'erp'), opts = { 'timelimits', opt.timerange }; + else opts = { 'freqlimits', opt.freqrange }; + end; + if strcmpi(opt.singletrials, 'on') + if strcmpi(params.singletrials, 'off') + fprintf('\n'); + errordlg2('No single trial data - recompute data files'); + datavals = []; + return; + end; + opts = { opts{:} 'singletrials' 'on' }; + for c = 1:nc + for g = 1:ng + if ~isempty(setinds{c,g}) + if ~isempty(opt.channels), [alldata{c, g} z z z z setinfoIndices{c, g}] = std_readfile( setinfo(setinds{c,g}(:)), 'measure', dtype, opts{:}, 'channels' , opt.channels(ind), 'setinfoinds', setinds{c,g}(:)); + else [alldata{c, g} z z z z setinfoIndices{c, g}] = std_readfile( setinfo(setinds{c,g}(:)), 'measure', dtype, opts{:}, 'components', allinds{c,g}, 'setinfoinds', setinds{c,g}(:)); + end; + end; + end; + end; + else + for c = 1:nc + for g = 1:ng + if ~isempty(setinds{c,g}) + if ~isempty(opt.channels), [alldata{c, g}] = std_readfile( setinfo(setinds{c,g}(:)), 'measure', dtype, opts{:}, 'channels' , opt.channels(ind)); + else [alldata{c, g}] = std_readfile( setinfo(setinds{c,g}(:)), 'measure', dtype, opts{:}, 'components', allinds{c,g}); + end; + end; + end; + end; + end; + fprintf('\n'); + + % inverting component polaritites + % ------------------------------- + if isempty(opt.channels) && strcmpi(dtype, 'erp') + if strcmpi(opt.singletrials, 'on') + disp('Warning: component ERP polarity cannot (yet) be inverted for single trials'); + else + STUDY = std_readtopoclust(STUDY, ALLEEG, finalinds(ind)); + if isfield(STUDY.cluster, 'topopol') && ~isempty(STUDY.cluster(finalinds(ind)).topopol) + [ tmpstruct tmp1 tmp2 topopolcell] = std_setcomps2cell(STUDY, STUDY.cluster(finalinds(ind)).sets, STUDY.cluster(finalinds(ind)).comps, STUDY.cluster(finalinds(ind)).topopol); + disp('Inverting ERP component polarities based on scalp map polarities'); + for index = 1:length(alldata(:)) + for comps = 1:size(alldata{index},2) + alldata{index}(:,comps) = alldata{index}(:,comps)*topopolcell{index}(comps); + end; + end; + else + disp('Cluster topographies absent - cannot adjust single component ERP polarities'); + end; + end; + end; + + % remove mean of each subject across groups and conditions + if strcmpi(dtype, 'spec') && strcmpi(opt.rmsubjmean, 'on') && ~isempty(opt.channels) + disp('Removing subject''s average spectrum based on pairing settings'); + if strcmpi(paired1, 'on') && strcmpi(paired2, 'on') && (nc > 1 || ng > 1) + disp('Removing average spectrum for both indep. variables'); + meanpowbase = computemeanspectrum(alldata(:), opt.singletrials); + alldata = removemeanspectrum(alldata, meanpowbase); + elseif strcmpi(paired1, 'on') && ng > 1 + disp('Removing average spectrum for first indep. variables (second indep. var. is unpaired)'); + for g = 1:ng % ng = number of groups + meanpowbase = computemeanspectrum(alldata(:,g), opt.singletrials); + alldata(:,g) = removemeanspectrum(alldata(:,g), meanpowbase); + end; + elseif strcmpi(paired2, 'on') && nc > 1 + disp('Removing average spectrum for second indep. variables (first indep. var. is unpaired)'); + for c = 1:nc % ng = number of groups + meanpowbase = computemeanspectrum(alldata(c,:), opt.singletrials); + alldata(c,:) = removemeanspectrum(alldata(c,:), meanpowbase); + end; + else + disp('Not removing average spectrum baseline (both indep. variables are unpaired'); + end; + end; + + if strcmpi(opt.singletrials, 'on') + tmpstruct = setfield( tmpstruct, [ dtype 'datatrials' ], alldata); + tmpstruct = setfield( tmpstruct, [ 'setindstrials' ], setinfoIndices); + if ~isempty(opt.channels) + tmpstruct = setfield( tmpstruct, [ dtype 'trialinfo' ], opt.subject); + else tmpstruct = setfield( tmpstruct, [ dtype 'trialinfo' ], opt.component); + end; + else tmpstruct = setfield( tmpstruct, [ dtype 'data' ], alldata); + end; + if strcmpi(dtype, 'spec'), tmpstruct.specfreqs = xvals; + else tmpstruct.erptimes = xvals; + end; + + % copy results to structure + % ------------------------- + fieldnames = { [ dtype 'data' ] [ dtype 'freqs' ] [ dtype 'datatrials' ] ... + [ dtype 'times' ] [ dtype 'trialinfo' ] 'allinds' 'setinds' 'setindstrials' }; + for f = 1:length(fieldnames) + if isfield(tmpstruct, fieldnames{f}), + tmpdata = getfield(tmpstruct, fieldnames{f}); + if ~isempty(opt.channels) + STUDY.changrp = setfield(STUDY.changrp, { finalinds(ind) }, fieldnames{f}, tmpdata); + else STUDY.cluster = setfield(STUDY.cluster, { finalinds(ind) }, fieldnames{f}, tmpdata); + end; + end; + end; + end; +end; + +% if several channels, agregate them +% ---------------------------------- +allinds = finalinds; +if ~isempty(opt.channels) + structdat = STUDY.changrp; + datavals = cell(nc, ng); + if strcmpi( dtype, 'spec'), xvals = getfield(structdat(allinds(1)), [ dtype 'freqs' ]); + else xvals = getfield(structdat(allinds(1)), [ dtype 'times' ]); + end; + for ind = 1:length(datavals(:)) + if strcmpi(opt.singletrials, 'on') + tmpdat = getfield(structdat(allinds(1)), [ dtype 'datatrials' ]); + else tmpdat = getfield(structdat(allinds(1)), [ dtype 'data' ]); + end; + if ~isempty(tmpdat{ind}) + datavals{ind} = zeros([ size(tmpdat{ind}) length(allinds)]); + for chan = 1:length(allinds) + if strcmpi(opt.singletrials, 'on') + tmpdat = getfield(structdat(allinds(chan)), [ dtype 'datatrials' ]); + else tmpdat = getfield(structdat(allinds(chan)), [ dtype 'data' ]); + end; + datavals{ind}(:,:,chan) = tmpdat{ind}; % only works for interpolated data + end; + + datavals{ind} = squeeze(permute(datavals{ind}, [1 3 2])); % time elec subjects + end; + end; + setinds = structdat(allinds(1)).setinds; + if ~isempty(opt.subject) + if strcmpi(opt.singletrials, 'on') + datavals = std_selsubject(datavals, opt.subject, structdat(allinds(1)).setindstrials, { STUDY.design(opt.design).cell.case }, 2); + else + datavals = std_selsubject(datavals, opt.subject, setinds, { STUDY.design(opt.design).cell.case }, 2); + end; + end; +else + if strcmpi(opt.singletrials, 'on') + datavals = getfield(STUDY.cluster(allinds(1)), [ dtype 'datatrials' ]); + else datavals = getfield(STUDY.cluster(allinds(1)), [ dtype 'data' ]); + end; + if strcmpi( dtype, 'spec'), xvals = getfield(STUDY.cluster(allinds(1)), [ dtype 'freqs' ]); + else xvals = getfield(STUDY.cluster(allinds(1)), [ dtype 'times' ]); + end; + compinds = STUDY.cluster(allinds(1)).allinds; + setinds = STUDY.cluster(allinds(1)).setinds; + if ~isempty(opt.component) && length(allinds) == 1 && strcmpi(opt.singletrials,'off') + datavals = std_selcomp(STUDY, datavals, allinds, setinds, compinds, opt.component); + end; +end; + +% compute mean spectrum +% --------------------- +function meanpowbase = computemeanspectrum(spectrum, singletrials) + + try + len = length(spectrum(:)); + count = 0; + for index = 1:len + if ~isempty(spectrum{index}) + if strcmpi(singletrials, 'on') + if count == 0, meanpowbase = mean(spectrum{index},2); + else meanpowbase = meanpowbase + mean(spectrum{index},2); + end; + else + if count == 0, meanpowbase = spectrum{index}; + else meanpowbase = meanpowbase + spectrum{index}; + end; + end; + count = count+1; + end; + end; + meanpowbase = meanpowbase/count; + catch, + error([ 'Problem while subtracting mean spectrum.' 10 ... + 'Common spectrum subtraction is performed based on' 10 ... + 'pairing settings in your design. Most likelly, one' 10 ... + 'independent variable should not have its data paired.' ]); + end; + +% remove mean spectrum +% -------------------- +function spectrum = removemeanspectrum(spectrum, meanpowbase) + for g = 1:size(spectrum,2) % ng = number of groups + for c = 1:size(spectrum,1) + if ~isempty(spectrum{c,g}) && ~isempty(spectrum{c,g}) + if size(spectrum{c,g},2) ~= size(meanpowbase, 2) + tmpmeanpowbase = repmat(meanpowbase, [1 size(spectrum{c,g},2)]); + else tmpmeanpowbase = meanpowbase; + end; + spectrum{c,g} = spectrum{c,g} - tmpmeanpowbase; + end; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readerpimage.m b/code/eeglab13_4_4b/functions/studyfunc/std_readerpimage.m new file mode 100644 index 0000000..d332168 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readerpimage.m @@ -0,0 +1,30 @@ +% std_readerpimage() - load ERPimage measures for data channels or +% for all components of a specified cluster. +% Usage: +% >> [STUDY, erpimagedata, times, trials, events] = std_readerpimage(STUDY, ALLEEG, varargin); +% +% Note: this function is a helper function that contains a call to the +% std_readersp function that reads all 2-D data matrices for EEGLAB STUDY. +% See the std_readersp help message for more information. +% +% Author: Arnaud Delorme, CERCO, 2006- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, erspdata, alltimes, allfreqs, events] = std_readerpimage(STUDY, ALLEEG, varargin); + +[STUDY, erspdata, alltimes, allfreqs, erspbase, events] = std_readersp(STUDY, ALLEEG, 'infotype','erpim', varargin{:}); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readersp.m b/code/eeglab13_4_4b/functions/studyfunc/std_readersp.m new file mode 100644 index 0000000..f7bf20e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readersp.m @@ -0,0 +1,539 @@ +% std_readersp() - load ERSP measures for data channels or for all +% components of a specified cluster. This function is +% also being used to read ITC and ERPimage data. +% Usage: +% >> [STUDY, erspdata, times, freqs, erspbase] = ... +% std_readersp(STUDY, ALLEEG, varargin); +% Inputs: +% STUDY - studyset structure containing some or all files in ALLEEG +% ALLEEG - vector of loaded EEG datasets +% +% Optional inputs: +% 'design' - [integer] read files from a specific STUDY design. Default +% is empty (use current design in STUDY.currentdesign). +% 'channels' - [cell] list of channels to import {default: none} +% 'clusters' - [integer] list of clusters to import {[]|default: all but +% the parent cluster (1) and any 'NotClust' clusters} +% 'singletrials' - ['on'|'off'] load single trials spectral data (if +% available). Default is 'off'. +% 'forceread' - ['on'|'off'] Force rereading data from disk. +% Default is 'off'. +% 'subject' - [string] select a specific subject {default:all} +% 'component' - [integer] select a specific component in a cluster +% {default:all} +% 'datatype' - {'ersp'|'itc'|'erpim'} This function is used to read all +% 2-D STUDY matrices stored on disk (not only ERSP). It may +% read ERSP ('ersp' option), ITC ('itc' option) or ERPimage +% data ('erpim' option). +% +% ERSP specific options: +% 'timerange' - [min max] time range {default: whole measure range} +% 'freqrange' - [min max] frequency range {default: whole measure range} +% 'subbaseline' - ['on'|'off'] subtract the ERSP baseline for paired +% conditions. The conditions for which baseline is removed +% are indicated on the command line. See help +% std_studydesign for more information about paired and +% unpaired variables. +% +% ERPimage specific option: +% This function is used to read all 2-D STUDY matrices stored on disk +% (this includes ERPimages). It therefore takes as input specific +% ERPimage options. Note that the 'singletrials' optional input is +% irrelevant for ERPimages (which are always stored as single trials). +% 'concatenate' - ['on'|'off'] read concatenated ERPimage data ('on') or +% stacked ERPimage data. See help std_erpimage for more +% information. +% 'timerange' - [min max] time range {default: whole measure range} +% 'trialrange' - [min max] read only a specific range of the ERPimage +% output trials {default: whole measure range} +% Output: +% STUDY - updated studyset structure +% erspdata - [cell array] ERSP data (the cell array size is +% condition x groups). This may also be ITC data or ERPimage +% data (see above). +% times - [float array] array of time points +% freqs - [float array] array of frequencies. For ERPimage this +% contains trial indices. +% erspbase - [cell array] baseline values +% events - [cell array] events (ERPimage only). +% +% Author: Arnaud Delorme, CERCO, 2006- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, erspdata, alltimes, allfreqs, erspbase, events, unitPower] = std_readersp(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_readersp; + return; +end +events = {}; +unitPower = 'dB'; +if ~isstruct(ALLEEG) % old calling format + dataset = ALLEEG; + EEG = STUDY(dataset); + comp = varargin{1}; + if length(varargin) > 1, timelim = varargin{2}; else timelim = []; end; + if length(varargin) > 2, freqlim = varargin{3}; else freqlim = []; end; + filebase = fullfile(EEG.filepath, EEG.filename(1:end-4)); + if comp < 0 + error('Old format function call, channel reading not supported'); + [ersp params alltimes allfreqs] = std_readfile(filebase, 'channels', -comp, 'timelimits', timelim, 'freqlimits', freqlim); + else + [ersp params alltimes allfreqs] = std_readfile(filebase, 'components', comp, 'timelimits', timelim, 'freqlimits', freqlim, 'measure', 'ersp'); + [erspbase params alltimes allfreqs] = std_readfile(filebase, 'components', comp, 'timelimits', timelim, 'freqlimits', freqlim, 'measure', 'erspbase'); + end; + STUDY = ersp; + erspdata = allfreqs; + allfreqs = params; + return; +end; + +STUDY = pop_erspparams( STUDY, 'default'); +STUDY = pop_erpimparams(STUDY, 'default'); +[opt moreopts] = finputcheck( varargin, { ... + 'design' 'integer' [] STUDY.currentdesign; + 'channels' 'cell' [] {}; + 'clusters' 'integer' [] []; + 'trialrange' 'real' [] STUDY.etc.erpimparams.trialrange; + 'freqrange' 'real' [] STUDY.etc.erspparams.freqrange; + 'timerange' 'real' [] NaN; + 'singletrials' 'string' { 'on','off' } 'off'; + 'forceread' 'string' { 'on','off' } 'off'; + 'concatenate' 'string' { 'on','off' } STUDY.etc.erpimparams.concatenate; + 'subbaseline' 'string' { 'on','off' } STUDY.etc.erspparams.subbaseline; + 'component' 'integer' [] []; + 'infotype' 'string' { 'ersp','itc','erpim' } 'ersp'; ... % deprecated + 'datatype' 'string' { 'ersp','itc','erpim' } 'ersp'; ... + 'subject' 'string' [] '' }, ... + 'std_readersp', 'ignore'); +if isstr(opt), error(opt); end; +if ~strcmpi(opt.infotype, 'ersp'), opt.datatype = opt.infotype; end; +if strcmpi(opt.datatype, 'erpim'), if isnan(opt.timerange), opt.timerange = STUDY.etc.erpimparams.timerange; end; + opt.freqrange = opt.trialrange; + ordinate = 'trials'; +else if isnan(opt.timerange) opt.timerange = STUDY.etc.erspparams.timerange; end; + ordinate = 'freqs'; +end; +nc = max(length(STUDY.design(opt.design).variable(1).value),1); +ng = max(length(STUDY.design(opt.design).variable(2).value),1); +paired1 = STUDY.design(opt.design).variable(1).pairing; +paired2 = STUDY.design(opt.design).variable(2).pairing; + +dtype = opt.datatype; + +% find channel indices +% -------------------- +if ~isempty(opt.channels) + allChangrp = lower({ STUDY.changrp.name }); + finalinds = std_chaninds(STUDY, opt.channels); +else finalinds = opt.clusters; +end; + +for ind = 1:length(finalinds) + erspbase = cell( nc, ng ); + + % find indices + % ------------ + if ~isempty(opt.channels) + tmpstruct = STUDY.changrp(finalinds(ind)); + allinds = tmpstruct.allinds; + setinds = tmpstruct.setinds; + else + tmpstruct = STUDY.cluster(finalinds(ind)); + allinds = tmpstruct.allinds; + setinds = tmpstruct.setinds; + end; + + % check if data is already here + % ----------------------------- + if strcmpi(dtype, 'erpim') % ERP images + dataread = 0; + eqtf = isequal( STUDY.etc.erpimparams.timerange , opt.timerange) && ... + isequal( STUDY.etc.erpimparams.trialrange, opt.trialrange); + if isfield(tmpstruct, 'erpimdata') && eqtf && ~isempty(tmpstruct.erpimdata) + dataread = 1; + end; + else + dataread = 0; + eqtf = isequal( STUDY.etc.erspparams.timerange, opt.timerange) && ... + isequal( STUDY.etc.erspparams.freqrange, opt.freqrange); + eqtfb = isequal( STUDY.etc.erspparams.subbaseline, opt.subbaseline) && eqtf; + if strcmpi(opt.singletrials,'off') + if isfield(tmpstruct, [ dtype 'data']) && eqtfb && ~isempty(getfield(tmpstruct, [ dtype 'data'])) + dataread = 1; + end; + else + if isfield(tmpstruct, [ dtype 'datatrials']) && eqtf && ~isempty(getfield(tmpstruct, [ dtype 'datatrials'])) + if ~isempty(opt.channels) && strcmpi(getfield(tmpstruct, [ dtype 'trialinfo' ]), opt.subject) + dataread = 1; + elseif isempty(opt.channels) && isequal(getfield(tmpstruct, [ dtype 'trialinfo' ]), opt.component) + dataread = 1; + end; + end; + end; + end; + + if dataread && strcmpi(opt.forceread, 'off') + disp('Using pre-loaded data. To force rereading data from disk use the ''forceread'' flag'); + else + + if strcmpi(dtype, 'erpim') % ERP images + + if strcmpi(opt.singletrials, 'on') + error( [ 'Single trial loading option not supported with STUDY ERP-image' 10 '(there is no such thing as a single-trial ERPimage)' ]); + end; + % read the data and select channels + % --------------------------------- + setinfo = STUDY.design(opt.design).cell; + erpim = cell( nc, ng ); + events = cell( nc, ng ); + for c = 1:nc + for g = 1:ng + if ~isempty(setinds{c,g}) + if ~isempty(opt.channels), opts = { 'channels', allChangrp(allinds{c,g}(:)), 'timelimits', opt.timerange, 'triallimits', opt.trialrange, 'concatenate', opt.concatenate }; + else opts = { 'components', allinds{c,g}(:), 'timelimits', opt.timerange, 'triallimits', opt.trialrange, 'concatenate', opt.concatenate }; + end; + [erpim{c, g} tmpparams alltimes alltrials events{c,g}] = std_readfile( setinfo(setinds{c,g}(:)), 'measure', 'erpim', opts{:}); + fprintf('.'); + end; + end; + end; + if strcmpi(opt.concatenate, 'on'), alltrials = []; end; + fprintf('\n'); + ersp = erpim; + allfreqs = alltrials; + + else % ERSP/ITC + + % reserve arrays + % -------------- + events = {}; + ersp = cell( nc, ng ); + erspinds = cell( nc, ng ); + + % find total nb of trials + % THIS CODE IS NOT NECESSARY ANY MORE (SEE BUG 1170) + % ----------------------- + %setinfo = STUDY.design(opt.design).cell; + %tottrials = cell( nc, ng ); + %if strcmpi(opt.singletrials, 'on') + % for indSet = 1:length(setinfo) + % condind = std_indvarmatch( setinfo(indSet).value{1}, STUDY.design(opt.design).variable(1).value ); + % grpind = std_indvarmatch( setinfo(indSet).value{2}, STUDY.design(opt.design).variable(2).value ); + % if isempty(tottrials{condind, grpind}), tottrials{condind, grpind} = sum(cellfun(@length, setinfo(indSet).trials)); + % else tottrials{condind, grpind} = tottrials{condind, grpind} + sum(cellfun(@length, setinfo(indSet).trials)); + % end; + % end; + %end; + + % read the data and select channels + % --------------------------------- + fprintf('Reading all %s data:', upper(dtype)); + setinfo = STUDY.design(opt.design).cell; + if strcmpi(opt.singletrials, 'on') + for c = 1:nc + for g = 1:ng + if ~isempty(opt.channels) + allsubjects = { STUDY.design(opt.design).cell.case }; + if ~isempty(opt.subject), inds = strmatch( opt.subject, allsubjects(setinds{c,g})); + else inds = 1:length(allinds{c,g}); end; + else + if ~isempty(opt.component) inds = find( allinds{c,g} == STUDY.cluster(finalinds(ind)).comps(opt.component)); + else inds = 1:length(allinds{c,g}); end; + end; + if ~isempty(inds) + count{c, g} = 1; + for indtmp = 1:length(inds) + setindtmp = STUDY.design(opt.design).cell(setinds{c,g}(inds(indtmp))); + tmpopts = { 'measure', 'timef' 'timelimits', opt.timerange, 'freqlimits', opt.freqrange }; + if ~isempty(opt.channels), [ tmpersp tmpparams alltimes allfreqs] = std_readfile(setindtmp, 'channels', allChangrp(allinds{c,g}(inds(indtmp))), tmpopts{:}); + else [ tmpersp tmpparams alltimes allfreqs] = std_readfile(setindtmp, 'components', allinds{c,g}(inds(indtmp)), tmpopts{:}); + end; + indices = [count{c, g}:count{c, g}+size(tmpersp,3)-1]; + if indtmp == 1 + ersp{c, g} = permute(tmpersp, [2 1 3]); + else ersp{c, g}(:,:,indices) = permute(tmpersp, [2 1 3]); + end; + erspinds{c, g}(1:2,indtmp) = [ count{c, g} count{c, g}+size(tmpersp,3)-1 ]; + count{c, g} = count{c, g}+size(tmpersp,3); + if size(tmpersp,3) ~= sum(cellfun(@length, setindtmp.trials)) + error( sprintf('Wrong number of trials in datafile for design index %d\n', setinds{c,g}(inds(indtmp)))); + end; + end; + end; + end; + end; + else + for c = 1:nc + for g = 1:ng + if ~isempty(setinds{c,g}) + if ~isempty(opt.channels), opts = { 'channels', allChangrp(allinds{c,g}(:)), 'timelimits', opt.timerange, 'freqlimits', opt.freqrange }; + else opts = { 'components', allinds{c,g}(:) , 'timelimits', opt.timerange, 'freqlimits', opt.freqrange }; + end; + if strcmpi(dtype, 'ersp') + erspbase{c, g} = std_readfile( setinfo(setinds{c,g}(:)), 'measure', 'erspbase', opts{:}); + [ ersp{c, g} tmpparams alltimes allfreqs ] = std_readfile( setinfo(setinds{c,g}(:)), 'measure', 'ersp' , opts{:}); + else [ ersp{c, g} tmpparams alltimes allfreqs ] = std_readfile( setinfo(setinds{c,g}(:)), 'measure', 'itc' , opts{:}); + ersp{c, g} = abs(ersp{c, g}); + end; + fprintf('.'); + %ersp{c, g} = permute(ersp{c, g} , [3 2 1]); + %erspbase{c, g} = 10*log(permute(erspbase{c, g}, [3 2 1])); + end; + end; + end; + end; + fprintf('\n'); + + % compute ERSP or ITC if trial mode + % (since only the timef have been loaded) + % --------------------------------------- + if strcmpi(opt.singletrials, 'on') + tmpparams2 = fieldnames(tmpparams); tmpparams2 = tmpparams2'; + tmpparams2(2,:) = struct2cell(tmpparams); + precomp.times = alltimes; + precomp.freqs = allfreqs; + precomp.recompute = dtype; + for c = 1:nc + for g = 1:ng + if ~isempty(ersp{c,g}) + precomp.tfdata = permute(ersp{c,g}, [2 1 3]); + if strcmpi(dtype, 'itc') + [tmp ersp{c,g}] = newtimef(zeros(ALLEEG(1).pnts,2), ALLEEG(1).pnts, [ALLEEG(1).xmin ALLEEG(1).xmax]*1000, ... + ALLEEG(1).srate, [], tmpparams2{:}, 'precomputed', precomp, 'verbose', 'off'); + elseif strcmpi(dtype, 'ersp') + [ersp{c,g} tmp] = newtimef(zeros(ALLEEG(1).pnts,2), ALLEEG(1).pnts, [ALLEEG(1).xmin ALLEEG(1).xmax]*1000, ... + ALLEEG(1).srate, [], tmpparams2{:}, 'precomputed', precomp, 'verbose', 'off'); + end; + ersp{c,g} = permute(ersp{c,g}, [2 1 3]); + end; + end; + end; + end; + + % compute average baseline across groups and conditions + % ----------------------------------------------------- + if strcmpi(opt.subbaseline, 'on') && strcmpi(dtype, 'ersp') + if strcmpi(opt.singletrials, 'on') + disp('WARNING: no ERSP baseline may not be subtracted when using single trials'); + else + disp('Recomputing baseline...'); + if strcmpi(paired1, 'on') && strcmpi(paired2, 'on') + disp('Removing ERSP baseline for both indep. variables'); + meanpowbase = computeerspbaseline(erspbase(:), opt.singletrials); + ersp = removeerspbaseline(ersp, erspbase, meanpowbase); + elseif strcmpi(paired1, 'on') + disp('Removing ERSP baseline for first indep. variables (second indep. var. is unpaired)'); + for g = 1:ng % ng = number of groups + meanpowbase = computeerspbaseline(erspbase(:,g), opt.singletrials); + ersp(:,g) = removeerspbaseline(ersp(:,g), erspbase(:,g), meanpowbase); + end; + elseif strcmpi(paired2, 'on') + disp('Removing ERSP baseline for second indep. variables (first indep. var. is unpaired)'); + for c = 1:nc % ng = number of groups + meanpowbase = computeerspbaseline(erspbase(c,:), opt.singletrials); + ersp(c,:) = removeerspbaseline(ersp(c,:), erspbase(c,:), meanpowbase); + end; + else + disp('Not removing ERSP baseline (both indep. variables are unpaired'); + end; + end; + end; + end; + +% if strcmpi(opt.statmode, 'common') +% % collapse the two last dimensions before computing significance +% % i.e. 18 subject with 4 channels -> same as 4*18 subjects +% % -------------------------------------------------------------- +% disp('Using all channels for statistics...'); +% for c = 1:nc +% for g = 1:ng +% ersp{c,g} = reshape( ersp{c,g}, size(ersp{c,g},1), size(ersp{c,g},2), size(ersp{c,g},3)*size(ersp{c,g},4)); +% end; +% end; +% end; + + % copy data to structure + % ---------------------- + if ~isempty(events) + tmpstruct = setfield(tmpstruct, [ dtype 'events' ], events); + end; + tmpstruct = setfield(tmpstruct, [ dtype ordinate ], allfreqs); + tmpstruct = setfield(tmpstruct, [ dtype 'times' ], alltimes); + if strcmpi(opt.singletrials, 'on') + tmpstruct = setfield(tmpstruct, [ dtype 'datatrials' ], ersp); + tmpstruct = setfield(tmpstruct, [ dtype 'subjinds' ], erspinds); + tmpstruct = setfield(tmpstruct, [ dtype 'times' ], alltimes); + if ~isempty(opt.channels) + tmpstruct = setfield(tmpstruct, [ dtype 'trialinfo' ], opt.subject); + else tmpstruct = setfield(tmpstruct, [ dtype 'trialinfo' ], opt.component); + end; + else + tmpstruct = setfield(tmpstruct, [ dtype 'data' ], ersp); + if strcmpi(dtype, 'ersp') + tmpstruct = setfield(tmpstruct, [ dtype 'base' ], erspbase); + end; + end; + + % copy results to structure + % ------------------------- + fields = { [ dtype 'data' ] [ dtype 'events' ] [ dtype ordinate ] [ dtype 'datatrials' ] ... + [ dtype 'subjinds' ] [ dtype 'base' ] [ dtype 'times' ] [ dtype 'trialinfo' ] 'allinds' 'setinds' }; + for f = 1:length(fields) + if isfield(tmpstruct, fields{f}), + tmpdata = getfield(tmpstruct, fields{f}); + if ~isempty(opt.channels) + STUDY.changrp = setfield(STUDY.changrp, { finalinds(ind) }, fields{f}, tmpdata); + else STUDY.cluster = setfield(STUDY.cluster, { finalinds(ind) }, fields{f}, tmpdata); + end; + end; + end; + end; +end; + +% output unit +% ----------- +if exist('tmpparams') ~= 1 + if ~isempty(opt.channels), [tmpersp tmpparams] = std_readfile(STUDY.design(opt.design).cell(1), 'channels', {STUDY.changrp(1).name}, 'measure', opt.datatype); + else [tmpersp tmpparams] = std_readfile(STUDY.design(opt.design).cell(1), 'components', STUDY.cluster(finalinds(end)).allinds{1,1}(1), 'measure', opt.datatype); + end; +end; +if ~isfield(tmpparams, 'baseline'), tmpparams.baseline = 0; end; +if ~isfield(tmpparams, 'scale' ), tmpparams.scale = 'log'; end; +if ~isfield(tmpparams, 'basenorm'), tmpparams.basenorm = 'off'; end; +if strcmpi(tmpparams.scale, 'log') + if strcmpi(tmpparams.basenorm, 'on') + unitPower = '10*log(std.)'; % impossible + elseif isnan(tmpparams.baseline) + unitPower = '10*log10(\muV^{2}/Hz)'; + else + unitPower = 'dB'; + end; +else + if strcmpi(tmpparams.basenorm, 'on') + unitPower = 'std.'; + elseif isnan(tmpparams.baseline) + unitPower = '\muV^{2}/Hz'; + else + unitPower = '% of baseline'; + end; +end; + +% return structure +% ---------------- +if nargout <2 + return +end +allinds = finalinds; +if ~isempty(opt.channels) + structdat = STUDY.changrp; + erspdata = cell(nc, ng); + events = {}; + for ind = 1:length(erspdata(:)) + if strcmpi(opt.singletrials, 'on') + tmpdat = getfield(structdat(allinds(1)), [ dtype 'datatrials' ]); + else tmpdat = getfield(structdat(allinds(1)), [ dtype 'data' ]); + end; + if ndims(tmpdat{ind}) == 2, erspdata{ind} = zeros([ size(tmpdat{ind}) 1 length(allinds)]); + else erspdata{ind} = zeros([ size(tmpdat{ind}) length(allinds)]); + end; + for index = 1:length(allinds) + if strcmpi(opt.singletrials, 'on') + tmpdat = getfield(structdat(allinds(index)), [ dtype 'datatrials' ]); + else tmpdat = getfield(structdat(allinds(index)), [ dtype 'data' ]); + end; + erspdata{ind}(:,:,:,index) = tmpdat{ind}; + allfreqs = getfield(structdat(allinds(index)), [ dtype ordinate ]); + alltimes = getfield(structdat(allinds(index)), [ dtype 'times' ]); + if isfield(structdat, [ dtype 'events' ]) + events = getfield(structdat(allinds(index)), [ dtype 'events' ]); + end; + compinds = structdat(allinds(index)).allinds; + setinds = structdat(allinds(index)).setinds; + end; + erspdata{ind} = permute(erspdata{ind}, [1 2 4 3]); % time freqs elec subjects + end; + if ~isempty(opt.subject) && strcmpi(opt.singletrials,'off') + erspdata = std_selsubject(erspdata, opt.subject, setinds, { STUDY.design(opt.design).cell.case }, 2); + end; +else + if strcmpi(opt.singletrials, 'on') + erspdata = getfield(STUDY.cluster(allinds(1)), [ dtype 'datatrials' ]); + else erspdata = getfield(STUDY.cluster(allinds(1)), [ dtype 'data' ]); + end; + allfreqs = getfield(STUDY.cluster(allinds(1)), [ dtype ordinate ]); + alltimes = getfield(STUDY.cluster(allinds(1)), [ dtype 'times' ]); + if isfield(STUDY.cluster, [ dtype 'events' ]) + events = getfield(STUDY.cluster(allinds(1)), [ dtype 'events' ]); + end; + compinds = STUDY.cluster(allinds(1)).allinds; + setinds = STUDY.cluster(allinds(1)).setinds; + if ~isempty(opt.component) && length(allinds) == 1 && strcmpi(opt.singletrials,'off') + erspdata = std_selcomp(STUDY, erspdata, allinds, setinds, compinds, opt.component); + end; +end; + +% compute ERSP baseline +% --------------------- +function meanpowbase = computeerspbaseline(erspbase, singletrials) + + try + len = length(erspbase(:)); + count = 0; + for index = 1:len + if ~isempty(erspbase{index}) + if strcmpi(singletrials, 'on') + if count == 0, meanpowbase = abs(mean(erspbase{index},3)); + else meanpowbase = meanpowbase + abs(mean(erspbase{index},3)); + end; + else + if count == 0, meanpowbase = abs(erspbase{index}); + else meanpowbase = meanpowbase + abs(erspbase{index}); + end; + end; + count = count+1; + end; + end; + meanpowbase = reshape(meanpowbase , [size(meanpowbase,1) 1 size(meanpowbase,2)])/count; + catch, + error([ 'Problem while subtracting common ERSP baseline.' 10 ... + 'Common baseline subtraction is performed based on' 10 ... + 'pairing settings in your design. Most likelly, one' 10 ... + 'independent variable should not have its data paired.' ]); + end; + +% remove ERSP baseline +% --------------------- +function ersp = removeerspbaseline(ersp, erspbase, meanpowbase) + convert2log = 0; + for g = 1:size(ersp,2) % ng = number of groups + for c = 1:size(ersp,1) + if ~isempty(erspbase{c,g}) && ~isempty(ersp{c,g}) + erspbasetmp = reshape(erspbase{c,g}, [size(meanpowbase,1) 1 size(meanpowbase,3)]); + if any(erspbasetmp(:) > 1000) + convert2log = 1; + end; + tmpmeanpowbase = repmat(meanpowbase, [1 size(ersp{c,g},2) 1]); + if convert2log + ersp{c,g} = ersp{c,g} - repmat(10*log10(erspbasetmp), [1 size(ersp{c,g},2) 1 1]) + 10*log10(tmpmeanpowbase); + else ersp{c,g} = ersp{c,g} - repmat(abs(erspbasetmp), [1 size(ersp{c,g},2) 1 1]) + tmpmeanpowbase; + end; + end; + end; + end; + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readfile.m b/code/eeglab13_4_4b/functions/studyfunc/std_readfile.m new file mode 100644 index 0000000..f019bb3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readfile.m @@ -0,0 +1,333 @@ +% std_readfile() - Read data file containing STUDY measures. +% +% Usage: +% >> [data param range1 range2] = std_readfile(filename, 'key', val); +% +% Inputs: +% filename - [string] read specific file, for instance 's1.daterp' +% containing ERP data for dataset "s1.set". It is also +% possible to provide only the "base" file name "s1" and +% function will load the appropriate file based on the +% selected input measure (measure input). +% +% Optional inputs: +% 'channels' - [cell or integer] channel labels - for instance +% { 'cz' 'pz' } - or indices - for instance [1 2 3] +% of channels to load from the data file. +% 'components' - [integer] component index in the selected EEG dataset for which +% to read the ERSP +% 'timelimits' - [min max] ERSP time (latency in ms) range of interest +% 'freqlimits' - [min max] ERSP frequency range (in Hz) of interest +% 'measure' - ['erp'|'spec'|'ersp'|'itc'|'timef'|'erspbase'|'erspboot' +% 'itcboot'|'erpim'] data measure to read. If a full file name +% is provided, the data measure is selected automatically. +% 'getparamsonly' - ['on'|'off'] only read file parameters not data. +% +% Outputs: +% data - the multi-channel or multi-component data. The size of this +% output depends on the number of dimension (for ERSP or ERP +% for instance). The last dimension is channels or components. +% params - structure containing parameters saved with the data file. +% range1 - time points (ERP, ERSP) or frequency points (spectrum) +% range2 - frequency points (ERSP, ITCs) +% +% Examples: +% % the examples below read all data channels for the selected files +% [ersp params times freqs] = std_readfiles('s1.datersp'); +% [erp params times] = std_readfiles('s1.daterp'); +% [erp params times] = std_readfiles('s1.daterp', timerange', [-100 500]); +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, May 2010 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, 2010, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% dimensions +% time x freqs x channel_comps x subjects_trials + +function [measureData, parameters, measureRange1, measureRange2, events, setinfoTrialIndices] = std_readfile(fileBaseName, varargin); + +if nargin < 1 + help std_readfile; + return; +end; + +opt = finputcheck(varargin, { 'components' 'integer' [] []; + 'getparamonly' 'string' { 'on','off' } 'off'; + 'singletrials' 'string' { 'on','off' } 'off'; + 'concatenate' 'string' { 'on','off' } 'off'; % ERPimage only + 'channels' 'cell' [] {}; + 'setinfoinds' 'integer' [] []; + 'measure' 'string' { 'erpim','ersp','erspboot','erspbase','itc','itcboot','spec','erp','timef' } 'erp'; + 'timelimits' 'real' [] []; % ERPimage, ERP, ERSP, ITC + 'triallimits' 'real' [] []; % ERPimage only + 'freqlimits' 'real' [] []; % SPEC, ERSP, ITC + 'dataindices' 'integer' [] [] }, 'std_readdatafile'); +if isstr(opt), error(opt); end; +if ~isempty(opt.triallimits), opt.freqlimits = opt.triallimits; end; +if strcmpi(opt.concatenate, 'on'), opt.singletrials = 'on'; end; +if isstruct(fileBaseName), fileBaseName = { fileBaseName.filebase }; +else fileBaseName = { fileBaseName }; +end; +if ~isempty(opt.channels) && length(opt.channels) < length(fileBaseName) + opt.channels(2:length(fileBaseName)) = opt.channels(1); +end; + +% get file extension +% ------------------ +if ~isempty(opt.channels) || (~isempty(opt.dataindices) && opt.dataindices(1) < 0) , dataType = 'chan'; +else dataType = 'comp'; +end; +[tmp1 tmp2 currentFileExt] = fileparts(fileBaseName{1}); +if length(currentFileExt) > 3 && (strcmpi(currentFileExt(2:4), 'dat') || strcmpi(currentFileExt(2:4), 'ica')) + opt.measure = currentFileExt(5:end); + if strcmpi(currentFileExt(2:4), 'dat'), dataType = 'chan'; + else dataType = 'comp'; + end; + fileExt = ''; +else + if strcmpi(dataType, 'chan'), fileExt = [ '.dat' opt.measure ]; + else fileExt = [ '.ica' opt.measure ]; + end; +end; +if nargin > 5 && strcmpi(opt.singletrials, 'on') + indFlag = true; +else indFlag = false; +end; + +% get fields to read +% ------------------ +erspFreqOnly = 0; +switch opt.measure + case 'erpim' , fieldExt = ''; + case 'erp' , fieldExt = ''; + case 'spec' , fieldExt = ''; + case 'ersp' , fieldExt = '_ersp'; + case 'itc' , fieldExt = '_itc'; + case 'timef' , fieldExt = '_timef'; + case 'erspbase', fieldExt = '_erspbase'; fileExt = fileExt(1:end-4); erspFreqOnly = 1; + case 'erspboot', fieldExt = '_erspboot'; fileExt = fileExt(1:end-4); erspFreqOnly = 1; + case 'itcboot' , fieldExt = '_itcboot'; fileExt = fileExt(1:end-4); erspFreqOnly = 1; +end; + +% get channel or component indices +% -------------------------------- +if ~isempty(opt.channels) && isnumeric(opt.channels) + opt.dataindices = opt.channels; +elseif ~isempty(opt.channels) + %if length(fileBaseName) > 1, error('Cannot read channel labels when reading more than 1 input file'); end; + for iFile = 1:length(fileBaseName) + filename = [ fileBaseName{iFile} fileExt ]; + try, + warning('off', 'MATLAB:load:variableNotFound'); + fileData = load( '-mat', filename, 'labels', 'chanlabels' ); + warning('on', 'MATLAB:load:variableNotFound'); + catch, fileData = []; + end; + if isfield(fileData, 'labels'), chan.chanlocs = struct('labels', fileData.labels); + elseif isfield(fileData, 'chanlabels') chan.chanlocs = struct('labels', fileData.chanlabels); + else error('Cannot use file to lookup channel names, the file needs to be recomputed'); + end; + opt.dataindices(iFile) = std_chaninds(chan, opt.channels{iFile}); + end; +elseif ~isempty(opt.components) + opt.dataindices = opt.components; +else opt.dataindices = abs(opt.dataindices); +end; + +% file names and indices must have the same number of values +% ---------------------------------------------------------- +if strcmpi(opt.getparamonly, 'on'), opt.dataindices = 1; end; +if length(fileBaseName ) == 1, fileBaseName( 1:length(opt.dataindices)) = fileBaseName; end; +if length(opt.dataindices) == 1, opt.dataindices(1:length(fileBaseName )) = opt.dataindices; end; +if length(opt.dataindices) ~= length(fileBaseName) && ~isempty(opt.dataindices), error('Number of files and number of indices must be the same'); end; + +% scan datasets +% ------------- +measureRange1 = []; +measureRange2 = []; +measureData = []; +parameters = []; +events = {}; +setinfoTrialIndices = []; + +% read only specific fields +% ------------------------- +counttrial = 0; +for fInd = 1:length(opt.dataindices) % usually only one value + + fieldsToRead = [ dataType int2str(opt.dataindices(fInd)) fieldExt ]; + try, + warning('off', 'MATLAB:load:variableNotFound'); + fileData = load( '-mat', [ fileBaseName{fInd} fileExt ], 'parameters', 'freqs', 'times', 'events', 'chanlocsforinterp', fieldsToRead ); + warning('on', 'MATLAB:load:variableNotFound'); + catch + error( [ 'Cannot read file ''' fileBaseName{fInd} fileExt '''' ]); + end; + + % get output for parameters and measure ranges + % -------------------------------------------- + if isfield(fileData, 'chanlocsforinterp'), chanlocsforinterp = fileData.chanlocsforinterp; end; + if isfield(fileData, 'parameters') + parameters = removedup(fileData.parameters); + for index = 1:length(parameters), if iscell(parameters{index}), parameters{index} = { parameters{index} }; end; end; + parameters = struct(parameters{:}); + end; + if isfield(fileData, 'times'), measureRange1 = fileData.times; end; + if isfield(fileData, 'freqs'), measureRange2 = fileData.freqs; end; + if isfield(fileData, 'events'), events{fInd} = fileData.events; end; + + % if the function is only called to get parameters + % ------------------------------------------------ + if strcmpi(opt.getparamonly, 'on'), + measureRange1 = indicesselect(measureRange1, opt.timelimits); + measureRange2 = indicesselect(measureRange2, opt.freqlimits); + if strcmpi(opt.measure, 'spec'), measureRange1 = measureRange2; end; + + parameters.singletrials = 'off'; + if strcmpi(opt.measure, 'timef') + parameters.singletrials = 'on'; + elseif strcmpi(opt.measure, 'erp') || strcmpi(opt.measure, 'spec') + if strcmpi(dataType, 'chan') + if size(fileData.chan1,1) > 1 && size(fileData.chan1,2) > 1 + parameters.singletrials = 'on'; + end; + else + if size(fileData.comp1,1) > 1 && size(fileData.comp1,2) > 1 + parameters.singletrials = 'on'; + end; + end; + end; + return; + end; + + % copy fields to output variables + % ------------------------------- + if isfield(fileData, fieldsToRead) + fieldData = getfield(fileData, fieldsToRead); + if isempty(fieldData) + tmpSize = size(fieldData); + tmpSize(tmpSize == 0) = 1; + fieldData = ones(tmpSize)*NaN; + end; + if isstr(fieldData), eval( [ 'fieldData = ' fieldData ] ); end; + + % average single trials if necessary + % ---------------------------------- + if strcmpi(opt.measure, 'erp') || strcmpi(opt.measure, 'spec') + if strcmpi(opt.singletrials, 'off') && size(fieldData,1) > 1 && size(fieldData,2) > 1 + fieldData = mean(fieldData,2); + end; + end; + + % array reservation + % ----------------- + if fInd == 1 + sizeFD = size(fieldData); + if length(sizeFD) == 2 && (sizeFD(1) == 1 || sizeFD(2) == 1), sizeFD = sizeFD(1)*sizeFD(2); end; + if length(sizeFD) == 2 && (sizeFD(1) == 0 || sizeFD(2) == 0), sizeFD = max(sizeFD(1)); end; + if strcmpi(opt.singletrials, 'off'), measureData = zeros([ sizeFD length(opt.dataindices) ], 'single'); + else measureData = zeros([ sizeFD ], 'single'); + end; + if indFlag, + setinfoTrialIndices = zeros(1, size(measureData,ndims(measureData)), 'int16'); + if length(opt.setinfoinds) ~= length(opt.dataindices) error('For single trial output, the "setinfoinds" parameter must be set'); end; + end; + nDimData = length(sizeFD); + end; + + % copy data to output variable + % ---------------------------- + if nDimData == 1, measureData(:,fInd) = fieldData; + else + if strcmpi(opt.singletrials, 'off') + if nDimData == 2, measureData(:,:,fInd) = fieldData; + else measureData(:,:,:,fInd) = fieldData; + end; + else + if nDimData == 2, measureData(:,counttrial+1:counttrial+size(fieldData,2)) = fieldData; + else measureData(:,:,counttrial+1:counttrial+size(fieldData,2)) = fieldData; + end; + setinfoTrialIndices(counttrial+1:counttrial+size(fieldData,2)) = opt.setinfoinds(fInd); + counttrial = counttrial+size(fieldData,2); + end; + end; + elseif ~isempty(findstr('comp', fieldsToRead)) + error( sprintf([ 'Field "%s" not found in file %s' 10 'Try recomputing measure.' ], fieldsToRead, [ fileBaseName{fInd} fileExt ])); + else + error(['Problem loading data, most likely your design has' 10 ... + 'conditions with no trials or missing channels' 10 ... + 'If you think this is a bug, report it on Bugzilla for EEGLAB' ]); + % the case below is for the rare case where all the channels are read and the end of the array needs to be trimmed + % error('There is a problem with your data, please enter a bug report and upload your data at http://sccn.ucsd.edu/eeglab/bugzilla'); + if nDimData == 1, measureData(:,1:(fInd-1)) = []; + elseif nDimData == 2, measureData(:,:,1:(fInd-1)) = []; + else measureData(:,:,:,1:(fInd-1)) = []; + end; + break; + end; +end; + +% special ERP image +% ----------------- +if ~isempty(events) + len = length(events{1}); + events = [ events{:} ]; + if strcmpi(opt.singletrials, 'off') && ~isempty(events), events = reshape(events, len, length(events)/len); end; +end; + +% select plotting or clustering time/freq range +% --------------------------------------------- +if ~isempty(measureRange1) && ~erspFreqOnly + [measureRange1 indBegin indEnd] = indicesselect(measureRange1, opt.timelimits); + if ~isempty(measureData) + if strcmpi(opt.measure, 'erp') || ( strcmpi(opt.measure, 'erpim') && strcmpi(opt.singletrials, 'on') ) + measureData = measureData(indBegin:indEnd,:,:); + else measureData = measureData(:,indBegin:indEnd,:); + end; + end; +end; +if isempty(measureRange2) && size(measureData,1) > 1 && size(measureData,2) > 1 % for ERPimage + measureRange2 = [1:size(measureData,1)]; +end; +if ~isempty(measureRange2) + [measureRange2 indBegin indEnd] = indicesselect(measureRange2, opt.freqlimits); + if ~isempty(measureData) + measureData = measureData(indBegin:indEnd,:,:); + end; + if strcmpi(opt.measure, 'spec'), measureRange1 = measureRange2; end; +end; + +% remove duplicates in the list of parameters +% ------------------------------------------- +function cella = removedup(cella) + [tmp indices] = unique_bc(cella(1:2:end)); + if length(tmp) ~= length(cella)/2 + %fprintf('Warning: duplicate ''key'', ''val'' parameter(s), keeping the last one(s)\n'); + end; + cella = cella(sort(union(indices*2-1, indices*2))); + +% find indices for selection of measure +% ------------------------------------- +function [measureRange indBegin indEnd] = indicesselect(measureRange, measureLimits); + indBegin = 1; + indEnd = length(measureRange); + if ~isempty(measureRange) && ~isempty(measureLimits) && (measureLimits(1) > measureRange(1) || measureLimits(end) < measureRange(end)) + indBegin = min(find(measureRange >= measureLimits(1))); + indEnd = max(find(measureRange <= measureLimits(end))); + measureRange = measureRange(indBegin:indEnd); + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readitc.m b/code/eeglab13_4_4b/functions/studyfunc/std_readitc.m new file mode 100644 index 0000000..dde3823 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readitc.m @@ -0,0 +1,31 @@ +% std_readitc() - load ITC measures for data channels or +% for all components of a specified cluster. +% Usage: +% >> [STUDY, itcdata, times, freqs] = ... +% std_readitc(STUDY, ALLEEG, varargin); +% +% Note: this function is a helper function that contains a call to the +% std_readersp function that reads all 2-D data matrices for EEGLAB STUDY. +% See the std_readersp help message for more information. +% +% Author: Arnaud Delorme, CERCO, 2006- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, erspdata, alltimes, allfreqs, erspbase] = std_readersp(STUDY, ALLEEG, varargin); + +[STUDY, erspdata, alltimes, allfreqs] = std_readersp(STUDY, ALLEEG, 'infotype','itc', varargin{:}); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readpac.m b/code/eeglab13_4_4b/functions/studyfunc/std_readpac.m new file mode 100644 index 0000000..fafdfb2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readpac.m @@ -0,0 +1,208 @@ +% std_readpac() - read phase-amplitude correlation +% +% Usage: +% >> [STUDY, clustinfo] = std_readpac(STUDY, ALLEEG); +% >> [STUDY, clustinfo] = std_readpac(STUDY, ALLEEG, ... +% 'key', 'val'); +% Inputs: +% STUDY - studyset structure containing some or all files in ALLEEG +% ALLEEG - vector of loaded EEG datasets +% +% Optional inputs: +% 'channels' - [cell] list of channels to import {default: all} +% 'clusters' - [integer] list of clusters to import {[]|default: all but +% the parent cluster (1) and any 'NotClust' clusters} +% 'freqrange' - [min max] frequency range {default: whole measure range} +% 'timerange' - [min max] time range {default: whole measure epoch} +% +% Output: +% STUDY - (possibly) updated STUDY structure +% clustinfo - structure of specified cluster information. +% +% Author: Arnaud Delorme, CERCO, 2009- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, clustinfo] = std_readpac(STUDY, ALLEEG, varargin); + +if nargin < 2 + help std_readpac; + return; +end + +[opt moreopts] = finputcheck( varargin, { ... + 'condition' 'cell' [] {}; + 'channels1' 'cell' [] {}; + 'clusters1' 'integer' [] []; + 'channels2' 'cell' [] {}; + 'clusters2' 'integer' [] []; + 'onepersubj' 'string' { 'on','off' } 'off'; + 'forceread' 'string' { 'on','off' } 'off'; + 'recompute' 'string' { 'on','off' } 'off'; + 'freqrange' 'real' [] []; + 'timerange' 'real' [] [] }, ... + 'std_readpac', 'ignore'); + +if isstr(opt), error(opt); end; + +%STUDY = pop_pacparams(STUDY, 'default'); +%if isempty(opt.timerange), opt.timerange = STUDY.etc.pacparams.timerange; end; +%if isempty(opt.freqrange), opt.freqrange = STUDY.etc.pacparams.freqrange; end; + +nc = max(length(STUDY.condition),1); +ng = max(length(STUDY.group),1); + +% find channel indices +% -------------------- +if ~isempty(opt.channels1) + len1 = length(opt.channels1); + len2 = length(opt.channels2); + opt.indices1 = std_chaninds(STUDY, opt.channels1); + opt.indices2 = std_chaninds(STUDY, opt.channels2); +else + len1 = length(opt.clusters1); + len2 = length(opt.clusters2); + opt.indices1 = opt.clusters1; + opt.indices2 = opt.clusters2; +end; + +STUDY = std_convertoldsetformat(STUDY); %XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX REMOVE WHEN READY TO GET RID OF OLD FORMAT + +for ind1 = 1:len1 % usually only one channel/component + for ind2 = 1:len2 % usually one channel/component + + % find indices + % ------------ + if ~isempty(opt.channels1) + tmpstruct1 = STUDY.changrp(opt.indices1(ind1)); + tmpstruct2 = STUDY.changrp(opt.indices2(ind2)); + else + tmpstruct1 = STUDY.cluster(opt.indices1(ind1)); + tmpstruct2 = STUDY.cluster(opt.indices2(ind2)); + end; + allinds1 = tmpstruct1.allinds; + setinds1 = tmpstruct1.setinds; + allinds2 = tmpstruct2.allinds; + setinds2 = tmpstruct2.setinds; + + % check if data is already here + % ----------------------------- + dataread = 0; + if isfield(tmpstruct1, 'pacdata') & strcmpi(opt.forceread, 'off') & strcmpi(opt.recompute, 'off') + if ~isempty(tmpstruct1.pacdata) & iscell(tmpstruct1.pacdata) & length(tmpstruct1.pacdata) >= opt.indices2(ind2) + if ~isempty(tmpstruct1.pacdata{opt.indices2(ind2)}) + %if isequal( STUDY.etc.pacparams.timerange, opt.timerange) & ... + % isequal( STUDY.etc.pacparams.freqrange, opt.freqrange) & ~isempty(tmpstruct.pacdata) + dataread = 1; + end; + end; + end; + + if ~dataread + + % reserve arrays + % -------------- +% pacarray = cell( max(length(STUDY.condition),1), max(length(STUDY.group),1) ); +% tmpind1 = 1; while(isempty(setinds{tmpind1})), tmpind1 = tmpind1+1; end; +% tmpind2 = 1; while(isempty(setinds{tmpind2})), tmpind2 = tmpind2+1; end; +% if ~isempty(opt.channels1) +% [ tmp allfreqs alltimes ] = std_readpac( ALLEEG, 'channels1' , setinds1{tmpind}(1), 'channels2' , setinds2{tmpind}(1), 'timerange', opt.timerange, 'freqrange', opt.freqrange); +% else [ tmp allfreqs alltimes ] = std_readpac( ALLEEG, 'components1', setinds1{tmpind}(1), 'components2', setinds2{tmpind}(1), 'timerange', opt.timerange, 'freqrange', opt.freqrange); +% end; +% for c = 1:nc +% for g = 1:ng +% pacarray{c, g} = repmat(zero, [length(alltimes), length(allfreqs), length(allinds1{c,g}) ]); +% end; +% end; + + % read the data and select channels + % --------------------------------- + fprintf('Reading all PAC data...\n'); + for c = 1:nc + for g = 1:ng + + % scan all subjects + count = 1; + for subj = 1:length(STUDY.subject) + + % get dataset indices for this subject + [inds1 inds2] = getsubjcomps(STUDY, subj, setinds1{c,g}, setinds2{c,g}); + if setinds1{c,g}(inds1) ~= setinds2{c,g}(inds2), error('Wrong subject index'); end; + if ~strcmpi(ALLEEG(setinds1{c,g}(inds1)).subject, STUDY.subject(subj)), error('Wrong subject index'); end; + + if ~isempty(inds1) & ~isempty(inds2) + if ~isempty(opt.channels1) + [pacarraytmp allfreqs alltimes] = std_pac( ALLEEG(setinds1{c,g}(subj)), 'channels1' , allinds1{c,g}(inds1), 'channels2', allinds2{c,g}(inds2), 'timerange', opt.timerange, 'freqrange', opt.freqrange, 'recompute', opt.recompute, moreopts{:}); + else [pacarraytmp allfreqs alltimes] = std_pac( ALLEEG(setinds1{c,g}(subj)), 'components1', allinds1{c,g}(inds1), 'components2', allinds2{c,g}(inds2), 'timerange', opt.timerange, 'freqrange', opt.freqrange, 'recompute', opt.recompute, moreopts{:}); + end; + + % collapse first 2 dimentions (comps x comps) + if ndims(pacarraytmp) == 4 + pacarraytmp = reshape(pacarraytmp, size(pacarraytmp,1)*size(pacarraytmp,2), size(pacarraytmp,3), size(pacarraytmp,4)); + else pacarraytmp = reshape(pacarraytmp, 1, size(pacarraytmp,1),size(pacarraytmp,2)); + end; + if strcmpi(opt.onepersubj, 'on') + pacarray{c, g}(:,:,count) = squeeze(mean(pacarraytmp,1)); + count = count+1; + else + for tmpi = 1:size(pacarraytmp,1) + pacarray{c, g}(:,:,count) = pacarraytmp(tmpi,:,:); + count = count+1; + end; + end; + end; + end; + end; + end; + + % copy data to structure + % ---------------------- + if ~isempty(opt.channels1) + STUDY.changrp(opt.indices1(ind1)).pacfreqs = allfreqs; + STUDY.changrp(opt.indices1(ind1)).pactimes = alltimes; + STUDY.changrp(opt.indices1(ind1)).pacdata{opt.indices2(ind2)} = pacarray; + else STUDY.cluster(opt.indices1(ind1)).pacfreqs = allfreqs; + STUDY.cluster(opt.indices1(ind1)).pactimes = alltimes; + STUDY.cluster(opt.indices1(ind1)).pacdata{opt.indices2(ind2)} = pacarray; + end; + end; + end; +end; + +% return structure +% ---------------- +if ~isempty(opt.channels1) + clustinfo = STUDY.changrp(opt.indices1); +else clustinfo = STUDY.cluster(opt.indices1); +end; + +% get components common to a given subject +% ---------------------------------------- +function [inds1 inds2] = getsubjcomps(STUDY, subj, setlist1, setlist2, complist1, complist2) + + inds1 = []; + inds2 = []; + datasets = strmatch(STUDY.subject{subj}, { STUDY.datasetinfo.subject } ); % all datasets of subject + [tmp1] = intersect_bc(setlist1, datasets); + [tmp2] = intersect_bc(setlist2, datasets); + if length(tmp1) > 1, error('This function does not support sessions for subjects'); end; + if length(tmp2) > 1, error('This function does not support sessions for subjects'); end; + if tmp1 ~= tmp2, error('Different datasets while it should be the same'); end; + if ~isempty(tmp1), inds1 = find(setlist1 == tmp1); end; + if ~isempty(tmp2), inds2 = find(setlist2 == tmp2); end; + + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readspec.m b/code/eeglab13_4_4b/functions/studyfunc/std_readspec.m new file mode 100644 index 0000000..a223170 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readspec.m @@ -0,0 +1,82 @@ +% std_readspec() - load spectrum measures for data channels or +% for all components of a specified cluster. +% Called by plotting functions +% std_envtopo(), std_erpplot(), std_erspplot(), ... +% Usage: +% >> [STUDY, specdata, allfreqs, setinds, cinds] = ... +% std_readspec(STUDY, ALLEEG, varargin); +% Inputs: +% STUDY - studyset structure containing some or all files in ALLEEG +% ALLEEG - vector of loaded EEG datasets +% +% Optional inputs: +% 'design' - [integer] read files from a specific STUDY design. Default +% is empty (use current design in STUDY.currentdesign). +% 'channels' - [cell] list of channels to import {default: none} +% 'clusters' - [integer] list of clusters to import {[]|default: all but +% the parent cluster (1) and any 'NotClust' clusters} +% 'singletrials' - ['on'|'off'] load single trials spectral data (if +% available). Default is 'off'. +% 'subject' - [string] select a specific subject {default:all} +% 'component' - [integer] select a specific component in a cluster +% {default:all} +% +% Spectrum specific inputs: +% 'freqrange' - [min max] frequency range {default: whole measure range} +% 'rmsubjmean' - ['on'|'off'] remove mean subject spectrum from every +% channel spectrum, making them easier to compare +% { default: 'off' } +% Output: +% STUDY - updated studyset structure +% specdata - [cell array] spectral data (the cell array size is +% condition x groups) +% freqs - [float array] array of frequencies +% setinds - [cell array] datasets indices +% cinds - [cell array] channel or component indices +% +% Example: +% std_precomp(STUDY, ALLEEG, { ALLEEG(1).chanlocs.labels }, 'spec', 'on'); +% [spec freqs] = std_readspec(STUDY, ALLEEG, 'channels', { ALLEEG(1).chanlocs(1).labels }); +% +% Author: Arnaud Delorme, CERCO, 2006- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, specdata, allfreqs] = std_readspec(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_readspec; + return; +end +if ~isstruct(ALLEEG) % old calling format + % old calling format + % ------------------ + EEG = STUDY(ALLEEG); + filename = fullfile(EEG.filepath, EEG.filename(1:end-4)); + comporchan = varargin{1}; + options = {'measure', 'spec'}; + if length(varargin) > 1, options = { options{:} 'freqlimits', varargin{2} }; end; + if comporchan(1) > 0 + [datavals tmp xvals] = std_readfile(filename, 'components',comporchan, options{:}); + else + [datavals tmp xvals] = std_readfile(filename, 'channels', comporchan, options{:}); + end; + STUDY = datavals'; + specdata = xvals; +end; + +[STUDY, specdata, allfreqs] = std_readerp(STUDY, ALLEEG, 'datatype', 'spec', varargin{:}); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readspecgram.m b/code/eeglab13_4_4b/functions/studyfunc/std_readspecgram.m new file mode 100644 index 0000000..5c3710d --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readspecgram.m @@ -0,0 +1,127 @@ +% std_readspecgram() - returns the stored mean power spectrogram for an ICA component +% or a data channel in a specified dataset. The spectrogram is +% assumed to have been saved in a Matlab file, +% "[dataset_name].datspecgram", in the same +% directory as the dataset file. If this file doesn't exist, +% use std_specgram() to create it. +% Usage: +% >> [spec, times, freqs] = std_readspecgram(ALLEEG, setindx, component, timerange, freqrange); +% +% Inputs: +% ALLEEG - a vector of dataset EEG structures (may also be one dataset). +% Must contain the dataset of interest (the 'setindx' below). +% setindx - [integer] an index of an EEG dataset in the ALLEEG +% structure for which to read a component spectrum. +% component - [integer] index of the component in the selected EEG dataset +% for which to return the spectrum +% freqrange - [min max in Hz] frequency range to return +% +% +% Outputs: +% spec - the log-power spectrum of the requested ICA component in the +% specified dataset (in dB) +% freqs - vector of spectral frequencies (in Hz) +% +% See also std_spec(), pop_preclust(), std_preclust() +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, February, 2008 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, October 11, 2004, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [X, t, f] = std_readspecgram(ALLEEG, abset, comp, timerange, freqrange, rmsubjmean); + +if nargin < 4 + timerange = []; +end; +if nargin < 5 + freqrange = []; +end; + +X = []; + +if iscell(comp) + % find channel indices list + % ------------------------- + chanind = []; + tmpchanlocs = ALLEEG(abset).chanlocs; + chanlabs = lower({ tmpchanlocs.labels }); + for index = 1:length(comp) + tmp = strmatch(lower(comp{index}), chanlabs, 'exact'); + if isempty(tmp) + error([ 'Channel ''' comp{index} ''' not found in dataset ' int2str(abset)]); + else + chanind = [ chanind tmp ]; + end; + end; + filename = fullfile( ALLEEG(abset).filepath,[ ALLEEG(abset).filename(1:end-3) 'datspecgram']); + prefix = 'chan'; + inds = chanind; +elseif comp(1) < 0 + filename = fullfile( ALLEEG(abset).filepath,[ ALLEEG(abset).filename(1:end-3) 'datspecgram']); + prefix = 'chan'; + inds = -comp; +else + filename = fullfile( ALLEEG(abset).filepath,[ ALLEEG(abset).filename(1:end-3) 'icaspecgram']); + prefix = 'comp'; + inds = comp; +end; + +for k=1:length(inds) + try, + warning backtrace off; + erpstruct = load( '-mat', filename, [ prefix int2str(inds(k)) ], 'freqs', 'times'); + warning backtrace on; + catch + error( [ 'Cannot read file ''' filename '''' ]); + end; + + tmpdat = getfield(erpstruct, [ prefix int2str(inds(k)) ]); + if k == 1 + X = zeros([size(tmpdat) length(comp)]); + end; + X(:,:,k) = tmpdat; + f = getfield(erpstruct, 'freqs'); + t = getfield(erpstruct, 'times'); +end; + +% select frequency range of interest +% ---------------------------------- +if ~isempty(freqrange) + maxind = max(find(f <= freqrange(end))); + minind = min(find(f >= freqrange(1))); +else + %if not, use whole spectrum + maxind = length(f); + minind = 1; +end +f = f(minind:maxind); +X = X(minind:maxind,:,:); + +% select time range of interest +% ----------------------------- +if ~isempty(timerange) + maxind = max(find(t <= timerange(end))); + minind = min(find(t >= timerange(1))); +else + %if not, use whole spectrum + maxind = length(t); + minind = 1; +end +t = t(minind:maxind); +X = X(:,minind:maxind,:); + +return; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readtopo.m b/code/eeglab13_4_4b/functions/studyfunc/std_readtopo.m new file mode 100644 index 0000000..6282617 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readtopo.m @@ -0,0 +1,153 @@ +% std_readtopo() - returns the scalp map of a specified ICA component, assumed +% to have been saved in a Matlab file, [dataset_name].icatopo, +% in the same directory as the dataset file. If this file does +% not exist, use std_topo() to create it, else a pre-clustering +% function that calls it: pop_preclust() or eeg_preclust(). +% Usage: +% >> [grid, y, x ] = std_readtopo(ALLEEG, setindx, component); +% >> [grid, y, x ] = std_readtopo(ALLEEG, setindx, component, transform, mode); +% +% Inputs: +% ALLEEG - vector of EEG datasets (can also be one EEG set). +% must contain the dataset of interest (see 'setindx' below). +% setindx - [integer] an index of an EEG dataset in the ALLEEG +% structure, for which to get the component ERP. +% component - [integer] index of the component for which the scalp map +% grid should be returned. +% transform - ['none'!'laplacian'|'gradient'] transform scalp map to +% laplacian or gradient map. Default is 'none'. +% mode - ['2dmap'|'preclust'] return either a 2-D array for direct +% plotting ('2dmap') or an array formated for preclustering +% with all the NaN values removed (ncomps x points). Default +% is '2dmap' for 1 component and 'preclust' for several. +% +% Outputs: +% grid - square scalp-map color-value grid for the requested ICA component +% in the specified dataset, an interpolated Cartesian grid as output +% by topoplot(). +% y - y-axis values for the interpolated grid +% x - x-axis values of the interpolated grid +% +% See also std_topo(), std_preclust() +% +% Authors: Arnaud Delorme, Hilit Serby, SCCN, INC, UCSD, February, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, October 11, 2004, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [X, yi, xi ] = std_readtopo(ALLEEG, abset, comps, option, mode) + +X = []; +yi = []; +xi = []; +if nargin < 4 + option = 'none'; +end; +if nargin < 5 + mode = '2Dmap'; +end; +filename = correctfile(fullfile( ALLEEG(abset).filepath,[ ALLEEG(abset).filename(1:end-3) 'icatopo'])); +tmpfile = which(filename); +if ~isempty(tmpfile), filename = tmpfile; end; + +% 061411, 2:51pm +% Modified by Joaquin +% while getfield(dir(filename), 'bytes') < 1000 +i = 1; +while getfield(dir(filename), 'bytes') < 1500 + topo = load( '-mat', filename); + filename = correctfile(topo.file, ALLEEG(abset).filepath); + tmpfile = which(filename); + if ~isempty(tmpfile), filename = tmpfile; end; + if(i>100) + error('too many attempts to find valid icatopo'); + end + i = i+1; +end; + +for k = 1:length(comps) + + if length(comps) < 3 + try + topo = load( '-mat', filename, ... + [ 'comp' int2str(comps(k)) '_grid'], ... + [ 'comp' int2str(comps(k)) '_x'], ... + [ 'comp' int2str(comps(k)) '_y'] ); + catch + error( [ 'Cannot read file ''' filename '''' ]); + end; + elseif k == 1 + try + topo = load( '-mat', filename); + catch + error([ 'Missing scalp topography file - also necessary for ERP polarity' 10 'Try recomputing scalp topographies for components' ]); + end; + end; + + try, + tmp = getfield(topo, [ 'comp' int2str(comps(k)) '_grid' ]); + catch, + error([ 'Empty scalp topography file - also necessary for ERP polarity' 10 'Try recomputing scalp topographies for components' ]); + end; + + if strcmpi(option, 'gradient') + [tmpx, tmpy] = gradient(tmp); % Gradient + tmp = tmpx; + tmp(:,:,2) = tmpy; + elseif strcmpi(option, 'laplacian') + tmp = del2(tmp); % Laplacian + end; + + if length(comps) > 1 | strcmpi(mode, 'preclust') + tmp = tmp(find(~isnan(tmp))); % remove NaN for more than 1 component + end; + if k == 1 + X = zeros([ length(comps) size(tmp) ]) ; + end + X(k,:,:,:) = tmp; + if k == 1 + yi = getfield(topo, [ 'comp' int2str(comps(k)) '_y']); + xi = getfield(topo, [ 'comp' int2str(comps(k)) '_x']); + end; +end +X = squeeze(X); + +return; + +function filename = correctfile(filename, datasetpath) + comp = computer; + if filename(2) == ':' & ~strcmpi(comp(1:2), 'PC') + filename = [filesep filename(4:end) ]; + filename(find(filename == '\')) = filesep; + end; + + if ~exist(filename) + [tmpp tmpf ext] = fileparts(filename); + if exist([tmpf ext]) + filename = [tmpf ext]; + else + [tmpp2 tmpp1] = fileparts(tmpp); + if exist(fullfile(tmpp1, [ tmpf ext ])) + filename = fullfile(tmpp1, [ tmpf ext ]); + else + filename = fullfile(datasetpath, [ tmpf ext ]); + if ~exist(filename) + error([ 'Cannot load file ''' [ tmpf ext ] '''' ]); + end; + end; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_readtopoclust.m b/code/eeglab13_4_4b/functions/studyfunc/std_readtopoclust.m new file mode 100644 index 0000000..668747e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_readtopoclust.m @@ -0,0 +1,120 @@ +% std_readtopoclust() - Compute and return cluster component scalp maps. +% Automatically inverts the polarity of component scalp maps +% to best match the polarity of the cluster mean scalp map. +% Usage: +% >> [STUDY clsstruct] = std_readtopoclust(STUDY, ALLEEG, clusters); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in +% the STUDY. +% clusters - cluster numbers to read. +% +% Outputs: +% STUDY - the input STUDY set structure with the computed mean cluster scalp +% map added (unless cluster scalp map means already exist in the STUDY) +% to allow quick replotting. +% clsstruct - STUDY.cluster structure array for the modified clusters. +% +% See also std_topoplot(), pop_clustedit() +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, 2007 + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, June 07, 2007, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, centroid] = std_readtopoclust(STUDY,ALLEEG, clsind); + +if nargin < 3 + help readtopoclust; + return; +end; + +if isempty(clsind) + for k = 2: length(STUDY.cluster) % don't include the ParentCluster + if ~strncmpi('Notclust',STUDY.cluster(k).name,8) + % don't include 'Notclust' clusters + clsind = [clsind k]; + end + end +end + + Ncond = length(STUDY.condition); +if Ncond == 0 + Ncond = 1; +end +centroid = cell(length(clsind),1); +fprintf('Computing the requested mean cluster scalp maps (only done once)\n'); +if ~isfield( STUDY.cluster, 'topo' ), STUDY.cluster(1).topo = []; end; +cond = 1; + +for clust = 1:length(clsind) %go over all requested clusters + + if isempty( STUDY.cluster(clsind(clust)).topo ) + + numitems = length(STUDY.cluster(clsind(clust)).comps); + + for k = 1:numitems % go through all components + comp = STUDY.cluster(clsind(clust)).comps(k); + abset = STUDY.cluster(clsind(clust)).sets(cond,k); + if ~isnan(comp) & ~isnan(abset) + [grid yi xi] = std_readtopo(ALLEEG, abset, comp); + if ~isfield(centroid{clust}, 'topotmp') || isempty(centroid{clust}.topotmp) + centroid{clust}.topotmp = zeros([ size(grid(1:4:end),2) numitems ]); + end; + centroid{clust}.topotmp(:,k) = grid(1:4:end); % for inversion + centroid{clust}.topo{k} = grid; + centroid{clust}.topox = xi; + centroid{clust}.topoy = yi; + end + end + fprintf('\n'); + + %update STUDY + tmpinds = find(isnan(centroid{clust}.topotmp(:,1))); + %centroid{clust}.topotmp(tmpinds,:) = []; + %for clust = 1:length(clsind) %go over all requested clusters + for cond = 1 + if clsind(1) > 0 + ncomp = length(STUDY.cluster(clsind(clust)).comps); + end; + [ tmp pol ] = std_comppol(centroid{clust}.topotmp); + fprintf('%d/%d polarities inverted while reading component scalp maps\n', ... + length(find(pol == -1)), length(pol)); + nitems = length(centroid{clust}.topo); + for k = 1:nitems + centroid{clust}.topo{k} = pol(k)*centroid{clust}.topo{k}; + if k == 1, allscalp = centroid{clust}.topo{k}/nitems; + else allscalp = centroid{clust}.topo{k}/nitems + allscalp; + end; + end; + STUDY.cluster(clsind(clust)).topox = centroid{clust}.topox; + STUDY.cluster(clsind(clust)).topoy = centroid{clust}.topoy; + STUDY.cluster(clsind(clust)).topoall = centroid{clust}.topo; + STUDY.cluster(clsind(clust)).topo = allscalp; + STUDY.cluster(clsind(clust)).topopol = pol; + end + %end + else + + centroid{clust}.topox = STUDY.cluster(clsind(clust)).topox; + centroid{clust}.topoy = STUDY.cluster(clsind(clust)).topoy; + centroid{clust}.topo = STUDY.cluster(clsind(clust)).topoall; + + end; + +end + +fprintf('\n'); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_rebuilddesign.m b/code/eeglab13_4_4b/functions/studyfunc/std_rebuilddesign.m new file mode 100644 index 0000000..e7be7fb --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_rebuilddesign.m @@ -0,0 +1,87 @@ +% std_rebuilddesign - reduild design structure when datasets have been +% removed or added. +% Usage: +% STUDY = std_rebuilddesign(STUDY, ALLEEG); +% STUDY = std_rebuilddesign(STUDY, ALLEEG, designind); +% +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% +% Optional inputs: +% designind - [integer>0] indices (number) of the design to rebuild. +% Default is all. +% Ouput: +% STUDY - updated EEGLAB STUDY set +% +% Author: Arnaud Delorme, Institute for Neural Computation UCSD, 2010- + +% Copyright (C) Arnaud Delorme, arno@ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_rebuilddesign(STUDY, ALLEEG, designind); + +if nargin < 2 + help std_rebuilddesign; + return; +end; + +if nargin < 3 + designind = 1:length(STUDY.design); +end; + +[indvars indvarvals] = std_getindvar(STUDY); +for indDesign = designind + + % find out if some independent variables or independent + % variable values have been removed + tmpdesign = STUDY.design(indDesign); + indVar1 = strmatch(tmpdesign.variable(1).label, indvars, 'exact'); + indVar2 = strmatch(tmpdesign.variable(2).label, indvars, 'exact'); + if isempty(indVar1) + tmpdesign.variable(1).label = ''; + tmpdesign.variable(1).value = {}; + else + tmpdesign.variable(1).value = myintersect( tmpdesign.variable(1).value, indvarvals{indVar1} ); + end; + if isempty(indVar2) + tmpdesign.variable(2).label = ''; + tmpdesign.variable(2).value = {}; + else + tmpdesign.variable(2).value = myintersect( tmpdesign.variable(2).value, indvarvals{indVar2} ); + end; + + STUDY = std_makedesign(STUDY, ALLEEG, indDesign, tmpdesign); +end; + +STUDY = std_selectdesign(STUDY, ALLEEG, STUDY.currentdesign); + +% take the intersection for independent variables +% ----------------------------------------------- +function a = myintersect(a,b); + + if isempty(b) || isempty(a), a = {}; return; end; + + for index = 1:length(a) + if isstr(a{index}) + a(index) = intersect_bc(a(index), b); + elseif iscell(a{index}) + a{index} = intersect_bc(a{index}, b); + elseif isnumeric(a{index}) + a{index} = intersect_bc(a{index}, [ b{:} ]); + end; + end; + \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_rejectoutliers.m b/code/eeglab13_4_4b/functions/studyfunc/std_rejectoutliers.m new file mode 100644 index 0000000..e498383 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_rejectoutliers.m @@ -0,0 +1,123 @@ +% std_rejectoutliers() - Commandline function, to reject outlier component(s) from clusters. +% Reassign the outlier component(s) to an outlier cluster specific to each cluster. +% Usage: +% >> [STUDY] = std_rejectoutliers(STUDY, ALLEEG, clusters, th); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in the STUDY. +% ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% Optional inputs: +% clusters - [numeric vector| 'all' ] specific cluster numbers (or 'all' clusters), which outliers +% will be rejected from. {default:'all'}. +% th - [number] a threshold factor to select outliers. How far a component can be from the +% cluster centroid (in the cluster std multiples) befor it will be considered as an outlier. +% Components that their distance from the cluster centroid are more than this factor +% times the cluster std (th *std) will be rejected. {default: 3}. +% +% Outputs: +% STUDY - the input STUDY set structure modified with the components reassignment, +% from the cluster to its outlier cluster. +% +% Example: +% >> clusters = [10 15]; th = 2; +% >> [STUDY] = std_rejectoutliers(STUDY, ALLEEG, clusters, th); +% Reject outlier components (that are more than 2 std from the cluster centroid) from cluster 10 and 15. +% +% See also pop_clustedit +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, July, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, July 11, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_rejectoutliers(STUDY, ALLEEG, varargin) + +cls = 2:length(STUDY.cluster); % all clusters in STUDY +th = 3; % The threshold factor - default: 3 + +if length(varargin) > 1 + if isnumeric(varargin{1}) + cls = varargin{1}; + if isempty(cls) + cls = 2:length(STUDY.cluster); + end + else + if isstr(varargin{1}) & strcmpi(varargin{1}, 'all') + cls = 2:length(STUDY.cluster); + else + error('std_prejectoutliers: clusters input takes either specific clusters (numeric vector) or keyword ''all''.'); + end + end +end +tmp =[]; +for k = 1: length(cls) + % don't include 'Notclust' clusters + if ~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8) & ~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13) + tmp = [tmp cls(k)]; + end +end +cls = tmp; +clear tmp + +if length(varargin) == 2 + if isnumeric(varargin{2}) + th = varargin{2}; + else + error('std_prejectoutliers: std input must be a numeric value.'); + end +end + +% Perform validity checks +for k = 1:length(cls) + % Cannot reject outlier components if cluster is a 'Notclust' or 'Outlier' cluster + if strncmpi('Notclust',STUDY.cluster(cls(k)).name,8) | strncmpi('Outliers',STUDY.cluster(cls(k)).name,8) | ... + strncmpi('ParentCluster', STUDY.cluster(cls(k)).name,13) + warndlg2('Cannot reject outlier components from a Notclust or Outliers cluster'); + return; + end + % Cannot reject outlier components if cluster has children clusters + if ~isempty(STUDY.cluster(cls(k)).child) + warndlg2('Cannot reject outlier components if cluster has children clusters.'); + return; + end + + % If the PCA data matrix of the cluster components is empty (case of merged cluster) + if isempty(STUDY.cluster(cls(k)).preclust.preclustdata) % No preclustering information + warndlg2('Cannot reject outlier components if cluster was not a part of pre-clustering.'); + return; + end +end + +% For each of the clusters reject outlier components +for k = 1:length(cls) + % The PCA data matrix of the cluster components + clsPCA = STUDY.cluster(cls(k)).preclust.preclustdata; + % The cluster centroid + clsCentr = mean(clsPCA,1); + % The std of the cluster (based on the distances between all cluster components to the cluster centroid). + std_std = std(sum((clsPCA-ones(size(clsPCA,1),1)*clsCentr).^2,2),1); + outliers = []; + for l = 1:length(STUDY.cluster(cls(k)).comps) + compdist = sum((clsPCA(l,:) - clsCentr).^2); % Component distance from cluster centroid + if compdist > std_std * th % check if an outlier + outliers = [ outliers l]; + end + end + % Move outlier to the outlier cluster + if ~isempty(outliers) % reject outliers if exist + STUDY = std_moveoutlier(STUDY, ALLEEG,cls(k) , outliers); + end +end diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_renameclust.m b/code/eeglab13_4_4b/functions/studyfunc/std_renameclust.m new file mode 100644 index 0000000..54c6fd9 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_renameclust.m @@ -0,0 +1,86 @@ +% std_renameclust() - Commandline function, to rename clusters using specified (mnemonic) names. +% Usage: +% >> [STUDY] = std_renameclust(STUDY, ALLEEG, cluster, new_name); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in the STUDY. +% ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% cluster - single cluster number. +% new_name - [string] mnemonic cluster name. +% +% Outputs: +% STUDY - the input STUDY set structure modified according to specified new cluster name. +% +% Example: +% >> cluster = 7; new_name = 'artifacts'; +% >> [STUDY] = std_renameclust(STUDY,ALLEEG, cluster, new_name); +% Cluster 7 name (i.e.: STUDY.cluster(7).name) will change to 'artifacts 7'. +% +% See also pop_clustedit +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 07, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_renameclust(STUDY, ALLEEG, cls, new_name) + +if ~exist('cls') + error('std_renameclust: you must provide a cluster number to rename.'); +end +if isempty(cls) + error('std_renameclust: you must provide a cluster number to rename.'); +end +if ~exist('new_name') + error('std_renameclust: you must provide a new cluster name.'); +end +if strncmpi('Notclust',STUDY.cluster(cls).name,8) % Don't rename Notclust 'clusters' + warndlg2('std_renameclust: Notclust cannot be renamed'); + return; +end + +ti = strfind(STUDY.cluster(cls).name, ' '); +clus_id = STUDY.cluster(cls).name(ti(end) + 1:end); +new_name = sprintf('%s %s', new_name, clus_id); +% If the cluster have children cluster update their parent cluster name to the +% new cluster. +if ~isempty(STUDY.cluster(cls).child) + for k = 1:length(STUDY.cluster(cls).child) + child_cls = STUDY.cluster(cls).child{k}; + child_id = find(strcmp({STUDY.cluster.name},child_cls)); + parent_id = find(strcmp(STUDY.cluster(child_id).parent,STUDY.cluster(cls).name)); + STUDY.cluster(child_id).parent{parent_id} = new_name; + end +end +% If the cluster has parent clusters, update the parent clusters with the +% new cluster name of child cluster. +if ~isempty(STUDY.cluster(cls).parent) + for k = 1:length(STUDY.cluster(cls).parent) + parent_cls = STUDY.cluster(cls).parent{k}; + parent_id = find(strcmp({STUDY.cluster.name},parent_cls)); + STUDY.cluster(parent_id).child{find(strcmp(STUDY.cluster(parent_id).child,STUDY.cluster(cls).name))} = new_name; + end +end +% If the cluster have an Outlier cluster, update the Outlier cluster name. +outlier_clust = std_findoutlierclust(STUDY,cls); %find the outlier cluster for this cluster +if outlier_clust ~= 0 + ti = strfind(STUDY.cluster(outlier_clust).name, ' '); + clus_id = STUDY.cluster(outlier_clust).name(ti(end) + 1:end); + STUDY.cluster(outlier_clust).name = sprintf('Outliers %s %s', new_name, clus_id); +end + +% Rename cluster +STUDY.cluster(cls).name = new_name; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_renamestudyfiles.m b/code/eeglab13_4_4b/functions/studyfunc/std_renamestudyfiles.m new file mode 100644 index 0000000..fdd3536 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_renamestudyfiles.m @@ -0,0 +1,81 @@ +% std_renamestudyfiles() - rename files for design 1 if necessary. In design +% 1, for backward compatibility, files could have +% legacy names. For consistency these files now +% need to be renamed. Note that the STUDY is +% automatically resave on disk to avoid any potential +% inconsistency. +% +% Usage: +% >> STUDY = std_renamestudyfiles(STUDY, ALLEEG) +% +% Inputs: +% STUDY - EEGLAB STUDY set +% ALLEEG - vector of the EEG datasets included in the STUDY structure +% +% Output: +% STUDY - The input STUDY with new design files. +% +% Author: Arnaud Delorme, Institute for Neural Computation UCSD, 2013- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_renamestudyfiles(STUDY, ALLEEG) + +if nargin < 2 + help std_renamestudyfiles; + return; +end; + +STUDY2 = std_makedesign(STUDY, ALLEEG, 1, STUDY.design(1), 'defaultdesign', 'forceoff', 'verbose', 'off'); +allCell1 = { STUDY.design(1).cell.filebase }; +allCell2 = { STUDY2.design(1).cell.filebase }; + +fileExtensions = { 'daterp' 'datspec' 'datersp' 'daterpim' 'dattimef' 'datitc' 'daterpim' ... + 'icaerp' 'icaspec' 'icaersp' 'icaerpim' 'icatimef' 'icaitc' 'icaerpim' }; + +if ~isequal(allCell1, allCell2) + + thereIsAFileNotDesign = false; + for index = 1:length(allCell1), if length(allCell1{index}) < 6 || all(allCell1{index}(1:6) == 'design'), thereIsAFileNotDesign = true; end; end; + for index = 1:length(allCell1), if length(allCell1{index}) < 6 || all(allCell1{index}(1:6) == 'design'), thereIsAFileNotDesign = true; end; end; + + if thereIsAFileNotDesign + res = questdlg2(['Old STUDY design data files have been detected.' 10 ... + 'EEGLAB wants to rename these files to improve consistency' 10 ... + 'and stability. No dataset will be renamed, only preprocessed' 10 ... + 'STUDY data files.' ], 'Rename STUDY data files', 'Cancel', ... + 'Rename', 'Rename'); + + if strcmpi(res, 'rename') + STUDY = pop_savestudy(STUDY, ALLEEG, 'savemode', 'resave'); + for iCell = 1:length(allCell1) + + % scan file extensions + for iExt = 1:length(fileExtensions) + files = dir( [ allCell1{iCell} '.' fileExtensions{iExt} ]); + if ~isempty(files) && ~strcmpi(allCell1{iCell}, allCell2{iCell}) + movefile( [ allCell1{iCell} '.' fileExtensions{iExt} ], ... + [ allCell2{iCell} '.' fileExtensions{iExt} ]); + disp([ 'Moving ' [ allCell1{iCell} '.' fileExtensions{iExt} ] ' to ' [ allCell2{iCell} '.' fileExtensions{iExt} ] ]); + end; + end; + end; + STUDY = STUDY2; + STUDY = pop_savestudy(STUDY, ALLEEG, 'savemode', 'resave'); + end; + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_reset.m b/code/eeglab13_4_4b/functions/studyfunc/std_reset.m new file mode 100644 index 0000000..e0062b6 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_reset.m @@ -0,0 +1,48 @@ +% std_reset() - Remove all preloaded measures from STUDY +% +% Usage: +% >> STUDY = std_reset(STUDY); +% +% Inputs: +% STUDY - EEGLAB STUDY structure +% +% Outputs: +% STUDY - EEGLAB STUDY structure +% +% Author: Arnaud Delorme, CERCO/CNRS & SCCN, INC, UCSD, 2009- + +% Copyright (C) Arnaud Delorme, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_reset(STUDY) + +if nargin < 1 + help std_reset; + return; +end; + +fields = { 'erpdata' 'erptimes' 'specdata' 'specfreqs' 'erspdata' ... + 'ersptimes' 'erspfreqs' 'itcdata' 'itctimes' 'itcfreqs' ... + 'topo' 'topox' 'topoy' 'topoall' 'topopol' 'dipole' }; +for ind = 1:length(fields) + if isfield(STUDY.cluster, fields{ind}) + STUDY.cluster = rmfield(STUDY.cluster, fields{ind}); + end; + if isfield(STUDY, 'changrp') + if isfield(STUDY.changrp, fields{ind}) + STUDY.changrp = rmfield(STUDY.changrp, fields{ind}); + end; + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_rmalldatafields.m b/code/eeglab13_4_4b/functions/studyfunc/std_rmalldatafields.m new file mode 100644 index 0000000..897fd5c --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_rmalldatafields.m @@ -0,0 +1,63 @@ +% std_rmalldatafields - remove all data fields from STUDY (before saving +% it for instance. +% +% Usage: +% STUDY = std_rmalldatafields(STUDY, type); +% +% Input: +% STUDY - EEGLAB study structure +% +% Optional input: +% type - ['chan'|'clust'|'both'] remove from changrp channel location +% structure, cluster structure or both. Default is 'both'. +% +% Ouput: +% STUDY - updated EEGLAB study structure +% +% Author: Arnaud Delorme, CERCO/CNRS, UCSD, 2010- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_rmalldatafields(STUDY, chanorcomp); + +if nargin < 1 + help std_rmalldatafields; + return; +end; +if nargin < 2 + chanorcomp = 'both'; +end; + +fields = { 'erpdata' 'erptimes' 'erpdatatrials' 'erptrialinfo' ... + 'specdata' 'specfreqs' 'specdatatrials' 'spectrialinfo' ... + 'erspdata' 'erspbase' 'erspfreqs' 'ersptimes' 'erspdatatrials' 'ersptrialinfo' ... + 'topo' 'topox' 'topoy' 'topoall' 'topopol' ... + 'itcdata' 'itcfreqs' 'itctimes' 'itcdatatrials' 'itctrialinfo' ... + 'erpimdata' 'erpimtrials' 'erpimevents' 'erpimtimes' 'erspsubjinds' 'itcsubjinds' 'dipoles' ... + 'data' 'datatimes' 'datasortvals' 'datacontinds' 'centroid' }; +for ff = 1:length(fields) + if strcmpi(chanorcomp, 'data') || strcmpi(chanorcomp, 'both') + if isfield(STUDY.changrp, fields{ff}) + STUDY.changrp = rmfield(STUDY.changrp, fields{ff} ); + end; + end; + if strcmpi(chanorcomp, 'clust') || strcmpi(chanorcomp, 'both') + if isfield(STUDY.cluster, fields{ff}) + STUDY.cluster = rmfield(STUDY.cluster, fields{ff} ); + end; + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_savedat.m b/code/eeglab13_4_4b/functions/studyfunc/std_savedat.m new file mode 100644 index 0000000..614c893 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_savedat.m @@ -0,0 +1,48 @@ +% std_savedat() - save measure for computed data +% +% Usage: std_savedat( filename, structure); +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, 2006- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function std_savedat( tmpfile, structure) + + delims = find( tmpfile == '.'); + if ~isfield(structure, 'datafile') && ~isfield(structure, 'datafiles') + structure.datafile = [ tmpfile(1:delims(end)-1) '.set' ]; + end; + + % fix reading problem (bug 764) + tmpfile2 = which(tmpfile); + if isempty(tmpfile2), tmpfile2 = tmpfile; end; + tmpfile = tmpfile2; + + eeglab_options; + if option_saveversion6 + try + save('-v6' , tmpfile, '-struct', 'structure'); + catch + fields = fieldnames(structure); + for i=1:length(fields) + eval([ fields{i} '=structure.' fields{i} ';']); + end; + save('-mat', tmpfile, fields{:}); + end; + else + save('-v7.3' , tmpfile, '-struct', 'structure'); + end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_selcomp.m b/code/eeglab13_4_4b/functions/studyfunc/std_selcomp.m new file mode 100644 index 0000000..b479173 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_selcomp.m @@ -0,0 +1,88 @@ +% std_selcomp() - Helper function for std_erpplot(), std_specplot() +% and std_erspplot() to select specific +% components prior to plotting. +% Usage: +% >> std_selcomp( STUDY, data, cluster, setinds, compinds, comps) +% +% Inputs: +% STUDY - EEGLAB STUDY structure. +% data - [cell array] mean data for each subject group and/or data +% condition. For example, to compute mean ERPs statistics from a +% STUDY for epochs of 800 frames in two conditions from three +% groups of 12 subjects, +% >> data = { [800x12] [800x12] [800x12];... % 3 groups, cond 1 +% [800x12] [800x12] [800x12] }; % 3 groups, cond 2 +% cluster - [integer] cluster index +% setinds - [cell array] set indices for each of the last dimension of the +% data cell array. +% >> setinds = { [12] [12] [12];... % 3 groups, cond 1 +% [12] [12] [12] }; % 3 groups, cond 2 +% compinds - [cell array] component indices for each of the last dimension +% of the data cell array. +% >> compinds = { [12] [12] [12];... % 3 groups, cond 1 +% [12] [12] [12] }; % 3 groups, cond 2 +% comps - [integer] find and select specific component index in array +% +% Output: +% data - [cell array] data array with the subject or component selected +% subject - [string] subject name (for component selection) +% comp_names - [cell array] component names (for component selection) +% +% Author: Arnaud Delorme, CERCO, CNRS, 2006- +% +% See also: std_erpplot(), std_specplot() and std_erspplot() + +function [data, subject, comp_names] = std_selcomp(STUDY, data, clust, setinds, compinds, compsel) + +if nargin < 2 + help std_selcomp; + return; +end; + +optndims = ndims(data{1}); +comp_names = {}; +subject = ''; + +% find and select group +% --------------------- +if isempty(compsel), return; end; +sets = STUDY.cluster(clust).sets(:,compsel); +comps = STUDY.cluster(clust).comps(compsel); +%grp = STUDY.datasetinfo(sets(1)).group; +%grpind = strmatch( grp, STUDY.group ); +%if isempty(grpind), grpind = 1; end; +%data = data(:,grpind); + +% find component +% -------------- +for c = 1:length(data(:)) + rminds = 1:size(data{c},optndims); + + for ind = length(compinds{c}):-1:1 + setindex = STUDY.design(STUDY.currentdesign).cell(setinds{c}(ind)).dataset; + if compinds{c}(ind) == comps && any(setindex == sets) + rminds(ind) = []; + end; + end; + + if optndims == 2 + data{c}(:,rminds) = []; %2-D + elseif optndims == 3 + data{c}(:,:,rminds) = []; %3-D + else + data{c}(:,:,:,rminds) = []; %3-D + end; + comp_names{c,1} = comps; +end; +% for c = 1:size(data,1) +% for ind = 1:length(compinds{1,grpind}) +% if compinds{1,grpind}(ind) == comps & any(setinds{1,grpind}(ind) == sets) +% if optndims == 2 +% data{c} = data{c}(:,ind); +% else data{c} = data{c}(:,:,ind); +% end; +% comp_names{c,1} = comps; +% end; +% end; +% end; +subject = STUDY.datasetinfo(sets(1)).subject; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_selectdataset.m b/code/eeglab13_4_4b/functions/studyfunc/std_selectdataset.m new file mode 100644 index 0000000..9102ac2 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_selectdataset.m @@ -0,0 +1,94 @@ +% std_selectdataset() - select datasets and trials for a given independent +% variable with a given set of values. +% +% Usage: +% >> [STUDY] = std_selectdataset(STUDY, ALLEEG, indvar, indvarvals); +% +% Inputs: +% STUDY - EELAB STUDY structure +% ALLEEG - EELAB dataset structure +% indvar - [string] independent variable name +% indvarvals - [cell] cell array of string for selected values for the +% verboseflag - ['verbose'|'silent'] print info flag +% +% choosen independent variable +% Output: +% datind - [integer array] indices of selected dataset +% dattrialsind - [cell] trial indices for each dataset (not only the +% datasets selected above). +% +% Author: Arnaud Delorme, CERCO, 2010- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [datind, dattrialselect] = std_selectdataset(STUDY, ALLEEG, indvar, indvarvals, verboseFlag); + +if nargin < 3 + help std_selectdataset; + return; +end; +if nargin < 5 + verboseFlag = 'verbose'; +end; + +% check for multiple condition selection +if ~iscell(indvarvals), + pos = findstr(' - ', indvarvals); + if ~isempty(pos) + tmpindvar = indvarvals; + indvarvals = { indvarvals(1:pos(1)-1) }; + pos(end+1) = length(tmpindvar)+1; + for ind = 1:length(pos)-1 + indvarvals{end+1} = tmpindvar(pos(ind)+3:pos(ind+1)-1); + end; + else + indvarvals = { indvarvals }; + end; +end; + +% default dattrialselect = all trials +% ----------------------------------- +if isfield(STUDY.datasetinfo, 'trialinfo') + dattrialselect = cellfun(@(x)([1:length(x)]), { STUDY.datasetinfo.trialinfo }, 'uniformoutput', false); +else for i=1:length(ALLEEG), dattrialselect{i} = [1:ALLEEG(i).trials]; end; +end; + +if isempty(indvar) + datind = [1:length(STUDY.datasetinfo)]; +elseif isfield(STUDY.datasetinfo, indvar) && ~isempty(getfield(STUDY.datasetinfo(1), indvar)) + % regular selection of dataset in datasetinfo + % ------------------------------------------- + if strcmpi(verboseFlag, 'verbose'), fprintf(' Selecting datasets with field ''%s'' equal to %s\n', indvar, vararg2str(indvarvals)); end; + eval( [ 'myfieldvals = { STUDY.datasetinfo.' indvar '};' ] ); + datind = []; + for dat = 1:length(indvarvals) + datind = union_bc(datind, std_indvarmatch(indvarvals{dat}, myfieldvals)); + end; +else + % selection of trials within datasets + % ----------------------------------- + if strcmpi(verboseFlag, 'verbose'), fprintf(' Selecting trials with field ''%s'' equal to %s\n', indvar, vararg2str(indvarvals)); end; + dattrials = cellfun(@(x)(eval(['{ x.' indvar '}'])), { STUDY.datasetinfo.trialinfo }, 'uniformoutput', false); + dattrials = cellfun(@(x)(eval(['{ x.' indvar '}'])), { STUDY.datasetinfo.trialinfo }, 'uniformoutput', false); % do not remove duplicate line (or Matlab crashes) + dattrialselect = cell(1,length(STUDY.datasetinfo)); + for dat = 1:length(indvarvals) + for tmpi = 1:length(dattrials) + dattrialselect{tmpi} = union_bc(dattrialselect{tmpi}, std_indvarmatch(indvarvals{dat}, dattrials{tmpi})); + end; + end; + datind = find(~cellfun(@isempty, dattrialselect)); +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_selectdesign.m b/code/eeglab13_4_4b/functions/studyfunc/std_selectdesign.m new file mode 100644 index 0000000..ecd7e0e --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_selectdesign.m @@ -0,0 +1,57 @@ +% std_selectdesign() - select an existing STUDY design. +% Use std_makedesign() to add a new STUDY.design. +% +% Usage: +% >> [STUDY] = std_selectdesign(STUDY, ALLEEG, designind); +% +% Inputs: +% STUDY - EEGLAB STUDY structure +% STUDY - EEGLAB ALLEEG structure +% designind - desired (existing) design index +% +% Outputs: +% STUDY - EEGLAB STUDY structure with currentdesign set to the input design index. +% +% Author: Arnaud Delorme, Institute for Neural Computation, UCSD, 2010- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_selectdesign(STUDY, ALLEEG, designind); + +if nargin < 3 + help std_selectdesign; + return; +end; + +if designind < 1 || designind > length(STUDY.design) || isempty(STUDY.design(designind).name) + disp('Cannot select an empty STUDY.design'); + return; +end; +STUDY.currentdesign = designind; +STUDY = std_rmalldatafields( STUDY ); + +% remake setinds and allinds +% -------------------------- +STUDY = std_changroup(STUDY, ALLEEG, [], 'on'); % with interpolation HAVE TO FIX THAT + +% update the component indices +% ---------------------------- +STUDY.cluster(1).setinds = {}; +STUDY.cluster(1).allinds = {}; +for index = 1:length(STUDY.cluster) + STUDY.cluster(index) = std_setcomps2cell(STUDY, index); +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_selsubject.m b/code/eeglab13_4_4b/functions/studyfunc/std_selsubject.m new file mode 100644 index 0000000..787b1d3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_selsubject.m @@ -0,0 +1,76 @@ +% std_selsubject() - Helper function for std_erpplot(), std_specplot() +% and std_erspplot() to select specific subject when +% plotting channel data. +% Usage: +% >> data = std_selsubject( data, subject, setinds, allsubjects); +% +% Inputs: +% data - [cell array] mean data for each subject group and/or data +% condition. For example, to compute mean ERPs statistics from a +% STUDY for epochs of 800 frames in two conditions from three +% groups of 12 subjects, +% >> data = { [800x12] [800x12] [800x12];... % 3 groups, cond 1 +% [800x12] [800x12] [800x12] }; % 3 groups, cond 2 +% subject - [string] subject name +% setinds - [cell array] set indices for each of the last dimension of the +% data cell array. +% >> setinds = { [12] [12] [12];... % 3 groups, cond 1 +% [12] [12] [12] }; % 3 groups, cond 2 +% allsubject - [cell array] all subjects (same order as in +% STUDY.datasetinfo) +% +% Output: +% data - [cell array] data array with the subject or component selected +% +% Author: Arnaud Delorme, CERCO, CNRS, 2006- +% +% See also: std_erpplot(), std_specplot() and std_erspplot() + +function [data] = std_selsubject(data, subject, setinds, allsubjects, optndims); + +if nargin < 2 + help std_selsubject; + return; +end; + +optndims = max(optndims, ndims(data{1})); +if isempty(strmatch(lower(subject), lower(allsubjects))) + error(sprintf('Cannot select subject %s in list %s', subject, vararg2str({ allsubjects }))); +end; + +% plot specific subject +% --------------------- +if size(setinds{1},1) > 1 && size(setinds{1},2) > 1 % single trials + % possible subject indices + selectInds = strmatch(lower(subject), lower(allsubjects)); + for c = 1:size(data,1) + for g = 1:size(data,2) + selectCol = []; + for ind = 1:length(selectInds) + selectCol = [ selectCol find(setinds{c,g} == selectInds') ]; + end; + if optndims == 2 + data{c,g} = data{c,g}(:,selectCol); %2-D + elseif optndims == 3 + data{c,g} = data{c,g}(:,:,selectCol); %3-D + else + data{c,g} = data{c,g}(:,:,:,selectCol); %4-D + end; + end; + end; +else + for c = 1:size(data,1) + for g = 1:size(data,2) + subjectind = strmatch(lower(subject), lower(allsubjects)); + l = zeros(size(setinds{c,g})); + for iSubj = 1:length(subjectind), l = l | setinds{c,g} == subjectind(iSubj); end; + if optndims == 2 + data{c,g}(:,~l) = []; %2-D + elseif optndims == 3 + data{c,g}(:,:,~l) = []; %3-D + else + data{c,g}(:,:,:,~l) = []; %4-D + end; + end; + end; +end; \ No newline at end of file diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_setcomps2cell.m b/code/eeglab13_4_4b/functions/studyfunc/std_setcomps2cell.m new file mode 100644 index 0000000..8cc89cf --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_setcomps2cell.m @@ -0,0 +1,99 @@ +% std_setcomps2cell - convert .sets and .comps to cell array. The .sets and +% .comps format is useful for GUI but the cell array +% format is used for plotting and statistics. +% +% Usage: +% [ struct setinds allinds ] = std_setcomps2cell(STUDY, clustind); +% [ struct setinds allinds ] = std_setcomps2cell(STUDY, sets, comps); +% [ struct setinds allinds measurecell] = std_setcomps2cell(STUDY, sets, comps, measure); +% +% Author: Arnaud Delorme, CERCO/CNRS, UCSD, 2009- + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ tmpstruct setinds allinds measurecell] = std_setcomps2cell(STUDY, sets, comps, measure, generateerror) + +if nargin < 5 + generateerror = 0; +end; +if nargin == 4 && length(measure) == 1 + generateerror = measure; + measure = []; +end; +if nargin < 3 + tmpstruct = STUDY.cluster(sets); + sets = tmpstruct.sets; + comps = tmpstruct.comps; % old format +else + tmpstruct = []; +end; +if nargin < 4 || isempty(measure) + measure = comps; +end; +measure = repmat(measure, [size(sets,1) 1]); +comps = repmat(comps , [size(sets,1) 1]); +oldsets = sets; +sets = reshape(sets , 1, size(sets ,1)*size(sets ,2)); +measure = reshape(measure, 1, size(measure,1)*size(measure,2)); +comps = reshape(comps , 1, size(comps ,1)*size(comps ,2)); + +% get indices for all groups and conditions +% ----------------------------------------- +setinfo = STUDY.design(STUDY.currentdesign).cell; +allconditions = STUDY.design(STUDY.currentdesign).variable(1).value; +allgroups = STUDY.design(STUDY.currentdesign).variable(2).value; +nc = max(length(allconditions),1); +ng = max(length(allgroups), 1); +allinds = cell( nc, ng ); +setinds = cell( nc, ng ); +measurecell = cell( nc, ng ); + +for index = 1:length(setinfo) + % get index of independent variables + % ---------------------------------- + condind = std_indvarmatch( setinfo(index).value{1}, allconditions); + grpind = std_indvarmatch( setinfo(index).value{2}, allgroups ); + if isempty(allconditions), condind = 1; end; + if isempty(allgroups), grpind = 1; end; + + % get the position in sets where the dataset is + % if several datasets check that they all have the same + % ICA and component index + % ----------------------- + datind = setinfo(index).dataset; + ind = find(datind(1) == sets); + if ~isempty(ind) && length(datind) > 1 + [ind1 ind2] = find(datind(1) == oldsets); + columnica = oldsets(:,ind2(1)); + if ~all(ismember(datind, columnica)); + disp('Warning: STUDY design combines datasets with different ICA - use ICA only for artifact rejection'); + end; + end; + + measurecell{ condind, grpind } = [ measurecell{ condind, grpind } measure(ind) ]; + allinds{ condind, grpind } = [ allinds{ condind, grpind } comps( ind) ]; + setinds{ condind, grpind } = [ setinds{ condind, grpind } repmat(index, [1 length(ind)]) ]; +end; +tmpstruct.allinds = allinds; +tmpstruct.setinds = setinds; + +if generateerror && isempty(setinds{1}) + error( [ 'Some datasets not included in preclustering' 10 ... + 'because of partial STUDY design. You need to' 10 ... + 'use a STUDY design that includes all datasets.' ]); +end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_spec.m b/code/eeglab13_4_4b/functions/studyfunc/std_spec.m new file mode 100644 index 0000000..fd41d2c --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_spec.m @@ -0,0 +1,379 @@ +% std_spec() - Returns the ICA component spectra for a dataset. Updates the EEG structure +% in the Matlab environment and in the .set file as well. Saves the spectra +% in a file. +% Usage: +% >> [spec freqs] = std_spec(EEG, 'key', 'val', ...); +% +% Computes the mean spectra of the activites of specified components of the +% supplied dataset. The spectra are saved in a Matlab file. If such a file +% already exists, loads the spectral information from this file. +% Options (below) specify which components to use, and the desired frequency +% range. There is also an option to specify other spectopo() input variables +% (see >> help spectopo for details). +% +% Returns the removed mean spectra of the selected ICA components in the +% requested frequency range. If the spectra were computed previously but a +% different frequency range is selected, there is an overwrite option. +% so. The function will load previously computed log spectra, if any, and +% will remove the mean from the requested frequency range. The frequencies +% vector is also returned. +% Inputs: +% EEG - a loaded epoched EEG dataset structure. +% +% Optional inputs: +% 'components' - [numeric vector] components of the EEG structure for which +% activation spectrum will be computed. Note that because +% computation of ERP is so fast, all components spectrum are +% computed and saved. Only selected component +% are returned by the function to Matlab +% {default|[] -> all} +% 'channels' - [cell array] channels of the EEG structure for which +% activation spectrum will be computed. Note that because +% computation of ERP is so fast, all channels spectrum are +% computed and saved. Only selected channels +% are returned by the function to Matlab +% {default|[] -> none} +% 'recompute' - ['on'|'off'] force recomputing ERP file even if it is +% already on disk. +% 'trialindices' - [cell array] indices of trials for each dataset. +% Default is all trials. +% 'recompute' - ['on'|'off'] force recomputing data file even if it is +% already on disk. +% 'rmcomps' - [integer array] remove artifactual components (this entry +% is ignored when plotting components). This entry contains +% the indices of the components to be removed. Default is none. +% 'interp' - [struct] channel location structure containing electrode +% to interpolate ((this entry is ignored when plotting +% components). Default is no interpolation. +% 'fileout' - [string] name of the file to save on disk. The default +% is the same name (with a different extension) as the +% dataset given as input. +% 'savetrials' - ['on'|'off'] save single-trials ERSP. Requires a lot of disk +% space (dataset space on disk times 10) but allow for refined +% single-trial statistics. +% +% spectrum specific optional inputs: +% 'specmode' - ['psd'|'fft'|'pburg'|'pmtm'] method to compute spectral +% decomposition. 'psd' uses the spectopo function (optional +% parameters to this function may be given as input). 'fft' +% uses a simple fft on each trial. For continuous data +% data trials are extracted automatically (see 'epochlim' +% and 'epochrecur' below). Two experimental modes are +% 'pmtm' and 'pbug' which use multitaper and the Burg +% method to compute spectrum respectively. NOTE THAT SOME +% OF THESE OPTIONS REQUIRE THE SIGNAL PROCESSING TOOLBOX. +% 'epochlim' - [min max] for FFT on continuous data, extract data +% epochs with specific epoch limits in seconds (see also +% 'epochrecur' below). Default is [0 1]. +% 'epochrecur' - [float] for FFT on continuous data, set the automatic +% epoch extraction recurence interval (default is 0.5 second). +% 'timerange' - [min max] use data within a specific time range before +% computing the data spectrum. For instance, for evoked +% data trials, it is recommended to use the baseline time +% period. +% 'logtrials' - ['on'|'off'] compute single-trial log transform before +% averaging them. Default is 'off' for 'psd' specmode and +% 'on' for 'fft' specmode. +% 'continuous' - ['on'|'off'] force epoch data to be treated as +% continuous so small data epochs can be extracted for the +% 'fft' specmode option. Default is 'off'. +% 'freqrange' - [minhz maxhz] frequency range (in Hz) within which to +% return the spectrum {default|[]: [0 sample rate/2]}. +% Note that this does not affect the spectrum computed on +% disk, only the data returned by this function as output. +% 'nw' - [integer] number of tapers for the 'pmtm' spectral +% method. Default is 4. +% 'burgorder' - [integet] order for the Burg spectral method. +% +% Other optional spectral parameters: +% All optional parameters to the spectopo function may be provided to this +% function as well (requires the 'specmode' option above to be set to +% 'psd'). +% +% Outputs: +% spec - the mean spectra (in dB) of the requested ICA components in the selected +% frequency range (with the mean of each spectrum removed). +% freqs - a vector of frequencies at which the spectra have been computed. +% +% Files output or overwritten for ICA: +% [dataset_filename].icaspec, % raw spectrum of ICA components +% Files output or overwritten for data: +% [dataset_filename].datspec, +% +% See also spectopo(), std_erp(), std_ersp(), std_map(), std_preclust() +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, January, 2005 + +% Defunct: 0 -> if frequency range is different from saved spectra, ask via a +% pop-up window whether to keep existing spectra or to overwrite them. + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [X, f, overwrt] = std_spec(EEG, varargin) + +overwrt = 1; % deprecated +if nargin < 1 + help std_spec; + return; +end; + +% decode inputs +% ------------- +if ~isempty(varargin) + if ~isstr(varargin{1}) + varargin = { varargin{:} [] [] }; + if all(varargin{1} > 0) + options = { 'components' varargin{1} 'freqrange' varargin{2} }; + else + options = { 'channels' -varargin{1} 'freqrange' varargin{2} }; + end; + else + options = varargin; + end; +else + options = varargin; +end; + +[g spec_opt] = finputcheck(options, { 'components' 'integer' [] []; + 'channels' 'cell' {} {}; + 'timerange' 'float' [] []; + 'specmode' 'string' {'fft','psd','pmtm','pburg'} 'psd'; + 'recompute' 'string' { 'on','off' } 'off'; + 'savetrials' 'string' { 'on','off' } 'off'; + 'continuous' 'string' { 'on','off' } 'off'; + 'logtrials' 'string' { 'on','off' 'notset' } 'notset'; + 'savefile' 'string' { 'on','off' } 'on'; + 'epochlim' 'real' [] [0 1]; + 'trialindices' { 'integer','cell' } [] []; + 'epochrecur' 'real' [] 0.5; + 'rmcomps' 'cell' [] cell(1,length(EEG)); + 'nw' 'float' [] 4; + 'fileout' 'string' [] ''; + 'burgorder' 'integer' [] 20; + 'interp' 'struct' { } struct([]); + 'nfft' 'integer' [] []; + 'freqrange' 'real' [] [] }, 'std_spec', 'ignore'); +if isstr(g), error(g); end; +if isfield(EEG,'icaweights') + numc = size(EEG(1).icaweights,1); +else + error('EEG.icaweights not found'); +end +if isempty(g.components) + g.components = 1:numc; +end + +EEG_etc = []; + +% filename +% -------- +if isempty(g.fileout), g.fileout = fullfile(EEG(1).filepath, EEG(1).filename(1:end-4)); end; +if ~isempty(g.channels) + filename = [ g.fileout '.datspec']; + prefix = 'chan'; +else + filename = [ g.fileout '.icaspec']; + prefix = 'comp'; +end; + +% SPEC information found in datasets +% --------------------------------- +if exist(filename) & strcmpi(g.recompute, 'off') + + fprintf('File "%s" found on disk, no need to recompute\n', filename); + setinfo.filebase = g.fileout; + if strcmpi(prefix, 'comp') + [X tmp f] = std_readfile(setinfo, 'components', g.components, 'freqlimits', g.freqrange, 'measure', 'spec'); + else + [X tmp f] = std_readfile(setinfo, 'channels', g.channels, 'freqlimits', g.freqrange, 'measure', 'spec'); + end; + if ~isempty(X), return; end; +end + +% No SPEC information found +% ------------------------- +options = {}; +if ~isempty(g.rmcomps), options = { options{:} 'rmcomps' g.rmcomps }; end; +if ~isempty(g.interp), options = { options{:} 'interp' g.interp }; end; +if isempty(g.channels) + [X boundaries] = eeg_getdatact(EEG, 'component', [1:size(EEG(1).icaweights,1)], 'trialindices', g.trialindices ); +else [X boundaries] = eeg_getdatact(EEG, 'channel' , [1:EEG(1).nbchan], 'trialindices', g.trialindices, 'rmcomps', g.rmcomps, 'interp', g.interp); +end; +if ~isempty(boundaries) && boundaries(end) ~= size(X,2), boundaries = [boundaries size(X,2)]; end; + +% get specific time range for epoched and continuous data +% ------------------------------------------------------- +oritrials = EEG.trials; +if ~isempty(g.timerange) + if oritrials > 1 + timebef = find(EEG(1).times >= g.timerange(1) & EEG(1).times < g.timerange(2) ); + X = X(:,timebef,:); + EEG(1).pnts = length(timebef); + else + disp('warning: ''timerange'' option cannot be used with continuous data'); + end; +end; + +% extract epochs if necessary +% --------------------------- +if ~strcmpi(g.specmode, 'psd') + if EEG(1).trials == 1 || strcmpi(g.continuous, 'on') + TMP = EEG(1); + TMP.data = X; + TMP.icaweights = []; + TMP.icasphere = []; + TMP.icawinv = []; + TMP.icaact = []; + TMP.icachansind = []; + TMP.trials = size(TMP.data,3); + TMP.pnts = size(TMP.data,2); + TMP.event = []; + TMP.epoch = []; + for index = 1:length(boundaries) + TMP.event(index).type = 'boundary'; + TMP.event(index).latency = boundaries(index); + end; + TMP = eeg_checkset(TMP); + if TMP.trials > 1 + TMP = eeg_epoch2continuous(TMP); + end; + TMP = eeg_regepochs(TMP, g.epochrecur, g.epochlim); + disp('Warning: continuous data, extracting 1-second epochs'); + X = TMP.data; + end; +end; + +% compute spectral decomposition +% ------------------------------ +if strcmpi(g.logtrials, 'notset'), if strcmpi(g.specmode, 'fft') g.logtrials = 'on'; else g.logtrials = 'off'; end; end; +if strcmpi(g.logtrials, 'on'), datatype = 'SPECTRUMLOG'; else datatype = 'SPECTRUMABS'; end; +if strcmpi(g.specmode, 'psd') + if strcmpi(g.savetrials, 'on') || strcmpi(g.logtrials, 'on') + for iTrial = 1:size(X,3) + [XX(:,:,iTrial), f] = spectopo(X(:,:,iTrial), size(X,2), EEG(1).srate, 'plot', 'off', 'boundaries', boundaries, 'nfft', g.nfft, spec_opt{:}); + if iTrial == 1, XX(:,:,size(X,3)) = 0; end; + end; + if strcmpi(g.logtrials, 'off') + X = 10.^(XX/10); + else X = XX; + end; + if strcmpi(g.savetrials, 'off') + X = mean(X,3); + end; + else + [X, f] = spectopo(X, size(X,2), EEG(1).srate, 'plot', 'off', 'boundaries', boundaries, 'nfft', g.nfft, spec_opt{:}); + X = 10.^(X/10); + end; +elseif strcmpi(g.specmode, 'pmtm') + if strcmpi(g.logtrials, 'on') + error('Log trials option cannot be used in conjunction with the PMTM option'); + end; + if all([ EEG.trials ] == 1) && ~isempty(boundaries), disp('Warning: multitaper does not take into account boundaries in continuous data'); end; + fprintf('Computing spectrum using multitaper method:'); + for cind = 1:size(X,1) + fprintf('.'); + for tind = 1:size(X,3) + [tmpdat f] = pmtm(X(cind,:,tind), g.nw, g.nfft, EEG.srate); + if cind == 1 && tind == 1 + X2 = zeros(size(X,1), length(tmpdat), size(X,3)); + end; + X2(cind,:,tind) = tmpdat; + end; + end; + fprintf('\n'); + X = X2; + if strcmpi(g.savetrials, 'off'), X = mean(X,3); end; +elseif strcmpi(g.specmode, 'pburg') + if strcmpi(g.logtrials, 'on') + error('Log trials option cannot be used in conjunction with the PBURB option'); + end; + fprintf('Computing spectrum using Burg method:'); + if all([ EEG.trials ] == 1) && ~isempty(boundaries), disp('Warning: pburg does not take into account boundaries in continuous data'); end; + for cind = 1:size(X,1) + fprintf('.'); + for tind = 1:size(X,3) + [tmpdat f] = pburg(X(cind,:,tind), g.burgorder, g.nfft, EEG.srate); + if cind == 1 && tind == 1 + X2 = zeros(size(X,1), length(tmpdat), size(X,3)); + end; + X2(cind,:,tind) = tmpdat; + end; + end; + fprintf('\n'); + X = X2; + if strcmpi(g.savetrials, 'off'), X = mean(X,3); end; +else % fft mode + if oritrials == 1 || strcmpi(g.continuous, 'on') + X = bsxfun(@times, X, hamming(size(X,2))'); + end; + if all([ EEG.trials ] == 1) && ~isempty(boundaries), disp('Warning: fft does not take into account boundaries in continuous data'); end; + tmp = fft(X, g.nfft, 2); + f = linspace(0, EEG(1).srate/2, floor(size(tmp,2)/2)); + f = f(2:end); % remove DC (match the output of PSD) + tmp = tmp(:,2:floor(size(tmp,2)/2),:); + X = tmp.*conj(tmp); + if strcmpi(g.logtrials, 'on'), X = 10*log10(X); end; + if strcmpi(g.savetrials, 'off'), X = mean(X,3); end; + if strcmpi(g.logtrials, 'off'), X = 10*log10(X); end; +end; + +% Save SPECs in file (all components or channels) +% ----------------------------------------------- +fileNames = computeFullFileName( { EEG.filepath }, { EEG.filename }); +if strcmpi(g.savefile, 'on') + options = { options{:} spec_opt{:} 'timerange' g.timerange 'nfft' g.nfft 'specmode' g.specmode }; + if strcmpi(prefix, 'comp') + savetofile( filename, f, X, 'comp', 1:size(X,1), options, {}, fileNames, g.trialindices, datatype); + else + if ~isempty(g.interp) + savetofile( filename, f, X, 'chan', 1:size(X,1), options, { g.interp.labels }, fileNames, g.trialindices, datatype); + else + tmpchanlocs = EEG(1).chanlocs; + savetofile( filename, f, X, 'chan', 1:size(X,1), options, { tmpchanlocs.labels }, fileNames, g.trialindices, datatype); + end; + end; +end; +return; + +% compute full file names +% ----------------------- +function res = computeFullFileName(filePaths, fileNames); +for index = 1:length(fileNames) + res{index} = fullfile(filePaths{index}, fileNames{index}); +end; + +% ------------------------------------- +% saving SPEC information to Matlab file +% ------------------------------------- +function savetofile(filename, f, X, prefix, comps, params, labels, dataFiles, dataTrials, datatype); + + disp([ 'Saving SPECTRAL file ''' filename '''' ]); + allspec = []; + for k = 1:length(comps) + allspec = setfield( allspec, [ prefix int2str(comps(k)) ], squeeze(X(k,:,:))); + end; + if nargin > 6 && ~isempty(labels) + allspec.labels = labels; + end; + allspec.freqs = f; + allspec.parameters = params; + allspec.datatype = datatype; + allspec.datafiles = dataFiles; + allspec.datatrials = dataTrials; + allspec.average_spec = mean(X,1); + std_savedat(filename, allspec); + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_specgram.m b/code/eeglab13_4_4b/functions/studyfunc/std_specgram.m new file mode 100644 index 0000000..a06d8e0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_specgram.m @@ -0,0 +1,369 @@ +% std_specgram() - Returns the ICA component or channel spectrogram for a dataset. +% Saves the spectra in a file. +% Usage: +% >> [spec freqs] = std_specgram(EEG, 'key', 'val', ...); +% +% Inputs: +% EEG - a loaded epoched EEG dataset structure. +% +% Optional inputs: +% 'components' - [numeric vector] components of the EEG structure for which +% activation spectogram will be computed. Note that because +% computation of component spectra is relatively fast, all +% components spectra are computed and saved. Only selected +% component are returned by the function to Matlab +% {default|[] -> all} +% 'channels' - [cell array] channels of the EEG structure for which +% activation spectogram will be computed. Note that because +% computation of spectrum is relatively fast, all channels +% spectrum are computed and saved. Only selected channels +% are returned by the function to Matlab +% {default|[] -> none} +% 'recompute' - ['on'|'off'] force recomputing ERP file even if it is +% already on disk. +% +% Other optional spectral parameters: +% All optional parameters to the newtimef function may be provided to this function +% as well. +% +% Outputs: +% spec - the mean spectra (in dB) of the requested ICA components in the selected +% frequency range (with the mean of each spectrum removed). +% freqs - a vector of frequencies at which the spectra have been computed. +% +% Files output or overwritten for ICA: +% [dataset_filename].icaspecgram, +% Files output or overwritten for data: +% [dataset_filename].datspecgram, +% +% See also spectopo(), std_erp(), std_ersp(), std_map(), std_preclust() +% +% Authors: Arnaud Delorme, SCCN, INC, UCSD, January, 2005 + +% Defunct: 0 -> if frequency range is different from saved spectra, ask via a +% pop-up window whether to keep existing spectra or to overwrite them. + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, October 11, 2004, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% eeg_specgram() - Compute spectrogramme taking into account boundaries in +% the data. +% Usage: +% >> EEGOUT = eeg_specgram( EEG, typeplot, num, 'key', 'val'); +% +% Inputs: +% EEG - EEG dataset structure +% typeplot - type of processinopt. 1 process the raw +% data and 0 the ICA components +% num - component or channel number +% +% Optional inputs: +% 'winsize' - [integer] window size in points +% 'overlap' - [integer] window overlap in points (default: 0) +% 'movav' - [real] moving average +% +% Author: Arnaud Delorme, CERCO, CNRS, 2008- + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [erspinterp t f ] = eeg_specgram(EEG, varargin); + +if nargin < 1 + help std_specgram; + return; +end; + +[opt moreopts] = finputcheck(varargin, { 'components' 'integer' [] []; + 'channels' { 'cell','integer' } { [] [] } {} + 'recompute' 'string' { 'on','off' } 'off'; + 'winsize' 'integer' [] 3; % 3 seconds + 'rmcomps' 'integer' [] []; + 'interp' 'struct' { } struct([]); + 'overlap' 'integer' [] 0; + 'plot' 'string' { 'off','on' } 'off'; + 'freqrange' 'real' [] []; + 'timerange' 'real' [] []; + 'filter' 'real' [] []}, ... % 11 points + 'eeg_specgram', 'ignore'); +if isstr(opt), error(opt); end; +if isfield(EEG,'icaweights') + numc = size(EEG.icaweights,1); +else + error('EEG.icaweights not found'); +end +if isempty(opt.components) + opt.components = 1:numc; +end +%opt.winsize = 2^ceil(log2(opt.winsize*EEG.srate)); +opt.winsize = opt.winsize*EEG.srate; + +% filename +% -------- +if ~isempty(opt.channels) + filename = fullfile( EEG.filepath,[ EEG.filename(1:end-3) 'datspecgram']); + prefix = 'chan'; + opt.indices = opt.channels; + if iscell(opt.channels) + tmpchanlocs = EEG(1).chanlocs; + for index = 1:length(opt.channels) + chanind = strmatch( lower(opt.channels{index}), lower({ tmpchanlocs.labels }), 'exact'); + if isempty(chanind), error('Channel group not found'); end; + chaninds(index) = chanind; + end; + opt.indices = chaninds; + opt.channels = chaninds; + end; +else + filename = fullfile( EEG.filepath,[ EEG.filename(1:end-3) 'icaspecgram']); + prefix = 'comp'; + opt.indices = opt.components; +end; + +% SPEC information found in datasets +% ---------------------------------- +if exist(filename) & strcmpi(opt.recompute, 'off') + + if strcmpi(prefix, 'comp') + [erspinterp, t, f] = std_readspecgram(EEG, 1, opt.components, opt.freqrange); + else + [erspinterp, t, f] = std_readspecgram(EEG, 1, -opt.channels, opt.freqrange); + end; + return; + +end + +% No SPEC information found +% ------------------------ +options = {}; +if strcmpi(prefix, 'comp') + X = eeg_getdatact(EEG, 'component', [1:size(EEG.icaweights,1)]); +else + EEG.data = eeg_getdatact(EEG, 'channel', [1:EEG.nbchan], 'rmcomps', opt.rmcomps); + if ~isempty(opt.rmcomps), options = { options{:} 'rmcomps' opt.rmcomps }; end; + if ~isempty(opt.interp), + EEG = eeg_interp(EEG, opt.interp, 'spherical'); + end; + X = EEG.data; +end; + +% get the array of original point latency +% --------------------------------------- +urpnts = eeg_urpnts(EEG); +urarray = eeg_makeurarray(EEG, urpnts); % contain the indices of the urpoint in the EEG data + % urarray(1000) = 1000, urarray(2300) = 1600 if part removed in the data +urwincenter = opt.winsize/2+1:opt.winsize-opt.overlap:urpnts-opt.winsize/2; +wintag = ones(1, length(urwincenter)); +if EEG.trials == 1 + for i = 1:length(urwincenter) + win = urwincenter(i)+[-opt.winsize/2+1:opt.winsize/2]; + if ~all(urarray(win)) + wintag(i) = 0; + %fprintf('Missing data window: %3.1f-%3.1f s\n', (win(1)-1)/EEG.srate, (win(end)-1)/EEG.srate); + end; + end; +else + error('eeg_specgram can only be run on continuous data'); +end; + +% compute spectrum 2 solutions +% 1- use newtimef, have to set the exact times and window +% 2- redo the FFT myself +% ---------------------- +wincenter = urwincenter(find(wintag)); % remove bad windows +wincenter = urarray(wincenter); % latency in current dataset +wincenter = 1000*(wincenter-1)/EEG.srate; % convert to ms +freqs = linspace(0.1, 50, 100); +options = { 0 'winsize', opt.winsize, 'baseline', [0 Inf], 'timesout', wincenter, ... + 'plotersp', 'off', 'plotitc', 'off', 'freqs', freqs }; +%freqs = exp(linspace(log(EEG.srate/opt.winsize*4), log(50), 100)); +%cycles = linspace(3,8,100); +%options = { [3 0.8] 'winsize', opt.winsize, 'baseline', [0 Inf], 'timesout', wincenter, ... +% 'freqs' freqs 'cycles' cycles 'plotersp', 'off', 'plotitc', 'off' }; +for ic = 1:length(opt.indices) + [ersp(:,:,ic) itc powebase t f] = newtimef(X(opt.indices(ic), :), EEG.pnts, [EEG.xmin EEG.xmax]*1000, EEG.srate, options{:}, moreopts{:}); +end; + +% interpolate and smooth in time +% ------------------------------ +disp('Now interpolating...'); +wininterp = find(wintag == 0); +erspinterp = zeros(size(ersp,1), length(urwincenter), size(ersp,3)); +erspinterp(:,find(wintag),:) = ersp; +for s = 1:size(ersp,3) + for i=1:length(wininterp) + first1right = find(wintag(wininterp(i):end)); + first1left = find(wintag(wininterp(i):-1:1)); + if isempty(first1right) + erspinterp(:,wininterp(i),s) = erspinterp(:,wininterp(i)+1-first1left(1),s); + elseif isempty(first1left) + erspinterp(:,wininterp(i),s) = erspinterp(:,wininterp(i)-1+first1right(1),s); + else + erspinterp(:,wininterp(i),s) =(erspinterp(:,wininterp(i)-1+first1right(1),s) + erspinterp(:,wininterp(i)+1-first1left(1),s))/2; + end; + end; +end; + +%erspinterp = vectdata(ersp, urwincenter(find(wintag))/EEG.srate, 'timesout', urwincenter/EEG.srate); + +% smooth in time with a simple convolution +% ---------------------------------------- +if ~isempty(opt.filter) + filterlen = opt.filter(1); + filterstd = opt.filter(2); + incr = 2*filterstd/(filterlen-1); %gaussian filter + filter = exp(-(-filterstd:incr:filterstd).^2); + + erspinterp = convn(erspinterp, filter/sum(filter), 'same'); + %erspinterp = conv2(erspinterp, filter/sum(filter)); + %erspinterp(:, [1:(filterlen-1)/2 end-(filterlen-1)/2+1:end]) = []; +end; + +% plot result +% ----------- +t = (urwincenter-1)/EEG.srate; +if strcmpi(opt.plot, 'on') + figure; imagesc(t, log(f), erspinterp); + ft = str2num(get(gca,'yticklabel')); + ft = exp(1).^ft; + ft = unique_bc(round(ft)); + ftick = get(gca,'ytick'); + ftick = exp(1).^ftick; + ftick = unique_bc(round(ftick)); + ftick = log(ftick); + set(gca,'ytick',ftick); + set(gca,'yticklabel', num2str(ft)); + + xlabel('Time (h)'); + ylabel('Frequency (Hz)'); + set(gca, 'ydir', 'normal'); +end; + +% Save SPECs in file (all components or channels) +% ---------------------------------- +options = { 'winsize' opt.winsize 'overlap' opt.overlap moreopts{:} }; +if strcmpi(prefix, 'comp') + savetofile( filename, t, f, erspinterp, 'comp', opt.indices, options, [], opt.interp); + [erspinterp, t, f] = std_readspecgram(EEG, 1, opt.components, opt.timerange, opt.freqrange); +else + tmpchanlocs = EEG(1).chanlocs; + savetofile( filename, t, f, erspinterp, 'chan', opt.indices, options, { tmpchanlocs.labels }, opt.interp); + [erspinterp, t, f] = std_readspecgram(EEG, 1, -opt.channels, opt.timerange, opt.freqrange); +end; +return; + +% recompute the original data length in points +% -------------------------------------------- +function urlat = eeg_makeurarray(EEG, urpnts); + + if isempty(EEG.event) | ~isfield(EEG.event, 'duration') + urlat = 1:EEG.pnts; + return; + end; + + % get boundary events latency and duration + % ---------------------------------------- + tmpevent = EEG.event; + bounds = strmatch('boundary', { tmpevent.type }); + alldurs = [ tmpevent(bounds).duration ]; + alllats = [ tmpevent(bounds).latency ]; + if length(alldurs) >= 1 + if alldurs(1) <= 1 + alllats(1) = []; + alldurs(1) = []; + end; + end; + + if isempty(alllats) + urlat = 1:EEG.pnts; + return; + end; + + % build the ur boolean array + % -------------------------- + urlat = ones(1, urpnts); + for i=1:length(alllats) + urlat(round(alllats(i)+0.5):round(alllats(i)+0.5+alldurs(i)-1)) = 0; + alllats(i+1:end) = alllats(i+1:end)+alldurs(i); + end; + urlat(find(urlat)) = 1:EEG.pnts; + +% ------------------------------------- +% saving SPEC information to Matlab file +% ------------------------------------- +function savetofile(filename, t, f, X, prefix, comps, params, labels, interp); + + disp([ 'Saving SPECTRAL file ''' filename '''' ]); + allspec = []; + for k = 1:length(comps) + allspec = setfield( allspec, [ prefix int2str(comps(k)) ], X(:,:,k)); + end; + if ~isempty(labels) + allspec.labels = labels; + end; + allspec.freqs = f; + allspec.times = t; + allspec.parameters = params; + allspec.datatype = 'SPECTROGRAM'; + allerp.interpolation = fastif(isempty(interp), 'no', interp); + allspec.average_spec = mean(X,1); + std_savedat(filename, allspec); + +% recompute the original data length in points +% -------------------------------------------- +function pntslat = eeg_urpnts(EEG); + + if isempty(EEG.event) | ~isfield(EEG.event, 'duration') + pntslat = EEG.pnts; + return; + end; + tmpevent = EEG.event; + bounds = strmatch('boundary', { tmpevent.type }); + alldurs = [ tmpevent(bounds).duration ]; + if length(alldurs) > 0 + if alldurs(1) <= 1, alldurs(1) = []; + end; + end; + pntslat = EEG.pnts + sum(alldurs); + +% recompute the original latency +% ------------------------------ +function pntslat = eeg_urlatency(EEG, pntslat); + + if isempty(EEG.event), return; end; + if ~isstr(EEG.event(1).type), return; end; + + tmpevent = EEG.event; + bounds = strmatch('boundary', { tmpevent.type }) + for i=1:length(bounds) + if EEG.event(bounds(i)).duration > 1 + pntslat = pntslat + EEG.event(bounds(i)).duration; + end; + end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_specplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_specplot.m new file mode 100644 index 0000000..ddda889 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_specplot.m @@ -0,0 +1,97 @@ +% std_specplot() - plot STUDY component cluster spectra, either mean spectra +% for all requested clusters in the same figure, with spectra +% for different conditions (if any) plotted in different colors, +% or spectra for each specified cluster in a separate figure +% for each condition, showing the cluster component spectra plus +% the mean cluster spectrum (in bold). The spectra can be +% plotted only if component spectra have been computed and +% saved with the EEG datasets in Matlab files "[datasetname].icaspec" +% using pop_preclust() or std_preclust(). Called by pop_clustedit(). +% Calls std_readspec() and internal function std_plotcompspec() +% Usage: +% >> [STUDY] = std_specplot(STUDY, ALLEEG, key1, val1, key2, val2, ...); +% >> [STUDY specdata specfreqs pgroup pcond pinter] = std_specplot(STUDY, ALLEEG, ...); +% +% Inputs: +% STUDY - STUDY structure comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - vector of EEG dataset structures for the dataset(s) in the STUDY, +% typically created using load_ALLEEG(). +% Optional inputs for component plotting: +% 'clusters' - [numeric vector|'all'] indices of clusters to plot. +% If no component indices ('comps' below) are given, the average +% spectrums of the requested clusters are plotted in the same figure, +% with spectrums for different conditions (and groups if any) plotted +% in different colors. In 'comps' (below) mode, spectrum for each +% specified cluster are plotted in separate figures (one per +% condition), each overplotting cluster component spectrum plus the +% average cluster spectrum in bold. Note this parameter has no effect +% if the 'comps' option (below) is used. {default: 'all'} +% 'comps' - [numeric vector|'all'] indices of the cluster components to plot. +% Note that 'comps', 'all' is equivalent to 'plotsubjects', 'on'. +% +% Optional inputs for channel plotting: +% 'channels' - [numeric vector] specific channel group to plot. By +% default, the grand mean channel spectrum is plotted (using the +% same format as for the cluster component means described above) +% 'subject' - [numeric vector] In 'changrp' mode (above), index of +% the subject(s) to plot. Else by default, plot all components +% in the cluster. +% 'plotsubjects' - ['on'|'off'] When 'on', plot spectrum of all subjects. +% +% Other optional inputs: +% 'plotmode' - ['normal'|'condensed'] 'normal' -> plot in a new figure; +% 'condensed' -> plot all curves in the current figure in a +% condensed fashion {default: 'normal'} +% 'key','val' - All optional inputs to pop_specparams() are also accepted here +% to plot subset of time, statistics etc. The values used by default +% are the ones set using pop_specparams() and stored in the +% STUDY structure. +% Outputs: +% STUDY - the input STUDY set structure with the plotted cluster mean spectra +% added?? to allow quick replotting. +% specdata - [cell] spectral data for each condition, group and subjects. +% size of cell array is [nconds x ngroups]. Size of each element +% is [freqs x subjects] for data channels or [freqs x components] +% for component clusters. This array may be gicen as input +% directly to the statcond() function or std_stats() function +% to compute statistics. +% specfreqs - [array] Sprectum point frequency values. +% pgroup - [array or cell] p-values group statistics. Output of the +% statcond() function. +% pcond - [array or cell] condition statistics. Output of the statcond() +% function. +% pinter - [array or cell] groups x conditions statistics. Output of +% statcond() function. +% Example: +% >> [STUDY] = std_specplot(STUDY,ALLEEG, 'clusters', 2, 'mode', 'apart'); +% % Plot component spectra for STUDY cluster 2, plus the mean cluster +% % spectrum (in bold). +% +% See also pop_clustedit(), pop_preclust() std_preclust(), pop_clustedit(), std_readspec() +% +% Authors: Arnaud Delorme, CERCO, August, 2006 + +% Copyright (C) Arnaud Delorme, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [STUDY, specdata, allfreqs, pgroup, pcond, pinter] = std_specplot(STUDY, ALLEEG, varargin) + +if nargin < 2 + help std_specplot; + return; +end; + +[STUDY, specdata, allfreqs, pgroup, pcond, pinter] = std_erpplot(STUDY, ALLEEG, 'datatype', 'spec', 'unitx', 'Hz', varargin{:}); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_stat.m b/code/eeglab13_4_4b/functions/studyfunc/std_stat.m new file mode 100644 index 0000000..e45b1bb --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_stat.m @@ -0,0 +1,254 @@ +% std_stat() - compute statistics for ERP/spectral traces or ERSP/ITC images +% of a component or channel cluster in a STUDY. +% Usage: +% >> [pcond, pgroup, pinter, statscond, statsgroup, statsinter] = std_stat( data, 'key', 'val', ...) +% Inputs: +% data - [cell array] mean data for each subject group and/or data +% condition. For example, to compute mean ERPs statistics from a +% STUDY for epochs of 800 frames in two conditions from three +% groups of 12 subjects: +% +% >> data = { [800x12] [800x12] [800x12];... % 3 groups, cond 1 +% [800x12] [800x12] [800x12] }; % 3 groups, cond 2 +% >> pcond = std_stat(data, 'condstats', 'on'); +% +% By default, parametric statistics are computed across subjects +% in the three groups. See below and >> help statcond +% for more information about the statistical computations. +% +% Statistics options (EEGLAB): +% 'groupstats' - ['on'|'off'] Compute (or not) statistics across groups. +% {default: 'off'} +% 'condstats' - ['on'|'off'] Compute (or not) statistics across groups. +% {default: 'off'} +% 'method' - ['parametric'|'permutation'] Type of statistics to use +% default is 'parametric'. 'perm' and 'param' legacy +% abreviations are still functional. +% 'naccu' - [integer] Number of surrogate averages fo accumulate when +% computing permutation-based statistics. For example, to +% test p<0.01 use naccu>=200; for p<0.001, use naccu>=2000. +% If a non-NaN 'threshold' is set (see below) and 'naccu' +% is too low, it will be automatically increased. This +% keyword available only from the command line {default:500} +% 'alpha' - [NaN|p-value] threshold for computing p-value. In this +% function, it is only used to compute naccu above. NaN +% means that no threshold has been set. +% 'mcorrect' - ['none'|'fdr'] apply correcting for multiple comparisons. +% 'mode' - ['eeglab'|'fieldtrip'] statistical framework to use. +% 'eeglab' uses EEGLAB statistical functions and 'fieldtrip' +% uses Fieldtrip statistical funcitons. Default is 'eeglab'. +% +% Fieldtrip statistics options: +% 'fieldtripnaccu' - 'numrandomization' Fieldtrip parameter +% 'fieldtripalpha' - 'alpha' Fieldtrip parameter. Default is 0.05. +% 'fieldtripmethod' - 'method' Fieldtrip parameter. Default is 'analytic' +% 'fieldtripmcorrect' - 'mcorrect' Fieldtrip parameter. Default is 'none'. +% 'fieldtripclusterparam' - string or cell array for optional parameters +% for cluster correction method, see function +% ft_statistics_montecarlo for more information. +% 'fieldtripchannelneighbor' - Fieldtrip channel neighbour structure for +% cluster correction method, see function +% std_prepare_neighbors for more information. +% Legacy parameters: +% 'threshold' - now 'alpha' +% 'statistics' - now 'method' +% +% Outputs: +% pcond - [cell] condition pvalues or mask (0 or 1) if an alpha value +% is selected. One element per group. +% pgroup - [cell] group pvalues or mask (0 or 1). One element per +% condition. +% pinter - [cell] three elements, condition pvalues (group pooled), +% group pvalues (condition pooled) and interaction pvalues. +% statcond - [cell] condition statistic values (F or T). +% statgroup - [cell] group pvalues or mask (0 or 1). One element per +% condition. +% statinter - [cell] three elements, condition statistics (group pooled), +% group statistics (condition pooled) and interaction F statistics. +% +% Author: Arnaud Delorme, CERCO, CNRS, 2006- +% +% See also: statcond() + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [pcond, pgroup, pinter, statscond, statsgroup, statsinter] = std_stat(data, varargin) + +pgroup = {}; +pcond = {}; +pinter = {}; +if nargin < 1 + help std_stat; + return; +end; + +% decode inputs +% ------------- +if ~isempty(varargin) && isstruct(varargin{1}) + opt = varargin{1}; + varargin(1) = []; +else + opt = []; +end; +if ~isempty(varargin) ||isempty(opt); + opt = pop_statparams(opt, varargin{:}); +end; + +if ~isfield(opt, 'paired'), opt.paired = { 'off' 'off' }; end; +if ~isnan(opt.eeglab.alpha(1)) && isempty(opt.eeglab.naccu), opt.eeglab.naccu = 1/opt.eeglab.alpha(end)*2; end; +if any(any(cellfun('size', data, 2)==1)), opt.groupstats = 'off'; opt.condstats = 'off'; end; +if strcmpi(opt.eeglab.mcorrect, 'fdr'), opt.eeglab.naccu = opt.eeglab.naccu*20; end; +if isempty(opt.eeglab.naccu), opt.eeglab.naccu = 2000; end; +if strcmpi(opt.eeglab.method(1:3), 'par') && ~isreal(data{1}) + fprintf('*** Cannot use parametric statistics for single-trial ITC significance ***\n'); + return; +end; +nc = size(data,1); +ng = size(data,2); + +% compute significance mask +% ------------------------- +pcond = {}; +pgroup = {}; +pinter = {}; +statscond = {}; +statsgroup = {}; +statsinter = {}; +if strcmpi(opt.mode, 'eeglab') + % EEGLAB statistics + % ----------------- + if strcmpi(opt.condstats, 'on') && nc > 1 + for g = 1:ng + [F df pval] = statcond(data(:,g), 'method', opt.eeglab.method, 'naccu', opt.eeglab.naccu, 'paired', opt.paired{1}); + pcond{g} = squeeze(pval); + statscond{g} = squeeze(F); + end; + end; + if strcmpi(opt.groupstats, 'on') && ng > 1 + for c = 1:nc + [F df pval] = statcond(data(c,:), 'method', opt.eeglab.method, 'naccu', opt.eeglab.naccu, 'paired', opt.paired{2}); + pgroup{c} = squeeze(pval); + statsgroup{c} = squeeze(F); + end; + else + end; + if ( strcmpi(opt.groupstats, 'on') && strcmpi(opt.condstats, 'on') ) & ng > 1 & nc > 1 + opt.paired = sort(opt.paired); % put 'off' first if present + [F df pval] = statcond(data, 'method', opt.eeglab.method, 'naccu', opt.eeglab.naccu, 'paired', opt.paired{1}); + for index = 1:length(pval) + pinter{index} = squeeze(pval{index}); + statsinter{index} = squeeze(F{index}); + end; + end; + + if ~isempty(opt.groupstats) || ~isempty(opt.condstats) + if ~strcmpi(opt.eeglab.mcorrect, 'none'), + disp([ 'Applying ' upper(opt.eeglab.mcorrect) ' correction for multiple comparisons' ]); + for ind = 1:length(pcond), pcond{ind} = mcorrect( pcond{ind} , opt.eeglab.mcorrect ); end; + for ind = 1:length(pgroup), pgroup{ind} = mcorrect( pgroup{ind}, opt.eeglab.mcorrect ); end; + if ~isempty(pinter), + pinter{1} = mcorrect(pinter{1}, opt.eeglab.mcorrect); + pinter{2} = mcorrect(pinter{2}, opt.eeglab.mcorrect); + pinter{3} = mcorrect(pinter{3}, opt.eeglab.mcorrect); + end; + end; + if ~isnan(opt.eeglab.alpha) + for ind = 1:length(pcond), pcond{ind} = applythreshold(pcond{ind}, opt.eeglab.alpha); end; + for ind = 1:length(pgroup), pgroup{ind} = applythreshold(pgroup{ind}, opt.eeglab.alpha); end; + for ind = 1:length(pinter), pinter{ind} = applythreshold(pinter{ind}, opt.eeglab.alpha); end; + end; + end; +else + if ~exist('ft_freqstatistics'), error('Install Fieldtrip-lite to use Fieldtrip statistics'); end; + + % Fieldtrip statistics + % -------------------- + params = {}; + if strcmpi(opt.fieldtrip.mcorrect, 'cluster') + params = eval( [ '{' opt.fieldtrip.clusterparam '}' ]); + if isempty(opt.fieldtrip.channelneighbor), opt.fieldtrip.channelneighbor = struct([]); end; + params = { params{:} 'neighbours' opt.fieldtrip.channelneighbor }; % channelneighbor is empty if only one channel selected + end; + params = { params{:} 'method', opt.fieldtrip.method, 'naccu', opt.fieldtrip.naccu 'mcorrect' opt.fieldtrip.mcorrect 'alpha' opt.fieldtrip.alpha 'numrandomization' opt.fieldtrip.naccu }; + params = { params{:} 'structoutput' 'on' }; % before if ~isnan(opt.fieldtrip.alpha), end; + + if strcmpi(opt.condstats, 'on') && nc > 1 + for g = 1:ng + [F df pval] = statcondfieldtrip(data(:,g), 'paired', opt.paired{1}, params{:}); + pcond{g} = applymask( F, opt.fieldtrip); + statscond{g} = squeeze(F.stat); + end; + else + pcond = {}; + end; + if strcmpi(opt.groupstats, 'on') && ng > 1 + for c = 1:nc + [F df pval] = statcondfieldtrip(data(c,:), 'paired', opt.paired{2}, params{:}); + pgroup{c} = applymask( F, opt.fieldtrip); + statsgroup{c} = squeeze(F.stat); + end; + else + pgroup = {}; + end; + if ( strcmpi(opt.groupstats, 'on') && strcmpi(opt.condstats, 'on') ) & ng > 1 & nc > 1 + opt.paired = sort(opt.paired); % put 'off' first if present + [F df pval] = statcondfieldtrip(data, 'paired', opt.paired{1}, params{:}); + for index = 1:length(pval) + pinter{index} = applymask(F{inter}, opt.fieldtrip); + statsinter{index} = squeeze(F.stat{index}); + end; + else + pinter = {}; + end; +end; + +% apply mask for fieldtrip data +% ----------------------------- +function p = applymask(F, fieldtrip) + +if ~isnan(fieldtrip.alpha), p = squeeze(F.mask); +else + p = squeeze(F.pval); + if ~strcmpi(fieldtrip.mcorrect, 'none') + p(~F.mask) = 1; + end; +end; + +% apply stat threshold to data for EEGLAB stats +% --------------------------------------------- +function newdata = applythreshold(data, threshold) + +threshold = sort(threshold); +newdata = zeros(size(data)); +for index = 1:length(threshold) + inds = data < threshold(index); + data(inds) = 1; + newdata(inds) = length(threshold)-index+1; +end; + +% compute correction for multiple comparisons +% ------------------------------------------- +function pvals = mcorrect(pvals, method); + +switch method + case {'no' 'none'}, return; + case 'bonferoni', pvals = pvals*prod(size(pvals)); + case 'holms', [tmp ind] = sort(pvals(:)); [tmp ind2] = sort(ind); pvals(:) = pvals(:).*(prod(size(pvals))-ind2+1); + case 'fdr', pvals = fdr(pvals); + otherwise error(['Unknown method ''' method ''' for correction for multiple comparisons' ]); +end; + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_substudy.m b/code/eeglab13_4_4b/functions/studyfunc/std_substudy.m new file mode 100644 index 0000000..fba34e7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_substudy.m @@ -0,0 +1,140 @@ +% std_substudy() - create a sub-STUDY set by removing datasets, conditions, groups, or +% subjects. +% Usage: +% >> [ STUDY ALLEEG ] = std_substudy(STUDY, ALLEEG, 'key', 'val', ...); +% +% Optional Inputs: +% STUDY - existing study structure. +% ALLEEG - vector of EEG dataset structures to be included in the STUDY. +% +% Optional Inputs: +% 'dataset' - [integer array] indices of dataset to include in sub-STUDY +% Default is all datasets. +% 'subject' - [cell array] name of subjects to include in sub-STUDY. +% Default is all subjects.% +% 'condition' - [cell array] name of conditions to include in sub-STUDY +% Default is all conditions. +% 'group' - [cell array] name of gourps to include in sub-STUDY +% Default is all groups. +% 'rmdat' - ['on'|'off'] actually remove datasets 'on', or simply +% remove all references to these datasets for channels and +% clusters ('off'). +% +% Example: +% % create a sub-STUDY using only the first 3 subjects +% % WARNING: make sure your STUDY is saved before creating a sub-STUDY +% [STUDY ALLEEG] = std_substudy(STUDY, ALLEEG, 'subject', STUDY.subjects(1:3)); +% +% Authors: Arnaud Delorme, CERCO/CNSR & SCCN, INC, UCSD, 2009- + +% Copyright (C) Arnaud Delorme, SCCN, INC, UCSD, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ STUDY ALLEEG ] = std_substudy(STUDY, ALLEEG, varargin); + +if nargin < 3 + help std_substudy; + return; +end + +opt = finputcheck(varargin, { 'condition' 'cell' {} {}; + 'dataset' 'integer' {} []; + 'group' 'cell' {} {}; + 'rmdat' 'string' { 'on','off' } 'on'; + 'subject' 'cell' {} {} }, 'std_substudy'); +if isstr(opt), return; end; + +% find datasets to remove +% ----------------------- +tagdel = []; +if ~isempty(opt.subject) + for index = 1:length(STUDY.datasetinfo) + if ~strmatch(STUDY.datasetinfo.subject, opt.subject, 'exact') + tagdel = [ tagdel index ]; + end; + end; +end; +if ~isempty(opt.condition) + for index = 1:length(STUDY.datasetinfo) + if ~strmatch(STUDY.datasetinfo.condition, opt.condition, 'exact') + tagdel = [ tagdel index ]; + end; + end; +end; +if ~isempty(opt.group) + for index = 1:length(STUDY.datasetinfo) + if ~strmatch(STUDY.datasetinfo.group, opt.group, 'exact') + tagdel = [ tagdel index ]; + end; + end; +end; +if ~isempty(opt.dataset) + tagdel = [ tagdel setdiff([1:length(ALLEEG)], opt.dataset) ]; +end; +tagdel = unique_bc(tagdel); + +% find new dataset indices +% ------------------------ +alldats = [1:length(ALLEEG)]; +if strcmpi(opt.rmdat, 'on') + alldats(tagdel) = []; + for index = 1:length(ALLEEG) + tmp = find(alldats == index); + if isempty(tmp), tmp = NaN; end; + datcoresp(index) = tmp; + end; + ALLEEG(tagdel) = []; + STUDY.datasetinfo(tagdel) = []; + for index = 1:length(STUDY.datasetinfo) + STUDY.datasetinfo(index).index = index; + end; +else + alldats(tagdel) = []; + for index = 1:length(ALLEEG) + tmp = find(alldats == index); + if isempty(tmp), tmp = NaN; else tmp = index; end; + datcoresp(index) = tmp; + end; +end; + +% check channel consistency +% ------------------------- +for i = 1:length(STUDY.changrp) + for c = 1:size(STUDY.changrp(i).setinds,1) + for g = 1:size(STUDY.changrp(i).setinds,2) + newinds = datcoresp(STUDY.changrp(i).setinds{c,g}); + nonnans = find(~isnan(newinds)); + STUDY.changrp(i).setinds{c,g} = newinds(nonnans); + STUDY.changrp(i).allinds{c,g} = STUDY.changrp(i).allinds{c,g}(nonnans); + end; + end; +end; + +% check cluster consistency +% ------------------------- +for index = 1:length(STUDY.cluster) + STUDY.cluster(index).sets(:) = datcoresp(STUDY.cluster(index).sets(:)); + for i = size(STUDY.cluster(index).sets,2):-1:1 + if all(isnan(STUDY.cluster(index).sets(:,i))) + STUDY.cluster(index).sets(:,i) = []; + STUDY.cluster(index).comps(:,i) = []; + end; + end; + [tmp STUDY.cluster(index).setinds STUDY.cluster(index).allinds] = std_setcomps2cell(STUDY, STUDY.cluster(index).sets, STUDY.cluster(index).comps); +end; + +STUDY = std_reset(STUDY); +STUDY = std_checkset(STUDY, ALLEEG); diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_topo.m b/code/eeglab13_4_4b/functions/studyfunc/std_topo.m new file mode 100644 index 0000000..8cee295 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_topo.m @@ -0,0 +1,143 @@ +% std_topo() - uses topoplot() to get the interpolated Cartesian grid of the +% specified component topo maps. The topo map grids are saved +% into a (.icatopo) file and a pointer to the file is stored +% in the EEG structure. If such a file already exists, +% loads the information from it. +% +% Returns the topo map grids of all the requested components. Also +% returns the EEG sub-structure etc (i.e EEG.etc), which is modified +% with a pointer to the float file and some information about the file. +% Usage: +% >> X = std_topo(EEG, components, option); +% +% % Returns the ICA topo map grid for a dataset. +% % Updates the EEG structure in the Matlab environment and re-saves +% Inputs: +% EEG - an EEG dataset structure. +% components - [numeric vector] components in the EEG structure to compute topo maps +% {default|[] -> all} +% option - ['gradient'|'laplacian'|'none'] compute gradient or laplacian of +% the scale topography. This does not acffect the saved file which is +% always 'none' {default is 'none' = the interpolated topo map} +% Outputs: +% X - the topo map grid of the requested ICA components, each grid is +% one ROW of X. +% +% File output: [dataset_name].icatopo +% +% Authors: Hilit Serby, Arnaud Delorme, SCCN, INC, UCSD, January, 2005 +% +% See also topoplot(), std_erp(), std_ersp(), std_spec(), std_preclust() + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, October 11, 2004, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [X] = std_topo(EEG, comps, option, varargin) + +if nargin < 1 + help std_topo; + return; +end; +if isfield(EEG,'icaweights') + numc = size(EEG.icaweights,1); +else + error('EEG.icaweights not found'); +end +if nargin < 2 + comps = 1:numc; +elseif isempty(comps) + comps = 1:numc; +end + +if nargin < 3 + option = 'none'; +end; + +g = finputcheck( varargin, { 'recompute' 'string' { 'on','off' } 'off' }, 'std_topo'); +if isstr(g), error(g); end; + +% figure; toporeplot(grid,'style', 'both','plotrad', 0.5, 'intrad', 0.5, 'xsurface' ,Xi, 'ysurface',Yi ); + +% Topo information found in dataset +% --------------------------------- +if exist(fullfile(EEG.filepath, [ EEG.filename(1:end-3) 'icatopo' ])) & strcmpi(g.recompute, 'off') + for k = 1:length(comps) + tmp = std_readtopo( EEG, 1, comps(k)); + if strcmpi(option, 'gradient') + [tmpx, tmpy] = gradient(tmp); %Gradient + tmp = [tmpx(:); tmpy(:)]'; + elseif strcmpi(option, 'laplacian') + tmp = del2(tmp); %Laplacian + tmp = tmp(:)'; + else + tmp = tmp(:)'; + end; + + tmp = tmp(find(~isnan(tmp))); + if k == 1 + X = zeros(length(comps),length(tmp)) ; + end + X(k,:) = tmp; + end + return +end + +all_topos = []; +for k = 1:numc + + % compute topo map grid (topoimage) + % --------------------------------- + chanlocs = EEG.chanlocs(EEG.icachansind); + if isempty( [ chanlocs.theta ] ) + error('Channel locations are required for computing scalp topographies'); + end; + [hfig grid plotrad Xi Yi] = topoplot( EEG.icawinv(:,k), chanlocs, ... + 'verbose', 'off',... + 'electrodes', 'on' ,'style','both',... + 'plotrad',0.55,'intrad',0.55,... + 'noplot', 'on', 'chaninfo', EEG.chaninfo); + + all_topos = setfield(all_topos, [ 'comp' int2str(k) '_grid' ], grid); + all_topos = setfield(all_topos, [ 'comp' int2str(k) '_x' ] , Xi(:,1)); + all_topos = setfield(all_topos, [ 'comp' int2str(k) '_y' ] , Yi(:,1)); + +end + +% Save topos in file +% ------------------ +all_topos.datatype = 'TOPO'; +tmpfile = fullfile( EEG.filepath, [ EEG.filename(1:end-3) 'icatopo' ]); +std_savedat(tmpfile, all_topos); + +for k = 1:length(comps) + tmp = getfield(all_topos, [ 'comp' int2str(comps(k)) '_grid' ]); + + if strcmpi(option, 'gradient') + [tmpx, tmpy] = gradient(tmp); % Gradient + tmp = [tmpx(:); tmpy(:)]'; + elseif strcmpi(option, 'laplacian') + tmp = del2(tmp); % Laplacian + tmp = tmp(:)'; + else + tmp = tmp(:)'; + end; + + tmp = tmp(find(~isnan(tmp))); + if k == 1 + X = zeros(length(comps),length(tmp)) ; + end + X(k,:) = tmp; +end diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_topoplot.m b/code/eeglab13_4_4b/functions/studyfunc/std_topoplot.m new file mode 100644 index 0000000..ca5dd0f --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_topoplot.m @@ -0,0 +1,292 @@ +% std_topoplot() - Command line function to plot cluster component and mean scalp maps. +% Displays either mean cluster/s scalp map/s, or all cluster/s components +% scalp maps with the mean cluster/s scsalp map in one figure. +% The scalp maps can be visualized only if component scalp maps +% were calculated and saved in the EEG datasets in the STUDY. +% These can be computed during pre-clustering using the GUI-based function +% pop_preclust() or the equivalent commandline functions eeg_createdata() +% and eeg_preclust(). A pop-function that calls this function is +% pop_clustedit(). +% Usage: +% >> [STUDY] = std_topoplot(STUDY, ALLEEG, key1, val1, key2, val2); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in +% the STUDY. ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% Optional inputs: +% 'clusters' - [numeric vector| 'all'] -> specific cluster numbers to plot. +% 'all' -> plot all clusters in STUDY. +% {default: 'all'}. +% 'comps' - [numeric vector | 'all'] -> indices of the cluster components to plot. +% 'all' -> plot all the components in the cluster +% {default: 'all'}. +% 'mode' - ['together'|'apart'] a plotting mode. In 'together' mode, the average +% scalp maps of the requested clusters are plotted in the same figure, +% one per condition. In 'apart' mode, component scalp maps for each +% cluster are plotted in a separate figure for each condition, plus the +% cluster mean map. Note that this option is irrelevant if component +% indices ('comps' above) are provided.{default: 'apart'}. +% 'figure' - ['on'|'off'] for the 'together' mode option, plots on +% a new figure ('on'), or on the current figure ('off'). +% {default: 'on'}. +% Outputs: +% STUDY - the input STUDY set structure modified with plotted cluster scalp +% map means, to allow quick replotting (unless clusters meands +% already exists in th STUDY). +% +% Example: +% % Plot the mean scalp maps for clusters 1 through 20 on the same figure. +% >> [STUDY] = std_topoplot(STUDY,ALLEEG, 'clusters', [1:20], 'mode', 'together'); +% +% See also pop_clustedit(), pop_preclust() +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 07, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_topoplot(STUDY, ALLEEG, varargin) +icadefs; + +% Set default values +cls = []; +mode = 'together'; % plot all cluster mean scalp maps on one figure +figureon = 1; % plot on a new figure + +for k = 3:2:nargin + switch varargin{k-2} + case 'clusters' + if isnumeric(varargin{k-1}) + cls = varargin{k-1}; + if isempty(cls) + cls = 2:length(STUDY.cluster); + end + else + if isstr(varargin{k-1}) & strcmpi(varargin{k-1}, 'all') + cls = 2:length(STUDY.cluster); + else + error('std_topoplot: ''clusters'' input takes either specific clusters (numeric vector) or keyword ''all''.'); + end + end + case 'plotsubjects' % legacy + mode = 'apart'; + case 'comps' + if isstr( varargin{k-1} ), mode = 'apart'; + else STUDY = std_plotcompmap(STUDY, ALLEEG, cls, varargin{k-1}); return; + end; + case 'mode' % Plotting mode 'together' / 'apart' + mode = varargin{k-1}; + case 'figure' + if strcmpi(varargin{k-1},'off') + figureon = 0; + end + case 'plotrad' + inputPlotrad = varargin{k-1}; + end +end + +% select clusters to plot +% ----------------------- +if isempty(cls) + tmp =[]; + cls = 2:length(STUDY.cluster); % plot all clusters in STUDY + for k = 1: length(cls) + % don't include 'Notclust' clusters + if ~strncmpi('Notclust',STUDY.cluster(cls(k)).name,8) & ~strncmpi('ParentCluster',STUDY.cluster(cls(k)).name,13) + tmp = [tmp cls(k)]; + end + end + cls = tmp; +end; + +% Plot all the components in the cluster +disp('Drawing components of cluster (all at once)...'); +if ~isfield(STUDY.cluster,'topo'), STUDY.cluster(1).topo = []; end; +for clus = 1: length(cls) % For each cluster requested + if isempty(STUDY.cluster(cls(clus)).topo) + STUDY = std_readtopoclust(STUDY,ALLEEG, cls(clus)); + end; +end +if strcmpi(mode, 'apart') + for clus = 1: length(cls) % For each cluster requested + len = length(STUDY.cluster(cls(clus)).comps); + if len > 0 % A non-empty cluster + h_topo = figure; + rowcols(2) = ceil(sqrt(len + 4)); rowcols(1) = ceil((len+4)/rowcols(2)); + clusscalp = STUDY.cluster(cls(clus)); + ave_grid = clusscalp.topo; + tmp_ave = ave_grid; + tmp_ave(find(isnan(tmp_ave))) = 0; % remove NaN values from grid for later correlation calculation. + for k = 1:len + abset = STUDY.datasetinfo(STUDY.cluster(cls(clus)).sets(1,k)).index; + subject = STUDY.datasetinfo(STUDY.cluster(cls(clus)).sets(1,k)).subject; + comp = STUDY.cluster(cls(clus)).comps(k); + [Xi,Yi] = meshgrid(clusscalp.topoy,clusscalp.topox); + scalpmap = squeeze(clusscalp.topoall{k}); % already correct polarity + if k <= rowcols(2) - 2 %first sbplot row + figure(h_topo); + sbplot(rowcols(1),rowcols(2),k+2) , + toporeplot(scalpmap, 'style', 'both', 'plotrad',0.5,'intrad',0.5, 'verbose', 'off','xsurface', Xi, 'ysurface', Yi ); + title([subject '/' 'ic' num2str(comp) ], 'interpreter', 'none'); + %waitbar(k/(len+1),h_wait) + else %other sbplot rows + figure(h_topo) + sbplot(rowcols(1),rowcols(2),k+4) , + toporeplot(scalpmap, 'style', 'both', 'plotrad',0.5,'intrad',0.5, 'verbose', 'off','xsurface', Xi, 'ysurface', Yi ); + title([subject '/' 'ic' num2str(comp)], 'interpreter', 'none'); + %waitbar(k/(len+1),h_wait) + end + end + figure(h_topo) + sbplot(rowcols(1),rowcols(2),[1 rowcols(2)+2 ]) , + toporeplot(ave_grid, 'style', 'both', 'plotrad',0.5,'intrad',0.5, 'verbose', 'off'); + title([ STUDY.cluster(cls(clus)).name ' (' num2str(length(unique(STUDY.cluster(cls(clus)).sets(1,:)))) ' Ss, ' num2str(length(STUDY.cluster(cls(clus)).comps)),' ICs)']); + %title([ STUDY.cluster(cls(clus)).name ' average scalp map, ' num2str(length(unique(STUDY.cluster(cls(clus)).sets(1,:)))) 'Ss']); + set(gcf,'Color', BACKCOLOR); + %waitbar(1,h_wait) + %delete(h_wait) + orient tall % fill the figure page for printing + axcopy + end % Finished one cluster plot + end % Finished plotting all clusters +end % Finished 'apart' plotting mode + +% Plot clusters centroid maps +if strcmpi(mode, 'together') + len = length(cls); + rowcols(2) = ceil(sqrt(len)); rowcols(1) = ceil((len)/rowcols(2)); + if figureon + try + % optional 'CreateCancelBtn', 'delete(gcbf); error(''USER ABORT'');', + h_wait = waitbar(0,'Computing topoplot ...', 'Color', BACKEEGLABCOLOR,'position', [300, 200, 300, 48]); + catch % for Matlab 5.3 + h_wait = waitbar(0,'Computing topoplot ...','position', [300, 200, 300, 48]); + end + figure + end + for k = 1:len + if len ~= 1 + sbplot(rowcols(1),rowcols(2),k) + end + tmpcmap = colormap(DEFAULT_COLORMAP); + toporeplot(STUDY.cluster(cls(k)).topo, 'style', 'both', 'plotrad',0.5,'intrad',0.5, 'verbose', 'off','colormap', tmpcmap); + title([ STUDY.cluster(cls(k)).name ' (' num2str(length(unique(STUDY.cluster(cls(k)).sets(1,:)))) ' Ss, ' num2str(length(STUDY.cluster(cls(k)).comps)),' ICs)']); + %title([ STUDY.cluster(cls(k)).name ', ' num2str(length(unique(STUDY.cluster(cls(k)).sets(1,:)))) 'Ss' ]); + if figureon + waitbar(k/len,h_wait) + end + end + if figureon + delete(h_wait) + end + if len ~= 1 + maintitle = 'Average scalp map for all clusters'; + a = textsc(maintitle, 'title'); + set(a, 'fontweight', 'bold'); + set(gcf,'name', maintitle); + else + title([ STUDY.cluster(cls(k)).name ' (' num2str(length(unique(STUDY.cluster(cls(k)).sets(1,:)))) ' Ss, ' num2str(length(STUDY.cluster(cls(k)).comps)),' ICs)']); + set(gcf,'name',['Scalp map of ' STUDY.cluster(cls(k)).name ' (' num2str(length(unique(STUDY.cluster(cls(k)).sets(1,:)))) ' Ss, ' num2str(length(STUDY.cluster(cls(k)).comps)),' ICs)']); + %title([ STUDY.cluster(cls(k)).name ' scalp map, ' num2str(length(unique(STUDY.cluster(cls(k)).sets(1,:)))) 'Ss' ]); + end + set(gcf,'Color', BACKCOLOR); + + orient tall + axcopy +end + +% std_plotcompmap() - Commandline function, to visualizing cluster components scalp maps. +% Displays the scalp maps of specified cluster components on separate figures. +% The scalp maps can be visualized only if component scalp maps +% were calculated and saved in the EEG datasets in the STUDY. +% These can be computed during pre-clustering using the GUI-based function +% pop_preclust() or the equivalent commandline functions eeg_createdata() +% and eeg_preclust(). A pop-function that calls this function is pop_clustedit(). +% Usage: +% >> [STUDY] = std_plotcompmap(STUDY, ALLEEG, cluster, comps); +% Inputs: +% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG. +% ALLEEG - global EEGLAB vector of EEG structures for the dataset(s) included in the STUDY. +% ALLEEG for a STUDY set is typically created using load_ALLEEG(). +% cluster - single cluster number. +% +% Optional inputs: +% comps - [numeric vector] -> indices of the cluster components to plot. +% 'all' -> plot all the components in the cluster +% (as in std_topoplot). {default: 'all'}. +% +% Outputs: +% STUDY - the input STUDY set structure modified with plotted cluster scalp +% map mean, to allow quick replotting (unless cluster mean +% already existed in the STUDY). +% +% Example: +% >> cluster = 4; comps= [1 7 10]; +% >> [STUDY] = std_plotcompmap(STUDY,ALLEEG, cluster, comps); +% Plots components 1, 7 & 10 scalp maps of cluster 4 on separate figures. +% +% See also pop_clustedit, pop_preclust, eeg_createdata, std_topoplot +% +% Authors: Hilit Serby, Arnaud Delorme, Scott Makeig, SCCN, INC, UCSD, June, 2005 + +% Copyright (C) Hilit Serby, SCCN, INC, UCSD, June 07, 2005, hilit@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function STUDY = std_plotcompmap(STUDY, ALLEEG, cls, varargin) +icadefs; + +if ~exist('cls') + error('std_plotcompmap: you must provide a cluster numberas an input.'); +end +if isempty(cls) + error('std_plotcompmap: you must provide a cluster numberas an input.'); +end +if nargin == 3 % no component indices were given + % Default: plot all components of the cluster + [STUDY] = std_topoplot(STUDY, ALLEEG, 'clusters', cls, 'mode', 'apart'); + return +else + comp_ind = varargin{1}; +end +STUDY = std_readtopoclust(STUDY,ALLEEG, cls); +for ci = 1:length(comp_ind) + abset = STUDY.datasetinfo(STUDY.cluster(cls).sets(1,comp_ind(ci))).index; + subject = STUDY.datasetinfo(STUDY.cluster(cls).sets(1,comp_ind(ci))).subject; + comp = STUDY.cluster(cls).comps(comp_ind(ci)); + grid = STUDY.cluster(cls).topoall{comp_ind(ci)}; + xi = STUDY.cluster(cls).topox; + yi = STUDY.cluster(cls).topoy; + [Xi,Yi] = meshgrid(yi,xi); + figure; + toporeplot(grid, 'style', 'both', 'plotrad',0.5,'intrad',0.5,'xsurface', Xi, 'ysurface', Yi, 'verbose', 'off'); + title([subject ' / ' 'IC' num2str(comp) ', ' STUDY.cluster(cls).name ]); + set(gcf,'Color', BACKCOLOR); + axcopy; +end + diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_uniformfiles.m b/code/eeglab13_4_4b/functions/studyfunc/std_uniformfiles.m new file mode 100644 index 0000000..681d78c --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_uniformfiles.m @@ -0,0 +1,95 @@ +% std_uniformfiles() - Check uniform channel distribution accross data files +% +% Usage: +% >> boolval = std_uniformfiles(STUDY, ALLEEG); +% +% Inputs: +% STUDY - EEGLAB STUDY +% +% Outputs: +% boolval - [-1|0|1] 0 if non uniform, 1 if uniform, -1 if error +% +% Authors: Arnaud Delorme, SCCN/UCSD, CERCO/CNRS, 2010- + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function uniformlabels = std_uniformfiles( STUDY, ALLEEG ); + +if nargin < 2 + help std_checkconsist; + return; +end; + +filetypes = { 'daterp' 'datspec' 'datersp' 'datitc' 'dattimef' }; + +% set channel interpolation mode +% ------------------------------ +uniformlabels = []; + +count = 1; +selectedtypes = {}; +for index = 1:length(filetypes) + + % scan datasets + % ------------- + [ tmpstruct compinds filepresent ] = std_fileinfo(ALLEEG, filetypes{index}); + + % check if the structures are equal + % --------------------------------- + if ~isempty(tmpstruct) + if any(filepresent == 0) + uniformlabels = -1; + return; + else + firstval = tmpstruct(1).labels; + uniformlabels(count) = length(firstval); + for dat = 2:length(tmpstruct) + tmpval = tmpstruct(dat).labels; + if ~isequal(firstval, tmpval) + uniformlabels(count) = 0; + end; + end; + selectedtypes{count} = filetypes{index}; + count = count+1; + end; + end; +end; + +% check output +% ------------ +if any(uniformlabels == 0) + if any(uniformlabels) == 1 + disp('Warning: conflict between datafiles - all should have the same channel distribution'); + for index = 1:length(selectedtypes) + if uniformlabels(index) + fprintf(' Data files with extention "%s" have interpolated channels\n', selectedtypes{index}); + else fprintf(' Data files with extention "%s" have non-interpolated channels\n', selectedtypes{index}); + end; + end; + uniformlabels = -1; + else + uniformlabels = 0; + end; +else + if ~(length(unique(uniformlabels)) == 1) + fprintf('Warning: Data files have different number of channel in each file\n'); + for index = 1:length(selectedtypes) + fprintf(' Data files with extention "%s" have %d channels\n', selectedtypes{index}, uniformlabels(index)); + end; + end; + uniformlabels = 1; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/std_uniformsetinds.m b/code/eeglab13_4_4b/functions/studyfunc/std_uniformsetinds.m new file mode 100644 index 0000000..1a72694 --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/std_uniformsetinds.m @@ -0,0 +1,37 @@ +% std_uniformsetinds() - Check uniform channel distribution accross datasets +% +% Usage: +% >> boolval = std_uniformsetinds(STUDY); +% Inputs: +% STUDY - EEGLAB STUDY +% +% Outputs: +% boolval - [0|1] 1 if uniform +% +% Authors: Arnaud Delorme, SCCN/UCSD, CERCO/CNRS, 2010- + +% Copyright (C) Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function uniformchannels = std_uniformsetinds( STUDY ); + +uniformchannels = 1; +for c = 1:length(STUDY.changrp(1).setinds(:)) + tmpind = cellfun(@(x)(length(x{c})), { STUDY.changrp(:).setinds }); + if length(unique(tmpind)) ~= 1 + uniformchannels = 0; + end; +end; diff --git a/code/eeglab13_4_4b/functions/studyfunc/toporeplot.m b/code/eeglab13_4_4b/functions/studyfunc/toporeplot.m new file mode 100644 index 0000000..ad26f9c --- /dev/null +++ b/code/eeglab13_4_4b/functions/studyfunc/toporeplot.m @@ -0,0 +1,826 @@ +% toporeplot() - re-plot a saved topoplot() output image (a square matrix) +% in a 2-D circular scalp map view (as looking down at the top +% of the head). May also be used to re-plot a mean topoplot() +% map for a number of subjects and/or components without all +% the constitutent maps having the same channel montage. +% Nose is at top of plot. Left = left. See topoplot(). +% Usage: +% >> toporeplot(topoimage,'plotrad',val1, 'intrad',val2); +% % Use an existing (or mean) topoplot output image. Give the +% % original 'intrad' and 'plotrad' values used to in topoimage. +% >> toporeplot(topoimage,'plotrad',val1,'xsurface', Xi, 'ysurface',Yi ); +% % Use an existing (or mean) topoplot output image. Give the same +% % 'plotrad' value used to create it. Since 'intrad' was not input +% % to topoplot(), give the grid axes Xi and Yi as inputs. +% >> [hfig val ]= toporeplot(topoimage,'plotrad',val1, 'Param1','Value1', ...); +% % Give one of the two options above plus other optional parameters. +% Required inputs: +% topoimage - output image matrix (as) from topoplot(). For maximum flexibility, +% create topoimage using topoplot() options: 'plotrad',1, 'intrad',1 +% 'plotrad' - [0.15<=float<=1.0] plotting radius = max channel arc_length to plot. +% If plotrad > 0.5, chans with arc_length > 0.5 (i.e. below ears,eyes) +% are plotted in a circular 'skirt' outside the cartoon head. +% The topoimage depends on 'plotrad', so 'plotrad' is required to +% reproduce the 'topoplot' image. +% Optional inputs: +% 'chanlocs' - name of an EEG electrode position file (see >> topoplot example). +% Else, an EEG.chanlocs structure (see >> help pop_editset). +% 'maplimits' - 'absmax' -> scale map colors to +/- the absolute-max (makes green 0); +% 'maxmin' -> scale colors to the data range (makes green mid-range); +% [lo,hi] -> use user-definined lo/hi limits {default: 'absmax'} +% 'style' - 'map' -> plot colored map only +% 'contour' -> plot contour lines only +% 'both' -> plot both colored map and contour lines {default: 'both'} +% 'fill' -> plot constant color between contour lines +% 'blank' -> plot electrode locations only, requires electrode info. +% 'electrodes' - 'on','off','labels','numbers','ptslabels','ptsnumbers' See Plot detail +% options below. {default: 'on' -> mark electrode locations with points +% unless more than 64 channels, then 'off'}. Requires electrode info. +% 'intrad' - [0.15<=float<=1.0] radius of the interpolation area used in topoplot() +% to get the grid. +% 'headrad' - [0.15<=float<=1.0] drawing radius (arc_length) for the cartoon head. +% NB: Only headrad = 0.5 is anatomically correct! 0 -> don't draw head; +% 'rim' -> show cartoon head at outer edge of the plot {default: 0.5}. +% Requires electrode information. +% 'noplot' - [rad theta] are coordinates of a (possibly missing) channel. +% Do not plot but return interpolated value for channel location. +% Do not plot but return interpolated value for this location. +% 'xsurface' - [Xi- matrix] the Xi grid points for the surface of the plotting +% an output of topoplot(). +% 'ysurface' - [Yi- matrix] the Yi grid points for the surface of the plotting, +% an output of topoplot(). +% Dipole plotting: +% 'dipole' - [xi yi xe ye ze] plot dipole on the top of the scalp map +% from coordinate (xi,yi) to coordinates (xe,ye,ze) (dipole head +% model has radius 1). If several rows, plot one dipole per row. +% Coordinates returned by dipplot() may be used. Can accept +% an EEG.dipfit.model structure (See >> help dipplot). +% Ex: ,'dipole',EEG.dipfit.model(17) % Plot dipole(s) for comp. 17. +% 'dipnorm' - ['on'|'off'] normalize dipole length {default: 'on'}. +% 'diporient' - [-1|1] invert dipole orientation {default: 1}. +% 'diplen' - [real] scale dipole length {default: 1}. +% 'dipscale' - [real] scale dipole size {default: 1}. +% 'dipsphere' - [real] size of the dipole sphere. {default: 85 mm}. +% 'dipcolor' - [color] dipole color as Matlab code code or [r g b] vector +% {default: 'k' = black}. +% Plot detail options: +% 'electcolor' {'k'}|'emarker' {'.'}|'emarkersize' {14} ... +% |'emarkersize1chan' {40}|'efontsize' {var} - electrode marking details and {defaults}. +% 'shading' - 'flat','interp' {default: 'flat'} +% 'colormap' - (n,3) any size colormap {default: existing colormap} +% 'numcontour' - number of contour lines {default: 6} +% 'ccolor' - color of the contours {default: dark grey} +% 'hcolor'|'ecolor' - colors of the cartoon head and electrodes {default: black} +% 'circgrid' - [int > 100] number of elements (angles) in head and border circles {201} +% 'verbose' - ['on'|'off'] comment on operations on command line {default: 'on'}. +% +% Outputs: +% hfig - plot axes handle +% val - single interpolated value at the specified 'noplot' arg channel +% location ([rad theta]). +% +% Notes: - To change the plot map masking ring to a new figure background color, +% >> set(findobj(gca,'type','patch'),'facecolor',get(gcf,'color')) +% - Topoplots may be rotated from the commandline >> view([deg 90]) {default:[0 90]) +% +% Authors: Hilit Serby, Andy Spydell, Colin Humphries, Arnaud Delorme & Scott Makeig +% CNL / Salk Institute, 8/1996-/10/2001; SCCN/INC/UCSD, Nov. 2001- Nov. 2004 +% +% See also: topoplot(), timtopo(), envtopo() + +% Deprecated but still usable; +% 'interplimits' - ['electrodes'|'head'] 'electrodes'-> interpolate the electrode grid; +% 'head'-> interpolate the whole disk {default: 'head'}. + + +% toporeplot() - From topoplot.m, Revision 1.216 2004/12/05 12:00:00 hilit +%[hfig grid] = topoplot( EEG.icawinv(:, 5), EEG.chanlocs, 'verbose', 'off','electrodes', 'off' ,'style','both'); +%figure; toporeplot(grid, 'style', 'both', 'plotrad',0.5,'intrad',0.5, 'verbose', 'off'); + +function [handle,chanval] = toporeplot(grid,p1,v1,p2,v2,p3,v3,p4,v4,p5,v5,p6,v6,p7,v7,p8,v8,p9,v9,p10,v10) + +% +%%%%%%%%%%%%%%%%%%%%%%%% Set defaults %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +icadefs % read defaults MAXTOPOPLOTCHANS and DEFAULT_ELOC and BACKCOLOR +if ~exist('BACKCOLOR') % if icadefs.m does not define BACKCOLOR + BACKCOLOR = [.93 .96 1]; % EEGLAB standard +end +GRID_SCALE = length(grid); +noplot = 'off'; +handle = []; +chanval = NaN; +rmax = 0.5; % head radius - don't change this! +INTERPLIMITS = 'head'; % head, electrodes +MAPLIMITS = 'absmax'; % absmax, maxmin, [values] +CIRCGRID = 201; % number of angles to use in drawing circles +AXHEADFAC = 1.3; % head to axes scaling factor +CONTOURNUM = 6; % number of contour levels to plot +STYLE = 'both'; % default 'style': both,straight,fill,contour,blank +HEADCOLOR = [0 0 0]; % default head color (black) +CCOLOR = [0.2 0.2 0.2]; % default contour color +ECOLOR = [0 0 0]; % default electrode color +ELECTRODES = []; % default 'electrodes': on|off|label - set below +MAXDEFAULTSHOWLOCS = 64;% if more channels than this, don't show electrode locations by default +EMARKER = '.'; % mark electrode locations with small disks +EMARKERSIZE = []; % default depends on number of electrodes, set in code +EMARKERSIZE1CHAN = 40; % default selected channel location marker size +EMARKERCOLOR1CHAN = 'red'; % selected channel location marker color +EFSIZE = get(0,'DefaultAxesFontSize'); % use current default fontsize for electrode labels +HLINEWIDTH = 3; % default linewidth for head, nose, ears +BLANKINGRINGWIDTH = .035;% width of the blanking ring +HEADRINGWIDTH = .007;% width of the cartoon head ring +SHADING = 'flat'; % default 'shading': flat|interp +plotrad = []; % plotting radius ([] = auto, based on outermost channel location) +intrad = []; % default interpolation square is to outermost electrode (<=1.0) +headrad = []; % default plotting radius for cartoon head is 0.5 +MINPLOTRAD = 0.15; % can't make a topoplot with smaller plotrad (contours fail) +VERBOSE = 'off'; +MASKSURF = 'off'; + +%%%%%% Dipole defaults %%%%%%%%%%%% +DIPOLE = []; +DIPNORM = 'on'; +DIPSPHERE = 85; +DIPLEN = 1; +DIPSCALE = 1; +DIPORIENT = 1; +DIPCOLOR = [0 0 0]; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% +%%%%%%%%%%%%%%%%%%%%%%% Handle arguments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if nargin< 1 + help topoplot; + return +end +nargs = nargin; +if ~mod(nargs,2) + error('Optional inputs must come in Key - Val pairs') +end +if ~isnumeric(grid) | size(grid,1) ~= size(grid,2) + error('topoimage must be a square matrix'); +end +for i = 2:2:nargs + Param = eval(['p',int2str((i-2)/2 +1)]); + Value = eval(['v',int2str((i-2)/2 +1)]); + if ~isstr(Param) + error('Flag arguments must be strings') + end + Param = lower(Param); + switch lower(Param) + case 'chanlocs' + loc_file = Value; + case 'colormap' + if size(Value,2)~=3 + error('Colormap must be a n x 3 matrix') + end + colormap(Value) + case {'interplimits','headlimits'} + if ~isstr(Value) + error('''interplimits'' value must be a string') + end + Value = lower(Value); + if ~strcmp(Value,'electrodes') & ~strcmp(Value,'head') + error('Incorrect value for interplimits') + end + INTERPLIMITS = Value; + case 'verbose' + VERBOSE = Value; + case 'maplimits' + MAPLIMITS = Value; + case 'masksurf' + MASKSURF = Value; + case 'circgrid' + CIRCGRID = Value; + if isstr(CIRCGRID) | CIRCGRID<100 + error('''circgrid'' value must be an int > 100'); + end + case 'style' + STYLE = lower(Value); + case 'numcontour' + CONTOURNUM = Value; + case 'electrodes' + ELECTRODES = lower(Value); + if strcmpi(ELECTRODES,'pointlabels') | strcmpi(ELECTRODES,'ptslabels') ... + | strcmpi(ELECTRODES,'labelspts') | strcmpi(ELECTRODES,'ptlabels') ... + | strcmpi(ELECTRODES,'labelpts') + ELECTRODES = 'labelpoint'; % backwards compatability + end + if strcmpi(ELECTRODES,'pointnumbers') | strcmpi(ELECTRODES,'ptsnumbers') ... + | strcmpi(ELECTRODES,'numberspts') | strcmpi(ELECTRODES,'ptnumbers') ... + | strcmpi(ELECTRODES,'numberpts') | strcmpi(ELECTRODES,'ptsnums') ... + | strcmpi(ELECTRODES,'numspts') + ELECTRODES = 'numpoint'; % backwards compatability + end + if strcmpi(ELECTRODES,'nums') + ELECTRODES = 'numbers'; % backwards compatability + end + if strcmpi(ELECTRODES,'pts') + ELECTRODES = 'on'; % backwards compatability + end + if ~strcmpi(ELECTRODES,'labelpoint') ... + & ~strcmpi(ELECTRODES,'numpoint') ... + & ~strcmp(ELECTRODES,'on') ... + & ~strcmp(ELECTRODES,'off') ... + & ~strcmp(ELECTRODES,'labels') ... + & ~strcmpi(ELECTRODES,'numbers') + error('Unknown value for keyword ''electrodes'''); + end + case 'dipole' + DIPOLE = Value; + case 'dipsphere' + DIPSPHERE = Value; + case 'dipnorm' + DIPNORM = Value; + case 'diplen' + DIPLEN = Value; + case 'dipscale' + DIPSCALE = Value; + case 'diporient' + DIPORIENT = Value; + case 'dipcolor' + DIPCOLOR = Value; + case 'emarker' + EMARKER = Value; + case 'plotrad' + plotrad = Value; + if isstr(plotrad) | (plotrad < MINPLOTRAD | plotrad > 1) + error('plotrad argument should be a number between 0.15 and 1.0'); + end + case 'intrad' + intrad = Value; + if isstr(intrad) | (intrad < MINPLOTRAD | intrad > 1) + error('intrad argument should be a number between 0.15 and 1.0'); + end + case 'headrad' + headrad = Value; + if isstr(headrad) & ( strcmpi(headrad,'off') | strcmpi(headrad,'none') ) + headrad = 0; % undocumented 'no head' alternatives + end + if isempty(headrad) % [] -> none also + headrad = 0; + end + if ~isstr(headrad) + if ~(headrad==0) & (headrad < MINPLOTRAD | headrad>1) + error('bad value for headrad'); + end + elseif ~strcmpi(headrad,'rim') + error('bad value for headrad'); + end + case 'xsurface' + Xi = Value; + if ~isnumeric(Xi) | size(Xi,1) ~= size(Xi,2) | size(Xi,1) ~= size(grid,1) + error('xsurface must be a square matrix the size of grid'); + end + case 'ysurface' + Yi = Value; + if ~isnumeric(Yi) | size(Yi,1) ~= size(Yi,2) | size(Yi,1) ~= size(grid,1) + error('ysurface must be a square matrix the size of grid'); + end + case {'headcolor','hcolor'} + HEADCOLOR = Value; + case {'contourcolor','ccolor'} + CCOLOR = Value; + case {'electcolor','ecolor'} + ECOLOR = Value; + case {'emarkersize','emsize'} + EMARKERSIZE = Value; + case 'emarkersize1chan' + EMARKERSIZE1CHAN= Value; + case {'efontsize','efsize'} + EFSIZE = Value; + case 'shading' + SHADING = lower(Value); + if ~any(strcmp(SHADING,{'flat','interp'})) + error('Invalid shading parameter') + end + case 'noplot' + noplot = Value; + if ~isstr(noplot) + if length(noplot) ~= 2 + error('''noplot'' location should be [radius, angle]') + else + chanrad = noplot(1); + chantheta = noplot(2); + noplot = 'on'; + end + end + otherwise + error(['Unknown input parameter ''' Param ''' ???']) + end +end + +if isempty(plotrad) + error(' ''plotrad'' must be given') +end +if isempty(intrad) + if ~exist('Yi') | ~exist('Xi') + error('either ''intrad'' or the grid axes (Xi and Yi) must be given'); + end +end + +% +%%%%%%%%%%%%%%%%%%%% Read the channel location information %%%%%%%%%%%%%%%%%%%%%%%% +% +if exist('loc_file') + if isstr(loc_file) + [tmpeloc labels Th Rd indices] = readlocs(loc_file,'filetype','loc'); + else % a locs struct + [tmpeloc labels Th Rd indices] = readlocs(loc_file); + % Note: Th and Rd correspond to indices channels-with-coordinates only + end + labels = strvcat(labels); + Th = pi/180*Th; % convert degrees to radians + + % + %%%%%%%%%%%%%%%%%% Read plotting radius from chanlocs %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if isempty(plotrad) & isfield(tmpeloc, 'plotrad'), + plotrad = tmpeloc(1).plotrad; + if isstr(plotrad) % plotrad shouldn't be a string + plotrad = str2num(plotrad) % just checking + end + if plotrad < MINPLOTRAD | plotrad > 1.0 + fprintf('Bad value (%g) for plotrad.\n',plotrad); + error(' '); + end + if strcmpi(VERBOSE,'on') & ~isempty(plotrad) + fprintf('Plotting radius plotrad (%g) set from EEG.chanlocs.\n',plotrad); + end + end; + if isempty(plotrad) + plotrad = min(1.0,max(Rd)*1.02); % default: just outside the outermost electrode location + plotrad = max(plotrad,0.5); % default: plot out to the 0.5 head boundary + end % don't plot channels with Rd > 1 (below head) + + if isstr(plotrad) | plotrad < MINPLOTRAD | plotrad > 1.0 + error('plotrad must be between 0.15 and 1.0'); + end +end +if isempty(plotrad) & ~ exist('loc_file') + plotrad = 1; % default: plot out to the 0.5 head bounda +end +% plotrad now set + +% +%%%%%%%%%%%%%%%%%%%%%%% Set radius of head cartoon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if isempty(headrad) % never set -> defaults + if plotrad >= rmax + headrad = rmax; % (anatomically correct) + else % if plotrad < rmax + headrad = 0; % don't plot head + if strcmpi(VERBOSE, 'on') + fprintf('topoplot(): not plotting cartoon head since plotrad (%5.4g) < 0.5\n',... + plotrad); + end + end +elseif strcmpi(headrad,'rim') % force plotting at rim of map + headrad = plotrad; +end + +% headrad now set + +% +%%%%%%%%%%%%%%%%% Issue warning if headrad ~= rmax %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + +if headrad ~= 0.5 & strcmpi(VERBOSE, 'on') + fprintf(' NB: Plotting map using ''plotrad'' %-4.3g,',plotrad); + fprintf( ' ''headrad'' %-4.3g\n',headrad); + fprintf('Warning: The plotting radius of the cartoon head is NOT anatomically correct (0.5).\n') +end + +squeezefac = rmax/plotrad; + +% +%%%%%%%%%%%%%%%%%%%%% Find plotting channels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if exist('tmpeloc') + pltchans = find(Rd <= plotrad); % plot channels inside plotting circle + [x,y] = pol2cart(Th,Rd); % transform electrode locations from polar to cartesian coordinates + % + %%%%%%%%%%%%%%%%%%%%% Eliminate channels not plotted %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + allx = x; + ally = y; + + + Th = Th(pltchans); % eliminate channels outside the plotting area + Rd = Rd(pltchans); + x = x(pltchans); + y = y(pltchans); + + labels= labels(pltchans,:); + + % + %%%%%%%%%%%%%%% Squeeze channel locations to <= rmax %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + Rd = Rd*squeezefac; % squeeze electrode arc_lengths towards the vertex + % to plot all inside the head cartoon + x = x*squeezefac; + y = y*squeezefac; + allx = allx*squeezefac; + ally = ally*squeezefac; +end +% Note: Now outermost channel will be plotted just inside rmax + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Make the plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~strcmpi(STYLE,'blank') % if draw interpolated scalp map + % + %%%%%%%%%%%%%%%%%%%%%%% Interpolate scalp map data %%%%%%%%%%%%%%%%%%%%%%%% + % + if ~isempty(intrad) % intrad specified + xi = linspace(-intrad*squeezefac,intrad*squeezefac,GRID_SCALE); % use the specified intrad value + yi = linspace(-intrad*squeezefac,intrad*squeezefac,GRID_SCALE); + [Xi,Yi] = meshgrid(yi',xi); + elseif ~exist('Xi') | ~exist('Yi') + error('toporeplot require either intrad input or both xsurface and ysurface') + end + Zi = grid; + mask = (sqrt(Xi.^2 + Yi.^2) <= rmax); % mask outside the plotting circle + ii = find(mask == 0); + Zi(ii) = NaN; + + % + %%%%%%%%%% Return interpolated value at designated scalp location %%%%%%%%%% + % + if exist('chanrad') % optional first argument to 'noplot' + chantheta = (chantheta/360)*2*pi; + chancoords = round(ceil(GRID_SCALE/2)+GRID_SCALE/2*2*chanrad*[cos(-chantheta),... + -sin(-chantheta)]); + if chancoords(1)<1 ... + | chancoords(1) > GRID_SCALE ... + | chancoords(2)<1 ... + | chancoords(2)>GRID_SCALE + error('designated ''noplot'' channel out of bounds') + else + chanval = Zi(chancoords(1),chancoords(2)); + end + end + % + %%%%%%%%%%%%%%%%%%%%%%%%%% Return interpolated image only %%%%%%%%%%%%%%%%% + % + if strcmpi(noplot, 'on') + if strcmpi(VERBOSE,'on') + fprintf('topoplot(): no plot requested.\n') + end + return; + end + % + %%%%%%%%%%%%%%%%%%%%%%% Calculate colormap limits %%%%%%%%%%%%%%%%%%%%%%%%%% + % + m = size(colormap,1); + if isstr(MAPLIMITS) + if strcmp(MAPLIMITS,'absmax') + amin = -max(max(abs(Zi))); + amax = max(max(abs(Zi))); + elseif strcmp(MAPLIMITS,'maxmin') | strcmp(MAPLIMITS,'minmax') + amin = min(min(Zi)); + amax = max(max(Zi)); + else + error('unknown ''maplimits'' value.'); + end + else + amin = MAPLIMITS(1); + amax = MAPLIMITS(2); + end + delta = Xi(1,2)-Xi(1,1); % length of grid entry + + % + %%%%%%%%%%%%%%%%%%%%%%%%%% Scale the axes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + cla % clear current axis + hold on + h = gca; % uses current axes + + % instead of default larger AXHEADFAC + if squeezefac<0.92 & plotrad-headrad > 0.05 % (size of head in axes) + AXHEADFAC = 1.05; % do not leave room for external ears if head cartoon + % shrunk enough by the 'skirt' option + end + + set(gca,'Xlim',[-rmax rmax]*AXHEADFAC,'Ylim',[-rmax rmax]*AXHEADFAC); + % specify size of head axes in gca + + unsh = (GRID_SCALE+1)/GRID_SCALE; % un-shrink the effects of 'interp' SHADING + + switch STYLE + % + %%%%%%%%%%%%%%%%%%%%%%%% Plot map contours only %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + case 'contour' % plot surface contours only + [cls chs] = contour(Xi,Yi,Zi,CONTOURNUM,'k'); + % + %%%%%%%%%%%%%%%%%%%%%%%% Else plot map and contours %%%%%%%%%%%%%%%%%%%%%%%%% + % + case 'both' % plot interpolated surface and surface contours + if strcmp(SHADING,'interp') + tmph = surface(Xi*unsh,Yi*unsh,zeros(size(Zi)),Zi,... + 'EdgeColor','none','FaceColor',SHADING); + else % SHADING == 'flat' + tmph = surface(Xi-delta/2,Yi-delta/2,zeros(size(Zi)),Zi,... + 'EdgeColor','none','FaceColor',SHADING); + end + if strcmpi(MASKSURF, 'on') + set(tmph, 'visible', 'off'); + handle = tmph; + end; + [cls chs] = contour(Xi,Yi,Zi,CONTOURNUM,'k'); + for h=chs, set(h,'color',CCOLOR); end + % + %%%%%%%%%%%%%%%%%%%%%%%% Else plot map only %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + case {'straight', 'map'} % 'straight' was former arg + if strcmp(SHADING,'interp') % 'interp' mode is shifted somehow... but how? + tmph = surface(Xi*unsh,Yi*unsh,zeros(size(Zi)),Zi,'EdgeColor','none',... + 'FaceColor',SHADING); + else + tmph = surface(Xi-delta/2,Yi-delta/2,zeros(size(Zi)),Zi,'EdgeColor','none',... + 'FaceColor',SHADING); + end + if strcmpi(MASKSURF, 'on') + set(tmph, 'visible', 'off'); + handle = tmph; + end; + % + %%%%%%%%%%%%%%%%%% Else fill contours with uniform colors %%%%%%%%%%%%%%%%%% + % + case 'fill' + [cls chs] = contourf(Xi,Yi,Zi,CONTOURNUM,'k'); + otherwise + error('Invalid style') + end + + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Set color axis %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + caxis([amin amax]) % set coloraxis + % + %%%%%%%%%%%%%%%%%%%%%%% Draw blank head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + else % if STYLE 'blank' + if strcmpi(noplot, 'on') + if strcmpi(VERBOSE,'on') + fprintf('topoplot(): no plot requested.\n') + end + return; + end + cla + hold on + set(gca,'Xlim',[-rmax rmax]*AXHEADFAC,'Ylim',[-rmax rmax]*AXHEADFAC) + if ~exist('tmpeloc') + error('No electrode location information found'); + end + if strcmp(ELECTRODES,'labelpoint') | strcmp(ELECTRODES,'numpoint') + text(-0.6,-0.6, [ int2str(length(Rd)) ' of ' int2str(length(tmpeloc)) ' electrode locations shown']); + text(-0.6,-0.7, [ 'Click on electrodes to toggle name/number']); + tl = title('Channel locations'); + set(tl, 'fontweight', 'bold'); + end + end + +if exist('handle') ~= 1 + handle = gca; +end; + +% +%%%%%%%%%%%%%%%%%%% Plot filled ring to mask jagged grid boundary %%%%%%%%%%%%%%%%%%%%%%%%%%% +% +hwidth = HEADRINGWIDTH; % width of head ring +hin = squeezefac*headrad*(1- hwidth/2); % inner head ring radius + +if strcmp(SHADING,'interp') + rwidth = BLANKINGRINGWIDTH*1.3; % width of blanking outer ring +else + rwidth = BLANKINGRINGWIDTH; % width of blanking outer ring +end +rin = rmax*(1-rwidth/2); % inner ring radius +if hin>rin + rin = hin; % dont blank inside the head ring +end + +circ = linspace(0,2*pi,CIRCGRID); +rx = sin(circ); +ry = cos(circ); +ringx = [[rx(:)' rx(1) ]*(rin+rwidth) [rx(:)' rx(1)]*rin]; +ringy = [[ry(:)' ry(1) ]*(rin+rwidth) [ry(:)' ry(1)]*rin]; + +if ~strcmpi(STYLE,'blank') + ringh= patch(ringx,ringy,0.01*ones(size(ringx)),BACKCOLOR,'edgecolor','none'); hold on +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%% Plot cartoon head, ears, nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if headrad > 0 % if cartoon head to be plotted +% +%%%%%%%%%%%%%%%%%%% Plot head outline %%%%%%%%%%%%%%%%%%%%%%%%%%% +% +headx = [[rx(:)' rx(1) ]*(hin+hwidth) [rx(:)' rx(1)]*hin]; +heady = [[ry(:)' ry(1) ]*(hin+hwidth) [ry(:)' ry(1)]*hin]; + +ringh= patch(headx,heady,ones(size(headx)),HEADCOLOR,'edgecolor',HEADCOLOR); hold on + +% +%%%%%%%%%%%%%%%%%%% Plot ears and nose %%%%%%%%%%%%%%%%%%%%%%%%%%% +% + base = rmax-.0046; + basex = 0.18*rmax; % nose width + tip = 1.15*rmax; + tiphw = .04*rmax; % nose tip half width + tipr = .01*rmax; % nose tip rounding + q = .04; % ear lengthening + EarX = [.497-.005 .510 .518 .5299 .5419 .54 .547 .532 .510 .489-.005]; % rmax = 0.5 + EarY = [q+.0555 q+.0775 q+.0783 q+.0746 q+.0555 -.0055 -.0932 -.1313 -.1384 -.1199]; + sf = headrad/plotrad; % squeeze the model ears and nose + % by this factor + plot3([basex;tiphw;0;-tiphw;-basex]*sf,[base;tip-tipr;tip;tip-tipr;base]*sf,... + 2*ones(size([basex;tiphw;0;-tiphw;-basex])),... + 'Color',HEADCOLOR,'LineWidth',HLINEWIDTH); % plot nose + plot3(EarX*sf,EarY*sf,2*ones(size(EarX)),'color',HEADCOLOR,'LineWidth',HLINEWIDTH) % plot left ear + plot3(-EarX*sf,EarY*sf,2*ones(size(EarY)),'color',HEADCOLOR,'LineWidth',HLINEWIDTH) % plot right ear +end + +% +% %%%%%%%%%%%%%%%%%%% Show electrode information %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + plotax = gca; + axis square % make plotax square + axis off + + pos = get(gca,'position'); + xlm = get(gca,'xlim'); + ylm = get(gca,'ylim'); + + axis square % make textax square + + pos = get(gca,'position'); + set(plotax,'position',pos); + + xlm = get(gca,'xlim'); + set(plotax,'xlim',xlm); + + ylm = get(gca,'ylim'); + set(plotax,'ylim',ylm); % copy position and axis limits again + + %%%%%%%%%%%%%%%%%%%%%%%%%only if electrode info is available %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if exist('tmpeloc') + if isempty(EMARKERSIZE) + EMARKERSIZE = 10; + if length(y)>=32 + EMARKERSIZE = 8; + elseif length(y)>=48 + EMARKERSIZE = 6; + elseif length(y)>=64 + EMARKERSIZE = 5; + elseif length(y)>=80 + EMARKERSIZE = 4; + elseif length(y)>=100 + EMARKERSIZE = 3; + elseif length(y)>=128 + EMARKERSIZE = 2; + elseif length(y)>=160 + EMARKERSIZE = 1; + end + end + % + %%%%%%%%%%%%%%%%%%%%%%%% Mark electrode locations only %%%%%%%%%%%%%%%%%%%%%%%%%% + % + ELECTRODE_HEIGHT = 2.1; % z value for plotting electrode information (above the surf) + + if strcmp(ELECTRODES,'on') % plot electrodes as spots + hp2 = plot3(y,x,ones(size(x))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE); + % + %%%%%%%%%%%%%%%%%%%%%%%% Print electrode labels only %%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + elseif strcmp(ELECTRODES,'labels') % print electrode names (labels) + for i = 1:size(labels,1) + text(double(y(i)),double(x(i)),... + ELECTRODE_HEIGHT,labels(i,:),'HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',ECOLOR,... + 'FontSize',EFSIZE) + end + % + %%%%%%%%%%%%%%%%%%%%%%%% Mark electrode locations plus labels %%%%%%%%%%%%%%%%%%% + % + elseif strcmp(ELECTRODES,'labelpoint') + hp2 = plot3(y,x,ones(size(x))*ELECTRODE_HEIGHT,... + EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE); + for i = 1:size(labels,1) + hh(i) = text(double(y(i)+0.01),double(x(i)),... + ELECTRODE_HEIGHT,labels(i,:),'HorizontalAlignment','left',... + 'VerticalAlignment','middle','Color', ECOLOR,'userdata', num2str(pltchans(i)), ... + 'FontSize',EFSIZE, 'buttondownfcn', ... + ['tmpstr = get(gco, ''userdata'');'... + 'set(gco, ''userdata'', get(gco, ''string''));' ... + 'set(gco, ''string'', tmpstr); clear tmpstr;'] ); + end + % + %%%%%%%%%%%%%%%%%%%%%%% Mark electrode locations plus numbers %%%%%%%%%%%%%%%%%%% + % + elseif strcmp(ELECTRODES,'numpoint') + hp2 = plot3(y,x,ones(size(x))*ELECTRODE_HEIGHT,EMARKER,'Color',ECOLOR,'markersize',EMARKERSIZE); + for i = 1:size(labels,1) + hh(i) = text(double(y(i)+0.01),double(x(i)),... + ELECTRODE_HEIGHT,num2str(pltchans(i)),'HorizontalAlignment','left',... + 'VerticalAlignment','middle','Color', ECOLOR,'userdata', labels(i,:) , ... + 'FontSize',EFSIZE, 'buttondownfcn', ... + ['tmpstr = get(gco, ''userdata'');'... + 'set(gco, ''userdata'', get(gco, ''string''));' ... + 'set(gco, ''string'', tmpstr); clear tmpstr;'] ); + end + % + %%%%%%%%%%%%%%%%%%%%%% Print electrode numbers only %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + elseif strcmp(ELECTRODES,'numbers') + for i = 1:size(labels,1) + text(double(y(i)),double(x(i)),... + ELECTRODE_HEIGHT,int2str(pltchans(i)),'HorizontalAlignment','center',... + 'VerticalAlignment','middle','Color',ECOLOR,... + 'FontSize',EFSIZE) + end + end +end + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%% Plot dipole(s) on the scalp map %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +if ~isempty(DIPOLE) + hold on; + tmp = DIPOLE; + if isstruct(DIPOLE) + if ~isfield(tmp,'posxyz') + error('dipole structure is not an EEG.dipfit.model') + end + DIPOLE = []; % Note: invert x and y from dipplot usage + DIPOLE(:,1) = -tmp.posxyz(:,2)/DIPSPHERE; % -y -> x + DIPOLE(:,2) = tmp.posxyz(:,1)/DIPSPHERE; % x -> y + DIPOLE(:,3) = -tmp.momxyz(:,2); + DIPOLE(:,4) = tmp.momxyz(:,1); + else + DIPOLE(:,1) = -tmp(:,2); % same for vector input + DIPOLE(:,2) = tmp(:,1); + DIPOLE(:,3) = -tmp(:,4); + DIPOLE(:,4) = tmp(:,3); + end; + for index = 1:size(DIPOLE,1) + if ~any(DIPOLE(index,:)) + DIPOLE(index,:) = []; + end + end; + DIPOLE(:,1:4) = DIPOLE(:,1:4)*rmax*(rmax/plotrad); % scale radius from 1 -> rmax (0.5) + DIPOLE(:,3:end) = (DIPOLE(:,3:end))*rmax/100000*(rmax/plotrad); + if strcmpi(DIPNORM, 'on') + for index = 1:size(DIPOLE,1) + DIPOLE(index,3:4) = DIPOLE(index,3:4)/norm(DIPOLE(index,3:end))*0.2; + end; + end; + DIPOLE(:, 3:4) = DIPORIENT*DIPOLE(:, 3:4)*DIPLEN; + + PLOT_DIPOLE=1; + if sum(DIPOLE(1,3:4).^2) <= 0.00001 + if strcmpi(VERBOSE,'on') + fprintf('Note: dipole is length 0 - not plotted\n') + end + PLOT_DIPOLE = 0; + end + if 0 % sum(DIPOLE(1,1:2).^2) > plotrad + if strcmpi(VERBOSE,'on') + fprintf('Note: dipole is outside plotting area - not plotted\n') + end + PLOT_DIPOLE = 0; + end + if PLOT_DIPOLE + for index = 1:size(DIPOLE,1) + hh = plot( DIPOLE(index, 1), DIPOLE(index, 2), '.'); + set(hh, 'color', DIPCOLOR, 'markersize', DIPSCALE*30); + hh = line( [DIPOLE(index, 1) DIPOLE(index, 1)+DIPOLE(index, 3)]', ... + [DIPOLE(index, 2) DIPOLE(index, 2)+DIPOLE(index, 4)]'); + set(hh, 'color', DIPCOLOR, 'linewidth', DIPSCALE*30/7); + end; + end; +end; + +% +%%%%%%%%%%%%% Set EEGLAB background color to match head border %%%%%%%%%%%%%%%%%%%%%%%% +% +try, + icadefs; + set(gcf, 'color', BACKCOLOR); + catch, +end; + +hold off +axis off +return diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/angtimewarp.m b/code/eeglab13_4_4b/functions/timefreqfunc/angtimewarp.m new file mode 100644 index 0000000..d6cd756 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/angtimewarp.m @@ -0,0 +1,126 @@ +% angtimewarp() - Given two event marker vectors, computes a +% warping of the input angular time series so that its +% evlatencies match newlatencies. Values of the warped +% timeserie that falls between two frames in the original +% timeserie will be linearly interpolated under the +% assumption that phase change is minimal between two +% successive time points. +% Usage: +% >> warpAngs = angtimewarp(evlatency, newlatency, angData) +% +% Necessary inputs: +% evlatency - [vector] time markers on the original time-series, in +% frames. Markers must be ordered by increasing +% latency. If you want to warp the entire time series, +% make sure frame 1 and the last frame are in the vector. +% newlatency - [vector] desired time marker latencies. The original +% time series will be warped so that its time markers (see +% evlatency) match the ones in newlatency. newlatency +% frames must be sorted by ascending latencies in frames. +% Both vectors have to be the same length. +% angData - [vector] original angular time series (in radians). +% Angles should be between -pi and pi. +% +% Optional outputs: +% warpAngs - [vector] warped angular time-course, with values between +% -pi and pi +% +% Example: +% >> angs = 2*pi*rand(1,10)-pi; +% >> warpangs = angtimewarp([1 5 10], [1 6 10], angs) +% +% Authors: Jean Hausser, SCCN/INC/UCSD, 2006 +% +% See also: timeWarp(), phasecoher(), erpimage(), newtimef() +% + +function angdataw=angtimewarp(evLatency, newLatency, angdata) + + if min(sort(evLatency) == evLatency) == 0 + error('evlatency should be sorted'); + return; + end + if min(sort(newLatency) == newLatency) == 0 + error('newlatency should be sorted'); + return; + end + if length(evLatency) ~= length(newLatency) + error('evlatency and newlatency must have the same length.'); + return; + end + if length(evLatency) < 2 | length(newLatency) < 2 + error(['There should be at least two events in evlatency and ' ... + 'newlatency, that is "begin" and "end"' ]); + return; + end + if evLatency(1) ~= 1 + disp(['Assuming old and new time series beginnings are ' ... + 'synchronized']); + disp(['Make sure you defined an end event for both old and new time ' ... + 'series !']); + evLatency(end+1)=1; + newLatency(end+1)=1; + evLatency = sort(evLatency); + newLatency = sort(newLatency); + end + + t = 1:max(evLatency); + + for k=1:length(evLatency)-1 + for i=evLatency(k):evLatency(k+1)-1 + tp(i) = (t(i)-evLatency(k)) * ... + (newLatency(k+1) - newLatency(k))/... + (evLatency(k+1) - evLatency(k)) + ... + newLatency(k); + end + end + + + %Check what's going on at tp(max(newLatency)), should equal t(max(evLatency)) +% $$$ keyboard; + tp(max(evLatency)) = max(newLatency); + ts = tp-min(newLatency)+1; + +% $$$ M = sparse(max(newLatency)-min(newLatency)+1, max(evLatency)); +% $$$ M = zeros(max(newLatency)-min(newLatency)+1, max(evLatency)); + angdataw = zeros(1, max(newLatency)-min(newLatency)+1); + + k = 0; + for i=1:length(angdataw) + while i > ts(k+1) + k = k+1; + end +% $$$ k = k-1; + +% $$$ keyboard; + if k == 0 + % Check wether i == ts(1) and i == 1 + % In that case, M(1,1) = 1 +% $$$ keyboard; +% $$$ M(1,1) = 1; + angdataw(1) = angdata(1); + else +% $$$ M(i,k) = 1 - (i-ts(k))/(ts(k+1)-ts(k)); +% $$$ M(i,k+1) = 1 - (ts(k+1)-i)/(ts(k+1)-ts(k)); + + %Linear interp + angdataw(i) = angdata(k)*(1 - (i-ts(k))/(ts(k+1)-ts(k))) + ... + angdata(k+1)*(1 - (ts(k+1)-i)/(ts(k+1)-ts(k))); + + %Correction because angles have a ring structure + theta1 = [angdata(k) angdata(k+1) angdataw(i)]; + theta2 = theta1 - min(angdata(k), angdata(k+1)); + theta2max = max(theta2(1), theta2(2)); +% $$$ if i == 13 +% $$$ keyboard; %so we get a chance to check wether 0= pi & theta2(3) >= theta2max) | ... + theta2(3) == theta2(1) | theta2(3) == theta2(2) ) + angdataw(i) = angdataw(i) + pi; + end + if angdataw(i) > pi %Make sure we're still on [-pi, pi] + angdataw(i) = angdataw(i) - 2*pi; + end + end + end diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/bootstat.m b/code/eeglab13_4_4b/functions/timefreqfunc/bootstat.m new file mode 100644 index 0000000..0d0603e --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/bootstat.m @@ -0,0 +1,497 @@ +% bootstat() - accumulate surrogate data to assess significance by permutation of some +% measure of two input variables. +% +% If 'distfit','on', fits the psd with a 4th-order polynomial using the +% data kurtosis, as in Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., +% Mykkytka, E.F. "A probability distribution and its uses in fitting data." +% Technometrics, 21:201-214, 1979. +% Usage: +% >> [rsignif,rboot] = bootstat( { arg1 arg2 ...}, formula, varargin ...); +% Inputs: +% arg1 - [array] 1-D, 2-D or 3-D array of values +% arg2 - [array] 1-D, 2-D or 3-D array of values +% formula - [string] formula to compute the given measure. Takes arguments +% 'arg1', 'arg2' as inputs and 'res' (result, by default) as output. +% For data arrays of more than 1 dimension, the formula must be iterative +% so that shuffling can occur at each step while scanning the last +% array dimension. Examples: +% 'res = arg1 - arg2' % difference of two 1-D data arrays +% 'res = mean( arg1 .* arg2)' % mean projection of two 1-D data arrays +% 'res = res + arg1 .* conj(arg2)' % iterative, for use with 2|3-D arrays +% Optional inputs: +% 'boottype ' - ['rand'|'shuffle'] +% 'rand' = do not shuffle data. Only flip polarity randomly (for real +% number) or phase (for complex numbers). +% 'shuffle' = shuffle values of first argument (see two options below). +% Default. +% 'shuffledim' - [integer] indices of dimensions to shuffle. For instance, [1 2] will +% shuffle the first two dimensions. Default is to shuffle along +% dimension 2. +% 'shufflemode' - ['swap'|'regular'] shuffle mode. Either swap dimensions (for instance +% swap rows then columns if dimension [1 2] are selected) or shuffle +% in each dimension independently (slower). If only one dimension is +% selected for shuffling, this option does not change the result. +% 'randmode' - ['opposite'|'inverse'] randomize sign (or phase for complex number, +% or randomly set half the value to reference. +% 'alpha' - [real] significance level (between 0 and 1) {default 0.05}. +% 'naccu' - [integer] number of exemplars to accumulate {default 200}. +% 'bootside' - ['both'|'upper'] side of the surrogate distribution to +% consider for significance. This parameter affects the size +% of the last dimension of the accumulation array ('accres') +% (size is 2 for 'both' and 1 for 'upper') {default: 'both'}. +% 'basevect' - [integer vector] time vector indices for baseline in second dimension. +% {default: all time points}. +% 'rboot' - accumulation array (from a previous call). Allows faster +% computation of the 'rsignif' output {default: none}. +% 'formulaout' - [string] name of the computed variable {default: 'res'}. +% 'dimaccu' - [integer] use dimension in result to accumulate data. +% For instance if the result array is size [60x50] and this value is 2, +% the function will consider than 50 times 60 value have been accumulated. +% +% Fitting distribution: +% 'distfit' - ['on'|'off'] fit distribution with known function to compute more accurate +% limits or exact p-value (see 'vals' option). The MATLAB statistical toolbox +% is required. This option is currently implemented only for 1-D data. +% 'vals' - [float array] significance values. 'alpha' is ignored and +% rsignif returns the p-values. Requires 'distfit' (see above). +% This option currently implemented only for 1-D data. +% 'correctp' - [phat pci zerofreq] parameters for correcting for a biased probability +% distribution (requires 'distfit' above). See help of correctfit(). +% Outputs: +% rsignif - significance arrays. 2 values (low high) for each point (use +% 'alpha' to change these limits). +% rboot - accumulated surrogate data values. +% +% Authors: Arnaud Delorme, Bhaktivedcanta Institute, Mumbai, India, Nov 2004 +% +% See also: timef() + +% NOTE: There is an undocumented parameter, 'savecoher', [0|1] +% HELP TEXT REMOVED: (Ex: Using option 'both', coherence during baseline would be +% ignored since times are shuffled during each accumulation. + +% Copyright (C) 9/2002 Arnaud Delorme & Scott Makeig, SCCN/INC/UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% ************************************* +% To fit the psd with as 4th order polynomial using the distribution kurtosis, +% Reference: Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., Mykkytka, E.F. +% "A probability distribution and its uses in fitting data." +% Technimetrics, 1979, 21: 201-214. +% ************************************* + +function [accarrayout, Rbootout, Rbootout2] = bootstat(oriargs, formula, varargin) +% nb_points, timesout, naccu, baselength, baseboot, boottype, alpha, rboot); + +if nargin < 2 + help bootstat; + return; +end; + +if ~isstr(formula) + error('The second argument must be a string formula'); +end; + +g = finputcheck(varargin, ... + { 'dims' 'integer' [] []; ... + 'naccu' 'integer' [0 10000] 200; ... + 'bootside' 'string' { 'both','upper' } 'both'; ... + 'basevect' 'integer' [] []; ... + 'boottype' 'string' { 'rand','shuffle' } 'shuffle'; ... + 'shufflemode' 'string' { 'swap','regular' } 'swap'; ... + 'randmode' 'string' { 'opposite','inverse' } 'opposite'; ... + 'shuffledim' 'integer' [0 Inf] []; ... + 'label' 'string' [] formula; ... + 'alpha' 'real' [0 1] 0.05; ... + 'vals' 'real' [] []; ... + 'distfit' 'string' {'on','off' } 'off'; ... + 'dimaccu' 'integer' [1 Inf] []; ... + 'correctp' 'real' [] []; ... + 'rboot' 'real' [] NaN }); +if isstr(g) + error(g); +end; +if isempty(g.shuffledim) & strcmpi(g.boottype, 'rand') + g.shuffledim = []; +elseif isempty(g.shuffledim) + g.shuffledim = 2; +end; +unitname = ''; +if 2/g.alpha > g.naccu + if strcmpi(g.distfit, 'off') | ~((size(oriarg1,1) == 1 | size(oriarg1,2) == 1) & size(oriarg1,3) == 1) + g.naccu = 2/g.alpha; + fprintf('Adjusting naccu to compute alpha value'); + end; +end; +if isempty(g.rboot) + g.rboot = NaN; +end; + +% function for bootstrap computation +% ---------------------------------- +if ~iscell(oriargs) | length(oriargs) == 1, + oriarg1 = oriargs; + oriarg2 = []; +else + oriarg1 = oriargs{1}; + oriarg2 = oriargs{2}; +end; +[nb_points times trials] = size(oriarg1); +if times == 1, disp('Warning 1 value only for shuffling dimension'); end; + +% only consider baseline +% ---------------------- +if ~isempty(g.basevect) + fprintf('\nPermutation statistics baseline length is %d (out of %d) points\n', length(g.basevect), times); + arg1 = oriarg1(:,g.basevect,:); + if ~isempty(oriarg2) + arg2 = oriarg2(:,g.basevect,:); + end; +else + arg1 = oriarg1; + arg2 = oriarg2; +end; + +% formula for accumulation array +% ------------------------------ +% if g.dimaccu is not empty, accumulate over that dimension +% of the resulting array to speed up computation +formula = [ 'res=' formula ]; +g.formulapost = [ 'if index == 1, ' ... + ' if ~isempty(g.dimaccu), ' ... + ' Rbootout= zeros([ ceil(g.naccu/size(res,g.dimaccu)) size( res ) ]);' ... + ' else,' ... + ' Rbootout= zeros([ g.naccu size( res ) ]);' ... + ' end;' ... + 'end,' ... + 'Rbootout(count,:,:,:) = res;' ... + 'count = count+1;' ... + 'if ~isempty(g.dimaccu), ' ... + ' index = index + size(res,g.dimaccu);' ... + ' fprintf(''%d '', index-1);' ... + 'else ' ... + ' index=index+1;' ... + ' if rem(index,10) == 0, fprintf(''%d '', index); end;' ... + ' if rem(index,100) == 0, fprintf(''\n''); end;' ... + 'end;' ]; + +% ************************** +% case 1: precomputed values +% ************************** +if ~isnan(g.rboot) + Rbootout = g.rboot; +% *********************************** +% case 2: randomize polarity or phase +% *********************************** +elseif strcmpi(g.boottype, 'rand') & strcmpi(g.randmode, 'inverse') + fprintf('Bootstat function: randomize inverse values\n'); + fprintf('Processing permutation statistics for %s (naccu=%d):', g.label, g.naccu); + + % compute random array + % -------------------- + multarray = ones(size(arg1)); + totlen = prod(size(arg1)); + if isreal(arg1), + multarray(1:round(totlen/2)) = 0; + end; + for shuff = 1:ndims(multarray) + multarray = supershuffle(multarray,shuff); % initial shuffling + end; + if isempty(g.shuffledim), g.shuffledim = 1:ndims(multarray); end; + invarg1 = 1./arg1; + + % accumulate + % ---------- + index = 1; + count = 1; + while index <= g.naccu + for shuff = g.shuffledim + multarray = supershuffle(multarray,shuff); + end; + tmpinds = find(reshape(multarray, 1, prod(size(multarray)))); + arg1 = oriarg1; + arg1(tmpinds) = invarg1(tmpinds); + eval([ formula ';' ]); + eval( g.formulapost ); % also contains index = index+1 + end +elseif strcmpi(g.boottype, 'rand') % opposite + fprintf('Bootstat function: randomize polarity or phase\n'); + fprintf('Processing permutation statistics for %s (naccu=%d):', g.label, g.naccu); + + % compute random array + % -------------------- + multarray = ones(size(arg1)); + totlen = prod(size(arg1)); + if isreal(arg1), + multarray(1:round(totlen/2)) = -1; + else + tmparray = exp(j*linspace(0,2*pi,totlen+1)); + multarray(1:totlen) = tmparray(1:end-1); + end; + for shuff = 1:ndims(multarray) + multarray = supershuffle(multarray,shuff); % initial shuffling + end; + if isempty(g.shuffledim), g.shuffledim = 1:ndims(multarray); end; + + % accumulate + % ---------- + index = 1; + count = 1; + while index <= g.naccu + for shuff = g.shuffledim + multarray = supershuffle(multarray,shuff); + end; + arg1 = arg1.*multarray; + eval([ formula ';' ]); + eval( g.formulapost ); % also contains index = index+1 + end +% ******************************************** +% case 3: shuffle vector of only one dimension +% ******************************************** +elseif length(g.shuffledim) == 1 + fprintf('Bootstat function: shuffling along dimension %d only\n', g.shuffledim); + fprintf('Processing permutation statistics for %s (naccu=%d):', g.label, g.naccu); + + index = 1; + count = 1; + while index <= g.naccu + arg1 = shuffleonedim(arg1,g.shuffledim); + eval([ formula ';' ]); + eval( g.formulapost ); + end +% *********************************************** +% case 5: shuffle vector along several dimensions +% *********************************************** +else + if strcmpi(g.shufflemode, 'swap') % swap mode + fprintf('Bootstat function: shuffling along dimension %s (swap mode)\n', int2str(g.shuffledim)); + fprintf('Processing permutation statistics for %s (naccu=%d):', g.label, g.naccu); + index = 1; + count = 1; + while index <= g.naccu + for shuff = g.shuffledim + arg1 = supershuffle(arg1,shuff); + end; + eval([ formula ';' ]); + eval( g.formulapost ); + end + else % regular shuffling + fprintf('Bootstat function: shuffling along dimension %s (regular mode)\n', int2str(g.shuffledim)); + fprintf('Processing permutation statistics for %s (naccu=%d):', g.label, g.naccu); + index = 1; + count = 1; + while index <= g.naccu + for shuff = g.shuffledim + arg1 = shuffleonedim(arg1,shuff); + end; + eval([ formula ';' ]); + eval( g.formulapost ); + end + end; +end; +Rbootout(count:end,:,:,:) = []; + +% ********************** +% assessing significance +% ********************** + +% get accumulation array +% ---------------------- +accarray = Rbootout; +if ~isreal(accarray) + accarray = sqrt(accarray .* conj(accarray)); % faster than abs() +end; +% reshape the output if necessary +% ------------------------------- +if ~isempty(g.dimaccu) + if g.dimaccu+1 == 3 + accarray = permute( accarray, [1 3 2]); + end; + accarray = reshape( accarray, size(accarray,1)*size(accarray,2), size(accarray,3) ); +end; +if size(accarray,1) == 1, accarray = accarray'; end; % first dim contains g.naccu + +% ****************************************************** +% compute thresholds on array not fitting a distribution +% ****************************************************** +if strcmpi(g.distfit, 'off') + + % compute bootstrap significance level + % ------------------------------------ + accarray = sort(accarray,1); % always sort on naccu + Rbootout2 = accarray; + i = round(size(accarray,1)*g.alpha); + accarray1 = squeeze(mean(accarray(size(accarray,1)-i+1:end,:,:),1)); + accarray2 = squeeze(mean(accarray(1:i ,:,:),1)); + if abs(accarray(1,1,1) - accarray(end,1,1)) < abs(accarray(1,1,1))*1e-15 + accarray1(:) = NaN; + accarray2(:) = NaN; + end; + +else + % ******************* + % fit to distribution + % ******************* + sizerboot = size (accarray); + accarray1 = zeros(sizerboot(2:end)); + accarray2 = zeros(sizerboot(2:end)); + + if ~isempty(g.vals{index}) + if ~all(size(g.vals{index}) == sizerboot(2:end) ) + error('For fitting, vals must have the same dimension as the output array (try transposing)'); + end; + end; + + % fitting with Ramberg-Schmeiser distribution + % ------------------------------------------- + if ~isempty(g.vals{index}) % compute significance for value + for index1 = 1:size(accarrayout,1) + for index2 = 1:size(accarrayout,2) + accarray1(index1,index2) = 1 - rsfit(squeeze(accarray(:,index1,index2)), g.vals{index}(index1, index2)); + if length(g.correctp) == 2 + accarray1(index1,index2) = correctfit(accarray1, 'gamparams', [g.correctp 0]); % no correction for p=0 + else + accarray1(index1,index2) = correctfit(accarray1, 'gamparams', g.correctp); + end; + end; + end; + else % compute value for significance + for index1 = 1:size(accarrayout,1) + for index2 = 1:size(accarrayout,2) + [p c l chi2] = rsfit(Rbootout(:),0); + pval = g.alpha; accarray1(index1,index2) = l(1) + (pval.^l(3) - (1-pval).^l(4))/l(2); + pval = 1-g.alpha; accarray2(index1,index2) = l(1) + (pval.^l(3) - (1-pval).^l(4))/l(2); + end; + end; + end; + + % plot results + % ------------------------------------- + % figure; + % hist(abs(Rbootout)); tmpax = axis; + % hold on; + % valcomp = linspace(min(abs(Rbootout(:))), max(abs(Rbootout(:))), 100); + % normy = normpdf(valcomp, mu, sigma); + % plot(valcomp, normy/max(normy)*tmpax(4), 'r'); + % return; +end; + +% set output array: backward compatible +% ------------------------------------- +if strcmpi(g.bootside, 'upper'); % only upper significance + accarrayout = accarray1; +else + if size(accarray1,1) ~= 1 & size(accarray1,2) ~= 1 + accarrayout = accarray2; + accarrayout(:,:,2) = accarray1; + else + accarrayout = [ accarray2(:) accarray1(:) ]; + end; +end; +accarrayout = squeeze(accarrayout); +if size(accarrayout,1) == 1 & size(accarrayout,3) == 1, accarrayout = accarrayout'; end; + +% better but not backward compatible +% ---------------------------------- +% accarrayout = { accarray1 accarray2 }; + +return; + + % fitting with normal distribution (deprecated) + % -------------------------------- + [mu sigma] = normfit(abs(Rbootout(:))); + accarrayout = 1 - normcdf(g.vals, mu, sigma); % cumulative density distribution + % formula of normal distribution + % y = 1/sqrt(2) * exp( -(x-mu).^2/(sigma*sigma*2) ) / (sqrt(pi)*sigma); +% % Gamma and Beta fits: +% elseif strcmpi(g.distfit, 'gamma') +% [phatgam pcigam] = gamfit(abs(Rbootout(:))); +% gamy = gampdf(valcomp, phatgam(1), pcigam(2)) +% p = 1 - gamcdf(g.vals, phatgam(1), pcigam(2)); % cumulative density distribution +% elseif strcmpi(g.distfit, 'beta') +% [phatbeta pcibeta] = betafit(abs(Rbootout(:))); +% betay = betapdf(valcomp, phatbeta(1), pcibeta(1)); +% p = 1 - betacdf(g.vals, phatbeta(1), pcibeta(1)); % cumulative density distribution +% end + + + if strcmpi(g.distfit, 'off') + tmpsort = sort(Rbootout); + i = round(g.alpha*g.naccu); + sigval = [mean(tmpsort(1:i)) mean(tmpsort(g.naccu-i+1:g.naccu))]; + if strcmpi(g.bootside, 'upper'), sigval = sigval(2); end; + accarrayout = sigval; + end; + +% this shuffling preserve the number of -1 and 1 +% for cloumns and rows (assuming matrix size is multiple of 2 +% ----------------------------------------------------------- +function array = supershuffle(array, dim) + if size(array, 1) == 1 | size(array,2) == 1 + array = shuffle(array); + return; + end; + if size(array, dim) == 1, return; end; + + if dim == 1 + indrows = shuffle(1:size(array,1)); + for index = 1:2:length(indrows)-rem(length(indrows),2) % shuffle rows + tmparray = array(indrows(index),:,:); + array(indrows(index),:,:) = array(indrows(index+1),:,:); + array(indrows(index+1),:,:) = tmparray; + end; + elseif dim == 2 + indcols = shuffle(1:size(array,2)); + for index = 1:2:length(indcols)-rem(length(indcols),2) % shuffle colums + tmparray = array(:,indcols(index),:); + array(:,indcols(index),:) = array(:,indcols(index+1),:); + array(:,indcols(index+1),:) = tmparray; + end; + else + ind3d = shuffle(1:size(array,3)); + for index = 1:2:length(ind3d)-rem(length(ind3d),2) % shuffle colums + tmparray = array(:,:,ind3d(index)); + array(:,:,ind3d(index)) = array(:,:,ind3d(index+1)); + array(:,:,ind3d(index+1)) = tmparray; + end; + end; + +% shuffle one dimension, one row/colums at a time +% ----------------------------------------------- +function array = shuffleonedim(array, dim) + if size(array, 1) == 1 | size(array,2) == 1 + array = shuffle(array, dim); + else + if dim == 1 + for index1 = 1:size(array,3) + for index2 = 1:size(array,2) + array(:,index2,index1) = shuffle(array(:,index2,index1)); + end; + end; + elseif dim == 2 + for index1 = 1:size(array,3) + for index2 = 1:size(array,1) + array(index2,:,index1) = shuffle(array(index2,:,index1)); + end; + end; + else + for index1 = 1:size(array,1) + for index2 = 1:size(array,2) + array(index1,index2,:) = shuffle(array(index1,index2,:)); + end; + end; + end; + end; diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/correct_mc.m b/code/eeglab13_4_4b/functions/timefreqfunc/correct_mc.m new file mode 100644 index 0000000..c5eeedd --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/correct_mc.m @@ -0,0 +1,130 @@ +% correct_mc() - compute an upper limit for the number of independant +% time-frequency estimate in a given time-frequency image. +% This number can be used to correct for multiple comparisons. +% +% Usage: +% [ncorrect array] = correct_mc( EEG, cycles, maxfreq, timesout); +% +% Inputs: +% EEG - EEGLAB structure +% cycles - [float] same as the cycle input to timef(). Default is [3 0.5]. +% freqrange - [float] minimum and maximum frequency. Default is [2 50] Hz. +% timesout - [integer] array of number of time points to test. +% +% Output: +% ncorrect - number of independant tf estimate in the time-freq image +% array - array of size (freqs x timesout) containing pvalues. +% +% Method details: +% +% Dividing by the total number of time-frequency estimate in the 2-D +% time-frequency image decomposition would be too conservative since +% spectral estimates of neighboring time-frequency points are highly +% correlated. One must thus estimate the number of independent +% time-frequency points in the TF image. Here, I used geometrical wavelets +% which are optimal in terms of image compression, so neighboring +% frequencies can be assume to carry independent spectral estimates. +% We thus had time-frequency decompositions at only X frequencies (e.g. 120, +% 60, 30, 15, 7.5, 3.25, 1.625 Hz). For each frequency, I then found +% the minimum number of time points for which there was a significant +% correlation of the spectral estimates between neighboring time points +% (for each frequency and number of time point, I computed the correlation +% from 0 to 1 for all data channel to obtain an a probability distribution +% of correlation; we then fitted this distribution using a 4th order curve +% (Ramberg, J. S., E. J. Dudewicz, et al. (1979). "A probability +% distribution and its uses in fitting data." Technometrics 21(2)) and +% assessed the probability of significance for the value 0 (no correlation) +% to be within the distribution of estimated correlation). For instance, +% using 28 time points at 120 Hz, there was no significant (p>0.05 taking +% into account Bonferoni correction for multiple comparisons) correlation +% between neighboring time-frequency power estimate, but there was a +% significant correlation using 32 time points instead of 28 (p<0.05). +% Applying the same approach for the X geometrical frequencies and summing +% the minimum number of time points for observing a significant correlation +% at all frequencies, ones obtain in general a number below 200 (with the +% defaults above and 3-second data epochs) independent estimates. In all +% the time-frequency plots, one has to used a significance mask at p<0.00025 +% (0.05/200). An alternative method for correcting for multiple comparisons +% is presented in Nichols & Holmes, Human Brain Mapping, 2001. +% +% Author: Arnaud Delorme, SCCN, Jan 17, 2004 + +% Copyright (C) 2004 Arnaud Delorme, SCCN, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ncorrect, pval] = correct_mc( EEG, cycles, freqrange, timesout); + + if nargin < 1 + help correct_mc; + return; + end; + if nargin < 2 + cycles = [3 0.5]; + end; + if nargin < 3 + freqrange = [2 50]; + end; + if nargin < 4 + % possible number of time outputs + % ------------------------------- + timesout = [5 6 7 8 9 10 12 14 16 18 20 24 28 32 36 40]; + end; + nfreqs = ceil(log2(freqrange(2))); + + % scan times + % ---------- + for ti = 1:length(timesout) + clear tmpf + + % scan data channels + % ------------------ + for index = 1:EEG.nbchan + + clf; [ersp,itc,powbase,times,freqs,erspboot,itcboot] = newtimef(EEG.data(index,:),EEG.pnts, ... + [EEG.xmin EEG.xmax]*1000,EEG.srate, cycles, 'timesout', timesout(ti), ... + 'freqscale', 'log', 'nfreqs', nfreqs, 'freqrange', freqrange, 'plotitc', 'off', 'plotersp', 'off'); + + % compute correlation + % ------------------- + for fi = 1:length(freqs) + tmp = corrcoef(ersp(fi,1:end-1), ersp(fi,2:end)); + tmpf(index,fi) = tmp(2,1); + end; + + end; + + % fit curve and determine if the result is significant + % ---------------------------------------------------- + for fi = 1:length(freqs) + pval(fi, ti) = rsfit(tmpf(:,fi)', 0); + if pval(fi,ti) > 0.9999, pval(fi,ti) = NaN; end; + end; + end; + + % find minimum number of points for each frequency + % ------------------------------------------------ + ncorrect = 0; + threshold = 0.05 / prod(size(pval)); + for fi = 1:size(pval,1) + ti = 1; + while ti <= size(pval,2) + if pval(fi,ti) < threshold + ncorrect = ncorrect + timesout(ti); + ti = size(pval,2)+1; + end; + ti = ti+1; + end; + end; diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/correctfit.m b/code/eeglab13_4_4b/functions/timefreqfunc/correctfit.m new file mode 100644 index 0000000..ecfb2ba --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/correctfit.m @@ -0,0 +1,88 @@ +% correctfit() - correct fit using observed p-values. Use this function +% if for some reason, the distribution of p values is +% not uniform between 0 and 1 +% +% Usage: +% >> [p phat pci zerofreq] = correctfit(pval, 'key', 'val'); +% +% Inputs: +% pval - input p value +% +% Optional inputs: +% 'allpval' - [float array] collection of p values drawn from random +% distributions (theoritically uniform). +% 'gamparams' - [phat pci zerofreq] parameter for gamma function fitting. +% zerofreq is the frequency of occurence of p=0. +% 'zeromode' - ['on'|'off'] enable estimation of frequency of pval=0 +% (this might lead to hight pval). Default is 'on'. +% +% Outputs: +% p - corrected p value. +% phat - phat gamfit() parameter. +% pci - phat gamfit() parameter. +% zerofreq - frequency of occurence of p=0. +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2003- +% +% See also: bootstat() + +% Copyright (C) 7/02/03 Arnaud Delorme, SCCN/INC/UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [pval, PHAT, PCI, zerofreq] = correctfit(pval, varargin) + + if nargin < 2 + help correctfit; + disp('You need to specify one optional input'); + return; + end; + + g = finputcheck( varargin, { 'allpval' 'real' [0 1] []; + 'zeromode' 'string' {'on','off'} 'on'; + 'gamparams' 'real' [] []}, 'correctfit'); + if isstr(g), error(g); end; + + if ~isempty(g.gamparams) + PHAT = g.gamparams(1); + PCI = g.gamparams(2); + zerofreq = g.gamparams(3); + elseif ~isempty(g.allpval) + nonzero = find(g.allpval(:) ~= 0); + zerofreq = (length(g.allpval(:))-length(nonzero))/ length(g.allpval(:)); + tmpdat = -log10( g.allpval(nonzero) ) + 1E-10; + [PHAT, PCI] = gamfit( tmpdat ); + PHAT = PHAT(1); + PCI = PCI(2); + end; + + if pval == 0 + if strcmpi(g.zeromode, 'on') + pval = zerofreq; + end; + else + tmppval = -log10( pval ) + 1E-10; + pval = 1-gamcdf( tmppval, PHAT, PCI); + end; + + if 1 % plotting + if exist('tmpdat') == 1 + figure; hist(tmpdat, 100); hold on; + mult = ylim; + tmpdat = linspace(0.00001,10, 300); + normy = gampdf( tmpdat, PHAT, PCI); + plot( tmpdat, normy/max(normy)*mult(2)*3, 'r'); + end; + end; diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/crossf.m b/code/eeglab13_4_4b/functions/timefreqfunc/crossf.m new file mode 100644 index 0000000..1aceeeb --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/crossf.m @@ -0,0 +1,1446 @@ +% crossf() - Returns estimates and plots event-related coherence (ERCOH) +% between two input data time series (X,Y). A lower panel (optionally) +% shows the coherence phase difference between the processes. +% In this panel, output by > crossf(X,Y,...); +% 90 degrees (orange) means X leads Y by a quarter cycle. +% -90 degrees (blue) means Y leads X by a quarter cycle. +% Coherence phase units may be radians, degrees, or msec. +% Click on any subplot to view separately and zoom in/out. +% +% Function description: +% Uses EITHER fixed-window, zero-padded FFTs (fastest) OR constant-Q +% 0-padded wavelet DFTs (more even sensitivity across frequencies), +% both Hanning-tapered. Output frequency spacing is the lowest +% frequency ('srate'/'winsize') divided by the 'padratio'. +% +% If an 'alpha' value is given, then bootstrap statistics are +% computed (from a distribution of 'naccu' {200} surrogate baseline +% data epochs) for the baseline epoch, and non-significant features +% of the output plots are zeroed (and shown in green). The baseline +% epoch is all windows with center latencies < the given 'baseline' +% value, or if 'baseboot' is 1, the whole epoch. +% Usage: +% >> [coh,mcoh,timesout,freqsout,cohboot,cohangles] ... +% = crossf(X,Y,frames,tlimits,srate,cycles, ... +% 'key1', 'val1', 'key2', val2' ...); +% Required inputs: +% X = first single-channel data set (1,frames*nepochs) +% Y = second single-channel data set (1,frames*nepochs) +% frames = frames per epoch {default: 750} +% tlimits = [mintime maxtime] (ms) epoch latency limits {def: [-1000 2000]} +% srate = data sampling rate (Hz) {default: 250} +% cycles = 0 -> Use FFTs (with constant window length) +% = >0 -> Number of cycles in each analysis wavelet +% = [cycles expfactor] -> if 0 < expfactor < 1, the number +% of wavelet cycles expands with frequency from cycles +% If expfactor = 1, no expansion; if = 0, constant +% window length (as in FFT) {default: 0} +% Optional Coherence Type: +% 'type' = ['coher'|'phasecoher'] Compute either linear coherence +% ('coher') or phase coherence ('phasecoher') also known +% as phase coupling factor' {default: 'phasecoher'}. +% 'subitc' = ['on'|'off'] subtract stimulus locked Inter-Trial Coherence +% from X and Y. This computes the 'intrinsic' coherence +% X and Y not arising from common synchronization to +% experimental events. See notes. {default: 'off'} +% 'shuffle' = integer indicating the number of estimates to compute +% bootstrap coherence based on shuffled trials. This estimates +% the coherence arising only from time locking of X and Y +% to experimental events (opposite of 'subitc') {default: 0} +% Optional Detrend: +% 'detret' = ['on'|'off'], Linearly detrend data within epochs {def: 'off'} +% 'detrep' = ['on'|'off'], Linearly detrend data across trials {def: 'off'} +% +% Optional FFT/DFT: +% 'winsize' = If cycles==0: data subwindow length (fastest, 2^n0: *longest* window length to use. This +% determines the lowest output frequency {default: ~frames/8} +% 'timesout' = Number of output latencies (int0) +% If cycles==0, all FFT frequencies are output {default: 50} +% 'baseline' = Coherence baseline end latency (ms). NaN -> No baseline +% {default:NaN} +% 'powbase' = Baseline spectrum to log-subtract {default: from data} +% +% Optional Bootstrap: +% 'alpha' = If non-0, compute two-tailed bootstrap significance prob. +% level. Show non-signif output values as green. {def: 0} +% 'naccu' = Number of bootstrap replications to compute {def: 200} +% 'boottype' = ['times'|'timestrials'] Bootstrap type: Either shuffle +% windows ('times') or windows and trials ('timestrials') +% Option 'timestrials' requires more memory {default: 'times'} +% 'memory' = ['low'|'high'] 'low' -> decrease memory use {default: 'high'} +% 'baseboot' = Extent of bootstrap shuffling (0=to 'baseline'; 1=whole epoch) +% If no baseline is given (NaN), extent of bootstrap shuffling +% is the whole epoch {default: 0} +% 'rboot' = Input bootstrap coherence limits (e.g., from crossf()) +% The bootstrap type should be identical to that used +% to obtain the input limits. {default: compute from data} +% Optional Scalp Map: +% 'topovec' = (2,nchans) matrix, plot scalp maps to plot {default: []} +% ELSE (c1,c2), plot two cartoons showing channel locations. +% 'elocs' = Electrode location structure or file for scalp map +% {default: none} +% 'chaninfo' = Electrode location additional information (nose position...) +% {default: none} +% +% Optional Plot and Compute Features: +% 'compute' = ['matlab'|'c'] Use C subroutines to speed up the +% computation (currently unimplemented) {def: 'matlab'} +% 'savecoher' - [0|1] 1 --> Accumulate the individual trial coherence +% vectors; output them as cohangles {default: 0 = off} +% 'plotamp' = ['on'|'off'], Plot coherence magnitude {def: 'on'} +% 'maxamp' = [real] Set the maximum for the amp. scale {def: auto} +% 'plotphase' = ['on'|'off'], Plot coherence phase angle {def: 'on'} +% 'angleunit' = Phase units: 'ms' -> msec, 'deg' -> degrees, +% or 'rad' -> radians {default: 'deg'} +% 'title' = Optional figure title {default: none} +% 'vert' = Latencies to mark with a dotted vertical line +% {default: none} +% 'linewidth' = Line width for marktimes traces (thick=2, thin=1) +% {default: 2} +% 'cmax' = Maximum amplitude for color scale {def: data limits} +% 'axesfont' = Axes font size {default: 10} +% 'titlefont' = Title font size {default: 8} +% +% Outputs: +% coh = Matrix (nfreqs,timesout) of coherence magnitudes +% mcoh = Vector of mean baseline coherence at each frequency +% timesout = Vector of output latencies (window centers) (ms). +% freqsout = Vector of frequency bin centers (Hz). +% cohboot = Matrix (nfreqs,2) of [lower;upper] coher signif. limits +% if 'boottype' is 'trials', (nfreqs,timesout, 2) +% cohangle = (nfreqs,timesout) matrix of coherence angles (in radians) +% cohangles = (nfreqs,timesout,trials) matrix of single-trial coherence +% angles (in radians), saved and output only if 'savecoher',1 +% +% Plot description: +% Assuming both 'plotamp' and 'plotphase' options are 'on' (=default), the upper panel +% presents the magnitude of either phase coherence or linear coherence, depending on +% the 'type' parameter (above). The lower panel presents the coherence phase difference +% (in degrees). Click on any plot to pop up a new window (using 'axcopy()'). +% -- The upper left marginal panel shows mean coherence during the baseline period +% (blue), and when significance is set, the significance threshold (dotted black-green). +% -- The horizontal panel under the coherence magnitude image indicates the maximum +% (green) and minimum (blue) coherence values across all frequencies. When significance +% is set (using option 'trials' for 'boottype'), an additional curve indicates the +% significance threshold (dotted black-green). +% +% Notes: 1) When cycles==0, nfreqs is total number of FFT frequencies. +% 2) As noted above: 'blue' coherence angle -> X leads Y; 'red' -> Y leads X +% 3) The 'boottype' should be ideally 'timesframes', but this creates high +% memory demands, so the 'times' method must be used in many cases. +% 4) If 'boottype' is 'trials', the average of the complex bootstrap +% is subtracted from the coherence to compensate for phase differences +% (the average is also subtracted from the bootstrap distribution). +% For other bootstraps, this is not necessary since the phase is random. +% 5) If baseline is non-NaN, the baseline is subtracted from +% the complex coherence. On the left hand side of the coherence +% amplitude image, the baseline is displayed as a magenta line +% (if no baseline is selected, this curve represents the average +% coherence at every given frequency). +% 6) If a out-of-memory error occurs, set the 'memory' option to 'low' +% (Makes computation time slower; Only the 'times' bootstrap method +% can be used in this mode). +% +% Authors: Arnaud Delorme, Sigurd Enghoff & Scott Makeig +% CNL/Salk Institute 1998-2001; SCCN/INC/UCSD, La Jolla, 2002- +% +% See also: timef() + +% Copyright (C) 8/1/98 Arnaud Delorme, Sigurd Enghoff & Scott Makeig, SCCN/INC/UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 11-20-98 defined g.linewidth constant -sm +% 04-01-99 made number of frequencies consistent -se +% 06-29-99 fixed constant-Q freq indexing -se +% 08-13-99 added cohangle plotting -sm +% 08-20-99 made bootstrap more efficient -sm +% 08-24-99 allow nan values introduced by possible eventlock() preproc. -sm +% 03-05-2007 eventlock.m deprecated to eegalign.m. -tf +% 03-16-00 added lead/lag interpretation to help msg - sm & eric visser +% 03-16-00 added axcopy() feature -sm & tpj +% 04-20-00 fixed Rangle sign for wavelets, added verts array -sm +% 01-22-01 corrected help msg when nargin<2 -sm & arno delorme +% 01-25-02 reformated help & license, added links -ad +% 03-09-02 function restructuration -ad +% add 'key', val arguments (+ external baseboot, baseline, color axis, angleunit...) +% add detrending (across time and trials) + 'coher' option for amplitude coherence +% significance only if alpha is given, ploting options in 'plotamp' and 'plotphase' +% 03-16-02 timeout automatically adjusted if too high -ad +% 04-03-02 added new options for bootstrap -ad + +% Note: 3 "objects" (Tf, Coher and Boot) are handled by specific functions under Matlab +% (Tf) function Tf = tfinit(...) - create object Time Frequency (Tf) associated with some data +% (Tf) function [Tf, itcvals] = tfitc(...) - compute itc for the selected data +% (Tf) function [Tf, itcvals] = tfitcpost(Tf, trials) - itc normlisation +% (Tf) function [Tf, tmpX] = tfcomp(Tf, trials, times) - compute time freq. decomposition +% (Coher) function Coher = coherinit(...) - initialize coherence object +% (Coher) function Coher = cohercomp(Coher, tmpX, tmpY, trial, time) - compute coherence +% (Coher) function Coher = cohercomppost(Coher, trials) - coherence normalization +% (Boot) function Boot = bootinit(...) - intialize bootstrap object +% (Boot) function Boot = bootcomp(...) - compute bootstrap +% (Boot) function [Boot, Rbootout] = bootcomppost(...) - bootstrap normalization +% and by real objects under C++ (C++ code, incomplete) + +function [R,mbase,times,freqs,Rbootout,Rangle, trialcoher, Tfx, Tfy] = crossf(X, Y, frame, tlimits, Fs, varwin, varargin) + +%varwin,winsize,nwin,oversmp,maxfreq,alpha,verts,caxmax) + +% ------------------------ +% Commandline arg defaults: +% ------------------------ +DEFAULT_ANGLEUNIT = 'deg'; % angle plotting units - 'rad', 'ms', or 'deg' +DEFAULT_EPOCH = 750; % Frames per epoch +DEFAULT_TIMELIM = [-1000 2000]; % Time range of epochs (ms) +DEFAULT_FS = 250; % Sampling frequency (Hz) +DEFAULT_NWIN = 200; % Number of windows = horizontal resolution +DEFAULT_VARWIN = 0; % Fixed window length or base on cycles. + +% =0: fix window length to nwin +% >0: set window length equal varwin cycles +% bounded above by winsize, also determines +% the min. freq. to be computed. + +DEFAULT_OVERSMP = 2; % Number of times to oversample = vertical resolution +DEFAULT_MAXFREQ = 50; % Maximum frequency to display (Hz) +DEFAULT_TITLE = 'Event-Related Coherence'; % Figure title +DEFAULT_ALPHA = NaN; % Default two-sided significance probability threshold + +if (nargin < 2) + help crossf + return +end + +if ~iscell(X) + if (min(size(X))~=1 | length(X)<2) + fprintf('crossf(): X must be a row or column vector.\n'); + return + elseif (min(size(Y))~=1 | length(Y)<2) + fprintf('crossf(): Y must be a row or column vector.\n'); + return + elseif (length(X) ~= length(Y)) + fprintf('crossf(): X and Y must have same length.\n'); + return + end +end; + +if (nargin < 3) + frame = DEFAULT_EPOCH; +elseif (~isnumeric(frame) | length(frame)~=1 | frame~=round(frame)) + fprintf('crossf(): Value of frames must be an integer.\n'); + return +elseif (frame <= 0) + fprintf('crossf(): Value of frames must be positive.\n'); + return +elseif ~iscell(X) & (rem(length(X),frame) ~= 0) + fprintf('crossf(): Length of data vectors must be divisible by frames.\n'); + return +end + +if (nargin < 4) + tlimits = DEFAULT_TIMELIM; +elseif (~isnumeric(tlimits) | sum(size(tlimits))~=3) + error('crossf(): Value of tlimits must be a vector containing two numbers.'); +elseif (tlimits(1) >= tlimits(2)) + error('crossf(): tlimits interval must be [min,max].'); +end + +if (nargin < 5) + Fs = DEFAULT_FS; +elseif (~isnumeric(Fs) | length(Fs)~=1) + error('crossf(): Value of srate must be a number.'); +elseif (Fs <= 0) + error('crossf(): Value of srate must be positive.'); +end + +if (nargin < 6) + varwin = DEFAULT_VARWIN; +elseif (~isnumeric(varwin) | length(varwin)>2) + error('crossf(): Value of cycles must be a number or a (1,2) vector.'); +elseif (varwin < 0) + error('crossf(): Value of cycles must be either zero or positive.'); +end + +% consider structure for these arguments +% -------------------------------------- +vararginori = varargin; +for index=1:length(varargin) + if iscell(varargin{index}), varargin{index} = { varargin{index} }; end; +end; +if ~isempty(varargin) + try, g = struct(varargin{:}); + catch, error('Argument error in the {''param'', value} sequence'); end; +else + g = []; +end; + +try, g.shuffle; catch, g.shuffle = 0; end; +try, g.title; catch, g.title = DEFAULT_TITLE; end; +try, g.winsize; catch, g.winsize = max(pow2(nextpow2(frame)-3),4); end; +try, g.pad; catch, g.pad = max(pow2(nextpow2(g.winsize)),4); end; +try, g.timesout; catch, g.timesout = DEFAULT_NWIN; end; +try, g.padratio; catch, g.padratio = DEFAULT_OVERSMP; end; +try, g.maxfreq; catch, g.maxfreq = DEFAULT_MAXFREQ; end; +try, g.topovec; catch, g.topovec = []; end; +try, g.elocs; catch, g.elocs = ''; end; +try, g.alpha; catch, g.alpha = DEFAULT_ALPHA; end; +try, g.marktimes; catch, g.marktimes = []; end; % default no vertical lines +try, g.marktimes = g.vert; catch, g.vert = []; end; % default no vertical lines +try, g.powbase; catch, g.powbase = nan; end; +try, g.rboot; catch, g.rboot = nan; end; +try, g.plotamp; catch, g.plotamp = 'on'; end; +try, g.plotphase; catch, g.plotphase = 'on'; end; +try, g.plotbootsub; catch, g.plotbootsub = 'on'; end; +try, g.detrep; catch, g.detrep = 'off'; end; +try, g.detret; catch, g.detret = 'off'; end; +try, g.baseline; catch, g.baseline = NaN; end; +try, g.baseboot; catch, g.baseboot = 0; end; +try, g.linewidth; catch, g.linewidth = 2; end; +try, g.naccu; catch, g.naccu = 200; end; +try, g.angleunit; catch, g.angleunit = DEFAULT_ANGLEUNIT; end; +try, g.cmax; catch, g.cmax = 0; end; % 0=use data limits +try, g.type; catch, g.type = 'phasecoher'; end; +try, g.boottype; catch, g.boottype = 'times'; end; +try, g.subitc; catch, g.subitc = 'off'; end; +try, g.memory; catch, g.memory = 'high'; end; +try, g.compute; catch, g.compute = 'matlab'; end; +try, g.maxamp; catch, g.maxamp = []; end; +try, g.savecoher; catch, g.savecoher = 0; end; +try, g.noinput; catch, g.noinput = 'no'; end; +try, g.chaninfo; catch, g.chaninfo = []; end; + +allfields = fieldnames(g); +for index = 1:length(allfields) + switch allfields{index} + case { 'shuffle' 'title' 'winsize' 'pad' 'timesout' 'padratio' 'maxfreq' 'topovec' 'elocs' 'alpha' ... + 'marktimes' 'vert' 'powbase' 'rboot' 'plotamp' 'plotphase' 'plotbootsub' 'detrep' 'detret' ... + 'baseline' 'baseboot' 'linewidth' 'naccu' 'angleunit' 'cmax' 'type' 'boottype' 'subitc' ... + 'memory' 'compute' 'maxamp' 'savecoher' 'noinput' 'chaninfo' }; + case {'plotersp' 'plotitc' }, disp(['crossf warning: timef option ''' allfields{index} ''' ignored']); + otherwise disp(['crossf error: unrecognized option ''' allfields{index} '''']); beep; return; + end; +end; + +g.tlimits = tlimits; +g.frame = frame; +g.srate = Fs; +g.cycles = varwin(1); +if length(varwin)>1 + g.cyclesfact = varwin(2); +else + g.cyclesfact = 1; +end; +g.type = lower(g.type); +g.boottype = lower(g.boottype); +g.detrep = lower(g.detrep); +g.detret = lower(g.detret); +g.plotphase = lower(g.plotphase); +g.plotbootsub = lower(g.plotbootsub); +g.subitc = lower(g.subitc); +g.plotamp = lower(g.plotamp); +g.shuffle = lower(g.shuffle); +g.compute = lower(g.compute); +g.AXES_FONT = 10; +g.TITLE_FONT = 14; + +% testing arguments consistency +% ----------------------------- +if (~ischar(g.title)) + error('Title must be a string.'); +end + +if (~isnumeric(g.winsize) | length(g.winsize)~=1 | g.winsize~=round(g.winsize)) + error('Value of winsize must be an integer number.'); +elseif (g.winsize <= 0) + error('Value of winsize must be positive.'); +elseif (g.cycles == 0 & pow2(nextpow2(g.winsize)) ~= g.winsize) + error('Value of winsize must be an integer power of two [1,2,4,8,16,...]'); +elseif (g.winsize > g.frame) + error('Value of winsize must be less than frame length.'); +end + +if (~isnumeric(g.timesout) | length(g.timesout)~=1 | g.timesout~=round(g.timesout)) + error('Value of timesout must be an integer number.'); +elseif (g.timesout <= 0) + error('Value of timesout must be positive.'); +end +if (g.timesout > g.frame-g.winsize) + g.timesout = g.frame-g.winsize; + disp(['Value of timesout must be <= frame-winsize, timeout adjusted to ' int2str(g.timesout) ]); +end + +if (~isnumeric(g.padratio) | length(g.padratio)~=1 | g.padratio~=round(g.padratio)) + error('Value of padratio must be an integer.'); +elseif (g.padratio <= 0) + error('Value of padratio must be positive.'); +elseif (pow2(nextpow2(g.padratio)) ~= g.padratio) + error('Value of padratio must be an integer power of two [1,2,4,8,16,...]'); +end + +if (~isnumeric(g.maxfreq) | length(g.maxfreq)~=1) + error('Value of g.maxfreq must be a number.'); +elseif (g.maxfreq <= 0) + error('Value of g.maxfreq must be positive.'); +elseif (g.maxfreq > Fs/2) + fprintf('Warning: input value of g.maxfreq larger that Nyquist frequency %3.4 Hz\n\n',Fs/2); +end + +if isempty(g.topovec) + g.topovec = []; +elseif min(size(g.topovec))==1 + g.topovec = g.topovec(:); + if size(g.topovec,1)~=2 + error('topovec must be a row or column vector.'); + end +end; + +if isempty(g.elocs) + g.elocs = ''; +elseif (~ischar(g.elocs)) & ~isstruct(g.elocs) + error('Channel location file must be a valid text file.'); +end + +if (~isnumeric(g.alpha) | length(g.alpha)~=1) + error('timef(): Value of g.alpha must be a number.\n'); +elseif (round(g.naccu*g.alpha) < 2) + fprintf('Value of g.alpha is out of the normal range [%g,0.5]\n',2/g.naccu); + g.naccu = round(2/g.alpha); + fprintf(' Increasing the number of bootstrap iterations to %d\n',g.naccu); +end +if g.alpha>0.5 | g.alpha<=0 + error('Value of g.alpha is out of the allowed range (0.00,0.5).'); +end +if ~isnan(g.alpha) + if g.baseboot > 0 + fprintf('Bootstrap analysis will use data in baseline (pre-0) subwindows only.\n') + else + fprintf('Bootstrap analysis will use data in all subwindows.\n') + end +end +switch g.angleunit + case { 'rad', 'ms', 'deg' },; + otherwise error('Angleunit must be either ''rad'', ''deg'', or ''ms'''); +end; +switch g.type + case { 'coher', 'phasecoher' 'phasecoher2' },; + otherwise error('Type must be either ''coher'' or ''phasecoher'''); +end; +switch g.boottype + case { 'times' 'timestrials' 'trials'},; + otherwise error('Boot type must be either ''times'', ''trials'' or ''timestrials'''); +end; +if (~isnumeric(g.shuffle)) + error('Shuffle argument type must be numeric'); +end; +switch g.memory + case { 'low', 'high' },; + otherwise error('memory must be either ''low'' or ''high'''); +end; +if strcmp(g.memory, 'low') & ~strcmp(g.boottype, 'times') + error(['Bootstrap type ''' g.boottype ''' cannot be used in low memory mode']); +end; + +switch g.compute + case { 'matlab', 'c' },; + otherwise error('compute must be either ''matlab'' or ''c'''); +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Compare 2 conditions +%%%%%%%%%%%%%%%%%%%%%%%%%%% +if iscell(X) + if length(X) ~= 2 | length(Y) ~= 2 + error('crossf: to compare conditions, X and Y input must be 2-elements cell arrays'); + end; + if ~strcmp(g.boottype, 'times') + disp('crossf warning: The significance bootstrap type is irrelevant when comparing conditions'); + end; + for index = 1:2:length(vararginori) + if index<=length(vararginori) % needed: if elemenets are deleted + %if strcmp(vararginori{index}, 'alpha'), vararginori(index:index+1) = []; + if strcmp(vararginori{index}, 'title'), vararginori(index:index+1) = []; + end; + end; + end; + if iscell(g.title) + if length(g.title) <= 2, + g.title{3} = 'Condition 2 - condition 1'; + end; + else + g.title = { 'Condition 1', 'Condition 2', 'Condition 2 - condition 1' }; + end; + + fprintf('Running crossf on condition 1 *********************\n'); + fprintf('Note: If an out-of-memory error occurs, try reducing the\n'); + fprintf(' number of time points or number of frequencies\n'); + if ~strcmp(g.type, 'coher') + fprintf('Note: Type ''coher'' takes 3 times as much memory as other options!)\n'); + end + figure; + subplot(1,3,1); title(g.title{1}); + if ~strcmp(g.type, 'coher') + [R1,mbase,times,freqs,Rbootout1,Rangle1, savecoher1] = crossf(X{1}, Y{1}, ... + frame, tlimits, Fs, varwin, 'savecoher', 1, 'title', ' ',vararginori{:}); + else + [R1,mbase,times,freqs,Rbootout1,Rangle1, savecoher1, Tfx1, Tfy1] = crossf(X{1}, Y{1}, ... + frame, tlimits, Fs, varwin, 'savecoher', 1,'title', ' ',vararginori{:}); + end; + R1 = R1.*exp(j*Rangle1); % output Rangle is in radians + + % Asking user for memory limitations + % if ~strcmp(g.noinput, 'yes') + % tmp = whos('Tfx1'); + % fprintf('This function will require an additional %d bytes, do you wish\n', ... + % tmp.bytes*6+size(savecoher1,1)*size(savecoher1,2)*g.naccu*8); + % res = input('to continue (y/n) (use the ''noinput'' option to disable this message):', 's'); + % if res == 'n', return; end; + % end; + + fprintf('\nRunning crossf on condition 2 *********************\n'); + subplot(1,3,2); title(g.title{2}); + if ~strcmp(g.type, 'coher') + [R2,mbase,times,freqs,Rbootout2,Rangle2, savecoher2] = crossf(X{2}, Y{2}, ... + frame, tlimits, Fs, varwin,'savecoher', 1, 'title', ' ',vararginori{:}); + else + [R2,mbase,times,freqs,Rbootout2,Rangle2, savecoher2, Tfx2, Tfy2] = crossf(X{2}, Y{2}, ... + frame, tlimits, Fs, varwin,'savecoher', 1, 'title', ' ',vararginori{:}); + end; + R2 = R2.*exp(j*Rangle2); % output Rangle is in radians + + subplot(1,3,3); title(g.title{3}); + if isnan(g.alpha) + plotall(R2-R1, [], [], times, freqs, mbase, find(freqs <= g.maxfreq), g); + else + % accumulate coherence images (all arrays [nb_points * timesout * trials]) + % --------------------------- + allsavedcoher = zeros(size(savecoher1,1), ... + size(savecoher1,2), ... + size(savecoher1,3)+size(savecoher2,3)); + allsavedcoher(:,:,1:size(savecoher1,3)) = savecoher1; + allsavedcoher(:,:,size(savecoher1,3)+1:end) = savecoher2; + clear savecoher1 savecoher2; + + if strcmp(g.type, 'coher') + alltfx = zeros(size(Tfx1,1), size(Tfx2,2), size(Tfx1,3)+size(Tfx2,3)); + alltfx(:,:,1:size(Tfx1,3)) = Tfx1; + alltfx(:,:,size(Tfx1,3)+1:end) = Tfx2; + clear Tfx1 Tfx2; + + alltfy = zeros(size(Tfy1,1), size(Tfy2,2), size(Tfy1,3)+size(Tfy2,3)); + alltfy(:,:,1:size(Tfy1,3)) = Tfy1; + alltfy(:,:,size(Tfy1,3)+1:end) = Tfy2; + clear Tfy1 Tfy2; + end; + + coherimages = zeros(size(allsavedcoher,1), size(allsavedcoher,2), g.naccu); + cond1trials = length(X{1})/g.frame; + cond2trials = length(X{2})/g.frame; + alltrials = [1:cond1trials+cond2trials]; + fprintf('Accumulating bootstrap:'); + + % preprocess data + % --------------- + switch g.type + case 'coher', % take the square of alltfx and alltfy + alltfx = alltfx.^2; + alltfy = alltfy.^2; + case 'phasecoher', % normalize + allsavedcoher = allsavedcoher ./ abs(allsavedcoher); + case 'phasecoher2', % don't do anything + end; + + if strcmp(g.type, 'coher') + [coherdiff coher1 coher2] = coher2conddiff( allsavedcoher, alltrials, ... + cond1trials, g.type, alltfx, alltfy); + else + [coherdiff coher1 coher2] = coher2conddiff( allsavedcoher, alltrials, ... + cond1trials, g.type); + end; + %figure; g.alpha = NaN; & to check that the new images are the same as the original + %subplot(1,3,1); plotall(coher1, [], [], times, freqs, mbase, find(freqs <= g.maxfreq), g); + %subplot(1,3,2); plotall(coher2, [], [], times, freqs, mbase, find(freqs <= g.maxfreq), g); + %return; + + for index=1:g.naccu + if rem(index,10) == 0, fprintf(' %d',index); end + if rem(index,120) == 0, fprintf('\n'); end + + if strcmp(g.type, 'coher') + coherimages(:,:,index) = coher2conddiff( allsavedcoher, shuffle(alltrials), ... + cond1trials, g.type, alltfx, alltfy); + else + coherimages(:,:,index) = coher2conddiff( allsavedcoher, shuffle(alltrials), ... + cond1trials, g.type); + end; + end; + fprintf('\n'); + + % create articially a Bootstrap object to compute significance + Boot = bootinit( [], size(allsavedcoher,1), g.timesout, g.naccu, 0, g.baseboot, ... + 'noboottype', g.alpha, g.rboot); + Boot.Coherboot.R = coherimages; + Boot = bootcomppost(Boot, [], [], []); + g.title = ''; + plotall(coherdiff, Boot.Coherboot.R, Boot.Rsignif, times, freqs, mbase, ... + find(freqs <= g.maxfreq), g); + end; + return; % ********************************** END PROCESSING TWO CONDITIONS +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% shuffle trials if necessary +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if g.shuffle ~= 0 + fprintf('x and y data trials being shuffled %d times\n',g.shuffle); + XX = reshape(X, 1, frame, length(X)/g.frame); + YY = Y; + X = []; + Y = []; + for index = 1:g.shuffle + XX = shuffle(XX,3); + X = [X XX(:,:)]; + Y = [Y YY]; + end; +end; + +% detrend over epochs (trials) if requested +% ----------------------------------------- +switch g.detrep +case 'on' + X = reshape(X, g.frame, length(X)/g.frame); + X = X - mean(X,2)*ones(1, length(X(:))/g.frame); + Y = reshape(Y, g.frame, length(Y)/g.frame); + Y = Y - mean(Y,2)*ones(1, length(Y(:))/g.frame); +end; + +% time limits +wintime = 500*g.winsize/g.srate; +times = [g.tlimits(1)+wintime:(g.tlimits(2)-g.tlimits(1)-2*wintime)/(g.timesout-1):g.tlimits(2)-wintime]; + +%%%%%%%%%% +% baseline +%%%%%%%%%% +if ~isnan(g.baseline) + baseln = find(times < g.baseline); % subtract means of pre-0 (centered) windows + if isempty(baseln) + baseln = 1:length(times); % use all times as baseline + disp('Bootstrap baseline empty, using the whole epoch.'); + end; + baselength = length(baseln); +else + baseln = 1:length(times); % use all times as baseline + baselength = length(times); % used for bootstrap +end; + +%%%%%%%%%%%%%%%%%%%% +% Initialize objects +%%%%%%%%%%%%%%%%%%%% +tmpsaveall = (~isnan(g.alpha) & isnan(g.rboot) & strcmp(g.memory, 'high')) ... + | (strcmp(g.subitc, 'on') & strcmp(g.memory, 'high')); +trials = length(X)/g.frame; +if ~strcmp(lower(g.compute), 'c') + Tfx = tfinit(X, g.timesout, g.winsize, g.cycles, g.frame, g.padratio, g.detret, ... + g.srate, g.maxfreq, g.subitc, g.type, g.cyclesfact, tmpsaveall); + Tfy = tfinit(Y, g.timesout, g.winsize, g.cycles, g.frame, g.padratio, g.detret, ... + g.srate, g.maxfreq, g.subitc, g.type, g.cyclesfact, tmpsaveall); + Coher = coherinit(Tfx.nb_points, trials, g.timesout, g.type); + Coherboot = coherinit(Tfx.nb_points, trials, g.naccu , g.type); + Boot = bootinit( Coherboot, Tfx.nb_points, g.timesout, g.naccu, baselength, ... + g.baseboot, g.boottype, g.alpha, g.rboot); + freqs = Tfx.freqs; + dispf = find(freqs <= g.maxfreq); + freqs = freqs(dispf); +else + freqs = g.srate*g.cycles/g.winsize*[2:2/g.padratio:g.winsize]/2; +end; +dispf = find(Tfx.freqs <= g.maxfreq); + +%------------- +% Reserve space +%------------- +% R = zeros(tfx.nb_points,g.timesout); % mean coherence +% RR = repmat(nan,tfx.nb_points,g.timesout); % initialize with nans +% Rboot = zeros(tfx.nb_points,g.naccu); % summed bootstrap coher +% switch g.type +% case 'coher', +% cumulXY = zeros(tfx.nb_points,g.timesout); +% cumulXYboot = zeros(tfx.nb_points,g.naccu); +% end; +% if g.bootsub > 0 +% Rboottrial = zeros(tfx.nb_points, g.timesout, g.bootsub); % summed bootstrap coher +% cumulXYboottrial = zeros(tfx.nb_points, g.timesout, g.bootsub); +% end; +% if ~isnan(g.alpha) & isnan(g.rboot) +% tf.tmpalltimes = repmat(nan,tfx.nb_points,g.timesout); +% end + +% -------------------- +% Display text to user +% -------------------- +fprintf('\nComputing Event-Related '); +switch g.type + case 'phasecoher', fprintf('Phase Coherence (ITC) images for %d trials.\n',length(X)/g.frame); + case 'phasecoher2', fprintf('Phase Coherence 2 (ITC) images for %d trials.\n',length(X)/g.frame); + case 'coher', fprintf('Linear Coherence (ITC) images for %d trials.\n',length(X)/g.frame); +end; +fprintf('The trial latency range is from %4.5g ms before to %4.5g ms after\n the time-locking event.\n', g.tlimits(1),g.tlimits(2)); +fprintf('The frequency range displayed will be %g-%g Hz.\n',min(freqs),g.maxfreq); +if ~isnan(g.baseline) + if length(baseln) == length(times) + fprintf('Using the full trial latency range as baseline.\n'); + else + fprintf('Using trial latencies from %4.5g ms to %4.5g ms as baseline.\n', g.tlimits,g.baseline); + end; +else + fprintf('No baseline time range was specified.\n'); +end; +if g.cycles==0 + fprintf('The data window size will be %d samples (%g ms).\n',g.winsize,2*wintime); + fprintf('The FFT length will be %d samples\n',g.winsize*g.padratio); +else + fprintf('The window size will be %2.3g cycles.\n',g.cycles); + fprintf('The maximum window size will be %d samples (%g ms).\n',g.winsize,2*wintime); +end +fprintf('The window will be applied %d times\n',g.timesout); +fprintf(' with an average step size of %2.2g samples (%2.4g ms).\n', Tfx.stp,1000*Tfx.stp/g.srate); +fprintf('Results will be oversampled %d times.\n',g.padratio); +if ~isnan(g.alpha) + fprintf('Bootstrap confidence limits will be computed based on alpha = %g\n', g.alpha); +else + fprintf('Bootstrap confidence limits will NOT be computed.\n'); +end +switch g.plotphase +case 'on', + if strcmp(g.angleunit,'deg') + fprintf(['Coherence angles will be imaged in degrees.\n']); + elseif strcmp(g.angleunit,'rad') + fprintf(['Coherence angles will be imaged in radians.\n']); + elseif strcmp(g.angleunit,'ms') + fprintf(['Coherence angles will be imaged in ms.\n']); + end +end; +fprintf('\nProcessing trial (of %d): ',trials); + +% firstboot = 1; +% Rn=zeros(trials,g.timesout); +% X = X(:)'; % make X and Y column vectors +% Y = Y(:)'; +% tfy = tfx; + +if strcmp(lower(g.compute), 'c') + % C PART + filename = [ 'tmpcrossf' num2str(round(rand(1)*1000)) ]; + f = fopen([ filename '.in'], 'w'); + fwrite(f, tmpsaveall, 'int32'); + fwrite(f, g.detret, 'int32'); + fwrite(f, g.srate, 'int32'); + fwrite(f, g.maxfreq, 'int32'); + fwrite(f, g.padratio, 'int32'); + fwrite(f, g.cycles, 'int32'); + fwrite(f, g.winsize, 'int32'); + fwrite(f, g.timesout, 'int32'); + fwrite(f, g.subitc, 'int32'); + fwrite(f, g.type, 'int32'); + fwrite(f, trials, 'int32'); + fwrite(f, g.naccu, 'int32'); + fwrite(f, length(X), 'int32'); + fwrite(f, X, 'double'); + fwrite(f, Y, 'double'); + fclose(f); + + command = [ '!cppcrosff ' filename '.in ' filename '.out' ]; + eval(command); + + f = fopen([ filename '.out'], 'r'); + size1 = fread(f, 'int32', 1); + size2 = fread(f, 'int32', 1); + Rreal = fread(f, 'double', [size1 size2]); + Rimg = fread(f, 'double', [size1 size2]); + Coher.R = Rreal + j*Rimg; + Boot.Coherboot.R = []; + Boot.Rsignif = []; +else + % ------------------------ + % MATLAB PART + % compute ITC if necessary + % ------------------------ + if strcmp(g.subitc, 'on') + for t=1:trials + if rem(t,10) == 0, fprintf(' %d',t); end + if rem(t,120) == 0, fprintf('\n'); end + Tfx = tfitc( Tfx, t, 1:g.timesout); + Tfy = tfitc( Tfy, t, 1:g.timesout); + end; + fprintf('\n'); + Tfx = tfitcpost( Tfx, trials); + Tfy = tfitcpost( Tfy, trials); + end; + + % --------- + % Main loop + % --------- + if g.savecoher, + trialcoher = zeros(Tfx.nb_points, g.timesout, trials); + else + trialcoher = []; + end; + for t=1:trials + if rem(t,10) == 0, fprintf(' %d',t); end + if rem(t,120) == 0, fprintf('\n'); end + + Tfx = tfcomp( Tfx, t, 1:g.timesout); + Tfy = tfcomp( Tfy, t, 1:g.timesout); + if g.savecoher + [Coher trialcoher(:,:,t)] = cohercomp( Coher, Tfx.tmpalltimes, ... + Tfy.tmpalltimes, t, 1:g.timesout); + else + Coher = cohercomp( Coher, Tfx.tmpalltimes, Tfy.tmpalltimes, t, 1:g.timesout); + end; + + Boot = bootcomp( Boot, Coher.Rn(t,:), Tfx.tmpalltimes, Tfy.tmpalltimes); + end % t = trial + [Boot Rbootout] = bootcomppost(Boot, Coher.Rn, Tfx.tmpall, Tfy.tmpall); + % Note that the bootstrap thresholding is actually performed + % in the display subfunction plotall() + + Coher = cohercomppost(Coher, trials); +end; + +% ---------------------------------- +% If coherence, perform the division +% ---------------------------------- +% switch g.type +% case 'coher', +% R = R ./ cumulXY; +% if ~isnan(g.alpha) & isnan(g.rboot) +% Rboot = Rboot ./ cumulXYboot; +% end; +% if g.bootsub > 0 +% Rboottrial = Rboottrial ./ cumulXYboottrial; +% end; +% case 'phasecoher', +% Rn = sum(Rn, 1); +% R = R ./ (ones(size(R,1),1)*Rn); % coherence magnitude +% if ~isnan(g.alpha) & isnan(g.rboot) +% Rboot = Rboot / trials; +% end; +% if g.bootsub > 0 +% Rboottrial = Rboottrial / trials; +% end; +% end; + +% ---------------- +% Compute baseline +% ---------------- +mbase = mean(abs(Coher.R(:,baseln)')); % mean baseline coherence magnitude + +% --------------- +% Plot everything +% --------------- +plotall(Coher.R, Boot.Coherboot.R, Boot.Rsignif, times, freqs, mbase, dispf, g); + +% -------------------------------------- +% Convert output Rangle to degrees or ms - Disabled to keep original default: radians output +% -------------------------------------- +% Rangle = angle(Coher.R); % returns radians +% if strcmp(g.angleunit,'ms') % convert to ms +% Rangle = (Rangle/(2*pi)).*repmat(1000./freqs(dispf)',1,length(times)); +% elseif strcmp(g.angleunit,'deg') % convert to deg +% Rangle = Rangle*180/pi; % convert to degrees +% else % angleunit is 'rad' +% % Rangle = Rangle; +% end +% Rangle(find(Rraw==0)) = 0; % mask for significance - set angle at non-signif coher points to 0 + +R = abs(Coher.R); +Rsignif = Boot.Rsignif; +Tfx = permute(Tfx.tmpall, [3 2 1]); % from [trials timesout nb_points] +% to [nb_points timesout trials] +Tfy = permute(Tfy.tmpall, [3 2 1]); + +return; % end crossf() ************************************************* + +% +% crossf() plotting functions +% ---------------------------------------------------------------------- +function plotall(R, Rboot, Rsignif, times, freqs, mbase, dispf, g) + +switch lower(g.plotphase) +case 'on', + switch lower(g.plotamp), + case 'on', ordinate1 = 0.67; ordinate2 = 0.1; height = 0.33; g.plot = 1; + case 'off', ordinate2 = 0.1; height = 0.9; g.plot = 1; + end; +case 'off', ordinate1 = 0.1; height = 0.9; + switch lower(g.plotamp), + case 'on', ordinate1 = 0.1; height = 0.9; g.plot = 1; + case 'off', g.plot = 0; + end; +end; + +% +% Compute cross-spectral angles +% ----------------------------- +Rangle = angle(R); % returns radians + +% +% Optionally convert Rangle to degrees or ms +% ------------------------------------------ +if strcmp(g.angleunit,'ms') % convert to ms + Rangle = (Rangle/(2*pi)).*repmat(1000./freqs(dispf)',1,length(times)); + maxangle = max(max(abs(Rangle))); +elseif strcmp(g.angleunit,'deg') % convert to degrees + Rangle = Rangle*180/pi; % convert to degrees + maxangle = 180; % use full-cycle plotting +else + maxangle = pi; % radians +end + +R = abs(R); + +% if ~isnan(g.baseline) +% R = R - repmat(mbase',[1 g.timesout]); % remove baseline mean +% end; + +Rraw = R; % raw coherence (e.g., coherency) magnitude values output + +if g.plot + fprintf('\nNow plotting...\n'); + set(gcf,'DefaultAxesFontSize',g.AXES_FONT) + colormap(jet(256)); + + pos = get(gca,'position'); % plot relative to current axes + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]; + axis('off') +end; + +switch lower(g.plotamp) +case 'on' + % + % Image the coherence [% perturbations] + % + RR = R; + if ~isnan(g.alpha) % zero out (and 'green out') nonsignif. R values + RR(find(RR < repmat(Rboot(:),[1 g.timesout]))) = 0; + Rraw(find(repmat(Rsignif(:),[1,size(Rraw,2)])>=Rraw))=0; + end + + if g.cmax == 0 + coh_caxis = max(max(R(dispf,:)))*[-1 1]; + else + coh_caxis = g.cmax*[-1 1]; + end + + h(6) = axes('Units','Normalized', 'Position',[.1 ordinate1 .8 height].*s+q); + + map=hsv(300); % install circular color map - green=0, yellow, orng, red, violet = max + % cyan, blue, violet = min + map = flipud([map(251:end,:);map(1:250,:)]); + map(151,:) = map(151,:)*0.9; % tone down the (0=) green! + colormap(map); + + imagesc(times,freqs(dispf),RR(dispf,:),coh_caxis); % plot the coherence image + if ~isempty(g.maxamp) + caxis([-g.maxamp g.maxamp]); + end; + tmpscale = caxis; + + hold on + plot([0 0],[0 freqs(max(dispf))],'--m','LineWidth',g.linewidth) + for i=1:length(g.marktimes) + plot([g.marktimes(i) g.marktimes(i)],[0 freqs(max(dispf))],'--m','LineWidth',g.linewidth); + end; + hold off + set(h(6),'YTickLabel',[],'YTick',[]) + set(h(6),'XTickLabel',[],'XTick',[]) + %title('Event-Related Coherence') + + h(8) = axes('Position',[.95 ordinate1 .05 height].*s+q); + cbar(h(8),151:300, [0 tmpscale(2)]); % use only positive colors (gyorv) + + % + % Plot delta-mean min and max coherence at each time point on bottom of image + % + h(10) = axes('Units','Normalized','Position',[.1 ordinate1-0.1 .8 .1].*s+q); + % plot marginal means below + Emax = max(R(dispf,:)); % mean coherence at each time point + Emin = min(R(dispf,:)); % mean coherence at each time point + plot(times,Emin, times, Emax, 'LineWidth',g.linewidth); hold on; + plot([times(1) times(length(times))],[0 0],'LineWidth',0.7); + plot([0 0],[-500 500],'--m','LineWidth',g.linewidth); + for i=1:length(g.marktimes) + plot([g.marktimes(i) g.marktimes(i)],[-500 500],'--m','LineWidth',g.linewidth); + end; + if ~isnan(g.alpha) & strcmp(g.boottype, 'trials') + % plot bootstrap significance limits (base mean +/-) + plot(times,mean(Rboot(dispf,:)),'g','LineWidth',g.linewidth); hold on; + plot(times,mean(Rsignif(dispf,:)),'k:','LineWidth',g.linewidth); + axis([min(times) max(times) 0 max([Emax(:)' Rsignif(:)'])*1.2]) + else + axis([min(times) max(times) 0 max(Emax)*1.2]) + end; + tick = get(h(10),'YTick'); + set(h(10),'YTick',[tick(1) ; tick(length(tick))]) + set(h(10),'YAxisLocation','right') + xlabel('Time (ms)') + ylabel('coh.') + + % + % Plot mean baseline coherence at each freq on left side of image + % + h(11) = axes('Units','Normalized','Position',[0 ordinate1 .1 height].*s+q); + % plot mean spectrum + E = abs(mbase(dispf)); % baseline mean coherence at each frequency + plot(freqs(dispf),E,'LineWidth',g.linewidth); % plot mbase + if ~isnan(g.alpha) % plot bootstrap significance limits (base mean +/-) + hold on + % plot(freqs(dispf),Rboot(:,dispf)+[E;E],'g','LineWidth',g.linewidth); + plot(freqs(dispf),mean(Rboot (dispf,:),2),'g','LineWidth',g.linewidth); + plot(freqs(dispf),mean(Rsignif(dispf,:),2),'k:','LineWidth',g.linewidth); + axis([freqs(1) freqs(max(dispf)) 0 max([E Rsignif(:)'])*1.2]); + else % plot marginal mean coherence only + if ~isnan(max(E)) + axis([freqs(1) freqs(max(dispf)) 0 max(E)*1.2]); + end; + end + + tick = get(h(11),'YTick'); + set(h(11),'YTick',[tick(1) ; tick(length(tick))]) + set(h(11),'View',[90 90]) + xlabel('Freq. (Hz)') + ylabel('coh.') +end; + +switch lower(g.plotphase) +case 'on' + % + % Plot coherence phase lags in bottom panel + % + h(13) = axes('Units','Normalized','Position',[.1 ordinate2 .8 height].*s+q); + Rangle(find(Rraw==0)) = 0; % when plotting, mask for significance + % = set angle at non-signif coher points to 0 + + imagesc(times,freqs(dispf),Rangle(dispf,:),[-maxangle maxangle]); % plot the + hold on % coherence phase angles + plot([0 0],[0 freqs(max(dispf))],'--m','LineWidth',g.linewidth); % zero-time line + for i=1:length(g.marktimes) + plot([g.marktimes(i) g.marktimes(i)],[0 freqs(max(dispf))],'--m','LineWidth',g.linewidth); + end; + + ylabel('Freq. (Hz)') + xlabel('Time (ms)') + + h(14)=axes('Position',[.95 ordinate2 .05 height].*s+q); + cbar(h(14),0,[-maxangle maxangle]); % two-sided colorbar +end + +if g.plot + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + if (length(g.title) > 0) % plot title + if h(6) ~= 0, axes(h(6)); else axes(h(13)); end; + %h = subplot('Position',[0 0 1 1].*s+q, 'Visible','Off'); + %h(13) = text(-.05,1.01,g.title); + h(13) = title(g.title); + %set(h(13),'VerticalAlignment','bottom') + %set(h(13),'HorizontalAlignment','left') + set(h(13),'FontSize',g.TITLE_FONT); + end + % + %%%%%%%%%%%%%%% plot topoplot() %%%%%%%%%%%%%%%%%%%%%%% + % + if (~isempty(g.topovec)) + h(15) = subplot('Position',[-.1 .43 .2 .14].*s+q); + if size(g.topovec,2) <= 2 + topoplot(g.topovec(1),g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10, 'chaninfo', g.chaninfo); + else + topoplot(g.topovec(1,:),g.elocs,'electrodes','off', 'chaninfo', g.chaninfo); + end; + axis('square') + + h(16) = subplot('Position',[.9 .43 .2 .14].*s+q); + if size(g.topovec,2) <= 2 + topoplot(g.topovec(2),g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10, 'chaninfo', g.chaninfo); + else + topoplot(g.topovec(2,:),g.elocs,'electrodes','off', 'chaninfo', g.chaninfo); + end; + axis('square') + end + + axcopy(gcf); +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TIME FREQUENCY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% function for time freq initialisation +% ------------------------------------- +function Tf = tfinit(X, timesout, winsize, ... + cycles, frame, padratio, detret, srate, maxfreq, subitc, type, cyclesfact, saveall); +Tf.X = X(:)'; % make X column vectors +Tf.winsize = winsize; +Tf.cycles = cycles; +Tf.frame = frame; +Tf.padratio = padratio; +Tf.detret = detret; +Tf.stp = (frame-winsize)/(timesout-1); +Tf.subitc = subitc; % for ITC +Tf.type = type; % for ITC +Tf.saveall = saveall; +if (Tf.cycles == 0) %%%%%%%%%%%%%% constant window-length FFTs %%%%%%%%%%%%%%%% + % Tf.freqs = srate/winsize*[1:2/padratio:winsize]/2; % incorect for padratio > 2 + Tf.freqs = linspace(0, srate/2, length([1:2/padratio:winsize])+1); + Tf.freqs = Tf.freqs(2:end); + Tf.win = hanning(winsize); + Tf.nb_points = padratio*winsize/2; +else % %%%%%%%%%%%%%%%%%% Constant-Q (wavelet) DFTs %%%%%%%%%%%%%%%%%%%%%%%%%%%% + Tf.freqs = srate*cycles/winsize*[2:2/padratio:winsize]/2; + Tf.win = dftfilt(winsize,maxfreq/srate,cycles,padratio,cyclesfact); + Tf.nb_points = size(Tf.win,2); +end; +Tf.tmpalltimes = zeros(Tf.nb_points, timesout); +trials = length(X)/frame; +if saveall + Tf.tmpall = repmat(nan,[trials timesout Tf.nb_points]); +else + Tf.tmpall = []; +end +Tf.tmpallbool = zeros(trials,timesout); +Tf.ITCdone = 0; +if Tf.subitc + Tf.ITC = zeros(Tf.nb_points, timesout); + switch Tf.type, + case { 'coher' 'phasecoher2' } + Tf.ITCcumul = zeros(Tf.nb_points, timesout); + end; +end; + +% function for itc +% ---------------- +function [Tf, itcvals] = tfitc(Tf, trials, times); +Tf = tfcomp(Tf, trials, times); +switch Tf.type + case 'coher', + Tf.ITC(:,times) = Tf.ITC(:,times) + Tf.tmpalltimes; % complex coher. + Tf.ITCcumul(:,times) = Tf.ITCcumul(:,times)+abs(Tf.tmpalltimes).^2; + case 'phasecoher2', + Tf.ITC(:,times) = Tf.ITC(:,times) + Tf.tmpalltimes; % complex coher. + Tf.ITCcumul(:,times) = Tf.ITCcumul(:,times)+abs(Tf.tmpalltimes); + case 'phasecoher', + Tf.ITC(:,times) = Tf.ITC(:,times) + Tf.tmpalltimes ./ abs(Tf.tmpalltimes); + % complex coher. +end % ~any(isnan()) +return; + +function [Tf, itcvals] = tfitcpost(Tf, trials); +switch Tf.type + case 'coher', Tf.ITC = Tf.ITC ./ sqrt(trials * Tf.ITCcumul); + case 'phasecoher2', Tf.ITC = Tf.ITC ./ Tf.ITCcumul; + case 'phasecoher', Tf.ITC = Tf.ITC / trials; % complex coher. +end % ~any(isnan()) + +if Tf.saveall + Tf.ITC = transpose(Tf.ITC); % do not use ' otherwise conjugate + + %imagesc(abs(Tf.ITC)); colorbar; figure; + %squeeze(Tf.tmpall(1,1,1:Tf.nb_points)) + %squeeze(Tf.ITC (1,1,1:Tf.nb_points)) + %Tf.ITC = shiftdim(Tf.ITC, -1); + + Tf.ITC = repmat(shiftdim(Tf.ITC, -1), [trials 1 1]); + Tf.tmpall = (Tf.tmpall - abs(Tf.tmpall) .* Tf.ITC) ./ abs(Tf.tmpall); + + % for index = 1:trials + % imagesc(squeeze(abs(Tf.tmpall(index,:,:)))); drawnow; figure; + % Tf.tmpall(index,:,:) = (Tf.tmpall(index,:,:) - Tf.tmpall(index,:,:) .* Tf.ITC)./Tf.tmpall(index,:,:); + % imagesc(squeeze(abs(Tf.tmpall(index,:,:)))); drawnow; + % subplot(10,10, index); imagesc(squeeze(abs(Tf.tmpall(index,:,:)))); caxis([0 1]); drawnow; + % end; + % squeeze(Tf.tmpall(1,1,1:Tf.nb_points)) + % figure; axcopy; + +end; +Tf.ITCdone = 1; +return; + +% function for time freq decomposition +% ------------------------------------ +function [Tf, tmpX] = tfcomp(Tf, trials, times); +% tf is an structure containing all the information about the decomposition +for trial = trials + for index = times + if ~Tf.tmpallbool(trial, index) % already computed + tmpX = Tf.X([1:Tf.winsize]+floor((index-1)*Tf.stp)+(trial-1)*Tf.frame); + + if ~any(isnan(tmpX)) % perform the decomposition + tmpX = tmpX - mean(tmpX); + switch Tf.detret, case 'on', + tmpX = detrend(tmpX); + end; + + if Tf.cycles == 0 % use FFTs + tmpX = Tf.win .* tmpX(:); + tmpX = fft(tmpX,Tf.padratio*Tf.winsize); + tmpX = tmpX(2:Tf.padratio*Tf.winsize/2+1); + else + tmpX = transpose(Tf.win) * tmpX(:); + end + else + tmpX = NaN; + end; + if Tf.ITCdone + tmpX = (tmpX - abs(tmpX) .* Tf.ITC(:,index)) ./ abs(tmpX); + end; + Tf.tmpalltimes(:,index) = tmpX; + if Tf.saveall + Tf.tmpall(trial, index,:) = tmpX; + Tf.tmpallbool(trial, index) = 1; + end + else + Tf.tmpalltimes(:,index) = Tf.tmpall(trial, index,:); + end; + end; +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COHERENCE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% function for coherence initialisation +% ------------------------------------- +function Coher = coherinit(nb_points, trials, timesout, type); +Coher.R = zeros(nb_points,timesout); % mean coherence +% Coher.RR = repmat(nan,nb_points,timesout); % initialize with nans +Coher.type = type; +Coher.Rn=zeros(trials,timesout); +switch type + case 'coher', + Coher.cumulX = zeros(nb_points,timesout); + Coher.cumulY = zeros(nb_points,timesout); + case 'phasecoher2', + Coher.cumul = zeros(nb_points,timesout); +end; + +% function for coherence calculation +% ------------------------------------- +% function Coher = cohercomparray(Coher, tmpX, tmpY, trial); +% switch Coher.type +% case 'coher', +% Coher.R = Coher.R + tmpX.*conj(tmpY); % complex coher. +% Coher.cumulXY = Coher.cumulXY + abs(tmpX).*abs(tmpY); +% case 'phasecoher', +% Coher.R = Coher.R + tmpX.*conj(tmpY) ./ (abs(tmpX).*abs(tmpY)); % complex coher. +% Coher.Rn(trial,:) = 1; +% end % ~any(isnan()) + +function [Coher,tmptrialcoh] = cohercomp(Coher, tmpX, tmpY, trial, time); +tmptrialcoh = tmpX.*conj(tmpY); +switch Coher.type + case 'coher', + Coher.R(:,time) = Coher.R(:,time) + tmptrialcoh; % complex coher. + Coher.cumulX(:,time) = Coher.cumulX(:,time) + abs(tmpX).^2; + Coher.cumulY(:,time) = Coher.cumulY(:,time) + abs(tmpY).^2; + case 'phasecoher2', + Coher.R(:,time) = Coher.R(:,time) + tmptrialcoh; % complex coher. + Coher.cumul(:,time) = Coher.cumul(:,time) + abs(tmptrialcoh); + case 'phasecoher', + Coher.R(:,time) = Coher.R(:,time) + tmptrialcoh ./ abs(tmptrialcoh); % complex coher. + %figure; imagesc(abs(tmpX.*conj(tmpY) ./ (abs(tmpX).*abs(tmpY)))); + Coher.Rn(trial,time) = Coher.Rn(trial,time)+1; +end % ~any(isnan()) + +% function for post coherence calculation +% --------------------------------------- +function Coher = cohercomppost(Coher, trials); +switch Coher.type + case 'coher', + Coher.R = Coher.R ./ sqrt(Coher.cumulX) ./ sqrt(Coher.cumulY); + case 'phasecoher2', + Coher.R = Coher.R ./ Coher.cumul; + case 'phasecoher', + Coher.Rn = sum(Coher.Rn, 1); + Coher.R = Coher.R ./ (ones(size(Coher.R,1),1)*Coher.Rn); % coherence magnitude +end; + +% function for 2 conditions coherence calculation +% ----------------------------------------------- +function [coherimage, coherimage1, coherimage2] = coher2conddiff( allsavedcoher, alltrials, cond1trials, type, tfx, tfy); + t1s = alltrials(1:cond1trials); + t2s = alltrials(cond1trials+1:end); + switch type + case 'coher', + coherimage1 = sum(allsavedcoher(:,:,t1s),3) ./ sqrt(sum(tfx(:,:,t1s),3)) ./ sqrt(sum(tfy(:,:,t1s),3)); + coherimage2 = sum(allsavedcoher(:,:,t2s),3) ./ sqrt(sum(tfx(:,:,t2s),3)) ./ sqrt(sum(tfy(:,:,t1s),3)); + case 'phasecoher2', + coherimage1 = sum(allsavedcoher(:,:,t1s),3) ./ sum(abs(allsavedcoher(:,:,t1s)),3); + coherimage2 = sum(allsavedcoher(:,:,t2s),3) ./ sum(abs(allsavedcoher(:,:,t2s)),3); + case 'phasecoher', + coherimage1 = sum(allsavedcoher(:,:,t1s),3) / cond1trials; + coherimage2 = sum(allsavedcoher(:,:,t2s),3) / (size(allsavedcoher,3)-cond1trials); + end; + coherimage = coherimage2 - coherimage1; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BOOTSTRAP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% function for bootstrap initialisation +% ------------------------------------- +function Boot = bootinit(Coherboot, nb_points, timesout, naccu, baselength, baseboot, boottype, alpha, rboot); +Boot.Rboot = zeros(nb_points,naccu); % summed bootstrap coher +Boot.boottype = boottype; +Boot.baselength = baselength; +Boot.baseboot = baseboot; +Boot.Coherboot = Coherboot; +Boot.naccu = naccu; +Boot.alpha = alpha; +Boot.rboot = rboot; + +% function for bootstrap computation +% ---------------------------------- +function Boot = bootcomp(Boot, Rn, tmpalltimesx, tmpalltimesy); +if ~isnan(Boot.alpha) & isnan(Boot.rboot) + if strcmp(Boot.boottype, 'times') % get g.naccu bootstrap estimates for each trial + goodbasewins = find(Rn==1); + if Boot.baseboot % use baseline windows only + goodbasewins = find(goodbasewins<=Boot.baselength); + end + ngdbasewins = length(goodbasewins); + j=1; + tmpsX = zeros(size(tmpalltimesx,1), Boot.naccu); + tmpsY = zeros(size(tmpalltimesx,1), Boot.naccu); + if ngdbasewins > 1 + while j<=Boot.naccu + s = ceil(rand([1 2])*ngdbasewins); % random ints [1,g.timesout] + s = goodbasewins(s); + if ~any(isnan(tmpalltimesx(:,s(1)))) & ~any(isnan(tmpalltimesy(:,s(2)))) + tmpsX(:,j) = tmpalltimesx(:,s(1)); + tmpsY(:,j) = tmpalltimesy(:,s(2)); + j = j+1; + end + end + Boot.Coherboot = cohercomp(Boot.Coherboot, tmpsX, tmpsY, 1, 1:Boot.naccu); + end; + end +end; + +% handle other trial bootstrap types +% ---------------------------------- +function [Boot, Rbootout] = bootcomppost(Boot, allRn, alltmpsX, alltmpsY); +trials = size(alltmpsX, 1); +times = size(alltmpsX, 2); +nb_points = size(alltmpsX, 3); +if ~isnan(Boot.alpha) & isnan(Boot.rboot) + if strcmp(Boot.boottype, 'trials') % get g.naccu bootstrap estimates for each trial + fprintf('\nProcessing trial bootstrap (of %d):',times(end)); + tmpsX = zeros(size(alltmpsX,3), Boot.naccu); + tmpsY = zeros(size(alltmpsY,3), Boot.naccu ); + Boot.fullcoherboot = zeros(nb_points, Boot.naccu, times); + + for index=1:times + if rem(index,10) == 0, fprintf(' %d',index); end + if rem(index,120) == 0, fprintf('\n'); end + for allt=1:trials + j=1; + while j<=Boot.naccu + t = ceil(rand([1 2])*trials); % random ints [1,g.timesout] + if (allRn(t(1),index) == 1) & (allRn(t(2),index) == 1) + tmpsX(:,j) = squeeze(alltmpsX(t(1),index,:)); + tmpsY(:,j) = squeeze(alltmpsY(t(2),index,:)); + j = j+1; + end + end + Boot.Coherboot = cohercomp(Boot.Coherboot, tmpsX, tmpsY, 1, 1:Boot.naccu); + end; + Boot.Coherboot = cohercomppost(Boot.Coherboot); % CHECK IF NECSSARY FOR ALL BOOT TYPE + Boot.fullcoherboot(:,:,index) = Boot.Coherboot.R; + Boot.Coherboot = coherinit(nb_points, trials, Boot.naccu, Boot.Coherboot.type); + end; + Boot.Coherboot.R = Boot.fullcoherboot; + Boot = rmfield(Boot, 'fullcoherboot'); + elseif strcmp(Boot.boottype, 'timestrials') % handle timestrials bootstrap + fprintf('\nProcessing time and trial bootstrap (of %d):',trials); + tmpsX = zeros(size(alltmpsX,3), Boot.naccu); + tmpsY = zeros(size(alltmpsY,3), Boot.naccu ); + for allt=1:trials + if rem(allt,10) == 0, fprintf(' %d',allt); end + if rem(allt,120) == 0, fprintf('\n'); end + j=1; + while j<=Boot.naccu + t = ceil(rand([1 2])*trials); % random ints [1,g.timesout] + goodbasewins = find((allRn(t(1),:) & allRn(t(2),:)) ==1); + if Boot.baseboot % use baseline windows only + goodbasewins = find(goodbasewins<=baselength); + end + ngdbasewins = length(goodbasewins); + + if ngdbasewins>1 + s = ceil(rand([1 2])*ngdbasewins); % random ints [1,g.timesout] + s=goodbasewins(s); + + if all(allRn(t(1),s(1)) == 1) & all(allRn(t(2),s(2)) == 1) + tmpsX(:,j) = squeeze(alltmpsX(t(1),s(1),:)); + tmpsY(:,j) = squeeze(alltmpsY(t(2),s(2),:)); + j = j+1; + end + end + end + Boot.Coherboot = cohercomp(Boot.Coherboot, tmpsX, tmpsY, 1, 1:Boot.naccu); + end + Boot.Coherboot = cohercomppost(Boot.Coherboot); + elseif strcmp(Boot.boottype, 'times') % boottype is 'times' + Boot.Coherboot = cohercomppost(Boot.Coherboot); + end; +end; + +% test if precomputed +if ~isnan(Boot.alpha) & isnan(Boot.rboot) % if bootstrap analysis included . . . + % 'boottype'='times' or 'timestrials', size(R)=nb_points*naccu + % 'boottype'='trials', size(R)=nb_points*naccu*times + Boot.Coherboot.R = abs (Boot.Coherboot.R); + Boot.Coherboot.R = sort(Boot.Coherboot.R,2); + + % compute bootstrap significance level + i = round(Boot.naccu*Boot.alpha); + Boot.Rsignif = mean(Boot.Coherboot.R(:,Boot.naccu-i+1:Boot.naccu),2); % significance levels for Rraw + Boot.Coherboot.R = squeeze(mean(Boot.Coherboot.R(:,Boot.naccu-i+1:Boot.naccu),2)); + if size(Boot.Coherboot.R, 2) == 1 + Rbootout(:,2) = Boot.Coherboot.R; + else + Rbootout(:,:,2) = Boot.Coherboot.R; + end; + % BEFORE + %Rboot = [mean(Rboot(1:i,:)) ; mean(Rboot(g.naccu-i+1:g.naccu,:))]; +elseif ~isnan(Boot.rboot) + Boot.Coherboot.R = Boot.rboot; + Boot.Rsignif = Boot.rboot; + Rbootout = Boot.rboot; +else + Boot.Coherboot.R = []; + Boot.Rsignif = []; + Rbootout = []; +end % NOTE: above, mean ????? + +function w = hanning(n) +if ~rem(n,2) + w = .5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = .5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt.m b/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt.m new file mode 100644 index 0000000..f66bf28 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt.m @@ -0,0 +1,74 @@ +% dftfilt() - discrete Fourier filter +% +% Usage: +% >> b = dftfilt(n,W,c,k,q) +% +% Inputs: +% n - number of input samples +% W - maximum angular freq. relative to n, 0 < W <= .5 +% c - cycles +% k - oversampling +% q - [0;1] 0->fft, 1->c cycles +% +% Authors: Sigurd Enghoff, Arnaud Delorme & Scott Makeig, +% SCCN/INC/UCSD, La Jolla, 8/1/98 + +% Copyright (C) 8/1/98 Sigurd Enghoff & Scott Makei, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +% future developments +% ------------------- +% input into dftfilt: +% - lowfreq and maxfreq (of interest) +% - lowcycle and maxcyle (ex: 3 cycles at low freq and 10 cycles at maxfreq) +% - the delta in frequency: ex 0.5 Hz +% The function should: compute the number of points (len) automatically +% Warning with FFT compatibility +% Still, something has to be done about the masking so that it would be comaptible + +function b = dftfilt(len,maxfreq,cycle,oversmp,wavfact) + +count = 1; +for index = 1:1/oversmp:maxfreq*len/cycle % scan frequencies + w(:,count) = j * index * cycle * linspace(-pi+2*pi/len, pi-2*pi/len, len)'; % exp(-w) is a sinus curve + count = count+1; % -2*pi/len ensures that we really scan from -pi to pi without redundance (-pi=+pi) +end; +b = exp(-w); + +%srate = 2*pi/len; % Angular increment. +%w = j * cycle * [0:srate:2*pi-srate/2]'; % Column. +%x = 1:1/oversmp:maxfreq*len/cycle; % Row. +%b = exp(-w*x); % Exponentiation of outer product. + +for i = 1:size(b,2), + m = round(wavfact*len*(i-1)/(i+oversmp-1)); % Number of elements to discard. + mu = round(m/2); % Number of upper elemnts. + ml = m-round(m/2); % Number of lower elemnts. + b(:,i) = b(:,i) .* [zeros(mu,1) ; hanning(len-m) ; zeros(ml,1)]; +end + +% syemtric hanning function +function w = hanning(n) +if ~rem(n,2) + w = .5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = .5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end + diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt2.m b/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt2.m new file mode 100644 index 0000000..dc5f12d --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt2.m @@ -0,0 +1,148 @@ +% dftfilt2() - discrete complex wavelet filters +% +% Usage: +% >> wavelet = dftfilt2( freqs, cycles, srate, cyclefact) +% +% Inputs: +% freqs - frequency array +% cycles - cycles array. If one value is given, all wavelets have +% the same number of cycles. If two values are given, the +% two values are used for the number of cycles at the lowest +% frequency and at the highest frequency, with linear +% interpolation between these values for intermediate +% frequencies +% srate - sampling rate (in Hz) +% +% cycleinc - ['linear'|'log'] increase mode if [min max] cycles is +% provided in 'cycle' parameter. {default: 'linear'} +% type - ['sinus'|'morlet'] wavelet type is a sinusoid with +% cosine (real) and sine (imaginary) parts tapered by +% a Hanning or Morlet function. 'morlet' is a typical Morlet +% wavelet (with p=2*pi and sigma=0.7) best matching the +% 'sinus' Hanning taper) {default: 'morlet'} +% Output: +% wavelet - cell array of wavelet filters +% +% Note: The length of the window is automatically computed from the +% number of cycles and is always made odd. +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 3/28/2003 + +% Copyright (C) 3/28/2003 Arnaud Delorme 8, SCCN/INC/UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function wavelet = dftfilt2( freqs, cycles, srate, cycleinc, type); + + if nargin < 3 + error('3 arguments required'); + end; + if nargin < 5 + type = 'morlet'; + end; + + % compute number of cycles at each frequency + % ------------------------------------------ + if length(cycles) == 1 + cycles = cycles*ones(size(freqs)); + elseif length(cycles) == 2 + if nargin == 4 & strcmpi(cycleinc, 'log') % cycleinc + cycles = linspace(log(cycles(1)), log(cycles(2)), length(freqs)); + cycles = exp(cycles); + else + cycles = linspace(cycles(1), cycles(2), length(freqs)); + end; + end; + + % compute wavelet + for index = 1:length(freqs) + + % number of cycles depend on window size + % number of cycles automatically reduced if smaller window + % note: as the number of cycle changes, the frequency shifts a little + % this has to be fixed + + winlen = cycles(index)*srate/freqs(index); + winlenint = floor(winlen); + if mod(winlenint,2) == 1, winlenint = winlenint+1; end; + winval = linspace(winlenint/2, -winlenint/2, winlenint+1); + + if strcmpi(type, 'sinus') % Hanning + win = exp(2i*pi*freqs(index)*winval/srate); + wavelet{index} = win .* hanning(length(winval))'; + + else % Morlet + t = freqs(index)*winval/srate; + p = 2*pi; + s = cycles(index)/5; + wavelet{index} = exp(j*t*p)/sqrt(2*pi) .* ... + (exp(-t.^2/(2*s^2))-sqrt(2)*exp(-t.^2/(s^2)-p^2*s^2/4)); + end; + end; + + + return; + + % testing + % ------- + wav1 = dftfilt2(5, 5, 256); wav1 = wav1{1}; + abs1 = linspace(-floor(length(wav1)),floor(length(wav1)), length(wav1)); + figure; plot(abs1, real(wav1), 'b'); + + wav2 = dftfilt2(5, 3, 256); wav2 = wav2{1}; + abs2 = linspace(-floor(length(wav2)),floor(length(wav2)), length(wav2)); + hold on; plot(abs2, real(wav2), 'r'); + + wav3 = dftfilt2(5, 1.4895990, 256); wav3 = wav3{1}; + abs3 = linspace(-floor(length(wav3)),floor(length(wav3)), length(wav3)); + hold on; plot(abs3, real(wav3), 'g'); + + wav4 = dftfilt2(5, 8.73, 256); wav4 = wav4{1}; + abs4 = linspace(-floor(length(wav4)),floor(length(wav4)), length(wav4)); + hold on; plot(abs4, real(wav4), 'm'); + + % more testing + % ------------ + freqs = exp(linspace(0,log(10),10)); + win = dftfilt2(freqs, [3 3], 256, 'linear', 'sinus'); + win = dftfilt2(freqs, [3 3], 256, 'linear', 'morlet'); + + freqs = [12.0008 13.2675 14.5341 15.8007 17.0674 18.3340 19.6007 20.8673 22.1339 23.4006 24.6672 25.9339 27.2005 28.4671 29.7338 31.0004 32.2670 33.5337 34.8003 36.0670 37.3336 38.6002 39.8669 41.1335 42.4002 43.6668 44.9334 46.2001 47.4667 ... + 48.7334 50.0000]; + + win = dftfilt2(freqs, [3 12], 256, 'linear'); size(win) + + winsize = 0; + for index = 1:length(win) + winsize = max(winsize,length(win{index})); + end; + allwav = zeros(winsize, length(win)); + for index = 1:length(win) + wav1 = win{index}; + abs1 = linspace(-(length(wav1)-1)/2,(length(wav1)-1)/2, length(wav1)); + allwav(abs1+(winsize+1)/2,index) = wav1(:); + end; + figure; imagesc(imag(allwav)); + + +% syemtric hanning function +function w = hanning(n) +if ~rem(n,2) + w = .5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = .5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt3.m b/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt3.m new file mode 100644 index 0000000..e8c3d84 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/dftfilt3.m @@ -0,0 +1,194 @@ +% dftfilt3() - discrete complex wavelet filters +% +% Usage: +% >> [wavelet,cycles,freqresol,timeresol] = dftfilt3( freqs, cycles, srate, varargin) +% +% Inputs: +% freqs - vector of frequencies of interest. +% cycles - cycles array. If cycles=0, then the Hanning tapered Short-term FFT is used. +% If one value is given and cycles>0, all wavelets have +% the same number of cycles. If two values are given, the +% two values are used for the number of cycles at the lowest +% frequency and at the highest frequency, with linear or +% log-linear interpolation between these values for intermediate +% frequencies +% srate - sampling rate (in Hz) +% +% Optional Inputs: Input these as 'key/value pairs. +% 'cycleinc' - ['linear'|'log'] increase mode if [min max] cycles is +% provided in 'cycle' parameter. {default: 'linear'} +% 'winsize' Use this option for Hanning tapered FFT or if you prefer to set the length of the +% wavelets to be equal for all of them (e.g., to set the +% length to 256 samples input: 'winsize',256). {default: []) +% Note: the output 'wavelet' will be a matrix and it may be +% incompatible with current versions of timefreq and newtimef. +% 'timesupport' The number of temporal standard deviation used for wavelet lengths {default: 7) +% +% Output: +% wavelet - cell array or matrix of wavelet filters +% timeresol - temporal resolution of Morlet wavelets. +% freqresol - frequency resolution of Morlet wavelets. +% +% Note: The length of the window is always made odd. +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 3/28/2003 +% Rey Ramirez, SCCN/INC/UCSD, La Jolla, 9/26/2006 + +% Copyright (C) 3/28/2003 Arnaud Delorme 8, SCCN/INC/UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% +% Revision 1.12 2006/09/25 rey r +% Almost complete rewriting of dftfilt2.m, changing both Morlet and Hanning +% DFT to be more in line with conventional implementations. +% +% Revision 1.11 2006/09/07 19:05:34 scott +% further clarified the Morlet/Hanning distinction -sm +% +% Revision 1.10 2006/09/07 18:55:15 scott +% clarified window types in help msg -sm +% +% Revision 1.9 2006/05/05 16:17:36 arno +% implementing cycle array +% +% Revision 1.8 2004/03/04 19:31:03 arno +% email +% +% Revision 1.7 2004/02/25 01:45:55 arno +% sinus test +% +% Revision 1.6 2004/02/15 22:23:08 arno +% implementing morlet wavelet +% +% Revision 1.5 2003/05/09 20:55:10 arno +% adding hanning function +% +% Revision 1.4 2003/04/29 16:02:54 arno +% header typos +% +% Revision 1.3 2003/04/29 01:09:16 arno +% debug imaginary part +% +% Revision 1.2 2003/04/28 23:01:13 arno +% *** empty log message *** +% +% Revision 1.1 2003/04/28 22:46:49 arno +% Initial revision +% + +function [wavelet,cycles,freqresol,timeresol] = dftfilt3( freqs, cycles, srate, varargin); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Rey fixed all input parameter sorting. +if nargin < 3 + error(' A minimum of 3 arguments is required'); +end; +numargin=length(varargin); +if rem(numargin,2) + error('There is an uneven number key/value inputs. You are probably missing a keyword or its value.') +end +varargin(1:2:end)=lower(varargin(1:2:end)); + +% Setting default parameter values. +cycleinc='linear'; +winsize=[]; +timesupport=7; % Setting default of 7 temporal standard deviations for wavelet's length. + +for n=1:2:numargin + keyword=varargin{n}; + if strcmpi('cycleinc',keyword) + cycleinc=varargin{n+1}; + elseif strcmpi('winsize',keyword) + winsize=varargin{n+1}; + if ~mod(winsize,2) + winsize=winsize+1; % Always set to odd length wavelets and hanning windows; + end + elseif strcmpi('timesupport',keyword) + timesupport=varargin{n+1}; + else + error(['What is ' keyword '? The only legal keywords are: type, cycleinc, winsize, or timesupport.']) + end +end +if isempty(winsize) & cycles==0 + error('If you are using a Hanning tapered FFT, please supply the winsize input-pair.') +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% compute number of cycles at each frequency +% ------------------------------------------ +type='morlet'; +if length(cycles) == 1 & cycles(1)~=0 + cycles = cycles*ones(size(freqs)); +elseif length(cycles) == 2 + if strcmpi(cycleinc, 'log') % cycleinc + cycles = linspace(log(cycles(1)), log(cycles(2)), length(freqs)); + cycles = exp(cycles); + %cycles=logspace(log10(cycles(1)),log10(cycles(2)),length(freqs)); %rey + else + cycles = linspace(cycles(1), cycles(2), length(freqs)); + end; +end; +if cycles==0 + type='sinus'; +end + +sp=1/srate; % Rey added this line (i.e., sampling period). +% compute wavelet +for index = 1:length(freqs) + fk=freqs(index); + if strcmpi(type, 'morlet') % Morlet. + sigf=fk/cycles(index); % Computing time and frequency standard deviations, resolutions, and normalization constant. + sigt=1./(2*pi*sigf); + A=1./sqrt(sigt*sqrt(pi)); + timeresol(index)=2*sigt; + freqresol(index)=2*sigf; + if isempty(winsize) % bases will be a cell array. + tneg=[-sp:-sp:-sigt*timesupport/2]; + tpos=[0:sp:sigt*timesupport/2]; + t=[fliplr(tneg) tpos]; + psi=A.*(exp(-(t.^2)./(2*(sigt^2))).*exp(2*i*pi*fk*t)); + wavelet{index}=psi; % These are the wavelets with variable number of samples based on temporal standard deviations (sigt). + else % bases will be a matrix. + tneg=[-sp:-sp:-sp*winsize/2]; + tpos=[0:sp:sp*winsize/2]; + t=[fliplr(tneg) tpos]; + psi=A.*(exp(-(t.^2)./(2*(sigt^2))).*exp(2*i*pi*fk*t)); + wavelet(index,:)=psi; % These are the wavelets with the same length. + % This is useful for doing time-frequency analysis as a matrix vector or matrix matrix multiplication. + end + elseif strcmpi(type, 'sinus') % Hanning + tneg=[-sp:-sp:-sp*winsize/2]; + tpos=[0:sp:sp*winsize/2]; + t=[fliplr(tneg) tpos]; + win = exp(2*i*pi*fk*t); + wavelet(index,:) = win .* hanning(winsize)'; + %wavelet{index} = win .* hanning(winsize)'; + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + end; +end; + + + +% symmetric hanning function +function w = hanning(n) +if ~rem(n,2) + w = .5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = .5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/newcrossf.m b/code/eeglab13_4_4b/functions/timefreqfunc/newcrossf.m new file mode 100644 index 0000000..75527c7 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/newcrossf.m @@ -0,0 +1,1455 @@ +% newcrossf() - Returns estimates and plots event-related coherence (ERCOH) +% between two input data time series. A lower panel (optionally) shows +% the coherence phase difference between the processes. In this panel: +% In the plot output by > newcrossf(x,y,...); +% 90 degrees (orange) means x leads y by a quarter cycle. +% -90 degrees (blue) means y leads x by a quarter cycle. +% Click on any subplot to view separately and zoom in/out. +% +% Function description: +% Uses EITHER fixed-window, zero-padded FFTs (fastest) OR constant-Q +% 0-padded wavelet DFTs (more even sensitivity across frequencies), +% both Hanning-tapered. Output frequency spacing is the lowest +% frequency ('srate'/'winsize') divided by the 'padratio'. +% +% If an 'alpha' value is given, then bootstrap statistics are +% computed (from a distribution of 'naccu' (200) surrogate baseline +% data epochs) for the baseline epoch, and non-significant features +% of the output plots are zeroed (and shown in green). The baseline +% epoch is all windows with center latencies < the given 'baseline' value +% or, if 'baseboot' is 1, the whole epoch. +% +% Usage with single dataset: +% >> [coh,mcoh,timesout,freqsout,cohboot,cohangles,... +% allcoher,alltfX,alltfY] = newcrossf(x,y,frames,tlimits,srate, ... +% cycles, 'key1', 'val1', 'key2', val2' ...); +% +% Example to compare two condition (coh. comp 1-2 EEG versus ALLEEG(2)): +% >> [coh,mcoh,timesout,freqsout,cohboot,cohangles,... +% allcoher,alltfX,alltfY] = newcrossf({EEG.icaact(1,:,:) ... +% ALLEEG(2).icaact(1,:,:)},{{EEG.icaact(2,:,:) ... +% ALLEEG(2).icaact(2,:,:)}},frames,tlimits,srate, ... +% cycles, 'key1', 'val1', 'key2', val2' ...); +% +% Required inputs: +% x = First single-channel data set (1,frames*nepochs) +% Else, cell array {x1,x2} of two such data vectors to also +% estimate (significant) coherence differences between two +% conditions. +% y = Second single-channel data set (1,frames*nepochs) +% Else, cell array {y1,y2} of two such data vectors. +% frames = Frames per epoch {750} +% tlimits = [mintime maxtime] (ms) Epoch latency limits {[-1000 2000]} +% srate = Data sampling rate (Hz) {250} +% cycles = 0 -> Use FFTs (with constant window length) +% = >0 -> Number of cycles in each analysis wavelet +% = [cycles expfactor] -> if 0 < expfactor < 1, the number +% of wavelet cycles expands with frequency from cycles +% If expfactor = 1, no expansion; if = 0, constant +% window length (as in FFT) {default cycles: 0} +% +% Optional Coherence Type: +% 'type' = ['coher'|'phasecoher'|'amp'] Compute either linear coherence +% ('coher'), phase coherence ('phasecoher') also known +% as phase coupling factor', or amplitude correlations ('amp') +% {default: 'phasecoher'}. Note that for amplitude correlation, +% the significance threshold is computed using the corrcoef +% function, so can be set arbitrary low without increase in +% computation load. An additional type is 'crossspec' to compute +% cross-spectrum between 2 processes (single-trial). This type +% is automatically selected if user enter continuous data. +% 'amplag' = [integer vector] allow to compute non 0 amplitude correlation +% (using option 'amp' above). The vector given as parameter +% indicates the point lags ([-4 -2 0 2 4] would compute the +% correlation at time t-4, t-2, t, t+2, t+4, and return the +% maximum correlation at these points). +% 'subitc' = ['on'|'off'] Subtract stimulus locked Inter-Trial Coherence +% from x and y. This computes the 'intrinsic' coherence +% x and y not arising from common synchronization to +% experimental events. For cell array input, one may provide +% a cell array ({'on','off'} for example). {default: 'off'} +% 'shuffle' = Integer indicating the number of estimates to compute +% bootstrap coherence based on shuffled trials. This estimates +% the coherence arising only from time locking of x and y +% to experimental events (opposite of 'subitc'). For cell array +% input, one may provide a cell array, for example { 1 0 }. +% { default 0: no shuffling }. +% +% Optional Detrend: +% 'detrend' = ['on'|'off'], Linearly detrend each data epoch {'off'} +% 'rmerp' = ['on'|'off'], Remove epoch mean from data epochs {'off'} +% +% Optional FFT/DFT: +% 'winsize' = If cycles==0: data subwindow length (fastest, 2^n0: *longest* window length to use. This +% determines the lowest output frequency {~frames/8} +% 'timesout' = Number of output latencies (int0) +% If cycles==0, all FFT frequencies are output.{def: 50} +% Note: NOW DEPRECATED, use 'freqs' instead, +% 'freqs' = [min max] Frequency limits. {Default: [minfreq 50], +% minfreq being determined by the number of data points, +% cycles and sampling frequency}. +% 'nfreqs' = Number of output frequencies. For FFT, closest computed +% frequency will be returned. Overwrite 'padratio' effects +% for wavelets. {Default: use 'padratio'}. +% 'freqscale' = ['log'|'linear'] Frequency scaling. {Default: 'linear'}. +% Note that for obtaining 'log' spaced freqs using FFT, +% closest correspondant frequencies in the 'linear' space +% are returned. +% 'baseline' = Spectral baseline end-time (in ms). NaN imply that no +% baseline is used. A range [min max] may also be entered +% You may also enter one row per region for baseline +% e.g. [0 100; 300 400] considers the window 0 to 100 ms and +% 300 to 400 ms. This is only valid for the coherence amplitude +% not for the coherence phase. { default NaN } +% 'lowmem' = ['on'|'off'] {'off'} Compute frequency by frequency to +% save memory. +% +% Optional Bootstrap: +% 'alpha' = If non-0, compute two-tailed bootstrap significance prob. +% level. Show non-signif output values in neutral green. {0} +% 'naccu' = Number of bootstrap replications to compute {200} +% 'boottype' = ['shuffle'|'shufftrials'|'rand'|'randall'] Bootstrap type: Either +% shuffle time and trial windows ('shuffle' default) or trials only +% using a separate bootstrap for each time window ('shufftrials'). +% Option 'rand' randomize the phase. Option 'randall' randomize the +% phase for each individual time/frequency point. +% 'baseboot' = Bootstrap baseline subtract (1 -> use 'baseline'; Default +% 0 -> use whole trial +% [min max] -> use time range) +% Default is to use the baseline unless no baseline is +% specified (then the function uses all sample up to time 0) +% You may also enter one row per region for baseline +% e.g. [0 100; 300 400] considers the window 0 to 100 ms and +% 300 to 400 ms. +% 'condboot' = ['abs'|'angle'|'complex'] In comparing two conditions, +% either subtract complex spectral values' absolute vales +% ('abs'), angles ('angles') or the complex values themselves +% ('complex'). {default: 'abs'} +% 'rboot' = Input bootstrap coherence limits (e.g., from newcrossf()) +% The bootstrap type should be identical to that used +% to obtain the input limits. {default: compute from data} +% Optional scalp map plot: +% 'topovec' = (2,nchans) matrix. Scalp maps to plot {[]} +% ELSE [c1,c2], plot two cartoons showing channel locations. +% 'elocs' = Electrode location file for scalp map {none} +% File should be ascii in format of >> topoplot example +% 'chaninfo' = Electrode location additional information (nose position...) +% {default: none} +% +% Optional plot and compute features: +% 'plottype' = ['image'|'curve'] plot time frequency images or +% curves (one curve per frequency). Default is 'image'. +% 'plotmean' = ['on'|'off'] For 'curve' plots only. Average all +% frequencies given as input. Default: 'on'. +% 'highlightmode' = ['background'|'bottom'] For 'curve' plots only, +% display significant time regions either in the plot background +% or underneatht the curve. +% 'plotamp' = ['on'|'off']. Plot coherence magnitude {'on'} +% 'maxamp' = [real] Set the maximum for the amplitude scale {auto} +% 'plotphase' = ['on'|'off']. Plot coherence phase angle {'on'} +% 'angleunit' = Phase units: 'ms' for msec or 'deg' for degrees or 'rad' +% for radians {'deg'} +% 'title' = Optional figure title. If two conditions are given +% as input, title can be a cell array with two text +% string elements {none} +% 'vert' = Latencies to mark with a dotted vertical line {none} +% 'linewidth' = Line width for marktimes traces (thick=2, thin=1) {2} +% 'newfig' = ['on'|'off'] Create new figure for difference plots {'on'} +% 'axesfont' = Axes font size {10} +% 'titlefont' = Title font size {8} +% +% Outputs: +% coh = Matrix (nfreqs,timesout) of coherence magnitudes. Not +% that for continuous data, the function is returning the +% cross-spectrum. +% mcoh = Vector of mean baseline coherence at each frequency +% see 'baseline' parameter. +% timesout = Vector of output latencies (window centers) (ms). +% freqsout = Vector of frequency bin centers (Hz). +% cohboot = Matrix (nfreqs) of upper coher signif. limits +% if 'boottype' is 'trials', (nfreqs,timesout) +% cohangle = (nfreqs,timesout) matrix of coherence angles in radian +% allcoher = single trial coherence +% alltfX = single trial spectral decomposition of X +% alltfY = single trial spectral decomposition of Y +% +% Plot description: +% Assuming both 'plotamp' and 'plotphase' options are 'on' (=default), the upper panel +% presents the magnitude of either phase coherence or linear coherence, depending on +% the 'type' parameter (above). The lower panel presents the coherence phase difference +% (in degrees). Click on any plot to pop up a new window (using 'axcopy()'). +% -- The upper left marginal panel shows mean coherence during the baseline period +% (blue), and when significance is set, the significance threshold (dotted black-green). +% -- The horizontal panel under the coherence magnitude image indicates the maximum +% (green) and minimum (blue) coherence values across all frequencies. When significance +% is set (using option 'trials' for 'boottype'), an additional curve indicates the +% significance threshold (dotted black-green). +% +% Notes: 1) When cycles==0, nfreqs is total number of FFT frequencies. +% 2) 'blue' coherence lag -> x leads y; 'red' -> y leads x +% 3) The 'boottype' should be ideally 'timestrials', but this creates +% large memory demands, so 'times' must be used in many cases. +% 4) If 'boottype' is 'trials', the average of the complex bootstrap +% is subtracted from the coherence to compensate for phase differences +% (the average is also subtracted from the bootstrap distribution). +% For other bootstraps, this is not necessary since there the phase +% distribution should be random. +% 5) If baseline is non-NaN, the baseline is subtracted from +% the complex coherence. On the left hand side of the coherence +% amplitude image, the baseline is displayed as a magenta line. +% (If no baseline is selected, this curve represents the average +% coherence at every given frequency). +% +% Authors: Arnaud Delorme, Sigurd Enghoff & Scott Makeig +% CNL/Salk Institute 1998-2001; SCCN/INC/UCSD, La Jolla, 2002- +% +% See also: timef() + +% NOTE: one hidden parameter 'savecoher', 0 or 1 + +% Copyright (C) 8/1/98 Arnaud Delorme, Sigurd Enghoff & Scott Makeig, SCCN/INC/UCSD +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 11-20-98 defined g.linewidth constant -sm +% 04-01-99 made number of frequencies consistent -se +% 06-29-99 fixed constant-Q freq indexing -se +% 08-13-99 added cohangle plotting -sm +% 08-20-99 made bootstrap more efficient -sm +% 08-24-99 allow nan values introduced by possible eventlock() preproc. -sm +% 03-16-00 added lead/lag interpretation to help msg - sm & eric visser +% 03-16-00 added axcopy() feature -sm & tpj +% 04-20-00 fixed Rangle sign for wavelets, added verts array -sm +% 01-22-01 corrected help msg when nargin<2 -sm & arno delorme +% 01-25-02 reformated help & license, added links -ad +% 03-09-02 function restructuration -ad +% add 'key', val arguments (+ external baseboot, baseline, color axis, angleunit...) +% add detrending (across time and trials) + 'coher' option for amplitude coherence +% significance only if alpha is given, ploting options in 'plotamp' and 'plotphase' +% 03-16-02 timeout automatically adjusted if too high -ad +% 04-03-02 added new options for bootstrap -ad + +% There are 3 "objects" Tf, Coher and Boot which are handled +% - by specific functions under Matlab +% (Tf) function Tf = tfinit(...) - create object Time Frequency (Tf) associated with some data +% (Tf) function [Tf, itcvals] = tfitc(...) - compute itc for the selected data +% (Tf) function [Tf, itcvals] = tfitcpost(Tf, trials) - itc normlisation +% (Tf) function [Tf, tmpX] = tfcomp(Tf, trials, times) - compute time freq. decomposition +% (Coher) function Coher = coherinit(...) - initialize coherence object +% (Coher) function Coher = cohercomp(Coher, tmpX, tmpY, trial, time) - compute coherence +% (Coher) function Coher = cohercomppost(Coher, trials) - coherence normalization +% (Boot) function Boot = bootinit(...) - intialize bootstrap object +% (Boot) function Boot = bootcomp(...) - compute bootstrap +% (Boot) function [Boot, Rbootout] = bootcomppost(...) - bootstrap normalization +% - by real objects under C++ (see C++ code) + +function [R,mbase,timesout,freqs,Rbootout,Rangle, coherresout, alltfX, alltfY] = newcrossf(X, Y, frame, tlimits, Fs, varwin, varargin) + +%varwin,winsize,nwin,oversmp,maxfreq,alpha,verts,caxmax) + +% Commandline arg defaults: +DEFAULT_ANGLEUNITS = 'deg'; % angle plotting units - 'ms' or 'deg' +DEFAULT_EPOCH = 750; % Frames per epoch +DEFAULT_TIMELIM = [-1000 2000]; % Time range of epochs (ms) +DEFAULT_FS = 250; % Sampling frequency (Hz) +DEFAULT_NWIN = 200; % Number of windows = horizontal resolution +DEFAULT_VARWIN = 0; % Fixed window length or base on cycles. +% =0: fix window length to nwin +% >0: set window length equal varwin cycles +% bounded above by winsize, also determines +% the min. freq. to be computed. +DEFAULT_OVERSMP = 2; % Number of times to oversample = vertical resolution +DEFAULT_MAXFREQ = 50; % Maximum frequency to display (Hz) +DEFAULT_TITLE = 'Event-Related Coherence'; % Figure title +DEFAULT_ALPHA = NaN; % Default two-sided significance probability threshold + +%disp('WARNING: this function is not part of the EEGLAB toolbox and should not be distributed'); +%disp(' you must contact Arnaud Delorme (arno@salk.edu) for terms of use'); + +if (nargin < 2) + help newcrossf + return +end +coherresout = []; + +if ~iscell(X) + if (min(size(X))~=1 | length(X)<2) + fprintf('crossf(): x must be a row or column vector.\n'); + return + elseif (min(size(Y))~=1 | length(Y)<2) + fprintf('crossf(): y must be a row or column vector.\n'); + return + elseif (length(X) ~= length(Y)) + fprintf('crossf(): x and y must have same length.\n'); + return + end +end; + +if (nargin < 3) + frame = DEFAULT_EPOCH; +elseif (~isnumeric(frame) | length(frame)~=1 | frame~=round(frame)) + fprintf('crossf(): Value of frames must be an integer.\n'); + return +elseif (frame <= 0) + fprintf('crossf(): Value of frames must be positive.\n'); + return +elseif ~iscell(X) & (rem(size(X,2),frame) ~= 0) & (rem(size(X,1),frame) ~= 0) + fprintf('crossf(): Length of data vectors must be divisible by frames.\n'); + return +end + +if (nargin < 4) + tlimits = DEFAULT_TIMELIM; +elseif (~isnumeric(tlimits) | sum(size(tlimits))~=3) + error('crossf(): Value of tlimits must be a vector containing two numbers.'); +elseif (tlimits(1) >= tlimits(2)) + error('crossf(): tlimits interval must be [min,max].'); +end + +if (nargin < 5) + Fs = DEFAULT_FS; +elseif (~isnumeric(Fs) | length(Fs)~=1) + error('crossf(): Value of srate must be a number.'); +elseif (Fs <= 0) + error('crossf(): Value of srate must be positive.'); +end + +if (nargin < 6) + varwin = DEFAULT_VARWIN; +elseif (~isnumeric(varwin) | length(varwin)>2) + error('crossf(): Value of cycles must be a number or a (1,2) vector.'); +elseif (varwin < 0) + error('crossf(): Value of cycles must be either zero or positive.'); +end + +% consider structure for these arguments +% -------------------------------------- +vararginori = varargin; +for index=1:length(varargin) + if iscell(varargin{index}), varargin{index} = { varargin{index} }; end; +end; +if ~isempty(varargin) + [tmp indices] = unique_bc(varargin(1:2:end)); % keep the first one + varargin = varargin(sort(union(indices*2-1, indices*2))); % these 2 line remove duplicate arguments + try, g = struct(varargin{:}); + catch, error('Argument error in the {''param'', value} sequence'); end; +else + g = []; +end; + +try, g.condboot; catch, g.condboot = 'abs'; end; +try, g.shuffle; catch, g.shuffle = 0; end; +try, g.title; catch, g.title = DEFAULT_TITLE; end; +try, g.winsize; catch, g.winsize = max(pow2(nextpow2(frame)-3),4); end; +try, g.pad; catch, g.pad = max(pow2(nextpow2(g.winsize)),4); end; +try, g.timesout; catch, g.timesout = DEFAULT_NWIN; end; +try, g.padratio; catch, g.padratio = DEFAULT_OVERSMP; end; +try, g.topovec; catch, g.topovec = []; end; +try, g.elocs; catch, g.elocs = ''; end; +try, g.alpha; catch, g.alpha = DEFAULT_ALPHA; end; +try, g.marktimes; catch, g.marktimes = []; end; % default no vertical lines +try, g.marktimes = g.vert; catch, g.vert = []; end; % default no vertical lines +try, g.rboot; catch, g.rboot = []; end; +try, g.plotamp; catch, g.plotamp = 'on'; end; +try, g.plotphase; catch, g.plotphase = 'on'; end; +try, g.plotbootsub; catch, g.plotbootsub = 'on'; end; +try, g.detrend; catch, g.detrend = 'off'; end; +try, g.rmerp; catch, g.rmerp = 'off'; end; +try, g.baseline; catch, g.baseline = NaN; end; +try, g.baseboot; catch, g.baseboot = 1; end; +try, g.linewidth; catch, g.linewidth = 2; end; +try, g.maxfreq; catch, g.maxfreq = DEFAULT_MAXFREQ; end; +try, g.freqs; catch, g.freqs = [0 g.maxfreq]; end; +try, g.nfreqs; catch, g.nfreqs = []; end; +try, g.freqscale; catch, g.freqscale = 'linear'; end; +try, g.naccu; catch, g.naccu = 200; end; +try, g.angleunit; catch, g.angleunit = DEFAULT_ANGLEUNITS; end; +try, g.type; catch, g.type = 'phasecoher'; end; +try, g.newfig; catch, g.newfig = 'on'; end; +try, g.boottype; catch, g.boottype = 'shuffle'; end; +try, g.subitc; catch, g.subitc = 'off'; end; +try, g.compute; catch, g.compute = 'matlab'; end; +try, g.maxamp; catch, g.maxamp = []; end; +try, g.savecoher; catch, g.savecoher = 0; end; +try, g.amplag; catch, g.amplag = 0; end; +try, g.noinput; catch, g.noinput = 'no'; end; +try, g.lowmem; catch, g.lowmem = 'off'; end; +try, g.plottype; catch, g.plottype = 'image'; end; +try, g.plotmean; catch, g.plotmean = 'on'; end; +try, g.highlightmode; catch, g.highlightmode = 'background'; end; +try, g.chaninfo; catch, g.chaninfo = []; end; + +if isfield(g, 'detret'), g.detrend = g.detret; end; +if isfield(g, 'detrep'), g.rmerp = g.detrep; end; +if ~isnan(g.alpha) && ndims(X) == 2 && (size(X,1) == 1 || size(X,2) == 1) + error('Cannot compute significance for continuous data'); +end; + +allfields = fieldnames(g); +for index = 1:length(allfields) + switch allfields{index} + case { 'shuffle' 'title' 'winsize' 'pad' 'timesout' 'padratio' 'maxfreq' 'topovec' 'elocs' 'alpha' ... + 'marktimes' 'vert' 'rboot' 'plotamp' 'plotphase' 'plotbootsub' 'detrep' 'rmerp' 'detret' 'detrend' ... + 'baseline' 'baseboot' 'linewidth' 'naccu' 'angleunit' 'type' 'boottype' 'subitc' 'lowmem' 'plottype' ... + 'compute' 'maxamp' 'savecoher' 'noinput' 'condboot' 'newfig' 'freqs' 'nfreqs' 'freqscale' 'amplag' ... + 'highlightmode' 'plotmean' 'chaninfo' }; + case {'plotersp' 'plotitc' }, disp(['crossf warning: timef option ''' allfields{index} ''' ignored']); + otherwise disp(['crossf error: unrecognized option ''' allfields{index} '''']); beep; return; + end; +end; + +g.tlimits = tlimits; +g.frame = frame; +if ~iscell(X) g.trials = prod(size(X))/g.frame; +else g.trials = prod(size(X{1}))/g.frame; +end; +g.srate = Fs; +g.cycles = varwin; +g.type = lower(g.type); +g.boottype = lower(g.boottype); +g.rmerp = lower(g.rmerp); +g.detrend = lower(g.detrend); +g.plotphase = lower(g.plotphase); +g.plotbootsub = lower(g.plotbootsub); +g.subitc = lower(g.subitc); +g.plotamp = lower(g.plotamp); +g.compute = lower(g.compute); +g.AXES_FONT = 10; +g.TITLE_FONT = 14; + +% change type if necessary +if g.trials == 1 & ~strcmpi(g.type, 'crossspec') + disp('Continuous data: switching to crossspectrum'); + g.type = 'crossspec'; +end; +if strcmpi(g.freqscale, 'log') & g.freqs(1) == 0, g.freqs(1) = 3; end; + +% reshape 3D inputs +% ----------------- +if ndims(X) == 3 + X = reshape(X, size(X,1), size(X,2)*size(X,3)); + Y = reshape(Y, size(Y,1), size(Y,2)*size(Y,3)); +end; + +% testing arguments consistency +% ----------------------------- +if strcmpi(g.title, DEFAULT_TITLE) + switch g.type + case 'coher', g.title = 'Event-Related Coherence'; % Figure title + case 'phasecoher', g.title = 'Event-Related Phase Coherence'; + case 'phasecoher2', g.title = 'Event-Related Phase Coherence 2'; + case 'amp' , g.title = 'Event-Related Amplitude Correlation'; + case 'crossspec', g.title = 'Event-Related Amplitude Correlation'; + end; +end; + +if ~ischar(g.title) & ~iscell(g.title) + error('Title must be a string or a cell array.'); +end + +if isempty(g.topovec) + g.topovec = []; +elseif min(size(g.topovec))==1 + g.topovec = g.topovec(:); + if size(g.topovec,1)~=2 + error('topovec must be a row or column vector.'); + end +end; + +if isempty(g.elocs) + g.elocs = ''; +elseif (~ischar(g.elocs)) & ~isstruct(g.elocs) + error('Channel location file must be a valid text file.'); +end + +if (~isnumeric(g.alpha) | length(g.alpha)~=1) + error('timef(): Value of g.alpha must be a number.\n'); +elseif (round(g.naccu*g.alpha) < 2) + fprintf('Value of g.alpha is out of the normal range [%g,0.5]\n',2/g.naccu); + g.naccu = round(2/g.alpha); + fprintf(' Increasing the number of bootstrap iterations to %d\n',g.naccu); +end +if g.alpha>0.5 | g.alpha<=0 + error('Value of g.alpha is out of the allowed range (0.00,0.5).'); +end +switch lower(g.newfig) + case { 'on', 'off' }, ; + otherwise error('newfig must be either on or off'); +end; +switch g.angleunit +case { 'ms', 'deg', 'rad' },; +otherwise error('Angleunit must be either ''deg'', ''rad'', or ''ms'''); +end; +switch g.type +case { 'coher', 'phasecoher' 'phasecoher2' 'amp' 'crossspec' },; +otherwise error('Type must be either ''coher'', ''phasecoher'', ''crossspec'', or ''amp'''); +end; +switch g.boottype +case { 'shuffle' 'shufftrials' 'rand' 'randall'},; +otherwise error('Invalid boot type'); +end; +if ~isnumeric(g.shuffle) & ~iscell(g.shuffle) + error('Shuffle argument type must be numeric'); +end; +switch g.compute +case { 'matlab', 'c' },; +otherwise error('compute must be either ''matlab'' or ''c'''); +end; +if ~strcmpi(g.condboot, 'abs') & ~strcmpi(g.condboot, 'angle') ... + & ~strcmpi(g.condboot, 'complex') + error('Condboot must be either ''abs'', ''angle'' or ''complex''.'); +end; +if g.tlimits(2)-g.tlimits(1) < 30 + disp('Crossf WARNING: time range is very small (<30 ms). Times limits are in millisenconds not seconds.'); +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% compute frequency by frequency if low memory +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if strcmpi(g.lowmem, 'on') & ~iscell(X) & length(X) ~= g.frame & (isempty(g.nfreqs) | g.nfreqs ~= 1) + + % compute for first 2 trials to get freqsout + XX = reshape(X, 1, frame, length(X)/g.frame); + YY = reshape(Y, 1, frame, length(Y)/g.frame); + [coh,mcoh,timesout,freqs] = newcrossf(XX(1,:,1), YY(1,:,1), frame, tlimits, Fs, varwin, 'plotamp', 'off', 'plotphase', 'off',varargin{:}); + + % scan all frequencies + for index = 1:length(freqs) + if nargout < 6 + [R(index,:),mbase(index),timesout,tmpfreqs(index),Rbootout(index,:),Rangle(index,:)] = ... + newcrossf(X, Y, frame, tlimits, Fs, varwin, 'freqs', [freqs(index) freqs(index)], 'nfreqs', 1, ... + 'plotamp', 'off', 'plotphase', 'off',varargin{:}, 'lowmem', 'off', 'timesout', timesout); + elseif nargout == 7 % requires RAM + [R(index,:),mbase(index),timesout,tmpfreqs(index),Rbootout(index,:),Rangle(index,:), ... + coherresout(index,:,:)] = ... + newcrossf(X, Y, frame, tlimits, Fs, varwin, 'freqs', [freqs(index) freqs(index)], 'nfreqs', 1, ... + 'plotamp', 'off', 'plotphase', 'off',varargin{:}, 'lowmem', 'off', 'timesout', timesout); + else + [R(index,:),mbase(index),timesout,tmpfreqs(index),Rbootout(index,:),Rangle(index,:), ... + coherresout(index,:,:),alltfX(index,:,:),alltfY(index,:,:)] = ... + newcrossf(X, Y, frame, tlimits, Fs, varwin, 'freqs', [freqs(index) freqs(index)], 'nfreqs', 1, ... + 'plotamp', 'off', 'plotphase', 'off',varargin{:}, 'lowmem', 'off', 'timesout', timesout); + end; + end; + + % plot and return + plotall(R.*exp(j*Rangle), Rbootout, timesout, freqs, mbase, g); + return; +end; + + +%%%%%%%%%%%%%%%%%%%%%%%%%%% +% compare 2 conditions part +%%%%%%%%%%%%%%%%%%%%%%%%%%% +if iscell(X) + if length(X) ~= 2 | length(Y) ~= 2 + error('crossf: to compare conditions, X and Y input must be 2-elements cell arrays'); + end; + + % deal with titles + % ---------------- + for index = length(vararginori)-1:-2:1 + if index<=length(vararginori) % needed: if elemenets are deleted + if strcmp(vararginori{index}, 'title') , vararginori(index:index+1) = []; end; + if strcmp(vararginori{index}, 'subitc'), vararginori(index:index+1) = []; end; + if strcmp(vararginori{index}, 'shuffle'), vararginori(index:index+1) = []; end; + end; + end; + if ~iscell(g.subitc) + g.subitc = { g.subitc g.subitc }; + end; + if ~iscell(g.shuffle) + g.shuffle = { g.shuffle g.shuffle }; + end; + if iscell(g.title) + if length(g.title) <= 2, + g.title{3} = 'Condition 1 - condition 2'; + end; + else + g.title = { 'Condition 1', 'Condition 2', 'Condition 1 - condition 2' }; + end; + + fprintf('Running newcrossf on condition 1 *********************\n'); + fprintf('Note: if an out-of-memory error occurs, try reducing the\n'); + fprintf(' number of time points or number of frequencies\n'); + fprintf(' (the ''coher'' options takes 3 times more memory than other options)\n'); + + if strcmpi(g.plotamp, 'on') | strcmpi(g.plotphase, 'on') + if strcmpi(g.newfig, 'on'), figure; end; + subplot(1,3,1); + end; + + if ~strcmp(g.type, 'coher') & nargout < 9 + [R1,mbase,timesout,freqs,Rbootout1,Rangle1, savecoher1] = newcrossf(X{1}, Y{1}, ... + frame, tlimits, Fs, varwin, 'savecoher', 1, 'title', g.title{1}, ... + 'shuffle', g.shuffle{1}, 'subitc', g.subitc{1}, vararginori{:}); + else + [R1,mbase,timesout,freqs,Rbootout1,Rangle1, savecoher1, Tfx1, Tfy1] = newcrossf(X{1}, Y{1}, ... + frame, tlimits, Fs, varwin, 'savecoher', 1, 'title', g.title{1}, ... + 'shuffle', g.shuffle{1}, 'subitc', g.subitc{1}, vararginori{:}); + end; + R1 = R1.*exp(j*Rangle1/180*pi); + + fprintf('\nRunning newcrossf on condition 2 *********************\n'); + if strcmpi(g.plotamp, 'on') | strcmpi(g.plotphase, 'on') + subplot(1,3,2); + end; + if ~strcmp(g.type, 'coher') & nargout < 9 + [R2,mbase,timesout,freqs,Rbootout2,Rangle2, savecoher2] = newcrossf(X{2}, Y{2}, ... + frame, tlimits, Fs, varwin,'savecoher', 1, 'title', g.title{2}, ... + 'shuffle', g.shuffle{2}, 'subitc', g.subitc{2}, vararginori{:}); + else + [R2,mbase,timesout,freqs,Rbootout2,Rangle2, savecoher2, Tfx2, Tfy2] = newcrossf(X{2}, Y{2}, ... + frame, tlimits, Fs, varwin,'savecoher', 1, 'title', g.title{2}, ... + 'shuffle', g.shuffle{2}, 'subitc', g.subitc{2}, vararginori{:} ); + end; + %figure; imagesc(abs( sum( savecoher1 ./ abs(savecoher1), 3)) - abs( sum( savecoher2 ./ abs(savecoher2), 3) )); cbar; return; + %figure; imagesc(abs( R2 ) - abs( R1) ); cbar; return; + R2 = R2.*exp(j*Rangle2/180*pi); + + if strcmpi(g.plotamp, 'on') | strcmpi(g.plotphase, 'on') + subplot(1,3,3); + end; + if isnan(g.alpha) + switch(g.condboot) + case 'abs', Rdiff = abs(R1)-abs(R2); + case 'angle', Rdiff = angle(R1)-angle(R2); + case 'complex', Rdiff = R1-R2; + end; + g.title = g.title{3}; + if strcmpi(g.plotamp, 'on') | strcmpi(g.plotphase, 'on') + plotall(Rdiff, [], timesout, freqs, mbase, g); + end; + Rbootout = []; + else + % preprocess data and run condstat + % -------------------------------- + switch g.type + case 'coher', % take the square of alltfx and alltfy first to speed up + Tfx1 = Tfx1.*conj(Tfx1); Tfx2 = Tfx2.*conj(Tfx2); + Tfy1 = Tfy1.*conj(Tfy1); Tfy2 = Tfy2.*conj(Tfy2); + formula = 'sum(arg1(:,:,X),3) ./ sqrt(sum(arg2(:,:,X),3)) ./ sqrt(sum(arg3(:,:,X),3))'; + if strcmpi(g.lowmem, 'on') + for ind = 1:2:size(savecoher1,1) + if ind == size(savecoher1,1), indarr = ind; else indarr = [ind:ind+1]; end; + [Rdiff(indarr,:,:) coherimages(indarr,:,:) coher1(indarr,:,:) coher2(indarr,:,:)] = condstat(formula, g.naccu, g.alpha, ... + 'both', g.condboot, { savecoher1(indarr,:,:) savecoher2(indarr,:,:) }, ... + { Tfx1(indarr,:,:) Tfx2(indarr,:,:) }, { Tfy1(indarr,:,:) Tfy2(indarr,:,:) }); + end; + else + [Rdiff coherimages coher1 coher2] = condstat(formula, g.naccu, g.alpha, ... + 'both', g.condboot, { savecoher1 savecoher2 }, { Tfx1 Tfx2 }, { Tfy1 Tfy2 }); + end; + + case 'amp' % amplitude correlation + error('Cannot compute difference of amplitude correlation images yet'); + + case 'crossspec' % amplitude correlation + error('Cannot compute difference of cross-spectral decomposition'); + + case 'phasecoher', % normalize first to speed up + savecoher1 = savecoher1 ./ sqrt(savecoher1.*conj(savecoher1)); + savecoher2 = savecoher2 ./ sqrt(savecoher2.*conj(savecoher2)); % twice faster than abs() + formula = 'sum(arg1(:,:,X),3) ./ length(X)'; + if strcmpi(g.lowmem, 'on') + for ind = 1:2:size(savecoher1,1) + if ind == size(savecoher1,1), indarr = ind; else indarr = [ind:ind+1]; end; + [Rdiff(indarr,:,:) coherimages(indarr,:,:) coher1(indarr,:,:) coher2(indarr,:,:)] = condstat(formula, g.naccu, g.alpha, ... + 'both', g.condboot, { savecoher1(indarr,:,:) savecoher2(indarr,:,:) } ); + end; + else + [Rdiff coherimages coher1 coher2] = condstat(formula, g.naccu, g.alpha, 'both', g.condboot, ... + { savecoher1 savecoher2 }); + end; + case 'phasecoher2', + savecoher1 = savecoher1 ./ sqrt(savecoher1.*conj(savecoher1)); + savecoher2 = savecoher2 ./ sqrt(savecoher2.*conj(savecoher2)); % twice faster than abs() + formula = 'sum(arg1(:,:,X),3) ./ sum(sqrt(arg1(:,:,X).*conj(arg1(:,:,X)))),3)'; + % sqrt(a.*conj(a)) is about twice faster than abs() + if strcmpi(g.lowmem, 'on') + for ind = 1:2:size(savecoher1,1) + if ind == size(savecoher1,1), indarr = ind; else indarr = [ind:ind+1]; end; + [Rdiff(indarr,:,:) coherimages(indarr,:,:) coher1(indarr,:,:) coher2(indarr,:,:)] = condstat(formula, g.naccu, g.alpha, ... + 'both', g.condboot, { savecoher1(indarr,:,:) savecoher2(indarr,:,:) } ); + end; + else + [Rdiff coherimages coher1 coher2] = condstat(formula, g.naccu, g.alpha, 'both', g.condboot, ... + { savecoher1 savecoher2 }); + end; + end; + + %Boot = bootinit( [], size(savecoher1,1), g.timesout, g.naccu, 0, g.baseboot, 'noboottype', g.alpha, g.rboot); + %Boot.Coherboot.R = coherimages; + %Boot = bootcomppost(Boot, [], [], []); + g.title = g.title{3}; + g.boottype = 'shufftrials'; + if strcmpi(g.plotamp, 'on') | strcmpi(g.plotphase, 'on') + plotall(Rdiff, coherimages, timesout, freqs, mbase, g); + end; + + % outputs + Rbootout = {Rbootout1 Rbootout2 coherimages}; + end; + if size(Rdiff,3) > 1, Rdiff = reshape(Rdiff, 1, size(Rdiff,3)); end; + R = { abs(R1) abs(R2) fastif(isreal(Rdiff), Rdiff, abs(Rdiff)) }; + Rangle = { angle(R1) angle(R2) angle(Rdiff) }; + coherresout = []; + if nargout >=9 + alltfX = { Tfx1 Tfx2 }; + alltfY = { Tfy1 Tfy2 }; + end; + return; % ********************************** END FOR SEVERAL CONDITIONS +end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% shuffle trials if necessary +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if g.shuffle ~= 0 + fprintf('x and y data trials being shuffled %d times\n',g.shuffle); + XX = reshape(X, 1, frame, length(X)/g.frame); + YY = Y; + X = []; + Y = []; + for index = 1:g.shuffle + XX = shuffle(XX,3); + X = [X XX(:,:)]; + Y = [Y YY]; + end; +end; + +% detrend over epochs (trials) if requested +% ----------------------------------------- +switch g.rmerp +case 'on' + X = reshape(X, g.frame, length(X)/g.frame); + X = X - mean(X,2)*ones(1, length(X(:))/g.frame); + Y = reshape(Y, g.frame, length(Y)/g.frame); + Y = Y - mean(Y,2)*ones(1, length(Y(:))/g.frame); +end; + +%%%%%%%%%%%%%%%%%%%%%% +% display text to user +%%%%%%%%%%%%%%%%%%%%%% +fprintf('\nComputing the Event-Related \n'); +switch g.type + case 'phasecoher', fprintf('Phase Coherence (ITC) images based on %d trials\n',g.trials); + case 'phasecoher2', fprintf('Phase Coherence 2 (ITC) images based on %d trials\n',g.trials); + case 'coher', fprintf('Linear Coherence (ITC) images based on %d trials\n',g.trials); + case 'amp', fprintf('Amplitude correlation images based on %d trials\n',g.trials); + case 'crossspec', fprintf('Cross-spectral images based on %d trials\n',g.trials); +end; +if ~isnan(g.alpha) + fprintf('Bootstrap confidence limits will be computed based on alpha = %g\n', g.alpha); +else + fprintf('Bootstrap confidence limits will NOT be computed.\n'); +end +switch g.plotphase +case 'on', fprintf(['Coherence angles will be imaged in ',g.angleunit,'\n']); +end; + + +%%%%%%%%%%%%%%%%%%%%%%% +% main computation loop +%%%%%%%%%%%%%%%%%%%%%%% + +% ------------------------------------- +% compute time frequency decompositions +% ------------------------------------- +if length(g.timesout) > 1, tmioutopt = { 'timesout' , g.timesout }; +else tmioutopt = { 'ntimesout', g.timesout }; +end; +spectraloptions = { tmioutopt{:}, 'winsize', g.winsize, 'tlimits', g.tlimits, 'detrend', ... + g.detrend, 'subitc', g.subitc, 'wavelet', g.cycles, 'padratio', g.padratio, ... + 'freqs' g.freqs 'freqscale' g.freqscale 'nfreqs' g.nfreqs }; +if ~strcmpi(g.type, 'amp') & ~strcmpi(g.type, 'crossspec') + spectraloptions = { spectraloptions{:} 'itctype' g.type }; +end; + +fprintf('\nProcessing first input\n'); +X = reshape(X, g.frame, g.trials); +[alltfX freqs timesout] = timefreq(X, g.srate, spectraloptions{:}); +fprintf('\nProcessing second input\n'); +Y = reshape(Y, g.frame, g.trials); +[alltfY] = timefreq(Y, g.srate, spectraloptions{:}); + +% ------------------ +% compute coherences +% ------------------ +tmpprod = alltfX .* conj(alltfY); +if nargout > 6 | strcmpi(g.type, 'phasecoher2') | strcmpi(g.type, 'phasecoher') + coherresout = alltfX .* conj(alltfY); +end; +switch g.type + case 'crossspec', + coherres = alltfX .* conj(alltfY); % no normalization + + case 'coher', + coherres = sum(alltfX .* conj(alltfY), 3) ./ sqrt( sum(abs(alltfX).^2,3) .* sum(abs(alltfY).^2,3) ); + + case 'amp' + alltfX = abs(alltfX); + alltfY = abs(alltfY); + coherres = ampcorr(alltfX, alltfY, freqs, timesout, g); + g.alpha = NaN; + coherresout = []; + + case 'phasecoher2', + coherres = sum(coherresout, 3) ./ sum(abs(coherresout),3); + + case 'phasecoher', + coherres = sum( coherresout ./ abs(coherresout), 3) / g.trials; +end; + +%%%%%%%%%% +% baseline +%%%%%%%%%% +if size(g.baseline,2) == 2 + baseln = []; + for index = 1:size(g.baseline,1) + tmptime = find(timesout >= g.baseline(index,1) & timesout <= g.baseline(index,2)); + baseln = union_bc(baseln, tmptime); + end; + if length(baseln)==0 + error('No point found in baseline'); + end; +else + if ~isempty(find(timesout < g.baseline)) + baseln = find(timesout < g.baseline); % subtract means of pre-0 (centered) windows + else + baseln = 1:length(timesout); % use all times as baseline + end +end; +if ~isnan(g.alpha) & length(baseln)==0 + fprintf('timef(): no window centers in baseline (times<%g) - shorten (max) window length.\n', g.baseline) + return +end +mbase = mean(abs(coherres(:,baseln)')); % mean baseline coherence magnitude + +% ----------------- +% compute bootstrap +% ----------------- +if ~isempty(g.rboot) + Rbootout = g.rboot; +else + if ~isnan(g.alpha) + % getting formula for coherence + % ----------------------------- + switch g.type + case 'coher', + inputdata = { alltfX alltfY }; % default + formula = 'sum(arg1 .* conj(arg2), 3) ./ sqrt( sum(abs(arg1).^2,3) .* sum(abs(arg2).^2,3) );'; + case 'amp', % not implemented + inputdata = { abs(alltfX) abs(alltfY) }; % default + case 'phasecoher2', + inputdata = { alltfX alltfY }; % default + formula = [ 'tmp = arg1 .* conj(arg2);' ... + 'res = sum(tmp, 3) ./ sum(abs(tmp),3);' ]; + case 'phasecoher', + inputdata = { alltfX./abs(alltfX) alltfY./abs(alltfY) }; + formula = [ 'mean(arg1 .* conj(arg2),3);' ]; + case 'crossspec', + inputdata = { alltfX./abs(alltfX) alltfY./abs(alltfY) }; + formulainit = [ 'arg1 .* conj(arg2);' ]; + end; + + % finding baseline for bootstrap + % ------------------------------ + if size(g.baseboot,2) == 1 + if g.baseboot == 0, baselntmp = []; + elseif ~isnan(g.baseline(1)) + baselntmp = baseln; + else baselntmp = find(timesout <= 0); % if it is empty use whole epoch + end; + else + baselntmp = []; + for index = 1:size(g.baseboot,1) + tmptime = find(timesout >= g.baseboot(index,1) & timesout <= g.baseboot(index,2)); + baselntmp = union_bc(baselntmp, tmptime); + end; + end; + if prod(size(g.baseboot)) > 2 + fprintf('Bootstrap analysis will use data in multiple selected windows.\n'); + elseif size(g.baseboot,2) == 2 + fprintf('Bootstrap analysis will use data in range %3.2g-%3.2g ms.\n', g.baseboot(1), g.baseboot(2)); + elseif g.baseboot + fprintf(' %d bootstrap windows in baseline (times<%g).\n', length(baselntmp), g.baseboot) + end; + + if strcmpi(g.boottype, 'shuffle') | strcmpi(g.boottype, 'rand') + Rbootout = bootstat(inputdata, formula, 'boottype', g.boottype, 'label', 'coherence', ... + 'bootside', 'upper', 'shuffledim', [2 3], 'dimaccu', 2, ... + 'naccu', g.naccu, 'alpha', g.alpha, 'basevect', baselntmp); + elseif strcmpi(g.boottype, 'randall') + % randomize phase but do not accumulate over time + % dimension (NOT TESTED) + % note the absence of dimaccu and the shuffledim 3 + Rbootout = bootstat(inputdata, formula, 'boottype', 'rand', ... + 'bootside', 'upper', 'shuffledim', 3, ... + 'naccu', g.naccu, 'alpha', g.alpha, 'basevect', baselntmp); + else % shuffle only trials (NOT TESTED) + % note the absence of dimaccu and the shuffledim 3 + Rbootout = bootstat(inputdata, formula, 'boottype', 'shuffle', ... + 'bootside', 'upper', 'shuffledim', 3, ... + 'naccu', g.naccu, 'alpha', g.alpha, 'basevect', baselntmp); + end; + else Rbootout = []; + end; + % note that the bootstrap thresholding is actually performed in the display subfunction plotall() +end; + +% plot everything +% --------------- +if strcmpi(g.plotamp, 'on') | strcmpi(g.plotphase, 'on') + if strcmpi(g.plottype, 'image') + plotall ( coherres, Rbootout, timesout, freqs, mbase, g); + else + plotallcurves( coherres, Rbootout, timesout, freqs, mbase, g); + end; +end; + +% proces outputs +% -------------- +Rangle = angle(coherres); +R = abs(coherres); + +return; +% *********************************************************************** + +% ------------------------------ +% amplitude correlation function +% ------------------------------ +function [coherres, lagmap] = ampcorr(alltfX, alltfY, freqs, timesout, g) + + % initialize variables + % -------------------- + coherres = zeros(length(freqs), length(timesout), length(g.amplag)); + alpha = zeros(length(freqs), length(timesout), length(g.amplag)); + countlag = 1; + for lag = g.amplag + fprintf('Computing %d point lag amplitude correlation, please wait...\n', lag); + for i1 = 1:length(freqs) + for i2 = max(1, 1-lag):min(length(timesout)-lag, length(timesout)) + if ~isnan(g.alpha) + [tmp1 tmp2] = corrcoef( squeeze(alltfX(i1,i2,:)), squeeze(alltfY(i1,i2+lag,:)) ); + coherres(i1,i2,countlag) = tmp1(1,2); + alpha(i1,i2,countlag) = tmp2(1,2); + else + tmp1 = corrcoef( squeeze(alltfX(i1,i2,:)), squeeze(alltfY(i1,i2+lag,:)) ); + coherres(i1,i2,countlag) = tmp1(1,2); + end; + end; + end; + countlag = countlag + 1; + end; + + % find max corr if different lags + % ------------------------------- + if length(g.amplag) > 1 + [coherres lagmap] = max(coherres, [], 3); + dimsize = length(freqs)*length(timesout); + alpha = reshape(alpha((lagmap(:)-1)*dimsize+[1:dimsize]'),length(freqs), length(timesout)); + % above is same as (but faster) + % for i1 = 1:length(freqs) + % for i2 = 1:length(timesout) + % alphanew(i1, i2) = alpha(i1, i2, lagmap(i1, i2)); + % end; + % end; + lagmap = g.amplag(lagmap); % real lag + coherres = coherres.*exp(j*lagmap/max(abs(g.amplag))); % encode lag in the phase + else + lagmap = []; + end; + + % apply significance mask + % ----------------------- + if ~isnan(g.alpha) + tmpind = find(alpha(:) > g.alpha); + coherres(tmpind) = 0; + end; + +% ------------------ +% plotting functions +% ------------------ +function plotall(R, Rboot, times, freqs, mbase, g) + +switch lower(g.plotphase) +case 'on', + switch lower(g.plotamp), + case 'on', ordinate1 = 0.67; ordinate2 = 0.1; height = 0.33; g.plot = 1; + case 'off', ordinate2 = 0.1; height = 0.9; g.plot = 1; + end; +case 'off', ordinate1 = 0.1; height = 0.9; + switch lower(g.plotamp), + case 'on', ordinate1 = 0.1; height = 0.9; g.plot = 1; + case 'off', g.plot = 0; + end; +end; + +% compute angles +% -------------- +Rangle = angle(R); +if ~isreal(R) + R = abs(R); + Rraw =R; % raw coherence values + setylim = 1; + if ~isnan(g.baseline) + R = R - repmat(mbase',[1 g.timesout]); % remove baseline mean + end; +else + Rraw = R; + setylim = 0; +end; + +if g.plot + fprintf('\nNow plotting...\n'); + set(gcf,'DefaultAxesFontSize',g.AXES_FONT) + colormap(jet(256)); + + pos = get(gca,'position'); % plot relative to current axes + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]; + axis('off') +end; + +switch lower(g.plotamp) +case 'on' + % + % Image the coherence [% perturbations] + % + RR = R; + if ~isnan(g.alpha) % zero out (and 'green out') nonsignif. R values + switch dims(Rboot) + case 3, RR (find(RR > Rboot(:,:,1) & (RR < Rboot(:,:,2)))) = 0; + Rraw(find(RR > Rboot(:,:,1) & (RR < Rboot(:,:,2)))) = 0; + case 2, RR (find(RR < Rboot)) = 0; + Rraw(find(RR < Rboot)) = 0; + case 1, RR (find(RR < repmat(Rboot(:),[1 size(RR,2)]))) = 0; + Rraw(find(RR < repmat(Rboot(:),[1 size(Rraw,2)]))) = 0; + end; + end + + h(6) = axes('Units','Normalized', 'Position',[.1 ordinate1 .8 height].*s+q); + + map=hsv(300); % install circular color map - green=0, yellow, orng, red, violet = max + % cyan, blue, violet = min + map = flipud([map(251:end,:);map(1:250,:)]); + map(151,:) = map(151,:)*0.9; % tone down the (0=) green! + colormap(map); + + if ~strcmpi(g.freqscale, 'log') + try, imagesc(times,freqs,RR,max(max(RR))*[-1 1]); % plot the coherence image + catch, imagesc(times,freqs,RR,[-1 1]); end; + else + try, imagesclogy(times,freqs,RR,max(max(RR))*[-1 1]); % plot the coherence image + catch, imagesclogy(times,freqs,RR,[-1 1]); end; + end; + + set(gca,'ydir','norm'); + + if ~isempty(g.maxamp) + caxis([-g.maxamp g.maxamp]); + end; + tmpscale = caxis; + + hold on + plot([0 0],[0 freqs(end)],'--m','LineWidth',g.linewidth) + for i=1:length(g.marktimes) + plot([g.marktimes(i) g.marktimes(i)],[0 freqs(end)],'--m','LineWidth',g.linewidth); + end; + hold off + set(h(6),'YTickLabel',[],'YTick',[]) + set(h(6),'XTickLabel',[],'XTick',[]) + + h(8) = axes('Position',[.95 ordinate1 .05 height].*s+q); + + if setylim + cbar(h(8),151:300, [0 tmpscale(2)]); % use only positive colors (gyorv) + else cbar(h(8),1:300 , [-tmpscale(2) tmpscale(2)]); % use only positive colors (gyorv) + end; + + % + % Plot delta-mean min and max coherence at each time point on bottom of image + % + + h(10) = axes('Units','Normalized','Position',[.1 ordinate1-0.1 .8 .1].*s+q); % plot marginal means below + Emax = max(R); % mean coherence at each time point + Emin = min(R); % mean coherence at each time point + plot(times,Emin, times, Emax, 'LineWidth',g.linewidth); hold on; + plot([times(1) times(length(times))],[0 0],'LineWidth',0.7); + plot([0 0],[-500 500],'--m','LineWidth',g.linewidth); + for i=1:length(g.marktimes) + plot([g.marktimes(i) g.marktimes(i)],[-500 500],'--m','LineWidth',g.linewidth); + end; + if ~isnan(g.alpha) & dims(Rboot) > 1 + % plot bootstrap significance limits (base mean +/-) + switch dims(Rboot) + case 2, plot(times,mean(Rboot(:,:),1),'g' ,'LineWidth',g.linewidth); + plot(times,mean(Rboot(:,:),1),'k:','LineWidth',g.linewidth); + case 3, plot(times,mean(Rboot(:,:,1),1),'g' ,'LineWidth',g.linewidth); + plot(times,mean(Rboot(:,:,1),1),'k:','LineWidth',g.linewidth); + plot(times,mean(Rboot(:,:,2),1),'g' ,'LineWidth',g.linewidth); + plot(times,mean(Rboot(:,:,2),1),'k:','LineWidth',g.linewidth); + end; + axis([min(times) max(times) 0 max([Emax(:)' Rboot(:)'])*1.2]) + else + axis([min(times) max(times) 0 max(Emax)*1.2]) + end; + + tick = get(h(10),'YTick'); + set(h(10),'YTick',[tick(1) ; tick(length(tick))]) + set(h(10),'YAxisLocation','right') + xlabel('Time (ms)') + ylabel('coh.') + + % + % Plot mean baseline coherence at each freq on left side of image + % + + h(11) = axes('Units','Normalized','Position',[0 ordinate1 .1 height].*s+q); % plot mean spectrum + E = abs(mbase); % baseline mean coherence at each frequency + if ~strcmpi(g.freqscale, 'log') + plot(freqs,E,'b','LineWidth',g.linewidth); % plot mbase + else + semilogx(freqs,E,'b','LineWidth',g.linewidth); % plot mbase + set(h(11),'View',[90 90]) + divs = linspace(log(freqs(1)), log(freqs(end)), 10); + set(gca, 'xtickmode', 'manual'); + divs = ceil(exp(divs)); divs = unique_bc(divs); % ceil is critical here, round might misalign + % out-of border label with within border ticks + set(gca, 'xtick', divs); + end; + if ~isnan(g.alpha) % plot bootstrap significance limits (base mean +/-) + hold on + if ~strcmpi(g.freqscale, 'log') + switch dims(Rboot) + case 1, plot(freqs,Rboot(:),'g' ,'LineWidth',g.linewidth); + plot(freqs,Rboot(:),'k:','LineWidth',g.linewidth); + case 2, plot(freqs,mean(Rboot(:,:),2),'g' ,'LineWidth',g.linewidth); + plot(freqs,mean(Rboot(:,:),2),'k:','LineWidth',g.linewidth); + case 3, plot(freqs,mean(Rboot(:,:,1),2),'g' ,'LineWidth',g.linewidth); + plot(freqs,mean(Rboot(:,:,1),2),'k:','LineWidth',g.linewidth); + plot(freqs,mean(Rboot(:,:,2),2),'g' ,'LineWidth',g.linewidth); + plot(freqs,mean(Rboot(:,:,2),2),'k:','LineWidth',g.linewidth); + end; + else + switch dims(Rboot) + case 1, semilogy(freqs,Rboot(:),'g' ,'LineWidth',g.linewidth); + semilogy(freqs,Rboot(:),'k:','LineWidth',g.linewidth); + case 2, semilogy(freqs,mean(Rboot(:,:),2),'g' ,'LineWidth',g.linewidth); + semilogy(freqs,mean(Rboot(:,:),2),'k:','LineWidth',g.linewidth); + case 3, semilogy(freqs,mean(Rboot(:,:,1),2),'g' ,'LineWidth',g.linewidth); + semilogy(freqs,mean(Rboot(:,:,1),2),'k:','LineWidth',g.linewidth); + semilogy(freqs,mean(Rboot(:,:,2),2),'g' ,'LineWidth',g.linewidth); + semilogy(freqs,mean(Rboot(:,:,2),2),'k:','LineWidth',g.linewidth); + end; + end; + if ~isnan(max(E)) + axis([freqs(1) freqs(end) 0 max([E Rboot(:)'])*1.2]); + end; + else % plot marginal mean coherence only + if ~isnan(max(E)) + axis([freqs(1) freqs(end) 0 max(E)*1.2]); + end; + end + + set(gca,'xdir','rev'); % nima + + tick = get(h(11),'YTick'); + set(h(11),'YTick',[tick(1) ; tick(length(tick))]); % crashes for log + set(h(11),'View',[90 90]) + xlabel('Freq. (Hz)') + ylabel('coh.') +end; + +switch lower(g.plotphase) +case 'on' + % + % Plot coherence phase lags in bottom panel + % + h(13) = axes('Units','Normalized','Position',[.1 ordinate2 .8 height].*s+q); + if setylim + if strcmpi(g.type, 'amp') % currrently -1 to 1 + maxangle = max(abs(g.amplag)) * mean(times(2:end) - times(1:end-1)); + Rangle = Rangle * maxangle; + maxangle = maxangle+5; % so that the min and the max does not mix + else + if strcmp(g.angleunit,'ms') % convert to ms + Rangle = (Rangle/(2*pi)).*repmat(1000./freqs(:)',1,length(times)); + maxangle = max(max(abs(Rangle))); + elseif strcmpi(g.angleunit,'deg') % convert to degrees + Rangle = Rangle*180/pi; % convert to degrees + maxangle = 180; % use full-cycle plotting + else + maxangle = pi; + end + end; + Rangle(find(Rraw==0)) = 0; % set angle at non-signif coher points to 0 + + if ~strcmpi(g.freqscale, 'log') + imagesc(times,freqs,Rangle,[-maxangle maxangle]); % plot the coherence phase angles + else + imagesclogy(times,freqs,Rangle,[-maxangle maxangle]); % plot the coherence phase angles + end; + hold on + plot([0 0],[0 freqs(end)],'--m','LineWidth',g.linewidth); % zero-time line + for i=1:length(g.marktimes) + plot([g.marktimes(i) g.marktimes(i)],[0 freqs(end)],'--m','LineWidth',g.linewidth); + end; + + set(gca,'ydir','norm'); % nima + + ylabel('Freq. (Hz)') + xlabel('Time (ms)') + + h(14)=axes('Position',[.95 ordinate2 .05 height].*s+q); + cbar(h(14),0,[-maxangle maxangle]); % two-sided colorbar + else + axis off; + text(0, 0.5, 'Real values, no angles'); + end; +end + +if g.plot + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + if (length(g.title) > 0) % plot title + axes('Position',pos,'Visible','Off'); + h(13) = text(-.05,1.01,g.title); + set(h(13),'VerticalAlignment','bottom') + set(h(13),'HorizontalAlignment','left') + set(h(13),'FontSize',g.TITLE_FONT) + end + % + %%%%%%%%%%%%%%% plot topoplot() %%%%%%%%%%%%%%%%%%%%%%% + % + if (~isempty(g.topovec)) & strcmpi(g.plotamp, 'on') & strcmpi(g.plotphase, 'on') + h(15) = subplot('Position',[-.1 .43 .2 .14].*s+q); + if size(g.topovec,2) <= 2 + topoplot(g.topovec(1),g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10, 'chaninfo', g.chaninfo); + else + topoplot(g.topovec(1,:),g.elocs,'electrodes','off', 'chaninfo', g.chaninfo); + end; + axis('square') + + h(16) = subplot('Position',[.9 .43 .2 .14].*s+q); + if size(g.topovec,2) <= 2 + topoplot(g.topovec(2),g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10, 'chaninfo', g.chaninfo); + else + topoplot(g.topovec(2,:),g.elocs,'electrodes','off', 'chaninfo', g.chaninfo); + end; + axis('square') + end + + try, axcopy(gcf); catch, end; +end; + +% --------------- +% Plotting curves +% --------------- +function plotallcurves(R, Rboot, times, freqs, mbase, g) + + % compute angles + % -------------- + Rangle = angle(R); + pos = get(gca,'position'); % plot relative to current axes + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]; + if ~isreal(R) + R = abs(R); + Rraw =R; % raw coherence values + if ~isnan(g.baseline) + R = R - repmat(mbase',[1 g.timesout]); % remove baseline mean + end; + else + Rraw = R; + setylim = 0; + end; + + % time unit + % --------- + if times(end) > 10000 + times = times/1000; + timeunit = 's'; + else + timeunit = 'ms'; + end; + + % legend + % ------ + alllegend = {}; + if strcmpi(g.plotmean, 'on') & freqs(1) ~= freqs(end) + alllegend = { [ num2str(freqs(1)) '-' num2str(freqs(end)) 'Hz' ] }; + else + for index = 1:length(freqs) + alllegend{index} = [ num2str(freqs(index)) 'Hz' ]; + end; + end; + + fprintf('\nNow plotting...\n'); + if strcmpi(g.plotamp, 'on') + % + % Plot coherence amplitude in top panel + % + if strcmpi(g.plotphase, 'on'), subplot(2,1,1); end; + if isempty(g.maxamp), g.maxamp = 0; end; + plotcurve(times, R, 'maskarray', Rboot, 'title', 'Coherence amplitude', ... + 'xlabel', [ 'Time (' timeunit ')' ], 'ylabel', '0-1', 'ylim', g.maxamp, ... + 'vert', g.vert, 'marktimes', g.marktimes, 'legend', alllegend, ... + 'linewidth', g.linewidth, 'highlightmode', g.highlightmode, 'plotmean', g.plotmean); + end; + + if strcmpi(g.plotphase, 'on') + % + % Plot coherence phase lags in bottom panel + % + if strcmpi(g.plotamp, 'on'), subplot(2,1,2); end; + plotcurve(times, Rangle/pi*180, 'maskarray', Rboot, 'val2mask', R, 'title', 'Coherence phase', ... + 'xlabel', [ 'Time (' timeunit ')' ], 'ylabel', 'Angle (deg.)', 'ylim', [-180 180], ... + 'vert', g.vert, 'marktimes', g.marktimes, 'legend', alllegend, ... + 'linewidth', g.linewidth, 'highlightmode', g.highlightmode, 'plotmean', g.plotmean); + end + + if strcmpi(g.plotamp, 'on') | strcmpi(g.plotphase, 'on') + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + if (length(g.title) > 0) % plot title + h(13) = textsc(g.title, 'title'); + end + + % + %%%%%%%%%%%%%%% plot topoplot() %%%%%%%%%%%%%%%%%%%%%%% + % + if (~isempty(g.topovec)) + h(15) = subplot('Position',[-.1 .43 .2 .14].*s+q); + if size(g.topovec,2) <= 2 + topoplot(g.topovec(1),g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10); + else + topoplot(g.topovec(1,:),g.elocs,'electrodes','off'); + end; + axis('square') + + h(16) = subplot('Position',[.9 .43 .2 .14].*s+q); + if size(g.topovec,2) <= 2 + topoplot(g.topovec(2),g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10); + else + topoplot(g.topovec(2,:),g.elocs,'electrodes','off'); + end; + axis('square') + end + + try, axcopy(gcf); catch, end; + end; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COHERENCE OBSOLETE %%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% function for coherence initialisation +% ------------------------------------- +function Coher = coherinit(nb_points, trials, timesout, type); +Coher.R = zeros(nb_points,timesout); % mean coherence +%Coher.RR = repmat(nan,nb_points,timesout); % initialize with nans +Coher.type = type; +Coher.Rn=zeros(trials,timesout); +switch type + case 'coher', + Coher.cumulX = zeros(nb_points,timesout); + Coher.cumulY = zeros(nb_points,timesout); + case 'phasecoher2', + Coher.cumul = zeros(nb_points,timesout); +end; + +% function for coherence calculation +% ------------------------------------- +%function Coher = cohercomparray(Coher, tmpX, tmpY, trial); +%switch Coher.type +% case 'coher', +% Coher.R = Coher.R + tmpX.*conj(tmpY); % complex coher. +% Coher.cumulXY = Coher.cumulXY + abs(tmpX).*abs(tmpY); +% case 'phasecoher', +% Coher.R = Coher.R + tmpX.*conj(tmpY) ./ (abs(tmpX).*abs(tmpY)); % complex coher. +% Coher.Rn(trial,:) = 1; +%end % ~any(isnan()) + +function [Coher,tmptrialcoh] = cohercomp(Coher, tmpX, tmpY, trial, time); +tmptrialcoh = tmpX.*conj(tmpY); +switch Coher.type + case 'coher', + Coher.R(:,time) = Coher.R(:,time) + tmptrialcoh; % complex coher. + Coher.cumulX(:,time) = Coher.cumulX(:,time) + abs(tmpX).^2; + Coher.cumulY(:,time) = Coher.cumulY(:,time) + abs(tmpY).^2; + case 'phasecoher2', + Coher.R(:,time) = Coher.R(:,time) + tmptrialcoh; % complex coher. + Coher.cumul(:,time) = Coher.cumul(:,time) + abs(tmptrialcoh); + case 'phasecoher', + Coher.R(:,time) = Coher.R(:,time) + tmptrialcoh ./ abs(tmptrialcoh); % complex coher. + %figure; imagesc(abs(tmpX.*conj(tmpY) ./ (abs(tmpX).*abs(tmpY)))); + Coher.Rn(trial,time) = Coher.Rn(trial,time)+1; +end % ~any(isnan()) + +% function for post coherence calculation +% --------------------------------------- +function Coher = cohercomppost(Coher, trials); +switch Coher.type + case 'coher', + Coher.R = Coher.R ./ sqrt(Coher.cumulX) ./ sqrt(Coher.cumulY); + case 'phasecoher2', + Coher.R = Coher.R ./ Coher.cumul; + case 'phasecoher', + Coher.Rn = sum(Coher.Rn, 1); + Coher.R = Coher.R ./ (ones(size(Coher.R,1),1)*Coher.Rn); % coherence magnitude +end; + +% function for 2 conditions coherence calculation +% ----------------------------------------------- +function [coherimage, coherimage1, coherimage2] = coher2conddiff( allsavedcoher, alltrials, cond1trials, type, tfx, tfy); + t1s = alltrials(1:cond1trials); + t2s = alltrials(cond1trials+1:end); + switch type + case 'coher', + coherimage1 = sum(allsavedcoher(:,:,t1s),3) ./ sqrt(sum(tfx(:,:,t1s))) ./ sqrt(sum(tfy(:,:,t1s))); + coherimage2 = sum(allsavedcoher(:,:,t2s),3) ./ sqrt(sum(tfx(:,:,t2s))) ./ sqrt(sum(tfy(:,:,t1s))); + case 'phasecoher2', + coherimage1 = sum(allsavedcoher(:,:,t1s),3) ./ sum(abs(allsavedcoher(:,:,t1s)),3); + coherimage2 = sum(allsavedcoher(:,:,t2s),3) ./ sum(abs(allsavedcoher(:,:,t2s)),3); + case 'phasecoher', + coherimage1 = sum(allsavedcoher(:,:,t1s),3) / cond1trials; + coherimage2 = sum(allsavedcoher(:,:,t2s),3) / (size(allsavedcoher,3)-cond1trials); + end; + coherimage = coherimage2 - coherimage1; + +function w = hanning(n) +if ~rem(n,2) + w = .5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = .5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end + +function res = dims(array) + res = min(ndims(array), max(size(array,2),size(array,3))); diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/newtimef.m b/code/eeglab13_4_4b/functions/timefreqfunc/newtimef.m new file mode 100644 index 0000000..b275312 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/newtimef.m @@ -0,0 +1,2211 @@ +% newtimef() - Return estimates and plots of mean event-related (log) spectral +% perturbation (ERSP) and inter-trial coherence (ITC) events across +% event-related trials (epochs) of a single input channel time series. +% +% * Also can compute and statistically compare transforms for two time +% series. Use this to compare ERSP and ITC means in two conditions. +% +% * Uses either fixed-window, zero-padded FFTs (fastest), or wavelet +% 0-padded DFTs. FFT uses Hanning tapers; wavelets use (similar) Morlet +% tapers. +% +% * For the wavelet and FFT methods, output frequency spacing +% is the lowest frequency ('srate'/'winsize') divided by 'padratio'. +% NaN input values (such as returned by eventlock()) are ignored. +% +% * If 'alpha' is given (see below), permutation statistics are computed +% (from a distribution of 'naccu' surrogate data trials) and +% non-significant features of the output plots are zeroed out +% and plotted in green. +% +% * Given a 'topovec' topo vector and 'elocs' electrode location file, +% the figure also shows a topoplot() view of the specified scalp map. +% +% * Note: Left-click on subplots to view and zoom in separate windows. +% +% Usage with single dataset: +% >> [ersp,itc,powbase,times,freqs,erspboot,itcboot] = ... +% newtimef(data, frames, epochlim, srate, cycles,... +% 'key1',value1, 'key2',value2, ... ); +% +% Example to compare two condition (channel 1 EEG versus ALLEEG(2)): +% >> [ersp,itc,powbase,times,freqs,erspboot,itcboot] = ... +% newtimef({EEG.data(1,:,:) ALLEEG(2).data(1,:,:)}, +% EEG.pnts, [EEG.xmin EEG.xmax]*1000, EEG.srate, cycles); +% NOTE: +% >> timef details % presents more detailed argument information +% % Note: version timef() also computes multitaper transforms +% +% Required inputs: Value {default} +% data = Single-channel data vector (1,frames*ntrials), else +% 2-D array (frames,trials) or 3-D array (1,frames,trials). +% To compare two conditions (data1 versus data2), in place of +% a single data matrix enter a cell array {data1 data2} +% frames = Frames per trial. Ignored if data are 2-D or 3-D. {750} +% epochlim = [mintime maxtime] (ms). Note that these are the time limits +% of the data epochs themselves, NOT A SUB-WINDOW TO EXTRACT +% FROM THE EPOCHS as is the case for pop_newtimef(). {[-1000 2000]} +% srate = data sampling rate (Hz) {default: read from icadefs.m or 250} +% 'cycles' = [real] indicates the number of cycles for the time-frequency +% decomposition {default: 0} +% If 0, use FFTs and Hanning window tapering. +% If [real positive scalar], the number of cycles in each Morlet +% wavelet, held constant across frequencies. +% If [cycles cycles(2)] wavelet cycles increase with +% frequency beginning at cycles(1) and, if cycles(2) > 1, +% increasing to cycles(2) at the upper frequency, +% If cycles(2) = 0, use same window size for all frequencies +% (similar to FFT when cycles(1) = 1) +% If cycles(2) = 1, cycles do not increase (same as giving +% only one value for 'cycles'). This corresponds to a pure +% wavelet decomposition, same number of cycles at each frequency. +% If 0 < cycles(2) < 1, cycles increase linearly with frequency: +% from 0 --> FFT (same window width at all frequencies) +% to 1 --> wavelet (same number of cycles at all frequencies). +% The exact number of cycles in the highest frequency window is +% indicated in the command line output. Typical value: 'cycles', [3 0.5] +% +% Optional inter-trial coherence (ITC) Type: +% 'itctype' = ['coher'|'phasecoher'|'phasecoher2'] Compute either linear +% coherence ('coher') or phase coherence ('phasecoher'). +% Originall called 'phase-locking factor' {default: 'phasecoher'} +% +% Optional detrending: +% 'detrend' = ['on'|'off'], Linearly detrend each data epoch {'off'} +% 'rmerp' = ['on'|'off'], Remove epoch mean from data epochs {'off'} +% +% Optional FFT/DFT parameters: +% 'winsize' = If cycles==0: data subwindow length (fastest, 2^n0: The *longest* window length to use. This +% determines the lowest output frequency. Note: this parameter +% is overwritten when the minimum frequency requires +% a longer time window {default: ~frames/8} +% 'timesout' = Number of output times (int0) +% If cycles==0, all FFT frequencies are output. {default: 50} +% DEPRECATED, use 'freqs' instead,and never both. +% 'freqs' = [min max] frequency limits. {default [minfreq 50], +% minfreq being determined by the number of data points, +% cycles and sampling frequency. +% 'nfreqs' = number of output frequencies. For FFT, closest computed +% frequency will be returned. Overwrite 'padratio' effects +% for wavelets. {default: use 'padratio'} +% 'freqscale' = ['log'|'linear'] frequency scale. {default: 'linear'} +% Note that for obtaining 'log' spaced freqs using FFT, +% closest correspondant frequencies in the 'linear' space +% are returned. +% 'verbose' = ['on'|'off'] print text {'on'} +% 'subitc' = ['on'|'off'] subtract stimulus locked Inter-Trial Coherence +% (ITC) from x and y. This computes an 'intrinsic' coherence +% of x and y not arising directly from common phase locking +% to experimental events. See notes. {default: 'off'} +% 'wletmethod' = ['dftfilt'|'dftfilt2'|'dftfilt3'] Wavelet type to use. +% 'dftfilt2' -> Morlet-variant wavelets, or Hanning DFT. +% 'dftfilt3' -> Morlet wavelets. See the timefreq() function +% for more detials {default: 'dftfilt3'} +% 'cycleinc' ['linear'|'log'] mode of cycles increase when [min max] cycles +% are provided in 'cycle' parameter. Applies only to +% 'wletmethod','dftfilt' {default: 'linear'} +% +% Optional baseline parameters: +% 'baseline' = Spectral baseline end-time (in ms). NaN --> no baseline is used. +% A [min max] range may also be entered +% You may also enter one row per region for baseline +% e.g. [0 100; 300 400] considers the window 0 to 100 ms and +% 300 to 400 ms This parameter validly defines all baseline types +% below. Again, [NaN] Prevent baseline subtraction. +% {default: 0 -> all negative time values}. +% 'powbase' = Baseline spectrum to log-subtract {default|NaN -> from data} +% 'commonbase' = ['on'|'off'] use common baseline when comparing two +% conditions {default: 'on'}. +% 'basenorm' = ['on'|'off'] 'on' normalize baseline in the power spectral +% average; else 'off', divide by the average power across +% trials at each frequency (gain model). {default: 'off'} +% 'trialbase' = ['on'|'off'|'full'] perform baseline (normalization or division +% above in single trial instead of the trial average. Default +% if 'off'. 'full' is an option that perform single +% trial normalization (or simple division based on the +% 'basenorm' input over the full trial length before +% performing standard baseline removal. It has been +% shown to be less sensitive to noisy trials in Grandchamp R, +% Delorme A. (2011) Single-trial normalization for event-related +% spectral decomposition reduces sensitivity to noisy trials. +% Front Psychol. 2:236. +% +% Optional time warping parameter: +% 'timewarp' = [eventms matrix] Time-warp amplitude and phase time- +% courses(following time/freq transform but before +% smoothing across trials). 'eventms' is a matrix +% of size (all_trials,epoch_events) whose columns +% specify the epoch times (latencies) (in ms) at which +% the same series of successive events occur in each +% trial. If two data conditions, eventms should be +% [eventms1;eventms2] --> all trials stacked vertically. +% 'timewarpms' = [warpms] optional vector of event times (latencies) (in ms) +% to which the series of events should be warped. +% (Note: Epoch start and end should not be declared +% as eventms or warpms}. If 'warpms' is absent or [], +% the median of each 'eventms' column will be used; +% If two datasets, the grand medians of the two are used. +% 'timewarpidx' = [plotidx] is an vector of indices telling which of +% the time-warped 'eventms' columns (above) to show with +% vertical lines. If undefined, all columns are plotted. +% Overwrites the 'vert' argument (below) if any. +% +% Optional permutation parameters: +% 'alpha' = If non-0, compute two-tailed permutation significance +% probability level. Show non-signif. output values +% as green. {default: 0} +% 'mcorrect' = ['none'|'fdr'] correction for multiple comparison +% 'fdr' uses false detection rate (see function fdr()). +% Not available for condition comparisons. {default:'none'} +% 'pcontour' = ['on'|'off'] draw contour around significant regions +% instead of masking them. Not available for condition +% comparisons. {default:'off'} +% 'naccu' = Number of permutation replications to accumulate {200} +% 'baseboot' = permutation baseline subtract (1 -> use 'baseline'; +% 0 -> use whole trial +% [min max] -> use time range) +% You may also enter one row per region for baseline, +% e.g. [0 100; 300 400] considers the window 0 to 100 ms +% and 300 to 400 ms. {default: 1} +% 'boottype' = ['shuffle'|'rand'|'randall'] 'shuffle' -> shuffle times +% and trials; 'rand' -> invert polarity of spectral data +% (for ERSP) or randomize phase (for ITC); 'randall' -> +% compute significances by accumulating random-polarity +% inversions for each time/frequency point (slow!). Note +% that in the previous revision of this function, this +% method was called 'bootstrap' though it is actually +% permutation {default: 'shuffle'} +% 'condboot' = ['abs'|'angle'|'complex'] to compare two conditions, +% either subtract ITC absolute values ('abs'), angles +% ('angles'), or complex values ('complex'). {default: 'abs'} +% 'pboot' = permutation power limits (e.g., from newtimef()) {def: from data} +% 'rboot' = permutation ITC limits (e.g., from newtimef()). +% Note: Both 'pboot' and 'rboot' must be provided to avoid +% recomputing the surrogate data! {default: from data} +% +% Optional Scalp Map: +% 'topovec' = Scalp topography (map) to plot {none} +% 'elocs' = Electrode location file for scalp map {none} +% Value should be a string array containing the path +% and name of the file. For file format, see +% >> topoplot example +% 'chaninfo' Passed to topoplot, if called. +% [struct] optional structure containing fields +% 'nosedir', 'plotrad', and/or 'chantype'. See these +% field definitions above, below. +% {default: nosedir +X, plotrad 0.5, all channels} +% +% Optional Plotting Parameters: +% 'scale' = ['log'|'abs'] visualize power in log scale (dB) or absolute +% scale. {default: 'log'} +% 'plottype' = ['image'|'curve'] plot time/frequency images or traces +% (curves, one curve per frequency). {default: 'image'} +% 'plotmean' = ['on'|'off'] For 'curve' plots only. Average all +% frequencies given as input. {default: 'on'} +% 'highlightmode' = ['background'|'bottom'] For 'curve' plots only, +% display significant time regions either in the plot background +% or under the curve. +% 'plotersp' = ['on'|'off'] Plot power spectral perturbations {'on'} +% 'plotitc' = ['on'|'off'] Plot inter-trial coherence {'on'} +% 'plotphasesign' = ['on'|'off'] Plot phase sign in the inter trial coherence {'on'} +% 'plotphaseonly' = ['on'|'off'] Plot ITC phase instead of ITC amplitude {'off'} +% 'erspmax' = [real] set the ERSP max. For the color scale (min= -max) {auto} +% 'itcmax' = [real] set the ITC image maximum for the color scale {auto} +% 'hzdir' = ['up' or 'normal'|'down' or 'reverse'] Direction of +% the frequency axes {default: as in icadefs.m, or 'up'} +% 'ydir' = ['up' or 'normal'|'down' or 'reverse'] Direction of +% the ERP axis plotted below the ITC {as in icadefs.m, or 'up'} +% 'erplim' = [min max] ERP limits for ITC (below ITC image) {auto} +% 'itcavglim' = [min max] average ITC limits for all freq. (left of ITC) {auto} +% 'speclim' = [min max] average spectrum limits (left of ERSP image) {auto} +% 'erspmarglim' = [min max] average marginal ERSP limits (below ERSP image) {auto} +% 'title' = Optional figure or (brief) title {none}. For multiple conditions +% this must contain a cell array of 2 or 3 title strings. +% 'marktimes' = Non-0 times to mark with a dotted vertical line (ms) {none} +% 'linewidth' = Line width for 'marktimes' traces (thick=2, thin=1) {2} +% 'axesfont' = Axes text font size {10} +% 'titlefont' = Title text font size {8} +% 'vert' = [times_vector] -> plot vertical dashed lines at specified times +% in ms. {default: none} +% 'newfig' = ['on'|'off'] Create new figure for difference plots {'on'} +% 'caption' = Caption of the figure {none} +% 'outputformat' = ['old'|'plot'] for compatibility with script that used the +% old output format, set to 'old' (mbase in absolute amplitude (not +% dB) and real itc instead of complex itc). 'plot' returns +% the plotted result {default: 'plot'} +% Outputs: +% ersp = (nfreqs,timesout) matrix of log spectral diffs from baseline +% (in dB log scale or absolute scale). Use the 'plot' output format +% above to output the ERSP as shown on the plot. +% itc = (nfreqs,timesout) matrix of complex inter-trial coherencies. +% itc is complex -- ITC magnitude is abs(itc); ITC phase in radians +% is angle(itc), or in deg phase(itc)*180/pi. +% powbase = baseline power spectrum. Note that even, when selecting the +% the 'trialbase' option, the average power spectrum is +% returned (not trial based). To obtain the baseline of +% each trial, recompute it manually using the tfdata +% output described below. +% times = vector of output times (spectral time window centers) (in ms). +% freqs = vector of frequency bin centers (in Hz). +% erspboot = (nfreqs,2) matrix of [lower upper] ERSP significance. +% itcboot = (nfreqs) matrix of [upper] abs(itc) threshold. +% tfdata = optional (nfreqs,timesout,trials) time/frequency decomposition +% of the single data trials. Values are complex. +% +% Plot description: +% Assuming both 'plotersp' and 'plotitc' options are 'on' (= default). +% The upper panel presents the data ERSP (Event-Related Spectral Perturbation) +% in dB, with mean baseline spectral activity (in dB) subtracted. Use +% "'baseline', NaN" to prevent timef() from removing the baseline. +% The lower panel presents the data ITC (Inter-Trial Coherence). +% Click on any plot axes to pop up a new window (using 'axcopy()') +% -- Upper left marginal panel presents the mean spectrum during the baseline +% period (blue), and when significance is set, the significance threshold +% at each frequency (dotted green-black trace). +% -- The marginal panel under the ERSP image shows the maximum (green) and +% minimum (blue) ERSP values relative to baseline power at each frequency. +% -- The lower left marginal panel shows mean ITC across the imaged time range +% (blue), and when significance is set, the significance threshold (dotted +% green-black). +% -- The marginal panel under the ITC image shows the ERP (which is produced by +% ITC across the data spectral pass band). +% +% Authors: Arnaud Delorme, Jean Hausser from timef() by Sigurd Enghoff, Scott Makeig +% CNL / Salk Institute 1998- | SCCN/INC, UCSD 2002- +% +% See also: timefreq(), condstat(), newcrossf(), tftopo() + +% Deprecated Multitaper Parameters: [not included here] +% 'mtaper' = If [N W], performs multitaper decomposition. +% (N is the time resolution and W the frequency resolution; +% maximum taper number is 2NW-1). Overwrites 'winsize' and 'padratio'. +% If [N W K], forces the use of K Slepian tapers (if possible). +% Phase is calculated using standard methods. +% The use of mutitaper with wavelets (cycles>0) is not +% recommended (as multiwavelets are not implemented). +% Uses Matlab functions DPSS, PMTM. {no multitaper} + +% Deprecated time warp keywords (working?) +% 'timewarpfr' = {{[events], [warpfr], [plotidx]}} Time warp amplitude and phase +% time-courses (after time/freq transform but before smoothingtimefreqfunc +% across trials). 'events' is a matrix whose columns specify the +% epoch frames [1 ... end] at which a series of successive events +% occur in each trial. 'warpfr' is an optional vector of event +% frames to which the series of events should be time locked. +% (Note: Epoch start and end should not be declared as events or +% warpfr}. If 'warpfr' is absent or [], the median of each 'events' +% column will be used. [plotidx] is an optional vector of indices +% telling which of the warpfr to plot with vertical lines. If +% undefined, all marks are plotted. Overwrites 'vert' argument, +% if any. [Note: In future releases, 'timewarpfr' will be deprecated +% in favor of 'timewarp' using latencies in ms instead of frames]. + +% Deprecated original time warp keywords (working?) +% 'timeStretchMarks' = [(marks,trials) matrix] Each trial data will be +% linearly warped (after time/freq. transform) so that the +% event marks are time locked to the reference frames +% (see timeStretchRefs). Marks must be specified in frames +% 'timeStretchRefs' = [1 x marks] Common reference frames to all trials. +% If empty or undefined, median latency for each mark will be used.boottype +% 'timeStretchPlot' = [vector] Indicates the indices of the reference frames +% (in StretchRefs) should be overplotted on the ERSP and ITC. +% +% +% Copyright (C) University of California San Diego, La Jolla, CA +% +% First built as timef.m at CNL / Salk Institute 8/1/98-8/28/01 by +% Sigurd Enghoff and Scott Makeig, edited by Arnaud Delorme +% SCCN/INC/UCSD/ reprogrammed as newtimef -Arnaud Delorme 2002- +% SCCN/INC/UCSD/ added time warping capabilities -Jean Hausser 2005 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 10-19-98 avoided division by zero (using MIN_ABS) -sm +% 10-19-98 improved usage message and commandline info printing -sm +% 10-19-98 made valid [] values for tvec and g.elocs -sm +% 04-01-99 added missing freq in freqs and plots, fixed log scaling bug -se && -tpj +% 06-29-99 fixed frequency indexing for constant-Q -se +% 08-24-99 reworked to handle NaN input values -sm +% 12-07-99 adjusted ERPtimes to plot ERP under ITC -sm +% 12-22-99 debugged ERPtimes, added BASE_BOOT -sm +% 01-10-00 debugged BASE_BOOT=0 -sm +% 02-28-00 added NOTE on formula derivation below -sm +% 03-16-00 added axcopy() feature -sm && tpj +% 04-16-00 added multiple marktimes loop -sm +% 04-20-00 fixed ITC cbar limits when spcified in input -sm +% 07-29-00 changed frequencies displayed msg -sm +% 10-12-00 fixed bug in freqs when cycles>0 -sm +% 02-07-01 fixed inconsistency in BASE_BOOT use -sm +% 08-28-01 matlab 'key' value arguments -ad +% 08-28-01 multitaper decomposition -ad +% 01-25-02 reformated help && license -ad +% 03-08-02 debug && compare to old timef function -ad +% 03-16-02 timeout automatically adjusted if too high -ad +% 04-02-02 added 'coher' option -ad + +function [P,R,mbase,timesout,freqs,Pboot,Rboot,alltfX,PA] = newtimef( data, frames, tlimits, Fs, varwin, varargin); + +% Note: Above, PA is output of 'phsamp','on' + +% For future 'timewarp' keyword help: 'timewarp' 3rd element {colors} contains a +% list of Matlab linestyles to use for vertical lines marking the occurence +% of the time warped events. If '', no line will be drawn for this event +% column. If fewer colors than event columns, cycles through the given color +% labels. Note: Not compatible with 'vert' (below). + +%varwin,winsize,g.timesout,g.padratio,g.maxfreq,g.topovec,g.elocs,g.alpha,g.marktimes,g.powbase,g.pboot,g.rboot) + +% ITC: Normally, R = |Sum(Pxy)| / (Sum(|Pxx|)*Sum(|Pyy|)) is coherence. +% But here, we consider Phase(Pyy) = 0 and |Pyy| = 1 -> Pxy = Pxx +% Giving, R = |Sum(Pxx)|/Sum(|Pxx|), the inter-trial coherence (ITC) +% Also called 'phase-locking factor' by Tallon-Baudry et al. (1996) + +if nargin < 1 + help newtimef; + return; +end; + +% Read system (or directory) constants and preferences: +% ------------------------------------------------------ +icadefs % read local EEGLAB constants: HZDIR, YDIR, DEFAULT_SRATE, DEFAULT_TIMLIM + +if ~exist('HZDIR'), HZDIR = 'up'; end; % ascending freqs +if ~exist('YDIR'), YDIR = 'up'; end; % positive up + +if YDIR == 1, YDIR = 'up'; end; % convert from [-1|1] as set in icadefs.m +if YDIR == -1, YDIR = 'down'; end; % and read by other plotting functions + +if ~exist('DEFAULT_SRATE'), DEFAULT_SRATE = 250; end; % 250 Hz +if ~exist('DEFAULT_TIMLIM'), DEFAULT_TIMLIM = [-1000 2000]; end; % [-1 2] s epochs + +% Constants set here: +% ------------------ +ERSP_CAXIS_LIMIT = 0; % 0 -> use data limits; else positive value +% giving symmetric +/- caxis limits. +ITC_CAXIS_LIMIT = 0; % 0 -> use data limits; else positive value +% giving symmetric +/- caxis limits. +MIN_ABS = 1e-8; % avoid division by ~zero + +% Command line argument defaults: +% ------------------------------ +DEFAULT_NWIN = 200; % Number of windows = horizontal resolution +DEFAULT_VARWIN = 0; % Fixed window length or fixed number of cycles. +% =0: fix window length to that determined by nwin +% >0: set window length equal to varwin cycles +% Bounded above by winsize, which determines +% the min. freq. to be computed. + +DEFAULT_OVERSMP = 2; % Number of times to oversample frequencies +DEFAULT_MAXFREQ = 50; % Maximum frequency to display (Hz) +DEFAULT_TITLE = ''; % Figure title (no default) +DEFAULT_ELOC = 'chan.locs'; % Channel location file +DEFAULT_ALPHA = NaN; % Percentile of bins to keep +DEFAULT_MARKTIME= NaN; + +% Font sizes: +AXES_FONT = 10; % axes text FontSize +TITLE_FONT = 8; + +if (nargin < 2) + frames = floor((DEFAULT_TIMLIN(2)-DEFAULT_TIMLIM(1))/DEFAULT_SRATE); +elseif (~isnumeric(frames) | length(frames)~=1 | frames~=round(frames)) + error('Value of frames must be an integer.'); +elseif (frames <= 0) + error('Value of frames must be positive.'); +end; + +DEFAULT_WINSIZE = max(pow2(nextpow2(frames)-3),4); +DEFAULT_PAD = max(pow2(nextpow2(DEFAULT_WINSIZE)),4); + +if (nargin < 1) + help newtimef + return +end + +if isstr(data) && strcmp(data,'details') + more on + help timefdetails + more off + return +end +if ~iscell(data) + data = reshape_data(data, frames); + trials = size(data,ndims(data)); +else + if ndims(data) == 3 && size(data,1) == 1 + error('Cannot process multiple channel component in compare mode'); + end; + [data{1}, frames] = reshape_data(data{1}, frames); + [data{2}, frames] = reshape_data(data{2}, frames); + trials = size(data{1},2); +end; + +if (nargin < 3) + tlimits = DEFAULT_TIMLIM; +elseif (~isnumeric(tlimits) | sum(size(tlimits))~=3) + error('Value of tlimits must be a vector containing two numbers.'); +elseif (tlimits(1) >= tlimits(2)) + error('tlimits interval must be ascending.'); +end + +if (nargin < 4) + Fs = DEFAULT_SRATE; +elseif (~isnumeric(Fs) | length(Fs)~=1) + error('Value of srate must be a number.'); +elseif (Fs <= 0) + error('Value of srate must be positive.'); +end + +if (nargin < 5) + varwin = DEFAULT_VARWIN; +elseif ~isnumeric(varwin) && strcmpi(varwin, 'cycles') + varwin = varargin{1}; + varargin(1) = []; +elseif (varwin < 0) + error('Value of cycles must be zero or positive.'); +end + +% build a structure for keyword arguments +% -------------------------------------- +if ~isempty(varargin) + [tmp indices] = unique_bc(varargin(1:2:end)); + varargin = varargin(sort(union(indices*2-1, indices*2))); % these 2 lines remove duplicate arguments + try, g = struct(varargin{:}); + catch, error('Argument error in the {''param'', value} sequence'); end; +end +%} +[ g timefreqopts ] = finputcheck(varargin, ... + {'boottype' 'string' {'shuffle','rand','randall'} 'shuffle'; ... + 'condboot' 'string' {'abs','angle','complex'} 'abs'; ... + 'title' { 'string','cell' } { [] [] } DEFAULT_TITLE; ... + 'title2' 'string' [] DEFAULT_TITLE; ... + 'winsize' 'integer' [0 Inf] DEFAULT_WINSIZE; ... + 'pad' 'real' [] DEFAULT_PAD; ... + 'timesout' 'integer' [] DEFAULT_NWIN; ... + 'padratio' 'integer' [0 Inf] DEFAULT_OVERSMP; ... + 'topovec' 'real' [] []; ... + 'elocs' {'string','struct'} [] DEFAULT_ELOC; ... + 'alpha' 'real' [0 0.5] DEFAULT_ALPHA; ... + 'marktimes' 'real' [] DEFAULT_MARKTIME; ... + 'powbase' 'real' [] NaN; ... + 'pboot' 'real' [] NaN; ... + 'rboot' 'real' [] NaN; ... + 'plotersp' 'string' {'on','off'} 'on'; ... + 'plotamp' 'string' {'on','off'} 'on'; ... + 'plotitc' 'string' {'on','off'} 'on'; ... + 'detrend' 'string' {'on','off'} 'off'; ... + 'rmerp' 'string' {'on','off'} 'off'; ... + 'basenorm' 'string' {'on','off'} 'off'; ... + 'commonbase' 'string' {'on','off'} 'on'; ... + 'baseline' 'real' [] 0; ... + 'baseboot' 'real' [] 1; ... + 'linewidth' 'integer' [1 2] 2; ... + 'naccu' 'integer' [1 Inf] 200; ... + 'mtaper' 'real' [] []; ... + 'maxfreq' 'real' [0 Inf] DEFAULT_MAXFREQ; ... + 'freqs' 'real' [0 Inf] [0 DEFAULT_MAXFREQ]; ... + 'cycles' 'integer' [] []; ... + 'nfreqs' 'integer' [] []; ... + 'freqscale' 'string' [] 'linear'; ... + 'vert' 'real' [] []; ... + 'newfig' 'string' {'on','off'} 'on'; ... + 'type' 'string' {'coher','phasecoher','phasecoher2'} 'phasecoher'; ... + 'itctype' 'string' {'coher','phasecoher','phasecoher2'} 'phasecoher'; ... + 'phsamp' 'string' {'on','off'} 'off'; ... % phsamp not completed - Toby 9.28.2006 + 'plotphaseonly' 'string' {'on','off'} 'off'; ... + 'plotphasesign' 'string' {'on','off'} 'on'; ... + 'plotphase' 'string' {'on','off'} 'on'; ... % same as above for backward compatibility + 'pcontour' 'string' {'on','off'} 'off'; ... + 'outputformat' 'string' {'old','new','plot' } 'plot'; ... + 'itcmax' 'real' [] []; ... + 'erspmax' 'real' [] []; ... + 'lowmem' 'string' {'on','off'} 'off'; ... + 'verbose' 'string' {'on','off'} 'on'; ... + 'plottype' 'string' {'image','curve'} 'image'; ... + 'mcorrect' 'string' {'fdr','none'} 'none'; ... + 'plotmean' 'string' {'on','off'} 'on'; ... + 'plotmode' 'string' {} ''; ... % for metaplottopo + 'highlightmode' 'string' {'background','bottom'} 'background'; ... + 'chaninfo' 'struct' [] struct([]); ... + 'erspmarglim' 'real' [] []; ... + 'itcavglim' 'real' [] []; ... + 'erplim' 'real' [] []; ... + 'speclim' 'real' [] []; ... + 'ntimesout' 'real' [] []; ... + 'scale' 'string' { 'log','abs'} 'log'; ... + 'timewarp' 'real' [] []; ... + 'precomputed' 'struct' [] struct([]); ... + 'timewarpms' 'real' [] []; ... + 'timewarpfr' 'real' [] []; ... + 'timewarpidx' 'real' [] []; ... + 'timewarpidx' 'real' [] []; ... + 'timeStretchMarks' 'real' [] []; ... + 'timeStretchRefs' 'real' [] []; ... + 'timeStretchPlot' 'real' [] []; ... + 'trialbase' 'string' {'on','off','full'} 'off'; + 'caption' 'string' [] ''; ... + 'hzdir' 'string' {'up','down','normal','reverse'} HZDIR; ... + 'ydir' 'string' {'up','down','normal','reverse'} YDIR; ... + 'cycleinc' 'string' {'linear','log'} 'linear' + }, 'newtimef', 'ignore'); +if isstr(g), error(g); end; +if strcmpi(g.plotamp, 'off'), g.plotersp = 'off'; end; +if strcmpi(g.basenorm, 'on'), g.scale = 'abs'; end; +if ~strcmpi(g.itctype , 'phasecoher'), g.type = g.itctype; end; + +g.tlimits = tlimits; +g.frames = frames; +g.srate = Fs; +if isempty(g.cycles) + g.cycles = varwin; +end; +g.AXES_FONT = AXES_FONT; % axes text FontSize +g.TITLE_FONT = TITLE_FONT; +g.ERSP_CAXIS_LIMIT = ERSP_CAXIS_LIMIT; +g.ITC_CAXIS_LIMIT = ITC_CAXIS_LIMIT; +if ~strcmpi(g.plotphase, 'on'), g.plotphasesign = g.plotphase; end; + +% unpack 'timewarp' (and undocumented 'timewarpfr') arguments +%------------------------------------------------------------ +if isfield(g,'timewarpfr') + if iscell(g.timewarpfr) && length(g.timewarpfr) > 3 + error('undocumented ''timewarpfr'' cell array may have at most 3 elements'); + end +end + +if ~isempty(g.nfreqs) + verboseprintf(g.verbose, 'Warning: ''nfreqs'' input overwrite ''padratio''\n'); +end; +if strcmpi(g.basenorm, 'on') + verboseprintf(g.verbose, 'Baseline normalization is on (results will be shown as z-scores)\n'); +end; + +if isfield(g,'timewarp') && ~isempty(g.timewarp) + if ndims(data) == 3 + error('Cannot perform time warping on 3-D data input'); + end; + if ~isempty(g.timewarp) % convert timewarp ms to timewarpfr frames -sm + fprintf('\n') + if iscell(g.timewarp) + error('timewarp argument must be a (total_trials,epoch_events) matrix'); + end + evntms = g.timewarp; + warpfr = round((evntms - g.tlimits(1))/1000*g.srate)+1; + g.timewarpfr{1} = warpfr'; + + if isfield(g,'timewarpms') + refms = g.timewarpms; + reffr = round((refms - g.tlimits(1))/1000*g.srate)+1; + g.timewarpfr{2} = reffr'; + end + if isfield(g,'timewarpidx') + g.timewarpfr{3} = g.timewarpidx; + end + end + + % convert again to timeStretch parameters + % --------------------------------------- + if ~isempty(g.timewarpfr) + g.timeStretchMarks = g.timewarpfr{1}; + if length(g.timewarpfr) > 1 + g.timeStretchRefs = g.timewarpfr{2}; + end + + if length(g.timewarpfr) > 2 + if isempty(g.timewarpfr{3}) + stretchevents = size(g.timeStretchMarks,1); + g.timeStretchPlot = [1:stretchevents]; % default to plotting all lines + else + g.timeStretchPlot = g.timewarpfr{3}; + end + end + + if max(max(g.timeStretchMarks)) > frames-2 | min(min(g.timeStretchMarks)) < 3 + error('Time warping events must be inside the epochs.'); + end + if ~isempty(g.timeStretchRefs) + if max(g.timeStretchRefs) > frames-2 | min(g.timeStretchRefs) < 3 + error('Time warping reference latencies must be within the epochs.'); + end + end + end +end + +% Determining source of the call +% --------------------------------------% 'guicall'= 1 if newtimef is called +callerstr = dbstack(1); % from EEGLAB GUI, otherwise 'guicall'= 0 +if isempty(callerstr) % 7/3/2014, Ramon + guicall = 0; +elseif strcmp(callerstr(end).name,'pop_newtimef') + guicall = 1; +else + guicall = 0; +end + +% test argument consistency +% -------------------------- +if g.tlimits(2)-g.tlimits(1) < 30 + verboseprintf(g.verbose, 'newtimef(): WARNING: Specified time range is very small (< 30 ms)???\n'); + verboseprintf(g.verbose, ' Epoch time limits should be in msec, not seconds!\n'); +end + +if (g.winsize > g.frames) + error('Value of winsize must be smaller than epoch frames.'); +end + +if length(g.timesout) == 1 && g.timesout > 0 + if g.timesout > g.frames-g.winsize + g.timesout = g.frames-g.winsize; + disp(['Value of timesout must be <= frames-winsize, timeout adjusted to ' int2str(g.timesout) ]); + end +end; + +if (pow2(nextpow2(g.padratio)) ~= g.padratio) + error('Value of padratio must be an integer power of two [1,2,4,8,16,...]'); +end + +if (g.maxfreq > Fs/2) + verboseprintf(g.verbose, ['Warning: value of maxfreq reduced to Nyquist rate' ... + ' (%3.2f)\n\n'], Fs/2); + g.maxfreq = Fs/2; +end +if g.maxfreq ~= DEFAULT_MAXFREQ, g.freqs(2) = g.maxfreq; end; + +if isempty(g.topovec) + g.topovec = []; + if isempty(g.elocs) + error('Channel location file must be specified.'); + end; +end + +if (round(g.naccu*g.alpha) < 2) + verboseprintf(g.verbose, 'Value of alpha is outside its normal range [%g,0.5]\n',2/g.naccu); + g.naccu = round(2/g.alpha); + verboseprintf(g.verbose, ' Increasing the number of iterations to %d\n',g.naccu); +end + +if ~isnan(g.alpha) + if length(g.baseboot) == 2 + verboseprintf(g.verbose, 'Permutation analysis will use data from %3.2g to %3.2g ms.\n', ... + g.baseboot(1), g.baseboot(2)) + elseif g.baseboot > 0 + verboseprintf(g.verbose, 'Permutation analysis will use data in (pre-0) baseline subwindows only.\n') + else + verboseprintf(g.verbose, 'Permutation analysis will use data in all subwindows.\n') + end +end + +if ~isempty(g.timeStretchMarks) % timeStretch code by Jean Hauser + if isempty(g.timeStretchRefs) + verboseprintf(g.verbose, ['Using median event latencies as reference event times for time warping.\n']); + g.timeStretchRefs = median(g.timeStretchMarks,2); + % Note: Uses (grand) median latencies for two conditions + else + verboseprintf(g.verbose, ['Using supplied latencies as reference event times for time warping.\n']); + end + if isempty(g.timeStretchPlot) + verboseprintf(g.verbose, 'Will not overplot the reference event times on the ERSP.\n'); + elseif length(g.timeStretchPlot) > 0 + g.vert = ((g.timeStretchRefs(g.timeStretchPlot)-1) ... + /g.srate+g.tlimits(1)/1000)*1000; + fprintf('Plotting timewarp markers at ') + for li = 1:length(g.vert), fprintf('%d ',g.vert(li)); end + fprintf(' ms.\n') + end +end + +if min(g.vert) < g.tlimits(1) | max(g.vert) > g.tlimits(2) + error('vertical line (''vert'') latency outside of epoch boundaries'); +end + +if strcmp(g.hzdir,'up')| strcmp(g.hzdir,'normal') + g.hzdir = 'normal'; % convert to Matlab graphics constants +elseif strcmp(g.hzdir,'down') | strcmp(g.hzdir,'reverse')| g.hzdir==-1 + g.hzdir = 'reverse'; +else + error('unknown ''hzdir'' argument'); +end + +if strcmp(g.ydir,'up')| strcmp(g.ydir,'normal') + g.ydir = 'normal'; % convert to Matlab graphics constants +elseif strcmp(g.ydir,'down') | strcmp(g.ydir,'reverse') + g.ydir = 'reverse'; +else + error('unknown ''ydir'' argument'); +end + +% ----------------- +% ERSP scaling unit +% ----------------- +if strcmpi(g.scale, 'log') + if strcmpi(g.basenorm, 'on') + g.unitpower = '10*log(std.)'; % impossible + elseif isnan(g.baseline) + g.unitpower = '10*log10(\muV^{2}/Hz)'; + else + g.unitpower = 'dB'; + end; +else + if strcmpi(g.basenorm, 'on') + g.unitpower = 'std.'; + elseif isnan(g.baseline) + g.unitpower = '\muV^{2}/Hz'; + else + g.unitpower = '% of baseline'; + end; +end; + +% Multitaper - used in timef +% -------------------------- +if ~isempty(g.mtaper) % multitaper, inspired from a Bijan Pesaran matlab function + if length(g.mtaper) < 3 + %error('mtaper arguement must be [N W] or [N W K]'); + + if g.mtaper(1) * g.mtaper(2) < 1 + error('mtaper 2 first arguments'' product must be larger than 1'); + end; + if length(g.mtaper) == 2 + g.mtaper(3) = floor( 2*g.mtaper(2)*g.mtaper(1) - 1); + end + if length(g.mtaper) == 3 + if g.mtaper(3) > 2 * g.mtaper(1) * g.mtaper(2) -1 + error('mtaper number too high (maximum (2*N*W-1))'); + end; + end + disp(['Using ' num2str(g.mtaper(3)) ' tapers.']); + NW = g.mtaper(1)*g.mtaper(2); % product NW + N = g.mtaper(1)*g.srate; + [e,v] = dpss(N, NW, 'calc'); + e=e(:,1:g.mtaper(3)); + g.alltapers = e; + else + g.alltapers = g.mtaper; + disp('mtaper argument not [N W] or [N W K]; considering raw taper matrix'); + end; + g.winsize = size(g.alltapers, 1); + g.pad = max(pow2(nextpow2(g.winsize)),256); % pad*nextpow + nfk = floor([0 g.maxfreq]./g.srate.*g.pad); + g.padratio = 2*nfk(2)/g.winsize; + + %compute number of frequencies + %nf = max(256, g.pad*2^nextpow2(g.winsize+1)); + %nfk = floor([0 g.maxfreq]./g.srate.*nf); + + %freqs = linspace( 0, g.maxfreq, diff(nfk)); % this also works in the case of a FFT +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% compute frequency by frequency if low memory +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if strcmpi(g.lowmem, 'on') && numel(data) ~= g.frames && isempty(g.nfreqs) && ~iscell(data) + disp('Lowmem is a deprecated option that is not functional any more'); + return; + + % NOTE: the code below is functional but the graphical output is + % different when the 'lowmem' option is used compared to when it is not + % used - AD, 29 April 2011 + + % compute for first 2 trials to get freqsout + XX = reshape(data, 1, frames, prod(size(data))/g.frames); + [P,R,mbase,timesout,freqsout] = newtimef(XX(1,:,1), frames, tlimits, Fs, g.cycles, 'plotitc', 'off', 'plotamp', 'off',varargin{:}, 'lowmem', 'off'); + + % scan all frequencies + for index = 1:length(freqsout) + if nargout < 8 + [P(index,:),R(index,:),mbase(index),timesout,tmpfreqs(index),Pboottmp,Rboottmp] = ... + newtimef(data, frames, tlimits, Fs, g.cycles, ... + 'freqs', [freqsout(index) freqsout(index)], 'nfreqs', 1, ... + 'plotamp', 'off', 'plotitc', 'off', 'plotphasesign', 'off',varargin{:}, ... + 'lowmem', 'off', 'timesout', timesout); + if ~isempty(Pboottmp) + Pboot(index,:) = Pboottmp; + Rboot(index,:) = Rboottmp; + else + Pboot = []; + Rboot = []; + end; + else + [P(index,:),R(index,:),mbase(index),timesout,tmpfreqs(index),Pboot(index,:),Rboot(index,:), ... + alltfX(index,:,:)] = ... + newtimef(data, frames, tlimits, Fs, g.cycles, ... + 'freqs', [freqsout(index) freqsout(index)], 'nfreqs', 1, ... + 'plotamp', 'off', 'plotphasesign', 'off',varargin{:}, ... + 'lowmem', 'off', 'timesout', timesout); + end; + end; + + % compute trial-average ERP + % ------------------------- + ERP = mean(data,2); + + % plot results + %------------- + plottimef(P, R, Pboot, Rboot, ERP, freqsout, timesout, mbase, [], [], g); + + return; % finished +end; + + +%%%%%%%%%%%%%%%%%%%%%%% +% compare 2 conditions +%%%%%%%%%%%%%%%%%%%%%%% +if iscell(data) + if ~guicall && (strcmp(g.basenorm, 'on') || strcmp(g.trialbase, 'on')) % ------------------------------------- Temporary fix for error when using + error('EEGLAB error: basenorm and/or trialbase options cannot be used when processing 2 conditions'); % basenorm or trialbase with two conditions + end; + Pboot = []; + Rboot = []; + if ~strcmpi(g.mcorrect, 'none') + error('Correction for multiple comparison not implemented for comparing conditions'); + end; + + vararginori = varargin; + if length(data) ~= 2 + error('newtimef: to compare two conditions, data must be a length-2 cell array'); + end; + + % deal with titles + % ---------------- + for index = 1:2:length(vararginori) + if index<=length(vararginori) % needed if elements are deleted + + % if strcmp(vararginori{index}, 'title') | ... % Added by Jean Hauser + % strcmp(vararginori{index}, 'title2') | ... + if strcmp(vararginori{index}, 'timeStretchMarks') | ... + strcmp(vararginori{index}, 'timeStretchRefs') | ... + strcmp(vararginori{index}, 'timeStretchPlots') + vararginori(index:index+1) = []; + end; + end; + end; + if iscell(g.title) && length(g.title) >= 2 % Changed that part because providing titles + % as cells caused the function to crash (why?) + % at line 704 (g.tlimits = tlimits) -Jean + if length(g.title) == 2, + g.title{3} = [ g.title{1} ' - ' g.title{2} ]; + end; + else + disp('Warning: title must be a cell array'); + g.title = { 'Condition 1' 'Condition 2' 'Condition 1 minus Condition 2' }; + end; + + verboseprintf(g.verbose, '\nRunning newtimef() on Condition 1 **********************\n\n'); + + verboseprintf(g.verbose, 'Note: If an out-of-memory error occurs, try reducing the\n'); + verboseprintf(g.verbose, ' the number of time points or number of frequencies\n'); + verboseprintf(g.verbose, '(''coher'' options take 3 times the memory of other options)\n\n'); + + cond_1_epochs = size(data{1},2); + + if ~isempty(g.timeStretchMarks) + [P1,R1,mbase1,timesout,freqs,Pboot1,Rboot1,alltfX1] = ... + newtimef( data{1}, frames, tlimits, Fs, g.cycles, 'plotitc', 'off', ... + 'plotersp', 'off', vararginori{:}, 'lowmem', 'off', ... + 'timeStretchMarks', g.timeStretchMarks(:,1:cond_1_epochs), ... + 'timeStretchRefs', g.timeStretchRefs); + else + [P1,R1,mbase1,timesout,freqs,Pboot1,Rboot1,alltfX1] = ... + newtimef( data{1}, frames, tlimits, Fs, g.cycles, 'plotitc', 'off', ... + 'plotersp', 'off', vararginori{:}, 'lowmem', 'off'); + end + + verboseprintf(g.verbose,'\nRunning newtimef() on Condition 2 **********************\n\n'); + + [P2,R2,mbase2,timesout,freqs,Pboot2,Rboot2,alltfX2] = ... + newtimef( data{2}, frames, tlimits, Fs, g.cycles, 'plotitc', 'off', ... + 'plotersp', 'off', vararginori{:}, 'lowmem', 'off', ... + 'timeStretchMarks', g.timeStretchMarks(:,cond_1_epochs+1:end), ... + 'timeStretchRefs', g.timeStretchRefs); + + verboseprintf(g.verbose,'\nComputing difference **********************\n\n'); + + % recompute power baselines + % ------------------------- + if ~isnan( g.baseline(1) ) && ~isnan( mbase1(1) ) && isnan(g.powbase(1)) && strcmpi(g.commonbase, 'on') + disp('Recomputing baseline power: using the grand mean of both conditions ...'); + mbase = (mbase1 + mbase2)/2; + P1 = P1 + repmat(mbase1(1:size(P1,1))',[1 size(P1,2)]); + P2 = P2 + repmat(mbase2(1:size(P1,1))',[1 size(P1,2)]); + P1 = P1 - repmat(mbase (1:size(P1,1))',[1 size(P1,2)]); + P2 = P2 - repmat(mbase (1:size(P1,1))',[1 size(P1,2)]); + if ~isnan(g.alpha) + Pboot1 = Pboot1 + repmat(mbase1(1:size(Pboot1,1))',[1 size(Pboot1,2) size(Pboot1,3)]); + Pboot2 = Pboot2 + repmat(mbase2(1:size(Pboot1,1))',[1 size(Pboot1,2) size(Pboot1,3)]); + Pboot1 = Pboot1 - repmat(mbase (1:size(Pboot1,1))',[1 size(Pboot1,2) size(Pboot1,3)]); + Pboot2 = Pboot2 - repmat(mbase (1:size(Pboot1,1))',[1 size(Pboot1,2) size(Pboot1,3)]); + end; + verboseprintf(g.verbose, '\nSubtracting the common power baseline ...\n'); + meanmbase = mbase; + mbase = { mbase mbase }; + elseif strcmpi(g.commonbase, 'on') + mbase = { NaN NaN }; + meanmbase = mbase{1}; %Ramon :for bug 1657 + else + meanmbase = (mbase1 + mbase2)/2; + mbase = { mbase1 mbase2 }; + end; + + % plotting + % -------- + if strcmpi(g.plotersp, 'on') | strcmpi(g.plotitc, 'on') + g.titleall = g.title; + if strcmpi(g.newfig, 'on'), figure; end; % declare a new figure + + % using same color scale + % ---------------------- + if ~isfield(g, 'erspmax') + g.erspmax = max( max(max(abs(Pboot1))), max(max(abs(Pboot2))) ); + end; + if ~isfield(g, 'itcmax') + g.itcmax = max( max(max(abs(Rboot1))), max(max(abs(Rboot2))) ); + end; + + subplot(1,3,1); % plot Condition 1 + g.title = g.titleall{1}; + g = plottimef(P1, R1, Pboot1, Rboot1, mean(data{1},2), freqs, timesout, mbase{1}, [], [], g); + g.itcavglim = []; + + subplot(1,3,2); % plot Condition 2 + g.title = g.titleall{2}; + plottimef(P2, R2, Pboot2, Rboot2, mean(data{2},2), freqs, timesout, mbase{2}, [], [], g); + + subplot(1,3,3); % plot Condition 1 - Condition 2 + g.title = g.titleall{3}; + end; + + if isnan(g.alpha) + switch(g.condboot) + case 'abs', Rdiff = abs(R1)-abs(R2); + case 'angle', Rdiff = angle(R1)-angle(R2); + case 'complex', Rdiff = R1-R2; + end; + if strcmpi(g.plotersp, 'on') | strcmpi(g.plotitc, 'on') + plottimef(P1-P2, Rdiff, [], [], mean(data{1},2)-mean(data{2},2), freqs, timesout, meanmbase, [], [], g); + end; + else + % preprocess data and run compstat() function + % ------------------------------------------- + alltfX1power = alltfX1.*conj(alltfX1); + alltfX2power = alltfX2.*conj(alltfX2); + + if ~isnan(mbase{1}(1)) + mbase1 = 10.^(mbase{1}(1:size(alltfX1,1))'/20); + mbase2 = 10.^(mbase{2}(1:size(alltfX1,1))'/20); + alltfX1 = alltfX1./repmat(mbase1/2,[1 size(alltfX1,2) size(alltfX1,3)]); + alltfX2 = alltfX2./repmat(mbase2/2,[1 size(alltfX2,2) size(alltfX2,3)]); + alltfX1power = alltfX1power./repmat(mbase1,[1 size(alltfX1power,2) size(alltfX1power,3)]); + alltfX2power = alltfX2power./repmat(mbase2,[1 size(alltfX2power,2) size(alltfX2power,3)]); + end; + + %formula = {'log10(mean(arg1,3))'}; % toby 10.02.2006 + %formula = {'log10(mean(arg1(:,:,data),3))'}; + + formula = {'log10(mean(arg1(:,:,X),3))'}; + switch g.type + case 'coher', % take the square of alltfx and alltfy first to speed up + formula = { formula{1} ['sum(arg2(:,:,data),3)./sqrt(sum(arg1(:,:,data),3)*length(data) )'] }; + if strcmpi(g.lowmem, 'on') + for ind = 1:2:size(alltfX1power,1) + if ind == size(alltfX1,1), indarr = ind; else indarr = [ind:ind+1]; end; + [resdifftmp resimagestmp res1tmp res2tmp] = ... + condstat(formula, g.naccu, g.alpha, {'both' 'upper'}, { '' g.condboot}, ... + { alltfX1power(indarr,:,:) alltfX2power(indarr,:,:) }, {alltfX1(indarr,:,:) alltfX2(indarr,:,:)}); + resdiff{1}(indarr,:) = resdifftmp{1}; resdiff{2}(indarr,:) = resdifftmp{2}; + resimages{1}(indarr,:,:) = resimagestmp{1}; resimages{2}(indarr,:,:) = resimagestmp{2}; + res1{1}(indarr,:) = res1tmp{1}; res1{2}(indarr,:) = res1tmp{2}; + res2{1}(indarr,:) = res2tmp{1}; res2{2}(indarr,:) = res2tmp{2}; + end; + else + alltfXpower = { alltfX1power alltfX2power }; + alltfX = { alltfX1 alltfX2 }; + alltfXabs = { alltfX1abs alltfX2abs }; + [resdiff resimages res1 res2] = condstat(formula, g.naccu, g.alpha, {'both' 'upper'}, { '' g.condboot}, alltfXpower, alltfX, alltfXabs); + end; + case 'phasecoher2', % normalize first to speed up + + %formula = { formula{1} ['sum(arg2(:,:,data),3)./sum(arg3(:,:,data),3)'] }; + % toby 10/3/2006 + + formula = { formula{1} ['sum(arg2(:,:,X),3)./sum(arg3(:,:,X),3)'] }; + alltfX1abs = sqrt(alltfX1power); % these 2 lines can be suppressed + alltfX2abs = sqrt(alltfX2power); % by inserting sqrt(arg1(:,:,data)) instead of arg3(:,:,data)) + if strcmpi(g.lowmem, 'on') + for ind = 1:2:size(alltfX1abs,1) + if ind == size(alltfX1,1), indarr = ind; else indarr = [ind:ind+1]; end; + [resdifftmp resimagestmp res1tmp res2tmp] = ... + condstat(formula, g.naccu, g.alpha, {'both' 'upper'}, { '' g.condboot}, ... + { alltfX1power(indarr,:,:) alltfX2power(indarr,:,:) }, {alltfX1(indarr,:,:) ... + alltfX2(indarr,:,:)}, { alltfX1abs(indarr,:,:) alltfX2abs(indarr,:,:) }); + resdiff{1}(indarr,:) = resdifftmp{1}; resdiff{2}(indarr,:) = resdifftmp{2}; + resimages{1}(indarr,:,:) = resimagestmp{1}; resimages{2}(indarr,:,:) = resimagestmp{2}; + res1{1}(indarr,:) = res1tmp{1}; res1{2}(indarr,:) = res1tmp{2}; + res2{1}(indarr,:) = res2tmp{1}; res2{2}(indarr,:) = res2tmp{2}; + end; + else + alltfXpower = { alltfX1power alltfX2power }; + alltfX = { alltfX1 alltfX2 }; + alltfXabs = { alltfX1abs alltfX2abs }; + [resdiff resimages res1 res2] = condstat(formula, g.naccu, g.alpha, {'both' 'upper'}, { '' g.condboot}, alltfXpower, alltfX, alltfXabs); + end; + case 'phasecoher', + + %formula = { formula{1} ['mean(arg2,3)'] }; % toby 10.02.2006 + %formula = { formula{1} ['mean(arg2(:,:,data),3)'] }; + + formula = { formula{1} ['mean(arg2(:,:,X),3)'] }; + if strcmpi(g.lowmem, 'on') + for ind = 1:2:size(alltfX1,1) + if ind == size(alltfX1,1), indarr = ind; else indarr = [ind:ind+1]; end; + alltfX1norm = alltfX1(indarr,:,:)./sqrt(alltfX1(indarr,:,:).*conj(alltfX1(indarr,:,:))); + alltfX2norm = alltfX2(indarr,:,:)./sqrt(alltfX2(indarr,:,:).*conj(alltfX2(indarr,:,:))); + alltfXpower = { alltfX1power(indarr,:,:) alltfX2power(indarr,:,:) }; + alltfXnorm = { alltfX1norm alltfX2norm }; + [resdifftmp resimagestmp res1tmp res2tmp] = ... + condstat(formula, g.naccu, g.alpha, {'both' 'both'}, { '' g.condboot}, ... + alltfXpower, alltfXnorm); + resdiff{1}(indarr,:) = resdifftmp{1}; resdiff{2}(indarr,:) = resdifftmp{2}; + resimages{1}(indarr,:,:) = resimagestmp{1}; resimages{2}(indarr,:,:) = resimagestmp{2}; + res1{1}(indarr,:) = res1tmp{1}; res1{2}(indarr,:) = res1tmp{2}; + res2{1}(indarr,:) = res2tmp{1}; res2{2}(indarr,:) = res2tmp{2}; + end; + else + alltfX1norm = alltfX1./sqrt(alltfX1.*conj(alltfX1)); + alltfX2norm = alltfX2./sqrt(alltfX2.*conj(alltfX2)); % maybe have to suppress preprocessing -> lot of memory + alltfXpower = { alltfX1power alltfX2power }; + alltfXnorm = { alltfX1norm alltfX2norm }; + [resdiff resimages res1 res2] = condstat(formula, g.naccu, g.alpha, {'both' 'both'}, { '' g.condboot}, ... + alltfXpower, alltfXnorm); + end; + end; + + % same as below: plottimef(P1-P2, R2-R1, 10*resimages{1}, resimages{2}, mean(data{1},2)-mean(data{2},2), freqs, times, mbase, g); + if strcmpi(g.plotersp, 'on') | strcmpi(g.plotitc, 'on') + g.erspmax = []; % auto scale + g.itcmax = []; % auto scale + plottimef(10*resdiff{1}, resdiff{2}, 10*resimages{1}, resimages{2}, ... + mean(data{1},2)-mean(data{2},2), freqs, timesout, meanmbase, [], [], g); + end; + R1 = res1{2}; + R2 = res2{2}; + Rdiff = resdiff{2}; + Pboot = { Pboot1 Pboot2 10*resimages{1} }; + Rboot = { Rboot1 Rboot2 resimages{2} }; + end; + P = { P1 P2 P1-P2 }; + R = { R1 R2 Rdiff }; + + if nargout >= 8, alltfX = { alltfX1 alltfX2 }; end; + + return; % ********************************** END FOR MULTIPLE CONDITIONS +end; + +%%%%%%%%%%%%%%%%%%%%%% +% display text to user (computation perfomed only for display) +%%%%%%%%%%%%%%%%%%%%%% +verboseprintf(g.verbose, 'Computing Event-Related Spectral Perturbation (ERSP) and\n'); +switch g.type + case 'phasecoher', verboseprintf(g.verbose, ' Inter-Trial Phase Coherence (ITC) images based on %d trials\n',trials); + case 'phasecoher2', verboseprintf(g.verbose, ' Inter-Trial Phase Coherence 2 (ITC) images based on %d trials\n',trials); + case 'coher', verboseprintf(g.verbose, ' Linear Inter-Trial Coherence (ITC) images based on %d trials\n',trials); +end; +verboseprintf(g.verbose, ' of %d frames sampled at %g Hz.\n',g.frames,g.srate); +verboseprintf(g.verbose, 'Each trial contains samples from %1.0f ms before to\n',g.tlimits(1)); +verboseprintf(g.verbose, ' %1.0f ms after the timelocking event.\n',g.tlimits(2)); +if ~isnan(g.alpha) + verboseprintf(g.verbose, 'Only significant values (permutation statistics p<%g) will be colored;\n',g.alpha) + verboseprintf(g.verbose, ' non-significant values will be plotted in green\n'); +end +verboseprintf(g.verbose,' Image frequency direction: %s\n',g.hzdir); + +if isempty(g.precomputed) + % ----------------------------------------- + % detrend over epochs (trials) if requested + % ----------------------------------------- + if strcmpi(g.rmerp, 'on') + if ndims(data) == 2 + data = data - mean(data,2)*ones(1, length(data(:))/g.frames); + else data = data - repmat(mean(data,3), [1 1 trials]); + end; + end; + + % ---------------------------------------------------- + % compute time frequency decompositions, power and ITC + % ---------------------------------------------------- + if length(g.timesout) > 1, tmioutopt = { 'timesout' , g.timesout }; + elseif ~isempty(g.ntimesout) tmioutopt = { 'ntimesout', g.ntimesout }; + else tmioutopt = { 'ntimesout', g.timesout }; + end; + + [alltfX freqs timesout R] = timefreq(data, g.srate, tmioutopt{:}, ... + 'winsize', g.winsize, 'tlimits', g.tlimits, 'detrend', g.detrend, ... + 'itctype', g.type, 'wavelet', g.cycles, 'verbose', g.verbose, ... + 'padratio', g.padratio, 'freqs', g.freqs, 'freqscale', g.freqscale, ... + 'nfreqs', g.nfreqs, 'timestretch', {g.timeStretchMarks', g.timeStretchRefs}, timefreqopts{:}); +else + alltfX = g.precomputed.tfdata; + timesout = g.precomputed.times; + freqs = g.precomputed.freqs; + if strcmpi(g.precomputed.recompute, 'ersp') + R = []; + else + switch g.itctype + case 'coher', R = alltfX ./ repmat(sqrt(sum(alltfX .* conj(alltfX),3) * size(alltfX,3)), [1 1 size(alltfX,3)]); + case 'phasecoher2', R = alltfX ./ repmat(sum(sqrt(alltfX .* conj(alltfX)),3), [1 1 size(alltfX,3)]); + case 'phasecoher', R = alltfX ./ sqrt(alltfX .* conj(alltfX)); + end; + P = []; mbase = []; return; + end; +end; + +if g.cycles(1) == 0 + alltfX = 2/0.375*alltfX/g.winsize; % TF and MC (12/11/2006): normalization, divide by g.winsize + P = alltfX.*conj(alltfX); % power + % TF and MC (12/14/2006): multiply by 2 account for negative frequencies, + % and ounteract the reduction by a factor 0.375 that occurs as a result of + % cosine (Hann) tapering. Refer to Bug 446 + % Modified again 04/29/2011 due to comment in bug 1032 +else + P = alltfX.*conj(alltfX); % power for wavelets +end; + +% --------------- +% baseline length +% --------------- +if size(g.baseline,2) == 2 + baseln = []; + for index = 1:size(g.baseline,1) + tmptime = find(timesout >= g.baseline(index,1) & timesout <= g.baseline(index,2)); + baseln = union_bc(baseln, tmptime); + end; + if length(baseln)==0 + error( [ 'There are no sample points found in the default baseline.' 10 ... + 'This may happen even though data time limits overlap with' 10 ... + 'the baseline period (because of the time-freq. window width).' 10 ... + 'Either disable the baseline, change the baseline limits.' ] ); + end +else + if ~isempty(find(timesout < g.baseline)) + baseln = find(timesout < g.baseline); % subtract means of pre-0 (centered) windows + else baseln = 1:length(timesout); % use all times as baseline + end +end; + +if ~isnan(g.alpha) && length(baseln)==0 + verboseprintf(g.verbose, 'timef(): no window centers in baseline (times<%g) - shorten (max) window length.\n', g.baseline) + return +end + +% ----------------------------------------- +% remove baseline on a trial by trial basis +% ----------------------------------------- +if strcmpi(g.trialbase, 'on'), tmpbase = baseln; +else tmpbase = 1:size(P,2); % full baseline +end; +if ndims(P) == 4 + if ~strcmpi(g.trialbase, 'off') && isnan( g.powbase(1) ) + mbase = mean(P(:,:,tmpbase,:),3); + if strcmpi(g.basenorm, 'on') + mstd = std(P(:,:,tmpbase,:),[],3); + P = bsxfun(@rdivide, bsxfun(@minus, P, mbase), mstd); + else P = bsxfun(@rdivide, P, mbase); + end; + end; +else + if ~strcmpi(g.trialbase, 'off') && isnan( g.powbase(1) ) + mbase = mean(P(:,tmpbase,:),2); + if strcmpi(g.basenorm, 'on') + mstd = std(P(:,tmpbase,:),[],2); + P = (P-repmat(mbase,[1 size(P,2) 1]))./repmat(mstd,[1 size(P,2) 1]); % convert to log then back to normal + else + P = P./repmat(mbase,[1 size(P,2) 1]); + %P = 10 .^ (log10(P) - repmat(log10(mbase),[1 size(P,2) 1])); % same as above + end; + end; +end; +if ~isempty(g.precomputed) + return; % return single trial power +end; + +% ----------------------- +% compute baseline values +% ----------------------- +if isnan(g.powbase(1)) + + verboseprintf(g.verbose, 'Computing the mean baseline spectrum\n'); + if ndims(P) == 4 + if ndims(P) > 3, Pori = mean(P, 4); else Pori = P; end; + mbase = mean(Pori(:,:,baseln),3); + else + if ndims(P) > 2, Pori = mean(P, 3); else Pori = P; end; + mbase = mean(Pori(:,baseln),2); + end; +else + verboseprintf(g.verbose, 'Using the input baseline spectrum\n'); + mbase = g.powbase; + if strcmpi(g.scale, 'log'), mbase = 10.^(mbase/10); end; + if size(mbase,1) == 1 % if input was a row vector, flip to be a column + mbase = mbase'; + end; +end +baselength = length(baseln); + +% ------------------------- +% remove baseline (average) +% ------------------------- +% original ERSP baseline removal +if ~strcmpi(g.trialbase, 'on') + if ~isnan( g.baseline(1) ) && any(~isnan( mbase(1) )) && strcmpi(g.basenorm, 'off') + P = bsxfun(@rdivide, P, mbase); % use single trials + % ERSP baseline normalized + elseif ~isnan( g.baseline(1) ) && ~isnan( mbase(1) ) && strcmpi(g.basenorm, 'on') + + if ndims(Pori) == 3, + mstd = std(Pori(:,:,baseln),[],3); + else mstd = std(Pori(:,baseln),[],2); + end; + P = bsxfun(@rdivide, bsxfun(@minus, P, mbase), mstd); + end; +end; + +% ---------------- +% phase amp option +% ---------------- +if strcmpi(g.phsamp, 'on') + disp( 'phsamp option is deprecated'); + % switch g.phsamp + % case 'on' + %PA = zeros(size(P,1),size(P,1),g.timesout); % NB: (freqs,freqs,times) + % $$$ end % phs amp + %PA (freq x freq x time) + %PA(:,:,j) = PA(:,:,j) + (tmpX ./ abs(tmpX)) * ((P(:,j)))'; + % x-product: unit phase column + % times amplitude row + + %tmpcx(1,:,:) = cumulX; % allow ./ below + %for jj=1:g.timesout + % PA(:,:,jj) = PA(:,:,jj) ./ repmat(P(:,jj)', [size(P,1) 1]); + %end +end + +% --------- +% bootstrap +% --------- % this ensures that if bootstrap limits provided that no +% 'alpha' won't prevent application of the provided limits +if ~isnan(g.alpha) | ~isempty(find(~isnan(g.pboot))) | ~isempty(find(~isnan(g.rboot)))% if bootstrap analysis requested . . . + + % ERSP bootstrap + % -------------- + if ~isempty(find(~isnan(g.pboot))) % if ERSP bootstrap limits provided already + Pboot = g.pboot(:); + else + if size(g.baseboot,2) == 1 + if g.baseboot == 0, baselntmp = []; + elseif ~isnan(g.baseline(1)) + baselntmp = baseln; + else baselntmp = find(timesout <= 0); % if it is empty use whole epoch + end; + else + baselntmp = []; + for index = 1:size(g.baseboot,1) + tmptime = find(timesout >= g.baseboot(index,1) & timesout <= g.baseboot(index,2)); + if isempty(tmptime), + fprintf('Warning: empty baseline interval [%3.2f %3.2f]\n', g.baseboot(index,1), g.baseboot(index,2)); + end; + baselntmp = union_bc(baselntmp, tmptime); + end; + end; + if prod(size(g.baseboot)) > 2 + fprintf('Permutation statistics will use data in multiple selected windows.\n'); + elseif size(g.baseboot,2) == 2 + fprintf('Permutation statistics will use data in range %3.2g-%3.2g ms.\n', g.baseboot(1), g.baseboot(2)); + elseif g.baseboot + fprintf(' %d permutation statistics windows in baseline (times<%g).\n', length(baselntmp), g.baseboot) + end; + + % power significance + % ------------------ + if strcmpi(g.boottype, 'shuffle') + formula = 'mean(arg1,3);'; + [ Pboot Pboottrialstmp Pboottrials] = bootstat(P, formula, 'boottype', 'shuffle', ... + 'label', 'ERSP', 'bootside', 'both', 'naccu', g.naccu, ... + 'basevect', baselntmp, 'alpha', g.alpha, 'dimaccu', 2 ); + clear Pboottrialstmp; + else + center = 0; + if strcmpi(g.basenorm, 'off'), center = 1; end; + + % bootstrap signs + Pboottmp = P; + Pboottrials = zeros([ size(P,1) size(P,2) g.naccu ]); + for index = 1:g.naccu + Pboottmp = (Pboottmp-center).*(ceil(rand(size(Pboottmp))*2-1)*2-1)+center; + Pboottrials(:,:,index) = mean(Pboottmp,3); + end; + Pboot = []; + end; + if size(Pboot,2) == 1, Pboot = Pboot'; end; + end; + + % ITC bootstrap + % ------------- + if ~isempty(find(~isnan(g.rboot))) % if itc bootstrap provided + Rboot = g.rboot; + else + if ~isempty(find(~isnan(g.pboot))) % if ERSP limits were provided (but ITC not) + if size(g.baseboot,2) == 1 + if g.baseboot == 0, baselntmp = []; + elseif ~isnan(g.baseline(1)) + baselntmp = baseln; + else baselntmp = find(timesout <= 0); % if it is empty use whole epoch + end; + else + baselntmp = []; + for index = 1:size(g.baseboot,1) + tmptime = find(timesout >= g.baseboot(index,1) && timesout <= g.baseboot(index,2)); + if isempty(tmptime), + fprintf('Warning: empty baseline interval [%3.2f %3.2f]\n', g.baseboot(index,1), g.baseboot(index,2)); + end; + baselntmp = union_bc(baselntmp, tmptime); + end; + end; + if prod(size(g.baseboot)) > 2 + fprintf('Permutation statistics will use data in multiple selected windows.\n'); + elseif size(g.baseboot,2) == 2 + fprintf('Permutation statistics will use data in range %3.2g-%3.2g ms.\n', g.baseboot(1), g.baseboot(2)); + elseif g.baseboot + fprintf(' %d permutation statistics windows in baseline (times<%g).\n', length(baselntmp), g.baseboot) + end; + end; + % ITC significance + % ---------------- + inputdata = alltfX; + switch g.type + case 'coher', formula = [ 'sum(arg1,3)./sqrt(sum(arg1.*conj(arg1),3))/ sqrt(' int2str(size(alltfX,3)) ');' ]; + case 'phasecoher', formula = [ 'mean(arg1,3);' ]; inputdata = alltfX./sqrt(alltfX.*conj(alltfX)); + case 'phasecoher2', formula = [ 'sum(arg1,3)./sum(sqrt(arg1.*conj(arg1)),3);' ]; + end; + if strcmpi(g.boottype, 'randall'), dimaccu = []; g.boottype = 'rand'; + else dimaccu = 2; + end; + [Rboot Rboottmp Rboottrials] = bootstat(inputdata, formula, 'boottype', g.boottype, ... + 'label', 'ITC', 'bootside', 'upper', 'naccu', g.naccu, ... + 'basevect', baselntmp, 'alpha', g.alpha, 'dimaccu', 2 ); + fprintf('\n'); + clear Rboottmp; + end; +else + Pboot = []; Rboot = []; +end + +% average the power +% ----------------- +PA = P; +if ndims(P) == 4, P = mean(P, 4); +elseif ndims(P) == 3, P = mean(P, 3); +end; + +% correction for multiple comparisons +% ----------------------------------- +maskersp = []; +maskitc = []; +if ~isnan(g.alpha) + if isempty(find(~isnan(g.pboot))) % if ERSP lims not provided + if ndims(Pboottrials) < 3, Pboottrials = Pboottrials'; end; + exactp_ersp = compute_pvals(P, Pboottrials); + if strcmpi(g.mcorrect, 'fdr') + alphafdr = fdr(exactp_ersp, g.alpha); + if alphafdr ~= 0 + fprintf('ERSP correction for multiple comparisons using FDR, alpha_fdr = %3.6f\n', alphafdr); + else fprintf('ERSP correction for multiple comparisons using FDR, nothing significant\n', alphafdr); + end; + maskersp = exactp_ersp <= alphafdr; + else + maskersp = exactp_ersp <= g.alpha; + end; + end; + if isempty(find(~isnan(g.rboot))) % if ITC lims not provided + exactp_itc = compute_pvals(abs(R), abs(Rboottrials')); + if strcmpi(g.mcorrect, 'fdr') + alphafdr = fdr(exactp_itc, g.alpha); + if alphafdr ~= 0 + fprintf('ITC correction for multiple comparisons using FDR, alpha_fdr = %3.6f\n', alphafdr); + else fprintf('ITC correction for multiple comparisons using FDR, nothing significant\n', alphafdr); + end; + maskitc = exactp_itc <= alphafdr; + else + maskitc = exactp_itc <= g.alpha; + end + end; +end; + +% convert to log if necessary +% --------------------------- +if strcmpi(g.scale, 'log') + if ~isnan( g.baseline(1) ) && ~isnan( mbase(1) ) && strcmpi(g.trialbase, 'off'), mbase = log10(mbase)*10; end; + P = 10 * log10(P); + if ~isempty(Pboot) + Pboot = 10 * log10(Pboot); + end; +end; +if isempty(Pboot) && exist('maskersp') + Pboot = maskersp; +end; + +% auto scalling +% ------------- +if isempty(g.erspmax) + g.erspmax = [max(max(abs(P)))]/2; + if strcmpi(g.scale, 'abs') && strcmpi(g.basenorm, 'off') % % of baseline + g.erspmax = [max(max(abs(P)))]; + if g.erspmax > 1 + g.erspmax = [1-(g.erspmax-1) g.erspmax]; + else g.erspmax = [g.erspmax 1+(1-g.erspmax)]; + end; + end; + %g.erspmax = [-g.erspmax g.erspmax]+1; +end; + +% -------- +% plotting +% -------- +if strcmpi(g.plotersp, 'on') || strcmpi(g.plotitc, 'on') + if ndims(P) == 3 + P = squeeze(P(2,:,:,:)); + R = squeeze(R(2,:,:,:)); + mbase = squeeze(mbase(2,:)); + ERP = mean(squeeze(data(1,:,:)),2); + else + ERP = mean(data,2); + end; + if strcmpi(g.plottype, 'image') + plottimef(P, R, Pboot, Rboot, ERP, freqs, timesout, mbase, maskersp, maskitc, g); + else + plotallcurves(P, R, Pboot, Rboot, ERP, freqs, timesout, mbase, g); + end; +end; + +% -------------- +% format outputs +% -------------- +if strcmpi(g.outputformat, 'old') + R = abs(R); % convert coherence vector to magnitude + if strcmpi(g.scale, 'log'), mbase = 10^(mbase/10); end; +end; +if strcmpi(g.verbose, 'on') + disp('Note: Add output variables to command line call in history to'); + disp(' retrieve results and use the tftopo function to replot them'); +end; +mbase = mbase'; + +if ~isempty(g.caption) + h = textsc(g.caption, 'title'); + set(h, 'FontWeight', 'bold'); +end + +return; + +% ----------------- +% plotting function +% ----------------- +function g = plottimef(P, R, Pboot, Rboot, ERP, freqs, times, mbase, maskersp, maskitc, g); + +persistent showwarning; + +if isempty(showwarning) + warning( [ 'Some versions of Matlab crash on this function. If this is' 10 ... + 'the case, simply comment the code line 1655-1673 in newtimef.m' 10 ... + 'which aims at "ploting marginal ERSP mean below ERSP image"' ]); + showwarning = 1; +end; + +% +% compute ERP +% +ERPtimes = [g.tlimits(1):(g.tlimits(2)-g.tlimits(1))/(g.frames-1):g.tlimits(2)+0.000001]; +ERPindices = zeros(1, length(times)); +for ti=1:length(times) + [tmp ERPindices(ti)] = min(abs(ERPtimes-times(ti))); +end +ERPtimes = ERPtimes(ERPindices); % subset of ERP frames on t/f window centers +ERP = ERP(ERPindices); + +if ~isreal(R) + Rangle = angle(R); + Rsign = sign(imag(R)); + R = abs(R); % convert coherence vector to magnitude + setylim = 1; +else + Rangle = zeros(size(R)); % Ramon: if isreal(R) then we get an error because Rangle does not exist + Rsign = ones(size(R)); + setylim = 0; +end; +switch lower(g.plotitc) + case 'on', + switch lower(g.plotersp), + case 'on', ordinate1 = 0.67; ordinate2 = 0.1; height = 0.33; g.plot = 1; + case 'off', ordinate2 = 0.1; height = 0.9; g.plot = 1; + end; + case 'off', ordinate1 = 0.1; height = 0.9; + switch lower(g.plotersp), + case 'on', ordinate1 = 0.1; height = 0.9; g.plot = 1; + case 'off', g.plot = 0; + end; +end; + +if g.plot + % verboseprintf(g.verbose, '\nNow plotting...\n'); + set(gcf,'DefaultAxesFontSize',g.AXES_FONT) + colormap(jet(256)); + pos = get(gca,'position'); + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]; + axis off; +end; + +switch lower(g.plotersp) + case 'on' + % + %%%%%%% image the ERSP %%%%%%%%%%%%%%%%%%%%%%%%%% + % + + h(1) = axes('Position',[.1 ordinate1 .9 height].*s+q); + set(h(1), 'tag', 'ersp'); + + PP = P; + if strcmpi(g.scale, 'abs') && strcmpi(g.basenorm, 'off') + baseval = 1; + else baseval = 0; + end; + if ~isnan(g.alpha) + if strcmpi(g.pcontour, 'off') && ~isempty(maskersp) % zero out nonsignif. power differences + PP(~maskersp) = baseval; + %PP = PP .* maskersp; + elseif isempty(maskersp) + if size(PP,1) == size(Pboot,1) && size(PP,2) == size(Pboot,2) + PP(find(PP > Pboot(:,:,1) & (PP < Pboot(:,:,2)))) = baseval; + Pboot = squeeze(mean(Pboot,2)); + if size(Pboot,2) == 1, Pboot = Pboot'; end; + else + PP(find((PP > repmat(Pboot(:,1),[1 length(times)])) ... + & (PP < repmat(Pboot(:,2),[1 length(times)])))) = baseval; + end + end; + end; + + % find color limits + % ----------------- + if isempty(g.erspmax) + if g.ERSP_CAXIS_LIMIT == 0 + g.erspmax = [-1 1]*1.1*max(max(abs(P(:,:)))); + else + g.erspmax = g.ERSP_CAXIS_LIMIT*[-1 1]; + end + elseif length(g.erspmax) == 1 + g.erspmax = [ -g.erspmax g.erspmax]; + end + if isnan( g.baseline(1) ) && g.erspmax(1) < 0 + g.erspmax = [ min(min(P(:,:))) max(max(P(:,:)))]; + end; + + % plot image + % ---------- + if ~strcmpi(g.freqscale, 'log') + imagesc(times,freqs,PP(:,:), g.erspmax); + else + imagesclogy(times,freqs,PP(:,:),g.erspmax); + end; + set(gca,'ydir',g.hzdir); % make frequency ascend or descend + + % put contour for multiple comparison masking + if ~isempty(maskersp) && strcmpi(g.pcontour, 'on') + hold on; [tmpc tmph] = contour(times, freqs, maskersp); + set(tmph, 'linecolor', 'k', 'linewidth', 0.25) + end; + + hold on + plot([0 0],[0 freqs(end)],'--m','LineWidth',g.linewidth); % plot time 0 + if ~isnan(g.marktimes) % plot marked time + for mt = g.marktimes(:)' + plot([mt mt],[0 freqs(end)],'--k','LineWidth',g.linewidth); + end + end + hold off + set(h(1),'YTickLabel',[],'YTick',[]) + set(h(1),'XTickLabel',[],'XTick',[]) + if ~isempty(g.vert) + for index = 1:length(g.vert) + line([g.vert(index), g.vert(index)], [min(freqs) max(freqs)], 'linewidth', 1, 'color', 'm'); + end; + end; + + h(2) = gca; + h(3) = cbar('vert'); % ERSP colorbar axes + set(h(2),'Position',[.1 ordinate1 .8 height].*s+q) + set(h(3),'Position',[.95 ordinate1 .05 height].*s+q) + title([ 'ERSP(' g.unitpower ')' ]) + + % + %%%%% plot marginal ERSP mean below ERSP image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + h(4) = axes('Position',[.1 ordinate1-0.1 .8 .1].*s+q); + + E = [min(P(:,:),[],1);max(P(:,:),[],1)]; + + % plotting limits + if isempty(g.erspmarglim) + g.erspmarglim = [min(E(1,:))-max(max(abs(E)))/3 max(E(2,:))+max(max(abs(E)))/3]; + end; + + plot(times,E,[0 0],g.erspmarglim, '--m','LineWidth',g.linewidth) + xlim([min(times) max(times)]) + ylim(g.erspmarglim) + + tick = get(h(4),'YTick'); + set(h(4),'YTick',[tick(1) ; tick(end)]) + set(h(4),'YAxisLocation','right') + set(h(4),'TickLength',[0.020 0.025]); + xlabel('Time (ms)') + ylabel(g.unitpower) + + % + %%%%% plot mean spectrum to left of ERSP image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + h(5) = axes('Position',[0 ordinate1 .1 height].*s+q); + + if isnan(g.baseline) % Ramon :for bug 1657 + E = zeros(size(freqs)); + else + E = mbase; + end + + if ~isnan(E(1)) + + % plotting limits + if isempty(g.speclim) + % g.speclim = [min(E)-max(abs(E))/3 max(E)+max(abs(E))/3]; + g.speclim = [min(mbase)-max(abs(mbase))/3 max(mbase)+max(abs(mbase))/3]; % RMC: Just for plotting + end; + + % plot curves + if ~strcmpi(g.freqscale, 'log') + plot(freqs,E,'LineWidth',g.linewidth); hold on; + if ~isnan(g.alpha) && size(Pboot,2) == 2 + try + plot(freqs,Pboot(:,:)'+[E;E], 'g', 'LineWidth',g.linewidth) + plot(freqs,Pboot(:,:)'+[E;E], 'k:','LineWidth',g.linewidth) + catch + plot(freqs,Pboot(:,:)+[E E], 'g', 'LineWidth',g.linewidth) + plot(freqs,Pboot(:,:)+[E E], 'k:','LineWidth',g.linewidth) + end; + end + if freqs(1) ~= freqs(end), xlim([freqs(1) freqs(end)]); end; + if g.speclim(1) ~= g.speclim(2), ylim(g.speclim); end; % Ramon :for bug 1657 + + else % 'log' + semilogx(freqs,E,'LineWidth',g.linewidth); hold on; + if ~isnan(g.alpha) + try + semilogx(freqs,Pboot(:,:)'+[E;E],'g', 'LineWidth',g.linewidth) + semilogx(freqs,Pboot(:,:)'+[E;E],'k:','LineWidth',g.linewidth) + catch + semilogx(freqs,Pboot(:,:)+[E E],'g', 'LineWidth',g.linewidth) + semilogx(freqs,Pboot(:,:)+[E E],'k:','LineWidth',g.linewidth) + end; + end + if freqs(1) ~= freqs(end), xlim([freqs(1) freqs(end)]); end; + if g.speclim(1) ~= g.speclim(2), ylim(g.speclim); end; %RMC + set(h(5),'View',[90 90]) + divs = linspace(log(freqs(1)), log(freqs(end)), 10); + set(gca, 'xtickmode', 'manual'); + divs = ceil(exp(divs)); divs = unique_bc(divs); % ceil is critical here, round might misalign + set(gca, 'xtick', divs); + end; + set(h(5),'TickLength',[0.020 0.025]); + set(h(5),'View',[90 90]) + xlabel('Frequency (Hz)') + if strcmp(g.hzdir,'normal') + set(gca,'xdir','reverse'); + else + set(gca,'xdir','normal'); + end + ylabel(g.unitpower) + tick = get(h(5),'YTick'); + if (length(tick)>2) + set(h(5),'YTick',[tick(1) ; tick(end-1)]) + end + end; +end; + +switch lower(g.plotitc) + case 'on' + % + %%%%%%%%%%%% Image the ITC %%%%%%%%%%%%%%%%%% + % + h(6) = axes('Position',[.1 ordinate2 .9 height].*s+q); % ITC image + set(h(1), 'tag', 'itc'); + + if abs(R(1,1)-1) < 0.0001, g.plotphaseonly = 'on'; end; + if strcmpi(g.plotphaseonly, 'on') + RR = Rangle/pi*180; + else + RR = R; + end; + if ~isnan(g.alpha) + if ~isempty(maskitc) && strcmpi(g.pcontour, 'off') + RR = RR .* maskitc; + elseif isempty(maskitc) + if size(RR,1) == size(Rboot,1) && size(RR,2) == size(Rboot,2) + tmp = gcf; + if size(Rboot,3) == 2 RR(find(RR > Rboot(:,:,1) & RR < Rboot(:,:,2))) = 0; + else RR(find(RR < Rboot)) = 0; + end; + Rboot = mean(Rboot(:,:,end),2); + else + RR(find(RR < repmat(Rboot(:),[1 length(times)]))) = 0; + end; + end; + end + + if g.ITC_CAXIS_LIMIT == 0 + coh_caxis = min(max(max(R(:,:))),1)*[-1 1]; % 1 WAS 0.4 ! + else + coh_caxis = g.ITC_CAXIS_LIMIT*[-1 1]; + end + + if strcmpi(g.plotphaseonly, 'on') + if ~strcmpi(g.freqscale, 'log') + imagesc(times,freqs,RR(:,:)); % <--- + else + imagesclogy(times,freqs,RR(:,:)); % <--- + end; + g.itcmax = [-180 180]; + setylim = 0; + else + if max(coh_caxis) == 0, % toby 10.02.2006 + coh_caxis = [-1 1]; + end + if ~strcmpi(g.freqscale, 'log') + if exist('Rsign') && strcmp(g.plotphasesign, 'on') + imagesc(times,freqs,Rsign(:,:).*RR(:,:),coh_caxis); % <--- + else + imagesc(times,freqs,RR(:,:),coh_caxis); % <--- + end + else + if exist('Rsign') && strcmp(g.plotphasesign, 'on') + imagesclogy(times,freqs,Rsign(:,:).*RR(:,:),coh_caxis); % <--- + else + imagesclogy(times,freqs,RR(:,:),coh_caxis); % <--- + end + end; + end; + set(gca,'ydir',g.hzdir); % make frequency ascend or descend + + % plot contour if necessary + if ~isempty(maskitc) && strcmpi(g.pcontour, 'on') + hold on; [tmpc tmph] = contour(times, freqs, maskitc); + set(tmph, 'linecolor', 'k', 'linewidth', 0.25) + end; + + if isempty(g.itcmax) + g.itcmax = caxis; + elseif length(g.itcmax) == 1 + g.itcmax = [ -g.itcmax g.itcmax ]; + end; + caxis(g.itcmax); + + hold on + plot([0 0],[0 freqs(end)],'--m','LineWidth',g.linewidth); + if ~isnan(g.marktimes) + for mt = g.marktimes(:)' + plot([mt mt],[0 freqs(end)],'--k','LineWidth',g.linewidth); + end + end + hold off + set(h(6),'YTickLabel',[],'YTick',[]) + set(h(6),'XTickLabel',[],'XTick',[]) + if ~isempty(g.vert) + for index = 1:length(g.vert) + line([g.vert(index), g.vert(index)], [min(freqs) max(freqs)], 'linewidth', 1, 'color', 'm'); + end; + end; + + h(7) = gca; + h(8) = cbar('vert'); + %h(9) = get(h(8),'Children'); % make the function crash + set(h(7),'Position',[.1 ordinate2 .8 height].*s+q) + set(h(8),'Position',[.95 ordinate2 .05 height].*s+q) + if setylim + set(h(8),'YLim',[0 g.itcmax(2)]); + end; + if strcmpi(g.plotphaseonly, 'on') + title('ITC phase') + else + title('ITC') + end; + + % + %%%%% plot the ERP below the ITC image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + + h(10) = axes('Position',[.1 ordinate2-0.1 .8 .1].*s+q); % ERP + + if isempty(g.erplim) + ERPmax = max(ERP); + ERPmin = min(ERP); + g.erplim = [ ERPmin - 0.1*(ERPmax-ERPmin) ERPmax + 0.1*(ERPmax-ERPmin) ]; + end; + + plot(ERPtimes,ERP, [0 0],g.erplim,'--m','LineWidth',g.linewidth); + hold on; + plot([times(1) times(length(times))],[0 0], 'k'); + xlim([min(ERPtimes) max(ERPtimes)]); + ylim(g.erplim) + set(gca,'ydir',g.ydir); + + tick = get(h(10),'YTick'); + set(h(10),'YTick',[tick(1) ; tick(end)]) + set(h(10),'TickLength',[0.02 0.025]); + set(h(10),'YAxisLocation','right') + xlabel('Time (ms)') + ylabel('\muV') + if (~isempty(g.topovec)) + if length(g.topovec) ~= 1, ylabel(''); end; % ICA component + end; + E = nan_mean(R(:,:)'); % don't let a few NaN's crash this + + % + %%%%% plot the marginal mean left of the ITC image %%%%%%%%%%%%%%%%%%%%% + % + + h(11) = axes('Position',[0 ordinate2 .1 height].*s+q); % plot the marginal mean + % ITC left of the ITC image + % set plotting limits + if isempty(g.itcavglim) + if ~isnan(g.alpha) + g.itcavglim = [ min(E)-max(E)/3 max(Rboot)+max(Rboot)/3]; + else + g.itcavglim = [ min(E)-max(E)/3 max(E)+max(E)/3]; + end; + end; + if max(g.itcavglim) == 0 % toby 10.02.2006 + g.itcavglim = [-1 1]; + end + + % plot marginal ITC + if ~strcmpi(g.freqscale, 'log') + plot(freqs,E,'LineWidth',g.linewidth); hold on; + if ~isnan(g.alpha) + plot(freqs,Rboot,'g', 'LineWidth',g.linewidth) + plot(freqs,Rboot,'k:','LineWidth',g.linewidth) + end + if freqs(1) ~= freqs(end), xlim([freqs(1) freqs(end)]); end + ylim(g.itcavglim) + else + semilogx(freqs,E,'LineWidth',g.linewidth); hold on; + if ~isnan(g.alpha) + semilogx(freqs,Rboot(:),'g', 'LineWidth',g.linewidth) + semilogx(freqs,Rboot(:),'k:','LineWidth',g.linewidth) + end + if freqs(1) ~= freqs(end), xlim([freqs(1) freqs(end)]); end; + ylim(g.itcavglim) + divs = linspace(log(freqs(1)), log(freqs(end)), 10); + set(gca, 'xtickmode', 'manual'); + divs = ceil(exp(divs)); divs = unique_bc(divs); % ceil is critical here, round might misalign + set(gca, 'xtick', divs); + end; + + % ITC plot details + tick = get(h(11),'YTick'); + if length(tick) > 1 + set(h(11),'YTick',[tick(1) ; tick(length(tick))]) + end; + set(h(11),'View',[90 90]) + %set(h(11),'TickLength',[0.020 0.025]); + xlabel('Frequency (Hz)') + if strcmp(g.hzdir,'normal') + set(gca,'xdir','reverse'); + else + set(gca,'xdir','normal'); + end + ylabel('ERP') + +end; %switch + +% +%%%%%%%%%%%%%%% plot a topoplot() %%%%%%%%%%%%%%%%%%%%%%% +% +if (~isempty(g.topovec)) && strcmpi(g.plotitc, 'on') && strcmpi(g.plotersp, 'on') + + if strcmp(g.plotersp,'off') + h(12) = axes('Position',[-.207 .95 .2 .14].*s+q); % place the scalp map at top-left + else + h(12) = axes('Position',[-.1 .43 .2 .14].*s+q); % place the scalp map at middle-left + end; + if length(g.topovec) == 1 + topoplot(g.topovec,g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10, 'chaninfo', g.chaninfo); + else + topoplot(g.topovec,g.elocs,'electrodes','off', 'chaninfo', g.chaninfo); + end; + axis('square') +end + +if g.plot + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + if (length(g.title) > 0) && ~iscell(g.title) + axes('Position',pos,'Visible','Off'); + h(13) = text(-.05,1.01,g.title); + set(h(13),'VerticalAlignment','bottom') + set(h(13),'HorizontalAlignment','left') + set(h(13),'FontSize',g.TITLE_FONT); + end + + try, axcopy(gcf); catch, end; +end; + +% --------------- +% Plotting curves +% --------------- +function plotallcurves(P, R, Pboot, Rboot, ERP, freqs, times, mbase, g); + +if ~isreal(R) + Rangle = angle(R); + R = abs(R); % convert coherence vector to magnitude + setylim = 1; +else + Rangle = zeros(size(R)); % Ramon: if isreal(R) then we get an error because Rangle does not exist + Rsign = ones(size(R)); + setylim = 0; +end; + +if strcmpi(g.plotitc, 'on') | strcmpi(g.plotersp, 'on') + verboseprintf(g.verbose, '\nNow plotting...\n'); + pos = get(gca,'position'); + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]; +end; + +% time unit +% --------- +if times(end) > 10000 + times = times/1000; + timeunit = 's'; +else + timeunit = 'ms'; +end; + +if strcmpi(g.plotersp, 'on') + % + %%%%%%% image the ERSP %%%%%%%%%%%%%%%%%%%%%%%%%% + % + if strcmpi(g.plotitc, 'on'), subplot(2,1,1); end; + set(gca, 'tag', 'ersp'); + alllegend = {}; + + for index = 1:length(freqs) + alllegend{index} = [ num2str(freqs(index)) 'Hz baseline ' num2str(mbase(index)) ' dB' ]; + end; + if strcmpi(g.plotmean, 'on') && freqs(1) ~= freqs(end) + alllegend = { alllegend{:} [ num2str(freqs(1)) '-' num2str(freqs(end)) ... + 'Hz mean baseline ' num2str(mean(mbase)) ' dB' ] }; + end; + plotcurve(times, P, 'maskarray', Pboot, 'title', 'ERSP', ... + 'xlabel', [ 'Time (' timeunit ')' ], 'ylabel', 'dB', 'ylim', [-g.erspmax g.erspmax], ... + 'vert', g.vert, 'marktimes', g.marktimes, 'legend', alllegend, ... + 'linewidth', g.linewidth, 'highlightmode', g.highlightmode, 'plotmean', g.plotmean); +end; + +if strcmpi(g.plotitc, 'on') + % + %%%%%%%%%%%% Image the ITC %%%%%%%%%%%%%%%%%% + % + if strcmpi(g.plotersp, 'on'), subplot(2,1,2); end; + set(gca, 'tag', 'itc'); + if abs(R(1,1)-1) < 0.0001, g.plotphaseonly = 'on'; end; + if strcmpi(g.plotphaseonly, 'on') % plot ITC phase instead of amplitude (e.g. for continuous data) + RR = Rangle/pi*180; + else RR = R; + end; + + % find regions of significance + % ---------------------------- + alllegend = {}; + for index = 1:length(freqs) + alllegend{index} = [ num2str(freqs(index)) 'Hz baseline ' num2str(mbase(index)) ' dB' ]; + end; + if strcmpi(g.plotmean, 'on') && freqs(1) ~= freqs(end) + alllegend = { alllegend{:} [ num2str(freqs(1)) '-' num2str(freqs(end)) ... + 'Hz mean baseline ' num2str(mean(mbase)) ' dB' ] }; + end; + plotcurve(times, RR, 'maskarray', Rboot, 'val2mask', R, 'title', 'ITC', ... + 'xlabel', [ 'Time (' timeunit ')' ], 'ylabel', 'dB', 'ylim', g.itcmax, ... + 'vert', g.vert, 'marktimes', g.marktimes, 'legend', alllegend, ... + 'linewidth', g.linewidth, 'highlightmode', g.highlightmode, 'plotmean', g.plotmean); +end; + +if strcmpi(g.plotitc, 'on') | strcmpi(g.plotersp, 'on') + % + %%%%%%%%%%%%%%% plot a topoplot() %%%%%%%%%%%%%%%%%%%%%%% + % + if (~isempty(g.topovec)) + h(12) = axes('Position',[-.1 .43 .2 .14].*s+q); + if length(g.topovec) == 1 + topoplot(g.topovec,g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10); + else + topoplot(g.topovec,g.elocs,'electrodes','off'); + end; + axis('square') + end + + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + if (length(g.title) > 0) && ~iscell(g.title) + axes('Position',pos,'Visible','Off'); + h(13) = text(-.05,1.01,g.title); + set(h(13),'VerticalAlignment','bottom') + set(h(13),'HorizontalAlignment','left') + set(h(13),'FontSize',g.TITLE_FONT); + end + + try, axcopy(gcf); catch, end; +end; + +% +%%%%%%%%%%%%%%%%%%%%%%% Highlight regions %%%%%%%%%%%%%%%%%%%%%%%%%% +% +function highlight(ax, times, regions, highlightmode); +color1 = [0.75 0.75 0.75]; +color2 = [0 0 0]; +yl = ylim; + +if ~strcmpi(highlightmode, 'background') + yl2 = [ yl(1)-(yl(2)-yl(1))*0.15 yl(1)-(yl(2)-yl(1))*0.1 ]; + tmph = patch([times(1) times(end) times(end) times(1)], ... + [yl2(1) yl2(1) yl2(2) yl2(2)], [1 1 1]); hold on; + ylim([ yl2(1) yl(2)]); + set(tmph, 'edgecolor', [1 1 1]); +end; + +if ~isempty(regions) + axes(ax); + in_a_region = 0; + for index=1:length(regions) + if regions(index) && ~in_a_region + tmpreg(1) = times(index); + in_a_region = 1; + end; + if ~regions(index) && in_a_region + tmpreg(2) = times(index); + in_a_region = 0; + if strcmpi(highlightmode, 'background') + tmph = patch([tmpreg(1) tmpreg(2) tmpreg(2) tmpreg(1)], ... + [yl(1) yl(1) yl(2) yl(2)], color1); hold on; + set(tmph, 'edgecolor', color1); + else + tmph = patch([tmpreg(1) tmpreg(2) tmpreg(2) tmpreg(1)], ... + [yl2(1) yl2(1) yl2(2) yl2(2)], color2); hold on; + set(tmph, 'edgecolor', color2); + end; + end; + end; +end; + +% reshaping data +% ----------- +function [data, frames] = reshape_data(data, frames) +data = squeeze(data); +if min(size(data)) == 1 + if (rem(length(data),frames) ~= 0) + error('Length of data vector must be divisible by frames.'); + end + data = reshape(data, frames, length(data)/frames); +else + frames = size(data,1); +end + +function verboseprintf(verbose, varargin) +if strcmpi(verbose, 'on') + fprintf(varargin{:}); +end; + +% reshaping data +% ----------- +function pvals = compute_pvals(oridat, surrog, tail) + + if nargin < 3 + tail = 'both'; + end; + + if myndims(oridat) > 1 + if size(oridat,2) ~= size(surrog, 2) | myndims(surrog) == 2 + if size(oridat,1) == size(surrog, 1) + surrog = repmat( reshape(surrog, [size(surrog,1) 1 size(surrog,2)]), [1 size(oridat,2) 1]); + elseif size(oridat,2) == size(surrog, 1) + surrog = repmat( reshape(surrog, [1 size(surrog,1) size(surrog,2)]), [size(oridat,1) 1 1]); + else + error('Permutation statistics array size error'); + end; + end; + end; + + surrog = sort(surrog, myndims(surrog)); % sort last dimension + + if myndims(surrog) == 1 + surrog(end+1) = oridat; + elseif myndims(surrog) == 2 + surrog(:,end+1) = oridat; + elseif myndims(surrog) == 3 + surrog(:,:,end+1) = oridat; + else + surrog(:,:,:,end+1) = oridat; + end; + + [tmp idx] = sort( surrog, myndims(surrog) ); + [tmp mx] = max( idx,[], myndims(surrog)); + + len = size(surrog, myndims(surrog) ); + pvals = 1-(mx-0.5)/len; + if strcmpi(tail, 'both') + pvals = min(pvals, 1-pvals); + pvals = 2*pvals; + end; + +function val = myndims(a) + if ndims(a) > 2 + val = ndims(a); + else + if size(a,1) == 1, + val = 2; + elseif size(a,2) == 1, + val = 1; + else + val = 2; + end; + end; + + diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/pac.m b/code/eeglab13_4_4b/functions/timefreqfunc/pac.m new file mode 100644 index 0000000..8c845f0 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/pac.m @@ -0,0 +1,426 @@ +% pac() - compute phase-amplitude coupling (power of first input +% correlation with phase of second). There is no graphical output +% to this function. +% +% Usage: +% >> pac(x,y,srate); +% >> [coh,timesout,freqsout1,freqsout2,cohboot] ... +% = pac(x,y,srate,'key1', 'val1', 'key2', val2' ...); +% Inputs: +% x = [float array] 2-D data array of size (times,trials) or +% 3-D (1,times,trials) +% y = [float array] 2-D or 3-d data array +% srate = data sampling rate (Hz) +% +% Most important optional inputs +% 'method' = ['mod'|'corrsin'|'corrcos'|'latphase'] modulation +% method or correlation of amplitude with sine or cosine of +% angle (see ref). 'laphase' compute the phase +% histogram at a specific time and requires the +% 'powerlat' option to be set. +% 'freqs' = [min max] frequency limits. Default [minfreq 50], +% minfreq being determined by the number of data points, +% cycles and sampling frequency. Use 0 for minimum frequency +% to compute default minfreq. You may also enter an +% array of frequencies for the spectral decomposition +% (for FFT, closest computed frequency will be returned; use +% 'padratio' to change FFT freq. resolution). +% 'freqs2' = [float array] array of frequencies for the second +% argument. 'freqs' is used for the first argument. +% By default it is the same as 'freqs'. +% 'wavelet' = 0 -> Use FFTs (with constant window length) { Default } +% = >0 -> Number of cycles in each analysis wavelet +% = [cycles expfactor] -> if 0 < expfactor < 1, the number +% of wavelet cycles expands with frequency from cycles +% If expfactor = 1, no expansion; if = 0, constant +% window length (as in FFT) {default wavelet: 0} +% = [cycles array] -> cycle for each frequency. Size of array +% must be the same as the number of frequencies +% {default cycles: 0} +% 'wavelet2' = same as 'wavelet' for the second argument. Default is +% same as cycles. Note that if the lowest frequency for X +% and Y are different and cycle is [cycles expfactor], it +% may result in discrepencies in the number of cycles at +% the same frequencies for X and Y. +% 'ntimesout' = Number of output times (int0: *longest* window length to use. This +% determines the lowest output frequency. Note that this +% parameter is overwritten if the minimum frequency has been set +% manually and requires a longer time window {~frames/8} +% 'padratio' = FFT-length/winframes (2^k) {2} +% Multiplies the number of output frequencies by dividing +% their spacing (standard FFT padding). When cycles~=0, +% frequency spacing is divided by padratio. +% 'nfreqs' = number of output frequencies. For FFT, closest computed +% frequency will be returned. Overwrite 'padratio' effects +% for wavelets. Default: use 'padratio'. +% 'freqscale' = ['log'|'linear'] frequency scale. Default is 'linear'. +% Note that for obtaining 'log' spaced freqs using FFT, +% closest correspondant frequencies in the 'linear' space +% are returned. +% 'subitc' = ['on'|'off'] subtract stimulus locked Inter-Trial Coherence +% (ITC) from x and y. This computes the 'intrinsic' coherence +% x and y not arising from common synchronization to +% experimental events. See notes. {default: 'off'} +% 'itctype' = ['coher'|'phasecoher'] For use with 'subitc', see timef() +% for more details {default: 'phasecoher'}. +% 'subwin' = [min max] sub time window in ms (this windowing is +% performed after the spectral decomposition). +% +% Outputs: +% pac = Matrix (nfreqs1,nfreqs2,timesout) of coherence (complex). +% Use 20*log(abs(crossfcoh)) to vizualize log spectral diffs. +% timesout = Vector of output times (window centers) (ms). +% freqsout1 = Vector of frequency bin centers for first argument (Hz). +% freqsout2 = Vector of frequency bin centers for second argument (Hz). +% alltfX = single trial spectral decomposition of X +% alltfY = single trial spectral decomposition of Y +% +% Author: Arnaud Delorme, SCCN/INC, UCSD 2005- +% +% Ref: Testing for Nested Oscilations (2008) J Neuro Methods 174(1):50-61 +% +% See also: timefreq(), crossf() + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [crossfcoh, timesout1, freqs1, freqs2, crossfcohall, alltfX, alltfY] = pac(X, Y, srate, varargin); + +if nargin < 1 + help pac; + return; +end; + +% deal with 3-D inputs +% -------------------- +if ndims(X) == 3, X = reshape(X, size(X,2), size(X,3)); end; +if ndims(Y) == 3, Y = reshape(Y, size(Y,2), size(Y,3)); end; +frame = size(X,2); + +g = finputcheck(varargin, ... + { 'alpha' 'real' [0 0.2] []; + 'baseboot' 'float' [] 0; + 'boottype' 'string' {'times','trials','timestrials'} 'timestrials'; + 'detrend' 'string' {'on','off'} 'off'; + 'freqs' 'real' [0 Inf] [0 srate/2]; + 'freqs2' 'real' [0 Inf] []; + 'freqscale' 'string' { 'linear','log' } 'linear'; + 'itctype' 'string' {'phasecoher','phasecoher2','coher'} 'phasecoher'; + 'nfreqs' 'integer' [0 Inf] []; + 'lowmem' 'string' {'on','off'} 'off'; + 'method' 'string' { 'mod','corrsin','corrcos','latphase' } 'mod'; + 'naccu' 'integer' [1 Inf] 250; + 'newfig' 'string' {'on','off'} 'on'; + 'padratio' 'integer' [1 Inf] 2; + 'rmerp' 'string' {'on','off'} 'off'; + 'rboot' 'real' [] []; + 'subitc' 'string' {'on','off'} 'off'; + 'subwin' 'real' [] []; ... + 'gammapowerlim' 'real' [] []; ... + 'powerlim' 'real' [] []; ... + 'powerlat' 'real' [] []; ... + 'gammabase' 'real' [] []; ... + 'timesout' 'real' [] []; ... + 'ntimesout' 'integer' [] 200; ... + 'tlimits' 'real' [] [0 frame/srate]; + 'title' 'string' [] ''; + 'vert' { 'real','cell' } [] []; + 'wavelet' 'real' [0 Inf] 0; + 'wavelet2' 'real' [0 Inf] []; + 'winsize' 'integer' [0 Inf] max(pow2(nextpow2(frame)-3),4) }, 'pac'); + +if isstr(g), error(g); end; + +% more defaults +% ------------- +if isempty(g.wavelet2), g.wavelet2 = g.wavelet; end; +if isempty(g.freqs2), g.freqs2 = g.freqs; end; + +% remove ERP if necessary +% ----------------------- +X = squeeze(X); +Y = squeeze(Y);X = squeeze(X); +trials = size(X,2); +if strcmpi(g.rmerp, 'on') + X = X - repmat(mean(X,2), [1 trials]); + Y = Y - repmat(mean(Y,2), [1 trials]); +end; + +% perform timefreq decomposition +% ------------------------------ +[alltfX freqs1 timesout1] = timefreq(X, srate, 'ntimesout', g.ntimesout, 'timesout', g.timesout, 'winsize', g.winsize, ... + 'tlimits', g.tlimits, 'detrend', g.detrend, 'itctype', g.itctype, ... + 'subitc', g.subitc, 'wavelet', g.wavelet, 'padratio', g.padratio, ... + 'freqs', g.freqs, 'freqscale', g.freqscale, 'nfreqs', g.nfreqs); +[alltfY freqs2 timesout2] = timefreq(Y, srate, 'ntimesout', g.ntimesout, 'timesout', g.timesout, 'winsize', g.winsize, ... + 'tlimits', g.tlimits, 'detrend', g.detrend, 'itctype', g.itctype, ... + 'subitc', g.subitc, 'wavelet', g.wavelet2, 'padratio', g.padratio, ... + 'freqs', g.freqs2, 'freqscale', g.freqscale, 'nfreqs', g.nfreqs); + +% check time limits +% ----------------- +if ~isempty(g.subwin) + ind1 = find(timesout1 > g.subwin(1) & timesout1 < g.subwin(2)); + ind2 = find(timesout2 > g.subwin(1) & timesout2 < g.subwin(2)); + alltfX = alltfX(:, ind1, :); + alltfY = alltfY(:, ind2, :); + timesout1 = timesout1(ind1); + timesout2 = timesout2(ind2); +end; +if length(timesout1) ~= length(timesout2) | any( timesout1 ~= timesout2) + disp('Warning: Time points are different for X and Y. Use ''timesout'' to specify common time points'); + [vals ind1 ind2 ] = intersect_bc(timesout1, timesout2); + fprintf('Searching for common time points: %d found\n', length(vals)); + if length(vals) < 10, error('Less than 10 common data points'); end; + timesout1 = vals; + timesout2 = vals; + alltfX = alltfX(:, ind1, :); + alltfY = alltfY(:, ind2, :); +end; + +% scan accross frequency and time +% ------------------------------- +%if isempty(g.alpha) +% disp('Warning: if significance mask is not applied, result might be slightly') +% disp('different (since angle is not made uniform and amplitude interpolated)') +%end; + +cohboot =[]; +if ~strcmpi(g.method, 'latphase') + for find1 = 1:length(freqs1) + for find2 = 1:length(freqs2) + for ti = 1:length(timesout1) + + % get data + % -------- + tmpalltfx = squeeze(alltfX(find1,ti,:)); + tmpalltfy = squeeze(alltfY(find2,ti,:)); + + %if ~isempty(g.alpha) + % tmpalltfy = angle(tmpalltfy); + % tmpalltfx = abs( tmpalltfx); + % [ tmp cohboot(find1,find2,ti,:) newamp newangle ] = ... + % bootcircle(tmpalltfx, tmpalltfy, 'naccu', g.naccu); + % crossfcoh(find1,find2,ti) = sum ( newamp .* exp(j*newangle) ); + %else + tmpalltfy = angle(tmpalltfy); + tmpalltfx = abs( tmpalltfx); + if strcmpi(g.method, 'mod') + crossfcoh(find1,find2,ti) = sum( tmpalltfx .* exp(j*tmpalltfy) ); + elseif strcmpi(g.method, 'corrsin') + tmp = corrcoef( sin(tmpalltfy), tmpalltfx); + crossfcoh(find1,find2,ti) = tmp(2); + else + tmp = corrcoef( cos(tmpalltfy), tmpalltfx); + crossfcoh(find1,find2,ti) = tmp(2); + end; + end; + end; + end; +elseif 1 + % this option computes power at a given latency + % then computes the same as above (vectors) + + %if isempty(g.powerlat) + % error('You need to specify a latency for the ''powerlat'' option'); + %end; + + gammapower = mean(10*log10(alltfX(:,:,:).*conj(alltfX)),1); % average all frequencies for power + if isempty(g.gammapowerlim) + g.gammapowerlim = [ min(gammapower(:)) max(gammapower(:)) ]; + end; + fprintf('Gamma power limits: %3.2f to %3.2f\n', g.gammapowerlim(1), g.gammapowerlim(2)); + power = 10*log10(alltfY(:,:,:).*conj(alltfY)); + if isempty(g.powerlim) + for freq = 1:size(power,1) + g.powerlim(freq,:) = [ min(power(freq,:)) max(power(freq,:)) ]; + end; + end; + for freq = 1:size(power,1) + fprintf('Freq %d power limits: %3.2f to %3.2f\n', freqs2(freq), g.powerlim(freq,1), g.powerlim(freq,2)); + end; + + % power plot + %figure; plot(timesout2/1000, (mean(power(9,:,:),3)-mean(power(9,:)))/50); + %hold on; plot(linspace(0, length(Y)/srate, length(Y)), mean(Y'), 'g'); + + % phase with power + % figure; plot(timesout2/1000, (mean(phaseangle(9,:,:),3)-mean(phaseangle(9,:)))/50); + % hold on; plot(timesout1/1000, (mean(gammapower,3)-mean(gammapower(:)))/100, 'r'); + %figure; plot((mean(phaseangle(9,:,:),3)-mean(phaseangle(9,:)))/50+j*(mean(gammapower,3)-mean(gammapower(:)))/100, '.'); + + matsize = 32; + matcenter = (matsize-1)/2+1; + matrixfinalgammapower = zeros(size(alltfY,1),size(alltfX,3),matsize,matsize); + matrixfinalcount = zeros(size(alltfY,1),size(alltfX,3),matsize,matsize); + + % get power indices + if isempty(g.gammabase) + g.gammabase = mean(gammapower(:)); + end; + fprintf('Gamma power average: %3.2f\n', g.gammabase); + gammapoweradd = gammapower-g.gammabase; + gammapower = floor((gammapower-g.gammapowerlim(1))/(g.gammapowerlim(2)-g.gammapowerlim(1))*(matsize-2))+1; + phaseangle = angle(alltfY); + posx = zeros(size(power)); + posy = zeros(size(power)); + for freq = 1:length(freqs2) + fprintf('Processing frequency %3.2f\n', freqs2(freq)); + power(freq,:,:) = (power(freq,:,:)-g.powerlim(freq,1))/(g.powerlim(freq,2)-g.powerlim(freq,1))*(matsize-3)/2+1; + complexval = power(freq,:,:).*exp(j*phaseangle(freq,:,:)); + posx(freq,:,:) = round(real(complexval)+matcenter); + posy(freq,:,:) = round(imag(complexval)+matcenter); + for trial = 1:size(alltfX,3) % scan trials + for time = 1:size(alltfX,2) + %matrixfinal(freq,posx(freq,time,trial),posy(freq,time,trial),gammapower(1,time,trial)) = ... + % matrixfinal(freq,posx(freq,time,trial),posy(freq,time,trial),gammapower(1,time,trial))+1; + matrixfinalgammapower(freq,trial,posx(freq,time,trial),posy(freq,time,trial)) = ... + matrixfinalgammapower(freq,trial,posx(freq,time,trial),posy(freq,time,trial))+gammapoweradd(1,time,trial); + matrixfinalcount(freq,trial,posx(freq,time,trial),posy(freq,time,trial)) = ... + matrixfinalcount(freq,trial,posx(freq,time,trial),posy(freq,time,trial))+1; + end; + end; + %matrixfinal(freq,:,:,:) = convn(squeeze(matrixfinal(freq,:,:,:)), gs, 'same'); + %tmpmat = posx(index,:)+(posy(index,:)-1)*64+(gammapower(:)-1)*64*64; + matrixfinalcount(freq, find(matrixfinalcount(freq,:) == 0)) = 1; + matrixfinalgammapower(freq,:,:,:) = matrixfinalgammapower(freq,:,:,:)./matrixfinalcount(freq,:,:,:); + end; + + % average and smooth + matrixfinalgammapowermean = squeeze(mean(matrixfinalgammapower,2)); + for freq = 1:length(freqs2) + matrixfinalgammapowermean(freq,:,:) = conv2(squeeze(matrixfinalgammapowermean(freq,:,:)), gauss2d(5,5), 'same'); + end; + %matrixfinalgammapower = matrixfinalgammapower/size(alltfX,3)/size(alltfX,2); + + %vect = linspace(-pi,pi,50); + %for f = 1:length(freqs2) + % crossfcoh(f,:) = hist(tmpalltfy(f,:), vect); + %end; + + % smoothing of output image + % ------------------------- + %gs = gauss2d(6, 6, 6); + %crossfcoh = convn(crossfcoh, gs, 'same'); + %freqs1 = freqs2; + %timesout1 = linspace(-180, 180, size(crossfcoh,2)); + + crossfcoh = matrixfinalgammapowermean; + crossfcohall = matrixfinalgammapower; + +else + % this option computes power at a given latency + % then computes the same as above (vectors) + + %if isempty(g.powerlat) + % error('You need to specify a latency for the ''powerlat'' option'); + %end; + + gammapower = mean(10*log10(alltfX(:,:,:).*conj(alltfX)),1); % average all frequencies for power + if isempty(g.gammapowerlim) + g.gammapowerlim = [ min(gammapower(:)) max(gammapower(:)) ]; + end; + power = 10*log10(alltfY(:,:,:).*conj(alltfY)); + if isempty(g.powerlim) + for freq = 1:size(power,1) + g.powerlim(freq,:) = [ min(power(freq,:)) max(power(freq,:)) ]; + end; + end; + + % power plot + %figure; plot(timesout2/1000, (mean(power(9,:,:),3)-mean(power(9,:)))/50); + %hold on; plot(linspace(0, length(Y)/srate, length(Y)), mean(Y'), 'g'); + + % phase with power + % figure; plot(timesout2/1000, (mean(phaseangle(9,:,:),3)-mean(phaseangle(9,:)))/50); + % hold on; plot(timesout1/1000, (mean(gammapower,3)-mean(gammapower(:)))/100, 'r'); + %figure; plot((mean(phaseangle(9,:,:),3)-mean(phaseangle(9,:)))/50+j*(mean(gammapower,3)-mean(gammapower(:)))/100, '.'); + + matsize = 64; + matcenter = (matsize-1)/2+1; + matrixfinal = zeros(size(alltfY,1),64,64,64); + matrixfinalgammapower = zeros(size(alltfY,1),matsize,matsize); + matrixfinalcount = zeros(size(alltfY,1),matsize,matsize); + + % get power indices + gammapoweradd = gammapower-mean(gammapower(:)); + gammapower = floor((gammapower-g.gammapowerlim(1))/(g.gammapowerlim(2)-g.gammapowerlim(1))*(matsize-1))+1; + phaseangle = angle(alltfY); + posx = zeros(size(power)); + posy = zeros(size(power)); + gs = gauss3d(6, 6, 6); + for freq = 1:size(alltfY) + fprintf('Processing frequency %3.2f\n', freqs2(freq)); + power(freq,:,:) = (power(freq,:,:)-g.powerlim(freq,1))/(g.powerlim(freq,2)-g.powerlim(freq,1))*(matsize-2)/2; + complexval = power(freq,:,:).*exp(j*phaseangle(freq,:,:)); + posx(freq,:,:) = round(real(complexval)+matcenter); + posy(freq,:,:) = round(imag(complexval)+matcenter); + for trial = 1:size(alltfX,3) % scan trials + for time = 1:size(alltfX,2) + %matrixfinal(freq,posx(freq,time,trial),posy(freq,time,trial),gammapower(1,time,trial)) = ... + % matrixfinal(freq,posx(freq,time,trial),posy(freq,time,trial),gammapower(1,time,trial))+1; + matrixfinalgammapower(freq,posx(freq,time,trial),posy(freq,time,trial)) = ... + matrixfinalgammapower(freq,posx(freq,time,trial),posy(freq,time,trial))+gammapoweradd(1,time,trial); + matrixfinalcount(freq,posx(freq,time,trial),posy(freq,time,trial)) = ... + matrixfinalcount(freq,posx(freq,time,trial),posy(freq,time,trial))+1; + end; + end; + %matrixfinal(freq,:,:,:) = convn(squeeze(matrixfinal(freq,:,:,:)), gs, 'same'); + %tmpmat = posx(index,:)+(posy(index,:)-1)*64+(gammapower(:)-1)*64*64; + matrixfinalcount(freq, find(matrixfinalcount(freq,:) == 0)) = 1; + matrixfinalgammapower(freq,:,:) = matrixfinalgammapower(freq,:,:)./matrixfinalcount(freq, :,:); + matrixfinalgammapower(freq,:,:) = conv2(squeeze(matrixfinalgammapower(freq,:,:)), gauss2d(5,5), 'same'); + end; + %matrixfinalgammapower = matrixfinalgammapower/size(alltfX,3)/size(alltfX,2); + + %vect = linspace(-pi,pi,50); + %for f = 1:length(freqs2) + % crossfcoh(f,:) = hist(tmpalltfy(f,:), vect); + %end; + + % smoothing of output image + % ------------------------- + %gs = gauss2d(6, 6, 6); + %crossfcoh = convn(crossfcoh, gs, 'same'); + %freqs1 = freqs2; + %timesout1 = linspace(-180, 180, size(crossfcoh,2)); + + crossfcoh = matrixfinalgammapower; + +end; + +% 7/31/2014 Ramon: crossfcohall sometimes does not exist depending on choice of input options +if ~exist('crossfcohall', 'var') + crossfcohall = []; +end + + diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/pac_cont.m b/code/eeglab13_4_4b/functions/timefreqfunc/pac_cont.m new file mode 100644 index 0000000..419cd78 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/pac_cont.m @@ -0,0 +1,419 @@ +% pac_cont() - compute phase-amplitude coupling (power of first input +% correlation with phase of second). There is no graphical output +% to this function. +% +% Usage: +% >> pac_cont(x,y,srate); +% >> [pac timesout pvals] = pac_cont(x,y,srate,'key1', 'val1', 'key2', val2' ...); +% +% Inputs: +% x = [float array] 1-D data vector of size (1xtimes) +% y = [float array] 1-D data vector of size (1xtimes) +% srate = data sampling rate (Hz) +% +% Optional time information intputs: +% 'winsize' = If cycles==0: data subwindow length (fastest, 2^n0: *longest* window length to use. This +% determines the lowest output frequency. Note that this +% parameter is overwritten if the minimum frequency has been set +% manually and requires a longer time window {~frames/8} +% 'ntimesout' = Number of output times (int 1, X = X'; end; +if size(Y,1) > 1, Y = Y'; end; +if size(X,1) ~= 1 || size(Y,1) ~= 1, error('Cannot only process vector input'); end; +frame = size(X,2); +pvals = []; + +g = finputcheck(varargin, ... + { ... + 'alpha' 'real' [0 0.2] []; + 'baseline' 'float' [] []; + 'freqphase' 'real' [0 Inf] [0 srate/2]; + 'freqamp' 'real' [0 Inf] []; + 'mcorrect' 'string' { 'none' 'fdr' } 'none'; + 'method' 'string' { 'plv' 'modulation' 'glm' 'corr' } 'modulation'; + 'naccu' 'integer' [1 Inf] 250; + 'instantstat' 'string' {'on','off'} 'off'; + 'newfig' 'string' {'on','off'} 'on'; + 'nofig' 'string' {'on','off'} 'off'; + 'statlim' 'string' {'surrogate','parametric'} 'parametric'; + 'timesout' 'real' [] []; ... + 'filterfunc' 'string' { 'eegfilt' 'iirfilt' 'eegfiltfft' } 'eegfiltfft'; ... + 'filterphase' '' {} []; + 'filteramp' '' {} []; + 'ntimesout' 'integer' [] 200; ... + 'tlimits' 'real' [] [0 frame/srate]; + 'title' 'string' [] ''; + 'vert' 'real' [] []; + 'winsize' 'integer' [0 Inf] max(pow2(nextpow2(frame)-3),4) }, 'pac'); + +if isstr(g), error(g); end; + +if ~isempty(g.filterphase) + x_freqphase = feval(g.filterphase, X(:)'); +else x_freqphase = feval(g.filterfunc, X(:)', srate, g.freqphase(1), g.freqphase(end)); +end; +if ~isempty(g.filteramp) + x_freqamp = feval(g.filteramp, Y(:)'); +else x_freqamp = feval(g.filterfunc, Y(:)', srate, g.freqamp( 1), g.freqamp( end)); +end; +z_phasedata = hilbert(x_freqphase); +z_ampdata = hilbert(x_freqamp); +phase = angle(z_phasedata); +amplitude = abs( z_ampdata); +z = amplitude.*exp(i*phase); % this is the pac measure + +% get time windows +% ---------------- +g.verbose = 'on'; +g.causal = 'off'; +[ timesout1 indexout ] = gettimes(frame, g.tlimits, g.timesout, g.winsize, g.ntimesout, g.causal, g.verbose); + +% scan time windows +% ----------------- +if ~isempty(g.alpha) + m_raw = zeros(1,length(indexout)); + pvals = zeros(1,length(indexout)); +end; +fprintf('Computing PAC:\n'); +for iWin = 1:length(indexout) + x_phaseEpoch = x_freqphase(indexout(iWin)+[-g.winsize/2+1:g.winsize/2]); + x_ampEpoch = x_freqamp( indexout(iWin)+[-g.winsize/2+1:g.winsize/2]); + z_phaseEpoch = z_phasedata(indexout(iWin)+[-g.winsize/2+1:g.winsize/2]); + z_ampEpoch = z_ampdata( indexout(iWin)+[-g.winsize/2+1:g.winsize/2]); + z_epoch = z( indexout(iWin)+[-g.winsize/2+1:g.winsize/2]); + + numpoints=length(x_phaseEpoch); + if rem(iWin,10) == 0, verboseprintf(g.verbose, ' %d',iWin); end + if rem(iWin,120) == 0, verboseprintf(g.verbose, '\n'); end + + % Choose method + % ------------- + if strcmpi(g.method, 'modulation') + + % Modulation index + m_raw(iWin) = abs(sum(z_epoch))/numpoints; + + elseif strcmpi(g.method, 'plv') + + if iWin == 145 + %dsfsd; + end; + + %amplitude_filt = sgolayfilt(amplitude, 3, 101); + if ~isempty(g.filterphase) + amplitude_filt = feval(g.filterphase, z_ampEpoch); + else amplitude_filt = feval(g.filterfunc , z_ampEpoch, srate, g.freqphase(1), g.freqphase(end)); + end; + z_amplitude_filt = hilbert(amplitude_filt); + + phase_amp_modulation = angle(z_amplitude_filt); + m_raw(iWin) = abs(sum(exp(i*(x_phaseEpoch - phase_amp_modulation)))/numpoints); + + elseif strcmpi(g.method, 'corr') + + if iWin == inf %145 + figure; plot(abs(z_ampdata)) + hold on; plot(x_phasedata/10000000000, 'r') + x = X(indexout(iWin)+[-g.winsize/2+1:g.winsize/2]); + hold on; plot(x, 'g'); + dsfsd; + end; + [r_ESC pval_corr] = corrcoef(x_phaseEpoch, abs(z_ampEpoch)); + m_raw(iWin) = r_ESC(1,2); + pvals(iWin) = pval_corr(1,2); + + elseif strcmpi(g.method, 'glm') + + [b dev stats] = glmfit(x_phaseEpoch', abs(z_ampEpoch)', 'normal'); + GLM_beta = stats.beta(2,1); + pvals(iWin) = stats.p(2,1); + m_raw(iWin) = b(1); + + end; + + %% compute statistics (instantaneous) + % ----------------------------------- + if ~isempty(g.alpha) && strcmpi(g.instantstat, 'on') && ~strcmpi(g.method, 'corr') && ~strcmpi(g.method, 'glm') + + % compute surrogate values + numsurrogate=g.naccu; + minskip=srate; + maxskip=numpoints-srate; % max variation half a second + if maxskip < 1 + error('Window size shorter than 1 second; too short for computing surrogate data'); + end; + skip=ceil(numpoints.*rand(numsurrogate*4,1)); + skip(skip>maxskip)=[]; + skip(skip= g.baseline(1) & timesout1 <= g.baseline(end)); + + m_raw_base = abs(m_raw(baselineInd)); + + if strcmpi(g.statlim, 'surrogate') + for index = 1:length(m_raw) + pvals(index) = stat_surrogate_pvals(m_raw_base, m_raw(index), 'upper'); + end; + else + [surrogate_mean,surrogate_std]=normfit(m_raw_base); + m_norm_length=(abs(m_raw)-surrogate_mean)/surrogate_std; + pvals = normcdf(0, m_norm_length, 1); + end; + if strcmpi(g.mcorrect, 'fdr') + pvals = fdr(pvals); + end; +end; + +%% plot results +% ------------- +if strcmpi(g.nofig, 'on') + return +end; +if strcmpi(g.newfig, 'on') + figure; +end; +if ~isempty(g.alpha) + plotcurve(timesout1, m_raw, 'maskarray', pvals < g.alpha); +else plotcurve(timesout1, m_raw); +end; +xlabel('Time (ms)'); +ylabel('PAC (0 to 1)'); +title(g.title); + +% plot vertical lines +% ------------------- +if ~isempty(g.vert) + hold on; + yl = ylim; + for index = 1:length(g.vert) + plot([g.vert(index) g.vert(index)], yl, 'g'); + end; +end; + +% ------------- +% gettime function identical to timefreq function +% DO NOT MODIFY +% ------------- +function [ timevals, timeindices ] = gettimes(frames, tlimits, timevar, winsize, ntimevar, causal, verbose); +timevect = linspace(tlimits(1), tlimits(2), frames); +srate = 1000*(frames-1)/(tlimits(2)-tlimits(1)); + +if isempty(timevar) % no pre-defined time points + if ntimevar(1) > 0 + % generate linearly space vector + % ------------------------------ + if (ntimevar > frames-winsize) + ntimevar = frames-winsize; + if ntimevar < 0 + error('Not enough data points, reduce the window size or lowest frequency'); + end; + verboseprintf(verbose, ['Value of ''timesout'' must be <= frame-winsize, ''timesout'' adjusted to ' int2str(ntimevar) '\n']); + end + npoints = ntimevar(1); + wintime = 500*winsize/srate; + if strcmpi(causal, 'on') + timevals = linspace(tlimits(1)+2*wintime, tlimits(2), npoints); + else timevals = linspace(tlimits(1)+wintime, tlimits(2)-wintime, npoints); + end; + verboseprintf(verbose, 'Generating %d time points (%1.1f to %1.1f ms)\n', npoints, min(timevals), max(timevals)); + else + % subsample data + % -------------- + nsub = -ntimevar(1); + if strcmpi(causal, 'on') + timeindices = [ceil(winsize+nsub):nsub:length(timevect)]; + else timeindices = [ceil(winsize/2+nsub/2):nsub:length(timevect)-ceil(winsize/2)-1]; + end; + timevals = timevect( timeindices ); % the conversion at line 741 leaves timeindices unchanged + verboseprintf(verbose, 'Subsampling by %d (%1.1f to %1.1f ms)\n', nsub, min(timevals), max(timevals)); + end; +else + timevals = timevar; + % check boundaries + % ---------------- + wintime = 500*winsize/srate; + if strcmpi(causal, 'on') + tmpind = find( (timevals >= tlimits(1)+2*wintime-0.0001) & (timevals <= tlimits(2)) ); + else tmpind = find( (timevals >= tlimits(1)+wintime-0.0001) & (timevals <= tlimits(2)-wintime+0.0001) ); + end; + % 0.0001 account for numerical innacuracies on opteron computers + if isempty(tmpind) + error('No time points. Reduce time window or minimum frequency.'); + end; + if length(timevals) ~= length(tmpind) + verboseprintf(verbose, 'Warning: %d out of %d time values were removed (now %3.2f to %3.2f ms) so the lowest\n', ... + length(timevals)-length(tmpind), length(timevals), timevals(tmpind(1)), timevals(tmpind(end))); + verboseprintf(verbose, ' frequency could be computed with the requested accuracy\n'); + end; + timevals = timevals(tmpind); +end; + +% find closet points in data +% -------------------------- +timeindices = round(eeg_lat2point(timevals, 1, srate, tlimits, 1E-3)); +if length(timeindices) < length(unique(timeindices)) + timeindices = unique_bc(timeindices) + verboseprintf(verbose, 'Warning: duplicate times, reduce the number of output times\n'); +end; +if length(unique(timeindices(2:end)-timeindices(1:end-1))) > 1 + verboseprintf(verbose, 'Finding closest points for time variable\n'); + verboseprintf(verbose, 'Time values for time/freq decomposition is not perfectly uniformly distributed\n'); +else + verboseprintf(verbose, 'Distribution of data point for time/freq decomposition is perfectly uniform\n'); +end; +timevals = timevect(timeindices); + +function verboseprintf(verbose, varargin) +if strcmpi(verbose, 'on') + fprintf(varargin{:}); +end; + diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/rsadjust.m b/code/eeglab13_4_4b/functions/timefreqfunc/rsadjust.m new file mode 100644 index 0000000..e2750ec --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/rsadjust.m @@ -0,0 +1,84 @@ +% rsadjust() - adjust l-values (Ramberg-Schmeiser distribution) +% with respect to signal mean and variance +% +% Usage: p = rsadjust(l3, l4, m, var, skew) +% +% Input: +% l3 - value lambda3 for Ramberg-Schmeiser distribution +% l4 - value lambda4 for Ramberg-Schmeiser distribution +% m - mean of the signal distribution +% var - variance of the signal distribution +% skew - skewness of the signal distribution (only the sign of +% this parameter is used). +% +% Output: +% l1 - value lambda3 for Ramberg-Schmeiser distribution +% l2 - value lambda4 for Ramberg-Schmeiser distribution +% l3 - value lambda3 for Ramberg-Schmeiser distribution (copy +% from input) +% l4 - value lambda4 for Ramberg-Schmeiser distribution (copy +% from input) +% +% Author: Arnaud Delorme, SCCN, 2003 +% +% See also: rsfit(), rsget() +% +% Reference: Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., Mykkytka, E.F. +% A probability distribution and its uses in fitting data. +% Technimetrics, 1979, 21: 201-214. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [l1,l2,l3,l4] = rsadjust( l3, l4, mu, sigma2, m3); + + % swap l3 and l4 for negative skewness + % ------------------------------------ + if m3 < 0 + ltmp = l4; + l4 = l3; + l3 = ltmp; + end; + + A = 1/(1 + l3) - 1/(1 + l4); + B = 1/(1 + 2*l3) + 1/(1 + 2*l4) - 2*beta(1+l3, 1+l4); + C = 1/(1 + 3*l3) - 1/(1 + 3*l4) ... + - 3*beta(1+2*l3, 1+l4) + 3*beta(1+l3, 1+2*l4); + + % compute l2 (and its sign) + % ------------------------ + l2 = sqrt( (B-A^2)/sigma2 ); + if m3 == 0, m3 = -0.000000000000001; end; + if (m3*(C - 2*A*B + 2*A^3)) < 0, l2 = -l2; end; + %l22 = ((C - 2*A*B + 2*A^3)/m3)^(1/3) % also equal to l2 + + % compute l1 + % ---------- + l1 = mu - A/l2; + + return; + + % fitting table 1 of + % --------------- + [l1 l2] = pdffitsolv2(-.0187,-.0388, 0, 1, 1) + [l1 l2] = pdffitsolv2(-.1359,-.1359, 0, 1, 0) + + % sign problem + [l1 l2] = pdffitsolv2(1.4501,1.4501, 0, 1) + + % numerical problem for l1 + [l1 l2] = pdffitsolv2(-.00000407,-.001076, 0, 1, 2) + [l1 l2] = pdffitsolv2(0,-.000580, 0, 1, 2) diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/rsfit.m b/code/eeglab13_4_4b/functions/timefreqfunc/rsfit.m new file mode 100644 index 0000000..5c0f62b --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/rsfit.m @@ -0,0 +1,185 @@ +% rsfit() - find p value for a given value in a given distribution +% using Ramberg-Schmeiser distribution +% +% Usage: >> p = rsfit(x, val) +% >> [p c l chi2] = rsfit(x, val, plot) +% +% Input: +% x - [float array] accumulation values +% val - [float] value to test +% plot - [0|1|2] plot fit. Using 2, the function avoids creating +% a new figure. Default: 0. +% +% Output: +% p - p value +% c - [mean var skewness kurtosis] distribution cumulants +% l - [4x float vector] Ramberg-Schmeiser distribution best fit +% parameters. +% chi2 - [float] chi2 for goodness of fit (based on 12 bins). +% Fit is significantly different from data histogram if +% chi2 > 19 (5%) +% +% Author: Arnaud Delorme, SCCN, 2003 +% +% See also: rsadjust(), rsget(), rspdfsolv(), rspfunc() +% +% Reference: Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., Mykkytka, E.F. +% A probability distribution and its uses in fitting data. +% Technimetrics, 1979, 21: 201-214. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [p, c, l, res] = rsfit(x, val, plotflag) + + if nargin < 2 + help rsfit; + return; + end; + if nargin < 3 + plotflag = 0; + end; + + % moments + % ------- + m1 = mean(x); + m2 = sum((x-m1).^2)/length(x); + m3 = sum((x-m1).^3)/length(x); + m4 = sum((x-m1).^4)/length(x); + + xmean = m1; + xvar = m2; + xskew = m3/(m2^1.5); + xkurt = m4/(m2^2); + c = [ xmean xvar xskew xkurt ]; + + if xkurt < 0 + disp('rsfit error: Can not fit negative kurtosis'); + save('/home/arno/temp/dattmp.mat', '-mat', 'x'); + disp('data saved to disk in /home/arno/temp/dattmp.mat'); + end; + + % find fit + % -------- + try, + [sol tmp exitcode] = fminsearch('rspdfsolv', [0.1 0.1], optimset('TolX',1e-12, 'MaxFunEvals', 100000000), abs(xskew), xkurt); + catch, exitcode = 0; % did not converge + end; + if ~exitcode + try, [sol tmp exitcode] = fminsearch('rspdfsolv', -[0.1 0.1], optimset('TolX',1e-12, 'MaxFunEvals', 100000000), abs(xskew), xkurt); + catch, exitcode = 0; end; + end; + if ~exitcode, error('No convergence'); end; + if sol(2)*sol(1) == -1, error('Wrong sign for convergence'); end; + %fprintf(' l-val:%f\n', sol); + + res = rspdfsolv(sol, abs(xskew), xkurt); + l3 = sol(1); + l4 = sol(2); + + %load res; + %[tmp indalpha3] = min( abs(rangealpha3 - xskew) ); + %[tmp indalpha4] = min( abs(rangealpha4 - xkurt) ); + %l3 = res(indalpha3,indalpha4,1); + %l4 = res(indalpha3,indalpha4,2); + %res = res(indalpha3,indalpha4,3); + + % adjust fit + % ---------- + [l1 l2 l3 l4] = rsadjust(l3, l4, xmean, xvar, xskew); + l = [l1 l2 l3 l4]; + p = rsget(l, val); + + % compute goodness of fit + % ----------------------- + if nargout > 3 | plotflag + + % histogram of value 12 bins + % -------------------------- + [N X] = hist(x, 25); + interval = X(2)-X(1); + X = [X-interval/2 X(end)+interval/2]; % borders + + % regroup bin with less than 5 values + % ----------------------------------- + indices2rm = []; + for index = 1:length(N)-1 + if N(index) < 5 + N(index+1) = N(index+1) + N(index); + indices2rm = [ indices2rm index]; + end; + end; + N(indices2rm) = []; + X(indices2rm+1) = []; + indices2rm = []; + for index = length(N):-1:2 + if N(index) < 5 + N(index-1) = N(index-1) + N(index); + indices2rm = [ indices2rm index]; + end; + end; + N(indices2rm) = []; + X(indices2rm) = []; + + % compute expected values + % ----------------------- + for index = 1:length(X)-1 + p1 = rsget( l, X(index+1)); + p2 = rsget( l, X(index )); + expect(index) = length(x)*(p1-p2); + end; + + % value of X2 + % ----------- + res = sum(((expect - N).^2)./expect); + + % plot fit + % -------- + if plotflag + if plotflag ~= 2, figure('paperpositionmode', 'auto'); end; + hist(x, 10); + + % plot fit + % -------- + xdiff = X(end)-X(1); + abscisia = linspace(X(1)-0.2*xdiff, X(end)+0.2*xdiff, 100); + %abscisia = (X(1:end-1)+X(2:end))/2; + expectplot = zeros(1,length(abscisia)-1); + for index = 2:length(abscisia); + p1 = rsget( l, abscisia(index-1)); + p2 = rsget( l, abscisia(index )); + expectplot(index-1) = length(x)*(p2-p1); + % have to do this subtraction since this a cumulate density distribution + end; + abscisia = (abscisia(2:end)+abscisia(1:end-1))/2; + hold on; plot(abscisia, expectplot, 'r'); + + % plot PDF + % ---------- + pval = linspace(0,1, 102); pval(1) = []; pval(end) = []; + rp = l(1) + (pval.^l(3) - (1-pval).^l(4))/l(2); + fp = l(2)*1./(l(3).*(pval.^(l(3)-1)) + l(4).*((1-pval).^(l(4)-1))); + [maxval index] = max(expect); + [tmp closestind] = min(abs(rp - abscisia(index))); + fp = fp./fp(closestind)*maxval; + plot(rp, fp, 'g'); + legend('Chi2 fit (some bins have been grouped)', 'Pdf', 'Data histogram' ); + xlabel('Bins'); + ylabel('# of data point per bin'); + title (sprintf('Fit of distribution using Ramberg-Schmeiser distribution (Chi2 = %2.4g)', res)); + end; + end; + return diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/rsget.m b/code/eeglab13_4_4b/functions/timefreqfunc/rsget.m new file mode 100644 index 0000000..f89417d --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/rsget.m @@ -0,0 +1,49 @@ +% rsget() - get the p-value for a given collection of l-values +% (Ramberg-Schmeiser distribution) +% +% Usage: p = getfit(l, val) +% +% Input: +% l - [l1 l2 l3 l4] l-values for Ramberg-Schmeiser distribution +% val - value in the distribution to get a p-value estimate at +% +% Output: +% p - p-value +% +% Author: Arnaud Delorme, SCCN, 2003 +% +% see also: rspfunc() +% +% Reference: Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., Mykkytka, E.F. +% A probability distribution and its uses in fitting data. +% Technimetrics, 1979, 21: 201-214. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function p = rsget( l, val); + + % plot the curve + % -------------- + %pval = linspace(0,1, 102); pval(1) = []; pval(end) = []; + %rp = l(1) + (pval.^l(3) - (1-pval).^l(4))/l(2); + %fp = l(2)*1./(l(3).*(pval.^(l(3)-1)) + l(4).*((1-pval).^(l(4)-1))); + %figure; plot(pval, rp); + %figure; plot(rp, fp); + + % find p value for a given val + % ---------------------------- + p = fminbnd('rspfunc', 0, 1, optimset('TolX',1e-300), l, val); diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/rspdfsolv.m b/code/eeglab13_4_4b/functions/timefreqfunc/rspdfsolv.m new file mode 100644 index 0000000..7e472a8 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/rspdfsolv.m @@ -0,0 +1,70 @@ +% rspdfsolv() - sub-function used by rsfit() to searc for optimal +% parameter for Ramberg-Schmeiser distribution +% +% Usage: res = rspdfsolv(l, l3, l4) +% +% Input: +% l - [lambda3 lamda4] parameters to optimize +% skew - expected skewness +% kurt - expected kurtosis +% +% Output: +% res - residual +% +% Author: Arnaud Delorme, SCCN, 2003 +% +% See also: rsget() +% +% Reference: Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., Mykkytka, E.F. +% A probability distribution and its uses in fitting data. +% Technimetrics, 1979, 21: 201-214. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function res = rspdfsolv( l, a3, a4); + + A = 1/(1 + l(1)) - 1/(1 + l(2)); + B = 1/(1 + 2*l(1)) + 1/(1 + 2*l(2)) - 2*beta(1+l(1), 1+l(2)); + C = 1/(1 + 3*l(1)) - 1/(1 + 3*l(2)) ... + - 3*beta(1+2*l(1), 1+l(2)) + 3*beta(1+l(1), 1+2*l(2)); + D = 1/(1 + 4*l(1)) + 1/(1 + 4*l(2)) ... + - 4*beta(1+3*l(1), 1+l(2)) - 4*beta(1+l(1), 1+3*l(2)) ... + + 6*beta(1+2*l(1), 1+2*l(2)); + + estim_a3 = (C - 3*A*B + 2*A^3)/(B-A^2)^(3/2); + estim_a4 = (D - 4*A*C + 6*A^2*B - 3*A^4)/(B-A^2)^2; + + res = (estim_a3 - a3)^2 + (estim_a4 - a4)^2; + + % the last term try to ensures that l(1) and l(2) are of the same sign + if sign(l(1)*l(2)) == -1, res = 2*res; end; + return; + +% original equations +% $$$ A = 1(1 + l(3)) - 1/(1 + l(4)); +% $$$ B = 1(1 + 2*l(3)) + 1/(1 + 2*l(4)) - 2*beta(1+l(3), 1+l(4)); +% $$$ C = 1(1 + 3*l(3)) - 1/(1 + 3*l(4)) ... +% $$$ - 3*beta(1+2*l(3), 1+l(4)) + 3*beta(1+l(3), 1+2*l(4)); +% $$$ D = 1(1 + 4*l(3)) + 1/(1 + 4*l(4)) ... +% $$$ - 4*beta(1+3*l(3), 1+l(4)) - 4*beta(1+l(3), 1+3*l(4)) ... +% $$$ + 6*beta(1+2*l(3), 1+2*l(4)); +% $$$ +% $$$ R(1) = l(1) + A/l(2); +% $$$ R(2) = (B-A^2)/l(2)^2; +% $$$ R(3) = (C - 3*A*B + 2*A^3)/l(2)^3; +% $$$ R(4) = (D - 4*A*C + 6*A^2*B - 3*A^4)/l(2)^4; + diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/rspfunc.m b/code/eeglab13_4_4b/functions/timefreqfunc/rspfunc.m new file mode 100644 index 0000000..8e0e7ad --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/rspfunc.m @@ -0,0 +1,42 @@ +% rspfunc() - sub-function used by rsget() +% +% Usage: res = rspfunc(pval, l, rval) +% +% Input: +% pval - p-value to optimize +% l - [l1 l2 l3 l4] l-values for Ramberg-Schmeiser distribution +% rval - expected r-value +% +% Output: +% res - residual +% +% Author: Arnaud Delorme, SCCN, 2003 +% +% See also: rsget() +% +% Reference: Ramberg, J.S., Tadikamalla, P.R., Dudewicz E.J., Mykkytka, E.F. +% A probability distribution and its uses in fitting data. +% Technimetrics, 1979, 21: 201-214. + +% Copyright (C) 2003 Arnaud Delorme, SCCN, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function rp = rspfunc( pval, l, rval); + + % for fiting rp with fminsearch + % ----------------------------- + rp = l(1) + (pval.^l(3) - (1-pval).^l(4))/l(2); + rp = abs(rval-rp); diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/timef.m b/code/eeglab13_4_4b/functions/timefreqfunc/timef.m new file mode 100644 index 0000000..253e66d --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/timef.m @@ -0,0 +1,1116 @@ +% timef() - Returns estimates and plots of mean event-related spectral +% perturbation (ERSP) and inter-trial coherence (ITC) changes +% across event-related trials (epochs) of a single input time series. +% * Uses either fixed-window, zero-padded FFTs (fastest), wavelet +% 0-padded DFTs (both Hanning-tapered), OR multitaper spectra ('mtaper'). +% * For the wavelet and FFT methods, output frequency spacing +% is the lowest frequency ('srate'/'winsize') divided by 'padratio'. +% NaN input values (such as returned by eventlock()) are ignored. +% * If 'alpha' is given, then bootstrap statistics are computed +% (from a distribution of 'naccu' surrogate data trials) and +% non-significant features of the output plots are zeroed out +% (i.e., plotted in green). +% * Given a 'topovec' scalp map weights vector and an 'elocs' electrode +% location file or structure, the figure also shows a topoplot() +% image of the specified scalp map. +% +% * Note: Left-click on subplots to view and zoom in separate windows. +% Usage: +% >> [ersp,itc,powbase,times,freqs,erspboot,itcboot,itcphase] = ... +% timef(data,frames,tlimits,srate,cycles,... +% 'key1',value1,'key2',value2, ... ); +% NOTE: +% * For more detailed information about timef(), >> timef details +% * Default values may differ when called from pop_timef() +% +% Required inputs: +% data = Single-channel data vector (1,frames*ntrials) (required) +% frames = Frames per trial {def|[]: datalength} +% tlimits = [mintime maxtime] (ms) Epoch time limits +% {def|[]: from frames,srate} +% srate = data sampling rate (Hz) {def:250} +% cycles = If 0 -> Use FFTs (with constant window length) {0 = FFT} +% If >0 -> Number of cycles in each analysis wavelet +% If [wavecycles factor] -> wavelet cycles increase with +% frequency beginning at wavecyles (0 no increase, standard wavelets; factor=0 -> fixed epoch +% length, as in FFT. Else, 'mtaper' -> multitaper decomp. +% +% Optional Inter-Irial Coherence (ITC) type: +% 'type' = ['coher'|'phasecoher'] Compute either linear coherence +% ('coher') or phase coherence ('phasecoher') also known +% as the phase coupling factor {'phasecoher'}. +% Optional detrending: +% 'detret' = ['on'|'off'], Detrend data in time. {'off'} +% 'detrep' = ['on'|'off'], Detrend data across trials {'off'} +% +% Optional FFT/DFT parameters: +% 'winsize' = If cycles==0: data subwindow length (fastest, 2^n0: *longest* window length to use. This +% determines the lowest output frequency {~frames/8} +% 'timesout' = Number of output times (int0) +% If cycles==0, all FFT frequencies are output. {50} +% 'baseline' = Spectral baseline window center end-time (in ms). {0} +% 'powbase' = Baseline spectrum (power, not dB) to normalize the data. +% {def|NaN->from data} +% +% Optional multitaper parameters: +% 'mtaper' = If [N W], performs multitaper decomposition. +% (N is the time resolution and W the frequency resolution; +% maximum taper number is 2NW-1). Overwrites 'winsize' and +% 'padratio'. +% If [N W K], uses K Slepian tapers (if possible). +% Phase is calculated using standard methods. +% The use of mutitaper with wavelets (cycles>0) is not +% recommended (as multiwavelets are not implemented). +% Uses Matlab functions DPSS, PMTM. {no multitaper} +% +% Optional bootstrap parameters: +% 'alpha' = If non-0, compute two-tailed bootstrap significance prob. +% level. Show non-signif. output values in green {0} +% 'naccu' = Number of bootstrap replications to accumulate {200} +% 'baseboot' = Bootstrap baseline to subtract (1 -> use 'baseline'(above) +% 0 -> use whole trial) {1} +% Optional scalp map: +% 'topovec' = Scalp topography (map) to plot {none} +% 'elocs' = Electrode location file for scalp map +% File should be ascii in format of >> topoplot example +% May also be an EEG.chanlocs struct. +% {default: file named in icadefs.m} +% Optional plotting parameters: +% 'hzdir' = ['up'|'down'] Direction of the frequency axes; reads default +% from icadefs.m {'up'} +% 'plotersp' = ['on'|'off'] Plot power spectral perturbations {'on'} +% 'plotitc' = ['on'|'off'] Plot inter trial coherence {'on'} +% 'plotphase' = ['on'|'off'] Plot sign of the phase in the ITC panel, i.e. +% green->red, pos.-phase ITC, green->blue, neg.-phase ITC {'on'} +% 'erspmax' = [real dB] set the ERSP max. for the scale (min= -max){auto} +% 'itcmax' = [real<=1] set the ITC maximum for the scale {auto} +% 'title' = Optional figure title {none} +% 'marktimes' = Non-0 times to mark with a dotted vertical line (ms) {none} +% 'linewidth' = Line width for 'marktimes' traces (thick=2, thin=1) {2} +% 'pboot' = Bootstrap power limits (e.g., from timef()) {from data} +% 'rboot' = Bootstrap ITC limits (e.g., from timef()) {from data} +% 'axesfont' = Axes text font size {10} +% 'titlefont' = Title text font size {8} +% 'vert' = [times_vector] -> plot vertical dashed lines at given ms. +% 'verbose' = ['on'|'off'] print text {'on'} +% +% Outputs: +% ersp = Matrix (nfreqs,timesout) of log spectral diffs. from +% baseline (in dB). NB: Not masked for significance. +% Must do this using erspboot +% itc = Matrix of inter-trial coherencies (nfreqs,timesout) +% (range: [0 1]) NB: Not masked for significance. +% Must do this using itcboot +% powbase = Baseline power spectrum (NOT in dB, used to norm. the ERSP) +% times = Vector of output times (sub-window centers) (in ms) +% freqs = Vector of frequency bin centers (in Hz) +% erspboot = Matrix (2,nfreqs) of [lower;upper] ERSP significance diffs +% itcboot = Matrix (2,nfreqs) of [lower;upper] ITC thresholds (not diffs) +% itcphase = Matrix (nfreqs,timesout) of ITC phase (in radians) +% +% Plot description: +% Assuming both 'plotersp' and 'plotitc' options are 'on' (= default). +% The upper panel presents the data ERSP (Event-Related Spectral Perturbation) +% in dB, with mean baseline spectral activity (in dB) subtracted. Use +% "'baseline', NaN" to prevent timef() from removing the baseline. +% The lower panel presents the data ITC (Inter-Trial Coherence). +% Click on any plot axes to pop up a new window (using 'axcopy()') +% -- Upper left marginal panel presents the mean spectrum during the baseline +% period (blue), and when significance is set, the significance threshold +% at each frequency (dotted green-black trace). +% -- The marginal panel under the ERSP image shows the maximum (green) and +% minimum (blue) ERSP values relative to baseline power at each frequency. +% -- The lower left marginal panel shows mean ITC across the imaged time range +% (blue), and when significance is set, the significance threshold (dotted +% green-black). +% -- The marginal panel under the ITC image shows the ERP (which is produced by +% ITC across the data spectral pass band). +% +% Author: Sigurd Enghoff, Arnaud Delorme & Scott Makeig +% CNL / Salk Institute 1998- | SCCN/INC, UCSD 2002- +% +% Known problems: +% Significance masking currently fails for linear coherence. +% +% See also: crossf() + +% Copyright (C) 1998 Sigurd Enghoff, Scott Makeig, Arnaud Delorme, +% CNL / Salk Institute 8/1/98-8/28/01 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 10-19-98 avoided division by zero (using MIN_ABS) -sm +% 10-19-98 improved usage message and commandline info printing -sm +% 10-19-98 made valid [] values for tvec and g.elocs -sm +% 04-01-99 added missing freq in freqs and plots, fixed log scaling bug -se & -tpj +% 06-29-99 fixed frequency indexing for constant-Q -se +% 08-24-99 reworked to handle NaN input values -sm +% 12-07-99 adjusted ERPtimes to plot ERP under ITC -sm +% 12-22-99 debugged ERPtimes, added BASE_BOOT -sm +% 01-10-00 debugged BASE_BOOT=0 -sm +% 02-28-00 added NOTE on formula derivation below -sm +% 03-16-00 added axcopy() feature -sm & tpj +% 04-16-00 added multiple marktimes loop -sm +% 04-20-00 fixed ITC cbar limits when spcified in input -sm +% 07-29-00 changed frequencies displayed msg -sm +% 10-12-00 fixed bug in freqs when cycles>0 -sm +% 02-07-01 fixed inconsistency in BASE_BOOT use -sm +% 08-28-01 matlab 'key' value arguments -ad +% 08-28-01 multitaper decomposition -ad +% 01-25-02 reformated help & license -ad +% 03-08-02 debug & compare to old timef function -ad +% 03-16-02 timeout automatically adjusted if too high -ad +% 04-02-02 added 'coher' option -ad + +function [P,R,mbase,times,freqs,Pboot,Rboot,Rphase,PA] = timef(X,frames,tlimits,Fs,varwin,varargin); + +% Note: undocumented arg PA is output of 'phsamp','on' + +%varwin,winsize,g.timesout,g.padratio,g.maxfreq,g.topovec,g.elocs,g.alpha,g.marktimes,g.powbase,g.pboot,g.rboot) + +% ITC: Normally, R = |Sum(Pxy)| / (Sum(|Pxx|)*Sum(|Pyy|)) is linear coherence. +% But here, we consider: Phase(Pyy) = 0 and |Pyy| = 1 -> Pxy = Pxx +% Giving, R = |Sum(Pxx)|/Sum(|Pxx|), the inter-trial coherence (ITC) +% Also called 'phase-locking factor' by Tallon-Baudry et al. (1996), +% the ITC is the phase coherence between the data time series and the +% time-locking event time series. + +% Read system-wide / dir-wide constants: +icadefs + +% Constants set here: +ERSP_CAXIS_LIMIT = 0; % 0 -> use data limits; else positive value + % giving symmetric +/- caxis limits. +ITC_CAXIS_LIMIT = 0; % 0 -> use data limits; else positive value + % giving symmetric +/- caxis limits. + +% Commandline arg defaults: +DEFAULT_EPOCH = NaN; % Frames per trial +DEFAULT_TIMLIM = NaN; % Time range of g.frames (ms) +DEFAULT_FS = 250; % Sampling frequency (Hz) +DEFAULT_NWIN = 200; % Number of windows = horizontal resolution +DEFAULT_VARWIN = 0; % Fixed window length or fixed number of cycles. + % =0: fix window length to that determined by nwin + % >0: set window length equal to varwin cycles + % Bounded above by winsize, which determines + % the min. freq. to be computed. +DEFAULT_OVERSMP = 2; % Number of times to oversample frequencies +DEFAULT_MAXFREQ = 50; % Maximum frequency to display (Hz) +DEFAULT_TITLE = ''; % Figure title +DEFAULT_ELOC = 'chan.locs'; % Channel location file +DEFAULT_ALPHA = NaN; % Percentile of bins to keep +DEFAULT_MARKTIME= NaN; + +% Font sizes: +AXES_FONT = 10; % axes text FontSize +TITLE_FONT = 8; + +if nargout>7 + Rphase = []; % initialize in case Rphase asked for, but ITC not computed +end + +if (nargin < 1) + help timef + return +end + +if isstr(X) & strcmp(X,'details') + more on + help timefdetails + more off + return +end + +if (min(size(X))~=1 | length(X)<2) + error('Data must be a row or column vector.'); +end + +if nargin < 2 | isempty(frames) | isnan(frames) + frames = DEFAULT_EPOCH; +elseif (~isnumeric(frames) | length(frames)~=1 | frames~=round(frames)) + error('Value of frames must be an integer.'); +elseif (frames <= 0) + error('Value of frames must be positive.'); +elseif (rem(length(X),frames) ~= 0) + error('Length of data vector must be divisible by frames.'); +end +if isnan(frames) | isempty(frames) + frames = length(X); +end + +if nargin < 3 | isnan(tlimits) | isempty(tlimits) + tlimits = DEFAULT_TIMLIM; +elseif (~isnumeric(tlimits) | sum(size(tlimits))~=3) + error('Value of tlimits must be a vector containing two numbers.'); +elseif (tlimits(1) >= tlimits(2)) + error('tlimits interval must be ascending.'); +end + +if (nargin < 4) + Fs = DEFAULT_FS; +elseif (~isnumeric(Fs) | length(Fs)~=1) + error('Value of srate must be a number.'); +elseif (Fs <= 0) + error('Value of srate must be positive.'); +end + +if isnan(tlimits) | isempty(tlimits) + hlim = 1000*frames/Fs; % fit default tlimits to srate and frames + tlimits = [0 hlim]; +end + +framesdiff = frames - Fs*(tlimits(2)-tlimits(1))/1000; +if abs(framesdiff) > 1 + error('Given time limits, frames and sampling rate are incompatible'); +elseif framesdiff ~= 0 + tlimits(1) = tlimits(1) - 0.5*framesdiff*1000/Fs; + tlimits(2) = tlimits(2) + 0.5*framesdiff*1000/Fs; + fprintf('Adjusted time limits slightly, to [%.1f,%.1f] ms, to match frames and srate.\n',tlimits(1),tlimits(2)); +end + +if (nargin < 5) + varwin = DEFAULT_VARWIN; +elseif (~isnumeric(varwin) | length(varwin)>2) + error('Value of cycles must be a number.'); +elseif (varwin < 0) + error('Value of cycles must be zero or positive.'); +end + +% consider structure for these arguments +% -------------------------------------- +if ~isempty(varargin) + try, g = struct(varargin{:}); + catch, error('Argument error in the {''param'', value} sequence'); end; +end; +g.tlimits = tlimits; +g.frames = frames; +g.srate = Fs; +g.cycles = varwin(1); +if length(varwin)>1 + g.cyclesfact = varwin(2); +else + g.cyclesfact = 1; +end; + +try, g.title; catch, g.title = DEFAULT_TITLE; end; +try, g.winsize; catch, g.winsize = max(pow2(nextpow2(g.frames)-3),4); end; +try, g.pad; catch, g.pad = max(pow2(nextpow2(g.winsize)),4); end; +try, g.timesout; catch, g.timesout = DEFAULT_NWIN; end; +try, g.padratio; catch, g.padratio = DEFAULT_OVERSMP; end; +try, g.maxfreq; catch, g.maxfreq = DEFAULT_MAXFREQ; end; +try, g.topovec; catch, g.topovec = []; end; +try, g.elocs; catch, g.elocs = DEFAULT_ELOC; end; +try, g.alpha; catch, g.alpha = DEFAULT_ALPHA; end; +try, g.marktimes; catch, g.marktimes = DEFAULT_MARKTIME; end; +try, g.powbase; catch, g.powbase = NaN; end; +try, g.pboot; catch, g.pboot = NaN; end; +try, g.rboot; catch, g.rboot = NaN; end; +try, g.plotersp; catch, g.plotersp = 'on'; end; +try, g.plotitc; catch, g.plotitc = 'on'; end; +try, g.detrep; catch, g.detrep = 'off'; end; +try, g.detret; catch, g.detret = 'off'; end; +try, g.baseline; catch, g.baseline = 0; end; +try, g.baseboot; catch, g.baseboot = 1; end; +try, g.linewidth; catch, g.linewidth = 2; end; +try, g.naccu; catch, g.naccu = 200; end; +try, g.mtaper; catch, g.mtaper = []; end; +try, g.vert; catch, g.vert = []; end; +try, g.type; catch, g.type = 'phasecoher'; end; +try, g.phsamp; catch, g.phsamp = 'off'; end; +try, g.plotphase; catch, g.plotphase = 'on'; end; +try, g.itcmax; catch, g.itcmax = []; end; +try, g.erspmax; catch, g.erspmax = []; end; +try, g.verbose; catch, g.verbose = 'on'; end; +try, g.chaninfo; catch, g.chaninfo = []; end; +try, g.hzdir; catch, g.hzdir = HZDIR; end; % default from icadefs +lasterr(''); + +% testing arguments consistency +% ----------------------------- +if strcmp(g.hzdir,'up') + g.hzdir = 'normal'; +elseif strcmp(g.hzdir,'down') + g.hzdir = 'reverse'; +else + error('unknown ''hzdir'' value - not ''up'' or ''down'''); +end + +switch lower(g.verbose) + case { 'on', 'off' }, ; + otherwise error('verbose must be either on or off'); +end; +if (~ischar(g.title)) + error('Title must be a string.'); +end + +if (~isnumeric(g.winsize) | length(g.winsize)~=1 | g.winsize~=round(g.winsize)) + error('Value of winsize must be an integer number.'); +elseif (g.winsize <= 0) + error('Value of winsize must be positive.'); +elseif (g.cycles == 0 & pow2(nextpow2(g.winsize)) ~= g.winsize) + error('Value of winsize must be an integer power of two [1,2,4,8,16,...]'); +elseif (g.winsize > g.frames) + error('Value of winsize must be less than frames per epoch.'); +end + +if (~isnumeric(g.timesout) | length(g.timesout)~=1 | g.timesout~=round(g.timesout)) + error('Value of timesout must be an integer number.'); +elseif (g.timesout <= 0) + error('Value of timesout must be positive.'); +end +if (g.timesout > g.frames-g.winsize) + g.timesout = g.frames-g.winsize; + disp(['Value of timesout must be <= frames-winsize, timeout adjusted to ' int2str(g.timesout) ]); +end + +if (~isnumeric(g.padratio) | length(g.padratio)~=1 | g.padratio~=round(g.padratio)) + error('Value of padratio must be an integer.'); +elseif (g.padratio <= 0) + error('Value of padratio must be positive.'); +elseif (pow2(nextpow2(g.padratio)) ~= g.padratio) + error('Value of padratio must be an integer power of two [1,2,4,8,16,...]'); +end + +if (~isnumeric(g.maxfreq) | length(g.maxfreq)~=1) + error('Value of maxfreq must be a number.'); +elseif (g.maxfreq <= 0) + error('Value of maxfreq must be positive.'); +elseif (g.maxfreq > Fs/2) + myprintf(g.verbose,['Warning: value of maxfreq reduced to Nyquist rate' ... + ' (%3.2f)\n\n'], Fs/2); + g.maxfreq = Fs/2; +end + +if isempty(g.topovec) + g.topovec = []; + if isempty(g.elocs) + error('Channel location file must be specified.'); + end; +end +if isempty(g.elocs) + g.elocs = DEFAULT_ELOC; +elseif (~ischar(g.elocs)) & ~isstruct(g.elocs) + error('Channel location file must be a valid text file.'); +end + +if (~isnumeric(g.alpha) | length(g.alpha)~=1) + error('timef(): Value of g.alpha must be a number.\n'); +elseif (round(g.naccu*g.alpha) < 2) + myprintf(g.verbose,'Value of g.alpha is out of the normal range [%g,0.5]\n',2/g.naccu); + g.naccu = round(2/g.alpha); + myprintf(g.verbose,' Increasing the number of bootstrap iterations to %d\n',g.naccu); +end +if g.alpha>0.5 | g.alpha<=0 + error('Value of g.alpha is out of the allowed range (0.00,0.5).'); +end +if ~isnan(g.alpha) + if g.baseboot > 0 + myprintf(g.verbose,'Bootstrap analysis will use data in baseline (pre-0 centered) subwindows only.\n') + else + myprintf(g.verbose,'Bootstrap analysis will use data in all subwindows.\n') + end +end +if ~isnumeric(g.vert) + error('vertical line(s) option must be a vector'); +else + if min(g.vert) < g.tlimits(1) | max(g.vert) > g.tlimits(2) + error('vertical line(s) time out-of-bound'); + end; +end; + +if ~isnan (g.rboot) + if size(g.rboot) == [1,1] + if g.cycles == 0 + g.rboot = g.rboot*ones(g.winsize*g.padratio/2); + end + end +end; + +if ~isempty(g.mtaper) % mutitaper, inspired from Bijan Pesaran matlab function + if length(g.mtaper) < 3 + %error('mtaper arguement must be [N W] or [N W K]'); + + if g.mtaper(1) * g.mtaper(2) < 1 + error('mtaper 2 first arguments'' product must be higher than 1'); + end; + if length(g.mtaper) == 2 + g.mtaper(3) = floor( 2*g.mtaper(2)*g.mtaper(1) - 1); + end + if length(g.mtaper) == 3 + if g.mtaper(3) > 2 * g.mtaper(1) * g.mtaper(2) -1 + error('mtaper number too high (maximum (2*N*W-1))'); + end; + end + disp(['Using ' num2str(g.mtaper(3)) ' tapers.']); + NW = g.mtaper(1)*g.mtaper(2); % product NW + N = g.mtaper(1)*g.srate; + [e,v] = dpss(N, NW, 'calc'); + e=e(:,1:g.mtaper(3)); + g.alltapers = e; + else + g.alltapers = g.mtaper; + disp('mtaper argument not [N W] or [N W K]; considering raw taper matrix'); + end; + + g.winsize = size(g.alltapers, 1); + g.pad = max(pow2(nextpow2(g.winsize)),256); % pad*nextpow + + %nfk = floor([0 g.maxfreq]./g.srate.*g.pad); % not used any more + %g.padratio = 2*nfk(2)/g.winsize; + + g.padratio = g.pad/g.winsize; + + %compute number of frequencies + %nf = max(256, g.pad*2^nextpow2(g.winsize+1)); + %nfk = floor([0 g.maxfreq]./g.srate.*nf); + %freqs = linspace( 0, g.maxfreq, diff(nfk)); % this also work in the case of a FFT + +end; + +switch lower(g.plotphase) + case { 'on', 'off' }, ; + otherwise error('plotphase must be either on or off'); +end; +switch lower(g.plotersp) + case { 'on', 'off' }, ; + otherwise error('plotersp must be either on or off'); +end; +switch lower(g.plotitc) + case { 'on', 'off' }, ; + otherwise error('plotitc must be either on or off'); +end; +switch lower(g.detrep) + case { 'on', 'off' }, ; + otherwise error('detrep must be either on or off'); +end; +switch lower(g.detret) + case { 'on', 'off' }, ; + otherwise error('detret must be either on or off'); +end; +switch lower(g.phsamp) + case { 'on', 'off' }, ; + otherwise error('phsamp must be either on or off'); +end; +if ~isnumeric(g.linewidth) + error('linewidth must be numeric'); +end; +if ~isnumeric(g.naccu) + error('naccu must be numeric'); +end; +if ~isnumeric(g.baseline) + error('baseline must be numeric'); +end; +switch g.baseboot + case {0,1}, ; + otherwise, error('baseboot must be 0 or 1'); +end; +switch g.type + case { 'coher', 'phasecoher', 'phasecoher2' },; + otherwise error('Type must be either ''coher'' or ''phasecoher'''); +end; +if isnan(g.baseline) + g.unitpower = 'uV/Hz'; +else + g.unitpower = 'dB'; +end; + +if (g.cycles == 0) %%%%%%%%%%%%%% constant window-length FFTs %%%%%%%%%%%%%%%% + freqs = linspace(0, g.srate/2, g.padratio*g.winsize/2+1); + freqs = freqs(2:end); + win = hanning(g.winsize); + + P = zeros(g.padratio*g.winsize/2,g.timesout); % summed power + PP = zeros(g.padratio*g.winsize/2,g.timesout); % power + R = zeros(g.padratio*g.winsize/2,g.timesout); % mean coherence + RR = zeros(g.padratio*g.winsize/2,g.timesout); % (coherence) + Pboot = zeros(g.padratio*g.winsize/2,g.naccu); % summed bootstrap power + Rboot = zeros(g.padratio*g.winsize/2,g.naccu); % summed bootstrap coher + Rn = zeros(1,g.timesout); + Rbn = 0; + + switch g.type + case { 'coher' 'phasecoher2' }, + cumulX = zeros(g.padratio*g.winsize/2,g.timesout); + cumulXboot = zeros(g.padratio*g.winsize/2,g.naccu); + case 'phasecoher' + switch g.phsamp + case 'on' + cumulX = zeros(g.padratio*g.winsize/2,g.timesout); + end + end; + +else % %%%%%%%%%%%%%%%%%% cycles>0, Constant-Q (wavelet) DFTs %%%%%%%%%%%%%%%%%%%% + + freqs = g.srate*g.cycles/g.winsize*[2:2/g.padratio:g.winsize]/2; + dispf = find(freqs <= g.maxfreq); + freqs = freqs(dispf); + + win = dftfilt(g.winsize,g.maxfreq/g.srate,g.cycles,g.padratio,g.cyclesfact); + P = zeros(size(win,2),g.timesout); % summed power + R = zeros(size(win,2),g.timesout); % mean coherence + PP = repmat(NaN,size(win,2),g.timesout); % initialize with NaN + RR = repmat(NaN,size(win,2),g.timesout); % initialize with NaN + Pboot = zeros(size(win,2),g.naccu); % summed bootstrap power + Rboot = zeros(size(win,2),g.naccu); % summed bootstrap coher + Rn = zeros(1,g.timesout); + Rbn = 0; + + switch g.type + case { 'coher' 'phasecoher2' }, + cumulX = zeros(size(win,2),g.timesout); + cumulXboot = zeros(size(win,2),g.naccu); + case 'phasecoher' + switch g.phsamp + case 'on' + cumulX = zeros(size(win,2),g.timesout); + end + end; +end + +switch g.phsamp + case 'on' + PA = zeros(size(P,1),size(P,1),g.timesout); % NB: (freqs,freqs,times) +end % phs amp + +wintime = 1000/g.srate*(g.winsize/2); % (1000/g.srate)*(g.winsize/2); +times = [g.tlimits(1)+wintime:(g.tlimits(2)-g.tlimits(1)-2*wintime)/(g.timesout-1):g.tlimits(2)-wintime]; +ERPtimes = [g.tlimits(1):(g.tlimits(2)-g.tlimits(1))/(g.frames-1):g.tlimits(2)+0.000001]; +ERPindices = []; +for ti=times + [tmp indx] = min(abs(ERPtimes-ti)); + ERPindices = [ERPindices indx]; +end +ERPtimes = ERPtimes(ERPindices); % subset of ERP frames on t/f window centers + +if ~isempty(find(times < g.baseline)) + baseln = find(times < g.baseline); % subtract means of pre-0 (centered) windows +else + baseln = 1:length(times); % use all times as baseline +end +if ~isnan(g.alpha) & length(baseln)==0 + myprintf(g.verbose,'timef(): no window centers in baseline (times<%g) - shorten (max) window length.\n', g.baseline) + return +elseif ~isnan(g.alpha) & g.baseboot + myprintf(g.verbose,' %d bootstrap windows in baseline (center times < %g).\n',... + length(baseln), g.baseline) +end +dispf = find(freqs <= g.maxfreq); +stp = (g.frames-g.winsize)/(g.timesout-1); + +myprintf(g.verbose,'Computing Event-Related Spectral Perturbation (ERSP) and\n'); +switch g.type + case 'phasecoher', myprintf(g.verbose,' Inter-Trial Phase Coherence (ITC) images based on %d trials\n',length(X)/g.frames); + case 'phasecoher2', myprintf(g.verbose,' Inter-Trial Phase Coherence 2 (ITC) images based on %d trials\n',length(X)/g.frames); + case 'coher', myprintf(g.verbose,' Linear Inter-Trial Coherence (ITC) images based on %d trials\n',length(X)/g.frames); +end; +myprintf(g.verbose,' of %d frames sampled at %g Hz.\n',g.frames,g.srate); +myprintf(g.verbose,'Each trial contains samples from %d ms before to\n',g.tlimits(1)); +myprintf(g.verbose,' %.0f ms after the timelocking event.\n',g.tlimits(2)); +myprintf(g.verbose,'The window size used is %d samples (%g ms) wide.\n',g.winsize,2*wintime); +myprintf(g.verbose,'The window is applied %d times at an average step\n',g.timesout); +myprintf(g.verbose,' size of %g samples (%g ms).\n',stp,1000*stp/g.srate); +myprintf(g.verbose,'Results are oversampled %d times; the %d frequencies\n',g.padratio,length(dispf)); +myprintf(g.verbose,' displayed are from %2.1f Hz to %3.1f Hz.\n',freqs(dispf(1)),freqs(dispf(end))); +if ~isnan(g.alpha) + myprintf(g.verbose,'Only significant values (bootstrap p<%g) will be colored;\n',g.alpha) + myprintf(g.verbose,' non-significant values will be plotted in green\n'); +end + +trials = length(X)/g.frames; +baselength = length(baseln); +myprintf(g.verbose,'\nOf %d trials total, processing trial:',trials); + +% detrend over epochs (trials) if requested +% ----------------------------------------- +switch g.detrep + case 'on' + X = reshape(X, g.frames, length(X)/g.frames); + X = X - mean(X,2)*ones(1, length(X(:))/g.frames); + X = X(:)'; +end; + +for i=1:trials + if (rem(i,100)==0) + myprintf(g.verbose,'\n'); + end + if (rem(i,10) == 0) + myprintf(g.verbose,'%d',i); + elseif (rem(i,2) == 0) + myprintf(g.verbose,'.'); + end + + ERP = blockave(X,g.frames); % compute the ERP trial average + + Wn = zeros(1,g.timesout); + for j=1:g.timesout, + tmpX = X([1:g.winsize]+floor((j-1)*stp)+(i-1)*g.frames); + % pull out data g.frames + tmpX = tmpX - mean(tmpX); % remove the mean for that window + switch g.detret, case 'on', tmpX = detrend(tmpX); end; + if ~any(isnan(tmpX)) + if (g.cycles == 0) % FFT + if ~isempty(g.mtaper) % apply multitaper (no hanning window) + tmpXMT = fft(g.alltapers .* ... + (tmpX(:) * ones(1,size(g.alltapers,2))), g.pad); + %tmpXMT = tmpXMT(nfk(1)+1:nfk(2),:); + tmpXMT = tmpXMT(2:g.padratio*g.winsize/2+1,:); + PP(:,j) = mean(abs(tmpXMT).^2, 2); + % power; can also ponderate multitaper by their eigenvalues v + tmpX = win .* tmpX(:); + tmpX = fft(tmpX, g.pad); + tmpX = tmpX(2:g.padratio*g.winsize/2+1); + else + % TF and MC (12/2006): Calculation changes made so that + % power can be correctly calculated from ERSP. + tmpX = win .* tmpX(:); + tmpX = fft(tmpX,g.padratio*g.winsize); + tmpX = tmpX / g.winsize; % TF and MC (12/11/2006): normalization, divide by g.winsize + tmpX = tmpX(2:g.padratio*g.winsize/2+1); + PP(:,j) = 2/0.375*abs(tmpX).^2; % power + % TF and MC (12/14/2006): multiply by 2 account for negative frequencies, + % Counteract the reduction by a factor 0.375 + % that occurs as a result of cosine (Hann) tapering. Refer to Bug 446 + end; + else % wavelet + if ~isempty(g.mtaper) % apply multitaper + tmpXMT = g.alltapers .* (tmpX(:) * ones(1,size(g.alltapers,2))); + tmpXMT = transpose(win) * tmpXMT; + PP(:,j) = mean(abs(tmpXMT).^2, 2); % power + tmpX = transpose(win) * tmpX(:); + else + tmpX = transpose(win) * tmpX(:); + PP(:,j) = abs(tmpX).^2; % power + end + end + + if abs(tmpX) < eps % If less than smallest possible machine value + % (i.e. if it's zero) then call it 0. + RR(:,j) = zeros(size(RR(:,j))); + else + switch g.type + case { 'coher' }, + RR(:,j) = tmpX; + cumulX(:,j) = cumulX(:,j)+abs(tmpX).^2; + case { 'phasecoher2' }, + RR(:,j) = tmpX; + cumulX(:,j) = cumulX(:,j)+abs(tmpX); + case 'phasecoher', + RR(:,j) = tmpX ./ abs(tmpX); % normalized cross-spectral vector + switch g.phsamp + case 'on' + cumulX(:,j) = cumulX(:,j)+abs(tmpX); % accumulate for PA + end + end; + end + Wn(j) = 1; + end + + switch g.phsamp + case 'on' % PA (freq x freq x time) + PA(:,:,j) = PA(:,:,j) + (tmpX ./ abs(tmpX)) * ((PP(:,j)))'; + % cross-product: unit phase (column) + % times amplitude (row) + end + end % window + + if ~isnan(g.alpha) % save surrogate data for bootstrap analysis + j = 1; + goodbasewins = find(Wn==1); + if g.baseboot % use baseline windows only + goodbasewins = find(goodbasewins<=baselength); + end + ngdbasewins = length(goodbasewins); + if ngdbasewins>1 + while j <= g.naccu + i=ceil(rand*ngdbasewins); + i=goodbasewins(i); + Pboot(:,j) = Pboot(:,j) + PP(:,i); + Rboot(:,j) = Rboot(:,j) + RR(:,i); + switch g.type + case 'coher', cumulXboot(:,j) = cumulXboot(:,j)+abs(tmpX).^2; + case 'phasecoher2', cumulXboot(:,j) = cumulXboot(:,j)+abs(tmpX); + end; + j = j+1; + end + Rbn = Rbn + 1; + end + end % bootstrap + + Wn = find(Wn>0); + if length(Wn)>0 + P(:,Wn) = P(:,Wn) + PP(:,Wn); % add non-NaN windows + R(:,Wn) = R(:,Wn) + RR(:,Wn); + Rn(Wn) = Rn(Wn) + ones(1,length(Wn)); % count number of addends + end +end % trial + +% if coherence, perform the division +% ---------------------------------- +switch g.type + case 'coher', + R = R ./ ( sqrt( trials*cumulX ) ); + if ~isnan(g.alpha) + Rboot = Rboot ./ ( sqrt( trials*cumulXboot ) ); + end; + case 'phasecoher2', + R = R ./ ( cumulX ); + if ~isnan(g.alpha) + Rboot = Rboot ./ cumulXboot; + end; + case 'phasecoher', + R = R ./ (ones(size(R,1),1)*Rn); +end; + +switch g.phsamp + case 'on' + tmpcx(1,:,:) = cumulX; % allow ./ below + for j=1:g.timesout + PA(:,:,j) = PA(:,:,j) ./ repmat(PP(:,j)', [size(PP,1) 1]); + end +end + +if min(Rn) < 1 + myprintf(g.verbose,'timef(): No valid timef estimates for windows %s of %d.\n',... + int2str(find(Rn==0)),length(Rn)); + Rn(find(Rn<1))==1; + return +end +P = P ./ (ones(size(P,1),1) * Rn); + +if isnan(g.powbase) + myprintf(g.verbose,'\nComputing the mean baseline spectrum\n'); + mbase = mean(P(:,baseln),2)'; +else + myprintf(g.verbose,'Using the input baseline spectrum\n'); + mbase = g.powbase; +end +if ~isnan( g.baseline ) & ~isnan( mbase ) + P = 10 * (log10(P) - repmat(log10(mbase(1:size(P,1)))',[1 g.timesout])); % convert to (10log10) dB +else + P = 10 * log10(P); +end; + +Rsign = sign(imag(R)); +if nargout > 7 + for lp = 1:size(R,1) + Rphase(lp,:) = rem(angle(R(lp,:)),2*pi); % replaced obsolete phase() -sm 2/1/6 + end + Rphase(find(Rphase>pi)) = 2*pi-Rphase(find(Rphase>pi)); + Rphase(find(Rphase<-pi)) = -2*pi-Rphase(find(Rphase<-pi)); +end + +R = abs(R); % convert coherence vector to magnitude + +if ~isnan(g.alpha) % if bootstrap analysis included . . . + if Rbn>0 + i = round(g.naccu*g.alpha); + if isnan(g.pboot) + Pboot = Pboot / Rbn; % normalize + if ~isnan( g.baseline ) + Pboot = 10 * (log10(Pboot) - repmat(log10(mbase)',[1 g.naccu])); + else + Pboot = 10 * log10(Pboot); + end; + Pboot = sort(Pboot'); + Pboot = [mean(Pboot(1:i,:)) ; mean(Pboot(g.naccu-i+1:g.naccu,:))]; + else + Pboot = g.pboot; + end + + if isnan(g.rboot) + Rboot = abs(Rboot) / Rbn; + Rboot = sort(Rboot'); + Rboot = mean(Rboot(g.naccu-i+1:g.naccu,:)); + else + Rboot = g.rboot; + end + else + myprintf(g.verbose,'No valid bootstrap trials...!\n'); + end +end + +switch lower(g.plotitc) + case 'on', + switch lower(g.plotersp), + case 'on', ordinate1 = 0.67; ordinate2 = 0.1; height = 0.33; g.plot = 1; + case 'off', ordinate2 = 0.1; height = 0.9; g.plot = 1; + end; + case 'off', ordinate1 = 0.1; height = 0.9; + switch lower(g.plotersp), + case 'on', ordinate1 = 0.1; height = 0.9; g.plot = 1; + case 'off', g.plot = 0; + end; +end; + +if g.plot + myprintf(g.verbose,'\nNow plotting...\n'); + set(gcf,'DefaultAxesFontSize',AXES_FONT) + colormap(jet(256)); + pos = get(gca,'position'); + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]; +end; + +switch lower(g.plotersp) + case 'on' + % + %%%%%%% image the ERSP %%%%%%%%%%%%%%%%%%%%%%%%%% + % + h(1) = subplot('Position',[.1 ordinate1 .9 height].*s+q); + + PP = P; % PP will be ERSP power after + if ~isnan(g.alpha) % zero out nonsignif. power differences + PP(find((PP > repmat(Pboot(1,:)',[1 g.timesout])) ... + & (PP < repmat(Pboot(2,:)',[1 g.timesout])))) = 0; + end + + if ERSP_CAXIS_LIMIT == 0 + ersp_caxis = [-1 1]*1.1*max(max(abs(P(dispf,:)))); + else + ersp_caxis = ERSP_CAXIS_LIMIT*[-1 1]; + end + + if ~isnan( g.baseline ) + imagesc(times,freqs(dispf),PP(dispf,:),ersp_caxis); + else + imagesc(times,freqs(dispf),PP(dispf,:)); + end; + set(gca,'ydir',g.hzdir); % make frequency ascend or descend + if ~isempty(g.erspmax) + caxis([-g.erspmax g.erspmax]); + end; + + hold on + plot([0 0],[0 freqs(max(dispf))],'--m','LineWidth',g.linewidth); % plot time 0 + if ~isnan(g.marktimes) % plot marked time + for mt = g.marktimes(:)' + plot([mt mt],[0 freqs(max(dispf))],'--k','LineWidth',g.linewidth); + end + end + hold off + set(h(1),'YTickLabel',[],'YTick',[]) + set(h(1),'XTickLabel',[],'XTick',[]) + if ~isempty(g.vert) + for index = 1:length(g.vert) + line([g.vert(index), g.vert(index)], [min(freqs(dispf)) max(freqs(dispf))], 'linewidth', 1, 'color', 'm'); + end; + end; + + h(2) = gca; + h(3) = cbar('vert'); % ERSP colorbar axes + set(h(2),'Position',[.1 ordinate1 .8 height].*s+q) + set(h(3),'Position',[.95 ordinate1 .05 height].*s+q) + title([ 'ERSP(' g.unitpower ')' ]) + + E = [min(P(dispf,:));max(P(dispf,:))]; + h(4) = subplot('Position',[.1 ordinate1-0.1 .8 .1].*s+q); % plot marginal ERSP means + % below the ERSP image + plot(times,E,[0 0],... + [min(E(1,:))-max(max(abs(E)))/3 max(E(2,:))+max(max(abs(E)))/3], ... + '--m','LineWidth',g.linewidth) + axis([min(times) max(times) ... + min(E(1,:))-max(max(abs(E)))/3 max(E(2,:))+max(max(abs(E)))/3]) + + tick = get(h(4),'YTick'); + set(h(4),'YTick',[tick(1) ; tick(end)]) + set(h(4),'YAxisLocation','right') + set(h(4),'TickLength',[0.020 0.025]); + xlabel('Time (ms)') + ylabel( g.unitpower ) + + E = 10 * log10(mbase(dispf)); + h(5) = subplot('Position',[0 ordinate1 .1 height].*s+q); % plot mean spectrum + % to left of ERSP image + plot(freqs(dispf),E,'LineWidth',g.linewidth) + if ~isnan(g.alpha) + hold on; + plot(freqs(dispf),Pboot(:,dispf)+[E;E],'g', 'LineWidth',g.linewidth); + plot(freqs(dispf),Pboot(:,dispf)+[E;E],'k:','LineWidth',g.linewidth) + end + + axis([freqs(1) freqs(max(dispf)) min(E)-max(abs(E))/3 max(E)+max(abs(E))/3]) + tick = get(h(5),'YTick'); + if (length(tick)>1) + set(h(5),'YTick',[tick(1) ; tick(end-1)]) + end + set(h(5),'TickLength',[0.020 0.025]); + set(h(5),'View',[90 90]) + xlabel('Frequency (Hz)') + ylabel( g.unitpower ) + if strcmp(g.hzdir,'normal') + freqdir = 'reverse'; + else + freqdir = 'normal'; + end + set(h(5),'xdir',freqdir); % make frequency ascend or descend +end; + +switch lower(g.plotitc) + case 'on' + % + %%%%%%%%%%%% Image the ITC %%%%%%%%%%%%%%%%%% + % + h(6) = subplot('Position',[.1 ordinate2 .9 height].*s+q); % ITC image + + RR = R; % RR is the masked ITC (R) + if ~isnan(g.alpha) + RR(find(RR < repmat(Rboot(1,:)',[1 g.timesout]))) = 0; + end + + if ITC_CAXIS_LIMIT == 0 + coh_caxis = min(max(max(R(dispf,:))),1)*[-1 1]; % 1 WAS 0.4 ! + else + coh_caxis = ITC_CAXIS_LIMIT*[-1 1]; + end + + if exist('Rsign') & strcmp(g.plotphase, 'on') + imagesc(times,freqs(dispf),Rsign(dispf,:).*RR(dispf,:),coh_caxis); % <--- + else + imagesc(times,freqs(dispf),RR(dispf,:),coh_caxis); % <--- + end + if ~isempty(g.itcmax) + caxis([-g.itcmax g.itcmax]); + end; + tmpcaxis = caxis; + set(gca,'ydir',g.hzdir); % make frequency ascend or descend + + hold on + plot([0 0],[0 freqs(max(dispf))],'--m','LineWidth',g.linewidth); + if ~isnan(g.marktimes) + for mt = g.marktimes(:)' + plot([mt mt],[0 freqs(max(dispf))],'--k','LineWidth',g.linewidth); + end + end + hold off + set(h(6),'YTickLabel',[],'YTick',[]) + set(h(6),'XTickLabel',[],'XTick',[]) + if ~isempty(g.vert) + for index = 1:length(g.vert) + line([g.vert(index), g.vert(index)], ... + [min(freqs(dispf)) max(freqs(dispf))], ... + 'linewidth', 1, 'color', 'm'); + end; + end; + + h(7) = gca; + h(8) = cbar('vert'); + %h(9) = get(h(8),'Children'); + set(h(7),'Position',[.1 ordinate2 .8 height].*s+q) + set(h(8),'Position',[.95 ordinate2 .05 height].*s+q) + set(h(8),'YLim',[0 tmpcaxis(2)]); + title('ITC') + + % + %%%%% plot the ERP below the ITC image %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % E = mean(R(dispf,:)); + + ERPmax = max(ERP); + ERPmin = min(ERP); + ERPmax = ERPmax + 0.1*(ERPmax-ERPmin); + ERPmin = ERPmin - 0.1*(ERPmax-ERPmin); + h(10) = subplot('Position',[.1 ordinate2-0.1 .8 .1].*s+q); % ERP + + plot(ERPtimes,ERP(ERPindices),... + [0 0],[ERPmin ERPmax],'--m','LineWidth',g.linewidth); + hold on; plot([times(1) times(length(times))],[0 0], 'k'); + axis([min(ERPtimes) max(ERPtimes) ERPmin ERPmax]); + + tick = get(h(10),'YTick'); + set(h(10),'YTick',[tick(1) ; tick(end)]) + set(h(10),'TickLength',[0.02 0.025]); + set(h(10),'YAxisLocation','right') + xlabel('Time (ms)') + ylabel('\muV') + if (~isempty(g.topovec)) + if length(g.topovec) ~= 1, ylabel(''); end; % ICA component + end; + + E = mean(R(dispf,:)'); + h(11) = subplot('Position',[0 ordinate2 .1 height].*s+q); % plot the marginal mean + % ITC left of the ITC image + if ~isnan(g.alpha) + plot(freqs(dispf),E,'LineWidth',g.linewidth); hold on; + plot(freqs(dispf),Rboot(dispf),'g', 'LineWidth',g.linewidth); + plot(freqs(dispf),Rboot(dispf),'k:','LineWidth',g.linewidth); + axis([freqs(1) freqs(max(dispf)) 0 max([E Rboot(dispf)])+max(E)/3]) + else + plot(freqs(dispf),E,'LineWidth',g.linewidth) + axis([freqs(1) freqs(max(dispf)) min(E)-max(E)/3 max(E)+max(E)/3]) + end + + tick = get(h(11),'YTick'); + set(h(11),'YTick',[tick(1) ; tick(length(tick))]) + set(h(11),'View',[90 90]) + set(h(11),'TickLength',[0.020 0.025]); + xlabel('Frequency (Hz)') + ylabel('ERP') + if strcmp(g.hzdir,'normal') + freqdir = 'reverse'; + else + freqdir = 'normal'; + end + set(gca,'xdir',freqdir); % make frequency ascend or descend + + % + %%%%%%%%%%%%%%% plot a topoplot() %%%%%%%%%%%%%%%%%%%%%%% + % + if (~isempty(g.topovec)) + h(12) = subplot('Position',[-.1 .43 .2 .14].*s+q); + if length(g.topovec) == 1 + topoplot(g.topovec,g.elocs,'electrodes','off', ... + 'style', 'blank', 'emarkersize1chan', 10, 'chaninfo', g.chaninfo); + else + topoplot(g.topovec,g.elocs,'electrodes','off', 'chaninfo', g.chaninfo); + end; + axis('square') + end +end; % switch + +if g.plot + try, icadefs; set(gcf, 'color', BACKCOLOR); catch, end; + if (length(g.title) > 0) + axes('Position',pos,'Visible','Off'); + h(13) = text(-.05,1.01,g.title); + set(h(13),'VerticalAlignment','bottom') + set(h(13),'HorizontalAlignment','left') + set(h(13),'FontSize',TITLE_FONT); + end + + axcopy(gcf); +end; + +% symmetric Hanning tapering function +% ----------------------------------- +function w = hanning(n) +if ~rem(n,2) + w = .5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = .5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end + +function myprintf(verbose, varargin) + if strcmpi(verbose, 'on') + fprintf(varargin{:}); + end; diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/timefreq.m b/code/eeglab13_4_4b/functions/timefreqfunc/timefreq.m new file mode 100644 index 0000000..07de08e --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/timefreq.m @@ -0,0 +1,729 @@ +% timefreq() - compute time/frequency decomposition of data trials. This +% function is a compute-only function called by +% the more complete time/frequency functions newtimef() +% and newcrossf() which also plot timefreq() results. +% +% Usage: +% >> [tf, freqs, times] = timefreq(data, srate); +% >> [tf, freqs, times, itcvals] = timefreq(data, srate, ... +% 'key1', 'val1', 'key2', 'val2' ...) +% Inputs: +% data = [float array] 2-D data array of size (times,trials) +% srate = sampling rate +% +% Optional inputs: +% 'cycles' = [real] indicates the number of cycles for the +% time-frequency decomposition {default: 0} +% if 0, use FFTs and Hanning window tapering. +% or [real positive scalar] Number of cycles in each Morlet +% wavelet, constant across frequencies. +% or [cycles cycles(2)] wavelet cycles increase with +% frequency starting at cycles(1) and, +% if cycles(2) > 1, increasing to cycles(2) at +% the upper frequency, +% or if cycles(2) = 0, same window size at all +% frequencies (similar to FFT if cycles(1) = 1) +% or if cycles(2) = 1, not increasing (same as giving +% only one value for 'cycles'). This corresponds to pure +% wavelet with the same number of cycles at each frequencies +% if 0 < cycles(2) < 1, linear variation in between pure +% wavelets (1) and FFT (0). The exact number of cycles +% at the highest frequency is indicated on the command line. +% 'wavelet' = DEPRECATED, please use 'cycles'. This function does not +% support multitaper. For multitaper, use timef(). +% 'wletmethod' = ['dftfilt2'|'dftfilt3'] Wavelet method/program to use. +% {default: 'dftfilt3'} +% 'dftfilt' DEPRECATED. Method used in regular timef() +% program. Not available any more. +% 'dftfilt2' Morlet-variant or Hanning DFT (calls dftfilt2() +% to generate wavelets). +% 'dftfilt3' Morlet wavelet or Hanning DFT (exact Tallon +% Baudry). Calls dftfilt3(). +% 'ffttaper' = ['none'|'hanning'|'hamming'|'blackmanharris'] FFT tapering +% function. Default is 'hanning'. Note that 'hamming' and +% 'blackmanharris' require the signal processing toolbox. +% Optional ITC type: +% 'type' = ['coher'|'phasecoher'] Compute either linear coherence +% ('coher') or phase coherence ('phasecoher') also known +% as phase coupling factor' {default: 'phasecoher'}. +% 'subitc' = ['on'|'off'] subtract stimulus locked Inter-Trial Coherence +% (ITC) from x and y. This computes the 'intrinsic' coherence +% x and y not arising from common synchronization to +% experimental events. See notes. {default: 'off'} +% +% Optional detrending: +% 'detrend' = ['on'|'off'], Linearly detrend each data epoch {'off'} +% +% Optional FFT/DFT parameters: +% 'tlimits' = [min max] time limits in ms. +% 'winsize' = If cycles==0 (FFT, see 'wavelet' input): data subwindow +% length (fastest, 2^n0: *longest* window length to use. This +% determines the lowest output frequency {~frames/8} +% 'ntimesout' = Number of output times (int frame) + error('Value of winsize must be less than frame length.'); +end +if (pow2(nextpow2(g.padratio)) ~= g.padratio) + error('Value of padratio must be an integer power of two [1,2,4,8,16,...]'); +end + +% finding frequency limits +% ------------------------ +if g.cycles(1) ~= 0 & g.freqs(1) == 0, g.freqs(1) = srate*g.cycles(1)/g.winsize; end; + +% finding frequencies +% ------------------- +if length(g.freqs) == 2 + + % min and max + % ----------- + if g.freqs(1) == 0 & g.cycles(1) ~= 0 + g.freqs(1) = srate*g.cycles(1)/g.winsize; + end; + + % default number of freqs using padratio + % -------------------------------------- + if isempty(g.nfreqs) + g.nfreqs = g.winsize/2*g.padratio+1; + % adjust nfreqs depending on frequency range + tmpfreqs = linspace(0, srate/2, g.nfreqs); + tmpfreqs = tmpfreqs(2:end); % remove DC (match the output of PSD) + + % adjust limits for FFT (only linear scale) + if g.cycles(1) == 0 & ~strcmpi(g.freqscale, 'log') + if ~any(tmpfreqs == g.freqs(1)) + [tmp minind] = min(abs(tmpfreqs-g.freqs(1))); + g.freqs(1) = tmpfreqs(minind); + verboseprintf(g.verbose, 'Adjust min freq. to %3.2f Hz to match FFT output frequencies\n', g.freqs(1)); + end; + if ~any(tmpfreqs == g.freqs(2)) + [tmp minind] = min(abs(tmpfreqs-g.freqs(2))); + g.freqs(2) = tmpfreqs(minind); + verboseprintf(g.verbose, 'Adjust max freq. to %3.2f Hz to match FFT output frequencies\n', g.freqs(2)); + end; + end; + + % find number of frequencies + % -------------------------- + g.nfreqs = length(tmpfreqs( intersect( find(tmpfreqs >= g.freqs(1)), find(tmpfreqs <= g.freqs(2))))); + if g.freqs(1)==g.freqs(2), g.nfreqs = 1; end; + end; + + % find closest freqs for FFT + % -------------------------- + if strcmpi(g.freqscale, 'log') + g.freqs = linspace(log(g.freqs(1)), log(g.freqs(end)), g.nfreqs); + g.freqs = exp(g.freqs); + else + g.freqs = linspace(g.freqs(1), g.freqs(2), g.nfreqs); % this should be OK for FFT + % because of the limit adjustment + end; +end; +g.nfreqs = length(g.freqs); + +% function for time freq initialisation +% ------------------------------------- +if (g.cycles(1) == 0) %%%%%%%%%%%%%% constant window-length FFTs %%%%%%%%%%%%%%%% + freqs = linspace(0, srate/2, g.winsize*g.padratio/2+1); + freqs = freqs(2:end); % remove DC (match the output of PSD) + %srate/g.winsize*[1:2/g.padratio:g.winsize]/2 + verboseprintf(g.verbose, 'Using %s FFT tapering\n', g.ffttaper); + switch g.ffttaper + case 'hanning', g.win = hanning(g.winsize); + case 'hamming', g.win = hamming(g.winsize); + case 'blackmanharris', g.win = blackmanharris(g.winsize); + case 'none', g.win = ones(g.winsize,1); + end; +else % %%%%%%%%%%%%%%%%%% Constant-Q (wavelet) DFTs %%%%%%%%%%%%%%%%%%%%%%%%%%%% + %freqs = srate*g.cycles/g.winsize*[2:2/g.padratio:g.winsize]/2; + %g.win = dftfilt(g.winsize,g.freqs(2)/srate,g.cycles,g.padratio,g.cyclesfact); + + freqs = g.freqs; + if length(g.cycles) == 2 + if g.cycles(2) < 1 + g.cycles = [ g.cycles(1) g.cycles(1)*g.freqs(end)/g.freqs(1)*(1-g.cycles(2))]; + end + verboseprintf(g.verbose, 'Using %g cycles at lowest frequency to %g at highest.\n', g.cycles(1), g.cycles(2)); + elseif length(g.cycles) == 1 + verboseprintf(g.verbose, 'Using %d cycles at all frequencies.\n',g.cycles); + else + verboseprintf(g.verbose, 'Using user-defined cycle for each frequency\n'); + end + if strcmp(g.wletmethod, 'dftfilt2') + g.win = dftfilt2(g.freqs,g.cycles,srate, g.freqscale); % uses Morlet taper by default + elseif strcmp(g.wletmethod, 'dftfilt3') % Default + g.win = dftfilt3(g.freqs,g.cycles,srate, 'cycleinc', g.freqscale); % uses Morlet taper by default + else return + end + g.winsize = 0; + for index = 1:length(g.win) + g.winsize = max(g.winsize,length(g.win{index})); + end; +end; + +% compute time vector +% ------------------- +[ g.timesout g.indexout ] = gettimes(frame, g.tlimits, g.timesout, g.winsize, g.ntimesout, g.causal, g.verbose); + +% ------------------------------- +% compute time freq decomposition +% ------------------------------- +verboseprintf(g.verbose, 'The window size used is %d samples (%g ms) wide.\n',g.winsize, 1000/srate*g.winsize); +if strcmpi(g.freqscale, 'log') % fastif was having strange "function not available" messages + scaletoprint = 'log'; +else scaletoprint = 'linear'; +end +verboseprintf(g.verbose, 'Estimating %d %s-spaced frequencies from %2.1f Hz to %3.1f Hz.\n', length(g.freqs), ... + scaletoprint, g.freqs(1), g.freqs(end)); +%verboseprintf(g.verbose, 'Estimating %d %s-spaced frequencies from %2.1f Hz to %3.1f Hz.\n', length(g.freqs), ... +% fastif(strcmpi(g.freqscale, 'log'), 'log', 'linear'), g.freqs(1), g.freqs(end)); + +if g.cycles(1) == 0 + if 1 + % build large matrix to compute FFT + % --------------------------------- + indices = repmat([-g.winsize/2+1:g.winsize/2]', [1 length(g.indexout) trials]); + indices = indices + repmat(g.indexout, [size(indices,1) 1 trials]); + indices = indices + repmat(reshape(([1:trials]-1)*frame,1,1,trials), [size(indices,1) length(g.indexout) 1]); + if chan > 1 + tmpall = repmat(nan,[chan length(freqs) length(g.timesout) trials]); + tmpX = reshape(data(:,indices), [ size(data,1) size(indices)]); + tmpX = bsxfun(@minus, tmpX, mean( tmpX, 2)); % avoids repmat - faster than tmpX = tmpX - repmat(mean(tmpX), [size(tmpX,1) 1 1]); + tmpX = bsxfun(@times, tmpX, g.win'); + tmpX = fft(tmpX,g.padratio*g.winsize,2); + tmpall = squeeze(tmpX(:,2:g.padratio*g.winsize/2+1,:,:)); + else + tmpall = repmat(nan,[length(freqs) length(g.timesout) trials]); + tmpX = data(indices); + tmpX = bsxfun(@minus, tmpX, mean( tmpX, 1)); % avoids repmat - faster than tmpX = tmpX - repmat(mean(tmpX), [size(tmpX,1) 1 1]); + tmpX = bsxfun(@times, tmpX, g.win); + %tmpX = fft(tmpX,2^ceil(log2(g.padratio*g.winsize))); + %tmpall = tmpX(2:g.padratio*g.winsize/2+1,:,:); + tmpX = fft(tmpX,g.padratio*g.winsize); + tmpall = tmpX(2:g.padratio*g.winsize/2+1,:,:); + end; + else % old iterative computation + tmpall = repmat(nan,[length(freqs) length(g.timesout) trials]); + verboseprintf(g.verbose, 'Processing trial (of %d):',trials); + for trial = 1:trials + if rem(trial,10) == 0, verboseprintf(g.verbose, ' %d',trial); end + if rem(trial,120) == 0, verboseprintf(g.verbose, '\n'); end + for index = 1:length(g.indexout) + if strcmpi(g.causal, 'off') + tmpX = data([-g.winsize/2+1:g.winsize/2]+g.indexout(index)+(trial-1)*frame); % 1 point imprecision + else + tmpX = data([-g.winsize+1:0]+g.indexout(index)+(trial-1)*frame); % 1 point imprecision + end; + + tmpX = tmpX - mean(tmpX); + if strcmpi(g.detrend, 'on'), + tmpX = detrend(tmpX); + end; + + tmpX = g.win .* tmpX(:); + tmpX = fft(tmpX,g.padratio*g.winsize); + tmpX = tmpX(2:g.padratio*g.winsize/2+1); + tmpall(:,index, trial) = tmpX(:); + end; + end; + end; +else % wavelet + if chan > 1 + % wavelets are processed in groups of the same size + % to speed up computation. Wavelet of groups of different size + % can be processed together but at a cost of a lot of RAM and + % a lot of extra computation -> not efficient + tmpall = repmat(nan,[chan length(freqs) length(g.timesout) trials]); + wt = [ 1 find(diff(cellfun(@length,g.win)))+1 length(g.win)+1]; + verboseprintf(g.verbose, 'Computing of %d:', length(wt)); + for ind = 1:length(wt)-1 + verboseprintf(g.verbose, '.'); + wavarray = reshape([ g.win{wt(ind):wt(ind+1)-1} ], [ length(g.win{wt(ind)}) wt(ind+1)-wt(ind) ]); + sizewav = size(wavarray,1)-1; + indices = repmat([-sizewav/2:sizewav/2]', [1 size(wavarray,2) length(g.indexout) trials]); + indices = indices + repmat(reshape(g.indexout, 1,1,length(g.indexout)), [size(indices,1) size(indices,2) 1 trials]); + indices = indices + repmat(reshape(([1:trials]-1)*frame,1,1,1,trials), [size(indices,1) size(indices,2) size(indices,3) 1]); + szfreqdata = [ size(data,1) size(indices) ]; + tmpX = reshape(data(:,indices), szfreqdata); + tmpX = bsxfun(@minus, tmpX, mean( tmpX, 2)); % avoids repmat - faster than tmpX = tmpX - repmat(mean(tmpX), [size(tmpX,1) 1 1]); + wavarray = reshape(wavarray, [1 size(wavarray,1) size(wavarray,2)]); + tmpall(:,wt(ind):wt(ind+1)-1,:,:,:) = reshape(sum(bsxfun(@times, tmpX, wavarray),2), [szfreqdata(1) szfreqdata(3:end)]); + end; + verboseprintf(g.verbose, '\n'); + %tmpall = squeeze(tmpall(1,:,:,:)); + elseif 0 + tmpall = repmat(nan,[length(freqs) length(g.timesout) trials]); + % wavelets are processed in groups of the same size + % to speed up computation. Wavelet of groups of different size + % can be processed together but at a cost of a lot of RAM and + % a lot of extra computation -> not faster than the regular + % iterative method + wt = [ 1 find(diff(cellfun(@length,g.win)))+1 length(g.win)+1]; + for ind = 1:length(wt)-1 + wavarray = reshape([ g.win{wt(ind):wt(ind+1)-1} ], [ length(g.win{wt(ind)}) wt(ind+1)-wt(ind) ]); + sizewav = size(wavarray,1)-1; + indices = repmat([-sizewav/2:sizewav/2]', [1 size(wavarray,2) length(g.indexout) trials]); + indices = indices + repmat(reshape(g.indexout, 1,1,length(g.indexout)), [size(indices,1) size(indices,2) 1 trials]); + indices = indices + repmat(reshape(([1:trials]-1)*frame,1,1,1,trials), [size(indices,1) size(indices,2) size(indices,3) 1]); + tmpX = data(indices); + tmpX = bsxfun(@minus, tmpX, mean( tmpX, 1)); % avoids repmat - faster than tmpX = tmpX - repmat(mean(tmpX), [size(tmpX,1) 1 1]); + tmpall(wt(ind):wt(ind+1)-1,:,:) = squeeze(sum(bsxfun(@times, tmpX, wavarray),1)); + end; + elseif 0 + % wavelets are processed one by one but all windows simultaneously + % -> not faster than the regular iterative method + tmpall = repmat(nan,[length(freqs) length(g.timesout) trials]); + sizewav = length(g.win{1})-1; % max window size + mainc = sizewav/2; + indices = repmat([-sizewav/2:sizewav/2]', [1 length(g.indexout) trials]); + indices = indices + repmat(g.indexout, [size(indices,1) 1 trials]); + indices = indices + repmat(reshape(([1:trials]-1)*frame,1,1,trials), [size(indices,1) length(g.indexout) 1]); + + for freqind = 1:length(g.win) + winc = (length(g.win{freqind})-1)/2; + wins = length(g.win{freqind})-1; + wini = [-wins/2:wins/2]+winc+mainc-winc+1; + tmpX = data(indices(wini,:,:)); + tmpX = bsxfun(@minus, tmpX, mean( tmpX, 1)); % avoids repmat - faster than tmpX = tmpX - repmat(mean(tmpX), [size(tmpX,1) 1 1]); + tmpX = sum(bsxfun(@times, tmpX, g.win{freqind}'),1); + tmpall(freqind,:,:) = tmpX; + end; + else + % prepare wavelet filters + % ----------------------- + for index = 1:length(g.win) + g.win{index} = transpose(repmat(g.win{index}, [trials 1])); + end; + + % apply filters + % ------------- + verboseprintf(g.verbose, 'Processing time point (of %d):',length(g.timesout)); + tmpall = zeros(length(g.win), length(g.indexout), size(data,2)); + for index = 1:length(g.indexout) + if rem(index,10) == 0, verboseprintf(g.verbose, ' %d',index); end + if rem(index,120) == 0, verboseprintf(g.verbose, '\n'); end + for freqind = 1:length(g.win) + wav = g.win{freqind}; + sizewav = size(wav,1)-1; + %g.indexout(index), size(wav,1), g.freqs(freqind) + if strcmpi(g.causal, 'off') + tmpX = data([-sizewav/2:sizewav/2]+g.indexout(index),:); + else + tmpX = data([-sizewav:0]+g.indexout(index),:); + end; + + tmpX = tmpX - ones(size(tmpX,1),1)*mean(tmpX); + if strcmpi(g.detrend, 'on'), + for trial = 1:trials + tmpX(:,trial) = detrend(tmpX(:,trial)); + end; + end; + + tmpX = sum(wav .* tmpX); + tmpall( freqind, index, :) = tmpX; + end; + end; + end; +end; +verboseprintf(g.verbose, '\n'); + +% time-warp code begins -Jean +% --------------------------- +if ~isempty(g.timestretch) && length(g.timestretch{1}) > 0 + + timemarks = g.timestretch{1}'; + if isempty(g.timestretch{2}) | length(g.timestretch{2}) == 0 + timerefs = median(g.timestretch{1}',2); + else + timerefs = g.timestretch{2}; + end + trials = size(tmpall,3); + + % convert timerefs to subsampled ERSP space + % ----------------------------------------- + + [dummy refsPos] = min(transpose(abs( ... + repmat(timerefs, [1 length(g.indexout)]) - repmat(g.indexout, [length(timerefs) 1])))); + refsPos(end+1) = 1; + refsPos(end+1) = length(g.indexout); + refsPos = sort(refsPos); + + for t=1:trials + + % convert timemarks to subsampled ERSP space + % ------------------------------------------ + + %[dummy pos]=min(abs(repmat(timemarks(2:7,1), [1 length(g.indexout)])-repmat(g.indexout,[6 1]))); + + outOfTimeRangeTimeWarpMarkers = find(timemarks(:,t) < min(g.indexout) | timemarks(:,t) > max(g.indexout)); + +% if ~isempty(outOfTimeRangeTimeWarpMarkers) +% verboseprintf(g.verbose, 'Timefreq warning: time-warp latencies in epoch %d are out of time range defined for calculation of ERSP.\n', t); +% end; + + [dummy marksPos] = min(transpose( ... + abs( ... + repmat(timemarks(:,t), [1 length(g.indexout)]) ... + - repmat(g.indexout, [size(timemarks,1) 1]) ... + ) ... + )); + + + marksPos(end+1) = 1; + marksPos(end+1) = length(g.indexout); + marksPos = sort(marksPos); + + %now warp tmpall + mytmpall = tmpall(:,:,t); + r = sqrt(mytmpall.*conj(mytmpall)); + theta = angle(mytmpall); + + % So mytmpall is almost equal to r.*exp(i*theta) + % whos marksPos refsPos + + M = timewarp(marksPos, refsPos); + + TSr = transpose(M*r'); + TStheta = zeros(size(theta,1), size(theta,2)); + + for freqInd=1:size(TStheta,1) + TStheta(freqInd, :) = angtimewarp(marksPos, refsPos, theta(freqInd, :)); + end + TStmpall = TSr.*exp(i*TStheta); + + % $$$ keyboard; + + tmpall(:,:,t) = TStmpall; + end +end +%time-warp ends +zerovals = tmpall == 0; +if any(reshape(zerovals, 1, prod(size(zerovals)))) + tmpall(zerovals) = Inf; + minval = min(tmpall(:)); % remove bug + tmpall(zerovals) = minval; +end; + +% compute and subtract ITC +% ------------------------ +if nargout > 3 || strcmpi(g.subitc, 'on') + itcvals = tfitc(tmpall, g.itctype); +end; +if strcmpi(g.subitc, 'on') + %a = gcf; figure; imagesc(abs(itcvals)); cbar; figure(a); + if ndims(tmpall) <= 3 + tmpall = (tmpall - abs(tmpall) .* repmat(itcvals, [1 1 trials])) ./ abs(tmpall); + else tmpall = (tmpall - abs(tmpall) .* repmat(itcvals, [1 1 1 trials])) ./ abs(tmpall); + end; +end; + +% find closest output frequencies +% ------------------------------- +if length(g.freqs) ~= length(freqs) || any(g.freqs ~= freqs) + allindices = zeros(1,length(g.freqs)); + for index = 1:length(g.freqs) + [dum ind] = min(abs(freqs-g.freqs(index))); + allindices(index) = ind; + end; + verboseprintf(g.verbose, 'finding closest frequencies: %d freqs removed\n', length(freqs)-length(allindices)); + freqs = freqs(allindices); + if ndims(tmpall) <= 3 + tmpall = tmpall(allindices,:,:); + else tmpall = tmpall(:,allindices,:,:); + end; + if nargout > 3 | strcmpi(g.subitc, 'on') + if ndims(tmpall) <= 3 + itcvals = itcvals(allindices,:,:); + else itcvals = itcvals(:,allindices,:,:); + end; + end; +end; + +timesout = g.timesout; + +%figure; imagesc(abs(sum(itcvals,3))); cbar; +return; + +% function for itc +% ---------------- +function [itcvals] = tfitc(tfdecomp, itctype); +% first dimension are trials +nd = max(3,ndims(tfdecomp)); +switch itctype + case 'coher', + try, + itcvals = sum(tfdecomp,nd) ./ sqrt(sum(tfdecomp .* conj(tfdecomp),nd) * size(tfdecomp,nd)); + catch, % scan rows if out of memory + for index =1:size(tfdecomp,1) + itcvals(index,:,:) = sum(tfdecomp(index,:,:,:),nd) ./ sqrt(sum(tfdecomp(index,:,:,:) .* conj(tfdecomp(index,:,:,:)),nd) * size(tfdecomp,nd)); + end; + end; + case 'phasecoher2', + try, + itcvals = sum(tfdecomp,nd) ./ sum(sqrt(tfdecomp .* conj(tfdecomp)),nd); + catch, % scan rows if out of memory + for index =1:size(tfdecomp,1) + itcvals(index,:,:) = sum(tfdecomp(index,:,:,:),nd) ./ sum(sqrt(tfdecomp(index,:,:,:) .* conj(tfdecomp(index,:,:,:))),nd); + end; + end; + case 'phasecoher', + try, + itcvals = sum(tfdecomp ./ sqrt(tfdecomp .* conj(tfdecomp)) ,nd) / size(tfdecomp,nd); + catch, % scan rows if out of memory + for index =1:size(tfdecomp,1) + itcvals(index,:,:) = sum(tfdecomp(index,:,:,:) ./ sqrt(tfdecomp(index,:,:,:) .* conj(tfdecomp(index,:,:,:))) ,nd) / size(tfdecomp,nd); + end; + end; +end % ~any(isnan()) +return; + +function w = hanning(n) +if ~rem(n,2) + w = .5*(1 - cos(2*pi*(1:n/2)'/(n+1))); + w = [w; w(end:-1:1)]; +else + w = .5*(1 - cos(2*pi*(1:(n+1)/2)'/(n+1))); + w = [w; w(end-1:-1:1)]; +end + +% get time points +% --------------- +function [ timevals, timeindices ] = gettimes(frames, tlimits, timevar, winsize, ntimevar, causal, verbose); +timevect = linspace(tlimits(1), tlimits(2), frames); +srate = 1000*(frames-1)/(tlimits(2)-tlimits(1)); + +if isempty(timevar) % no pre-defined time points + if ntimevar(1) > 0 + % generate linearly space vector + % ------------------------------ + if (ntimevar > frames-winsize) + ntimevar = frames-winsize; + if ntimevar < 0 + error('Not enough data points, reduce the window size or lowest frequency'); + end; + verboseprintf(verbose, ['Value of ''timesout'' must be <= frame-winsize, ''timesout'' adjusted to ' int2str(ntimevar) '\n']); + end + npoints = ntimevar(1); + wintime = 500*winsize/srate; + if strcmpi(causal, 'on') + timevals = linspace(tlimits(1)+2*wintime, tlimits(2), npoints); + else timevals = linspace(tlimits(1)+wintime, tlimits(2)-wintime, npoints); + end; + verboseprintf(verbose, 'Generating %d time points (%1.1f to %1.1f ms)\n', npoints, min(timevals), max(timevals)); + else + % subsample data + % -------------- + nsub = -ntimevar(1); + if strcmpi(causal, 'on') + timeindices = [ceil(winsize+nsub):nsub:length(timevect)]; + else timeindices = [ceil(winsize/2+nsub/2):nsub:length(timevect)-ceil(winsize/2)-1]; + end; + timevals = timevect( timeindices ); % the conversion at line 741 leaves timeindices unchanged + verboseprintf(verbose, 'Subsampling by %d (%1.1f to %1.1f ms)\n', nsub, min(timevals), max(timevals)); + end; +else + timevals = timevar; + % check boundaries + % ---------------- + wintime = 500*winsize/srate; + if strcmpi(causal, 'on') + tmpind = find( (timevals >= tlimits(1)+2*wintime-0.0001) & (timevals <= tlimits(2)) ); + else tmpind = find( (timevals >= tlimits(1)+wintime-0.0001) & (timevals <= tlimits(2)-wintime+0.0001) ); + end; + % 0.0001 account for numerical innacuracies on opteron computers + if isempty(tmpind) + error('No time points. Reduce time window or minimum frequency.'); + end; + if length(timevals) ~= length(tmpind) + verboseprintf(verbose, 'Warning: %d out of %d time values were removed (now %3.2f to %3.2f ms) so the lowest\n', ... + length(timevals)-length(tmpind), length(timevals), timevals(tmpind(1)), timevals(tmpind(end))); + verboseprintf(verbose, ' frequency could be computed with the requested accuracy\n'); + end; + timevals = timevals(tmpind); +end; + +% find closet points in data +% -------------------------- +timeindices = round(eeg_lat2point(timevals, 1, srate, tlimits, 1E-3)); +if length(timeindices) < length(unique(timeindices)) + timeindices = unique_bc(timeindices) + verboseprintf(verbose, 'Warning: duplicate times, reduce the number of output times\n'); +end; +if length(unique(timeindices(2:end)-timeindices(1:end-1))) > 1 + verboseprintf(verbose, 'Finding closest points for time variable\n'); + verboseprintf(verbose, 'Time values for time/freq decomposition is not perfectly uniformly distributed\n'); +else + verboseprintf(verbose, 'Distribution of data point for time/freq decomposition is perfectly uniform\n'); +end; +timevals = timevect(timeindices); + +% DEPRECATED, FOR C INTERFACE +function nofunction() +% C PART %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +filename = [ 'tmpcrossf' num2str(round(rand(1)*1000)) ]; +f = fopen([ filename '.in'], 'w'); +fwrite(f, tmpsaveall, 'int32'); +fwrite(f, g.detret, 'int32'); +fwrite(f, g.srate, 'int32'); +fwrite(f, g.maxfreq, 'int32'); +fwrite(f, g.padratio, 'int32'); +fwrite(f, g.cycles, 'int32'); +fwrite(f, g.winsize, 'int32'); +fwrite(f, g.timesout, 'int32'); +fwrite(f, g.subitc, 'int32'); +fwrite(f, g.type, 'int32'); +fwrite(f, trials, 'int32'); +fwrite(f, g.naccu, 'int32'); +fwrite(f, length(X), 'int32'); +fwrite(f, X, 'double'); +fwrite(f, Y, 'double'); +fclose(f); + +command = [ '!cppcrosff ' filename '.in ' filename '.out' ]; +eval(command); + +f = fopen([ filename '.out'], 'r'); +size1 = fread(f, 'int32', 1); +size2 = fread(f, 'int32', 1); +Rreal = fread(f, 'double', [size1 size2]); +Rimg = fread(f, 'double', [size1 size2]); +Coher.R = Rreal + j*Rimg; +Boot.Coherboot.R = []; +Boot.Rsignif = []; + +function verboseprintf(verbose, varargin) +if strcmpi(verbose, 'on') + fprintf(varargin{:}); +end; + diff --git a/code/eeglab13_4_4b/functions/timefreqfunc/timewarp.m b/code/eeglab13_4_4b/functions/timefreqfunc/timewarp.m new file mode 100644 index 0000000..9dc9db3 --- /dev/null +++ b/code/eeglab13_4_4b/functions/timefreqfunc/timewarp.m @@ -0,0 +1,97 @@ +% timewarp() - Given two event marker vectors, computes a matrix +% that can be used to warp a time series so that its +% evlatencies match newlatencies. Values of the warped +% timeserie that falls between two frames in the original +% timeserie will be linear interpolated. +% Usage: +% >> warpmat = timewarp(evlatency, newlatency) +% +% Necessary inputs: +% evlatency - [vector] event markers in the original time series, in frames +% Markers must be ordered by increasing frame latency. +% If you want to warp the entire time-series, make sure +% the first (1) and last frames are in the vector. +% newlatency - [vector] desired warped event time latencies. The original +% time series will be warped so that the frame numbers of its +% events (see evlatency above) match the frame numbers in +% newlatency. newlatency frames must be sorted by ascending +% latency. Both vectors must be the same length. +% +% Optional outputs: +% warpmat - [matrix] Multiplying this matrix with the original +% time series (column) vectors performs the warping. +% +% Example: +% % In 10-frame vectors, warp frames 3 and 5 to frames 4 and 8, +% % respectively. Generate a matrix to warp data epochs in +% % variable 'data' of size (10,k) +% >> warpmat = timewarp([1 3 5 10], [1 4 8 10]) +% >> warped_data = warpmat*data; +% +% Authors: Jean Hausser, SCCN/INC/UCSD, 2006 +% +% See also: angtimewarp(), phasecoher(), erpimage() +% +function M=timewarp(evLatency, newLatency) + M = [0]; + if min(sort(evLatency) == evLatency) == 0 + error('evLatency should be in ascending order'); + return; + end + if min(sort(newLatency) == newLatency) == 0 + error('newLatency should be in ascending order'); + return; + end + if length(evLatency) ~= length(newLatency) + error('evLatency and newLatency must have the same length.'); + return; + end + if length(evLatency) < 2 | length(newLatency) < 2 + error(['There should be at least two events in evlatency and ' ... + 'newlatency (e.g., "begin" and "end")'] ); + return; + end + if evLatency(1) ~= 1 + disp(['Assuming old and new time series beginnings are synchronized.']); + disp(['Make sure you have defined an ending event in both the old and new time series!']); + evLatency(end+1)=1; + newLatency(end+1)=1; + evLatency = sort(evLatency); + newLatency = sort(newLatency); + end + + t = 1:max(evLatency); + + for k=1:length(evLatency)-1 + for i=evLatency(k):evLatency(k+1)-1 + tp(i) = (t(i)-evLatency(k)) * ... + (newLatency(k+1) - newLatency(k))/... + (evLatency(k+1) - evLatency(k)) + ... + newLatency(k); + end + end + + + % Check what's going on at tp(max(newLatency)), should equal t(max(evLatency)) + tp(max(evLatency)) = max(newLatency); + ts = tp-min(newLatency)+1; + +% $$$ M = sparse(max(newLatency)-min(newLatency)+1, max(evLatency)); + M = zeros(max(newLatency)-min(newLatency)+1, max(evLatency)); + + k = 0; + for i=1:size(M,1) + while i > ts(k+1) + k = k+1; + end +% $$$ k = k-1; + + if k == 0 + % Check wether i == ts(1) and i == 1 + % In that case, M(1,1) = 1 + M(1,1) = 1; + else + M(i,k) = 1 - (i-ts(k))/(ts(k+1)-ts(k)); + M(i,k+1) = 1 - (ts(k+1)-i)/(ts(k+1)-ts(k)); + end + end diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/ADJUST.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/ADJUST.m new file mode 100644 index 0000000..c803482 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/ADJUST.m @@ -0,0 +1,546 @@ + +% ADJUST() - Automatic EEG artifact Detector +% with Joint Use of Spatial and Temporal features +% +% Usage: +% >> [art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... +% soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, nuovaV, soglia_D, maxdin]=ADJUST (EEG,out) +% +% Inputs: +% EEG - current dataset structure or structure array (has to be epoched) +% out - (string) report file name +% +% Outputs: +% art - List of artifacted ICs +% horiz - List of HEM ICs +% vert - List of VEM ICs +% blink - List of EB ICs +% disc - List of GD ICs +% soglia_DV - SVD threshold +% diff_var - SVD feature values +% soglia_K - TK threshold +% meanK - TK feature values +% soglia_SED - SED threshold +% SED - SED feature values +% soglia_SAD - SAD threshold +% SAD - SAD feature values +% soglia_GDSF- GDSF threshold +% GDSF - GDSF feature values +% soglia_V - MEV threshold +% nuovaV - MEV feature values +% +% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ADJUST +% Automatic EEG artifact Detector based on the Joint Use of Spatial and Temporal features +% +% Developed 2007-2014 +% Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% Last update: 02/05/2014 by Marco Buiatti +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Reference paper: +% Mognon A, Jovicich J, Bruzzone L, Buiatti M, +% ADJUST: An Automatic EEG artifact Detector based on the Joint Use of Spatial and Temporal features. +% Psychophysiology 48 (2), 229-240 (2011). +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% VERSIONS LOG +% +% 02/05/14: Modified text in Report.txt (MB). +% +% 30/03/14: Removed 'message to the user' (redundant). (MB) +% +% 22/03/14: kurtosis is replaced by kurt for compatibility if signal processing +% toolbox is missing (MB). +% +% V2 (07 OCTOBER 2010) - by Andrea Mognon +% Added input 'nchannels' to compute_SAD and compute_SED_NOnorm; +% this is useful to differentiate the number of ICs (n) and the number of +% sensors (nchannels); +% bug reported by Guido Hesselman on October, 1 2010. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% function [art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, meanK, soglia_SED, SED, soglia_SAD, SAD, ... +% soglia_GDSF, GDSF, soglia_V, nuovaV, soglia_D, maxdin]=ADJUST (EEG,out) +function [art, horiz, vert, blink, disc,... + soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... + soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, nuovaV, soglia_D, maxdin]=ADJUST (EEG,out) + + +%% Settings + +% ---------------------------------------------------- +% | Change experimental settings in this section | +% ---------------------------------------------------- + +% ---------------------------------------------------- +% | Initial message to user: | +% ---------------------------------------------------- +% +% disp(' ') +% disp('Detects Horizontal and Vertical eye movements,') +% disp('Blinks and Discontinuities in dataset:') +% disp([EEG.filename]) +% disp(' ') + +% ---------------------------------------------------- +% | Collect useful data from EEG structure | +% ---------------------------------------------------- + +%number of ICs=size(EEG.icawinv,1); + +%number of time points=size(EEG.data,2); + +if length(size(EEG.data))==3 + + num_epoch=size(EEG.data,3); + +else + + num_epoch=0; + +end + +% Check the presence of ICA activations + +if isempty(EEG.icaact) + disp('EEG.icaact not present. Recomputed from data.'); + if length(size(EEG.data))==3 +% EEG.icaact = EEG.icaweights*EEG.icasphere*reshape(EEG.data, size(EEG.icawinv,1), num_epoch*size(EEG.data,2)); +% EEG.icaact = reshape(EEG.icaact,size(EEG.icawinv,1),size(EEG.data,2), num_epoch); + EEG.icaact = reshape(EEG.icaweights*EEG.icasphere*reshape(EEG.data,[size(EEG.data,1)... + size(EEG.data,2)*size(EEG.data,3)]),[size(EEG.data,1) size(EEG.data,2) size(EEG.data,3)]); + else EEG.icaact = EEG.icaweights*EEG.icasphere*EEG.data; + end +end + +topografie=EEG.icawinv'; %computes IC topographies + +% Topographies and time courses normalization +% +% disp(' '); +% disp('Normalizing topographies...') +% disp('Scaling time courses...') + +for i=1:size(EEG.icawinv,2) % number of ICs + + ScalingFactor=norm(topografie(i,:)); + + topografie(i,:)=topografie(i,:)/ScalingFactor; + + if length(size(EEG.data))==3 + EEG.icaact(i,:,:)=ScalingFactor*EEG.icaact(i,:,:); + else + EEG.icaact(i,:)=ScalingFactor*EEG.icaact(i,:); + end + +end +% +% disp('Done.') +% disp(' ') + +% Variables memorizing artifacted ICs indexes + +blink=[]; + +horiz=[]; + +vert=[]; + +disc=[]; + +%% Check EEG channel position information +nopos_channels=[]; +for el=1:length(EEG.chanlocs) + if(any(isempty(EEG.chanlocs(1,el).X)&isempty(EEG.chanlocs(1,el).Y)&isempty(EEG.chanlocs(1,el).Z)&isempty(EEG.chanlocs(1,el).theta)&isempty(EEG.chanlocs(1,el).radius))) + nopos_channels=[nopos_channels el]; + end; +end + +if ~isempty(nopos_channels) + warning(['Channels ' num2str(nopos_channels) ' have incomplete location information. They will NOT be used to compute ADJUST spatial features']); + disp(' '); +end; + +pos_channels=setdiff(1:length(EEG.chanlocs),nopos_channels); + +%% Feature extraction + +disp(' ') +disp('Features Extraction:') + +%GDSF - General Discontinuity Spatial Feature + +disp('GDSF - General Discontinuity Spatial Feature...') + +GDSF = compute_GD_feat(topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); + + +%SED - Spatial Eye Difference + +disp('SED - Spatial Eye Difference...') + +[SED,medie_left,medie_right]=computeSED_NOnorm(topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); + + +%SAD - Spatial Average Difference + +disp('SAD - Spatial Average Difference...') + +[SAD,var_front,var_back,mean_front,mean_back]=computeSAD(topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); + + +%SVD - Spatial Variance Difference between front zone and back zone + +diff_var=var_front-var_back; + +%epoch dynamic range, variance and kurtosis + +K=zeros(num_epoch,size(EEG.icawinv,2)); %kurtosis +Kloc=K; + +Vmax=zeros(num_epoch,size(EEG.icawinv,2)); %variance + +% disp('Computing variance and kurtosis of all epochs...') + +for i=1:size(EEG.icawinv,2) % number of ICs + + for j=1:num_epoch + Vmax(j,i)=var(EEG.icaact(i,:,j)); +% Kloc(j,i)=kurtosis(EEG.icaact(i,:,j)); + K(j,i)=kurt(EEG.icaact(i,:,j)); + end +end + +% check that kurt and kurtosis give the same values: +% [a,b]=max(abs(Kloc(:)-K(:))) + +%TK - Temporal Kurtosis + +disp('Temporal Kurtosis...') + +meanK=zeros(1,size(EEG.icawinv,2)); + +for i=1:size(EEG.icawinv,2) + if num_epoch>100 + meanK(1,i)=trim_and_mean(K(:,i)); + else meanK(1,i)=mean(K(:,i)); + end + +end + + +%MEV - Maximum Epoch Variance + +disp('Maximum epoch variance...') + +maxvar=zeros(1,size(EEG.icawinv,2)); +meanvar=zeros(1,size(EEG.icawinv,2)); + + +for i=1:size(EEG.icawinv,2) + if num_epoch>100 + maxvar(1,i)=trim_and_max(Vmax(:,i)'); + meanvar(1,i)=trim_and_mean(Vmax(:,i)'); + else + maxvar(1,i)=max(Vmax(:,i)); + meanvar(1,i)=mean(Vmax(:,i)); + end +end + +% MEV in reviewed formulation: + +nuovaV=maxvar./meanvar; + + + +%% Thresholds computation + +disp('Computing EM thresholds...') + +% soglia_K=EM(meanK); +% +% soglia_SED=EM(SED); +% +% soglia_SAD=EM(SAD); +% +% soglia_GDSF=EM(GDSF); +% +% soglia_V=EM(nuovaV); +[soglia_K,med1_K,med2_K]=EM(meanK); + +[soglia_SED,med1_SED,med2_SED]=EM(SED); + +[soglia_SAD,med1_SAD,med2_SAD]=EM(SAD); + +[soglia_GDSF,med1_GDSF,med2_GDSF]=EM(GDSF); + +[soglia_V,med1_V,med2_V]=EM(nuovaV); + +%% Output file header + +% ---------------------------------------------------- +% | Opens report file and writes header | +% ---------------------------------------------------- + +file=fopen(out,'w'); + +fprintf(file,'ADJUST\n'); + +fprintf(file,'Automatic EEG artifacts Detector with Joint Use of Spatial and Temporal features\n\n'); + +fprintf(file,'Andrea Mognon and Marco Buiatti (2009-2014)\n\n'); + +fprintf(file,['Analyzed dataset: ' EEG.filename '\n']); + +fprintf(file,['Analysis date: ' date '\n']); + +fprintf(file,'Analysis carried out on the %d Independent Components\n\n',size(EEG.icawinv,2)); + + +%% Horizontal eye movements (HEM) + +disp(' '); +disp('Artifact Identification:'); +disp('Horizontal Eye Movements...') + +% ---------------------------------------------------- +% | Writes HEM header in the report file | +% ---------------------------------------------------- + +fprintf(file,'> HEM - Horizontal movements\n\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'SED - Spatial eye difference (threshold=%f)\n',soglia_SED); + +fprintf(file,'MEV - Maximum epoch variance (threshold=%f)\n\n',soglia_V); + +fprintf(file,'ICs with Horizontal eye movements:\n'); + +horiz=intersect(intersect(find(SED>=soglia_SED),find(medie_left.*medie_right<0)),... + (find(nuovaV>=soglia_V))); + +hor_bool=1; %true if there are artifacted ICs + +if isempty(horiz) %no IC found + + fprintf(file,'/ \n'); + + hor_bool=0; + +else + + fprintf(file,[num2str(horiz) '\n']); + fprintf(file,'\n'); + +end + + + +%% Vertical eye movements (VEM) + +disp('Vertical Eye Movements...') + +% ---------------------------------------------------- +% | Writes VEM header in the report file | +% ---------------------------------------------------- + + +fprintf(file,'>> VEM - Vertical movements\n\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'SAD - Spatial average difference (threshold=%f)\n',soglia_SAD); + +fprintf(file,'MEV - Maximum epoch variance (threshold=%f)\n\n',soglia_V); + +fprintf(file,'ICs with Vertical eye movements:\n'); + + + + +vert=intersect(intersect(find(SAD>=soglia_SAD),find(medie_left.*medie_right>0)),... + intersect(find(diff_var>0),find(nuovaV>=soglia_V))); + + + +ver_bool=1; %true if there are artifacted ICs + +if isempty(vert) %no artifact found + + fprintf(file,'/ \n'); + + ver_bool=0; +else + + fprintf(file,[num2str(vert) '\n']); + fprintf(file,'\n'); +end + + + + +%% Eye Blink (EB) + +disp('Eye Blinks...') + +% ---------------------------------------------------- +% | Writes EB header in the report file | +% ---------------------------------------------------- + +fprintf(file,'>>> EB - Blinks\n\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'SAD (threshold=%f)\n',soglia_SAD); + +fprintf(file,'TK - Temporal kurtosis (threshold=%f)\n\n',soglia_K); + +fprintf(file,'ICs with Blinks:\n'); + + + +blink=intersect ( intersect( find(SAD>=soglia_SAD),find(medie_left.*medie_right>0) ) ,... + intersect ( find(meanK>=soglia_K),find(diff_var>0) )); + + + +bl_bool=1; %true if there are artifacted ICs + +if isempty(blink) %no blink component + + fprintf(file,'/ \n'); + + bl_bool=0; +else + + fprintf(file,[num2str(blink) '\n']); + fprintf(file,'\n'); +end + + + +%% Generic Discontinuities (GD) + +disp('Generic Discontinuities...') + +% ---------------------------------------------------- +% | Writes GD header in the report file | +% ---------------------------------------------------- + +fprintf(file,'>>>> GD - Discontinuities\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'GDSF - Generic Discontinuities Spatial Feature (threshold=%f)\n',soglia_GDSF); + +fprintf(file,'MEV - Maximum epoch variance (threshold=%f)\n\n',soglia_V); + +fprintf(file,'ICs with Generic Discontinuities:\n'); + + +disc=intersect(find(GDSF>=soglia_GDSF),find(nuovaV>=soglia_V)); + +dsc_bool=1; %true if there are discontinuities + +if isempty(disc) %no discontinuities + + fprintf(file,'/ \n'); + + dsc_bool=0; +else + + fprintf(file,[num2str(disc) '\n']); + fprintf(file,'\n'); +end + +aic=unique([blink disc horiz vert]); + +fprintf(file,'Artifacted ICs (total):\n'); + fprintf(file,[num2str(aic) '\n']); + fprintf(file,'\n'); + + + +%% Displaying results + +% ---------------------------------------------------- +% | Write message to user: report file name | +% ---------------------------------------------------- + +disp(' ') +disp(['Results in <' out '>.']) + + +fclose(file); + +%compute output variable +art = nonzeros( union (union(blink,horiz) , union(vert,disc)) )'; %artifact ICs + +% these three are old outputs which are no more necessary in latest ADJUST version. +soglia_D=0; +soglia_DV=0; +maxdin=zeros(1,size(EEG.icawinv,2)); + +return + +%% The following sections have been moved to interface_ADJ in order to manage +%% continuous data + +% +% %% Saving artifacted ICs for further analysis +% +% nome=['List_' EEG.setname '.mat']; +% +% save (nome, 'blink', 'horiz', 'vert', 'disc'); +% +% disp(' ') +% disp(['Artifact ICs list saved in ' nome]); +% +% +% %% IC show & remove +% % show all ICs; detected ICs are highlighted in red color. Based on +% % pop_selectcomps. +% +% art = nonzeros( union (union(blink,horiz) , union(vert,disc)) )'; %artifact ICs +% +% % [EEG] = pop_selectcomps_ADJ( EEG, 1:size(EEG.icawinv,1), art, horiz, vert, blink, disc,... +% % soglia_DV, diff_var, soglia_K, meanK, soglia_SED, SED, soglia_SAD, SAD, ... +% % soglia_TDR, topog_DR, soglia_V, maxvar, soglia_D, maxdin ); +% [EEG] = pop_selectcomps_ADJ( EEG, 1:size(EEG.icawinv,1), art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... +% soglia_GDSF, med2_GDSF, topog_DR, soglia_V, med2_V, maxvar, soglia_D, maxdin ); + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/EM.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/EM.m new file mode 100644 index 0000000..1cf8a23 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/EM.m @@ -0,0 +1,184 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% EM - ADJUST package +% +% Performs automatic threshold on the digital numbers +% of the input vector 'vec'; based on Expectation - Maximization algorithm + +% Reference paper: +% Bruzzone, L., Prieto, D.F., 2000. Automatic analysis of the difference image +% for unsupervised change detection. +% IEEE Trans. Geosci. Remote Sensing 38, 1171:1182 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Usage: +% >> [last,med1,med2,var1,var2,prior1,prior2]=EM(vec); +% +% Input: vec (row vector, to be thresholded) +% +% Outputs: last (threshold value) +% med1,med2 (mean values of the Gaussian-distributed classes 1,2) +% var1,var2 (variance of the Gaussian-distributed classes 1,2) +% prior1,prior2 (prior probabilities of the Gaussian-distributed classes 1,2) +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function [last,med1,med2,var1,var2,prior1,prior2]=EM(vec) + +if size(vec,2)>1 + len=size(vec,2); %number of elements +else + vec=vec'; + len=size(vec,2); +end + +c_FA=1; % False Alarm cost +c_MA=1; % Missed Alarm cost + +med=mean(vec); +standard=std(vec); +mediana=(max(vec)+min(vec))/2; + +alpha1=0.01*(max(vec)-mediana); % initialization parameter/ righthand side +alpha2=0.01*(mediana-min(vec)); % initialization parameter/ lefthand side + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% EXPECTATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +train1=[]; % Expectation of class 1 +train2=[]; +train=[]; % Expectation of 'unlabeled' samples + +for i=1:(len) + if (vec(i)<(mediana-alpha2)) + train2=[train2 vec(i)]; + elseif (vec(i)>(mediana+alpha1)) + train1=[train1 vec(i)]; + else + train=[train vec(i)]; + end +end + +n1=length(train1); +n2=length(train2); + +med1=mean(train1); +med2=mean(train2); +prior1=n1/(n1+n2); +prior2=n2/(n1+n2); +var1=var(train1); +var2=var(train2); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% MAXIMIZATION +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +count=0; +dif_med_1=1; % difference between current and previous mean +dif_med_2=1; +dif_var_1=1; % difference between current and previous variance +dif_var_2=1; +dif_prior_1=1; % difference between current and previous prior +dif_prior_2=1; +stop=0.0001; + +while((dif_med_1>stop)&&(dif_med_2>stop)&&(dif_var_1>stop)&&(dif_var_2>stop)&&(dif_prior_1>stop)&&(dif_prior_2>stop)) + + count=count+1; + + med1_old=med1; + med2_old=med2; + var1_old=var1; + var2_old=var2; + prior1_old=prior1; + prior2_old=prior2; + prior1_i=[]; + prior2_i=[]; + + % FOLLOWING FORMULATION IS ACCORDING TO REFERENCE PAPER: + + for i=1:len + prior1_i=[prior1_i prior1_old*Bayes(med1_old,var1_old,vec(i))/... + (prior1_old*Bayes(med1_old,var1_old,vec(i))+prior2_old*Bayes(med2_old,var2_old,vec(i)))]; + prior2_i=[prior2_i prior2_old*Bayes(med2_old,var2_old,vec(i))/... + (prior1_old*Bayes(med1_old,var1_old,vec(i))+prior2_old*Bayes(med2_old,var2_old,vec(i)))]; + end + + + prior1=sum(prior1_i)/len; + prior2=sum(prior2_i)/len; + med1=sum(prior1_i.*vec)/(prior1*len); + med2=sum(prior2_i.*vec)/(prior2*len); + var1=sum(prior1_i.*((vec-med1_old).^2))/(prior1*len); + var2=sum(prior2_i.*((vec-med2_old).^2))/(prior2*len); + + dif_med_1=abs(med1-med1_old); + dif_med_2=abs(med2-med2_old); + dif_var_1=abs(var1-var1_old); + dif_var_2=abs(var2-var2_old); + dif_prior_1=abs(prior1-prior1_old); + dif_prior_2=abs(prior2-prior2_old); + +end + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% THRESHOLDING +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +k=c_MA/c_FA; +a=(var1-var2)/2; +b= ((var2*med1)-(var1*med2)); +c=(log((k*prior1*sqrt(var2))/(prior2*sqrt(var1)))*(var2*var1))+(((((med2)^2)*var1)-(((med1)^2)*var2))/2); +rad=(b^2)-(4*a*c); +if rad<0 + disp('Negative Discriminant!'); + return; +end + +soglia1=(-b+sqrt(rad))/(2*a); +soglia2=(-b-sqrt(rad))/(2*a); + +if ((soglia1med1)) + last=soglia2; +else + last=soglia1; +end + +if isnan(last) % TO PREVENT CRASHES + last=mediana; +end + +return + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function prob=Bayes(med,var,point) +if var==0 + prob=1; +else + prob=((1/(sqrt(2*pi*var)))*exp((-1)*((point-med)^2)/(2*var))); +end + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/INSTALLATION.txt b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/INSTALLATION.txt new file mode 100644 index 0000000..fc4a5a9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/INSTALLATION.txt @@ -0,0 +1,17 @@ + +ADJUST - Automatic EEG artifact Detection with Joint Use of Spatial and Temporal features + +This package runs in EEGLAB. +Please copy this folder into your EEGLAB plugins directory, e.g. here: + +/home/[...]/eeglab13_4_4b/plugins/ + +and then run EEGLAB; ADJUST should appear in the menu Tools -> ADJUST1.1.1 +NOTE: Perform ICA before running ADJUST. ICA is a necessary step. + + +2009-2015 Marco Buiatti +Center for Mind/Brain Sciences, University of Trento, Italy + +Support contact: adjust.staff@gmail.com + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/LICENSE.txt b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/LICENSE.txt new file mode 100644 index 0000000..10926e8 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/LICENSE.txt @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/computeSAD.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/computeSAD.m new file mode 100644 index 0000000..5255bdf --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/computeSAD.m @@ -0,0 +1,109 @@ + +% computeSAD() - Computes Spatial Average Difference feature +% +% Usage: +% >> [rapp,var_front,var_back,mean_front,mean_back]=computeSAD(topog,chanlocs,n); +% +% Inputs: +% topog - topographies vector +% chanlocs - EEG.chanlocs struct +% n - number of ICs +% nchannels - number of channels +% +% Outputs: +% rapp - SAD values +% var_front - Frontal Area variance values +% var_back - Posterior Area variance values +% mean_front - Frontal Area average values +% mean_back - Posterior Area average values +% +% +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function [rapp,var_front,var_back,mean_front,mean_back]=computeSAD(topog,chanlocs,n) + +nchannels=length(chanlocs); + +%% Define scalp zones + +% Find electrodes in Frontal Area (FA) +dimfront=0; %number of FA electrodes +index1=zeros(1,nchannels); %indexes of FA electrodes + +for k=1:nchannels + if (abs(chanlocs(1,k).theta)<60) && (chanlocs(1,k).radius>0.40) %electrodes are in FA + dimfront=dimfront+1; %count electrodes + index1(1,dimfront)=k; + end +end + + % Find electrodes in Posterior Area (PA) + dimback=0; + index3=zeros(1,nchannels); + for h=1:nchannels + if (abs(chanlocs(1,h).theta)>110) + dimback=dimback+1; + index3(1,dimback)=h; + end + end + + if dimfront*dimback==0 + disp('ERROR: no channels included in some scalp areas.') + disp('Check channels distribution and/or change scalp areas definitions in computeSAD.m and computeSED_NOnorm.m') + disp('ADJUST session aborted.') + return + end + +%% Outputs + + rapp=zeros(1,n); % SAD + mean_front=zeros(1,n); % FA electrodes mean value + mean_back=zeros(1,n); % PA electrodes mean value + var_front=zeros(1,n); % FA electrodes variance value + var_back=zeros(1,n); % PA electrodes variance value + +%% Output computation + +for i=1:n % for each topography + + %create FA electrodes vector + front=zeros(1,dimfront); + for h=1:dimfront + front(1,h)=topog(i,index1(1,h)); + end + + %create PA electrodes vector + back=zeros(1,dimback); + for h=1:dimback + back(1,h)=topog(i,index3(1,h)); + end + + + + %compute features + + rapp(1,i)=abs(mean(front))-abs(mean(back)); % SAD + mean_front(1,i)=mean(front); + mean_back(1,i)=mean(back); + var_back(1,i)=var(back); + var_front(1,i)=var(front); + +end + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/computeSED_NOnorm.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/computeSED_NOnorm.m new file mode 100644 index 0000000..49b3140 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/computeSED_NOnorm.m @@ -0,0 +1,121 @@ + +% computeSED_NOnorm() - Computes Spatial Eye Difference feature +% without normalization +% +% Usage: +% >> [out,medie_left,medie_right]=computeSED_NOnorm(topog,chanlocs,n); +% +% Inputs: +% topog - topographies vector +% chanlocs - EEG.chanlocs struct +% n - number of ICs +% nchannels - number of channels +% +% Outputs: +% out - SED values +% medie_left - Left Eye area average values +% medie_right- Right Eye area average values +% +% +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [out,medie_left,medie_right]=computeSED_NOnorm(topog,chanlocs,n) + +nchannels=length(chanlocs); + +%% Define scalp zones + +% Find electrodes in Left Eye area (LE) +dimleft=0; %number of LE electrodes +index1=zeros(1,nchannels); %indexes of LE electrodes + +for k=1:nchannels + if (-610.30) %electrodes are in LE + dimleft=dimleft+1; %count electrodes + index1(1,dimleft)=k; + end +end + + % Find electrodes in Right Eye area (RE) + dimright=0; %number of RE electrodes + index2=zeros(1,nchannels); %indexes of RE electrodes + for g=1:nchannels + if (340.30) %electrodes are in RE + dimright=dimright+1; %count electrodes + index2(1,dimright)=g; + end + end + + % Find electrodes in Posterior Area (PA) + dimback=0; + index3=zeros(1,nchannels); + for h=1:nchannels + if (abs(chanlocs(1,h).theta)>110) + dimback=dimback+1; + index3(1,dimback)=h; + end + end + + if dimleft*dimright*dimback==0 + disp('ERROR: no channels included in some scalp areas.') + disp('Check channels distribution and/or change scalp areas definitions in computeSAD.m and computeSED_NOnorm.m') + disp('ADJUST session aborted.') + return + end + + %% Outputs + + out=zeros(1,n); %memorizes SED + medie_left=zeros(1,n); %memorizes LE mean value + medie_right=zeros(1,n); %memorizes RE mean value + +%% Output computation + +for i=1:n % for each topography + %create LE electrodes vector + left=zeros(1,dimleft); + for h=1:dimleft + left(1,h)=topog(i,index1(1,h)); + end + + %create RE electrodes vector + right=zeros(1,dimright); + for h=1:dimright + right(1,h)=topog(i,index2(1,h)); + end + + %create PA electrodes vector + back=zeros(1,dimback); + for h=1:dimback + back(1,h)=topog(i,index3(1,h)); + end + + + + %compute features + out1=abs(mean(left)-mean(right)); + out2=var(back); + out(1,i)=out1; % SED not notmalized + medie_left(1,i)=mean(left); + medie_right(1,i)=mean(right); + + +end + + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/compute_GD_feat.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/compute_GD_feat.m new file mode 100644 index 0000000..eea71e8 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/compute_GD_feat.m @@ -0,0 +1,71 @@ +% compute_GD_feat() - Computes Generic Discontinuity spatial feature +% +% Usage: +% >> res = compute_GD_feat(topografie,canali,num_componenti); +% +% Inputs: +% topografie - topographies vector +% canali - EEG.chanlocs struct +% num_componenti - number of components +% +% Outputs: +% res - GDSF values + +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function res = compute_GD_feat(topografie,canali,num_componenti) + +% Computes GDSF, discontinuity spatial feature +% topografie is the topography weights matrix +% canali is the structure EEG.chanlocs +% num_componenti is the number of ICs +% res is GDSF values + +xpos=[canali.X];ypos=[canali.Y];zpos=[canali.Z]; +pos=[xpos',ypos',zpos']; + +res=zeros(1,num_componenti); + +for ic=1:num_componenti + + % consider the vector topografie(ic,:) + + aux=[]; + + for el=1:length(canali)-1 + + P=pos(el,:); %position of current electrode + d=pos-repmat(P,length(canali),1); + %d=pos-repmat(P,62,1); + dist=sqrt(sum((d.*d),2)); + + [y,I]=sort(dist); + repchas=I(2:11); % list of 10 nearest channels to el + weightchas=exp(-y(2:11)); % respective weights, computed wrt distance + + aux=[aux abs(topografie(ic,el)-mean(weightchas.*topografie(ic,repchas)'))]; + % difference between el and the average of 10 neighbors + % weighted according to weightchas + end + + res(ic)=max(aux); + +end + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/eegplugin_adjust.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/eegplugin_adjust.m new file mode 100644 index 0000000..7dd6abb --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/eegplugin_adjust.m @@ -0,0 +1,40 @@ + +% eegplugin_adjust() - Plugin for running ADJUST algorithm on EEG data. +% +% Usage: +% >> eegplugin_adjust( fig, try_strings, catch_strings); +% +% Inputs: +% +% fig - [integer] EEGLAB figure +% try_strings - [struct] "try" strings for menu callbacks. +% catch_strings - [struct] "catch" strings for menu callbacks. +% +% +% Copyright (C) 2009-2015 Andrea Mognon (1) and Marco Buiatti (1,2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function eegplugin_adjust( fig, try_strings, catch_strings) +plotmenu = findobj(fig, 'tag', 'tools'); +uimenu(plotmenu, 'label', 'ADJUST1.1.1', 'callback', ... + [try_strings.no_check '[ALLEEG,EEG,CURRENTSET,LASTCOM]= pop_ADJUST_interface( ALLEEG,EEG,CURRENTSET );eeglab redraw;' catch_strings.add_to_hist ]); + + + + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/interface_ADJ.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/interface_ADJ.m new file mode 100644 index 0000000..4612772 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/interface_ADJ.m @@ -0,0 +1,181 @@ + +% interface_ADJ() - Run ADJUST algorithm on EEG data +% +% Usage: +% >> EEG=interface_ADJ(EEG,report); +% +% Inputs and outputs: +% EEG - current dataset structure or structure array +% +% Input: +% report - (string) report file name +% +% +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +% +% +% REVISION HISTORY: +% +% 09/04/14: dir and filename removed from call of the function because +% unused (MB). +% +% 30/03/14: line 51: added test for ICA and for number of ICs = number of channels +% (MB). +% +% 20/03/14: line 73 commented out to avoid baseline removal. MB. + +function EEG = interface_ADJ (EEG,report) + +% Epoching + + % ---------------------------------------------------- + % | NOTE: epochs are extracted ONLY to make | + % | ArtifactADJUST run | + % ---------------------------------------------------- + +% Check that ICA has been computed +if isempty(EEG.icaweights) + warning('Please compute ICA before running ADJUST.'); + return; +end; + +% Check that number of ICs = number of channels +if size(EEG.icaweights,1)> vett=mat2vec(mat); +% +% Input: +% mat - 2D or 3D matrix +% +% Output: +% vett - vector +% +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function vett=mat2vec(mat) + +if ndims(mat)==2 + M=size(mat,1); + N=size(mat,2); + vett=zeros(1,M*N); + for i=1:M + for j=1:N + vett(1,(i-1)*N+j)=mat(i,j); + end + end +end + +if ndims(mat)==3 + I=size(mat,1); + M=size(mat,2); + N=size(mat,3); + vett=zeros(1,I*M*N); + inter=zeros(I,M*N); +% for i=1:I +% +% for k=1:M +% for l=1:N +% inter(i,(k-1)*N+l)=mat(i,k,l); +% end +% end +% +% end +% +% for i=1:I +% for j=1:M*N +% vett(1,(i-1)*M*N+j)=inter(i,j); +% end +% end + + +%%% for epoch-divided EEG data: + for i=1:I + + for l=1:N + for k=1:M + inter(i,(l-1)*M+k)=mat(i,k,l); + end + end + + end + + for i=1:I + for j=1:M*N + vett(1,(i-1)*M*N+j)=inter(i,j); + end + end + +end + + + \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_ADJUST_interface.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_ADJUST_interface.m new file mode 100644 index 0000000..af8b67e --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_ADJUST_interface.m @@ -0,0 +1,74 @@ +% pop_ADJUST_interface() - running ADJUST algorithm on EEG data +% +% Usage: +% >> [ALLEEG,EEG,CURRENTSET,com] = pop_ADJUST_interface ( +% ALLEEG,EEG,CURRENTSET ); +% +% Inputs and outputs: +% ALLEEG - array of EEG dataset structures +% EEG - current dataset structure or structure array +% CURRENTSET - index(s) of the current EEG dataset(s) in ALLEEG +% +% +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +% +% +% REVISION HISTORY: +% 09/04/14: Filter/Gross Artifact Rejection/ICA have been removed (MB). + + +function [ALLEEG,EEG,CURRENTSET,com] = pop_ADJUST_interface ( ALLEEG,EEG,CURRENTSET ) + +% the command output is a hidden output that does not have to +% be described in the header + +com = ''; % this initialization ensure that the function will return something + % if the user press the cancel button + +% display help if not enough arguments +% ------------------------------------ +if nargin < 1 + help pop_ADJUST_interface; + return; +end; + +%% select operations to be done: display list + +% messages={'Filter the data';'Remove Gross Artifacts and Perform ICA'; 'Run ADJUST'}; +% +% [Selection,ok] = listdlg('ListString',messages,'Name','ADJUST User Interface',... +% 'PromptString','Select operations to be done:',... +% 'OKString','Start Processing','SelectionMode','multiple','ListSize',[300 100]); + +disp(' ') +disp (['Running ADJUST on dataset ' strrep(EEG.filename, '.set', '') '.set']) +promptstr = { 'Enter Report file name (in quote): '}; +inistr = { '''report.txt''' }; +result = inputdlg2( promptstr, 'ADJUST User Interface', 1, inistr, 'pop_ADJUST_interface'); +if length( result ) == 0 return; end; + +report = eval( [ '[' result{1} ']' ] ); + +[EEG] = interface_ADJ (EEG,report); + +% return the string command +% ------------------------- +com = sprintf('pop_ADJUST_interface( %s );', EEG.filename); + +return; diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_prop_ADJ.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_prop_ADJ.m new file mode 100644 index 0000000..9edbe53 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_prop_ADJ.m @@ -0,0 +1,477 @@ +% pop_prop_ADJ() - overloaded pop_prop() for ADJUST plugin. +% plot the properties of a channel or of an independent component. +% ADJUST feature values are also shown (normalized wrt threshold). +% +% +% Usage: +% >> com = pop_prop_ADJ(EEG, typecomp, numcompo, winhandle, is_H, is_V, is_B, is_D,... +% soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... +% soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, maxvar, soglia_D, maxdin) +% +% Inputs: +% EEG - current dataset structure or structure array +% typecomp - [0|1] compute electrode property (1) or component +% property (0). Default is 1. +% numcompo - channel or component number +% winhandle - if this parameter is present or non-NaN, buttons for the +% rejection of the component are drawn. If +% non-zero, this parameter is used to backpropagate +% the color of the rejection button. +% is_H - (bool) true if plotted IC is HEM +% is_V - (bool) true if plotted IC is VEM +% is_B - (bool) true if plotted IC is EB +% is_D - (bool) true if plotted IC is GD +% soglia_DV - feature1 (SVD) threshold +% diff_var - feature1 (SVD) vector +% soglia_K - feature2 (TK) threshold +% meanK - feature2 (TK) vector +% soglia_SED - feature3 (SED) threshold +% SED - feature3 (SED) vector +% soglia_SAD - feature4 (SAD) threshold +% SAD - feature4 (SAD) vector +% soglia_TDR - feature5 (SDR) threshold +% topog_DR - feature5 (SDR) vector +% soglia_V - feature6 (MEV) threshold +% maxvar - feature6 (MEV) vector +% soglia_D - feature7 (MEDR) threshold +% maxdin - feature7 (MEDR) vector +% + +% ORIGINAL HELP: +% pop_prop() - plot the properties of a channel or of an independent +% component. +% Usage: +% >> pop_prop( EEG, typecomp); % pops up a query window +% >> pop_prop( EEG, typecomp, chan, winhandle); +% +% Inputs: +% EEG - dataset structure (see EEGGLOBAL) +% typecomp - [0|1] compute electrode property (1) or component +% property (0). Default is 1. +% chan - channel or component number +% winhandle - if this parameter is present or non-NaN, buttons for the +% rejection of the component are drawn. If +% non-zero, this parameter is used to backpropagate +% the color of the rejection button. +% spectral_options - [cell array] cell arry of options for the spectopo() +% function. +% + +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +% +% +% +% VERSIONS LOG +% +% 26/03/14: +% + +function com = pop_prop_ADJ(EEG, typecomp, numcompo, winhandle, is_H, is_V, is_B, is_D,... + soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... + soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, maxvar, soglia_D, maxdin) %,spec_opt) + +com = ''; +if nargin < 1 + help pop_prop_ADJ; + return; +end; + +if nargin == 1 + typecomp = 1; +end; +if typecomp == 0 & isempty(EEG.icaweights) + error('No ICA weights recorded for this set, first run ICA'); +end; +if nargin == 2 + promptstr = { fastif(typecomp,'Channel number to plot:','Component number to plot:') ... + 'Spectral options (see spectopo help):' }; + inistr = { '1' '''freqrange'', [2 50]' }; + result = inputdlg2( promptstr, 'Component properties - pop_prop_ADJ()', 1, inistr, 'pop_prop_ADJ'); + if size( result, 1 ) == 0 return; end; + + numcompo = eval( [ '[' result{1} ']' ] ); + spec_opt = eval( [ '{' result{2} '}' ] ); +end; + +% plotting several component properties - STILL TO CHANGE +% ------------------------------------- +if length(numcompo) > 1 + for index = numcompo + pop_prop(EEG, typecomp, index); + end; + com = sprintf('pop_prop( %s, %d, [%s]);', inputname(1), typecomp, int2str(numcompo)); + return; +end; + +if numcompo < 1 | numcompo > EEG.nbchan + error('Component index out of range'); +end; + +% assumed input is numcompo +% ------------------------- +try, icadefs; +catch, + BACKCOLOR = [0.8 0.8 0.8]; + GUIBUTTONCOLOR = [0.8 0.8 0.8]; +end; +basename = [fastif(typecomp,'Channel ', 'Component ') int2str(numcompo) ]; + +fh = figure('name', ['pop_prop_ADJ() - ' basename ' properties'], 'color', BACKCOLOR, 'numbertitle', 'off', 'visible', 'off'); +pos = get(gcf,'Position'); +set(gcf,'Position', [pos(1) pos(2)-500+pos(4) 500 500], 'visible', 'on'); +pos = get(gca,'position'); % plot relative to current axes +hh = gca; +q = [pos(1) pos(2) 0 0]; +s = [pos(3) pos(4) pos(3) pos(4)]./100; +axis off; + +% plotting topoplot +% ----------------- +h = axes('Units','Normalized', 'Position',[-10 65 40 35].*s+q); + +%topoplot( EEG.icawinv(:,numcompo), EEG.chanlocs); axis square; + +if typecomp == 1 % plot single channel locations + topoplot( numcompo, EEG.chanlocs, 'chaninfo', EEG.chaninfo, ... + 'electrodes','off', 'style', 'blank', 'emarkersize1chan', 12); axis square; +else % plot component map + topoplot( EEG.icawinv(:,numcompo), EEG.chanlocs, 'chaninfo', EEG.chaninfo, ... + 'shading', 'interp', 'numcontour', 3); axis square; +end; +basename = [fastif(typecomp,'Channel ', 'IC') int2str(numcompo) ]; +% title([ basename fastif(typecomp, ' location', ' map')], 'fontsize', 14); +title(basename, 'fontsize', 12); + +% plotting erpimage +% ----------------- +hhh = axes('Units','Normalized', 'Position',[45 67 48 33].*s+q); %era height 38 +eeglab_options; +if EEG.trials > 1 + % put title at top of erpimage + axis off + hh = axes('Units','Normalized', 'Position',[45 67 48 33].*s+q); + EEG.times = linspace(EEG.xmin, EEG.xmax, EEG.pnts); + if EEG.trials < 6 + ei_smooth = 1; + else + ei_smooth = 3; + end + if typecomp == 1 % plot component + offset = nan_mean(EEG.data(numcompo,:)); + erpimage( EEG.data(numcompo,:)-offset, ones(1,EEG.trials)*10000, EEG.times , ... + '', ei_smooth, 1, 'caxis', 2/3, 'cbar','erp'); + else % plot channel + if option_computeica + offset = nan_mean(EEG.icaact(numcompo,:)); + erpimage( EEG.icaact(numcompo,:)-offset, ones(1,EEG.trials)*10000, EEG.times , ... + '', ei_smooth, 1, 'caxis', 2/3, 'cbar','erp', 'yerplabel', ''); + else + + icaacttmp = (EEG.icaweights(numcompo,:) * EEG.icasphere) ... + * reshape(EEG.data(1:size(EEG.icaweights,1),:,:), EEG.nbchan, EEG.trials*EEG.pnts); +% icaacttmp = (EEG.icaweights(numcompo,:) * EEG.icasphere) ... +% * EEG.data(EEG.nbchan, EEG.trials*EEG.pnts); + offset = nan_mean(icaacttmp); + erpimage( icaacttmp-offset, ones(1,EEG.trials)*10000, EEG.times, ... + '', ei_smooth, 1, 'caxis', 2/3, 'cbar','erp', 'yerplabel', ''); + end; + end; + axes(hhh); + title(sprintf('%s activity \\fontsize{10}(global offset %3.3f)', basename, offset), 'fontsize', 12); +else + + % put title at top of erpimage + EI_TITLE = 'Continous data'; + axis off + hh = axes('Units','Normalized', 'Position',[45 62 48 38].*s+q); + ERPIMAGELINES = 200; % show 200-line erpimage + while size(EEG.data,2) < ERPIMAGELINES*EEG.srate + ERPIMAGELINES = round(0.9 * ERPIMAGELINES); + end + if ERPIMAGELINES > 2 % give up if data too small + if ERPIMAGELINES < 10 + ei_smooth == 1; + else + ei_smooth = 3; + end + erpimageframes = floor(size(EEG.data,2)/ERPIMAGELINES); + erpimageframestot = erpimageframes*ERPIMAGELINES; + eegtimes = linspace(0, erpimageframes-1, EEG.srate/1000); + if typecomp == 1 % plot component + offset = nan_mean(EEG.data(numcompo,:)); + erpimage( reshape(EEG.data(numcompo,1:erpimageframestot),erpimageframes,ERPIMAGELINES)-offset, ones(1,ERPIMAGELINES)*10000, eegtimes , ... + EI_TITLE, ei_smooth, 1, 'caxis', 2/3, 'cbar'); + else % plot channel + if option_computeica + offset = nan_mean(EEG.icaact(numcompo,:)); + erpimage( ... + reshape(EEG.icaact(numcompo,1:erpimageframestot),erpimageframes,ERPIMAGELINES)-offset, ... + ones(1,ERPIMAGELINES)*10000, eegtimes , ... + EI_TITLE, ei_smooth, 1, 'caxis', 2/3, 'cbar','yerplabel', ''); + else +% icaacttmp = reshape(EEG.icaweights(numcompo,:) * EEG.icasphere) ... +% * reshape(EEG.data, erpimageframes, ERPIMAGELINES); + + icaacttmp = EEG.icaweights(numcompo,:) * EEG.icasphere ... + *EEG.data(:,1:erpimageframes*ERPIMAGELINES); + + offset = nan_mean(icaacttmp); + erpimage( icaacttmp-offset, ones(1,ERPIMAGELINES)*10000, eegtimes, ... + EI_TITLE, ei_smooth, 1, 'caxis', 2/3, 'cbar', 'yerplabel', ''); + end; + end + else + axis off; + text(0.1, 0.3, [ 'No erpimage plotted' 10 'for small continuous data']); + end; + axes(hhh); +end; + +% plotting spectrum +% ----------------- +if ~exist('winhandle') + winhandle = NaN; +end; +if ~isnan(winhandle) + h = axes('units','normalized', 'position',[10 25 85 25].*s+q); + %h = axes('units','normalized', 'position',[5 10 95 35].*s+q); %%% + %CHANGE! +else + h = axes('units','normalized', 'position',[10 15 85 30].*s+q); + %h = axes('units','normalized', 'position',[5 0 95 40].*s+q); %%% + %CHANGE! +end; +%h = axes('units','normalized', 'position',[45 5 60 40].*s+q); +try + eeglab_options; + %next instr added for correct function! Andrea + option_computeica=1; + if typecomp == 1 + %[spectra freqs] = spectopo( EEG.data(numcompo,:), EEG.pnts, EEG.srate, spec_opt{:},'freqrange', [0 45] ); + [spectra freqs] = spectopo( EEG.data(numcompo,:), EEG.pnts, EEG.srate, 'freqrange', [0 45] ); + else + if option_computeica + + %[spectra freqs] = spectopo( EEG.icaact(numcompo,:), EEG.pnts, EEG.srate, 'mapnorm', EEG.icawinv(:,numcompo), spec_opt{:}, 'freqrange', [0 45]); + % CONTROL ADDED FOR CONTINUOUS DATA + if size(EEG.data,3)==1 + EEG.icaact = EEG.icaweights*EEG.icasphere*EEG.data; + end + [spectra freqs] = spectopo( EEG.icaact(numcompo,:), EEG.pnts, EEG.srate, 'mapnorm', EEG.icawinv(:,numcompo), 'freqrange', [0 45]); + else + if exist('icaacttmp')~=1, + + icaacttmp = (EEG.icaweights(numcompo,:)*EEG.icasphere)*reshape(EEG.data, EEG.nbchan, EEG.trials*EEG.pnts); + end; + + %[spectra freqs] = spectopo( icaacttmp, EEG.pnts, EEG.srate, 'mapnorm', EEG.icawinv(:,numcompo), spec_opt{:} ,'freqrange', [0 45]); + [spectra freqs] = spectopo( icaacttmp, EEG.pnts, EEG.srate, 'mapnorm', EEG.icawinv(:,numcompo), 'freqrange', [0 45]); + end; + end; + set(gca,'fontsize',8); + % set up new limits + % ----------------- + %freqslim = 50; + %set(gca, 'xlim', [0 min(freqslim, EEG.srate/2)]); + %spectra = spectra(find(freqs <= freqslim)); + %set(gca, 'ylim', [min(spectra) max(spectra)]); + + %tmpy = get(gca, 'ylim'); + %set(gca, 'ylim', [max(tmpy(1),-1) tmpy(2)]); + set( get(gca, 'ylabel'), 'string', 'Power 10*log_{10}(\muV^{2}/Hz)', 'fontsize', 8); + set( get(gca, 'xlabel'), 'string', 'Frequency (Hz)', 'fontsize', 8); + title('Activity power spectrum', 'fontsize', 12); +catch + axis off; + text(0.1, 0.3, [ 'Error: no spectrum plotted' 10 ' make sure you have the ' 10 'signal processing toolbox']); +end; + +% ---------------------------------------------------------------- +% plotting IC properties +% ----------------- +if ~exist('winhandle') + winhandle = NaN; +end; +if ~isnan(winhandle) + h = axes('units','normalized', 'position',[3 2 95 10].*s+q); +else + h = axes('units','normalized', 'position',[3 0 95 10].*s+q); +end; + +axis off +str='ADJUST - Detected as '; +if is_H + str=[str 'HEM ']; +end + if is_V + str=[str 'VEM ']; + end + if is_B + str=[str 'EB ']; + end + if is_D + str=[str 'GD']; + end + +if (is_H || is_V || is_B || is_D)==0 + str='ADJUST - Not detected'; +end +% text(0,0,[str 10 'TK ' num2str(meanK) '(' num2str(soglia_K) '); SAD ' num2str(SAD) '(' num2str(soglia_SAD) ... +% '); SVD ' num2str(diff_var) '(' num2str(soglia_DV) '); SED ' num2str(SED) '(' num2str(soglia_SED) ... +% ')' 10 'MEDR ' num2str(maxdin) '(' num2str(soglia_D) '); MEV ' num2str(maxvar) '(' num2str(soglia_V) ... +% '); SDR ' num2str(topog_DR) '(' num2str(soglia_TDR) ')'],'FontSize',8); + +% compute bar graph entries +% E=[ SAD/soglia_SAD SED/soglia_SED GDSF/soglia_GDSF maxvar/soglia_V meanK/soglia_K]; +E=[(SAD-med2_SAD)/(soglia_SAD-med2_SAD) (SED-med2_SED)/(soglia_SED-med2_SED) (GDSF-med2_GDSF)/(soglia_GDSF-med2_GDSF) (maxvar-med2_V)/(soglia_V-med2_V) (meanK-med2_K)/(soglia_K-med2_K)]; + +% set bar colors +C={[1 0 0],[.6 0 .2],[1 1 0],[0 1 0], [0 1 1]}; +% horizontal line +l=ones([1, length(E)+2]); +% plot +plot(0:length(E)+1 , l , 'Linewidth',2,'Color','k'); +hold on +for i=1:length(E) + v=zeros(1,length(E)); + v(i)=E(i); + bar(v,'facecolor',C{i}); + title(str); + set(gca,'XTickLabel',{'';'SAD';'SED';'GDSF';'MEV';'TK';''},'YTickLabel',{'0';'Threshold';'2*Threshold'},'YLim',[0 2]) +end + + + + +% ----------------------------------------------------------------- + + +% display buttons +% --------------- + +if ~isnan(winhandle) + COLREJ = '[1 0.6 0.6]'; + COLACC = '[0.75 1 0.75]'; + % CANCEL button + % ------------- + h = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', GUIBUTTONCOLOR, 'string', 'Cancel', 'Units','Normalized','Position',[-10 -10 15 6].*s+q, 'callback', 'close(gcf);'); + + % VALUE button + % ------------- + hval = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', GUIBUTTONCOLOR, 'string', 'Values', 'Units','Normalized', 'Position', [15 -10 15 6].*s+q); + + % REJECT button + % ------------- + status = EEG.reject.gcompreject(numcompo); + hr = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', eval(fastif(status,COLREJ,COLACC)), ... + 'string', fastif(status, 'REJECT', 'ACCEPT'), 'Units','Normalized', 'Position', [40 -10 15 6].*s+q, 'userdata', status, 'tag', 'rejstatus'); + command = [ 'set(gcbo, ''userdata'', ~get(gcbo, ''userdata''));' ... + 'if get(gcbo, ''userdata''),' ... + ' set( gcbo, ''backgroundcolor'',' COLREJ ', ''string'', ''REJECT'');' ... + 'else ' ... + ' set( gcbo, ''backgroundcolor'',' COLACC ', ''string'', ''ACCEPT'');' ... + 'end;' ]; + set( hr, 'callback', command); + + % HELP button + % ------------- + h = uicontrol(gcf, 'Style', 'pushbutton', 'backgroundcolor', GUIBUTTONCOLOR, 'string', 'HELP', 'Units','Normalized', 'Position', [65 -10 15 6].*s+q, 'callback', 'pophelp(''pop_prop_ADJ'');'); + + % OK button + % --------- + command = [ 'global EEG;' ... + 'tmpstatus = get( findobj(''parent'', gcbf, ''tag'', ''rejstatus''), ''userdata'');' ... + 'EEG.reject.gcompreject(' num2str(numcompo) ') = tmpstatus;' ]; + if winhandle ~= 0 + command = [ command ... + sprintf('if tmpstatus set(%3.15f, ''backgroundcolor'', %s); else set(%3.15f, ''backgroundcolor'', %s); end;', ... + winhandle, COLREJ, winhandle, COLACC)]; + end; + command = [ command 'close(gcf); clear tmpstatus' ]; + h = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'OK', 'backgroundcolor', GUIBUTTONCOLOR, 'Units','Normalized', 'Position',[90 -10 15 6].*s+q, 'callback', command); + + % draw the figure for statistical values + % -------------------------------------- + index = num2str( numcompo ); + command = [ ... + 'figure(''MenuBar'', ''none'', ''name'', ''Statistics of the component'', ''numbertitle'', ''off'');' ... + '' ... + 'pos = get(gcf,''Position'');' ... + 'set(gcf,''Position'', [pos(1) pos(2) 340 340]);' ... + 'pos = get(gca,''position'');' ... + 'q = [pos(1) pos(2) 0 0];' ... + 's = [pos(3) pos(4) pos(3) pos(4)]./100;' ... + 'axis off;' ... + '' ... + 'txt1 = sprintf(''(\n' ... + 'Entropy of component activity\t\t%2.2f\n' ... + '> Rejection threshold \t\t%2.2f\n\n' ... + ' AND \t\t\t----\n\n' ... + 'Kurtosis of component activity\t\t%2.2f\n' ... + '> Rejection threshold \t\t%2.2f\n\n' ... + ') OR \t\t\t----\n\n' ... + 'Kurtosis distibution \t\t\t%2.2f\n' ... + '> Rejection threhold\t\t\t%2.2f\n\n' ... + '\n' ... + 'Current thesholds sujest to %s the component\n\n' ... + '(after manually accepting/rejecting the component, you may recalibrate thresholds for future automatic rejection on other datasets)'',' ... + 'EEG.stats.compenta(' index '), EEG.reject.threshentropy, EEG.stats.compkurta(' index '), ' ... + 'EEG.reject.threshkurtact, EEG.stats.compkurtdist(' index '), EEG.reject.threshkurtdist, fastif(EEG.reject.gcompreject(' index '), ''REJECT'', ''ACCEPT''));' ... + '' ... + 'uicontrol(gcf, ''Units'',''Normalized'', ''Position'',[-11 4 117 100].*s+q, ''Style'', ''frame'' );' ... + 'uicontrol(gcf, ''Units'',''Normalized'', ''Position'',[-5 5 100 95].*s+q, ''String'', txt1, ''Style'',''text'', ''HorizontalAlignment'', ''left'' );' ... + 'h = uicontrol(gcf, ''Style'', ''pushbutton'', ''string'', ''Close'', ''Units'',''Normalized'', ''Position'', [35 -10 25 10].*s+q, ''callback'', ''close(gcf);'');' ... + 'clear txt1 q s h pos;' ]; + set( hval, 'callback', command); + if isempty( EEG.stats.compenta ) + set(hval, 'enable', 'off'); + end; + + % MODIFICA + %com = sprintf('pop_prop( %s, %d, %d, 0, %s);', inputname(1), typecomp, numcompo, vararg2str( { spec_opt } ) ); + com = sprintf('pop_prop_ADJ( %s, %d, %d, 0, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %s);',... + inputname(1), typecomp, numcompo, is_H, is_V, is_B, is_D,... + soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... + soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, maxvar, soglia_D, maxdin ); + +else + %com = sprintf('pop_prop( %s, %d, %d, NaN, %s);', inputname(1), typecomp, numcompo, vararg2str( { spec_opt } ) ); + com = sprintf('pop_prop_ADJ( %s, %d, %d, NaN, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %s);',... + inputname(1), typecomp, numcompo, is_H, is_V, is_B, is_D,... + soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... + soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, maxvar, soglia_D, maxdin ); + +end; + +return; + +function out = nan_mean(in) + + nans = find(isnan(in)); + in(nans) = 0; + sums = sum(in); + nonnans = ones(size(in)); + nonnans(nans) = 0; + nonnans = sum(nonnans); + nononnans = find(nonnans==0); + nonnans(nononnans) = 1; + out = sum(in)./nonnans; + out(nononnans) = NaN; + + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_selectcomps_ADJ.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_selectcomps_ADJ.m new file mode 100644 index 0000000..58f2c22 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/pop_selectcomps_ADJ.m @@ -0,0 +1,244 @@ + +% pop_selectcomps_ADJ() - Display components with button to vizualize their +% properties and feature values and label them for +% rejection. ADJUST detected ICs are highlighter in red +% color. Based on pop_selectcomps. +% +% Usage: +% >> [EEG,com] = pop_selectcomps_ADJ( EEG, compnum, art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... +% soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, maxvar, soglia_D, maxdin, fig ) +% +% Inputs: +% EEG - current dataset structure or structure array +% compnum - vector of component numbers +% art - vector of artifact components numbers +% horiz - vector of HEM components numbers +% vert - vector of VEM components numbers +% blink - vector of EB components numbers +% disc - vector of GD components numbers +% soglia_DV - feature1 (SVD) threshold +% diff_var - feature1 (SVD) vector +% soglia_K - feature2 (TK) threshold +% meanK - feature2 (TK) vector +% soglia_SED - feature3 (SED) threshold +% SED - feature3 (SED) vector +% soglia_SAD - feature4 (SAD) threshold +% SAD - feature4 (SAD) vector +% soglia_TDR - feature5 (SDR) threshold +% topog_DR - feature5 (SDR) vector +% soglia_V - feature6 (MEV) threshold +% maxvar - feature6 (MEV) vector +% soglia_D - feature7 (MEDR) threshold +% maxdin - feature7 (MEDR) vector +% +% Outputs: +% EEG - Output dataset with updated rejected components +% +% +% +% ORIGINAL FUNCTION HELP: +% pop_selectcomps() - Display components with button to vizualize their +% properties and label them for rejection. +% Usage: +% >> OUTEEG = pop_selectcomps( INEEG, compnum, art ); +% +% Inputs: +% INEEG - Input dataset +% compnum - vector of component numbers +% +% Output: +% OUTEEG - Output dataset with updated rejected components +% +% +% +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% function [EEG,com] = pop_selectcomps_ADJ( EEG, compnum, art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, meanK, soglia_SED, SED, soglia_SAD, SAD, ... +% soglia_GDSF, GDSF, soglia_V, maxvar, soglia_D, maxdin, fig ) +function [EEG,com] = pop_selectcomps_ADJ( EEG, compnum, art, horiz, vert, blink, disc,... + soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... + soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, maxvar, soglia_D, maxdin, fig ) + +COLREJ = '[1 0.6 0.6]'; +COLACC = '[0.75 1 0.75]'; +COLART = '[1 0 0]'; +PLOTPERFIG = 35; + +com = ''; +if nargin < 1 + help pop_selectcomps_ADJ; + return; +end; + +if nargin < 2 + promptstr = { 'Components to plot:' }; + initstr = { [ '1:' int2str(size(EEG.icaweights,1)) ] }; + + result = inputdlg2(promptstr, 'Reject comp. by map -- pop_selectcomps',1, initstr); + if isempty(result), return; end; + compnum = eval( [ '[' result{1} ']' ]); + + if length(compnum) > PLOTPERFIG + ButtonName=questdlg2(strvcat(['More than ' int2str(PLOTPERFIG) ' components so'],'this function will pop-up several windows'), ... + 'Confirmation', 'Cancel', 'OK','OK'); + if ~isempty( strmatch(lower(ButtonName), 'cancel')), return; end; + end; + +end; + +currentfigtag = ['selcomp' num2str(rand)]; % generate a random figure tag + +if length(compnum) > PLOTPERFIG + for index = 1:PLOTPERFIG:length(compnum) + fprintf('Drawing figure...\n'); + EEG = pop_selectcomps_ADJ(EEG, compnum([index:min(length(compnum),index+PLOTPERFIG-1)]), art, horiz, vert, blink, disc,... + soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... + soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, maxvar, soglia_D, maxdin); + end; + + com = [ 'pop_selectcomps(' inputname(1) ', ' vararg2str(compnum) ');' ]; + return; +end; + +if isempty(EEG.reject.gcompreject) + EEG.reject.gcompreject = zeros( size(EEG.icawinv,2)); +end; +try, icadefs; +catch, + BACKCOLOR = [0.8 0.8 0.8]; + GUIBUTTONCOLOR = [0.8 0.8 0.8]; +end; + +% set up the figure +% ----------------- +column =ceil(sqrt( length(compnum) ))+1; +rows = ceil(length(compnum)/column); +if ~exist('fig') + figure('name', [ 'Reject components by map - pop_selectcomps_ADJ() (dataset: ' EEG.setname ')'], 'tag', currentfigtag, ... + 'numbertitle', 'off', 'color', BACKCOLOR); + set(gcf,'MenuBar', 'none'); + pos = get(gcf,'Position'); + set(gcf,'Position', [pos(1) 20 800/7*column 600/5*rows]); + incx = 120; + incy = 110; + sizewx = 100/column; + if rows > 2 + sizewy = 90/rows; + else + sizewy = 80/rows; + end; + pos = get(gca,'position'); % plot relative to current axes + hh = gca; + q = [pos(1) pos(2) 0 0]; + s = [pos(3) pos(4) pos(3) pos(4)]./100; + axis off; +end; + +% figure rows and columns +% ----------------------- +if EEG.nbchan > 64 + disp('More than 64 electrodes: electrode locations not shown'); + plotelec = 0; +else + plotelec = 1; +end; +count = 1; +for ri = compnum + if exist('fig') + button = findobj('parent', fig, 'tag', ['comp' num2str(ri)]); + if isempty(button) + error( 'pop_selectcomps_ADJ(): figure does not contain the component button'); + end; + else + button = []; + end; + + if isempty( button ) + % compute coordinates + % ------------------- + X = mod(count-1, column)/column * incx-10; + Y = (rows-floor((count-1)/column))/rows * incy - sizewy*1.3; + + % plot the head + % ------------- + if ~strcmp(get(gcf, 'tag'), currentfigtag); + disp('Aborting plot'); + return; + end; + ha = axes('Units','Normalized', 'Position',[X Y sizewx sizewy].*s+q); + if plotelec + topoplot( EEG.icawinv(:,ri), EEG.chanlocs, 'verbose', ... + 'off', 'style' , 'fill', 'chaninfo', EEG.chaninfo); + else + topoplot( EEG.icawinv(:,ri), EEG.chanlocs, 'verbose', ... + 'off', 'style' , 'fill','electrodes','off', 'chaninfo', EEG.chaninfo); + end; + axis square; + + % plot the button + % --------------- + button = double(uicontrol(gcf, 'Style', 'pushbutton', 'Units','Normalized', 'Position',... + [X Y+sizewy sizewx sizewy*0.25].*s+q, 'tag', ['comp' num2str(ri)])); + command = sprintf('pop_prop_ADJ( %s, 0, %d, %3.15f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f);', ... + inputname(1), ri, button, ... + ~isempty(intersect(horiz,ri)), ~isempty(intersect(vert,ri)), ~isempty(intersect(blink,ri)), ~isempty(intersect(disc,ri)),... + soglia_DV, diff_var(ri), soglia_K, med2_K, meanK(ri), soglia_SED, med2_SED, SED(ri),... + soglia_SAD, med2_SAD, SAD(ri), soglia_GDSF, med2_GDSF, GDSF(ri), soglia_V, med2_V, maxvar(ri), soglia_D, maxdin(ri)); + set( button, 'callback', command ); + end; + + % MODIFY BUTTON COLOR: ARTIFACT IC? + if isempty( intersect(art,ri)) % NON ARTIFACT + set( button, 'backgroundcolor', eval(fastif(EEG.reject.gcompreject(ri), COLREJ,COLACC)), 'string', int2str(ri)); + else set( button, 'backgroundcolor', eval(fastif(EEG.reject.gcompreject(ri), COLREJ,COLART)), 'string', int2str(ri)); + end + + drawnow; + count = count +1; +end; + +% draw the bottom button +% ---------------------- +if ~exist('fig') + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'Cancel', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[-10 -10 15 sizewy*0.25].*s+q, 'callback', 'close(gcf); fprintf(''Operation cancelled\n'')' ); + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'Set threhsolds', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[10 -10 15 sizewy*0.25].*s+q, 'callback', 'pop_icathresh(EEG); pop_selectcomps( EEG, gcbf);' ); + if isempty( EEG.stats.compenta ), set(hh, 'enable', 'off'); end; + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'See comp. stats', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[30 -10 15 sizewy*0.25].*s+q, 'callback', ' ' ); + if isempty( EEG.stats.compenta ), set(hh, 'enable', 'off'); end; + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'See projection', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[50 -10 15 sizewy*0.25].*s+q, 'callback', ' ', 'enable', 'off' ); + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'Help', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[70 -10 15 sizewy*0.25].*s+q, 'callback', 'pophelp(''pop_selectcomps'');' ); + command = '[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); eegh(''[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);''); close(gcf)'; +% str1='R'; +% str2='rej'; +% command='rej=EEG.reject;[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);rej=EEG.reject;save(str1,str2);close(gcf)'; + hh = uicontrol(gcf, 'Style', 'pushbutton', 'string', 'OK', 'Units','Normalized', 'backgroundcolor', GUIBUTTONCOLOR, ... + 'Position',[90 -10 15 sizewy*0.25].*s+q, 'callback', command); + % sprintf(['eeg_global; if %d pop_rejepoch(%d, %d, find(EEG.reject.sigreject > 0), EEG.reject.elecreject, 0, 1);' ... + % ' end; pop_compproj(%d,%d,1); close(gcf); eeg_retrieve(%d); eeg_updatemenu; '], rejtrials, set_in, set_out, fastif(rejtrials, set_out, set_in), set_out, set_in)); +end; + +com = [ 'pop_selectcomps(' inputname(1) ', ' vararg2str(compnum) ');' ]; +return; diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/trim_and_max.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/trim_and_max.m new file mode 100644 index 0000000..8157a7e --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/trim_and_max.m @@ -0,0 +1,57 @@ + +% trim_and_max() - Computes maximum value from vector 'vettore' +% after removing the top 1% of the values +% (to be outlier resistant) +% +% Usage: +% >> valore=trim_and_max(vettore); +% +% Inputs: +% vettore - row vector +% +% Outputs: +% valore - result +% +% +% Author: Andrea Mognon, Center for Mind/Brain Sciences, University of +% Trento, 2009 + +% Motivation taken from the following comment to our paper: +% "On page 11 the authors motivate the use of the max5 function when computing +% Maximum Epoch Variance because the simple maximum would be too sensitive +% to spurious outliers. This is a good concern, however the max5 function would +% still be sensitive to spurious outliers for very large data sets. In other words, if +% the data set is large enough, one will be very likely to record more than five +% outliers. The authors should use a trimmed max function that computes the +% simple maximum after the top say .1% of the values have been removed from +% consideration. This rejection criteria scales appropriately with the size of the data +% set." + +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function valore=trim_and_max(vettore) + + +dim=floor(.01*size(vettore,2)); % = 1% of vector length + +tmp=sort(vettore); +valore= tmp(length(vettore)-dim); + + diff --git a/code/eeglab13_4_4b/plugins/ADJUST1.1.1/trim_and_mean.m b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/trim_and_mean.m new file mode 100644 index 0000000..c9b4ae4 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/ADJUST1.1.1/trim_and_mean.m @@ -0,0 +1,42 @@ + +% trim_and_mean() - Computes average value from vector 'vettore' +% after removing the top .1% of the values +% (to be outlier resistant) +% +% Usage: +% >> valore=trim_and_mean(vettore); +% +% Inputs: +% vettore - row vector +% +% Outputs: +% valore - result +% +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +function valore=trim_and_mean(vettore) + + +dim=floor(.01*size(vettore,2)); % = 1% of vector length + +tmp=sort(vettore); +valore= mean (tmp(1:(length(vettore)-dim))); + + diff --git a/code/eeglab13_4_4b/plugins/FASTER/FASTER manual.pdf b/code/eeglab13_4_4b/plugins/FASTER/FASTER manual.pdf new file mode 100644 index 0000000..6fd4887 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/FASTER/FASTER manual.pdf differ diff --git a/code/eeglab13_4_4b/plugins/FASTER/FASTER.m b/code/eeglab13_4_4b/plugins/FASTER/FASTER.m new file mode 100644 index 0000000..44565a5 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/FASTER.m @@ -0,0 +1,581 @@ +function FASTER(option_wrapper) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +startDir=option_wrapper.options.file_options.folder_name; +outDir=option_wrapper.options.file_options.output_folder_name; +chan_locs=option_wrapper.options.file_options.channel_locations; +is_bdf=option_wrapper.options.file_options.is_bdf==1; +using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; +resume=option_wrapper.options.file_options.resume; + +if ~using_ALLEEG + %[jpathname jf1 jf2 jf3]=fileparts(option_wrapper.options.job_filename); + [jpathname jf1 jf2]=fileparts(option_wrapper.options.job_filename); + Qname=[jf1 jf2 '_ProcQ.eegQ']; +else + Qname='ProcQ.eegQ'; +end + +is_processing=exist([startDir filesep Qname],'file'); + +if ((~ischar(chan_locs) || ~exist(chan_locs,'file')) && is_bdf) && ~is_processing + fprintf('Invalid channel location file.\n'); + return; +end + +if (~using_ALLEEG) + can_distribute=1; + if ~is_processing + if (resume) + if ~isempty(option_wrapper.options.file_options.plist) + plist=option_wrapper.options.file_options.plist; + nlist=option_wrapper.options.file_options.nlist; + oplist=option_wrapper.options.file_options.oplist; + else + if (is_bdf) + [plist nlist] = extsearchc(startDir,'.bdf',0); + else + % Assume .set if not .bdf + % Later versions may support other file formats + [plist nlist] = extsearchc(startDir,'.set',0); + end + oplist=cell(size(plist)); + + x=true(size(plist)); + for i=1:length(plist) + if length(plist{i})>12 + if strcmp(plist{i}(end-11:end),'Intermediate') + x(i)=0; + end + end + if isempty(outDir) + oplist{i}=plist{i}; + else + oplist{i}=outDir; + dir_structure=get_dir_structure(plist{i},startDir); + for k=1:length(dir_structure) + oplist{i}=[filepath filesep dir_structure{k}]; + if ~exist(oplist{i},'dir') + mkdir(oplist{i}); + end + end + end + end + plist={plist{x}}; + nlist={nlist{x}}; + oplist={oplist{x}}; + + option_wrapper.options.file_options.plist=plist; + option_wrapper.options.file_options.nlist=nlist; + option_wrapper.options.file_options.oplist=oplist; + end + else + if (is_bdf) + [plist nlist] = extsearchc(startDir,'.bdf',0); + else + % Assume .set if not .bdf + % Later versions may support other file formats + [plist nlist] = extsearchc(startDir,'.set',0); + end + oplist=cell(size(plist)); + x=true(size(plist)); + + filepath=option_wrapper.options.file_options.output_folder_name; + + for i=1:length(plist) + if length(plist{i})>12 + if strcmp(plist{i}(end-11:end),'Intermediate') + x(i)=0; + end + end + if isempty(outDir) + oplist{i}=plist{i}; + else + oplist{i}=outDir; + dir_structure=get_dir_structure(plist{i},startDir); + for k=1:length(dir_structure) + oplist{i}=[filepath filesep dir_structure{k}]; + if ~exist(oplist{i},'dir') + mkdir(oplist{i}); + end + end + end + end + plist={plist{x}}; + nlist={nlist{x}}; + oplist={oplist{x}}; + if (option_wrapper.options.file_options.make_subdirectories) + x = findrepeats(plist); + for i = 1:length(x) + if isempty(outDir) + try + mkdir(plist{x(i)},nlist{x(i)}(1:end-4)); + movefile([plist{x(i)} filesep nlist{x(i)}],[plist{x(i)} filesep nlist{x(i)}(1:end-4)],'f'); + if exist([plist{x(i)} filesep nlist{x(i)}(1:end-4) '.fdt'],'file') && ~is_bdf + movefile([plist{x(i)} filesep nlist{x(i)}(1:end-4) '.fdt'],[plist{x(i)} filesep nlist{x(i)}(1:end-4)],'f'); + end + plist{x(i)} = [plist{x(i)} filesep nlist{x(i)}(1:end-4)]; + oplist{x(i)} = plist{x(i)}; + catch + error('Error in organising files in %s\n',plist{x(i)}); + return; + end + else + try + if ~exist([outDir filesep nlist{x(i)}(1:end-4)],'dir') + mkdir(outDir,nlist{x(i)}(1:end-4)); + end + oplist{x(i)} = [outDir filesep nlist{x(i)}(1:end-4)]; + catch + error('Error in organising files in %s\n',plist{x(i)}); + return; + end + end + end + end + option_wrapper.options.file_options.plist=plist; + option_wrapper.options.file_options.nlist=nlist; + option_wrapper.options.file_options.oplist=oplist; + end + + % Changed the below from copyfile to direct write due to some weird + % permission issue that was probably only on one test computer. + % Works now anyway! + if ~isempty(chan_locs) + [clpathstr, clname, clext] = fileparts(chan_locs); + fid=0; + if ~isempty(outDir) && ~strcmp(outDir,clpathstr) + %copyfile(chan_locs,outDir,'f'); + fid=fopen([outDir filesep clname clext],'w'); + elseif ~strcmp(startDir,clpathstr) + %copyfile(chan_locs,startDir,'f'); + fid=fopen([startDir filesep clname clext],'w'); + end + if fid>0 + fid2=fopen(chan_locs,'r'); + while ~feof(fid2) + fprintf(fid,'%s',fgets(fid2)); + end + fclose(fid); + fclose(fid2); + end + end + + % Add stuff to save in the [startDir filesep 'ProcQ.eegQ'] file + Q.plist=plist; + Q.nlist=nlist; + Q.plist_rel=cell(0); + Q.oplist_rel=cell(0); + for v=1:length(plist) + Q.plist_rel{v}=find_relative_path(plist{v},startDir); + Q.oplist_rel{v}=find_relative_path(oplist{v},startDir); + end + Q.outDir_rel=cell(0); + if ~isempty(outDir) + Q.outDir_rel=find_relative_path(outDir,startDir); + end + my_comp_num=1; + Q.comp_nums=1; + Q.finished=0; + Q.processed=zeros(size(Q.plist)); + Q.errors=zeros(size(Q.plist)); + if resume + Q.next_file=option_wrapper.options.file_options.current_file_num; + else + Q.next_file=1; + end + save([startDir filesep Qname],'Q'); + else + my_queue_file=[]; + wait_and_lock(); + L=load([startDir filesep Qname],'-mat'); + Q=L.Q; + clear L; + % Recreate the path list from the relative path list, which are + plist=cell(size(Q.plist_rel)); + oplist=plist; + for v=1:length(Q.plist_rel) + plist{v} = make_relative_path(Q.plist_rel{v},startDir); + oplist{v} = make_relative_path(Q.oplist_rel{v},startDir); + end + %plist=Q.plist; + nlist=Q.nlist; + if ~isempty(Q.outDir_rel) + outDir = make_relative_path(Q.outDir_rel,startDir); + end + %fprintf('\n\nOutput directory is: %s\n\n',outDir); + my_comp_num=max(Q.comp_nums)+1; + Q.comp_nums=[Q.comp_nums my_comp_num]; + save_and_unlock(); + [clpathstr, clname, clext] = fileparts(chan_locs); + if ~isempty(outDir) + option_wrapper.options.file_options.channel_locations=[outDir filesep clname clext]; + else + option_wrapper.options.file_options.channel_locations=[startDir filesep clname clext]; + end + end +else + can_distribute=0; + if is_processing==1 + error('Can''t join a running jobfile if opened from EEGLAB. If this file is not being processed, reload it and reset the queue.'); + + % The below won't run, I may reinstate it at some point, but it's + % difficult to co-ordinate and may be pointless + c=clock; + months={'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec'}; + new_jobname=[sprintf('%d/%s/%d__%d-%d-%d___',c(3),months{c(2)},c(1),c(4),c(5),round(c(6))) option_wrapper.options.job_filename]; + warning(sprintf('This jobfile is running on another machine.\nA new jobfile will be created: %s',new_jobname)); %#ok + option_wrapper.option.job_filename=new_jobname; + return; + end + startDir=cd; + plist=zeros(evalin('base','size(ALLEEG);')); + %nlist=plist; + for v=1:length(plist) + plist(v)=evalin('base',sprintf('isempty(ALLEEG(%d).data);',v)); + end + ALLEEG_to_do=find(plist~=1); + plist=cell(length(ALLEEG_to_do)); + for v=1:length(plist) + plist{v}=ALLEEG_to_do(v); + oplist=cell(size(plist)); + if ~isempty(outDir) + oplist{v}=outDir; + else + oplist{v}=evalin('base',sprintf('(ALLEEG(%d).filepath);',plist{v})); + if isempty(oplist{v}) + oplist{v}=cd; + end + end + end + nlist=plist; + Q.plist=plist; + Q.nlist=nlist; + Q.plist_rel=plist; + my_comp_num=1; + Q.comp_nums=1; + Q.finished=0; + Q.processed=zeros(size(Q.plist)); + Q.errors=zeros(size(Q.plist)); + %Q.next_file=ALLEEG_to_do(1); + Q.next_file=1; + save([startDir filesep Qname],'Q'); + option_wrapper.options.file_options.plist=plist; + option_wrapper.options.file_options.nlist=nlist; + option_wrapper.options.file_options.oplist=oplist; +end + +if (~exist([startDir filesep 'Processing'],'dir')) + mkdir([startDir filesep 'Processing']); +end +if (~exist([startDir filesep 'Queue'],'dir')) + mkdir([startDir filesep 'Queue']); +end + +all_errors=cell(0); + +doing_distrib=0; +is_processing=1; +error_indices=zeros(size(plist)); +first_file=1; +had_error=0; +my_proc_file=[]; +make_processing_file(); +EEG_state=[]; +while (1) + %%%%%%%%%%%%%%%%%%%%% + % Before processing % + %%%%%%%%%%%%%%%%%%%%% + + % The queue system is there to ensure that multiple computers are not + % reading the options file simultaneously and so trying to process the + % same file! Also to make sure all computers have finished processing + % before the grand average is made. + + % Puts the current computer number in the queue + % and waits until other computers are done updating + % the queue file. Then opens the queue file, reads the + % current state to find the next file to process, then + % updates that for the next computer to read. If there + % is no next file, it marks the processing as finished. + my_queue_file=[]; + wait_and_lock(); + L=load([startDir filesep Qname],'-mat'); + Q=L.Q; + if ~first_file + if ~had_error + Q.processed(current_file)=1; + else + Q.errors(current_file)=1; + if option_wrapper.debug && exist('m','var') + if isempty(outDir) + if exist([startDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'file') + L=load([startDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'-mat'); + all_errors=L.all_errors; + end + all_errors{end+1,1}=m; + all_errors{end,2}=EEG_state; + save([startDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'all_errors','-mat'); + error_indices(current_file)=size(all_errors,1); + else + if exist([outDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'file') + L=load([outDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'-mat'); + all_errors=L.all_errors; + end + all_errors{end+1,1}=m; + all_errors{end,2}=EEG_state; + save([outDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'all_errors','-mat'); + error_indices(current_file)=size(all_errors,1); + end + end + end + end + had_error=0; + %if (~using_ALLEEG && Q.next_file>length(Q.plist)) || (using_ALLEEG && Q.next_file>max(ALLEEG_to_do)) + if Q.next_file>length(Q.plist) + Q.finished=1; + end + if Q.finished + Q.comp_nums=setdiff(Q.comp_nums,my_comp_num); + delete_processing_file(); + save_and_unlock(); + break; + end + + current_file=Q.next_file; + Q.next_file=Q.next_file+1; + + option_wrapper.options.file_options.current_file = [plist{current_file} filesep nlist{current_file}]; + option_wrapper.options.file_options.current_file_num=current_file; + if (~isempty(option_wrapper.options.job_filename)) + save(option_wrapper.options.job_filename,'option_wrapper','-mat'); + end + + save_and_unlock(); + + %%%%%%%%%%%%%% + % Processing % + %%%%%%%%%%%%%% + if (~isempty(option_wrapper.options.file_options.searchstring)) + searchstring2=option_wrapper.options.file_options.searchstring; + else + searchstring2=nlist{current_file}; + end + if ((using_ALLEEG && ~evalin('base',sprintf('isempty(ALLEEG(%d).data);',plist{current_file}))) || ~isempty(strfind(nlist{current_file},searchstring2)) ) + tic + fprintf('******************\n'); + fprintf('* File %.3d / %.3d *\n',current_file,length(nlist)); + fprintf('******************\n'); + + if (~using_ALLEEG) + %log_file = fopen([plist{current_file} filesep option_wrapper.options.file_options.file_prefix nlist{current_file}(1:end-4) '.log'],'a+'); + log_file = fopen([oplist{current_file} filesep option_wrapper.options.file_options.file_prefix nlist{current_file}(1:end-4) '.log'],'a+'); + else + log_file = fopen([oplist{current_file} filesep option_wrapper.options.file_options.file_prefix sprintf('FASTER_ALLEEG(%d).log',ALLEEG_to_do(current_file))],'a+'); + end + + try + FASTER_process(option_wrapper,log_file); + catch + m=lasterror; + fprintf('\nError - %s.\n',m.message); + try fclose(log_file); catch; end; + had_error=1; + end + else + fprintf('Skipped file.\n'); + end + + % After processing + first_file=0; +end + +%%%%%%%%%%%%%%%%%%%%%% +% Queueing Functions % +%%%%%%%%%%%%%%%%%%%%%% + function wait_and_lock() + % Find the last queue file, make one for this computer, then wait + % until the previous one is deleted + D=dir([startDir filesep 'Queue']); + N={D(:).name}; + N=setdiff(N,{'.','..'}); + N=str2double(N); + if isempty(N) + N=0; + end + next_queue_num=max(N)+1; + my_queue_file=[startDir filesep 'Queue' filesep sprintf('%d',next_queue_num)]; + fid=fopen(my_queue_file,'w'); + fclose(fid); + prev_queue_file=[startDir filesep 'Queue' filesep sprintf('%d',max(N))]; + said=0; + while max(N)>0 && exist(prev_queue_file,'file') + if ~said + fprintf('Waiting for removal of Queue file %s\n',prev_queue_file); + said=1; + end + pause(1); + end + assignin('caller','my_queue_file',my_queue_file); + end + function save_and_unlock() + save([startDir filesep Qname],'Q'); + pause(1); + delete(my_queue_file); + assignin('caller','my_queue_file',[]); + end + function make_processing_file() + my_proc_file=[startDir filesep 'Processing' filesep sprintf('%d',my_comp_num)]; + fid=fopen(my_proc_file,'w'); + fclose(fid); + assignin('caller','my_proc_file',my_proc_file); + end + function delete_processing_file() + delete(my_proc_file); + assignin('caller','my_proc_file',[]); + end + +%%%%%%%%%%%%%%%%%%% +% Post processing % +%%%%%%%%%%%%%%%%%%% + +if using_ALLEEG + evalin('base','EEG=ALLEEG(CURRENTSET);'); + evalin('base','eeglab redraw;'); +end + +D=dir([startDir filesep 'Processing']); +if length(D)>2 + fprintf('*******************\n'); + fprintf('* FASTER Finished *\n'); + fprintf('*******************\n'); + fprintf('Finished processing all my files. The last computer to finish processing will make the grand average.\n'); + return; +end + +if isempty(outDir) + top_log = fopen([startDir filesep option_wrapper.options.file_options.file_prefix 'FASTER.log'],'a'); + if exist([startDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'file') + L=load([startDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'-mat'); + all_errors=L.all_errors; + end +else + top_log = fopen([outDir filesep option_wrapper.options.file_options.file_prefix 'FASTER.log'],'a'); + if exist([outDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'file') + L=load([outDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'-mat'); + all_errors=L.all_errors; + end +end + +c=clock; +months={'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec'}; +fprintf(top_log,'\n%d/%s/%d %d:%d:%d\n',c(3),months{c(2)},c(1),c(4),c(5),round(c(6))); + +for v=1:length(plist) + if ~using_ALLEEG + fprintf(top_log,'%s%s%s:\n',plist{v},filesep,nlist{v}); + else + fprintf(top_log,'ALLEEG(%d):\n',v); + if Q.processed(v) + fprintf(top_log,'Processed successfully.\n'); + elseif Q.errors(v) + fprintf(top_log,'Error: %s. Load all_errors.mat and investigate all_errors{%d,1} for more info.\n',all_errors{error_indices(v),1}.message,error_indices(v)); + else + fprintf(top_log,'Skipped due to filename filter or empty ALLEEG dataset.\n'); + end + fprintf(top_log,'\n'); + end +end + +delete([startDir filesep Qname]); +if length(dir([startDir filesep 'Processing']))==2 + rmdir([startDir filesep 'Processing']); +end +if length(dir([startDir filesep 'Queue']))==2 + rmdir([startDir filesep 'Queue']); +end + +%%%%%%%%%%%%%%%%% +% Grand Average % +%%%%%%%%%%%%%%%%% + +FASTER_grandaverage(startDir,option_wrapper,all_errors,top_log,plist,nlist); + +%%%%%%%%%%%%% +% All done! % +%%%%%%%%%%%%% + +fprintf('*******************\n'); +fprintf('* FASTER Finished *\n'); +fprintf('* %.3d processed *\n',sum(Q.processed)); +fprintf('* %.3d errors *\n',sum(Q.errors)); +fprintf('* %.3d skipped *\n',length(plist)-sum(Q.processed)-sum(Q.errors)); +fprintf('*******************\n'); +fprintf(top_log,'\nFinished. %d processed, %d errors, %d skipped.\n',sum(Q.processed),sum(Q.errors),length(plist)-sum(Q.processed)-sum(Q.errors)); +fclose(top_log); + + function out_chan_locs = check_chan_locs(chan_locs,num_chans,num_exts) + fid = fopen(chan_locs,'r'); + if fid==-1 + out_chan_locs = -1; + return; + end + count=0; + x=''; + while ~feof(fid) + x = fgetl(fid); + if ~isempty(x) + count = count+1; + end + end + if count < num_chans + num_exts + out_chan_locs = -1; + fclose(fid); + return; + end + if count == num_chans + num_exts + out_chan_locs = chan_locs; + fclose(fid); + return; + end + frewind(fid); + fid2 = fopen(['tempchanloc' chan_locs(end-4:end)],'w'); + count2 = 0; + while ~feof(fid) + x = fgets(fid); + if (count2 < num_chans || count - count2 <= num_exts) + fprintf(fid2,'%s',x); + end + count2 = count2 + 1; + end + fclose(fid); + fclose(fid2); + out_chan_locs = ['tempchanloc' chan_locs(end-4:end)]; + end + + function indices = findrepeats(input) + indices=zeros(size(input)); + for u=1:length(input) + indices(u)=sum(strcmp(input{u},input)); + end + indices=find(indices>1); + end + +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/FASTER_GUI.m b/code/eeglab13_4_4b/plugins/FASTER/FASTER_GUI.m new file mode 100644 index 0000000..5fb8cb2 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/FASTER_GUI.m @@ -0,0 +1,651 @@ +% FASTER GUI v1.2.1b - see manual for help. + +function varargout=FASTER_GUI(varargin) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity +% College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Options file format: +% option_wrapper (top level struct) +% option_wrapper.job_name - filename where the options file is stored +% option_wrapper. +% option_wrapper.current_group - current group of options displayed +% (modified by clicking e.g. "Filter Options" button) +% option_wrapper.last_value - last option number in the option group +% clicked (used for double-click window open functionality) + +FASTER_version='1.2.2b'; + +if nargout==1 + from_EEGLAB=1; +else + from_EEGLAB=0; +end + +set(0,'Units','pixels'); +screensize = get(0,'ScreenSize'); +screensize = screensize(1,[3 4]); +%The normal window works down to 800*600, it's pretty unlikely anyone with a smaller res +%display will be running this script anyway +figurepos = [(screensize(1)-720)/2 (screensize(2)-450)/2 720 450]; +figurepos = round(figurepos); +bgcolor = [0.9 0.9 0.9]; +if (from_EEGLAB) + %bgcolor = [1 0.1 0.3]; + bgcolor=get(findobj('-regexp','Name','EEGLAB'),'Color'); +end + +%%%%%%%%%%%%%%%%%%%%%%% +%%%%% MAIN WINDOW %%%%% +%%%%%%%%%%%%%%%%%%%%%%% + +fh = figure; +set(fh,'DockControls','off','Visible','on','Position',figurepos,'MenuBar','none','Toolbar','none','Color',bgcolor,'Resize','off','Name','FASTER EEG Processing v1.2.1b','NumberTitle','off','NextPlot','new'); +set(fh,'Units','Normalized'); +set(0,'Units','normalized'); + +all_options=struct; + +mainpanel=uipanel('Parent',fh,'Units','Normalized','Position',[0 0 1 1],'BackgroundColor',bgcolor); +optpanel=uipanel('Parent',mainpanel); +option_box=uicontrol('Parent',optpanel,'Tag','option_box'); +init_options(); + +bGO = uicontrol('Parent',mainpanel,'Style','pushbutton','String','Run Job','FontSize',24,'FontWeight','bold','Units','Normalized','Position',[0.51 0.01 0.48 0.25],'Callback',{@FASTER_callbacks,'run_FASTER',option_box},'Interruptible','off','BusyAction','cancel'); + +lHeading = uicontrol('Parent',mainpanel,'Style','text','String','Setup', 'FontSize',24,'Units','Normalized','Position',[0.51 0.88 0.49 0.12],'BackgroundColor',bgcolor); + +bFolder = uicontrol('Parent',mainpanel,'Style','pushbutton','String','Job directory:', 'FontSize',14,'Units','Normalized','Position',[0.51 0.8275 0.18 0.07],'BackgroundColor',bgcolor); +tbFolder = uicontrol('Parent',mainpanel,'Style','edit','String','','FontSize',14,'HorizontalAlign','center','Units','Normalized','Position',[0.70 0.8275 0.28 0.07],'UserData','file_options.folder_name'); +bOFolder = uicontrol('Parent',mainpanel,'Style','pushbutton','String','Output directory:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.75 0.18 0.07],'BackgroundColor',bgcolor); +tbOFolder = uicontrol('Parent',mainpanel,'Style','edit','String','','FontSize',14,'HorizontalAlign','center','Units','Normalized','Position',[0.70 0.75 0.28 0.07],'UserData','file_options.output_folder_name'); +bChanLocs = uicontrol('Parent',mainpanel,'Style','pushbutton','String','Channel locations:', 'FontSize',11,'Units','Normalized','Position',[0.51 0.6725 0.18 0.07],'BackgroundColor',bgcolor); +tbChanLocs = uicontrol('Parent',mainpanel,'Style','edit','String','','FontSize',14,'HorizontalAlign','center','Units','Normalized','Position',[0.70 0.6725 0.28 0.07],'UserData','file_options.channel_locations','FontSize',12); +set(tbFolder,'Callback',{@FASTER_callbacks,'update_value',option_box}); +set(tbOFolder,'Callback',{@FASTER_callbacks,'update_value',option_box}); +set(tbChanLocs,'Callback',{@FASTER_callbacks,'update_value',option_box}); +set(bFolder,'Callback',{@FASTER_callbacks,'folderselect',tbFolder,'Select job folder',option_box}); +set(bOFolder,'Callback',{@FASTER_callbacks,'folderselect',tbOFolder,'Select output folder',option_box}); +set(bChanLocs,'Callback',{@FASTER_callbacks,'fileselect',tbChanLocs,'Select channel location file',option_box}); +lFileType = uicontrol('Parent',mainpanel,'Style','text','String','File type:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.575 0.18 0.08],'BackgroundColor',bgcolor); +ddFileType = uicontrol('Parent',mainpanel,'Style','popupmenu','String',{'BDF file (Biosemi)','SET file (EEGLAB)'},'FontSize',14,'HorizontalAlign','center','Units','Normalized','Position',[0.70 0.585 0.28 0.08],'UserData','file_options.is_bdf','FontSize',12,'Callback',{@FASTER_callbacks,'update_value',option_box}); +lSearchString = uicontrol('Parent',mainpanel,'Style','text','String','File filter:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.5275 0.18 0.06],'BackgroundColor',bgcolor); +tbSearchString = uicontrol('Parent',mainpanel,'Style','edit','String','','FontSize',14,'HorizontalAlign','center','Units','Normalized','Position',[0.70 0.5375 0.28 0.06],'UserData','file_options.searchstring'); +set(tbSearchString,'Callback',{@FASTER_callbacks,'update_value',option_box}); +lPrefix = uicontrol('Parent',mainpanel,'Style','text','String','Output file prefix:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.46 0.18 0.06],'BackgroundColor',bgcolor); +tbPrefix = uicontrol('Parent',mainpanel,'Style','edit','String','','FontSize',12,'HorizontalAlign','center','Units','Normalized','Position',[0.7 0.47 0.28 0.06],'UserData','file_options.file_prefix'); +set(tbPrefix,'Callback',{@FASTER_callbacks,'update_value',option_box}); +if (~from_EEGLAB) + lSubdirs = uicontrol('Parent',mainpanel,'Style','text','String','Individual folders:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.40 0.18 0.06],'BackgroundColor',bgcolor); + cbSubdirs = uicontrol('Parent',mainpanel,'Style','checkbox','String','','FontSize',14,'Units','Normalized','Position',[0.83 0.4075 0.15 0.06],'UserData','file_options.make_subdirectories','BackgroundColor',bgcolor); + set(cbSubdirs,'Callback',{@FASTER_callbacks,'update_value',option_box}); + lResume = uicontrol('Parent',mainpanel,'Style','text','String','Resume:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.345 0.18 0.06],'BackgroundColor',bgcolor); + cbResume = uicontrol('Parent',mainpanel,'Style','checkbox','String','','FontSize',14,'Units','Normalized','Position',[0.83 0.3525 0.15 0.06],'UserData','file_options.resume','BackgroundColor',bgcolor); + set(cbResume,'Callback',{@FASTER_callbacks,'update_value',option_box}); + lResume_num = uicontrol('Parent',mainpanel,'Style','text','String','','HorizontalAlign','right', 'FontSize',12,'Units','Normalized','Position',[0.93 0.345 0.05 0.06],'BackgroundColor',bgcolor,'UserData','file_options.current_file_num'); + other_handles=[tbFolder tbOFolder tbChanLocs ddFileType tbSearchString tbPrefix cbSubdirs cbResume lResume_num bFolder]; +else + set([bFolder,tbFolder,lFileType,ddFileType],'Enable','off'); + set(lSearchString,'String','Setname filter:'); + lSaveEEG = uicontrol('Parent',mainpanel,'Style','text','String','Save datasets:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.40 0.18 0.06],'BackgroundColor',bgcolor); + cbSaveEEG = uicontrol('Parent',mainpanel,'Style','checkbox','String','','FontSize',14,'Units','Normalized','Position',[0.83 0.4075 0.15 0.06],'UserData','file_options.save_ALLEEG','BackgroundColor',bgcolor); + set(cbSaveEEG,'Callback',{@FASTER_callbacks,'update_value',option_box}); + lOverwrite = uicontrol('Parent',mainpanel,'Style','text','String','Overwrite datasets:', 'FontSize',12,'Units','Normalized','Position',[0.51 0.345 0.18 0.06],'BackgroundColor',bgcolor); + cbOverwrite = uicontrol('Parent',mainpanel,'Style','checkbox','String','','FontSize',14,'Units','Normalized','Position',[0.83 0.3525 0.15 0.06],'UserData','file_options.overwrite_ALLEEG','BackgroundColor',bgcolor); +% set(cbResume,'Callback',{@FASTER_callbacks,'update_value',option_box}); +% other_handles=[tbFolder tbOFolder tbChanLocs ddFileType tbSearchString tbPrefix cbSaveEEG cbResume bFolder]; + other_handles=[tbFolder tbOFolder tbChanLocs ddFileType tbSearchString tbPrefix cbSaveEEG bFolder]; +end + +bSave = uicontrol('Parent',mainpanel,'Style','pushbutton','String','Save job','FontSize',14,'Units','Normalized','Position',[0.51 0.265 0.235 0.09],'Callback',{@FASTER_callbacks,'save_job',option_box}); +bLoad = uicontrol('Parent',mainpanel,'Style','pushbutton','String','Load job','FontSize',14,'Units','Normalized','Position',[0.755 0.265 0.235 0.09],'Callback',{@FASTER_callbacks,'open_job',option_box,std_options}); + +% Options panel + +set(optpanel,'Parent',mainpanel,'Units','Normalized','Position',[0.01 0.01 0.49 0.98],'BackgroundColor',bgcolor); +uicontrol('Parent',optpanel,'FontSize',20,'Style','text','String','Options','Units','Normalized','Position',[0.3 0.9 0.4 0.1],'BackgroundColor',bgcolor); + +y=0.03; +x=0.05; +h=0.35; +w=0.9; +set(option_box,'Parent',optpanel,'Style','listbox','String','','Units','Normalized','Position',[x y w h]); + +uicontrol('Parent',optpanel,'FontSize',12,'Style','text','String','Function','Units','Normalized','Position',[0.1 0.82 0.5 0.05],'BackgroundColor',bgcolor); +uicontrol('Parent',optpanel,'FontSize',12,'Style','text','String','Save','Units','Normalized','Position',[0.72 0.82 0.12 0.05],'BackgroundColor',bgcolor); + +% Set of options and corresponding window functions for each function group +list_filter={'High pass on','High pass frequency','High pass options','Low pass on','Low pass frequency','Low pass options','Notch on','Notch frequency','Notch options','Resample'}; +list_channels={'Reference channel','EEG channels','External channels','Known bad channels','Interpolate after ICA','Channel rejection','Rejection options'}; +list_epoch={'Markered epoching','Unmarkered epoching','Epoch limits','Baseline subtraction','Epoch rejection','Rejection options'}; +list_ICA={'Run ICA','Channels for ICA','ICA k value','Keep existing ICA weights','Save component topographies as images','ICA component rejection','Rejection options'}; +list_epoch_interp={'Epoch interpolation','Rejection options'}; +list_GA={'Make grand average','Grand average markers','Grand average length','Trimmed mean','Subject removal','Rejection options'}; + +set(option_box,'String',list_filter); %Set to display the filter settings initially + +x1=0.1; +x2=0.71; +x3=0.76; +y=0.75; +filter_button = uicontrol('Parent',optpanel,'FontSize',14,'Style','pushbutton','String','Filter','Value',1,'Units','Normalized','Position',[x1 y 0.5 0.055],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'changelist',option_box,list_filter,1},'UserData',[0 1]); +filter_save = uicontrol('Parent',optpanel,'Style','checkbox','Value',1,'Units','Normalized','Position',[x3 y 0.05 0.05],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'set_save_options',1,option_box}); +y=y-0.07; +channels_button = uicontrol('Parent',optpanel,'FontSize',14,'Style','pushbutton','String','Channels','Value',1,'Units','Normalized','Position',[x1 y 0.5 0.055],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'changelist',option_box,list_channels,2}); +channels_save = uicontrol('Parent',optpanel,'Style','checkbox','Value',1,'Units','Normalized','Position',[x3 y 0.05 0.05],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'set_save_options',2,option_box}); +y=y-0.07; +epoch_button = uicontrol('Parent',optpanel,'FontSize',14,'Style','pushbutton','String','Epoching','Value',1,'Units','Normalized','Position',[x1 y 0.5 0.055],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'changelist',option_box,list_epoch,3}); +epoch_save = uicontrol('Parent',optpanel,'Style','checkbox','Value',1,'Units','Normalized','Position',[x3 y 0.05 0.05],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'set_save_options',3,option_box}); +y=y-0.07; +ICA_button = uicontrol('Parent',optpanel,'FontSize',14,'Style','pushbutton','String','ICA','Value',1,'Units','Normalized','Position',[x1 y 0.5 0.055],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'changelist',option_box,list_ICA,4}); +ICA_save = uicontrol('Parent',optpanel,'Style','checkbox','Value',1,'Units','Normalized','Position',[x3 y 0.05 0.05],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'set_save_options',4,option_box}); +y=y-0.07; +epoch_interp_button = uicontrol('Parent',optpanel,'FontSize',14,'Style','pushbutton','String','Epoch Interpolation','Value',1,'Units','Normalized','Position',[x1 y 0.5 0.055],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'changelist',option_box,list_epoch_interp,5}); +epoch_interp_save = uicontrol('Parent',optpanel,'Style','checkbox','Value',1,'Units','Normalized','Position',[x3 y 0.05 0.05],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'set_save_options',5,option_box}); +y=y-0.07; +GA_button = uicontrol('Parent',optpanel,'FontSize',14,'Style','pushbutton','String','Grand Average','Value',1,'Units','Normalized','Position',[x1 y 0.5 0.055],'BackgroundColor',bgcolor,'Callback',{@FASTER_callbacks,'changelist',option_box,list_GA,6}); + +save_handles=[filter_save channels_save epoch_save ICA_save epoch_interp_save]; +for s=1:5 + set(save_handles(s),'Value',all_options.save_options(s)); +end + +settings_list={'Style','String','FontSize','UserData'}; + +windows_filter={ + +{ +{'text','High pass on',14,0},{'checkbox','',14,'filter_options.hpf_on'},... +}, + +{ +{'text','High pass frequency',14,0},{'edit','',14,'filter_options.hpf_freq'},... +}, + +{ +{'text','HP ripple (dB)',12,0},{'edit','0.01',14,'filter_options.hpf_ripple'},{'text','HP attenuation (dB)',12,0},{'edit','80',14,'filter_options.hpf_attenuation'},{'text','HP transition band width (Hz)',10,0},{'edit','1',14,'filter_options.hpf_bandwidth'},... +}, + +{ +{'text','Low pass on',14,0},{'checkbox','',14,'filter_options.lpf_on'},... +}, + +{ +{'text','Low pass frequency',14,0},{'edit','',14,'filter_options.lpf_freq'},... +}, + +{ +{'text','LP ripple (dB)',12,0},{'edit','0.01',14,'filter_options.lpf_ripple'},{'text','LP attenuation (dB)',12,0},{'edit','80',14,'filter_options.lpf_attenuation'},{'text','LP transition band width (Hz)',10,0},{'edit','1',14,'filter_options.lpf_bandwidth'},... +}, + +{ +{'text','Notch on',14,0},{'checkbox','',14,'filter_options.notch_on'},... +}, + +{ +{'text','Notch frequency',14,0},{'edit','',14,'filter_options.notch_freq'},... +}, + +{ +{'text','Notch bandwidth (dB)',12,0},{'edit','0.01',14,'filter_options.notch_bandwidth1'},{'text','Notch ripple (dB)',12,0},{'edit','0.01',14,'filter_options.notch_ripple'},{'text','Notch attenuation (dB)',12,0},{'edit','80',14,'filter_options.notch_attenuation'},{'text','Notch transition band width (Hz)',10,0},{'edit','1',14,'filter_options.notch_bandwidth2'},... +}, + +{ +{'text','Resample on',14,0},{'checkbox','',14,'filter_options.resample_on'},{'text','Resample frequency (Hz)',12,0},{'edit','512',14,'filter_options.resample_freq'},... +}, + +}; + +windows_channels={ + +{ +{'text','Reference chan for processing',10,0},{'edit','',14,'channel_options.ref_chan'},{'text','Output reference channel',12,0},{'edit','',14,'channel_options.op_ref_chan'},... +} + +{ +{'text','EEG channels',14,0},{'edit','',14,'channel_options.eeg_chans'},... +} + +{ +{'text','External channels',14,0},{'edit','',14,'channel_options.ext_chans'},... +} + +{ +{'text','Known bad channels',14,0},{'edit','',14,'channel_options.bad_channels'},... +} + +{ +{'text','Interpolate after ICA',14,0},{'checkbox','',14,'channel_options.interp_after_ica'},... +} + +{ +{'text','Run channel rejection',14,0},{'checkbox','',14,'channel_options.channel_rejection_on'},... +} + +{ +{'text','Channel correlation',14,0},{'checkbox','',14,'channel_options.rejection_options.measure(1)'},{'text','Z threshold',14,0},{'edit','',14,'channel_options.rejection_options.z(1)'},{'text','Channel variance',14,0},{'checkbox','',14,'channel_options.rejection_options.measure(2)'},{'text','Z threshold',14,0},{'edit','',14,'channel_options.rejection_options.z(2)'},{'text','Hurst exponent',14,0},{'checkbox','',14,'channel_options.rejection_options.measure(3)'},{'text','Z threshold',14,0},{'edit','',14,'channel_options.rejection_options.z(3)'},{'text','Exclude EOG channels',12,0},{'checkbox','',14,'channel_options.exclude_EOG_chans'},... +}, + +}; + +windows_epochs={ + +{ +{'text','Markered epoching',12,0},{'checkbox','',14,'epoch_options.markered_epoch'},{'text','Markers for epoching',14,0},{'edit','',14,'epoch_options.epoch_markers'},... +}, + +{ +{'text','Unmarkered epoching',12,0},{'checkbox','',14,'epoch_options.unmarkered_epoch'},{'text','Epoching interval',12,0},{'edit','',14,'epoch_options.unmarkered_epoch_interval'},... +}, + +{ +{'text','Epoch limits',14,0},{'edit','',14,'epoch_options.epoch_limits'},... +}, + +{ +{'text','Baseline subtraction',14,0},{'edit','',14,'epoch_options.baseline_sub'},... +}, + +{ +{'text','Epoch rejection',14,0},{'checkbox','',14,'epoch_options.epoch_rejection_on'},... +}, + +{ +{'text','Deviation from mean',14,0},{'checkbox','',14,'epoch_options.rejection_options.measure(1)'},{'text','Z threshold',14,0},{'edit','',14,'epoch_options.rejection_options.z(1)'},{'text','Variance',14,0},{'checkbox','',14,'epoch_options.rejection_options.measure(2)'},{'text','Z threshold',14,0},{'edit','',14,'epoch_options.rejection_options.z(2)'},{'text','Amplitude range',14,0},{'checkbox','',14,'epoch_options.rejection_options.measure(3)'},{'text','Z threshold',14,0},{'edit','',14,'epoch_options.rejection_options.z(3)'},... +}, + +}; + +windows_ICA={ + +{ +{'text','Run ICA',14,0},{'checkbox','',14,'ica_options.run_ica'},... +} + +{ +{'text','ICA channels',14,0},{'edit',25,14,'ica_options.ica_channels'},... +} + +{ +{'text','ICA k value',14,0},{'edit',25,14,'ica_options.k_value'},... +} + +{ +{'text','Keep existing ICA weights',12,0},{'checkbox','',14,'ica_options.keep_ICA'},... +} + +{ +{'text','Save component topography images',10,0},{'checkbox','',14,'ica_options.IC_images'},... +} + +{ +{'text','Reject ICA components',12,0},{'checkbox','',14,'ica_options.component_rejection_on'},... +} + +{ +{'text','Median gradient',14,0},{'checkbox','',14,'ica_options.rejection_options.measure(1)'},{'text','Z threshold',14,0},{'edit','',14,'ica_options.rejection_options.z(1)'},{'text','Spectral slope',14,0},{'checkbox','',14,'ica_options.rejection_options.measure(2)'},{'text','Z threshold',14,0},{'edit','',14,'ica_options.rejection_options.z(2)'},{'text','Spatial kurtosis',14,0},{'checkbox','',14,'ica_options.rejection_options.measure(3)'},{'text','Z threshold',14,0},{'edit','',14,'ica_options.rejection_options.z(3)'},{'text','Hurst exponent',14,0},{'checkbox','',14,'ica_options.rejection_options.measure(4)'},{'text','Z threshold',14,0},{'edit','',14,'ica_options.rejection_options.z(4)'},{'text','EOG correlation',14,0},{'checkbox','',14,'ica_options.rejection_options.measure(5)'},{'text','Z threshold',14,0},{'edit','',14,'ica_options.rejection_options.z(5)'},{'text','EOG channels',14,0},{'edit',129:132,12,'ica_options.EOG_channels'},{'text','Lowpass frequency',12,0},{'edit','',14,'ica_options.lopass_freq'},... +} + +}; + +windows_epoch_interp={ + +{ +{'text','Epoch interpolation',14,0},{'checkbox','',14,'epoch_interp_options.epoch_interpolation_on'},... +} + +{ +{'text','Median gradient',14,0},{'checkbox','',14,'epoch_interp_options.rejection_options.measure(1)'},{'text','Z threshold',14,0},{'edit','',14,'epoch_interp_options.rejection_options.z(1)'},{'text','Variance',14,0},{'checkbox','',14,'epoch_interp_options.rejection_options.measure(2)'},{'text','Z threshold',14,0},{'edit','',14,'epoch_interp_options.rejection_options.z(2)'},{'text','Amplitude range',14,0},{'checkbox','',14,'epoch_interp_options.rejection_options.measure(3)'},{'text','Z threshold',14,0},{'edit','',14,'epoch_interp_options.rejection_options.z(3)'},{'text','Deviation from mean',14,0},{'checkbox','',14,'epoch_interp_options.rejection_options.measure(4)'},{'text','Z threshold',14,0},{'edit','',14,'epoch_interp_options.rejection_options.z(4)'},... +} + +}; + +windows_GA={ + +{ +{'text','Make grand average',14,0},{'checkbox','',14,'averaging_options.make_GA'},... +}, + +{ +{'text','Grand average markers',12,0},{'edit','',14,'averaging_options.GA_markers'},... +}, + +{ +{'text','Grand average length',12,0},{'edit','',14,'averaging_options.GA_epoch_length'},... +}, + +{ +{'text','Use trimmed mean',12,0},{'checkbox','',14,'averaging_options.GA_trimmed_mean'},{'text','Percentage to trim',12,0},{'edit','',14,'averaging_options.GA_trimmed_mean_perc'},... +}, + +{ +{'text','Subject removal on',12,0},{'checkbox','',14,'averaging_options.subject_removal_on'},... +}, + +{ +{'text','Deviation from mean',14,0},{'checkbox','',14,'averaging_options.rejection_options.measure(1)'},{'text','Z threshold',14,0},{'edit','',14,'averaging_options.rejection_options.z(1)'},{'text','Variance',14,0},{'checkbox','',14,'averaging_options.rejection_options.measure(2)'},{'text','Z threshold',14,0},{'edit','',14,'averaging_options.rejection_options.z(2)'},{'text','Amplitude range',14,0},{'checkbox','',14,'averaging_options.rejection_options.measure(3)'},{'text','Z threshold',14,0},{'edit','',14,'averaging_options.rejection_options.z(3)'},{'text','Max EOG value',14,0},{'checkbox','',14,'averaging_options.rejection_options.measure(4)'},{'text','Z threshold',14,0},{'edit','',14,'averaging_options.rejection_options.z(4)'},... +}, + +}; + +all_windows = {windows_filter, windows_channels, windows_epochs, windows_ICA, windows_epoch_interp, windows_GA}; +if (from_EEGLAB) + all_options.file_options.using_ALLEEG=1; +end + +option_wrapper=struct; +option_wrapper.options=all_options; +option_wrapper.current_group=1; +option_wrapper.last_value=1; +option_wrapper.window_handles=all_windows; +option_wrapper.save_handles=save_handles; +option_wrapper.other_handles=other_handles; +option_wrapper.version=FASTER_version; + +option_wrapper.debug=1; + +set(option_box,'Callback',{@FASTER_callbacks,'pop_up',@make_window},'UserData',option_wrapper); + +set(fh,'CloseRequestFcn',{@FASTER_callbacks,'main_window_close',option_box}); + +hmenu = uimenu('Label','More Options'); +uimenu(hmenu,'Label','Save as default options','Callback',{@FASTER_callbacks,'save_defaults',option_box}); +uimenu(hmenu,'Label','Load default option','Callback',{@FASTER_callbacks,'get_defaults',option_box,from_EEGLAB}); +uimenu(hmenu,'Label','Save as new job file','Callback',{@FASTER_callbacks,'save_new_job',option_box}); + +FASTER_callbacks([],[],'update_controls',option_box); + +if nargout==1 + varargout{1}=evalin('base','EEG;'); +end + +%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%% OPTIONS WINDOW %%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%% + + function nf=make_window(controls2,src) + controls1={'Style','String','FontSize','UserData'}; + nf = figure; + N=length(controls2); + w=400; + h=40 * (N/2) + 40; + set(nf,'Units','Pixels','Position',[(screensize(1)-w)/2 (screensize(2)-h)/2 w h],'Color',bgcolor,'WindowStyle','modal'); + hcontrols=zeros(size(controls2)); + for u=1:N + hcontrols(u)=uicontrol('Parent',nf); + set(hcontrols(u),controls1,controls2{u}); + %set(hcontrols(u),'Units','Pixels','BackgroundColor',bgcolor); + x = (mod(u-1,2)*200); + y = (20*N)-40*(round(u/2))+40; + set(hcontrols(u),'Position',[x y 200 40]+get_offset(get(hcontrols(u),'Style'))); + option_wrapper=get(src,'UserData'); + subgroup=get(hcontrols(u),'UserData'); + if ischar(subgroup) + if (strcmpi(get(hcontrols(u),'Style'),'edit')) + set(hcontrols(u),'Units','Pixels','BackgroundColor',[1 1 1]); + r=e('option_wrapper.options',subgroup); + if (~ischar(r) && ~iscell(r)) + if (any(mod(r,1))) + s=sprintf('%.2f ', r); + if (~isempty(s) && s(end)==' ') + s=s(1:end-1); + end + set(hcontrols(u),'String',s); + else + if (~isempty(r) && all(diff(r)==1) && length(r)>1) + set(hcontrols(u),'String',sprintf('%d:%d', r(1),r(end))); + else + s=sprintf('%d ',r); + if (~isempty(s) && s(end)==' ') + s=s(1:end-1); + end + set(hcontrols(u),'String',s); + end + end + elseif iscell(r) + s='{'; + for c=1:length(r) + if ischar(r{c}) + s=[s '''' r{c} ''', ']; + else + if (any(mod(r{c},1))) + s1=sprintf('%.2f ', r{c}); + if (~isempty(s1) && s1(end)==' ') + s1=s1(1:end-1); + end + else + if (~isempty(r{c}) && all(diff(r{c})==1) && length(r{c})>1) + s1=sprintf('%d:%d', r{c}(1),r{c}(end)); + else + s1=sprintf('%d ',r{c}); + if (~isempty(s1) && s1(end)==' ') + s1=s1(1:end-1); + end + end + end + + s=[s '[' s1 '], ']; + end + end + if (~isempty(s) && s(end)==' ') + if (s(end-1)==',') + s=s(1:end-2); + else + s=s(1:end-1); + end + end + s=[s '}']; + set(hcontrols(u),'String',s); + else + set(hcontrols(u),'String',e('option_wrapper.options',subgroup)); + end + else + set(hcontrols(u),'Units','Pixels','BackgroundColor',bgcolor); + set(hcontrols(u),'Value',e('option_wrapper.options',subgroup)); + end + else + set(hcontrols(u),'Units','Pixels','BackgroundColor',bgcolor); + set(hcontrols(u),'Value',0); + end + set(hcontrols(u),'Callback',{@FASTER_callbacks,'set_window_value',src}); + end + + uicontrol('style','pushbutton','Units','Pixels','BackgroundColor',bgcolor,'Position',[175 10 50 20],'String','OK','Callback',{@FASTER_callbacks,'option_window_close',src,hcontrols,nf},'FontSize',12); + set(nf,'CloseRequestFcn',{@FASTER_callbacks,'do_nothing'}); + end + + function out=get_offset(uicontrol_type) + % Lines up text correctly + switch (uicontrol_type) + case 'text' + out=[0 -2 0 -8]; + case 'checkbox' + out=[80 2 0 0]; + case 'edit' + out=[0 4 -2 -4]; + otherwise + out=[0 0 0 0]; + end + out = out + [0 -5 0 0]; + end + + function out=e(part1,part2) + out=eval(sprintf('%s.%s',part1,part2)); + end + + function init_options() + % Provides the default options. + if (exist('FASTER_defaults.mat','file')) + def_options=FASTER_callbacks([],[],'get_defaults',option_box,from_EEGLAB); + end + + all_options.job_filename=''; + all_options.current_file=[]; + all_options.current_file_num=1; + all_options.is_processing=0; + + all_options.save_options=ones(1,5); + + all_options.file_options.folder_name=''; + all_options.file_options.output_folder_name=''; + all_options.file_options.current_file=''; + all_options.file_options.current_file_num=1; + all_options.file_options.channel_locations=''; + all_options.file_options.searchstring=''; + all_options.file_options.cutoff_markers=[]; + all_options.file_options.is_bdf=1; + all_options.file_options.resume=0; + all_options.file_options.file_prefix=''; + all_options.file_options.plist=cell(0); + all_options.file_options.oplist=cell(0); + all_options.file_options.nlist=cell(0); + all_options.file_options.using_ALLEEG=0; + all_options.file_options.make_subdirectories=1; + all_options.file_options.save_ALLEEG=1; + all_options.file_options.folder_name_rel=cell(0); + all_options.file_options.overwrite_ALLEEG=0; + + all_options.filter_options.hpf_on=1; + all_options.filter_options.hpf_freq=1; + all_options.filter_options.hpf_ripple=0.05; + all_options.filter_options.hpf_attenuation=80; + all_options.filter_options.hpf_bandwidth=0.5; + all_options.filter_options.lpf_on=1; + all_options.filter_options.lpf_freq=95; + all_options.filter_options.lpf_ripple=0.01; + all_options.filter_options.lpf_attenuation=40; + all_options.filter_options.lpf_bandwidth=2.5; + all_options.filter_options.notch_on=1; + all_options.filter_options.notch_freq=50; + all_options.filter_options.notch_bandwidth1=3; + all_options.filter_options.notch_ripple=0.05; + all_options.filter_options.notch_attenuation=80; + all_options.filter_options.notch_bandwidth2=1; + all_options.filter_options.resample_on=0; + all_options.filter_options.resample_freq=0; + + all_options.channel_options.do_reref=1; + all_options.channel_options.ref_chan=85; + all_options.channel_options.op_ref_chan=[]; + all_options.channel_options.eeg_chans=1:128; + all_options.channel_options.ext_chans=129:136; + all_options.channel_options.bad_channels=[]; + all_options.channel_options.interp_after_ica=1; + all_options.channel_options.channel_rejection_on=1; + all_options.channel_options.rejection_options=struct; + all_options.channel_options.rejection_options.measure(1)=1; + all_options.channel_options.rejection_options.z(1)=3; + all_options.channel_options.rejection_options.measure(2)=1; + all_options.channel_options.rejection_options.z(2)=3; + all_options.channel_options.rejection_options.measure(3)=1; + all_options.channel_options.rejection_options.z(3)=3; + all_options.channel_options.exclude_EOG_chans=1; + + all_options.epoch_options.markered_epoch=1; + all_options.epoch_options.epoch_markers=[]; + all_options.epoch_options.epoch_limits=[-0.2 0.8]; + all_options.epoch_options.baseline_sub=[-0.1 0]; + all_options.epoch_options.unmarkered_epoch=0; + all_options.epoch_options.unmarkered_epoch_interval=1; + all_options.epoch_options.epoch_rejection_on=1; + all_options.epoch_options.rejection_options=struct; + all_options.epoch_options.rejection_options.measure(1)=1; + all_options.epoch_options.rejection_options.z(1)=3; + all_options.epoch_options.rejection_options.measure(2)=1; + all_options.epoch_options.rejection_options.z(2)=3; + all_options.epoch_options.rejection_options.measure(3)=1; + all_options.epoch_options.rejection_options.z(3)=3; + + all_options.ica_options.run_ica=1; + all_options.ica_options.k_value=25; + all_options.ica_options.ica_channels=1:136; + all_options.ica_options.keep_ICA=0; + all_options.ica_options.IC_images=0; + all_options.ica_options.component_rejection_on=1; + all_options.ica_options.rejection_options=struct; + all_options.ica_options.rejection_options.measure(1)=1; + all_options.ica_options.rejection_options.z(1)=3; + all_options.ica_options.rejection_options.measure(2)=1; + all_options.ica_options.rejection_options.z(2)=3; + all_options.ica_options.rejection_options.measure(3)=1; + all_options.ica_options.rejection_options.z(3)=3; + all_options.ica_options.rejection_options.measure(4)=1; + all_options.ica_options.rejection_options.z(4)=3; + all_options.ica_options.rejection_options.measure(5)=1; + all_options.ica_options.rejection_options.z(5)=3; + all_options.ica_options.EOG_channels=129:132; + all_options.ica_options.lopass_freq=[]; + + all_options.epoch_interp_options.epoch_interpolation_on=1; + all_options.epoch_interp_options.rejection_options=struct; + all_options.epoch_interp_options.rejection_options.measure(1)=1; + all_options.epoch_interp_options.rejection_options.z(1)=3; + all_options.epoch_interp_options.rejection_options.measure(2)=1; + all_options.epoch_interp_options.rejection_options.z(2)=3; + all_options.epoch_interp_options.rejection_options.measure(3)=1; + all_options.epoch_interp_options.rejection_options.z(3)=3; + all_options.epoch_interp_options.rejection_options.measure(4)=1; + all_options.epoch_interp_options.rejection_options.z(4)=3; + + all_options.averaging_options.make_GA=0; + all_options.averaging_options.GA_markers=[]; + all_options.averaging_options.GA_epoch_length=[-0.2 0.8]; + all_options.averaging_options.GA_trimmed_mean=0; + all_options.averaging_options.GA_trimmed_mean_perc=10; + all_options.averaging_options.subject_removal_on=1; + all_options.averaging_options.rejection_options=struct; + all_options.averaging_options.rejection_options.measure(1)=1; + all_options.averaging_options.rejection_options.z(1)=3; + all_options.averaging_options.rejection_options.measure(2)=1; + all_options.averaging_options.rejection_options.z(2)=3; + all_options.averaging_options.rejection_options.measure(3)=1; + all_options.averaging_options.rejection_options.z(3)=3; + all_options.averaging_options.rejection_options.measure(4)=1; + all_options.averaging_options.rejection_options.z(4)=3; + + if (exist('def_options','var')) + names=fieldnames(all_options); + for v=1:length(names) + if ~isfield(def_options,names{v}) + def_options.(names{v})=all_options.(names{v}); + elseif isstruct(all_options.(names{v})) + names_2 = fieldnames(all_options.(names{v})); + for t=1:length(names_2) + if ~isfield(def_options.(names{v}),names_2{t}) + def_options.(names{v}).(names_2{t})=all_options.(names{v}).(names_2{t}); + elseif isstruct(all_options.(names{v}).(names_2{t})) % Max three levels of structs + names_3 = fieldnames(all_options.(names{v}).(names_2{t})); + for r=1:length(names_3) + if ~isfield(def_options.(names{v}).(names_2{t}),names_3{r}) || ~all(size(def_options.(names{v}).(names_2{t}).(names_3{r}))==size(all_options.(names{v}).(names_2{t}).(names_3{r}))) + def_options.(names{v}).(names_2{t}).(names_3{r})=all_options.(names{v}).(names_2{t}).(names_3{r}); + end + end + end + end + end + end + + std_options=all_options; + all_options=def_options; + else + std_options=all_options; + end + end + +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/FASTER_callbacks.asv b/code/eeglab13_4_4b/plugins/FASTER/FASTER_callbacks.asv new file mode 100644 index 0000000..ce51458 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/FASTER_callbacks.asv @@ -0,0 +1,545 @@ +function varargout=FASTER_callbacks(src,eventdata,varargin) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +top_nargout=nargout; + +if nargin < 2 + %This should never happen. + return; +elseif nargin==2 + x=get(src,'Parent'); + if (x==0) + uiresume(src); + else + uiresume(x); + end +elseif nargin>=3 + %try + % Evaluate the first argument in varargin as the function name and the rest + % as the arguments to that function + eval(sprintf('%s(src,eventdata,varargin{2:end});',varargin{1})); + %catch ME + % fprintf('Error: %s\n',ME.message); + %end +end + + function do_nothing(src,eventdata) + return; + end + + function double_click_func(varargin) + fprintf('Eval''d.\n'); + if (get(varargin{1},'Selected')) + eval_string=[varargin{3} '(']; + for i=4:nargin + eval_string=[eval_string varargin{i} ',']; + end + if eval_string(end)==',' + eval_string = [eval_string(1:end-1) ');']; + end + eval(eval_string); + end + end + + function fileselect(src,eventdata,tbhandle,name,handle) + [file_to_do pathname] = uigetfile('*.*',name); + if (file_to_do~=0) + set(tbhandle,'String',[pathname file_to_do]); + else + return; + end + + option_wrapper=get(handle,'UserData'); + eval(sprintf('option_wrapper.options.%s = ''%s'';',get(tbhandle,'UserData'),[pathname file_to_do])); + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function folderselect(src,eventdata,tbhandle,name,handle) + folder_to_do = uigetdir(cd,name); + if (folder_to_do~=0) + set(tbhandle,'String',folder_to_do); + else + return; + end + + option_wrapper=get(handle,'UserData'); + eval(sprintf('option_wrapper.options.%s = ''%s'';',get(tbhandle,'UserData'),folder_to_do)); + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function changelist(src,eventdata,listbox,list_strings,value) + set(listbox,'String',list_strings,'Value',1); + option_wrapper=get(listbox,'UserData'); + option_wrapper.last_value=1; + option_wrapper.current_group=value; + set(listbox,'UserData',option_wrapper); + end + + function set_window_value(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + current_item=get(src,'UserData'); + if (strcmpi(get(src,'Style'),'edit')) + string=get(src,'String'); + if isempty(string) + string='[]'; + end + if (string(1)~='[') + string = [ '[' string ]; + end + if (string(end)~=']') + string = [ string ']']; + end + + try + %r=eval(string); + eval(sprintf('option_wrapper.options.%s=%s;',current_item,string)); + %if iscell(r) + + %end + %set(src,'Value',eval(string)); % Is this at all necessary except as a temporary variable? I don't think so. + catch + close(get(src,'Parent')); + ew=errordlg('Invalid assignment.','Assignment error','modal'); + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + p=get(ew,'Position'); + set(ew,'Position',[(screensize(1)-p(3))/2 (screensize(2)-p(4))/2 p(3) p(4)]); + return; + end + + + else + eval(sprintf('option_wrapper.options.%s=get(src,''Value'');',current_item)); + end + + set(handle,'UserData',option_wrapper); + end + + function set_save_options(src,eventdata,number,handle) + option_wrapper=get(handle,'UserData'); + option_wrapper.options.save_options(number)=get(src,'Value'); + set(handle,'UserData',option_wrapper); + end + + function pop_up(src,eventdata,funchand) + option_wrapper=get(src,'UserData'); + x=get(src,'Value'); + if (x==option_wrapper.last_value) + funchand(option_wrapper.window_handles{option_wrapper.current_group}{x},src); + end + option_wrapper.last_value=x; + set(src,'UserData',option_wrapper); + end + + function option_window_close(src,eventdata,handle,control_handles,figure_handle) + if nargin==4 + figure_handle=src; + end + option_wrapper=get(handle,'UserData'); + try + for p=2:2:length(control_handles) + current_item=get(control_handles(p),'UserData'); + + if (strcmpi(get(control_handles(p),'Style'),'edit')) + string=get(control_handles(p),'String'); + if isempty(string) + string='[]'; + end + if (string(1)~='[') + string = [ '[' string ]; + end + if (string(end)~=']') + string = [ string ']']; + end + + try + eval(sprintf('option_wrapper.options.%s=%s;',current_item,string)); + %set(control_handles(p),'Value',eval(string)); + catch + ew=errordlg('Invalid assignment.','Assignment error','modal'); + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + pos=get(ew,'Position'); + set(ew,'Units','Pixels','Position',[(screensize(1)-pos(3))/2 (screensize(2)-pos(4))/2 pos(3) pos(4)]); + return; + end + else + eval(sprintf('option_wrapper.options.%s=get(control_handles(p),''Value'');',current_item)); + end + %eval(sprintf('option_wrapper.options.%s=get(control_handles(p),''Value'');',current_item)); + end + catch + ew2=errordlg('Something went wrong.','Error','modal'); + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + p=get(ew2,'Position'); + set(ew2,'Units','Pixels','Position',[(screensize(1)-p(3))/2 (screensize(2)-p(4))/2 p(3) p(4)]); + delete(figure_handle); + end + set(handle,'UserData',option_wrapper); + set(figure_handle,'WindowStyle','normal'); + delete(figure_handle); + end + + function main_window_close(src,eventdata,handle) + delete(src); + end + + function error_window(src,eventdata,string) + bgcolor=[0.9 0.9 0.9]; + ew=figure; + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + set(ew,'Units','Pixels','Position',[(screensize(1)/2-100) (screensize(2)/2-50) 200 100],'WindowStyle','modal','Color',bgcolor); + uicontrol('FontSize',12,'Style','text','String',string,'Units','Normalized','Position',[0 0.5 1 0.5],'BackgroundColor',bgcolor); + uicontrol('FontSize',12,'Style','pushbutton','String','OK','Units','Normalized','Position',[0.35 0.1 0.3 0.3],'Callback',{@close_this,ew},'BackgroundColor',bgcolor); + + function close_this(src,eventdata,handle) + set(handle,'WindowStyle','normal'); + delete(handle); + end + end + + function set_onoff_options(src,eventdata,number,handle) + option_wrapper=get(handle,'UserData'); + option_wrapper.options{2}{number}{end}={get(src,'Value')}; + set(handle,'UserData',options); + end + + function run_FASTER(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; + if ~using_ALLEEG && (isempty(option_wrapper.options.file_options.folder_name) || ~exist(option_wrapper.options.file_options.folder_name,'dir')) + errordlg('Invalid job folder selected.','Error','modal'); + %assignin('base','optins',option_wrapper); + return; + end + if (~isempty(option_wrapper.options.file_options.output_folder_name) && ~exist(option_wrapper.options.file_options.output_folder_name,'dir')) + errordlg('Invalid output folder selected.','Error','modal'); + return; + end + if (isempty(option_wrapper.options.file_options.channel_locations)) + if (option_wrapper.options.file_options.is_bdf==1) + errordlg('Must enter channel locations for .bdf files.','Error','modal'); + return; + else + button = questdlg(sprintf('No channel locations entered.\nDo all .set files have channel locations?'),'Channel locations','Yes','No','Yes'); + if strcmp(button,'No') + return; + end + end + end + if (option_wrapper.options.ica_options.run_ica && ~isempty(setdiff(option_wrapper.options.ica_options.ica_channels,[option_wrapper.options.channel_options.eeg_chans option_wrapper.options.channel_options.ext_chans]))) + errordlg('Selected ICA channels are not a subset of selected EEG and external channels.'); + return; + end + + % v=version(); + % dots=strfind(v,'.'); + % v_num=str2num(v(1:dots(2)-1)); + % + % if v_num>7.4 + % FASTER(option_wrapper); + % else + % FASTER_compat(option_wrapper); + % end + + % Version number check is awkward at the moment. + % Using lasterror for the moment until it is removed + % completely. + + % If none of the above checks returned, run FASTER! + try + FASTER(option_wrapper); + catch + m=lasterror; + if exist('my_queue_file','var') && ~isempty(my_queue_file) && exist(my_queue_file,'file') + delete(my_queue_file); + end + if exist('my_proc_file','var') && ~isempty(my_proc_file) && exist(my_proc_file,'file') + delete(my_proc_file); + end + assignin('base','m',m); + rethrow(m); + end + end + + function stop(src,eventdata) + error('Stopped FASTER!\n'); + end + + function new_job(src,eventdata,handle) + folder_to_do = uigetdir(cd,'Open folder to process'); + [root_folder f1 f2] = fileparts(folder_to_do); + + [pathname file_to_save] = uiputfile('*.eegjob','Save job',[folder_to_do filesep f1 f2 '.eegjob']); + if (all(folder_to_do~=0) && all(file_to_save~=0)) + option_wrapper.file_options.folder_name=folder_to_do; + + save_job([],[],handle,[pathname filesep file_to_save]); + end + end + + function open_job(src,eventdata,handle,std_options) + [file_to_do pathname] = uigetfile('*.eegjob','Select EEG job to open'); + option_wrapper=get(handle,'UserData'); + if (file_to_do~=0) + all=load([pathname filesep file_to_do],'-mat'); + or2=all.option_wrapper; + + using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; + %if exist([pathname filesep 'ProcQ.eegQ'],'file') + if ~using_ALLEEG + if isfield(or2.options.file_options,'folder_name_rel') && ~isempty(or2.options.file_options.folder_name_rel) + try + startDir = make_relative_path(or2.options.file_options.folder_name_rel,pathname); + or2.options.file_options.folder_name=startDir; + catch + startDir=or2.options.file_options.folder_name; + end + else + startDir=or2.options.file_options.folder_name; + end + else + startDir=cd; + end + + if (~using_ALLEEG && exist([startDir filesep file_to_do '_ProcQ.eegQ'],'file')) || (using_ALLEEG && exist([startDir filesep 'ProcQ.eegQ'],'file')) + button = questdlg(sprintf('Queue file present.\nJoining the queue will add this computer to an already running FASTER session (cannot be used if FASTER was started from EEGLAB).\n\nOverwriting will delete the queue file and start from the beginning. Use this if an error occurred previously, or if processing was aborted before finishing the job (resume will function as normal).\n\nCancelling will abort loading this file.'),'Queue file detected','Join','Reset Queue','Cancel','Join'); + if strcmp(button,'Cancel') + return; + elseif strcmp(button,'Reset Queue') + button = questdlg(sprintf('Warning: resetting will remove the queue file and other tracking files. Please ensure no other computers are using this job file for processing.\nContinue?'),'Restart warning','Yes','No','No'); + if strcmp(button,'No') + return; + end + if ~using_ALLEEG + delete([startDir filesep file_to_do '_ProcQ.eegQ']); + else + delete([startDir filesep 'ProcQ.eegQ']); + end + if exist([startDir filesep 'Queue'],'dir') + D=dir([startDir filesep 'Queue']); + for v=1:length(D) + if ~strcmp(D(v).name,'.') && ~strcmp(D(v).name,'..') + delete([startDir filesep 'Queue' filesep D(v).name]); + end + end + rmdir([startDir filesep 'Queue']); + end + if exist([startDir filesep 'Processing'],'dir') + D=dir([startDir filesep 'Processing']); + for v=1:length(D) + if ~strcmp(D(v).name,'.') && ~strcmp(D(v).name,'..') + delete([startDir filesep 'Processing' filesep D(v).name]); + end + end + rmdir([startDir filesep 'Processing']); + end + end + end + + or2.options.file_options.using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; + option_wrapper.options=check_options(src,eventdata,std_options,or2.options); + option_wrapper.options.file_options.resume=1; + option_wrapper.options.job_filename=[pathname filesep file_to_do]; + end + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function varargout=check_options(src,eventdata,op1,op2) + names=fieldnames(op1); + for v=1:length(names) + if ~isfield(op2,names{v}) + op2.(names{v})=op1.(names{v}); + elseif isstruct(op1.(names{v})) + names_2 = fieldnames(op1.(names{v})); + for t=1:length(names_2) + if ~isfield(op2.(names{v}),names_2{t}) + op2.(names{v}).(names_2{t})=op1.(names{v}).(names_2{t}); + elseif isstruct(op1.(names{v}).(names_2{t})) % Max three levels of structs + names_3 = fieldnames(op1.(names{v}).(names_2{t})); + for r=1:length(names_3) + if ~isfield(op2.(names{v}).(names_2{t}),names_3{r}) || ~all(size(op2.(names{v}).(names_2{t}).(names_3{r}))==size(op1.(names{v}).(names_2{t}).(names_3{r}))) + op2.(names{v}).(names_2{t}).(names_3{r})=op1.(names{v}).(names_2{t}).(names_3{r}); + end + end + end + end + end + end + if nargout==1 + varargout{1}=op2; + end + end + + function update_value(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + if (strcmp(get(src,'Style'),'edit')) + eval(sprintf('option_wrapper.options.%s = ''%s'';',get(src,'UserData'),get(src,'String'))); + else + eval(sprintf('option_wrapper.options.%s = %f;',get(src,'UserData'),get(src,'Value'))); + end + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function save_job(src,eventdata,handle,full_filename) + option_wrapper=get(handle,'UserData'); + tmp_using=option_wrapper.options.file_options.using_ALLEEG; + option_wrapper.options.file_options.using_ALLEEG=0; + if nargin==3 + if isempty(option_wrapper.options.job_filename) || ~exist(option_wrapper.options.job_filename,'file') + if isempty(option_wrapper.options.file_options.folder_name) + [pathname file_to_save] = uiputfile('*.eegjob','Save job'); + else + [v d]=builtin('version'); + vs=sscanf(v,'%d.%d.%d.%d'); + if vs(2)> + [root_folder f1 f2] = fileparts(option_wrapper.options.file_options.folder_name); + [pathname file_to_save] = uiputfile('*.eegjob','Save job',[option_wrapper.options.file_options.folder_name filesep option_wrapper.options.file_options.file_prefix f1 f2 '.eegjob']); + end + if (file_to_save==0) + return; + end + full_filename=[file_to_save filesep pathname]; + else + full_filename=option_wrapper.options.job_filename; + end + end + if ~isempty(option_wrapper.options.file_options.folder_name) + if exist('file_to_save','var') + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,file_to_save); + else + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,fileparts(option_wrapper.options.job_filename)); + end + else + option_wrapper.options.file_options.folder_name_rel=cell(0); + end + save(full_filename,'option_wrapper','-mat'); + option_wrapper.options.job_filename=full_filename; + option_wrapper.options.file_options.using_ALLEEG=tmp_using; + set(handle,'UserData',option_wrapper); + end + + function save_new_job(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + tmp_using=option_wrapper.options.file_options.using_ALLEEG; + option_wrapper.options.file_options.using_ALLEEG=0; + if isempty(option_wrapper.options.file_options.folder_name) + [pathname file_to_save] = uiputfile('*.eegjob','Save job'); + else + [root_folder f1 f2 f3] = fileparts(option_wrapper.options.file_options.folder_name); + [pathname file_to_save] = uiputfile('*.eegjob','Save job',[option_wrapper.options.file_options.folder_name filesep option_wrapper.options.file_options.file_prefix f1 f2 f3 '.eegjob']); + end + if (file_to_save==0) + return; + end + full_filename=[file_to_save filesep pathname]; + if exist('file_to_save','var') + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,file_to_save); + else + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,root_folder); + end + save(full_filename,'option_wrapper','-mat'); + option_wrapper.options.job_filename=full_filename; + option_wrapper.options.file_options.using_ALLEEG=tmp_using; + set(handle,'UserData',option_wrapper); + end + + function get_defaults(src,eventdata,handle,using_ALLEEG) + option_wrapper=get(handle,'UserData'); + filename=which('FASTER_defaults.mat'); + if ~isempty(filename) + x=load(filename,'-mat'); + option_wrapper_def=x.option_wrapper; + option_wrapper_def.options.job_filename=[]; + option_wrapper_def.options.current_file=[]; + option_wrapper_def.options.current_file_num=1; + %option_wrapper.options.file_options.using_ALLEEG=0; + end + + option_wrapper_def.options.file_options.using_ALLEEG=using_ALLEEG; + + if (top_nargout>0) + vout{1}=option_wrapper_def.options; + else + option_wrapper.options=option_wrapper_def.options; + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + end + + function update_controls(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + for c=1:length(option_wrapper.save_handles) + set(option_wrapper.save_handles(c),'Value',option_wrapper.options.save_options(c)); + end + + % File options etc + for c=1:length(option_wrapper.other_handles) + if (strcmp(get(option_wrapper.other_handles(c),'Style'),'edit') || strcmp(get(option_wrapper.other_handles(c),'Style'),'text')) + set(option_wrapper.other_handles(c),'String',eval(['option_wrapper.options.' get(option_wrapper.other_handles(c),'UserData')])); + elseif strcmp(get(option_wrapper.other_handles(c),'Style'),'pushbutton') + + else + if (strcmp(get(option_wrapper.other_handles(c),'UserData'),'file_options.save_ALLEEG')) + if ~isempty(option_wrapper.options.file_options.output_folder_name) + option_wrapper.options.file_options.save_ALLEEG=1; + set(option_wrapper.other_handles(c),'Enable','off'); + else + set(option_wrapper.other_handles(c),'Enable','on'); + end + end + set(option_wrapper.other_handles(c),'Value',eval(['option_wrapper.options.' get(option_wrapper.other_handles(c),'UserData')])); + end + end + end + + function save_defaults(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + option_wrapper.job_filename=[]; + option_wrapper.options.using_ALLEEG=0; + if ~isempty(which('FASTER_defaults.mat')) + save(which('FASTER_defaults.mat'),'option_wrapper','-mat'); + else + [root_folder] = fileparts(which('FASTER_callbacks.m')); + save([root_folder filesep 'FASTER_defaults.mat'],'option_wrapper','-mat'); + end + end + +if top_nargout>0 + if (~exist('vout','var')) + for u=1:top_nargout + vout{u}=[]; + end + end + varargout=vout; +end + +end + diff --git a/code/eeglab13_4_4b/plugins/FASTER/FASTER_callbacks.m b/code/eeglab13_4_4b/plugins/FASTER/FASTER_callbacks.m new file mode 100644 index 0000000..1cdeed1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/FASTER_callbacks.m @@ -0,0 +1,542 @@ +function varargout=FASTER_callbacks(src,eventdata,varargin) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +top_nargout=nargout; + +if nargin < 2 + %This should never happen. + return; +elseif nargin==2 + x=get(src,'Parent'); + if (x==0) + uiresume(src); + else + uiresume(x); + end +elseif nargin>=3 + %try + % Evaluate the first argument in varargin as the function name and the rest + % as the arguments to that function + eval(sprintf('%s(src,eventdata,varargin{2:end});',varargin{1})); + %catch ME + % fprintf('Error: %s\n',ME.message); + %end +end + + function do_nothing(src,eventdata) + return; + end + + function double_click_func(varargin) + fprintf('Eval''d.\n'); + if (get(varargin{1},'Selected')) + eval_string=[varargin{3} '(']; + for i=4:nargin + eval_string=[eval_string varargin{i} ',']; + end + if eval_string(end)==',' + eval_string = [eval_string(1:end-1) ');']; + end + eval(eval_string); + end + end + + function fileselect(src,eventdata,tbhandle,name,handle) + [file_to_do pathname] = uigetfile('*.*',name); + if (file_to_do~=0) + set(tbhandle,'String',[pathname file_to_do]); + else + return; + end + + option_wrapper=get(handle,'UserData'); + eval(sprintf('option_wrapper.options.%s = ''%s'';',get(tbhandle,'UserData'),[pathname file_to_do])); + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function folderselect(src,eventdata,tbhandle,name,handle) + folder_to_do = uigetdir(cd,name); + if (folder_to_do~=0) + set(tbhandle,'String',folder_to_do); + else + return; + end + + option_wrapper=get(handle,'UserData'); + eval(sprintf('option_wrapper.options.%s = ''%s'';',get(tbhandle,'UserData'),folder_to_do)); + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function changelist(src,eventdata,listbox,list_strings,value) + set(listbox,'String',list_strings,'Value',1); + option_wrapper=get(listbox,'UserData'); + option_wrapper.last_value=1; + option_wrapper.current_group=value; + set(listbox,'UserData',option_wrapper); + end + + function set_window_value(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + current_item=get(src,'UserData'); + if (strcmpi(get(src,'Style'),'edit')) + string=get(src,'String'); + if isempty(string) + string='[]'; + end + if (string(1)~='[') + string = [ '[' string ]; + end + if (string(end)~=']') + string = [ string ']']; + end + + try + %r=eval(string); + eval(sprintf('option_wrapper.options.%s=%s;',current_item,string)); + %if iscell(r) + + %end + %set(src,'Value',eval(string)); % Is this at all necessary except as a temporary variable? I don't think so. + catch + close(get(src,'Parent')); + ew=errordlg('Invalid assignment.','Assignment error','modal'); + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + p=get(ew,'Position'); + set(ew,'Position',[(screensize(1)-p(3))/2 (screensize(2)-p(4))/2 p(3) p(4)]); + return; + end + + + else + eval(sprintf('option_wrapper.options.%s=get(src,''Value'');',current_item)); + end + + set(handle,'UserData',option_wrapper); + end + + function set_save_options(src,eventdata,number,handle) + option_wrapper=get(handle,'UserData'); + option_wrapper.options.save_options(number)=get(src,'Value'); + set(handle,'UserData',option_wrapper); + end + + function pop_up(src,eventdata,funchand) + option_wrapper=get(src,'UserData'); + x=get(src,'Value'); + if (x==option_wrapper.last_value) + funchand(option_wrapper.window_handles{option_wrapper.current_group}{x},src); + end + option_wrapper.last_value=x; + set(src,'UserData',option_wrapper); + end + + function option_window_close(src,eventdata,handle,control_handles,figure_handle) + if nargin==4 + figure_handle=src; + end + option_wrapper=get(handle,'UserData'); + try + for p=2:2:length(control_handles) + current_item=get(control_handles(p),'UserData'); + + if (strcmpi(get(control_handles(p),'Style'),'edit')) + string=get(control_handles(p),'String'); + if isempty(string) + string='[]'; + end + if (string(1)~='[') + string = [ '[' string ]; + end + if (string(end)~=']') + string = [ string ']']; + end + + try + eval(sprintf('option_wrapper.options.%s=%s;',current_item,string)); + %set(control_handles(p),'Value',eval(string)); + catch + ew=errordlg('Invalid assignment.','Assignment error','modal'); + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + pos=get(ew,'Position'); + set(ew,'Units','Pixels','Position',[(screensize(1)-pos(3))/2 (screensize(2)-pos(4))/2 pos(3) pos(4)]); + return; + end + else + eval(sprintf('option_wrapper.options.%s=get(control_handles(p),''Value'');',current_item)); + end + %eval(sprintf('option_wrapper.options.%s=get(control_handles(p),''Value'');',current_item)); + end + catch + ew2=errordlg('Something went wrong.','Error','modal'); + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + p=get(ew2,'Position'); + set(ew2,'Units','Pixels','Position',[(screensize(1)-p(3))/2 (screensize(2)-p(4))/2 p(3) p(4)]); + delete(figure_handle); + end + set(handle,'UserData',option_wrapper); + set(figure_handle,'WindowStyle','normal'); + delete(figure_handle); + end + + function main_window_close(src,eventdata,handle) + delete(src); + end + + function error_window(src,eventdata,string) + bgcolor=[0.9 0.9 0.9]; + ew=figure; + set(0,'Units','pixels'); + screensize = get(0,'ScreenSize'); + screensize = screensize(1,[3 4]); + set(ew,'Units','Pixels','Position',[(screensize(1)/2-100) (screensize(2)/2-50) 200 100],'WindowStyle','modal','Color',bgcolor); + uicontrol('FontSize',12,'Style','text','String',string,'Units','Normalized','Position',[0 0.5 1 0.5],'BackgroundColor',bgcolor); + uicontrol('FontSize',12,'Style','pushbutton','String','OK','Units','Normalized','Position',[0.35 0.1 0.3 0.3],'Callback',{@close_this,ew},'BackgroundColor',bgcolor); + + function close_this(src,eventdata,handle) + set(handle,'WindowStyle','normal'); + delete(handle); + end + end + + function set_onoff_options(src,eventdata,number,handle) + option_wrapper=get(handle,'UserData'); + option_wrapper.options{2}{number}{end}={get(src,'Value')}; + set(handle,'UserData',options); + end + + function run_FASTER(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; + if ~using_ALLEEG && (isempty(option_wrapper.options.file_options.folder_name) || ~exist(option_wrapper.options.file_options.folder_name,'dir')) + errordlg('Invalid job folder selected.','Error','modal'); + %assignin('base','optins',option_wrapper); + return; + end + if (~isempty(option_wrapper.options.file_options.output_folder_name) && ~exist(option_wrapper.options.file_options.output_folder_name,'dir')) + errordlg('Invalid output folder selected.','Error','modal'); + return; + end + if (isempty(option_wrapper.options.file_options.channel_locations)) + if (option_wrapper.options.file_options.is_bdf==1) + errordlg('Must enter channel locations for .bdf files.','Error','modal'); + return; + else + button = questdlg(sprintf('No channel locations entered.\nDo all .set files have channel locations?'),'Channel locations','Yes','No','Yes'); + if strcmp(button,'No') + return; + end + end + end + if (option_wrapper.options.ica_options.run_ica && ~isempty(setdiff(option_wrapper.options.ica_options.ica_channels,[option_wrapper.options.channel_options.eeg_chans option_wrapper.options.channel_options.ext_chans]))) + errordlg('Selected ICA channels are not a subset of selected EEG and external channels.'); + return; + end + + % v=version(); + % dots=strfind(v,'.'); + % v_num=str2num(v(1:dots(2)-1)); + % + % if v_num>7.4 + % FASTER(option_wrapper); + % else + % FASTER_compat(option_wrapper); + % end + + % Version number check is awkward at the moment. + % Using lasterror for the moment until it is removed + % completely. + + % If none of the above checks returned, run FASTER! + try + FASTER(option_wrapper); + catch + m=lasterror; + if exist('my_queue_file','var') && ~isempty(my_queue_file) && exist(my_queue_file,'file') + delete(my_queue_file); + end + if exist('my_proc_file','var') && ~isempty(my_proc_file) && exist(my_proc_file,'file') + delete(my_proc_file); + end + assignin('base','m',m); + rethrow(m); + end + end + + function stop(src,eventdata) + error('Stopped FASTER!\n'); + end + + function new_job(src,eventdata,handle) + folder_to_do = uigetdir(cd,'Open folder to process'); + [root_folder f1 f2] = fileparts(folder_to_do); + + [pathname file_to_save] = uiputfile('*.eegjob','Save job',[folder_to_do filesep f1 f2 '.eegjob']); + if (all(folder_to_do~=0) && all(file_to_save~=0)) + option_wrapper.file_options.folder_name=folder_to_do; + + save_job([],[],handle,[pathname filesep file_to_save]); + end + end + + function open_job(src,eventdata,handle,std_options) + [file_to_do pathname] = uigetfile('*.eegjob','Select EEG job to open'); + option_wrapper=get(handle,'UserData'); + if (file_to_do~=0) + all=load([pathname filesep file_to_do],'-mat'); + or2=all.option_wrapper; + + using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; + %if exist([pathname filesep 'ProcQ.eegQ'],'file') + if ~using_ALLEEG + if isfield(or2.options.file_options,'folder_name_rel') && ~isempty(or2.options.file_options.folder_name_rel) + try + startDir = make_relative_path(or2.options.file_options.folder_name_rel,pathname); + or2.options.file_options.folder_name=startDir; + catch + startDir=or2.options.file_options.folder_name; + end + else + startDir=or2.options.file_options.folder_name; + end + else + startDir=cd; + end + + if (~using_ALLEEG && exist([startDir filesep file_to_do '_ProcQ.eegQ'],'file')) || (using_ALLEEG && exist([startDir filesep 'ProcQ.eegQ'],'file')) + button = questdlg(sprintf('Queue file present.\nJoining the queue will add this computer to an already running FASTER session (cannot be used if FASTER was started from EEGLAB).\n\nOverwriting will delete the queue file and start from the beginning. Use this if an error occurred previously, or if processing was aborted before finishing the job (resume will function as normal).\n\nCancelling will abort loading this file.'),'Queue file detected','Join','Reset Queue','Cancel','Join'); + if strcmp(button,'Cancel') + return; + elseif strcmp(button,'Reset Queue') + button = questdlg(sprintf('Warning: resetting will remove the queue file and other tracking files. Please ensure no other computers are using this job file for processing.\nContinue?'),'Restart warning','Yes','No','No'); + if strcmp(button,'No') + return; + end + if ~using_ALLEEG + delete([startDir filesep file_to_do '_ProcQ.eegQ']); + else + delete([startDir filesep 'ProcQ.eegQ']); + end + if exist([startDir filesep 'Queue'],'dir') + D=dir([startDir filesep 'Queue']); + for v=1:length(D) + if ~strcmp(D(v).name,'.') && ~strcmp(D(v).name,'..') + delete([startDir filesep 'Queue' filesep D(v).name]); + end + end + rmdir([startDir filesep 'Queue']); + end + if exist([startDir filesep 'Processing'],'dir') + D=dir([startDir filesep 'Processing']); + for v=1:length(D) + if ~strcmp(D(v).name,'.') && ~strcmp(D(v).name,'..') + delete([startDir filesep 'Processing' filesep D(v).name]); + end + end + rmdir([startDir filesep 'Processing']); + end + end + end + + or2.options.file_options.using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; + option_wrapper.options=check_options(src,eventdata,std_options,or2.options); + option_wrapper.options.file_options.resume=1; + option_wrapper.options.job_filename=[pathname filesep file_to_do]; + end + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function varargout=check_options(src,eventdata,op1,op2) + names=fieldnames(op1); + for v=1:length(names) + if ~isfield(op2,names{v}) + op2.(names{v})=op1.(names{v}); + elseif isstruct(op1.(names{v})) + names_2 = fieldnames(op1.(names{v})); + for t=1:length(names_2) + if ~isfield(op2.(names{v}),names_2{t}) + op2.(names{v}).(names_2{t})=op1.(names{v}).(names_2{t}); + elseif isstruct(op1.(names{v}).(names_2{t})) % Max three levels of structs + names_3 = fieldnames(op1.(names{v}).(names_2{t})); + for r=1:length(names_3) + if ~isfield(op2.(names{v}).(names_2{t}),names_3{r}) || ~all(size(op2.(names{v}).(names_2{t}).(names_3{r}))==size(op1.(names{v}).(names_2{t}).(names_3{r}))) + op2.(names{v}).(names_2{t}).(names_3{r})=op1.(names{v}).(names_2{t}).(names_3{r}); + end + end + end + end + end + end + if nargout==1 + varargout{1}=op2; + end + end + + function update_value(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + if (strcmp(get(src,'Style'),'edit')) + eval(sprintf('option_wrapper.options.%s = ''%s'';',get(src,'UserData'),get(src,'String'))); + else + eval(sprintf('option_wrapper.options.%s = %f;',get(src,'UserData'),get(src,'Value'))); + end + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + + function save_job(src,eventdata,handle,full_filename) + option_wrapper=get(handle,'UserData'); + tmp_using=option_wrapper.options.file_options.using_ALLEEG; + option_wrapper.options.file_options.using_ALLEEG=0; + if nargin==3 + if isempty(option_wrapper.options.job_filename) || ~exist(option_wrapper.options.job_filename,'file') + if isempty(option_wrapper.options.file_options.folder_name) + [pathname file_to_save] = uiputfile('*.eegjob','Save job'); + else + [root_folder f1 f2] = fileparts(option_wrapper.options.file_options.folder_name); + [pathname file_to_save] = uiputfile('*.eegjob','Save job',[option_wrapper.options.file_options.folder_name filesep option_wrapper.options.file_options.file_prefix f1 f2 '.eegjob']); + end + if (file_to_save==0) + return; + end + full_filename=[file_to_save filesep pathname]; + else + full_filename=option_wrapper.options.job_filename; + end + end + if ~isempty(option_wrapper.options.file_options.folder_name) + if exist('file_to_save','var') + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,file_to_save); + else + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,fileparts(option_wrapper.options.job_filename)); + end + else + option_wrapper.options.file_options.folder_name_rel=cell(0); + end + save(full_filename,'option_wrapper','-mat'); + option_wrapper.options.job_filename=full_filename; + option_wrapper.options.file_options.using_ALLEEG=tmp_using; + set(handle,'UserData',option_wrapper); + end + + function save_new_job(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + tmp_using=option_wrapper.options.file_options.using_ALLEEG; + option_wrapper.options.file_options.using_ALLEEG=0; + if isempty(option_wrapper.options.file_options.folder_name) + [pathname file_to_save] = uiputfile('*.eegjob','Save job'); + else + [root_folder f1 f2] = fileparts(option_wrapper.options.file_options.folder_name); + [pathname file_to_save] = uiputfile('*.eegjob','Save job',[option_wrapper.options.file_options.folder_name filesep option_wrapper.options.file_options.file_prefix f1 f2 '.eegjob']); + end + if (file_to_save==0) + return; + end + full_filename=[file_to_save filesep pathname]; + if exist('file_to_save','var') + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,file_to_save); + else + option_wrapper.options.file_options.folder_name_rel=find_relative_path(option_wrapper.options.file_options.folder_name,root_folder); + end + save(full_filename,'option_wrapper','-mat'); + option_wrapper.options.job_filename=full_filename; + option_wrapper.options.file_options.using_ALLEEG=tmp_using; + set(handle,'UserData',option_wrapper); + end + + function get_defaults(src,eventdata,handle,using_ALLEEG) + option_wrapper=get(handle,'UserData'); + filename=which('FASTER_defaults.mat'); + if ~isempty(filename) + x=load(filename,'-mat'); + option_wrapper_def=x.option_wrapper; + option_wrapper_def.options.job_filename=[]; + option_wrapper_def.options.current_file=[]; + option_wrapper_def.options.current_file_num=1; + %option_wrapper.options.file_options.using_ALLEEG=0; + end + + option_wrapper_def.options.file_options.using_ALLEEG=using_ALLEEG; + + if (top_nargout>0) + vout{1}=option_wrapper_def.options; + else + option_wrapper.options=option_wrapper_def.options; + set(handle,'UserData',option_wrapper); + update_controls(src,eventdata,handle); + end + end + + function update_controls(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + for c=1:length(option_wrapper.save_handles) + set(option_wrapper.save_handles(c),'Value',option_wrapper.options.save_options(c)); + end + + % File options etc + for c=1:length(option_wrapper.other_handles) + if (strcmp(get(option_wrapper.other_handles(c),'Style'),'edit') || strcmp(get(option_wrapper.other_handles(c),'Style'),'text')) + set(option_wrapper.other_handles(c),'String',eval(['option_wrapper.options.' get(option_wrapper.other_handles(c),'UserData')])); + elseif strcmp(get(option_wrapper.other_handles(c),'Style'),'pushbutton') + + else + if (strcmp(get(option_wrapper.other_handles(c),'UserData'),'file_options.save_ALLEEG')) + if ~isempty(option_wrapper.options.file_options.output_folder_name) + option_wrapper.options.file_options.save_ALLEEG=1; + set(option_wrapper.other_handles(c),'Enable','off'); + else + set(option_wrapper.other_handles(c),'Enable','on'); + end + end + set(option_wrapper.other_handles(c),'Value',eval(['option_wrapper.options.' get(option_wrapper.other_handles(c),'UserData')])); + end + end + end + + function save_defaults(src,eventdata,handle) + option_wrapper=get(handle,'UserData'); + option_wrapper.job_filename=[]; + option_wrapper.options.using_ALLEEG=0; + if ~isempty(which('FASTER_defaults.mat')) + save(which('FASTER_defaults.mat'),'option_wrapper','-mat'); + else + [root_folder] = fileparts(which('FASTER_callbacks.m')); + save([root_folder filesep 'FASTER_defaults.mat'],'option_wrapper','-mat'); + end + end + +if top_nargout>0 + if (~exist('vout','var')) + for u=1:top_nargout + vout{u}=[]; + end + end + varargout=vout; +end + +end + diff --git a/code/eeglab13_4_4b/plugins/FASTER/FASTER_grandaverage.m b/code/eeglab13_4_4b/plugins/FASTER/FASTER_grandaverage.m new file mode 100644 index 0000000..1c31fd6 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/FASTER_grandaverage.m @@ -0,0 +1,222 @@ +function FASTER_grandaverage(startDir,option_wrapper,all_errors,top_log,plist,nlist) + +if ~option_wrapper.options.averaging_options.make_GA + return; +end + +using_ALLEEG=option_wrapper.options.file_options.using_ALLEEG; +save_ALLEEG=option_wrapper.options.file_options.save_ALLEEG; +outDir=option_wrapper.options.file_options.output_folder_name; + +if using_ALLEEG + length_ALLEEG=evalin('base','length(ALLEEG);'); + if ~(length(plist)==length_ALLEEG) + plist=cell(1,length_ALLEEG); + end +end + +try + if (option_wrapper.options.averaging_options.make_GA && (~isempty(plist) || using_ALLEEG)) + GA_markers=option_wrapper.options.averaging_options.GA_markers; + + if ~isempty(GA_markers) + GAs=cell(size(GA_markers)); + p=ones(size(GA_markers)); + else + p=1; + end + GA_epoch_length=option_wrapper.options.averaging_options.GA_epoch_length; + + %% Do per-file or per-ALLEEG-dataset averaging + + for i=1:length(plist) + % If the output folder option is set, get the proper subdirectory + % under that, otherwise use the original directory + if ~using_ALLEEG && ~isempty(outDir) + dir_structure=get_dir_structure(plist{i},option_wrapper.options.file_options.folder_name); + filepath=outDir; + for v=1:length(dir_structure) + filepath=[filepath filesep dir_structure{v}]; + end + else + filepath=plist{i}; + end + + if (~isempty(option_wrapper.options.file_options.searchstring)) + searchstring2=option_wrapper.options.file_options.searchstring; + else + searchstring2=nlist{i}; + end + if using_ALLEEG || (~isempty(strfind(nlist{i},searchstring2)) || ~isempty(strfind(filepath,searchstring2))) && exist([filepath filesep option_wrapper.options.file_options.file_prefix nlist{i}(1:end-4) '.set'],'file') + if ~using_ALLEEG + EEGt=pop_loadset('filepath',filepath,'filename',[option_wrapper.options.file_options.file_prefix nlist{i}(1:end-4) '.set']); + elseif ~evalin('base',sprintf('isempty(ALLEEG(%d).data);',i)) + EEGt=evalin('base',sprintf('ALLEEG(%d);',i)); + end + if ~isempty(option_wrapper.options.averaging_options.GA_markers) && ~isempty(EEGt) && ~isempty(EEGt.data) + if iscell(GA_markers) + for v=1:length(GA_markers) + [EEGt1 did_epoch]=h_epoch(EEGt,GA_markers{v},GA_epoch_length + [2/EEGt.srate -2/EEGt.srate]); + if ~isempty(EEGt1.data) && size(EEGt1.data,3)>1 && did_epoch + if exist('trimmean','file')==2 + trim_mean_on=option_wrapper.options.averaging_options.GA_trimmed_mean; + trim_mean_perc=option_wrapper.options.averaging_options.GA_trimmed_mean_perc; + GAs{v}(:,:,p(v))=trimmean(EEGt1.data,trim_mean_on*trim_mean_perc,3); + else + GAs{v}(:,:,p(v))=mean(EEGt1.data,3); + end + p(v)=p(v)+1; + end + end + %p=p+1; + else + for v=1:length(GA_markers) + [EEGt1 did_epoch]=h_epoch(EEGt,GA_markers(v),GA_epoch_length + [2/EEGt.srate -2/EEGt.srate]); + if ~isempty(EEGt1.data) && size(EEGt1.data,3)>1 && did_epoch + if exist('trimmean','file')==2 + trim_mean_on=option_wrapper.options.averaging_options.GA_trimmed_mean; + trim_mean_perc=option_wrapper.options.averaging_options.GA_trimmed_mean_perc; + GAs{v}(:,:,p(v))=trimmean(EEGt1.data,trim_mean_on*trim_mean_perc,3); + else + GAs{v}(:,:,p(v))=mean(EEGt1.data,3); + end + p(v)=p(v)+1; + else + + end + end + %p=p+1; + end + elseif ~isempty(EEGt.data) && size(EEGt.data,3)>1 + if exist('trimmean','file')==2 + trim_mean_on=option_wrapper.options.averaging_options.GA_trimmed_mean; + trim_mean_perc=option_wrapper.options.averaging_options.GA_trimmed_mean_perc; + GAs(:,:,p)=trimmean(EEGt.data,trim_mean_on*trim_mean_perc,3); + else + GAs(:,:,p)=mean(EEGt.data,3); + end + p=p+1; + elseif size(EEGt.data,3)==1 + warning('Continuous dataset not included in grand average. A blank epoch may be present.'); + else + warning('Empty dataset not included in grand average. A blank epoch may be present.'); + end + end + end + + %% Do rejection + + if ~isempty(option_wrapper.options.averaging_options.GA_markers) && exist('GAs','var') && ~isempty(GAs) + if iscell(GA_markers) + for v=1:length(GA_markers) + if ~isempty(GAs{v}) + cl=EEGt.chanlocs; ci=EEGt.chaninfo; + EEGt=make_EEG(GAs{v},GA_markers{v},EEGt.srate,GA_epoch_length + [2/EEGt.srate -2/EEGt.srate]); + EEGt.chanlocs=cl; EEGt.chaninfo=ci; + if (option_wrapper.options.averaging_options.subject_removal_on) && size(EEGt.data,3)>1 + list_properties=GA_properties(EEGt,option_wrapper.options.channel_options.eeg_chans,option_wrapper.options.ica_options.EOG_channels); + lengths=min_z(list_properties,option_wrapper.options.averaging_options.rejection_options); + if ~isempty(find(lengths, 1)) + bad_subjs=find(lengths); + EEGt=pop_rejepoch(EEGt,bad_subjs,0); + fprintf(top_log,'In the grand average for marker %s, the following files were removed:',GA_markers{v}); + fprintf(top_log,'%s%s%s\n',plist{bad_subjs},filesep,nlist{bad_subjs}); + fprintf(top_log,'\n'); + end + end + EEGt=eeg_checkset(EEGt); + if ~isempty(outDir) + pop_saveset(EEGt,'filename',[option_wrapper.options.file_options.file_prefix EEGt.setname '.set'],'filepath',outDir); + elseif ~using_ALLEEG || save_ALLEEG + pop_saveset(EEGt,'filename',[option_wrapper.options.file_options.file_prefix EEGt.setname '.set'],'filepath',startDir); + end + if using_ALLEEG + assignin('base','FASTER_Temp_EEG',EEGt); + evalin('base','[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, FASTER_Temp_EEG);clear FASTER_Temp_EEG;eeglab redraw;'); + end + else + fprintf(top_log,'No markers %s detected in any files.\n',GA_markers{v}) + end + end + else + for v=1:length(GA_markers) + if ~isempty(GAs{v}) + cl=EEGt.chanlocs; ci=EEGt.chaninfo; + EEGt=make_EEG(GAs{v},GA_markers(v),EEGt.srate,GA_epoch_length + [2/EEGt.srate -2/EEGt.srate]); + EEGt.chanlocs=cl; EEGt.chaninfo=ci; + if (option_wrapper.options.averaging_options.subject_removal_on) && size(EEGt.data,3)>1 + list_properties=GA_properties(EEGt,option_wrapper.options.channel_options.eeg_chans,option_wrapper.options.ica_options.EOG_channels); + lengths=min_z(list_properties,option_wrapper.options.averaging_options.rejection_options); + if ~isempty(find(lengths, 1)) + bad_subjs=find(lengths); + EEGt=pop_rejepoch(EEGt,bad_subjs,0); + fprintf(top_log,'In the grand average for marker %d, the following files were removed:',GA_markers(v)); + fprintf(top_log,'%s%s%s\n',plist{bad_subjs},filesep,nlist{bad_subjs}); + fprintf(top_log,'\n'); + end + end + EEGt=eeg_checkset(EEGt); + if ~isempty(outDir) + pop_saveset(EEGt,'filename',[option_wrapper.options.file_options.file_prefix EEGt.setname '.set'],'filepath',outDir); + elseif ~using_ALLEEG || save_ALLEEG + pop_saveset(EEGt,'filename',[option_wrapper.options.file_options.file_prefix EEGt.setname '.set'],'filepath',startDir); + end + if using_ALLEEG + assignin('base','FASTER_Temp_EEG',EEGt); + evalin('base','[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, FASTER_Temp_EEG);clear FASTER_Temp_EEG;eeglab redraw;'); + end + else + fprintf(top_log,'No markers %d detected in any files.\n',GA_markers(v)) + end + end + end + elseif exist('GAs','var') && ~isempty(GAs) + cl=EEGt.chanlocs; ci=EEGt.chaninfo; + EEGt=make_EEG(GAs,1,EEGt.srate,GA_epoch_length + [2/EEGt.srate -2/EEGt.srate]); + EEGt.chanlocs=cl; EEGt.chaninfo=ci; + if (option_wrapper.options.averaging_options.subject_removal_on) && size(EEGt.data,3)>1 + list_properties=GA_properties(EEGt,option_wrapper.options.channel_options.eeg_chans,option_wrapper.options.ica_options.EOG_channels); + lengths=min_z(list_properties,option_wrapper.options.averaging_options.rejection_options); + if ~isempty(find(lengths, 1)) + bad_subjs=find(lengths); + EEGt=pop_rejepoch(EEGt,bad_subjs,0); + fprintf(top_log,'In the grand average, the following files were removed:'); + fprintf(top_log,'%s%s%s\n',plist{bad_subjs},filesep,nlist{bad_subjs}); + fprintf(top_log,'\n'); + end + end + EEGt=eeg_checkset(EEGt); + + if ~isempty(outDir) + pop_saveset(EEGt,'filename',[option_wrapper.options.file_options.file_prefix 'GA.set'],'filepath',outDir); + elseif ~using_ALLEEG || save_ALLEEG + pop_saveset(EEGt,'filename',[option_wrapper.options.file_options.file_prefix 'GA.set'],'filepath',startDir); + end + if using_ALLEEG + assignin('base','FASTER_TMP_EEG',EEGt); + evalin('base','[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, FASTER_TMP_EEG);clear FASTER_TMP_EEG;eeglab redraw;'); + end + else + fprintf(top_log,'No epoched files were found.\n') + end + end +catch + m=lasterror; + fprintf('Error - %s.\n',m.message); + fprintf(top_log,'Error in grand averaging - %s.\n',m.message); + if option_wrapper.debug + if exist('EEGt','var') + EEG_state{1}=evalc('disp(EEGt)'); + end + EEG_state{2}=option_wrapper; + EEG_state{3}=builtin('version'); + if exist('eeg_getversion','file') + EEG_state{4}=eeg_getversion; + else + EEG_state{4}=which('eeglab'); + end + all_errors{end+1,1}=m; + all_errors{end,2}=EEG_state; + save([startDir filesep option_wrapper.options.file_options.file_prefix 'FASTER_errors.mat'],'all_errors','-mat'); + end +end diff --git a/code/eeglab13_4_4b/plugins/FASTER/FASTER_process.m b/code/eeglab13_4_4b/plugins/FASTER/FASTER_process.m new file mode 100644 index 0000000..66e74ec --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/FASTER_process.m @@ -0,0 +1,680 @@ +function EEG=FASTER_process(option_wrapper,log_file) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +EEG=[]; +try + tic; + o=option_wrapper.options; + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % File options % + %%%%%%%%%%%%%%%% + % 1 File name including full path (string) + % 2 Reference channel (integer > 0) + % 3 Number of data channels (integer > 0) + % 4 Number of extra channels (integer > 0) + % 5 Channel locations file including full path (string) + % 6 Save options (cell) + %%%%%%%%%%%%%%%% + + using_ALLEEG=o.file_options.using_ALLEEG; + prefix=o.file_options.file_prefix; + %prefix_ALLEEG=o.file_options.prefix_ALLEEG; + + fullfilename = o.file_options.current_file; + ref_chan = o.channel_options.ref_chan; + eeg_chans = o.channel_options.eeg_chans; + if (eeg_chans==0) + eeg_chans=[]; + end + ext_chans = o.channel_options.ext_chans; + if (ext_chans==0) + ext_chans=[]; + end + channel_locations_file = o.file_options.channel_locations; + save_options = o.save_options; + cutoff_markers = o.file_options.cutoff_markers; + do_reref = o.channel_options.do_reref; + + if (~do_reref) + ref_chan=[]; + end + [filepath,filename,extension] = fileparts(fullfilename); + + %log_file = fopen([filepath filesep filename '.log'],'a'); + + c=clock; + months={'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec'}; + fprintf(log_file,'\n%d/%s/%d %d:%d:%d\n',c(3),months{c(2)},c(1),c(4),c(5),round(c(6))); + fprintf(log_file,'%.2f - Opened log file.\n',toc); + + %%%%%%%%%%%%%%%%%%%%%% + % File setup section % + %%%%%%%%%%%%%%%%%%%%%% + + % Import .bdf file or load .set file + % Note: import all channels and then remove the unnecessary ones, as + % otherwise the event channel gets removed and we have no event data. + if strcmpi(extension,'.bdf') && ~using_ALLEEG + fprintf('Importing %s.\n',fullfilename); + EEG = pop_biosig(fullfilename); + EEG.setname = filename; + EEG = pop_select(EEG, 'nochannel',length(eeg_chans)+length(ext_chans)+1:size(EEG.data,1)); + if (do_reref) + if (max(EEG.data(ref_chan,:))==0 && min(EEG.data(ref_chan,:))==0) + fprintf(log_file,'%.2f - Reference channel %d is already zeroed. Data was not re-referenced.\n',toc,ref_chan); + elseif (o.ica_options.keep_ICA && ~isempty(EEG.icaweights)) + fprintf(log_file,'%.2f - Data was not re-referenced to maintain existing ICA weights. Bad channel detection may be ineffective.\n',toc,ref_chan); + else + EEG = h_pop_reref( EEG, ref_chan, 'exclude', ext_chans, 'keepref', 'on'); + end + end + + filename = [o.file_options.file_prefix filename]; + filepath=o.file_options.oplist{o.file_options.current_file_num}; + mkdir([filepath filesep 'Intermediate']); + EEG = pop_saveset(EEG,'filename',[filename '.set'],'filepath',filepath,'savemode','onefile'); + fprintf(log_file,'%.2f - Imported and converted file %s.\n',toc,fullfilename); + elseif strcmpi(extension,'.set') && ~using_ALLEEG + fprintf('Loading %s.\n',fullfilename); + EEG = pop_loadset('filename',[filename '.set'],'filepath',filepath); + fprintf(log_file,'%.2f - Loaded file %s.\n',toc,fullfilename); + if ~isempty(o.file_options.output_folder_name) + filepath=o.file_options.oplist{o.file_options.current_file_num}; + mkdir([filepath filesep 'Intermediate']); + else + filepath=o.file_options.oplist{o.file_options.current_file_num}; + mkdir([filepath filesep 'Intermediate']); + pop_saveset(EEG,'filename',['Original_' filename '.set'],'filepath',[filepath filesep 'Intermediate']); + delete(fullfilename); + if exist([fullfilename(1:end-4) '.fdt'],'file') + delete([fullfilename(1:end-4) '.fdt']); + end + if exist([fullfilename(1:end-4) '.dat'],'file') + delete([fullfilename(1:end-4) '.dat']); + end + end + filename = [o.file_options.file_prefix filename]; + EEG.filename = [filename '.set']; + elseif using_ALLEEG + EEG=evalin('base',sprintf('ALLEEG(%d);',o.file_options.plist{o.file_options.current_file_num})); + filepath=o.file_options.oplist{o.file_options.current_file_num}; + + if ~isempty(EEG.filename) + filename=sprintf('%s%s.set',prefix,EEG.filename); + elseif ~isempty(EEG.setname) + filename=sprintf('%sALLEEG(%d)_%s.set',prefix,o.file_options.current_file_num,EEG.setname); + else + filename=sprintf('%sALLEEG(%d).set',prefix,o.file_options.current_file_num); + end + EEG.filepath=filepath; + EEG.filename=filename; + mkdir([filepath filesep 'Intermediate']); + EEG = pop_select(EEG, 'nochannel',length(eeg_chans)+length(ext_chans)+1:size(EEG.data,1)); + if (do_reref) + if (max(EEG.data(ref_chan,:))==0 && min(EEG.data(ref_chan,:))==0) + fprintf(log_file,'%.2f - Reference channel %d is already zeroed. Data was not re-referenced.\n',toc,ref_chan); + elseif (o.ica_options.keep_ICA && ~isempty(EEG.icaweights)) + fprintf(log_file,'%.2f - Data was not re-referenced to maintain existing ICA weights. Bad channel detection may be ineffective.\n',toc,ref_chan); + else + EEG = h_pop_reref( EEG, ref_chan, 'exclude', ext_chans, 'keepref', 'on'); + end + end + else + EEG=[]; + fprintf('Unknown file format.\n'); + fprintf(log_file,'%.2f - Unknown file format. Cannot process.\n',toc); + return; + end + EEG = eeg_checkset(EEG); + + % Check if channel locations exist, and if not load them from disk. + if (~isfield(EEG.chanlocs,'X') || ~isfield(EEG.chanlocs,'Y') || ~isfield(EEG.chanlocs,'Z') || isempty(EEG.chanlocs)) || isempty([EEG.chanlocs(:).X]) || isempty([EEG.chanlocs(:).Y]) || isempty([EEG.chanlocs(:).Z]) + EEG = pop_chanedit(EEG, 'load', {channel_locations_file}); + EEG.saved='no'; + fprintf(log_file,'%.2f - Loaded channel locations file from %s.\n',toc,channel_locations_file); + end + %EEG = pop_saveset(EEG,'savemode','resave'); + + %%%%%%%%%%%%%%%% + % Save options % + %%%%%%%%%%%%%%%% + do_saves=(~using_ALLEEG || (o.file_options.save_ALLEEG && ~isempty(EEG.filename)) || ~isempty(o.file_options.output_folder_name)); + if (~do_saves) + save_options = zeros(size(save_options)); + else + EEG = pop_saveset(EEG,'filename',[filename '.set'],'filepath',filepath,'savemode','onefile'); + end + save_before_filter = save_options(1); + save_before_interp = save_options(2); + save_before_epoch = save_options(3); + save_before_ica_rej = save_options(4); + save_before_epoch_interp = save_options(5); + + if save_before_filter + EEGBAK=EEG; + EEGBAK.setname = ['pre_filt_' EEG.setname]; + pop_saveset(EEGBAK,'filename',['1_pre_filt_' EEG.filename],'filepath',[filepath filesep 'Intermediate'],'savemode','onefile'); + clear EEGBAK; + end + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Filtering % + %%%%%%%%%%%%% + + resample_frequency=o.filter_options.resample_freq; + do_resample=o.filter_options.resample_on; + % Downsampling is done later (shouldn't really be done at all). + + do_hipass=o.filter_options.hpf_on; + do_lopass=o.filter_options.lpf_on; + do_notch=o.filter_options.notch_on; + + if any(any(isnan(EEG.data))) + fprintf('NaN in EEG data before filtering.\n'); + end + + if do_hipass + w_h=o.filter_options.hpf_freq; + t_h=o.filter_options.hpf_bandwidth; + r_h=o.filter_options.hpf_ripple; + a_h=o.filter_options.hpf_attenuation; + + [m, wtpass, wtstop] = pop_firpmord([w_h-(t_h) w_h+(t_h)], [0 1], [10^(-1*abs(a_h)/20) (10^(r_h/20)-1)/(10^(r_h/20)+1)], EEG.srate); + if mod(m,2);m=m+1;end; + EEG = pop_firpm(EEG, 'fcutoff', w_h, 'ftrans', t_h, 'ftype', 'highpass', 'wtpass', wtpass, 'wtstop', wtstop, 'forder', m); + EEG.saved='no'; + fprintf(log_file,'%.2f - Highpass filter: %.3fHz, transition band: %.2f, order: %d.\n',toc,w_h,t_h,m); + end + + if do_lopass + w_l=o.filter_options.lpf_freq; + t_l=o.filter_options.lpf_bandwidth; + r_l=o.filter_options.lpf_ripple; + a_l=o.filter_options.lpf_attenuation; + + [m, wtpass, wtstop] = pop_firpmord([w_l-(t_l) w_l+(t_l)], [1 0], [(10^(r_l/20)-1)/(10^(r_l/20)+1) 10^(-1*abs(a_l)/20)], EEG.srate); + if mod(m,2);m=m+1;end; + EEG = pop_firpm(EEG, 'fcutoff', w_l, 'ftrans', t_l, 'ftype', 'lowpass', 'wtpass', wtpass, 'wtstop', wtstop, 'forder', m); + EEG.saved='no'; + fprintf(log_file,'%.2f - Lowpass filter: %.3fHz, transition band: %.2f, order: %d.\n',toc,w_l,t_l,m); + end + + if do_notch + for n=1:length(o.filter_options.notch_freq) + w_n=[o.filter_options.notch_freq(n)-o.filter_options.notch_bandwidth1/2 o.filter_options.notch_freq(n)+o.filter_options.notch_bandwidth1/2]; + t_n=o.filter_options.notch_bandwidth2; + r_n=o.filter_options.notch_ripple; + a_n=o.filter_options.notch_attenuation; + + [m, wtpass, wtstop] = pop_firpmord([w_n(1)-(t_n) w_n(1)+(t_n) w_n(2)-(t_n) w_n(2)+(t_n)], [0 1 0], [10^(-1*abs(a_n)/20) (10^(r_n/20)-1)/(10^(r_n/20)+1) 10^(-1*abs(a_n)/20)], EEG.srate); + if mod(m,2);m=m+1;end; + EEG = pop_firpm(EEG, 'fcutoff', w_n, 'ftrans', t_n, 'ftype', 'bandstop', 'wtpass', wtpass, 'wtstop', wtstop, 'forder', m); + EEG.saved='no'; + fprintf(log_file,'%.2f - Notch filter: %.3f to %.3fHz, transition band: %.2f, order: %d.\n',toc,w_n(1),w_n(2),t_n,m); + end + end + + if (do_saves), EEG = pop_saveset(EEG,'savemode','resave'); end + + if save_before_interp + EEGBAK=EEG; + EEGBAK.setname = ['pre_interp_' EEG.setname]; + pop_saveset(EEGBAK,'filename',['2_pre_interp_' EEG.filename],'filepath',[filepath filesep 'Intermediate'],'savemode','onefile'); + clear EEGBAK; + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Data cutoff point % + % Will be re-implemented % + %%%%%%%%%%%%%%%%%%%%%%%%%% + % if ~isempty(cutoff_markers) && any(cutoff_markers) + % cutoff_point=[0 size(EEG.data,2)+1]; + % for u=1:length(EEG.event) + % if EEG.event(u).type == cutoff_markers(1) || strcmp(EEG.event(u).type,cutoff_markers(1)) + % cutoff_point(1)=EEG.event(u).latency; % Finds the last 255 (check this one) + % end + % if EEG.event(u).type == cutoff_markers(2) || strcmp(EEG.event(u).type,cutoff_markers(2)) + % cutoff_point(2)=EEG.event(u).latency; % Finds the last 255 (check this one) + % end + % end + % if cutoff_point(1) > 1 + % EEG = pop_select( EEG, 'nopoint',[1 cutoff_point(1)] ); + % end + % if cutoff_point(2) < size(EEG.data,2) + % EEG = pop_select( EEG, 'nopoint',[cutoff_point(2) size(EEG.data(:,:),2)] ); + % end + % end + + % %New cutoff points for VESPA + % + % EEG = remevent(EEG,768);EEG=remevent(EEG,33536); + % + % + % first_real_event = -1; + % last_real_event = -1; + % + % for u=1:length(EEG.event)-2 + % + % if ((EEG.event(u).latency - EEG.event(u+1).latency) * (1000/EEG.srate) < 100 && (EEG.event(u+1).latency - EEG.event(u+2).latency) * (1000/EEG.srate) < 100 && first_real_event == -1) + % first_real_event = u; + % end + % + % if (first_real_event ~= -1 && (EEG.event(u).latency - EEG.event(u+1).latency) * (1000/EEG.srate) > 100 && (EEG.event(u+1).latency - EEG.event(u+2).latency) * (1000/EEG.srate) > 100 && last_real_event == -1) + % last_real_event = u; + % end + % + % end + % + % first_real_time=max(EEG.event(first_real_event).latency - EEG.srate,1); + % + % if (last_real_event==-1) + % last_real_time=min(EEG.event(end).latency + EEG.srate,size(EEG.data(:,:),2)); + % else + % last_real_time=min(EEG.event(last_real_event).latency + EEG.srate,1); + % end + % + % EEG = pop_select( EEG, 'point',[first_real_time:last_real_time] ); + % EEG.saved='no'; + % EEG = pop_saveset(EEG,'savemode','resave'); + % + % fprintf(log_file,'Cropped between %.2f and %.2f seconds.\n',first_real_time/EEG.srate,last_real_time/EEG.srate); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Channel interpolation options % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % 1 Automatic interpolation of bad channels on or off (1 / 0) + % 2 Radius for channel interpolation hypersphere (integer > 0) + % 3 Automatic interpolation of channels per single epoch at end of process (1 / 0) + % 4 Radius for epoch interpolation hypersphere (integer > 0) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + chans_to_interp=[]; + do_auto_interp = o.channel_options.channel_rejection_on; + + if do_auto_interp + list_properties = channel_properties(EEG,eeg_chans,ref_chan); + lengths = min_z(list_properties,o.channel_options.rejection_options); % Need to edit to make rejection_options.measure a vector, instead of multiple fields + chans_to_interp = union(eeg_chans(logical(lengths)),o.channel_options.bad_channels); + chans_to_interp = setdiff(chans_to_interp,ref_chan); % Ref chan may appear bad, but we shouldn't interpolate it! + if (o.channel_options.exclude_EOG_chans) + chans_to_interp = setdiff(chans_to_interp,o.ica_options.EOG_channels); + end + if ~o.channel_options.interp_after_ica + if ~isempty(chans_to_interp) + fprintf('Interpolating channel(s)'); + fprintf(' %d',chans_to_interp); + fprintf('.\n'); + EEG = h_eeg_interp_spl(EEG,chans_to_interp,ext_chans); + EEG.saved='no'; + fprintf(log_file,'%.2f - Interpolated channels',toc); fprintf(log_file,' %d',chans_to_interp); fprintf(log_file,'.\n'); + end + end + end + + if (do_saves), EEG = pop_saveset(EEG,'savemode','resave'); end + + if save_before_epoch + EEGBAK=EEG; + EEGBAK.setname = ['pre_epoch_' EEG.setname]; + pop_saveset(EEGBAK,'filename',['3_pre_epoch_' EEG.filename],'filepath',[filepath filesep 'Intermediate'],'savemode','onefile'); + clear EEGBAK; + end + + %%% Do resampling here (if done pre-filtering, it creates problems). %%% + %%% It does anyway, it seems. %%% + if do_resample + old_name = EEG.setname; + old_srate = EEG.srate; + EEG = pop_resample( EEG, resample_frequency); + EEG.setname = old_name; + fprintf(log_file,'%.2f - Resampled from %dHz to %dHz.\n',toc,old_srate,resample_frequency); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Epoch options % + %%%%%%%%%%%%%%%%% + % 1 Epoching on or off (1 / 0) + % 2 Markers to epoch from (array of integers or cell of strings) + % 3 Epoch length (vector of 2 floats, 1 negative, 1 positive) - seconds + % 4 Baseline length for mean subtraction (vector of 2 integers) (0 => baseline subtraction off) - milliseconds + % 5 Auto epoch rejection on or off (1 / 0) + % 6 Radius for epoch rejection hypersphere (integer > 0) + %%%%%%%%%%%%%%%%% + markers = o.epoch_options.epoch_markers; + epoch_length = o.epoch_options.epoch_limits; + baseline_time = o.epoch_options.baseline_sub * 1000; + do_epoch_rejection = o.epoch_options.epoch_rejection_on; + do_epoching = ((~isempty(markers) && o.epoch_options.markered_epoch) || o.epoch_options.unmarkered_epoch) && any(o.epoch_options.epoch_limits) && length(o.epoch_options.epoch_limits)==2; + + %%%%%%%%%%%%%% + % Epoch data % + %%%%%%%%%%%%%% + if do_epoching + oldname = EEG.setname; + if ~o.epoch_options.unmarkered_epoch + EEGt = h_epoch(EEG,markers,epoch_length); + EEG.setname = oldname; + EEG.saved='no'; + if isnumeric(markers) + fprintf(log_file,'%.2f - Epoched data on markers',toc); + fprintf(log_file,' %d',markers); + fprintf(log_file,'.\n'); + else + fprintf(log_file,'%.2f - Epoched data on markers',toc); + fprintf(log_file,' %s',markers{:}); + fprintf(log_file,'.\n'); + end + if size(EEG.data,3)==0 + fprintf(log_file,'Epoch length too short, no epochs were generated.\n'); + else + EEG=EEGt; + clear EEGt; + end + else + EEG = eeg_regepochs(EEG,o.epoch_options.unmarkered_epoch_interval,epoch_length,NaN); + EEG.setname = oldname; + EEG.saved='no'; + fprintf(log_file,'%.2f - Epoched data every %.2f seconds.\n',toc,o.epoch_options.unmarkered_epoch_interval); + end + + % Remove epoch baselines after epoching: + if any(baseline_time) + EEG = pop_rmbase( EEG, baseline_time); + end + end + if (size(EEG.data,3)>1) + % Rereference just to print baseline variance, as otherwise the initial + % BL variance is with a single reference, and the final in average + % reference + EEGtemp = h_pop_reref(EEG, [], 'exclude',ext_chans, 'refstate', ref_chan); + fprintf(log_file,'Initial baseline variance: %.2f.\n',median(var(mean(EEGtemp.data(:,1:round(EEGtemp.srate*-1*EEGtemp.xmin),:),3),[],2))); + clear EEGtemp; + end + + if (do_saves), EEG = pop_saveset(EEG,'savemode','resave'); end + + %%%%%%%%%%%%%%%%%%%%%%%%%%% + % Epoch rejection section % + %%%%%%%%%%%%%%%%%%%%%%%%%%% + if do_epoch_rejection && size(EEG.data,3)>1 + if (o.channel_options.interp_after_ica) + list_properties = epoch_properties(EEG,setdiff(eeg_chans,chans_to_interp)); + else + list_properties = epoch_properties(EEG,eeg_chans); + end + [lengths] = min_z(list_properties,o.epoch_options.rejection_options); + EEG=pop_rejepoch(EEG, find(lengths),0); + fprintf(log_file,'%.2f - Rejected %d epochs',toc,length(find(lengths))); + fprintf(log_file,' %d',find(lengths)); + fprintf(log_file,'.\n'); + EEG.saved='no'; + end + + if (do_saves), EEG = pop_saveset(EEG,'savemode','resave'); end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Average reference % + %%%%%%%%%%%%%%%%%%%%% + if (do_reref && ~o.ica_options.keep_ICA) + if ~o.channel_options.interp_after_ica + EEG = h_pop_reref(EEG, [], 'exclude',ext_chans, 'refstate', ref_chan); + else + EEG = h_pop_reref(EEG, [], 'exclude',[ext_chans chans_to_interp], 'refstate', ref_chan); + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % ICA options % + %%%%%%%%%%%%%%% + % 1 ICA on or off (1 / 0) + % 2 Auto component rejection on or off (1 / 0) + % 3 Radius for component rejection hypersphere (integer > 0) + % 4 EOG channels (vector of integers) + %%%%%%%%%%%%%%% + do_ica = o.ica_options.run_ica; + k_value = o.ica_options.k_value; + do_component_rejection = o.ica_options.component_rejection_on; + EOG_chans = o.ica_options.EOG_channels; + ica_chans = o.ica_options.ica_channels; + + %%%%%%%%%% + % Do ICA % + %%%%%%%%%% + if do_ica && (~o.ica_options.keep_ICA || isempty(EEG.icaweights)) + num_pca = min(floor(sqrt(size(EEG.data(:,:),2) / k_value)),(size(EEG.data,1) - length(chans_to_interp) - 1)); + num_pca = min(num_pca,length(setdiff(ica_chans,chans_to_interp))); + if (o.channel_options.interp_after_ica) + %EEG = pop_runica(EEG, 'icatype', 'runica', 'dataset',1, 'chanind',setdiff(ica_chans,chans_to_interp),'options',{'extended',1,'pca',num_pca}); + ica_chans=intersect(setdiff(ica_chans,chans_to_interp),union(eeg_chans,ext_chans)); + EEG = pop_runica(EEG, 'dataset',1, 'chanind',setdiff(ica_chans,chans_to_interp),'options',{'extended',1,'pca',num_pca}); + else + %EEG = pop_runica(EEG, 'icatype', 'runica', 'dataset',1, 'chanind',ica_chans,'options',{'extended',1,'pca',num_pca}); + ica_chans=intersect(ica_chans,union(eeg_chans,ext_chans)); + EEG = pop_runica(EEG, 'dataset',1, 'chanind',ica_chans,'options',{'extended',1,'pca',num_pca}); + end + EEG.saved='no'; + fprintf(log_file,'%.2f - Ran ICA.\n',toc); + end + + if (do_saves), EEG = pop_saveset(EEG,'savemode','resave'); end + + if save_before_ica_rej + EEGBAK=EEG; + EEGBAK.setname = ['pre_comp_rej_' EEG.setname]; + pop_saveset(EEGBAK,'filename',['4_pre_comp_rej_' EEG.filename],'filepath',[filepath filesep 'Intermediate'],'savemode','onefile'); + clear EEGBAK; + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Component rejection section % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Also includes topoplots % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if do_component_rejection && ~isempty(EEG.icaweights) + EEG = eeg_checkset(EEG); + original_name=EEG.setname; + if do_lopass + list_properties = component_properties(EEG,EOG_chans,[w_l-(t_l/2) w_l+(t_l/2)]); + elseif ~isempty(o.ica_options.lopass_freq) && o.ica_options.lopass_freq~=0 + list_properties = component_properties(EEG,EOG_chans,[o.ica_options.lopass_freq-5 o.ica_options.lopass_freq+5]); + else + list_properties = component_properties(EEG,EOG_chans); + o.ica_options.rejection_options.measure(2)=0; + end + [lengths] = min_z(list_properties,o.ica_options.rejection_options); + bad_comps=find(lengths); + + % Plot stuff + if (o.ica_options.IC_images) + p=1; + activations=eeg_getica(EEG); + perc_vars = var(activations(:,:),[],2); + perc_vars = 100*perc_vars./sum(perc_vars); + for u=1:size(EEG.icawinv,2) + if ~mod(u-1,16) + if (u~=1) + saveas(h,sprintf('%s%sIntermediate%sComponents_%d.png',filepath,filesep,filesep,p)); + p=p+1; + close(h); + end + h=figure; + end + subplot(4,4,1+mod(u-1,16)); + % if (size(EEG.icawinv,1)~=length(EEG.chanlocs)) + % topoplot(EEG.icawinv(:,u),EEG.chanlocs(setdiff(1:length(EEG.chanlocs),chans_to_interp))); + topoplot(EEG.icawinv(:,u),EEG.chanlocs(EEG.icachansind)); + % else + % topoplot(EEG.icawinv(:,u),EEG.chanlocs); + %end + title(sprintf('Component %d\n%.1f%% variance',u,perc_vars(u))); + if ~isempty(find(bad_comps==u, 1)) + c=get(h,'Children'); + c2=get(c(1),'Children'); + set(c2(5),'FaceColor',[0.6 0 0]); + x=get(c2(5),'XData'); + x(1:end/2)=1.5*(x(1:end/2)); + set(c2(5),'XData',x); + y=get(c2(5),'YData'); + y(1:end/2)=1.5*(y(1:end/2)); + set(c2(5),'YData',y); + end + end + %p=p+1; + saveas(h,sprintf('%s%sIntermediate%sComponents_%d.png',filepath,filesep,filesep,p)); + if ~isempty(h) + close(h); + end + end + + % Reject + if ~isempty(find(lengths,1)) + fprintf('Rejecting components'); + fprintf(' %d',find(lengths)); + fprintf('.\n'); + EEG = pop_subcomp(EEG, find(lengths), 0); + fprintf(log_file,'%.2f - Rejected %d components',toc,length(find(lengths))); + fprintf(log_file,' %d',find(lengths)); + fprintf(log_file,'.\n'); + else + fprintf('Rejected no components.\n'); + fprintf(log_file,'%.2f - Rejected no components.\n',toc); + end + EEG.setname=original_name; + EEG.saved='no'; + elseif ~isempty(EEG.icawinv) && o.ica_options.IC_images + activations=eeg_getica(EEG); + perc_vars = var(activations(:,:),[],2); + perc_vars = 100*perc_vars./sum(perc_vars); + p=1; + for u=1:size(EEG.icawinv,2) + if ~mod(u-1,16) + if (u~=1) + saveas(h,sprintf('%s%sIntermediate%sComponents_%d.png',filepath,filesep,filesep,p)); + p=p+1; + close(h); + end + h=figure; + end + subplot(4,4,1+mod(u-1,16)); + topoplot(EEG.icawinv(:,u),EEG.chanlocs); + title(sprintf('Component %d\n%.1f%% variance',u,perc_vars(u))); + end + %p=p+1; + saveas(h,sprintf('%s%sIntermediate%sComponents_%d.png',filepath,filesep,filesep,p)); + if ~isempty(h) + close(h); + end + end + + if (do_saves), EEG = pop_saveset(EEG,'savemode','resave'); end + + if save_before_epoch_interp + EEGBAK=EEG; + EEGBAK.setname = ['pre_epoch_interp_' EEG.setname]; + pop_saveset(EEGBAK,'filename',['5_pre_epoch_interp_' EEG.filename],'filepath',[filepath filesep 'Intermediate'],'savemode','onefile'); + clear EEGBAK; + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Interpolation section part 2 % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + if o.channel_options.interp_after_ica + if ~isempty(chans_to_interp) + fprintf('Interpolating channel(s)'); + fprintf(' %d',chans_to_interp); + fprintf('.\n'); + EEG = h_eeg_interp_spl(EEG,chans_to_interp,ext_chans); + EEG.saved='no'; + fprintf(log_file,'%.2f - Interpolated channels',toc); fprintf(log_file,' %d',chans_to_interp); fprintf(log_file,'.\n'); + end + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Epoch interpolation section % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + do_epoch_interp=o.epoch_interp_options.epoch_interpolation_on; + if do_epoch_interp && length(size(EEG.data)) > 2 + status = ''; + lengths_ep=cell(1,size(EEG.data,3)); + for v=1:size(EEG.data,3) + list_properties = single_epoch_channel_properties(EEG,v,eeg_chans); + lengths_ep{v}=eeg_chans(logical(min_z(list_properties,o.epoch_interp_options.rejection_options))); + status = [status sprintf('%d: ',v) sprintf('%d ',lengths_ep{v}) sprintf('\n')]; + end + EEG=h_epoch_interp_spl(EEG,lengths_ep,ext_chans); + EEG.saved='no'; + epoch_interps_log_file=fopen([filepath filesep filename '_epoch_interpolations.txt'],'a'); + fprintf(epoch_interps_log_file,'%s',status); + fclose(epoch_interps_log_file); + fprintf(log_file,'%.2f - Did per-epoch interpolation cleanup.\n',toc); + fprintf(log_file,['See ' filename(1:end-4) '_epoch_interpolations.txt for details.\n']); + end + + if ~isempty(o.channel_options.op_ref_chan) + EEG = h_pop_reref(EEG, o.channel_options.op_ref_chan, 'exclude',ext_chans, 'refstate', [], 'keepref', 'on'); + end + if (do_saves), EEG = pop_saveset(EEG,'savemode','resave'); end + + if using_ALLEEG + fprintf('Done with ALLEEG(%d) - %s.\nTook %d seconds.\n',o.file_options.current_file_num,EEG.setname,toc); + else + fprintf('Done with file %s.\nTook %d seconds.\n',[filepath filesep filename extension],toc); + end + + fprintf(log_file,'%.2f - Finished.\n',toc); + if (size(EEG.data,3>1)) + fprintf(log_file,'Final baseline variance: %.2f.\n',median(var(mean(EEG.data(:,1:round(EEG.srate*-1*EEG.xmin),:),3),[],2))); + % More stats here! + end + fclose(log_file); + + if (using_ALLEEG) + assignin('base','FASTER_TMP_EEG',EEG); + if o.file_options.overwrite_ALLEEG + evalin('base',sprintf('ALLEEG(%d)=FASTER_TMP_EEG; clear FASTER_TMP_EEG',o.file_options.current_file_num)); + else + evalin('base','[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, FASTER_TMP_EEG);clear FASTER_TMP_EEG;'); + end + end +catch + m=lasterror; + EEG_state{1}=evalc('disp(EEG)'); + try + if ~isempty(fopen(log_file)) + frewind(log_file); + EEG_state{2}=fscanf(log_file,'%c',inf); + + try fclose(log_file); catch; end; + end + catch + end + EEG_state{3}=option_wrapper; + EEG_state{4}=builtin('version'); + if exist('eeg_getversion','file') + EEG_state{5}=eeg_getversion; + else + EEG_state{5}=which('eeglab'); + end + + assignin('caller','EEG_state',EEG_state); + rethrow(m); +end +end diff --git a/code/eeglab13_4_4b/plugins/FASTER/GA_properties.m b/code/eeglab13_4_4b/plugins/FASTER/GA_properties.m new file mode 100644 index 0000000..28054e9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/GA_properties.m @@ -0,0 +1,59 @@ +function list_properties = GA_properties(EEG,eeg_chans,EOG_chans) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +list_properties = []; + +if length(size(EEG.data)) < 3 + fprintf('Not epoched.\n'); + return; +end + +measure = 1; + +means = mean(EEG.data(eeg_chans,:),2); + +% 1 Epoch's mean deviation from channel means. +for u = 1:size(EEG.data,3) + list_properties(u,measure) = mean(abs(squeeze(mean(EEG.data(eeg_chans,:,u),2)) - means)); +end +measure = measure + 1; + +% 2 Epoch variance +list_properties(:,measure) = mean(squeeze(var(EEG.data(eeg_chans,:,:),0,2))); +measure = measure + 1; + +% 3 Max amplitude difference +for t = eeg_chans + for u = 1:size(EEG.data,3) + ampdiffs(t,u) = max(EEG.data(t,:,u)) - min(EEG.data(t,:,u)); + end +end +list_properties(:,measure) = mean(ampdiffs,1); +measure = measure + 1; + +% 4 EOG channel max value +if ~isempty(EOG_chans) +list_properties(:,measure) = max(max(abs(EEG.data(EOG_chans,:,:)),[],2),[],1); +measure = measure + 1; +end + +for v = 1:size(list_properties,2) + list_properties(:,v) = list_properties(:,v) - median(list_properties(:,v)); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/blink_removal_only.m b/code/eeglab13_4_4b/plugins/FASTER/blink_removal_only.m new file mode 100644 index 0000000..bbd5132 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/blink_removal_only.m @@ -0,0 +1,38 @@ +function blink_removal_only(startDir,blink_chans) +[paths names]=extsearchc(startDir,'.bdf'); +prefix = 'EOG_removal_'; + +for u=1:length(paths) + try + EEG = pop_loadset('filename',['6_pre_comp_rej_' names{u}(1:end-4) '.set'],'filepath',[paths{u} filesep 'Intermediate']); + + for w=1:size(EEG.icaact,1) + for v=1:length(blink_chans) + x=zeros(1,length(blink_chans)); + if ~(max(EEG.data(blink_chans(v),:))==0 && min(EEG.data(blink_chans(v),:))==0); + f = corrcoef(EEG.icaact(w,:),EEG.data(blink_chans(v),:)); + x(v) = abs(f(1,2)); + else + x(v) = 0; + end + end + list_properties(w,1)=max(x); + end + + [lengths] = min_z(list_properties); + EEG = pop_subcomp(EEG, find(lengths >= 1), 0); + EEG = eeg_checkset(EEG); + + lengths_ep=cell(1,size(EEG.data,3)); + for v=1:size(EEG.data,3) + list_properties = single_epoch_channel_properties(EEG,v,64); + lengths_ep{v}=find(min_z(list_properties)); + end + + EEG=h_epoch_interp_spl(EEG,lengths_ep,65:72); + + pop_saveset(EEG,'filename',[prefix names{u}(1:end-4) '.set'],'filepath',[paths{u}]); + catch + fprintf('\nSkipped file %s%s%s.\n\n',paths{u},filesep,names{u}); + end +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/channel_properties.m b/code/eeglab13_4_4b/plugins/FASTER/channel_properties.m new file mode 100644 index 0000000..b0df193 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/channel_properties.m @@ -0,0 +1,100 @@ +function list_properties = channel_properties(EEG,eeg_chans,ref_chan) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%line 69 edited by RW Feb 2021 following bug report (thanks to Rick Wassing +%for spotting). +%ORIGINAL LINE: corrected = mcorrs(dist_inds) - fitcurve(idist_inds); +%CORRECTED LINE: corrected = mcorrs - fitcurve(idist_inds); + +if ~isstruct(EEG) + newdata=EEG; + clear EEG; + EEG.data=newdata; + clear newdata; +end + +measure = 1; + +if ~isempty(ref_chan) && length(ref_chan)==1 + pol_dist=distancematrix(EEG,eeg_chans); + [s_pol_dist dist_inds] = sort(pol_dist(ref_chan,eeg_chans)); + [s_inds idist_inds] = sort(dist_inds); +end + +% TEMPORAL PROPERTIES + +% 1 Mean correlation between each channel and all other channels + +% Ignore zeroed channels (ie reference channels) to avoid NaN problems +ignore = []; +datacorr = EEG.data; +for u = eeg_chans + if max(EEG.data(u,:))==0 && min(EEG.data(u,:))==0 + ignore=[ignore u]; + end +end + +% Calculate correlations +calc_indices=setdiff(eeg_chans,ignore); +ignore_indices=intersect(eeg_chans,ignore); +corrs = abs(corrcoef(EEG.data(setdiff(eeg_chans,ignore),:)')); +mcorrs=zeros(size(eeg_chans)); +for u=1:length(calc_indices) + mcorrs(calc_indices(u))=mean(corrs(u,:)); +end +mcorrs(ignore_indices)=mean(mcorrs(calc_indices)); + +% Quadratic correction for distance from reference electrode + +if (~isempty(ref_chan) && length(ref_chan)==1) + p = polyfit(s_pol_dist,mcorrs(dist_inds),2); + fitcurve = polyval(p,s_pol_dist); + corrected = mcorrs - fitcurve(idist_inds);%edited by RW Feb 2021 following bug report + list_properties(:,measure) = corrected; +else + list_properties(:,measure) = mcorrs(dist_inds); +end +measure = measure + 1; + +% 3 Variance of the channels +vars = var(EEG.data(eeg_chans,:)'); +vars(~isfinite(vars))=mean(vars(isfinite(vars))); +% Quadratic correction for distance from reference electrode + +if (~isempty(ref_chan) && length(ref_chan)==1) + p = polyfit(s_pol_dist,vars(dist_inds),2); + fitcurve = polyval(p,s_pol_dist); + corrected = vars - fitcurve(idist_inds); + + list_properties(:,measure) = corrected; +else + list_properties(:,measure) = vars; +end +measure = measure + 1; + +% 4 Hurst exponent +for u=1:length(eeg_chans) + list_properties(u,measure) = hurst_exponent(EEG.data(eeg_chans(u),:)); +end + +for u = 1:size(list_properties,2) + list_properties(isnan(list_properties(:,u)),u)=nanmean(list_properties(:,u)); + list_properties(:,u) = list_properties(:,u) - median(list_properties(:,u)); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/check_ref.m b/code/eeglab13_4_4b/plugins/FASTER/check_ref.m new file mode 100644 index 0000000..4b7eae4 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/check_ref.m @@ -0,0 +1,33 @@ +function EEG=check_ref(EEG,ref_chan,num_chans,num_exts) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +if all(round10(EEG.data(ref_chan,:),10)==0) + EEG=h_pop_reref(EEG,[],'keepref','on'); +end +mediffs=zeros(1,size(EEG.data,3));vars=mediffs; +for v=1:size(EEG.data,3) + mediffs(v)=median(diff(EEG.data(ref_chan,:,v),1,2),2); + vars(v)=var(EEG.data(ref_chan,:,v),[],2); +end +bad_subjs=union(find(min_z(mediffs)),find(min_z(vars))); +for v=1:length(bad_subjs) + tempEEG=h_eeg_interp_spl(pop_rejepoch(EEG,setdiff(1:size(EEG.data,3),bad_subjs(v)),0),ref_chan,'spherical',num_chans+1:num_chans+num_exts); + EEG.data(:,:,bad_subjs(v))=tempEEG.data; +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/component_properties.m b/code/eeglab13_4_4b/plugins/FASTER/component_properties.m new file mode 100644 index 0000000..da282d3 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/component_properties.m @@ -0,0 +1,99 @@ +function list_properties = component_properties(EEG,blink_chans,lpf_band) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +list_properties = []; +% +if isempty(EEG.icaweights) + fprintf('No ICA data.\n'); + return; +end + +if ~exist('lpf_band','var') || length(lpf_band)~=2 || ~any(lpf_band) + ignore_lpf=1; +else + ignore_lpf=0; +end + +delete_activations_after=0; +if ~isfield(EEG,'icaact') || isempty(EEG.icaact) + delete_activations_after=1; + EEG.icaact = eeg_getica(EEG); +end + +for u = 1:size(EEG.icaact,1) + [spectra(u,:) freqs] = pwelch(EEG.icaact(u,:),[],[],(EEG.srate),EEG.srate); +end + +list_properties = zeros(size(EEG.icaact,1),5); %This 5 corresponds to number of measurements made. + +for u=1:size(EEG.icaact,1) + measure = 1; + % TEMPORAL PROPERTIES + + % 1 Median gradient value, for high frequency stuff + list_properties(u,measure) = median(diff(EEG.icaact(u,:))); + measure = measure + 1; + + % 2 Mean slope around the LPF band (spectral) + if ignore_lpf + list_properties(u,measure) = 0; + else + list_properties(u,measure) = mean(diff(10*log10(spectra(u,find(freqs>=lpf_band(1),1):find(freqs<=lpf_band(2),1,'last'))))); + end + measure = measure + 1; + + % SPATIAL PROPERTIES + + % 3 Kurtosis of spatial map (if v peaky, i.e. one or two points high + % and everywhere else low, then it's probably noise on a single + % channel) + list_properties(u,measure) = kurt(EEG.icawinv(:,u)); + measure = measure + 1; + + % OTHER PROPERTIES + + % 4 Hurst exponent + list_properties(u,measure) = hurst_exponent(EEG.icaact(u,:)); + measure = measure + 1; + + % 10 Eyeblink correlations + if (exist('blink_chans','var') && ~isempty(blink_chans)) + for v = 1:length(blink_chans) + if ~(max(EEG.data(blink_chans(v),:))==0 && min(EEG.data(blink_chans(v),:))==0); + f = corrcoef(EEG.icaact(u,:),EEG.data(blink_chans(v),:)); + x(v) = abs(f(1,2)); + else + x(v) = v; + end + end + list_properties(u,measure) = max(x); + measure = measure + 1; + end +end + +for u = 1:size(list_properties,2) + list_properties(isnan(list_properties(:,u)),u)=nanmean(list_properties(:,u)); + list_properties(:,u) = list_properties(:,u) - median(list_properties(:,u)); +end + +if delete_activations_after + EEG.icaact=[]; +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/distancematrix.m b/code/eeglab13_4_4b/plugins/FASTER/distancematrix.m new file mode 100644 index 0000000..34efb14 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/distancematrix.m @@ -0,0 +1,70 @@ +function [distmatrixpol distmatrixxyz distmatrixproj] = distancematrix(EEG,eeg_chans) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +num_chans = size(EEG.data,1); +distmatrix = zeros(length(eeg_chans),length(eeg_chans)); +distmatrixpol = []; +for chan2tst = eeg_chans; + for q=eeg_chans + distmatrixpol(chan2tst,q)=sqrt(((EEG.chanlocs(chan2tst).radius^2)+(EEG.chanlocs(q).radius^2))-(2*((EEG.chanlocs(chan2tst).radius)*... + (EEG.chanlocs(q).radius)*cosd(EEG.chanlocs(chan2tst).theta - EEG.chanlocs(q).theta))));%calculates the distance between electrodes using polar format + end +end + +locs = EEG.chanlocs; +for u = eeg_chans + if ~isempty(locs(u).X) + Xs(u) = locs(u).X; + else + Xs(u) = 0; + end + if ~isempty(locs(u).Y) + Ys(u) = locs(u).Y; + else + Ys(u) = 0; + end + if ~isempty(locs(u).Z) + Zs(u) = locs(u).Z; + else + Zs(u) = 0; + end +end +Xs = round2(Xs,6); +Ys = round2(Ys,6); +Zs = round2(Zs,6); + +for u = eeg_chans + for v=eeg_chans + distmatrixxyz(u,v) = dist(Xs(u),Xs(v))+dist(Ys(u),Ys(v))+dist(Zs(u),Zs(v)); + end +end +D = max(max(distmatrixxyz)); +distmatrixproj = (pi-2*(acos(distmatrixxyz./D))).*(D./2); + function d = dist(in1,in2) + d = sqrt(abs(in1.^2 - in2.^2)); + end + + function num = round2(num,decimal) + num = num .* 10^decimal; + num = round(num); + num = num ./ 10^decimal; + end +end + diff --git a/code/eeglab13_4_4b/plugins/FASTER/eegplugin_FASTER.m b/code/eeglab13_4_4b/plugins/FASTER/eegplugin_FASTER.m new file mode 100644 index 0000000..e923f8d --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/eegplugin_FASTER.m @@ -0,0 +1,69 @@ +% eegplugin_FASTER() - EEGLAB plugin for using FASTER processing on EEG datasets +% +% Usage: +% >> eegplugin_FASTER(fig, trystrs, catchstrs); +% +% Inputs: +% fig - [integer] EEGLAB figure +% trystrs - [struct] "try" strings for menu callbacks. +% catchstrs - [struct] "catch" strings for menu callbacks. +% +% Author: Hugh Nolan, Robert Whelan, Richard Reilly, Trinity College Dublin, 2010 + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan, Richard Reilly, Trinity College Dublin, nolanhu@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function vers = eegplugin_grandaverage(fig, trystrs, catchstrs) + + vers = 'FASTER_1.0'; + if nargin < 3 + error('eegplugin_FASTER requires 3 arguments'); + end + + % add folder to path + % ----------------------- + if ~exist('FASTER_GUI') + p = which('FASTER_GUI'); + p = p(1:findstr(p,'FASTER_GUI.m')-1); + addpath(p); + end + + % find import data menu + % --------------------- + menu = findobj(fig, 'Label', 'Tools'); + + % menu callbacks + % -------------- + com_open_GUI = [trystrs.no_check 'EEG=FASTER_GUI(1);' catchstrs.add_to_hist]; + + % create menus if necessary + % ------------------------- + submenu = uimenu( menu, 'Label', 'Process with FASTER', 'CallBack', com_open_GUI, 'Separator', 'on', 'tag', 'FASTER', 'ForegroundColor',[1,0.1,0.2]); +% set(submenu,'enable','on'); +% c=get(menu,'Children'); +% i_faster=find(c==findobj(fig,'tag','FASTER')); +% i_study=find(c==findobj(fig,'Label','Load existing study')); +% c_faster=c(i_faster); +% if (i_faster > i_study) +% c(i_study+1:i_faster)=c(i_study:i_faster-1); +% c(i_study)=c_faster; +% else +% c(i_faster:i_study-1)=c(i_faster+1:i_study); +% c(i_study)=c_faster; +% end +% set(menu,'Children',c); \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/epoch_properties.m b/code/eeglab13_4_4b/plugins/FASTER/epoch_properties.m new file mode 100644 index 0000000..5b8e4bc --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/epoch_properties.m @@ -0,0 +1,34 @@ +function list_properties = epoch_properties(EEG,eeg_chans) +list_properties = []; + +if length(size(EEG.data)) < 3 + fprintf('Not epoched.\n'); + return; +end + +measure = 1; + +means = mean(EEG.data(eeg_chans,:),2); + +% 1 Epoch's mean deviation from channel means. +for u = 1:size(EEG.data,3) + list_properties(u,measure) = mean(abs(squeeze(mean(EEG.data(eeg_chans,:,u),2)) - means)); +end +measure = measure + 1; + +% 2 Epoch variance +list_properties(:,measure) = mean(squeeze(var(EEG.data(eeg_chans,:,:),0,2))); +measure = measure + 1; + +% 3 Max amplitude difference +for t = eeg_chans + for u = 1:size(EEG.data,3) + ampdiffs(t,u) = max(EEG.data(t,:,u)) - min(EEG.data(t,:,u)); + end +end +list_properties(:,measure) = mean(ampdiffs,1); +measure = measure + 1; + +for v = 1:size(list_properties,2) + list_properties(:,v) = list_properties(:,v) - median(list_properties(:,v)); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/extsearchc.m b/code/eeglab13_4_4b/plugins/FASTER/extsearchc.m new file mode 100644 index 0000000..0671d81 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/extsearchc.m @@ -0,0 +1,54 @@ +function [paths names] = extsearchc(startDir,extension,norecurse) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + if (exist('norecurse','var')~=1) + norecurse=0; + end + [paths names] = dirsearchc(startDir,extension,norecurse); + + function [paths names] = dirsearchc(currDir,searchstring,norecurse) + if nargin < 2 + fprintf('Usage: [paths names] = dirsearch(currDir, searchstring)\n'); + paths = ''; + names = ''; + return; + elseif (exist('norecurse','var')~=1) + norecurse=0; + end + paths = {}; + names = {}; + list_currDir = dir(currDir); + + for u = 1:length(list_currDir) + if (list_currDir(u).isdir==1 && strcmp(list_currDir(u).name,'.')~=1 && strcmp(list_currDir(u).name,'..')~=1 && norecurse==0) + [temppaths tempnames] = dirsearchc(sprintf('%s%s%s',currDir,filesep,list_currDir(u).name),searchstring); + paths = {paths{:} temppaths{:}}; + names = {names{:} tempnames{:}}; + elseif (length(list_currDir(u).name) > 4) + extension = list_currDir(u).name(end-3 : end); + if strcmp(extension, searchstring) == 1 + paths = {paths{:} currDir}; + names = {names{:} list_currDir(u).name}; + end + end + end + + end +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/find_relative_path.m b/code/eeglab13_4_4b/plugins/FASTER/find_relative_path.m new file mode 100644 index 0000000..1c40a00 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/find_relative_path.m @@ -0,0 +1,57 @@ + function [relpath pathstring] = find_relative_path(path_1,path_2) + % Outputs the relative path from path_2 to path_1 + % So that path_1 = [path_2 filesep relative_path] + + % If they are the same, there is no change. + if strcmp(path_1,path_2) + relpath=cell(0); + pathstring=path_1; + return; + end + + % The paths must be on the same drive/mount path + x=filesep; + if x=='\' + x='\\'; + end + + Current=textscan(path_1,'%s','Delimiter',x); + Current=Current{1}; + Path1=Current; + Current=textscan(path_2,'%s','Delimiter',x); + Current=Current{1}; + Path2=Current; + for u=1:length(Path2) + if u>length(Path1) || ~strcmp(Path1{u},Path2{u}) + break; + end + end + paths_diverge_at=u; + if paths_diverge_at==1 + error('Paths must contain at least one common directory.'); + end + relpath=cell(0); + for u=length(Path2):-1:paths_diverge_at + relpath{end+1}='..'; + end + for u=paths_diverge_at:length(Path1) + relpath{end+1}=Path1{u}; + end + + pathstring=''; + start_from=1; + tmpath=cd; + for u=1:length(relpath) + pathstring=[pathstring filesep relpath{u}]; + cd([path_2 filesep pathstring]); + if strcmp(cd,path_2) + start_from=u+1; + end + end + if start_from<=length(relpath) + relpath={relpath{start_from:end}}; + else + relpath=cell(0); + end + cd(tmpath); + end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/firfilt1.5.1.zip b/code/eeglab13_4_4b/plugins/FASTER/firfilt1.5.1.zip new file mode 100644 index 0000000..3ed41a6 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/FASTER/firfilt1.5.1.zip differ diff --git a/code/eeglab13_4_4b/plugins/FASTER/get_dir_structure.m b/code/eeglab13_4_4b/plugins/FASTER/get_dir_structure.m new file mode 100644 index 0000000..0db2437 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/get_dir_structure.m @@ -0,0 +1,13 @@ +function folders=get_dir_structure(current,base) +x=filesep; +if x=='\' + x='\\'; +end + +Current=textscan(current,'%s','Delimiter',x); +Current=Current{1}; +Base=textscan(base,'%s','Delimiter',x); +Base=Base{1}; +[x y]=setdiff(Current,Base); +[y1]=sort(y); +folders={Current{y1}}; \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/get_events.m b/code/eeglab13_4_4b/plugins/FASTER/get_events.m new file mode 100644 index 0000000..3bdc5bd --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/get_events.m @@ -0,0 +1,31 @@ +function alltypes=get_events(EEG) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +for u=1:length(EEG.event),numeric(u)=isnumeric(EEG.event(u).type);end; + if all(numeric) + for u=1:length(EEG.event),types(u)=EEG.event(u).type;end; + elseif ~any(numeric) + for u=1:length(EEG.event),types{u}=EEG.event(u).type;end; + else + error('Mixed event types (numeric and string) not allowed.\n'); + end + + alltypes=unique(types); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/gpl.txt b/code/eeglab13_4_4b/plugins/FASTER/gpl.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/gpl.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/code/eeglab13_4_4b/plugins/FASTER/h_eeg_interp_spl.m b/code/eeglab13_4_4b/plugins/FASTER/h_eeg_interp_spl.m new file mode 100644 index 0000000..511c3b4 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/h_eeg_interp_spl.m @@ -0,0 +1,157 @@ +% Small edits to the EEGLAB file +% Cleaned up and removed irrelevant sections. +% +% eeg_interp() - interpolate data channels +% +% Usage: EEGOUT = eeg_interp(EEG, badchans, method); +% +% Inputs: +% EEG - EEGLAB dataset +% badchans - [integer array] indices of channels to interpolate. +% For instance, these channels might be bad. +% [chanlocs structure] channel location structure containing +% either locations of channels to interpolate or a full +% channel structure (missing channels in the current +% dataset are interpolated). +% method - [string] method used for interpolation (default is 'spherical'). +% 'invdist' uses inverse distance on the scalp +% 'spherical' uses superfast spherical interpolation. +% 'spacetime' uses griddata3 to interpolate both in space +% and time (very slow and cannot be interupted). +% Output: +% EEGOUT - data set with bad electrode data replaced by +% interpolated data +% +% Author: Arnaud Delorme, CERCO, CNRS, Mai 2006- + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: eeg_interp.m,v $ +% Revision 1.7 2009/08/05 03:20:42 arno +% new interpolation function +% +% Revision 1.6 2009/07/30 03:32:47 arno +% fixed interpolating bad channels +% +% Revision 1.5 2009/07/02 19:30:33 arno +% fix problem with empty channel +% +% Revision 1.4 2009/07/02 18:23:33 arno +% fixing interpolation +% +% Revision 1.3 2009/04/21 21:48:53 arno +% make default spherical in eeg_interp +% +% Revision 1.2 2008/04/16 17:34:45 arno +% added spherical and 3-D interpolation +% +% Revision 1.1 2006/09/12 18:46:30 arno +% Initial revision +% + +function EEG = h_eeg_interp_spl(EEG, badchans, ignore_chans) + +if nargin < 2 + help eeg_interp; + return; +end; + +if ~exist('ignore_chans','var') + ignore_chans=[]; +end + +badchans = setdiff(badchans,ignore_chans); + +if isempty(badchans) + return; +end + +goodchans = setdiff(1:EEG.nbchan, badchans); +goodchans = setdiff(goodchans, ignore_chans); + +% find non-empty good channels +% ---------------------------- +nonemptychans = find(~cellfun('isempty', { EEG.chanlocs.theta })); +goodchans = intersect(goodchans, nonemptychans); +badchans = intersect(badchans, nonemptychans); +fprintf('Interpolating %d channels:', length(badchans));fprintf(' %d',badchans);fprintf('\n'); + +% scan data points +% ---------------- +% get theta, rad of electrodes +% ---------------------------- +xelec = [ EEG.chanlocs(goodchans).X ]; +yelec = [ EEG.chanlocs(goodchans).Y ]; +zelec = [ EEG.chanlocs(goodchans).Z ]; +rad = sqrt(xelec.^2+yelec.^2+zelec.^2); +xelec = xelec./rad; +yelec = yelec./rad; +zelec = zelec./rad; +xbad = [ EEG.chanlocs(badchans).X ]; +ybad = [ EEG.chanlocs(badchans).Y ]; +zbad = [ EEG.chanlocs(badchans).Z ]; +rad = sqrt(xbad.^2+ybad.^2+zbad.^2); +xbad = xbad./rad; +ybad = ybad./rad; +zbad = zbad./rad; + +EEG.data(badchans,:) = spheric_spline( xelec, yelec, zelec, xbad, ybad, zbad, EEG.data(goodchans,:)); +EEG = eeg_checkset(EEG); + +function allres = spheric_spline( xelec, yelec, zelec, xbad, ybad, zbad, values) + +newchans = length(xbad); +numpoints = size(values,2); + +Gelec = computeg(xelec,yelec,zelec,xelec,yelec,zelec); +Gsph = computeg(xbad,ybad,zbad,xelec,yelec,zelec); + +% compute solution for parameters C +% --------------------------------- +meanvalues = mean(values); +values = values - repmat(meanvalues, [size(values,1) 1]); % make mean zero + +values = [values;zeros(1,numpoints)]; +C = pinv([Gelec;ones(1,length(Gelec))]) * values; +clear values; +allres = zeros(newchans, numpoints); + +% apply results +% ------------- +for j = 1:size(Gsph,1) + allres(j,:) = sum(C .* repmat(Gsph(j,:)', [1 size(C,2)])); +end +allres = allres + repmat(meanvalues, [size(allres,1) 1]); + +% compute G function +% ------------------ +function g = computeg(x,y,z,xelec,yelec,zelec) + +unitmat = ones(length(x(:)),length(xelec)); +EI = unitmat - sqrt((repmat(x(:),1,length(xelec)) - repmat(xelec,length(x(:)),1)).^2 +... + (repmat(y(:),1,length(xelec)) - repmat(yelec,length(x(:)),1)).^2 +... + (repmat(z(:),1,length(xelec)) - repmat(zelec,length(x(:)),1)).^2); + +g = zeros(length(x(:)),length(xelec)); +%dsafds +m = 4; % 3 is linear, 4 is best according to Perrin's curve +for n = 1:7 + L = legendre(n,EI); + g = g + ((2*n+1)/(n^m*(n+1)^m))*squeeze(L(1,:,:)); +end +g = g/(4*pi); + diff --git a/code/eeglab13_4_4b/plugins/FASTER/h_epoch.m b/code/eeglab13_4_4b/plugins/FASTER/h_epoch.m new file mode 100644 index 0000000..dbd06cf --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/h_epoch.m @@ -0,0 +1,23 @@ +function [EEG did_epoch] = h_epoch(EEG,markers,epoch_length) +tempevents={EEG.event(:).type}; +if isnumeric(tempevents{1}); + tempevents2=textscan(sprintf('%d ',tempevents{:}),'%s '); + tempevents2=tempevents2{1}'; + events = unique(tempevents2); +else + events = unique(tempevents); +end +if ~iscell(markers) + epoch_markers=textscan(num2str(markers),'%s '); + epoch_markers=epoch_markers{1}'; +else + epoch_markers=markers; +end +[cell_markers ia]=intersect(events,epoch_markers); +if ~isempty(ia) + EEG=pop_epoch(EEG,cell_markers,epoch_length); + did_epoch=1; +else + warning('No epochs that were specified are present in the file. Data was not epoched.') + did_epoch=0; +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/h_epoch_interp_spl.m b/code/eeglab13_4_4b/plugins/FASTER/h_epoch_interp_spl.m new file mode 100644 index 0000000..e2d79a7 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/h_epoch_interp_spl.m @@ -0,0 +1,168 @@ +% Edit to the EEGLAB interpolation function to interpolate different +% channels within each epoch +% Cleaned up and removed irrelevant sections. +% +% Additions Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% +% Based on: +% +% eeg_interp() - interpolate data channels +% +% Usage: EEGOUT = eeg_interp(EEG, badchans, method); +% +% Inputs: +% EEG - EEGLAB dataset +% badchans - [integer array] indices of channels to interpolate. +% For instance, these channels might be bad. +% [chanlocs structure] channel location structure containing +% either locations of channels to interpolate or a full +% channel structure (missing channels in the current +% dataset are interpolated). +% method - [string] method used for interpolation (default is 'spherical'). +% 'invdist' uses inverse distance on the scalp +% 'spherical' uses superfast spherical interpolation. +% 'spacetime' uses griddata3 to interpolate both in space +% and time (very slow and cannot be interupted). +% Output: +% EEGOUT - data set with bad electrode data replaced by +% interpolated data +% +% Author: Arnaud Delorme, CERCO, CNRS, Mai 2006- + +% Copyright (C) Arnaud Delorme, CERCO, 2006, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: eeg_interp.m,v $ +% Revision 1.7 2009/08/05 03:20:42 arno +% new interpolation function +% +% Revision 1.6 2009/07/30 03:32:47 arno +% fixed interpolating bad channels +% +% Revision 1.5 2009/07/02 19:30:33 arno +% fix problem with empty channel +% +% Revision 1.4 2009/07/02 18:23:33 arno +% fixing interpolation +% +% Revision 1.3 2009/04/21 21:48:53 arno +% make default spherical in eeg_interp +% +% Revision 1.2 2008/04/16 17:34:45 arno +% added spherical and 3-D interpolation +% +% Revision 1.1 2006/09/12 18:46:30 arno +% Initial revision +% + +function EEG = h_epoch_interp_spl(EEG, bad_elec_epochs, ignore_chans) +warning off; +if nargin < 2 + help eeg_interp; + return; +end; + +if isempty(bad_elec_epochs) || ~iscell(bad_elec_epochs) + fprintf('Incorrect input format.\n'); + return; +end + +if ~exist('ignore_chans','var') + ignore_chans=[]; +end + +for v=1:length(bad_elec_epochs) + if ~isempty(bad_elec_epochs{v}) + badchans = bad_elec_epochs{v}; + goodchans = setdiff(1:size(EEG.data,1), badchans); + goodchans = setdiff(goodchans, ignore_chans); + + % find non-empty good channels + % ---------------------------- + nonemptychans = find(~cellfun('isempty', { EEG.chanlocs.theta })); + goodchans = intersect(goodchans,nonemptychans); + badchans = intersect(badchans, nonemptychans); + + % scan data points + % ---------------- + % get theta, rad of electrodes + % ---------------------------- + xelec = [ EEG.chanlocs(goodchans).X ]; + yelec = [ EEG.chanlocs(goodchans).Y ]; + zelec = [ EEG.chanlocs(goodchans).Z ]; + rad = sqrt(xelec.^2+yelec.^2+zelec.^2); + xelec = xelec./rad; + yelec = yelec./rad; + zelec = zelec./rad; + xbad = [ EEG.chanlocs(badchans).X ]; + ybad = [ EEG.chanlocs(badchans).Y ]; + zbad = [ EEG.chanlocs(badchans).Z ]; + rad = sqrt(xbad.^2+ybad.^2+zbad.^2); + xbad = xbad./rad; + ybad = ybad./rad; + zbad = zbad./rad; + + EEG.data(badchans,:,v) = spheric_spline( xelec, yelec, zelec, xbad, ybad, zbad, EEG.data(goodchans,:,v)); + end +end +EEG = eeg_checkset(EEG); + +warning on; + +function allres = spheric_spline( xelec, yelec, zelec, xbad, ybad, zbad, values) + +newchans = length(xbad); +numpoints = size(values,2); + +Gelec = computeg(xelec,yelec,zelec,xelec,yelec,zelec); +Gsph = computeg(xbad,ybad,zbad,xelec,yelec,zelec); + +% compute solution for parameters C +% --------------------------------- +meanvalues = mean(values); +values = values - repmat(meanvalues, [size(values,1) 1]); % make mean zero + +values = [values;zeros(1,numpoints)]; +C = pinv([Gelec;ones(1,length(Gelec))]) * values; +clear values; +allres = zeros(newchans, numpoints); + +% apply results +% ------------- +for j = 1:size(Gsph,1) + allres(j,:) = sum(C .* repmat(Gsph(j,:)', [1 size(C,2)])); +end +allres = allres + repmat(meanvalues, [size(allres,1) 1]); + +% compute G function +% ------------------ +function g = computeg(x,y,z,xelec,yelec,zelec) + +unitmat = ones(length(x(:)),length(xelec)); +EI = unitmat - sqrt((repmat(x(:),1,length(xelec)) - repmat(xelec,length(x(:)),1)).^2 +... + (repmat(y(:),1,length(xelec)) - repmat(yelec,length(x(:)),1)).^2 +... + (repmat(z(:),1,length(xelec)) - repmat(zelec,length(x(:)),1)).^2); + +g = zeros(length(x(:)),length(xelec)); +%dsafds +m = 4; % 3 is linear, 4 is best according to Perrin's curve +for n = 1:7 + L = legendre(n,EI); + g = g + ((2*n+1)/(n^m*(n+1)^m))*squeeze(L(1,:,:)); +end +g = g/(4*pi); + diff --git a/code/eeglab13_4_4b/plugins/FASTER/h_pop_reref.m b/code/eeglab13_4_4b/plugins/FASTER/h_pop_reref.m new file mode 100644 index 0000000..50b69f6 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/h_pop_reref.m @@ -0,0 +1,385 @@ +% Small edits to the EEGLAB file +% +% pop_reref() - Convert an EEG dataset to average reference or to a +% new common reference channel (or channels). Calls reref(). +% Usage: +% >> EEGOUT = pop_reref( EEG ); % pop up interactive window +% >> EEGOUT = pop_reref( EEG, ref, 'key', 'val' ...); +% +% Graphic interface: +% "Compute average reference" - [edit box] Checking this box (for 'yes') is +% the same as giving an empty value for the commandline 'ref' +% argument. Unchecked, the data are transformed to common reference. +% "Re-reference data to channel(s)" - [checkbox] Checking this option +% automatically unchecks the checkbox above, allowing reference +% channel indices to be entered in the text edit box to its right +% (No commandline equivalent). +% "Retain old reference channels in data" - [checkbox] When re-referencing the +% data, checking this checkbox includes the data for the +% previous reference channel. +% "Exclude channel indices (EMG, EOG)" - [edit box] exclude the given +% channel indices from rereferencing. +% "Add current reference channel back to the data" - [edit box] When +% re-referencing the data, checking this checkbox +% reconstitutes the data for the previous reference +% channel. If the location for this channel was not +% defined, it can be specified using the text box below. +% Inputs: +% EEG - input dataset +% ref - reference: [] = convert to average reference +% [int vector] = new reference electrode number(s) +% Optional inputs: +% 'exclude' - [integer array] List of channels to exclude. +% 'keepref' - ['on'|'off'] keep the reference channel. +% 'refloc' - [structure] Previous reference channel structure. +% +% Outputs: +% EEGOUT - re-referenced output dataset +% +% Notes: +% For other options, call reref() directly. See >> help reref +% +% Author: Arnaud Delorme, CNL / Salk Institute, 12 Nov 2002 +% +% See also: reref(), eeglab() + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: pop_reref.m,v $ +% Revision 1.35 2009/06/28 06:33:38 arno +% Fixing rereferencing futher +% +% Revision 1.34 2009/06/28 05:49:56 arno +% Adding reference and reprogramming pop_chanedit +% +% Revision 1.33 2008/04/16 17:52:46 arno +% Additional entry to exclude reference from rereferencing +% +% Revision 1.32 2007/02/16 18:59:24 scott +% clarified help msg -sm +% +% Revision 1.31 2006/05/04 10:07:07 arno +% same +% +% Revision 1.29 2005/01/24 19:30:37 arno +% remove field for Keun re-refencing +% ,. +% +% Revision 1.28 2004/05/14 23:58:23 arno +% operator precedence +% +% Revision 1.27 2004/01/30 23:01:52 arno +% update channel position only if refloc is set +% +% Revision 1.26 2003/11/05 16:24:17 arno +% homogenous -> homogeneous +% +% Revision 1.25 2003/10/14 17:03:08 arno +% vararg2str for optional arguments +% +% Revision 1.24 2003/09/08 22:54:12 arno +% typo for refstate +% +% Revision 1.23 2003/07/31 17:10:05 arno +% conversion to 3-D for the last channel +% +% Revision 1.22 2003/07/31 17:03:31 arno +% empty last channel +% +% Revision 1.21 2003/07/30 18:03:59 arno +% allowing empty channel location +% +% Revision 1.20 2003/07/28 17:53:39 arno +% channel ref index +% +% Revision 1.19 2003/07/28 16:46:49 arno +% remove redundancy +% +% Revision 1.18 2003/07/28 16:42:03 arno +% text with scott +% +% Revision 1.17 2003/07/27 01:19:21 arno +% debuging GUI call +% +% Revision 1.16 2003/07/27 01:09:30 arno +% debuging +% +% Revision 1.15 2003/07/27 00:44:32 arno +% brand new function for rereferencing +% +% Revision 1.14 2003/07/25 23:49:54 arno +% change interface, warning messages ... +% +% Revision 1.13 2003/07/25 00:11:56 arno +% allowing multiple references +% +% Revision 1.12 2003/07/25 00:10:51 arno +% correct typo +% +% Revision 1.11 2003/07/02 01:06:00 arno +% remove debug msg +% +% Revision 1.10 2003/07/02 01:05:34 arno +% debug msg +% +% Revision 1.9 2003/06/11 00:06:16 arno +% header message +% +% Revision 1.8 2003/02/17 02:53:22 arno +% reformating text for new functionality in help2html +% +% Revision 1.7 2003/02/16 23:30:20 arno +% adding GUI info +% +% Revision 1.6 2002/11/13 23:13:51 arno +% gui mutual exclusion problem +% +% Revision 1.5 2002/11/13 23:04:40 arno +% removing extra electrode in average ref +% +% Revision 1.4 2002/11/13 20:29:44 arno +% debugging +% +% Revision 1.3 2002/11/13 19:22:23 arno +% averef field -> ref field +% +% Revision 1.2 2002/11/12 23:23:37 arno +% mode -> method keyword +% +% Revision 1.1 2002/11/12 19:08:34 arno +% Initial revision +% +% Revision 1.1 2002/04/05 17:32:13 arno +% Initial revision +% + +function [EEG, com] = h_pop_reref( EEG, ref, varargin); + +com = ''; +if nargin < 1 + help h_pop_reref; + return; +end; +if isempty(EEG.data) + error('Pop_reref: cannot process empty data'); +end; + +% gui inputs +% ---------- +if nargin < 2 + + % find initial reference + % ---------------------- + if length(EEG.chanlocs) == EEG.nbchan+1 + includeref = 1; + end; + + geometry = { [1] [1] [1.8 1 0.3] [1] [1] [1.8 1 0.3] [1.8 1 0.3] }; + cb_setref = [ 'set(findobj(''parent'', gcbf, ''tag'', ''refbr'') , ''enable'', ''on'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''reref'') , ''enable'', ''on'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''keepref'') , ''enable'', ''on'');' ]; + cb_setave = [ 'set(findobj(''parent'', gcbf, ''tag'', ''refbr'') , ''enable'', ''off'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''reref'') , ''enable'', ''off'');' ... + 'set(findobj(''parent'', gcbf, ''tag'', ''keepref'') , ''enable'', ''off'', ''value'', 0);' ]; + cb_averef = [ 'set(findobj(''parent'', gcbf, ''tag'', ''rerefstr'') , ''value'', ~get(gcbo, ''value''));' ... + 'if get(gcbo, ''value''),' cb_setave ... + 'else,' cb_setref ... + 'end;' ]; + cb_ref = [ 'set(findobj(''parent'', gcbf, ''tag'', ''ave'') , ''value'', ~get(gcbo, ''value''));' ... + 'if get(gcbo, ''value''),' cb_setref ... + 'else,' cb_setave ... + 'end;' ]; + cb_chansel1 = '[tmp tmpval] = pop_chansel({EEG(1).chanlocs.labels}, ''withindex'', ''on''); set(findobj(gcbf, ''tag'', ''reref'' ), ''string'',tmpval); clear tmp tmpval'; + cb_chansel2 = '[tmp tmpval] = pop_chansel({EEG(1).chanlocs.labels}, ''withindex'', ''on''); set(findobj(gcbf, ''tag'', ''exclude'' ), ''string'',tmpval); clear tmp tmpval'; + cb_chansel3 = [ 'if ~isfield(EEG(1).chaninfo, ''nodatchans''), ' ... + ' warndlg2(''There are no Reference channel defined, add it using the channel location editor'');' ... + 'elseif isempty(EEG(1).chaninfo.nodatchans),' ... + ' warndlg2(''There are no Reference channel defined, add it using the channel location editor'');' ... + 'else,' ... + ' [tmp tmpval] = pop_chansel({EEG(1).chaninfo.nodatchans.labels}, ''withindex'', ''on''); set(findobj(gcbf, ''tag'', ''refloc'' ), ''string'',tmpval); clear tmp tmpval;' ... + 'end;' ]; + if isempty(EEG.chanlocs), cb_chansel1 = ''; cb_chansel2 = ''; cb_chansel3 = ''; end; + + % find current reference (= reference most used) + % ---------------------------------------------- + if isfield(EEG(1).chanlocs, 'ref') + [curref tmp allinds] = unique( { EEG(1).chanlocs.ref }); + maxind = 1; + for ind = unique(allinds) + if length(find(allinds == ind)) > length(find(allinds == maxind)) + maxind = ind; + end; + end; + curref = curref{maxind}; + if isempty(curref), curref = 'unknown'; end; + else curref = 'unknown'; + end; + + uilist = { { 'style' 'text' 'string' [ 'Current data reference state is: ' curref] } ... + ... + { 'style' 'checkbox' 'tag' 'ave' 'value' 1 'string' 'Compute average reference' 'callback' cb_averef } ... + ... + { 'style' 'checkbox' 'tag' 'rerefstr' 'value' 0 'string' 'Re-reference data to channel(s):' 'callback' cb_ref } ... + { 'style' 'edit' 'tag' 'reref' 'string' '' 'enable' 'off' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cb_chansel1 'enable' 'off' 'tag' 'refbr' } ... + ... + {} ... + ... + { 'style' 'checkbox' 'value' 0 'enable' 'off' 'tag' 'keepref' 'string' 'Retain old reference channels in data' } ... + ... + { 'style' 'text' 'string' 'Exclude channel indices (EMG, EOG)' } ... + { 'style' 'edit' 'tag' 'exclude' 'string' '' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cb_chansel2 } ... + ... + { 'style' 'text' 'tag' 'reflocstr' 'string' 'Add current reference channel back to the data' } ... + { 'style' 'edit' 'tag' 'refloc' 'string' '' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' cb_chansel3 } }; + + [result tmp tmp2 restag] = inputgui(geometry, uilist, 'pophelp(''h_pop_reref'')', 'h_pop_reref - average reference or re-reference data'); + if isempty(result), return; end; + + % decode inputs + % ------------- + options = {}; + if ~isempty(restag.refloc), + try + tmpallchans = lower({ EEG.chaninfo.nodatchans.labels }); + chanind = strmatch( lower(restag.refloc), tmpallchans, 'exact'); + options = { options{:} 'refloc' EEG.chaninfo.nodatchans(chanind) }; + catch, disp('Error with old reference: ignoring it'); + end; + end; + if ~isempty(restag.exclude), options = { options{:} 'exclude' eeg_chaninds(EEG, restag.exclude) }; end; + if restag.keepref, options = { options{:} 'keepref' 'on' }; end; + if restag.ave, ref = []; end; + if restag.rerefstr + if isempty(restag.reref) + warndlg2('Abording: you must enter one or more reference channels'); + return; + else + ref = eeg_chaninds(EEG, restag.reref); + end; + end; +else + options = varargin; +end; +optionscall = options; + +% include channel location file +% ----------------------------- +if ~isempty(EEG.chanlocs) + optionscall = { optionscall{:} 'elocs' EEG.chanlocs }; +end; + +nchans = EEG.nbchan; +fprintf('Re-referencing data\n'); +oldchanlocs = EEG.chanlocs; +[EEG.data EEG.chanlocs refchan ] = h_reref(EEG.data, ref, optionscall{:}); +g = struct(optionscall{:}); +if ~isfield(g, 'exclude'), g.exclude = []; end; +if ~isfield(g, 'keepref'), g.keepref = 'off'; end; +if ~isfield(g, 'refloc') , g.refloc = []; end; + +% deal with reference +% ------------------- +if ~isempty(refchan) + if ~isfield(EEG.chaninfo, 'nodatchans') + EEG.chaninfo.nodatchans = refchan; + elseif isempty(EEG.chaninfo.nodatchans) + EEG.chaninfo.nodatchans = refchan; + else + allf = fieldnames(refchan); + n = length(EEG.chaninfo.nodatchans); + for ind = 1:length(allf) + EEG.chaninfo.nodatchans = setfield(EEG.chaninfo.nodatchans, { n }, ... + allf{ind}, getfield(refchan, allf{ind})); + end; + end; +end; +if ~isempty(g.refloc) + tmpind = strmatch( g.refloc.labels, { EEG.chaninfo.nodatchans.labels }); + EEG.chaninfo.nodatchans(tmpind) = []; +end; + +EEG.nbchan = size(EEG.data,1); +EEG = eeg_checkset(EEG); + +% include ICA or not +% ------------------ +if ~isempty(EEG.icaweights) + + if ~isempty(intersect(EEG.icachansind, g.exclude)) + disp('Warning: some channels used for ICA were excluded from referencing'); + disp(' the ICA decomposition has been removed'); + EEG.icaweights = []; + EEG.icasphere = []; + elseif length(EEG.icachansind) ~= nchans - length(g.exclude) + disp('Error: some channels not used for ICA decomposition are used for rereferencing'); + disp(' the ICA decomposition has been removed'); + EEG.icaweights = []; + EEG.icasphere = []; + else + fprintf('Re-referencing ICA matrix\n'); + EEG.icawinv = h_reref(EEG.icawinv, ref, optionscall{:}); + + % get output channel indices + % -------------------------- + chansout = 1:nchans; + if ~isempty(ref) & strcmpi(g.keepref,'off') + ref = sort(ref); + for ind = length(ref):-1:1 + chansout(ref(ind)+1:end) = chansout(ref(ind)+1:end)-1; + chansout(ref(ind)) = []; + end; + end; + + % convert channel indices in icachanlocs + % -------------------------------------- + icachansind = EEG.icachansind; + for i=length(icachansind):-1:1 + indchan = find( icachansind(i) == chansout ); + if ~isempty( indchan ) + icachansind(i) = indchan; + else + icachansind(i) = []; + end; + end; + + % add new channel if necessary + if ~isempty(g.refloc) + icachansind = [ icachansind size(EEG.data,1) ]; + end; + + EEG.icachansind = icachansind; + if length(EEG.icachansind) ~= size(EEG.icawinv,1) + warning('Wrong channel indices, removing ICA decomposition'); + dsafdsf + EEG.icaweights = []; + EEG.icasphere = []; + else + EEG.icaweights = pinv(EEG.icawinv); + EEG.icasphere = eye(length(icachansind)); + end; + end; + EEG = eeg_checkset(EEG); +end; + +% generate the output command +% --------------------------- +com = sprintf('%s = pop_reref( %s, %s);', inputname(1), inputname(1), vararg2str({ref, options{:}})); diff --git a/code/eeglab13_4_4b/plugins/FASTER/h_reref.m b/code/eeglab13_4_4b/plugins/FASTER/h_reref.m new file mode 100644 index 0000000..2463379 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/h_reref.m @@ -0,0 +1,354 @@ +% Small edits to the EEGLAB file +% +% reref() - convert common reference EEG data to some other common reference +% or to average reference +% Usage: +% >> Dataout = reref(data); % convert all channels to average reference +% >> [Dataout Chanlocs] = reref(data, refchan, 'key', 'val'); +% % convert data to new reference with options +% Inputs: +% data - 2-D or 3-D data matrix (chans,frames*epochs) +% refchan - reference channel number(s). There are three possibilities: +% 1) [] - compute average reference +% 2) [X]: re-reference to channel X +% 2) [X Y Z ...]: re-reference to the average of channel X Y Z ... +% +% Optional inputs: +% 'exclude' - [integer array] channel indices to exclude from re-referencing +% (e.g., event marker channels, etc.) +% 'keepref' - ['on'|'off'] keep reference channel in output (only usable +% when there are several references). +% 'elocs' - Current data electrode location structure (e.g., EEG.chanlocs). +% 'refloc' - Reference channel location single element structure or cell array +% {'label' theta radius} containing the name and polar coordinates +% of the current channel. Including this entry means that +% this channel will be included (reconstructed) in the +% output. +% +% Outputs: +% Dataout - Input data converted to the new reference +% Chanlocs - Updated channel locations structure +% +% Notes: 1) The average reference calculation implements two methods +% (see www.egi.com/Technotes/AverageReference.pdf) +% V'i = (Vi-Vref) - sum(Vi-Vref)/number_of_electrodes +% +% Authors: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 2009- +% previous version: Arnaud Delorme & Scott Makeig, 1999-2002 + +% Deprecated inputs: +% These inputs are still accepted but not processed. The function returns +% accurate results irrespective of the entry of these options. +% 'refstate ' - ['common'|'averef'|[indices]] Current reference condition, +% ('averef') = average reference; ('common' or 0) = common +% reference. [indices] designate the current reference channel +% or channels if present in the data {default: 'common'} +% 'method' - ['standard'|'withref'] Do not ('standard') or do ('withref') +% include reference channel data in output {def: 'standard'}. +% Note: Option 'withref' not possible when multiple ref channel +% indices are given as argument to 'refstate' (below). +% +% ICA inputs: +% These inputs are still accepted but not the ICA conversion is now +% performed from within pop_reref() +% 'icaweights' - ICA weight matrix. Note: If this is ICA weights*sphere, +% then the 'icasphere' input below should be [] or identity. +% 'icasphere' - ICA sphere matrix (if any) +% 'icachansind' - Indices of the channels used in ICA decomposition +% +% Outputs: +% Wout - ICA weight matrix (former icaweights*icasphere) +% converted to new data reference +% Sout - ICA sphere matrix converted to an identity matrix +% ICAinds - New indices of channels used in ICA decomposition +% meandata - (1,dataframes) means removed from each data point +% +% 2) In conversion of the weight matrix to a new reference +% where WS = Wts*Sph and ica_act = WS*data, then +% data = inv(WS)*ica_act; +% If R*data are the re-referenced data, +% R*data= R*inv(WS)*ica_act; +% And Wout = inv(R*inv(WS)); +% Now, Sout = eye(length(ICAinds)); +% The re-referenced ICA component maps are now the +% columns of inv(Wout), and the icasphere matrix, Sout, +% is an identity matrix. Note: inv() -> pinv() when +% PCA dimension reduction is used during ICA decomposition. + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 1999 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: reref.m,v $ +% Revision 1.38 2009/06/28 06:33:38 arno +% Fixing rereferencing futher +% +% Revision 1.37 2009/06/28 05:49:56 arno +% Adding reference and reprogramming pop_chanedit +% +% Revision 1.36 2007/05/22 13:57:36 arno +% double reference +% +% Revision 1.35 2007/02/16 20:12:16 scott +% added electrode(s) for completeness -sm +% +% Revision 1.34 2007/02/16 19:55:30 toby +% error message formatting +% +% Revision 1.33 2007/02/16 17:22:06 scott +% clarified help msg -- with major ??? remaining ! -sm +% +% Revision 1.32 2006/10/02 11:36:56 arno +% fix excluding channels +% +% Revision 1.30 2006/05/04 10:33:54 arno +% fixing last changes when not all channels are used for ICA +% +% Revision 1.28 2004/11/05 18:29:16 arno +% fixing channel label problem +% +% Revision 1.27 2003/12/11 17:55:22 arno +% remove debug msg +% +% Revision 1.26 2003/10/14 17:13:36 arno +% *** empty log message *** +% +% Revision 1.25 2003/10/14 17:12:07 arno +% *** empty log message *** +% +% Revision 1.24 2003/10/14 17:11:25 arno +% *** empty log message *** +% +% Revision 1.23 2003/07/29 18:39:59 arno +% debuging empty channel location structure +% +% Revision 1.22 2003/07/29 16:58:18 arno +% debuging exclude +% +% Revision 1.21 2003/07/28 16:44:26 arno +% allowing to include current ref channel +% +% Revision 1.20 2003/07/27 00:59:49 arno +% debuging re-referencing +% +% Revision 1.19 2003/07/26 01:13:56 arno +% debuging reref to several channels +% +% Revision 1.18 2003/07/26 00:01:32 arno +% brand new function +% +% Revision 1.17 2003/07/02 01:07:41 arno +% debug input check +% +% Revision 1.16 2003/06/11 00:10:27 arno +% debug multiple references +% +% Revision 1.15 2002/11/15 03:00:17 arno +% same +% +% Revision 1.14 2002/11/15 02:59:34 arno +% header for web +% +% Revision 1.13 2002/11/15 01:44:44 scott +% can not -> cannot +% +% Revision 1.12 2002/11/15 01:41:04 arno +% header for web +% +% Revision 1.11 2002/11/14 18:14:02 arno +% updating elocs parameter filter +% +% Revision 1.10 2002/11/13 23:04:41 arno +% removing extra electrode in average ref +% +% Revision 1.9 2002/11/13 22:28:57 arno +% removing the average reference with original common reference +% +% Revision 1.8 2002/11/13 20:29:41 arno +% debugging +% +% Revision 1.7 2002/11/13 15:12:21 scott +% help msg +% +% Revision 1.6 2002/11/13 15:08:40 scott +% help msg +% +% Revision 1.5 2002/11/12 23:32:59 arno +% debugging old ref channel potential +% +% Revision 1.4 2002/11/12 23:22:47 arno +% header typo +% +% Revision 1.3 2002/11/12 19:08:02 arno +% debugging +% +% Revision 1.2 2002/11/12 18:43:31 arno +% debug +% +% Revision 1.1 2002/11/12 17:58:08 arno +% Initial revision +% +% Revision 1.7 2002/09/05 00:30:23 scott +% added meandata output -sm +% +% Revision 1.6 2002/08/21 02:08:19 arno +% nothing +% +% Revision 1.5 2002/08/21 02:03:32 arno +% debugging ica reref +% +% Revision 1.4 2002/08/21 00:21:51 arno +% debugging +% +% Revision 1.3 2002/04/11 18:37:33 scott +% revised help msg +% +% Revision 1.2 2002/04/11 18:02:03 arno +% computing average reference of components +% +% Revision 1.1 2002/04/05 17:36:45 jorn +% Initial revision +% + +% 12/16/99 Corrected denomiator on the suggestion of Ian Nimmo-Smith, Cambridge UK +% 01-25-02 reformated help & license -ad + +function [data, Elocs, morechans, W, S, icachansind, meandata] = h_reref(data, ref, varargin) + +if nargin<1 + help reref + return +end +if nargin < 2 + ref = []; +end; + +% check inputs +% ------------ +g = finputcheck(varargin, { 'icaweight' 'real' [] []; + 'icaweights' 'real' [] []; + 'icasphere' 'real' [] []; + 'icachansind' 'integer' [] []; + 'method' 'string' { 'standard' 'withref' } 'standard'; + 'refstate' { 'string' 'integer' } { { 'common' 'averef' } [1 size(data,1)] } 'common'; % ot used but kept for backward compatib. + 'exclude' 'integer' [1 size(data,1)] []; + 'refloc' { 'cell' 'struct' } { [] [] } {}; + 'keepref' 'string' {'on' 'off' } 'off'; + 'elocs' {'integer' 'struct'} [] [] }); +if isstr(g), error(g); end; +if ~isempty(g.icaweight) + g.icaweights = g.icaweight; +end; +if ~isempty(g.icaweights) + if isempty(g.icachansind), + g.icachansind = [1:size(g.icaweights,2)]; + disp('Warning: reref() output has changed slightly since EEGLAB 5.02'); + disp(' the 4th output argument is the indices of channels used for ICA instead'); + disp(' of the mean reference value (which is now output argument 5)'); + end; +end; + +if ~isempty(ref) + if ref > size(data,1) + error('reference channel index out of range'); + end; +end; + +[dim1 dim2 dim3] = size(data); +data = reshape(data, dim1, dim2*dim3); + +% single reference not present in the data +% add it as blank data channel at the end +% ---------------------------------------- +if ~isempty(g.refloc) == 1 + data(end+1,:) = 0; + if ~isempty(g.elocs) + if iscell(g.refloc) + g.elocs(end+1).labels = g.refloc{1}; + g.elocs(end ).theta = g.refloc{2}; + g.elocs(end ).radius = g.refloc{3}; + else + g.elocs(end+1).labels = g.refloc.labels; + fieldloc = fieldnames(g.refloc); + for ind = 1:length(fieldloc) + g.elocs(end) = setfield(g.elocs(end), fieldloc{ind}, getfield(g.refloc, fieldloc{ind})); + end; + end; + end; + [dim1 dim2 dim3] = size(data); +end; + +% exclude some channels +% --------------------- +chansin = setdiff([1:dim1], g.exclude); +nchansin = length(chansin); + +% return mean data +% ---------------- +if nargout > 4 + meandata = sum(data(chansin,2))/nchansin; +end; + +% generate rereferencing matrix +% ----------------------------- +if ~isempty(ref) % not average reference + refmatrix = eye(nchansin); % begin with identity matrix + for index = 1:length(ref) + refmatrix(:,ref(index)) = refmatrix(:,ref(index))-1/length(ref); + end; +else % compute average reference + refmatrix = eye(nchansin)-ones(nchansin)*1/nchansin; +end; +chansout = chansin; +data(chansout,:) = refmatrix*data(chansin,:); + +% change reference in elocs structure +% ----------------------------------- +if ~isempty(g.elocs) + if isempty(ref) + for ind = chansin + g.elocs(ind).ref = 'average'; + end; + else + reftxt = { g.elocs(ref).labels }; + if length(reftxt) == 1, reftxt = reftxt{1}; end; + for ind = chansin + g.elocs(ind).ref = reftxt; + end; + end; +end; + +% remove reference +% ---------------- +morechans = []; +if strcmpi(g.keepref, 'off') + data(ref,:) = []; + if ~isempty(g.elocs) + morechans = g.elocs(ref); + g.elocs(ref) = []; + end; +end; + +data = reshape(data, size(data,1), dim2, dim3); + +% treat optional ica parameters +% ----------------------------- +W = []; S = []; icachansind = []; +if ~isempty(g.icaweights) + disp('Warning: This function does not process ICA array anymore, use the pop_reref function instead'); +end; +Elocs = g.elocs; diff --git a/code/eeglab13_4_4b/plugins/FASTER/hurst_exponent.m b/code/eeglab13_4_4b/plugins/FASTER/hurst_exponent.m new file mode 100644 index 0000000..c3f6284 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/hurst_exponent.m @@ -0,0 +1,53 @@ +% The Hurst exponent +%-------------------------------------------------------------------------- +% This function does dispersional analysis on a data series, then does a +% Matlab polyfit to a log-log plot to estimate the Hurst exponent of the +% series. +% +% This algorithm is far faster than a full-blown implementation of Hurst's +% algorithm. I got the idea from a 2000 PhD dissertation by Hendrik J +% Blok, and I make no guarantees whatsoever about the rigor of this approach +% or the accuracy of results. Use it at your own risk. +% +% Bill Davidson +% 21 Oct 2003 + +function [hurst] = hurst_exponent(data0) % data set + +data=data0; % make a local copy + +[M,npoints]=size(data0); + +yvals=zeros(1,npoints); +xvals=zeros(1,npoints); +data2=zeros(1,npoints); + +index=0; +binsize=1; + +while npoints>4 + + y=std(data); + index=index+1; + xvals(index)=binsize; + yvals(index)=binsize*y; + + npoints=fix(npoints/2); + binsize=binsize*2; + for ipoints=1:npoints % average adjacent points in pairs + data2(ipoints)=(data(2*ipoints)+data((2*ipoints)-1))*0.5; + end + data=data2(1:npoints); + +end % while + +xvals=xvals(1:index); +yvals=yvals(1:index); + +logx=log(xvals); +logy=log(yvals); + +p2=polyfit(logx,logy,1); +hurst=p2(1); % Hurst exponent is the slope of the linear fit of log-log plot + +return; diff --git a/code/eeglab13_4_4b/plugins/FASTER/make_EEG.m b/code/eeglab13_4_4b/plugins/FASTER/make_EEG.m new file mode 100644 index 0000000..c22fc4b --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/make_EEG.m @@ -0,0 +1,51 @@ +function EEG = make_EEG(data,event_num,srate,epoch_lims) +EEG.data=data; +EEG.srate=srate; +EEG.xmin = epoch_lims(1); +EEG.xmax = epoch_lims(2); +EEG.nbchan=size(EEG.data,1); +EEG.pnts = size(EEG.data,2); +EEG.trials=size(EEG.data,3); + +EEG.icawinv = []; +EEG.icasphere = []; +EEG.icaweights = []; +EEG.icaact = []; +EEG.ref = []; +%EEG.setname = []; +if ~ischar(event_num) + EEG.setname = ['GA' sprintf('_%d',event_num)]; +else + EEG.setname = ['GA_' event_num]; +end +EEG.filename = []; +EEG.filepath = []; +EEG.saved = 'no'; +EEG.chanlocs = ''; +EEG.chaninfo = ''; +EEG.comments = ''; +EEG=eeg_checkset(EEG); + +if size(EEG.data,3 > 1) + for u=1:size(EEG.data,3) + if ~ischar(event_num)&&isscalar(event_num) + EEG.event(u).type=sprintf('%d',event_num); + else + EEG.event(u).type=1; + end + EEG.event(u).latency=EEG.xmin*-1*EEG.srate + (EEG.xmax - EEG.xmin)*EEG.srate*(u-1); + EEG.urevent(u).type=EEG.event(u).type; + EEG.urevent(u).latency=EEG.event(u).latency; + EEG.event(u).epoch=u; + EEG.event(u).urevent=u; + EEG.epoch(u).event=u; + EEG.epoch(u).eventlatency=0; + EEG.epoch(u).eventtype={[1]}; + EEG.epoch(u).urevent={[u]}; + end +else + EEG.event=[]; + EEG.urevent=[]; +end + +EEG=eeg_checkset(EEG); \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/make_relative_path.m b/code/eeglab13_4_4b/plugins/FASTER/make_relative_path.m new file mode 100644 index 0000000..9e387f0 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/make_relative_path.m @@ -0,0 +1,10 @@ +function [pathstring] = make_relative_path(rel_path_tree,path_1) +% Reconstructs the relative path from path_1 using the relative +% path tree generated by find_relative_path +tmpdir=cd; +pathstring=path_1; +for v=1:length(rel_path_tree) + cd([pathstring filesep rel_path_tree{v}]); + pathstring=cd; +end +cd(tmpdir); diff --git a/code/eeglab13_4_4b/plugins/FASTER/marker_rejig.m b/code/eeglab13_4_4b/plugins/FASTER/marker_rejig.m new file mode 100644 index 0000000..a2a1e7c --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/marker_rejig.m @@ -0,0 +1,23 @@ +function EEG=marker_rejig(EEG,marker1,N,operation,marker2,out_marker) +types = [EEG.event(:).type]; + +for u=1:length(types) + switch(operation) + case 'after' + if (u>N && types(u)==marker1 && types(u-N)==marker2) + EEG.event(u).type=out_marker; + end + case 'before' + if (u<=(length(types)-N) && types(u)==marker1 && types(u+N)==marker2) + EEG.event(u).type=out_marker; + end + case 'not_after' + if (u>N && types(u)==marker1 && types(u-N)~=marker2) + EEG.event(u).type=out_marker; + end + case 'not_before' + if (u<=(length(types)-N) && types(u)==marker1 && types(u+N)~=marker2) + EEG.event(u).type=out_marker; + end + end +end diff --git a/code/eeglab13_4_4b/plugins/FASTER/min_z.m b/code/eeglab13_4_4b/plugins/FASTER/min_z.m new file mode 100644 index 0000000..246c617 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/min_z.m @@ -0,0 +1,12 @@ +function [lengths] = min_z(list_properties,rejection_options) +if (~exist('rejection_options','var')) + rejection_options.measure=ones(1,size(list_properties,2)); + rejection_options.z=3*ones(1,size(list_properties,2)); +end + +rejection_options.measure=logical(rejection_options.measure); +zs=list_properties-repmat(mean(list_properties,1),size(list_properties,1),1); +zs=zs./repmat(std(zs,[],1),size(list_properties,1),1); +zs(isnan(zs))=0; +all_l = abs(zs) > repmat(rejection_options.z,size(list_properties,1),1); +lengths = any(all_l(:,rejection_options.measure),2); \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/pop_FASTER.m b/code/eeglab13_4_4b/plugins/FASTER/pop_FASTER.m new file mode 100644 index 0000000..d37960a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/pop_FASTER.m @@ -0,0 +1,2 @@ +function EEG=pop_FASTER(EEG) +EEG=FASTER_GUI(1); \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/remevent.m b/code/eeglab13_4_4b/plugins/FASTER/remevent.m new file mode 100644 index 0000000..b85e551 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/remevent.m @@ -0,0 +1,47 @@ +function EEG = remevent(EEG,numbers) + +% Copyright (C) 2010 Hugh Nolan, Robert Whelan and Richard Reilly, Trinity College Dublin, +% Ireland +% nolanhu@tcd.ie, robert.whelan@tcd.ie +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + if ~iscell(numbers) + str_numbers=cell(size(numbers)); + for u=1:length(numbers) + str_numbers{u} = num2str(numbers(u)); + end + else + str_numbers = numbers; + end + + if ischar(EEG.event(1).type) + types={EEG.event.type}; + + good_indices=true(size(EEG.event)); + for u=1:length(numbers) + good_indices=good_indices & (~(strcmp(str_numbers{u},types))); + end + good_indices=find(good_indices); + else + types=[EEG.event.type]; + + good_indices=true(size(EEG.event)); + for u=1:length(numbers) + good_indices=good_indices & (types~=numbers(u)); + end + end + + EEG.event = EEG.event(good_indices); \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/FASTER/single_epoch_channel_properties.m b/code/eeglab13_4_4b/plugins/FASTER/single_epoch_channel_properties.m new file mode 100644 index 0000000..d8396f1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/FASTER/single_epoch_channel_properties.m @@ -0,0 +1,31 @@ +function list_properties = single_epoch_channel_properties(EEG,epoch_num,eeg_chans) +if ~isstruct(EEG) + newdata=EEG; + clear EEG; + EEG.data=newdata; + clear newdata; +end + +measure = 1; +% TEMPORAL PROPERTIES + +% 1 Median diff value +list_properties(:,measure) = median(diff(EEG.data(eeg_chans,:,epoch_num),[],2),2); +measure = measure + 1; + +% 2 Variance of the channels +list_properties(:,measure) = var(EEG.data(eeg_chans,:,epoch_num),[],2); +list_properties(isnan(list_properties(:,measure)),measure)=0; +measure = measure + 1; + +% 3 Max difference of each channel +list_properties(:,measure)=(max(EEG.data(eeg_chans,:,epoch_num),[],2)-min(EEG.data(eeg_chans,:,epoch_num),[],2)); +measure = measure + 1; + +% 4 Deviation from channel mean +list_properties(:,measure)=abs(mean(EEG.data(eeg_chans,:,epoch_num),2)-mean(EEG.data(eeg_chans,:),2)); +measure = measure + 1; + +for u = 1:size(list_properties,2) + list_properties(:,u) = list_properties(:,u) - median(list_properties(:,u)); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/README.md b/code/eeglab13_4_4b/plugins/bva-io1.7/README.md new file mode 100644 index 0000000..1f143d5 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/README.md @@ -0,0 +1,5 @@ +This repository is a plugin for EEGLAB to import/export +Brain Vision Analyzer EEG data files. + +# Version history +v1.7 - Better handling of VMRK and EEG file non-consistant witht the header VHDR file; allow empty marker info section; allow importing truncated binary file diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/eegplugin_bva_io.m b/code/eeglab13_4_4b/plugins/bva-io1.7/eegplugin_bva_io.m new file mode 100644 index 0000000..803630a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/eegplugin_bva_io.m @@ -0,0 +1,79 @@ +% eegplugin_bva_io() - EEGLAB plugin for importing Brainvision +% .vhdr and .ahdr data files. +% +% Usage: +% >> eegplugin_bva_io(fig, trystrs, catchstrs); +% +% Inputs: +% fig - [integer] EEGLAB figure +% trystrs - [struct] "try" strings for menu callbacks. +% catchstrs - [struct] "catch" strings for menu callbacks. +% +% Author: Andreas Widmann for binary import, 2004 +% Arnaud Delorme for Matlab import and EEGLAB interface +% +% See also: pop_loadbv() + +% Copyright (C) 2004 Andreas Widmann & Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Id: eegplugin_bva_io.m 53 2010-05-22 21:57:38Z arnodelorme $ + +function vers = eegplugin_bva_io(fig, trystrs, catchstrs) + + vers = 'bva_io1.7'; + if nargin < 3 + error('eegplugin_bva_io requires 3 arguments'); + end; + + % add folder to path + % ------------------ + if ~exist('eegplugin_bva_io') + p = which('eegplugin_bva_io.m'); + p = p(1:findstr(p,'eegplugin_bva_io.m')-1); + addpath( p ); + end; + + % find import data menu + % --------------------- + menui = findobj(fig, 'tag', 'import data'); + menuo = findobj(fig, 'tag', 'export'); + + % menu callbacks + % -------------- + icadefs; + versiontype = 1; + if exist('EEGLAB_VERSION') + if EEGLAB_VERSION(1) == '4' + versiontype = 0; + end; + end; + if versiontype == 0 + comcnt1 = [ trystrs.no_check '[EEGTMP LASTCOM] = pop_loadbv;' catchstrs.new_non_empty ]; + comcnt2 = [ trystrs.no_check '[EEGTMP LASTCOM] = pop_loadbva;' catchstrs.new_non_empty ]; + else + comcnt1 = [ trystrs.no_check '[EEG LASTCOM] = pop_loadbv;' catchstrs.new_non_empty ]; + comcnt2 = [ trystrs.no_check '[EEG LASTCOM] = pop_loadbva;' catchstrs.new_non_empty ]; + end; + comcnt3 = [ trystrs.no_check 'LASTCOM = pop_writebva(EEG);' catchstrs.add_to_hist ]; + comcnt4 = [ trystrs.no_check 'LASTCOM = pop_copybv();' catchstrs.add_to_hist ]; + + % create menus + % ------------ + uimenu( menui, 'label', 'From Brain Vis. Rec. .vhdr or .ahdr file', 'callback', comcnt1, 'separator', 'on' ); + uimenu( menui, 'label', 'From Brain Vis. Anal. Matlab file', 'callback', comcnt2 ); + uimenu( menuo, 'label', 'Write Brain Vis. exchange format file', 'callback', comcnt3, 'separator', 'on' ); + uimenu( menuo, 'label', 'Copy and Rename Brain Vis. exchange files', 'callback', comcnt4 ); diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/loadbvef.m b/code/eeglab13_4_4b/plugins/bva-io1.7/loadbvef.m new file mode 100644 index 0000000..31f0a3a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/loadbvef.m @@ -0,0 +1,71 @@ +% loadbvef() - Load BrainVision electrode location file +% +% Usage: +% >> chanlocs = loadbvef( filename ); +% +% Inputs: +% filename - filename incl. filepath +% +% Outputs: +% chanlocs - EEGLAB chanlocs structure +% +% References: +% http://de.mathworks.com/help/matlab/import_export/importing-xml-documents.html +% +% Author: Andreas Widmann, University of Leipzig, 2015 + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2015 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ chanlocs ] = loadbvef( filename ) + +% Import/export tag/field name mapping +fieldNames = { 'Name', 'labels', 1; 'Theta', 'sph_theta_besa', 0; 'Phi', 'sph_phi_besa', 0; 'Radius', 'sph_radius', 0 }; + +% Read file +xDoc = xmlread( filename ); + +% Loop over electrodes +allListitems = xDoc.getElementsByTagName( 'Electrode' ); + +for k = 0:allListitems.getLength - 1 + + thisListitem = allListitems.item( k ); + + % Loop over fields + for iField = 1:size( fieldNames, 1 ) + + thisList = thisListitem.getElementsByTagName( fieldNames{ iField, 1 } ); + thisElement = thisList.item( 0 ); + + % String or numeric + if fieldNames{ iField, 3 } + chanlocs( k + 1 ).( fieldNames{ iField, 2 } ) = char( thisElement.getFirstChild.getData ); %#ok + else + chanlocs( k + 1 ).( fieldNames{ iField, 2 } ) = str2double( thisElement.getFirstChild.getData ); %#ok + end + + end + +end + +% Convert from BESA +chanlocs = convertlocs( chanlocs, 'sphbesa2all' ); +chanlocs = rmfield( chanlocs, { 'sph_phi_besa', 'sph_theta_besa' } ); + +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/parsebvmrk.m b/code/eeglab13_4_4b/plugins/bva-io1.7/parsebvmrk.m new file mode 100644 index 0000000..e608502 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/parsebvmrk.m @@ -0,0 +1,49 @@ +% parsebvmrk() - convert Brain Vision Data Exchange format marker +% configuration structure to EEGLAB event structure +% +% Usage: +% >> EVENT = parsebvmrk(MRK); +% +% Inputs: +% MRK - marker configuration structure +% +% Outputs: +% EVENT - EEGLAB event structure +% +% Author: Andreas Widmann, University of Leipzig, 2007 + +% Copyright (C) 2007 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Id: parsebvmrk.m 37 2007-06-26 12:56:17Z andreaswidmann $ + +function EVENT = parsebvmrk(MRK) + +for idx = 1:size(MRK.markerinfos, 1) + [mrkType mrkDesc EVENT(idx).latency EVENT(idx).duration EVENT(idx).channel EVENT(idx).bvtime visible] = ... + strread(MRK.markerinfos{idx, 1}, '%s%s%f%d%d%d%s', 'delimiter', ','); + EVENT(idx).bvmknum = MRK.markerinfos{idx, 2}; + EVENT( idx ).visible = char( visible ); + + if strcmpi(mrkType, 'New Segment') || strcmpi(mrkType, 'DC Correction') + EVENT(idx).type = 'boundary'; + else + EVENT(idx).type = char(mrkDesc); + end + + EVENT(idx).code = char(mrkType); + EVENT(idx).urevent = idx; +end diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/pop_copybv.m b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_copybv.m new file mode 100644 index 0000000..07de8c4 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_copybv.m @@ -0,0 +1,141 @@ +% pop_copybv - copy a Brain Vision file set and updates the appropriate +% file names (DataFile and MarkerFile lines) in .vhdr (or .ahdr) and .vmrk +% (or .amrk) files with a new file name +% +% Usage: +% >> [com] = pop_copybv(); % a window pops up for input file and output files +% >> [com] = pop_copybv(hdr_file); % a window pops up for outputfile +% >> [com] = pop_copybv(hdr_file, outputfile); % no window pops up +% +% Inputs: +% hdr_file - vdhr_file to copy +% outputfile - new file name (including path if different than pwd, +% extension is ignored, but best to use .vhdr) +% +% Author: Joshua Koen, University of Notre Dame + +% Copyright (C) 2019, Joshua Koen (jkoen@nd.edu) +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function com = pop_copybv( hdr_file, outputfile ) + +% initialize com +com = ''; + +% handle vhdr_file +if nargin < 1 + [hdr_file, hdrpath] = uigetfile2({'*.vhdr;*.ahdr'}, 'Select Brain Vision a/vhdr-file - pop_copybv()'); + if isempty( hdr_file ), return; end + hdr_file = fullfile(hdrpath,hdr_file); % Remove extension +end + +% Handle output file (Removes dot extension) +if nargin < 2 + [outputfile, outputpath] = uiputfile('*', 'Output file'); + if isempty(outputfile), return; end + outputfile = fullfile(outputpath,outputfile); +end + +% Determine extensions +[hdrpath, hdr_file, hdr_extension] = fileparts(hdr_file); +[outputpath, outputfile] = fileparts(outputfile); + +% Determine marker extension +switch hdr_extension + case '.vhdr' + mrk_extension = '.vmrk'; + case '.ahdr' + mrk_extension = '.amrk'; + otherwise + error(['Only vhdr and ahdr files are handled: extension ' hdr_extension ' not recognized.']) +end + +% Open input hdr and mrk files for reading +vhdr_in = fopen( fullfile(hdrpath, [hdr_file hdr_extension]), 'r' ); +vmrk_in = fopen( fullfile(hdrpath, [hdr_file mrk_extension]), 'r' ); + +% Open output paths for writing +vhdr_out = fopen( fullfile(outputpath, [outputfile hdr_extension]), 'w' ); +vmrk_out = fopen( fullfile(outputpath, [outputfile mrk_extension]), 'w' ); + +% File output names for .vhdr +DataFile = [ outputfile '.eeg' ]; +MarkerFile = [ outputfile mrk_extension ]; + +% Update header header +disp('pop_copybv(): copying and updating header file'); +while ~feof(vhdr_in) + this_line = fgetl(vhdr_in); + this_line = bv_text_catcher(this_line, DataFile, MarkerFile); + fwrite(vhdr_out,sprintf('%s\n',this_line)); +end + +% Update vmrk file +disp('pop_copybv(): copying and updating marker file'); +while ~feof(vmrk_in) + this_line = fgetl(vmrk_in); + this_line = bv_text_catcher(this_line, DataFile, MarkerFile); + fwrite(vmrk_out,sprintf('%s\n',this_line)); +end + +% Simply copy the .eeg file +disp('pop_copybv(): copying data (.eeg) file'); +copyfile(fullfile(hdrpath, [hdr_file '.eeg']), fullfile(outputpath, [outputfile '.eeg'])); + +% Close files +fclose('all'); + +% update com +com = sprintf('pop_copybv( ''%s'', ''%s'' );', ... + fullfile(hdrpath,hdr_file,hdr_extension), fullfile(outputpath,outputfile,hdr_extension) ); + +function out_text = bv_text_catcher(in_text, DataFile, MarkerFile) + % bv_text_catcher() - checks information in a line of text from a .vhdr or + % .vmrk file for the DataFile= or MarkerFile= lines to update them + % appropriately. + % + % Usage: + % >> bv_text_catcher(in_text,DataFile,MarkerFile); % a window pops up + % >> EEG = pop_writebva(EEG, filename); + % + % Inputs: + % in_text - line of text to evaluate for presence of 'DataFile=' or + % 'MarkerFile=' + % DataFile - String for the new DataFile name to save in the .vhdr and + % .vmrk files. should only be file name and extension (no + % path). + % MarkerFile- String for the new DataFile name to save in the .vhdr file. + % Should only be file name and extension (no path). + + % Error Check + if ~ischar(in_text) || ~ischar(DataFile) || ~ischar(MarkerFile) || nargin < 3 + error('bv_file_catcher requires string inputs for in_text, DataFile, and MarkerFile'); + end + + + if all(ismember('DataFile=',in_text)) % DataFile replace + out_text = sprintf('DataFile=%s', DataFile); + elseif all(ismember('MarkerFile=', in_text)) % MarkerFile replace + out_text = sprintf('MarkerFile=%s', MarkerFile); + else % Otherwise simply pass it in + out_text = in_text; + end + +end + + +end % of function + diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/pop_loadbv.m b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_loadbv.m new file mode 100644 index 0000000..d2314dd --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_loadbv.m @@ -0,0 +1,441 @@ +% pop_loadbv() - load Brain Vision Data Exchange format dataset and +% return EEGLAB EEG structure +% +% Usage: +% >> [EEG, com] = pop_loadbv; % pop-up window mode +% >> [EEG, com] = pop_loadbv(path, hdrfile); +% >> [EEG, com] = pop_loadbv(path, hdrfile, srange); +% >> [EEG, com] = pop_loadbv(path, hdrfile, [], chans); +% >> [EEG, com] = pop_loadbv(path, hdrfile, srange, chans); +% +% Optional inputs: +% path - path to files +% hdrfile - name of Brain Vision vhdr-file (incl. extension) +% srange - scalar first sample to read (up to end of file) or +% vector first and last sample to read (e.g., [7 42]; +% default: all) +% chans - vector channels channels to read (e.g., [1:2 4]; +% default: all) +% metadata - [true|false] when true, only read meta data. Default +% false +% +% Outputs: +% EEG - EEGLAB EEG structure +% com - history string +% +% Note: +% Import "Brain Vision Data Exchange" format files with this function. +% Brain Vision Data Exchange files consist of a set of 3 files, a header +% file (.vhdr), a marker file (.vmrk), and a data file. Export from +% BrainVision Analyzer with "Generic Data" export. Select header and +% marker file for export (text format; XML format is not yet supported). +% Binary and text data formats, in both multiplexed and vectorized data +% orientation are supported. Binary data formats offer higher precision +% and faster file import. +% +% Author: Andreas Widmann & Arnaud Delorme, 2004- + +% Copyright (C) 2004 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Id: pop_loadbv.m 53 2010-05-22 21:57:38Z arnodelorme $ +% Revision 1.5 2010/03/23 21:19:52 roy +% added some lines so that the function can deal with the space lines in the ASCII multiplexed data file + +function [EEG, com] = pop_loadbv(path, hdrfile, srange, chans, metadata) + +com = ''; +EEG = []; +if nargin < 5 + metadata = false; +end +if nargin < 2 + [hdrfile, path] = uigetfile2('*.vhdr', 'Select Brain Vision vhdr-file - pop_loadbv()'); + if hdrfile(1) == 0, return; end + + drawnow; + uigeom = {[1 0.5] [1 0.5]}; + uilist = {{ 'style' 'text' 'string' 'Interval (samples; e.g., [7 42]; default: all):'} ... + { 'style' 'edit' 'string' ''} ... + { 'style' 'text' 'string' 'Channels (e.g., [1:2 4]; default: all):'} ... + { 'style' 'edit' 'string' ''}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_loadbv'')', 'Load a Brain Vision Data Exchange format dataset'); + if isempty(result), return, end + if ~isempty(result{1}) + srange = str2num(result{1}); + end + if ~isempty(result{2}) + chans = str2num(result{2}); + end +end + +% Header file +disp('pop_loadbv(): reading header file'); +hdr = readbvconf(path, hdrfile); + +% Common Infos +try + EEG = eeg_emptyset; +catch +end +EEG.comments = ['Original file: ' hdr.commoninfos.datafile]; +hdr.commoninfos.numberofchannels = str2double(hdr.commoninfos.numberofchannels); +EEG.srate = 1000000 / str2double(hdr.commoninfos.samplinginterval); + +% Binary Infos +if strcmpi(hdr.commoninfos.dataformat, 'binary') + switch lower(hdr.binaryinfos.binaryformat) + case 'int_16', binformat = 'int16'; bps = 2; + case 'uint_16', binformat = 'uint16'; bps = 2; + case 'ieee_float_32', binformat = 'float32'; bps = 4; + otherwise, error('Unsupported binary format'); + end +end + +% Channel Infos +if ~exist('chans', 'var') || isempty(chans) + chans = 1:hdr.commoninfos.numberofchannels; + EEG.nbchan = hdr.commoninfos.numberofchannels; +else + EEG.nbchan = length(chans); +end +if any(chans < 1) || any(chans > hdr.commoninfos.numberofchannels) + error('chans out of available channel range'); +end +if isfield(hdr, 'channelinfos') + for chan = 1:length(chans) + try + [EEG.chanlocs(chan).labels, chanlocs(chan).ref, chanlocs(chan).scale, chanlocs(chan).unit] = strread(hdr.channelinfos{chans(chan)}, '%s%s%s%s', 1, 'delimiter', ','); + catch % Octave compatible code below + str = hdr.channelinfos{chans(chan)}; + [EEG.chanlocs(chan).labels, str] = strtok(str, ','); + [chanlocs(chan).ref, str] = strtok(str, ','); + [chanlocs(chan).scale, str] = strtok(str, ','); + [chanlocs(chan).unit, str] = strtok(str, ','); + end + EEG.chanlocs(chan).labels = char(EEG.chanlocs(chan).labels); + chanlocs(chan).scale = str2double(char(chanlocs(chan).scale)); +% chanlocs(chan).unit = native2unicode(double(char(chanlocs(chan).scale)), 'UTF-8'); +% EEG.chanlocs(chan).datachan = chans(chan); + end + if isempty([chanlocs.scale]) + chanlocs = rmfield(chanlocs, 'scale'); + end +end +% [EEG.chanlocs.type] = deal([]); + +% Coordinates +if isfield(hdr, 'coordinates') + hdr.coordinates(end+1:length(chans)) = { [] }; + onenon0channel = 0; + for chan = 1:length(chans) + if ~isempty(hdr.coordinates{chans(chan)}) + if ismatlab + [EEG.chanlocs(chan).sph_radius, theta, phi] = strread(hdr.coordinates{chans(chan)}, '%f%f%f', 'delimiter', ','); + else + str = hdr.coordinates{chans(chan)}; + [EEG.chanlocs(chan).sph_radius, str] = strtok(str, ','); EEG.chanlocs(chan).sph_radius = str2num(EEG.chanlocs(chan).sph_radius); + [theta, str] = strtok(str, ','); theta = str2num(theta); + [phi, str] = strtok(str, ','); phi = str2num(phi); + end + if EEG.chanlocs(chan).sph_radius == 0 && theta == 0 && phi == 0 + EEG.chanlocs(chan).sph_radius = []; + EEG.chanlocs(chan).sph_theta = []; + EEG.chanlocs(chan).sph_phi = []; + else + onenon0channel = 1; + EEG.chanlocs(chan).sph_theta = phi - 90 * sign(theta); + EEG.chanlocs(chan).sph_phi = -abs(theta) + 90; + end + end + end + try + if onenon0channel + [EEG.chanlocs, EEG.chaninfo] = pop_chanedit(EEG.chanlocs, 'convert', 'sph2topo'); + [EEG.chanlocs, EEG.chaninfo] = pop_chanedit(EEG.chanlocs, 'convert', 'sph2cart'); + end + catch, end +end + +% Open data file and find the number of data points +% ------------------------------------------------- +disp('pop_loadbv(): reading EEG data'); +[IN, message] = fopen(fullfile(path, hdr.commoninfos.datafile), 'r'); +if IN == -1 + [IN, message] = fopen(fullfile(path, lower(hdr.commoninfos.datafile))); + if IN == -1 + hdr.commoninfos.datafile = [ hdrfile(1:end-4) 'eeg' ]; + fprintf(2, 'The header file points to a binary file that does not exist\n'); + fprintf(2, 'trying to open a binary file with the same name as the header\nfile and a different extension...\n'); + [IN, message] = fopen(fullfile(path, hdr.commoninfos.datafile), 'r'); + if IN == -1 + [IN, message] = fopen(fullfile(path, lower(hdr.commoninfos.datafile))); + if IN == -1 + error(message) + end + end + end +end +if isfield( hdr.commoninfos, 'datapoints' ) && ~isempty( hdr.commoninfos.datapoints ) && isnumeric( str2double( hdr.commoninfos.datapoints ) ) && str2double( hdr.commoninfos.datapoints ) > 0 + hdr.commoninfos.datapoints = str2double(hdr.commoninfos.datapoints); +elseif strcmpi( hdr.commoninfos.dataformat, 'binary' ) + fseek( IN, 0, 'eof' ); + hdr.commoninfos.datapoints = ftell( IN ) / ( hdr.commoninfos.numberofchannels * bps ); + if round(hdr.commoninfos.datapoints) ~= hdr.commoninfos.datapoints + fprintf(2, 'Binary file is truncated/incomplete\n'); + hdr.commoninfos.datapoints = floor(hdr.commoninfos.datapoints); + end + fseek( IN, 0, 'bof' ); +else + hdr.commoninfos.datapoints = NaN; +end + +if ~strcmpi(hdr.commoninfos.dataformat, 'binary') % ASCII + % tmppoint = hdr.commoninfos.datapoints; + tmpchan = fscanf(IN, '%s', 1); + + % AW: Determination of number of datapoints will not work for files without chanlabels and/or multiplexed dataformat. Suggest trusting in header. + % tmpdata = fscanf(IN, '%f', inf); + % hdr.commoninfos.datapoints = length(tmpdata); + % chanlabels = 1; + if isnan(str2double(tmpchan)) + % hdr.commoninfos.datapoints = hdr.commoninfos.datapoints+1; + chanlabels = 1; + else + chanlabels = 0; + end +end + +% Sample range +if ~exist('srange', 'var') || isempty(srange) + srange = [ 1 hdr.commoninfos.datapoints]; + EEG.pnts = hdr.commoninfos.datapoints; +elseif length(srange) == 1 + EEG.pnts = hdr.commoninfos.datapoints - srange(1) + 1; +else + EEG.pnts = srange(2) - srange(1) + 1; +end +if any(srange < 1) || any(srange > hdr.commoninfos.datapoints) + error('srange out of available data range'); +end + +% Read data +if metadata + EEG.data = []; +elseif strcmpi(hdr.commoninfos.dataformat, 'binary') + switch lower(hdr.commoninfos.dataorientation) + case 'multiplexed' + if EEG.nbchan == hdr.commoninfos.numberofchannels % Read all channels + fseek(IN, (srange(1) - 1) * EEG.nbchan * bps, 'bof'); + EEG.data = fread(IN, [EEG.nbchan, EEG.pnts], [binformat '=>float32']); + else % Read channel subset + EEG.data = repmat(single(0), [EEG.nbchan, EEG.pnts]); % Preallocate memory + for chan = 1:length(chans) + fseek(IN, (srange(1) - 1) * hdr.commoninfos.numberofchannels * bps + (chans(chan) - 1) * bps, 'bof'); + EEG.data(chan, :) = fread(IN, [1, EEG.pnts], [binformat '=>float32'], (hdr.commoninfos.numberofchannels - 1) * bps); + end + end + case 'vectorized' + if isequal(EEG.pnts, hdr.commoninfos.datapoints) && EEG.nbchan == hdr.commoninfos.numberofchannels % Read entire file + EEG.data = fread(IN, [EEG.pnts, EEG.nbchan], [binformat '=>float32']).'; + else % Read fraction of file + EEG.data = repmat(single(0), [EEG.nbchan, EEG.pnts]); % Preallocate memory + for chan = 1:length(chans) + fseek(IN, ((chans(chan) - 1) * hdr.commoninfos.datapoints + srange(1) - 1) * bps, 'bof'); + EEG.data(chan, :) = fread(IN, [1, EEG.pnts], [binformat '=>float32']); + end + end + otherwise + error('Unsupported data orientation') + end +else % ASCII data +% disp('If this function does not work, export your data in binary format'); +% EEG.data = repmat(single(0), [EEG.nbchan, EEG.pnts]); +% if strcmpi(lower(hdr.commoninfos.dataorientation), 'vectorized') +% count = 1; +% fseek(IN, 0, 'bof'); +% len = inf; +% for chan = 1:hdr.commoninfos.numberofchannels +% if chanlabels, tmpchan = fscanf(IN, '%s', 1); end; +% tmpdata = fscanf(IN, '%f', len); len = length(tmpdata); +% if ismember(chan, chans) +% EEG.data(count, :) = tmpdata(srange(1):srange(2))'; +% count = count + 1; +% end; +% end; +% elseif strcmpi(lower(hdr.commoninfos.dataorientation), 'multiplexed') +% % fclose(IN); +% % error('ASCII multiplexed reading not implemeted yet; export as a different format'); +% if EEG.nbchan == hdr.commoninfos.numberofchannels % Read all channels +% tmpchan= fgetl(IN); +% count = 1; +% while ~feof(IN) +% tmpstr = fgetl(IN); +% if ~isempty(tmpstr) +% temp_ind = tmpstr==','; +% tmpstr(temp_ind) = '.'; +% tmpdata = strread(tmpstr); +% EEG.data(:,count) = tmpdata'; +% count = count + 1; +% end; +% end; +% EEG.pnts = count - 1; +% else +% +% end; +% end; + + % Rewritten by AW, 2013-10-02. Old version by Arno did no longer work. MATLAB changes? + tmpdata = zeros([hdr.commoninfos.numberofchannels, hdr.commoninfos.datapoints], 'single'); + fseek(IN, 0, 'bof'); + switch lower(hdr.commoninfos.dataorientation) + + case 'vectorized' + if chanlabels || (isfield(hdr, 'asciiinfos') && isfield(hdr.asciiinfos, 'decimalsymbol') && ~strcmp(hdr.asciiinfos.decimalsymbol, '.')) % Read line by line + + for iChan = 1:hdr.commoninfos.numberofchannels + tmpstr = fgetl(IN); + if chanlabels + [tmpchan, count, errmsg, nextindex] = sscanf(tmpstr, '%s', 1); + tmpstr = tmpstr(nextindex:end); + end + if isfield(hdr, 'asciiinfos') && isfield(hdr.asciiinfos, 'decimalsymbol') && ~strcmp(hdr.asciiinfos.decimalsymbol, '.') + tmpdata(iChan, :) = sscanf(regexprep(tmpstr, hdr.asciiinfos.decimalsymbol, '.'), '%f', inf); + else + tmpdata(iChan, :) = sscanf(tmpstr, '%f', inf); + end + end + + else + tmpdata = fscanf(IN, '%f', inf); + tmpdata = reshape(tmpdata, hdr.commoninfos.datapoints, hdr.commoninfos.numberofchannels)'; + end + + case 'multiplexed' + if chanlabels + tmpchan = fgetl(IN); + end + if isfield(hdr, 'asciiinfos') && isfield(hdr.asciiinfos, 'decimalsymbol') && ~strcmp(hdr.asciiinfos.decimalsymbol, '.') % Read line by line + for iPnt = 1:hdr.commoninfos.datapoints + tmpstr = fgetl(IN); + tmpdata(:, iPnt) = sscanf(regexprep(tmpstr, hdr.asciiinfos.decimalsymbol, '.'), '%f', inf); + end + else + tmpdata = fscanf(IN, '%f', inf); + tmpdata = reshape(tmpdata, hdr.commoninfos.numberofchannels, hdr.commoninfos.datapoints); + end + + otherwise + error('Unknown data orientation') + + end + + EEG.data = tmpdata(chans, srange(1):srange(2)); +end + +fclose(IN); +EEG.trials = 1; +EEG.xmin = 0; +EEG.xmax = (EEG.pnts - 1) / EEG.srate; + +% Convert to EEG.data to double for MATLAB < R14 +if str2double(version('-release')) < 14 + EEG.data = double(EEG.data); +end + +% Scale data +if exist('chanlocs', 'var') && isfield(chanlocs, 'scale') && ~isempty(EEG.data) + disp('pop_loadbv(): scaling EEG data'); + for chan = 1:EEG.nbchan + if ~isnan(chanlocs(chan).scale) + EEG.data(chan, :) = EEG.data(chan, :) * chanlocs(chan).scale; + end + end +end + +% Marker file +if isfield(hdr.commoninfos, 'markerfile') + disp('pop_loadbv(): reading marker file'); + try + MRK = readbvconf(path, hdr.commoninfos.markerfile); + catch + MRK = readbvconf(path, [hdrfile(1:end-4) 'vmrk' ]); + end + if ~isequal(hdr.commoninfos.datafile, MRK.commoninfos.datafile) + disp('pop_loadbv() warning: data files in header and marker files inconsistent.'); + end + + % Marker infos + if isfield(MRK, 'markerinfos') + EEG.event = parsebvmrk(MRK); + + % Correct event latencies by first sample offset + tmpevent = EEG.event; + for index = 1:length(EEG.event) + tmpevent(index).latency = tmpevent(index).latency - srange(1) + 1; + end + EEG.event = tmpevent; + + % Remove unreferenced events + EEG.event = EEG.event([tmpevent.latency] >= 1 & [tmpevent.latency] <= EEG.pnts); + + % Copy event structure to urevent structure + EEG.urevent = rmfield(EEG.event, 'urevent'); + + % find if boundaries at homogenous intervals + % ------------------------------------------ + tmpevent = EEG.event; + boundaries = strmatch('boundary', {tmpevent.type}); + boundlats = unique([tmpevent(boundaries).latency]); + if (isfield(hdr.commoninfos, 'segmentationtype') && (strcmpi(hdr.commoninfos.segmentationtype, 'markerbased') || strcmpi(hdr.commoninfos.segmentationtype, 'fixtime'))) && length(boundaries) > 1 && length(unique(diff([boundlats EEG.pnts + 1]))) == 1 + EEG.trials = length(boundlats); + EEG.pnts = EEG.pnts / EEG.trials; + EEG.event(boundaries) = []; + + % adding epoch field + % ------------------ + tmpevent = EEG.event; + for index = 1:length(EEG.event) + EEG.event(index).epoch = ceil(tmpevent(index).latency / EEG.pnts); + end + + % finding minimum time + % -------------------- + tles = strmatch('time 0', lower({tmpevent.code}))'; + if ~isempty(tles) + for iTLE = tles(:)' + EEG.event(iTLE).type ='TLE'; + end + EEG.xmin = -(tmpevent(tles(1)).latency - 1) / EEG.srate; + end + else + for index = 1:length(boundaries) + EEG.event(boundaries(index)).duration = NaN; + end + end + end +end + +EEG.ref = 'common'; + +try + EEG = eeg_checkset(EEG); +catch +end + +if nargout == 2 + com = sprintf('EEG = pop_loadbv(''%s'', ''%s'', %s, %s);', path, hdrfile, mat2str(srange), mat2str(chans)); +end diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/pop_loadbva.m b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_loadbva.m new file mode 100644 index 0000000..6ba2090 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_loadbva.m @@ -0,0 +1,140 @@ +% pop_loadbva() - import a Matlab file from brain vision analyser +% software. +% +% Usage: +% >> OUTEEG = pop_loadbva( filename ); +% +% Inputs: +% filename - file name +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, Dec 2003 +% +% See also: eeglab() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_loadbva(filename) + + EEG = []; + com = ''; + + if nargin < 1 + [tmpfilename, filepath] = uigetfile('*.mat;*.MAT', 'Choose a Matlab file from Brain Vision Analyser -- pop_loadbva'); + if tmpfilename == 0 return; end; + filename = [ filepath tmpfilename ]; + end; + + disp('Importing data'); + EEG = eeg_emptyset; + bva = load(filename, '-mat'); + allfields = fieldnames(bva); + chanstruct = bva.Channels; + channames = lower({ chanstruct.Name }); + for index = 1:length(allfields) + switch lower(allfields{index}) + case { 't' 'markercount' 'markers' 'samplerate' 'segmentcount' 'channelcount' 'channels' }, + otherwise + count1 = strmatch(lower(allfields{index}), channames, 'exact'); + count2 = strmatch(lower(allfields{index}(2:end)), channames, 'exact'); + if ~isempty(count1) | ~isempty(count2) + count = [ count1 count2 ]; + count = count(1); + else + disp(['Warning: channel ''' lower(allfields{index}) ''' not in channel location structure']); + count = length(chanstruct)+1; + chanstruct(end+1).Name = allfields{index}; + chanstruct(end+1).Phi = []; + chanstruct(end+1).Theta = []; + chanstruct(end+1).Radius = []; + end; + if bva.SegmentCount > 1 + EEG.data(count,:,:) = getfield(bva, allfields{index})'; + bva = rmfield(bva, allfields{index}); + else + EEG.data(count,:) = getfield(bva, allfields{index}); + bva = rmfield(bva, allfields{index}); + end; + end; + end; + + EEG.nbchan = size(EEG.data,1); + EEG.srate = bva.SampleRate; + EEG.xmin = bva.t(1)/1000; + EEG.xmax = bva.t(end)/1000; + EEG.pnts = size(EEG.data,2); + EEG.trials = size(EEG.data,3); + EEG.setname = 'Brain Vision Analyzer file'; + EEG.comments = [ 'Original file: ' filename ]; + + % convert channel location structure + % ---------------------------------- + disp('Importing channel location information'); + for index = 1:length(chanstruct) + EEG.chanlocs(index).labels = chanstruct(index).Name; + if chanstruct(index).Radius ~= 0 + EEG.chanlocs(index).sph_theta_besa = chanstruct(index).Theta; + EEG.chanlocs(index).sph_phi_besa = chanstruct(index).Phi; + EEG.chanlocs(index).sph_radius = chanstruct(index).Radius; + else + EEG.chanlocs(index).sph_theta_besa = []; + EEG.chanlocs(index).sph_phi_besa = []; + EEG.chanlocs(index).sph_radius = []; + end; + end; + EEG.chanlocs = convertlocs(EEG.chanlocs, 'sphbesa2all'); + EEG.chanlocs = rmfield(EEG.chanlocs, 'sph_theta_besa'); + EEG.chanlocs = rmfield(EEG.chanlocs, 'sph_phi_besa'); + + % convert event information + % ------------------------- + disp('Importing events'); + index = 0; + if isfield(bva, 'Markers') + for index1 = 1:size(bva.Markers,1) + for index2 = 0:size(bva.Markers,2)-1 + if ~isempty(bva.Markers(index2*size(bva.Markers,1)+index1).Description) + index = index + 1; + EEG.event(index).type = bva.Markers(index2*size(bva.Markers,1)+index1).Description; + EEG.event(index).latency = bva.Markers(index2*size(bva.Markers,1)+index1).Position; + EEG.event(index).Points = bva.Markers(index2*size(bva.Markers,1)+index1).Points; + try + EEG.event(index).bvatype = bva.Markers(index2*size(bva.Markers,1)+index1).Type; + EEG.event(index).description = bva.Markers(index2*size(bva.Markers,1)+index1).Description; + catch, end; + try + EEG.event(index).chan = bva.Markers(index2*size(bva.Markers,1)+index1).Chan; + catch, end; + try + EEG.event(index).channelnumber = bva.Markers(index2*size(bva.Markers,1)+index1).ChannelNumber; + catch, end; + if bva.SegmentCount > 1 + EEG.event(index).epoch = index1; + EEG.event(index).latency = bva.Markers(index2*size(bva.Markers,1)+index1).Position+(index1-1)*EEG.pnts; + else + EEG.event(index).latency = bva.Markers(index2*size(bva.Markers,1)+index1).Position; + end; + end; + end; + end; + end + EEG = eeg_checkset(EEG, 'makeur'); + EEG = eeg_checkset(EEG, 'eventconsistency'); + + com = sprintf('EEG = pop_loadbva(''%s'');', filename); diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/pop_writebva.m b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_writebva.m new file mode 100644 index 0000000..7544661 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/pop_writebva.m @@ -0,0 +1,205 @@ +% pop_writebva() - export EEG dataset +% +% Usage: +% >> EEG = pop_writebva(EEG); % a window pops up +% >> EEG = pop_writebva(EEG, filename); +% +% Inputs: +% EEG - eeglab dataset +% filename - file name +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2005- + +% Copyright (C) 2005, Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function com = pop_writebva(EEG, filename); + +com = ''; +if nargin < 1 + help pop_writebva; + return; +end; + +if nargin < 2 + [filename, filepath] = uiputfile('*', 'Output file'); + if length( filepath ) == 0 return; end; + filename = [ filepath filename ]; +end; + +% remove extension if any +% ----------------------- +posdot = find(filename == '.'); +if ~isempty(posdot), filename = filename(1:posdot(end)-1); end; + +% open output file +% ---------------- +fid1 = fopen( [ filename '.vhdr' ], 'w' ); +fid2 = fopen( [ filename '.vmrk' ], 'w' ); +fid3 = fopen( [ filename '.dat' ], 'wb', 'ieee-le'); +[ tmppath basename ] = fileparts( filename ); + +% write data +% ---------- +for index = 1:EEG.nbchan + fwrite(fid3, EEG.data(index,:), 'float' ); +end; + +% write header +% ------------ +fprintf(fid1, 'Brain Vision Data Exchange Header File Version 1.0\n'); +fprintf(fid1, '; Data created from the EEGLAB software\n'); +fprintf(fid1, '\n'); +fprintf(fid1, '[Common Infos]\n'); +fprintf(fid1, 'DataFile=%s\n', [ basename '.dat' ]); +if ~isempty(EEG.event) + fprintf(fid1, 'MarkerFile=%s\n', [ basename '.vmrk' ]); +end; +fprintf(fid1, 'DataFormat=BINARY\n'); +fprintf(fid1, '; Data orientation: VECTORIZED=ch1,pt1, ch1,pt2..., MULTIPLEXED=ch1,pt1, ch2,pt1 ...\n'); +fprintf(fid1, 'DataOrientation=VECTORIZED\n'); +fprintf(fid1, 'DataType=TIMEDOMAIN\n'); +fprintf(fid1, 'NumberOfChannels=%d\n', EEG.nbchan); +fprintf(fid1, 'DataPoints=%d\n', EEG.pnts*EEG.trials); +fprintf(fid1, '; Sampling interval in microseconds if time domain (convert to Hertz:\n'); +fprintf(fid1, '; 1000000 / SamplingInterval) or in Hertz if frequency domain:\n'); +fprintf(fid1, 'SamplingInterval=%d\n', 1000000/EEG.srate); +if EEG.trials > 1 + fprintf(fid1, 'SegmentationType=MARKERBASED\n'); +end; +fprintf(fid1, '\n'); +fprintf(fid1, '[Binary Infos]\n'); +fprintf(fid1, 'BinaryFormat=IEEE_FLOAT_32\n'); +fprintf(fid1, '\n'); +if ~isempty(EEG.chanlocs) + fprintf(fid1, '[Channel Infos]\n'); + fprintf(fid1, '; Each entry: Ch=,,\n'); + fprintf(fid1, '; ,=,,\n'); + % loc = convertlocs(EEG.chanlocs, 'sph2sphbesa'); + % for index = 1:EEG.nbchan + % fprintf(fid1, 'Ch%d=%d,%d,%d\n', index, round(loc(index).sph_theta_besa), ... + % round(loc(index).sph_phi_besa), 0); + % end; + %end; +end; + +% export event information +% ------------------------ +if ~isempty(EEG.event) + fprintf(fid2, 'Brain Vision Data Exchange Marker File, Version 1.0\n'); + fprintf(fid2, '; Data created from the EEGLAB software\n'); + fprintf(fid2, '; The channel numbers are related to the channels in the exported file.\n'); + fprintf(fid2, '\n'); + fprintf(fid2, '[Common Infos]\n'); + fprintf(fid2, 'DataFile=%s\n', [ basename '.dat' ]); + fprintf(fid2, '\n'); + fprintf(fid2, '[Marker Infos]\n'); + fprintf(fid2, '; Each entry: Mk=,,,\n'); + fprintf(fid2, '; , ,\n'); + fprintf(fid2, '; \n'); + fprintf(fid2, '; Fields are delimited by commas, some fields might be omited (empty).\n'); + fprintf(fid2, '; Commas in type or description text are coded as "\1".\n'); + + % rename type and comments + % ------------------------ + for index = 1:length(EEG.event) + EEG.event(index).comment = EEG.event(index).type; + EEG.event(index).type = 'Stimulus'; + end; + + % make event cell array + % --------------------- + for index = 1:EEG.trials + EEG.event(end+1).type = 'New Segment'; + EEG.event(end ).latency = (index-1)*EEG.pnts+1; + end; + tmpevent = EEG.event; + [tmp latorder ] = sort( [ tmpevent.latency ] ); + EEG.event = EEG.event(latorder); + tmpevent = tmpevent( latorder ); + + % Recode boundary events + % ---------------------- + bndArray = find(strcmp('boundary', {tmpevent.comment})); % Find boundary events + isDupArray = ismember([tmpevent(bndArray).latency], [tmpevent(strcmp('New Segment', {tmpevent.type})).latency]); % Find already existing New Segment events with identical latency + notduplist = bndArray(~isDupArray); + duplist = bndArray(isDupArray); + for index = 1:length(notduplist) + EEG.event(notduplist(index)).type = 'New Segment'; % Recode boundary event type + EEG.event(notduplist(index)).comment = ''; % Recode boundary event comment + end; + EEG.event(duplist) = []; % Remove duplicate New Segment events + + % rename latency events + % --------------------- + time0ind = []; + for index = 1:length(EEG.event) + if mod( EEG.event(index).latency, EEG.pnts) == -EEG.xmin*EEG.srate+1 + time0ind = [ time0ind index ]; + end; + end; + for index = length(time0ind):-1:1 + EEG.event(time0ind(index)+1:end+1) = EEG.event(time0ind(index):end); + EEG.event(time0ind(index)).type = 'Time 0'; + EEG.event(time0ind(index)).comment = ''; + end; + + % write events + % ------------ + e = EEG.event; + for index = 1:length(e) + + % duration field + % -------------- + if isfield(e, 'duration') + if ~isempty(e(index).duration) + tmpdur = e(index).duration; + else tmpdur = 0; + end; + else tmpdur = 0; + end; + + % comment field + % ------------- + if isfield(e, 'comment') + if ~isempty(e(index).comment) + tmpcom = e(index).comment; + else tmpcom = ''; + end; + else tmpcom = num2str(e(index).type); + end; + + fprintf(fid2, 'Mk%d=%s,%s,%d,%d,0,0\n', index, num2str(e(index).type), num2str(tmpcom), round(e(index).latency), tmpdur); + end; +end +fclose(fid1); +fclose(fid2); +fclose(fid3); + +com = sprintf('pop_writebva(%s,''%s'');', inputname(1), filename); +return; diff --git a/code/eeglab13_4_4b/plugins/bva-io1.7/readbvconf.m b/code/eeglab13_4_4b/plugins/bva-io1.7/readbvconf.m new file mode 100644 index 0000000..9b9a005 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/bva-io1.7/readbvconf.m @@ -0,0 +1,147 @@ +% readbvconf() - read Brain Vision Data Exchange format configuration +% file +% +% Usage: +% >> CONF = readbvconf(pathname, filename); +% +% Inputs: +% pathname - path to file +% filename - filename +% +% Outputs: +% CONF - structure configuration +% +% Author: Andreas Widmann, University of Leipzig, 2007 + +% Copyright (C) 2007 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Id: readbvconf.m 44 2009-11-12 02:00:56Z arnodelorme $ + +function CONF = readbvconf(pathname, filename) + +if nargin < 2 + error('Not enough input arguments'); +end +% +% % Open and read file (old method, much slower) +% [IN, message] = fopen(fullfile(pathname, filename), 'r'); +% if IN == -1 +% [IN, message] = fopen(fullfile(pathname, lower(filename))); +% if IN == -1 +% error(message) +% end; +% end +% raw={}; +% while ~feof(IN) +% raw = [raw; {fgetl(IN)}]; +% end +% fclose(IN); +% +% % Remove comments and empty lines +% raw(cellfun('isempty', raw) == true) = []; +% raw(strmatch(';', raw)) = []; + +% Open and read file (automatically remove empty lines) +fid = fopen(fullfile(pathname, filename), 'r'); +raw = textscan(fid, '%s', 'delimiter', ''); +fclose(fid); +raw = raw{1}; +raw(strmatch(';', raw)) = []; % remove comments + +% Find sections +sectionArray = [strmatch('[', raw)' length(raw) + 1]; +for iSection = 1:length(sectionArray) - 1 + + % Convert section name + tmpstr = deblank(raw{sectionArray(iSection)}); + fieldName = lower(tmpstr(2:end-1)); + %fieldName = lower(char(strread(tmpstr(2:end), '[%s', 'delimiter', ']'))); + fieldName(isspace(fieldName) == true) = []; + + % Fill structure with parameter value pairs + switch fieldName + case {'commoninfos' 'binaryinfos' 'asciiinfos'} + for line = sectionArray(iSection) + 1:sectionArray(iSection + 1) - 1 + splitArray = strfind(raw{line}, '='); + fieldName2 = lower(raw{line}(1:splitArray(1) - 1)); + fieldName2(fieldName2 == ' ') = '_'; + fieldName2(fieldName2 == ':') = '_'; + CONF.(fieldName).(fieldName2) = raw{line}(splitArray(1) + 1:end); + end + case {'channelinfos' 'coordinates'} + for line = sectionArray(iSection) + 1:sectionArray(iSection + 1) - 1 + splitArray = strfind(raw{line}, '='); + CONF.(fieldName)(str2double(raw{line}(3:splitArray(1) - 1))) = {raw{line}(splitArray(1) + 1:end)}; + end + case {'markerinfos'} % Allow discontinuity for markers (but not channelinfos and coordinates!) + % try reading the whole section at once + + try + fileData = raw(sectionArray(iSection) + 1:sectionArray(iSection + 1) - 1); + fileData = sprintf('%s\n', fileData{:}); + newData = textscan(fileData', '%s', 'delimiter', '='); + newData = newData{1}; + eventValues = newData(2:2:end); + eventMarkers = newData(1:2:end-1); + eventMarkers = cellfun(@(x)str2double(x(3:end)), eventMarkers, 'uniformoutput', false); + markerInfo = eventValues; + markerInfo(:,2) = eventMarkers; + CONF.( [ fieldName ] ) = markerInfo; + catch + % old method (much slower) + for line = sectionArray(iSection) + 1:sectionArray(iSection + 1) - 1 + splitArray = strfind(raw{line}, '='); + CONF.(fieldName)(line - sectionArray(iSection), :) = {raw{line}(splitArray(1) + 1:end) str2double(raw{line}(3:splitArray(1) - 1))}; + end + end + + if ~isfield(CONF, fieldName) + disp('No event found'); + else + if any(cellfun(@isempty, CONF.(fieldName)(:,1))) + warning('Empty event(s).') + end + if ~all(1:size(CONF.(fieldName), 1) == [CONF.(fieldName){:, 2}]) + warning('Marker number discontinuity.') + end + end + + case 'comment' + CONF.(fieldName) = raw(sectionArray(iSection) + 1:sectionArray(iSection + 1) - 1); + otherwise + fprintf('Unrecognized entry: %s\n', fieldName); + end +end + +% Handle ahdr file type exceptions +[ ~, ~, ext ] = fileparts( fullfile(pathname, filename) ); +if strcmp( ext, '.ahdr' ) + + if ~isfield( CONF.commoninfos, 'numberofchannels' ) + error( 'Common infos field numberofchannels required.' ) + else + ahdrChan = str2double( CONF.commoninfos.numberofchannels ) + 1; + CONF.commoninfos.numberofchannels = num2str( ahdrChan ); + end + + CONF.channelinfos(ahdrChan) = { 'test,,1,mV' }; + + CONF.coordinates(ahdrChan) = { '0,0,0' }; + +end + +disp('Done.') diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/README.txt b/code/eeglab13_4_4b/plugins/dipfit2.3/README.txt new file mode 100644 index 0000000..d0db488 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/README.txt @@ -0,0 +1,2 @@ +v2.3 versus v2.2 +- added the function adjustcylinder2.m diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/adjustcylinder2.m b/code/eeglab13_4_4b/plugins/dipfit2.3/adjustcylinder2.m new file mode 100644 index 0000000..5c16552 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/adjustcylinder2.m @@ -0,0 +1,60 @@ +% adjustcylinder() - Adjust 3d object coordinates to match a pair of points +% +% Usage: +% >> [x y z] = adjustcylinder( x, y, z, pos1, pos2); +% +% Inputs: +% x,y,z - 3-D point coordinates +% pos1 - position of first point [x y z] +% pos2 - position of second point [x y z] +% +% Outputs: +% x,y,z - updated 3-D point coordinates +% +% Author: Arnaud Delorme, CNL / Salk Institute, 30 Mai 2003 + +% Copyright (C) 2003 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [x, y, z] = adjustcylinder2( h, pos1, pos2); + + % figure; plot3(x(2,:),y(2,:),z(2,:)); [ x(2,:)' y(2,:)' z(2,:)'] + + % stretch z coordinates to match for vector length + % ------------------------------------------------ + dist = sqrt(sum((pos1-pos2).^2)); + z = get(h, 'zdata'); + zrange = max(z(:)) - min(z(:)); + set(h, 'zdata', get(h, 'zdata') /zrange*dist); + + % rotate in 3-D to match vector angle [0 0 1] -> vector angle) + % only have to rotate in the x-z and y-z plane + % -------------------------------------------- + vectrot = [ pos2(1)-pos1(1) pos2(2)-pos1(2) pos2(3)-pos1(3)]; + [thvect phivect] = cart2sph( vectrot(1), vectrot(2), vectrot(3) ); + + rotatematlab(h, [0 0 1], thvect/pi*180, [0 0 0]); + rotatematlab(h, [thvect+pi/2 0]/pi*180, (pi/2-phivect)/pi*180, [0 0 0]); + + x = get(h, 'xdata') + pos1(1); + y = get(h, 'ydata') + pos1(2); + z = get(h, 'zdata') + pos1(3); + + set(h, 'xdata', x); + set(h, 'ydata', y); + set(h, 'zdata', z); + return; + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/channelselection.m b/code/eeglab13_4_4b/plugins/dipfit2.3/channelselection.m new file mode 100644 index 0000000..5cd4567 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/channelselection.m @@ -0,0 +1,310 @@ +function [channel] = channelselection(channel, datachannel) + +% CHANNELSELECTION for EEG and MEG labels +% +% This function translates the user-specified list of channels into channel +% labels as they occur in the data. This channel selection procedure can +% be used throughout fieldtrip. +% +% You can specify a mixture of real channel labels and of special strings, +% or index numbers that will be replaced by the corresponding channel +% labels. Channels that are not present in the raw datafile are +% automatically removed from the channel list. +% +% E.g. +% 'gui' a graphical user interface will pop up to select the channels +% 'all' is replaced by all channels in the datafile +% 'MEG' is replaced by all channels in the CTF datafile starting with 'M' +% 'EEG' is replaced by all channels in the CTF datafile starting with 'EEG' +% 'EEG1020' is replaced by 'Fp1', 'Fpz', 'Fp2', 'F7', 'F3', ... +% 'EOG' is replaced by all recognized EOG channels +% 'EMG' is replaced by all channels in the datafile starting with 'EMG' +% 'lfp' is replaced by all channels in the datafile starting with 'lfp' +% 'mua' is replaced by all channels in the datafile starting with 'mua' +% 'spike' is replaced by all channels in the datafile starting with 'spike' +% 10 is replaced by the 10th channel in the datafile +% +% Other channel groups are +% 'EEG1010' with approximately 90 electrodes +% 'EEG1005' with approximately 350 electrodes +% 'EEGCHWILLA' for Dorothee Chwilla's electrode caps (used at the NICI) +% 'EEGBHAM' for the 128 channel EEG system used in Birmingham +% 'EEGREF' for mastoid and ear electrodes (M1, M2, LM, RM, A1, A2) +% 'MZ' for MEG central +% 'ML' for MEG left +% 'MR' for MEG right +% 'MLx', 'MRx' and 'MZx' with x=C,F,O,P,T for left/right central, frontal, +% occipital, parietal and temporal +% +% You can also exclude channels or channel groups using the following syntax +% {'all', '-POz', '-Fp1', -EOG'} + +% Copyright (C) 2003-2007, Robert Oostenveld +% +% $Log: channelselection.m,v $ +% Revision 1.1 2009/01/30 04:02:01 arno +% *** empty log message *** +% +% Revision 1.19 2007/05/30 13:22:01 roboos +% concatenate indices as column instead of row vector +% +% Revision 1.18 2007/01/22 10:32:28 roboos +% added 'gui' option for graphical user interface, thanks to Vladimir +% +% Revision 1.17 2006/06/06 16:28:54 ingnie +% added option channel is numeric; channel index replaced by channel name +% +% Revision 1.16 2006/05/03 15:08:56 roboos +% already remove double channels prior to the translation of the channel groups +% +% Revision 1.15 2006/03/23 22:26:18 roboos +% added channel groups for lfp, mua and spike +% +% Revision 1.14 2005/12/16 14:03:20 roboos +% added two VEOG channels +% added the EEGBHAM channel group +% +% Revision 1.13 2005/09/14 12:32:24 roboos +% small change in help +% +% Revision 1.12 2005/05/23 09:33:43 roboos +% return immediately if input is empty +% +% Revision 1.11 2004/10/22 16:10:07 roboos +% replaced all occurences of strmatch with strncmp, which runs much faster +% +% Revision 1.10 2004/03/10 15:03:08 roberto +% made selection of EOG channels more general +% +% Revision 1.9 2004/02/24 17:21:34 roberto +% slightly different implementation to undo the channel name sorting +% +% Revision 1.8 2004/02/24 16:53:44 roberto +% added 2 lines that unbdo the alphabetical sorting, the labels are now +% sorted according to their occurence in the data +% +% Revision 1.7 2004/01/26 11:54:47 roberto +% fixed recursion bug in bad channels +% added a line to remove double occurences of channels +% +% Revision 1.6 2004/01/22 21:41:12 roberto +% added support for excluding bad channels or channel groups +% +% Revision 1.5 2004/01/15 17:01:35 roberto +% added channel groups for MZx, with x=f,c,p,o +% +% Revision 1.4 2004/01/09 15:17:33 roberto +% added EEGCHWILLA as channel group (for NICI/Eric Maris) +% added LM and RM to to reference electrodes +% +% Revision 1.3 2003/12/08 12:32:10 roberto +% added 2 channels for eog +% +% Revision 1.2 2003/11/12 07:50:14 roberto +% added separate group for EEG reference electrodes (mastoid, ear) +% +% Revision 1.1 2003/10/28 15:09:27 roberto +% previously known under misc/translate_channel_list.m +% added label to EOG group +% +% Revision 1.2 2003/09/11 21:55:32 roberto +% added labels for 10-10 and for 10-5 (5%) electrode system +% +% Revision 1.1 2003/06/16 15:32:58 roberto +% new implementation, starting from code in preprocessing +% + +if any(size(channel) == 0) + % there is nothing to do if it is empty + return +end + +if isnumeric(channel) + % change index into channelname + channel = datachannel(channel); + return +end + +if ~iscell(channel) + % ensure that a single input argument like 'all' also works + channel = {channel}; +end + +% ensure that both inputs are column vectors +channel = channel(:); +datachannel = datachannel(:); + +% remove channels that occur more than once, this sorts the channels alphabetically +[channel, indx] = unique(channel); +% undo the sorting, make the order identical to that of the data channels +[dum, indx] = sort(indx); +channel = channel(indx); + +% define the known groups with channel labels +labelall = datachannel; +label1020 = {'Fp1', 'Fpz', 'Fp2', 'F7', 'F3', 'Fz', 'F4', 'F8', 'T7', 'C3', 'Cz', 'C4', 'T8', 'P7', 'P3', 'Pz', 'P4', 'P8', 'O1', 'Oz', 'O2'}'; +label1010 = {'Fp1', 'Fpz', 'Fp2', 'AF9', 'AF7', 'AF5', 'AF3', 'AF1', 'AFz', 'AF2', 'AF4', 'AF6', 'AF8', 'AF10', 'F9', 'F7', 'F5', 'F3', 'F1', 'Fz', 'F2', 'F4', 'F6', 'F8', 'F10', 'FT9', 'FT7', 'FC5', 'FC3', 'FC1', 'FCz', 'FC2', 'FC4', 'FC6', 'FT8', 'FT10', 'T9', 'T7', 'C5', 'C3', 'C1', 'Cz', 'C2', 'C4', 'C6', 'T8', 'T10', 'TP9', 'TP7', 'CP5', 'CP3', 'CP1', 'CPz', 'CP2', 'CP4', 'CP6', 'TP8', 'TP10', 'P9', 'P7', 'P5', 'P3', 'P1', 'Pz', 'P2', 'P4', 'P6', 'P8', 'P10', 'PO9', 'PO7', 'PO5', 'PO3', 'PO1', 'POz', 'PO2', 'PO4', 'PO6', 'PO8', 'PO10', 'O1', 'Oz', 'O2', 'I1', 'Iz', 'I2'}'; +label1005 = {'Fp1', 'Fpz', 'Fp2', 'AF9', 'AF7', 'AF5', 'AF3', 'AF1', 'AFz', 'AF2', 'AF4', 'AF6', 'AF8', 'AF10', 'F9', 'F7', 'F5', 'F3', 'F1', 'Fz', 'F2', 'F4', 'F6', 'F8', 'F10', 'FT9', 'FT7', 'FC5', 'FC3', 'FC1', 'FCz', 'FC2', 'FC4', 'FC6', 'FT8', 'FT10', 'T9', 'T7', 'C5', 'C3', 'C1', 'Cz', 'C2', 'C4', 'C6', 'T8', 'T10', 'TP9', 'TP7', 'CP5', 'CP3', 'CP1', 'CPz', 'CP2', 'CP4', 'CP6', 'TP8', 'TP10', 'P9', 'P7', 'P5', 'P3', 'P1', 'Pz', 'P2', 'P4', 'P6', 'P8', 'P10', 'PO9', 'PO7', 'PO5', 'PO3', 'PO1', 'POz', 'PO2', 'PO4', 'PO6', 'PO8', 'PO10', 'O1', 'Oz', 'O2', 'I1', 'Iz', 'I2', 'AFp9h', 'AFp7h', 'AFp5h', 'AFp3h', 'AFp1h', 'AFp2h', 'AFp4h', 'AFp6h', 'AFp8h', 'AFp10h', 'AFF9h', 'AFF7h', 'AFF5h', 'AFF3h', 'AFF1h', 'AFF2h', 'AFF4h', 'AFF6h', 'AFF8h', 'AFF10h', 'FFT9h', 'FFT7h', 'FFC5h', 'FFC3h', 'FFC1h', 'FFC2h', 'FFC4h', 'FFC6h', 'FFT8h', 'FFT10h', 'FTT9h', 'FTT7h', 'FCC5h', 'FCC3h', 'FCC1h', 'FCC2h', 'FCC4h', 'FCC6h', 'FTT8h', 'FTT10h', 'TTP9h', 'TTP7h', 'CCP5h', 'CCP3h', 'CCP1h', 'CCP2h', 'CCP4h', 'CCP6h', 'TTP8h', 'TTP10h', 'TPP9h', 'TPP7h', 'CPP5h', 'CPP3h', 'CPP1h', 'CPP2h', 'CPP4h', 'CPP6h', 'TPP8h', 'TPP10h', 'PPO9h', 'PPO7h', 'PPO5h', 'PPO3h', 'PPO1h', 'PPO2h', 'PPO4h', 'PPO6h', 'PPO8h', 'PPO10h', 'POO9h', 'POO7h', 'POO5h', 'POO3h', 'POO1h', 'POO2h', 'POO4h', 'POO6h', 'POO8h', 'POO10h', 'OI1h', 'OI2h', 'Fp1h', 'Fp2h', 'AF9h', 'AF7h', 'AF5h', 'AF3h', 'AF1h', 'AF2h', 'AF4h', 'AF6h', 'AF8h', 'AF10h', 'F9h', 'F7h', 'F5h', 'F3h', 'F1h', 'F2h', 'F4h', 'F6h', 'F8h', 'F10h', 'FT9h', 'FT7h', 'FC5h', 'FC3h', 'FC1h', 'FC2h', 'FC4h', 'FC6h', 'FT8h', 'FT10h', 'T9h', 'T7h', 'C5h', 'C3h', 'C1h', 'C2h', 'C4h', 'C6h', 'T8h', 'T10h', 'TP9h', 'TP7h', 'CP5h', 'CP3h', 'CP1h', 'CP2h', 'CP4h', 'CP6h', 'TP8h', 'TP10h', 'P9h', 'P7h', 'P5h', 'P3h', 'P1h', 'P2h', 'P4h', 'P6h', 'P8h', 'P10h', 'PO9h', 'PO7h', 'PO5h', 'PO3h', 'PO1h', 'PO2h', 'PO4h', 'PO6h', 'PO8h', 'PO10h', 'O1h', 'O2h', 'I1h', 'I2h', 'AFp9', 'AFp7', 'AFp5', 'AFp3', 'AFp1', 'AFpz', 'AFp2', 'AFp4', 'AFp6', 'AFp8', 'AFp10', 'AFF9', 'AFF7', 'AFF5', 'AFF3', 'AFF1', 'AFFz', 'AFF2', 'AFF4', 'AFF6', 'AFF8', 'AFF10', 'FFT9', 'FFT7', 'FFC5', 'FFC3', 'FFC1', 'FFCz', 'FFC2', 'FFC4', 'FFC6', 'FFT8', 'FFT10', 'FTT9', 'FTT7', 'FCC5', 'FCC3', 'FCC1', 'FCCz', 'FCC2', 'FCC4', 'FCC6', 'FTT8', 'FTT10', 'TTP9', 'TTP7', 'CCP5', 'CCP3', 'CCP1', 'CCPz', 'CCP2', 'CCP4', 'CCP6', 'TTP8', 'TTP10', 'TPP9', 'TPP7', 'CPP5', 'CPP3', 'CPP1', 'CPPz', 'CPP2', 'CPP4', 'CPP6', 'TPP8', 'TPP10', 'PPO9', 'PPO7', 'PPO5', 'PPO3', 'PPO1', 'PPOz', 'PPO2', 'PPO4', 'PPO6', 'PPO8', 'PPO10', 'POO9', 'POO7', 'POO5', 'POO3', 'POO1', 'POOz', 'POO2', 'POO4', 'POO6', 'POO8', 'POO10', 'OI1', 'OIz', 'OI2'}'; +labelchwilla = {'Fz', 'Cz', 'Pz', 'F7', 'F8', 'LAT', 'RAT', 'LT', 'RT', 'LTP', 'RTP', 'OL', 'OR', 'FzA', 'Oz', 'F7A', 'F8A', 'F3A', 'F4A', 'F3', 'F4', 'P3', 'P4', 'T5', 'T6', 'P3P', 'P4P'}'; +labelbham = {'P9', 'PPO9h', 'PO7', 'PPO5h', 'PPO3h', 'PO5h', 'POO9h', 'PO9', 'I1', 'OI1h', 'O1', 'POO1', 'PO3h', 'PPO1h', 'PPO2h', 'POz', 'Oz', 'Iz', 'I2', 'OI2h', 'O2', 'POO2', 'PO4h', 'PPO4h', 'PO6h', 'POO10h', 'PO10', 'PO8', 'PPO6h', 'PPO10h', 'P10', 'P8', 'TPP9h', 'TP7', 'TTP7h', 'CP5', 'TPP7h', 'P7', 'P5', 'CPP5h', 'CCP5h', 'CP3', 'P3', 'CPP3h', 'CCP3h', 'CP1', 'P1', 'Pz', 'CPP1h', 'CPz', 'CPP2h', 'P2', 'CPP4h', 'CP2', 'CCP4h', 'CP4', 'P4', 'P6', 'CPP6h', 'CCP6h', 'CP6', 'TPP8h', 'TP8', 'TPP10h', 'T7', 'FTT7h', 'FT7', 'FC5', 'FCC5h', 'C5', 'C3', 'FCC3h', 'FC3', 'FC1', 'C1', 'CCP1h', 'Cz', 'FCC1h', 'FCz', 'FFC1h', 'Fz', 'FFC2h', 'FC2', 'FCC2h', 'CCP2h', 'C2', 'C4', 'FCC4h', 'FC4', 'FC6', 'FCC6h', 'C6', 'TTP8h', 'T8', 'FTT8h', 'FT8', 'FT9', 'FFT9h', 'F7', 'FFT7h', 'FFC5h', 'F5', 'AFF7h', 'AF7', 'AF5h', 'AFF5h', 'F3', 'FFC3h', 'F1', 'AF3h', 'Fp1', 'Fpz', 'Fp2', 'AFz', 'AF4h', 'F2', 'FFC4h', 'F4', 'AFF6h', 'AF6h', 'AF8', 'AFF8h', 'F6', 'FFC6h', 'FFT8h', 'F8', 'FFT10h', 'FT10'}; +labelref = {'M1', 'M2', 'LM', 'RM', 'A1', 'A2'}'; +labeleog = datachannel(strncmp('EOG', datachannel, length('EOG'))); % anything that starts with EOG +labeleog = {labeleog{:} 'HEOG', 'VEOG', 'VEOG-L', 'VEOG-R'}'; % or any of these +labelemg = datachannel(strncmp('EMG', datachannel, length('EMG'))); +labeleeg = datachannel(strncmp('EEG', datachannel, length('EEG'))); +labelmeg = datachannel(strncmp('M' , datachannel, length('M' ))); % all MEG channels start with "M" +labelmz = datachannel(strncmp('MZ' , datachannel, length('MZ' ))); % central MEG channels +labelml = datachannel(strncmp('ML' , datachannel, length('ML' ))); % left MEG channels +labelmr = datachannel(strncmp('MR' , datachannel, length('MR' ))); % right MEG channels +labelmlc = datachannel(strncmp('MLC', datachannel, length('MLC'))); +labelmlf = datachannel(strncmp('MLF', datachannel, length('MLF'))); +labelmlo = datachannel(strncmp('MLO', datachannel, length('MLO'))); +labelmlp = datachannel(strncmp('MLP', datachannel, length('MLP'))); +labelmlt = datachannel(strncmp('MLT', datachannel, length('MLT'))); +labelmrc = datachannel(strncmp('MRC', datachannel, length('MRC'))); +labelmrf = datachannel(strncmp('MRF', datachannel, length('MRF'))); +labelmro = datachannel(strncmp('MRO', datachannel, length('MRO'))); +labelmrp = datachannel(strncmp('MRP', datachannel, length('MRP'))); +labelmrt = datachannel(strncmp('MRT', datachannel, length('MRT'))); +labelmzc = datachannel(strncmp('MZC', datachannel, length('MZC'))); +labelmzf = datachannel(strncmp('MZF', datachannel, length('MZF'))); +labelmzo = datachannel(strncmp('MZO', datachannel, length('MZO'))); +labelmzp = datachannel(strncmp('MZP', datachannel, length('MZP'))); +labellfp = datachannel(strncmp('lfp', datachannel, length('lfp'))); +labelmua = datachannel(strncmp('mua', datachannel, length('mua'))); +labelspike = datachannel(strncmp('spike', datachannel, length('spike'))); + +% figure out if there are bad channels or channel groups that should be excluded +findbadchannel = strncmp('-', channel, length('-')); % bad channels start with '-' +badchannel = channel(findbadchannel); +if ~isempty(badchannel) + for i=1:length(badchannel) + badchannel{i} = badchannel{i}(2:end); % remove the '-' from the channel label + end + badchannel = channelselection(badchannel, datachannel); % support exclusion of channel groups + channel(findbadchannel) = []; % remove them from the channels to be processed +end + +% determine if any of the known groups is mentioned in the channel list +findall = find(strcmp(channel, 'all')); +findmeg = find(strcmp(channel, 'MEG')); +findemg = find(strcmp(channel, 'EMG')); +findeeg = find(strcmp(channel, 'EEG')); +findeeg1020 = find(strcmp(channel, 'EEG1020')); +findeeg1010 = find(strcmp(channel, 'EEG1010')); +findeeg1005 = find(strcmp(channel, 'EEG1005')); +findeegchwilla = find(strcmp(channel, 'EEGCHWILLA')); +findeegbham = find(strcmp(channel, 'EEGBHAM')); +findeegref = find(strcmp(channel, 'EEGREF')); +findeog = find(strcmp(channel, 'EOG')); +findmz = find(strcmp(channel, 'MZ' )); +findml = find(strcmp(channel, 'ML' )); +findmr = find(strcmp(channel, 'MR' )); +findmlc = find(strcmp(channel, 'MLC')); +findmlf = find(strcmp(channel, 'MLF')); +findmlo = find(strcmp(channel, 'MLO')); +findmlp = find(strcmp(channel, 'MLP')); +findmlt = find(strcmp(channel, 'MLT')); +findmrc = find(strcmp(channel, 'MRC')); +findmrf = find(strcmp(channel, 'MRF')); +findmro = find(strcmp(channel, 'MRO')); +findmrp = find(strcmp(channel, 'MRP')); +findmrt = find(strcmp(channel, 'MRT')); +findmzc = find(strcmp(channel, 'MZC')); +findmzf = find(strcmp(channel, 'MZF')); +findmzo = find(strcmp(channel, 'MZO')); +findmzp = find(strcmp(channel, 'MZP')); +findlfp = find(strcmp(channel, 'lfp')); +findmua = find(strcmp(channel, 'mua')); +findspike = find(strcmp(channel, 'spike')); +findgui = find(strcmp(channel, 'gui')); + +% remove any occurences of groups in the channel list +channel([ + findall + findmeg + findemg + findeeg + findeeg1020 + findeeg1010 + findeeg1005 + findeegchwilla + findeegbham + findeegref + findeog + findmz + findml + findmr + findmlc + findmlf + findmlo + findmlp + findmlt + findmrc + findmrf + findmro + findmrp + findmrt + findmzc + findmzf + findmzo + findmzp + findlfp + findmua + findspike + findgui +]) = []; + +% add the full channel labels to the channel list +if findall, channel = [channel; labelall]; end +if findmeg, channel = [channel; labelmeg]; end +if findemg, channel = [channel; labelemg]; end +if findeeg, channel = [channel; labeleeg]; end +if findeeg1020, channel = [channel; label1020]; end +if findeeg1010, channel = [channel; label1010]; end +if findeeg1005, channel = [channel; label1005]; end +if findeegchwilla, channel = [channel; labelchwilla]; end +if findeegbham, channel = [channel; labelbham]; end +if findeegref, channel = [channel; labelref]; end +if findeog, channel = [channel; labeleog]; end +if findmz , channel = [channel; labelmz ]; end +if findml , channel = [channel; labelml ]; end +if findmr , channel = [channel; labelmr ]; end +if findmlc, channel = [channel; labelmlc]; end +if findmlf, channel = [channel; labelmlf]; end +if findmlo, channel = [channel; labelmlo]; end +if findmlp, channel = [channel; labelmlp]; end +if findmlt, channel = [channel; labelmlt]; end +if findmrc, channel = [channel; labelmrc]; end +if findmrf, channel = [channel; labelmrf]; end +if findmro, channel = [channel; labelmro]; end +if findmrp, channel = [channel; labelmrp]; end +if findmrt, channel = [channel; labelmrt]; end +if findmzc, channel = [channel; labelmzc]; end +if findmzf, channel = [channel; labelmzf]; end +if findmzo, channel = [channel; labelmzo]; end +if findmzp, channel = [channel; labelmzp]; end +if findlfp, channel = [channel; labellfp]; end +if findmua, channel = [channel; labelmua]; end +if findspike, channel = [channel; labelspike]; end + +% remove channel labels that have been excluded by the user +badindx = match_str(channel, badchannel); +channel(badindx) = []; + +% remove channel labels that are not present in the data +chanindx = match_str(channel, datachannel); + +channel = channel(chanindx); + +if findgui + indx = select_channel_list(datachannel, match_str(datachannel, channel), 'Select channels'); + channel = datachannel(indx); +end + +% remove channels that occur more than once, this sorts the channels alphabetically +[channel, indx] = unique(channel); + +% undo the sorting, make the order identical to that of the data channels +[dum, indx] = sort(indx); +channel = channel(indx); diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_1_to_2.m b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_1_to_2.m new file mode 100644 index 0000000..e944118 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_1_to_2.m @@ -0,0 +1,60 @@ +% dipfit_1_to_2() - convert dipfit 1 structure to dipfit 2 structure. +% +% Usage: +% >> EEG.dipfit = dipfit_1_to_2(EEG.dipfit); +% +% Note: +% For non-standard BESA models (where the radii or the conductances +% have been modified, users must create a new model in Dipfit2 from +% the default BESA model. +% +% Author: Arnaud Delorme, SCCN, La Jolla 2005 + +% Copyright (C) Arnaud Delorme, SCCN, La Jolla 2005 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function newdipfit = dipfit_1_to_2( dipfit ); + + if isfield( dipfit, 'model') + newdipfit.model = dipfit.model; + end; + if isfield( dipfit, 'chansel') + newdipfit.chansel = dipfit.chansel; + end; + + ind = 1; % use first template (BESA) + newdipfit.coordformat = template_models(ind).coordformat; + newdipfit.mrifile = template_models(ind).mrifile; + newdipfit.chanfile = template_models(ind).chanfile; + + if ~isfield(dipfit, 'vol') + newdipfit.hdmfile = template_models(ind).hdmfile; + else + newdipfit.vol = dipfit.vol; + + %if length(dipfit.vol) == 4 + %if ~all(dipfit.vol == [85-6-7-1 85-6-7 85-6 85]) | ... + % ~all(dipfit.c == [0.33 1.00 0.0042 0.33]) | ... + % ~all(dipfit.o = [0 0 0]) + % disp('Warning: Conversion from dipfit 1 to dipfit 2 can only deal'); + % disp(' with standard (not modified) BESA model'); + % disp(' See "help dipfit_1_to_2" to convert this model'); + % newdipfit = []; + %end; + %end; + end; + + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_erpeeg.m b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_erpeeg.m new file mode 100644 index 0000000..3fe7fb7 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_erpeeg.m @@ -0,0 +1,94 @@ +% dipfit_erpeeg - fit multiple component dipoles using DIPFIT +% +% Usage: +% >> [ dipole model EEG] = dipfit_erpeeg(data, chanlocs, 'key', 'val', ...); +% +% Inputs: +% data - input data [channel x point]. One dipole per point is +% returned. +% chanlocs - channel location structure (returned by readlocs()). +% +% Optional inputs: +% 'settings' - [cell array] dipfit settings (arguments to the +% pop_dipfit_settings() function). Default is none. +% 'dipoles' - [1|2] use either 1 dipole or 2 dipoles contrain in +% symetry. Default is 1. +% 'dipplot' - ['on'|'off'] plot dipoles. Default is 'off'. +% 'plotopt' - [cell array] dipplot() 'key', 'val' options. Default is +% 'normlen', 'on', 'image', 'fullmri' +% +% Outputs: +% dipole - dipole structure ('posxyz' field is the position; 'momxyz' +% field is the moment and 'rv' the residual variance) +% model - structure containing model information ('vol.r' field is +% radius, 'vol.c' conductances, 'vol.o' the 3-D origin and +% 'chansel', the selected channels). +% EEG - faked EEG structure containing erp activation at the place +% of ICA components but allowing to plot ERP dipoles. +% +% Note: residual variance is set to NaN if Dipfit does not converge +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, Nov. 2003 + +% Copyright (C) 10/2003 Arnaud Delorme, SCCN/INC/UCSD, arno@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [dipoles, model, EEG] = dipfit_erpeeg(DATA, chanlocs, varargin); + + if nargin < 1 + help dipfit_erpeeg; + return; + end; + + ncomps = size(DATA,2); + if size(DATA,1) ~= length(chanlocs) + error('# of row in ''DATA'' must equal # of channels in ''chanlocs'''); + end; + + % faking an EEG dataset + % --------------------- + EEG = eeg_emptyset; + EEG.data = rand(size(DATA,1), 1000); + EEG.nbchan = size(DATA,1); + EEG.pnts = 1000; + EEG.trials = 1; + EEG.chanlocs = chanlocs; + EEG.icawinv = [ DATA DATA ]; + EEG.icaweights = zeros(size([ DATA DATA ]))'; + EEG.icasphere = zeros(size(DATA,1), size(DATA,1)); + %EEG = eeg_checkset(EEG); + EEG.icaact = EEG.icaweights*EEG.icasphere*EEG.data(:,:); + EEG.icaact = reshape( EEG.icaact, size(EEG.icaact,1), size(EEG.data,2), size(EEG.data,3)); + + % uses mutlifit to fit dipoles + % ---------------------------- + EEG = pop_multifit(EEG, [1:ncomps], varargin{:}); + + % process outputs + % --------------- + dipoles = EEG.dipfit.model; + if isfield(dipoles, 'active') + dipoles = rmfield(dipoles, 'active'); + end; + if isfield(dipoles, 'select') + dipoles = rmfield(dipoles, 'select'); + end; + model = EEG.dipfit; + if isfield(model, 'model') + model = rmfield(model, 'model'); + end; + return; + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_gridsearch.m b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_gridsearch.m new file mode 100644 index 0000000..a630bb2 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_gridsearch.m @@ -0,0 +1,115 @@ +% dipfit_gridsearch() - do initial batch-like dipole scan and fit to all +% data components and return a dipole model with a +% single dipole for each component. +% +% Usage: +% >> EEGOUT = dipfit_gridsearch( EEGIN, varargin) +% +% Inputs: +% ... +% +% Optional inputs: +% 'component' - vector with integers, ICA components to scan +% 'xgrid' - vector with floats, grid positions along x-axis +% 'ygrid' - vector with floats, grid positions along y-axis +% 'zgrid' - vector with floats, grid positions along z-axis +% +% Output: +% ... +% +% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003, load/save by +% Arnaud Delorme +% Thanks to Nicolas Robitaille for his help on the CTF MEG +% implementation + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@smi.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [EEGOUT] = dipfit_gridsearch(EEG, varargin) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% convert the optional arguments into a configuration structure that can be +% understood by FIELDTRIPs dipolefitting function +if nargin>2 + cfg = struct(varargin{:}); +else + help dipfit_gridsearch + return +end + +% specify the FieldTrip DIPOLEFITTING configuration +cfg.model = 'moving'; +cfg.gridsearch = 'yes'; +cfg.nonlinear = 'no'; +% add some additional settings from EEGLAB to the configuration +tmpchanlocs = EEG.chanlocs; +cfg.channel = { tmpchanlocs(EEG.dipfit.chansel).labels }; +if isfield(EEG.dipfit, 'vol') + cfg.vol = EEG.dipfit.vol; +elseif isfield(EEG.dipfit, 'hdmfile') + cfg.hdmfile = EEG.dipfit.hdmfile; +else + error('no head model in EEG.dipfit') +end +if isfield(EEG.dipfit, 'elecfile') & ~isempty(EEG.dipfit.elecfile) + cfg.elecfile = EEG.dipfit.elecfile; +end +if isfield(EEG.dipfit, 'gradfile') & ~isempty(EEG.dipfit.gradfile) + cfg.gradfile = EEG.dipfit.gradfile; +end + +% convert the EEGLAB data structure into a structure that looks as if it +% was computed using FIELDTRIPs componentanalysis function +comp = eeglab2fieldtrip(EEG, 'componentanalysis', 'dipfit'); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Added code to handle CTF data with multipleSphere head model % +% This code is copy-pasted in dipfit_gridSearch, dipfit_nonlinear % +% The flag .isMultiSphere is used by dipplot % +% Nicolas Robitaille, January 2007. % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%Do some trick to force fieldtrip to use the multiple sphere model +if strcmpi(EEG.dipfit.coordformat, 'CTF') + cfg = rmfield(cfg, 'channel'); + comp = rmfield(comp, 'elec'); + cfg.gradfile = EEG.dipfit.chanfile; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% END % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if ~isfield(cfg, 'component') + % default is to scan all components + cfg.component = 1:size(comp.topo,2); +end + +% for each component scan the whole brain with dipoles using FIELDTRIPs +% dipolefitting function +source = ft_dipolefitting(cfg, comp); + +% reformat the output dipole sources into EEGLABs data structure +for i=1:length(cfg.component) + EEG.dipfit.model(cfg.component(i)).posxyz = source.dip(i).pos; + EEG.dipfit.model(cfg.component(i)).momxyz = reshape(source.dip(i).mom, 3, length(source.dip(i).mom)/3)'; + EEG.dipfit.model(cfg.component(i)).rv = source.dip(i).rv; +end + +EEGOUT = EEG; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_nonlinear.m b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_nonlinear.m new file mode 100644 index 0000000..ce62f77 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_nonlinear.m @@ -0,0 +1,130 @@ +% dipfit_nonlinear() - perform nonlinear dipole fit on one of the components +% to improve the initial dipole model. Only selected dipoles +% will be fitted. +% +% Usage: +% >> EEGOUT = dipfit_nonlinear( EEGIN, optarg) +% +% Inputs: +% ... +% +% Optional inputs are specified in key/value pairs and can be: +% ... +% +% Output: +% ... +% +% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 +% Thanks to Nicolas Robitaille for his help on the CTF MEG +% implementation + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@smi.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [EEGOUT] = dipfit_nonlinear( EEG, varargin ) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% convert the optional arguments into a configuration structure that can be +% understood by FIELDTRIPs dipolefitting function +if nargin>2 + cfg = struct(varargin{:}); +else + help dipfit_nonlinear + return +end + +% specify the FieldTrip DIPOLEFITTING configuration +cfg.model = 'moving'; +cfg.gridsearch = 'no'; +if ~isfield(cfg, 'nonlinear') + % if this flag is set to 'no', only the dipole moment will be fitted + cfg.nonlinear = 'yes'; +end +% add some additional settings from EEGLAB to the configuration +tmpchanlocs = EEG.chanlocs; +cfg.channel = { tmpchanlocs(EEG.dipfit.chansel).labels }; +if isfield(EEG.dipfit, 'vol') + cfg.vol = EEG.dipfit.vol; +elseif isfield(EEG.dipfit, 'hdmfile') + cfg.hdmfile = EEG.dipfit.hdmfile; +else + error('no head model in EEG.dipfit') +end + +if isfield(EEG.dipfit, 'elecfile') & ~isempty(EEG.dipfit.elecfile) + cfg.elecfile = EEG.dipfit.elecfile; +end +if isfield(EEG.dipfit, 'gradfile') & ~isempty(EEG.dipfit.gradfile) + cfg.gradfile = EEG.dipfit.gradfile; +end + +% set up the initial dipole model based on the one in the EEG structure +cfg.dip.pos = EEG.dipfit.model(cfg.component).posxyz; +cfg.dip.mom = EEG.dipfit.model(cfg.component).momxyz'; +cfg.dip.mom = cfg.dip.mom(:); + +% convert the EEGLAB data structure into a structure that looks as if it +% was computed using FIELDTRIPs componentanalysis function +comp = eeglab2fieldtrip(EEG, 'componentanalysis', 'dipfit'); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Added code to handle CTF data with multipleSphere head model % +% This code is copy-pasted in dipfit_gridSearch, dipfit_nonlinear % +% The flag .isMultiSphere is used by dipplot % +% Nicolas Robitaille, January 2007. % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%Do some trick to force fieldtrip to use the multiple sphere model +if strcmpi(EEG.dipfit.coordformat, 'CTF') + cfg = rmfield(cfg, 'channel'); + comp = rmfield(comp, 'elec'); + cfg.gradfile = EEG.dipfit.chanfile; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% END % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% fit the dipoles to the ICA component(s) of interest using FIELDTRIPs +% dipolefitting function + +currentPath = pwd; +ptmp = which('ft_prepare_vol_sens'); +ptmp = fileparts(ptmp); +if isempty(ptmp), error('Path to "forward" folder of Fieldtrip missing'); end; +cd(fullfile(ptmp, 'private')); +try, + source = ft_dipolefitting(cfg, comp); +catch, + cd(currentPath); + lasterr + error(lasterr); +end; +cd(currentPath); + +% reformat the output dipole sources into EEGLABs data structure +EEG.dipfit.model(cfg.component).posxyz = source.dip.pos; +EEG.dipfit.model(cfg.component).momxyz = reshape(source.dip.mom, 3, length(source.dip.mom)/3)'; +EEG.dipfit.model(cfg.component).diffmap = source.Vmodel - source.Vdata; +EEG.dipfit.model(cfg.component).sourcepot = source.Vmodel; +EEG.dipfit.model(cfg.component).datapot = source.Vdata; +EEG.dipfit.model(cfg.component).rv = source.dip.rv; +%EEG.dipfit.model(cfg.component).rv = sum((source.Vdata - source.Vmodel).^2) / sum( source.Vdata.^2 ); + +EEGOUT = EEG; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_reject.m b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_reject.m new file mode 100644 index 0000000..7dda497 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfit_reject.m @@ -0,0 +1,54 @@ +% dipfit_reject() - remove dipole models with a poor fit +% +% Usage: +% >> dipout = dipfit_reject( model, reject ) +% +% Inputs: +% model struct array with a dipole model for each component +% +% Outputs: +% dipout struct array with a dipole model for each component +% +% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl/ + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@miba.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [dipout] = dipfit_reject(model, reject) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin < 1 + help dipfit_reject; + return; +end; + +for i=1:length(model) + if model(i).rv>reject + % reject this dipole model by replacing it by an empty model + dipout(i).posxyz = []; + dipout(i).momxyz = []; + dipout(i).rv = 1; + else + dipout(i).posxyz = model(i).posxyz; + dipout(i).momxyz = model(i).momxyz; + dipout(i).rv = model(i).rv; + end +end + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/dipfitdefs.m b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfitdefs.m new file mode 100644 index 0000000..bfeace5 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/dipfitdefs.m @@ -0,0 +1,153 @@ +% dipfitdefs() - default settings and filenames for dipolefitting +% to source in the ICA/ERP package functions. +% Insert local dir reference below. +% +% Note: Edit this file to change local directories under Unix and Windows +% +% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@miba.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% this file is not a function but a script and is included in the dipfit_XXX functions +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +try, + if ~isfield(EEG, 'chanlocs') + error('No electrode locations defined'); + end + + if ~isfield(EEG, 'icawinv') + error('No ICA components present'); + end + nchan = length(EEG(1).chanlocs); + ncomp = size(EEG(1).icawinv, 2); +catch, nchan = 0; end; + +% create one-sphere model +% defaultvolume.r = meanradius; +% defaultvolume.c = 0.33http://www.google.com/; +% defaultvolume.o = [0 0 0]; + +% create three-sphere model +% defaultvolume.r = meanradius * [0.0 0.92 0.88]; +% defaultvolume.c = [0.33 0.0042 0.33]; +% defaultvolume.o = [0 0 0]; + +% create four-sphere model that is identical to the default of besa +defaultvolume.r = [85-6-7-1 85-6-7 85-6 85]; % in mm +defaultvolume.c = [0.33 1.00 0.0042 0.33]; % brain/csf/skull/skin +defaultvolume.o = [0 0 0]; + +% default file locations +% ---------------------- +if ~iseeglabdeployed + folder = which('pop_dipfit_settings'); + folder = folder(1:end-21); +else + folder = eeglabexefolder; +end; +try, + delim = folder(end); + template_models(1).name = 'Spherical Four-Shell (BESA)'; + template_models(1).hdmfile = fullfile(folder, 'standard_BESA', 'standard_BESA.mat'); + template_models(1).mrifile = fullfile(folder, 'standard_BESA', 'avg152t1.mat'); + template_models(1).chanfile = fullfile(folder, 'standard_BESA', 'standard-10-5-cap385.elp'); + template_models(1).coordformat = 'spherical'; + template_models(1).coord_transform(1).transform = [ ]; + template_models(1).coord_transform(1).keywords = { 'standard-10-5-cap385' }; + template_models(1).coord_transform(2).transform = [ 13.4299 0.746361 -0.654923 0.000878113 -0.0818352 0.0023747 0.852832 0.941595 0.85887]; + template_models(1).coord_transform(2).keywords = { 'standard_1005' }; + template_models(1).coord_transform(3).transform = [ -0.254232 0 -8.4081 0 0.00272526 0 8.59463 -10.9643 10.4963 ]; + template_models(1).coord_transform(3).keywords = { 'gsn' 'sfp' }; + template_models(1).coord_transform(4).transform = [ 0 0 0 0 0.02 0 85 85 85 ]; + template_models(1).coord_transform(4).keywords = { 'egi' 'elp' }; + + template_models(2).name = 'Boundary Element Model (MNI)'; + template_models(2).hdmfile = fullfile(folder, 'standard_BEM', 'standard_vol.mat' ); + template_models(2).mrifile = fullfile(folder, 'standard_BEM', 'standard_mri.mat' ); + template_models(2).chanfile = fullfile(folder, 'standard_BEM', 'elec', 'standard_1005.elc' ); + template_models(2).coordformat = 'MNI'; + template_models(2).coord_transform(1).transform = [ 0 0 0 0 0 -pi/2 1 1 1]; + template_models(2).coord_transform(1).keywords = { 'standard_1005' }; + template_models(2).coord_transform(2).transform = [ 0.832146 -15.6287 2.41142 0.0812144 0.000937391 -1.5732 1.17419 1.06011 1.14846]; + template_models(2).coord_transform(2).keywords = { 'standard-10-5-cap385' }; + template_models(2).coord_transform(3).transform = [ 0.0547605 -17.3653 -8.13178 0.0755019 0.00318357 -1.56963 11.7138 12.7933 12.213 ]; + template_models(2).coord_transform(3).keywords = { 'gsn' 'sfp' }; + template_models(2).coord_transform(4).transform = [ 0 -15 0 0.08 0 -1.571 102 93 100 ]; + template_models(2).coord_transform(4).keywords = { 'egi' 'elp' }; + + template_models(3).name = 'Spherical Four-Shell (custom conductances - see DIPFIT wiki)'; + template_models(3).hdmfile = fullfile(folder, 'standard_BESA', 'standard_SCCN.mat'); + template_models(3).mrifile = fullfile(folder, 'standard_BESA', 'avg152t1.mat'); + template_models(3).chanfile = fullfile(folder, 'standard_BESA', 'standard-10-5-cap385.elp'); + template_models(3).coordformat = 'spherical'; + template_models(3).coord_transform(1).transform = [ ]; + template_models(3).coord_transform(1).keywords = { 'standard-10-5-cap385' }; + template_models(3).coord_transform(2).transform = [ 13.4299 0.746361 -0.654923 0.000878113 -0.0818352 0.0023747 0.852832 0.941595 0.85887]; + template_models(3).coord_transform(2).keywords = { 'standard_1005' }; + template_models(3).coord_transform(3).transform = [ -0.254232 0 -8.4081 0 0.00272526 0 8.59463 -10.9643 10.4963 ]; + template_models(3).coord_transform(3).keywords = { 'gsn' 'sfp' }; + template_models(3).coord_transform(4).transform = [ 0 0 0 0 0.02 0 85 85 85 ]; + template_models(3).coord_transform(4).keywords = { 'egi' 'elp' }; + + template_models(4).name = 'Boundary Element Model (custom conductances - see DIPFIT wiki)'; + template_models(4).hdmfile = fullfile(folder, 'standard_BEM', 'standard_vol_SCCN.mat' ); + template_models(4).mrifile = fullfile(folder, 'standard_BEM', 'standard_mri.mat' ); + template_models(4).chanfile = fullfile(folder, 'standard_BEM', 'elec', 'standard_1005.elc' ); + template_models(4).coordformat = 'MNI'; + template_models(4).coord_transform(1).transform = [ 0 0 0 0 0 -pi/2 1 1 1]; + template_models(4).coord_transform(1).keywords = { 'standard_1005' }; + template_models(4).coord_transform(2).transform = [ 0.832146 -15.6287 2.41142 0.0812144 0.000937391 -1.5732 1.17419 1.06011 1.14846]; + template_models(4).coord_transform(2).keywords = { 'standard-10-5-cap385' }; + template_models(4).coord_transform(3).transform = [ 0.0547605 -17.3653 -8.13178 0.0755019 0.00318357 -1.56963 11.7138 12.7933 12.213 ]; + template_models(4).coord_transform(3).keywords = { 'gsn' 'sfp' }; + template_models(4).coord_transform(4).transform = [ 0 -15 0 0.08 0 -1.571 102 93 100 ]; + template_models(4).coord_transform(4).keywords = { 'egi' 'elp' }; + +catch, + disp('Warning: problem when setting paths for dipole localization'); +end; + +template_models(5).name = 'CTF MEG'; +template_models(5).coordformat = 'CTF'; +template_models(6).name = 'Custom model files'; +template_models(6).coordformat = 'MNI'; % custom model + +% constrain electrode to sphere +% ----------------------------- +meanradius = defaultvolume.r(4); + +% defaults for GUI pop_dipfit_settings dialog +defaultelectrodes = sprintf('1:%d', nchan); + +% these settings determine the symmetry constraint that can be toggled on +% for the second dipole +%defaultconstraint = 'y'; % symmetry along x-axis +% PROBLEM: change with respect to the model used. Now just assume perpendicular to nose + +% defaults for GUI pop_dipfit_batch dialogs +rejectstr = '40'; % in percent +xgridstr = sprintf('linspace(-%d,%d,11)', floor(meanradius), floor(meanradius)); +ygridstr = sprintf('linspace(-%d,%d,11)', floor(meanradius), floor(meanradius)); +zgridstr = sprintf('linspace(0,%d,6)', floor(meanradius)); + +% Set DipoleDensity path +DIPOLEDENSITY_STDBEM = fullfile(folder, 'standard_BEM', 'standard_vol.mat'); diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/dipplot.m b/code/eeglab13_4_4b/plugins/dipfit2.3/dipplot.m new file mode 100644 index 0000000..b9306ab --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/dipplot.m @@ -0,0 +1,1281 @@ +% dipplot() - Visualize EEG equivalent-dipole locations and orientations +% in the MNI average MRI head or in the BESA spherical head model. +% Usage: +% >> dipplot( sources, 'key', 'val', ...); +% >> [sources X Y Z XE YE ZE] = dipplot( sources, 'key', 'val', ...); +% +% Inputs: +% sources - structure array of dipole information: can contain +% either BESA or DIPFIT dipole information. BESA dipole +% information are still supported but may disapear in the +% future. For DIPFIT +% sources.posxyz: contains 3-D location of dipole in each +% column. 2 rows indicate 2 dipoles. +% sources.momxyz: contains 3-D moments for dipoles above. +% sources.rv : residual variance from 0 to 1. +% other fields : used for graphic interface. +% +% Optional input: +% 'rvrange' - [min max] or [max] Only plot dipoles with residual variace +% within the given range. Default: plot all dipoles. +% 'summary' - ['on'|'off'|'3d'] Build a summary plot with three views (top, +% back, side). {default: 'off'} +% 'mri' - Matlab file containing an MRI volume and a 4-D transformation +% matrix to go from voxel space to electrode space: +% mri.anatomy contains a 3-D anatomical data array +% mri.transfrom contains a 4-D homogenous transformation matrix. +% 'coordformat' - ['MNI'|'spherical'] Consider that dipole coordinates are in +% MNI or spherical coordinates (for spherical, the radius of the +% head is assumed to be 85 (mm)). See also function sph2spm(). +% 'transform' - [real array] traditional transformation matrix to convert +% dipole coordinates to MNI space. Default is assumed from +% 'coordformat' input above. Type help traditional for more +% information. +% 'image' - ['besa'|'mri'] Background image. +% 'mri' (or 'fullmri') uses mean-MRI brain images from the Montreal +% Neurological Institute. This option can also contain a 3-D MRI +% volume (dim 1: left to right; dim 2: anterior-posterior; dim 3: +% superior-inferior). Use 'coregist' to coregister electrodes +% with the MRI. {default: 'mri'} +% 'verbose' - ['on'|'off'] comment on operations on command line {default: +% 'on'}. +% 'plot' - ['on'|'off'] only return outputs {default: 'off'}. +% +% Plotting options: +% 'color' - [cell array of color strings or (1,3) color arrays]. For +% exemple { 'b' 'g' [1 0 0] } gives blue, green and red. +% Dipole colors will rotate through the given colors if +% the number given is less than the number of dipoles to plot. +% A single number will be used as color index in the jet colormap. +% 'view' - 3-D viewing angle in cartesian coords., +% [0 0 1] gives a sagittal view, [0 -1 0] a view from the rear; +% [1 0 0] gives a view from the side of the head. +% 'mesh' - ['on'|'off'] Display spherical mesh. {Default is 'on'} +% 'meshdata' - [cell array|'file_name'] Mesh data in a cell array { 'vertices' +% data 'faces' data } or a boundary element model filename (the +% function will plot the 3rd mesh in the 'bnd' sub-structure). +% 'axistight' - ['on'|'off'] For MRI only, display the closest MRI +% slide. {Default is 'off'} +% 'gui' - ['on'|'off'] Display controls. {Default is 'on'} If gui 'off', +% a new figure is not created. Useful for incomporating a dipplot +% into a complex figure. +% 'num' - ['on'|'off'] Display component number. Take into account +% dipole size. {Default: 'off'} +% 'cornermri' - ['on'|'off'] force MRI images to the corner of the MRI volume +% (usefull when background is not black). Default: 'off'. +% 'drawedges' - ['on'|'off'] draw edges of the 3-D MRI (black in axistight, +% white otherwise.) Default is 'off'. +% 'projimg' - ['on'|'off'] Project dipole(s) onto the 2-D images, for use +% in making 3-D plots {Default 'off'} +% 'projlines' - ['on'|'off'] Plot lines connecting dipole with 2-D projection. +% Color is dashed black for BESA head and dashed black for the +% MNI brain {Default 'off'} +% 'projcol' - [color] color for the projected line {Default is same as dipole} +% 'dipolesize' - Size of the dipole sphere(s). This option may also contain one +% value per dipole {Default: 30} +% 'dipolelength' - Length of the dipole bar(s) {Default: 1} +% 'pointout' - ['on'|'off'] Point the dipoles outward. {Default: 'off'} +% 'sphere' - [float] radius of sphere corresponding to the skin. Default is 1. +% 'spheres' - ['on'|'off'] {default: 'off'} plot dipole markers as 3-D spheres. +% Does not yet interact with gui buttons, produces non-gui mode. +% 'spheresize' - [real>0] size of spheres (if 'on'). {default: 5} +% 'normlen' - ['on'|'off'] Normalize length of all dipoles. {Default: 'off'} +% 'dipnames' - [cell array] cell array of string with a name for each dipole (or +% pair of dipole). +% 'holdon' - ['on'|'off'] create a new dipplot figure or plot dipoles within an +% an existing figure. Default is 'off'. +% 'camera' - ['auto'|'set'] camera position. 'auto' is the default and +% an option using camera zoom. 'set' is a fixed view that +% does not depend on the content being plotted. +% +% Outputs: +% sources - EEG.source structure with two extra fiels 'mnicoord' and 'talcoord' +% containing the MNI and talairach coordinates of the dipoles. Note +% that for the BEM model, dipoles are already in MNI coordinates. +% X,Y,Z - Locations of dipole heads (Cartesian coordinates in MNI space). +% If there is more than one dipole per components, the last dipole +% is returned. +% XE,YE,ZE - Locations of dipole ends (Cartesian coordinates). The same +% remark as above applies. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 1st July 2002 +% +% Notes: See DIPFIT web tutorial at sccn.ucsd.edu/eeglab/dipfittut/dipfit.html +% for more details about MRI co-registration etc... +% +% Example: +% % define dipoles +% sources(1).posxyz = [-59 48 -28]; % position for the first dipole +% sources(1).momxyz = [ 0 58 -69]; % orientation for the first dipole +% sources(1).rv = 0.036; % residual variance for the first dipole +% sources(2).posxyz = [74 -4 -38]; % position for the second dipole +% sources(2).momxyz = [43 -38 -16]; % orientation for the second dipole +% sources(2).rv = 0.027; % residual variance for the second dipole +% +% % plot of the two dipoles (first in green, second in blue) +% dipplot( sources, 'color', { 'g' 'b' }); +% +% % To make a stereographic plot +% figure( 'position', [153 553 1067 421]; +% subplot(1,3,1); dipplot( sources, 'view', [43 10], 'gui', 'off'); +% subplot(1,3,3); dipplot( sources, 'view', [37 10], 'gui', 'off'); +% +% % To make a summary plot +% dipplot( sources, 'summary', 'on', 'num', 'on'); +% +% See also: eeglab(), dipfit() + +% old options +% ----------- +% 'std' - [cell array] plot standard deviation of dipoles. i.e. +% { [1:6] [7:12] } plot two elipsoids that best fit all the dipoles +% from 1 to 6 and 7 to 12 with radius 1 standard deviation. +% { { [1:6] 2 'linewidth' 2 } [7:12] } do the same but now the +% first elipsoid is 2 standard-dev and the lines are thicker. + +% Copyright (C) 2002 Arnaud Delorme +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% README -- Plotting strategy: +% - All buttons have a tag 'tmp' so they can be removed +% - The component-number buttons have 'userdata' equal to 'editor' and +% can be found easily by other buttons find('userdata', 'editor') +% - All dipoles have a tag 'dipoleX' (X=their number) and can be made +% visible/invisible +% - The gcf object 'userdat' field stores the handle of the dipole that +% is currently being modified +% - Gca 'userdata' stores imqge names and position + +function [outsources, XX, YY, ZZ, XO, YO, ZO] = dipplot( sourcesori, varargin ) + + DEFAULTVIEW = [0 0 1]; + + if nargin < 1 + help dipplot; + return; + end; + + % reading and testing arguments + % ----------------------------- + sources = sourcesori; + if ~isstruct(sources) + updatedipplot(sources(1)); + % sources countain the figure handler + return + end; + + % key type range default + g = finputcheck( varargin, { 'color' '' [] []; + 'axistight' 'string' { 'on' 'off' } 'off'; + 'camera' 'string' { 'auto' 'set' } 'auto'; + 'coordformat' 'string' { 'MNI' 'spherical' 'CTF' 'auto' } 'auto'; + 'drawedges' 'string' { 'on' 'off' } 'off'; + 'mesh' 'string' { 'on' 'off' } 'off'; + 'gui' 'string' { 'on' 'off' } 'on'; + 'summary' 'string' { 'on2' 'on' 'off' '3d' } 'off'; + 'verbose' 'string' { 'on' 'off' } 'on'; + 'view' 'real' [] [0 0 1]; + 'rvrange' 'real' [0 Inf] []; + 'transform' 'real' [0 Inf] []; + 'normlen' 'string' { 'on' 'off' } 'off'; + 'num' 'string' { 'on' 'off' } 'off'; + 'cornermri' 'string' { 'on' 'off' } 'off'; + 'mri' { 'string' 'struct' } [] ''; + 'dipnames' 'cell' [] {}; + 'projimg' 'string' { 'on' 'off' } 'off'; + 'projcol' '' [] []; + 'projlines' 'string' { 'on' 'off' } 'off'; + 'pointout' 'string' { 'on' 'off' } 'off'; + 'holdon' 'string' { 'on' 'off' } 'off'; + 'dipolesize' 'real' [0 Inf] 30; + 'dipolelength' 'real' [0 Inf] 1; + 'sphere' 'real' [0 Inf] 1; + 'spheres' 'string' {'on' 'off'} 'off'; + 'links' 'real' [] []; + 'image' { 'string' 'real' } [] 'mri'; + 'plot' 'string' { 'on' 'off' } 'on'; + 'meshdata' { 'string' 'cell' } [] '' }, 'dipplot'); + % 'std' 'cell' [] {}; + % 'coreg' 'real' [] []; + + if isstr(g), error(g); end; + if strcmpi(g.holdon, 'on'), g.gui = 'off'; end; + if length(g.dipolesize) == 1, g.dipolesize = repmat(g.dipolesize, [1 length(sourcesori)]); end; + + g.zoom = 1500; + + if strcmpi(g.image, 'besa') + error('BESA image not supported any more. Use EEGLAB version 4.512 or earlier. (BESA dipoles can still be plotted in MNI brain.)'); + end; + + % trying to determine coordformat + % ------------------------------- + if ~isfield(sources, 'momxyz') + g.coordformat = 'spherical'; + end; + if strcmpi(g.coordformat, 'auto') + if ~isempty(g.meshdata) + g.coordformat = 'MNI'; + if strcmpi(g.verbose, 'on'), + disp('Coordinate format unknown: using ''MNI'' since mesh data was provided as input'); + end + else + maxdiplen = 0; + for ind = 1:length(sourcesori) + maxdiplen = max(maxdiplen, max(abs(sourcesori(ind).momxyz(:)))); + end; + if maxdiplen>2000 + if strcmpi(g.verbose, 'on'), + disp('Coordinate format unknown: using ''MNI'' because of large dipole moments'); + end + else + g.coordformat = 'spherical'; + if strcmpi(g.verbose, 'on'), + disp('Coordinate format unknown: using ''spherical'' since no mesh data was provided as input'); + end + end; + end; + end; + + % axis image and limits + % --------------------- + dat.axistight = strcmpi(g.axistight, 'on'); + dat.drawedges = g.drawedges; + dat.cornermri = strcmpi(g.cornermri, 'on'); + radius = 85; + + % look up an MRI file if necessary + % -------------------------------- + if isempty(g.mri) + if strcmpi(g.verbose, 'on'), + disp('No MRI file given as input. Looking up one.'); + end + dipfitdefs; + g.mri = template_models(1).mrifile; + end; + + % read anatomical MRI using Fieldtrip and SPM2 functons + % ----------------------------------------------------- + if isstr(g.mri); + try, + g.mri = load('-mat', g.mri); + g.mri = g.mri.mri; + catch, + disp('Failed to read Matlab file. Attempt to read MRI file using function ft_read_mri'); + try, + warning off; + g.mri = ft_read_mri(g.mri); + %g.mri.anatomy(find(g.mri.anatomy > 255)) = 255; + %g.mri.anatomy = uint8(g.mri.anatomy); + g.mri.anatomy = round(gammacorrection( g.mri.anatomy, 0.8)); + g.mri.anatomy = uint8(round(g.mri.anatomy/max(reshape(g.mri.anatomy, prod(g.mri.dim),1))*255)); + % WARNING: if using double instead of int8, the scaling is different + % [-128 to 128 and 0 is not good] + % WARNING: the transform matrix is not 1, 1, 1 on the diagonal, some slices may be + % misplaced + warning on; + catch, + error('Cannot load file using ft_read_mri'); + end; + end; + end; + + if strcmpi(g.coordformat, 'spherical') + dat.sph2spm = sph2spm; + elseif strcmpi(g.coordformat, 'CTF') + dat.sph2spm = traditionaldipfit([0 0 0 0 0 0 10 -10 10]); + else + dat.sph2spm = []; %traditional([0 0 0 0 0 pi 1 1 1]); + end; + + if ~isempty(g.transform), dat.sph2spm = traditionaldipfit(g.transform); + end; + if isfield(g.mri, 'anatomycol') + dat.imgs = g.mri.anatomycol; + else + dat.imgs = g.mri.anatomy; + end; + dat.transform = g.mri.transform; + + % MRI coordinates for slices + % -------------------------- + if ~isfield(g.mri, 'xgrid') + g.mri.xgrid = [1:size(dat.imgs,1)]; + g.mri.ygrid = [1:size(dat.imgs,2)]; + g.mri.zgrid = [1:size(dat.imgs,3)]; + end; + if strcmpi(g.coordformat, 'CTF') + g.mri.zgrid = g.mri.zgrid(end:-1:1); + end; + + dat.imgcoords = { g.mri.xgrid g.mri.ygrid g.mri.zgrid }; + dat.maxcoord = [max(dat.imgcoords{1}) max(dat.imgcoords{2}) max(dat.imgcoords{3})]; + COLORMESH = 'w'; + BACKCOLOR = 'k'; + + % point 0 + % ------- + [xx yy zz] = transform(0, 0, 0, dat.sph2spm); % nothing happens for BEM since dat.sph2spm is empty + dat.zeroloc = [ xx yy zz ]; + + % conversion + % ---------- + if strcmpi(g.normlen, 'on') + if isfield(sources, 'besaextori') + sources = rmfield(sources, 'besaextori'); + end; + end; + if ~isfield(sources, 'besathloc') & strcmpi(g.image, 'besa') & ~is_sccn + error(['For copyright reasons, it is not possible to use the BESA ' ... + 'head model to plot non-BESA dipoles']); + end; + + if isfield(sources, 'besathloc') + sources = convertbesaoldformat(sources); + end; + if ~isfield(sources, 'posxyz') + sources = computexyzforbesa(sources); + end; + if ~isfield(sources, 'component') + if strcmpi(g.verbose, 'on'), + disp('No component indices, making incremental ones...'); + end + for index = 1:length(sources) + sources(index).component = index; + end; + end; + + % find non-empty sources + % ---------------------- + noempt = cellfun('isempty', { sources.posxyz } ); + sources = sources( find(~noempt) ); + + % transform coordinates + % --------------------- + outsources = sources; + for index = 1:length(sources) + sources(index).momxyz = sources(index).momxyz/1000; + end; + + % remove 0 second dipoles if any + % ------------------------------ + for index = 1:length(sources) + if size(sources(index).momxyz,1) == 2 + if all(sources(index).momxyz(2,:) == 0) + sources(index).momxyz = sources(index).momxyz(1,:); + sources(index).posxyz = sources(index).posxyz(1,:); + end; + end; + end; + + % remove sources with out of bound Residual variance + % -------------------------------------------------- + if isfield(sources, 'rv') & ~isempty(g.rvrange) + if length(g.rvrange) == 1, g.rvrange = [ 0 g.rvrange ]; end; + for index = length(sources):-1:1 + if sources(index).rv < g.rvrange(1)/100 | sources(index).rv > g.rvrange(2)/100 + sources(index) = []; + end; + end; + end; + + % color array + % ----------- + if isempty(g.color) + g.color = { 'g' 'b' 'r' 'm' 'c' 'y' }; + if strcmp(BACKCOLOR, 'w'), g.color = { g.color{:} 'k' }; end; + end; + g.color = g.color(mod(0:length(sources)-1, length(g.color)) +1); + if ~isempty(g.color) + g.color = strcol2real( g.color, jet(64) ); + end; + if ~isempty(g.projcol) + g.projcol = strcol2real( g.projcol, jet(64) ); + g.projcol = g.projcol(mod(0:length(sources)-1, length(g.projcol)) +1); + else + g.projcol = g.color; + for index = 1:length(g.color) + g.projcol{index} = g.projcol{index}/2; + end; + end; + + % build summarized figure + % ----------------------- + if strcmpi(g.summary, 'on') | strcmpi(g.summary, 'on2') + figure; + options = { 'gui', 'off', 'dipolesize', g.dipolesize/1.5,'dipolelength', g.dipolelength, 'sphere', g.sphere ... + 'color', g.color, 'mesh', g.mesh, 'num', g.num, 'image', g.image 'normlen' g.normlen ... + 'coordformat' g.coordformat 'mri' g.mri 'meshdata' g.meshdata 'axistight' g.axistight }; + pos1 = [0 0 0.5 0.5]; + pos2 = [0 0.5 0.5 .5]; + pos3 = [.5 .5 0.5 .5]; if strcmp(g.summary, 'on2'), tmp = pos1; pos1 =pos3; pos3 = tmp; end; + axes('position', pos1); newsources = dipplot(sourcesori, 'view', [1 0 0] , options{:}); axis off; + axes('position', pos2); newsources = dipplot(sourcesori, 'view', [0 0 1] , options{:}); axis off; + axes('position', pos3); newsources = dipplot(sourcesori, 'view', [0 -1 0], options{:}); axis off; + axes('position', [0.5 0 0.5 0.5]); + colorcount = 1; + if isfield(newsources, 'component') + for index = 1:length(newsources) + if isempty(g.dipnames), tmpname = sprintf( 'Comp. %d', newsources(index).component); + else tmpname = char(g.dipnames{index}); + end; + talpos = newsources(index).talcoord; + if strcmpi(g.coordformat, 'CTF') + textforgui(colorcount) = { sprintf( [ tmpname ' (RV:%3.2f%%)' ], 100*newsources(index).rv) }; + elseif size(talpos,1) == 1 + textforgui(colorcount) = { sprintf( [ tmpname ' (RV:%3.2f%%; Tal:%d,%d,%d)' ], ... + 100*newsources(index).rv, ... + round(talpos(1,1)), round(talpos(1,2)), round(talpos(1,3))) }; + else + textforgui(colorcount) = { sprintf( [ tmpname ' (RV:%3.2f%%; Tal:%d,%d,%d & %d,%d,%d)' ], ... + 100*newsources(index).rv, ... + round(talpos(1,1)), round(talpos(1,2)), round(talpos(1,3)), ... + round(talpos(2,1)), round(talpos(2,2)), round(talpos(2,3))) }; + end; + colorcount = colorcount+1; + end; + colorcount = colorcount-1; + allstr = strvcat(textforgui{:}); + h = text(0,0.45, allstr); + if colorcount >= 15, set(h, 'fontsize', 8);end; + if colorcount >= 20, set(h, 'fontsize', 6);end; + if strcmp(BACKCOLOR, 'k'), set(h, 'color', 'w'); end; + end; + axis off; + return; + elseif strcmpi(g.summary, '3d') + options = { 'gui', 'off', 'dipolesize', g.dipolesize/1.5,'dipolelength', g.dipolelength, 'sphere', g.sphere, 'spheres', g.spheres ... + 'color', g.color, 'mesh', g.mesh, 'num', g.num, 'image', g.image 'normlen' g.normlen ... + 'coordformat' g.coordformat 'mri' g.mri 'meshdata' g.meshdata 'axistight' g.axistight }; + figure('position', [ 100 600 600 200 ]); + axes('position', [-0.1 -0.1 1.2 1.2], 'color', 'k'); axis off; blackimg = zeros(10,10,3); image(blackimg); + axes('position', [0 0 1/3 1], 'tag', 'rear'); dipplot(sourcesori, options{:}, 'holdon', 'on'); view([0 -1 0]); + axes('position', [1/3 0 1/3 1], 'tag', 'top' ); dipplot(sourcesori, options{:}, 'holdon', 'on'); view([0 0 1]); + axes('position', [2/3 0 1/3 1], 'tag', 'side'); dipplot(sourcesori, options{:}, 'holdon', 'on'); view([1 -0.01 0]); + set(gcf, 'paperpositionmode', 'auto'); + return; + end; + + % plot head graph in 3D + % --------------------- + if strcmp(g.gui, 'on') + fig = figure('visible', g.plot); + pos = get(gca, 'position'); + set(gca, 'position', [pos(1)+0.05 pos(2:end)]); + end; + indx = ceil(dat.imgcoords{1}(end)/2); + indy = ceil(dat.imgcoords{2}(end)/2); + indz = ceil(dat.imgcoords{3}(end)/2); + if strcmpi(g.holdon, 'off') + plotimgs( dat, [indx indy indz], dat.transform); + + set(gca, 'color', BACKCOLOR); + %warning off; a = imread('besaside.pcx'); warning on; + % BECAUSE OF A BUG IN THE WARP FUNCTION, THIS DOES NOT WORK (11/02) + %hold on; warp([], wy, wz, a); + % set camera target + % ----------------- + + % format axis (BESA or MRI) + axis equal; + set(gca, 'cameraviewanglemode', 'manual'); % disable change size + camzoom(1.2^2); + if strcmpi(g.coordformat, 'CTF'), g.view(2:3) = -g.view(2:3); end; + view(g.view); + %set(gca, 'cameratarget', dat.zeroloc); % disable change size + %set(gca, 'cameraposition', dat.zeroloc+g.view*g.zoom); % disable change size + axis off; + end; + + % plot sphere mesh and nose + % ------------------------- + if strcmpi(g.holdon, 'off') + if isempty(g.meshdata) + SPHEREGRAIN = 20; % 20 is also Matlab default + [x y z] = sphere(SPHEREGRAIN); + hold on; + [xx yy zz] = transform(x*0.085, y*0.085, z*0.085, dat.sph2spm); + [xx yy zz] = transform(x*85 , y*85 , z*85 , dat.sph2spm); + %xx = x*100; + %yy = y*100; + %zz = z*100; + if strcmpi(COLORMESH, 'w') + hh = mesh(xx, yy, zz, 'cdata', ones(21,21,3), 'tag', 'mesh'); hidden off; + else + hh = mesh(xx, yy, zz, 'cdata', zeros(21,21,3), 'tag', 'mesh'); hidden off; + end; + else + try, + if isstr(g.meshdata) + tmp = load('-mat', g.meshdata); + g.meshdata = { 'vertices' tmp.vol.bnd(1).pnt 'faces' tmp.vol.bnd(1).tri }; + end; + hh = patch(g.meshdata{:}, 'facecolor', 'none', 'edgecolor', COLORMESH, 'tag', 'mesh'); + catch, disp('Unrecognize model file (probably CTF)'); end; + end; + end; + + %x = x*100*scaling; y = y*100*scaling; z=z*100*scaling; + %h = line(xx,yy,zz); set(h, 'color', COLORMESH, 'linestyle', '--', 'tag', 'mesh'); + %h = line(xx,zz,yy); set(h, 'color', COLORMESH, 'linestyle', '--', 'tag', 'mesh'); + %h = line([0 0;0 0],[-1 -1.2; -1.2 -1], [-0.3 -0.7; -0.7 -0.7]); + %set(h, 'color', COLORMESH, 'linewidth', 3, 'tag', 'noze'); + + % determine max length if besatextori exist + % ----------------------------------------- + sizedip = []; + for index = 1:length(sources) + sizedip = [ sizedip sources(index).momxyz(3) ]; + end; + maxlength = max(sizedip); + + % diph = gca; % DEBUG + % colormap('jet'); + % cbar + % axes(diph); + + for index = 1:length(sources) + nbdip = 1; + if size(sources(index).posxyz, 1) > 1 & any(sources(index).posxyz(2,:)) nbdip = 2; end; + + % reorder dipoles for plotting + if nbdip == 2 + if sources(index).posxyz(1,1) > sources(index).posxyz(2,1) + tmp = sources(index).posxyz(2,:); + sources(index).posxyz(2,:) = sources(index).posxyz(1,:); + sources(index).posxyz(1,:) = tmp; + tmp = sources(index).momxyz(2,:); + sources(index).momxyz(2,:) = sources(index).momxyz(1,:); + sources(index).momxyz(1,:) = tmp; + end; + if isfield(sources, 'active'), + nbdip = length(sources(index).active); + end; + end; + + % dipole length + % ------------- + multfactor = 1; + if strcmpi(g.normlen, 'on') + if nbdip == 1 + len = sqrt(sum(sources(index).momxyz(1,:).^2)); + else + len1 = sqrt(sum(sources(index).momxyz(1,:).^2)); + len2 = sqrt(sum(sources(index).momxyz(2,:).^2)); + len = mean([len1 len2]); + end; + if strcmpi(g.coordformat, 'CTF'), len = len*10; end; + if len ~= 0, multfactor = 15/len; end; + else + if strcmpi(g.coordformat, 'spherical') + multfactor = 100; + else multfactor = 1.5; + end; + end; + + for dip = 1:nbdip + + x = sources(index).posxyz(dip,1); + y = sources(index).posxyz(dip,2); + z = sources(index).posxyz(dip,3); + + xo = sources(index).momxyz(dip,1)*g.dipolelength*multfactor; + yo = sources(index).momxyz(dip,2)*g.dipolelength*multfactor; + zo = sources(index).momxyz(dip,3)*g.dipolelength*multfactor; + + xc = 0; + yc = 0; + zc = 0; + + centvec = [xo-xc yo-yc zo-zc]; % vector pointing into center + dipole_orient = [x+xo y+yo z+zo]/norm([x+xo y+yo z+zo]); + c = dot(centvec, dipole_orient); + + if strcmpi(g.pointout,'on') + if (c < 0) | (abs([x+xo,y+yo,z+zo]) < abs([x,y,z])) + xo1 = x-xo; % make dipole point outward from head center + yo1 = y-yo; + zo1 = z-zo; + %fprintf('invert because: %e \n', c); + else + xo1 = x+xo; + yo1 = y+yo; + zo1 = z+zo; + %fprintf('NO invert because: %e \n', c); + end + else + xo1 = x+xo; + yo1 = y+yo; + zo1 = z+zo; + %fprintf('NO invert because: %e \n', c); + end + + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% draw dipole bar %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + tag = [ 'dipole' num2str(index) ]; + + % from spherical to electrode space + % --------------------------------- + [xx yy zz] = transform(x, y, z, dat.sph2spm); % nothing happens for BEM + [xxo1 yyo1 zzo1] = transform(xo1, yo1, zo1, dat.sph2spm); % because dat.sph2spm = [] + + if ~strcmpi(g.spheres,'on') % plot dipole direction lines + h1 = line( [xx xxo1]', [yy yyo1]', [zz zzo1]'); + + elseif g.dipolelength>0 % plot dipole direction cylinders with end cap patch + + [xc yc zc] = cylinder( 2, 10); + [xs ys zs] = sphere(10); + xc = [ xc; -xs(7:11,:)*2 ]; + yc = [ yc; -ys(7:11,:)*2 ]; + zc = [ zc; zs(7:11,:)/5+1 ]; + + colorarray = repmat(reshape(g.color{index}, 1,1,3), [size(zc,1) size(zc,2) 1]); + handles = surf(xc, yc, zc, colorarray, 'tag', tag, 'edgecolor', 'none', ... + 'backfacelighting', 'lit', 'facecolor', 'interp', 'facelighting', ... + 'phong', 'ambientstrength', 0.3); + [xc yc zc] = adjustcylinder2( handles, [xx yy zz], [xxo1 yyo1 zzo1] ); + + cx = mean(xc,2); %cx = [(3*cx(1)+cx(2))/4; (cx(1)+3*cx(2))/4]; + cy = mean(yc,2); %cy = [(3*cy(1)+cy(2))/4; (cy(1)+3*cy(2))/4]; + cz = mean(zc,2); %cz = [(3*cz(1)+cz(2))/4; (cz(1)+3*cz(2))/4]; + tmpx = xc - repmat(cx, [1 size(xc, 2)]); + tmpy = yc - repmat(cy, [1 size(xc, 2)]); + tmpz = zc - repmat(cz, [1 size(xc, 2)]); + l=sqrt(tmpx.^2+tmpy.^2+tmpz.^2); + warning('off', 'MATLAB:divideByZero'); % this is due to a Matlab 2008b (or later) + normals = reshape([tmpx./l tmpy./l tmpz./l],[size(tmpx) 3]); % in the rotate function in adjustcylinder2 + warning('off', 'MATLAB:divideByZero'); % one of the z (the last row is not rotated) + set( handles, 'vertexnormals', normals); + + end + + [xxmri yymri zzmri ] = transform(xx, yy, zz, pinv(dat.transform)); + [xxmrio1 yymrio1 zzmrio1] = transform(xxo1, yyo1, zzo1, pinv(dat.transform)); + dipstruct.mricoord = [xxmri yymri zzmri]; % Coordinates in MRI space + dipstruct.eleccoord = [ xx yy zz ]; % Coordinates in elec space + dipstruct.posxyz = sources(index).posxyz; % Coordinates in spherical space + outsources(index).eleccoord(dip,:) = [xx yy zz]; + outsources(index).mnicoord(dip,:) = [xx yy zz]; + outsources(index).mricoord(dip,:) = [xxmri yymri zzmri]; + outsources(index).talcoord(dip,:) = mni2tal([xx yy zz]')'; + dipstruct.talcoord = mni2tal([xx yy zz]')'; + + % copy for output + % --------------- + XX(index) = xxmri; + YY(index) = yymri; + ZZ(index) = zzmri; + XO(index) = xxmrio1; + YO(index) = yymrio1; + ZO(index) = zzmrio1; + + if isempty(g.dipnames) + dipstruct.rv = sprintf('%3.2f', sources(index).rv*100); + dipstruct.name = sources(index).component; + else + dipstruct.rv = sprintf('%3.2f', sources(index).rv*100); + dipstruct.name = g.dipnames{index}; + end; + if ~strcmpi(g.spheres,'on') % plot disk markers + set(h1,'userdata',dipstruct,'tag',tag,'color','k','linewidth',g.dipolesize(index)/7.5); + if strcmp(BACKCOLOR, 'k'), set(h1, 'color', g.color{index}); end; + end + + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%% draw sphere or disk marker %%%%%%%%%%%%%%%%%%%%%%%%% + % + hold on; + if strcmpi(g.spheres,'on') % plot spheres + if strcmpi(g.projimg, 'on') + if strcmpi(g.verbose, 'on'), + disp('Warning: projections cannot be plotted for 3-D sphere'); + end + %tmpcolor = g.color{index} / 2; + %h = plotsphere([xx yy zz], g.dipolesize/6, 'color', g.color{index}, 'proj', ... + % [dat.imgcoords{1}(1) dat.imgcoords{2}(end) dat.imgcoords{3}(1)]*97/100, 'projcol', tmpcolor); + + %set(h(2:end), 'userdata', 'proj', 'tag', tag); + else + %h = plotsphere([xx yy zz], g.dipolesize/6, 'color', g.color{index}); + end; + h = plotsphere([xx yy zz], g.dipolesize(index)/6, 'color', g.color{index}); + set(h(1), 'userdata', dipstruct, 'tag', tag); + else % plot dipole markers + h = plot3(xx, yy, zz); + set(h, 'userdata', dipstruct, 'tag', tag, ... + 'marker', '.', 'markersize', g.dipolesize(index), 'color', g.color{index}); + end + + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% project onto images %%%%%%%%%%%%%%%%%%%%%%%%% + % + [tmp1xx tmp1yy tmp1zz ] = transform( xxmri , yymri , dat.imgcoords{3}(1), dat.transform); + [tmp1xxo1 tmp1yyo1 tmp1zzo1] = transform( xxmrio1, yymrio1, dat.imgcoords{3}(1), dat.transform); + [tmp2xx tmp2yy tmp2zz ] = transform( xxmri , dat.imgcoords{2}(end), zzmri , dat.transform); + [tmp2xxo1 tmp2yyo1 tmp2zzo1] = transform( xxmrio1, dat.imgcoords{2}(end), zzmrio1, dat.transform); + [tmp3xx tmp3yy tmp3zz ] = transform( dat.imgcoords{1}(1), yymri , zzmri , dat.transform); + [tmp3xxo1 tmp3yyo1 tmp3zzo1] = transform( dat.imgcoords{1}(1), yymrio1, zzmrio1, dat.transform); + + if strcmpi(g.projimg, 'on') & strcmpi(g.spheres, 'off') + tmpcolor = g.projcol{index}; + + % project onto z axis + tag = [ 'dipole' num2str(index) ]; + if ~strcmpi(g.image, 'besa') + h = line( [tmp1xx tmp1xxo1]', [tmp1yy tmp1yyo1]', [tmp1zz tmp1zzo1]'); + set(h, 'userdata', 'proj', 'tag', tag, 'color','k', 'linewidth', g.dipolesize(index)/7.5); + end; + if strcmp(BACKCOLOR, 'k'), set(h, 'color', tmpcolor); end; + h = plot3(tmp1xx, tmp1yy, tmp1zz); + set(h, 'userdata', 'proj', 'tag', tag, ... + 'marker', '.', 'markersize', g.dipolesize(index), 'color', tmpcolor); + + % project onto y axis + tag = [ 'dipole' num2str(index) ]; + if ~strcmpi(g.image, 'besa') + h = line( [tmp2xx tmp2xxo1]', [tmp2yy tmp2yyo1]', [tmp2zz tmp2zzo1]'); + set(h, 'userdata', 'proj', 'tag', tag, 'color','k', 'linewidth', g.dipolesize(index)/7.5); + end; + if strcmp(BACKCOLOR, 'k'), set(h, 'color', tmpcolor); end; + h = plot3(tmp2xx, tmp2yy, tmp2zz); + set(h, 'userdata', 'proj', 'tag', tag, ... + 'marker', '.', 'markersize', g.dipolesize(index), 'color', tmpcolor); + + % project onto x axis + tag = [ 'dipole' num2str(index) ]; + if ~strcmpi(g.image, 'besa') + h = line( [tmp3xx tmp3xxo1]', [tmp3yy tmp3yyo1]', [tmp3zz tmp3zzo1]'); + set(h, 'userdata', 'proj', 'tag', tag, 'color','k', 'linewidth', g.dipolesize(index)/7.5); + end; + if strcmp(BACKCOLOR, 'k'), set(h, 'color', tmpcolor); end; + h = plot3(tmp3xx, tmp3yy, tmp3zz); + set(h, 'userdata', 'proj', 'tag', tag, ... + 'marker', '.', 'markersize', g.dipolesize(index), 'color', tmpcolor); + end; + + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% project onto axes %%%%%%%%%%%%%%%%%%%%%%%%% + % + if strcmpi(g.projlines, 'on') + clear h; + % project onto z axis + tag = [ 'dipole' num2str(index) ]; + h(1) = line( [xx tmp1xx]', [yy tmp1yy]', [zz tmp1zz]); + set(h(1), 'userdata', 'proj', 'linestyle', '--', ... + 'tag', tag, 'color', g.color{index}, 'linewidth', g.dipolesize(index)/7.5/5); + + % project onto x axis + tag = [ 'dipole' num2str(index) ]; + h(2) = line( [xx tmp2xx]', [yy tmp2yy]', [zz tmp2zz]); + set(h(2), 'userdata', 'proj', 'linestyle', '--', ... + 'tag', tag, 'color', g.color{index}, 'linewidth', g.dipolesize(index)/7.5/5); + + % project onto y axis + tag = [ 'dipole' num2str(index) ]; + h(3) = line( [xx tmp3xx]', [yy tmp3yy]', [zz tmp3zz]); + set(h(3), 'userdata', 'proj', 'linestyle', '--', ... + 'tag', tag, 'color', g.color{index}, 'linewidth', g.dipolesize(index)/7.5/5); + if ~isempty(g.projcol) + set(h, 'color', g.projcol{index}); + end; + end; + % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% draw text %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + if isfield(sources, 'component') + if strcmp(g.num, 'on') + h = text(xx, yy, zz, [ ' ' int2str(sources(index).component)]); + set(h, 'userdata', dipstruct, 'tag', tag, 'fontsize', g.dipolesize(index)/2 ); + if ~strcmpi(g.image, 'besa'), set(h, 'color', 'w'); end; + end; + end; + end; + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3-D settings + if strcmpi(g.spheres, 'on') + lighting phong; + material shiny; + camlight left; + camlight right; + end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% draw elipse for group of dipoles %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % does not work because of new scheme, have to be reprogrammed + + %if ~isempty(g.std) + % for index = 1:length(g.std) + % if ~iscell(g.std{index}) + % plotellipse(sources, g.std{index}, 1, dat.tcparams, dat.coreg); + % else + % sc = plotellipse(sources, g.std{index}{1}, g.std{index}{2}, dat.tcparams, dat.coreg); + % if length( g.std{index} ) > 2 + % set(sc, g.std{index}{3:end}); + % end; + % end; + % end; + % end; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% buttons %%%%%%%%%%%%%%%%%%%%%%%%%%%%% + nbsrc = int2str(length(sources)); + cbmesh = [ 'if get(gcbo, ''userdata''), ' ... + ' set(findobj(''parent'', gca, ''tag'', ''mesh''), ''visible'', ''off'');' ... + ' set(gcbo, ''string'', ''Mesh on'');' ... + ' set(gcbo, ''userdata'', 0);' ... + 'else,' ... + ' set(findobj(''parent'', gca, ''tag'', ''mesh''), ''visible'', ''on'');' ... + ' set(gcbo, ''string'', ''Mesh off'');' ... + ' set(gcbo, ''userdata'', 1);' ... + 'end;' ]; + cbplot = [ 'if strcmpi(get(gcbo, ''string''), ''plot one''),' ... + ' for tmpi = 1:' nbsrc ',' ... + ' set(findobj(''parent'', gca, ''tag'', [ ''dipole'' int2str(tmpi) ]), ''visible'', ''off'');' ... + ' end; clear tmpi;' ... + ' dipplot(gcbf);' ... + ' set(gcbo, ''string'', ''Plot all'');' ... + 'else,' ... + ' for tmpi = 1:' nbsrc ',' ... + ' set(findobj(''parent'', gca, ''tag'', [ ''dipole'' int2str(tmpi) ]), ''visible'', ''on'');' ... + ' end; clear tmpi;' ... + ' set(gcbo, ''string'', ''Plot one'');' ... + 'end;' ]; + cbview = [ 'tmpuserdat = get(gca, ''userdata'');' ... + 'if tmpuserdat.axistight, ' ... + ' set(gcbo, ''string'', ''Tight view'');' ... + 'else,' ... + ' set(gcbo, ''string'', ''Loose view'');' ... + 'end;' ... + 'tmpuserdat.axistight = ~tmpuserdat.axistight;' ... + 'set(gca, ''userdata'', tmpuserdat);' ... + 'clear tmpuserdat;' ... + 'dipplot(gcbf);' ]; + viewstring = fastif(dat.axistight, 'Loose view', 'Tight view'); + enmesh = fastif(isempty(g.meshdata) & strcmpi(g.coordformat, 'MNI'), 'off', 'on'); + if strcmpi(g.coordformat, 'CTF'), viewcor = 'view([0 1 0]);'; viewtop = 'view([0 0 -1]);'; vis = 'off'; + else viewcor = 'view([0 -1 0]);'; viewtop = 'view([0 0 1]);'; vis = 'on'; + end; + + h = uicontrol( 'unit', 'normalized', 'position', [0 0 .15 1], 'tag', 'tmp', ... + 'style', 'text', 'string',' '); + h = uicontrol( 'unit', 'normalized', 'position', [0 0 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'fontweight', 'bold', 'string', 'No controls', 'callback', ... + 'set(findobj(''parent'', gcbf, ''tag'', ''tmp''), ''visible'', ''off'');'); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.05 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Top view', 'callback', viewtop); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.1 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Coronal view', 'callback', viewcor); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.15 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Sagittal view', 'callback', 'view([1 0 0]);'); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.2 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', viewstring, 'callback', cbview); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.25 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Mesh on', 'userdata', 0, 'callback', ... + cbmesh, 'enable', enmesh, 'visible', vis ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.3 .15 .05], 'tag', 'tmp', ... + 'style', 'text', 'string', 'Display:','fontweight', 'bold' ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.35 .15 .02], 'tag', 'tmp',... + 'style', 'text', 'string', ''); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.37 .15 .05], 'tag', 'tmp','userdata', 'z',... + 'style', 'text', 'string', 'Z:', 'visible', vis ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.42 .15 .05], 'tag', 'tmp','userdata', 'y', ... + 'style', 'text', 'string', 'Y:', 'visible', vis ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.47 .15 .05], 'tag', 'tmp', 'userdata', 'x',... + 'style', 'text', 'string', 'X:', 'visible', vis ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.52 .15 .05], 'tag', 'tmp', 'userdata', 'rv',... + 'style', 'text', 'string', 'RV:' ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.57 .15 .05], 'tag', 'tmp', 'userdata', 'comp', ... + 'style', 'text', 'string', ''); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.62 .15 .05], 'tag', 'tmp', 'userdata', 'editor', ... + 'style', 'edit', 'string', '1', 'callback', ... + [ 'dipplot(gcbf);' ] ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.67 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Keep|Prev', 'callback', ... + [ 'editobj = findobj(''parent'', gcf, ''userdata'', ''editor'');' ... + 'set(editobj, ''string'', num2str(str2num(get(editobj, ''string''))-1));' ... + 'tmpobj = get(gcf, ''userdata'');' ... + 'eval(get(editobj, ''callback''));' ... + 'set(tmpobj, ''visible'', ''on'');' ... + 'clear editobj tmpobj;' ]); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.72 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Prev', 'callback', ... + [ 'editobj = findobj(''parent'', gcf, ''userdata'', ''editor'');' ... + 'set(editobj, ''string'', num2str(str2num(get(editobj, ''string''))-1));' ... + 'eval(get(editobj, ''callback''));' ... + 'clear editobj;' ]); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.77 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Next', 'callback', ... + [ 'editobj = findobj(''parent'', gcf, ''userdata'', ''editor'');' ... + 'set(editobj, ''string'', num2str(str2num(get(editobj, ''string''))+1));' ... + 'dipplot(gcbf);' ... + 'clear editobj;' ]); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.82 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Keep|Next', 'callback', ... + [ 'editobj = findobj(''parent'', gcf, ''userdata'', ''editor'');' ... + 'set(editobj, ''string'', num2str(str2num(get(editobj, ''string''))+1));' ... + 'tmpobj = get(gcf, ''userdata'');' ... + 'dipplot(gcbf);' ... + 'set(tmpobj, ''visible'', ''on'');' ... + 'clear editobj tmpobj;' ]); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.87 .15 .05], 'tag', 'tmp', ... + 'style', 'pushbutton', 'string', 'Plot one', 'callback', cbplot); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.92 .15 .05], 'tag', 'tmp', ... + 'style', 'text', 'string', [num2str(length(sources)) ' dipoles:'], 'fontweight', 'bold' ); + h = uicontrol( 'unit', 'normalized', 'position', [0 0.97 .15 .05], 'tag', 'tmp', ... + 'style', 'text', 'string', ''); + set(gcf, 'userdata', findobj('parent', gca, 'tag', 'dipole1')); + + dat.nbsources = length(sources); + set(gca, 'userdata', dat ); % last param=1 for MRI view tight/loose + set(gcf, 'color', BACKCOLOR); + + if strcmp(g.gui, 'off') | strcmpi(g.holdon, 'on') + set(findobj('parent', gcf, 'tag', 'tmp'), 'visible', 'off'); + end; + if strcmp(g.mesh, 'off') + set(findobj('parent', gca, 'tag', 'mesh'), 'visible', 'off'); + end; + + updatedipplot(gcf); + + rotate3d on; + + % close figure if necessary + if strcmpi(g.plot, 'off') + try, close(fig); catch, end; + end; + + if strcmpi(g.holdon, 'on') + box off; + axis equal; + axis off; + end; + + % set camera positon + if strcmpi(g.camera, 'set') + set(gca, 'CameraPosition', [2546.94 -894.981 689.613], ... + 'CameraPositionMode', 'manual', ... + 'CameraTarget', [0 -18 18], ... + 'CameraTargetMode', 'manual', ... + 'CameraUpVector', [0 0 1], ... + 'CameraUpVectorMode', 'manual', ... + 'CameraViewAngle', [3.8815], ... + 'CameraViewAngleMode', 'manual'); + end; + +return; + +% electrode space to MRI space +% ============================ +function [x,y,z] = transform(x, y, z, transmat); + + if isempty(transmat), return; end; + for i = 1:size(x,1) + for j = 1:size(x,2) + tmparray = transmat * [ x(i,j) y(i,j) z(i,j) 1 ]'; + x(i,j) = tmparray(1); + y(i,j) = tmparray(2); + z(i,j) = tmparray(3); + end; + end; + + +% does not work any more +% ---------------------- +function sc = plotellipse(sources, ind, nstd, TCPARAMS, coreg); + + for i = 1:length(ind) + tmpval(1,i) = -sources(ind(i)).posxyz(1); + tmpval(2,i) = -sources(ind(i)).posxyz(2); + tmpval(3,i) = sources(ind(i)).posxyz(3); + [tmpval(1,i) tmpval(2,i) tmpval(3,i)] = transform(tmpval(1,i), tmpval(2,i), tmpval(3,i), TCPARAMS); + end; + + % mean and covariance + C = cov(tmpval'); + M = mean(tmpval,2); + [U,L] = eig(C); + + % For N standard deviations spread of data, the radii of the eliipsoid will + % be given by N*SQRT(eigenvalues). + radii = nstd*sqrt(diag(L)); + + % generate data for "unrotated" ellipsoid + [xc,yc,zc] = ellipsoid(0,0,0,radii(1),radii(2),radii(3), 10); + + % rotate data with orientation matrix U and center M + a = kron(U(:,1),xc); b = kron(U(:,2),yc); c = kron(U(:,3),zc); + data = a+b+c; n = size(data,2); + x = data(1:n,:)+M(1); y = data(n+1:2*n,:)+M(2); z = data(2*n+1:end,:)+M(3); + + % now plot the rotated ellipse + c = ones(size(z)); + sc = mesh(x,y,z); + alpha(0.5) + +function newsrc = convertbesaoldformat(src); + newsrc = []; + count = 1; + countdip = 1; + if ~isfield(src, 'besaextori'), src(1).besaextori = []; end; + for index = 1:length(src) + + % convert format + % -------------- + if isempty(src(index).besaextori), src(index).besaextori = 300; end; % 20 mm + newsrc(count).possph(countdip,:) = [ src(index).besathloc src(index).besaphloc src(index).besaexent]; + newsrc(count).momsph(countdip,:) = [ src(index).besathori src(index).besaphori src(index).besaextori/300]; + + % copy other fields + % ----------------- + if isfield(src, 'stdX') + newsrc(count).stdX = -src(index).stdY; + newsrc(count).stdY = src(index).stdX; + newsrc(count).stdZ = src(index).stdZ; + end; + if isfield(src, 'rv') + newsrc(count).rv = src(index).rv; + end; + if isfield(src, 'elecrv') + newsrc(count).rvelec = src(index).elecrv; + end; + if isfield(src, 'component') + newsrc(count).component = src(index).component; + if index ~= length(src) & src(index).component == src(index+1).component + countdip = countdip + 1; + else + count = count + 1; countdip = 1; + end; + else + count = count + 1; countdip = 1; + end; + end; + +function src = computexyzforbesa(src); + + for index = 1:length( src ) + for index2 = 1:size( src(index).possph, 1 ) + + % compute coordinates + % ------------------- + postmp = src(index).possph(index2,:); + momtmp = src(index).momsph(index2,:); + + phi = postmp(1)+90; %% %%%%%%%%%%%%%%% USE BESA COORDINATES %%%%% + theta = postmp(2); %% %%%%%%%%%%%%%%% USE BESA COORDINATES %%%%% + phiori = momtmp(1)+90; %% %%%%%%%%%%%% USE BESA COORDINATES %%%%% + thetaori = momtmp(2); %% %%%%%%%%%%%% USE BESA COORDINATES %%%%% + % exentricities are in % of the radius of the head sphere + [x y z] = sph2cart(theta/180*pi, phi/180*pi, postmp(3)/1.2); + [xo yo zo] = sph2cart(thetaori/180*pi, phiori/180*pi, momtmp(3)*5); % exentricity scaled for compatibility with DIPFIT + src(index).posxyz(index2,:) = [-y x z]; + src(index).momxyz(index2,:) = [-yo xo zo]; + + end; + end; + +% update dipplot (callback call) +% ------------------------------ +function updatedipplot(fig) + + % find current dipole index and test for authorized range + % ------------------------------------------------------- + dat = get(gca, 'userdata'); + editobj = findobj('parent', fig, 'userdata', 'editor'); + tmpnum = str2num(get(editobj(end), 'string')); + if tmpnum < 1, tmpnum = 1; end; + if tmpnum > dat.nbsources, tmpnum = dat.nbsources; end; + set(editobj(end), 'string', num2str(tmpnum)); + + % hide current dipole, find next dipole and show it + % ------------------------------------------------- + set(get(gcf, 'userdata'), 'visible', 'off'); + newdip = findobj('parent', gca, 'tag', [ 'dipole' get(editobj(end), 'string')]); + set(newdip, 'visible', 'on'); + set(gcf, 'userdata', newdip); + + % find all dipolar structures + % --------------------------- + index = 1; + count = 1; + for index = 1:length(newdip) + if isstruct( get(newdip(index), 'userdata') ) + dip_mricoord(count,:) = getfield(get(newdip(index), 'userdata'), 'mricoord'); + count = count+1; + foundind = index; + end; + end; + + % get residual variance + % --------------------- + if exist('foundind') + tmp = get(newdip(foundind), 'userdata'); + tal = tmp.talcoord; + if ~isstr( tmp.name ) + tmprvobj = findobj('parent', fig, 'userdata', 'comp'); set( tmprvobj(end), 'string', [ 'Comp: ' int2str(tmp.name) ] ); + else tmprvobj = findobj('parent', fig, 'userdata', 'comp'); set( tmprvobj(end), 'string', tmp.name ); + end; + tmprvobj = findobj('parent', fig, 'userdata', 'rv'); set( tmprvobj(end), 'string', [ 'RV: ' tmp.rv '%' ] ); + tmprvobj = findobj('parent', fig, 'userdata', 'x'); set( tmprvobj(end), 'string', [ 'X tal: ' int2str(round(tal(1))) ]); + tmprvobj = findobj('parent', fig, 'userdata', 'y'); set( tmprvobj(end), 'string', [ 'Y tal: ' int2str(round(tal(2))) ]); + tmprvobj = findobj('parent', fig, 'userdata', 'z'); set( tmprvobj(end), 'string', [ 'Z tal: ' int2str(round(tal(3))) ]); + end + + % adapt the MRI to the dipole depth + % --------------------------------- + delete(findobj('parent', gca, 'tag', 'img')); + + tmpdiv1 = dat.imgcoords{1}(2)-dat.imgcoords{1}(1); + tmpdiv2 = dat.imgcoords{2}(2)-dat.imgcoords{2}(1); + tmpdiv3 = dat.imgcoords{3}(2)-dat.imgcoords{3}(1); + if ~dat.axistight + [xx yy zz] = transform(0,0,0, pinv(dat.transform)); % elec -> MRI space + indx = minpos(dat.imgcoords{1}-zz); + indy = minpos(dat.imgcoords{2}-yy); + indz = minpos(dat.imgcoords{3}-xx); + else + if ~dat.cornermri + indx = minpos(dat.imgcoords{1} - mean(dip_mricoord(:,1))) - 3*tmpdiv1; + indy = minpos(dat.imgcoords{2} - mean(dip_mricoord(:,2))) + 3*tmpdiv2; + indz = minpos(dat.imgcoords{3} - mean(dip_mricoord(:,3))) - 3*tmpdiv3; + else % no need to shift slice if not ploted close to the dipole + indx = minpos(dat.imgcoords{1} - mean(dip_mricoord(:,1))); + indy = minpos(dat.imgcoords{2} - mean(dip_mricoord(:,2))); + indz = minpos(dat.imgcoords{3} - mean(dip_mricoord(:,3))); + end; + end; + + % middle of the brain + % ------------------- + plotimgs( dat, [indx indy indz], dat.transform); + %end; + +% plot images (transmat is the uniform matrix MRI coords -> elec coords) +% ---------------------------------------------------------------------- +function plotimgs(dat, mricoord, transmat); + + % loading images + % -------------- + if ndims(dat.imgs) == 4 % true color data + img1(:,:,3) = rot90(squeeze(dat.imgs(mricoord(1),:,:,3))); + img2(:,:,3) = rot90(squeeze(dat.imgs(:,mricoord(2),:,3))); + img3(:,:,3) = rot90(squeeze(dat.imgs(:,:,mricoord(3),3))); + img1(:,:,2) = rot90(squeeze(dat.imgs(mricoord(1),:,:,2))); + img2(:,:,2) = rot90(squeeze(dat.imgs(:,mricoord(2),:,2))); + img3(:,:,2) = rot90(squeeze(dat.imgs(:,:,mricoord(3),2))); + img1(:,:,1) = rot90(squeeze(dat.imgs(mricoord(1),:,:,1))); + img2(:,:,1) = rot90(squeeze(dat.imgs(:,mricoord(2),:,1))); + img3(:,:,1) = rot90(squeeze(dat.imgs(:,:,mricoord(3),1))); + else + img1 = rot90(squeeze(dat.imgs(mricoord(1),:,:))); + img2 = rot90(squeeze(dat.imgs(:,mricoord(2),:))); + img3 = rot90(squeeze(dat.imgs(:,:,mricoord(3)))); + + if ndims(img1) == 2, img1(:,:,3) = img1; img1(:,:,2) = img1(:,:,1); end; + if ndims(img2) == 2, img2(:,:,3) = img2; img2(:,:,2) = img2(:,:,1); end; + if ndims(img3) == 2, img3(:,:,3) = img3; img3(:,:,2) = img3(:,:,1); end; + end; + + % computing coordinates for planes + % -------------------------------- + wy1 = [min(dat.imgcoords{2}) max(dat.imgcoords{2}); min(dat.imgcoords{2}) max(dat.imgcoords{2})]; + wz1 = [min(dat.imgcoords{3}) min(dat.imgcoords{3}); max(dat.imgcoords{3}) max(dat.imgcoords{3})]; + wx2 = [min(dat.imgcoords{1}) max(dat.imgcoords{1}); min(dat.imgcoords{1}) max(dat.imgcoords{1})]; + wz2 = [min(dat.imgcoords{3}) min(dat.imgcoords{3}); max(dat.imgcoords{3}) max(dat.imgcoords{3})]; + wx3 = [min(dat.imgcoords{1}) max(dat.imgcoords{1}); min(dat.imgcoords{1}) max(dat.imgcoords{1})]; + wy3 = [min(dat.imgcoords{2}) min(dat.imgcoords{2}); max(dat.imgcoords{2}) max(dat.imgcoords{2})]; + if dat.axistight & ~dat.cornermri + wx1 = [ 1 1; 1 1]*dat.imgcoords{1}(mricoord(1)); + wy2 = [ 1 1; 1 1]*dat.imgcoords{2}(mricoord(2)); + wz3 = [ 1 1; 1 1]*dat.imgcoords{3}(mricoord(3)); + else + wx1 = [ 1 1; 1 1]*dat.imgcoords{1}(1); + wy2 = [ 1 1; 1 1]*dat.imgcoords{2}(end); + wz3 = [ 1 1; 1 1]*dat.imgcoords{3}(1); + end; + + % transform MRI coordinates to electrode space + % -------------------------------------------- + [ elecwx1 elecwy1 elecwz1 ] = transform( wx1, wy1, wz1, transmat); + [ elecwx2 elecwy2 elecwz2 ] = transform( wx2, wy2, wz2, transmat); + [ elecwx3 elecwy3 elecwz3 ] = transform( wx3, wy3, wz3, transmat); + + % ploting surfaces + % ---------------- + options = { 'FaceColor','texturemap', 'EdgeColor','none', 'CDataMapping', ... + 'direct','tag','img', 'facelighting', 'none' }; + hold on; + surface(elecwx1, elecwy1, elecwz1, img1(end:-1:1,:,:), options{:}); + surface(elecwx2, elecwy2, elecwz2, img2(end:-1:1,:,:), options{:}); + surface(elecwx3, elecwy3, elecwz3, img3(end:-1:1,:,:), options{:}); + %xlabel('x'); ylabel('y'); zlabel('z'); axis equal; dsaffd + + if strcmpi(dat.drawedges, 'on') + % removing old edges if any + delete(findobj( gcf, 'tag', 'edges')); + if dat.axistight & ~dat.cornermri, col = 'k'; else col = [0.5 0.5 0.5]; end; + h(1) = line([elecwx3(1) elecwx3(2)]', [elecwy3(1) elecwy2(1)]', [elecwz1(1) elecwz1(2)]'); % sagittal-transverse + h(2) = line([elecwx3(1) elecwx2(3)]', [elecwy2(1) elecwy2(2)]', [elecwz1(1) elecwz1(2)]'); % coronal-tranverse + h(3) = line([elecwx3(1) elecwx3(2)]', [elecwy2(1) elecwy2(2)]', [elecwz3(1) elecwz1(1)]'); % sagittal-coronal + set(h, 'color', col, 'linewidth', 2, 'tag', 'edges'); + end; + + %%fill3([-2 -2 2 2], [-2 2 2 -2], wz(:)-1, BACKCOLOR); + %%fill3([-2 -2 2 2], wy(:)-1, [-2 2 2 -2], BACKCOLOR); + rotate3d on + +function index = minpos(vals); + vals(find(vals < 0)) = inf; + [tmp index] = min(vals); + +function scalegca(multfactor) + xl = xlim; xf = ( xl(2) - xl(1) ) * multfactor; + yl = ylim; yf = ( yl(2) - yl(1) ) * multfactor; + zl = zlim; zf = ( zl(2) - zl(1) ) * multfactor; + xlim( [ xl(1)-xf xl(2)+xf ]); + ylim( [ yl(1)-yf yl(2)+yf ]); + zlim( [ zl(1)-zf zl(2)+zf ]); + +function color = strcol2real(colorin, colmap) + if ~iscell(colorin) + for index = 1:length(colorin) + color{index} = colmap(colorin(index),:); + end; + else + color = colorin; + for index = 1:length(colorin) + if isstr(colorin{index}) + switch colorin{index} + case 'r', color{index} = [1 0 0]; + case 'g', color{index} = [0 1 0]; + case 'b', color{index} = [0 0 1]; + case 'c', color{index} = [0 1 1]; + case 'm', color{index} = [1 0 1]; + case 'y', color{index} = [1 1 0]; + case 'k', color{index} = [0 0 0]; + case 'w', color{index} = [1 1 1]; + otherwise, error('Unknown color'); + end; + end; + end; + end; + +function x = gammacorrection(x, gammaval); + x = 255 * (double(x)/255).^ gammaval; + % image is supposed to be scaled from 0 to 255 + % gammaval = 1 is identity of course + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/eeglab2fieldtrip.m b/code/eeglab13_4_4b/plugins/dipfit2.3/eeglab2fieldtrip.m new file mode 100644 index 0000000..1ffd2af --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/eeglab2fieldtrip.m @@ -0,0 +1,152 @@ +% eeglab2fieldtrip() - do this ... +% +% Usage: >> data = eeglab2fieldtrip( EEG, fieldbox, transform ); +% +% Inputs: +% EEG - [struct] EEGLAB structure +% fieldbox - ['preprocessing'|'freqanalysis'|'timelockanalysis'|'companalysis'] +% transform - ['none'|'dipfit'] transform channel locations for DIPFIT +% using the transformation matrix in the field +% 'coord_transform' of the dipfit substructure of the EEG +% structure. +% Outputs: +% data - FIELDTRIP structure +% +% Author: Robert Oostenveld, F.C. Donders Centre, May, 2004. +% Arnaud Delorme, SCCN, INC, UCSD +% +% See also: + +% Copyright (C) 2004 Robert Oostenveld, F.C. Donders Centre, roberto@smi.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function data = eeglab2fieldtrip(EEG, fieldbox, transform) + +if nargin < 2 + help eeglab2fieldtrip + return; +end; + +% start with an empty data object +data = []; + +% add the objects that are common to all fieldboxes +tmpchanlocs = EEG.chanlocs; +data.label = { tmpchanlocs(EEG.icachansind).labels }; +data.fsample = EEG.srate; + +% get the electrode positions from the EEG structure: in principle, the number of +% channels can be more or less than the number of channel locations, i.e. not +% every channel has a position, or the potential was not measured on every +% position. This is not supported by EEGLAB, but it is supported by FIELDTRIP. + +if strcmpi(fieldbox, 'chanloc_withfid') + % insert "no data channels" in channel structure + % ---------------------------------------------- + if isfield(EEG.chaninfo, 'nodatchans') && ~isempty( EEG.chaninfo.nodatchans ) + chanlen = length(EEG.chanlocs); + fields = fieldnames( EEG.chaninfo.nodatchans ); + for index = 1:length(EEG.chaninfo.nodatchans) + ind = chanlen+index; + for f = 1:length( fields ) + EEG.chanlocs = setfield(EEG.chanlocs, { ind }, fields{f}, ... + getfield( EEG.chaninfo.nodatchans, { index }, fields{f})); + end; + end; + end; +end; + +data.elec.pnt = zeros(length( EEG.chanlocs ), 3); +for ind = 1:length( EEG.chanlocs ) + data.elec.label{ind} = EEG.chanlocs(ind).labels; + if ~isempty(EEG.chanlocs(ind).X) + data.elec.pnt(ind,1) = EEG.chanlocs(ind).X; + data.elec.pnt(ind,2) = EEG.chanlocs(ind).Y; + data.elec.pnt(ind,3) = EEG.chanlocs(ind).Z; + else + data.elec.pnt(ind,:) = [0 0 0]; + end; +end; + +if nargin > 2 + if strcmpi(transform, 'dipfit') + if ~isempty(EEG.dipfit.coord_transform) + disp('Transforming electrode coordinates to match head model'); + transfmat = traditionaldipfit(EEG.dipfit.coord_transform); + data.elec.pnt = transfmat * [ data.elec.pnt ones(size(data.elec.pnt,1),1) ]'; + data.elec.pnt = data.elec.pnt(1:3,:)'; + else + disp('Warning: no transformation of electrode coordinates to match head model'); + end; + end; +end; + +switch fieldbox + case 'preprocessing' + for index = 1:EEG.trials + data.trial{index} = EEG.data(:,:,index); + data.time{index} = linspace(EEG.xmin, EEG.xmax, EEG.pnts); % should be checked in FIELDTRIP + end; + data.label = { tmpchanlocs(1:EEG.nbchan).labels }; + + + case 'timelockanalysis' + data.avg = mean(EEG.data, 3); + data.var = std(EEG.data, [], 3).^2; + data.time = linspace(EEG.xmin, EEG.xmax, EEG.pnts); % should be checked in FIELDTRIP + data.label = { tmpchanlocs(1:EEG.nbchan).labels }; + + case 'componentanalysis' + for index = 1:EEG.trials + % the trials correspond to the raw data trials, except that they + % contain the component activations + try, + data.trial{index} = EEG.icaact(:,:,index); + catch + end; + data.time{index} = linspace(EEG.xmin, EEG.xmax, EEG.pnts); % should be checked in FIELDTRIP + end; + for comp = 1:size(EEG.icawinv,2) + % the labels correspond to the component activations that are stored in data.trial + data.label{comp} = sprintf('ica_%03d', comp); + end + % get the spatial distribution and electrode positions + tmpchanlocs = EEG.chanlocs; + data.topolabel = { tmpchanlocs(EEG.icachansind).labels }; + data.topo = EEG.icawinv; + + case { 'chanloc' 'chanloc_withfid' } + + case 'freqanalysis' + error('freqanalysis fieldbox not implemented yet') + + otherwise + error('unsupported fieldbox') +end + +try + % get the full name of the function + data.cfg.version.name = mfilename('fullpath'); +catch + % required for compatibility with Matlab versions prior to release 13 (6.5) + [st, i] = dbstack; + data.cfg.version.name = st(i); +end + +% add the version details of this function call to the configuration +data.cfg.version.id = '$Id: eeglab2fieldtrip.m,v 1.6 2009-07-02 23:39:29 arno Exp $'; + +return diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/eegplugin_dipfit.m b/code/eeglab13_4_4b/plugins/dipfit2.3/eegplugin_dipfit.m new file mode 100644 index 0000000..899dd00 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/eegplugin_dipfit.m @@ -0,0 +1,86 @@ +% eegplugin_dipfit() - DIPFIT plugin version 2.0 for EEGLAB menu. +% DIPFIT is the dipole fitting Matlab Toolbox of +% Robert Oostenveld (in collaboration with A. Delorme). +% +% Usage: +% >> eegplugin_dipfit(fig, trystrs, catchstrs); +% +% Inputs: +% fig - [integer] eeglab figure. +% trystrs - [struct] "try" strings for menu callbacks. +% catchstrs - [struct] "catch" strings for menu callbacks. +% +% Notes: +% To create a new plugin, simply create a file beginning with "eegplugin_" +% and place it in your eeglab folder. It will then be automatically +% detected by eeglab. See also this source code internal comments. +% For eeglab to return errors and add the function's results to +% the eeglab history, menu callback must be nested into "try" and +% a "catch" strings. For more information on how to create eeglab +% plugins, see http://www.sccn.ucsd.edu/eeglab/contrib.html +% +% Author: Arnaud Delorme, CNL / Salk Institute, 22 February 2003 +% +% See also: eeglab() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1.07 USA + +function vers = eegplugin_dipfit(fig, trystrs, catchstrs) + + vers = 'dipfit2.2'; + if nargin < 3 + error('eegplugin_dipfit requires 3 arguments'); + end; + + % find tools menu + % --------------- + menu = findobj(fig, 'tag', 'tools'); + % tag can be + % 'import data' -> File > import data menu + % 'import epoch' -> File > import epoch menu + % 'import event' -> File > import event menu + % 'export' -> File > export + % 'tools' -> tools menu + % 'plot' -> plot menu + + % command to check that the '.source' is present in the EEG structure + % ------------------------------------------------------------------- + check_dipfit = [trystrs.no_check 'if ~isfield(EEG, ''dipfit''), error(''Run the dipole setting first''); end;' ... + 'if isempty(EEG.dipfit), error(''Run the dipole setting first''); end;' ]; + check_dipfitnocheck = [ trystrs.no_check 'if ~isfield(EEG, ''dipfit''), error(''Run the dipole setting first''); end; ' ]; + check_chans = [ '[EEG tmpres] = eeg_checkset(EEG, ''chanlocs_homogeneous'');' ... + 'if ~isempty(tmpres), eegh(tmpres), end; clear tmpres;' ]; + + % menu callback commands + % ---------------------- + comsetting = [ trystrs.check_ica check_chans '[EEG LASTCOM]=pop_dipfit_settings(EEG);' catchstrs.store_and_hist ]; + combatch = [ check_dipfit check_chans '[EEG LASTCOM] = pop_dipfit_gridsearch(EEG);' catchstrs.store_and_hist ]; + comfit = [ check_dipfitnocheck check_chans [ 'EEG = pop_dipfit_nonlinear(EEG); ' ... + 'LASTCOM = ''% === History not supported for manual dipole fitting ==='';' ] catchstrs.store_and_hist ]; + comauto = [ check_dipfit check_chans '[EEG LASTCOM] = pop_multifit(EEG);' catchstrs.store_and_hist ]; + % preserve the '=" sign in the comment above: it is used by EEGLAB to detect appropriate LASTCOM + complot = [ check_dipfit check_chans 'LASTCOM = pop_dipplot(EEG);' catchstrs.add_to_hist ]; + + + % create menus + % ------------ + submenu = uimenu( menu, 'Label', 'Locate dipoles using DIPFIT 2.x', 'separator', 'on'); + uimenu( submenu, 'Label', 'Head model and settings' , 'CallBack', comsetting); + uimenu( submenu, 'Label', 'Coarse fit (grid scan)' , 'CallBack', combatch); + uimenu( submenu, 'Label', 'Fine fit (iterative)' , 'CallBack', comfit); + uimenu( submenu, 'Label', 'Autofit (coarse fit, fine fit & plot)', 'CallBack', comauto); + uimenu( submenu, 'Label', 'Plot component dipoles' , 'CallBack', complot, 'separator', 'on'); diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/electroderealign.m b/code/eeglab13_4_4b/plugins/dipfit2.3/electroderealign.m new file mode 100644 index 0000000..905d364 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/electroderealign.m @@ -0,0 +1,720 @@ +function [norm] = electroderealign(cfg); + +% ELECTRODEREALIGN rotates and translates electrode positions to +% template electrode positions or towards the head surface. It can +% either perform a rigid body transformation, in which only the +% coordinate system is changed, or it can apply additional deformations +% to the input electrodes. +% +% Use as +% [elec] = electroderealign(cfg) +% +% Three different methods for aligning the input electrodes are implemented: +% based on a warping method, based on the fiducials or interactive with a +% graphical user interface. Each of these approaches is described below. +% +% 1) You can apply a spatial deformation method (i.e. 'warp') that +% automatically minimizes the distance between the electrodes and the +% averaged standard. The warping methods use a non-linear search to +% optimize the error between input and template electrodes or the +% head surface. +% +% 2) You can apply a rigid body realignment based on three fiducial locations. +% Realigning using the fiducials only ensures that the fiducials (typically +% nose, left and right ear) are along the same axes in the input electrode +% set as in the template electrode set. +% +% 3) You can display the electrode positions together with the skin surface, +% and manually (using the graphical user interface) adjust the rotation, +% translation and scaling parameters, so that the two match. +% +% The configuration can contain the following options +% cfg.method = different methods for aligning the electrodes +% 'rigidbody' apply a rigid-body warp +% 'globalrescale' apply a rigid-body warp with global rescaling +% 'traditional' apply a rigid-body warp with individual axes rescaling +% 'nonlin1' apply a 1st order non-linear warp +% 'nonlin2' apply a 2nd order non-linear warp +% 'nonlin3' apply a 3rd order non-linear warp +% 'nonlin4' apply a 4th order non-linear warp +% 'nonlin5' apply a 5th order non-linear warp +% 'realignfiducial' realign the fiducials +% 'interactive' manually using graphical user interface +% cfg.channel = Nx1 cell-array with selection of channels (default = 'all'), +% see CHANNELSELECTION for details +% cfg.fiducial = cell-array with the name of three fiducials used for +% realigning (default = {'nasion', 'lpa', 'rpa'}) +% cfg.casesensitive = 'yes' or 'no', determines whether string comparisons +% between electrode labels are case sensitive (default = 'yes') +% cfg.feedback = 'yes' or 'no' (default = 'no') +% +% The electrode set that will be realigned is specified as +% cfg.elecfile = string with filename, or alternatively +% cfg.elec = structure with electrode definition +% +% If you want to align the electrodes to a single template electrode set +% or to multiple electrode sets (which will be averaged), you should +% specify the template electrode sets as +% cfg.template = single electrode set that serves as standard +% or +% cfg.template{1..N} = list of electrode sets that are averaged into the standard +% The template electrode sets can be specified either as electrode +% structures (i.e. when they are already read in memory) or as electrode +% files. +% +% If you want to align the electrodes to the head surface as obtained from +% an anatomical MRI (using one of the warping methods), you should specify +% the head surface +% cfg.headshape = a filename containing headshape, a structure containing a +% single triangulated boundary, or a Nx3 matrix with surface +% points +% +% In case you only want to realign the fiducials, the template electrode +% set only has to contain the three fiducials, e.g. +% cfg.template.pnt(1,:) = [110 0 0] % location of the nose +% cfg.template.pnt(2,:) = [0 90 0] % left ear +% cfg.template.pnt(3,:) = [0 -90 0] % right ear +% cfg.template.label = {''nasion', 'lpa', 'rpa'} +% +% See also READ_FCDC_ELEC, VOLUMEREALIGN + +% Copyright (C) 2005-2006, Robert Oostenveld +% +% $Log: electroderealign.m,v $ +% Revision 1.1 2009/01/30 04:02:02 arno +% *** empty log message *** +% +% Revision 1.6 2007/08/06 09:20:14 roboos +% added support for bti_hs +% +% Revision 1.5 2007/07/26 08:00:09 roboos +% also deal with cfg.headshape if specified as surface, set of points or ctf_hs file. +% the construction of the tri is now done consistently for all headshapes if tri is missing +% +% Revision 1.4 2007/02/13 15:12:51 roboos +% removed cfg.plot3d option +% +% Revision 1.3 2006/12/12 11:28:33 roboos +% moved projecttri subfunction into seperate function +% +% Revision 1.2 2006/10/04 07:10:07 roboos +% updated documentation +% +% Revision 1.1 2006/09/13 07:20:06 roboos +% renamed electrodenormalize to electroderealign, added "deprecated"-warning to the old function +% +% Revision 1.10 2006/09/13 07:09:24 roboos +% Implemented support for cfg.method=interactive, using GUI for specifying and showing transformations. Sofar only for electrodes+headsurface. +% +% Revision 1.9 2006/09/12 15:26:06 roboos +% implemented support for aligning electrodes to the skin surface, extended and improved documentation +% +% Revision 1.8 2006/04/20 09:58:34 roboos +% updated documentation +% +% Revision 1.7 2006/04/19 15:42:53 roboos +% replaced call to warp_pnt with new function name warp_optim +% +% Revision 1.6 2006/03/14 08:16:00 roboos +% changed function call to warp3d into warp_apply (thanks to Arno) +% +% Revision 1.5 2005/05/17 17:50:37 roboos +% changed all "if" occurences of & and | into && and || +% this makes the code more compatible with Octave and also seems to be in closer correspondence with Matlab documentation on shortcircuited evaluation of sequential boolean constructs +% +% Revision 1.4 2005/03/21 15:49:43 roboos +% added cfg.casesensitive for string comparison of electrode labels +% added cfg.feedback and cfg.plot3d option for debugging +% changed output: now ALL electrodes of the input are rerurned, after applying the specified transformation +% fixed small bug in feedback regarding distarnce prior/after realignfiducials) +% added support for various warping strategies, a.o. traditional, rigidbody, nonlin1-5, etc. +% +% Revision 1.3 2005/03/16 09:18:56 roboos +% fixed bug in fprintf feedback, instead of giving mean squared distance it should give mean distance before and after normalization +% +% Revision 1.2 2005/01/18 12:04:39 roboos +% improved error handling of missing fiducials +% added other default fiducials +% changed debugging output +% +% Revision 1.1 2005/01/17 14:56:06 roboos +% new implementation +% + +% set the defaults +if ~isfield(cfg, 'channel'), cfg.channel = 'all'; end +if ~isfield(cfg, 'feedback'), cfg.feedback = 'no'; end +if ~isfield(cfg, 'casesensitive'), cfg.casesensitive = 'yes'; end +if ~isfield(cfg, 'headshape'), cfg.headshape = []; end +if ~isfield(cfg, 'template'), cfg.template = []; end + +% this is a common mistake which can be accepted +if strcmp(cfg.method, 'realignfiducials') + cfg.method = 'realignfiducial'; +end + +if strcmp(cfg.method, 'warp') + % rename the default warp to one of the method recognized by the warping toolbox + cfg.method = 'traditional'; +end + +if strcmp(cfg.feedback, 'yes') + % use the global fb field to tell the warping toolbox to print feedback + global fb + fb = 1; +else + global fb + fb = 0; +end + +usetemplate = isfield(cfg, 'template') && ~isempty(cfg.template); +useheadshape = isfield(cfg, 'headshape') && ~isempty(cfg.headshape); + +if usetemplate + % get the template electrode definitions + if ~iscell(cfg.template) + cfg.template = {cfg.template}; + end + Ntemplate = length(cfg.template); + for i=1:Ntemplate + if isstruct(cfg.template{i}) + template(i) = cfg.template{i}; + else + template(i) = read_fcdc_elec(cfg.template{i}); + end + end +elseif useheadshape + % get the surface describing the head shape + if isstruct(cfg.headshape) && isfield(cfg.headshape, 'pnt') + % use the headshape surface specified in the configuration + headshape = cfg.headshape; + elseif isnumeric(cfg.headshape) && size(cfg.headshape,2)==3 + % use the headshape points specified in the configuration + headshape.pnt = cfg.headshape; + elseif ischar(cfg.headshape) && filetype(cfg.headshape, 'ctf_shape') + % read the headshape from file + headshape = read_ctf_shape(cfg.headshape); + elseif ischar(cfg.headshape) && filetype(cfg.headshape, '4d_hs') + % read the headshape from file + headshape = []; + headshape.pnt = read_bti_hs(cfg.headshape); + else + error('cfg.headshape is not specified correctly') + end + if ~isfield(headshape, 'tri') + % generate a closed triangulation from the surface points + headshape.tri = projecttri(headshape.pnt); + end +else + error('you should either specify template electrode positions, template fiducials or a head shape'); +end + +% get the electrode definition that should be warped +if isfield(cfg, 'elec') + elec = cfg.elec; +else + elec = read_fcdc_elec(cfg.elecfile); +end + +% remember the original electrode locations and labels +orig = elec; + +% convert all labels to lower case for string comparisons +% this has to be done AFTER keeping the original labels and positions +if strcmp(cfg.casesensitive, 'no') + for i=1:length(elec.label) + elec.label{i} = lower(elec.label{i}); + end + for j=1:length(template) + for i=1:length(template(j).label) + template(j).label{i} = lower(template(j).label{i}); + end + end +end + +if strcmp(cfg.feedback, 'yes') + % create an empty figure, continued below... + figure + axis equal + axis vis3d + hold on + xlabel('x') + ylabel('y') + zlabel('z') +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if usetemplate && any(strcmp(cfg.method, {'rigidbody', 'globalrescale', 'traditional', 'nonlin1', 'nonlin2', 'nonlin3', 'nonlin4', 'nonlin5'})) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % determine electrode selection and overlapping subset for warping + cfg.channel = channelselection(cfg.channel, elec.label); + for i=1:Ntemplate + cfg.channel = channelselection(cfg.channel, template(i).label); + end + + % make subselection of electrodes + [cfgsel, datsel] = match_str(cfg.channel, elec.label); + elec.label = elec.label(datsel); + elec.pnt = elec.pnt(datsel,:); + for i=1:Ntemplate + [cfgsel, datsel] = match_str(cfg.channel, template(i).label); + template(i).label = template(i).label(datsel); + template(i).pnt = template(i).pnt(datsel,:); + end + + % compute the average of the template electrode positions + all = []; + for i=1:Ntemplate + all = cat(3, all, template(i).pnt); + end + avg = mean(all,3); + stderr = std(all, [], 3); + + fprintf('warping electrodes to template... '); % the newline comes later + [norm.pnt, norm.m] = warp_optim(elec.pnt, avg, cfg.method); + norm.label = elec.label; + + dpre = mean(sqrt(sum((avg - elec.pnt).^2, 2))); + dpost = mean(sqrt(sum((avg - norm.pnt).^2, 2))); + fprintf('mean distance prior to warping %f, after warping %f\n', dpre, dpost); + + if strcmp(cfg.feedback, 'yes') + % plot all electrodes before warping + my_plot3(elec.pnt, 'r.'); + my_plot3(elec.pnt(1,:), 'r*'); + my_plot3(elec.pnt(2,:), 'r*'); + my_plot3(elec.pnt(3,:), 'r*'); + my_text3(elec.pnt(1,:), elec.label{1}, 'color', 'r'); + my_text3(elec.pnt(2,:), elec.label{2}, 'color', 'r'); + my_text3(elec.pnt(3,:), elec.label{3}, 'color', 'r'); + + % plot all electrodes after warping + my_plot3(norm.pnt, 'm.'); + my_plot3(norm.pnt(1,:), 'm*'); + my_plot3(norm.pnt(2,:), 'm*'); + my_plot3(norm.pnt(3,:), 'm*'); + my_text3(norm.pnt(1,:), norm.label{1}, 'color', 'm'); + my_text3(norm.pnt(2,:), norm.label{2}, 'color', 'm'); + my_text3(norm.pnt(3,:), norm.label{3}, 'color', 'm'); + + % plot the template electrode locations + my_plot3(avg, 'b.'); + my_plot3(avg(1,:), 'b*'); + my_plot3(avg(2,:), 'b*'); + my_plot3(avg(3,:), 'b*'); + my_text3(avg(1,:), norm.label{1}, 'color', 'b'); + my_text3(avg(2,:), norm.label{2}, 'color', 'b'); + my_text3(avg(3,:), norm.label{3}, 'color', 'b'); + + % plot lines connecting the input/warped electrode locations with the template locations + my_line3(elec.pnt, avg, 'color', 'r'); + my_line3(norm.pnt, avg, 'color', 'm'); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +elseif useheadshape && any(strcmp(cfg.method, {'rigidbody', 'globalrescale', 'traditional', 'nonlin1', 'nonlin2', 'nonlin3', 'nonlin4', 'nonlin5'})) + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % determine electrode selection and overlapping subset for warping + cfg.channel = channelselection(cfg.channel, elec.label); + + % make subselection of electrodes + [cfgsel, datsel] = match_str(cfg.channel, elec.label); + elec.label = elec.label(datsel); + elec.pnt = elec.pnt(datsel,:); + + fprintf('warping electrodes to head shape... '); % the newline comes later + [norm.pnt, norm.m] = warp_optim(elec.pnt, headshape, cfg.method); + norm.label = elec.label; + + dpre = warp_error([], elec.pnt, headshape, cfg.method); + dpost = warp_error(norm.m, elec.pnt, headshape, cfg.method); + fprintf('mean distance prior to warping %f, after warping %f\n', dpre, dpost); + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +elseif strcmp(cfg.method, 'realignfiducial') + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % try to determine the fiducials automatically if not specified + option1 = {'nasion' 'left' 'right'}; + option2 = {'nasion' 'lpa' 'rpa'}; + option3 = {'nz' 'lpa' 'rpa'}; + if ~isfield(cfg, 'fiducial') + if length(match_str(elec.label, option1))==3 + cfg.fiducial = option1; + elseif length(match_str(elec.label, option2))==3 + cfg.fiducial = option2; + elseif length(match_str(elec.label, option3))==3 + cfg.fiducial = option3; + else + error('could not determine three fiducials, please specify cfg.fiducial') + end + end + fprintf('using fiducials {''%s'', ''%s'', ''%s''}\n', cfg.fiducial{1}, cfg.fiducial{2}, cfg.fiducial{3}); + + % determine electrode selection + cfg.channel = channelselection(cfg.channel, elec.label); + [cfgsel, datsel] = match_str(cfg.channel, elec.label); + elec.label = elec.label(datsel); + elec.pnt = elec.pnt(datsel,:); + + if length(cfg.fiducial)~=3 + error('you must specify three fiducials'); + end + + % do case-insensitive search for fiducial locations + nas_indx = match_str(lower(elec.label), lower(cfg.fiducial{1})); + lpa_indx = match_str(lower(elec.label), lower(cfg.fiducial{2})); + rpa_indx = match_str(lower(elec.label), lower(cfg.fiducial{3})); + if length(nas_indx)~=1 || length(lpa_indx)~=1 || length(rpa_indx)~=1 + error('not all fiducials were found in the electrode set'); + end + elec_nas = elec.pnt(nas_indx,:); + elec_lpa = elec.pnt(lpa_indx,:); + elec_rpa = elec.pnt(rpa_indx,:); + + % find the matching fiducials in the template and average them + templ_nas = []; + templ_lpa = []; + templ_rpa = []; + for i=1:Ntemplate + nas_indx = match_str(lower(template(i).label), lower(cfg.fiducial{1})); + lpa_indx = match_str(lower(template(i).label), lower(cfg.fiducial{2})); + rpa_indx = match_str(lower(template(i).label), lower(cfg.fiducial{3})); + if length(nas_indx)~=1 || length(lpa_indx)~=1 || length(rpa_indx)~=1 + error(sprintf('not all fiducials were found in template %d', i)); + end + templ_nas(end+1,:) = template(i).pnt(nas_indx,:); + templ_lpa(end+1,:) = template(i).pnt(lpa_indx,:); + templ_rpa(end+1,:) = template(i).pnt(rpa_indx,:); + end + templ_nas = mean(templ_nas,1); + templ_lpa = mean(templ_lpa,1); + templ_rpa = mean(templ_rpa,1); + + % realign both to a common coordinate system + elec2common = headcoordinates(elec_nas, elec_lpa, elec_rpa); + templ2common = headcoordinates(templ_nas, templ_lpa, templ_rpa); + + % compute the combined transform and realign the electrodes to the template + norm = []; + norm.m = elec2common * inv(templ2common); + norm.pnt = warp_apply(norm.m, elec.pnt, 'homogeneous'); + norm.label = elec.label; + + nas_indx = match_str(lower(elec.label), lower(cfg.fiducial{1})); + lpa_indx = match_str(lower(elec.label), lower(cfg.fiducial{2})); + rpa_indx = match_str(lower(elec.label), lower(cfg.fiducial{3})); + dpre = mean(sqrt(sum((elec.pnt([nas_indx lpa_indx rpa_indx],:) - [templ_nas; templ_lpa; templ_rpa]).^2, 2))); + nas_indx = match_str(lower(norm.label), lower(cfg.fiducial{1})); + lpa_indx = match_str(lower(norm.label), lower(cfg.fiducial{2})); + rpa_indx = match_str(lower(norm.label), lower(cfg.fiducial{3})); + dpost = mean(sqrt(sum((norm.pnt([nas_indx lpa_indx rpa_indx],:) - [templ_nas; templ_lpa; templ_rpa]).^2, 2))); + fprintf('mean distance between fiducials prior to realignment %f, after realignment %f\n', dpre, dpost); + + if strcmp(cfg.feedback, 'yes') + % plot the first three electrodes before transformation + my_plot3(elec.pnt(1,:), 'r*'); + my_plot3(elec.pnt(2,:), 'r*'); + my_plot3(elec.pnt(3,:), 'r*'); + my_text3(elec.pnt(1,:), elec.label{1}, 'color', 'r'); + my_text3(elec.pnt(2,:), elec.label{2}, 'color', 'r'); + my_text3(elec.pnt(3,:), elec.label{3}, 'color', 'r'); + + % plot the template fiducials + my_plot3(templ_nas, 'b*'); + my_plot3(templ_lpa, 'b*'); + my_plot3(templ_rpa, 'b*'); + my_text3(templ_nas, ' nas', 'color', 'b'); + my_text3(templ_lpa, ' lpa', 'color', 'b'); + my_text3(templ_rpa, ' rpa', 'color', 'b'); + + % plot all electrodes after transformation + my_plot3(norm.pnt, 'm.'); + my_plot3(norm.pnt(1,:), 'm*'); + my_plot3(norm.pnt(2,:), 'm*'); + my_plot3(norm.pnt(3,:), 'm*'); + my_text3(norm.pnt(1,:), norm.label{1}, 'color', 'm'); + my_text3(norm.pnt(2,:), norm.label{2}, 'color', 'm'); + my_text3(norm.pnt(3,:), norm.label{3}, 'color', 'm'); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +elseif strcmp(cfg.method, 'interactive') + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % open a figure + fig = figure; + % add the data to the figure + set(fig, 'CloseRequestFcn', @cb_close); + setappdata(fig, 'elec', elec); + setappdata(fig, 'transform', eye(4)); + if useheadshape + setappdata(fig, 'surf', headshape); + end + if usetemplate + % FIXME interactive realigning to template electrodes is not yet supported + % this requires a consistent handling of channel selection etc. + setappdata(fig, 'template', template); + end + % add the GUI elements + cb_creategui(gca); + cb_redraw(gca); + rotate3d on + waitfor(fig); + % get the data from the figure that was left behind as global variable + global norm + tmp = norm; + clear global norm + norm = tmp; + clear tmp + +else + error('unknown method'); +end + +% apply the spatial transformation to all electrodes, and replace the +% electrode labels by their case-sensitive original values +if any(strcmp(cfg.method, {'rigidbody', 'globalrescale', 'traditional', 'nonlin1', 'nonlin2', 'nonlin3', 'nonlin4', 'nonlin5'})) + norm.pnt = warp_apply(norm.m, orig.pnt, cfg.method); +else + norm.pnt = warp_apply(norm.m, orig.pnt, 'homogenous'); +end +norm.label = orig.label; + +% add version information to the configuration +try + % get the full name of the function + cfg.version.name = mfilename('fullpath'); +catch + % required for compatibility with Matlab versions prior to release 13 (6.5) + [st, i] = dbstack; + cfg.version.name = st(i); +end +cfg.version.id = '$Id: electroderealign.m,v 1.1 2009/01/30 04:02:02 arno Exp $'; + +% remember the configuration +norm.cfg = cfg; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% some simple SUBFUNCTIONs that facilitate 3D plotting +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function h = my_plot3(xyz, varargin) +h = plot3(xyz(:,1), xyz(:,2), xyz(:,3), varargin{:}); +function h = my_text3(xyz, varargin) +h = text(xyz(:,1), xyz(:,2), xyz(:,3), varargin{:}); +function my_line3(xyzB, xyzE, varargin) +for i=1:size(xyzB,1) + line([xyzB(i,1) xyzE(i,1)], [xyzB(i,2) xyzE(i,2)], [xyzB(i,3) xyzE(i,3)], varargin{:}) +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SUBFUNCTION to layout a moderately complex graphical user interface +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function h = layoutgui(fig, geometry, position, style, string, value, tag, callback); +horipos = geometry(1); % lower left corner of the GUI part in the figure +vertpos = geometry(2); % lower left corner of the GUI part in the figure +width = geometry(3); % width of the GUI part in the figure +height = geometry(4); % height of the GUI part in the figure +horidist = 0.05; +vertdist = 0.05; +options = {'units', 'normalized', 'HorizontalAlignment', 'center'}; % 'VerticalAlignment', 'middle' +Nrow = size(position,1); +h = cell(Nrow,1); +for i=1:Nrow + if isempty(position{i}) + continue; + end + position{i} = position{i} ./ sum(position{i}); + Ncol = size(position{i},2); + ybeg = (Nrow-i )/Nrow + vertdist/2; + yend = (Nrow-i+1)/Nrow - vertdist/2; + for j=1:Ncol + xbeg = sum(position{i}(1:(j-1))) + horidist/2; + xend = sum(position{i}(1:(j ))) - horidist/2; + pos(1) = xbeg*width + horipos; + pos(2) = ybeg*height + vertpos; + pos(3) = (xend-xbeg)*width; + pos(4) = (yend-ybeg)*height; + h{i}{j} = uicontrol(fig, ... + options{:}, ... + 'position', pos, ... + 'style', style{i}{j}, ... + 'string', string{i}{j}, ... + 'tag', tag{i}{j}, ... + 'value', value{i}{j}, ... + 'callback', callback{i}{j} ... + ); + end +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function cb_creategui(hObject, eventdata, handles); +% define the position of each GUI element +position = { + [2 1 1 1] + [2 1 1 1] + [2 1 1 1] + [1] + [1] + [1] + [1] + [1 1] + }; + +% define the style of each GUI element +style = { + {'text' 'edit' 'edit' 'edit'} + {'text' 'edit' 'edit' 'edit'} + {'text' 'edit' 'edit' 'edit'} + {'pushbutton'} + {'pushbutton'} + {'toggle'} + {'toggle'} + {'text' 'edit'} + }; + +% define the descriptive string of each GUI element +string = { + {'rotate' 0 0 0} + {'translate' 0 0 0} + {'scale' 1 1 1} + {'redisplay'} + {'apply'} + {'toggle grid'} + {'toggle axes'} + {'alpha' 0.7} + }; + +% define the value of each GUI element +value = { + {[] [] [] []} + {[] [] [] []} + {[] [] [] []} + {[]} + {[]} + {0} + {0} + {[] []} + }; + +% define a tag for each GUI element +tag = { + {'' 'rx' 'ry' 'rz'} + {'' 'tx' 'ty' 'tz'} + {'' 'sx' 'sy' 'sz'} + {''} + {''} + {'toggle grid'} + {'toggle axes'} + {'' 'alpha'} + }; + +% define the callback function of each GUI element +callback = { + {[] @cb_redraw @cb_redraw @cb_redraw} + {[] @cb_redraw @cb_redraw @cb_redraw} + {[] @cb_redraw @cb_redraw @cb_redraw} + {@cb_redraw} + {@cb_apply} + {@cb_redraw} + {@cb_redraw} + {[] @cb_redraw} + }; + +fig = get(hObject, 'parent'); +layoutgui(fig, [0.7 0.05 0.25 0.50], position, style, string, value, tag, callback); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function cb_redraw(hObject, eventdata, handles); +fig = get(hObject, 'parent'); +surf = getappdata(fig, 'surf'); +elec = getappdata(fig, 'elec'); +template = getappdata(fig, 'template'); +% get the transformation details +rx = str2num(get(findobj(fig, 'tag', 'rx'), 'string')); +ry = str2num(get(findobj(fig, 'tag', 'ry'), 'string')); +rz = str2num(get(findobj(fig, 'tag', 'rz'), 'string')); +tx = str2num(get(findobj(fig, 'tag', 'tx'), 'string')); +ty = str2num(get(findobj(fig, 'tag', 'ty'), 'string')); +tz = str2num(get(findobj(fig, 'tag', 'tz'), 'string')); +sx = str2num(get(findobj(fig, 'tag', 'sx'), 'string')); +sy = str2num(get(findobj(fig, 'tag', 'sy'), 'string')); +sz = str2num(get(findobj(fig, 'tag', 'sz'), 'string')); +R = rotate ([rx ry rz]); +T = translate([tx ty tz]); +S = scale ([sx sy sz]); +H = S * T * R; +elec.pnt = warp_apply(H, elec.pnt); +axis vis3d; cla +xlabel('x') +ylabel('y') +zlabel('z') +if ~isempty(surf) + triplot(surf.pnt, surf.tri, [], 'faces_skin'); + alpha(str2num(get(findobj(fig, 'tag', 'alpha'), 'string'))); +end +if ~isempty(template) + triplot(template.pnt, [], [], 'nodes_blue') +end +triplot(elec.pnt, [], [], 'nodes'); +if isfield(elec, 'line') + triplot(elec.pnt, elec.line, [], 'edges'); +end +if get(findobj(fig, 'tag', 'toggle axes'), 'value') + axis on +else + axis off +end +if get(findobj(fig, 'tag', 'toggle grid'), 'value') + grid on +else + grid off +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function cb_apply(hObject, eventdata, handles); +fig = get(hObject, 'parent'); +elec = getappdata(fig, 'elec'); +transform = getappdata(fig, 'transform'); +% get the transformation details +rx = str2num(get(findobj(fig, 'tag', 'rx'), 'string')); +ry = str2num(get(findobj(fig, 'tag', 'ry'), 'string')); +rz = str2num(get(findobj(fig, 'tag', 'rz'), 'string')); +tx = str2num(get(findobj(fig, 'tag', 'tx'), 'string')); +ty = str2num(get(findobj(fig, 'tag', 'ty'), 'string')); +tz = str2num(get(findobj(fig, 'tag', 'tz'), 'string')); +sx = str2num(get(findobj(fig, 'tag', 'sx'), 'string')); +sy = str2num(get(findobj(fig, 'tag', 'sy'), 'string')); +sz = str2num(get(findobj(fig, 'tag', 'sz'), 'string')); +R = rotate ([rx ry rz]); +T = translate([tx ty tz]); +S = scale ([sx sy sz]); +H = S * T * R; +elec.pnt = warp_apply(H, elec.pnt); +transform = H * transform; +set(findobj(fig, 'tag', 'rx'), 'string', 0); +set(findobj(fig, 'tag', 'ry'), 'string', 0); +set(findobj(fig, 'tag', 'rz'), 'string', 0); +set(findobj(fig, 'tag', 'tx'), 'string', 0); +set(findobj(fig, 'tag', 'ty'), 'string', 0); +set(findobj(fig, 'tag', 'tz'), 'string', 0); +set(findobj(fig, 'tag', 'sx'), 'string', 1); +set(findobj(fig, 'tag', 'sy'), 'string', 1); +set(findobj(fig, 'tag', 'sz'), 'string', 1); +setappdata(fig, 'elec', elec); +setappdata(fig, 'transform', transform); +cb_redraw(hObject); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function cb_close(hObject, eventdata, handles); +% make the current transformation permanent and subsequently allow deleting the figure +cb_apply(gca); +% get the updated electrode from the figure +fig = hObject; +% hmmm, this is ugly +global norm +norm = getappdata(fig, 'elec'); +norm.m = getappdata(fig, 'transform'); +set(fig, 'CloseRequestFcn', @delete); +delete(fig); diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/fieldtripchan2eeglab.m b/code/eeglab13_4_4b/plugins/dipfit2.3/fieldtripchan2eeglab.m new file mode 100644 index 0000000..8a14b7a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/fieldtripchan2eeglab.m @@ -0,0 +1,43 @@ +% fieldtripchan2eeglab() - convert Fieldtrip channel location structure +% to EEGLAB channel location structure +% +% Usage: +% >> chanlocs = fieldtripchan2eeglab( fieldlocs ); +% +% Inputs: +% fieldlocs - Fieldtrip channel structure. See help readlocs() +% +% Outputs: +% chanlocs - EEGLAB channel location structure. +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2006- +% +% See also: readlocs() + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function chanlocs = fieldtripchan2eeglab( loc ); + + if nargin < 1 + help fieldtripchan2eeglab; + return; + end; + + chanlocs = struct('labels', loc.label(:)', 'X', mattocell(loc.pnt(:,1)'), ... + 'Y', mattocell(loc.pnt(:,2)'), ... + 'Z', mattocell(loc.pnt(:,3)')); + chanlocs = convertlocs(chanlocs, 'cart2all'); diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/headcoordinates.m b/code/eeglab13_4_4b/plugins/dipfit2.3/headcoordinates.m new file mode 100644 index 0000000..cf3013a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/headcoordinates.m @@ -0,0 +1,83 @@ +function [h] = headcoordinates(nas, lpa, rpa, flag); + +% HEADCOORDINATES returns the homogenous coordinate transformation matrix +% that converts the specified fiducials in any coordinate system (e.g. MRI) +% into the rotated and translated headccordinate system. +% +% [h] = headcoordinates(nas, lpa, rpa, flag) or +% [h] = headcoordinates(pt1, pt2, pt3, flag) +% +% The optional flag determines how the origin should be specified +% according to CTF conventions: flag = 0 (default) +% according to ASA conventions: flag = 1 +% according to FTG conventions: flag = 2 +% +% The headcoordinate system in CTF is defined as follows: +% the origin is exactly between lpa and rpa +% the X-axis goes towards nas +% the Y-axis goes approximately towards lpa, orthogonal to X and in the plane spanned by the fiducials +% the Z-axis goes approximately towards the vertex, orthogonal to X and Y +% +% The headcoordinate system in ASA is defined as follows: +% the origin is at the orthogonal intersection of the line from rpa-rpa and the line trough nas +% the X-axis goes towards nas +% the Y-axis goes through rpa and lpa +% the Z-axis goes approximately towards the vertex, orthogonal to X and Y +% +% The headcoordinate system in FTG is defines as: +% the origin corresponds with pt1 +% the x-axis is along the line from pt1 to pt2 +% the z-axis is orthogonal to the plane spanned by pt1, pt2 and pt3 +% +% See also WARPING, WARP3D + +% Copyright (C) 2003 Robert Oostenveld +% +if nargin<4 + flag=0; +end + +% ensure that they are row vectors +lpa = lpa(:)'; +rpa = rpa(:)'; +nas = nas(:)'; + +% compute the origin and direction of the coordinate axes in MRI coordinates +if flag==0 + % follow CTF convention + origin = [lpa+rpa]/2; + dirx = nas-origin; + dirx = dirx/norm(dirx); + dirz = cross(dirx,lpa-rpa); + dirz = dirz/norm(dirz); + diry = cross(dirz,dirx); +elseif flag==1 + % follow ASA convention + dirz = cross(nas-rpa, lpa-rpa); + diry = lpa-rpa; + dirx = cross(diry,dirz); + dirz = dirz/norm(dirz); + diry = diry/norm(diry); + dirx = dirx/norm(dirx); + origin = rpa + dot(nas-rpa,diry)*diry; +elseif flag==2 + % rename the marker points for convenience + pt1 = nas; pt2 = lpa; pt3 = rpa; + % follow FTG conventions + origin = pt1; + dirx = pt2-origin; + dirx = dirx/norm(dirx); + diry = pt3-origin; + dirz = cross(dirx,diry); + dirz = dirz/norm(dirz); + diry = cross(dirz,dirx); +end + +% compute the rotation matrix +rot = eye(4); +rot(1:3,1:3) = inv(eye(3) / [dirx; diry; dirz]); +% compute the translation matrix +tra = eye(4); +tra(1:4,4) = [-origin(:); 1]; +% compute the full homogenous transformation matrix from these two +h = rot * tra; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/homogenous2traditional.m b/code/eeglab13_4_4b/plugins/dipfit2.3/homogenous2traditional.m new file mode 100644 index 0000000..24eefd9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/homogenous2traditional.m @@ -0,0 +1,193 @@ +function f = homogenous2traditional(H) + +% HOMOGENOUS2TRADITIONAL estimates the traditional translation, rotation +% and scaling parameters from a homogenous transformation matrix. It will +% give an error if the homogenous matrix also describes a perspective +% transformation. +% +% Use as +% f = homogenous2traditional(H) +% where H is a 4x4 homogenous transformation matrix and f is a vector with +% nine elements describing +% x-shift +% y-shift +% z-shift +% followed by the +% pitch (rotation around x-axis) +% roll (rotation around y-axis) +% yaw (rotation around z-axis) +% followed by the +% x-rescaling factor +% y-rescaling factor +% z-rescaling factor +% +% The order in which the transformations would be done is exactly opposite +% as the list above, i.e. first z-rescale ... and finally x-shift. + +% Copyright (C) 2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% remember the input homogenous transformation matrix +Horg = H; + +% The homogenous transformation matrix is built up according to +% H = T * R * S +% where +% R = Rx * Ry * Rz + +% estimate the translation +tx = H(1,4); +ty = H(2,4); +tz = H(3,4); +T = [ + 1 0 0 tx + 0 1 0 ty + 0 0 1 tz + 0 0 0 1 + ]; +% recompute the homogenous matrix excluding the translation +H = inv(T) * H; + +% estimate the scaling +sx = norm(H(1:3,1)); +sy = norm(H(1:3,2)); +sz = norm(H(1:3,3)); +S = [ + sx 0 0 0 + 0 sy 0 0 + 0 0 sz 0 + 0 0 0 1 + ]; +% recompute the homogenous matrix excluding the scaling +H = H * inv(S); + +% the difficult part is to determine the rotations +% the order of the rotations matters + +% compute the rotation using a probe point on the z-axis +p = H * [0 0 1 0]'; +% the rotation around the y-axis is resulting in an offset in the positive x-direction +ry = asin(p(1)); + +% the rotation around the x-axis can be estimated by the projection on the yz-plane +if abs(p(2))= 0): +% +% X'= 0.9900X +% +% Y'= 0.9688Y +0.0460Z +% +% Z'= -0.0485Y +0.9189Z +% +% +% Below the AC (Z < 0): +% +% X'= 0.9900X +% +% Y'= 0.9688Y +0.0420Z +% +% Z'= -0.0485Y +0.8390Z +% +% +% The matlab function mni2tal.m implements these transforms. +% It returns estimated Talairach coordinates, from the +% transformations above, for given points in the MNI brain. +% To use it, save as mni2tal.m somewhere on your matlab path. +% +% So, taking our example point in the MNI brain, X = 10mm, Y = 12mm, Z = 14mm: +% +% With the mni2tal.m function above on your path, you could +% type the following at the matlab prompt: +% +% +% mni2tal([10 12 14]) +% +% Which would give the following output (see above): +% +% +% ans = +% +% 9.9000 12.2692 12.2821 +% +% +% which is, again, an estimate of the equivalent X, Y and Z +% coordinates in the Talairach brain. +% +% The inverse function, tal2mni.m, gives MNI coordinates for +% given Talairach coordinates, using the same algorithm. +% +% We could of course do a more complex transform to attempt +% to make a closer match between the two brains. The approach +% above is only intended to be preliminary. It does have the +% advantage that it is very simple, and therefore the distortions +% involved are easy to visualise, and unlikely to have dramatic +% unexpected effects. +% +% Incidentally, if you use the above transform, and you want to +% cite it, I suggest that you cite this web address. The transform +% is also mentioned briefly in the following papers: Duncan, J., +% Seitz, R.J., Kolodny, J., Bor, D., Herzog, H., Ahmed, A., Newell, F.N., +% Emslie, H. "A neural basis for General Intelligence", Science (21 July +% 2000), 289 (5478), 457-460; Calder, A.J., Lawrence, A.D. and +% Young,A.W. "Neuropsychology of Fear and Loathing" Nature Reviews +% Neuroscience (2001), Vol.2 No.5 352-363 +% diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_batch.m b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_batch.m new file mode 100644 index 0000000..5348776 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_batch.m @@ -0,0 +1,57 @@ +% pop_dipfit_batch() - interactively do batch scan of all ICA components +% with a single dipole +% Function deprecated. Use pop_dipfit_gridsearch() +% instead +% +% Usage: +% >> OUTEEG = pop_dipfit_batch( INEEG ); % pop up interactive window +% >> OUTEEG = pop_dipfit_batch( INEEG, comps ); +% >> OUTEEG = pop_dipfit_batch( INEEG, comps, xgrid, ygrid, zgrid, thresh ) +% +% Inputs: +% INEEG - input dataset +% comps - [integer array] component indices +% xgrid - [float array] x-grid. Default is 10 elements between +% -1 and 1. +% ygrid - [float array] y-grid. Default is 10 elements between +% -1 and 1. +% zgrid - [float array] z-grid. Default is 10 elements between +% -1 and 1. +% threshold - [float] threshold in percent. Default 40. +% +% Outputs: +% OUTEEG output dataset +% +% Authors: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 +% Arnaud Delorme, SCCN, La Jolla 2003 + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl/ + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@miba.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [OUTEEG, com] = pop_dipfit_batch( varargin ) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin<1 + help pop_dipfit_batch; + return +else + disp('Warning: pop_dipfit_manual is outdated. Use pop_dipfit_nonlinear instead'); + [OUTEEG, com] = pop_dipfit_gridsearch( varargin{:} ); +end; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_gridsearch.m b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_gridsearch.m new file mode 100644 index 0000000..cbebbea --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_gridsearch.m @@ -0,0 +1,143 @@ +% pop_dipfit_gridsearch() - scan all ICA components with a single dipole +% on a regular grid spanning the whole brain. Any dipoles that explains +% a component with a too large relative residual variance is removed. +% +% Usage: +% >> EEGOUT = pop_dipfit_gridsearch( EEGIN ); % pop up interactive window +% >> EEGOUT = pop_dipfit_gridsearch( EEGIN, comps ); +% >> EEGOUT = pop_dipfit_gridsearch( EEGIN, comps, xgrid, ygrid, zgrid, thresh ) +% +% Inputs: +% EEGIN - input dataset +% comps - [integer array] component indices +% xgrid - [float array] x-grid. Default is 10 elements between +% -1 and 1. +% ygrid - [float array] y-grid. Default is 10 elements between +% -1 and 1. +% zgrid - [float array] z-grid. Default is 10 elements between +% -1 and 1. +% thresh - [float] threshold in percent. Default 40. +% +% Outputs: +% EEGOUT output dataset +% +% Authors: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 +% Arnaud Delorme, SCCN, La Jolla 2003 +% Thanks to Nicolas Robitaille for his help on the CTF MEG +% implementation + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl/ + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@smi.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [EEGOUT, com] = pop_dipfit_gridsearch(EEG, select, xgrid, ygrid, zgrid, reject ); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin < 1 + help pop_dipfit_gridsearch; + return; +end; + +if ~plugin_askinstall('Fieldtrip-lite', 'ft_sourceanalysis'), return; end; + +EEGOUT = EEG; +com = ''; + +if ~isfield(EEG, 'chanlocs') + error('No electrodes present'); +end + +if ~isfield(EEG, 'icawinv') + error('No ICA components to fit'); +end + +if ~isfield(EEG, 'dipfit') + error('General dipolefit settings not specified'); +end + +if ~isfield(EEG.dipfit, 'vol') & ~isfield(EEG.dipfit, 'hdmfile') + error('Dipolefit volume conductor model not specified'); +end + +dipfitdefs +if strcmpi(EEG.dipfit.coordformat, 'CTF') + maxrad = 8.5; + xgridstr = sprintf('linspace(-%2.1f,%2.1f,11)', maxrad, maxrad); + ygridstr = sprintf('linspace(-%2.1f,%2.1f,11)', maxrad, maxrad); + zgridstr = sprintf('linspace(0,%2.1f,6)', maxrad); +end; +if nargin < 2 + % get the default values and filenames + promptstr = { 'Component(s) (not faster if few comp.)', ... + 'Grid in X-direction', ... + 'Grid in Y-direction', ... + 'Grid in Z-direction', ... + 'Rejection threshold RV(%)' }; + + inistr = { + [ '1:' int2str(size(EEG.icawinv,2)) ], ... + xgridstr, ... + ygridstr, ... + zgridstr, ... + rejectstr }; + + result = inputdlg2( promptstr, 'Batch dipole fit -- pop_dipfit_gridsearch()', 1, inistr, 'pop_dipfit_gridsearch'); + + if length(result)==0 + % user pressed cancel + return + end + + select = eval( [ '[' result{1} ']' ]); + xgrid = eval( result{2} ); + ygrid = eval( result{3} ); + zgrid = eval( result{4} ); + reject = eval( result{5} ) / 100; % string is in percent + options = { }; + else + if nargin < 2 + select = [1:size(EEG.icawinv,2)]; + end; + if nargin < 3 + xgrid = eval( xgridstr ); + end; + if nargin < 4 + ygrid = eval( ygridstr ); + end; + if nargin < 5 + zgrid = eval( zgridstr ); + end; + if nargin < 6 + reject = eval( rejectstr ); + end; + options = { 'waitbar' 'none' }; + end; + + % perform batch fit with single dipole for all selected channels and components + % warning off; + warning backtrace off; + EEGOUT = dipfit_gridsearch(EEG, 'component', select, 'xgrid', xgrid, 'ygrid', ygrid, 'zgrid', zgrid, options{:}); + warning backtrace on; + EEGOUT.dipfit.model = dipfit_reject(EEGOUT.dipfit.model, reject); + + % FIXME reject is not being used at the moment + disp('Done'); + com = sprintf('%s = pop_dipfit_gridsearch(%s, %s);', ... + inputname(1), inputname(1), vararg2str( { select xgrid, ygrid, zgrid reject })); + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_manual.m b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_manual.m new file mode 100644 index 0000000..35f89b7 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_manual.m @@ -0,0 +1,45 @@ +% pop_dipfit_manual() - interactively do dipole fit of selected ICA components +% Function deprecated. Use pop_dipfit_nonlinear() +% instead +% Usage: +% >> OUTEEG = pop_dipfit_manual( INEEG ) +% +% Inputs: +% INEEG input dataset +% +% Outputs: +% OUTEEG output dataset +% +% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 +% Arnaud Delorme, SCCN, La Jolla 2003 + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl/ + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@miba.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [OUTEEG, com] = pop_dipfit_manual( varargin ) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin<1 + help pop_dipfit_manual; + return +else + disp('Warning: pop_dipfit_manual is outdated. Use pop_dipfit_nonlinear instead'); + [OUTEEG, com] = pop_dipfit_nonlinear( varargin{:} ); +end; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_nonlinear.m b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_nonlinear.m new file mode 100644 index 0000000..08fc736 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_nonlinear.m @@ -0,0 +1,414 @@ +% pop_dipfit_nonlinear() - interactively do dipole fit of selected ICA components +% +% Usage: +% >> EEGOUT = pop_dipfit_nonlinear( EEGIN ) +% +% Inputs: +% EEGIN input dataset +% +% Outputs: +% EEGOUT output dataset +% +% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003 +% Arnaud Delorme, SCCN, La Jolla 2003 +% Thanks to Nicolas Robitaille for his help on the CTF MEG +% implementation + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl/ + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@smi.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [EEGOUT, com] = pop_dipfit_nonlinear( EEG, subfunction, parent, dipnum ) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% the code for this interactive dialog has 4 major parts +% - draw the graphical user interface +% - synchronize the gui with the data +% - synchronize the data with the gui +% - execute the actual dipole analysis + +% the subfunctions that perform handling of the gui are +% - dialog_selectcomponent +% - dialog_checkinput +% - dialog_setvalue +% - dialog_getvalue +% - dialog_plotmap +% - dialog_plotcomponent +% - dialog_flip +% the subfunctions that perform the fitting are +% - dipfit_position +% - dipfit_moment + +if ~plugin_askinstall('Fieldtrip-lite', 'ft_sourceanalysis'), return; end; + +if nargin<1 + help pop_dipfit_nonlinear; + return +elseif nargin==1 + + EEGOUT = EEG; + com = ''; + + if ~isfield(EEG, 'chanlocs') + error('No electrodes present'); + end + + if ~isfield(EEG, 'icawinv') + error('No ICA components to fit'); + end + + if ~isfield(EEG, 'dipfit') + error('General dipolefit settings not specified'); + end + + if ~isfield(EEG.dipfit, 'vol') & ~isfield(EEG.dipfit, 'hdmfile') + error('Dipolefit volume conductor model not specified'); + end + + % select all ICA components as 'fitable' + select = 1:size(EEG.icawinv,2); + if ~isfield(EEG.dipfit, 'current') + % select the first component as the current component + EEG.dipfit.current = 1; + end + + % verify the presence of a dipole model + if ~isfield(EEG.dipfit, 'model') + % create empty dipole model for each component + for i=select + EEG.dipfit.model(i).posxyz = zeros(2,3); + EEG.dipfit.model(i).momxyz = zeros(2,3); + EEG.dipfit.model(i).rv = 1; + EEG.dipfit.model(i).select = [1]; + end + end + + % verify the size of each dipole model + for i=select + if ~isfield(EEG.dipfit.model, 'posxyz') | length(EEG.dipfit.model) < i | isempty(EEG.dipfit.model(i).posxyz) + % replace all empty dipole models with a two dipole model, of which one is active + EEG.dipfit.model(i).select = [1]; + EEG.dipfit.model(i).rv = 1; + EEG.dipfit.model(i).posxyz = zeros(2,3); + EEG.dipfit.model(i).momxyz = zeros(2,3); + elseif size(EEG.dipfit.model(i).posxyz,1)==1 + % replace all one dipole models with a two dipole model + EEG.dipfit.model(i).select = [1]; + EEG.dipfit.model(i).posxyz = [EEG.dipfit.model(i).posxyz; [0 0 0]]; + EEG.dipfit.model(i).momxyz = [EEG.dipfit.model(i).momxyz; [0 0 0]]; + elseif size(EEG.dipfit.model(i).posxyz,1)>2 + % replace all more-than-two dipole models with a two dipole model + warning('pruning dipole model to two dipoles'); + EEG.dipfit.model(i).select = [1]; + EEG.dipfit.model(i).posxyz = EEG.dipfit.model(i).posxyz(1:2,:); + EEG.dipfit.model(i).momxyz = EEG.dipfit.model(i).momxyz(1:2,:); + end + end + + % default is not to use symmetry constraint + constr = []; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % construct the graphical user interface + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + % define the callback functions for the interface elements + cb_plotmap = 'pop_dipfit_nonlinear(EEG, ''dialog_plotmap'', gcbf);'; + cb_selectcomponent = 'pop_dipfit_nonlinear(EEG, ''dialog_selectcomponent'', gcbf);'; + cb_checkinput = 'pop_dipfit_nonlinear(EEG, ''dialog_checkinput'', gcbf);'; + cb_fitposition = 'pop_dipfit_nonlinear(EEG, ''dialog_getvalue'', gcbf); pop_dipfit_nonlinear(EEG, ''dipfit_position'', gcbf); pop_dipfit_nonlinear(EEG, ''dialog_setvalue'', gcbf);'; + cb_fitmoment = 'pop_dipfit_nonlinear(EEG, ''dialog_getvalue'', gcbf); pop_dipfit_nonlinear(EEG, ''dipfit_moment'' , gcbf); pop_dipfit_nonlinear(EEG, ''dialog_setvalue'', gcbf);'; + cb_close = 'close(gcbf)'; + cb_help = 'pophelp(''pop_dipfit_nonlinear'');'; + cb_ok = 'uiresume(gcbf);'; + cb_plotdip = 'pop_dipfit_nonlinear(EEG, ''dialog_plotcomponent'', gcbf);'; + cb_flip1 = 'pop_dipfit_nonlinear(EEG, ''dialog_flip'', gcbf, 1);'; + cb_flip2 = 'pop_dipfit_nonlinear(EEG, ''dialog_flip'', gcbf, 2);'; + cb_sym = [ 'set(findobj(gcbf, ''tag'', ''dip2sel''), ''value'', 1);' cb_checkinput ]; + + % vertical layout for each line + geomvert = [1 1 1 1 1 1 1 1 1]; + + % horizontal layout for each line + geomhoriz = { + [0.8 0.5 0.8 1 1] + [1] + [0.7 0.7 2 2 1] + [0.7 0.5 0.2 2 2 1] + [0.7 0.5 0.2 2 2 1] + [1] + [1 1 1] + [1] + [1 1 1] + }; + + % define each individual graphical user element + elements = { ... + { 'style' 'text' 'string' 'Component to fit' } ... + { 'style' 'edit' 'string' 'dummy' 'tag' 'component' 'callback' cb_selectcomponent } ... + { 'style' 'pushbutton' 'string' 'Plot map' 'callback' cb_plotmap } ... + { 'style' 'text' 'string' 'Residual variance = ' } ... + { 'style' 'text' 'string' 'dummy' 'tag' 'relvar' } ... + { } ... + { 'style' 'text' 'string' 'dipole' } ... + { 'style' 'text' 'string' 'fit' } ... + { 'style' 'text' 'string' 'position' } ... + { 'style' 'text' 'string' 'moment' } ... + { } ... + ... + { 'style' 'text' 'string' '#1' 'tag' 'dip1' } ... + { 'style' 'checkbox' 'string' '' 'tag' 'dip1sel' 'callback' cb_checkinput } { } ... + { 'style' 'edit' 'string' '' 'tag' 'dip1pos' 'callback' cb_checkinput } ... + { 'style' 'edit' 'string' '' 'tag' 'dip1mom' 'callback' cb_checkinput } ... + { 'style' 'pushbutton' 'string' 'Flip (in|out)' 'callback' cb_flip1 } ... + ... + { 'style' 'text' 'string' '#2' 'tag' 'dip2' } ... + { 'style' 'checkbox' 'string' '' 'tag' 'dip2sel' 'callback' cb_checkinput } { } ... + { 'style' 'edit' 'string' '' 'tag' 'dip2pos' 'callback' cb_checkinput } ... + { 'style' 'edit' 'string' '' 'tag' 'dip2mom' 'callback' cb_checkinput } ... + { 'style' 'pushbutton' 'string' 'Flip (in|out)' 'callback' cb_flip2 } ... + ... + { } { 'style' 'checkbox' 'string' 'Symmetry constrain for dipole #2' 'tag' 'dip2sym' 'callback' cb_sym 'value' 1 } ... + { } { } { } ... + { 'style' 'pushbutton' 'string' 'Fit dipole(s)'' position & moment' 'callback' cb_fitposition } ... + { 'style' 'pushbutton' 'string' 'OR fit only dipole(s)'' moment' 'callback' cb_fitmoment } ... + { 'style' 'pushbutton' 'string' 'Plot dipole(s)' 'callback' cb_plotdip } ... + }; + + % add the cancel, help and ok buttons at the bottom + + geomvert = [geomvert 1 1]; + + geomhoriz = {geomhoriz{:} [1] [1 1 1]}; + + elements = { elements{:} ... + { } ... + { 'Style', 'pushbutton', 'string', 'Cancel', 'callback', cb_close } ... + { 'Style', 'pushbutton', 'string', 'Help', 'callback', cb_help } ... + { 'Style', 'pushbutton', 'string', 'OK', 'callback', cb_ok } ... + }; + + % activate the graphical interface + supergui(0, geomhoriz, geomvert, elements{:}); + dlg = gcf; + set(gcf, 'name', 'Manual dipole fit -- pop_dipfit_nonlinear()'); + set(gcf, 'userdata', EEG); + pop_dipfit_nonlinear(EEG, 'dialog_setvalue', dlg); + uiwait(dlg); + if ishandle(dlg) + pop_dipfit_nonlinear(EEG, 'dialog_getvalue', dlg); + % FIXME, rv is undefined since the user may have changed dipole parameters + % FIXME, see also dialog_getvalue subfucntion + EEGOUT = get(dlg, 'userdata'); + close(dlg); + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % implement all subfunctions through a switch-yard + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +elseif nargin>=3 + + %disp(subfunction) + EEG = get(parent, 'userdata'); + + switch subfunction + + case 'dialog_selectcomponent' + current = get(findobj(parent, 'tag', 'component'), 'string'); + current = str2num(current); + current = current(1); + current = min(current, size(EEG.icaweights,1)); + current = max(current, 1); + set(findobj(parent, 'tag', 'component'), 'string', int2str(current)); + EEG.dipfit.current = current; + % reassign the global EEG object back to the dialogs userdata + set(parent, 'userdata', EEG); + % redraw the dialog with the current model + pop_dipfit_nonlinear(EEG, 'dialog_setvalue', parent); + + case 'dialog_plotmap' + current = str2num(get(findobj(parent, 'tag', 'component'), 'string')); + figure; pop_topoplot(EEG, 0, current, [ 'IC ' num2str(current) ], [1 1], 1); + title([ 'IC ' int2str(current) ]); + + case 'dialog_plotcomponent' + current = get(findobj(parent, 'tag', 'component'), 'string'); + EEG.dipfit.current = str2num(current); + if ~isempty( EEG.dipfit.current ) + pop_dipplot(EEG, 'DIPFIT', EEG.dipfit.current, 'normlen', 'on', 'projlines', 'on', 'mri', EEG.dipfit.mrifile); + end; + + case 'dialog_checkinput' + if get(findobj(parent, 'tag', 'dip1sel'), 'value') & ~get(findobj(parent, 'tag', 'dip1act'), 'value') + set(findobj(parent, 'tag', 'dip1act'), 'value', 1); + end + if get(findobj(parent, 'tag', 'dip2sel'), 'value') & ~get(findobj(parent, 'tag', 'dip2act'), 'value') + set(findobj(parent, 'tag', 'dip2act'), 'value', 1); + end + if ~all(size(str2num(get(findobj(parent, 'tag', 'dip1pos'), 'string')))==[1 3]) + set(findobj(parent, 'tag', 'dip1pos'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).posxyz(1,:))); + else + EEG.dipfit.model(EEG.dipfit.current).posxyz(1,:) = str2num(get(findobj(parent, 'tag', 'dip1pos'), 'string')); + end + if ~all(size(str2num(get(findobj(parent, 'tag', 'dip2pos'), 'string')))==[1 3]) + set(findobj(parent, 'tag', 'dip2pos'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).posxyz(2,:))); + else + EEG.dipfit.model(EEG.dipfit.current).posxyz(2,:) = str2num(get(findobj(parent, 'tag', 'dip2pos'), 'string')); + end + if ~all(size(str2num(get(findobj(parent, 'tag', 'dip1mom'), 'string')))==[1 3]) + set(findobj(parent, 'tag', 'dip1mom'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).momxyz(1,:))); + else + EEG.dipfit.model(EEG.dipfit.current).momxyz(1,:) = str2num(get(findobj(parent, 'tag', 'dip1mom'), 'string')); + end + if ~all(size(str2num(get(findobj(parent, 'tag', 'dip2mom'), 'string')))==[1 3]) + set(findobj(parent, 'tag', 'dip2mom'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).momxyz(2,:))); + else + EEG.dipfit.model(EEG.dipfit.current).momxyz(2,:) = str2num(get(findobj(parent, 'tag', 'dip2mom'), 'string')); + end + if get(findobj(parent, 'tag', 'dip2sel'), 'value') & get(findobj(parent, 'tag', 'dip2sym'), 'value') & ~get(findobj(parent, 'tag', 'dip1sel'), 'value') + set(findobj(parent, 'tag', 'dip2sel'), 'value', 0); + end + set(parent, 'userdata', EEG); + + case 'dialog_setvalue' + % synchronize the gui with the data + set(findobj(parent, 'tag', 'component'), 'string', EEG.dipfit.current); + set(findobj(parent, 'tag', 'relvar' ), 'string', sprintf('%0.2f%%', EEG.dipfit.model(EEG.dipfit.current).rv * 100)); + set(findobj(parent, 'tag', 'dip1sel'), 'value', ismember(1, EEG.dipfit.model(EEG.dipfit.current).select)); + set(findobj(parent, 'tag', 'dip2sel'), 'value', ismember(2, EEG.dipfit.model(EEG.dipfit.current).select)); + set(findobj(parent, 'tag', 'dip1pos'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).posxyz(1,:))); + if strcmpi(EEG.dipfit.coordformat, 'CTF') + set(findobj(parent, 'tag', 'dip1mom'), 'string', sprintf('%f %f %f', EEG.dipfit.model(EEG.dipfit.current).momxyz(1,:))); + else set(findobj(parent, 'tag', 'dip1mom'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).momxyz(1,:))); + end; + Ndipoles = size(EEG.dipfit.model(EEG.dipfit.current).posxyz, 1); + if Ndipoles>=2 + set(findobj(parent, 'tag', 'dip2pos'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).posxyz(2,:))); + if strcmpi(EEG.dipfit.coordformat, 'CTF') + set(findobj(parent, 'tag', 'dip2mom'), 'string', sprintf('%f %f %f', EEG.dipfit.model(EEG.dipfit.current).momxyz(2,:))); + else set(findobj(parent, 'tag', 'dip2mom'), 'string', sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(EEG.dipfit.current).momxyz(2,:))); + end; + end + + case 'dialog_getvalue' + % synchronize the data with the gui + if get(findobj(parent, 'tag', 'dip1sel'), 'value'); select = [1]; else select = []; end; + if get(findobj(parent, 'tag', 'dip2sel'), 'value'); select = [select 2]; end; + posxyz(1,:) = str2num(get(findobj(parent, 'tag', 'dip1pos'), 'string')); + posxyz(2,:) = str2num(get(findobj(parent, 'tag', 'dip2pos'), 'string')); + momxyz(1,:) = str2num(get(findobj(parent, 'tag', 'dip1mom'), 'string')); + momxyz(2,:) = str2num(get(findobj(parent, 'tag', 'dip2mom'), 'string')); + % assign the local values to the global EEG object + EEG.dipfit.model(EEG.dipfit.current).posxyz = posxyz; + EEG.dipfit.model(EEG.dipfit.current).momxyz = momxyz; + EEG.dipfit.model(EEG.dipfit.current).select = select; + % FIXME, rv is undefined after a manual change of parameters + % FIXME, this should either be undated continuously or upon OK buttonpress + % EEG.dipfit.model(EEG.dipfit.current).rv = nan; + + % reassign the global EEG object back to the dialogs userdata + set(parent, 'userdata', EEG); + + case 'dialog_flip' + % flip the orientation of the dipole + current = EEG.dipfit.current; + moment = EEG.dipfit.model(current).momxyz; + EEG.dipfit.model(current).momxyz(dipnum,:) = [ -moment(dipnum,1) -moment(dipnum,2) -moment(dipnum,3)]; + set(findobj(parent, 'tag', ['dip' int2str(dipnum) 'mom']), 'string', ... + sprintf('%0.3f %0.3f %0.3f', EEG.dipfit.model(current).momxyz(dipnum,:))); + set(parent, 'userdata', EEG); + + case {'dipfit_moment', 'dipfit_position'} + % determine the selected dipoles and components + current = EEG.dipfit.current; + select = find([get(findobj(parent, 'tag', 'dip1sel'), 'value') get(findobj(parent, 'tag', 'dip2sel'), 'value')]); + if isempty(select) + warning('no dipoles selected for fitting'); + return + end + % remove the dipoles from the model that are not selected, but keep + % the original dipole model (to keep the GUI consistent) + model_before_fitting = EEG.dipfit.model(current); + EEG.dipfit.model(current).posxyz = EEG.dipfit.model(current).posxyz(select,:); + EEG.dipfit.model(current).momxyz = EEG.dipfit.model(current).momxyz(select,:); + if strcmp(subfunction, 'dipfit_moment') + % the default is 'yes' which should only be overruled for fitting dipole moment + cfg.nonlinear = 'no'; + end + dipfitdefs; + if get(findobj(parent, 'tag', 'dip2sym'), 'value') & get(findobj(parent, 'tag', 'dip2sel'), 'value') + if strcmpi(EEG.dipfit.coordformat,'MNI') + cfg.symmetry = 'x'; + else + cfg.symmetry = 'y'; + end; + else + cfg.symmetry = []; + end + + cfg.component = current; + % convert structure into list of input arguments + arg = [fieldnames(cfg)' ; struct2cell(cfg)']; + arg = arg(:)'; + + % make a dialog to interrupt the fitting procedure + fig = figure('visible', 'off'); + supergui( fig, {1 1}, [], ... + {'style' 'text' 'string' 'Press button below to stop fitting' }, ... + {'style' 'pushbutton' 'string' 'Interupt' 'callback' 'figure(gcbf); set(gcbf, ''tag'', ''stop'');' } ); + drawnow; + % start the dipole fitting + try + warning backtrace off; + EEG = dipfit_nonlinear(EEG, arg{:}); + warning backtrace on; + catch, + disp('Dipole localization failed'); + end; + + % should the following string be put into com? ->NOT SUPPORTED + % -------------------------------------------------------- + com = sprintf('%s = dipfit_nonlinear(%s,%s)\n', inputname(1), inputname(1), vararg2str(arg)); + + % this GUI always requires two sources in the dipole model + % first put the original model back in and then replace the dipole parameters that have been fitted + model_after_fitting = EEG.dipfit.model(current); + newfields = fieldnames( EEG.dipfit.model ); + for index = 1:length(newfields) + eval( ['EEG.dipfit.model(' int2str(current) ').' newfields{index} ' = model_after_fitting.' newfields{index} ';' ]); + end; + EEG.dipfit.model(current).posxyz(select,:) = model_after_fitting.posxyz; + EEG.dipfit.model(current).momxyz(select,:) = model_after_fitting.momxyz; + EEG.dipfit.model(current).rv = model_after_fitting.rv; + %EEG.dipfit.model(current).diffmap = model_after_fitting.diffmap; + + % reassign the global EEG object back to the dialogs userdata + set(parent, 'userdata', EEG); + % close the interrupt dialog + if ishandle(fig) + close(fig); + end + + otherwise + error('unknown subfunction for pop_dipfit_nonlinear'); + end % switch subfunction + + end % if nargin + + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_settings.m b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_settings.m new file mode 100644 index 0000000..b99516a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipfit_settings.m @@ -0,0 +1,371 @@ +% pop_dipfit_settings() - select global settings for dipole fitting through a pop up window +% +% Usage: +% >> OUTEEG = pop_dipfit_settings ( INEEG ); % pop up window +% >> OUTEEG = pop_dipfit_settings ( INEEG, 'key1', 'val1', 'key2', 'val2' ... ) +% +% Inputs: +% INEEG input dataset +% +% Optional inputs: +% 'hdmfile' - [string] file containing a head model compatible with +% the Fieldtrip dipolefitting() function ("vol" entry) +% 'mrifile' - [string] file containing an anatomical MR head image. +% The MRI must be normalized to the MNI brain. See the .mat +% files used by the sphere and boundary element models +% (For instance, select the sphere model and study 'EEG.dipfit'). +% If SPM2 software is installed, dipfit will be able to read +% most MRI file formats for plotting purposes (.mnc files, etc...). +% To plot dipoles in a subject MRI, first normalize the MRI +% to the MNI brain using SPM2. +% 'coordformat' - ['MNI'|'Spherical'] Coordinates returned by the selected +% head model. May be MNI coordinates or spherical coordinates +% (For spherical coordinates, the head radius is assumed to be 85 mm. +% 'chanfile' - [string] template channel locations file. (This function will +% check whether your channel locations file is compatible with +% your selected head model). +% 'chansel' - [integer vector] indices of channels to use for dipole fitting. +% {default: all} +% 'coord_transform' - [float array] Talairach transformation matrix for +% aligning the dataset channel locations to the selected +% head model. +% 'electrodes' - [integer array] indices of channels to include +% in the dipole model. {default: all} +% Outputs: +% OUTEEG output dataset +% +% Author: Arnaud Delorme, SCCN, La Jolla 2003- +% Robert Oostenveld, SMI/FCDC, Nijmegen 2003 + +% MEG flag: +% 'gradfile' - [string] file containing gradiometer locations +% ("gradfile" parameter in Fieldtrip dipolefitting() function) + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl + +% Copyright (C) 2003 arno@salk.edu, Arnaud Delorme, SCCN, La Jolla 2003-2005 +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function [OUTEEG, com] = pop_dipfit_settings ( EEG, varargin ) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if nargin < 1 + help pop_dipfit_settings; + return; +end; + +if ~plugin_askinstall('Fieldtrip-lite', 'ft_sourceanalysis'), return; end; + +OUTEEG = EEG; +com = ''; + +% get the default values and filenames +dipfitdefs; + +if nargin < 2 + + if isstr(EEG) % setmodel + tmpdat = get(gcf, 'userdata'); + chanfile = tmpdat.chanfile; + tmpdat = tmpdat.template_models; + tmpval = get(findobj(gcf, 'tag', 'listmodels'), 'value'); + set(findobj(gcf, 'tag', 'model'), 'string', char(tmpdat(tmpval).hdmfile)); + set(findobj(gcf, 'tag', 'coord'), 'value' , fastif(strcmpi(tmpdat(tmpval).coordformat,'MNI'),2, ... + fastif(strcmpi(tmpdat(tmpval).coordformat,'CTF'),3,1))); + set(findobj(gcf, 'tag', 'mri' ), 'string', char(tmpdat(tmpval).mrifile)); + set(findobj(gcf, 'tag', 'meg'), 'string', char(tmpdat(tmpval).chanfile)); + set(findobj(gcf, 'tag', 'coregcheckbox'), 'value', 0); + if tmpval < 3, + set(findobj(gcf, 'userdata', 'editable'), 'enable', 'off'); + else, + set(findobj(gcf, 'userdata', 'editable'), 'enable', 'on'); + end; + if tmpval == 3, + set(findobj(gcf, 'tag', 'headstr'), 'string', 'Subject CTF head model file (default.htm)'); + set(findobj(gcf, 'tag', 'mristr'), 'string', 'Subject MRI (coregistered with CTF head)'); + set(findobj(gcf, 'tag', 'chanstr'), 'string', 'CTF Res4 file'); + set(findobj(gcf, 'tag', 'manualcoreg'), 'enable', 'off'); + set(findobj(gcf, 'userdata', 'coreg'), 'enable', 'off'); + else, + set(findobj(gcf, 'tag', 'headstr'), 'string', 'Head model file'); + set(findobj(gcf, 'tag', 'mristr'), 'string', 'MRI file'); + set(findobj(gcf, 'tag', 'chanstr'), 'string', 'Model template channel locations file'); + set(findobj(gcf, 'tag', 'manualcoreg'), 'enable', 'on'); + set(findobj(gcf, 'userdata', 'coreg'), 'enable', 'on'); + end; + tmpl = tmpdat(tmpval).coord_transform; + set(findobj(gcf, 'tag', 'coregtext'), 'string', ''); + set(findobj(gcf, 'tag', 'coregcheckbox'), 'value', 0); + [allkeywordstrue transform] = lookupchantemplate(chanfile, tmpl); + if allkeywordstrue, + set(findobj(gcf, 'tag', 'coregtext'), 'string', char(vararg2str({ transform }))); + if isempty(transform) + set(findobj(gcf, 'tag', 'coregcheckbox'), 'value', 1); + else set(findobj(gcf, 'tag', 'coregcheckbox'), 'value', 0); + end; + end; + return; + end; + + % detect DIPFIT1.0x structure + % --------------------------- + if isfield(EEG.dipfit, 'vol') + str = [ 'Dipole information structure from DIPFIT v1.02 detected.' ... + 'Keep or erase the old dipole information including dipole locations? ' ... + 'In either case, a new dipole model can be constructed.' ]; + + tmpButtonName=questdlg2( strmultiline(str, 60), 'Old DIPFIT structure', 'Keep', 'Erase', 'Keep'); + if strcmpi(tmpButtonName, 'Keep'), return; end; + + elseif isfield(EEG.dipfit, 'hdmfile') + % detect previous DIPFIT structure + % -------------------------------- + str = [ 'Dipole information and settings are present in the dataset. ' ... + 'Keep or erase this information?' ]; + tmpButtonName=questdlg2( strmultiline(str, 60), 'Old DIPFIT structure', 'Keep', 'Erase', 'Keep'); + if strcmpi(tmpButtonName, 'Keep'), return; end; + end; + + % define the callbacks for the buttons + % ------------------------------------- + cb_selectelectrodes = [ 'tmplocs = EEG.chanlocs; tmp = select_channel_list({tmplocs.label}, ' ... + 'eval(get(findobj(gcbf, ''tag'', ''elec''), ''string'')));' ... + 'set(findobj(gcbf, ''tag'', ''elec''), ''string'',[''['' num2str(tmp) '']'']); clear tmplocs;' ]; % did not work + cb_selectelectrodes = 'tmplocs = EEG.chanlocs; set(findobj(gcbf, ''tag'', ''elec''), ''string'', int2str(pop_chansel({tmplocs.labels}))); clear tmplocs;'; + cb_volmodel = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpind = get(gcbo, ''value'');' ... + 'set(findobj(gcbf, ''tag'', ''radii''), ''string'', num2str(tmpdat{tmpind}.r,3));' ... + 'set(findobj(gcbf, ''tag'', ''conduct''), ''string'', num2str(tmpdat{tmpind}.c,3));' ... + 'clear tmpdat tmpind;' ]; + cb_changeradii = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpdat.vol.r = str2num(get(gcbo, ''string''));' ... + 'set(gcf, ''userdata'', tmpdat)' ]; + cb_changeconduct = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpdat.vol.c = str2num(get(gcbo, ''string''));' ... + 'set(gcf, ''userdata'', tmpdat)' ]; + cb_changeorigin = [ 'tmpdat = get(gcbf, ''userdata'');' ... + 'tmpdat.vol.o = str2num(get(gcbo, ''string''));' ... + 'set(gcf, ''userdata'', tmpdat)' ]; + % cb_fitelec = [ 'if get(gcbo, ''value''),' ... + % ' set(findobj(gcbf, ''tag'', ''origin''), ''enable'', ''off'');' ... + % 'else' ... + % ' set(findobj(gcbf, ''tag'', ''origin''), ''enable'', ''on'');' ... + % 'end;' ]; + valmodel = 1; + userdata = []; + if isfield(EEG.chaninfo, 'filename') + if ~isempty(findstr(lower(EEG.chaninfo.filename), 'standard-10-5-cap385')), valmodel = 1; end; + if ~isempty(findstr(lower(EEG.chaninfo.filename), 'standard_1005')), valmodel = 2; end; + end; + + geomvert = [3 1 1 1 1 1 1 1 1 1 1]; + + geomhorz = { + [1 2] + [1] + [1 1.3 0.5 0.5 ] + [1 1.3 0.9 0.1 ] + [1 1.3 0.5 0.5 ] + [1 1.3 0.5 0.5 ] + [1 1.3 0.5 0.5 ] + [1 1.3 0.5 0.5 ] + [1] + [1] + [1] }; + + % define each individual graphical user element + comhelp1 = [ 'warndlg2(strvcat(''The two default head models are in ''standard_BEM'' and ''standard_BESA'''',' ... + ''' sub-folders in the DIPFIT2 plugin folder, and may be modified there.''), ''Model type'');' ]; + comhelp3 = [ 'warndlg2(strvcat(''Any MR image normalized to the MNI brain model may be used for plotting'',' ... + '''(see the DIPFIT 2.0 tutorial for more information)''), ''Model type'');' ]; + comhelp2 = [ 'warndlg2(strvcat(''The template location file associated with the head model'',' ... + '''you are using must be entered (see tutorial).''), ''Template location file'');' ]; + commandload1 = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''model''), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + commandload2 = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''meg''), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + commandload3 = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''mri''), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + cb_selectcoreg = [ 'tmpmodel = get( findobj(gcbf, ''tag'', ''model''), ''string'');' ... + 'tmploc2 = get( findobj(gcbf, ''tag'', ''meg'') , ''string'');' ... + 'tmploc1 = get( gcbo, ''userdata'');' ... + 'tmptransf = get( findobj(gcbf, ''tag'', ''coregtext''), ''string'');' ... + '[tmp tmptransf] = coregister(tmploc1{1}, tmploc2, ''mesh'', tmpmodel,' ... + ' ''transform'', str2num(tmptransf), ''chaninfo1'', tmploc1{2}, ''helpmsg'', ''on'');' ... + 'if ~isempty(tmptransf), set( findobj(gcbf, ''tag'', ''coregtext''), ''string'', num2str(tmptransf)); end;' ... + 'clear tmpmodel tmploc2 tmploc1 tmp tmptransf;' ]; + setmodel = [ 'pop_dipfit_settings(''setmodel'');' ]; + + dipfitdefs; % contains template_model + + templatenames = { template_models.name }; + elements = { ... + { 'style' 'text' 'string' [ 'Head model (click to select)' 10 '' ] } ... + { 'style' 'listbox' 'string' strvcat(templatenames{:}) ... + 'callback' setmodel 'value' valmodel 'tag' 'listmodels' } { } ... + { 'style' 'text' 'string' '________' 'tag' 'headstr' } ... + { 'style' 'edit' 'string' '' 'tag' 'model' 'userdata' 'editable' 'enable' 'off'} ... + { 'style' 'pushbutton' 'string' 'Browse' 'callback' commandload1 'userdata' 'editable' 'enable' 'off' } ... + { 'style' 'pushbutton' 'string' 'Help' 'callback' comhelp1 } ... + { 'style' 'text' 'string' 'Output coordinates' } ... + { 'style' 'popupmenu' 'string' 'spherical (head radius 85 mm)|MNI|CTF' 'tag' 'coord' ... + 'value' 1 'userdata' 'editable' 'enable' 'off'} ... + { 'style' 'text' 'string' 'Click to select' } { } ... + { 'style' 'text' 'string' '________' 'tag' 'mristr' } ... + { 'style' 'edit' 'string' '' 'tag' 'mri' } ... + { 'style' 'pushbutton' 'string' 'Browse' 'callback' commandload3 } ... + { 'style' 'pushbutton' 'string' 'Help' 'callback' comhelp3 } ... + { 'style' 'text' 'string' '________', 'tag', 'chanstr' } ... + { 'style' 'edit' 'string' '' 'tag' 'meg' 'userdata' 'editable' 'enable' 'off'} ... + { 'style' 'pushbutton' 'string' 'Browse' 'callback' commandload2 'userdata' 'editable' 'enable' 'off'} ... + { 'style' 'pushbutton' 'string' 'Help' 'callback' comhelp2 } ... + { 'style' 'text' 'string' 'Co-register chan. locs. with head model' 'userdata' 'coreg' } ... + { 'style' 'edit' 'string' '' 'tag' 'coregtext' 'userdata' 'coreg' } ... + { 'style' 'pushbutton' 'string' 'Manual Co-Reg.' 'tag' 'manualcoreg' 'callback' cb_selectcoreg 'userdata' { EEG.chanlocs,EEG.chaninfo } } ... + { 'style' 'checkbox' 'string' 'No Co-Reg.' 'tag' 'coregcheckbox' 'value' 0 'userdata' 'coreg' } ... + { 'style' 'text' 'string' 'Channels to omit from dipole fitting' } ... + { 'style' 'edit' 'string' '' 'tag' 'elec' } ... + { 'style' 'pushbutton' 'string' 'List' 'callback' cb_selectelectrodes } { } ... + { } ... + { 'style' 'text' 'string' 'Note: For EEG, check that the channel locations are on the surface of the head model' } ... + { 'style' 'text' 'string' '(To do this: ''Set head radius'' to about 85 in the channel editor).' } ... + }; + + % plot GUI and protect parameters + % ------------------------------- + userdata.template_models = template_models; + if isfield(EEG.chaninfo, 'filename') + userdata.chanfile = lower(EEG.chaninfo.filename); + else userdata.chanfile = ''; + end; + optiongui = { 'geometry', geomhorz, 'uilist', elements, 'helpcom', 'pophelp(''pop_dipfit_settings'')', ... + 'title', 'Dipole fit settings - pop_dipfit_settings()', ... + 'userdata', userdata, 'geomvert', geomvert 'eval' 'pop_dipfit_settings(''setmodel'');' }; + [result, userdat2, strhalt, outstruct] = inputgui( 'mode', 'noclose', optiongui{:}); + if isempty(result), return; end; + if ~isempty(get(0, 'currentfigure')) currentfig = gcf; else return; end; + + while test_wrong_parameters(currentfig) + [result, userdat2, strhalt, outstruct] = inputgui( 'mode', currentfig, optiongui{:}); + if isempty(result), return; end; + end; + close(currentfig); + + % decode GUI inputs + % ----------------- + options = {}; + options = { options{:} 'hdmfile' result{2} }; + options = { options{:} 'coordformat' fastif(result{3} == 2, 'MNI', fastif(result{3} == 1, 'Spherical', 'CTF')) }; + options = { options{:} 'mrifile' result{4} }; + options = { options{:} 'chanfile' result{5} }; + if ~result{7}, options = { options{:} 'coord_transform' str2num(result{6}) }; end; + options = { options{:} 'chansel' setdiff(1:EEG.nbchan, str2num(result{8})) }; + +else + options = varargin; +end + +g = finputcheck(options, { 'hdmfile' 'string' [] ''; + 'mrifile' 'string' [] ''; + 'chanfile' 'string' [] ''; + 'chansel' 'integer' [] [1:EEG.nbchan]; + 'electrodes' 'integer' [] []; + 'coord_transform' 'real' [] []; + 'coordformat' 'string' { 'MNI','spherical','CTF' } 'MNI' }); +if isstr(g), error(g); end; + +OUTEEG = rmfield(OUTEEG, 'dipfit'); +OUTEEG.dipfit.hdmfile = g.hdmfile; +OUTEEG.dipfit.mrifile = g.mrifile; +OUTEEG.dipfit.chanfile = g.chanfile; +OUTEEG.dipfit.chansel = g.chansel; +OUTEEG.dipfit.coordformat = g.coordformat; +OUTEEG.dipfit.coord_transform = g.coord_transform; +if ~isempty(g.electrodes), OUTEEG.dipfit.chansel = g.electrodes; end; + +% removing channels with no coordinates +% ------------------------------------- +[tmpeloc labels Th Rd indices] = readlocs(EEG.chanlocs); +if length(indices) < length(EEG.chanlocs) + disp('Warning: Channels removed from dipole fitting no longer have location coordinates!'); + OUTEEG.dipfit.chansel = intersect( OUTEEG.dipfit.chansel, indices); +end; + +% checking electrode configuration +% -------------------------------- +if 0 + disp('Checking the electrode configuration'); + tmpchan = readlocs(OUTEEG.dipfit.chanfile); + [tmp1 ind1 ind2] = intersect( lower({ tmpchan.labels }), lower({ OUTEEG.chanlocs.labels })); + if isempty(tmp1) + disp('No channel labels in common found between template and dataset channels'); + if ~isempty(findstr(OUTEEG.dipfit.hdmfile, 'BESA')) + disp('Use the channel editor to fit a head sphere to your channel locations.'); + disp('Check for inconsistency in dipole info.'); + else + disp('Results using standard BEM model are INACCURATE when the chan locations are not on the head surface!'); + end; + else % common channels: performing best transformation + TMP = OUTEEG; + elec1 = eeglab2fieldtrip(TMP, 'elec'); + elec1 = elec1.elec; + TMP.chanlocs = tmpchan; + elec2 = eeglab2fieldtrip(TMP, 'elec'); + elec2 = elec2.elec; + cfg.elec = elec1; + cfg.template = elec2; + cfg.method = 'warp'; + elec3 = electrodenormalize(cfg); + + % convert back to EEGLAB format + OUTEEG.chanlocs = struct( 'labels', elec3.label, ... + 'X' , mat2cell(elec3.pnt(:,1)'), ... + 'Y' , mat2cell(elec3.pnt(:,2)'), ... + 'Z' , mat2cell(elec3.pnt(:,3)') ); + OUTEEG.chanlocs = convertlocs(OUTEEG.chanlocs, 'cart2all'); + end; + +end; + +com = sprintf('%s = pop_dipfit_settings( %s, %s);', inputname(1), inputname(1), vararg2str(options)); + +% test for wrong parameters +% ------------------------- +function bool = test_wrong_parameters(hdl) + + coreg1 = get( findobj( hdl, 'tag', 'coregtext') , 'string' ); + coreg2 = get( findobj( hdl, 'tag', 'coregcheckbox'), 'value' ); + meg = get( findobj( hdl, 'tag', 'coord'), 'value' ); + + bool = 0; + if meg == 3, return; end; + if coreg2 == 0 & isempty(coreg1) + bool = 1; warndlg2(strvcat('You must co-register your channel locations', ... + 'with the head model (Press buttun, "Manual Co-Reg".', ... + 'and follow instructions); To bypass co-registration,', ... + 'check the checkbox " No Co-Reg".'), 'Error'); + end; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipplot.m b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipplot.m new file mode 100644 index 0000000..1e859e7 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_dipplot.m @@ -0,0 +1,196 @@ +% pop_dipplot() - plot dipoles. +% +% Usage: +% >> pop_dipplot( EEG ); % pop up interactive window +% >> pop_dipplot( EEG, comps, 'key1', 'val1', 'key2', 'val2', ...); +% +% Graphic interface: +% "Components" - [edit box] enter component number to plot. By +% all the localized components are plotted. Command +% line equivalent: components. +% "Background image" - [edit box] MRI background image. This image +% has to be normalized to the MNI brain using SPM2 for +% instance. Dipplot() command line equivalent: 'image'. +% "Summary mode" - [Checkbox] when checked, plot the 3 views of the +% head model and dipole locations. Dipplot() equivalent +% is 'summary' and 'num'. +% "Plot edges" - [Checkbox] plot edges at the intersection between +% MRI slices. Diplot() equivalent is 'drawedges'. +% "Plot closest MRI slide" - [Checkbox] plot closest MRI slice to +% dipoles although not using the 'tight' view mode. +% Dipplot() equivalent is 'cornermri' and 'axistight'. +% "Plot dipole's 2-D projections" - [Checkbox] plot a dimed dipole +% projection on each 2-D MRI slice. Dipplot() equivalent +% is 'projimg'. +% "Plot projection lines" - [Checkbox] plot lines originating from +% dipoles and perpendicular to each 2-D MRI slice. +% Dipplot() equivalent is 'projline'. +% "Make all dipole point out" - [Checkbox] make all dipole point +% toward outside the brain. Dipplot() equivalent is +% 'pointout'. +% "Normalized dipole length" - [Checkbox] normalize the length of +% all dipoles. Dipplot() command line equivalent: 'normlen'. +% "Additionnal dipfit() options" - [checkbox] enter additionnal +% sequence of 'key', 'val' argument in this edit box. +% +% Inputs: +% EEG - Input dataset +% comps - [integer array] plot component indices. If empty +% all the localized components are plotted. +% +% Optional inputs: +% 'key','val' - same as dipplot() +% +% Author: Arnaud Delorme, CNL / Salk Institute, 26 Feb 2003- +% +% See also: dipplot() + +% "Use dipoles from" - [list box] use dipoles from BESA or from the +% DIPFIT toolbox. Command line equivalent: type. + +% Copyright (C) 2003 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [com] = pop_dipplot( EEG, comps, varargin); + +com =''; +if nargin < 1 + help pop_dipplot; + return; +end; + +% check input structure +% --------------------- +if ~isfield(EEG, 'dipfit') & ~isfield(EEG, 'sources') + if ~isfield(EEG.dipfit.hdmfile) & ~isfield(EEG, 'sources') + error('No dipole information in dataset'); + end; + error('No dipole information in dataset'); +end; +if ~isfield(EEG.dipfit, 'model') + error('No dipole information in dataset'); +end; + +typedip = 'nonbesa'; +if nargin < 2 + % popup window parameters + % ----------------------- + commandload = [ '[filename, filepath] = uigetfile(''*'', ''Select a text file'');' ... + 'if filename ~=0,' ... + ' set(findobj(''parent'', gcbf, ''tag'', ''mrifile''), ''string'', [ filepath filename ]);' ... + 'end;' ... + 'clear filename filepath tagtest;' ]; + + geometry = { [2 1] [2 1] [0.8 0.3 1.5] [2.05 0.26 .75] [2.05 0.26 .75] [2.05 0.26 .75] ... + [2.05 0.26 .75] [2.05 0.26 .75] [2.05 0.26 .75] [2.05 0.26 .75] [2 1] }; + uilist = { { 'style' 'text' 'string' 'Components indices ([]=all avaliable)' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Plot dipoles within RV (%) range ([min max])' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'string' 'Background image' } ... + { 'style' 'pushbutton' 'string' '...' 'callback' commandload } ... + { 'style' 'edit' 'string' EEG.dipfit.mrifile 'tag' 'mrifile' } ... + { 'style' 'text' 'string' 'Plot summary mode' } ... + { 'style' 'checkbox' 'string' '' } {} ... + { 'style' 'text' 'string' 'Plot edges' } ... + { 'style' 'checkbox' 'string' '' } {} ... + { 'style' 'text' 'string' 'Plot closest MRI slide' } ... + { 'style' 'checkbox' 'string' '' } {} ... + { 'style' 'text' 'string' 'Plot dipole''s 2-D projections' } ... + { 'style' 'checkbox' 'string' '' } {} ... + { 'style' 'text' 'string' 'Plot projection lines' } ... + { 'style' 'checkbox' 'string' '' 'value' 0 } {} ... + { 'style' 'text' 'string' 'Make all dipoles point out' } ... + { 'style' 'checkbox' 'string' '' } {} ... + { 'style' 'text' 'string' 'Normalized dipole length' } ... + { 'style' 'checkbox' 'string' '' 'value' 1 } {} ... + { 'style' 'text' 'string' 'Additionnal dipplot() options' } ... + { 'style' 'edit' 'string' '' } }; + + result = inputgui( geometry, uilist, 'pophelp(''pop_dipplot'')', 'Plot dipoles - pop_dipplot'); + if length(result) == 0 return; end; + + % decode parameters + % ----------------- + options = {}; + if ~isempty(result{1}), comps = eval( [ '[' result{1} ']' ] ); else comps = []; end; + if ~isempty(result{2}), options = { options{:} 'rvrange' eval( [ '[' result{2} ']' ] ) }; end; + options = { options{:} 'mri' result{3} }; + if result{4} == 1, options = { options{:} 'summary' 'on' 'num' 'on' }; end; + if result{5} == 1, options = { options{:} 'drawedges' 'on' }; end; + if result{6} == 1, options = { options{:} 'cornermri' 'on' 'axistight' 'on' }; end; + if result{7} == 1, options = { options{:} 'projimg' 'on' }; end; + if result{8} == 1, options = { options{:} 'projlines' 'on' }; end; + if result{9} == 1, options = { options{:} 'pointout' 'on' }; end; + if result{10} == 1, options = { options{:} 'normlen' 'on' }; end; + if ~isempty( result{11} ), tmpopt = eval( [ '{' result{11} '}' ] ); options = { options{:} tmpopt{:} }; end; +else + if isstr(comps) + typedip = comps; + options = varargin(2:end); + comps = varargin{1}; + else + options = varargin; + end; +end; + +if strcmpi(typedip, 'besa') + if ~isfield(EEG, 'sources'), error('No BESA dipole information in dataset');end; + if ~isempty(comps) + [tmp1 int] = intersect( [ EEG.sources.component ], comps); + if isempty(int), error ('Localization not found for selected components'); end; + dipplot(EEG.sources(int), 'sphere', 1, options{:}); + else + dipplot(EEG.sources, options{:}); + end; +else + if ~isfield(EEG, 'dipfit'), error('No DIPFIT dipole information in dataset');end; + + % components to plot + % ------------------ + if ~isempty(comps) + if ~isfield(EEG.dipfit.model, 'component') + for index = double(comps(:)') + EEG.dipfit.model(index).component = index; + end; + end; + else + % find localized dipoles + comps = []; + for index2 = 1:length(EEG.dipfit.model) + if ~isempty(EEG.dipfit.model(index2).posxyz) ~= 0 + comps = [ comps index2 ]; + EEG.dipfit.model(index2).component = index2; + end; + end; + end; + + % plotting + % -------- + tmpoptions = { options{:} 'coordformat', EEG.dipfit.coordformat }; + if strcmpi(EEG.dipfit.coordformat, 'spherical') + dipplot(EEG.dipfit.model(comps), tmpoptions{:}); + elseif strcmpi(EEG.dipfit.coordformat, 'CTF') + dipplot(EEG.dipfit.model(comps), tmpoptions{:}); + else + dipplot(EEG.dipfit.model(comps), 'meshdata', EEG.dipfit.hdmfile, tmpoptions{:}); + end; +end; + +if nargin < 3 + com = sprintf('pop_dipplot( %s,%s);', inputname(1), vararg2str({ comps options{:}})); +end; +return; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/pop_multifit.m b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_multifit.m new file mode 100644 index 0000000..b300cd4 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/pop_multifit.m @@ -0,0 +1,243 @@ +% pop_multifit() - fit multiple component dipoles using DIPFIT +% +% Usage: +% >> EEG = pop_multifit(EEG); % pop-up graphical interface +% >> EEG = pop_multifit(EEG, comps, 'key', 'val', ...); +% +% Inputs: +% EEG - input EEGLAB dataset. +% comps - indices component to fit. Empty is all components. +% +% Optional inputs: +% 'dipoles' - [1|2] use either 1 dipole or 2 dipoles contrain in +% symmetry. Default is 1. +% 'dipplot' - ['on'|'off'] plot dipoles. Default is 'off'. +% 'plotopt' - [cell array] dipplot() 'key', 'val' options. Default is +% 'normlen', 'on', 'image', 'fullmri' +% 'rmout' - ['on'|'off'] remove dipoles outside the head. Artifactual +% component often localize outside the head. Default is 'off'. +% 'threshold' - [float] rejection threshold during component scan. +% Default is 40 (residual variance above 40%). +% +% Outputs: +% EEG - output dataset with updated "EEG.dipfit" field +% +% Note: residual variance is set to NaN if DIPFIT does not converge +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, La Jolla, Oct. 2003 + +% Copyright (C) 9/2003 Arnaud Delorme, SCCN/INC/UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_multifit(EEG, comps, varargin); + + if nargin < 1 + help pop_multifit; + return; + end; + + com = []; + ncomps = size(EEG.icaweights,1); + if ncomps == 0, error('you must run ICA first'); end; + + if nargin<2 + cb_chans = 'tmplocs = EEG.chanlocs; set(findobj(gcbf, ''tag'', ''chans''), ''string'', int2str(pop_chansel({tmplocs.labels}))); clear tmplocs;'; + + uilist = { { 'style' 'text' 'string' 'Component indices' } ... + { 'style' 'edit' 'string' [ '1:' int2str(ncomps) ] } ... + { 'style' 'text' 'string' 'Rejection threshold RV (%)' } ... + { 'style' 'edit' 'string' '100' } ... + { 'style' 'text' 'string' 'Remove dipoles outside the head' } ... + { 'style' 'checkbox' 'string' '' 'value' 0 } {} ... + { 'style' 'text' 'string' 'Fit bilateral dipoles (check)' } ... + { 'style' 'checkbox' 'string' '' 'value' 0 } {} ... + { 'style' 'text' 'string' 'Plot resulting dipoles (check)' } ... + { 'style' 'checkbox' 'string' '' 'value' 0 } {} ... + { 'style' 'text' 'string' 'dipplot() plotting options' } ... + { 'style' 'edit' 'string' '''normlen'' ''on''' } ... + { 'style' 'pushbutton' 'string' 'Help' 'callback' 'pophelp(''dipplot'')' } }; + + results = inputgui( { [1.91 2.8] [1.91 2.8] [3.1 0.8 1.6] [3.1 0.8 1.6] [3.1 0.8 1.6] [2.12 2.2 0.8]}, ... + uilist, 'pophelp(''pop_multifit'')', ... + 'Fit multiple ICA components -- pop_multifit()'); + if length(results) == 0 return; end; + comps = eval( [ '[' results{1} ']' ] ); + + % selecting model + % --------------- + options = {}; + if ~isempty(results{2}) + options = { options{:} 'threshold' eval( results{2} ) }; + end; + if results{3}, options = { options{:} 'rmout' 'on' }; end; + if results{4}, options = { options{:} 'dipoles' 2 }; end; + if results{5}, options = { options{:} 'dipplot' 'on' }; end; + options = { options{:} 'plotopt' eval( [ '{ ' results{6} ' }' ]) }; + else + options = varargin; + end; + + % checking parameters + % ------------------- + if isempty(comps), comps = [1:size(EEG.icaweights,1)]; end; + g = finputcheck(options, { 'settings' { 'cell' 'struct' } [] {}; % deprecated + 'dipoles' 'integer' [1 2] 1; + 'threshold' 'float' [0 100] 40; + 'dipplot' 'string' { 'on' 'off' } 'off'; + 'rmout' 'string' { 'on' 'off' } 'off'; + 'plotopt' 'cell' {} {'normlen' 'on' }}); + + if isstr(g), error(g); end; + EEG = eeg_checkset(EEG, 'chanlocs_homogeneous'); + + % dipfit settings + % --------------- + if isstruct(g.settings) + EEG.dipfit = g.settings; + elseif ~isempty(g.settings) + EEG = pop_dipfit_settings( EEG, g.settings{:}); % will probably not work but who knows + end; + + % Scanning dipole locations + % ------------------------- + dipfitdefs; + skipscan = 0; + try + alls = cellfun('size', { EEG.dipfit.model.posxyz }, 2); + if length(alls) == ncomps + if all(alls == 3) + skipscan = 1; + end; + end; + catch, end; + if skipscan + disp('Skipping scanning since all dipoles have non-null starting positions.'); + else + disp('Scanning dipolar grid to find acceptable starting positions...'); + xg = linspace(-floor(meanradius), floor(meanradius),11); + yg = linspace(-floor(meanradius), floor(meanradius),11); + zg = linspace(0 , floor(meanradius), 6); + EEG = pop_dipfit_gridsearch( EEG, [1:ncomps], ... + eval(xgridstr), eval(ygridstr), eval(zgridstr), 100); + disp('Scanning terminated. Refining dipole locations...'); + end; + + % set symmetry constraint + % ---------------------- + if strcmpi(EEG.dipfit.coordformat,'MNI') + defaultconstraint = 'x'; + else + defaultconstraint = 'y'; + end; + + % Searching dipole localization + % ----------------------------- + disp('Searching dipoles locations...'); + chansel = EEG.dipfit.chansel; + %elc = getelecpos(EEG.chanlocs, EEG.dipfit); + plotcomps = []; + for i = comps(:)' + if i <= length(EEG.dipfit.model) & ~isempty(EEG.dipfit.model(i).posxyz) + if g.dipoles == 2, + % try to find a good origin for automatic dipole localization + EEG.dipfit.model(i).active = [1 2]; + EEG.dipfit.model(i).select = [1 2]; + if isempty(EEG.dipfit.model(i).posxyz) + EEG.dipfit.model(i).posxyz = zeros(1,3); + EEG.dipfit.model(i).momxyz = zeros(2,3); + else + EEG.dipfit.model(i).posxyz(2,:) = EEG.dipfit.model(i).posxyz; + if strcmpi(EEG.dipfit.coordformat, 'MNI') + EEG.dipfit.model(i).posxyz(:,1) = [-40;40]; + else EEG.dipfit.model(i).posxyz(:,2) = [-40;40]; + end; + EEG.dipfit.model(i).momxyz(2,:) = EEG.dipfit.model(i).momxyz; + end; + else + EEG.dipfit.model(i).active = [1]; + EEG.dipfit.model(i).select = [1]; + end; + warning backtrace off; + try, + if g.dipoles == 2, + EEG = dipfit_nonlinear(EEG, 'component', i, 'symmetry', defaultconstraint); + else + EEG = dipfit_nonlinear(EEG, 'component', i, 'symmetry', []); + end; + catch, EEG.dipfit.model(i).rv = NaN; disp('Maximum number of iterations reached. Fitting failed'); + end; + warning backtrace on; + plotcomps = [ plotcomps i ]; + end; + end; + + % set RV to 1 for dipole with higher than 40% residual variance + % ------------------------------------------------------------- + EEG.dipfit.model = dipfit_reject(EEG.dipfit.model, g.threshold/100); + + % removing dipoles outside the head + % --------------------------------- + if strcmpi(g.rmout, 'on') & strcmpi(EEG.dipfit.coordformat, 'spherical') + rmdip = []; + for index = plotcomps + if ~isempty(EEG.dipfit.model(index).posxyz) + if any(sqrt(sum(EEG.dipfit.model(index).posxyz.^2,2)) > 85) + rmdip = [ rmdip index]; + EEG.dipfit.model(index).posxyz = []; + EEG.dipfit.model(index).momxyz = []; + EEG.dipfit.model(index).rv = 1; + end; + end; + end; + plotcomps = setdiff(plotcomps, rmdip); + if length(rmdip) > 0 + fprintf('%d out of cortex dipoles removed (usually artifacts)\n', length(rmdip)); + end; + end; + + % plotting dipoles + % ---------------- + if strcmpi(g.dipplot, 'on') + pop_dipplot(EEG, 'DIPFIT', plotcomps, g.plotopt{:}); + end; + + com = sprintf('%s = pop_multifit(%s, %s);', inputname(1), inputname(1), vararg2str({ comps options{:}})); + return; + +% get electrode positions from eeglag +% ----------------------------------- +function elc = getelecpos(chanlocs, dipfitstruct); + try, + elc = [ [chanlocs.X]' [chanlocs.Y]' [chanlocs.Z]' ]; + catch + disp('No 3-D carthesian coordinates; re-computing them from 2-D polar coordinates'); + EEG.chanlocs = convertlocs(EEG.chanlocs, 'topo2all'); + elc = [ [chanlocs.X]' [chanlocs.Y]' [chanlocs.Z]' ]; + end; + % constrain electrode to sphere + % ----------------------------- + disp('Constraining electrodes to sphere'); + elc = elc - repmat( dipfitstruct.vol.o, [size(elc,1) 1]); % recenter + % (note the step above is not needed since the origin should always be 0) + elc = elc ./ repmat( sqrt(sum(elc.*elc,2)), [1 3]); % normalize + elc = elc * max(dipfitstruct.vol.r); % head size + + %for index= 1:size(elc,1) + % elc(index,:) = max(dipfitstruct.vol.r) * elc(index,:) /norm(elc(index,:)); + %end; + + + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/globalrescale.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/globalrescale.m new file mode 100644 index 0000000..c4a7c26 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/globalrescale.m @@ -0,0 +1,60 @@ +function [H] = globalrescale(f); + +% GLOBALRESCALE creates the homogenous spatial transformation matrix +% for a 7 parameter rigid-body transformation with global rescaling +% +% Use as +% [H] = globalrescale(f) +% +% The transformation vector f should contain the +% x-shift +% y-shift +% z-shift +% followed by the +% pitch (rotation around x-axis) +% roll (rotation around y-axis) +% yaw (rotation around z-axis) +% followed by the +% global rescaling factor + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: globalrescale.m,v $ +% Revision 1.1 2009/01/30 04:02:06 arno +% *** empty log message *** +% +% Revision 1.3 2005/08/15 08:15:32 roboos +% reimplemented the rotate function, which contained an error (the error is in the AIR technical reference) +% changed all functions to be dependent on the rotate, translate and scale function +% all functions now behave consistenly, which also means that they are not compleetly backward compatible w.r.t. the order of the rotations +% +% Revision 1.2 2004/05/19 09:57:07 roberto +% added GPL copyright statement, added CVS log item +% + +% compute the homogenous transformation matrix for the translation +T = translate(f([1 2 3])); + +% compute the homogenous transformation matrix for the rotation +R = rotate(f([4 5 6])); + +% compute the homogenous transformation matrix for the global scaling +S = scale(f([7 7 7])); + +% compute the homogenous transformation matrix for the combination +H = T*R*S; + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/match_str.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/match_str.m new file mode 100644 index 0000000..f7aad93 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/match_str.m @@ -0,0 +1,79 @@ +function [sel1, sel2] = match_str(a, b); + +% MATCH_STR looks for matching labels in two listst of strings +% and returns the indices into both the 1st and 2nd list of the matches. +% They will be ordered according to the first input argument. +% +% [sel1, sel2] = match_str(strlist1, strlist2) +% +% The strings can be stored as a char matrix or as an vertical array of +% cells, the matching is done for each row. + +% Copyright (C) 2000, Robert Oostenveld +% +% $Log: match_str.m,v $ +% Revision 1.1 2009/01/30 04:02:07 arno +% *** empty log message *** +% +% Revision 1.6 2006/11/06 21:11:45 roboos +% also deal with empty [] input +% +% Revision 1.5 2004/11/10 17:11:40 roboos +% reverted to original implementation and reimplemented the speed up +% from scratch. The previous two revisions both were incompatible +% with the original implementation. +% +% Revision 1.4 2004/11/09 15:28:57 roboos +% fixed incompatibility that was introduced by previous speed increase: +% the original version gave back double occurences, and other fieldtrip +% functions (sourceanalysis) rely on this. The previously commited +% version only gave back one occurence of each hit, this is fixed by jansch +% in this version +% +% Revision 1.3 2004/10/22 15:59:41 roboos +% large speed increase by replacing 2 nested for loops by a standard matlab function (intersect) +% +% Revision 1.2 2003/03/17 10:37:28 roberto +% improved general help comments and added copyrights + +% ensure that both are cell-arrays +if isempty(a) + a = {}; +elseif ~iscell(a) + a = cellstr(a); +end +if isempty(b) + b = {}; +elseif ~iscell(b) + b = cellstr(b); +end + +% ensure that both are column vectors +a = a(:); +b = b(:); + +% regardless of what optimizations are implemented, the code should remain +% functionally compatible to the original, which is +% for i=1:length(a) +% for j=1:length(b) +% if strcmp(a(i),b(j)) +% sel1 = [sel1; i]; +% sel2 = [sel2; j]; +% end +% end +% end + +% replace all unique strings by a unique number and use the fact that +% numeric comparisons are much faster than string comparisons +[dum1, dum2, c] = unique([a; b]); +a = c(1:length(a)); +b = c((length(a)+1):end); + +sel1 = []; +sel2 = []; +for i=1:length(a) + % s = find(strcmp(a(i), b)); % for string comparison + s = find(a(i)==b); % for numeric comparison + sel1 = [sel1; repmat(i, size(s))]; + sel2 = [sel2; s]; +end diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/rigidbody.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/rigidbody.m new file mode 100644 index 0000000..d29766b --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/rigidbody.m @@ -0,0 +1,58 @@ +function [H] = rigidbody(f); + +% RIGIDBODY creates the homogenous spatial transformation matrix +% for a 6 parameter rigid-body transformation +% +% Use as +% [H] = rigidbody(f) +% +% The transformation vector f should contain the +% x-shift +% y-shift +% z-shift +% followed by the +% pitch (rotation around x-axis) +% roll (rotation around y-axis) +% yaw (rotation around z-axis) + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: rigidbody.m,v $ +% Revision 1.1 2009/01/30 04:02:11 arno +% *** empty log message *** +% +% Revision 1.4 2006/04/13 10:37:38 roboos +% added a ; to the end of a line +% +% Revision 1.3 2005/08/15 08:15:32 roboos +% reimplemented the rotate function, which contained an error (the error is in the AIR technical reference) +% changed all functions to be dependent on the rotate, translate and scale function +% all functions now behave consistenly, which also means that they are not compleetly backward compatible w.r.t. the order of the rotations +% +% Revision 1.2 2004/05/19 09:57:07 roberto +% added GPL copyright statement, added CVS log item +% + +% compute the homogenous transformation matrix for the translation +T = translate(f([1 2 3])); + +% compute the homogenous transformation matrix for the rotation +R = rotate(f([4 5 6])); + +% compute the homogenous transformation matrix for the combination +H = T*R; + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/rotate.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/rotate.m new file mode 100644 index 0000000..94bb5e1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/rotate.m @@ -0,0 +1,118 @@ +function [H] = rotate(D); + +% ROTATE returns the homogenous coordinate transformation matrix +% corresponding to a rotation around the x, y and z-axis. The direction of +% the rotation is according to the right-hand rule. +% +% Use as +% [H] = rotate(R) +% where +% R [rx, ry, rz] in degrees +% H corresponding homogenous transformation matrix +% +% Note that the order in which the rotations are performs matters. The +% rotation is first done around the z-axis, then the y-axis and finally the +% x-axis. + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: rotate.m,v $ +% Revision 1.1 2009/01/30 04:02:11 arno +% *** empty log message *** +% +% Revision 1.5 2006/09/12 13:35:28 roboos +% convert input rotation from degrees (according to documentation) into radians (needed for computations) +% +% Revision 1.4 2005/08/15 08:15:33 roboos +% reimplemented the rotate function, which contained an error (the error is in the AIR technical reference) +% changed all functions to be dependent on the rotate, translate and scale function +% all functions now behave consistenly, which also means that they are not compleetly backward compatible w.r.t. the order of the rotations +% +% Revision 1.3 2004/05/19 09:57:07 roberto +% added GPL copyright statement, added CVS log item +% + +% convert degrees to radians +R = D*pi/180; + +% get the individual angles (in radians) +rx = R(1); +ry = R(2); +rz = R(3); + +% precompute the sin/cos values of the angles +cX = cos(rx); +cY = cos(ry); +cZ = cos(rz); +sX = sin(rx); +sY = sin(ry); +sZ = sin(rz); + +% according to Roger Woods' http://bishopw.loni.ucla.edu/AIR5/homogenous.html +% it should be this, but I cannot reproduce his rotation matrix +% H = eye(4,4); +% H(1,1) = cZ*cY + sZ*sX*sY; +% H(1,2) = sZ*cY - cZ*sX*sY; +% H(1,3) = cX*sY; +% H(2,1) = -sZ*cX; +% H(2,2) = cZ*cX; +% H(2,3) = sX; +% H(3,1) = sZ*sX*cY - cZ*sY; +% H(3,2) = -cZ*sX*cY - sZ*sY; +% H(3,3) = cX*cY; + +% instead, the following rotation matrix does work according my +% expectations. It rotates according to the right hand rule and first +% rotates around z, then y and then x axis +H = [ + cZ*cY, -sZ*cY, sY, 0 + cZ*sY*sX+sZ*cX, -sZ*sY*sX+cZ*cX, -cY*sX, 0 + -cZ*sY*cX+sZ*sX, sZ*sY*cX+cZ*sX, cY*cX, 0 + 0, 0, 0, 1 +]; + +if 0 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The following code can be used to construct the combined rotation matrix +% for either xyz or zyx ordering (using the Matlab symbolic math toolbox) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + syms sX sY sZ cX cY cZ + % this is for only rotating around x + Rx = [ + 1 0 0 0 + 0 cX -sX 0 + 0 sX cX 0 + 0 0 0 1 + ]; + % this is for only rotating around y + Ry = [ + cY 0 sY 0 + 0 1 0 0 + -sY 0 cY 0 + 0 0 0 1 + ]; + % this is for only rotating around z + Rz = [ + cZ -sZ 0 0 + sZ cZ 0 0 + 0 0 1 0 + 0 0 0 1 + ]; + % combine them + Rzyx = Rz * Ry * Rx % rotate around x, y, then z + Rxyz = Rx * Ry * Rz % rotate around z, y, then x +end diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/scale.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/scale.m new file mode 100644 index 0000000..1a43b88 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/scale.m @@ -0,0 +1,48 @@ +function [H] = scale(S); + +% SCALE returns the homogenous coordinate transformation matrix +% corresponding to a scaling along the x, y and z-axis +% +% Use as +% [H] = translate(S) +% where +% S [sx, sy, sz] scaling along each of the axes +% H corresponding homogenous transformation matrix + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: scale.m,v $ +% Revision 1.1 2009/01/30 04:02:11 arno +% *** empty log message *** +% +% Revision 1.2 2005/08/15 08:15:33 roboos +% reimplemented the rotate function, which contained an error (the error is in the AIR technical reference) +% changed all functions to be dependent on the rotate, translate and scale function +% all functions now behave consistenly, which also means that they are not compleetly backward compatible w.r.t. the order of the rotations +% +% Revision 1.1 2004/05/19 09:57:07 roberto +% added GPL copyright statement, added CVS log item +% + +H = [ + S(1) 0 0 0 + 0 S(2) 0 0 + 0 0 S(3) 0 + 0 0 0 1 + ]; + + \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/traditional.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/traditional.m new file mode 100644 index 0000000..f132f96 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/traditional.m @@ -0,0 +1,70 @@ +function [H] = traditional(f); + +% TRADITIONAL creates the homogenous spatial transformation matrix +% for a 9 parameter traditional "Talairach-model" transformation +% +% Use as +% [H] = traditional(f) +% +% The transformation vector f should contain the +% x-shift +% y-shift +% z-shift +% followed by the +% pitch (rotation around x-axis) +% roll (rotation around y-axis) +% yaw (rotation around z-axis) +% followed by the +% x-rescaling factor +% y-rescaling factor +% z-rescaling factor +% +% The order in which the transformations are done is exactly opposite as +% the list above, i.e. first z-rescale, ... and finally x-shift. + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: traditional.m,v $ +% Revision 1.1 2009/01/30 04:02:12 arno +% *** empty log message *** +% +% Revision 1.5 2005/08/15 08:15:33 roboos +% reimplemented the rotate function, which contained an error (the error is in the AIR technical reference) +% changed all functions to be dependent on the rotate, translate and scale function +% all functions now behave consistenly, which also means that they are not compleetly backward compatible w.r.t. the order of the rotations +% +% Revision 1.4 2005/08/11 07:57:14 roboos +% fixed bug in y-rotation +% +% Revision 1.3 2005/04/21 08:28:45 roboos +% fixed bug in rotation matrix (thanks to Arno) +% +% Revision 1.2 2004/05/19 09:57:07 roberto +% added GPL copyright statement, added CVS log item +% + +% compute the homogenous transformation matrix for the translation +T = translate(f([1 2 3])); + +% compute the homogenous transformation matrix for the rotation +R = rotate(f([4 5 6])); + +% compute the homogenous transformation matrix for the scaling +S = scale(f([7 8 9])); + +% compute the homogenous transformation matrix for the combination +H = T*R*S; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/translate.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/translate.m new file mode 100644 index 0000000..b291ea1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/translate.m @@ -0,0 +1,46 @@ +function [H] = translate(T); + +% TRANSLATE returns the homogenous coordinate transformation matrix +% corresponding to a translation along the x, y and z-axis +% +% Use as +% [H] = translate(T) +% where +% T [tx, ty, tz] translation along each of the axes +% H corresponding homogenous transformation matrix + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: translate.m,v $ +% Revision 1.1 2009/01/30 04:02:12 arno +% *** empty log message *** +% +% Revision 1.4 2005/08/15 08:15:33 roboos +% reimplemented the rotate function, which contained an error (the error is in the AIR technical reference) +% changed all functions to be dependent on the rotate, translate and scale function +% all functions now behave consistenly, which also means that they are not compleetly backward compatible w.r.t. the order of the rotations +% +% Revision 1.3 2004/05/19 09:57:07 roberto +% added GPL copyright statement, added CVS log item +% + +H = [ + 1 0 0 T(1) + 0 1 0 T(2) + 0 0 1 T(3) + 0 0 0 1 + ]; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_apply.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_apply.m new file mode 100644 index 0000000..83bbd1f --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_apply.m @@ -0,0 +1,164 @@ +function [warped] = warp_apply(M, input, method); + +% WARP_APPLY performs a 3D linear or nonlinear transformation on the input +% coordinates, similar to those in AIR 3.08. You can find technical +% documentation on warping in general at http://bishopw.loni.ucla.edu/AIR3 +% +% Use as +% [warped] = warp_apply(M, input, method) +% where +% M mvector or matrix with warping parameters +% input Nx3 matrix with coordinates +% warped Nx3 matrix with coordinates +% method string describing the warping method +% +% The methods 'nonlin0', 'nonlin2' ... 'nonlin5' specify a +% polynomial transformation. The size of the transformation matrix +% depends on the order of the warp +% zeroth order : 1 parameter per coordinate (translation) +% first order : 4 parameters per coordinate (total 12, affine) +% second order : 10 parameters per coordinate +% third order : 20 parameters per coordinate +% fourth order : 35 parameters per coordinate +% fifth order : 56 parameters per coordinate (total 168) +% The size of M should be 3xP, where P is the number of parameters +% per coordinate. Alternatively, you can specify the method to be +% 'nonlinear', where the order will be determined from teh size of +% the matrix M. +% +% If the method 'homogeneous' is selected, the input matrix M should be +% a 4x4 homogenous transformation matrix. +% +% If any other method is selected, it is assumed that it specifies +% the name of an auxiliary function that will, when given the input +% parameter vector M, return an 4x4 homogenous transformation +% matrix. Supplied functions in teh warping toolbox are translate, +% rotate, scale, rigidbody, globalrescale, traditional, affine, +% perspective. + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: warp_apply.m,v $ +% Revision 1.1 2009/01/30 04:02:13 arno +% *** empty log message *** +% +% Revision 1.2 2006/09/13 09:47:41 roboos +% auto-detect homogeneous transformation if method not given +% +% Revision 1.1 2005/08/15 08:10:07 roboos +% renamed warp3d into warp_apply +% +% Revision 1.5 2005/03/21 15:35:38 roboos +% added support for nonlin0 up to nonlin5 as method-string (equivalent to nonlinear) +% extended help, added some comments and error checks +% +% Revision 1.4 2004/05/19 09:57:07 roberto +% added GPL copyright statement, added CVS log item +% +% Revision 1.3 2004/05/19 09:48:01 roberto +% *** empty log message *** +% +% Revision 1.2 2003/03/12 16:07:18 roberto +% improved help documentation +% + +if nargin<3 && all(size(M)==4) + % no specific transformation mode has been selected + % it looks like a homogenous transformation matrix + method = 'homogenous'; +elseif nargin<3 + % the default method is 'nonlinear' + method = 'nonlinear'; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% nonlinear warping +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +if any(strcmp(method, {'nonlinear', 'nonlin0', 'nonlin1', 'nonlin2', 'nonlin3', 'nonlin4', 'nonlin5'})) + x = input(:,1); + y = input(:,2); + z = input(:,3); + s = size(M); + + if s(1)~=3 + error('invalid size of nonlinear transformation matrix'); + elseif strcmp(method, 'nonlin0') & s(2)~=1 + error('invalid size of nonlinear transformation matrix'); + elseif strcmp(method, 'nonlin1') & s(2)~=4 + error('invalid size of nonlinear transformation matrix'); + elseif strcmp(method, 'nonlin2') & s(2)~=10 + error('invalid size of nonlinear transformation matrix'); + elseif strcmp(method, 'nonlin3') & s(2)~=20 + error('invalid size of nonlinear transformation matrix'); + elseif strcmp(method, 'nonlin4') & s(2)~=35 + error('invalid size of nonlinear transformation matrix'); + elseif strcmp(method, 'nonlin5') & s(2)~=56 + error('invalid size of nonlinear transformation matrix'); + end + + if s(2)==1 + % this is a translation, which in a strict sense is not the 0th order nonlinear transformation + xx = M(1,1) + x; + yy = M(2,1) + y; + zz = M(3,1) + z; + elseif s(2)==4 + xx = M(1,1) + M(1,2)*x + M(1,3)*y + M(1,4)*z; + yy = M(2,1) + M(2,2)*x + M(2,3)*y + M(2,4)*z; + zz = M(3,1) + M(3,2)*x + M(3,3)*y + M(3,4)*z; + elseif s(2)==10 + xx = M(1,1) + M(1,2)*x + M(1,3)*y + M(1,4)*z + M(1,5)*x.*x + M(1,6)*x.*y + M(1,7)*x.*z + M(1,8)*y.*y + M(1,9)*y.*z + M(1,10)*z.*z; + yy = M(2,1) + M(2,2)*x + M(2,3)*y + M(2,4)*z + M(2,5)*x.*x + M(2,6)*x.*y + M(2,7)*x.*z + M(2,8)*y.*y + M(2,9)*y.*z + M(2,10)*z.*z; + zz = M(3,1) + M(3,2)*x + M(3,3)*y + M(3,4)*z + M(3,5)*x.*x + M(3,6)*x.*y + M(3,7)*x.*z + M(3,8)*y.*y + M(3,9)*y.*z + M(3,10)*z.*z; + elseif s(2)==20 + xx = M(1,1) + M(1,2)*x + M(1,3)*y + M(1,4)*z + M(1,5)*x.*x + M(1,6)*x.*y + M(1,7)*x.*z + M(1,8)*y.*y + M(1,9)*y.*z + M(1,10)*z.*z + M(1,11)*x.*x.*x + M(1,12)*x.*x.*y + M(1,13)*x.*x.*z + M(1,14)*x.*y.*y + M(1,15)*x.*y.*z + M(1,16)*x.*z.*z + M(1,17)*y.*y.*y + M(1,18)*y.*y.*z + M(1,19)*y.*z.*z + M(1,20)*z.*z.*z; + yy = M(2,1) + M(2,2)*x + M(2,3)*y + M(2,4)*z + M(2,5)*x.*x + M(2,6)*x.*y + M(2,7)*x.*z + M(2,8)*y.*y + M(2,9)*y.*z + M(2,10)*z.*z + M(2,11)*x.*x.*x + M(2,12)*x.*x.*y + M(2,13)*x.*x.*z + M(2,14)*x.*y.*y + M(2,15)*x.*y.*z + M(2,16)*x.*z.*z + M(2,17)*y.*y.*y + M(2,18)*y.*y.*z + M(2,19)*y.*z.*z + M(2,20)*z.*z.*z; + zz = M(3,1) + M(3,2)*x + M(3,3)*y + M(3,4)*z + M(3,5)*x.*x + M(3,6)*x.*y + M(3,7)*x.*z + M(3,8)*y.*y + M(3,9)*y.*z + M(3,10)*z.*z + M(3,11)*x.*x.*x + M(3,12)*x.*x.*y + M(3,13)*x.*x.*z + M(3,14)*x.*y.*y + M(3,15)*x.*y.*z + M(3,16)*x.*z.*z + M(3,17)*y.*y.*y + M(3,18)*y.*y.*z + M(3,19)*y.*z.*z + M(3,20)*z.*z.*z; + elseif s(2)==35 + xx = M(1,1) + M(1,2)*x + M(1,3)*y + M(1,4)*z + M(1,5)*x.*x + M(1,6)*x.*y + M(1,7)*x.*z + M(1,8)*y.*y + M(1,9)*y.*z + M(1,10)*z.*z + M(1,11)*x.*x.*x + M(1,12)*x.*x.*y + M(1,13)*x.*x.*z + M(1,14)*x.*y.*y + M(1,15)*x.*y.*z + M(1,16)*x.*z.*z + M(1,17)*y.*y.*y + M(1,18)*y.*y.*z + M(1,19)*y.*z.*z + M(1,20)*z.*z.*z + M(1,21)*x.*x.*x.*x + M(1,22)*x.*x.*x.*y + M(1,23)*x.*x.*x.*z + M(1,24)*x.*x.*y.*y + M(1,25)*x.*x.*y.*z + M(1,26)*x.*x.*z.*z + M(1,27)*x.*y.*y.*y + M(1,28)*x.*y.*y.*z + M(1,29)*x.*y.*z.*z + M(1,30)*x.*z.*z.*z + M(1,31)*y.*y.*y.*y + M(1,32)*y.*y.*y.*z + M(1,33)*y.*y.*z.*z + M(1,34)*y.*z.*z.*z + M(1,35)*z.*z.*z.*z; + yy = M(2,1) + M(2,2)*x + M(2,3)*y + M(2,4)*z + M(2,5)*x.*x + M(2,6)*x.*y + M(2,7)*x.*z + M(2,8)*y.*y + M(2,9)*y.*z + M(2,10)*z.*z + M(2,11)*x.*x.*x + M(2,12)*x.*x.*y + M(2,13)*x.*x.*z + M(2,14)*x.*y.*y + M(2,15)*x.*y.*z + M(2,16)*x.*z.*z + M(2,17)*y.*y.*y + M(2,18)*y.*y.*z + M(2,19)*y.*z.*z + M(2,20)*z.*z.*z + M(2,21)*x.*x.*x.*x + M(2,22)*x.*x.*x.*y + M(2,23)*x.*x.*x.*z + M(2,24)*x.*x.*y.*y + M(2,25)*x.*x.*y.*z + M(2,26)*x.*x.*z.*z + M(2,27)*x.*y.*y.*y + M(2,28)*x.*y.*y.*z + M(2,29)*x.*y.*z.*z + M(2,30)*x.*z.*z.*z + M(2,31)*y.*y.*y.*y + M(2,32)*y.*y.*y.*z + M(2,33)*y.*y.*z.*z + M(2,34)*y.*z.*z.*z + M(2,35)*z.*z.*z.*z; + zz = M(3,1) + M(3,2)*x + M(3,3)*y + M(3,4)*z + M(3,5)*x.*x + M(3,6)*x.*y + M(3,7)*x.*z + M(3,8)*y.*y + M(3,9)*y.*z + M(3,10)*z.*z + M(3,11)*x.*x.*x + M(3,12)*x.*x.*y + M(3,13)*x.*x.*z + M(3,14)*x.*y.*y + M(3,15)*x.*y.*z + M(3,16)*x.*z.*z + M(3,17)*y.*y.*y + M(3,18)*y.*y.*z + M(3,19)*y.*z.*z + M(3,20)*z.*z.*z + M(3,21)*x.*x.*x.*x + M(3,22)*x.*x.*x.*y + M(3,23)*x.*x.*x.*z + M(3,24)*x.*x.*y.*y + M(3,25)*x.*x.*y.*z + M(3,26)*x.*x.*z.*z + M(3,27)*x.*y.*y.*y + M(3,28)*x.*y.*y.*z + M(3,29)*x.*y.*z.*z + M(3,30)*x.*z.*z.*z + M(3,31)*y.*y.*y.*y + M(3,32)*y.*y.*y.*z + M(3,33)*y.*y.*z.*z + M(3,34)*y.*z.*z.*z + M(3,35)*z.*z.*z.*z; + elseif s(2)==56 + xx = M(1,1) + M(1,2)*x + M(1,3)*y + M(1,4)*z + M(1,5)*x.*x + M(1,6)*x.*y + M(1,7)*x.*z + M(1,8)*y.*y + M(1,9)*y.*z + M(1,10)*z.*z + M(1,11)*x.*x.*x + M(1,12)*x.*x.*y + M(1,13)*x.*x.*z + M(1,14)*x.*y.*y + M(1,15)*x.*y.*z + M(1,16)*x.*z.*z + M(1,17)*y.*y.*y + M(1,18)*y.*y.*z + M(1,19)*y.*z.*z + M(1,20)*z.*z.*z + M(1,21)*x.*x.*x.*x + M(1,22)*x.*x.*x.*y + M(1,23)*x.*x.*x.*z + M(1,24)*x.*x.*y.*y + M(1,25)*x.*x.*y.*z + M(1,26)*x.*x.*z.*z + M(1,27)*x.*y.*y.*y + M(1,28)*x.*y.*y.*z + M(1,29)*x.*y.*z.*z + M(1,30)*x.*z.*z.*z + M(1,31)*y.*y.*y.*y + M(1,32)*y.*y.*y.*z + M(1,33)*y.*y.*z.*z + M(1,34)*y.*z.*z.*z + M(1,35)*z.*z.*z.*z + M(1,36)*x.*x.*x.*x.*x + M(1,37)*x.*x.*x.*x.*y + M(1,38)*x.*x.*x.*x.*z + M(1,39)*x.*x.*x.*y.*y + M(1,40)*x.*x.*x.*y.*z + M(1,41)*x.*x.*x.*z.*z + M(1,42)*x.*x.*y.*y.*y + M(1,43)*x.*x.*y.*y.*z + M(1,44)*x.*x.*y.*z.*z + M(1,45)*x.*x.*z.*z.*z + M(1,46)*x.*y.*y.*y.*y + M(1,47)*x.*y.*y.*y.*z + M(1,48)*x.*y.*y.*z.*z + M(1,49)*x.*y.*z.*z.*z + M(1,50)*x.*z.*z.*z.*z + M(1,51)*y.*y.*y.*y.*y + M(1,52)*y.*y.*y.*y.*z + M(1,53)*y.*y.*y.*z.*z + M(1,54)*y.*y.*z.*z.*z + M(1,55)*y.*z.*z.*z.*z + M(1,56)*z.*z.*z.*z.*z; + yy = M(2,1) + M(2,2)*x + M(2,3)*y + M(2,4)*z + M(2,5)*x.*x + M(2,6)*x.*y + M(2,7)*x.*z + M(2,8)*y.*y + M(2,9)*y.*z + M(2,10)*z.*z + M(2,11)*x.*x.*x + M(2,12)*x.*x.*y + M(2,13)*x.*x.*z + M(2,14)*x.*y.*y + M(2,15)*x.*y.*z + M(2,16)*x.*z.*z + M(2,17)*y.*y.*y + M(2,18)*y.*y.*z + M(2,19)*y.*z.*z + M(2,20)*z.*z.*z + M(2,21)*x.*x.*x.*x + M(2,22)*x.*x.*x.*y + M(2,23)*x.*x.*x.*z + M(2,24)*x.*x.*y.*y + M(2,25)*x.*x.*y.*z + M(2,26)*x.*x.*z.*z + M(2,27)*x.*y.*y.*y + M(2,28)*x.*y.*y.*z + M(2,29)*x.*y.*z.*z + M(2,30)*x.*z.*z.*z + M(2,31)*y.*y.*y.*y + M(2,32)*y.*y.*y.*z + M(2,33)*y.*y.*z.*z + M(2,34)*y.*z.*z.*z + M(2,35)*z.*z.*z.*z + M(2,36)*x.*x.*x.*x.*x + M(2,37)*x.*x.*x.*x.*y + M(2,38)*x.*x.*x.*x.*z + M(2,39)*x.*x.*x.*y.*y + M(2,40)*x.*x.*x.*y.*z + M(2,41)*x.*x.*x.*z.*z + M(2,42)*x.*x.*y.*y.*y + M(2,43)*x.*x.*y.*y.*z + M(2,44)*x.*x.*y.*z.*z + M(2,45)*x.*x.*z.*z.*z + M(2,46)*x.*y.*y.*y.*y + M(2,47)*x.*y.*y.*y.*z + M(2,48)*x.*y.*y.*z.*z + M(2,49)*x.*y.*z.*z.*z + M(2,50)*x.*z.*z.*z.*z + M(2,51)*y.*y.*y.*y.*y + M(2,52)*y.*y.*y.*y.*z + M(2,53)*y.*y.*y.*z.*z + M(2,54)*y.*y.*z.*z.*z + M(2,55)*y.*z.*z.*z.*z + M(2,56)*z.*z.*z.*z.*z; + zz = M(3,1) + M(3,2)*x + M(3,3)*y + M(3,4)*z + M(3,5)*x.*x + M(3,6)*x.*y + M(3,7)*x.*z + M(3,8)*y.*y + M(3,9)*y.*z + M(3,10)*z.*z + M(3,11)*x.*x.*x + M(3,12)*x.*x.*y + M(3,13)*x.*x.*z + M(3,14)*x.*y.*y + M(3,15)*x.*y.*z + M(3,16)*x.*z.*z + M(3,17)*y.*y.*y + M(3,18)*y.*y.*z + M(3,19)*y.*z.*z + M(3,20)*z.*z.*z + M(3,21)*x.*x.*x.*x + M(3,22)*x.*x.*x.*y + M(3,23)*x.*x.*x.*z + M(3,24)*x.*x.*y.*y + M(3,25)*x.*x.*y.*z + M(3,26)*x.*x.*z.*z + M(3,27)*x.*y.*y.*y + M(3,28)*x.*y.*y.*z + M(3,29)*x.*y.*z.*z + M(3,30)*x.*z.*z.*z + M(3,31)*y.*y.*y.*y + M(3,32)*y.*y.*y.*z + M(3,33)*y.*y.*z.*z + M(3,34)*y.*z.*z.*z + M(3,35)*z.*z.*z.*z + M(3,36)*x.*x.*x.*x.*x + M(3,37)*x.*x.*x.*x.*y + M(3,38)*x.*x.*x.*x.*z + M(3,39)*x.*x.*x.*y.*y + M(3,40)*x.*x.*x.*y.*z + M(3,41)*x.*x.*x.*z.*z + M(3,42)*x.*x.*y.*y.*y + M(3,43)*x.*x.*y.*y.*z + M(3,44)*x.*x.*y.*z.*z + M(3,45)*x.*x.*z.*z.*z + M(3,46)*x.*y.*y.*y.*y + M(3,47)*x.*y.*y.*y.*z + M(3,48)*x.*y.*y.*z.*z + M(3,49)*x.*y.*z.*z.*z + M(3,50)*x.*z.*z.*z.*z + M(3,51)*y.*y.*y.*y.*y + M(3,52)*y.*y.*y.*y.*z + M(3,53)*y.*y.*y.*z.*z + M(3,54)*y.*y.*z.*z.*z + M(3,55)*y.*z.*z.*z.*z + M(3,56)*z.*z.*z.*z.*z; + else + error('invalid size of nonlinear transformation matrix'); + end + + warped = [xx yy zz]; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% linear warping using homogenous coordinate transformation matrix +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +elseif strcmp(method, 'homogenous') | strcmp(method, 'homogeneous') + warped = [input'; ones(1, size(input, 1))]; + warped = M * warped; + warped = warped(1:3,:)'; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% using external function that returns a homogenous transformation matrix +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +elseif exist(method) + input = [input'; ones(1, size(input, 1))]; + H = feval(method, M); + warped = H * input; + warped = warped(1:3,:)'; + +else + error('unrecognized transformation method'); +end + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_error.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_error.m new file mode 100644 index 0000000..e9fbe24 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_error.m @@ -0,0 +1,82 @@ +function [dist] = warp_error(M, input, target, varargin); + +% WARP_ERROR computes the mean distance after linear or non-linear warping +% and can be used as the goalfunction in a 3D warping minimalisation +% +% Use as +% [dist] = warp_error(M, input, target, 'method') +% +% It returns the mean Euclidian distance (residu) when attempting to +% transform the input towards the target using transformation M +% and using the specified warping method. + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: warp_error.m,v $ +% Revision 1.1 2009/01/30 04:02:13 arno +% *** empty log message *** +% +% Revision 1.4 2006/09/12 15:20:02 roboos +% added support for warping the input points to a triangulated surface +% +% Revision 1.3 2006/04/13 10:50:34 roboos +% renamed calls to warp3d into warp_apply +% +% Revision 1.2 2006/04/13 10:46:09 roboos +% updated the documentation +% +% Revision 1.1 2005/08/15 08:11:20 roboos +% Renamed warpfun into warp_error, which is a better description of +% its use. This is a companion function for warp_optim. +% +% Revision 1.2 2004/05/19 09:57:08 roberto +% added GPL copyright statement, added CVS log item +% + +if ~isempty(M) + % apply the warp to the input positions + input = warp_apply(M, input, varargin{:}); +end + +if isstruct(target) + % project points onto target surface and compute distance between points and surface + % this is done here in one step, but can also be done in seperate steps (see example code below) + el = project_elec(input, target.pnt, target.tri); + dist = mean(el(:,4)); + % the following example code is more elaborate, and can be used for detailled testing + if 0 + Npnt = size(input,1); + prj = zeros(Npnt, 3); + % step 1: project each input point onto the triangulated surface + el = project_elec(input, target.pnt, target.tri); + % step 2: compute the projected point on the triangulated surface + for i=1:Npnt + v1 = target.pnt(target.tri(el(i,1),1),:); % position of vertex 1 + v2 = target.pnt(target.tri(el(i,1),2),:); % position of vertex 2 + v3 = target.pnt(target.tri(el(i,1),3),:); % position of vertex 3 + prj(i,:) = routlm(v1, v2, v3, el(i,2), el(i,3)); + end + % step 3: compute the distance + dif = input - prj; + dist = mean(sqrt(sum(dif' .^2))); + end +else + % compute distance between input points and target points + dif = input - target; + dist = mean(sqrt(sum(dif' .^2))); +end + diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_optim.m b/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_optim.m new file mode 100644 index 0000000..e294cb1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/private/warp_optim.m @@ -0,0 +1,207 @@ +function [result, M] = warp_pnt(input, target, method); + +% WARP_PNT determine intermediate positions using warping (deformation) +% the input cloud of points is warped to match the target. +% The strategy is to start with simpelest linear warp, followed by a more +% elaborate linear warp, which then is followed by the nonlinear warps up +% to the desired order. +% +% [result, M] = warp_pnt(input, target, method) +% input contains the Nx3 measured 3D positions +% target contains the Nx3 template 3D positions +% method should be empty or any of 'nonlin1', 'nonlin2' ... 'nonlin5' +% +% The default is a traditional linear warp with rescaling in each +% dimension. Optionally you can select a nonlinear warp of the 1st (affine) +% up to the 5th order. +% +% This function depends on the OPTIM and WARPING toolboxes. + +% Copyright (C) 2000-2005, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% $Log: warp_optim.m,v $ +% Revision 1.1 2009/01/30 04:02:13 arno +% *** empty log message *** +% +% Revision 1.7 2006/11/23 11:34:51 roboos +% use optimization toolbox if possible, othewise use the standard fminsearch function +% +% Revision 1.6 2006/09/13 09:55:58 roboos +% fixed bug (typo) in rigidbody +% +% Revision 1.5 2006/04/13 12:55:45 roboos +% added a str2func to solve a problem with feval and private +% +% Revision 1.4 2006/04/13 10:50:34 roboos +% renamed calls to warp3d into warp_apply +% +% Revision 1.3 2006/04/13 10:47:39 roboos +% renamed all calls to warpfun into warp_error +% +% Revision 1.2 2006/04/13 10:38:24 roboos +% fixed a problem due to find/strmatch +% +% Revision 1.1 2005/08/15 08:12:40 roboos +% Renamed warp_pnt into warp_optim for consistency with other functions. +% Also changed the code, the subsequent ordering of the simple to +% more complex warps is handled more clean. +% +% Revision 1.4 2005/03/21 15:43:42 roboos +% fixed bug in output for nonlinear warping +% added support for rigidbody or globalrescale warp +% +% Revision 1.3 2004/05/19 09:57:08 roberto +% added GPL copyright statement, added CVS log item +% + +global fb; + +if nargin<3 + method='traditional'; +end + +pos1 = input; +pos2 = target; + +% The warp_error function might be located in the private subdirectory fo +% fieldtrip, i.e. only available to functions in the fieldtrip toolbox. +% The following line ensures that the function can also be found by the +% feval that is executed by the optimalization toolbox. +warp_error = str2func('warp_error'); + +% set the options for the minimalisation routine +if exist('fminunc') + % use the optimization toolbox + optimfun = @fminunc; + options = optimset('fminunc'); + options = optimset(options, 'Display', 'off'); + options = optimset(options, 'MaxIter', 1500); + % options = optimset(options, 'MaxFunEvals', '1000*numberOfVariables'); + options = optimset(options, 'TolFun', 1e-4); + options = optimset(options, 'LargeScale', 'off'); +else + % use a standard matlab function, this function converges slower + optimfun = @fminsearch; + options = optimset('fminsearch'); + options = optimset(options, 'Display', 'off'); + options = optimset(options, 'MaxIter', 4500); +end + +if fb; fprintf('distance = %f\n', warp_error([0 0 0 0 0 0], pos1, pos2, 'rigidbody')); end + +% the warp is done in steps, starting simple and progressively getting more complex +level = find(strcmp(method, { + 'rigidbody' % 1 + 'globalrescale' % 2 + 'traditional' % 3 + 'nonlin1' % 4 + 'nonlin2' % 5 + 'nonlin3' % 6 + 'nonlin4' % 7 + 'nonlin5' % 8 + })); + +if isempty(method) + error('incorrect warping method specified'); +end + +if level>=1 + % do a rigid-body transformation (6 parameters) + if fb; disp('rigidbody...'); end + ri = [0 0 0 0 0 0]; + rf = optimfun(warp_error, ri, options, pos1, pos2, 'rigidbody'); + if fb; fprintf('distance = %f\n', warp_error(rf, pos1, pos2, 'rigidbody')); end +end + +if level>=2 + % do a rigid-body + global rescaling transformation (7 parameters) + if fb; disp('rigidbody + global rescaling...'); end + gi = [rf 1]; + gf = optimfun(warp_error, gi, options, pos1, pos2, 'globalrescale'); + if fb; fprintf('distance = %f\n', warp_error(gf, pos1, pos2, 'globalrescale')); end +end + +if level>=3 + % do a rigid-body + individual rescaling transformation (9 parameters) + if fb; disp('rigidbody + individual rescaling...'); end + ti = [gf gf(7) gf(7)]; + tf = optimfun(warp_error, ti, options, pos1, pos2, 'traditional'); + if fb; fprintf('distance = %f\n', warp_error(tf, pos1, pos2, 'traditional')); end +end + +if level>=4 + % do a first order nonlinear transformation, + if fb; disp('1st order nonlinear...'); end + e1i = traditional(tf); + e1i = [e1i(1:3,4) e1i(1:3,1:3)]; % reshuffle from homogenous into nonlinear + e1f = optimfun(warp_error, e1i, options, pos1, pos2); + if fb; fprintf('distance = %f\n', warp_error(e1f, pos1, pos2, 'nonlinear')); end +end + +if level>=5 + % do a second order nonlinear transformation, + if fb; disp('2nd order nonlinear...'); end + e2i = [e1f zeros(3,6)]; + e2f = optimfun(warp_error, e2i, options, pos1, pos2); + if fb; fprintf('distance = %f\n', warp_error(e2f, pos1, pos2, 'nonlinear')); end +end + +if level>=6 + % do a third order nonlinear transformation, + if fb; disp('3rd order nonlinear...'); end + e3i = [e2f zeros(3,10)]; + e3f = optimfun(warp_error, e3i, options, pos1, pos2); + if fb; fprintf('distance = %f\n', warp_error(e3f, pos1, pos2, 'nonlinear')); end +end + +if level>=7 + % do a fourth order nonlinear transformation, + if fb; disp('4th order nonlinear...'); end + e4i = [e3f zeros(3,10)]; + e4f = optimfun(warp_error, e4i, options, pos1, pos2); + if fb; fprintf('distance = %f\n', warp_error(e4f, pos1, pos2, 'nonlinear')); end +end + +if level>=8 + % do a fifth order nonlinear transformation, + if fb; disp('5th order nonlinear...'); end + e5i = [e4f zeros(3,10)]; + e5f = optimfun(warp_error, e5i, options, pos1, pos2); + if fb; fprintf('distance = %f\n', warp_error(e5f, pos1, pos2, 'nonlinear')); end +end + +% return the estimated parameters of the highest level warp +% and compute the warped points +switch level + case 1 + M = rf; + case 2 + M = gf; + case 3 + M = tf; + case 4 + M = e1f; + case 5 + M = e2f; + case 6 + M = e3f; + case 7 + M = e4f; + case 8 + M = e5f; +end +result = warp_apply(M, input, method); diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/sph2spm.m b/code/eeglab13_4_4b/plugins/dipfit2.3/sph2spm.m new file mode 100644 index 0000000..72d37e2 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/sph2spm.m @@ -0,0 +1,90 @@ +% sph2spm() - compute homogenous transformation matrix from +% BESA spherical coordinates to SPM 3-D coordinate +% +% Usage: +% >> trans = sph2spm; +% +% Outputs: +% trans - homogenous transformation matrix +% +% Note: head radius for spherical model is assumed to be 85 mm. +% +% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2005 +% Arnaud Delorme, SCCN, La Jolla 2005 + +% SMI, University Aalborg, Denmark http://www.smi.auc.dk/ +% FC Donders Centre, University Nijmegen, the Netherlands http://www.fcdonders.kun.nl/ + +% Copyright (C) 2003 Robert Oostenveld, SMI/FCDC roberto@smi.auc.dk +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function besa2SPM_result = besa2SPM; + +if 0 + % original transformation: problem occipital part of the haed did not + % fit + + % NAS, Left EAR, Right EAR coordinates in BESA + besa_NAS = [0.0000 0.0913 -0.0407]; + besa_LPA = [-0.0865 0.0000 -0.0500]; + besa_RPA = [0.0865 0.0000 -0.0500]; + + % NAS, Left EAR, Right EAR coordinates in SPM average + SPM_NAS = [0 84 -48]; + SPM_LPA = [-82 -32 -54]; + SPM_RPA = [82 -32 -54]; + + % transformation to CTF coordinate system + % --------------------------------------- + SPM2common = headcoordinates(SPM_NAS , SPM_LPA , SPM_RPA, 0); + besa2common = headcoordinates(besa_NAS, besa_LPA, besa_RPA, 0); + + nazcommon1 = besa2common * [ besa_NAS 1]'; + nazcommon2 = SPM2common * [ SPM_NAS 1]'; + ratiox = nazcommon1(1)/nazcommon2(1); + + lpacommon1 = besa2common * [ besa_LPA 1]'; + lpacommon2 = SPM2common * [ SPM_LPA 1]'; + ratioy = lpacommon1(2)/lpacommon2(2); + + scaling = eye(4); + scaling(1,1) = 1/ratiox; + scaling(2,2) = 1/ratioy; + scaling(3,3) = mean([ 1/ratioy 1/ratiox]); + + besa2SPM_result = inv(SPM2common) * scaling * besa2common; +end; + +if 0 + % using electrodenormalize to fit standard BESA electrode (haed radius + % has to be 85) to BEM electrodes + % problem: fit not optimal for temporal electrodes + + % traditional takes as input the .m field returned in the output from + % electrodenormalize + besa2SPM_result = traditionaldipfit([0.5588 -14.5541 1.8045 0.0004 0.0000 -1.5623 1.1889 1.0736 132.6198]) +end; + +% adapted manualy from above for temporal electrodes (see factor 0.94 +% instead of 1.1889 and x shift of -18.0041 instead of -14.5541) +%traditionaldipfit([0.5588 -18.0041 1.8045 0.0004 0.0000 -1.5623 1.1889 0.94 132.6198]) + +besa2SPM_result = [ + 0.0101 -0.9400 0 0.5588 + 1.1889 0.0080 0.0530 -18.0041 + -0.0005 -0.0000 1.1268 1.8045 + 0 0 0 1.0000 + ]; diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_1005.elc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_1005.elc new file mode 100644 index 0000000..4e69532 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_1005.elc @@ -0,0 +1,698 @@ +# ASA electrode file +ReferenceLabel avg +UnitPosition mm +NumberPositions= 346 +Positions +-86.0761 -19.9897 -47.9860 +85.7939 -20.0093 -48.0310 +0.0083 86.8110 -39.9830 +-29.4367 83.9171 -6.9900 +0.1123 88.2470 -1.7130 +29.8723 84.8959 -7.0800 +-48.9708 64.0872 -47.6830 +-54.8397 68.5722 -10.5900 +-45.4307 72.8622 5.9780 +-33.7007 76.8371 21.2270 +-18.4717 79.9041 32.7520 +0.2313 80.7710 35.4170 +19.8203 80.3019 32.7640 +35.7123 77.7259 21.9560 +46.5843 73.8078 6.0340 +55.7433 69.6568 -10.7550 +50.4352 63.8698 -48.0050 +-70.1019 41.6523 -49.9520 +-70.2629 42.4743 -11.4200 +-64.4658 48.0353 16.9210 +-50.2438 53.1112 42.1920 +-27.4958 56.9311 60.3420 +0.3122 58.5120 66.4620 +29.5142 57.6019 59.5400 +51.8362 54.3048 40.8140 +67.9142 49.8297 16.3670 +73.0431 44.4217 -12.0000 +72.1141 42.0667 -50.4520 +-84.0759 14.5673 -50.4290 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +84.1131 14.3647 -50.5380 +-85.8941 -15.8287 -48.2830 +-84.1611 -16.0187 -9.3460 +-80.2801 -13.7597 29.1600 +-65.3581 -11.6317 64.3580 +-36.1580 -9.9839 89.7520 +0.4009 -9.1670 100.2440 +37.6720 -9.6241 88.4120 +67.1179 -10.9003 63.5800 +83.4559 -12.7763 29.2080 +85.0799 -15.0203 -9.4900 +85.5599 -16.3613 -48.2710 +-85.6192 -46.5147 -45.7070 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +86.1618 -47.0353 -45.8690 +-73.0093 -73.7657 -40.9980 +-72.4343 -73.4527 -2.4870 +-67.2723 -76.2907 28.3820 +-53.0073 -78.7878 55.9400 +-28.6203 -80.5249 75.4360 +0.3247 -81.1150 82.6150 +31.9197 -80.4871 76.7160 +55.6667 -78.5602 56.5610 +67.8877 -75.9043 28.0910 +73.0557 -73.0683 -2.5400 +73.8947 -74.3903 -41.2200 +-54.9104 -98.0448 -35.4650 +-54.8404 -97.5279 2.7920 +-48.4244 -99.3408 21.5990 +-36.5114 -100.8529 37.1670 +-18.9724 -101.7680 46.5360 +0.2156 -102.1780 50.6080 +19.8776 -101.7930 46.3930 +36.7816 -100.8491 36.3970 +49.8196 -99.4461 21.7270 +55.6666 -97.6251 2.7300 +54.9876 -98.0911 -35.5410 +-29.4134 -112.4490 8.8390 +0.1076 -114.8920 14.6570 +29.8426 -112.1560 8.8000 +-29.8184 -114.5700 -29.2160 +0.0045 -118.5650 -23.0780 +29.7416 -114.2600 -29.2560 +-43.2897 75.8552 -28.2440 +-38.5517 79.9532 -4.9950 +-27.9857 82.4591 2.7020 +-17.1947 84.8491 10.0270 +-5.9317 86.8780 16.2000 +7.1053 87.0740 16.4690 +18.9233 85.5969 11.4430 +28.6443 82.9759 2.8280 +39.3203 80.6868 -4.7250 +43.8223 76.5418 -28.3070 +-63.2538 53.8573 -30.3160 +-61.3508 58.7992 0.8970 +-50.7998 64.0412 23.0890 +-34.3157 68.3931 41.1880 +-11.4357 70.7561 50.3480 +13.4793 71.2010 51.1750 +36.1833 69.1509 41.2540 +52.3972 65.0708 22.8620 +62.9152 60.0448 0.6300 +64.3342 54.5998 -30.4440 +-79.0669 28.0813 -31.2530 +-74.4999 31.3003 4.8460 +-65.2379 36.4282 36.1440 +-44.4098 40.7622 61.6900 +-15.4238 43.6600 77.6820 +17.5922 44.0540 77.7880 +45.8532 41.6228 60.6470 +67.1281 37.7998 35.2960 +78.0531 32.9817 4.4830 +80.0971 28.5137 -31.3380 +-84.1250 -1.8467 -29.7940 +-82.3550 0.8263 8.5790 +-74.6920 4.3033 45.3070 +-51.0509 7.1772 74.3770 +-18.2190 9.0941 92.5290 +18.7870 9.2479 91.5620 +51.8851 7.7978 73.5070 +77.0020 5.3357 45.3500 +83.8880 1.9457 8.5010 +84.1230 -1.8083 -29.6380 +-86.9731 -32.2157 -27.8480 +-85.5651 -30.6287 11.1530 +-76.4071 -29.7307 49.2170 +-52.9281 -28.9058 80.3040 +-18.3541 -28.3219 98.2200 +20.2199 -28.1481 98.1720 +55.1139 -28.3862 80.4740 +79.0059 -28.9863 49.6280 +85.9999 -29.8203 11.2480 +88.6249 -32.2723 -28.0000 +-78.1602 -60.7567 -23.8240 +-76.6802 -60.8317 12.8800 +-68.1152 -62.9747 47.2520 +-46.9142 -64.6908 75.2960 +-15.8202 -65.5999 91.1640 +19.4198 -65.5950 92.4050 +50.6738 -64.4822 76.1300 +71.0958 -62.6243 47.3280 +78.5198 -60.4323 12.9020 +78.9027 -60.9553 -23.8050 +-64.5973 -87.6558 -19.0140 +-62.9593 -87.5028 12.9520 +-54.0103 -89.8988 37.3320 +-35.8874 -91.6669 55.5040 +-12.0474 -92.6069 65.5080 +13.9226 -92.6940 66.9580 +37.7986 -91.6291 56.7330 +54.6087 -89.6402 37.0350 +63.1117 -87.2282 12.8560 +65.0137 -87.8062 -18.9520 +-42.8624 -108.0730 -13.1510 +-40.1204 -107.1290 12.0610 +-31.9514 -108.2520 23.0470 +-19.8624 -108.9420 29.7600 +-6.9194 -109.2600 32.7100 +6.8036 -109.1630 31.5820 +20.2936 -108.9140 28.9440 +32.1756 -108.2520 22.2550 +41.0976 -107.2450 12.1380 +43.8946 -109.1270 -13.1700 +-14.8504 -117.9870 -6.9200 +15.0946 -118.0180 -6.9330 +-14.8107 87.2351 -4.4770 +15.1623 88.0910 -4.5510 +-54.8298 66.4132 -29.7040 +-51.1757 70.8362 -1.7550 +-39.6407 74.8671 13.6780 +-27.2187 78.7091 28.3750 +-9.1977 80.6051 35.1330 +10.4823 80.8650 35.3590 +28.5803 79.3029 28.4700 +40.9403 75.7399 13.8600 +52.0293 71.8468 -1.9200 +55.7542 67.1698 -29.8240 +-71.5079 41.1193 -30.8540 +-68.5558 45.2843 3.0020 +-58.4878 50.6722 30.1920 +-39.9798 55.2601 52.6000 +-13.3838 57.9021 64.3320 +15.8342 58.4559 64.9920 +41.7942 56.2259 51.4990 +60.0522 52.0858 28.7080 +71.9592 47.1917 2.4750 +72.7981 41.8218 -31.0260 +-82.9559 13.3203 -30.8080 +-80.1139 16.3903 6.8500 +-71.2099 20.8203 41.3240 +-48.5119 24.5292 69.1360 +-17.3439 27.0241 86.9230 +18.4181 27.2709 86.4370 +49.5481 25.2378 68.4300 +73.2191 22.0067 41.2970 +81.5801 17.6837 6.5640 +83.3711 13.5477 -30.7490 +-85.1321 -17.0557 -28.7310 +-82.9461 -14.8827 10.0090 +-75.2941 -12.6397 47.9040 +-51.5811 -10.7548 78.0350 +-18.2790 -9.4319 97.3560 +19.6780 -9.3041 95.7060 +53.8059 -10.1442 77.7300 +78.1249 -11.7353 47.8400 +85.1369 -13.9063 9.8900 +86.0999 -17.0883 -28.7560 +-84.8102 -47.2457 -26.2200 +-82.7042 -46.2977 11.9740 +-73.3012 -46.7917 49.1090 +-51.0492 -47.1758 80.0160 +-17.3542 -47.3419 97.4100 +20.6798 -47.2321 98.0720 +53.9968 -46.8902 80.0770 +76.5498 -46.3733 49.1400 +85.1998 -45.8073 12.1020 +85.4428 -47.2213 -26.1760 +-72.1773 -74.6277 -21.5360 +-70.1133 -74.8677 12.9990 +-61.7283 -77.6238 43.0280 +-41.6733 -79.7528 66.7150 +-13.9613 -81.0029 81.0030 +17.2977 -80.9810 81.6410 +44.7477 -79.6111 67.6550 +63.6267 -77.3022 43.1190 +72.1037 -74.4993 13.0250 +73.2817 -75.0773 -21.5760 +-54.7754 -98.9768 -16.1930 +-51.9284 -98.4438 12.3040 +-43.3424 -100.1629 30.0090 +-28.0074 -101.3610 42.3790 +-9.5034 -102.0600 49.4180 +10.2356 -102.0290 48.9420 +28.6476 -101.3901 42.1380 +44.2206 -100.2191 29.8080 +52.8386 -98.5360 12.2500 +55.8596 -99.8940 -16.2080 +-14.8054 -115.1000 11.8290 +15.1456 -115.1910 11.8330 +-15.1584 -118.2420 -26.0480 +15.1286 -118.1510 -26.0810 +-36.1247 72.3801 -45.8520 +-43.5117 78.5802 -9.2400 +-33.2847 81.2071 -1.1400 +-22.3517 83.5621 6.0710 +-12.2417 86.1941 14.1880 +0.1703 87.3220 17.4420 +13.6223 86.7579 15.3020 +24.1013 84.3769 7.4330 +33.9133 81.8119 -1.0350 +43.9483 79.2958 -9.3000 +37.7123 72.1679 -46.1970 +-59.3398 52.6802 -48.7700 +-63.2618 55.9922 -11.1730 +-55.8198 61.3962 11.8840 +-43.3817 66.3672 32.8110 +-23.5817 69.9171 47.2930 +0.2763 71.2800 52.0920 +25.5583 70.5559 47.8270 +45.1522 67.2748 32.7310 +58.0002 62.5998 11.9000 +64.6732 57.2738 -11.4600 +60.6012 52.2668 -49.0380 +-78.4839 28.7703 -50.5220 +-76.6149 28.6533 -11.5080 +-71.5059 33.9263 20.9930 +-55.9399 38.7162 49.7880 +-30.6548 42.4151 71.0400 +0.3512 44.0740 79.1410 +32.6451 43.1009 70.7950 +57.5042 39.8518 48.8110 +74.2501 35.4997 20.3800 +79.0341 30.3437 -11.9970 +79.9201 28.9417 -50.9140 +-87.3620 -0.5147 -49.8370 +-82.6680 -0.9417 -10.2840 +-80.1330 2.5853 27.3120 +-64.1610 5.8313 60.8850 +-35.7490 8.3091 85.4590 +0.3911 9.5080 95.5600 +36.0700 8.6519 83.8320 +65.1640 6.6198 60.0520 +81.5440 3.6637 27.2010 +83.1680 0.1817 -10.3640 +85.3930 -0.9523 -49.5200 +-86.6321 -31.2377 -47.1780 +-85.9331 -31.0927 -8.4740 +-81.5431 -30.1727 30.2730 +-66.1281 -29.2957 65.8980 +-36.9301 -28.5699 91.7340 +0.3959 -28.1630 101.2690 +38.5399 -28.2251 90.9760 +68.8539 -28.6403 66.4100 +84.5529 -29.3783 30.8780 +85.9999 -30.2803 -8.4350 +86.7619 -31.7313 -47.2530 +-80.7152 -60.6457 -43.5940 +-78.5992 -59.7237 -4.7580 +-73.6642 -61.9227 30.3800 +-59.4112 -63.9248 62.6720 +-32.7283 -65.3199 85.9440 +0.3658 -65.7500 94.0580 +35.8918 -65.1381 85.9800 +62.2558 -63.6152 62.7190 +76.6708 -61.5483 30.5430 +79.3188 -59.3033 -4.8400 +81.5598 -61.2153 -43.8000 +-64.5703 -86.4318 -38.3240 +-64.5833 -86.2218 0.0330 +-58.7123 -88.7048 25.1930 +-46.1603 -90.8878 47.4460 +-24.6483 -92.2919 62.0760 +0.2727 -92.7580 67.3420 +26.4367 -92.2951 63.1990 +47.1437 -90.7122 47.6780 +60.8127 -88.5042 25.6620 +65.1517 -85.9432 -0.0090 +65.0377 -86.7182 -38.4480 +-43.1284 -107.5160 -32.3870 +-42.9764 -106.4930 5.7730 +-36.2344 -107.7160 17.7500 +-25.9844 -108.6160 26.5440 +-13.6644 -109.2660 32.8560 +0.1676 -109.2760 32.7900 +13.6506 -109.1060 30.9360 +26.6636 -108.6680 26.4150 +37.7006 -107.8400 18.0690 +43.6696 -106.5990 5.7260 +43.1766 -107.4440 -32.4630 +-29.3914 -114.5110 -10.0200 +0.0525 -119.3430 -3.9360 +29.5526 -113.6360 -10.0510 +-84.1611 -16.0187 -9.3460 +-72.4343 -73.4527 -2.4870 +85.0799 -15.0203 -9.4900 +73.0557 -73.0683 -2.5400 +-86.0761 -44.9897 -67.9860 + 85.7939 -45.0093 -68.0310 +-86.0761 -24.9897 -67.9860 + 85.7939 -25.0093 -68.0310 +Labels +LPA +RPA +Nz +Fp1 +Fpz +Fp2 +AF9 +AF7 +AF5 +AF3 +AF1 +AFz +AF2 +AF4 +AF6 +AF8 +AF10 +F9 +F7 +F5 +F3 +F1 +Fz +F2 +F4 +F6 +F8 +F10 +FT9 +FT7 +FC5 +FC3 +FC1 +FCz +FC2 +FC4 +FC6 +FT8 +FT10 +T9 +T7 +C5 +C3 +C1 +Cz +C2 +C4 +C6 +T8 +T10 +TP9 +TP7 +CP5 +CP3 +CP1 +CPz +CP2 +CP4 +CP6 +TP8 +TP10 +P9 +P7 +P5 +P3 +P1 +Pz +P2 +P4 +P6 +P8 +P10 +PO9 +PO7 +PO5 +PO3 +PO1 +POz +PO2 +PO4 +PO6 +PO8 +PO10 +O1 +Oz +O2 +I1 +Iz +I2 +AFp9h +AFp7h +AFp5h +AFp3h +AFp1h +AFp2h +AFp4h +AFp6h +AFp8h +AFp10h +AFF9h +AFF7h +AFF5h +AFF3h +AFF1h +AFF2h +AFF4h +AFF6h +AFF8h +AFF10h +FFT9h +FFT7h +FFC5h +FFC3h +FFC1h +FFC2h +FFC4h +FFC6h +FFT8h +FFT10h +FTT9h +FTT7h +FCC5h +FCC3h +FCC1h +FCC2h +FCC4h +FCC6h +FTT8h +FTT10h +TTP9h +TTP7h +CCP5h +CCP3h +CCP1h +CCP2h +CCP4h +CCP6h +TTP8h +TTP10h +TPP9h +TPP7h +CPP5h +CPP3h +CPP1h +CPP2h +CPP4h +CPP6h +TPP8h +TPP10h +PPO9h +PPO7h +PPO5h +PPO3h +PPO1h +PPO2h +PPO4h +PPO6h +PPO8h +PPO10h +POO9h +POO7h +POO5h +POO3h +POO1h +POO2h +POO4h +POO6h +POO8h +POO10h +OI1h +OI2h +Fp1h +Fp2h +AF9h +AF7h +AF5h +AF3h +AF1h +AF2h +AF4h +AF6h +AF8h +AF10h +F9h +F7h +F5h +F3h +F1h +F2h +F4h +F6h +F8h +F10h +FT9h +FT7h +FC5h +FC3h +FC1h +FC2h +FC4h +FC6h +FT8h +FT10h +T9h +T7h +C5h +C3h +C1h +C2h +C4h +C6h +T8h +T10h +TP9h +TP7h +CP5h +CP3h +CP1h +CP2h +CP4h +CP6h +TP8h +TP10h +P9h +P7h +P5h +P3h +P1h +P2h +P4h +P6h +P8h +P10h +PO9h +PO7h +PO5h +PO3h +PO1h +PO2h +PO4h +PO6h +PO8h +PO10h +O1h +O2h +I1h +I2h +AFp9 +AFp7 +AFp5 +AFp3 +AFp1 +AFpz +AFp2 +AFp4 +AFp6 +AFp8 +AFp10 +AFF9 +AFF7 +AFF5 +AFF3 +AFF1 +AFFz +AFF2 +AFF4 +AFF6 +AFF8 +AFF10 +FFT9 +FFT7 +FFC5 +FFC3 +FFC1 +FFCz +FFC2 +FFC4 +FFC6 +FFT8 +FFT10 +FTT9 +FTT7 +FCC5 +FCC3 +FCC1 +FCCz +FCC2 +FCC4 +FCC6 +FTT8 +FTT10 +TTP9 +TTP7 +CCP5 +CCP3 +CCP1 +CCPz +CCP2 +CCP4 +CCP6 +TTP8 +TTP10 +TPP9 +TPP7 +CPP5 +CPP3 +CPP1 +CPPz +CPP2 +CPP4 +CPP6 +TPP8 +TPP10 +PPO9 +PPO7 +PPO5 +PPO3 +PPO1 +PPOz +PPO2 +PPO4 +PPO6 +PPO8 +PPO10 +POO9 +POO7 +POO5 +POO3 +POO1 +POOz +POO2 +POO4 +POO6 +POO8 +POO10 +OI1 +OIz +OI2 +T3 +T5 +T4 +T6 +M1 +M2 +A1 +A2 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_1020.elc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_1020.elc new file mode 100644 index 0000000..2f68b51 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_1020.elc @@ -0,0 +1,200 @@ +# ASA electrode file +ReferenceLabel avg +UnitPosition mm +NumberPositions= 97 +Positions +-86.0761 -19.9897 -47.9860 +85.7939 -20.0093 -48.0310 +0.0083 86.8110 -39.9830 +-29.4367 83.9171 -6.9900 +0.1123 88.2470 -1.7130 +29.8723 84.8959 -7.0800 +-48.9708 64.0872 -47.6830 +-54.8397 68.5722 -10.5900 +-45.4307 72.8622 5.9780 +-33.7007 76.8371 21.2270 +-18.4717 79.9041 32.7520 +0.2313 80.7710 35.4170 +19.8203 80.3019 32.7640 +35.7123 77.7259 21.9560 +46.5843 73.8078 6.0340 +55.7433 69.6568 -10.7550 +50.4352 63.8698 -48.0050 +-70.1019 41.6523 -49.9520 +-70.2629 42.4743 -11.4200 +-64.4658 48.0353 16.9210 +-50.2438 53.1112 42.1920 +-27.4958 56.9311 60.3420 +0.3122 58.5120 66.4620 +29.5142 57.6019 59.5400 +51.8362 54.3048 40.8140 +67.9142 49.8297 16.3670 +73.0431 44.4217 -12.0000 +72.1141 42.0667 -50.4520 +-84.0759 14.5673 -50.4290 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +84.1131 14.3647 -50.5380 +-85.8941 -15.8287 -48.2830 +-84.1611 -16.0187 -9.3460 +-80.2801 -13.7597 29.1600 +-65.3581 -11.6317 64.3580 +-36.1580 -9.9839 89.7520 +0.4009 -9.1670 100.2440 +37.6720 -9.6241 88.4120 +67.1179 -10.9003 63.5800 +83.4559 -12.7763 29.2080 +85.0799 -15.0203 -9.4900 +85.5599 -16.3613 -48.2710 +-85.6192 -46.5147 -45.7070 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +86.1618 -47.0353 -45.8690 +-73.0093 -73.7657 -40.9980 +-72.4343 -73.4527 -2.4870 +-67.2723 -76.2907 28.3820 +-53.0073 -78.7878 55.9400 +-28.6203 -80.5249 75.4360 +0.3247 -81.1150 82.6150 +31.9197 -80.4871 76.7160 +55.6667 -78.5602 56.5610 +67.8877 -75.9043 28.0910 +73.0557 -73.0683 -2.5400 +73.8947 -74.3903 -41.2200 +-54.9104 -98.0448 -35.4650 +-54.8404 -97.5279 2.7920 +-48.4244 -99.3408 21.5990 +-36.5114 -100.8529 37.1670 +-18.9724 -101.7680 46.5360 +0.2156 -102.1780 50.6080 +19.8776 -101.7930 46.3930 +36.7816 -100.8491 36.3970 +49.8196 -99.4461 21.7270 +55.6666 -97.6251 2.7300 +54.9876 -98.0911 -35.5410 +-29.4134 -112.4490 8.8390 +0.1076 -114.8920 14.6570 +29.8426 -112.1560 8.8000 +-29.8184 -114.5700 -29.2160 +0.0045 -118.5650 -23.0780 +29.7416 -114.2600 -29.2560 +-84.1611 -16.0187 -9.3460 +-72.4343 -73.4527 -2.4870 +85.0799 -15.0203 -9.4900 +73.0557 -73.0683 -2.5400 +-86.0761 -44.9897 -67.9860 + 85.7939 -45.0093 -68.0310 +-86.0761 -24.9897 -67.9860 + 85.7939 -25.0093 -68.0310 +Labels +LPA +RPA +Nz +Fp1 +Fpz +Fp2 +AF9 +AF7 +AF5 +AF3 +AF1 +AFz +AF2 +AF4 +AF6 +AF8 +AF10 +F9 +F7 +F5 +F3 +F1 +Fz +F2 +F4 +F6 +F8 +F10 +FT9 +FT7 +FC5 +FC3 +FC1 +FCz +FC2 +FC4 +FC6 +FT8 +FT10 +T9 +T7 +C5 +C3 +C1 +Cz +C2 +C4 +C6 +T8 +T10 +TP9 +TP7 +CP5 +CP3 +CP1 +CPz +CP2 +CP4 +CP6 +TP8 +TP10 +P9 +P7 +P5 +P3 +P1 +Pz +P2 +P4 +P6 +P8 +P10 +PO9 +PO7 +PO5 +PO3 +PO1 +POz +PO2 +PO4 +PO6 +PO8 +PO10 +O1 +Oz +O2 +O9 +Iz +O10 +T3 +T5 +T4 +T6 +M1 +M2 +A1 +A2 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_alphabetic.elc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_alphabetic.elc new file mode 100644 index 0000000..55367e4 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_alphabetic.elc @@ -0,0 +1,142 @@ +# ASA electrode file +ReferenceLabel avg +UnitPosition mm +NumberPositions= 68 +Positions +-86.0761 -19.9897 -47.9860 +85.7939 -20.0093 -48.0310 +0.0083 86.8110 -39.9830 +-29.4367 83.9171 -6.9900 +0.1123 88.2470 -1.7130 +29.8723 84.8959 -7.0800 +-54.8397 68.5722 -10.5900 +-33.7007 76.8371 21.2270 +0.2313 80.7710 35.4170 +35.7123 77.7259 21.9560 +55.7433 69.6568 -10.7550 +-70.2629 42.4743 -11.4200 +-64.4658 48.0353 16.9210 +-50.2438 53.1112 42.1920 +-27.4958 56.9311 60.3420 +0.3122 58.5120 66.4620 +29.5142 57.6019 59.5400 +51.8362 54.3048 40.8140 +67.9142 49.8297 16.3670 +73.0431 44.4217 -12.0000 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +-84.1611 -16.0187 -9.3460 +-80.2801 -13.7597 29.1600 +-65.3581 -11.6317 64.3580 +-36.1580 -9.9839 89.7520 +0.4009 -9.1670 100.2440 +37.6720 -9.6241 88.4120 +67.1179 -10.9003 63.5800 +83.4559 -12.7763 29.2080 +85.0799 -15.0203 -9.4900 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +-72.4343 -73.4527 -2.4870 +-67.2723 -76.2907 28.3820 +-53.0073 -78.7878 55.9400 +-28.6203 -80.5249 75.4360 +0.3247 -81.1150 82.6150 +31.9197 -80.4871 76.7160 +55.6667 -78.5602 56.5610 +67.8877 -75.9043 28.0910 +73.0557 -73.0683 -2.5400 +-54.8404 -97.5279 2.7920 +-36.5114 -100.8529 37.1670 +0.2156 -102.1780 50.6080 +36.7816 -100.8491 36.3970 +55.6666 -97.6251 2.7300 +-29.4134 -112.4490 8.8390 +0.1076 -114.8920 14.6570 +29.8426 -112.1560 8.8000 +-86.0761 -44.9897 -67.9860 + 85.7939 -45.0093 -68.0310 +-86.0761 -24.9897 -67.9860 + 85.7939 -25.0093 -68.0310 +Labels +LPA +RPA +Nz +Fp1 +Fpz +Fp2 +B3 +B1 +Bz +B2 +B4 +F7 +F5 +F3 +F1 +Fz +F2 +F4 +F6 +F8 +D7 +D5 +D3 +D1 +Dz +D2 +D4 +D6 +D8 +T3 +C5 +C3 +C1 +Cz +C2 +C4 +C6 +T4 +E7 +E5 +E3 +E1 +Ez +E2 +E4 +E6 +E8 +T5 +P5 +P3 +P1 +Pz +P2 +P4 +P6 +T6 +H3 +H1 +Hz +H2 +H4 +O1 +Oz +O2 +M1 +M2 +A1 +A2 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_postfixed.elc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_postfixed.elc new file mode 100644 index 0000000..3ed4d32 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_postfixed.elc @@ -0,0 +1,212 @@ +# ASA electrode file +ReferenceLabel avg +UnitPosition mm +NumberPositions= 103 +Positions +-86.0761 -19.9897 -47.9860 +85.7939 -20.0093 -48.0310 +0.0083 86.8110 -39.9830 +-29.4367 83.9171 -6.9900 +0.1123 88.2470 -1.7130 +29.8723 84.8959 -7.0800 +-54.8397 68.5722 -10.5900 +-45.4307 72.8622 5.9780 +-33.7007 76.8371 21.2270 +-18.4717 79.9041 32.7520 +0.2313 80.7710 35.4170 +19.8203 80.3019 32.7640 +35.7123 77.7259 21.9560 +46.5843 73.8078 6.0340 +55.7433 69.6568 -10.7550 +-70.2629 42.4743 -11.4200 +-64.4658 48.0353 16.9210 +-50.2438 53.1112 42.1920 +-27.4958 56.9311 60.3420 +0.3122 58.5120 66.4620 +29.5142 57.6019 59.5400 +51.8362 54.3048 40.8140 +67.9142 49.8297 16.3670 +73.0431 44.4217 -12.0000 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +-84.0759 14.5673 -50.4290 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +84.1131 14.3647 -50.5380 +-84.1611 -16.0187 -9.3460 +-80.2801 -13.7597 29.1600 +-65.3581 -11.6317 64.3580 +-36.1580 -9.9839 89.7520 +0.4009 -9.1670 100.2440 +37.6720 -9.6241 88.4120 +67.1179 -10.9003 63.5800 +83.4559 -12.7763 29.2080 +85.0799 -15.0203 -9.4900 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +-73.0093 -73.7657 -40.9980 +-72.4343 -73.4527 -2.4870 +-67.2723 -76.2907 28.3820 +-53.0073 -78.7878 55.9400 +-28.6203 -80.5249 75.4360 +0.3247 -81.1150 82.6150 +31.9197 -80.4871 76.7160 +55.6667 -78.5602 56.5610 +67.8877 -75.9043 28.0910 +73.0557 -73.0683 -2.5400 +73.8947 -74.3903 -41.2200 +-54.9104 -98.0448 -35.4650 +-54.8404 -97.5279 2.7920 +-48.4244 -99.3408 21.5990 +-36.5114 -100.8529 37.1670 +-18.9724 -101.7680 46.5360 +0.2156 -102.1780 50.6080 +19.8776 -101.7930 46.3930 +36.7816 -100.8491 36.3970 +49.8196 -99.4461 21.7270 +55.6666 -97.6251 2.7300 +54.9876 -98.0911 -35.5410 +-29.4134 -112.4490 8.8390 +0.1076 -114.8920 14.6570 +29.8426 -112.1560 8.8000 +-29.8184 -114.5700 -29.2160 +0.0045 -118.5650 -23.0780 +29.7416 -114.2600 -29.2560 +-86.0761 -44.9897 -67.9860 + 85.7939 -45.0093 -68.0310 +-86.0761 -24.9897 -67.9860 + 85.7939 -25.0093 -68.0310 +Labels +LPA +RPA +Nz +Fp1 +Fpz +Fp2 +F7a +F5a +F3a +F1a +Fza +F2a +F4a +F6a +F8a +F7 +F5 +F3 +F1 +Fz +F2 +F4 +F6 +F8 +F7p +F5p +F3p +F1p +Fzp +F2p +F4p +F6p +F8p +T1 +T3a +C5a +C3a +C1a +Cza +C2a +C4a +C6a +T4a +T2 +T3 +C5 +C3 +C1 +Cz +C2 +C4 +C6 +T4 +T3p +C5p +C3p +C1p +Czp +C2p +C4p +C6p +T4p +T5a +P5a +P3a +P1a +Pza +P2a +P4a +P6a +T6a +Cb1a +T5 +P5 +P3 +P1 +Pz +P2 +P4 +P6 +T6 +Cb2a +Cb1 +O1a +P5p +P3p +P1p +Pzp +P2p +P4p +P6p +O2a +Cb2 +O1 +Oz +O2 +Cb1p +Iz +Cb2p +M1 +M2 +A1 +A2 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_prefixed.elc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_prefixed.elc new file mode 100644 index 0000000..67563c0 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_prefixed.elc @@ -0,0 +1,160 @@ +# ASA electrode file +ReferenceLabel avg +UnitPosition mm +NumberPositions= 77 +Positions +-86.0761 -19.9897 -47.9860 +85.7939 -20.0093 -48.0310 +0.0083 86.8110 -39.9830 +-29.4367 83.9171 -6.9900 +0.1123 88.2470 -1.7130 +29.8723 84.8959 -7.0800 +55.7433 69.6568 -10.7550 +-33.7007 76.8371 21.2270 +0.2313 80.7710 35.4170 +35.7123 77.7259 21.9560 +55.7433 69.6568 -10.7550 +-70.2629 42.4743 -11.4200 +-64.4658 48.0353 16.9210 +-50.2438 53.1112 42.1920 +-27.4958 56.9311 60.3420 +0.3122 58.5120 66.4620 +29.5142 57.6019 59.5400 +51.8362 54.3048 40.8140 +67.9142 49.8297 16.3670 +73.0431 44.4217 -12.0000 +-84.0759 14.5673 -50.4290 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +84.1131 14.3647 -50.5380 +-85.8941 -15.8287 -48.2830 +-84.1611 -16.0187 -9.3460 +-80.2801 -13.7597 29.1600 +-65.3581 -11.6317 64.3580 +-36.1580 -9.9839 89.7520 +0.4009 -9.1670 100.2440 +37.6720 -9.6241 88.4120 +67.1179 -10.9003 63.5800 +83.4559 -12.7763 29.2080 +85.0799 -15.0203 -9.4900 +85.5599 -16.3613 -48.2710 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +-73.0093 -73.7657 -40.9980 +-72.4343 -73.4527 -2.4870 +-67.2723 -76.2907 28.3820 +-53.0073 -78.7878 55.9400 +-28.6203 -80.5249 75.4360 +0.3247 -81.1150 82.6150 +31.9197 -80.4871 76.7160 +55.6667 -78.5602 56.5610 +67.8877 -75.9043 28.0910 +73.0557 -73.0683 -2.5400 +73.8947 -74.3903 -41.2200 +-54.9104 -98.0448 -35.4650 +-54.8404 -97.5279 2.7920 +-36.5114 -100.8529 37.1670 +0.2156 -102.1780 50.6080 +36.7816 -100.8491 36.3970 +55.6666 -97.6251 2.7300 +54.9876 -98.0911 -35.5410 +-29.4134 -112.4490 8.8390 +0.1076 -114.8920 14.6570 +29.8426 -112.1560 8.8000 +0.0045 -118.5650 -23.0780 +-86.0761 -44.9897 -67.9860 + 85.7939 -45.0093 -68.0310 +-86.0761 -24.9897 -67.9860 + 85.7939 -25.0093 -68.0310 +Labels +LPA +RPA +Nz +Fp1 +Fpz +Fp2 +aF3 +aF1 +aFz +aF2 +aF4 +F7 +F5 +F3 +F1 +Fz +F2 +F4 +F6 +F8 +iT1 +T1 +pF5 +pF3 +pF1 +pFz +pF2 +pF4 +pF6 +T2 +iT2 +iT3 +T3 +C5 +C3 +C1 +Cz +C2 +C4 +C6 +T4 +iT4 +T3A +pC5 +pC3 +pC1 +pCz +pC2 +pC4 +pC6 +T4A +iT5 +T5 +P5 +P3 +P1 +Pz +P2 +P4 +P6 +T6 +iT6 +pO5 +pO3 +pO1 +pOz +pO2 +pO4 +pO6 +O1 +Oz +O2 +Iz +M1 +M2 +A1 +A2 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_primed.elc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_primed.elc new file mode 100644 index 0000000..00ec918 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/elec/standard_primed.elc @@ -0,0 +1,212 @@ +# ASA electrode file +ReferenceLabel avg +UnitPosition mm +NumberPositions= 103 +Positions +-86.0761 -19.9897 -47.9860 +85.7939 -20.0093 -48.0310 +0.0083 86.8110 -39.9830 +-29.4367 83.9171 -6.9900 +0.1123 88.2470 -1.7130 +29.8723 84.8959 -7.0800 +-54.8397 68.5722 -10.5900 +-45.4307 72.8622 5.9780 +-33.7007 76.8371 21.2270 +-18.4717 79.9041 32.7520 +0.2313 80.7710 35.4170 +19.8203 80.3019 32.7640 +35.7123 77.7259 21.9560 +46.5843 73.8078 6.0340 +55.7433 69.6568 -10.7550 +-70.2629 42.4743 -11.4200 +-64.4658 48.0353 16.9210 +-50.2438 53.1112 42.1920 +-27.4958 56.9311 60.3420 +0.3122 58.5120 66.4620 +29.5142 57.6019 59.5400 +51.8362 54.3048 40.8140 +67.9142 49.8297 16.3670 +73.0431 44.4217 -12.0000 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +-84.0759 14.5673 -50.4290 +-80.7750 14.1203 -11.1350 +-77.2149 18.6433 24.4600 +-60.1819 22.7162 55.5440 +-34.0619 26.0111 79.9870 +0.3761 27.3900 88.6680 +34.7841 26.4379 78.8080 +62.2931 23.7228 55.6300 +79.5341 19.9357 24.4380 +81.8151 15.4167 -11.3300 +84.1131 14.3647 -50.5380 +-84.1611 -16.0187 -9.3460 +-80.2801 -13.7597 29.1600 +-65.3581 -11.6317 64.3580 +-36.1580 -9.9839 89.7520 +0.4009 -9.1670 100.2440 +37.6720 -9.6241 88.4120 +67.1179 -10.9003 63.5800 +83.4559 -12.7763 29.2080 +85.0799 -15.0203 -9.4900 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +-84.8302 -46.0217 -7.0560 +-79.5922 -46.5507 30.9490 +-63.5562 -47.0088 65.6240 +-35.5131 -47.2919 91.3150 +0.3858 -47.3180 99.4320 +38.3838 -47.0731 90.6950 +66.6118 -46.6372 65.5800 +83.3218 -46.1013 31.2060 +85.5488 -45.5453 -7.1300 +-73.0093 -73.7657 -40.9980 +-72.4343 -73.4527 -2.4870 +-67.2723 -76.2907 28.3820 +-53.0073 -78.7878 55.9400 +-28.6203 -80.5249 75.4360 +0.3247 -81.1150 82.6150 +31.9197 -80.4871 76.7160 +55.6667 -78.5602 56.5610 +67.8877 -75.9043 28.0910 +73.0557 -73.0683 -2.5400 +73.8947 -74.3903 -41.2200 +-54.9104 -98.0448 -35.4650 +-54.8404 -97.5279 2.7920 +-48.4244 -99.3408 21.5990 +-36.5114 -100.8529 37.1670 +-18.9724 -101.7680 46.5360 +0.2156 -102.1780 50.6080 +19.8776 -101.7930 46.3930 +36.7816 -100.8491 36.3970 +49.8196 -99.4461 21.7270 +55.6666 -97.6251 2.7300 +54.9876 -98.0911 -35.5410 +-29.4134 -112.4490 8.8390 +0.1076 -114.8920 14.6570 +29.8426 -112.1560 8.8000 +-29.8184 -114.5700 -29.2160 +0.0045 -118.5650 -23.0780 +29.7416 -114.2600 -29.2560 +-86.0761 -44.9897 -67.9860 + 85.7939 -45.0093 -68.0310 +-86.0761 -24.9897 -67.9860 + 85.7939 -25.0093 -68.0310 +Labels +LPA +RPA +Nz +Fp1 +Fpz +Fp2 +F7' +F5' +F3' +F1' +Fz' +F2' +F4' +F6' +F8' +F7 +F5 +F3 +F1 +Fz +F2 +F4 +F6 +F8 +F7'' +F5'' +F3'' +F1'' +Fz'' +F2'' +F4'' +F6'' +F8'' +T1 +T3' +C5' +C3' +C1' +Cz' +C2' +C4' +C6' +T4' +T2 +T3 +C5 +C3 +C1 +Cz +C2 +C4 +C6 +T4 +T3'' +C5'' +C3'' +C1'' +Cz'' +C2'' +C4'' +C6'' +T4'' +T5' +P5' +P3' +P1' +Pz' +P2' +P4' +P6' +T6' +Cb1' +T5 +P5 +P3 +P1 +Pz +P2 +P4 +P6 +T6 +Cb2' +Cb1 +O1' +P5'' +P3'' +P1'' +Pz'' +P2'' +P4'' +P6'' +O2' +Cb2 +O1 +Oz +O2 +Cb1'' +Iz +Cb2'' +M1 +M2 +A1 +A2 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bnd b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bnd new file mode 100644 index 0000000..58f3e47 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bnd @@ -0,0 +1,11 @@ +# Boundary with 1222 vertices and 2440 polygons with 3 vertices each +Type= Scalp +NumberPositions= 1222 +UnitPosition mm +Positions standard_skin_1222-1.bps +NumberSlices= 32 +Slices +1 6 12 19 24 30 35 40 45 49 53 56 58 60 61 62 62 61 60 58 56 53 49 45 40 35 30 24 19 12 6 1 +NumberPolygons= 2440 +TypePolygons= 3 +Polygons standard_skin_1222-1.bpl diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bpl b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bpl new file mode 100644 index 0000000..f580a8f Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bpl differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bps b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bps new file mode 100644 index 0000000..79dbf2f Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222-1.bps differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222.vol b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222.vol new file mode 100644 index 0000000..cfe8cf1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_1222.vol @@ -0,0 +1,8 @@ +# Volume conductor with 1 boundaries +NumberBoundaries= 1 +UnitConduct S/m +Conductivities +0.33 +WhereInside +0 +Boundary1 standard_skin_1222-1.bnd diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bnd b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bnd new file mode 100644 index 0000000..3f178c1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bnd @@ -0,0 +1,11 @@ +# Boundary with 14038 vertices and 28072 polygons with 3 vertices each +Type= Scalp +NumberPositions= 14038 +UnitPosition mm +Positions standard_skin_14038-1.bps +NumberSlices= 107 +Slices +1 6 13 19 25 31 37 44 50 56 62 68 74 80 85 91 97 102 108 113 118 123 128 133 138 143 147 152 156 160 164 168 172 175 179 182 185 188 191 193 195 198 200 202 203 205 206 207 208 209 209 210 210 210 210 209 209 208 207 206 205 203 202 200 198 195 193 191 188 185 182 179 175 172 168 164 160 156 152 147 143 138 133 128 123 118 113 108 102 97 91 85 80 74 68 62 56 50 44 37 31 25 19 13 6 0 1 +NumberPolygons= 28072 +TypePolygons= 3 +Polygons standard_skin_14038-1.bpl diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bpl b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bpl new file mode 100644 index 0000000..9577177 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bpl differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bps b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bps new file mode 100644 index 0000000..c20a7ea Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038-1.bps differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038.vol b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038.vol new file mode 100644 index 0000000..1adbeb9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_14038.vol @@ -0,0 +1,8 @@ +# Volume conductor with 1 boundaries +NumberBoundaries= 1 +UnitConduct S/m +Conductivities +0.33 +WhereInside +0 +Boundary1 standard_skin_14038-1.bnd diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bnd b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bnd new file mode 100644 index 0000000..f04ea99 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bnd @@ -0,0 +1,11 @@ +# Boundary with 5054 vertices and 10104 polygons with 3 vertices each +Type= Scalp +NumberPositions= 5054 +UnitPosition mm +Positions standard_skin_5054-1.bps +NumberSlices= 65 +Slices +1 6 13 19 25 31 37 43 49 55 60 66 71 76 81 86 90 94 99 102 106 109 112 115 117 119 121 123 124 125 126 126 126 126 125 124 123 121 119 117 115 112 109 106 102 99 94 90 86 81 76 71 66 60 55 49 43 37 31 25 19 13 6 0 1 +NumberPolygons= 10104 +TypePolygons= 3 +Polygons standard_skin_5054-1.bpl diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bpl b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bpl new file mode 100644 index 0000000..e3d270e Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bpl differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bps b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bps new file mode 100644 index 0000000..e76d125 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054-1.bps differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054.vol b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054.vol new file mode 100644 index 0000000..e05034e --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/skin/standard_skin_5054.vol @@ -0,0 +1,8 @@ +# Volume conductor with 1 boundaries +NumberBoundaries= 1 +UnitConduct S/m +Conductivities +0.33 +WhereInside +0 +Boundary1 standard_skin_5054-1.bnd diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_mri.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_mri.mat new file mode 100644 index 0000000..196040a Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_mri.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_vol.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_vol.mat new file mode 100644 index 0000000..d21f258 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_vol.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_vol_SCCN.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_vol_SCCN.mat new file mode 100644 index 0000000..35d91fc Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BEM/standard_vol_SCCN.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateRed254.loc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateRed254.loc new file mode 100644 index 0000000..65a73da --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateRed254.loc @@ -0,0 +1,254 @@ +1 -39.993 0.61067 A1 +2 -37.456 0.52976 A2 +3 -37.954 0.45664 A3 +4 -41.082 0.38651 A4 +5 -47.577 0.32415 A5 +6 -59.837 0.27577 A6 +7 -78.493 0.24127 A7 +8 -44.442 0.67591 A8 +9 -47.999 0.6091 A9 +10 -49.044 0.53271 A10 +11 -50.519 0.44863 A11 +12 -58.31 0.37649 A12 +13 -73.747 0.33244 A13 +14 -92.572 0.3159 A14 +15 -51.663 0.72498 A15 +16 -55.519 0.66755 A16 +17 -58.722 0.59937 A17 +18 -63.673 0.51791 A18 +19 -67.389 0.44445 A19 +20 -83.73 0.40267 A20 +21 -100.15 0.39122 A21 +22 -63.68 0.70729 A22 +23 -66.433 0.66235 A23 +24 -73.198 0.58759 A24 +25 -78.033 0.50242 A25 +26 -94.009 0.48113 A26 +27 -108.59 0.47186 A27 +28 -74.998 0.70469 A28 +29 -78.57 0.65566 A29 +30 -87.363 0.57783 A30 +31 -102.72 0.55893 A31 +32 -117.88 0.54031 A32 +33 -43.879 0.24556 B1 +34 -31.979 0.16239 B2 +35 -3.0293 0.19723 B3 +36 30.079 0.17371 B4 +37 38.524 0.26878 B5 +38 -57.577 0.18361 B6 +39 -59.643 0.091678 B7 +40 -4.3228 0.10312 B8 +41 56.25 0.11629 B9 +42 59.41 0.20707 B10 +43 -88.74 0.15607 B11 +44 -90 0.0033889 B12 +45 86.102 0.17859 B13 +46 -103.02 0.24685 B14 +47 -124.44 0.17181 B15 +48 -157.7 0.1659 B16 +49 176.13 0.1131 B17 +50 144.93 0.18232 B18 +51 121.72 0.20569 B19 +52 98.357 0.27707 B20 +53 -127.62 0.27815 B21 +54 -147.89 0.25418 B22 +55 -167.82 0.26797 B23 +56 178.36 0.19454 B24 +57 158.87 0.26381 B25 +58 140.24 0.25896 B26 +59 118.96 0.30331 B27 +60 -139.56 0.33077 B28 +61 -154.68 0.32819 B29 +62 176.98 0.29833 B30 +63 149.81 0.32471 B31 +64 135.25 0.3349 B32 +65 -147.56 0.81654 C1 +66 -164.8 0.81002 C2 +67 -148.68 0.60176 C3 +68 -160.47 0.5831 C4 +69 -170.36 0.54628 C5 +70 179.07 0.5163 C6 +71 167.07 0.55561 C7 +72 156.28 0.5827 C8 +73 144.14 0.59662 C9 +74 167.43 0.80802 C10 +75 147.27 0.83823 C11 +76 -155.37 0.6439 C12 +77 -170.14 0.61535 C13 +78 179.09 0.57583 C14 +79 167.1 0.61834 C15 +80 152.5 0.65293 C16 +81 -152.37 0.70734 C17 +82 -169.55 0.681 C18 +83 178.56 0.6394 C19 +84 165.44 0.67454 C20 +85 148.43 0.71591 C21 +86 -151.8 0.76274 C22 +87 -167.24 0.73459 C23 +88 178.3 0.71064 C24 +89 165.88 0.73544 C25 +90 150.07 0.7742 C26 +91 -150.97 0.79947 C27 +92 -167.59 0.78222 C28 +93 178.38 0.76587 C29 +94 165.64 0.7826 C30 +95 149.82 0.81343 C31 +96 179.68 0.79715 C32 +97 75.838 0.27645 D1 +98 57.716 0.3066 D2 +99 44.874 0.35755 D3 +100 37.777 0.42783 D4 +101 89.218 0.35285 D5 +102 70.779 0.37037 D6 +103 54.33 0.41168 D7 +104 97.902 0.43522 D8 +105 83.673 0.4473 D9 +106 66.118 0.47371 D10 +107 47.578 0.4866 D11 +108 35.228 0.49581 D12 +109 108.17 0.50255 D13 +110 93.612 0.52282 D14 +111 76.539 0.54225 D15 +112 59.914 0.55547 D16 +113 47.164 0.57055 D17 +114 35.648 0.57819 D18 +115 116.41 0.58251 D19 +116 102.27 0.58935 D20 +117 86.808 0.60248 D21 +118 71.587 0.6267 D22 +119 58.273 0.63774 D23 +120 46.196 0.64802 D24 +121 34.367 0.63474 D25 +122 79.869 0.68151 D26 +123 66.608 0.69611 D27 +124 53.752 0.69777 D28 +125 41.219 0.69393 D29 +126 74.211 0.74264 D30 +127 60.631 0.74509 D31 +128 48.281 0.74101 D32 +129 135.45 0.60911 E1 +130 124.93 0.64033 E2 +131 111.43 0.65268 E3 +132 137.75 0.67605 E4 +133 123.99 0.7063 E5 +134 138.35 0.75212 E6 +135 121.66 0.78379 E7 +136 136.2 0.80101 E8 +137 120.27 0.82341 E9 +138 138.99 0.82908 E10 +139 124.2 0.8492 E11 +140 134.59 0.84802 E12 +141 119.99 0.86803 E13 +142 107.96 0.86397 E14 +143 98.893 0.85178 E15 +144 85.638 0.82801 E16 +145 73.549 0.79385 E17 +146 59.153 0.79237 E18 +147 47.058 0.79273 E19 +148 39.25 0.75039 E20 +149 70.906 0.82641 E21 +150 55.222 0.82771 E22 +151 41.602 0.83137 E23 +152 36.069 0.80146 E24 +153 83.262 0.8592 E25 +154 66.467 0.8668 E26 +155 48.82 0.87401 E27 +156 97.023 0.88013 E28 +157 77.4 0.90336 E29 +158 55.993 0.91389 E30 +159 140.97 0.54307 E31 +160 127.97 0.56324 E32 +161 -110.02 0.33025 F1 +162 -127.08 0.35941 F2 +163 -144.39 0.39014 F3 +164 -157.78 0.39311 F4 +165 -166.72 0.34059 F5 +166 178.04 0.37114 F6 +167 161.37 0.33199 F7 +168 152.27 0.3887 F8 +169 139.1 0.37245 F9 +170 120.59 0.37519 F10 +171 105.08 0.3472 F11 +172 119 0.50177 F12 +173 112.47 0.42935 F13 +174 128.06 0.44113 F14 +175 143.39 0.44447 F15 +176 154.51 0.46384 F16 +177 163.24 0.41541 F17 +178 178.02 0.45063 F18 +179 -169.81 0.4131 F19 +180 -160.8 0.46324 F20 +181 -148.09 0.44947 F21 +182 -132.41 0.43097 F22 +183 -117.31 0.41189 F23 +184 -122.95 0.49099 F24 +185 -137.85 0.49018 F25 +186 -150.72 0.50426 F26 +187 -162.52 0.52463 F27 +188 -170.73 0.47993 F28 +189 164.26 0.48709 F29 +190 145.98 0.50559 F30 +191 131.8 0.50192 F31 +192 156.22 0.52801 F32 +193 -38.643 0.7541 G1 +194 -46.226 0.80178 G2 +195 -58.166 0.79237 G3 +196 -72.893 0.77713 G4 +197 -34.367 0.81404 G5 +198 -53.937 0.83848 G6 +199 -69.51 0.82996 G7 +200 -80.256 0.81722 G8 +201 -35.335 0.8479 G9 +202 -44.294 0.88352 G10 +203 -63.035 0.87615 G11 +204 -83.054 0.86841 G12 +205 -53.771 0.92452 G13 +206 -79.631 0.9075 G14 +207 -123.3 0.85986 G15 +208 -96.258 0.8751 G16 +209 -98.491 0.84675 G17 +210 -144.77 0.54827 G18 +211 -111.82 0.85428 G19 +212 -117.98 0.82082 G20 +213 -123.63 0.77312 G21 +214 -127.16 0.70696 G22 +215 -111.51 0.63222 G23 +216 -125.82 0.61955 G24 +217 -139.79 0.6095 G25 +218 -143.25 0.67752 G26 +219 -140.23 0.74021 G27 +220 -138.61 0.79578 G28 +221 -129.63 0.84108 G29 +222 -144.18 0.82212 G30 +223 -132.09 0.54374 G31 +224 -140.79 0.84395 G32 +225 33.252 0.3393 H1 +226 21.201 0.27457 H2 +227 0.20131 0.29697 H3 +228 -18.78 0.2673 H4 +229 -31.626 0.33307 H5 +230 -15.832 0.34614 H6 +231 0.55525 0.37625 H7 +232 16.539 0.34797 H8 +233 26.328 0.39781 H9 +234 13.349 0.41385 H10 +235 25.209 0.46182 H11 +236 13.034 0.47147 H12 +237 0.37298 0.44597 H13 +238 -14.172 0.41134 H14 +239 -27.063 0.3941 H15 +240 -12.782 0.4778 H16 +241 -25.072 0.45432 H17 +242 -13.157 0.52526 H18 +243 -25.442 0.51376 H19 +244 15.085 0.52859 H20 +245 -26.734 0.56861 H21 +246 -0.24975 0.50951 H22 +247 26.031 0.51712 H23 +248 28.336 0.56969 H24 +249 36.2 0.7092 EXG1 +250 21.641 0.71097 EXG2 +251 -10.518 0.7056 EXG3 +252 -28.949 0.7227 EXG4 +253 9.809 0.55873 EXG5 +254 -7.9205 0.55763 EXG6 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateRed254.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateRed254.mat new file mode 100644 index 0000000..6ad3f32 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateRed254.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateYellow254.loc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateYellow254.loc new file mode 100644 index 0000000..57ebccd --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateYellow254.loc @@ -0,0 +1,254 @@ +1 -40.515 0.58512 A1 +2 -37.995 0.51163 A2 +3 -38.096 0.45017 A3 +4 -39.001 0.3939 A4 +5 -45.311 0.33006 A5 +6 -58.77 0.27964 A6 +7 -75.776 0.24782 A7 +8 -44.091 0.6562 A8 +9 -48.741 0.57143 A9 +10 -48.173 0.50586 A10 +11 -50.234 0.44388 A11 +12 -57.9 0.38156 A12 +13 -70.368 0.34091 A13 +14 -88.789 0.31702 A14 +15 -51.998 0.72305 A15 +16 -52.424 0.64435 A16 +17 -58.335 0.55646 A17 +18 -59.747 0.48662 A18 +19 -67.719 0.42645 A19 +20 -80.696 0.40194 A20 +21 -98.013 0.39587 A21 +22 -59.733 0.70815 A22 +23 -61.693 0.62886 A23 +24 -70.063 0.54691 A24 +25 -74.493 0.4762 A25 +26 -88.273 0.47581 A26 +27 -104.91 0.48165 A27 +28 -70.511 0.69123 A28 +29 -72.088 0.6234 A29 +30 -83.778 0.53164 A30 +31 -99.441 0.54926 A31 +32 -116.41 0.56491 A32 +33 -40.39 0.23713 B1 +34 -34.699 0.1546 B2 +35 3.2078 0.1921 B3 +36 29.579 0.17022 B4 +37 39.3 0.26669 B5 +38 -62.003 0.19563 B6 +39 -58.471 0.10203 B7 +40 -1.9721 0.10319 B8 +41 59.894 0.10914 B9 +42 60.279 0.22433 B10 +43 -88.234 0.17995 B11 +44 -90 0.01395 B12 +45 83.297 0.18977 B13 +46 -102.1 0.26716 B14 +47 -124.13 0.20665 B15 +48 -155.53 0.17275 B16 +49 179.07 0.10089 B17 +50 145.54 0.21593 B18 +51 119.96 0.22693 B19 +52 96 0.27885 B20 +53 -123.16 0.30686 B21 +54 -146.43 0.27069 B22 +55 -166.16 0.27924 B23 +56 176.21 0.22907 B24 +57 155.75 0.29199 B25 +58 137.35 0.29473 B26 +59 117.84 0.31862 B27 +60 -137.88 0.35483 B28 +61 -154.43 0.35545 B29 +62 176.23 0.32284 B30 +63 150.08 0.36028 B31 +64 131.29 0.36568 B32 +65 -142.01 0.83836 C1 +66 -162.21 0.83675 C2 +67 -148.48 0.62454 C3 +68 -159.27 0.60867 C4 +69 -172.12 0.5778 C5 +70 176.74 0.54965 C6 +71 167.36 0.58722 C7 +72 157.39 0.61531 C8 +73 144.87 0.63681 C9 +74 164.37 0.83741 C10 +75 143.78 0.84268 C11 +76 -158.43 0.66473 C12 +77 -171.05 0.63768 C13 +78 177.78 0.6136 C14 +79 167.43 0.64402 C15 +80 154.48 0.66791 C16 +81 -153.84 0.71082 C17 +82 -169.42 0.69341 C18 +83 178.23 0.66643 C19 +84 166.74 0.70419 C20 +85 151.79 0.71936 C21 +86 -150.48 0.76189 C22 +87 -166.68 0.75087 C23 +88 179.33 0.71944 C24 +89 165.77 0.74997 C25 +90 150.48 0.77129 C26 +91 -144.42 0.80947 C27 +92 -163.76 0.7951 C28 +93 177.92 0.77455 C29 +94 164.25 0.79943 C30 +95 146.11 0.81654 C31 +96 178.63 0.81962 C32 +97 74.936 0.28716 D1 +98 54.291 0.31439 D2 +99 43.584 0.36517 D3 +100 37.82 0.43212 D4 +101 87.229 0.37337 D5 +102 69.162 0.37426 D6 +103 55.516 0.41273 D7 +104 96.217 0.43539 D8 +105 79.771 0.44546 D9 +106 62.946 0.47365 D10 +107 49.091 0.47931 D11 +108 35.094 0.4829 D12 +109 105.12 0.5123 D13 +110 89.533 0.51153 D14 +111 74.646 0.52055 D15 +112 60.053 0.5373 D16 +113 45.813 0.53493 D17 +114 34.618 0.5333 D18 +115 112.19 0.56826 D19 +116 98.426 0.56526 D20 +117 84.163 0.5745 D21 +118 68.976 0.58612 D22 +119 56.545 0.5955 D23 +120 47.751 0.61599 D24 +121 38.479 0.58001 D25 +122 75.333 0.65756 D26 +123 63.332 0.66399 D27 +124 53.576 0.66851 D28 +125 45.888 0.67912 D29 +126 68.847 0.73212 D30 +127 60.63 0.73787 D31 +128 51.681 0.74176 D32 +129 133.48 0.63279 E1 +130 119.05 0.62169 E2 +131 104.43 0.62581 E3 +132 138.54 0.69326 E4 +133 121.55 0.69782 E5 +134 135.65 0.74544 E6 +135 118.28 0.75427 E7 +136 134.12 0.79269 E8 +137 114.45 0.80644 E9 +138 129.1 0.83171 E10 +139 108.35 0.84199 E11 +140 122.45 0.86089 E12 +141 106.32 0.86732 E13 +142 94.35 0.86103 E14 +143 93.562 0.83988 E15 +144 78.045 0.82808 E16 +145 68.216 0.78862 E17 +146 57.755 0.79444 E18 +147 47.183 0.79177 E19 +148 44.532 0.73809 E20 +149 62.25 0.8355 E21 +150 50.11 0.83423 E22 +151 38.049 0.82938 E23 +152 37.676 0.7828 E24 +153 72.268 0.86295 E25 +154 54.825 0.87374 E26 +155 39.024 0.86837 E27 +156 81.419 0.87973 E28 +157 63.678 0.89436 E29 +158 41.2 0.90185 E30 +159 139.45 0.58498 E31 +160 127.15 0.56987 E32 +161 -108.08 0.34491 F1 +162 -125.87 0.38507 F2 +163 -142.5 0.41771 F3 +164 -157.24 0.43151 F4 +165 -169.88 0.37479 F5 +166 175.99 0.41988 F6 +167 162.48 0.37433 F7 +168 152.54 0.43347 F8 +169 138.97 0.41715 F9 +170 120.83 0.39901 F10 +171 103.47 0.37153 F11 +172 120.77 0.51934 F12 +173 110.42 0.45241 F13 +174 129.53 0.4726 F14 +175 146.74 0.48835 F15 +176 156.85 0.51075 F16 +177 166.92 0.46787 F17 +178 178.06 0.48775 F18 +179 -170.91 0.45177 F19 +180 -159.98 0.48921 F20 +181 -144.03 0.4837 F21 +182 -128.6 0.45895 F22 +183 -112.71 0.42785 F23 +184 -118.62 0.50422 F24 +185 -135.81 0.5276 F25 +186 -151.96 0.52897 F26 +187 -162.06 0.55493 F27 +188 -172.21 0.51456 F28 +189 167.04 0.53307 F29 +190 146.06 0.55066 F30 +191 133.91 0.52663 F31 +192 156.95 0.57322 F32 +193 -44.727 0.73477 G1 +194 -51.682 0.77252 G2 +195 -60.989 0.7607 G3 +196 -69.604 0.74798 G4 +197 -39.47 0.78374 G5 +198 -54.756 0.81451 G6 +199 -68.067 0.80277 G7 +200 -79.749 0.79044 G8 +201 -42.878 0.82323 G9 +202 -46.596 0.86733 G10 +203 -60.652 0.86079 G11 +204 -75.023 0.85065 G12 +205 -48.607 0.8987 G13 +206 -65.665 0.88472 G14 +207 -108.62 0.86549 G15 +208 -83.272 0.87044 G16 +209 -93.312 0.8348 G17 +210 -143.45 0.57045 G18 +211 -97.554 0.85159 G19 +212 -114.77 0.79731 G20 +213 -121.91 0.74528 G21 +214 -123.66 0.69316 G22 +215 -112.42 0.6383 G23 +216 -125.28 0.6383 G24 +217 -137.87 0.63532 G25 +218 -140.17 0.6859 G26 +219 -138.24 0.73037 G27 +220 -133.59 0.78007 G28 +221 -114.24 0.83242 G29 +222 -129.51 0.82488 G30 +223 -129.97 0.57174 G31 +224 -125.49 0.85753 G32 +225 31.798 0.3249 H1 +226 17.392 0.24959 H2 +227 1.5947 0.29495 H3 +228 -18.5 0.24316 H4 +229 -33.479 0.29296 H5 +230 -14.628 0.32827 H6 +231 0.91757 0.36891 H7 +232 16.66 0.3339 H8 +233 27.436 0.38358 H9 +234 12.405 0.39816 H10 +235 26.003 0.43352 H11 +236 11.976 0.45035 H12 +237 -1.822 0.42744 H13 +238 -14.745 0.39533 H14 +239 -30.295 0.36704 H15 +240 -14.539 0.45065 H16 +241 -27.892 0.4339 H17 +242 -15.226 0.49438 H18 +243 -27.846 0.48238 H19 +244 13.976 0.50255 H20 +245 -26.663 0.52859 H21 +246 -1.3278 0.4768 H22 +247 25.076 0.49486 H23 +248 26.766 0.53675 H24 +249 28.471 0.6793 EXG1 +250 15.308 0.67787 EXG2 +251 -12.069 0.67666 EXG3 +252 -25.68 0.69429 EXG4 +253 6.9272 0.54823 EXG5 +254 -6.4071 0.54574 EXG6 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateYellow254.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateYellow254.mat new file mode 100644 index 0000000..a3d0d59 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/TemplateYellow254.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/avg152t1.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/avg152t1.mat new file mode 100644 index 0000000..37972a2 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/avg152t1.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/avg152t1.mnc b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/avg152t1.mnc new file mode 100644 index 0000000..770a8f7 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/avg152t1.mnc differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard-10-5-cap385.elp b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard-10-5-cap385.elp new file mode 100644 index 0000000..a258c19 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard-10-5-cap385.elp @@ -0,0 +1,359 @@ +346 + FID LPA -120.03 0 85 + FID RPA 120.03 0 85 + FID Nz 114.03 90 85 + EEG Fp1 -92.698 -72.074 85 + EEG Fpz 91.204 90 85 + EEG Fp2 92.698 72.074 85 + EEG AF9 -117.54 -54.695 85 + EEG AF7 -94.02 -54.108 85 + EEG AF5 -83.969 -59.461 85 + EEG AF3 -75.803 -67.539 85 + EEG AF1 -70.343 -77.973 85 + EEG AFz 68.39 90 85 + EEG AF2 70.358 78.046 85 + EEG AF4 75.803 67.539 85 + EEG AF6 83.969 59.461 85 + EEG AF8 94.016 54.142 85 + EEG AF10 117.52 54.733 85 + EEG F9 -118.84 -36.687 85 + EEG F7 -95.055 -36.087 85 + EEG F5 -77.687 -40.595 85 + EEG F3 -62.027 -50.053 85 + EEG F1 -50.225 -66.507 85 + EEG Fz 45.608 90 85 + EEG F2 50.181 66.507 85 + EEG F4 62.01 50.103 85 + EEG F6 77.631 40.595 85 + EEG F8 95.052 36.133 85 + EEG F10 118.84 36.687 85 + EEG FT9 -119.68 -18.393 85 + EEG FT7 -95.745 -18.052 85 + EEG FC5 -73.482 -20.668 85 + EEG FC3 -51.88 -27.575 85 + EEG FC1 -32.613 -45.075 85 + EEG FCz 22.792 90 85 + EEG FC2 32.613 45.075 85 + EEG FC4 51.88 27.575 85 + EEG FC6 73.482 20.668 85 + EEG FT8 95.745 18.052 85 + EEG FT10 119.68 18.393 85 + EEG T9 -120.03 0 85 + EEG T7 -95.973 0 85 + EEG C5 -71.982 0 85 + EEG C3 -48.004 0 85 + EEG C1 -23.974 0 85 + EEG Cz 0 90 85 + EEG C2 24.027 0 85 + EEG C4 48 0 85 + EEG C6 71.982 0 85 + EEG T8 95.973 0 85 + EEG T10 120.03 0 85 + EEG TP9 -119.68 18.393 85 + EEG TP7 -95.745 18.052 85 + EEG CP5 -73.482 20.668 85 + EEG CP3 -51.88 27.575 85 + EEG CP1 -32.613 45.075 85 + EEG CPz 22.792 -90 85 + EEG CP2 32.613 -45.075 85 + EEG CP4 51.88 -27.575 85 + EEG CP6 73.482 -20.668 85 + EEG TP8 95.743 -18.107 85 + EEG TP10 119.68 -18.393 85 + EEG P9 -118.84 36.687 85 + EEG P7 -95.055 36.087 85 + EEG P5 -77.687 40.595 85 + EEG P3 -62.027 50.053 85 + EEG P1 -50.225 66.507 85 + EEG Pz 45.608 -90 85 + EEG P2 50.181 -66.507 85 + EEG P4 62.01 -50.103 85 + EEG P6 77.631 -40.595 85 + EEG P8 95.052 -36.133 85 + EEG P10 118.84 -36.687 85 + EEG PO9 -117.54 54.695 85 + EEG PO7 -94.02 54.108 85 + EEG PO5 -83.969 59.461 85 + EEG PO3 -75.803 67.539 85 + EEG PO1 -70.343 77.973 85 + EEG POz 68.39 -90 85 + EEG PO2 70.358 -78.046 85 + EEG PO4 75.803 -67.539 85 + EEG PO6 83.969 -59.461 85 + EEG PO8 94.016 -54.142 85 + EEG PO10 117.52 -54.733 85 + EEG O1 -92.698 72.074 85 + EEG Oz 91.204 -90 85 + EEG O2 92.698 -72.074 85 + EEG I1 -115.86 72.532 85 + EEG O9 -115.86 72.532 85 + EEG Iz 114.03 -90 85 + EEG I2 115.86 -72.532 85 + EEG O10 115.86 -72.532 85 + EEG AFp9h -105.02 -63.355 85 + EEG AFp7h -90.401 -65.641 85 + EEG AFp5h -85.465 -71.565 85 + EEG AFp3h -81.886 -78.451 85 + EEG AFp1h -80.031 -86.097 85 + EEG AFp2h 80.032 86.039 85 + EEG AFp4h 81.886 78.451 85 + EEG AFp6h 85.465 71.565 85 + EEG AFp8h 90.401 65.589 85 + EEG AFp10h 105.03 63.329 85 + EEG AFF9h -106.39 -45.423 85 + EEG AFF7h -87.419 -47.151 85 + EEG AFF5h -74.258 -54.227 85 + EEG AFF3h -63.752 -65.551 85 + EEG AFF1h -57.79 -81.161 85 + EEG AFF2h 57.785 81.228 85 + EEG AFF4h 63.804 65.551 85 + EEG AFF6h 74.267 54.178 85 + EEG AFF8h 87.418 47.193 85 + EEG AFF10h 106.4 45.381 85 + EEG FFT9h -107.42 -27.291 85 + EEG FFT7h -85.294 -28.418 85 + EEG FFC5h -65.525 -34.337 85 + EEG FFC3h -47.97 -47.02 85 + EEG FFC1h -35.992 -72.367 85 + EEG FFC2h 35.992 72.367 85 + EEG FFC4h 47.944 47.077 85 + EEG FFC6h 65.577 34.337 85 + EEG FFT8h 85.294 28.418 85 + EEG FFT10h 107.4 27.263 85 + EEG FTT9h -107.94 -9.1355 85 + EEG FTT7h -84.139 -9.5002 85 + EEG FCC5h -60.628 -11.865 85 + EEG FCC3h -37.497 -18.197 85 + EEG FCC1h -16.49 -44 85 + EEG FCC2h 16.513 43.86 85 + EEG FCC4h 37.497 18.197 85 + EEG FCC6h 60.655 11.851 85 + EEG FTT8h 84.145 9.4907 85 + EEG FTT10h 107.94 9.1355 85 + EEG TTP9h -107.94 9.1355 85 + EEG TTP7h -84.139 9.5002 85 + EEG CCP5h -60.628 11.865 85 + EEG CCP3h -37.497 18.197 85 + EEG CCP1h -16.49 44 85 + EEG CCP2h 16.513 -43.86 85 + EEG CCP4h 37.497 -18.197 85 + EEG CCP6h 60.655 -11.851 85 + EEG TTP8h 84.145 -9.4907 85 + EEG TTP10h 107.94 -9.1355 85 + EEG TPP9h -107.42 27.291 85 + EEG TPP7h -85.294 28.418 85 + EEG CPP5h -65.525 34.337 85 + EEG CPP3h -47.97 47.02 85 + EEG CPP1h -35.992 72.367 85 + EEG CPP2h 35.992 -72.367 85 + EEG CPP4h 47.944 -47.077 85 + EEG CPP6h 65.577 -34.337 85 + EEG TPP8h 85.294 -28.418 85 + EEG TPP10h 107.4 -27.263 85 + EEG PPO9h -106.39 45.423 85 + EEG PPO7h -87.419 47.151 85 + EEG PPO5h -74.258 54.227 85 + EEG PPO3h -63.752 65.551 85 + EEG PPO1h -57.79 81.161 85 + EEG PPO2h 57.785 -81.228 85 + EEG PPO4h 63.804 -65.551 85 + EEG PPO6h 74.267 -54.178 85 + EEG PPO8h 87.418 -47.193 85 + EEG PPO10h 106.4 -45.381 85 + EEG POO9h -105.02 63.355 85 + EEG POO7h -90.401 65.641 85 + EEG POO5h -85.465 71.565 85 + EEG POO3h -81.886 78.451 85 + EEG POO1h -80.031 86.097 85 + EEG POO2h 80.032 -86.039 85 + EEG POO4h 81.886 -78.451 85 + EEG POO6h 85.465 -71.565 85 + EEG POO8h 90.401 -65.589 85 + EEG POO10h 105.03 -63.329 85 + EEG OI1h -103.42 81.128 85 + EEG OI2h 103.43 -81.119 85 + EEG Fp1h -91.951 -81.066 85 + EEG Fp2h 91.951 81.009 85 + EEG AF9h -105.74 -54.393 85 + EEG AF7h -88.796 -56.469 85 + EEG AF5h -79.619 -63.2 85 + EEG AF3h -72.656 -72.496 85 + EEG AF1h -68.886 -83.904 85 + EEG AF2h 68.939 83.904 85 + EEG AF4h 72.651 72.553 85 + EEG AF6h 79.619 63.2 85 + EEG AF8h 88.853 56.517 85 + EEG AF10h 105.74 54.393 85 + EEG F9h -106.98 -36.367 85 + EEG F7h -86.213 -37.789 85 + EEG F5h -69.502 -44.567 85 + EEG F3h -55.454 -57.294 85 + EEG F1h -46.82 -77.642 85 + EEG F2h 46.82 77.642 85 + EEG F4h 55.454 57.294 85 + EEG F6h 69.502 44.567 85 + EEG F8h 86.213 37.789 85 + EEG F10h 106.93 36.367 85 + EEG FT9h -107.72 -18.187 85 + EEG FT7h -84.603 -18.945 85 + EEG FC5h -62.534 -23.385 85 + EEG FC3h -41.758 -34.216 85 + EEG FC1h -25.615 -63.198 85 + EEG FC2h 25.592 63.316 85 + EEG FC4h 41.758 34.216 85 + EEG FC6h 62.534 23.385 85 + EEG FT8h 84.547 18.999 85 + EEG FT10h 107.72 18.187 85 + EEG T9h -108.02 0 85 + EEG T7h -83.97 0 85 + EEG C5h -59.971 0 85 + EEG C3h -35.998 0 85 + EEG C1h -12.007 0 85 + EEG C2h 12.007 0 85 + EEG C4h 35.964 0 85 + EEG C6h 59.971 0 85 + EEG T8h 83.97 0 85 + EEG T10h 108.02 0 85 + EEG TP9h -107.72 18.187 85 + EEG TP7h -84.603 18.945 85 + EEG CP5h -62.534 23.385 85 + EEG CP3h -41.758 34.216 85 + EEG CP1h -25.615 63.198 85 + EEG CP2h 25.592 -63.316 85 + EEG CP4h 41.758 -34.216 85 + EEG CP6h 62.534 -23.385 85 + EEG TP8h 84.604 -18.999 85 + EEG TP10h 107.72 -18.187 85 + EEG P9h -106.98 36.367 85 + EEG P7h -86.213 37.789 85 + EEG P5h -69.502 44.567 85 + EEG P3h -55.454 57.294 85 + EEG P1h -46.82 77.642 85 + EEG P2h 46.82 -77.642 85 + EEG P4h 55.454 -57.294 85 + EEG P6h 69.502 -44.567 85 + EEG P8h 86.213 -37.789 85 + EEG P10h 106.93 -36.367 85 + EEG PO9h -105.74 54.393 85 + EEG PO7h -88.796 56.469 85 + EEG PO5h -79.619 63.2 85 + EEG PO3h -72.656 72.496 85 + EEG PO1h -68.886 83.904 85 + EEG PO2h 68.939 -83.904 85 + EEG PO4h 72.651 -72.553 85 + EEG PO6h 79.619 -63.2 85 + EEG PO8h 88.853 -56.517 85 + EEG PO10h 105.74 -54.393 85 + EEG O1h -91.951 81.066 85 + EEG O2h 91.951 -81.009 85 + EEG I1h -114.91 81.307 85 + EEG I2h 114.91 -81.307 85 + EEG AFp9 -116.7 -63.665 85 + EEG AFp7 -93.384 -63.127 85 + EEG AFp5 -87.764 -68.444 85 + EEG AFp3 -83.447 -74.871 85 + EEG AFp1 -80.728 -82.19 85 + EEG AFpz 79.793 90 85 + EEG AFp2 80.728 82.19 85 + EEG AFp4 83.502 74.927 85 + EEG AFp6 87.764 68.444 85 + EEG AFp8 93.384 63.127 85 + EEG AFp10 116.7 63.665 85 + EEG AFF9 -118.25 -45.782 85 + EEG AFF7 -94.591 -45.122 85 + EEG AFF5 -80.608 -50.187 85 + EEG AFF3 -68.622 -59.353 85 + EEG AFF1 -60.101 -72.946 85 + EEG AFFz 57.01 90 85 + EEG AFF2 60.101 72.946 85 + EEG AFF4 68.579 59.3 85 + EEG AFF6 80.608 50.187 85 + EEG AFF8 94.591 45.122 85 + EEG AFF10 118.25 45.782 85 + EEG FFT9 -119.34 -27.535 85 + EEG FFT7 -95.458 -27.106 85 + EEG FFC5 -75.279 -30.73 85 + EEG FFC3 -56.333 -39.585 85 + EEG FFC1 -40.896 -57.744 85 + EEG FFCz 34.231 90 85 + EEG FFC2 40.859 57.744 85 + EEG FFC4 56.333 39.585 85 + EEG FFC6 75.266 30.76 85 + EEG FFT8 95.453 27.08 85 + EEG FFT10 119.36 27.565 85 + EEG FTT9 -119.94 -9.234 85 + EEG FTT7 -95.914 -9.0265 85 + EEG FCC5 -72.356 -10.402 85 + EEG FCC3 -49.021 -14.202 85 + EEG FCC1 -26.414 -25.873 85 + EEG FCCz 11.377 90 85 + EEG FCC2 26.389 25.873 85 + EEG FCC4 48.978 14.202 85 + EEG FCC6 72.356 10.402 85 + EEG FTT8 95.92 9.0356 85 + EEG FTT10 119.89 9.234 85 + EEG TTP9 -119.94 9.234 85 + EEG TTP7 -95.914 9.0265 85 + EEG CCP5 -72.356 10.402 85 + EEG CCP3 -49.021 14.202 85 + EEG CCP1 -26.414 25.873 85 + EEG CCPz 11.377 -90 85 + EEG CCP2 26.389 -25.873 85 + EEG CCP4 48.978 -14.202 85 + EEG CCP6 72.356 -10.402 85 + EEG TTP8 95.92 -9.0356 85 + EEG TTP10 119.89 -9.234 85 + EEG TPP9 -119.34 27.535 85 + EEG TPP7 -95.458 27.106 85 + EEG CPP5 -75.279 30.73 85 + EEG CPP3 -56.333 39.585 85 + EEG CPP1 -40.896 57.744 85 + EEG CPPz 34.231 -90 85 + EEG CPP2 40.859 -57.744 85 + EEG CPP4 56.333 -39.585 85 + EEG CPP6 75.266 -30.76 85 + EEG TPP8 95.453 -27.08 85 + EEG TPP10 119.36 -27.565 85 + EEG PPO9 -118.25 45.782 85 + EEG PPO7 -94.591 45.122 85 + EEG PPO5 -80.608 50.187 85 + EEG PPO3 -68.622 59.353 85 + EEG PPO1 -60.109 72.883 85 + EEG PPOz 57.01 -90 85 + EEG PPO2 60.101 -72.946 85 + EEG PPO4 68.579 -59.3 85 + EEG PPO6 80.608 -50.187 85 + EEG PPO8 94.591 -45.122 85 + EEG PPO10 118.25 -45.782 85 + EEG POO9 -116.7 63.665 85 + EEG POO7 -93.384 63.127 85 + EEG POO5 -87.764 68.444 85 + EEG POO3 -83.447 74.871 85 + EEG POO1 -80.728 82.19 85 + EEG POOz 79.793 -90 85 + EEG POO2 80.728 -82.19 85 + EEG POO4 83.502 -74.927 85 + EEG POO6 87.764 -68.444 85 + EEG POO8 93.384 -63.127 85 + EEG POO10 116.7 -63.665 85 + EEG OI1 -104.24 72.276 85 + EEG OIz 102.6 -90 85 + EEG OI2 104.26 -72.258 85 + EEG T3 -95.973 0 85 + EEG T5 -95.055 36.087 85 + EEG T4 95.973 0 85 + EEG T6 95.052 -36.133 85 + EEG M1 -134.52 10.419 85 + EEG M2 134.52 -10.419 85 + EEG A1 -135 0 85 + EEG A2 135 0 85 + EOG VEOG 125 63 85 + EOG HEOG -118 -48 85 + EOG EOG1 125 63 85 + EOG EOG2 -118 -48 85 + EOG LO1 -118 -48 85 + EOG LO2 118 48 85 + EOG IO1 -125 -63 85 + EOG IO2 125 63 85 + EOG SO1 -105 -65 85 + EOG SO2 105 65 85 diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard_BESA.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard_BESA.mat new file mode 100644 index 0000000..34a1bec Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard_BESA.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard_SCCN.mat b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard_SCCN.mat new file mode 100644 index 0000000..472c887 Binary files /dev/null and b/code/eeglab13_4_4b/plugins/dipfit2.3/standard_BESA/standard_SCCN.mat differ diff --git a/code/eeglab13_4_4b/plugins/dipfit2.3/traditionaldipfit.m b/code/eeglab13_4_4b/plugins/dipfit2.3/traditionaldipfit.m new file mode 100644 index 0000000..120e700 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/dipfit2.3/traditionaldipfit.m @@ -0,0 +1,90 @@ +function [H] = traditionaldipfit(f); + +% TRADITIONALDIPFIT creates the homogenous spatial transformation matrix +% for a 9 parameter traditionaldipfit "Talairach-model" transformation +% +% H = traditionaldipfit(f) +% +% The transformation vector f should contain the +% x-shift +% y-shift +% z-shift +% (in length-units of the coordinate system used. For the MNI brain +% the unit is mm) +% followed by the +% pitch (rotation around x-axis) +% roll (rotation around y-axis) +% yaw (rotation around z-axis) +% (in radians) +% followed by the +% x-rescaling factor +% y-rescaling factor +% z-rescaling factor +% (in ratio = newscale/oldscale) +% +% H first applies scaling, then rotations, and finally the shifts. +% +% See also fieldtrip*/WARP3D.m + +% Copyright (C) 2000-2004, Robert Oostenveld +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% compute the homogenous transformation matrix for the translation +if length(f) == 6, f(7:9) = 1; end; + +T = eye(4,4); +if isa( f, 'sym') + T = sym(T); +end; +T(1,4) = f(1); +T(2,4) = f(2); +T(3,4) = f(3); + +% precompute the sin/cos values of the angles +cX = cos(f(4)); +cY = cos(f(5)); +cZ = cos(f(6)); +sX = sin(f(4)); +sY = sin(f(5)); +sZ = sin(f(6)); + +% compute the homogenous transformation matrix for the rotation +R = eye(4,4); +if isa( f, 'sym') + R = sym(R); +end; +R(1,1) = cZ*cY + sZ*sX*sY; +R(1,2) = sZ*cY + cZ*sX*sY; +R(1,3) = cX*sY; +R(2,1) = -sZ*cX; +R(2,2) = cZ*cX; +R(2,3) = sX; +R(3,1) = sZ*sX*cY - cZ*sY; +R(3,2) = -cZ*sX*cY - sZ*sY; +R(3,3) = cX*cY; + +% compute the homogenous transformation matrix for the scaling +S = eye(4,4); +if isa( f, 'sym') + S = sym(S); +end; +S(1,1) = f(7); +S(2,2) = f(8); +S(3,3) = f(9); + +% compute the homogenous coordinate transformation matrix for use by WARP3D +H = T*R*S; + diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/changelog.txt b/code/eeglab13_4_4b/plugins/firfilt1.6.1/changelog.txt new file mode 100644 index 0000000..e591503 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/changelog.txt @@ -0,0 +1,57 @@ +Version 1.6 +- ENH: minimum-phase conversion and causal filtering + +Version 1.5.5 +- CHG: menu + +Version 1.5.4 +- CHG: menu order + +Version 1.5.3 +- CHG: new TBW heuristic for pop_eegfiltnew.m + +Version 1.5.2 +- CHG: warning message + +Version 1.5.1 +- CHG: removed dependency on EEGLAB fastif function +- CHG: removed pop_xfirws dependency on EEGLAB for command line use +- BUG: plotting of frequency response with empty window parameters +- BUG: error in firws documentation +- ENH: improved pop_xfirws command line usability + +Version 1.5 +- BUG: pop_firpm compatibility with R14 and earlier. +- CHG: command line progress indicator. + +Version 1.4 +- BUG: duplicate boundary event handling. +- CHG: waitbar replaced by command line progress indicator. + +Version 1.3 +- NEW: pop_eegfiltnew. +- BUG: ETA calculation. + +Version 1.2 +- CHG: filter with double precision. + +Version 1.1 +- NEW: added pop_xfirws to design and export EEProbe compatible filters. +- BUG: compatibility with R14 and earlier. +- NEW: Tukey windows. + +Version 1.0 +- CHG: removed misleading default value for filter order. +- CHG: moved to EEGLAB filter menu. +- CHG: code cleaning and formatting. + +Version 0.92 +- ENH: optimized filter strategy. +- ENH: waitbar. +- CHG: avoid eval function. + +Version 0.91 +- BUG: check for empty boundaries vector. + +Version 0.9 +starting, initial public release. diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/eegplugin_firfilt.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/eegplugin_firfilt.m new file mode 100644 index 0000000..164b7a6 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/eegplugin_firfilt.m @@ -0,0 +1,64 @@ +% eegplugin_firfilt() - EEGLAB plugin for filtering data using linear- +% phase FIR filters +% +% Usage: +% >> eegplugin_firfilt(fig, trystrs, catchstrs); +% +% Inputs: +% fig - [integer] EEGLAB figure +% trystrs - [struct] "try" strings for menu callbacks. +% catchstrs - [struct] "catch" strings for menu callbacks. +% +% Author: Andreas Widmann, University of Leipzig, Germany, 2005 + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function vers = eegplugin_firfilt(fig, trystrs, catchstrs) + + vers = 'firfilt1.6.1'; + if nargin < 3 + error('eegplugin_firfilt requires 3 arguments'); + end + + % add folder to path + % ----------------------- + if ~exist('pop_firws') + p = which('eegplugin_firfilt'); + p = p(1:findstr(p,'eegplugin_firfilt.m')-1); + addpath([p vers]); + end + + % find import data menu + % --------------------- + menu = findobj(fig, 'tag', 'filter'); + + % menu callbacks + % -------------- + comfirfiltnew = [trystrs.no_check '[EEG LASTCOM] = pop_eegfiltnew(EEG);' catchstrs.new_and_hist]; + comfirws = [trystrs.no_check '[EEG LASTCOM] = pop_firws(EEG);' catchstrs.new_and_hist]; + comfirpm = [trystrs.no_check '[EEG LASTCOM] = pop_firpm(EEG);' catchstrs.new_and_hist]; + comfirma = [trystrs.no_check '[EEG LASTCOM] = pop_firma(EEG);' catchstrs.new_and_hist]; + + % create menus if necessary + % ------------------------- + uimenu( menu, 'Label', 'Basic FIR filter (new, default)', 'CallBack', comfirfiltnew, 'Separator', 'on', 'position', 1); + uimenu( menu, 'Label', 'Windowed sinc FIR filter', 'CallBack', comfirws, 'position', 2); + uimenu( menu, 'Label', 'Parks-McClellan (equiripple) FIR filter', 'CallBack', comfirpm, 'position', 3); + uimenu( menu, 'Label', 'Moving average FIR filter', 'CallBack', comfirma, 'position', 4); + \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/findboundaries.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/findboundaries.m new file mode 100644 index 0000000..8433558 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/findboundaries.m @@ -0,0 +1,58 @@ +% findboundaries() - Find boundaries (data discontinuities) in event +% structure of continuous EEG dataset +% +% Usage: +% >> boundaries = findboundaries(EEG.event); +% +% Inputs: +% EEG.event - EEGLAB EEG event structure +% +% Outputs: +% boundaries - scalar or vector of boundary event latencies +% +% Author: Andreas Widmann, University of Leipzig, 2005 + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function boundaries = findboundaries(event) + +if isfield(event, 'type') & isfield(event, 'latency') & cellfun('isclass', {event.type}, 'char') + + % Boundary event indices + boundaries = strmatch('boundary', {event.type}); + + % Boundary event latencies + boundaries = [event(boundaries).latency]; + + % Shift boundary events to epoch onset + boundaries = fix(boundaries + 0.5); + + % Remove duplicate boundary events + boundaries = unique(boundaries); + + % Epoch onset at first sample? + if isempty(boundaries) || boundaries(1) ~= 1 + boundaries = [1 boundaries]; + end + +else + + boundaries = 1; + +end diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfilt.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfilt.m new file mode 100644 index 0000000..c28efc6 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfilt.m @@ -0,0 +1,123 @@ +% firfilt() - Pad data with DC constant, filter data with FIR filter, +% and shift data by the filter's group delay +% +% Usage: +% >> EEG = firfilt(EEG, b, nFrames); +% +% Inputs: +% EEG - EEGLAB EEG structure +% b - vector of filter coefficients +% +% Optional inputs: +% nFrames - number of frames to filter per block {default 1000} +% +% Outputs: +% EEG - EEGLAB EEG structure +% +% Note: +% Higher values for nFrames increase speed and working memory +% requirements. +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% filter, findboundaries + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = firfilt(EEG, b, nFrames) + +if nargin < 2 + error('Not enough input arguments.'); +end +if nargin < 3 || isempty(nFrames) + nFrames = 1000; +end + +% Filter's group delay +if mod(length(b), 2) ~= 1 + error('Filter order is not even.'); +end +groupDelay = (length(b) - 1) / 2; + +% Find data discontinuities and reshape epoched data +if EEG.trials > 1 % Epoched data + EEG.data = reshape(EEG.data, [EEG.nbchan EEG.pnts * EEG.trials]); + dcArray = 1 : EEG.pnts : EEG.pnts * (EEG.trials + 1); +else % Continuous data + dcArray = [findboundaries(EEG.event) EEG.pnts + 1]; +end + +% Initialize progress indicator +nSteps = 20; +step = 0; +fprintf(1, 'firfilt(): |'); +strLength = fprintf(1, [repmat(' ', 1, nSteps - step) '| 0%%']); +tic + +for iDc = 1:(length(dcArray) - 1) + + % Pad beginning of data with DC constant and get initial conditions + ziDataDur = min(groupDelay, dcArray(iDc + 1) - dcArray(iDc)); + [temp, zi] = filter(b, 1, double([EEG.data(:, ones(1, groupDelay) * dcArray(iDc)) ... + EEG.data(:, dcArray(iDc):(dcArray(iDc) + ziDataDur - 1))]), [], 2); + + blockArray = [(dcArray(iDc) + groupDelay):nFrames:(dcArray(iDc + 1) - 1) dcArray(iDc + 1)]; + for iBlock = 1:(length(blockArray) - 1) + + % Filter the data + [EEG.data(:, (blockArray(iBlock) - groupDelay):(blockArray(iBlock + 1) - groupDelay - 1)), zi] = ... + filter(b, 1, double(EEG.data(:, blockArray(iBlock):(blockArray(iBlock + 1) - 1))), zi, 2); + + % Update progress indicator + [step, strLength] = mywaitbar((blockArray(iBlock + 1) - groupDelay - 1), size(EEG.data, 2), step, nSteps, strLength); + end + + % Pad end of data with DC constant + temp = filter(b, 1, double(EEG.data(:, ones(1, groupDelay) * (dcArray(iDc + 1) - 1))), zi, 2); + EEG.data(:, (dcArray(iDc + 1) - ziDataDur):(dcArray(iDc + 1) - 1)) = ... + temp(:, (end - ziDataDur + 1):end); + + % Update progress indicator + [step, strLength] = mywaitbar((dcArray(iDc + 1) - 1), size(EEG.data, 2), step, nSteps, strLength); + +end + +% Reshape epoched data +if EEG.trials > 1 + EEG.data = reshape(EEG.data, [EEG.nbchan EEG.pnts EEG.trials]); +end + +% Deinitialize progress indicator +fprintf(1, '\n') + +end + +function [step, strLength] = mywaitbar(compl, total, step, nSteps, strLength) + +progStrArray = '/-\|'; +tmp = floor(compl / total * nSteps); +if tmp > step + fprintf(1, [repmat('\b', 1, strLength) '%s'], repmat('=', 1, tmp - step)) + step = tmp; + ete = ceil(toc / step * (nSteps - step)); + strLength = fprintf(1, [repmat(' ', 1, nSteps - step) '%s %3d%%, ETE %02d:%02d'], progStrArray(mod(step - 1, 4) + 1), floor(step * 100 / nSteps), floor(ete / 60), mod(ete, 60)); +end + +end diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfiltdcpadded.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfiltdcpadded.m new file mode 100644 index 0000000..4b37c62 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfiltdcpadded.m @@ -0,0 +1,75 @@ +% firfiltdcpadded() - Pad data with DC constant and filter +% +% Usage: +% >> data = firfiltdcpadded(data, b, causal); +% +% Inputs: +% data - raw data +% b - vector of filter coefficients +% causal - boolean perform causal filtering {default 0} +% +% Outputs: +% data - smoothed data +% +% Note: +% firfiltdcpadded always operates (pads, filters) along first dimension. +% Not memory optimized. +% +% Author: Andreas Widmann, University of Leipzig, 2013 +% +% See also: +% firfiltsplit + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2013 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [ data ] = firfiltdcpadded(b, data, causal) + +% Defaults +if nargin < 3 || isempty(causal) + causal = 0; +end + +% Check arguments +if nargin < 2 + error('Not enough input arguments.'); +end + +% Filter's group delay +if mod(length(b), 2) ~= 1 + error('Filter order is not even.'); +end +groupDelay = (length(b) - 1) / 2; +b = double(b); % Filter with double precision + +% Pad data with DC constant +if causal + startPad = repmat(data(1, :), [2 * groupDelay 1]); + endPad = []; +else + startPad = repmat(data(1, :), [groupDelay 1]); + endPad = repmat(data(end, :), [groupDelay 1]); +end + +% Filter data +data = filter(b, 1, double([startPad; data; endPad])); % Pad and filter with double precision + +% Remove padded data +data = data(2 * groupDelay + 1:end, :); + +end diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfiltsplit.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfiltsplit.m new file mode 100644 index 0000000..5585796 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firfiltsplit.m @@ -0,0 +1,73 @@ +% firfiltsplit() - Split data at discontinuities and forward to dc padded +% filter function +% +% Usage: +% >> EEG = firfiltsplit(EEG, b); +% +% Inputs: +% EEG - EEGLAB EEG structure +% b - vector of filter coefficients +% causal - scalar boolean perform causal filtering {default 0} +% +% Outputs: +% EEG - EEGLAB EEG structure +% +% Note: +% This function is (in combination with firfiltdcpadded) just a +% non-memory optimized version of the firfilt function allowing causal +% filtering. Will possibly replace firfilt in the future. +% +% Author: Andreas Widmann, University of Leipzig, 2013 +% +% See also: +% firfiltdcpadded, findboundaries + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2013 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function EEG = firfiltsplit(EEG, b, causal) + +if nargin < 3 || isempty(causal) + causal = 0; +end +if nargin < 2 + error('Not enough input arguments.'); +end + +% Find data discontinuities and reshape epoched data +if EEG.trials > 1 % Epoched data + EEG.data = reshape(EEG.data, [EEG.nbchan EEG.pnts * EEG.trials]); + dcArray = 1 : EEG.pnts : EEG.pnts * (EEG.trials + 1); +else % Continuous data + dcArray = [findboundaries(EEG.event) EEG.pnts + 1]; +end + +% Loop over continuous segments +for iDc = 1:(length(dcArray) - 1) + + % Filter segment + EEG.data(:, dcArray(iDc):dcArray(iDc + 1) - 1) = firfiltdcpadded(b, EEG.data(:, dcArray(iDc):dcArray(iDc + 1) - 1)', causal)'; + +end + +% Reshape epoched data +if EEG.trials > 1 + EEG.data = reshape(EEG.data, [EEG.nbchan EEG.pnts EEG.trials]); +end + +end diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/firws.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firws.m new file mode 100644 index 0000000..cbe423e --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/firws.m @@ -0,0 +1,106 @@ +%firws() - Designs windowed sinc type I linear phase FIR filter +% +% Usage: +% >> b = firws(m, f); +% >> b = firws(m, f, w); +% >> b = firws(m, f, t); +% >> b = firws(m, f, t, w); +% +% Inputs: +% m - filter order (mandatory even) +% f - vector or scalar of cutoff frequency/ies (-6 dB; +% pi rad / sample) +% +% Optional inputs: +% w - vector of length m + 1 defining window {default blackman} +% t - 'high' for highpass, 'stop' for bandstop filter {default low-/ +% bandpass} +% +% Output: +% b - filter coefficients +% +% Example: +% fs = 500; cutoff = 0.5; tbw = 1; +% m = pop_firwsord('hamming', fs, tbw); +% b = firws(m, cutoff / (fs / 2), 'high', windows('hamming', m + 1)); +% +% References: +% Smith, S. W. (1999). The scientist and engineer's guide to digital +% signal processing (2nd ed.). San Diego, CA: California Technical +% Publishing. +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% pop_firws, pop_firwsord, pop_kaiserbeta, windows + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [b a] = firws(m, f, t, w) + + a = 1; + + if nargin < 2 + error('Not enough input arguments'); + end + if length(m) > 1 || ~isnumeric(m) || ~isreal(m) || mod(m, 2) ~= 0 || m < 2 + error('Filter order must be a real, even, positive integer.'); + end + f = f / 2; + if any(f <= 0) || any(f >= 0.5) + error('Frequencies must fall in range between 0 and 1.'); + end + if nargin < 3 || isempty(t) + t = ''; + end + if nargin < 4 || isempty(w) + if ~isempty(t) && ~ischar(t) + w = t; + t = ''; + else + w = windows('blackman', (m + 1)); + end + end + w = w(:)'; % Make window row vector + + b = fkernel(m, f(1), w); + + if length(f) == 1 && strcmpi(t, 'high') + b = fspecinv(b); + end + + if length(f) == 2 + b = b + fspecinv(fkernel(m, f(2), w)); + if isempty(t) || ~strcmpi(t, 'stop') + b = fspecinv(b); + end + end + +% Compute filter kernel +function b = fkernel(m, f, w) + m = -m / 2 : m / 2; + b(m == 0) = 2 * pi * f; % No division by zero + b(m ~= 0) = sin(2 * pi * f * m(m ~= 0)) ./ m(m ~= 0); % Sinc + b = b .* w; % Window + b = b / sum(b); % Normalization to unity gain at DC + +% Spectral inversion +function b = fspecinv(b) + b = -b; + b(1, (length(b) - 1) / 2 + 1) = b(1, (length(b) - 1) / 2 + 1) + 1; diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/minphaserceps.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/minphaserceps.m new file mode 100644 index 0000000..9180f2d --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/minphaserceps.m @@ -0,0 +1,46 @@ +% rcepsminphase() - Convert FIR filter coefficient to minimum phase +% +% Usage: +% >> b = minphaserceps(b); +% +% Inputs: +% b - FIR filter coefficients +% +% Outputs: +% bMinPhase - minimum phase FIR filter coefficients +% +% Author: Andreas Widmann, University of Leipzig, 2013 +% +% References: +% [1] Smith III, O. J. (2007). Introduction to Digital Filters with Audio +% Applications. W3K Publishing. Retrieved Nov 11 2013, from +% https://ccrma.stanford.edu/~jos/fp/Matlab_listing_mps_m.html +% [2] Vetter, K. (2013, Nov 11). Long FIR filters with low latency. +% Retrieved Nov 11 2013, from +% http://www.katjaas.nl/minimumphase/minimumphase.html + +function [bMinPhase] = minphaserceps(b) + +% Line vector +b = b(:)'; + +n = length(b); +upsamplingFactor = 1e3; % Impulse response upsampling/zero padding to reduce time-aliasing +nFFT = 2^ceil(log2(n * upsamplingFactor)); % Power of 2 +clipThresh = 1e-8; % -160 dB + +% Spectrum +s = abs(fft(b, nFFT)); +s(s < clipThresh) = clipThresh; % Clip spectrum to reduce time-aliasing + +% Real cepstrum +c = real(ifft(log(s))); + +% Fold +c = [c(1) [c(2:nFFT / 2) 0] + conj(c(nFFT:-1:nFFT / 2 + 1)) zeros(1, nFFT / 2 - 1)]; + +% Minimum phase +bMinPhase = real(ifft(exp(fft(c)))); + +% Remove zero-padding +bMinPhase = bMinPhase(1:n); diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/plotfresp.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/plotfresp.m new file mode 100644 index 0000000..4a611d5 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/plotfresp.m @@ -0,0 +1,137 @@ +% plotfresp() - Plot FIR filter's impulse, step, frequency, magnitude, +% and phase response +% +% Usage: +% >> plotfresp(b, a, n, fs); +% +% Inputs: +% b - vector filter coefficients +% +% Optional inputs: +% a - currently unused, reserved for future compatibility with IIR +% filters {default 1} +% n - scalar number of points +% fs - scalar sampling frequency +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% pop_firws, pop_firpm, pop_firma + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function plotfresp(b, a, nfft, fs, causal) + +if nargin < 5 || isempty(causal) + causal = 0; +end +if nargin < 4 || isempty(fs) + fs = 1; +end +if nargin < 3 || isempty(nfft) + nfft = 2^fix(log2(length(b))); + if nfft < 512 + nfft = 512; + end +end +if nargin < 1 + error('Not enough input arguments.'); +end + +n = length(b); +f = (0:1 / nfft:1) * fs / 2; + +% Impulse resonse +if causal, xval = 0:n-1; else xval = -(n - 1) / 2:(n - 1) / 2; end +ax(1) = subplot(2, 3, 1); +stem(xval, b, 'fill') +title('Impulse response'); +ylabel('Amplitude'); + +% Step response +ax(4) = subplot(2, 3, 4); +stem(xval, cumsum(b), 'fill'); +title('Step response'); +foo = ylim; +if foo(2) < -foo(1) + 1; + foo(2) = -foo(1) + 1; + ylim(foo); +end +xMin = []; xMax = []; +children = get(ax(4), 'Children'); +for child =1:length(children) + xData = get(children(child), 'XData'); + xMin = min([xMin min(xData)]); + xMax = max([xMax max(xData)]); +end +set(ax([1 4]), 'xlim', [xMin xMax]); +ylabel('Amplitude'); + +% Frequency response +ax(2) = subplot(2, 3, 2); +m = fix((length(b) - 1) / 2); % Filter order +z = fft(b, nfft * 2); +z = z(1:fix(length(z) / 2) + 1); +% foo = real(abs(z) .* exp(-i * (angle(z) + [0:1 / nfft:1] * m * pi))); % needs further testing +plot(f, abs(z)); +title('Frequency response'); +ylabel('Amplitude'); + +% Magnitude response +ax(5) = subplot(2, 3, 5); +db = abs(z); +db(db < eps^(2 / 3)) = eps^(2 / 3); % Log of zero warning +plot(f, 20 * log10(db)); +title('Magnitude response'); +foo = ylim; +if foo(1) < 20 * log10(eps^(2 / 3)) + foo(1) = 20 * log10(eps^(2 / 3)); +end +ylabel('Magnitude (dB)'); +ylim(foo); + +% Phase response +ax(3) = subplot(2, 3, 3); +z(abs(z) < eps^(2 / 3)) = NaN; % Phase is undefined for magnitude zero +phi = angle(z); +if causal + phi = unwrap(phi); +else + delay = -mod((0:1 / nfft:1) * m * pi + pi, 2 * pi) + pi; % Zero-phase + phi = phi - delay; + phi = phi + 2 * pi * (phi <= -pi + eps ^ (1/3)); % Unwrap +end +plot(f, phi); +title('Phase response'); +ylabel('Phase (rad)'); +% ylim([-pi / 2 1.5 * pi]); + +set(ax(1:5), 'ygrid', 'on', 'xgrid', 'on', 'box', 'on'); +titles = get(ax(1:5), 'title'); +set([titles{:}], 'fontweight', 'bold'); +xlabels = get(ax(1:5), 'xlabel'); +if fs == 1 + set([xlabels{[2 3 5]}], 'String', 'Normalized frequency (2 pi rad / sample)'); +else + set([xlabels{[2 3 5]}], 'String', 'Frequency (Hz)'); +end +set([xlabels{[1 4]}], 'String', 'Sample'); +set(ax([2 3 5]), 'xlim', [0 fs / 2]); +set(ax(1:5), 'colororder', circshift(get(ax(1), 'colororder'), -1)); +set(ax(1:5), 'nextplot', 'add'); diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_eegfiltnew.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_eegfiltnew.m new file mode 100644 index 0000000..1841d4b --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_eegfiltnew.m @@ -0,0 +1,234 @@ +% pop_eegfiltnew() - Filter data using Hamming windowed sinc FIR filter +% +% Usage: +% >> [EEG, com, b] = pop_eegfiltnew(EEG); % pop-up window mode +% >> [EEG, com, b] = pop_eegfiltnew(EEG, locutoff, hicutoff, filtorder, +% revfilt, usefft, plotfreqz, minphase); +% +% Inputs: +% EEG - EEGLAB EEG structure +% locutoff - lower edge of the frequency pass band (Hz) +% {[]/0 -> lowpass} +% hicutoff - higher edge of the frequency pass band (Hz) +% {[]/0 -> highpass} +% +% Optional inputs: +% filtorder - filter order (filter length - 1). Mandatory even +% revfilt - [0|1] invert filter (from bandpass to notch filter) +% {default 0 (bandpass)} +% usefft - ignored (backward compatibility only) +% plotfreqz - [0|1] plot filter's frequency and phase response +% {default 0} +% minphase - scalar boolean minimum-phase converted causal filter +% {default false} +% +% Outputs: +% EEG - filtered EEGLAB EEG structure +% com - history string +% b - filter coefficients +% +% Note: +% pop_eegfiltnew is intended as a replacement for the deprecated +% pop_eegfilt function. Required filter order/transition band width is +% estimated with the following heuristic in default mode: transition band +% width is 25% of the lower passband edge, but not lower than 2 Hz, where +% possible (for bandpass, highpass, and bandstop) and distance from +% passband edge to critical frequency (DC, Nyquist) otherwise. Window +% type is hardcoded to Hamming. Migration to windowed sinc FIR filters +% (pop_firws) is recommended. pop_firws allows user defined window type +% and estimation of filter order by user defined transition band width. +% +% Author: Andreas Widmann, University of Leipzig, 2012 +% +% See also: +% firfilt, firws, windows + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2008 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com, b] = pop_eegfiltnew(EEG, locutoff, hicutoff, filtorder, revfilt, usefft, plotfreqz, minphase) + +com = ''; + +if nargin < 1 + help pop_eegfiltnew; + return +end +if isempty(EEG.data) + error('Cannot filter empty dataset.'); +end + +% GUI +if nargin < 2 + + geometry = {[3, 1], [3, 1], [3, 1], 1, 1, 1, 1}; + geomvert = [1 1 1 2 1 1 1]; + + uilist = {{'style', 'text', 'string', 'Lower edge of the frequency pass band (Hz)'} ... + {'style', 'edit', 'string', ''} ... + {'style', 'text', 'string', 'Higher edge of the frequency pass band (Hz)'} ... + {'style', 'edit', 'string', ''} ... + {'style', 'text', 'string', 'FIR Filter order (Mandatory even. Default is automatic*)'} ... + {'style', 'edit', 'string', ''} ... + {'style', 'text', 'string', {'*See help text for a description of the default filter order heuristic.', 'Manual definition is recommended.'}} ... + {'style', 'checkbox', 'string', 'Notch filter the data instead of pass band', 'value', 0} ... + {'Style', 'checkbox', 'String', 'Use minimum-phase converted causal filter (non-linear!; beta)', 'Value', 0} ... + {'style', 'checkbox', 'string', 'Plot frequency response', 'value', 1}}; + + result = inputgui('geometry', geometry, 'geomvert', geomvert, 'uilist', uilist, 'title', 'Filter the data -- pop_eegfiltnew()', 'helpcom', 'pophelp(''pop_eegfiltnew'')'); + + if isempty(result), return; end + + locutoff = str2num(result{1}); + hicutoff = str2num(result{2}); + filtorder = str2num(result{3}); + revfilt = result{4}; + minphase = result{5}; + plotfreqz = result{6}; + usefft = []; + +else + + if nargin < 3 + hicutoff = []; + end + if nargin < 4 + filtorder = []; + end + if nargin < 5 || isempty(revfilt) + revfilt = 0; + end + if nargin < 6 + usefft = []; + elseif usefft == 1 + error('FFT filtering not supported. Argument is provided for backward compatibility in command line mode only.') + end + if nargin < 7 || isempty(plotfreqz) + plotfreqz = 0; + end + if nargin < 8 || isempty(minphase) + minphase = 0; + end + +end + +% Constants +TRANSWIDTHRATIO = 0.25; +fNyquist = EEG.srate / 2; + +% Check arguments +if locutoff == 0, locutoff = []; end +if hicutoff == 0, hicutoff = []; end +if isempty(hicutoff) % Convert highpass to inverted lowpass + hicutoff = locutoff; + locutoff = []; + revfilt = ~revfilt; +end +edgeArray = sort([locutoff hicutoff]); + +if isempty(edgeArray) + error('Not enough input arguments.'); +end +if any(edgeArray < 0 | edgeArray >= fNyquist) + error('Cutoff frequency out of range'); +end + +if ~isempty(filtorder) && (filtorder < 2 || mod(filtorder, 2) ~= 0) + error('Filter order must be a real, even, positive integer.') +end + +% Max stop-band width +maxTBWArray = edgeArray; % Band-/highpass +if revfilt == 0 % Band-/lowpass + maxTBWArray(end) = fNyquist - edgeArray(end); +elseif length(edgeArray) == 2 % Bandstop + maxTBWArray = diff(edgeArray) / 2; +end +maxDf = min(maxTBWArray); + +% Transition band width and filter order +if isempty(filtorder) + + % Default filter order heuristic + if revfilt == 1 % Highpass and bandstop + df = min([max([maxDf * TRANSWIDTHRATIO 2]) maxDf]); + else % Lowpass and bandpass + df = min([max([edgeArray(1) * TRANSWIDTHRATIO 2]) maxDf]); + end + + filtorder = 3.3 / (df / EEG.srate); % Hamming window + filtorder = ceil(filtorder / 2) * 2; % Filter order must be even. + +else + + df = 3.3 / filtorder * EEG.srate; % Hamming window + filtorderMin = ceil(3.3 ./ ((maxDf * 2) / EEG.srate) / 2) * 2; + filtorderOpt = ceil(3.3 ./ (maxDf / EEG.srate) / 2) * 2; + if filtorder < filtorderMin + error('Filter order too low. Minimum required filter order is %d. For better results a minimum filter order of %d is recommended.', filtorderMin, filtorderOpt) + elseif filtorder < filtorderOpt + warning('firfilt:filterOrderLow', 'Transition band is wider than maximum stop-band width. For better results a minimum filter order of %d is recommended. Reported might deviate from effective -6dB cutoff frequency.', filtorderOpt) + end + +end + +filterTypeArray = {'lowpass', 'bandpass'; 'highpass', 'bandstop (notch)'}; +fprintf('pop_eegfiltnew() - performing %d point %s filtering.\n', filtorder + 1, filterTypeArray{revfilt + 1, length(edgeArray)}) +fprintf('pop_eegfiltnew() - transition band width: %.4g Hz\n', df) +fprintf('pop_eegfiltnew() - passband edge(s): %s Hz\n', mat2str(edgeArray)) + +% Passband edge to cutoff (transition band center; -6 dB) +dfArray = {df, [-df, df]; -df, [df, -df]}; +cutoffArray = edgeArray + dfArray{revfilt + 1, length(edgeArray)} / 2; +fprintf('pop_eegfiltnew() - cutoff frequency(ies) (-6 dB): %s Hz\n', mat2str(cutoffArray)) + +% Window +winArray = windows('hamming', filtorder + 1); + +% Filter coefficients +if revfilt == 1 + filterTypeArray = {'high', 'stop'}; + b = firws(filtorder, cutoffArray / fNyquist, filterTypeArray{length(cutoffArray)}, winArray); +else + b = firws(filtorder, cutoffArray / fNyquist, winArray); +end + +if minphase + disp('pop_eegfiltnew() - converting filter to minimum-phase (non-linear!)'); + b = minphaserceps(b); +end + +% Plot frequency response +if plotfreqz + freqz(b, 1, 8192, EEG.srate); +end + +% Filter +if minphase + disp('pop_eegfiltnew() - filtering the data (causal)'); + EEG = firfiltsplit(EEG, b, 1); +else + disp('pop_eegfiltnew() - filtering the data (zero-phase)'); + EEG = firfilt(EEG, b); +end + + +% History string +com = sprintf('%s = pop_eegfiltnew(%s, %s, %s, %s, %s, %s, %s);', inputname(1), inputname(1), mat2str(locutoff), mat2str(hicutoff), mat2str(filtorder), mat2str(revfilt), mat2str(usefft), mat2str(plotfreqz)); + +end diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firma.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firma.m new file mode 100644 index 0000000..78322e5 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firma.m @@ -0,0 +1,103 @@ +% pop_firma() - Filter data using moving average FIR filter +% +% Usage: +% >> [EEG, com] = pop_firma(EEG); % pop-up window mode +% >> [EEG, com] = pop_firma(EEG, 'forder', order); +% +% Inputs: +% EEG - EEGLAB EEG structure +% 'forder' - scalar filter order. Mandatory even +% +% Outputs: +% EEG - filtered EEGLAB EEG structure +% com - history string +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% firfilt, plotfresp + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com] = pop_firma(EEG, varargin) + + com = ''; + if nargin < 1 + help pop_firma; + return; + end + if isempty(EEG.data) + error('Cannot process empty dataset'); + end + + if nargin < 2 + drawnow; + uigeom = {[1 1 1] [1] [1 1 1]}; + uilist = {{'style' 'text' 'string' 'Filter order (mandatory even):'} ... + {'style' 'edit' 'string' '' 'tag' 'forderedit'} {} ... + {} ... + {} {} {'Style' 'pushbutton' 'string' 'Plot filter responses' 'callback' {@complot, EEG.srate}}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_firma'')', 'Filter the data -- pop_firma()'); + if length(result) == 0, return; end + + if ~isempty(result{1}) + args = [{'forder'} {str2num(result{1})}]; + else + error('Not enough input arguments'); + end + else + args = varargin; + end + + % Convert args to structure + args = struct(args{:}); + + % Filter coefficients + b = ones(1, args.forder + 1) / (args.forder + 1); + + % Filter + disp('pop_firma() - filtering the data'); + EEG = firfilt(EEG, b); + + % History string + com = sprintf('%s = pop_firma(%s', inputname(1), inputname(1)); + for c = fieldnames(args)' + if ischar(args.(c{:})) + com = [com sprintf(', ''%s'', ''%s''', c{:}, args.(c{:}))]; + else + com = [com sprintf(', ''%s'', %s', c{:}, mat2str(args.(c{:})))]; + end + end + com = [com ');']; + +% Callback plot filter properties +function complot(obj, evt, srate) + args.forder = str2num(get(findobj(gcbf, 'tag', 'forderedit'), 'string')); + if isempty(args.forder) + error('Not enough input arguments'); + end + b = ones(1, args.forder + 1) / (args.forder + 1); + H = findobj('tag', 'filter responses', 'type', 'figure'); + if ~isempty(H) + figure(H); + else + H = figure; + set(H, 'color', [.93 .96 1], 'tag', 'filter responses'); + end + plotfresp(b, 1, [], srate); diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firpm.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firpm.m new file mode 100644 index 0000000..4c31f9e --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firpm.m @@ -0,0 +1,202 @@ +% pop_firpm() - Filter data using Parks-McClellan FIR filter +% +% Usage: +% >> [EEG, com, b] = pop_firpm(EEG); % pop-up window mode +% >> [EEG, com, b] = pop_firpm(EEG, 'key1', value1, 'key2', ... +% value2, 'keyn', valuen); +% +% Inputs: +% EEG - EEGLAB EEG structure +% 'fcutoff' - vector or scalar of cutoff frequency/ies (~-6 dB; Hz) +% 'ftrans' - scalar transition band width +% 'ftype' - char array filter type. 'bandpass', 'highpass', +% 'lowpass', or 'bandstop' +% 'forder' - scalar filter order. Mandatory even +% +% Optional inputs: +% 'wtpass' - scalar passband weight +% 'wtstop' - scalar stopband weight +% +% Outputs: +% EEG - filtered EEGLAB EEG structure +% com - history string +% b - filter coefficients +% +% Note: +% Requires the signal processing toolbox. +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% firfilt, pop_firpmord, plotfresp, firpm, firpmord + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com, b] = pop_firpm(EEG, varargin) + + if exist('firpm', 'file') ~= 2 + error('Requires the signal processing toolbox.'); + end + + com = ''; + if nargin < 1 + help pop_firpm; + return; + end + if isempty(EEG.data) + error('Cannot process empty dataset'); + end + + if nargin < 2 + drawnow; + ftypes = {'bandpass' 'highpass' 'lowpass' 'bandstop'}; + uigeom = {[1 0.75 0.75] [1 0.75 0.75] [1 0.75 0.75] 1 [1 0.75 0.75] [1 0.75 0.75] [1 0.75 0.75] 1 [1 0.75 0.75]}; + uilist = {{'Style' 'text' 'String' 'Cutoff frequency(ies) [hp lp] (~-6 dB; Hz):'} ... + {'Style' 'edit' 'String' '' 'Tag' 'fcutoffedit'} {} ... + {'Style' 'text' 'String' 'Transition band width:'} ... + {'Style' 'edit' 'String' '' 'Tag' 'ftransedit'} {} ... + {'Style' 'text' 'String' 'Filter type:'} ... + {'Style' 'popupmenu' 'String' ftypes 'Tag' 'ftypepop'} {} ... + {} ... + {'Style' 'text' 'String' 'Passband weight:'} ... + {'Style' 'edit' 'String' '' 'Tag' 'wtpassedit'} {} ... + {'Style' 'text' 'String' 'Stopband weight:'} ... + {'Style' 'edit' 'String' '' 'Tag' 'wtstopedit'} {} ... + {'Style' 'text' 'String' 'Filter order (mandatory even):'} ... + {'Style' 'edit' 'String' '' 'Tag' 'forderedit'} ... + {'Style' 'pushbutton' 'String' 'Estimate' 'Tag' 'orderpush' 'Callback' {@comcb, ftypes, EEG.srate}} ... + {} ... + {} {} {'Style' 'pushbutton' 'String', 'Plot filter responses' 'Tag' 'plotpush' 'Callback' {@comcb, ftypes, EEG.srate}}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_firpm'')', 'Filter the data -- pop_firpm()'); + if isempty(result), return; end + + args = {}; + if ~isempty(result{1}) + args = [args {'fcutoff'} {str2num(result{1})}]; + end + if ~isempty(result{2}) + args = [args {'ftrans'} {str2double(result{2})}]; + end + args = [args {'ftype'} ftypes(result{3})]; + if ~isempty(result{4}) + args = [args {'wtpass'} {str2double(result{4})}]; + end + if ~isempty(result{5}) + args = [args {'wtstop'} {str2double(result{5})}]; + end + if ~isempty(result{6}) + args = [args {'forder'} {str2double(result{6})}]; + end + else + args = varargin; + end + + % Convert args to structure + args = struct(args{:}); + + c = parseargs(args, EEG.srate); + if ~isfield(args, 'forder') || isempty(args.forder) + error('Not enough input arguments'); + end + b = firpm(args.forder, c{:}); + + % Filter + disp('pop_firpm() - filtering the data'); + EEG = firfilt(EEG, b); + + % History string + com = sprintf('%s = pop_firpm(%s', inputname(1), inputname(1)); + for c = fieldnames(args)' + if ischar(args.(c{:})) + com = [com sprintf(', ''%s'', ''%s''', c{:}, args.(c{:}))]; + else + com = [com sprintf(', ''%s'', %s', c{:}, mat2str(args.(c{:})))]; + end + end + com = [com ');']; + +% Convert structure args to cell array firpm parameters +function c = parseargs(args, srate) + + if ~isfield(args, 'fcutoff') || ~isfield(args, 'ftype') || ~isfield(args, 'ftrans') || isempty(args.fcutoff) || isempty(args.ftype) || isempty(args.ftrans) + error('Not enough input arguments.'); + end + + % Cutoff frequencies + args.fcutoff = [args.fcutoff - args.ftrans / 2 args.fcutoff + args.ftrans / 2]; + args.fcutoff = sort(args.fcutoff / (srate / 2)); % Sorting and normalization + if any(args.fcutoff < 0) + error('Cutoff frequencies - transition band width / 2 must not be < DC'); + elseif any(args.fcutoff > 1) + error('Cutoff frequencies + transition band width / 2 must not be > Nyquist'); + end + c = {[0 args.fcutoff 1]}; + + % Filter type + switch args.ftype + case 'bandpass' + c = [c {[0 0 1 1 0 0]}]; + case 'bandstop' + c = [c {[1 1 0 0 1 1]}]; + case 'highpass' + c = [c {[0 0 1 1]}]; + case 'lowpass' + c = [c {[1 1 0 0]}]; + end + + %Filter weights + if all(isfield(args, {'wtpass', 'wtstop'})) && ~isempty(args.wtpass) && ~isempty(args.wtstop) + w = [args.wtstop args.wtpass]; + c{3} = w(c{2}(1:2:end) + 1); + end + +% Callback +function comcb(obj, evt, ftypes, srate) + + args.fcutoff = str2num(get(findobj(gcbf, 'Tag', 'fcutoffedit'), 'String')); + args.ftype = ftypes{get(findobj(gcbf, 'Tag', 'ftypepop'), 'Value')}; + args.ftrans = str2double(get(findobj(gcbf, 'Tag', 'ftransedit'), 'String')); + args.wtpass = str2double(get(findobj(gcbf, 'Tag', 'wtpassedit'), 'String')); + args.wtstop = str2double(get(findobj(gcbf, 'Tag', 'wtstopedit'), 'String')); + c = parseargs(args, srate); + + switch get(obj, 'Tag') + case 'orderpush' + [args.forder, args.wtpass, args.wtstop] = pop_firpmord(c{1}(2:end - 1), c{2}(1:2:end)); + if ~isempty(args.forder) || ~isempty(args.wtpass) || ~isempty(args.wtstop) + set(findobj(gcbf, 'Tag', 'forderedit'), 'String', ceil(args.forder / 2) * 2); + set(findobj(gcbf, 'Tag', 'wtpassedit'), 'String', args.wtpass); + set(findobj(gcbf, 'Tag', 'wtstopedit'), 'String', args.wtstop); + end + + case 'plotpush' + args.forder = str2double(get(findobj(gcbf, 'Tag', 'forderedit'), 'String')); + if isempty(args.forder) + error('Not enough input arguments'); + end + b = firpm(args.forder, c{:}); + H = findobj('Tag', 'filter responses', 'Type', 'figure'); + if ~isempty(H) + figure(H); + else + H = figure; + set(H, 'color', [.93 .96 1], 'Tag', 'filter responses'); + end + plotfresp(b, 1, [], srate); + end diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firpmord.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firpmord.m new file mode 100644 index 0000000..34be390 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firpmord.m @@ -0,0 +1,97 @@ +% pop_firpmord() - Estimate Parks-McClellan filter order and weights +% +% Usage: +% >> [m, wtpass, wtstop] = pop_firpmord(f, a); % pop-up window mode +% >> [m, wtpass, wtstop] = pop_firpmord(f, a, dev); +% >> [m, wtpass, wtstop] = pop_firpmord(f, a, dev, fs); +% +% Inputs: +% f - vector frequency band edges +% a - vector desired amplitudes on bands defined by f +% dev - vector allowable deviations on bands defined by f +% +% Optional inputs: +% fs - scalar sampling frequency {default 2} +% +% Output: +% m - scalar estimated filter order +% wtpass - scalar passband weight +% wtstop - scalar stopband weight +% +% Note: +% Requires the signal processing toolbox. Convert passband ripple from +% dev to peak-to-peak dB: rp = 20 * log10((1 + dev) / (1 - dev)). +% Convert stopband attenuation from dev to dB: rs = 20 * log10(dev). +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% pop_firpm, firpm, firpmord + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [m, wtpass, wtstop] = pop_firpmord(f, a, dev, fs) + +m = []; +wtpass = []; +wtstop = []; + +if exist('firpmord') ~= 2 + error('Requires the signal processing toolbox.'); +end + +if nargin < 2 || isempty(f) || isempty(a) + error('Not enough input arguments'); +end + +% Sampling frequency +if nargin < 4 || isempty(fs) + fs = 2; +end + +% GUI +if nargin < 3 || isempty(dev) + drawnow; + uigeom = {[1 1] [1 1]}; + uilist = {{'style' 'text' 'string' 'Peak-to-peak passband ripple (dB):'} ... + {'style' 'edit'} ... + {'style' 'text' 'string' 'Stopband attenuation (dB):'} ... + {'style' 'edit'}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_firpmord'')', 'Estimate filter order and weights -- pop_firpmord()'); + if length(result) == 0, return, end + + if ~isempty(result{1}) + rp = str2num(result{1}); + rp = (10^(rp / 20) - 1) / (10^(rp / 20) + 1); + dev(find(a == 1)) = rp; + else + error('Not enough input arguments.'); + end + if ~isempty(result{2}) + rs = str2num(result{2}); + rs = 10^(-abs(rs) / 20); + dev(find(a == 0)) = rs; + else + error('Not enough input arguments.'); + end +end + +[m, fo, ao, w] = firpmord(f, a, dev, fs); +wtpass = w(find(a == 1, 1)); +wtstop = w(find(a == 0, 1)); diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firws.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firws.m new file mode 100644 index 0000000..94cb5cd --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firws.m @@ -0,0 +1,234 @@ +% pop_firws() - Filter data using windowed sinc FIR filter +% +% Usage: +% >> [EEG, com, b] = pop_firws(EEG); % pop-up window mode +% >> [EEG, com, b] = pop_firws(EEG, 'key1', value1, 'key2', ... +% value2, 'keyn', valuen); +% +% Inputs: +% EEG - EEGLAB EEG structure +% 'fcutoff' - vector or scalar of cutoff frequency/ies (-6 dB; Hz) +% 'forder' - scalar filter order. Mandatory even +% +% Optional inputs: +% 'ftype' - char array filter type. 'bandpass', 'highpass', +% 'lowpass', or 'bandstop' {default 'bandpass' or +% 'lowpass', depending on number of cutoff frequencies} +% 'wtype' - char array window type. 'rectangular', 'bartlett', +% 'hann', 'hamming', 'blackman', or 'kaiser' {default +% 'blackman'} +% 'warg' - scalar kaiser beta +% 'minphase' - scalar boolean minimum-phase converted causal filter +% {default false} +% +% Outputs: +% EEG - filtered EEGLAB EEG structure +% com - history string +% b - filter coefficients +% +% Note: +% Window based filters' transition band width is defined by filter +% order and window type/parameters. Stopband attenuation equals +% passband ripple and is defined by the window type/parameters. Refer +% to table below for typical parameters. (Windowed sinc) symmetric FIR +% filters have linear phase and can be made zero phase (non-causal) by +% shifting the data by the filters group delay (what firfilt does by +% default). Pi phase jumps noticable in the phase reponse reflect a +% negative frequency response and only occur in the stopband. pop_firws +% also allows causal filtering with minimum-phase (non-linear!) converted +% filter coefficients with similar properties. Non-linear causal +% filtering is NOT recommended for most use cases. +% +% Beta Max stopband Max passband Max passband Transition width Mainlobe width +% attenuation deviation ripple (dB) (normalized freq) (normalized rad freq) +% (dB) +% Rectangular -21 0.0891 1.552 0.9 / m* 4 * pi / m +% Bartlett -25 0.0562 0.977 8 * pi / m +% Hann -44 0.0063 0.109 3.1 / m 8 * pi / m +% Hamming -53 0.0022 0.038 3.3 / m 8 * pi / m +% Blackman -74 0.0002 0.003 5.5 / m 12 * pi / m +% Kaiser 5.653 -60 0.001 0.017 3.6 / m +% Kaiser 7.857 -80 0.0001 0.002 5.0 / m +% * m = filter order +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% firfilt, firws, pop_firwsord, pop_kaiserbeta, plotfresp, windows + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, com, b] = pop_firws(EEG, varargin) + + com = ''; + if nargin < 1 + help pop_firws; + return; + end + if isempty(EEG.data) + error('Cannot process empty dataset'); + end + + if nargin < 2 + drawnow; + ftypes = {'bandpass', 'highpass', 'lowpass', 'bandstop'}; + ftypesStr = {'Bandpass', 'Highpass', 'Lowpass', 'Bandstop'}; + wtypes = {'rectangular', 'bartlett', 'hann', 'hamming', 'blackman', 'kaiser'}; + wtypesStr = {'Rectangular (PB dev=0.089, SB att=-21dB)', 'Bartlett (PB dev=0.056, SB att=-25dB)', 'Hann (PB dev=0.006, SB att=-44dB)', 'Hamming (PB dev=0.002, SB att=-53dB)', 'Blackman (PB dev=0.0002, SB att=-74dB)', 'Kaiser'}; + uigeom = {[1 0.75 0.75] [1 0.75 0.75] 1 [1 0.75 0.75] [1 0.75 0.75] [1 0.75 0.75] [1 1.5] 1 [1 0.75 0.75]}; + uilist = {{'Style' 'text' 'String' 'Cutoff frequency(ies) [hp lp] (-6 dB; Hz):'} ... + {'Style' 'edit' 'String' '' 'Tag' 'fcutoffedit'} {} ... + {'Style' 'text' 'String' 'Filter type:'} ... + {'Style' 'popupmenu' 'String' ftypesStr 'Tag' 'ftypepop'} {} ... + {} ... + {'Style' 'text' 'String' 'Window type:'} ... + {'Style' 'popupmenu' 'String' wtypesStr 'Tag' 'wtypepop' 'Value' 5 'Callback' 'temp = {''off'', ''on''}; set(findobj(gcbf, ''-regexp'', ''Tag'', ''^warg''), ''Enable'', temp{double(get(gcbo, ''Value'') == 6) + 1}), set(findobj(gcbf, ''Tag'', ''wargedit''), ''String'', '''')'} {} ... + {'Style' 'text' 'String' 'Kaiser window beta:' 'Tag' 'wargtext' 'Enable' 'off'} ... + {'Style' 'edit' 'String' '' 'Tag' 'wargedit' 'Enable' 'off'} ... + {'Style' 'pushbutton' 'String' 'Estimate' 'Tag' 'wargpush' 'Enable' 'off' 'Callback' @comwarg} ... + {'Style' 'text' 'String' 'Filter order (mandatory even):'} ... + {'Style' 'edit' 'String' '' 'Tag' 'forderedit'} ... + {'Style' 'pushbutton' 'String' 'Estimate' 'Callback' {@comforder, wtypes, EEG.srate}} ... + {} {'Style' 'checkbox', 'String', 'Use minimum-phase converted causal filter (non-linear!; beta)', 'Tag' 'minphase', 'Value', 0} ... + {'Style' 'edit' 'Tag' 'devedit' 'Visible' 'off'} ... + {} {} {'Style' 'pushbutton' 'String', 'Plot filter responses' 'Callback' {@comfresp, wtypes, ftypes, EEG.srate}}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_firws'')', 'Filter the data -- pop_firws()'); + if isempty(result), return; end + + args = {}; + if ~isempty(result{1}) + args = [args {'fcutoff'} {str2num(result{1})}]; + end + args = [args {'ftype'} ftypes(result{2})]; + args = [args {'wtype'} wtypes(result{3})]; + if ~isempty(result{4}) + args = [args {'warg'} {str2double(result{4})}]; + end + if ~isempty(result{5}) + args = [args {'forder'} {str2double(result{5})}]; + end + args = [args {'minphase'} result{6}]; + else + args = varargin; + end + + % Convert args to structure + args = struct(args{:}); + + c = parseargs(args, EEG.srate); + b = firws(c{:}); + + % Check arguments + if ~isfield(args, 'minphase') || isempty(args.minphase) + args.minphase = 0; + end + + % Filter + disp('pop_firws() - filtering the data'); + if args.minphase + b = minphaserceps(b); + EEG = firfiltsplit(EEG, b, 1); + else + EEG = firfilt(EEG, b); + end + + % History string + com = sprintf('%s = pop_firws(%s', inputname(1), inputname(1)); + for c = fieldnames(args)' + if ischar(args.(c{:})) + com = [com sprintf(', ''%s'', ''%s''', c{:}, args.(c{:}))]; + else + com = [com sprintf(', ''%s'', %s', c{:}, mat2str(args.(c{:})))]; + end + end + com = [com ');']; + +% Convert structure args to cell array firws parameters +function c = parseargs(args, srate) + + % Filter order and cutoff frequencies + if ~isfield(args, 'fcutoff') || ~isfield(args, 'forder') || isempty(args.fcutoff) || isempty(args.forder) + error('Not enough input arguments.'); + end + c = [{args.forder} {sort(args.fcutoff / (srate / 2))}]; % Sorting and normalization + + % Filter type + if isfield(args, 'ftype') && ~isempty(args.ftype) + if (strcmpi(args.ftype, 'bandpass') || strcmpi(args.ftype, 'bandstop')) && length(args.fcutoff) ~= 2 + error('Not enough input arguments.'); + elseif (strcmpi(args.ftype, 'highpass') || strcmpi(args.ftype, 'lowpass')) && length(args.fcutoff) ~= 1 + error('Too many input arguments.'); + end + switch args.ftype + case 'bandstop' + c = [c {'stop'}]; + case 'highpass' + c = [c {'high'}]; + end + end + + % Window type + if isfield(args, 'wtype') && ~isempty(args.wtype) + if strcmpi(args.wtype, 'kaiser') + if isfield(args, 'warg') && ~isempty(args.warg) + c = [c {windows(args.wtype, args.forder + 1, args.warg)'}]; + else + error('Not enough input arguments.'); + end + else + c = [c {windows(args.wtype, args.forder + 1)'}]; + end + end + +% Callback estimate Kaiser beta +function comwarg(varargin) + [warg, dev] = pop_kaiserbeta; + set(findobj(gcbf, 'Tag', 'wargedit'), 'String', warg); + set(findobj(gcbf, 'Tag', 'devedit'), 'String', dev); + +% Callback estimate filter order +function comforder(obj, evt, wtypes, srate) + wtype = wtypes{get(findobj(gcbf, 'Tag', 'wtypepop'), 'Value')}; + dev = get(findobj(gcbf, 'Tag', 'devedit'), 'String'); + [forder, dev] = pop_firwsord(wtype, srate, [], dev); + set(findobj(gcbf, 'Tag', 'forderedit'), 'String', forder); + set(findobj(gcbf, 'Tag', 'devedit'), 'String', dev); + +% Callback plot filter responses +function comfresp(obj, evt, wtypes, ftypes, srate) + args.fcutoff = str2num(get(findobj(gcbf, 'Tag', 'fcutoffedit'), 'String')); + args.ftype = ftypes{get(findobj(gcbf, 'Tag', 'ftypepop'), 'Value')}; + args.wtype = wtypes{get(findobj(gcbf, 'Tag', 'wtypepop'), 'Value')}; + args.warg = str2num(get(findobj(gcbf, 'Tag', 'wargedit'), 'String')); + args.forder = str2double(get(findobj(gcbf, 'Tag', 'forderedit'), 'String')); + args.minphase = get(findobj(gcbf, 'Tag', 'minphase'), 'Value'); + causal = args.minphase; + c = parseargs(args, srate); + b = firws(c{:}); + if args.minphase + b = minphaserceps(b); + end + H = findobj('Tag', 'filter responses', 'type', 'figure'); + if ~isempty(H) + figure(H); + else + H = figure; + set(H, 'color', [.93 .96 1], 'Tag', 'filter responses'); + end + plotfresp(b, 1, [], srate, causal); diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firwsord.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firwsord.m new file mode 100644 index 0000000..43a1f86 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_firwsord.m @@ -0,0 +1,145 @@ +% pop_firwsord() - Estimate windowed sinc filter order depending on +% window type and requested transition band width +% +% Usage: +% >> [m, dev] = pop_firwsord; % pop-up window mode +% >> m = pop_firwsord(wtype, fs, df); +% >> m = pop_firwsord('kaiser', fs, df, dev); +% +% Inputs: +% wtype - char array window type. 'rectangular', 'bartlett', 'hann', +% 'hamming', {'blackman'}, or 'kaiser' +% fs - scalar sampling frequency {default 2} +% df - scalar requested transition band width +% dev - scalar maximum passband deviation/ripple (Kaiser window +% only) +% +% Output: +% m - scalar estimated filter order +% dev - scalar maximum passband deviation/ripple +% +% References: +% [1] Smith, S. W. (1999). The scientist and engineer's guide to +% digital signal processing (2nd ed.). San Diego, CA: California +% Technical Publishing. +% [2] Proakis, J. G., & Manolakis, D. G. (1996). Digital Signal +% Processing: Principles, Algorithms, and Applications (3rd ed.). +% Englewood Cliffs, NJ: Prentice-Hall +% [3] Ifeachor E. C., & Jervis B. W. (1993). Digital Signal +% Processing: A Practical Approach. Wokingham, UK: Addison-Wesley +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% pop_firws, firws, pop_kaiserbeta, windows + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [m, dev] = pop_firwsord(wtype, fs, df, dev) + + m = []; + + wtypes = {'rectangular' 'bartlett' 'hann' 'hamming' 'blackman' 'kaiser'}; + + % Window type + if nargin < 1 || isempty(wtype) + wtype = 5; + elseif ~ischar(wtype) || isempty(strmatch(wtype, wtypes)) + error('Unknown window type'); + else + wtype = strmatch(wtype, wtypes); + end + + % Sampling frequency + if nargin < 2 || isempty(fs) + fs = 2; + end + + % Transition band width + if nargin < 3 + df = []; + end + + % Maximum passband deviation/ripple + if nargin < 4 || isempty(dev) + devs = {0.089 0.056 0.0063 0.0022 0.0002 []}; + dev = devs{wtype}; + end + + % GUI + if nargin < 3 || isempty(df) || (wtype == 6 && isempty(dev)) + drawnow; + uigeom = {[1 1] [1 1] [1 1] [1 1]}; + uilist = {{'style' 'text' 'string' 'Sampling frequency:'} ... + {'style' 'edit' 'string' fs} ... + {'style' 'text' 'string' 'Window type:'} ... + {'style' 'popupmenu' 'string' wtypes 'tag' 'wtypepop' 'value' wtype 'callback' {@comwtype, dev}} ... + {'style' 'text' 'string' 'Transition bandwidth (Hz):'} ... + {'style' 'edit' 'string' df} ... + {'style' 'text' 'string' 'Max passband deviation/ripple:' 'tag' 'devtext'} ... + {'style' 'edit' 'tag' 'devedit' 'createfcn' {@comwtype, dev}}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_firwsord'')', 'Estimate filter order -- pop_firwsord()'); + + if length(result) == 0, return, end + if ~isempty(result{1}) + fs = str2num(result{1}); + else + fs = 2; + end + wtype = result{2}; + if ~isempty(result{3}) + df = str2num(result{3}); + else + error('Not enough input arguments.'); + end + if ~isempty(result{4}) + dev = str2num(result{4}); + elseif wtype == 6 + error('Not enough input arguments.'); + end + end + + if length(fs) > 1 || ~isnumeric(fs) || ~isreal(fs) || fs <= 0 + error('Sampling frequency must be a positive real scalar.'); + end + if length(df) > 1 || ~isnumeric(df) || ~isreal(df) || fs <= 0 + error('Transition bandwidth must be a positive real scalar.'); + end + + df = df / fs; % Normalize transition band width + + if wtype == 6 + if length(dev) > 1 || ~isnumeric(dev) || ~isreal(dev) || dev <= 0 + error('Passband deviation/ripple must be a positive real scalar.'); + end + devdb = -20 * log10(dev); + m = 1 + (devdb - 8) / (2.285 * 2 * pi * df); + else + dfs = [0.9 2.9 3.1 3.3 5.5]; + m = dfs(wtype) / df; + end + + m = ceil(m / 2) * 2; % Make filter order even (type 1) + +function comwtype(obj, evt, dev) + enable = {'off' 'off' 'off' 'off' 'off' 'on'}; + devs = {0.089 0.056 0.0063 0.0022 0.0002 dev}; + wtype = get(findobj(gcbf, 'tag', 'wtypepop'), 'value'); + set(findobj(gcbf, 'tag', 'devtext'), 'enable', enable{wtype}); + set(findobj(gcbf, 'tag', 'devedit'), 'enable', enable{wtype}, 'string', devs{wtype}); diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_kaiserbeta.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_kaiserbeta.m new file mode 100644 index 0000000..fd94db9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_kaiserbeta.m @@ -0,0 +1,69 @@ +% pop_kaiserbeta() - Estimate Kaiser window beta +% +% Usage: +% >> [beta, dev] = pop_kaiserbeta; % pop-up window mode +% >> beta = pop_kaiserbeta(dev); +% +% Inputs: +% dev - scalar maximum passband deviation/ripple +% +% Output: +% beta - scalar Kaiser window beta +% dev - scalar maximum passband deviation/ripple +% +% References: +% [1] Proakis, J. G., & Manolakis, D. G. (1996). Digital Signal +% Processing: Principles, Algorithms, and Applications (3rd ed.). +% Englewood Cliffs, NJ: Prentice-Hall +% +% Author: Andreas Widmann, University of Leipzig, 2005 +% +% See also: +% pop_firws, firws, pop_firwsord, windows + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [beta, dev] = pop_kaiserbeta(dev) + + beta = []; + + if nargin < 1 || isempty(dev) + drawnow; + uigeom = {[1 1]}; + uilist = {{'style' 'text' 'string' 'Max passband deviation/ripple:'} ... + {'style' 'edit' 'string' ''}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_kaiserbeta'')', 'Estimate Kaiser window beta -- pop_kaiserbeta()'); + if length(result) == 0, return, end + if ~isempty(result{1}) + dev = str2num(result{1}); + else + error('Not enough input arguments.'); + end + end + + devdb = -20 * log10(dev); + if devdb > 50 + beta = 0.1102 * (devdb - 8.7); + elseif devdb >= 21 + beta = 0.5842 * (devdb - 21)^0.4 + 0.07886 * (devdb - 21); + else + beta = 0; + end + +end diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_xfirws.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_xfirws.m new file mode 100644 index 0000000..938d4fb --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/pop_xfirws.m @@ -0,0 +1,249 @@ +% pop_xfirws() - Design and export xfir compatible windowed sinc FIR filter +% +% Usage: +% >> pop_xfirws; % pop-up window mode +% >> [b, a] = pop_xfirws; % pop-up window mode +% >> pop_xfirws('key1', value1, 'key2', value2, 'keyn', valuen); +% >> [b, a] = pop_xfirws('key1', value1, 'key2', value2, 'keyn', valuen); +% +% Inputs: +% 'srate' - scalar sampling rate (Hz) +% 'fcutoff' - vector or scalar of cutoff frequency/ies (-6 dB; Hz) +% 'forder' - scalar filter order. Mandatory even +% +% Optional inputs: +% 'ftype' - char array filter type. 'bandpass', 'highpass', +% 'lowpass', or 'bandstop' {default 'bandpass' or +% 'lowpass', depending on number of cutoff frequencies} +% 'wtype' - char array window type. 'rectangular', 'bartlett', +% 'hann', 'hamming', 'blackman', or 'kaiser' {default +% 'blackman'} +% 'warg' - scalar kaiser beta +% 'filename' - char array export filename +% 'pathname' - char array export pathname {default '.'} +% +% Outputs: +% b - filter coefficients +% a - filter coefficients +% +% Note: +% Window based filters' transition band width is defined by filter +% order and window type/parameters. Stopband attenuation equals +% passband ripple and is defined by the window type/parameters. Refer +% to table below for typical parameters. (Windowed sinc) FIR filters +% are zero phase in passband when shifted by the filters group delay +% (what firfilt does). Pi phase jumps noticable in the phase reponse +% reflect a negative frequency response and only occur in the +% stopband. +% +% Beta Max stopband Max passband Max passband Transition width Mainlobe width +% attenuation deviation ripple (dB) (normalized freq) (normalized rad freq) +% (dB) +% Rectangular -21 0.0891 1.552 0.9 / m* 4 * pi / m +% Bartlett -25 0.0562 0.977 (2.9** / m) 8 * pi / m +% Hann -44 0.0063 0.109 3.1 / m 8 * pi / m +% Hamming -53 0.0022 0.038 3.3 / m 8 * pi / m +% Blackman -74 0.0002 0.003 5.5 / m 12 * pi / m +% Kaiser 5.653 -60 0.001 0.017 3.6 / m +% Kaiser 7.857 -80 0.0001 0.002 5.0 / m +% * m = filter order +% ** estimate for higher m only +% +% Example: +% fs = 500; tbw = 2; dev = 0.001; +% beta = pop_kaiserbeta(dev); +% m = pop_firwsord('kaiser', fs, tbw, dev); +% pop_xfirws('srate', fs, 'fcutoff', [1 25], 'ftype', 'bandpass', 'wtype', 'kaiser', 'warg', beta, 'forder', m, 'filename', 'foo.fir') +% +% Author: Andreas Widmann, University of Leipzig, 2011 +% +% See also: +% firfilt, firws, pop_firwsord, pop_kaiserbeta, plotfresp, windows + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2011 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [varargout] = pop_xfirws(varargin) + +% Pop-up window mode +if nargin < 1 + + drawnow; + ftypes = {'bandpass' 'highpass' 'lowpass' 'bandstop'}; + wtypes = {'rectangular' 'bartlett' 'hann' 'hamming' 'blackman' 'kaiser'}; + uigeom = {[1 0.75 0.75] 1 [1 0.75 0.75] [1 0.75 0.75] 1 [1 0.75 0.75] [1 0.75 0.75] [1 0.75 0.75] 1 [1 0.75 0.75]}; + uilist = {{'Style' 'text' 'String' 'Sampling frequency (Hz):'} ... + {'Style' 'edit' 'String' '2' 'Tag' 'srateedit'} {} ... + {} ... + {'Style' 'text' 'String' 'Cutoff frequency(ies) [hp lp] (-6 dB; Hz):'} ... + {'Style' 'edit' 'String' '' 'Tag' 'fcutoffedit'} {} ... + {'Style' 'text' 'String' 'Filter type:'} ... + {'Style' 'popupmenu' 'String' ftypes 'Tag' 'ftypepop'} {} ... + {} ... + {'Style' 'text' 'String' 'Window type:'} ... + {'Style' 'popupmenu' 'String' wtypes 'Tag' 'wtypepop' 'Value' 5 'Callback' 'temp = {''off'', ''on''}; set(findobj(gcbf, ''-regexp'', ''Tag'', ''^warg''), ''Enable'', temp{double(get(gcbo, ''Value'') == 6) + 1}), set(findobj(gcbf, ''Tag'', ''wargedit''), ''String'', '''')'} {} ... + {'Style' 'text' 'String' 'Kaiser window beta:' 'Tag' 'wargtext' 'Enable' 'off'} ... + {'Style' 'edit' 'String' '' 'Tag' 'wargedit' 'Enable' 'off'} ... + {'Style' 'pushbutton' 'String' 'Estimate' 'Tag' 'wargpush' 'Enable' 'off' 'Callback' @comwarg} ... + {'Style' 'text' 'String' 'Filter order (mandatory even):'} ... + {'Style' 'edit' 'String' '' 'Tag' 'forderedit'} ... + {'Style' 'pushbutton' 'String' 'Estimate' 'Callback' {@comforder, wtypes}} ... + {'Style' 'edit' 'Tag' 'devedit' 'Visible' 'off'} ... + {} {} {'Style' 'pushbutton' 'String', 'Plot filter responses' 'Callback' {@comfresp, wtypes, ftypes}}}; + result = inputgui(uigeom, uilist, 'pophelp(''pop_firws'')', 'Filter the data -- pop_firws()'); + if isempty(result), return; end + + Arg = struct; + Arg.srate = str2double(result{1}); + Arg.fcutoff = str2num(result{2}); + Arg.ftype = ftypes{result{3}}; + Arg.wtype = wtypes{result{4}}; + Arg.warg = str2num(result{5}); + Arg.forder = str2double(result{6}); + +% Command line mode +else + Arg = struct(varargin{:}); +end + +% Sampling rate +if ~isfield(Arg, 'srate') || isempty(Arg.srate) % Use default + Arg.srate = 2; +end + +% Filter order and cutoff frequencies +if ~isfield(Arg, 'fcutoff') || ~isfield(Arg, 'forder') || isempty(Arg.fcutoff) || isempty(Arg.forder) + error('Not enough input arguments.'); +end +firwsArgArray = {Arg.forder sort(Arg.fcutoff / Arg.srate * 2)}; % Sorting and normalization + +% Filter type +if ~isfield(Arg, 'ftype') || isempty(Arg.ftype) % Use default + switch length(Arg.fcutoff) + case 1 + Arg.ftype = 'lowpass'; + case 2 + Arg.ftype = 'bandpass'; + otherwise + error('Wrong number of arguments.') + end +else + if any(strcmpi(Arg.ftype, {'bandpass' 'bandstop'})) && length(Arg.fcutoff) ~= 2 + error('Not enough input arguments.'); + elseif any(strcmpi(Arg.ftype, {'highpass' 'lowpass'})) && length(Arg.fcutoff) ~= 1 + error('Too many input arguments.'); + end + switch Arg.ftype + case 'bandstop' + firwsArgArray(end + 1) = {'stop'}; + case 'highpass' + firwsArgArray(end + 1) = {'high'}; + end +end + +% Window type +if ~isfield(Arg, 'wtype') || isempty(Arg.wtype) % Use default + Arg.wtype = 'blackman'; +end + +% Window parameter +if ~isfield(Arg, 'warg') || isempty(Arg.warg) + Arg.warg = []; + firwsArgArray(end + 1) = {windows(Arg.wtype, Arg.forder + 1)}; +else + firwsArgArray(end + 1) = {windows(Arg.wtype, Arg.forder + 1, Arg.warg)}; +end + +b = firws(firwsArgArray{:}); +a = 1; + +if nargout == 0 || isfield(Arg, 'filename') + + % Open file + if ~isfield(Arg, 'filename') || isempty(Arg.filename) + [Arg.filename Arg.pathname] = uiputfile('*.fir', 'Save filter -- pop_xfirws'); + end + if ~isfield(Arg, 'pathname') || isempty(Arg.pathname) + Arg.pathname = '.'; + end + [fid message] = fopen(fullfile(Arg.pathname, Arg.filename), 'w', 'l'); + if fid == -1 + error(message) + end + + % Author + fprintf(fid, '[author]\n'); + fprintf(fid, '%s\n\n', 'pop_xfirws 1.5.1'); + + % FIR design + fprintf(fid, '[fir design]\n'); + fprintf(fid, 'method %s\n', 'fourier'); + fprintf(fid, 'type %s\n', Arg.ftype); + fprintf(fid, 'fsample %f\n', Arg.srate); + fprintf(fid, 'length %d\n', Arg.forder + 1); + fprintf(fid, 'fcrit%d %f\n', [1:length(Arg.fcutoff); Arg.fcutoff]); + fprintf(fid, 'window %s %s\n\n', Arg.wtype, num2str(Arg.warg)); % fprintf bug + + % FIR + fprintf(fid, '[fir]\n'); + fprintf(fid, '%d\n', Arg.forder + 1); + fprintf(fid, '% 18.10e\n', b); + + % Close file + fclose(fid); + +end + +if nargout > 0 + varargout = {b a}; +end + +% Callback estimate Kaiser beta +function comwarg(varargin) + [warg, dev] = pop_kaiserbeta; + set(findobj(gcbf, 'Tag', 'wargedit'), 'String', warg); + set(findobj(gcbf, 'Tag', 'devedit'), 'String', dev); + +% Callback estimate filter order +function comforder(obj, evt, wtypes) + srate = str2double(get(findobj(gcbf, 'Tag', 'srateedit'), 'String')); + wtype = wtypes{get(findobj(gcbf, 'Tag', 'wtypepop'), 'Value')}; + dev = str2double(get(findobj(gcbf, 'Tag', 'devedit'), 'String')); + [forder, dev] = pop_firwsord(wtype, srate, [], dev); + set(findobj(gcbf, 'Tag', 'forderedit'), 'String', forder); + set(findobj(gcbf, 'Tag', 'devedit'), 'String', dev); + +% Callback plot filter responses +function comfresp(obj, evt, wtypes, ftypes) + Arg.srate = str2double(get(findobj(gcbf, 'Tag', 'srateedit'), 'String')); + Arg.fcutoff = str2num(get(findobj(gcbf, 'Tag', 'fcutoffedit'), 'String')); + Arg.ftype = ftypes{get(findobj(gcbf, 'Tag', 'ftypepop'), 'Value')}; + Arg.wtype = wtypes{get(findobj(gcbf, 'Tag', 'wtypepop'), 'Value')}; + Arg.warg = str2num(get(findobj(gcbf, 'Tag', 'wargedit'), 'String')); + Arg.forder = str2double(get(findobj(gcbf, 'Tag', 'forderedit'), 'String')); + xfirwsArgArray(1, :) = fieldnames(Arg); + xfirwsArgArray(2, :) = struct2cell(Arg); + [b a] = pop_xfirws(xfirwsArgArray{:}); + H = findobj('Tag', 'filter responses', 'type', 'figure'); + if ~isempty(H) + figure(H); + else + H = figure; + set(H, 'color', [.93 .96 1], 'Tag', 'filter responses'); + end + plotfresp(b, a, [], Arg.srate); diff --git a/code/eeglab13_4_4b/plugins/firfilt1.6.1/windows.m b/code/eeglab13_4_4b/plugins/firfilt1.6.1/windows.m new file mode 100644 index 0000000..cc015a5 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/firfilt1.6.1/windows.m @@ -0,0 +1,114 @@ +% windows() - Returns handle to window function or window +% +% Usage: +% >> h = windows(t); +% >> h = windows(t, m); +% >> h = windows(t, m, a); +% +% Inputs: +% t - char array 'rectangular', 'bartlett', 'hann', 'hamming', +% 'blackman', 'blackmanharris', or 'kaiser' +% +% Optional inputs: +% m - scalar window length +% a - scalar or vector with window parameter(s) +% +% Output: +% h - function handle or column vector window +% +% Author: Andreas Widmann, University of Leipzig, 2005 + +%123456789012345678901234567890123456789012345678901234567890123456789012 + +% Copyright (C) 2005 Andreas Widmann, University of Leipzig, widmann@uni-leipzig.de +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function h = windows(t, m, a) + + if nargin < 1 + error('Not enough input arguments.'); + end + h = str2func(t); + switch nargin + case 2 + h = h(m); + case 3 + h = h(m, a); + end +end + +function w = rectangular(m) + w = ones(m, 1); +end + +function w = bartlett(m) + w = 1 - abs(-1:2 / (m - 1):1)'; +end + +% von Hann +function w = hann(m); + w = hamming(m, 0.5); +end + +% Hamming +function w = hamming(m, a) + if nargin < 2 || isempty(a) + a = 25 / 46; + end + m = [0:1 / (m - 1):1]'; + w = a - (1 - a) * cos(2 * pi * m); +end + +% Blackman +function w = blackman(m, a) + if nargin < 2 || isempty(a) + a = [0.42 0.5 0.08 0]; + end + m = [0:1 / (m - 1):1]'; + w = a(1) - a(2) * cos (2 * pi * m) + a(3) * cos(4 * pi * m) - a(4) * cos(6 * pi * m); +end + +% Blackman-Harris +function w = blackmanharris(m) + w = blackman(m, [0.35875 0.48829 0.14128 0.01168]); +end + +% Kaiser +function w = kaiser(m, a) + if nargin < 2 || isempty(a) + a = 0.5; + end + m = [-1:2 / (m - 1):1]'; + w = besseli(0, a * sqrt(1 - m.^2)) / besseli(0, a); +end + +% Tukey +function w = tukey(m, a) + if nargin < 2 || isempty(a) + a = 0.5; + end + if a <= 0 + w = ones(m, 1); + elseif a >= 1 + w = hann(m); + else + a = (m - 1) / 2 * a; + tapArray = (0:a)' / a; + w = [0.5 - 0.5 * cos(pi * tapArray); ... + ones(m - 2 * length(tapArray), 1); ... + 0.5 - 0.5 * cos(pi * tapArray(end:-1:1))]; + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/LICENSE.txt b/code/eeglab13_4_4b/plugins/mffmatlabio-master/LICENSE.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/MFF-1.2.2-jar-with-dependencies.jar b/code/eeglab13_4_4b/plugins/mffmatlabio-master/MFF-1.2.2-jar-with-dependencies.jar new file mode 100644 index 0000000..871bc8f Binary files /dev/null and b/code/eeglab13_4_4b/plugins/mffmatlabio-master/MFF-1.2.2-jar-with-dependencies.jar differ diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/README.md b/code/eeglab13_4_4b/plugins/mffmatlabio-master/README.md new file mode 100644 index 0000000..d9711ef --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/README.md @@ -0,0 +1,116 @@ +# Known limitations to the EGI/Philips MFF import/export plugin +--------------------------------------------------------- +- Timing accuracy limited to 10-50 microseconds precision. Matlab 2014b time + conversion is not as precise as Matlab 2017a conversion (we can loose 1ms + accuracy on some events in some specific rare files). With Matlab 2018a, the + difference seems to be at most 10 microseconds. In most applications, + this limitation has no consequences as event latencies are multiple of 1000 + microseconds (1 ms) and the events are imported and exported perfectly. + +- The plugin will not work with version of Matlab older than 2014a as the Java + JAR file cannot be properly interfaced. + +- When the Java Heap Memory is at its default level, few files can be imported. + There is a special message guiding users how to increase the default settings + in Matlab in case they encounter an error. Importantly, some large files + require a computer with 16Gb of RAM or more (or Java Heap of 4Gb). + +- Calibration data when present is applied to the data. However, if the file + is exported this information is lost. Impedance data and channel status also + contained in the info1.xml file is ignored. + +- Importing trials of different length is not supported. This is a rare occurrence. + +- Channel status and channel keys in category files are not imported + +- Importing filter information and calibration information is not supported + (except gain calibration which is applied to the data when it is imported) + +- The plugin will import multiple subject trial averages in EEGLAB but the + export is not correct or identical. The reason is that EEGLAB consider + these averages as single trials from the same subject and cannot handle + participant names. + +- When importing in standalone mode (not as an EEGLAB plugin, if the file + is exported, it will not contain event keys + +- Video files are not imported and expoted + +- This plugin was tested on platforms using little-endian byte ordering. + Although we do not expect big-endian to be a problem, there is a small + chance there could be problem + +# Revision history +---------------- +Version 3.5 +- Fixes issues associated with standalone use + +Version 3.4 +- Fixes issues associated with reading data under Fieldtrip + +Version 3.3 +- Fix reading on Windows + +Version 3.2 +- Fix error with boundary events + +Version 3.1 +- Implement auto-save for BIDS +- Fix event track type for segmenting in Netstation + +Version 3.0 +- Fix issue with PNS channels +- Fix imporing rare files with custom fields +- Fixing a variety of minor Git issues + +Version 2.02 +- Adding eeg_checkset to private folder to run in standalone mode (F. Tadel) +- Added fix for files with no events (R. Martinez fix for https://github.com/sccn/eeglab/issues/17) + +Version 2.01 +- Allow eegplugin_mffmatlabio to return version number +- Remove call in mff_import that was assuming EEGLAB was present + +Version 2.00 +- Octave compatibility +- Fix issue with boundary latency when importing file mff version 0 +- Allowing to export random EEG files +- Rescale coordinates for non-MFF channel coordinates +- Allow exporting datasets which do not have a code field +- Allow exporting datasets with no event duration +- Better support for PNS channels for File-IO +- Fix command line call not rotating channels + +Version 1.00 +- Add file separator to EEGLAB export menu + +Version 0.96 +- Add license for each file +- Clean up documentation + +Version 0.95 +- Fix issues when running File-io import and now importing using File-io functions direclty +- Adding licence file + +Version 0.94 +- Fix EEGLAB history for pop_mffimport +- Fix boundaries when encoding types +- Minor documentation changes + +Version 0.93 +- Now import/export data files with PNS data only +- Through the graphic interface, now allow to specify the MFF events field to + use for the EEGLAB event types. +- Now allow the plugin to function in standalone mode. +- Now check for Matlab version and issue an error for unsuported Matlab versions + +Version 0.92 +- Renamed all the functions +- Fix minor issue with multiple references + +Version 0.91 - Difference with previous revision +- Fixed issue with info1.xml file which was missing some information + +Version 0.9 +- Adding support for layout and subject information + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/eegplugin_mffmatlabio.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/eegplugin_mffmatlabio.m new file mode 100644 index 0000000..012d8dd --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/eegplugin_mffmatlabio.m @@ -0,0 +1,100 @@ +% eegplugin_mffmatlabio() - plugin for importing and exporting MFF files +% +% Usage: +% >> eegplugin_mffmatlabio(fig, trystrs, catchstrs); +% +% Inputs: +% fig - [integer] eeglab figure. +% trystrs - [struct] "try" strings for menu callbacks. +% catchstrs - [struct] "catch" strings for menu callbacks. +% +% Main files +% ---------- +% eegplugin_mffmatlabio.m - create menu in the EEGLAB interface +% pop_mffimport.m - import MFF file into EEGLAB (graphic interface) +% pop_mffexport.m - export EEGLAB structure to MFF file/folder (graphic interface) +% +% Support files +% ------------- +% mff_import.m - import MFF file/folder to EEGLAB structure +% mff_importcategories.m - import 'categories.xml' file +% mff_importcoordinates.m - import 'coordinates.xml' file +% mff_importepochs.m - import 'epochs.xml' file +% mff_importevents.m - import 'eventsxxxx.xml' file(s) +% mff_importinfo.m - import 'info.xml' file +% mff_importinfon.m - import 'info1.xml' file +% mff_importpnsset.m - import PNS file +% mff_importsensorlayout.m - import 'sensorlayout.xml' file +% mff_importsignal.m - import 'signal1.bin' file +% mff_importsubject.m - import subject file +% mff_export.m - export MFF file/folder from EEGLAB structure +% mff_createmff.m - create empty MFF file/folder +% mff_exportcategories.m - export 'categories.xml' file +% mff_exportcoordinates.m - export 'coordinates.xml' file +% mff_exportepochs.m - export 'epochs.xml' file +% mff_exportevents.m - export 'events.xml' file +% mff_exportinfo.m - export 'info.xml' file +% mff_exportinfon.m - export 'info1.xml' file +% mff_exportpnsset.m - export PNS file +% mff_exportsensorlayout.m - export 'sensorlayout.xml' file +% mff_exportsignal.m - export 'signal1.bin' file +% mff_exportsubject.m - export subject file +% mff_decodetime.m - convert MFF time to Matlab time +% mff_encodetime.m - convert Matlab time to MFF time +% mff_getobj.m - convert Java object to Matlab +% mff_setobj.m - convert Matlab object to Java +% pop_mffimport.m - EEGLAB import GUI +% pop_mffexport.m - EEGLAB export GUI +% eegplugin_mffmatlabio.m - EEGLAB startup function +% eeg_compare.m - Function to compare EEGLAB sturtures +% mff_fileio_read_data.m - File-IO function to read data +% mff_fileio_read_header.m - File-IO function to read header +% mff_fileio_read_event.m - File-IO function to read event +% mff_fileio_write.m - File-IO function to write data and events + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function versionstr = eegplugin_mffmatlabio(fig, trystrs, catchstrs) + + %global EEG + versionstr = '3.5'; + if nargin < 3 + disp('eegplugin_mffmatlabio requires 3 arguments'); + return + end + + % add amica folder to path + % ----------------------- + if ~exist('mff_import') + p = which('eegplugin_mffmatlabio'); + p = p(1:findstr(p,'eegplugin_mffmatlabio.m')-1); + addpath(p); + end + + % find tools menu + % --------------- + menui = findobj(fig, 'tag', 'import data'); + menue = findobj(fig, 'tag', 'export'); + + % menu callback commands + % ---------------------- + comload = [ trystrs.no_check '[EEG, LASTCOM] = pop_mffimport;' catchstrs.new_non_empty ]; + comwrite = [ trystrs.no_check 'LASTCOM = pop_mffexport(EEG);' catchstrs.store_and_hist ]; + + % create menus (CHANGING THESE MENUS AFFECTS THE MAIN eeglab.m FUNCTION) + % ------------ + submenu = uimenu( menui, 'Label', 'Import EGI/Philips .mff file', 'separator', 'on', 'CallBack', comload); + submenu = uimenu( menue, 'Label', 'Export EGI/Philips .mff file', 'separator', 'on', 'CallBack', comwrite); diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_createmff.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_createmff.m new file mode 100644 index 0000000..4ac7827 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_createmff.m @@ -0,0 +1,52 @@ +% mff_createmff - create empty MFF file/folder +% +% Usage: +% mff_createmff(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function events = mff_createmff(mffURI) + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Test script for matlab binding of Java based MFF file access library. +% The MFFFactory class is used to access all resources contained in a +% MFF package file. This example loads an event track from the example file +% and writes out information about events in that file. + +% create a factory +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); %MFFResourceType.MFFResourceTypes. +mffFileResourceType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_MFFFile')); + +if mfffactory.resourceExistsAtURI(mffURI, mffFileResourceType) + disp('The resource already exists'); +else + disp('The resource does not exist'); + + if mfffactory.createResourceAtURI(mffURI, mffFileResourceType) + disp('Success creating MFF file.'); + else + disp('An error occured creating the MFF file.'); + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_decodetime.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_decodetime.m new file mode 100644 index 0000000..9f1c9b3 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_decodetime.m @@ -0,0 +1,41 @@ +% mff_decodetime - decode EGI time format into Matlab time format +% +% Usage: +% timeout = mff_decodetime(timein); +% +% Input: +% timein - EGI time format (string) +% +% Output: +% timeout - Matlab numerical time (see datenum) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function timeValOut = mff_decodetime(timeVal) + + % remove GMT part + microSec = 0.0000000000115251168608665466308593750000000; + timeValOut = datenum(timeVal(1:23), 'yyyy-mm-ddTHH:MM:SS.FFF') + str2double(timeVal(24:26))*microSec; + +% indDash = find(timeVal == '-'); +% if indDash(end) > 10 else indDash = length(timeVal)+1; end; +% +% microSeconds = timeVal(indDash(end)-4:indDash(end)-1); +% microSeconds = str2double(microSeconds)/24/60/60/1000; +% fprintf('%1.20f\n', timeValOut); +% timeValOut = timeValOut+microSeconds; +% fprintf('%1.20f\n', timeValOut); + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_encodetime.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_encodetime.m new file mode 100644 index 0000000..8170436 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_encodetime.m @@ -0,0 +1,58 @@ +% mff_encodetime - encode EGI time format from Matlab time format +% +% Usage: +% timeout = mff_encodetime(timein); +% +% Input: +% timein - EGI time format (numerical) +% +% Output: +% timeout - EGI string format time +% +% Example: +% timeValOut = mff_decodetime('2009-04-16T21:52:47.893250-08:00') +% mff_encodetime(timeValOut,'08:00') +% +% timeValOut = mff_decodetime('2009-04-16T21:52:47.893750-08:00') +% mff_encodetime(timeValOut,'08:00') % issue here + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function timeValOut = mff_encodetime(timeVal, timeZone) + + % remove GMT part + microSec = 0.000000000011525116860866546630859375000; + + % estimate error + tmp = datestr(timeVal, 'yyyy-mm-ddTHH:MM:SS.FFF'); + remain = timeVal-mff_decodetime([tmp '000']); + if remain < 0 + tmp = datestr(timeVal-microSec*1000, 'yyyy-mm-ddTHH:MM:SS.FFF'); + remain = timeVal-mff_decodetime([tmp '000']); + if remain < 0 + error('Negative microseconds'); + end + end + timeValOut = [ tmp sprintf('%.3d', round(remain/microSec/10)*10) timeZone ]; + + +% old code +% millisec = 0.000000000011525116860866546630859375000; +% +% tmp = timeVal/millisec; +% remain = (tmp-floor(tmp))*1000; +% +% timeValOut = [ datestr(timeVal, 'yyyy-mm-ddTHH:MM:SS.FFF') sprintf('%.3d', round(remain,-1)) '-' timeZone ]; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_export.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_export.m new file mode 100644 index 0000000..a3bf22f --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_export.m @@ -0,0 +1,64 @@ +% mff_export - export EEGLAB structure to MFF file. This function calls +% all other function to create MFF structure, export +% events, channels and channel coordinates. +% +% Usage: +% mff_export(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_export(EEG, outputFile) + +matVer = ver('MATLAB'); +if exist('OCTAVE_VERSION', 'builtin') == 0 && datenum(matVer.Date) < 735595 + error('This version of Matlab is too old. Use version 2014a or later'); +end + +% add mff extension if not present +[filePath, fileName] = fileparts( outputFile); +outputFile = fullfile(filePath, [ fileName '.mff' ]); + +% delete folder if it exist +if exist(outputFile) + rmdir(outputFile, 's'); +end + +mff_createmff(outputFile); +if ~isfield(EEG.etc, 'recordingtime') + EEG.etc.recordingtime = now; + EEG.etc.timezone = '00:00'; +end +mff_exportinfo(EEG, outputFile); +mff_exportsubject(EEG, outputFile); +mff_exportinfon(EEG, outputFile,1); +if isfield(EEG.etc, 'info2') + mff_exportinfon(EEG, outputFile, 2); +end +mff_exportsignal(EEG, outputFile); +indtle = mff_exportcategories(EEG, outputFile); +EEG.event(indtle) = []; % remove time locking events +mff_exportevents(EEG, outputFile); +mff_exportcoordinates(EEG, outputFile); +mff_exportsensorlayout(EEG, outputFile); +mff_exportpnsset(EEG, outputFile); +mff_exportepochs(EEG, outputFile); +mff_exportsensorlayout(EEG, outputFile); +disp('Done'); \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportcategories.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportcategories.m new file mode 100644 index 0000000..9bd85f7 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportcategories.m @@ -0,0 +1,127 @@ +% mff_exportcategories - export MFF EEG event from EEGLAB structure to +% 'categories.xml' file +% Usage: +% mff_exportcategories(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function indtle = mff_exportcategories(EEG, mffFile) + +indtle = []; % time locking event indices +if EEG.trials == 1 + return; +end + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create a factory. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +categoriesRType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Categories')); +if mfffactory.createResourceAtURI(fullfile(mffFile, 'categories.xml'), categoriesRType) + fprintf('categories.xml file created successfully\n'); +else + fprintf('categories.xml ressource already exist, overwriting\n'); +end +catsResource = mfffactory.openResourceAtURI( fullfile(mffFile, 'categories.xml'), categoriesRType); + +% find time-locking events +% ------------------------ +events = EEG.event; +eventlat = abs(eeg_point2lat( [ events.latency ], [ events.epoch ], EEG.srate, [EEG.xmin EEG.xmax])); +indtle = find(eventlat == 0); +if length(indtle) < EEG.trials + indtle = find(eventlat < 0.02); + if length(indtle) ~= EEG.trials + if isfield(EEG.event, 'begintime') + indtle = find(cellfun(@isempty, { EEG.event.begintime })); + if length(indtle) ~= EEG.trials + disp('WARNING: NOT THE RIGHT NUMBER OF TIME-LOCKING EVENTS'); + end + end + end +end + +events = events(indtle); +uniqueType = unique( { events.type } ); +jCatList = javaObject('java.util.ArrayList'); +epochLen = []; +for iType = 1:length(uniqueType) + trials = strmatch( uniqueType{iType}, { events.type }, 'exact'); % get time locking events + + catObj = javaObject('com.egi.services.mff.api.Category'); + catObj.setName( events(trials(1)).type ); + jList = javaObject('java.util.ArrayList'); + for iTrial = 1:length(trials) + segmentObj = javaObject('com.egi.services.mff.api.Segment'); + epoch = events(trials(iTrial)).epoch; + + segmentObj.setName( events(trials(iTrial)).type ); + segmentObj.setBeginTime( round((epoch-1)*EEG.pnts/round(EEG.srate)*1000000) ); + segmentObj.setEndTime( round((epoch )*EEG.pnts/round(EEG.srate)*1000000) ); + segmentObj.setEventBegin( round((events(trials(iTrial)).latency-1)/round(EEG.srate)*1000000) ); + if isfield(events(trials(iTrial)), 'duration') && ~isempty(events(trials(iTrial)).duration) + duration = events(trials(iTrial)).duration; + else duration = 0; + end + segmentObj.setEventEnd( round((events(trials(iTrial)).latency-1+duration)/round(EEG.srate)*1000000) ); + if isfield(events, 'status') + segmentObj.setStatus( events(trials(iTrial)).status ); + end + if isfield(events, 'mffkeysbackup') + % if additional keys are present -> average (not sure this heuristic is always correct) + segmentObj.setName( 'Average' ); + + if ~isempty(events(trials(iTrial)).mffkeysbackup) + jListKeys = javaObject('java.util.ArrayList'); + tmpKeys = eval(events(trials(iTrial)).mffkeysbackup); + for iKey = 1:length(tmpKeys); + keyObj = javaObject('com.egi.services.mff.api.Key'); + keyObj.setCode(tmpKeys(iKey).code); + keyObj.setData(tmpKeys(iKey).data); + keyObj.setDataType(tmpKeys(iKey).datatype); + keyObj.setDescription(tmpKeys(iKey).description); + jListKeys.add(keyObj); + end + segmentObj.setKeys(jListKeys); + end + end + + % check epoch length + epochLenTmp = segmentObj.getEndTime() - segmentObj.getBeginTime(); + if isempty(epochLen) + epochLen = epochLenTmp; + elseif epochLen ~= epochLenTmp + error('Epoch length export error') + end + + jList.add(segmentObj); + end + catObj.setSegments(jList); + jCatList.add(catObj); +end + +catsResource.setCategories(jCatList); +catsResource.saveResource(); diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportcoordinates.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportcoordinates.m new file mode 100644 index 0000000..f3bac5a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportcoordinates.m @@ -0,0 +1,117 @@ +% mff_exportcoordinates - export MFF 'coordinates.xml' file from EEGLAB structure +% +% Usage: +% mff_exportcoordinates(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportcoordinates(EEG, mffFile) + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% rotate back (need all the channels) +EEG=pop_chanedit(EEG, 'forcelocs',[],'nosedir','-Y'); + +% remove PNS channels +if ~isempty(EEG.chanlocs) && isfield(EEG.chanlocs, 'type') + allTypes = { EEG.chanlocs.type }; + allTypes = cellfun(@(x)num2str(x), allTypes, 'uniformoutput', false); + pnsChans = strmatch('pns', lower(allTypes), 'exact')'; + EEG.chanlocs(pnsChans) = []; +end + +if isempty(EEG.chanlocs) || ~isfield(EEG.chanlocs(1), 'X') || isempty(EEG.chanlocs(1).X) + return; +end +[~, ~, chanlocs]= eeg_checkchanlocs( EEG.chanlocs, EEG.chaninfo); + +% create a factory +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +% Note that 3 is the value associated with the event track resource type +fileName = 'coordinates.xml'; +coordinatefilename = fullfile(mffFile, fileName); +coordinatetype = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Coordinates')); +if mfffactory.createResourceAtURI(coordinatefilename, coordinatetype) + disp('Success at creating the coordinate file'); +else + disp('File already exist, cannot create coordinate file'); +end + +fprintf('Exporting %d coordinate...\n', length(chanlocs)); +coordinateObj = mfffactory.openResourceAtURI(coordinatefilename, coordinatetype); + +layoutObj = javaObject('com.egi.services.mff.api.SensorLayout'); +layoutObj.setName('Exported from EEGLAB'); + +jList = javaObject('java.util.ArrayList'); + +% average radius is 10 in sherical coordiantes +if ~isempty(chanlocs(1).X) + averageRadius = mean( [ EEG.chanlocs.sph_radius ]); + if abs(averageRadius -10) < 2, averageRadius = 10; end +end + +for iSensor = 1:length(chanlocs) + sensorObj = javaObject('com.egi.services.mff.api.Sensor'); + + sensorObj.setNumber(iSensor); + if isfield(chanlocs, 'description') && ~isempty(chanlocs(iSensor).description) + sensorObj.setName(chanlocs(iSensor).description); + else + sensorObj.setName(chanlocs(iSensor).labels); + end + if ~isempty(chanlocs(iSensor).X) + sensorObj.setX(chanlocs(iSensor).X*10/averageRadius); % assumes 0,0,0 at the center of the head + sensorObj.setY(chanlocs(iSensor).Y*10/averageRadius); + sensorObj.setZ(chanlocs(iSensor).Z*10/averageRadius); + end + if isfield(chanlocs, 'identifier') && ~isempty(chanlocs(iSensor).identifier) && (chanlocs(iSensor).identifier ~= 0) + sensorObj.setIdentifier(chanlocs(iSensor).identifier); + end + if ~isfield(chanlocs, 'type') || isempty(chanlocs(iSensor).type) + chanlocs(iSensor).type = 0; + end + switch chanlocs(iSensor).type + case 'EEG', sensorObj.setType(0); + case 'FID', sensorObj.setType(2); + end + if strcmpi(chanlocs(iSensor).labels, EEG.ref) + sensorObj.setType(1); + end + jList.add(sensorObj); + +end +layoutObj.setSensors(jList); +coordinateObj.setSensorLayout(layoutObj); +coordinateObj.setAcquisitionMethod('Exported from EEGLAB'); +try + coordinateObj.setAcquisitionTime(mff_encodetime(EEG.etc.timezone, EEG.etc.recordingtime)); +catch + coordinateObj.setAcquisitionTime('2006-01-01T00:00:00.000000-08:00'); +end +coordinateObj.saveResource(); + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportepochs.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportepochs.m new file mode 100644 index 0000000..69a7d2a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportepochs.m @@ -0,0 +1,109 @@ +% mff_exportepochs - export MFF 'epochs.xml' file from EEGLAB structure +% +% Usage: +% mff_exportepochs(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportepochs(EEG, mffFile) + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create a factory. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +%% create Segment to load time +epochsRType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Epochs')); +catURI = [ mffFile filesep 'epochs.xml' ]; +jList = javaObject('java.util.ArrayList'); +if mfffactory.createResourceAtURI(catURI, epochsRType) + fprintf('Epochs.xml file created successfully\n'); +else + fprintf('Epochs.xml ressource already exist, overwriting\n'); +end +epochResource = mfffactorydelegate.openResourceAtURI(catURI, epochsRType); + +% continuous data: export each portion of data +% epoched data: eport each epoch + +% get offsets +durations = []; +if EEG.trials == 1 + samples = []; + boundaryEvent = []; + if ~isempty(EEG.event) && isfield(EEG.event, 'type') && isstr(EEG.event(1).type) + boundaryEvent = strmatch( 'boundary', { EEG.event.type }, 'exact'); + samples = [ EEG.event(boundaryEvent).latency ]; + end + samples = [ 0 samples EEG.pnts ]; + if isfield(EEG.event, 'duration') && ~isempty(boundaryEvent) + durations = { EEG.event(boundaryEvent).duration }; + durations(cellfun(@isempty,durations)) = { 0 }; + durations = [ durations{:} ]; + durations = cumsum(durations); + durations = [0 durations durations(end) ]; + else + durations = zeros(1,length(samples)); + end +else + samples = EEG.pnts*[0:EEG.trials]; + durations = zeros(1,length(samples)); +end + +% write data +block = 1; +warnOnce = false; +epochLen = []; +for iSample = 2:length(samples) + + epochObj = javaObject('com.egi.services.mff.api.Epoch'); + + % latency of block + epochObj.setBeginTime( round((samples(iSample-1)+durations(iSample-1))/round(EEG.srate)*1000000) ); % in microsec + epochObj.setEndTime( round((samples(iSample)+durations(iSample-1))/round(EEG.srate)*1000000) ); + + % check epoch length + epochLenTmp = epochObj.getBeginTime() - epochObj.getEndTime(); + if isempty(epochLen) + epochLen = epochLenTmp; + elseif epochLen ~= epochLenTmp + if warnOnce + disp('Warning: epoch length differ (normal for continuous data)'); + warnOnce = true; + end + end + + % length of block + blockinc = ceil((samples(iSample)-samples(iSample-1))/65536); + epochObj.setFirstBlock(block); + epochObj.setLastBlock(block+blockinc-1); + block = block+blockinc; + + jList.add(epochObj); +end + +epochResource.setEpochs(jList); +epochResource.saveResource(); + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportevents.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportevents.m new file mode 100644 index 0000000..1a0c128 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportevents.m @@ -0,0 +1,153 @@ +% mff_exportevents - export MFF EEG event from EEGLAB structure to +% 'Events_exported_from_EEGLAB.xml' file +% Usage: +% mff_exportevents(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportevents(EEG, mffFile) + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +if isfield(EEG.etc, 'recordingtime') + begTime = EEG.etc.recordingtime; +else + begTime = now; +end +if isfield(EEG.etc, 'timezone') + timeZone = EEG.etc.timezone; +else + timeZone = '00:00'; +end +srate = EEG.srate; + +% create a factory +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% determine the number of files +events = EEG.event; +if isfield(EEG.event, 'name') + allNames = { events.name }; + allNames = cellfun(@num2str, allNames, 'UniformOutput', false); + uniqueNames = unique( allNames ); +else + uniqueNames = { '' }; +end + +tracktype = ''; +for iFile = 1:length(uniqueNames) + + % Create Signal object and read in event track file. + fileName = 'Events_exported_from_EEGLAB.xml'; + if length(uniqueNames) > 1 + eventtrackfilename = fullfile(mffFile, [ fileName(1:end-4) '_' num2str(iFile) '.xml' ]); + indEvents = strmatch( uniqueNames{iFile}, allNames, 'exact'); + if isfield(events, 'tracktype') + tracktype = events(indEvents(1)).tracktype; + end + else + eventtrackfilename = fullfile(mffFile, fileName); + if isfield(events, 'tracktype') + tracktype = events(1).tracktype; + end + indEvents = 1:length(events); + end + + if ~all(cellfun(@(x)isequal(x, 'boundary'), {events(indEvents).type})) + eventtracktype = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_EventTrack')); + if mfffactory.createResourceAtURI(eventtrackfilename, eventtracktype) + disp('Success at creating the event file'); + else + disp('Could not create event file'); + end + + fprintf('Exporting %d events...\n', length(events)); + eventtrackObj = mfffactory.openResourceAtURI(eventtrackfilename, eventtracktype); + if isfield(events, 'name') && ~isempty(uniqueNames{iFile}) + eventtrackObj.setName(events(1).name); + end + if isfield(events, 'tracktype') && ~isempty(tracktype) + eventtrackObj.setTrackType(tracktype); + end + + jList = javaObject('java.util.ArrayList'); + addLatency = 0; + multiplier = 24*60*60*srate; + keyWarning = true; + for iEvent = 1:length(events) + if strcmpi(events(iEvent).type, 'boundary') % do not export boundary events + addLatency = addLatency + events(iEvent).duration; + else + if ~isfield(events, 'name') || strcmpi(events(iEvent).name, uniqueNames{iFile}) + eventObj = javaObject('com.egi.services.mff.api.Event'); + + % Get keys for event and display key codes + if isfield(events(iEvent), 'code') + eventObj.setCode( events(iEvent).code ); + else + eventObj.setCode(num2str(events(iEvent).type)); + end + if isfield(events(iEvent), 'description'), eventObj.setDescription( events(iEvent).description ); end + if isfield(events(iEvent), 'duration' ), eventObj.setDuration( events(iEvent).duration ); end + if isfield(events(iEvent), 'label'), eventObj.setLabel( events(iEvent).label ); end + if isfield(events(iEvent), 'sourcedevice'), eventObj.setSourceDevice(events(iEvent).sourcedevice ); end + + if isfield(events, 'mffkeysbackup') && ~isempty(events(iEvent).mffkeysbackup) + jListKeys = javaObject('java.util.ArrayList'); + tmpmffkeysbackup = events(iEvent).mffkeysbackup; + tmpmffkeysbackup(tmpmffkeysbackup == 10) = ' '; % remove carriage return + tmpKeys = eval(tmpmffkeysbackup); + for iKey = 1:length(tmpKeys); + keyObj = javaObject('com.egi.services.mff.api.Key'); + keyObj.setCode(tmpKeys(iKey).code); + keyObj.setData(tmpKeys(iKey).data); + keyObj.setDataType(tmpKeys(iKey).datatype); + keyObj.setDescription(tmpKeys(iKey).description); + jListKeys.add(keyObj); + end + eventObj.setKeys(jListKeys); + elseif keyWarning + disp('Warning: no MFF backup key structure found - MFF keys not exported'); + disp(' import keys when loading the data to be able to export them'); + keyWarning = false; + end + + realLatency = (events(iEvent).latency + addLatency)/multiplier+begTime; + tmp = mff_encodetime(realLatency, timeZone); + if isfield(events(iEvent), 'begintime') + if ~isequal(events(iEvent).begintime, tmp) && ~isempty(events(iEvent).begintime) + fprintf('Note: exported event time %d differ from original one %s vs %s\n', iEvent, events(iEvent).begintime, tmp); + end + end + eventObj.setBeginTime(mff_encodetime(realLatency, timeZone)); + + jList.add(eventObj); + end + end + end + eventtrackObj.setEvents(jList); + eventtrackObj.saveResource(); + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportinfo.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportinfo.m new file mode 100644 index 0000000..33f3883 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportinfo.m @@ -0,0 +1,50 @@ +% mff_exportinfo - export MFF 'info.xml' file from EEGLAB structure +% +% Usage: +% mff_exportinfo(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function EEG = mff_exportinfo(EEG, mffFile) + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +infoType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Info')); +if mfffactory.createResourceAtURI(fullfile(mffFile, 'info.xml'), infoType) + fprintf('Info.xml file created successfully\n'); +else + fprintf('Info.xml ressource already exist, overwriting\n'); +end +info = mfffactory.openResourceAtURI( fullfile(mffFile, 'info.xml'), infoType); + +info.setMFFVersion(3); +if ~isfield(EEG.etc, 'recordingtime') + error('Unknow record time'); +end +begTime = mff_encodetime(EEG.etc.recordingtime, EEG.etc.timezone); +info.setRecordTime(begTime); +info.saveResource(); diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportinfon.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportinfon.m new file mode 100644 index 0000000..4c5d7a1 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportinfon.m @@ -0,0 +1,81 @@ +% mff_exportinfo - export MFF 'info.xml' file from EEGLAB structure +% +% Usage: +% mff_exportinfon(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportinfon(EEG, mffFile, index) + +infon = [ 'info' int2str(index) ]; + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +infoType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_InfoN')); +if mfffactory.createResourceAtURI(fullfile(mffFile, [infon '.xml']), infoType) + fprintf('%s.xml file created successfully\n', infon); +else + fprintf('%s.xml ressource already exist, overwriting\n', infon); +end + +info = mfffactory.openResourceAtURI( fullfile(mffFile, [infon '.xml']), infoType); + +% set file type 1 or 2 +tmpInfo = []; +if isfield(EEG.etc, infon ) + if isfield(EEG.etc.(infon), 'infoNFileTypeInformation') + tmpInfo = EEG.etc.(infon).infoNFileTypeInformation; + end +end +if index == 1 && ~isfield(tmpInfo, 'pnsSetName') + tmp = javaMethod('valueOf', 'com.egi.services.mff.api.InfoN$InfoNFileType', 'kEEG'); + tmp2 = javaObject('com.egi.services.mff.api.InfoNFileTypeEEG'); +else + tmp = javaMethod('valueOf', 'com.egi.services.mff.api.InfoN$InfoNFileType', 'kPNSData'); + tmp2 = javaObject('com.egi.services.mff.api.InfoNFileTypePNSData'); +end + +info.setInfoNFileType(tmp); +if isfield(EEG.etc, infon ) + if isfield(EEG.etc.(infon), 'infoNFileTypeInformation') + tmpInfo = EEG.etc.(infon).infoNFileTypeInformation; + if isfield(tmpInfo, 'montageName'), tmp2.setMontageName(tmpInfo.montageName); end + if isfield(tmpInfo, 'sensorLayoutName'), tmp2.setSensorLayoutName(tmpInfo.sensorLayoutName); end + if isfield(tmpInfo, 'referenceScheme'), tmp2.setReferenceScheme(tmpInfo.referenceScheme); end + if isfield(tmpInfo, 'pnsSetName'), tmp2.setPNSSetName(tmpInfo.pnsSetName); end + else + if index == 1 + tmp2.setMontageName('EEGLAB exported montage'); + else + tmp2.setPNSSetName('EEGLAB exported PNS channels'); + end + end +else + tmp2.setMontageName('EEGLAB exported montage'); +end +info.setInfoNFileTypeInformation(tmp2); +info.saveResource(); diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportpnsset.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportpnsset.m new file mode 100644 index 0000000..8a2cebc --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportpnsset.m @@ -0,0 +1,74 @@ +% mff_exportpnsset - import information from MFF 'pnsSet.xml' file +% +% Usage: +% chaninfo = mff_importpnsset(EEG, mffFile) +% +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportpnsset(EEG, mffFile) + +% find PNS channels +if isempty(EEG.chanlocs), return; end +if ~isfield(EEG.chanlocs, 'type'), return; end +allTypes = { EEG.chanlocs.type }; +allTypes = cellfun(@(x)num2str(x), allTypes, 'uniformoutput', false); +pnsChans = strmatch('pns', lower(allTypes), 'exact')'; +if isempty(pnsChans), return; end + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create an MFFFactory object. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +% Note that 3 is the value associated with the event track resource type. +pnsURI = fullfile(mffFile, 'pnsSet.xml'); +pnsType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_PNSSet')); +if mfffactory.createResourceAtURI(pnsURI, pnsType) + disp('Success at creating the PNS sensor file'); +else + disp('File already exist, not create coordinate file'); +end + +pns = mfffactory.openResourceAtURI(pnsURI, pnsType); + +if ~isempty(pnsChans) + + jList = javaObject('java.util.ArrayList'); + + for iChan = 1:length(pnsChans) + sensorObj = javaObject('com.egi.services.mff.api.PNSSensor'); + sensorObj.setName(EEG.chanlocs(pnsChans(iChan)).labels); + sensorObj.setNumber(iChan); + jList.add(sensorObj); + end + + pns.setPNSSensors(jList); + pns.saveResource(); + +else + + fprintf('Error: could not load the pnsSet.xml resource.\n'); + +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsensorlayout.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsensorlayout.m new file mode 100644 index 0000000..994b613 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsensorlayout.m @@ -0,0 +1,87 @@ +% mff_exportsensorlayout - export information from MFF 'sensorLayout.xml' file +% +% Usage: +% mff_exportsensorlayout(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportsensorlayout(EEG, mffFile) + +if ~isfield(EEG.etc, 'layout') || isempty(EEG.etc.layout) + return; +end + +matStruct = EEG.etc.layout; + +% check for removed channels and update structure +if length(matStruct.sensors) ~= length(EEG.chanlocs) + % different number of channels - scan for removed channels + chanlocs = EEG.chanlocs; + if isempty(chanlocs) || ~isfield(chanlocs, 'type') || isempty(chanlocs(1).type) + currenChans = 1:size(EEG.data,1); + else + % find EEG channels and convert them + eegChans = cellfun(@(x)isequal(lower(x), 'eeg'), {chanlocs.type}); + try + currenChans = cellfun(@(x)str2num(x(2:end)), {chanlocs(eegChans).labels}); + catch + % this can fail if EGI channels are not E1, E2, etc... + currenChans = 1:size(EEG.data,1); + end + end + + for iSens = 1:length(matStruct.sensors) + if ismember(matStruct.sensors(iSens).number, currenChans) + matStruct.sensors(iSens).type = 0; + elseif matStruct.sensors(iSens).type == 0 + matStruct.sensors(iSens).type = 2; + end + end + +end + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create an MFFFactory object. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +sLayoutURI = fullfile(mffFile, 'sensorLayout.xml'); +sensorLayoutType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_SensorLayout')); +mfffactory.createResourceAtURI(sLayoutURI, sensorLayoutType); +layoutObj = mfffactory.openResourceAtURI(sLayoutURI, sensorLayoutType); + +variables = ... + { ... + 'Name' 'char' {}; + 'OriginalLayout' 'char' {} ; + 'Sensors' 'array' { 'Name' 'char' {}; 'Number' 'real' {}; 'X' 'real' {}; 'Y' 'real' {}; 'Z' 'real' {}; 'Type' 'real' {}; 'Identifier' 'real' {} }; + 'Threads' 'array' { 'First' 'real' {}; 'Second' 'real' {} }; + 'TilingSets' 'array' { '' 'array' {} }; + 'Neighbors' 'array' { 'ChannelNumber' 'real' {}; 'Neighbors' 'array' { } } }; + +layout = []; +layoutObj = mff_setobj(layoutObj, matStruct, variables); +layoutObj.saveResource(); + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsignal.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsignal.m new file mode 100644 index 0000000..45eefc9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsignal.m @@ -0,0 +1,131 @@ +% mff_exportsignal - export MFF EEG data from EEGLAB structure into +% 'signal1.bin' +% +% Usage: +% mff_exportsignal(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportsignal(EEG, mffFile) + +% find PNS channels +if ~isempty(EEG.chanlocs) && isfield(EEG.chanlocs, 'type') + allTypes = { EEG.chanlocs.type }; + allTypes = cellfun(@(x)num2str(x), allTypes, 'uniformoutput', false); + pnsChans = strmatch('pns', lower(allTypes), 'exact')'; +else + pnsChans = []; +end + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create a factory. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); +binfilename = { [mffFile filesep 'signal1.bin'] [mffFile filesep 'signal2.bin'] }; +if isempty(pnsChans) + binfilename(2) = []; + chanRange{1} = [1:EEG.nbchan]; +else + chanRange{1} = setdiff([1:EEG.nbchan], pnsChans); + chanRange{2} = pnsChans; +end + +% PNS signal only -> move to file signal1.bin +if isempty(chanRange{1}) + chanRange = { chanRange{2} [] }; + binfilename(2) = []; +end + +% Create Signal object and read in signal1.bin file. +signalresourcetype = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Signal')); + +for iFile = 1:length(binfilename) + if mfffactory.createResourceAtURI(binfilename{iFile}, signalresourcetype) + fprintf('Signal binary file created successfully\n'); + else + fprintf('Signal binary ressource already exist, overwriting\n'); + end + + signalResource = mfffactory.openResourceAtURI(binfilename{iFile}, signalresourcetype); + jList = javaObject('java.util.ArrayList'); + if round(EEG.srate) ~= EEG.srate + fprintf('Warning: sampling frequency need to be rounded from %1.2f to %1.0f\n', EEG.srate, round(EEG.srate)); + end + if ~isempty(signalResource) + + % continuous data: export each portion of data + % epoched data: eport each epoch + nChans = length(chanRange{iFile}); + + % get offsets + if EEG.trials == 1 + samples = []; + if ~isempty(EEG.event) && isfield(EEG.event, 'type') && isstr(EEG.event(1).type) + boundaryEvent = strmatch( 'boundary', { EEG.event.type }, 'exact'); + samples = [ EEG.event(boundaryEvent).latency ]; + end + samples = round([ 0 samples EEG.pnts ]); % in rare cases, not rounding generates numerical instabilities (file MMVTD_Continuous_EEG.mff) + else + samples = EEG.pnts*[0:EEG.trials]; + end + + % add additional blocks if the data block is too large + newSamples = []; + for iSample = 1:length(samples)-1 + len = samples(iSample+1)-samples(iSample); + tmpSamples = 0:65536:len; + newSamples = [ newSamples samples(iSample)+tmpSamples ]; + end + samples = [newSamples samples(end)]; + + % write data + for iSample = 2:length(samples) + + newBlock = javaObject('com.egi.services.mff.api.SignalBlock'); + + newBlock.version = 1; + newBlock.dataBlockSize = (samples(iSample)-samples(iSample-1))*nChans*4; + %fprintf('Data block size: %d\n', newBlock.dataBlockSize); + newBlock.numberOfSignals = nChans; + newBlock.headerSize = 20+nChans*8; % this was calculated heuristically + + newBlock.offsets = [0:nChans-1]'*(samples(iSample)-samples(iSample-1))*4; % int32 + newBlock.signalDepth = int32(ones(nChans, 1)*32); % int32 or 4 bytes + newBlock.signalFrequency = int32(ones(nChans, 1)*round(EEG.srate)); % int32 + + data = single(EEG.data(chanRange{iFile}, samples(iSample-1)+1:samples(iSample)))'; + if ~isempty(data) + newBlock.data = typecast(data(:), 'int8'); % LITTLE ENDIAN HERE - BIG ENDIAN MIGHT BE A PROBLEM + end + jList.add(newBlock); + end + signalResource.setNumberOfBlocks(length(samples)-1); + signalResource.setSignalBlocks(jList); + signalResource.saveResource(); + + else + error('Error: Can not open the signal resource.\n'); + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsubject.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsubject.m new file mode 100644 index 0000000..93be71f --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_exportsubject.m @@ -0,0 +1,49 @@ +% mff_exportsubject - export subject information into MFF ressources +% +% Usage: +% mff_exportsubject(EEG, mffFile); +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_exportsubject(EEG, mffFile) + +if ~isfield(EEG.etc, 'subject') || isempty(EEG.etc.subject) + return; +end + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create an MFFFactory object. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +sURI = fullfile(mffFile, 'subject.xml'); +objectType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Subject')); +mfffactory.createResourceAtURI(sURI, objectType); +sObject = mfffactory.openResourceAtURI(sURI, objectType); + +variables = { 'Fields' 'array' { 'Name' 'char' {}; 'Data' 'char' {}; 'DataType' 'char' {} } }; + +sObject = mff_setobj(sObject, EEG.etc.subject, variables); +sObject.saveResource(); diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_data.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_data.m new file mode 100644 index 0000000..7d6fa0f --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_data.m @@ -0,0 +1,44 @@ +% mff_fileio_read_data() - import MFF data +% +% Usage: +% >> dat = mff_fileio_read_header(filename); +% +% Inputs: +% filename - [string] file name +% +% Optional inputs: +% 'header' - FILEIO structure header +% +% Outputs: +% dat - data over the specified range + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function dat = mff_fileio_read_data(filename, varargin) + +if nargin < 1 + help mff_fileio_read_data; + return; +end + +header = ft_getopt(varargin, 'header'); + +if isempty(header) + header = mff_fileio_read_header(filename); +end + +dat = header.orig.data; + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_event.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_event.m new file mode 100644 index 0000000..f5ae41f --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_event.m @@ -0,0 +1,52 @@ +% mff_fileio_read_event() - import MFF events +% +% Usage: +% >> event = mff_fileio_read_event(filename, ...); +% +% Inputs: +% filename - [string] file name +% +% Optional inputs: +% 'header' - FILEIO structure header +% +% Outputs: +% event - FILEIO toolbox event structure + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function event = mff_fileio_read_event(filename, varargin) + +if nargin < 1 + help mff_fileio_read_event; + return; +end + +hdr = ft_getopt(varargin, 'header'); + +if isempty(hdr) + hdr = mff_fileio_read_header(filename); +end + +curPath = pwd; +p = fileparts(which('ft_read_header')); +cd(fullfile(p, 'private')); + +% bypass the last part where time-locking events are added +hdr.orig.trials = 1; + +event = read_eeglabevent( [], 'header', hdr, varargin{:} ); + +cd(curPath); diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_header.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_header.m new file mode 100644 index 0000000..722c4e4 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_read_header.m @@ -0,0 +1,41 @@ +% mff_fileio_read_header() - import MFF header +% +% Usage: +% >> header = read_eeglabheader(filename); +% +% Inputs: +% filename - [string] file name +% +% Outputs: +% header - FILEIO toolbox type structure + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function header = mff_fileio_read_header(mffFile) + +if nargin < 1 + help mff_fileio_read_header; + return; +end + +% import basic information +tmp = mff_import(mffFile); +curPath = pwd; +p = fileparts(which('ft_read_header')); +cd(fullfile(p, 'private')); +header = read_eeglabheader( tmp ); +cd(curPath); +header.orig = tmp; \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_write.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_write.m new file mode 100644 index 0000000..a9322ee --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_fileio_write.m @@ -0,0 +1,58 @@ +% mff_fileio_write - export Fieldtrip structures to MFF file +% +% Usage: +% mff_fileio_write(mffFile, header, data, event); +% +% Inputs: +% mffFile - [string] MFF file name +% header - fieldtrip data header +% data - fieldtrip raw data +% event - fieldtrip event structure (optional) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mff_fileio_write(filename, hdr, data, evt) + +if exist('pop_fileio') + a = dir(which('pop_fileio.m')); + b = dir(which('pop_fileio2.m')); + if isempty(a) || isempty(b) || a.bytes ~= b.bytes + fprintf([ '-----------------------------------------------------------------------------\n' ... + 'WARNING: pop_fileio.m and pop_fileio2.m differ; likely you are using\n' ... + ' an old version of EEGLAB; The importer will try to import data using\n' ... + ' the pop_fileio.m function, and revert to pop_fileio2.m if it crashes\n' ... + '-----------------------------------------------------------------------------\n' ]); + end + try + EEG = pop_fileio(hdr, data, evt); % maybe the wrong version? + catch + EEG = pop_fileio2(hdr, data, evt); % backup function included here + end +else + EEG = pop_fileio2(hdr, data, evt); % backup function included here +end + +if isfield(hdr, 'orig') + if isfield(hdr.orig, 'etc') + EEG.etc = hdr.orig.etc; + end +end + +mff_export(EEG, filename); + +% add code for eeg_emptyset +% add code for pop_fileio +% add code for finputcheck diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_getobj.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_getobj.m new file mode 100644 index 0000000..af3d123 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_getobj.m @@ -0,0 +1,60 @@ +% mff_getobj - import information from MFF object +% +% Usage: +% values = mff_setobj(mffObj, structure); +% +% Inputs: +% mffObj - MFF object of any type +% structure - description of variables to assign +% +% Outputs: +% values - values for the structure +% +% Note: this function may take any MFF object structure + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function matStruct = mff_getobj(mffObj, variables) + +for iVar = 1:size(variables,1) + varName = variables{iVar,1}; + varType = variables{iVar,2}; + varArray = variables{iVar,3}; + + if ~isequal(varType, 'array') + eval( [ 'matStruct.(lower(varName)) = ' varType '(mffObj.get' varName '());' ] ); + else + if isempty(varName) + for iArray = 1:mffObj.size + matStruct.value(iArray) = mffObj.get(iArray-1); + end + else + eval( [ 'tmparray = mffObj.get' varName '();' ] ); + if ~isempty(tmparray) + for iArray = 1:tmparray.size + tmpval = tmparray.get(iArray-1); + if ~isempty(varArray) + matStruct.(lower(varName))(iArray) = mff_getobj(tmpval, varArray); + else + matStruct.(lower(varName))(iArray) = tmpval; + end + end + else + matStruct.(lower(varName)) = []; + end + end + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_import.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_import.m new file mode 100644 index 0000000..9ced221 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_import.m @@ -0,0 +1,386 @@ +% mff_import - import MFF file to EEGLAB structure. This function calls +% all other function to import MFF xml files, including +% events, channels and channel coordinates. +% +% Usage: +% EEG = mff_import(mffFile); +% +% Input: +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) +% Output: +% EEG - EEGLAB structure +% data - channels x sample data +% events - events +% chanlocs - channel locations +% mff - misceleneous event information +% +% Note: This function imports the "code" MFF event information into the +% EEGLAB type field. If you want to use other MFF event information +% extract epoch, use the pop_importmff function. + +% This is the list of known types +% kMFF_RT_Unknown +% kMFF_RT_Any +% kMFF_RT_MFFFile +% kMFF_RT_Signal +% kMFF_RT_EventTrack +% kMFF_RT_Epochs +% kMFF_RT_Subject +% kMFF_RT_History +% kMFF_RT_Info +% kMFF_RT_InfoN +% kMFF_RT_Categories +% kMFF_RT_JTFCategories +% kMFF_RT_SensorLayout +% kMFF_RT_Coordinates +% kMFF_RT_Photogrammetry^ +% kMFF_RT_PNSSet +% kMFF_RT_MovieSyncs +% kMFF_RT_Fields +% kMFF_RT_Notes +% kMFF_RT_Montage +% kMFF_RT_DipoleSet +% kMFF_RT_PhoticStim +% kMFF_RT_GTENModulationConfiguratonFile +% kMFF_RT_GeometryEGIG +% kMFF_RT_AnatomyEGIA + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function [EEG, data, events, chanlocs, mff] = mff_import(mffFile) + +%matVer = ver('MATLAB'); +%if datenum(matVer.Date) < 735595 % Matlab 2014a +% error('This version of Matlab is too old. Use version 2014a or later'); +%end + +if nargin < 1 + help mff_import; + return; +end + +% add full path if possible +mffPath = fileparts(mffFile); +if isempty(mffPath) + mffFile = fullfile(pwd, mffFile); +elseif exist(fullfile(pwd, mffFile)) + mffFile = fullfile(pwd, mffFile); +end + +% import data +[floatData, allDataSize, srate, nchans] = mff_importsignal(mffFile); + +% aggregate all blocks +npns = nchans(2); +nChannels = size(floatData{1}, 1); +blockSamples = cellfun(@(x)size(x,2), floatData); +if ~isequal(allDataSize/nChannels/4, blockSamples) && ... + ~isequal(allDataSize/(nChannels+1)/4, blockSamples) % sometimes an empty PNS channel is removed + error('Block sample size problem'); +end +blockSamples = [0 cumsum(blockSamples)]; +floatData = [ floatData{:} ]; + +if exist('eeg_emptyset.m', 'file') + EEG = eeg_emptyset; +else + EEG = []; +end +[~, EEG.setname] = fileparts(mffFile); +EEG.nbchan = double(nChannels); +EEG.data = floatData; +EEG.trials = 1; +EEG.srate = double(srate(1)); +EEG.pnts = size(EEG.data,2); +EEG.xmin = 0; +EEG.xmax = 1; +if exist('eeg_checkset.m', 'file') && exist('eeglab_options.m', 'file') + EEG = eeg_checkset(EEG); +end + +% scale signal with calibration values if necessary +disp('Make sure you to use the MFF ressource path name not the relative path (crash often related to that issue) ******'); +info1 = mff_importinfon(mffFile, 1); +info2 = mff_importinfon(mffFile, 2); +if isfield(info1, 'calibration') + disp('Calibrating data...'); + for iChan = 1:length(info1.calibration) + floatData(iChan,:,:) = floatData(iChan,:,:)*info1.calibration(iChan); + end +end +if isfield(info2, 'calibration') + disp('Calibrating data...'); + for iChan = 1:length(info2.calibration) + floatData(end-length(info2.calibration)+iChan,:,:) = floatData(end-length(info2.calibration)+iChan,:,:)*info2.calibration(iChan); + end +end +info1.calibration = []; +info2.calibration = []; +EEG.etc.info1 = info1; +if ~isempty(info2) && length(fieldnames(info2)) > 1 + EEG.etc.info2 = info2; % more than just calibration +end + +% import info file +info = mff_importinfo(mffFile); +layout = mff_importsensorlayout(mffFile); +subject = mff_importsubject(mffFile); +begtime = info.recordtimematlab; +EEG.etc.timezone = info.timezone; +EEG.etc.mffversion = info.version; +EEG.etc.layout = layout; +EEG.etc.subject = subject; +if ~isempty(subject) + subjectFields = { subject.fields.name }; + ind = strmatch('localIdentifier', subjectFields, 'exact'); + if ~isempty(ind) + EEG.subject = subject.fields(ind).data; + end +end + +% import coordinate layout +[EEG.chanlocs, EEG.ref] = mff_importcoordinates(mffFile); +if iscell(EEG.ref) + EEG.ref = sprintf('%s ', EEG.ref{:}); +end +EEG.urchanlocs = EEG.chanlocs; +pnschans = mff_importpnsset(mffFile); +if length(pnschans) ~= npns && ~(length(pnschans) == size(EEG.data,1) && isempty(EEG.chanlocs)) + if length(pnschans) == npns+1 + % last PNS status channel missing because blank and removed by mff_importsignal + pnschans(end) = []; + else + error('Number of PNS raw data channels is not equal to number of PNS channels'); + end +end +if ~isempty(EEG.chanlocs) + if exist('eeg_checkchanlocs.m', 'file') + EEG = eeg_checkchanlocs(EEG); % put fiducials in chanfinfo + nChannels = length(EEG.chanlocs); + end +end +if ~isempty(pnschans) + if isempty(EEG.chanlocs) && length(pnschans) == size(EEG.data,1) + % Only PNS channels + EEG.chanlocs = pnschans; + else + if isempty(EEG.chanlocs) + for iChan = 1:nChannels + EEG.chanlocs(end+1).labels = [ 'E' num2str(iChan) ]; + EEG.chanlocs(end ).type = 'EEG'; + end + end + for iChan = 1:npns + EEG.chanlocs(end+1).labels = pnschans(iChan).labels; + EEG.chanlocs(end ).type = pnschans(iChan).type; + end + end +end +if exist('pop_chanedit', 'file') + EEG=pop_chanedit(EEG, 'forcelocs',[],'nosedir','+Y'); +else + EEG.chaninfo.nosedir = '+Y'; +end + +EEG.etc.recordingtime = begtime; + +% import events +[EEG.event, newtimezone] = mff_importevents(mffFile, begtime, EEG.srate); +if ~isequal(EEG.etc.timezone, newtimezone) && ~isempty(newtimezone) + error('Time zone issue'); +end +%mff_exportevents(EEG.event, 'test', EEG.etc.recordingtime, EEG.etc.timezone, EEG.srate); + +% import continuous or epoch data +cont = mff_importepochs(mffFile, info.version); + +% import continuous or epoch data +cat = mff_importcategories(mffFile, info.version); + +% calculate epoch length +allEpochLen = [ [cont.endtime] - [cont.begintime] ]; +if length(unique(allEpochLen)) > 1 + fprintf([ 'IMPORTANT Warning: cannot import trials of different length\n' ... + ' importing as segmented data (trial/category info will be lost)\n' ] ); + cat = []; +end + +if ~isempty(cat) + if sum(cellfun(@length, { cat.trials })) ~= length(cont) + error('The number of "segments" do not match the number of epochs'); + end + + % check time consistency + iTrial = ones(1, length(cat)); + epochLen = cont(1).endtime-cont(1).begintime; + EEG.xmin = -(cat(1).trials(1).eventbegin-cat(1).trials(1).begintime)/1000000; + epochDiffLat = cell(1, length(cat)); + EEG.pnts = round(epochLen/1000000*EEG.srate); + lastOriEventIndex = length(EEG.event); + + % recorting categories + catCont = []; + for iCat = 1:length(cat) + catContTmp = cat(iCat).trials; + [catContTmp.name] = deal(cat(iCat).name); + try + catCont = [ catCont catContTmp ]; + catch + fieldsTmp = fieldnames(catContTmp); + for iCount = 1:length(catContTmp) + for iField = 1:length(fieldsTmp) + catCont(end+1).(fieldsTmp{iField}) = catContTmp(iCount).(fieldsTmp{iField}); + end + end + end + end + [tmp, indices] = sort([catCont.begintime]); + catCont = catCont(indices); + + for iBound = 1:length(cont) % do not add first event + + if catCont(iBound).begintime ~= cont(iBound).begintime + fprintf('Warning: categornies and epoch information does not match for epoch\n', iBound); + end + + % there is a natural jitter of a few millisecond for each time-locking + % event within the uncertainty of the EEG sampling rate + % epochDiffLat{iCat}(end+1) = cat(iCat).trials(iTrial(iCat)-1).eventbegin-cat(iCat).trials(iTrial(iCat)-1).begintime; + if catCont(iBound).eventbegin-catCont(iBound).begintime ~= EEG.xmin + % disp('Time locking event offset'); + end + + % check latency and block consistency + sampleCalculated = (cont(iBound).begintime/1000000)*EEG.srate; + sampleBlock = blockSamples(cont(iBound).firstblock); % this assumes block of size 1 + if abs(sampleCalculated-sampleBlock) > 1e-10 + fprintf('Warning: segment discontinuity (%d samples missing - pause in the recording or bug?)\n', iBound, sampleCalculated-sampleBlock); + end + + % adding new fields to event structure + trial = catCont(iBound); + EEG.event(end+1).type = trial.name; + EEG.event(end).latency = -EEG.xmin*EEG.srate+1+EEG.pnts*(iBound-1); + EEG.event(end).duration = (trial.eventend-trial.eventbegin)/1000000*EEG.srate; % this is sometimes off by 1e-13 + + EEG.event(end).epoch = iBound; + + % copy other fields + trialFields = setdiff(fields(trial), { 'name', 'begintime', 'endtime', 'eventbegin', 'eventend' }); + for iField = 1:length(trialFields) + EEG.event(end).(trialFields{iField}) = trial.(trialFields{iField}); + end + + cont(iBound).samplebeg = cont(iBound).begintime/1000000*EEG.srate; + cont(iBound).sampleend = cont(iBound).endtime/1000000*EEG.srate; + cont(iBound).samplelen = cont(iBound).sampleend - cont(iBound).samplebeg; + + %EEG.event(end).latency = (trial.eventbegin)/1000000*EEG.srate; % this is sometimes off by 1e-13 + %EEG.event(end).duration = (trial.eventend-trial.eventbegin)/1000000*EEG.srate; % this is sometimes off by 1e-13 + end + + % adjust event latencies in case of gaps between segments + if any([cont(2:end).begintime] - [cont(1:end-1).endtime]) + for iEvent = 1:lastOriEventIndex + % find closest sample + inds = find( EEG.event(iEvent).latency > [cont.samplebeg]); + if length(inds) > 1 + correction = (cont(inds(end)).samplebeg - sum([cont(1:inds(end)-1).samplelen])); + if correction + EEG.event(iEvent).latency = EEG.event(iEvent).latency - correction; + end + end + end + end + + %% scan events and assign epoch + for iEvent = 1:length(EEG.event) + newepoch = floor((EEG.event(iEvent).latency+0.000001)/EEG.pnts)+1; % adding 1/1000000 of a sample is necessary to prevent the error below for some files + if ~isempty(EEG.event(iEvent).epoch) && ~(newepoch == EEG.event(iEvent).epoch) + %error(sprintf('Event %d, wong epoch index %d vs %d\n', iEvent, newepoch, EEG.event(iEvent).epoch)); + % This could be a bug in writing the file or a feature + % to fix this, line 275, recompule the latency of the onset of the epoch + % based on the block offset (since the latency of the onset of the epoch is wrong due either + % to a bug or a paus in the recording) then use this information to recompute the event latency + % (subtracting the wrong event begin and adding back the right one) + end + EEG.event(iEvent).epoch = newepoch; + end +else + % add boundary events + discontinuities = 0; + if ~isempty(cont) && cont(1).begintime ~= 0 + error('First discontinuity does not start at time 0'); + end + for iBound = 2:length(cont) % do not add first event + if cont(iBound-1).endtime ~= cont(iBound).begintime + EEG.event(end+1).type = 'boundary'; + eventDuration = cont(iBound).begintime - cont(iBound-1).endtime; % in microseconds + discontinuities = discontinuities + eventDuration; + EEG.event(end).duration = eventDuration/1000000*EEG.srate; % in samples + + sampleCalculated = ((cont(iBound).begintime-discontinuities)/1000000)*EEG.srate; + sampleBlock = blockSamples(cont(iBound).firstblock); % this assumes block of size 1 + if abs(sampleCalculated-sampleBlock) > 1e-10 + fprintf('Warning: segment discontinuity (%d samples missing - pause in the recording or bug?)\n', sampleCalculated-sampleBlock); + end + EEG.event(end).latency = (cont(iBound).begintime)/1000000*EEG.srate; % absolute time allow resorting events later +% EEG.event(end).latency = sampleCalculated; + end + end + + % rename Break cnt events +end + +%% resort events and check event structure +if ~isempty(EEG.event) + if any(cellfun(@isempty, { EEG.event.latency })) + error('Some empty event latency') + end + [~,iEvent] = sort([EEG.event.latency]); + EEG.event = EEG.event(iEvent); + + % remove duration of remove data portions from events + subLatency = 0; + for iEvent = 1:length(EEG.event) + if strcmpi(EEG.event(iEvent).type, 'boundary') + subLatency = subLatency + EEG.event(iEvent).duration; + end + EEG.event(iEvent).latency = EEG.event(iEvent).latency-subLatency; + end + + % events are not checked in this function if called from pop_mffimport.m + % because they would alter time locking event values when importing + % data trials + s = dbstack; + if length(s) <= 1 || ~strcmpi(s(2).file, 'pop_mffimport.m') + if exist('eeg_checkset.m', 'file') && exist('eeglab_options.m', 'file') + EEG = eeg_checkset(EEG,'eventconsistency'); + end + end +end + +data = EEG.data; +events = EEG.event; +chanlocs = EEG.chanlocs; +mff = EEG.etc; +try + EEG = eeg_checkset(EEG); +catch + EEG.pnts = size(EEG.data,2); + EEG.trials = size(EEG.data,3); +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importcategories.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importcategories.m new file mode 100644 index 0000000..b497cb8 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importcategories.m @@ -0,0 +1,88 @@ +% mff_importcategories - import information from MFF 'categories.xml' file +% +% Usage: +% cat = mff_exportcategories(mffFile, version); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% vesion - file version (optional - default is 3) +% +% Output: +% cat - Matlab structure containing informations contained in the MFF file. + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function cat = mff_importcategories(mffFile, version) + +cat = []; +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +if nargin < 2 + version = 3; +end +if version == 0 + divider = 1000; +else + divider = 1; +end + +% Create a factory. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +%% create Segment to load time +categoriesRType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Categories')); +catURI = [ mffFile filesep 'categories.xml' ]; +catsResource = mfffactorydelegate.openResourceAtURI(catURI, categoriesRType); +if ~isempty(catsResource) + if catsResource.loadResource() + categories = catsResource.getCategories(); + fprintf('Importing categories.xml ressource: %d categories\n', categories.size); + + for iCat = 1:categories.size + category = categories.get(iCat-1); + cat(iCat).name = char(category.getName()); + + % Get the list of segments for this category. + segments = category.getSegments(); + fprintf('Category %s, %d trials\n', char(category.getName()), segments.size); + + if ~isempty(segments) + + for iSeg = 1:segments.size + + segment = segments.get(iSeg-1); + cat(iCat).trials(iSeg).name = char(segment.getName()); + cat(iCat).trials(iSeg).status = char(segment.getStatus()); + cat(iCat).trials(iSeg).begintime = segment.getBeginTime()/divider; + cat(iCat).trials(iSeg).endtime = segment.getEndTime()/divider; + cat(iCat).trials(iSeg).eventbegin = segment.getEventBegin()/divider; + cat(iCat).trials(iSeg).eventend = segment.getEventEnd()/divider; + + keylist = segment.getKeys(); + cat(iCat).trials = mff_importkeys(cat(iCat).trials, iSeg, keylist, true); + + if segment.getClockStartTimePresent() + cat(iCat).trials(iSeg).clockstarttime = char(segment.getClockStartTime()); + end + end + end + end + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importcoordinates.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importcoordinates.m new file mode 100644 index 0000000..58e13be --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importcoordinates.m @@ -0,0 +1,122 @@ +% mff_importcoordinates - import information from MFF 'coordinates.xml' file +% +% Usage: +% [chanlocs, ref] = mff_importcoordinates(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% +% Output: +% chanlocs - EEGLAB channel location structure +% ref - reference + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function [chanlocs, reference, rVal] = mff_importcoordinates(mffFile) + +chanlocs = []; +rVal = true; + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create an MFFFactory object. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +% Note that 3 is the value associated with the event track resource type. +sLayoutURI = fullfile(mffFile, 'coordinates.xml'); +sensorLayoutType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Coordinates')); + +cLayout = mfffactory.openResourceAtURI(sLayoutURI, sensorLayoutType); + +listfid = []; +ref = []; +reference = {}; +if ~isempty(cLayout) + + %try + + if cLayout.loadResource() + + % The information about the Coordinate Layout Resource. + fprintf('Coordinate acquisition Time: %s\n', char(cLayout.getAcquisitionTime())); + fprintf('Coordinate acquisition Method: %s\n', char(cLayout.getAcquisitionMethod())); + + % Check to see if we have a default subject. + % fprintf('Default Subject: %d\n', cLayout.getDefaultSubject()); + + % Get the sesnors. + sLayout = cLayout.getSensorLayout(); + + if ~isempty(sLayout ) + + % Information about the sensor layout. + + fprintf('Coordinate Layout Name: %s\n', char(sLayout.getName())); + + % If Montage + if ~isempty(sLayout.getOriginalLayout()) + fprintf('Cordinate Original Layout Name: %s\n', char(sLayout.getOriginalLayout()) ); + end + sensors = sLayout.getSensors(); + + if ~isempty(sensors ) + + for iSensor = 1:sensors.size + sensor = sensors.get(iSensor-1); + description = char(sensor.getName()); + chanlocs(iSensor).labels = [ 'E' num2str(sensor.getNumber()) ]; + chanlocs(iSensor).description = description; + chanlocs(iSensor).X = sensor.getX(); + chanlocs(iSensor).Y = sensor.getY(); + chanlocs(iSensor).Z = sensor.getZ(); + chanlocs(iSensor).identifier = sensor.getIdentifier(); + sensorType = sensor.getType(); + switch sensorType + case 0, chanlocs(iSensor).type = 'EEG'; + case 1, chanlocs(iSensor).type = 'EEG'; ref = [ref iSensor]; reference = { reference{:} chanlocs(iSensor).labels }; + case 2, chanlocs(iSensor).type = 'FID'; listfid = [ listfid iSensor ]; + end + end + + end + else + fprintf('Error: Coordinate Layout is null\n'); + rVal = false; + end + + else + fprintf('Error: could not load the coordinates resource.\n'); + rVal = false; + end + +end + +if ~isempty(ref) + for iSensor = 1:length(chanlocs) + if strcmpi(chanlocs(iSensor).type, 'EEG'), chanlocs(iSensor).ref = [ chanlocs(ref).labels ]; end + end +end + +if ~isempty(chanlocs) + chanlocs = convertlocs(chanlocs, 'cart2all'); +end + + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importepochs.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importepochs.m new file mode 100644 index 0000000..a19a825 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importepochs.m @@ -0,0 +1,71 @@ +% mff_importepochs - import information from MFF 'epochs.xml' file +% +% Usage: +% epochs = mff_importepochs(mffFile, version); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% vesion - file version (optional - default is 3) +% +% Output: +% epochs - Matlab structure containing informations contained in the MFF file. + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function continuous = mff_importepochs(mffFile, version) + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +if nargin < 2 + version = 3; +end +if version == 0 + divider = 1000; +else + divider = 1; +end + +% Create a factory. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); + +%% create Segment to load time +epochsRType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Epochs')); +catURI = [ mffFile filesep 'epochs.xml' ]; +if ~exist(catURI) + catURI = [ mffFile filesep 'epoch.xml' ]; +end +epochResource = mfffactorydelegate.openResourceAtURI(catURI, epochsRType); +continuous = []; +if epochResource.loadResource() + epochs = epochResource.getEpochs(); + fprintf('Importing epoch.xml ressource: %d data segments\n', epochs.size); + + for iEpoch = 1:epochs.size + singleEpoch = epochs.get(iEpoch-1); + continuous(iEpoch).begintime = singleEpoch.getBeginTime()/divider; + continuous(iEpoch).endtime = singleEpoch.getEndTime()/divider; + continuous(iEpoch).firstblock = singleEpoch.getFirstBlock(); + continuous(iEpoch).lastblock = singleEpoch.getLastBlock(); +% fprintf('Continuous portion Begin Time: %d\n', singleEpoch.getBeginTime()); +% fprintf('Continuous portion End Time: %d\n', singleEpoch.getEndTime()); +% fprintf('Continuous portion Signal Block This Epoch: %d\n', singleEpoch.getFirstBlock()); +% fprintf('Continuous portion Signal Block This Epoch: %d\n', singleEpoch.getLastBlock()); + end +end + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importevents.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importevents.m new file mode 100644 index 0000000..bac32cc --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importevents.m @@ -0,0 +1,195 @@ +% mff_importevents - import information from MFF 'eventsxxxxx.xml' +% files. If several files are detected, information +% from all files is imported. +% +% Usage: +% [events, timezone] = mff_importevents(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% +% Output: +% events - EEGLAB event structure +% timezone - time zone + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function [events, timeZone] = mff_importevents(mffFile, begTime, srate) + +events = []; +timeZone = []; +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% create a factory +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +% Note that 3 is the value associated with the event track resource type. +eventFile = dir( fullfile(mffFile, 'Events_*.xml')); +if isempty(eventFile), return; end +timeZone = []; +eventCount = 1; +showWarning = true; + +% use vararg2str to save events so they may be exported +eeglabExport = true; +if ~exist('vararg2str', 'file') + eeglabExport = false; +end + +for iEvent = 1:length(eventFile) + eventtrackfilename = fullfile(mffFile, eventFile(iEvent).name); + eventtracktype = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_EventTrack')); + eventtrackObj = mfffactory.openResourceAtURI(eventtrackfilename, eventtracktype); + + if eventtrackObj.loadResource() + + name = eventtrackObj.getName(); + trackType = eventtrackObj.getTrackType(); + eventlist = eventtrackObj.getEvents(); + nevents = eventlist.size(); + fprintf('Importing %d events from file %s...\n', nevents, eventFile(iEvent).name); + + % Read through each event track and inspect count of events + % and beginTime for last event in each. + if nevents>0 + + multiplier = 24*60*60*srate; + events(nevents).description = ''; % create last event + + for eventnum = 1:nevents + + eventObj = eventlist.get(eventnum-1); + + % Get keys for event and display key codes + events(eventCount).begintime = char(eventObj.getBeginTime()); + if events(eventCount).begintime(end-1) == '-' + events(eventCount).begintime = [ events(eventCount).begintime(1:end-1) '0' events(eventCount).begintime(end) ':00' ]; + elseif events(eventCount).begintime(end-2) == '-' + events(eventCount).begintime = [ events(eventCount).begintime(1:end-2) events(eventCount).begintime(end) ':00' ]; + end + events(eventCount).classid = char(eventObj.getClassID()); + events(eventCount).code = char(eventObj.getCode()); + events(eventCount).description = char(eventObj.getDescription()); + events(eventCount).duration = eventObj.getDuration(); + events(eventCount).label = char(eventObj.getLabel()); + events(eventCount).relativebegintime = eventObj.getRelativeBeginTime(); + events(eventCount).sourcedevice = char(eventObj.getSourceDevice()); + events(eventCount).name = char(name); + events(eventCount).tracktype = char(trackType); + + % compute latency in days with ms -> convert to samples + % eventCount = 1; + events(eventCount).latency = (mff_decodetime(events(eventCount).begintime)-begTime)*multiplier; + + % dual time recoding +% tmp = mff_encodetime(events(eventCount).latency/multiplier+begTime, '08:00') +% fprintf('%s\n%s\n', events(eventCount).begintime, tmp); + + events(eventCount).type = events(eventCount).code; + + % import keys + keylist = eventObj.getKeys(); + events = mff_importkeys(events, eventCount, keylist, eeglabExport); + + eventCount = eventCount+1; + + end + end + else + fprintf('Could not load event file %s\n', eventtrackfilename); + end +end +if ~isempty(events) + % get the time zone (duplicate code in mff_importevents and mff_importinfo) + minusSign = find(events(end).begintime == '+'); + if isempty(minusSign) + minusSign = find(events(end).begintime == '-'); + minusSign = minusSign(end); + end + timeZone = events(end).begintime(minusSign(end):end); + if length(timeZone) > 6 + timeZone = []; + disp('Issue with decoding the time zone'); + end +end + +% % same as above but 10% faster. Was not retained because the increased +% % complexitity. Does not support importing keys +% +% begintime = cell(1,eventcount); +% classid = cell(1,eventcount); +% code = cell(1,eventcount); +% description = cell(1,eventcount); +% duration = cell(1,eventcount); +% label = cell(1,eventcount); +% relativebegintime = cell(1,eventcount); +% sourcedevice = cell(1,eventcount); +% eventkeys = cell(1,eventcount); +% for eventnum = 1:eventcount +% +% eventObj = eventlist.get(eventnum-1); +% +% % Get keys for event and display key codes +% begintime{eventnum} = eventObj.getBeginTime(); +% classid{eventnum} = eventObj.getClassID(); +% code{eventnum} = eventObj.getCode(); +% description{eventnum} = eventObj.getDescription(); +% duration{eventnum} = eventObj.getDuration(); +% label{eventnum} = eventObj.getLabel(); +% relativebegintime{eventnum} = eventObj.getRelativeBeginTime(); +% sourcedevice{eventnum} = eventObj.getSourceDevice(); +% eventkeys{eventnum} = eventObj.getKeys(); +% +% end +% +% disp('Converting events to Matlab format...') +% begintime = cellfun(@(x)char(x), begintime, 'uniformoutput', false); +% begintime2 = cellfun(@(x)mff_decodetime(x), begintime, 'uniformoutput', false); +% classid = cellfun(@(x)char(x), classid, 'uniformoutput', false); +% code = cellfun(@(x)char(x), code, 'uniformoutput', false); +% description = cellfun(@(x)char(x), description, 'uniformoutput', false); +% label = cellfun(@(x)char(x), label, 'uniformoutput', false); +% relativebegintime = cellfun(@(x)char(x), relativebegintime, 'uniformoutput', false); +% sourcedevice = cellfun(@(x)char(x), sourcedevice, 'uniformoutput', false); +% eventkeys = cellfun(@(x)char(x), eventkeys, 'uniformoutput', false); +% +% events = struct('begintime', begintime, 'latency', begintime2, 'classid', classid, 'code', code, 'description', description, ... +% 'label', label, 'relativebegintime', relativebegintime, 'sourcedevice', sourcedevice, 'eventkeys', eventkeys); + +% Save as above but not faster +% eventlist = eventlist.toArray; +% eventlist = cell(eventlist); +% +% begintime = cellfun(@(x)char(x.getBeginTime()), eventlist, 'uniformoutput', false); +% begintime2 = cellfun(@(x)mff_decodetime(x), begintime, 'uniformoutput', false); +% classid = cellfun(@(x)char(x.getClassID()), eventlist, 'uniformoutput', false); +% code = cellfun(@(x)char(x.getCode()), eventlist, 'uniformoutput', false); +% description = cellfun(@(x)char(x.getDescription()), eventlist, 'uniformoutput', false); +% label = cellfun(@(x)char(x.getLabel()), eventlist, 'uniformoutput', false); +% sourcedevice = cellfun(@(x)char(x.getSourceDevice()), eventlist, 'uniformoutput', false); +% eventkeys = cellfun(@(x)char(x.getKeys()), eventlist, 'uniformoutput', false); +% +% relativebegintime = cellfun(@(x)x.getRelativeBeginTime(), eventlist, 'uniformoutput', false); +% duration = cellfun(@(x)x.getDuration(), eventlist, 'uniformoutput', false); +% +% events = struct('begintime', begintime, 'latency', begintime2, 'classid', classid, 'code', code, 'type', code, 'description', description, ... +% 'label', label, 'duration', duration, 'relativebegintime', relativebegintime, 'sourcedevice', sourcedevice, 'eventkeys', eventkeys); + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importinfo.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importinfo.m new file mode 100644 index 0000000..8fe6a13 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importinfo.m @@ -0,0 +1,88 @@ +% mff_importinfo - import information from MFF 'info.xml' file +% +% Usage: +% info = mff_exportsignal(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% +% Output: +% info - Matlab structure containing informations contained in the MFF +% file. + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function infoMatlab = mff_importinfo(mffFile) + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +infotype = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Info')); +info = mfffactory.openResourceAtURI( fullfile(mffFile, 'info.xml'), infotype); + +infoMatlab.version = 0; +infoMatlab.timezone = []; +infoMatlab.recordtimematlab = 0; +if ~isempty(info) + %try + if (info.loadResource() == true) + + % The files version number. + if (info.getMFFVersionPresent() == true) + fprintf( 'MFF Version: %d\n', info.getMFFVersion()); + infoMatlab.version = info.getMFFVersion(); % Integer + end + + % The recording time. + timeVal = char(info.getRecordTime()); + fprintf( 'File''s Recording Time: %s\n', timeVal); + infoMatlab.recordtime = timeVal; + + % get the time zone (duplicate code in mff_importevents and mff_importinfo) + minusSign = find(timeVal == '+'); + if isempty(minusSign) + minusSign = find(timeVal == '-'); + minusSign = minusSign(end); + end + timeZone = timeVal(minusSign(end):end); + if length(timeZone) > 6 + timeZone = []; + disp('Issue with decoding the time zone'); + end + infoMatlab.timezone = timeZone; + + % decode time + timeVal = mff_decodetime(timeVal); + infoMatlab.recordtimematlab = timeVal; + + else + fprintf( 'Error: Could not load Info resource; file might be corrupted.\n'); + end + + %catch + % error( 'Unknown while decoding info ressource; send us your data file.\n'); + %end + +else + error( 'Error: Could not open the Info resource; check path\n'); +end + +mfffactory.closeResource(info); diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importinfon.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importinfon.m new file mode 100644 index 0000000..62f2ac9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importinfon.m @@ -0,0 +1,129 @@ +% mff_importinfon - import information from MFF 'info.xml' file +% +% Usage: +% info = mff_exportsignal(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% +% Output: +% info - Matlab structure containing informations contained in the MFF +% file. + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function infoN = mff_importinfon(mffFile, index) + +infon = [ 'Info' int2str(index) ]; + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +infotype = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_InfoN')); + +if exist(fullfile(mffFile, [infon '.xml'])) + check_rewrite_file( fullfile(mffFile, [infon '.xml']) ); +end +info = mfffactory.openResourceAtURI( fullfile(mffFile, [infon '.xml']), infotype); + +infoN = []; +if ~isempty(info) && exist(fullfile(mffFile, [infon '.xml'])) + if info.loadResource() == true + + tmp = info.getInfoNFileType; + infoN.infoNFileType.value = tmp.getValue; + + tmp = info.getInfoNFileTypeInformation; + try + if ~isempty(char(tmp.getMontageName)) + infoN.infoNFileTypeInformation.montageName = char(tmp.getMontageName); + end + if ~isempty(char(tmp.getSensorLayoutName)) + infoN.infoNFileTypeInformation.sensorLayoutName = char(tmp.getSensorLayoutName); + end + if ~isempty(char(tmp.referenceScheme)) + infoN.infoNFileTypeInformation.referenceScheme = char(tmp.getReferenceScheme); + end + catch + end + try + infoN.infoNFileTypeInformation.pnsSetName = char(tmp.getPNSSetName); + catch + end + + calibAll = info.getCalibrations; + if ~isempty(calibAll) + for iCalType = 1:calibAll.size + + calibList = calibAll.get(iCalType-1); % first on the list is Gain + if strcmpi(char(calibList.getType()), 'GCAL'); + + + if ~isempty(calibList) + calibValues = []; + channels = calibList.getChannels; + + for iCalib = 1:channels.size + chan = channels.get(iCalib-1); + calibValues(iCalib) = str2num(chan.getChannelData()); + end + + infoN.calibration = calibValues; + + end + end + end + end + else + fprintf( 'Error: Could not load Info resource; file might be corrupted.\n'); + end +end + +mfffactory.closeResource(info); + +% rewrite info file for for hardware filter issue in Java library +function check_rewrite_file( fileName ) + +fid = fopen(fileName, 'r'); +txt = {}; +modified = false; +while ~feof(fid) + txt{end+1} = fgetl(fid); + posStr = strfind(txt{end}, 'd">true'); + if ~isempty(posStr) + modified = true; + txt{end}(posStr) = []; + end +end +fclose(fid); + +if modified + fid = fopen(fileName, 'w'); + if fid == -1 + error('Cannot modify original file to make it compatible with Java import librairy'); + end + for iTxt = 1:length(txt) + fprintf(fid, '%s\n', txt{iTxt}); + end + fclose(fid); +end + + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importkeys.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importkeys.m new file mode 100644 index 0000000..9f063f9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importkeys.m @@ -0,0 +1,65 @@ +% mff_importkeys - import MFF keys into structure +% +% Usage: +% events = mff_importkeys(events, eventind, keys); +% +% Inputs: +% events - EEGLAB event structure +% eventind - event index +% keys - MFF keys (in the form of a Java array) +% +% Output: +% events - EEGLAB event structure + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function events = mff_importkeys(events, eventCount, keylist, eeglabExport) + +if nargin < 3 + error('mff_importkeys requires 3 arguments'); +end +if nargin < 4 + eeglabExport = true; +end + +if isempty(keylist) + return +end +eventkeycount = keylist.size; +events(eventCount).mffkeys = char(keylist); + +keyVals = []; +for q = 0:eventkeycount-1 + theKey = keylist.get(q); + keyVals(q+1).code = char(theKey.getCode); + keyVals(q+1).data = char(theKey.getData); + keyVals(q+1).datatype = char(theKey.getDataType); + keyVals(q+1).description = char(theKey.getDescription); + cleancode = keyVals(q+1).code; + cleancode( cleancode < 48 ) = []; % invalid char + cleancode( cleancode > 57 & cleancode < 64 ) = []; % invalid char + try + events(eventCount).( [ 'mffkey_' cleancode ]) = keyVals(q+1).data; + catch + if showWarning + disp('Warning: issue when converting MFF event key ************'); + showWarning = false; + end + end +end +if eeglabExport + events(eventCount).mffkeysbackup = vararg2str(keyVals); % for exporting +end \ No newline at end of file diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importpnsset.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importpnsset.m new file mode 100644 index 0000000..5c7f315 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importpnsset.m @@ -0,0 +1,72 @@ +% mff_importpnsset - import information from MFF 'pnsSet.xml' file +% +% Usage: +% chaninfo = mff_importpnsset(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% +% Output: +% chaninfo - EEGLAB channel location structure + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function [chaninfo, rVal] = mff_importpnsset(mffFile) + +chanlocs = []; +rVal = true; + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create an MFFFactory object. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +% Note that 3 is the value associated with the event track resource type. +pnsURI = fullfile(mffFile, 'pnsSet.xml'); +pnsType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_PNSSet')); +pns = mfffactory.openResourceAtURI(pnsURI, pnsType); + +chaninfo = []; +if ~isempty(pns) + + if pns.loadResource() + + sensors = pns.getPNSSensors(); + + if ~isempty(sensors ) + + for iSensor = 1:sensors.size + sensor = sensors.get(iSensor-1); + chaninfo(iSensor).labels = char(sensor.getName); + chaninfo(iSensor).type = 'PNS'; + end + + end + else + fprintf('Error: pnsSet ressource is null\n'); + rVal = false; + end + +else + + rVal = false; + +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsensorlayout.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsensorlayout.m new file mode 100644 index 0000000..daf5718 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsensorlayout.m @@ -0,0 +1,155 @@ +% mff_importsensorlayout - import information from MFF 'sensorLayout.xml' file +% +% Usage: +% layout = mff_importsensorlayout(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% +% Output: +% layout - Matlab structure containing informations contained in the MFF file. + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function [layout, rVal] = mff_importsensorlayout(mffFile) + +layout = []; +rVal = true; + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create an MFFFactory object. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +sLayoutURI = fullfile(mffFile, 'sensorLayout.xml'); +sensorLayoutType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_SensorLayout')); + +sLayout = mfffactory.openResourceAtURI(sLayoutURI, sensorLayoutType); +% +% layout = []; +% if ~isempty(sLayout) +% +% % Load the Sensor Layout resource. +% if sLayout.loadResource() +% layout.name = char(sLayout.getName()); +% +% % Get information about this layout. +% fprintf('Layout Name: ', char(sLayout.getName())); +% +% if ~isempty(sLayout.getOriginalLayout) +% fprintf('Original Layout Name: %s\n', char(sLayout.getOriginalLayout())); +% layout.originallayout = char(sLayout.getOriginalLayout()); +% end +% +% sensors = sLayout.getSensors(); +% neighbors = sLayout.getNeighbors(); +% threads = sLayout.getThreads();%Not CPU threads. +% tilingSets = sLayout.getTilingSets(); +% +% % Accessing the sensors. +% if ~isempty(sensors) +% +% for iSensor = 1:sensors.size +% sensor = sensors.get(iSensor-1); +% +% layout.sensor(iSensor).name = char(sensor.getName()); +% layout.sensor(iSensor).number = sensor.getNumber(); +% layout.sensor(iSensor).X = sensor.getX(); +% layout.sensor(iSensor).Y = sensor.getY(); +% layout.sensor(iSensor).Z = sensor.getZ(); +% layout.sensor(iSensor).type = sensor.getType(); +% end +% end +% +% % Sensor Layout threads are the visible connections between sensors on the net. +% if ~isempty(threads) +% +% for iThread = 1:threads.size +% thread = threads.get(iThread-1); +% layout.thread(iThread).first = thread.getFirst(); +% layout.thread(iThread).second = thread.getSecond(); +% end +% +% end +% +% % Tiling Sets. +% if ~isempty(tilingSets) +% +% for iTilingSet = 1:tilingSets.size +% tilingSet = tilingSets.get(iTilingSet-1); +% fprintf('Tiling Set:----------\n'); +% for iSet = 1:tilingSet.size +% layout.tilingSet(iSet).value = tilingSet.get(iSet-1); +% end +% end +% +% end +% +% fprintf('\n'); +% +% % Neighbors. +% if ~isempty(neighbors) +% +% for iNeighbor = 1:neighbors.size +% neighbor = neighbors.get(iNeighbor-1); +% layout.neighbors(iNeighbor).channelnumber = neighbor.getChannelNumber(); +% channelNumbers = neighbor.getNeighbors(); +% for iChan = 1:channelNumbers.size +% layout.neighbors(iNeighbor).value(iChan) = channelNumbers.get(iChan-1); +% end +% +% end +% +% end +% +% else +% +% fprintf('Error: Could not load the Sensor Layout\n'); +% rVal = false; +% +% end +% +% else +% +% fprintf('Error: The Sensor Layout resource does not exist\n'); +% rVal = false; +% end +% return + +variables = ... + { ... + 'Name' 'char' {}; + 'OriginalLayout' 'char' {} ; + 'Sensors' 'array' { 'Name' 'char' {}; 'Number' 'real' {}; 'X' 'real' {}; 'Y' 'real' {}; 'Z' 'real' {}; 'Type' 'real' {}; 'Identifier' 'real' {} }; + 'Threads' 'array' { 'First' 'real' {}; 'Second' 'real' {} }; + 'TilingSets' 'array' { '' 'array' {} }; + 'Neighbors' 'array' { 'ChannelNumber' 'real' {}; 'Neighbors' 'array' {} } }; + +layout = []; +if ~isempty(sLayout) + try + if sLayout.loadResource() + layout = mff_getobj(sLayout, variables); + end + catch + disp('Failed to load Layout ressource'); + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsignal.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsignal.m new file mode 100644 index 0000000..a119858 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsignal.m @@ -0,0 +1,300 @@ +% mff_importsignal - import information from MFF 'signal1.bin' file +% +% Usage: +% data = mff_importsignal(mffFile, skipdataflag); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% skipdataflag - [0|1] skip data flag, when set to 1, the data is not imported +% default is 0. +% +% Output: +% data - cell array of raw data (one cell is one block in the original +% mff framework) +% datasize - size of each block +% srate - sampling rate +% npns - number of PNS data channels + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function [floatData, allDataSize, frequencies, nChannels] = mff_importsignal(mffFile) + +if nargin < 1 + help mff_importsignal; + return; +end + +if exist('eegplugin_mffimport') + error('MFFimport plugin conflict detected, remove plugin and call back this function/menu'); +end + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create a factory. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); +binfilenames = { [mffFile filesep 'signal1.bin'] [mffFile filesep 'signal2.bin'] }; +if ~exist(binfilenames{2}) binfilenames(2) = []; end + +floatData = { [] [] }; +allDataSize = { [] [] }; +nChannels = [0 0]; +for iFile = 1:length(binfilenames) + + % Create Signal object and read in signal1.bin file. + signalresourcetype = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Signal')); + signalResource = mfffactory.openResourceAtURI(binfilenames{iFile}, signalresourcetype); + rVal = true; + if ~isempty(signalResource) + + %try + + res = signalResource.loadResource(); + if res + + blocks = signalResource.getSignalBlocks(); + numblocks = signalResource.getNumberOfBlocks(); + + if ~isempty(blocks) + + % before reading any data, look at info for each block + blockIndex = 0; + for x = 0:numblocks-1 + block = blocks.get(x); + + if rVal + % Load the signal Blocks data + try + block = signalResource.loadSignalBlockData(block); + catch + errorCode = lasterror; + if strcmpi(errorCode.identifier, 'MATLAB:Java:GenericException') + error( [ 'You must increase Java Memory to read this file' 10 ... + 'On the Home tab, in the Environment section, click Preferences.' 10 ... + 'Select MATLAB > General > Java Heap Memory' 10 ... + 'You must restart Matlab after making this change.' 10 ... + 'If your Java memory is already at the maximum, the easiest' 10 ... + 'solution is to use another computer to import the file' ]); + else + error(lasterr); + end + end + + version = block.version; + dataSize = block.dataBlockSize; + allDataSize{iFile}(x+1) = dataSize; + nChannels(iFile) = block.numberOfSignals; + nSamples = 0; + headerSize = block.headerSize; + + offsets = block.offsets; % int array + signalDepth = block.signalDepth; % int array + frequencies = block.signalFrequency; % int array + + if isempty(offsets) || isempty(signalDepth) || isempty(frequencies) + error('Error: Arrays are null for block no. %d\n', blockIndex); + end + + typeSize = (signalDepth(1) / 8); % 8 bits + + % Determine the number of sample. Note the special check for only one channel. + if ~isempty(offsets) && nChannels(iFile) > 1 + nSamples = offsets(2) / typeSize; + else + if(nChannels(iFile) == 1) + nSamples = dataSize / typeSize; + end + end + + if(blockIndex == 0) + fprintf('Signal Block Version Number: %d\n', version); + fprintf('Signal Block Data Size: %d\n', dataSize); + fprintf('Signal Block Header size. %d\n', headerSize); + fprintf('Number of Signals: %d\n', nChannels(iFile)); + fprintf('Signal Block Samples: %d\n', nSamples); + fprintf('Sample Rate: %d\n', frequencies(1)); + fprintf('Signal Depth: %d\n', signalDepth(1)); + fprintf('---------------------------------\n'); + + % Optional Header is usually only written to the + % first signal block of the signal file. + if ~isempty(block.optionalHeader) + + buffer = typecast(block.optionalHeader,'uint8'); + + % Get the optional headers information. Please refer to the + % Meta File Format(MFF)documentation for more information about + % Signal files and the optional header. + + tmpType = typecast(buffer(1:4),'int32'); + numBlocks = typecast(buffer(5:12),'int64'); + totalSamples = typecast(buffer(13:20),'int64'); + numSignals = typecast(buffer(21:24),'int32'); + + fprintf('Optional Header type: %d\n',tmpType); + fprintf('Optional Header number of blocks total: %d\n',numBlocks); + fprintf('Optional Header number of Samples total: %d\n',totalSamples); + fprintf('Optional Header number of Signals: %d\n',numSignals); + fprintf('------------------------------------------\n'); + + end + + end + + % Get the data. + typeSize = 4; + floatData{iFile}{blockIndex+1} = typecast(block.data,'single'); % WARNING LITTLE ENDIAN HERE + + % Note: the length of the buffer should match the Block data size. + if length(floatData{iFile}{blockIndex+1})*typeSize ~= dataSize + error('Error: Data buffer size mismatch\n'); + end + floatData{iFile}{blockIndex+1} = reshape(floatData{iFile}{blockIndex+1}, nSamples, nChannels(iFile))'; + + %--- + % Note: offsets[] are represented in bytes. what we want is a value we can use as an + % offset in our signalArray for the given datatype: int, float , double. To do this we need + % to calculate: int offset = ( offsets[channelnumber] / typeSize ), or with the actual + % array: float someVal = signalArray[( offsets[channelnumber] / typeSize )]. + %--- + + % A few examples of accessing the data. % + + % Get first sample from each channel in this signal block. + % for channel = 1:nChannels + % offset = offsets(channel); + % fprintf('First Sample for channel no. %d : %f\n', channel, floatData(offset/typeSize +1)); + % end + + %Get every sample for every channel from float array. + % for c=1:nChannels + % fprintf('Block No. %d Channel No: %d\n', blockIndex, c); + % for s=1:nSamples + % signalVal = floatData((offsets(c)/typeSize) + s); + % fprintf(' Sample No. %d:%f\n', s, signalVal); + % end + % end + % + % % Get every channel for every sample from float array. + % for s=1:nSamples + % fprintf('Block No. "+blockIndex+" Sample No. %d\n',s); + % for c=1:nChannels + % signalVal = floatData((offsets(c)/typeSize) + s); + % fprintf(' Channel No. %d:%f\n', c, signalVal); + % end + % end + + else + error('Error Accessing signal data.\n'); + end + blockIndex = blockIndex+1; + end + else + error('Error: Empty block.\n'); + end + else + error('Error: Could not load the signal resource.\n'); + end + + %catch + % Logger.getLogger(MFFAPIExamples.class.getName()).log(Level.SEVERE, null, ex); + % rVal = false; + % Additional cleanup as needed + %end + + else + error('Error: Can not open the signal resource.\n'); + end + mfffactory.closeResource(signalResource); +end + +% combine autonomous and EEG data +if ~isempty(floatData{2}) + + % remove last channel of PNS data if null + uniqueLastChan = unique(floatData{2}{1}(end,:)); + if length(uniqueLastChan) == 1 && uniqueLastChan == 0 + floatData{2} = cellfun(@(x)x(1:end-1,:), floatData{2}, 'uniformoutput', false); + end + nChannels(2) = size(floatData{2}{1},1); + + % concatenate PNS data and EEG data + try + for iSegment = 1:length(floatData{1}) + floatData{1}{iSegment} = [ floatData{1}{iSegment}; floatData{2}{iSegment} ]; + end + catch + error('Issue with concatenating the autonomous data and the EEG data'); + end + floatData = floatData{1}; + allDataSize = allDataSize{1} + allDataSize{2}; +else + floatData = floatData{1}; + allDataSize = allDataSize{1}; +end + +% % Inspect Signal file. How many blocks, samples, etc. +% % This can be done without reading in any of the actual data. +% +% % Get first block, returned as bytes. Will convert to single precision +% % floating point values later. +% blocks = binObj.getSignalBlocks(); +% numblocks = binObj.getNumberOfBlocks() +% +% % before reading any data, look at info for each block +% for x = 0:numblocks-1 +% blockObj = blocks.get(x); +% blockObj.version +% blockObj.headerSize +% blockObj.dataBlockSize +% blockObj.numberOfSignals +% blockObj.optionalHeaderSize +% samplesinblock = blockObj.dataBlockSize +% end +% +% % Read the first block and plot the data for the first two channels +% if numblocks >= 1 +% blockObj = blocks.get(0) +% +% % To access the data for a block, it must be loaded first. +% blockObj = binObj.loadSignalBlockData(blockObj) +% bytearray = blockObj.data; +% sizebytearray = size(bytearray) +% +% % Number of 4 byte floats is 1/4 the data block size that +% % is divided by channel count to get data for each channel: +% samplesinblock = blockObj.dataBlockSize/4 +% channelsize = samplesinblock / blockObj.numberOfSignals +% +% % Convert bytes to equivalent floating point values. +% floatdata = typecast(bytearray,'single'); +% sizeofdata = size(floatdata) +% floatdata(1:channelsize) +% floatdata(channelsize+1:2*channelsize) +% +% % Plot results if desired +% if plotresults +% figure; +% hold on +% +% subplot(2,1,1); plot( 1:channelsize, floatdata(1:channelsize) ) +% subplot(2,1,2); plot( 1:channelsize, floatdata(channelsize+1:2*channelsize) ) +% end +% end + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsubject.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsubject.m new file mode 100644 index 0000000..f20be63 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_importsubject.m @@ -0,0 +1,58 @@ +% mff_importsubject - import subject information from MFF ressources +% +% Usage: +% subject = mff_importsubject(mffFile); +% +% Inputs: +% mffFile - filename/foldername for the MFF file +% +% Output: +% subject - Matlab structure containing informations contained in the MFF file + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more detailsmff_setobj. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function subject = mff_importsubject(mffFile) + +layout = []; +rVal = true; + +p = fileparts(which('mff_importsignal.m')); +warning('off', 'MATLAB:Java:DuplicateClass'); +javaaddpath(fullfile(p, 'MFF-1.2.2-jar-with-dependencies.jar')); +warning('on', 'MATLAB:Java:DuplicateClass'); + +% Create an MFFFactory object. +mfffactorydelegate = javaObject('com.egi.services.mff.api.LocalMFFFactoryDelegate'); +mfffactory = javaObject('com.egi.services.mff.api.MFFFactory', mfffactorydelegate); + +% Create Signal object and read in event track file. +sURI = fullfile(mffFile, 'subject.xml'); +objectType = javaObject('com.egi.services.mff.api.MFFResourceType', javaMethod('valueOf', 'com.egi.services.mff.api.MFFResourceType$MFFResourceTypes', 'kMFF_RT_Subject')); + +sObject = mfffactory.openResourceAtURI(sURI, objectType); + +variables = { 'Fields' 'array' { 'Name' 'char' {}; 'Data' 'char' {}; 'DataType' 'char' {} } }; + +subject = []; +if ~isempty(sObject) + try + if sObject.loadResource() + subject = mff_getobj(sObject, variables); + end + catch + disp('Failed to load subject ressource'); + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_setobj.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_setobj.m new file mode 100644 index 0000000..7546d5a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/mff_setobj.m @@ -0,0 +1,65 @@ +% mff_setobj - export information into MFF object +% +% Usage: +% mffObj = mff_setobj(mffObj, structure, values); +% +% Inputs: +% mffObj - MFF object of any type +% structure - description of variables to assign +% values - values for the structure +% +% Output: +% mffObj - MFF object of any type +% +% Note: this function may take any MFF object structure + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function mffObj = mff_setobj(mffObj, matStruct, variables) + +for iVar = 1:size(variables,1) + varName = variables{iVar,1}; + varType = variables{iVar,2}; + varArray = variables{iVar,3}; + + if ~isequal(varType, 'array') + eval( [ 'mffObj.set' varName '(matStruct.(lower(varName)));' ] ); + else + if isempty(varName) + % special case for TilingSet + for iArray = 1:length(matStruct.value) + mffObj.add(javaObject('java.lang.Integer', matStruct.value(iArray))); + end + else + if ~isempty(matStruct.(lower(varName))) + jList = javaObject('java.util.ArrayList'); + for iArray = 1:length(matStruct.(lower(varName))) + if isempty(varArray) || isempty(varArray{1}) + mffObj2 = javaObject('java.util.ArrayList'); + else + mffObj2 = javaObject( [ 'com.egi.services.mff.api.' varName(1:end-1) ]); + end + if isreal(matStruct.(lower(varName))(iArray)) + jList.add(javaObject('java.lang.Integer', matStruct.(lower(varName))(iArray))); + else + jList.add(mff_setobj(mffObj2, matStruct.(lower(varName))(iArray), varArray)); + end + end + eval( [ 'mffObj.set' varName '(jList);' ]); + end + end + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/pop_mffexport.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/pop_mffexport.m new file mode 100644 index 0000000..be5be4c --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/pop_mffexport.m @@ -0,0 +1,50 @@ +% pop_mffexport - export MFF file from EEGLAB structure. +% +% Usage: +% pop_mffexport( EEG); % pop up menu to select file +% pop_mffexport( EEG, mffFile); % export file +% +% Inputs: +% EEG - EEGLAB structure +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function com = pop_mffexport(EEG, fileName) + +com = ''; +if nargin < 1 + help pop_mffexport; + return; +end + +matVer = ver('MATLAB'); +if datenum(matVer.Date) < 735595 + error('This version of Matlab is too old. Use version 2014a or later'); +end + +if nargin < 2 + % pop up window + % ------------- + [fileName, filePath] = uiputfile('*', 'Enter an EGI .mff file/folder'); + if fileName(1) == 0, return; end + fileName = fullfile(filePath, fileName); +end + +mff_export(EEG, fileName); +com = sprintf('pop_mffexport(EEG, ''%s'');', fileName); + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/pop_mffimport.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/pop_mffimport.m new file mode 100644 index 0000000..60306c2 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/pop_mffimport.m @@ -0,0 +1,189 @@ +% pop_mffimport - import MFF file to EEGLAB structure. Note that events +% in MFF files are very rich and that you need to specify +% which field may contain the information for EEGLAB to +% extract events. This is the purpose of the second input +% "typefield" to that function. +% +% Usage: +% EEG = pop_mffimport; % pop up menu to select file +% EEG = pop_mffimport(mffFile, typefield); % import file +% +% Input: +% mffFile - filename/foldername for the MFF file (MFF file/folder must +% already exist) +% typefield - [string or cell] MFF field(s) to use for the type field. The +% default is the code field of the MFF file. If several fields +% are provided, the fields are concatenated to create the EEGLAB +% type field. +% savedat - [0|1] automatically save imported dataset +% +% Output: +% EEG - EEGLAB structure + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +function [EEG, com] = pop_mffimport(fileName, typefield, saveData) + +com = ''; +matVer = ver('MATLAB'); +if nargin < 3 + saveData = 0; +end +if datenum(matVer.Date) < 735595 + error('This version of Matlab is too old. Use version 2014a or later'); +end + +EEG = []; + +if ~exist('convertlocs.m', 'file') + error('This function requires to install the EEGLAB software (and start it)'); +end + +if nargin < 1 + + % pop up window + % ------------- + if ismac + [fileName, filePath] = uigetfile('*', 'Select an EGI .mff file(s)', 'MultiSelect', 'on'); + if isnumeric(fileName) && fileName(1) == 0, return; end + fileName = fullfile(filePath, fileName); + else + fileName = uigetdir2('*', 'Select an EGI .mff folder(s)'); + if isempty(fileName), return; end + if length(fileName) == 1, fileName = fileName{1}; end + end + + if iscell(fileName) + buttonName = questdlg2([ 'Do you want to automatically save imported datasets?' 10 ... + '(the name will remain the same as the original dataset' 10 ... + 'and the .set extension will be used)' ], 'pop_importmff() - import MFF dataset(s)', 'Cancel', 'No thanks', 'Yes Save', 'Yes Save'); + switch buttonName + case 'Cancel', return; + case 'No thanks', saveData = 0; + otherwise saveData = 1; + end + end +end + +if ~iscell(fileName), fileName = { fileName }; end +EEGTMP = []; +for iFile = 1:length(fileName) + EEGTMP = mff_import(fileName{iFile}); + + if nargin < 2 && iFile == 1 + if isempty(EEGTMP.event) + disp('No event in data file'); + else + % popup window parameters + % ----------------------- + eventfields = setdiff(fieldnames(EEGTMP.event), { 'type' 'latency' 'duration' 'urevent' 'epoch' 'begintime' }); + poscode = strmatch('code', lower(eventfields), 'exact'); + if isempty(poscode), poscode=1; end + uilist = { { 'style' 'text' 'String' ['Event type field:' 10 '(you may select multiple)'] } ... + { 'style' 'listbox' 'string' eventfields 'value' poscode 'min' 0 'max' 2} }; + geom = { 1 1 }; + result = inputgui( 'geometry', geom, 'uilist', uilist, 'geomvert', [1 3], 'helpcom', 'pophelp(''pop_mffimport'')', 'title', 'Choose event type field -- pop_mffimport()'); + + if isempty(result), return; end + typefield = eventfields(result{1}); + end + end + + % Use different event fields to populate the EEGLAB type field + % ------------------------------------------------------------ + if exist('typefield', 'var') + if ~isempty(typefield) || ~(ischar(typefield) && strcmpi(typefield, 'code')) + if ischar(typefield), typefield = { typefield }; end + + % get data for each MFF event field + dataField = cell(length(EEGTMP.event), length(typefield)); + for iField = 1:length(typefield) + dataField(:,iField) = { EEGTMP.event.(typefield{iField}) }'; + end + + % copy the data into EEGLAB event structure + strField = cell(1,length(typefield)); + strField(:) = {'_'}; % add space between events + for iEvent = 1:length(EEGTMP.event) + if ~isequal(lower(EEGTMP.event(iEvent).type), 'boundary') % not a boundary + if ~all(cellfun(@isempty, dataField(iEvent,:))) % not a trial type + tmpType = [ dataField(iEvent,:); strField ]; + tmpType = [ tmpType{:} ]; + tmpType(end) = []; + EEGTMP.event(iEvent).type = tmpType; + end + end + end + end + end + EEGTMP = eeg_checkset(EEGTMP,'eventconsistency'); + if saveData + EEGTMP = pop_saveset(EEGTMP, [ fileName{iFile}(1:end-4) '.set' ]); + EEGTMP(1).saved = 'justloaded'; + end + if iFile == 1 + EEG = EEGTMP; + else + EEG(iFile) = EEGTMP; + end +end + +% com = sprintf('EEG = pop_mffimport(''%s'', %s);', fileName, vararg2str({typefield})); +com = sprintf('EEG = pop_mffimport(%s', vararg2str({fileName})); +if exist('typefield', 'var'), com = sprintf([com ',%s'],vararg2str({typefield})); end +if saveData, com = [ com ',1' ]; end +com = [com ');']; + +% function below downlaoded from https://www.mathworks.com/matlabcentral/fileexchange/32555-uigetfile_n_dir-select-multiple-files-and-directories +% Copyright (c) 2011, Peugas +% All rights reserved. +function [pathname] = uigetdir2(start_path, dialog_title) +% Pick multiple directories and/or files + +import javax.swing.JFileChooser; + +if nargin == 0 || isempty(start_path) + start_path = pwd; +elseif numel(start_path) == 1 + if start_path == 0 % Allow a null argument. + start_path = pwd; + end +end + +jchooser = javaObjectEDT('javax.swing.JFileChooser', start_path); + +jchooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); +if nargin > 1 + jchooser.setDialogTitle(dialog_title); +end + +jchooser.setMultiSelectionEnabled(true); + +status = jchooser.showOpenDialog([]); + +if status == JFileChooser.APPROVE_OPTION + jFile = jchooser.getSelectedFiles(); + pathname{size(jFile, 1)}=[]; + for i=1:size(jFile, 1) + pathname{i} = char(jFile(i).getAbsolutePath); + end + +elseif status == JFileChooser.CANCEL_OPTION + pathname = []; +else + error('Error occured while picking file.'); +end + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/convertlocs.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/convertlocs.m new file mode 100644 index 0000000..0ef4def --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/convertlocs.m @@ -0,0 +1,225 @@ +% convertlocs() - Convert electrode locations between coordinate systems +% using the EEG.chanlocs structure. +% +% Usage: >> newchans = convertlocs( EEG, 'command'); +% +% Input: +% chanlocs - An EEGLAB EEG dataset OR a EEG.chanlocs channel locations structure +% 'command' - ['cart2topo'|'sph2topo'|'sphbesa2topo'| 'sph2cart'|'topo2cart'|'sphbesa2cart'| +% 'cart2sph'|'sphbesa2sph'|'topo2sph'| 'cart2sphbesa'|'sph2sphbesa'|'topo2sphbesa'| +% 'cart2all'|'sph2all'|'sphbesa2all'|'topo2all'] +% These command modes convert between four coordinate frames: 3-D Cartesian +% (cart), Matlab spherical (sph), Besa spherical (sphbesa), and 2-D polar (topo) +% 'auto' -- Here, the function finds the most complex coordinate frame +% and constrains all the others to this one. It searches first for Cartesian +% coordinates, then for spherical and finally for polar. Default is 'auto'. +% +% Optional input +% 'verbose' - ['on'|'off'] default is 'off'. +% +% Outputs: +% newchans - new EEGLAB channel locations structure +% +% Ex: CHANSTRUCT = convertlocs( CHANSTRUCT, 'cart2topo'); +% % Convert Cartesian coordinates to 2-D polar (topographic). +% +% Author: Arnaud Delorme, CNL / Salk Institute, 22 Dec 2002 +% +% See also: readlocs() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 22 Dec 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function chans = convertlocs(chans, command, varargin); + +if nargin < 1 + help convertlocs; + return; +end; + +if nargin < 2 + command = 'auto'; +end; +if nargin == 4 && strcmpi(varargin{2}, 'on') + verbose = 1; +else + verbose = 0; % off +end; + +% test if value exists for default +% -------------------------------- +if strcmp(command, 'auto') + if isfield(chans, 'X') && ~isempty(chans(1).X) + command = 'cart2all'; + if verbose + disp('Make all coordinate frames uniform using Cartesian coords'); + end; + else + if isfield(chans, 'sph_theta') && ~isempty(chans(1).sph_theta) + command = 'sph2all'; + if verbose + disp('Make all coordinate frames uniform using spherical coords'); + end; + else + if isfield(chans, 'sph_theta_besa') && ~isempty(chans(1).sph_theta_besa) + command = 'sphbesa2all'; + if verbose + disp('Make all coordinate frames uniform using BESA spherical coords'); + end; + else + command = 'topo2all'; + if verbose + disp('Make all coordinate frames uniform using polar coords'); + end; + end; + end; + end; +end; + +% convert +% ------- +switch command + case 'topo2sph', + theta = {chans.theta}; + radius = {chans.radius}; + indices = find(~cellfun('isempty', theta)); + [sph_phi sph_theta] = topo2sph( [ [ theta{indices} ]' [ radius{indices}]' ] ); + if verbose + disp('Warning: electrodes forced to lie on a sphere for polar to 3-D conversion'); + end; + for index = 1:length(indices) + chans(indices(index)).sph_theta = sph_theta(index); + chans(indices(index)).sph_phi = sph_phi (index); + end; + if isfield(chans, 'sph_radius'), + meanrad = mean([ chans(indices).sph_radius ]); + if isempty(meanrad), meanrad = 1; end; + else + meanrad = 1; + end; + sph_radius(1:length(indices)) = {meanrad}; +case 'topo2sphbesa', + chans = convertlocs(chans, 'topo2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords +case 'topo2cart' + chans = convertlocs(chans, 'topo2sph', varargin{:}); % search for spherical coords + if verbose + disp('Warning: spherical coordinates automatically updated'); + end; + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'topo2all', + chans = convertlocs(chans, 'topo2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'sph2cart', + sph_theta = {chans.sph_theta}; + sph_phi = {chans.sph_phi}; + indices = find(~cellfun('isempty', sph_theta)); + if ~isfield(chans, 'sph_radius'), sph_radius(1:length(indices)) = {1}; + else sph_radius = {chans.sph_radius}; + end; + inde = find(cellfun('isempty', sph_radius)); + if ~isempty(inde) + meanrad = mean( [ sph_radius{:} ]); + sph_radius(inde) = { meanrad }; + end; + [x y z] = sph2cart([ sph_theta{indices} ]'/180*pi, [ sph_phi{indices} ]'/180*pi, [ sph_radius{indices} ]'); + for index = 1:length(indices) + chans(indices(index)).X = x(index); + chans(indices(index)).Y = y(index); + chans(indices(index)).Z = z(index); + end; +case 'sph2topo', + if verbose + % disp('Warning: all radii constrained to one for spherical to topo transformation'); + end; + sph_theta = {chans.sph_theta}; + sph_phi = {chans.sph_phi}; + indices = find(~cellfun('isempty', sph_theta)); + [chan_num,angle,radius] = sph2topo([ ones(length(indices),1) [ sph_phi{indices} ]' [ sph_theta{indices} ]' ], 1, 2); % using method 2 + for index = 1:length(indices) + chans(indices(index)).theta = angle(index); + chans(indices(index)).radius = radius(index); + if ~isfield(chans, 'sph_radius') || isempty(chans(indices(index)).sph_radius) + chans(indices(index)).sph_radius = 1; + end; + end; +case 'sph2sphbesa', + % using polar coordinates + sph_theta = {chans.sph_theta}; + sph_phi = {chans.sph_phi}; + indices = find(~cellfun('isempty', sph_theta)); + [chan_num,angle,radius] = sph2topo([ones(length(indices),1) [ sph_phi{indices} ]' [ sph_theta{indices} ]' ], 1, 2); + [sph_theta_besa sph_phi_besa] = topo2sph([angle radius], 1, 1); + for index = 1:length(indices) + chans(indices(index)).sph_theta_besa = sph_theta_besa(index); + chans(indices(index)).sph_phi_besa = sph_phi_besa(index); + end; +case 'sph2all', + chans = convertlocs(chans, 'sph2topo', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'sphbesa2sph', + % using polar coordinates + sph_theta_besa = {chans.sph_theta_besa}; + sph_phi_besa = {chans.sph_phi_besa}; + indices = find(~cellfun('isempty', sph_theta_besa)); + [chan_num,angle,radius] = sph2topo([ones(length(indices),1) [ sph_theta_besa{indices} ]' [ sph_phi_besa{indices} ]' ], 1, 1); + %for index = 1:length(chans) + % chans(indices(index)).theta = angle(index); + % chans(indices(index)).radius = radius(index); + % chans(indices(index)).labels = int2str(index); + %end; + %figure; topoplot([],chans, 'style', 'blank', 'electrodes', 'labelpoint'); + + [sph_phi sph_theta] = topo2sph([angle radius], 2); + for index = 1:length(indices) + chans(indices(index)).sph_theta = sph_theta(index); + chans(indices(index)).sph_phi = sph_phi (index); + end; +case 'sphbesa2topo', + chans = convertlocs(chans, 'sphbesa2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2topo', varargin{:}); % search for spherical coords +case 'sphbesa2cart', + chans = convertlocs(chans, 'sphbesa2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2cart', varargin{:}); % search for spherical coords +case 'sphbesa2all', + chans = convertlocs(chans, 'sphbesa2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2all', varargin{:}); % search for spherical coords +case 'cart2topo', + chans = convertlocs(chans, 'cart2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2topo', varargin{:}); % search for spherical coords +case 'cart2sphbesa', + chans = convertlocs(chans, 'cart2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2sphbesa', varargin{:}); % search for spherical coords +case 'cart2sph', + if verbose + disp('WARNING: If XYZ center has not been optimized, optimize it using Edit > Channel Locations'); + end; + X = {chans.X}; + Y = {chans.Y}; + Z = {chans.Z}; + indices = find(~cellfun('isempty', X)); + [th phi radius] = cart2sph( [ X{indices} ], [ Y{indices} ], [ Z{indices} ]); + for index = 1:length(indices) + chans(indices(index)).sph_theta = th(index)/pi*180; + chans(indices(index)).sph_phi = phi(index)/pi*180; + chans(indices(index)).sph_radius = radius(index); + end; +case 'cart2all', + chans = convertlocs(chans, 'cart2sph', varargin{:}); % search for spherical coords + chans = convertlocs(chans, 'sph2all', varargin{:}); % search for spherical coords +end; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_checkchanlocs.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_checkchanlocs.m new file mode 100644 index 0000000..6aa140a --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_checkchanlocs.m @@ -0,0 +1,254 @@ +% eeg_checkchanlocs() - Check the consistency of the channel locations structure +% of an EEGLAB dataset. +% +% Usage: +% >> EEG = eeg_checkchanlocs(EEG); +% >> [chanlocs chaninfo] = eeg_checkchanlocs( chanlocs, chaninfo); +% +% Inputs: +% EEG - EEG dataset +% chanlocs - EEG.chanlocs structure +% chaninfo - EEG.chaninfo structure +% +% Outputs: +% EEG - new EEGLAB dataset with updated channel location structures +% EEG.chanlocs, EEG.urchanlocs, EEG.chaninfo +% chanlocs - updated channel location structure +% chaninfo - updated chaninfo structure +% +% Author: Arnaud Delorme, SCCN/INC/UCSD, March 2, 2011 + +% Copyright (C) SCCN/INC/UCSD, March 2, 2011, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% Hey Arno -- this is a quick fix to make an analysis work for Makoto +% I think the old version had a bug... + +function [chans, chaninfo, chanedit]= eeg_checkchanlocs(chans, chaninfo); + +if nargin < 1 + help eeg_checkchanlocs; + return; +end; + +if nargin < 2 + chaninfo = []; +end; + +processingEEGstruct = 0; +if isfield(chans, 'data') + processingEEGstruct = 1; + tmpEEG = chans; + chans = tmpEEG.chanlocs; + chaninfo = tmpEEG.chaninfo; +end; + +if ~isfield(chans, 'datachan') + [chanedit,dummy,complicated] = insertchans(chans, chaninfo); +else + chanedit = chans; + complicated = true; +end; + +nosevals = { '+X' '-X' '+Y' '-Y' }; +if ~isfield(chaninfo, 'plotrad'), chaninfo.plotrad = []; end; +if ~isfield(chaninfo, 'shrink'), chaninfo.shrink = []; end; +if ~isfield(chaninfo, 'nosedir'), chaninfo.nosedir = nosevals{1}; end; + +% handles deprecated fields +% ------------------------- +plotrad = []; +if isfield(chanedit, 'plotrad'), + plotrad = chanedit(1).plotrad; + chanedit = rmfield(chanedit, 'plotrad'); + if isstr(plotrad) && ~isempty(str2num(plotrad)), plotrad = str2num(plotrad); end; + chaninfo.plotrad = plotrad; +end; +if isfield(chanedit, 'shrink') && ~isempty(chanedit(1).shrink) + shrinkorskirt = 1; + if ~isstr(chanedit(1).shrink) + plotrad = 0.5/(1-chanedit(1).shrink); % convert old values + end; + chanedit = rmfield(chanedit, 'shrink'); + chaninfo.plotrad = plotrad; +end; + +% set non-existent fields to [] +% ----------------------------- +fields = { 'labels' 'theta' 'radius' 'X' 'Y' 'Z' 'sph_theta' 'sph_phi' 'sph_radius' 'type' 'ref' 'urchan' }; +fieldtype = { 'str' 'num' 'num' 'num' 'num' 'num' 'num' 'num' 'num' 'str' 'str' 'num' }; +check_newfields = true; %length(fieldnames(chanedit)) < length(fields); +if ~isempty(chanedit) + for index = 1:length(fields) + if check_newfields && ~isfield(chanedit, fields{index}) + % new field + % --------- + if strcmpi(fieldtype{index}, 'num') + chanedit = setfield(chanedit, {1}, fields{index}, []); + else + for indchan = 1:length(chanedit) + chanedit = setfield(chanedit, {indchan}, fields{index}, ''); + end; + end; + else + % existing fields + % --------------- + allvals = {chanedit.(fields{index})}; + if strcmpi(fieldtype{index}, 'num') + if ~all(cellfun('isclass',allvals,'double')) + numok = cellfun(@isnumeric, allvals); + if any(numok == 0) + for indConvert = find(numok == 0) + chanedit = setfield(chanedit, {indConvert}, fields{index}, []); + end; + end; + end + else + strok = cellfun('isclass', allvals,'char'); + if strcmpi(fields{index}, 'labels'), prefix = 'E'; else prefix = ''; end; + if any(strok == 0) + for indConvert = find(strok == 0) + try + strval = [ prefix num2str(getfield(chanedit, {indConvert}, fields{index})) ]; + chanedit = setfield(chanedit, {indConvert}, fields{index}, strval); + catch + chanedit = setfield(chanedit, {indConvert}, fields{index}, ''); + end; + end; + end; + end; + end; + end; +end; +if ~isequal(fieldnames(chanedit)',fields) + try + chanedit = orderfields(chanedit, fields); + catch, end; +end + +% check if duplicate channel label +% -------------------------------- +if isfield(chanedit, 'labels') + tmp = sort({chanedit.labels}); + if any(strcmp(tmp(1:end-1),tmp(2:end))) + disp('Warning: some channels have the same label'); + end +end; + +% check for empty channel label +% ----------------------------- +if isfield(chanedit, 'labels') + indEmpty = find(cellfun(@isempty, {chanedit.labels})); + if ~isempty(indEmpty) + tmpWarning = warning('backtrace'); + warning backtrace off; + warning('channel labels should not be empty, creating unique labels'); + warning(tmpWarning); + for index = indEmpty + chanedit(index).labels = sprintf('E%d', index); + end; + end; +end; + +% remove fields +% ------------- +if isfield(chanedit, 'sph_phi_besa' ), chanedit = rmfield(chanedit, 'sph_phi_besa'); end; +if isfield(chanedit, 'sph_theta_besa'), chanedit = rmfield(chanedit, 'sph_theta_besa'); end; + +% Populating channel location fields with all coordinates systems +if (any( cellfun('isempty',{ chanedit.X })) || any( cellfun('isempty', { chanedit.theta})) || any( cellfun('isempty', { chanedit.sph_theta}))) &&... + (any(~cellfun('isempty',{ chanedit.X })) || any(~cellfun('isempty', { chanedit.theta})) || any(~cellfun('isempty', { chanedit.sph_theta}))) + try + chanedit = convertlocs(chanedit,'auto'); + catch + disp('eeg_checkchanlocs: Unable to convert electrode locations between coordinate systems'); + end +end + +% reconstruct the chans structure +% ------------------------------- +if complicated + [chans chaninfo.nodatchans] = getnodatchan( chanedit ); + if ~isfield(chaninfo, 'nodatchans'), chaninfo.nodatchans = []; end; + if isempty(chanedit) + for iField = 1:length(fields) + chanedit = setfield(chanedit, fields{iField}, []); + end; + end; +else + chans = rmfield(chanedit,'datachan'); + chaninfo.nodatchans = []; +end + +if processingEEGstruct + tmpEEG.chanlocs = chans; + tmpEEG.chaninfo = chaninfo; + chans = tmpEEG; +end; + +% --------------------------------------------- +% separate data channels from non-data channels +% --------------------------------------------- +function [chans, fidsval] = getnodatchan(chans) +if isfield(chans,'datachan') + [chans(cellfun('isempty',{chans.datachan})).datachan] = deal(0); + fids = [chans.datachan] == 0; + fidsval = chans(fids); + chans = rmfield(chans(~fids),'datachan'); +else + fids = []; +end; + +% ---------------------------------------- +% fuse data channels and non-data channels +% ---------------------------------------- +function [chans, chaninfo,complicated] = insertchans(chans, chaninfo, nchans) +if nargin < 3, nchans = length(chans); end; +[chans.datachan] = deal(1); +complicated = false; % whether we need complicated treatment of datachans & co further down the road..... + +if isfield(chans,'type') + mask = strcmpi({chans.type},'FID') | strcmpi({chans.type},'IGNORE'); + if any(mask) + [chans(mask).datachan] = deal(0); + complicated = true; + end +end +if length(chans) > nchans && nchans ~= 0 % reference at the end of the structure + chans(end).datachan = 0; + complicated = true; +end; +if isfield(chaninfo, 'nodatchans') + if ~isempty(chaninfo.nodatchans) && isstruct(chaninfo.nodatchans) + chanlen = length(chans); + for index = 1:length(chaninfo.nodatchans) + fields = fieldnames( chaninfo.nodatchans ); + ind = chanlen+index; + for f = 1:length( fields ) + chans = setfield(chans, { ind }, fields{f}, getfield( chaninfo.nodatchans, { index }, fields{f})); + end; + chans(ind).datachan = 0; + complicated = true; + end; + chaninfo = rmfield(chaninfo, 'nodatchans'); + + % put these channels first + % ------------------------ + % tmp = chans(chanlen+1:end); + % chans(length(tmp)+1:end) = chans(1:end-length(tmp)); + % chans(1:length(tmp)) = tmp; + end; +end; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_checkset.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_checkset.m new file mode 100644 index 0000000..00f7169 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_checkset.m @@ -0,0 +1,1409 @@ +% eeg_checkset() - check the consistency of the fields of an EEG dataset +% Also: See EEG dataset structure field descriptions below. +% +% Usage: >> [EEGOUT,changes] = eeg_checkset(EEG); % perform all checks +% except 'makeur' +% >> [EEGOUT,changes] = eeg_checkset(EEG, 'keyword'); % perform 'keyword' check(s) +% +% Inputs: +% EEG - EEGLAB dataset structure or (ALLEEG) array of EEG structures +% +% Optional keywords: +% 'icaconsist' - if EEG contains several datasets, check whether they have +% the same ICA decomposition +% 'epochconsist' - if EEG contains several datasets, check whether they have +% identical epoch lengths and time limits. +% 'chanconsist' - if EEG contains several datasets, check whether they have +% the same number of channels and channel labels. +% 'data' - check whether EEG contains data (EEG.data) +% 'loaddata' - load data array (if necessary) +% 'savedata' - save data array (if necessary - see EEG.saved below) +% 'contdata' - check whether EEG contains continuous data +% 'epoch' - check whether EEG contains epoched or continuous data +% 'ica' - check whether EEG contains an ICA decomposition +% 'besa' - check whether EEG contains component dipole locations +% 'event' - check whether EEG contains an event array +% 'makeur' - remake the EEG.urevent structure +% 'checkur' - check whether the EEG.urevent structure is consistent +% with the EEG.event structure +% 'chanlocsize' - check the EEG.chanlocs structure length; show warning if +% necessary. +% 'chanlocs_homogeneous' - check whether EEG contains consistent channel +% information; if not, correct it.This option +% calls eeg_checkchanlocs. +% 'eventconsistency' - check whether EEG.event information are consistent; +% rebuild event* subfields of the 'EEG.epoch' structure +% (can be time consuming). +% Outputs: +% EEGOUT - output EEGLAB dataset or dataset array +% changes - change code: 'no' = no changes; 'yes' = the EEG +% structure was modified +% +% =========================================================== +% The structure of an EEG dataset under EEGLAB (as of v5.03): +% +% Basic dataset information: +% EEG.setname - descriptive name|title for the dataset +% EEG.filename - filename of the dataset file on disk +% EEG.filepath - filepath (directory/folder) of the dataset file(s) +% EEG.trials - number of epochs (or trials) in the dataset. +% If data are continuous, this number is 1. +% EEG.pnts - number of time points (or data frames) per trial (epoch). +% If data are continuous (trials=1), the total number +% of time points (frames) in the dataset +% EEG.nbchan - number of channels +% EEG.srate - data sampling rate (in Hz) +% EEG.xmin - epoch start latency|time (in sec. relative to the +% time-locking event at time 0) +% EEG.xmax - epoch end latency|time (in seconds) +% EEG.times - vector of latencies|times in miliseconds (one per time point) +% EEG.ref - ['common'|'averef'|integer] reference channel type or number +% EEG.history - cell array of ascii pop-window commands that created +% or modified the dataset +% EEG.comments - comments about the nature of the dataset (edit this via +% menu selection Edit > About this dataset) +% EEG.etc - miscellaneous (technical or temporary) dataset information +% EEG.saved - ['yes'|'no'] 'no' flags need to save dataset changes before exit +% +% The data: +% EEG.data - two-dimensional continuous data array (chans, frames) +% ELSE, three-dim. epoched data array (chans, frames, epochs) +% +% The channel locations sub-structures: +% EEG.chanlocs - structure array containing names and locations +% of the channels on the scalp +% EEG.urchanlocs - original (ur) dataset chanlocs structure containing +% all channels originally collected with these data +% (before channel rejection) +% EEG.chaninfo - structure containing additional channel info +% EEG.ref - type of channel reference ('common'|'averef'|+/-int] +% EEG.splinefile - location of the spline file used by headplot() to plot +% data scalp maps in 3-D +% +% The event and epoch sub-structures: +% EEG.event - event structure containing times and nature of experimental +% events recorded as occurring at data time points +% EEG.urevent - original (ur) event structure containing all experimental +% events recorded as occurring at the original data time points +% (before data rejection) +% EEG.epoch - epoch event information and epoch-associated data structure array (one per epoch) +% EEG.eventdescription - cell array of strings describing event fields. +% EEG.epochdescription - cell array of strings describing epoch fields. +% --> See the http://sccn.ucsd.edu/eeglab/maintut/eeglabscript.html for details +% +% ICA (or other linear) data components: +% EEG.icasphere - sphering array returned by linear (ICA) decomposition +% EEG.icaweights - unmixing weights array returned by linear (ICA) decomposition +% EEG.icawinv - inverse (ICA) weight matrix. Columns gives the projected +% topographies of the components to the electrodes. +% EEG.icaact - ICA activations matrix (components, frames, epochs) +% Note: [] here means that 'compute_ica' option has been set +% to 0 under 'File > Memory options' In this case, +% component activations are computed only as needed. +% EEG.icasplinefile - location of the spline file used by headplot() to plot +% component scalp maps in 3-D +% EEG.chaninfo.icachansind - indices of channels used in the ICA decomposition +% EEG.dipfit - array of structures containing component map dipole models +% +% Variables indicating membership of the dataset in a studyset: +% EEG.subject - studyset subject code +% EEG.group - studyset group code +% EEG.condition - studyset experimental condition code +% EEG.run - studyset run number +% EEG.session - studyset session number +% +% Variables used for manual and semi-automatic data rejection: +% EEG.specdata - data spectrum for every single trial +% EEG.specica - data spectrum for every single trial +% EEG.stats - statistics used for data rejection +% EEG.stats.kurtc - component kurtosis values +% EEG.stats.kurtg - global kurtosis of components +% EEG.stats.kurta - kurtosis of accepted epochs +% EEG.stats.kurtr - kurtosis of rejected epochs +% EEG.stats.kurtd - kurtosis of spatial distribution +% EEG.reject - statistics used for data rejection +% EEG.reject.entropy - entropy of epochs +% EEG.reject.entropyc - entropy of components +% EEG.reject.threshold - rejection thresholds +% EEG.reject.icareject - epochs rejected by ICA criteria +% EEG.reject.gcompreject - rejected ICA components +% EEG.reject.sigreject - epochs rejected by single-channel criteria +% EEG.reject.elecreject - epochs rejected by raw data criteria +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This file is part of EEGLAB, see http://www.eeglab.org +% for the documentation and details. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +% THE POSSIBILITY OF SUCH DAMAGE. + +% 01-25-02 reformated help & license -ad +% 01-26-02 chandeg events and trial condition format -ad +% 01-27-02 debug when trial condition is empty -ad +% 02-15-02 remove icawinv recompute for pop_epoch -ad & ja +% 02-16-02 remove last modification and test icawinv separatelly -ad +% 02-16-02 empty event and epoch check -ad +% 03-07-02 add the eeglab options -ad +% 03-07-02 corrected typos and rate/point calculation -ad & ja +% 03-15-02 add channel location reading & checking -ad +% 03-15-02 add checking of ICA and epochs with pop_up windows -ad +% 03-27-02 recorrected rate/point calculation -ad & sm + +function [EEG, res] = eeg_checkset( EEG, varargin ); +msg = ''; +res = 'no'; +com = sprintf('EEG = eeg_checkset( EEG );'); + +if nargin < 1 + help eeg_checkset; + return; +end + +if isempty(EEG), return; end +if ~isfield(EEG, 'data'), return; end + +% checking multiple datasets +% -------------------------- +if length(EEG) > 1 + + if nargin > 1 + switch varargin{1} + case 'epochconsist', % test epoch consistency + % ---------------------- + res = 'no'; + datasettype = unique_bc( [ EEG.trials ] ); + if datasettype(1) == 1 && length(datasettype) == 1, return; % continuous data + elseif datasettype(1) == 1, return; % continuous and epoch data + end + + allpnts = unique_bc( [ EEG.pnts ] ); + allxmin = unique_bc( [ EEG.xmin ] ); + if length(allpnts) == 1 && length(allxmin) == 1, res = 'yes'; end + return; + + case 'chanconsist' % test channel number and name consistency + % ---------------------------------------- + res = 'yes'; + chanlen = unique_bc( [ EEG.nbchan ] ); + anyempty = unique_bc( cellfun( 'isempty', { EEG.chanlocs }) ); + if length(chanlen) == 1 && all(anyempty == 0) + tmpchanlocs = EEG(1).chanlocs; + channame1 = { tmpchanlocs.labels }; + for i = 2:length(EEG) + tmpchanlocs = EEG(i).chanlocs; + channame2 = { tmpchanlocs.labels }; + if length(intersect(channame1, channame2)) ~= length(channame1), res = 'no'; end + end + else res = 'no'; + end + + % Field 'datachan in 'urchanlocs' is removed, if exist + if isfield(EEG, 'urchanlocs') && ~all(cellfun(@isempty,{EEG.urchanlocs})) && isfield([EEG.urchanlocs], 'datachan') + [EEG.urchanlocs] = deal(rmfield([EEG.urchanlocs], 'datachan')); + end + return; + + case 'icaconsist' % test ICA decomposition consistency + % ---------------------------------- + res = 'yes'; + anyempty = unique_bc( cellfun( 'isempty', { EEG.icaweights }) ); + if length(anyempty) == 1 && anyempty(1) == 0 + ica1 = EEG(1).icawinv; + for i = 2:length(EEG) + if ~isequal(EEG(1).icawinv, EEG(i).icawinv) + res = 'no'; + end + end + else res = 'no'; + end + return; + + end + end + +end + +% reading these option take time because +% of disk access +% -------------- +eeglab_options; + +% standard checking +% ----------------- +ALLEEG = EEG; +for inddataset = 1:length(ALLEEG) + + EEG = ALLEEG(inddataset); + + % additional checks + % ----------------- + res = -1; % error code + if ~isempty( varargin) + for index = 1:length( varargin ) + switch varargin{ index } + case 'data',; % already done at the top + case 'contdata',; + if EEG.trials > 1 + errordlg2(strvcat('Error: function only works on continuous data'), 'Error'); + return; + end + case 'ica', + if isempty(EEG.icaweights) + errordlg2(strvcat('Error: no ICA decomposition. use menu "Tools > Run ICA" first.'), 'Error'); + return; + end + case 'epoch', + if EEG.trials == 1 + errordlg2(strvcat('Extract epochs before running that function', 'Use Tools > Extract epochs'), 'Error'); + return + end + case 'besa', + if ~isfield(EEG, 'sources') + errordlg2(strvcat('No dipole information', '1) Export component maps: Tools > Localize ... BESA > Export ...' ... + , '2) Run BESA to localize the equivalent dipoles', ... + '3) Import the BESA dipoles: Tools > Localize ... BESA > Import ...'), 'Error'); + return + end + case 'event', + if isempty(EEG.event) + errordlg2(strvcat('Requires events. You need to add events first.', ... + 'Use "File > Import event info" or "File > Import epoch info"', ... + 'Install plugin VidEd to manually add events as you scroll the data.' ), 'Error'); + return; + end + case 'chanloc', + tmplocs = EEG.chanlocs; + if isempty(tmplocs) || ~isfield(tmplocs, 'theta') || all(cellfun('isempty', { tmplocs.theta })) + errordlg2( strvcat('This functionality requires channel location information.', ... + 'Enter the channel file name via "Edit > Edit dataset info".', ... + 'For channel file format, see ''>> help readlocs'' from the command line.'), 'Error'); + return; + end + case 'chanlocs_homogeneous', + tmplocs = EEG.chanlocs; + if isempty(tmplocs) || ~isfield(tmplocs, 'theta') || all(cellfun('isempty', { tmplocs.theta })) + errordlg2( strvcat('This functionality requires channel location information.', ... + 'Enter the channel file name via "Edit > Edit dataset info".', ... + 'For channel file format, see ''>> help readlocs'' from the command line.'), 'Error'); + return; + end + if ~isfield(EEG.chanlocs, 'X') || isempty(EEG.chanlocs(1).X) + EEG = eeg_checkchanlocs(EEG); + % EEG.chanlocs = convertlocs(EEG.chanlocs, 'topo2all'); + res = ['EEG = eeg_checkset(EEG, ''chanlocs_homogeneous''); ' ]; + end + case 'chanlocsize', + if ~isempty(EEG.chanlocs) + if length(EEG.chanlocs) > EEG.nbchan + questdlg2(strvcat('Warning: there is one more electrode location than', ... + 'data channels. EEGLAB will consider the last electrode to be the', ... + 'common reference channel. If this is not the case, remove the', ... + 'extra channel'), 'Warning', 'Ok', 'Ok'); + end + end + case 'makeur', + if ~isempty(EEG.event) + if isfield(EEG.event, 'urevent'), + EEG.event = rmfield(EEG.event, 'urevent'); + disp('eeg_checkset note: re-creating the original event table (EEG.urevent)'); + else + disp('eeg_checkset note: creating the original event table (EEG.urevent)'); + end + EEG.urevent = EEG.event; + for index = 1:length(EEG.event) + EEG.event(index).urevent = index; + end + end + case 'checkur', + if ~isempty(EEG.event) + if isfield(EEG.event, 'urevent') && ~isempty(EEG.urevent) + urlatencies = [ EEG.urevent.latency ]; + [newlat tmpind] = sort(urlatencies); + if ~isequal(newlat, urlatencies) + EEG.urevent = EEG.urevent(tmpind); + [tmp tmpind2] = sort(tmpind); + for index = 1:length(EEG.event) + EEG.event(index).urevent = tmpind2(EEG.event(index).urevent); + end + end + end + end + case 'eventconsistency', + [EEG res] = eeg_checkset(EEG); + if isempty(EEG.event), return; end + + % check events (slow) + % ------------ + if isfield(EEG.event, 'type') + eventInds = arrayfun(@(x)isempty(x.type), EEG.event); + if any(eventInds) + if all(arrayfun(@(x)isnumeric(x.type), EEG.event)) + for ind = find(eventInds), EEG.event(ind).type = NaN; end + else for ind = find(eventInds), EEG.event(ind).type = 'empty'; end + end + end + if ~all(arrayfun(@(x)ischar(x.type), EEG.event)) && ~all(arrayfun(@(x)isnumeric(x.type), EEG.event)) + disp('Warning: converting all event types to strings'); + for ind = 1:length(EEG.event) + EEG.event(ind).type = num2str(EEG.event(ind).type); + end + EEG = eeg_checkset(EEG, 'eventconsistency'); + end + + end + + % Removing events with NaN latency + % -------------------------------- + if isfield(EEG.event, 'latency') + nanindex = find(isnan([ EEG.event.latency ])); + if ~isempty(nanindex) + EEG.event(nanindex) = []; + trialtext = ''; + for inan = 1:length(nanindex) + trialstext = [trialtext ' ' num2str(nanindex(inan))]; + end + disp(sprintf(['eeg_checkset: Event(s) with NaN latency were deleted \nDeleted event index(es):[' trialstext ']'])); + end + end + + % remove the events which latency are out of boundary + % --------------------------------------------------- + if isfield(EEG.event, 'latency') + if isfield(EEG.event, 'type') && ischar(EEG.event(1).type) + if strcmpi(EEG.event(1).type, 'boundary') && isfield(EEG.event, 'duration') + if EEG.event(1).duration < 1 + EEG.event(1) = []; + elseif EEG.event(1).latency > 0 && EEG.event(1).latency < 1 + EEG.event(1).latency = 0.5; + end + end + end + + try, tmpevent = EEG.event; alllatencies = [ tmpevent.latency ]; + catch, error('Checkset: error empty latency entry for new events added by user'); + end + I1 = find(alllatencies < 0.5); + I2 = find(alllatencies > EEG.pnts*EEG.trials+1); % The addition of 1 was included + % because, if data epochs are extracted from -1 to + % time 0, this allow to include the last event in + % the last epoch (otherwise all epochs have an + % event except the last one + if (length(I1) + length(I2)) > 0 + fprintf('eeg_checkset warning: %d/%d events had out-of-bounds latencies and were removed\n', ... + length(I1) + length(I2), length(EEG.event)); + EEG.event(union(I1, I2)) = []; + end + end + if isempty(EEG.event), return; end + + % save information for non latency fields updates + % ----------------------------------------------- + difffield = []; + if ~isempty(EEG.event) && isfield(EEG.event, 'epoch') + % remove fields with empty epochs + % ------------------------------- + removeevent = []; + try + tmpevent = EEG.event; + allepochs = [ tmpevent.epoch ]; + removeevent = find( allepochs < 1 || allepochs > EEG.trials); + if ~isempty(removeevent) + disp([ 'eeg_checkset warning: ' int2str(length(removeevent)) ' event had invalid epoch numbers and were removed']); + end + catch + for indexevent = 1:length(EEG.event) + if isempty( EEG.event(indexevent).epoch ) || ~isnumeric(EEG.event(indexevent).epoch) ... + || EEG.event(indexevent).epoch < 1 || EEG.event(indexevent).epoch > EEG.trials + removeevent = [removeevent indexevent]; + disp([ 'eeg_checkset warning: event ' int2str(indexevent) ' has an invalid epoch number: removed']); + end + end + end + EEG.event(removeevent) = []; + end + if isempty(EEG.event), return; end + + % Duration set to 0 if empty + % -------------------------- + if isfield(EEG.event, 'duration') + emptyDur = cellfun(@isempty, { EEG.event.duration }); + if any(emptyDur) + for indexevent = find(emptyDur) + EEG.event(indexevent).duration = 0; + end + end + end + + % uniformize fields (str or int) if necessary + % ------------------------------------------- + fnames = fieldnames(EEG.event); + for fidx = 1:length(fnames) + fname = fnames{fidx}; + if ~strcmpi(fname, 'mffkeys') && ~strcmpi(fname, 'mffkeysbackup') + tmpevent = EEG.event; + allvalues = { tmpevent.(fname) }; + try + % find indices of numeric values among values of this event property + valreal = ~cellfun('isclass', allvalues, 'char'); + catch + valreal = mycellfun('isclass', allvalues, 'double'); + end + + format = 'ok'; + if ~all(valreal) % all valreal ok + format = 'str'; + if all(valreal == 0) % all valreal=0 ok + format = 'ok'; + end + end + if strcmp(format, 'str') + fprintf('eeg_checkset note: event field format ''%s'' made uniform\n', fname); + allvalues = cellfun(@num2str, allvalues, 'uniformoutput', false); + [EEG.event(valreal).(fname)] = deal(allvalues{find(valreal)}); + end + end + end + + % check boundary events + % --------------------- + tmpevent = EEG.event; + if isfield(tmpevent, 'type') && ~isnumeric(tmpevent(1).type) + allEventTypes = { tmpevent.type }; + boundsInd = strmatch('boundary', allEventTypes); + if ~isempty(boundsInd), + bounds = [ tmpevent(boundsInd).latency ]; + % remove last event if necessary + if EEG.trials==1;%this if block added by James Desjardins (Jan 13th, 2014) + if round(bounds(end)-0.5+1) >= size(EEG.data,2), EEG.event(boundsInd(end)) = []; bounds(end) = []; end; % remove final boundary if any + end + % The first boundary below need to be kept for + % urevent latency calculation + % if bounds(1) < 0, EEG.event(bounds(1)) = []; end; % remove initial boundary if any + indDoublet = find(bounds(2:end)-bounds(1:end-1)==0); + if ~isempty(indDoublet) + disp('Warning: duplicate boundary event removed'); + if isfield(EEG.event, 'duration') + for indBound = 1:length(indDoublet) + EEG.event(boundsInd(indDoublet(indBound)+1)).duration = EEG.event(boundsInd(indDoublet(indBound)+1)).duration+EEG.event(boundsInd(indDoublet(indBound))).duration; + end + end + EEG.event(boundsInd(indDoublet)) = []; + end + end + end + if isempty(EEG.event), return; end + + % check that numeric format is double (Matlab 7) + % ----------------------------------- + allfields = fieldnames(EEG.event); + if ~isempty(EEG.event) + for index = 1:length(allfields) + tmpval = EEG.event(1).(allfields{index}); + if isnumeric(tmpval) && ~isa(tmpval, 'double') + for indexevent = 1:length(EEG.event) + tmpval = getfield(EEG.event, { indexevent }, allfields{index} ); + EEG.event = setfield(EEG.event, { indexevent }, allfields{index}, double(tmpval)); + end + end + end + end + + % check duration field, replace empty by 0 + % ---------------------------------------- + if isfield(EEG.event, 'duration') + tmpevent = EEG.event; + try, valempt = cellfun('isempty' , { tmpevent.duration }); + catch, valempt = mycellfun('isempty', { tmpevent.duration }); + end + if any(valempt), + for index = find(valempt) + EEG.event(index).duration = 0; + end + end + end + + % resort events + % ------------- + if isfield(EEG.event, 'latency') + try, + if isfield(EEG.event, 'epoch') + TMPEEG = pop_editeventvals(EEG, 'sort', { 'epoch' 0 'latency' 0 }); + else + TMPEEG = pop_editeventvals(EEG, 'sort', { 'latency' 0 }); + end + if ~isequal(TMPEEG.event, EEG.event) + EEG = TMPEEG; + disp('Event resorted by increasing latencies.'); + end + catch, + disp('eeg_checkset: problem when attempting to resort event latencies.'); + end + end + + % check latency of first event + % ---------------------------- + if ~isempty(EEG.event) + if isfield(EEG.event, 'latency') + if EEG.event(1).latency < 0.5 + EEG.event(1).latency = 0.5; + end + end + end + + % build epoch structure + % --------------------- + try, + if EEG.trials > 1 && ~isempty(EEG.event) + % erase existing event-related fields + % ------------------------------ + if ~isfield(EEG,'epoch') + EEG.epoch = []; + end + if ~isempty(EEG.epoch) + if length(EEG.epoch) ~= EEG.trials + disp('Warning: number of epoch entries does not match number of dataset trials;'); + disp(' user-defined epoch entries will be erased.'); + EEG.epoch = []; + else + fn = fieldnames(EEG.epoch); + EEG.epoch = rmfield(EEG.epoch,fn(strncmp('event',fn,5))); + end + end + + % set event field + % --------------- + tmpevent = EEG.event; + eventepoch = [tmpevent.epoch]; + epochevent = cell(1,EEG.trials); + destdata = epochevent; + EEG.epoch(length(epochevent)).event = []; + for k=1:length(epochevent) + epochevent{k} = find(eventepoch==k); + end + tmpepoch = EEG.epoch; + [tmpepoch.event] = epochevent{:}; + EEG.epoch = tmpepoch; + maxlen = max(cellfun(@length,epochevent)); + + % copy event information into the epoch array + % ------------------------------------------- + eventfields = fieldnames(EEG.event)'; + eventfields = eventfields(~strcmp(eventfields,'epoch')); + tmpevent = EEG.event; + for k = 1:length(eventfields) + fname = eventfields{k}; + switch fname + case 'latency' + sourcedata = round(eeg_point2lat([tmpevent.(fname)],[tmpevent.epoch],EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3) * 10^8 )/10^8; + sourcedata = num2cell(sourcedata); + case 'duration' + sourcedata = num2cell([tmpevent.(fname)]/EEG.srate*1000); + otherwise + sourcedata = {tmpevent.(fname)}; + end + if maxlen == 1 + destdata = cell(1,length(epochevent)); + destdata(~cellfun('isempty',epochevent)) = sourcedata([epochevent{:}]); + else + for l=1:length(epochevent) + destdata{l} = sourcedata(epochevent{l}); + end + end + tmpepoch = EEG.epoch; + [tmpepoch.(['event' fname])] = destdata{:}; + EEG.epoch = tmpepoch; + end + end + catch, + errordlg2(['Warning: minor problem encountered when generating' 10 ... + 'the EEG.epoch structure (used only in user scripts)']); return; + end + case { 'loaddata' 'savedata' 'chanconsist' 'icaconsist' 'epochconsist' }, res = ''; + otherwise, error('eeg_checkset: unknown option'); + end + end + end + + res = []; + + % check name consistency + % ---------------------- + if ~isempty(EEG.setname) + if ~ischar(EEG.setname) + EEG.setname = ''; + else + if size(EEG.setname,1) > 1 + disp('eeg_checkset warning: invalid dataset name, removed'); + EEG.setname = ''; + end + end + else + EEG.setname = ''; + end + + % checking history and convert if necessary + % ----------------------------------------- + if isfield(EEG, 'history') && size(EEG.history,1) > 1 + allcoms = cellstr(EEG.history); + EEG.history = deblank(allcoms{1}); + for index = 2:length(allcoms) + EEG.history = [ EEG.history 10 deblank(allcoms{index}) ]; + end + end + + % read data if necessary + % ---------------------- + if ischar(EEG.data) && nargin > 1 + if strcmpi(varargin{1}, 'loaddata') + + EEG.data = eeg_getdatact(EEG); + + end + end + + % save data if necessary + % ---------------------- + if nargin > 1 + + % datfile available? + % ------------------ + datfile = 0; + if isfield(EEG, 'datfile') + if ~isempty(EEG.datfile) + datfile = 1; + end + end + + % save data + % --------- + if strcmpi(varargin{1}, 'savedata') && option_storedisk + error('eeg_checkset: cannot call savedata any more'); + + % the code below is deprecated + if ~ischar(EEG.data) % not already saved + disp('Writing previous dataset to disk...'); + + if datfile + tmpdata = reshape(EEG.data, EEG.nbchan, EEG.pnts*EEG.trials); + floatwrite( tmpdata', fullfile(EEG.filepath, EEG.datfile), 'ieee-le'); + EEG.data = EEG.datfile; + end + EEG.icaact = []; + + % saving dataset + % -------------- + filename = fullfile(EEG(1).filepath, EEG(1).filename); + if ~ischar(EEG.data) && option_single, EEG.data = single(EEG.data); end + v = version; + if str2num(v(1)) >= 7, save( filename, '-v6', '-mat', 'EEG'); % Matlab 7 + else save( filename, '-mat', 'EEG'); + end + if ~ischar(EEG.data), EEG.data = 'in set file'; end + + % res = sprintf('%s = eeg_checkset( %s, ''savedata'');', inputname(1), inputname(1)); + res = ['EEG = eeg_checkset( EEG, ''savedata'');']; + end + end + end + + % numerical format + % ---------------- + if isnumeric(EEG.data) + v = version; + EEG.icawinv = double(EEG.icawinv); % required for dipole fitting, otherwise it crashes + EEG.icaweights = double(EEG.icaweights); + EEG.icasphere = double(EEG.icasphere); + if ~isempty(findstr(v, 'R11')) || ~isempty(findstr(v, 'R12')) || ~isempty(findstr(v, 'R13')) + EEG.data = double(EEG.data); + EEG.icaact = double(EEG.icaact); + else + try, + if isa(EEG.data, 'double') && option_single + EEG.data = single(EEG.data); + EEG.icaact = single(EEG.icaact); + end + catch, + disp('WARNING: EEGLAB ran out of memory while converting dataset to single precision.'); + disp(' Save dataset (preferably saving data to a separate file; see File > Memory options).'); + disp(' Then reload it.'); + end + end + end + + % verify the type of the variables + % -------------------------------- + % data dimensions ------------------------- + if isnumeric(EEG.data) && ~isempty(EEG.data) + if ~isequal(size(EEG.data,1), EEG.nbchan) + disp( [ 'eeg_checkset warning: number of columns in data (' int2str(size(EEG.data,1)) ... + ') does not match the number of channels (' int2str(EEG.nbchan) '): corrected' ]); + res = com; + EEG.nbchan = size(EEG.data,1); + end + + if (ndims(EEG.data)) < 3 && (EEG.pnts > 1) + if mod(size(EEG.data,2), EEG.pnts) ~= 0 + if popask( [ 'eeg_checkset error: the number of frames does not divide the number of columns in the data.' 10 ... + 'Should EEGLAB attempt to abort operation ?' 10 '(press Cancel to fix the problem from the command line)']) + error('eeg_checkset error: user abort'); + %res = com; + %EEG.pnts = size(EEG.data,2); + %EEG = eeg_checkset(EEG); + %return; + else + res = com; + return; + %error( 'eeg_checkset error: number of points does not divide the number of columns in data'); + end + else + if EEG.trials > 1 + disp( 'eeg_checkset note: data array made 3-D'); + res = com; + end + if size(EEG.data,2) ~= EEG.pnts + EEG.data = reshape(EEG.data, EEG.nbchan, EEG.pnts, size(EEG.data,2)/EEG.pnts); + end + end + end + + % size of data ----------- + if size(EEG.data,3) ~= EEG.trials + disp( ['eeg_checkset warning: 3rd dimension size of data (' int2str(size(EEG.data,3)) ... + ') does not match the number of epochs (' int2str(EEG.trials) '), corrected' ]); + res = com; + EEG.trials = size(EEG.data,3); + end + if size(EEG.data,2) ~= EEG.pnts + disp( [ 'eeg_checkset warning: number of columns in data (' int2str(size(EEG.data,2)) ... + ') does not match the number of points (' int2str(EEG.pnts) '): corrected' ]); + res = com; + EEG.pnts = size(EEG.data,2); + end + end + + % parameters consistency + % ------------------------- + if round(EEG.srate*(EEG.xmax-EEG.xmin)+1) ~= EEG.pnts + fprintf( 'eeg_checkset note: upper time limit (xmax) adjusted so (xmax-xmin)*srate+1 = number of frames\n'); + if EEG.srate == 0 + EEG.srate = 1; + end + EEG.xmax = (EEG.pnts-1)/EEG.srate+EEG.xmin; + res = com; + end + + % deal with event arrays + % ---------------------- + if ~isfield(EEG, 'event'), EEG.event = []; res = com; end + if ~isempty(EEG.event) + if EEG.trials > 1 && ~isfield(EEG.event, 'epoch') + if popask( [ 'eeg_checkset error: the event info structure does not contain an ''epoch'' field.' ... + 'Should EEGLAB attempt to abort operation ?' 10 '(press Cancel to fix the problem from the commandline)']) + error('eeg_checkset error(): user abort'); + %res = com; + %EEG.event = []; + %EEG = eeg_checkset(EEG); + %return; + else + res = com; + return; + %error('eeg_checkset error: no epoch field in event structure'); + end + end + else + EEG.event = []; + end + if isempty(EEG.event) + EEG.eventdescription = {}; + end + if ~isfield(EEG, 'eventdescription') || ~iscell(EEG.eventdescription) + EEG.eventdescription = cell(1, length(fieldnames(EEG.event))); + res = com; + else + if ~isempty(EEG.event) + if length(EEG.eventdescription) > length( fieldnames(EEG.event)) + EEG.eventdescription = EEG.eventdescription(1:length( fieldnames(EEG.event))); + elseif length(EEG.eventdescription) < length( fieldnames(EEG.event)) + EEG.eventdescription(end+1:length( fieldnames(EEG.event))) = {''}; + end + end + end + % create urevent if continuous data + % --------------------------------- + %if ~isempty(EEG.event) && ~isfield(EEG, 'urevent') + % EEG.urevent = EEG.event; + % disp('eeg_checkset note: creating the original event table (EEG.urevent)'); + % for index = 1:length(EEG.event) + % EEG.event(index).urevent = index; + % end + %end + if isfield(EEG, 'urevent') && isfield(EEG.urevent, 'urevent') + EEG.urevent = rmfield(EEG.urevent, 'urevent'); + end + + % deal with epoch arrays + % ---------------------- + if ~isfield(EEG, 'epoch'), EEG.epoch = []; res = com; end + + % check if only one epoch + % ----------------------- + if EEG.trials == 1 + if isfield(EEG.event, 'epoch') + EEG.event = rmfield(EEG.event, 'epoch'); res = com; + end + if ~isempty(EEG.epoch) + EEG.epoch = []; res = com; + end + end + + if ~isfield(EEG, 'epochdescription'), EEG.epochdescription = {}; res = com; end + if ~isempty(EEG.epoch) + if isstruct(EEG.epoch), l = length( EEG.epoch); + else l = size( EEG.epoch, 2); + end + if l ~= EEG.trials + if popask( [ 'eeg_checkset error: the number of epoch indices in the epoch array/struct (' ... + int2str(l) ') is different from the number of epochs in the data (' int2str(EEG.trials) ').' 10 ... + 'Should EEGLAB attempt to abort operation ?' 10 '(press Cancel to fix the problem from the commandline)']) + error('eeg_checkset error: user abort'); + %res = com; + %EEG.epoch = []; + %EEG = eeg_checkset(EEG); + %return; + else + res = com; + return; + %error('eeg_checkset error: epoch structure size invalid'); + end + end + else + EEG.epoch = []; + end + + % check ica + % --------- + if ~isfield(EEG, 'icachansind') + if isempty(EEG.icaweights) + EEG.icachansind = []; res = com; + else + EEG.icachansind = [1:EEG.nbchan]; res = com; + end + elseif isempty(EEG.icachansind) + if isempty(EEG.icaweights) + EEG.icachansind = []; res = com; + else + EEG.icachansind = [1:EEG.nbchan]; res = com; + end + end + if ~isempty(EEG.icasphere) + if ~isempty(EEG.icaweights) + if size(EEG.icaweights,2) ~= size(EEG.icasphere,1) + if popask( [ 'eeg_checkset error: number of columns in weights array (' int2str(size(EEG.icaweights,2)) ')' 10 ... + 'does not match the number of rows in the sphere array (' int2str(size(EEG.icasphere,1)) ')' 10 ... + 'Should EEGLAB remove ICA information ?' 10 '(press Cancel to fix the problem from the commandline)']) + res = com; + EEG.icasphere = []; + EEG.icaweights = []; + EEG = eeg_checkset(EEG); + return; + else + error('eeg_checkset error: user abort'); + res = com; + return; + %error('eeg_checkset error: invalid weight and sphere array sizes'); + end + end + if isnumeric(EEG.data) + if length(EEG.icachansind) ~= size(EEG.icasphere,2) + if popask( [ 'eeg_checkset error: number of elements in ''icachansind'' (' int2str(length(EEG.icachansind)) ')' 10 ... + 'does not match the number of columns in the sphere array (' int2str(size(EEG.icasphere,2)) ')' 10 ... + 'Should EEGLAB remove ICA information ?' 10 '(press Cancel to fix the problem from the commandline)']) + res = com; + EEG.icasphere = []; + EEG.icaweights = []; + EEG = eeg_checkset(EEG); + return; + else + error('eeg_checkset error: user abort'); + res = com; + return; + %error('eeg_checkset error: invalid weight and sphere array sizes'); + end + end + if isempty(EEG.icaact) || (size(EEG.icaact,1) ~= size(EEG.icaweights,1)) || (size(EEG.icaact,2) ~= size(EEG.data,2)) + EEG.icaweights = double(EEG.icaweights); + EEG.icawinv = double(EEG.icawinv); + + % scale ICA components to RMS microvolt + if option_scaleicarms + if ~isempty(EEG.icawinv) + if mean(mean(abs(pinv(EEG.icaweights * EEG.icasphere)-EEG.icawinv))) < 0.0001 + disp('Scaling components to RMS microvolt'); + scaling = repmat(sqrt(mean(EEG(1).icawinv(:,:).^2))', [1 size(EEG.icaweights,2)]); + EEG.etc.icaweights_beforerms = EEG.icaweights; + EEG.etc.icasphere_beforerms = EEG.icasphere; + + EEG.icaweights = EEG.icaweights .* scaling; + EEG.icawinv = pinv(EEG.icaweights * EEG.icasphere); + end + end + end + + if ~isempty(EEG.data) && option_computeica + fprintf('eeg_checkset: recomputing the ICA activation matrix ...\n'); + res = com; + % Make compatible with Matlab 7 + if any(isnan(EEG.data(:))) + tmpdata = EEG.data(EEG.icachansind,:); + fprintf('eeg_checkset: recomputing ICA ignoring NaN indices ...\n'); + tmpindices = find(~sum(isnan(tmpdata))); % was: tmpindices = find(~isnan(EEG.data(1,:))); + EEG.icaact = zeros(size(EEG.icaweights,1), size(tmpdata,2)); EEG.icaact(:) = NaN; + EEG.icaact(:,tmpindices) = (EEG.icaweights*EEG.icasphere)*tmpdata(:,tmpindices); + else + EEG.icaact = (EEG.icaweights*EEG.icasphere)*EEG.data(EEG.icachansind,:); % automatically does single or double + end + EEG.icaact = reshape( EEG.icaact, size(EEG.icaact,1), EEG.pnts, EEG.trials); + end + end + end + if isempty(EEG.icawinv) + EEG.icawinv = pinv(EEG.icaweights*EEG.icasphere); % a priori same result as inv + res = com; + end + else + disp( [ 'eeg_checkset warning: weights matrix cannot be empty if sphere matrix is not, correcting ...' ]); + res = com; + EEG.icasphere = []; + end + if option_computeica + if ~isempty(EEG.icaact) && ndims(EEG.icaact) < 3 && (EEG.trials > 1) + disp( [ 'eeg_checkset note: independent component made 3-D' ]); + res = com; + EEG.icaact = reshape(EEG.icaact, size(EEG.icaact,1), EEG.pnts, EEG.trials); + end + else + if ~isempty(EEG.icaact) + fprintf('eeg_checkset: removing ICA activation matrix (as per edit options) ...\n'); + end + EEG.icaact = []; + end + else + if ~isempty( EEG.icaweights ), EEG.icaweights = []; res = com; end + if ~isempty( EEG.icawinv ), EEG.icawinv = []; res = com; end + if ~isempty( EEG.icaact ), EEG.icaact = []; res = com; end + end + if isempty(EEG.icaact) + EEG.icaact = []; + end + + % ------------- + % check chanlocs + % ------------- + if ~isfield(EEG, 'chaninfo') + EEG.chaninfo = []; + end + if ~isempty( EEG.chanlocs ) + + % reference (use EEG structure) + % --------- + if ~isfield(EEG, 'ref'), EEG.ref = ''; end + if strcmpi(EEG.ref, 'averef') + ref = 'average'; + else ref = ''; + end + if ~isfield( EEG.chanlocs, 'ref') + EEG.chanlocs(1).ref = ref; + end + charrefs = cellfun('isclass',{EEG.chanlocs.ref},'char'); + if any(charrefs) ref = ''; end + for tmpind = find(~charrefs) + EEG.chanlocs(tmpind).ref = ref; + end + if ~isstruct( EEG.chanlocs) + if exist( EEG.chanlocs ) ~= 2 + disp( [ 'eeg_checkset warning: channel file does not exist or is not in Matlab path: filename removed from EEG struct' ]); + EEG.chanlocs = []; + res = com; + else + res = com; + try, EEG.chanlocs = readlocs( EEG.chanlocs ); + disp( [ 'eeg_checkset: channel file read' ]); + catch, EEG.chanlocs = []; end + end + else + if ~isfield(EEG.chanlocs,'labels') + disp('eeg_checkset warning: no field label in channel location structure, removing it'); + EEG.chanlocs = []; + res = com; + end + end + if isstruct( EEG.chanlocs) + if length( EEG.chanlocs) ~= EEG.nbchan && length( EEG.chanlocs) ~= EEG.nbchan+1 && ~isempty(EEG.data) + disp( [ 'eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed' ]); + EEG.chanlocs = []; + res = com; + end + end + + % force Nosedir to +X (done here because of DIPFIT) + % ------------------- + if isfield(EEG.chaninfo, 'nosedir') + if ~strcmpi(EEG.chaninfo.nosedir, '+x') && all(isfield(EEG.chanlocs,{'X','Y','theta','sph_theta'})) + disp(['Note for expert users: Nose direction is now set from ''' upper(EEG.chaninfo.nosedir) ''' to default +X in EEG.chanlocs']); + [tmp chaninfo chans] = eeg_checkchanlocs(EEG.chanlocs, EEG.chaninfo); % Merge all channels for rotation (FID and data channels) + if strcmpi(chaninfo.nosedir, '+y') + rotate = 270; + elseif strcmpi(chaninfo.nosedir, '-x') + rotate = 180; + else + rotate = 90; + end + for index = 1:length(chans) + rotategrad = rotate/180*pi; + coord = (chans(index).Y + chans(index).X*sqrt(-1))*exp(sqrt(-1)*-rotategrad); + chans(index).Y = real(coord); + chans(index).X = imag(coord); + + if ~isempty(chans(index).theta) + chans(index).theta = chans(index).theta -rotate; + chans(index).sph_theta = chans(index).sph_theta+rotate; + if chans(index).theta <-180, chans(index).theta =chans(index).theta +360; end + if chans(index).sph_theta>180 , chans(index).sph_theta=chans(index).sph_theta-360; end + end + end + + if isfield(EEG, 'dipfit') + if isfield(EEG.dipfit, 'coord_transform') + if isempty(EEG.dipfit.coord_transform) + EEG.dipfit.coord_transform = [0 0 0 0 0 0 1 1 1]; + end + EEG.dipfit.coord_transform(6) = EEG.dipfit.coord_transform(6)+rotategrad; + end + end + + chaninfo.nosedir = '+X'; + [EEG.chanlocs EEG.chaninfo] = eeg_checkchanlocs(chans, chaninfo); % Update FID in chaninfo and remove them from chanlocs + end; + end + + % general checking of channels + % ---------------------------- + EEG = eeg_checkchanlocs(EEG); + if EEG.nbchan ~= length(EEG.chanlocs) + EEG.chanlocs = []; + EEG.chaninfo = []; + disp('Warning: the size of the channel location structure does not match with'); + disp(' number of channels. Channel information have been removed.'); + end + end + EEG.chaninfo.icachansind = EEG.icachansind; % just a copy for programming convinience + + %if ~isfield(EEG, 'urchanlocs') + % EEG.urchanlocs = EEG.chanlocs; + % for index = 1:length(EEG.chanlocs) + % EEG.chanlocs(index).urchan = index; + % end + % disp('eeg_checkset note: creating backup chanlocs structure (urchanlocs)'); + %end + + % Field 'datachan in 'urchanlocs' is removed, if exist + if isfield(EEG, 'urchanlocs') && ~isempty(EEG.urchanlocs) && isfield(EEG.urchanlocs, 'datachan') + EEG.urchanlocs = rmfield(EEG.urchanlocs, 'datachan'); + end + + % check reference + % --------------- + if ~isfield(EEG, 'ref') + EEG.ref = 'common'; + end + if ischar(EEG.ref) && strcmpi(EEG.ref, 'common') + if length(EEG.chanlocs) > EEG.nbchan + disp('Extra common reference electrode location detected'); + EEG.ref = EEG.nbchan+1; + end + end + + % DIPFIT structure + % ---------------- + if ~isfield(EEG,'dipfit') || isempty(EEG.dipfit) + EEG.dipfit = []; res = com; + else + try + % check if dipfitdefs is present + dipfitdefs; + if isfield(EEG.dipfit, 'vol') && ~isfield(EEG.dipfit, 'hdmfile') + if exist('pop_dipfit_settings') + disp('Old DIPFIT structure detected: converting to DIPFIT 2 format'); + EEG.dipfit.hdmfile = template_models(1).hdmfile; + EEG.dipfit.coordformat = template_models(1).coordformat; + EEG.dipfit.mrifile = template_models(1).mrifile; + EEG.dipfit.chanfile = template_models(1).chanfile; + EEG.dipfit.coord_transform = []; + EEG.saved = 'no'; + res = com; + end + end + if isfield(EEG.dipfit, 'hdmfile') + if length(EEG.dipfit.hdmfile) > 8 + if strcmpi(EEG.dipfit.hdmfile(end-8), template_models(1).hdmfile(end-8)), EEG.dipfit.hdmfile = template_models(1).hdmfile; end + if strcmpi(EEG.dipfit.hdmfile(end-8), template_models(2).hdmfile(end-8)), EEG.dipfit.hdmfile = template_models(2).hdmfile; end + end + if length(EEG.dipfit.mrifile) > 8 + if strcmpi(EEG.dipfit.mrifile(end-8), template_models(1).mrifile(end-8)), EEG.dipfit.mrifile = template_models(1).mrifile; end + if strcmpi(EEG.dipfit.mrifile(end-8), template_models(2).mrifile(end-8)), EEG.dipfit.mrifile = template_models(2).mrifile; end + end + if length(EEG.dipfit.chanfile) > 8 + if strcmpi(EEG.dipfit.chanfile(end-8), template_models(1).chanfile(end-8)), EEG.dipfit.chanfile = template_models(1).chanfile; end + if strcmpi(EEG.dipfit.chanfile(end-8), template_models(2).chanfile(end-8)), EEG.dipfit.chanfile = template_models(2).chanfile; end + end + end + + if isfield(EEG.dipfit, 'coord_transform') + if isempty(EEG.dipfit.coord_transform) + EEG.dipfit.coord_transform = [0 0 0 0 0 0 1 1 1]; + end + elseif ~isempty(EEG.dipfit) + EEG.dipfit.coord_transform = [0 0 0 0 0 0 1 1 1]; + end + catch + e = lasterror; + if ~strcmp(e.identifier,'MATLAB:UndefinedFunction') + % if we got some error aside from dipfitdefs not being present, rethrow it + rethrow(e); + end + end + end + + % check events (fast) + % ------------ + if isfield(EEG.event, 'type') + tmpevent = EEG.event(1:min(length(EEG.event), 100)); + if ~all(cellfun(@ischar, { tmpevent.type })) && ~all(cellfun(@isnumeric, { tmpevent.type })) + disp('Warning: converting all event types to strings'); + for ind = 1:length(EEG.event) + EEG.event(ind).type = num2str(EEG.event(ind).type); + end + EEG = eeg_checkset(EEG, 'eventconsistency'); + end + end + + % EEG.times (only for epoched datasets) + % --------- + if ~isfield(EEG, 'times') || isempty(EEG.times) || length(EEG.times) ~= EEG.pnts + EEG.times = linspace(EEG.xmin*1000, EEG.xmax*1000, EEG.pnts); + end + + if ~isfield(EEG, 'history') EEG.history = ''; res = com; end + if ~isfield(EEG, 'splinefile') EEG.splinefile = ''; res = com; end + if ~isfield(EEG, 'icasplinefile') EEG.icasplinefile = ''; res = com; end + if ~isfield(EEG, 'saved') EEG.saved = 'no'; res = com; end + if ~isfield(EEG, 'subject') EEG.subject = ''; res = com; end + if ~isfield(EEG, 'condition') EEG.condition = ''; res = com; end + if ~isfield(EEG, 'group') EEG.group = ''; res = com; end + if ~isfield(EEG, 'run') EEG.run = []; res = com; end + if ~isfield(EEG, 'session') EEG.session = []; res = com; end + if ~isfield(EEG, 'urchanlocs') EEG.urchanlocs = []; res = com; end + if ~isfield(EEG, 'specdata') EEG.specdata = []; res = com; end + if ~isfield(EEG, 'specicaact') EEG.specicaact = []; res = com; end + if ~isfield(EEG, 'comments') EEG.comments = ''; res = com; end + if ~isfield(EEG, 'etc' ) EEG.etc = []; res = com; end + if ~isfield(EEG, 'urevent' ) EEG.urevent = []; res = com; end + if ~isfield(EEG, 'ref') || isempty(EEG.ref) EEG.ref = 'common'; res = com; end + + % create fields if absent + % ----------------------- + if ~isfield(EEG, 'reject') EEG.reject.rejjp = []; res = com; end + + listf = { 'rejjp' 'rejkurt' 'rejmanual' 'rejthresh' 'rejconst', 'rejfreq' ... + 'icarejjp' 'icarejkurt' 'icarejmanual' 'icarejthresh' 'icarejconst', 'icarejfreq'}; + for index = 1:length(listf) + name = listf{index}; + elecfield = [name 'E']; + if ~isfield(EEG.reject, elecfield), EEG.reject.(elecfield) = []; res = com; end + if ~isfield(EEG.reject, name) + EEG.reject.(name) = []; + res = com; + elseif ~isempty(EEG.reject.(name)) && isempty(EEG.reject.(elecfield)) + % check if electrode array is empty with rejection array is not + nbchan = fastif(strcmp(name, 'ica'), size(EEG.icaweights,1), EEG.nbchan); + EEG.reject = setfield(EEG.reject, elecfield, zeros(nbchan, length(getfield(EEG.reject, name)))); res = com; + end + end + if ~isfield(EEG.reject, 'rejglobal') EEG.reject.rejglobal = []; res = com; end + if ~isfield(EEG.reject, 'rejglobalE') EEG.reject.rejglobalE = []; res = com; end + + % track version of EEGLAB + % ----------------------- + tmpvers = eeg_getversion; + if ~isfield(EEG.etc, 'eeglabvers') || ~isequal(EEG.etc.eeglabvers, tmpvers) + EEG.etc.eeglabvers = tmpvers; + EEG = eeg_hist( EEG, ['EEG.etc.eeglabvers = ''' tmpvers '''; % this tracks which version of EEGLAB is being used, you may ignore it'] ); + res = com; + end + + % default colors for rejection + % ---------------------------- + if ~isfield(EEG.reject, 'rejmanualcol') EEG.reject.rejmanualcol = [1.0000 1 0.783]; res = com; end + if ~isfield(EEG.reject, 'rejthreshcol') EEG.reject.rejthreshcol = [0.8487 1.0000 0.5008]; res = com; end + if ~isfield(EEG.reject, 'rejconstcol') EEG.reject.rejconstcol = [0.6940 1.0000 0.7008]; res = com; end + if ~isfield(EEG.reject, 'rejjpcol') EEG.reject.rejjpcol = [1.0000 0.6991 0.7537]; res = com; end + if ~isfield(EEG.reject, 'rejkurtcol') EEG.reject.rejkurtcol = [0.6880 0.7042 1.0000]; res = com; end + if ~isfield(EEG.reject, 'rejfreqcol') EEG.reject.rejfreqcol = [0.9596 0.7193 1.0000]; res = com; end + if ~isfield(EEG.reject, 'disprej') EEG.reject.disprej = { }; end + + if ~isfield(EEG, 'stats') EEG.stats.jp = []; res = com; end + if ~isfield(EEG.stats, 'jp') EEG.stats.jp = []; res = com; end + if ~isfield(EEG.stats, 'jpE') EEG.stats.jpE = []; res = com; end + if ~isfield(EEG.stats, 'icajp') EEG.stats.icajp = []; res = com; end + if ~isfield(EEG.stats, 'icajpE') EEG.stats.icajpE = []; res = com; end + if ~isfield(EEG.stats, 'kurt') EEG.stats.kurt = []; res = com; end + if ~isfield(EEG.stats, 'kurtE') EEG.stats.kurtE = []; res = com; end + if ~isfield(EEG.stats, 'icakurt') EEG.stats.icakurt = []; res = com; end + if ~isfield(EEG.stats, 'icakurtE') EEG.stats.icakurtE = []; res = com; end + + % component rejection + % ------------------- + if ~isfield(EEG.stats, 'compenta') EEG.stats.compenta = []; res = com; end + if ~isfield(EEG.stats, 'compentr') EEG.stats.compentr = []; res = com; end + if ~isfield(EEG.stats, 'compkurta') EEG.stats.compkurta = []; res = com; end + if ~isfield(EEG.stats, 'compkurtr') EEG.stats.compkurtr = []; res = com; end + if ~isfield(EEG.stats, 'compkurtdist') EEG.stats.compkurtdist = []; res = com; end + if ~isfield(EEG.reject, 'threshold') EEG.reject.threshold = [0.8 0.8 0.8]; res = com; end + if ~isfield(EEG.reject, 'threshentropy') EEG.reject.threshentropy = 600; res = com; end + if ~isfield(EEG.reject, 'threshkurtact') EEG.reject.threshkurtact = 600; res = com; end + if ~isfield(EEG.reject, 'threshkurtdist') EEG.reject.threshkurtdist = 600; res = com; end + if ~isfield(EEG.reject, 'gcompreject') EEG.reject.gcompreject = []; res = com; end + if length(EEG.reject.gcompreject) ~= size(EEG.icaweights,1) + EEG.reject.gcompreject = zeros(1, size(EEG.icaweights,1)); + end + + % remove old fields + % ----------------- + if isfield(EEG, 'averef'), EEG = rmfield(EEG, 'averef'); end + if isfield(EEG, 'rt' ), EEG = rmfield(EEG, 'rt'); end + + % store in new structure + % ---------------------- + if isstruct(EEG) + if ~exist('ALLEEGNEW','var') + ALLEEGNEW = EEG; + else + ALLEEGNEW(inddataset) = EEG; + end + end +end + +% recorder fields +% --------------- +fieldorder = { 'setname' ... + 'filename' ... + 'filepath' ... + 'subject' ... + 'group' ... + 'condition' ... + 'session' ... + 'comments' ... + 'nbchan' ... + 'trials' ... + 'pnts' ... + 'srate' ... + 'xmin' ... + 'xmax' ... + 'times' ... + 'data' ... + 'icaact' ... + 'icawinv' ... + 'icasphere' ... + 'icaweights' ... + 'icachansind' ... + 'chanlocs' ... + 'urchanlocs' ... + 'chaninfo' ... + 'ref' ... + 'event' ... + 'urevent' ... + 'eventdescription' ... + 'epoch' ... + 'epochdescription' ... + 'reject' ... + 'stats' ... + 'specdata' ... + 'specicaact' ... + 'splinefile' ... + 'icasplinefile' ... + 'dipfit' ... + 'history' ... + 'saved' ... + 'etc' }; + +for fcell = fieldnames(EEG)' + fname = fcell{1}; + if ~any(strcmp(fieldorder,fname)) + fieldorder{end+1} = fname; + end +end + +try + ALLEEGNEW = orderfields(ALLEEGNEW, fieldorder); + EEG = ALLEEGNEW; +catch + disp('Couldn''t order data set fields properly.'); +end + +if exist('ALLEEGNEW','var') + EEG = ALLEEGNEW; +end + +if ~isa(EEG, 'eegobj') && option_eegobject + EEG = eegobj(EEG); +end + +return; + +function num = popask( text ) +ButtonName=questdlg2( text, ... + 'Confirmation', 'Cancel', 'Yes','Yes'); +switch lower(ButtonName), + case 'cancel', num = 0; + case 'yes', num = 1; +end + +function res = mycellfun(com, vals, classtype); +res = zeros(1, length(vals)); +switch com + case 'isempty', + for index = 1:length(vals), res(index) = isempty(vals{index}); end + case 'isclass' + if strcmp(classtype, 'double') + for index = 1:length(vals), res(index) = isnumeric(vals{index}); end + else + error('unknown cellfun command'); + end + otherwise error('unknown cellfun command'); +end + + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_compare.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_compare.m new file mode 100644 index 0000000..13a7d20 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_compare.m @@ -0,0 +1,124 @@ +% eeg_compare - compare EEG structures. Output are shown on the command +% line regarding difference between the files. +% Usage: +% eeg_compare(EEG1, EEG2); +% +% Input: +% EEG1 - first EEGLAB structure +% EEG2 - second EEGLAB structure + +function eeg_compare(EEG, EEG2) + +%% Assess difference between datasets +fields = fieldnames(EEG); +for iField = 1:length(fields) + if ~isfield(EEG2, fields{iField}) + fprintf('Field %s missing in second dataset\n', fields{iField}); + else + if ~isequal(EEG.(fields{iField}), EEG2.(fields{iField})) + fprintf('Field %s differs\n', fields{iField}); + end + end +end +if ~isequal(EEG.xmin, EEG2.xmin), fprintf('Difference between xmin is %1.6f sec\n', EEG.xmin-EEG2.xmin); end +if ~isequal(EEG.xmax, EEG2.xmax), fprintf('Difference between xmax is %1.6f sec\n', EEG.xmax-EEG2.xmax); end + +% check chanlocs +[~,~,chanlocs1] = eeg_checkchanlocs( EEG.chanlocs, EEG.chaninfo); +[~,~,chanlocs2] = eeg_checkchanlocs( EEG2.chanlocs, EEG.chaninfo); +if length(chanlocs1) == length(chanlocs2) + differ = 0; + differLabel = 0; + for iChan = 1:length(chanlocs1) + if sum(abs([ chanlocs1(iChan).X chanlocs1(iChan).Y chanlocs1(iChan).Z] - ... + [ chanlocs2(iChan).X chanlocs2(iChan).Y chanlocs2(iChan).Z])) > 1e-12 + differ = differ+1; + end + if ~isequal(chanlocs1(iChan).labels, chanlocs2(iChan).labels) + differLabel = differLabel+1; + end + end + if differ + fprintf('%d channel coordinates differ\n', differ); + else + disp('All channel coordinates are OK'); + end + if differLabel + fprintf('%d channel label(s) differ\n', differLabel); + else + disp('All channel labels are OK'); + end +else + disp('Different numbers of channels'); +end + +% check events +if length(EEG.event) ~= length(EEG2.event) + disp('Different numbers of events'); +elseif isempty(EEG.event) + disp('All events OK (empty)'); +else + fields1 = fieldnames(EEG.event); + fields2 = fieldnames(EEG2.event); + allFieldsOK = true; + + if ~isequal(sort(fields1), sort(fields2)) + disp('Not the same number of event fields'); + allFieldsOK = false; + end + + for iField = 1:length(fields1) + if isfield(EEG.event, fields1{iField}) && isfield(EEG2.event, fields1{iField}) + diffVal = zeros(1,length(EEG.event)); + if strcmpi(fields1{iField}, 'latency') + for iEvent = 1:length(EEG.event) + diffVal(iEvent) = EEG.event(iEvent).(fields1{iField}) - EEG2.event(iEvent).(fields1{iField}); + end + else + for iEvent = 1:length(EEG.event) + diffVal(iEvent) = ~isequal(EEG.event(iEvent).(fields1{iField}), EEG2.event(iEvent).(fields1{iField})); + end + end + if any(diffVal ~= 0) + if strcmpi(fields1{iField}, 'latency') + fprintf('Event latency (%2.1f %%) are not OK (abs diff of these is %1.4f samples)\n', length(find(diffVal))/length(diffVal)*100, mean( abs(diffVal(diffVal ~=0 ))) ); + fprintf(' ******** (see plot)\n'); + figure; plot(diffVal); + else + fprintf('Event fields "%s" are NOT OK (%2.1f %% of them)\n', fields1{iField}, length(find(diffVal))/length(diffVal)*100); + end + allFieldsOK = false; + end + end + end + disp('All other events OK (unless warning above)'); +end + +% check epochs +if length(EEG.epoch) == length(EEG2.epoch) + if ~isempty(EEG.epoch) + fields1 = fieldnames(EEG.epoch); + fields2 = fieldnames(EEG2.epoch); + allFieldsOK = true; + if ~isequal(sort(fields1), sort(fields2)) + disp('Not the same number of event fields'); + allFieldsOK = false; + else + diffVal = []; + for iField = 1:length(fields1) + for iEpoch = 1:length(EEG.epoch) + diffVal(iEpoch) = ~isequal(EEG.epoch(iEpoch).(fields1{iField}), EEG2.epoch(iEpoch).(fields1{iField})); + end + if any(diffVal ~= 0) + fprintf('Epoch fields "%s" are NOT OK (%2.1f %% of them)\n', fields1{iField}, length(find(diffVal))/length(diffVal)*100); + allFieldsOK = false; + end + end + end + if allFieldsOK + disp('All epoch and all epoch fields are OK'); + end + end +elseif ~isempty(EEG.epoch) + disp('Different numbers of epochs'); +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_emptyset.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_emptyset.m new file mode 100644 index 0000000..ea09232 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_emptyset.m @@ -0,0 +1,93 @@ +% eeg_emptyset() - Initialize an EEG dataset structure with default values. +% +% Usage: +% >> EEG = eeg_emptyset(); +% +% Outputs: +% EEG - empty dataset structure with default values. +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 +% +% See also: eeglab() + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 01-25-02 reformated help & license -ad + +function EEG = eeg_emptyset(); + +EEG.setname = ''; +EEG.filename = ''; +EEG.filepath = ''; +EEG.subject = ''; +EEG.group = ''; +EEG.condition = ''; +EEG.session = []; +EEG.comments = ''; +EEG.nbchan = 0; +EEG.trials = 0; +EEG.pnts = 0; +EEG.srate = 1; +EEG.xmin = 0; +EEG.xmax = 0; +EEG.times = []; +EEG.data = []; +EEG.icaact = []; +EEG.icawinv = []; +EEG.icasphere = []; +EEG.icaweights = []; +EEG.icachansind = []; +EEG.chanlocs = []; +EEG.urchanlocs = []; +EEG.chaninfo = []; +EEG.ref = []; +EEG.event = []; +EEG.urevent = []; +EEG.eventdescription = {}; +EEG.epoch = []; +EEG.epochdescription = {}; +EEG.reject = []; +EEG.stats = []; +EEG.specdata = []; +EEG.specicaact = []; +EEG.splinefile = ''; +EEG.icasplinefile = ''; +EEG.dipfit = []; +EEG.history = ''; +EEG.saved = 'no'; +EEG.etc = []; + +%EEG.reject.threshold = [1 0.8 0.85]; +%EEG.reject.icareject = []; +%EEG.reject.compreject = []; +%EEG.reject.gcompreject= []; +%EEG.reject.comptrial = []; +%EEG.reject.sigreject = []; +%EEG.reject.elecreject = []; + +%EEG.stats.kurta = []; +%EEG.stats.kurtr = []; +%EEG.stats.kurtd = []; +%EEG.stats.eegentropy = []; +%EEG.stats.eegkurt = []; +%EEG.stats.eegkurtg = []; +%EEG.stats.entropy = []; +%EEG.stats.kurtc = []; +%EEG.stats.kurtt = []; +%EEG.stats.entropyc = []; + +return; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_optionsbackup.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_optionsbackup.m new file mode 100644 index 0000000..408ae76 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_optionsbackup.m @@ -0,0 +1,23 @@ +% eeg_options() - eeglab option script +% +% Note: DO NOT EDIT, instead use pop_editoptions() or the menu +% /File/Maximize memory in EEGLAB gui + +% STUDY and file options (set these checkboxes if you intend to work with studies) +option_storedisk = 0 ; % If set, keep at most one dataset in memory. This allows processing hundreds of datasets within studies. +option_savetwofiles = 1 ; % If set, save not one but two files for each dataset (header and data). This allows faster data loading in studies. +option_saveversion6 = 1 ; % If set, write Matlab files in Matlab v6.5 (max compatibility). If not, write files in Matlab v7.3 (larger than 2Gb). +% Memory options +option_single = 1 ; % If set, use single precision under Matlab 7.x. This saves RAM but can lead to rare numerical imprecisions. +option_memmapdata = 0 ; % If set, use memory mapped array under Matlab 7.x. This may slow down some computation (beta). +option_eegobject = 0 ; % If set, use the EEGLAB EEG object instead of the standard EEG structure (beta). +% ICA options +option_computeica = 1 ; % If set, precompute ICA activations. This requires more RAM but allows faster plotting of component activations. +option_scaleicarms = 1 ; % If set, scale ICA component activities to RMS (Root Mean Square) in microvolt (recommended). +% Folder options +option_rememberfolder = 1 ; % If set, when browsing to open a new dataset assume the folder/directory of previous dataset. +% Toolbox options +option_donotusetoolboxes = 0 ; % If set, do not use Matlab additional toolboxes functions even if they are present (need to restart EEGLAB). +% EEGLAB connectivity and support +option_checkversion = 1 ; % If set, check for new version of EEGLAB at startup. +option_chat = 0 ; % If set, enable EEGLAB chat - currently UCSD only - restart EEGLAB after changing that option. diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_point2lat.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_point2lat.m new file mode 100644 index 0000000..9f019c8 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/eeg_point2lat.m @@ -0,0 +1,91 @@ +% eeg_point2lat() - convert latency in data points to latency in ms relative +% to the time locking. Used in eeglab(). +% Usage: +% >> [newlat ] = eeg_point2lat( lat_array, [], srate); +% >> [newlat ] = eeg_point2lat( lat_array, epoch_array,... +% srate, timelimits, timeunit); +% Inputs: +% lat_array - latency array in data points assuming concatenated +% data epochs (see eeglab() event structure) +% epoch_array - epoch number corresponding to each latency value +% srate - data sampling rate in Hz +% timelimits - [min max] timelimits in 'timeunit' units (see below) +% timeunit - time unit in second. Default is 1 = seconds. +% +% Outputs: +% newlat - converted latency values (in 'timeunit' units) for each epoch +% +% Example: +% tmpevent = EEG.event; +% eeg_point2lat( [ tmpevent.latency ], [], EEG.srate, [EEG.xmin EEG.xmax]); +% % returns the latency of all events in second for a continuous +% % dataset EEG +% +% eeg_point2lat( [ tmpevent.latency ], [ tmpevent.epoch ], +% EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); +% % returns the latency of all events in millisecond for a dataset +% % containing data epochs. +% +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2 Mai 2002 +% +% See also: eeg_lat2point(), eeglab(), pop_editieventvals(), pop_loaddat() + +% Copyright (C) 2 Mai 2002 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function newlat = eeg_point2lat( lat_array, epoch_array, srate, timewin, timeunit); + +if nargin <3 + help eeg_point2lat; + return; +end; +if isempty( epoch_array ) + epoch_array = ones( size(lat_array) ); +end; +if nargin <4 + timewin = 0; +end; +if nargin <5 + timeunit = 1; +end; + +if length(lat_array) ~= length(epoch_array) + if length(epoch_array)~= 1 + disp('eeg_point2lat: latency and epoch arrays must have the same length'); return; + else + epoch_array = ones(1,length(lat_array))*epoch_array; + end; +end; +if length(timewin) ~= 2 + disp('eeg_point2lat: timelimits array must have length 2'); return; +end; +if iscell(epoch_array) + epoch_array = [ epoch_array{:} ]; +end; +if iscell(lat_array) + lat_array = [ lat_array{:} ]; +end + +timewin = timewin*timeunit; + +if length(timewin) == 2 + pnts = (timewin(2)-timewin(1))*srate+1; +else + pnts = 0; +end; +newlat = ((lat_array - (epoch_array-1)*pnts-1)/srate+timewin(1))/timeunit; +newlat = round(newlat*1E9)*1E-9; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/error_bc.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/error_bc.m new file mode 100644 index 0000000..a4b77ba --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/error_bc.m @@ -0,0 +1,2 @@ +function res = error_bc +res = false; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/fastif.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/fastif.m new file mode 100644 index 0000000..42e64d7 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/fastif.m @@ -0,0 +1,39 @@ +% fastif() - fast if function. +% +% Usage: +% >> res = fastif(test, s1, s2); +% +% Input: +% test - logical test with result 0 or 1 +% s1 - result if 1 +% s2 - result if 0 +% +% Output: +% res - s1 or s2 depending on the value of the test +% +% Author: Arnaud Delorme, CNL / Salk Institute, 2001 + +% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function res = fastif(s1, s2, s3); + +if s1 + res = s2; +else + res = s3; +end; +return; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/pop_editeventvals.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/pop_editeventvals.m new file mode 100644 index 0000000..a92bfd9 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/pop_editeventvals.m @@ -0,0 +1,656 @@ +% pop_editeventvals() - Edit events contained in an EEG dataset structure. +% If the dataset is the only input, a window pops up +% allowing the user to insert the relevant parameter values. +% +% Usage: >> EEGOUT = pop_editeventvals( EEG, 'key1', value1, ... +% 'key2', value2, ... ); +% Input: +% EEG - EEG dataset +% +% Optional inputs: +% 'sort' - { field1 dir1 field2 dir2 } Sort events based on field1 +% then on optional field2. Arg dir1 indicates the sort +% direction (0 = increasing, 1 = decreasing). +% 'changefield' - {num field value} Insert the given value into the specified +% field in event num. (Ex: {34 'latency' 320.4}) +% 'changeevent' - {num value1 value2 value3 ...} Change the values of +% all fields in event num. +% 'add','append','insert' - {num value1 value2 value3 ...} Insert event +% before or at event num, and assign value to structure +% fields. Note that the latency field must be in second +% and will be converted to data sample. Note also that +% the index of the event is often irrelevant, as events +% will be automatically resorted by latencies. +% 'delete' - vector of indices of events to delete +% +% Outputs: +% EEGOUT - EEG dataset with the selected events only +% +% Ex: EEG = pop_editeventvals(EEG,'changefield', { 1 'type' 'target'}); +% % set field type of event number 1 to 'target' +% +% Author: Arnaud Delorme & Hilit Serby, SCCN, UCSD, 15 March 2002 +% +% See also: pop_selectevent(), pop_importevent() + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 15 March 2002, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 03-16-02 text interface editing -sm & ad +% 03-18-02 automatic latency switching display (epoch/continuous) - ad & sm +% 03-18-02 debug soring order - ad +% 03-18-02 put latencies in ms - ad, lf & sm +% 03-29-02 debug latencies in ms - ad & sm +% 04-02-02 debuging test - ad & sm + +function [EEG, com] = pop_editeventvals(EEG, varargin); + +com =''; +if nargin < 1 + help pop_editeventvals; + return; +end; + +if nargin >= 2 | isstr(EEG) % interpreting command from GUI or command line + + if isstr(EEG) % GUI + gui = 1; + varargin = { EEG varargin{:} }; + + % user data + % --------- + userdata = get(gcf, 'userdata'); + EEG = userdata{1}; + oldcom = userdata{2}; + allfields = fieldnames(EEG.event); + tmpind = strmatch('urevent', allfields); + allfields(tmpind) = []; + + % current event + % ------------- + objevent = findobj('parent', gcf, 'tag', 'numval'); + valnum = str2num(get(objevent, 'string')); + shift = 0; + + else % command line + + gui = 0; + if isempty(EEG.event) + disp('Getevent: cannot deal with empty event structure'); + return; + end; + + allfields = fieldnames(EEG.event); + tmpind = strmatch('urevent', allfields); + allfields(tmpind) = []; + + end; + + % retinterpret inputs (fix BUG 454) + % -------------------------------- + if ~gui + newvararg = {}; + for indfield = 1:2:length(varargin) + + com = varargin{ indfield }; + tmpargs = varargin{ indfield+1 }; + newvararg = { newvararg{:} com }; + + if any(strcmpi({'add','insert','append'},com)) + evtind = tmpargs{1}; + fields = fieldnames(EEG.event); + emptycells = cell(1,length(fields)-1); + newvararg = { newvararg{:}, { evtind emptycells{:} } }; + if strcmpi(com, 'append'), evtind = evtind+1; end; + + for ind = 2:length( tmpargs ) + if ~strcmpi(fields{ind-1}, 'urevent') + newvararg = { newvararg{:},'changefield',{ evtind fields{ind-1} tmpargs{ind} } }; + end; + end; + else + newvararg = { newvararg{:} tmpargs }; + end; + end; + varargin = newvararg; + end; + + % scan inputs + % ----------- + for indfield = 1:2:length(varargin) + if length(varargin) >= indfield+1 + tmparg = varargin{ indfield+1 }; + end; + + switch lower(varargin{indfield}) + + case 'goto', % ******************** GUI ONLY *********************** + + % shift time + % ---------- + shift = tmparg; + valnum = valnum + shift; + if valnum < 1, valnum = 1; end; + if valnum > length(EEG.event), valnum = length(EEG.event); end; + set(objevent, 'string', num2str(valnum,5)); + + % update fields + % ------------- + for index = 1:length(allfields) + + enable = 'on'; + if isfield(EEG.event, 'type') + if strcmpi(EEG.event(valnum).type, 'boundary'), enable = 'off'; end; + end; + if strcmp( allfields{index}, 'latency') & ~isempty(EEG.event(valnum).latency) + if isfield(EEG.event, 'epoch') + value = eeg_point2lat( EEG.event(valnum).latency, EEG.event(valnum).epoch, ... + EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); + else value = (EEG.event(valnum).latency-1)/EEG.srate+EEG.xmin; + end; + elseif strcmp( allfields{index}, 'duration') & ~isempty(EEG.event(valnum).duration) + if isfield(EEG.event, 'epoch') + value = EEG.event(valnum).duration/EEG.srate*1000; % milliseconds + else value = EEG.event(valnum).duration/EEG.srate; % seconds + end; + else + value = getfield( EEG.event(valnum), allfields{index}); + end; + + % update interface + % ---------------- + tmpobj = findobj('parent', gcf, 'tag', allfields{index}); + set(tmpobj, 'string', num2str(value,5), 'enable', enable); + end; + + % update original + % --------------- + tmpobj = findobj('parent', gcf, 'tag', 'original'); + if isfield(EEG.event, 'urevent') & EEG.event(valnum).urevent ~= valnum + set(tmpobj, 'string', [ 'originally ' int2str(EEG.event(valnum).urevent)], ... + 'horizontalalignment', 'center'); + else set(tmpobj, 'string', ' '); + end; + return; % NO NEED TO SAVE ANYTHING + + case { 'append' 'insert' 'add' }, % ********************************************************** + + if gui + shift = tmparg; % shift is for adding before or after the event + + % add epoch number if data epoch + % ------------------------------ + tmpcell = cell(1,1+length(fieldnames(EEG.event))); + tmpcell{1} = valnum; + if EEG.trials > 1 + indepoch = strmatch('epoch', fieldnames(EEG.event), 'exact'); + if valnum > 1, tmpprevval = valnum-1; + else tmpprevval = valnum+1; + end; + if tmpprevval <= length(EEG.event) + tmpcell{indepoch+1} = EEG.event(tmpprevval).epoch; + end; + end; + + % update commands + % --------------- + if shift + oldcom = { oldcom{:} 'append', tmpcell }; + else + oldcom = { oldcom{:} 'insert', tmpcell }; + end; + else + if strcmpi(lower(varargin{indfield}), 'append') % not 'add' for backward compatibility + shift = 1; + else shift = 0; + end; + valnum = tmparg{1}; + end; + + % find ur index + % ------------- + valnum = valnum + shift; + if isfield(EEG.event, 'epoch'), curepoch = EEG.event(valnum).epoch; end; + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + % find non empty urvalnum + urvalnum = []; + count = 0; + while isempty(urvalnum) + tmpindex = mod(valnum+count-1, length(EEG.event)+1)+1; + urvalnum = EEG.event(valnum+count).urevent; + count = count+1; + end; + if isfield(EEG.urevent, 'epoch'), urcurepoch = EEG.urevent(urvalnum).epoch; end; + urvalnum = urvalnum; + end; + + % update urevents + % --------------- + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + EEG.urevent(end+3) = EEG.urevent(end); + EEG.urevent(urvalnum+1:end-2) = EEG.urevent(urvalnum:end-3); + EEG.urevent(urvalnum) = EEG.urevent(end-1); + EEG.urevent = EEG.urevent(1:end-2); + if isfield(EEG.urevent, 'epoch'), EEG.urevent(urvalnum).epoch = urcurepoch; end; + end; + + % update events + % ------------- + EEG.event(end+3) = EEG.event(end); + EEG.event(valnum+1:end-2) = EEG.event(valnum:end-3); + EEG.event(valnum) = EEG.event(end-1); + EEG.event = EEG.event(1:end-2); + if isfield(EEG.event, 'epoch'), EEG.event(valnum).epoch = curepoch; end; + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + EEG.event(valnum).urevent = urvalnum; + for index = valnum+1:length(EEG.event) + EEG.event(index).urevent = EEG.event(index).urevent+1; + end; + end; + + % update type field + % ----------------- + for tmpind = 1:length(allfields) + EEG.event = checkconsistency(EEG.event, valnum, allfields{tmpind}); + end; + + case 'delete', % ********************************************************** + + if ~gui + valnum = tmparg; + end + + EEG.event(valnum) = []; + + if gui, + + valnum = min(valnum,length(EEG.event)); + set(objevent, 'string', num2str(valnum)); + + % update commands + % --------------- + oldcom = { oldcom{:} 'delete', valnum }; + + end; + + case { 'assign' 'changefield' }, % ********************************************************** + + if gui, % GUI case + + field = tmparg; + objfield = findobj('parent', gcf, 'tag', field); + editval = get(objfield, 'string'); + if ~isempty(editval) & ~isempty(str2num(editval)), editval = str2num(editval); end; + + % update history + % -------------- + oldcom = { oldcom{:},'changefield',{ valnum field editval }}; + + else % command line case + + valnum = tmparg{1}; + field = tmparg{2}; + editval = tmparg{3}; + + end; + + % latency and duration case + % ------------------------- + if strcmp( field, 'latency') & ~isempty(editval) + if isfield(EEG.event, 'epoch') + editval = eeg_lat2point( editval, EEG.event(valnum).epoch, ... + EEG.srate, [EEG.xmin EEG.xmax]*1000, 1E-3); + else editval = (editval- EEG.xmin)*EEG.srate+1; + end; + end; + if strcmp( field, 'duration') & ~isempty(editval) + if isfield(EEG.event, 'epoch') + editval = editval/1000*EEG.srate; % milliseconds + else editval = editval*EEG.srate; % seconds + end; + end; + + % adapt to other formats + % ---------------------- + EEG.event(valnum) = setfield(EEG.event(valnum), field, editval); + EEG.event = checkconsistency(EEG.event, valnum, field); + + % update urevents + % --------------- + if isfield(EEG, 'urevent') & isfield(EEG.event, 'urevent') + urvalnum = EEG.event(valnum).urevent; + + % latency case + % ------------ + if strcmp( field, 'latency') & ~isempty(editval) + if isfield(EEG.urevent, 'epoch') + urepoch = EEG.urevent(urvalnum).epoch; + + + % find closest event latency + % -------------------------- + if valnum1 + if EEG.event(valnum-1).epoch == urepoch + urlatency = EEG.urevent(EEG.event(valnum-1).urevent).latency; + latency = EEG.event(valnum-1).latency; + end; + end; + + % update event + % ------------ + if exist('urlatency') ~=1 + disp('Urevent not updated: could not find other event in the epoch'); + else + editval = urlatency - ( latency - editval ); % new latency value + end; + else + editval = eeg_urlatency(EEG.event, EEG.event(valnum).latency); + end; + elseif strcmp( field, 'latency') % empty editval + EEG.event(valnum).latency = NaN; + end; + + % duration case + % ------------ + if strcmp( field, 'duration') & ~isempty(editval) + if isfield(EEG.event, 'epoch') + editval = editval/1000*EEG.srate; % milliseconds -> point + else editval = editval*EEG.srate; % seconds -> point + end; + end; + EEG.urevent = setfield(EEG.urevent, {urvalnum}, field, editval); + end; + + case 'sort', % ********************************************************** + + if gui % retrieve data + + field1 = get(findobj('parent', gcf, 'tag', 'listbox1'), 'value'); + field2 = get(findobj('parent', gcf, 'tag', 'listbox2'), 'value'); + dir1 = get(findobj('parent', gcf, 'tag', 'order1'), 'value'); + dir2 = get(findobj('parent', gcf, 'tag', 'order2'), 'value'); + + if field1 > 1, field1 = allfields{field1-1}; else return; end; + if field2 > 1, field1 = allfields{field2-1}; else field2 = []; end; + + % update history + % -------------- + oldcom = { oldcom{:},'sort',{ field1 dir1 field2 dir2 } }; + + else % command line + field1 = tmparg{1}; + if length(tmparg) < 2, dir1 = 0; + else dir1 = tmparg{2}; + end; + if length(tmparg) < 3, field2 = []; + else field2 = tmparg{3}; + end; + if length(tmparg) < 4, dir2 = 0; + else dir2 = tmparg{4}; + end; + end; + + % Toby edit 11/16/2005 This section is scrambling the eeg.event + % fields. Requires further investigation. + + if ~isempty(field2) + tmpevent = EEG.event; + if ~ischar(EEG.event(1).(field2)) + tmparray = [ tmpevent.(field2) ]; + else tmparray = { tmpevent.(field2) }; + end + % Commented out 11/18/2005, Toby + % These lines were incorrectly sorting the event.latency field in + % units of time (seconds) relevant to each event's relative + % latency time as measured from the start of each epoch. It is + % possible that there are occasions when it is desirable to do + % so, but in the case of pop_mergset() it is not. + + %if strcmp(field2, 'latency') & EEG.trials > 1 + % tmparray = eeg_point2lat(tmparray, {EEG.event.epoch}, EEG.srate, [EEG.xmin EEG.xmax], 1); + %end; + [X I] = mysort( tmparray ); + if dir2 == 1, I = I(end:-1:1); end; + events = EEG.event(I); + else + events = EEG.event; + end; + tmpevent = EEG.event; + if ~ischar(EEG.event(1).(field1)) + tmparray = [ tmpevent.(field1) ]; + else tmparray = { tmpevent.(field1) }; + end + % Commented out 11/18/2005, Toby + %if strcmp( field1, 'latency') & EEG.trials > 1 + % tmparray = eeg_point2lat(tmparray, {events.epoch}, EEG.srate, [EEG.xmin EEG.xmax], 1); + %end; + [X I] = mysort( tmparray ); + if dir1 == 1, I = I(end:-1:1); end; + EEG.event = events(I); + + + if gui + % warn user + % --------- + warndlg2('Sorting done'); + else + noeventcheck = 1; % otherwise infinite recursion with eeg_checkset + end; + + end; % end switch + end; % end loop + + % save userdata + % ------------- + if gui + userdata{1} = EEG; + userdata{2} = oldcom; + set(gcf, 'userdata', userdata); + pop_editeventvals('goto', shift); + else + if ~exist('noeventcheck','var') + EEG = eeg_checkset(EEG, 'eventconsistency'); + EEG = eeg_checkset(EEG, 'checkur'); + end; + end; + return; +end; + +% ---------------------- +% graphic interface part +% ---------------------- + +if isempty(EEG.event) + disp('Getevent: cannot deal with empty event structure'); + return; +end; + +allfields = fieldnames(EEG.event); +tmpind = strmatch('urevent', allfields); +allfields(tmpind) = []; + +if nargin<2 + % add field values + % ---------------- + geometry = { [2 0.5] }; + tmpstr = sprintf('Edit event field values (currently %d events)',length(EEG.event)); + uilist = { { 'Style', 'text', 'string', tmpstr, 'fontweight', 'bold' } ... + { 'Style', 'pushbutton', 'string', 'Delete event', 'callback', 'pop_editeventvals(''delete'');' }}; + + for index = 1:length(allfields) + + geometry = { geometry{:} [1 1 1 1] }; + + % input string + % ------------ + if strcmp( allfields{index}, 'latency') | strcmp( allfields{index}, 'duration') + if EEG.trials > 1 + inputstr = [ allfields{index} ' (ms)']; + else inputstr = [ allfields{index} ' (sec)']; + end; + else inputstr = allfields{index}; + end; + + % callback for displaying help + % ---------------------------- + if index <= length( EEG.eventdescription ) + tmptext = EEG.eventdescription{ index }; + if ~isempty(tmptext) + if size(tmptext,1) > 15, stringtext = [ tmptext(1,1:15) '...' ]; + else stringtext = tmptext(1,:); + end; + else stringtext = 'no-description'; tmptext = 'no-description'; + end; + else stringtext = 'no-description'; tmptext = 'no-description'; + end; + cbbutton = ['questdlg2(' vararg2str(tmptext) ... + ',''Description of field ''''' allfields{index} ''''''', ''OK'', ''OK'');' ]; + + % create control + % -------------- + cbedit = [ 'pop_editeventvals(''assign'', ''' allfields{index} ''');' ]; + uilist = { uilist{:}, { }, ... + { 'Style', 'pushbutton', 'string', inputstr, 'callback',cbbutton }, ... + { 'Style', 'edit', 'tag', allfields{index}, 'string', '', 'callback', cbedit } ... + { } }; + end; + + % add buttons + % ----------- + geometry = { geometry{:} [1] [1.2 0.6 0.6 1 0.6 0.6 1.2] [1.2 0.6 0.6 1 0.6 0.6 1.2] [2 1 2] }; + + tpappend = 'Append event after the current event'; + tpinsert = 'Insert event before the current event'; + tporigin = 'Original index of the event (in EEG.urevent table)'; + uilist = { uilist{:}, ... + { }, ... + { },{ },{ }, {'Style', 'text', 'string', 'Event Num', 'fontweight', 'bold' }, { },{ },{ }, ... + { 'Style', 'pushbutton', 'string', 'Insert event', 'callback', 'pop_editeventvals(''append'', 0);', 'tooltipstring', tpinsert }, ... + { 'Style', 'pushbutton', 'string', '<<', 'callback', 'pop_editeventvals(''goto'', -10);' }, ... + { 'Style', 'pushbutton', 'string', '<', 'callback', 'pop_editeventvals(''goto'', -1);' }, ... + { 'Style', 'edit', 'string', '1', 'callback', 'pop_editeventvals(''goto'', 0);', 'tag', 'numval' }, ... + { 'Style', 'pushbutton', 'string', '>', 'callback', 'pop_editeventvals(''goto'', 1);' }, ... + { 'Style', 'pushbutton', 'string', '>>', 'callback', 'pop_editeventvals(''goto'', 10);' }, ... + { 'Style', 'pushbutton', 'string', 'Append event', 'callback', 'pop_editeventvals(''append'', 1);', 'tooltipstring', tpappend }, ... + { }, { 'Style', 'text', 'string', ' ', 'tag', 'original' 'horizontalalignment' 'center' 'tooltipstring' tporigin } { } }; + + % add sorting options + % ------------------- + listboxtext = 'No field selected'; + for index = 1:length(allfields) + listboxtext = [ listboxtext '|' allfields{index} ]; + end; + geometry = { geometry{:} [1] [1 1 1] [1 1 1] [1 1 1] }; + uilist = { uilist{:}, ... + { 'Style', 'text', 'string', 'Re-order events (for review only)', 'fontweight', 'bold' }, ... + { 'Style', 'text', 'string', 'Main sorting field:' }, ... + { 'Style', 'popupmenu', 'string', listboxtext, 'tag', 'listbox1' }, ... + { 'Style', 'checkbox', 'string', 'Click for decreasing order', 'tag', 'order1' } ... + { 'Style', 'text', 'string', 'Secondary sorting field:' }, ... + { 'Style', 'popupmenu', 'string', listboxtext, 'tag', 'listbox2' }, ... + { 'Style', 'checkbox', 'string', 'Click for decreasing order', 'tag', 'order2' }, ... + { } { 'Style', 'pushbutton', 'string', 'Re-sort', 'callback', 'pop_editeventvals(''sort'');' }, ... + { } }; + + userdata = { EEG {} }; + inputgui( geometry, uilist, 'pophelp(''pop_editeventvals'');', ... + 'Edit event values -- pop_editeventvals()', userdata, 'plot'); + pop_editeventvals('goto', 0); + + % wait for figure + % --------------- + fig = gcf; + waitfor( findobj('parent', fig, 'tag', 'ok'), 'userdata'); + try, userdata = get(fig, 'userdata'); close(fig); % figure still exist ? + catch, return; end; + + % transfer events + % --------------- + if ~isempty(userdata{2}) + com = sprintf('%s = pop_editeventvals(%s,%s);', inputname(1), inputname(1), vararg2str(userdata{2})); + end; + if isempty(findstr('''sort''', com)) + if ~isempty(userdata{2}) % some modification have been done + EEG = userdata{1}; + disp('Checking event consistency...'); + EEG = eeg_checkset(EEG, 'eventconsistency'); + EEG = eeg_checkset(EEG, 'checkur'); + end; + else + com = ''; + disp('WARNING: all edits discarded because of event resorting. The EEGLAB event structure'); + disp(' must contain events sorted by latency (you may obtain an event structure'); + disp(' with resorted event by calling this function from the command line).'); + end; + return; + +end; +return; + +% format the output field +% ----------------------- +function strval = reformat( val, latencycondition, trialcondition, eventnum) + if latencycondition + if trialcondition + strval = ['eeg_lat2point(' num2str(val) ', EEG.event(' int2str(eventnum) ').epoch, EEG.srate,[EEG.xmin EEG.xmax]*1000, 1E-3);' ]; + else + strval = [ '(' num2str(val) '-EEG.xmin)*EEG.srate+1;' ]; + end; + else + if isstr(val), strval = [ '''' val '''' ]; + else strval = num2str(val); + end; + end; + +% sort also empty values +% ---------------------- +function [X, I] = mysort(tmparray); + if iscell(tmparray) + if all(cellfun('isreal', tmparray)) + tmpempty = cellfun('isempty', tmparray); + tmparray(tmpempty) = { 0 }; + tmparray = [ tmparray{:} ]; + end; + end; + try, + [X I] = sort(tmparray); + catch, + disp('Sorting failed. Check that selected fields contain uniform value format.'); + X = tmparray; + I = 1:length(X); + end; + +% checkconsistency of new event +% ----------------------------- +function eventtmp = checkconsistency(eventtmp, valnum, field) + + otherval = mod(valnum+1, length(eventtmp))+1; + + if isstr(getfield(eventtmp(valnum), field)) & ~isstr(getfield(eventtmp(otherval), field)) + eventtmp(valnum) = setfield(eventtmp(valnum), field, str2num(getfield(eventtmp(valnum), field))); + end; + if ~isstr(getfield(eventtmp(valnum), field)) & isstr(getfield(eventtmp(otherval), field)) + eventtmp(valnum) = setfield(eventtmp(valnum), field, num2str(getfield(eventtmp(valnum), field))); + end; + if strcmpi(field, 'latency') & isempty(getfield(eventtmp(valnum), field)) + eventtmp(valnum).latency = NaN; + end; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/pop_fileio2.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/pop_fileio2.m new file mode 100644 index 0000000..f25bc1c --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/pop_fileio2.m @@ -0,0 +1,278 @@ +% pop_fileio() - import data files into EEGLAB using FileIO +% +% Usage: +% >> OUTEEG = pop_fileio; % pop up window +% >> OUTEEG = pop_fileio( filename ); +% >> OUTEEG = pop_fileio( header, dat, evt ); +% +% Inputs: +% filename - [string] file name +% header - fieldtrip data header +% data - fieldtrip raw data +% evt - fieldtrip event structure +% +% Optional inputs: +% 'channels' - [integer array] list of channel indices +% 'samples' - [min max] sample point limits for importing data +% 'trials' - [min max] trial's limit for importing data +% 'dataformat' - [string] data format. Default is automatic. Available +% choices are available in ft_read_data +% 'memorymapped' - ['on'|'off'] import memory mapped file (useful if +% encountering memory errors). Default is 'off'. +% +% Outputs: +% OUTEEG - EEGLAB data structure +% +% Author: Arnaud Delorme, SCCN, INC, UCSD, 2008- +% +% Note: FILEIO toolbox must be installed. + +% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD, arno@salk.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +function [EEG, command] = pop_fileio(filename, varargin) +EEG = []; +command = ''; + +if ~plugin_askinstall('Fileio', 'ft_read_data'), return; end + +alldata = []; +event = []; +if nargin < 1 + % ask user + ButtonName = questdlg2('Do you want to import a file or a folder?', ... + 'FILE-IO import', ... + 'Folder', 'File', 'File'); + if strcmpi(ButtonName, 'file') + [filename, filepath] = uigetfile('*.*', 'Choose a file or header file -- pop_fileio()'); + drawnow; + if filename(1) == 0 return; end + filename = fullfile(filepath, filename); + else + filename = uigetdir('*.*', 'Choose a folder -- pop_fileio()'); + drawnow; + if filename(1) == 0 return; end + end + + % open file to get infos + % ---------------------- + formats = { 'auto' '4d' '4d_pdf' '4d_m4d' '4d_xyz' 'bci2000_dat' 'besa_avr' 'besa_swf' 'biosemi_bdf' 'bham_bdf' 'biosemi_old' 'biosig' ... + 'gdf' 'brainvision_eeg' 'brainvision_dat' 'brainvision_seg' 'ced_son' 'deymed_ini' 'deymed_dat' 'emotiv_mat' 'gtec_mat' ... + 'itab_raw' 'combined_ds' 'ctf_ds' 'ctf_meg4' 'ctf_res4' 'ctf_old' 'read_ctf_meg4' 'ctf_read_meg4' 'ctf_shm' 'dataq_wdq' ... + 'eeglab_set' 'eeglab_erp' 'spmeeg_mat' 'ced_spike6mat' 'edf' 'eep_avr' 'eep_cnt' 'eyelink_asc' 'fcdc_buffer' 'fcdc_buffer_offline' ... + 'fcdc_matbin' 'fcdc_mysql' 'egi_egia' 'egi_egis' 'egi_sbin' 'egi_mff_v1' 'egi_mff_v2' 'micromed_trc' 'mpi_ds' 'mpi_dap' ... + 'netmeg' 'neuralynx_dma' 'neuralynx_sdma' 'neuralynx_ncs' 'neuralynx_nse' 'neuralynx_nte' 'neuralynx_ttl' 'neuralynx_tsl' ... + 'neuralynx_tsh' 'neuralynx_bin' 'neuralynx_ds' 'neuralynx_cds' 'nexstim_nxe' 'ns_avg' 'ns_cnt' 'ns_cnt16' 'ns_cnt32' 'ns_eeg' ... + 'neuromag_fif' 'neuromag_mne' 'neuromag_mex' 'neuroprax_eeg' 'plexon_ds' 'plexon_ddt' 'read_nex_data' 'read_plexon_nex' 'plexon_nex' ... + 'plexon_plx' 'yokogawa_ave' 'yokogawa_con' 'yokogawa_raw' 'nmc_archive_k' 'neuroshare' 'bucn_nirs' 'riff_wave' 'neurosim_ds' ... + 'neurosim_signals' 'neurosim_evolution' 'neurosim_spikes' 'manscan_mb2' 'manscan_mbi' 'neuroscope_bin' }; + + eeglab_options; + mmoval = option_memmapdata; + disp('Reading data file header...'); + dat = ft_read_header(filename); + valueFormat = 1; + if strcmpi(filename(end-2:end), 'mff') + valueFormat = 48; + end + uilist = { { 'style' 'text' 'String' 'Channel list (defaut all):' } ... + { 'style' 'edit' 'string' '' } ... + { 'style' 'text' 'String' [ 'Data range (in sample points) (default all [1 ' int2str(dat.nSamples) '])' ] } ... + { 'style' 'edit' 'string' '' } ... + }; + geom = { [3 1.5] [3 1.5] }; + if dat.nTrials > 1 + uilist{end+1} = { 'style' 'text' 'String' [ 'Trial range (default all [1 ' int2str(dat.nTrials) '])' ] }; + uilist{end+1} = { 'style' 'edit' 'string' '' }; + geom = { geom{:} [3 1.5] }; + end + uilist = { uilist{:} ... + { 'style' 'text' 'String' 'Data format' } ... + { 'style' 'popupmenu' 'string' formats 'value' valueFormat 'listboxtop' valueFormat } ... + { 'style' 'checkbox' 'String' 'Import as memory mapped file (use in case of out of memory) - beta' 'value' option_memmapdata } }; + geom = { geom{:} [3 1.5] [1] }; + + result = inputgui( geom, uilist, 'pophelp(''pop_fileio'')', 'Load data using FILE-IO -- pop_fileio()'); + if length(result) == 0 return; end + if dat.nTrials <= 1 + result = { result{1:2} [] result{3:end} }; + end + options = {}; + if length(result) == 3, result = { result{1:2} '' result{3}}; end + if ~isempty(result{1}), options = { options{:} 'channels' eval( [ '[' result{1} ']' ] ) }; end + if ~isempty(result{2}), options = { options{:} 'samples' eval( [ '[' result{2} ']' ] ) }; end + if ~isempty(result{3}), options = { options{:} 'trials' eval( [ '[' result{3} ']' ] ) }; end + if ~isempty(result{4}), options = { options{:} 'dataformat' formats{result{4}} }; end + if result{5}, options = { options{:} 'memorymapped' fastif(result{5}, 'on', 'off') }; end +else + if ~isstruct(filename) + dat = ft_read_header(filename); + options = varargin; + else + dat = filename; + filename = ''; + alldata = varargin{1}; + options = {}; + if nargin >= 3 + event = varargin{2}; + end + end +end + +% decode imput parameters +% ----------------------- +g = struct(options{:}); +if ~isfield(g, 'samples'), g.samples = []; end +if ~isfield(g, 'trials'), g.trials = []; end +if ~isfield(g, 'channels'), g.channels = []; end +if ~isfield(g, 'dataformat'), g.dataformat = 'auto'; end +if ~isfield(g, 'memorymapped'), g.memorymapped = 'off'; end + +% import data +% ----------- +EEG = eeg_emptyset; +fprintf('Reading data ...\n'); +dataopts = {}; +% In case of FIF files convert EEG channel units to uV in FT options +[trash1, trash2, filext] = fileparts(filename); clear trash1 trash2; +if strcmpi(filext,'.fif') + eegchanindx = find(strcmpi(dat.chantype,'eeg')); + if ~isempty(eegchanindx) && isfield (dat,'chanunit') + if ~all(strcmpi(dat.chanunit(eegchanindx),'uv')) + fprintf('Forcing EEG channel units to ''uV'' ...... \n'); + chanunitval = dat.chanunit; + chanunitval(eegchanindx) = {'uV'}; + dataopts = { dataopts{:} 'chanunit', chanunitval}; + else + fprintf('EEG channel units already in ''uV'' \n'); + end + end +end +if ~isempty(g.samples ), dataopts = { dataopts{:} 'begsample', g.samples(1), 'endsample', g.samples(2)}; end +if ~isempty(g.trials ), dataopts = { dataopts{:} 'begtrial', g.trials(1), 'endtrial', g.trials(2)}; end +if ~strcmpi(g.dataformat, 'auto'), dataopts = { dataopts{:} 'dataformat' g.dataformat }; end +if strcmpi(g.memorymapped, 'off') || ~isempty(alldata) + if ~isempty(g.channels), dataopts = { dataopts{:} 'chanindx', g.channels }; end + if isempty(alldata) + alldata = ft_read_data(filename, 'header', dat, dataopts{:}); + end +else + % read memory mapped file + g.datadims = [ dat.nChans dat.nSamples dat.nTrials ]; + disp('Importing as memory mapped array, this may take a while...'); + if isempty(g.channels), g.channels = [1:g.datadims(1)]; end + if ~isempty(g.samples ), g.datadims(2) = g.samples(2) - g.samples(1); end + if ~isempty(g.trials ), g.datadims(3) = g.trials(2) - g.trials(1); end + g.datadims(1) = length(g.channels); + alldata = mmo([], g.datadims); + for ic = 1:length(g.channels) + alldata(ic,:,:) = ft_read_data(filename, 'header', dat, dataopts{:}, 'chanindx', g.channels(ic)); + end +end + +% convert to seconds for sread +% ---------------------------- +EEG.srate = dat.Fs; +EEG.nbchan = dat.nChans; +EEG.data = alldata; +EEG.setname = ''; +EEG.comments = [ 'Original file: ' filename ]; +EEG.xmin = -dat.nSamplesPre/EEG.srate; +EEG.trials = dat.nTrials; +EEG.pnts = dat.nSamples; +if isfield(dat, 'label') && ~isempty(dat.label) + EEG.chanlocs = struct('labels', dat.label); + + % START ----------- Extracting EEG channel location + % Note: Currently for extensions where FT is able to generate valid 'labels' and 'elec' structure (e.g. FIF) + %If more formats, add them below + try + if isfield(dat,'elec') + eegchanindx = find(ft_chantype(dat, 'eeg') | ft_chantype(dat, 'pns') ); + if ~isempty(eegchanindx) + for ichan = 1:length(eegchanindx) + chanType = 'EEG'; + if isfield(dat, 'chantype') && ~isempty(dat.chantype) + chanType = dat.chantype{ichan}; + end + EEG = pop_chanedit(EEG,'changefield',{eegchanindx(ichan) 'X' dat.elec.chanpos(ichan,1) 'Y' dat.elec.chanpos(ichan,2) 'Z' dat.elec.chanpos(ichan,3) 'type' chanType}); + end + EEG.chanlocs = convertlocs(EEG.chanlocs,'cart2all'); + EEG.urchanlocs = EEG.chanlocs; + else + fprintf('pop_fileio: Unable to find EEG channels to extract location\n'); + end + end + catch + fprintf('pop_fileio: Unable to import channel location\n'); + end + % END ----------- Extracting EEG channel location +end + +% extract events +% -------------- +disp('Reading events...'); +if isempty(event) + try + event = ft_read_event(filename, dataopts{:}); + catch + disp(lasterr); + event = []; + end +end +if ~isempty(event) + subsample = 0; + + if ~isempty(g.samples), subsample = g.samples(1); end + + EEG.event = event; + for index = 1:length(event) + offset = fastif(isempty(event(index).offset), 0, event(index).offset); + EEG.event(index).type = event(index).value; + EEG.event(index).value = event(index).type; + EEG.event(index).latency = event(index).sample+offset+subsample; + EEG.event(index).duration = event(index).duration; + if EEG.trials > 1 + EEG.event(index).epoch = ceil(EEG.event(index).latency/EEG.pnts); + end + end + EEG.event = rmfield(EEG.event, 'sample'); + EEG.event = rmfield(EEG.event, 'value'); + EEG.event = rmfield(EEG.event, 'offset'); + + if exist('eeg_checkset') + EEG = eeg_checkset(EEG, 'eventconsistency'); + end +else + disp('Warning: no event found. Events might be embeded in a data channel.'); + disp(' To extract events, use menu File > Import Event Info > From data channel'); +end + +% convert data to single if necessary +% ----------------------------------- +if exist('eeg_checkset') + EEG = eeg_checkset(EEG,'makeur'); % Make EEG.urevent field +end + +% history +% ------- +if ischar(filename) + if isempty(options) + command = sprintf('EEG = pop_fileio(''%s'');', filename); + else + command = sprintf('EEG = pop_fileio(''%s'', %s);', filename, vararg2str(options)); + end +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/sph2topo.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/sph2topo.m new file mode 100644 index 0000000..bb8fa75 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/sph2topo.m @@ -0,0 +1,94 @@ +% sph2topo() - Convert from a 3-column headplot file in spherical coordinates +% to 3-column topoplot() locs file in polar (not cylindrical) coords. +% Used for topoplot() and other 2-D topographic plotting programs. +% Assumes a spherical coordinate system in which horizontal angles +% have a range [-180,180] deg, with zero pointing to the right ear. +% In the output polar coordinate system, zero points to the nose. +% See >> help readlocs +% Usage: +% >> [chan_num,angle,radius] = sph2topo(input,shrink_factor,method); +% +% Inputs: +% input = [channo,az,horiz] = chan_number, azumith (deg), horiz. angle (deg) +% When az>0, horiz=0 -> right ear, 90 -> nose +% When az<0, horiz=0 -> left ear, -90 -> nose +% shrink_factor = arc_length shrinking factor>=1 (deprecated). +% 1 -> plot edge is 90 deg azimuth {default}; +% 1.5 -> plot edge is +/-135 deg azimuth See +% >> help topoplot(). +% method = [1|2], optional. 1 is for Besa compatibility, 2 is for +% compatibility with Matlab function cart2sph(). Default is 2 +% +% Outputs: +% channo = channel number (as in input) +% angle = horizontal angle (0 -> nose; 90 -> right ear; -90 -> left ear) +% radius = arc_lengrh from vertex (Note: 90 deg az -> 0.5/shrink_factor); +% By topoplot() convention, radius=0.5 is the nasion-ear_canal plane. +% Use topoplot() 'plotrad' to plot chans with abs(az) > 90 deg. +% +% Author: Scott Makeig & Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 6/12/98 +% +% See also: cart2topo(), topo2sph() + +% Copyright (C) 6/12/98 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% corrected left/right orientation mismatch, Blair Hicks 6/20/98 +% changed name sph2pol() -> sph2topo() for compatibility -sm +% 01-25-02 reformated help & license -ad +% 01-25-02 changed computation so that it works with sph2topo -ad + +function [channo,angle,radius] = sph2topo(input,factor, method) + +chans = size(input,1); +angle = zeros(chans,1); +radius = zeros(chans,1); + +if nargin < 1 + help sph2topo + return +end + +if nargin< 2 + factor = 0; +end +if factor==0 + factor = 1; +end +if factor < 1 + help sph2topo + return +end + +if size(input,2) ~= 3 + help sph2topo + return +end + +channo = input(:,1); +az = input(:,2); +horiz = input(:,3); + +if exist('method')== 1 & method == 1 + radius = abs(az/180)/factor; + i = find(az>=0); + angle(i) = 90-horiz(i); + i = find(az<0); + angle(i) = -90-horiz(i); +else + angle = -horiz; + radius = 0.5 - az/180; +end; diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/topo2sph.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/topo2sph.m new file mode 100644 index 0000000..643c575 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/topo2sph.m @@ -0,0 +1,126 @@ +% topo2sph() - convert a topoplot() style 2-D polar-coordinate +% channel locations file to a 3-D spherical-angle +% file for use with headplot() +% Usage: +% >> [c h] = topo2sph('eloc_file','eloc_outfile', method, unshrink); +% >> [c h] = topo2sph( topoarray, method, unshrink ); +% +% Inputs: +% 'eloc_file' = filename of polar 2-D electrode locations file used by +% topoplot(). See >> topoplot example or cart2topo() +% 'eloc_outfile' = output file of 3-D electrode locations in spherical angle +% coords. for use in headplot(). +% topoarray = polar array of 2-D electrode locations, with polar angle +% in the first column and radius in the second one. +% method = [1|2] 1 is for Besa compatibility, 2 is for +% compatibility with Matlab function cart2sph(). {default: 2} +% unshrink = [0> help topoplot +% Outputs: +% c = coronal rotation +% h = horizontal rotation +% +% Author: Scott Makeig & Arnaud Delorme, SCCN/INC/UCSD, La Jolla, 1999 +% +% See also: sph2topo(), cart2topo() + +% Copyright (C) 1999 Scott Makeig, SCCN/INC/UCSD, scott@sccn.ucsd.edu +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +% 3-16-00 changed name to topo2sph() for compatibility with cart2topo() -sm +% 01-25-02 reformated help & license -ad +% 03-22-02 complete remodeling for returning arguments and taking arrays -ad + +function [c, h] = topo2sph(eloc_locs,eloc_angles, method, unshrink) + +MAXCHANS = 1024; + +if nargin < 1 + help topo2sph; + return; +end +if nargin > 1 && ~ischar(eloc_angles) + if nargin > 2 + unshrink = method; + end + method = eloc_angles; +else + method = 2; +end + +if isstr(eloc_locs) + fid = fopen(eloc_locs); + if fid<1 + fprintf('topo2sph()^G: cannot open eloc_loc file (%s)\n',eloc_locs) + return + end + E = fscanf(fid,'%d %f %f %s',[7 MAXCHANS]); + E = E'; + fclose(fid); +else + E = eloc_locs; + E = [ ones(size(E,1),1) E ]; +end + +if nargin > 1 && ischar(eloc_angles) + if exist(eloc_angles)==2 + fprintf('topo2sph: eloc_angles file (%s) already exists and will be erased.\n',eloc_angles); + end + + fid = fopen(eloc_angles,'a'); + if fid<1 + fprintf('topo2sph()^G: cannot open eloc_angles file (%s)\n',eloc_angles) + return + end +end + +if method == 2 + t = E(:,2); % theta + r = E(:,3); % radius + h = -t; % horizontal rotation + c = (0.5-r)*180; +else + for e=1:size(E,1) + % (t,r) -> (c,h) + + t = E(e,2); % theta + r = E(e,3); % radius + r = r*unshrink; + if t>=0 + h(e) = 90-t; % horizontal rotation + else + h(e) = -(90+t); + end + if t~=0 + c(e) = sign(t)*180*r; % coronal rotation + else + c(e) = 180*r; + end + end + t = t'; + r = r'; +end + +for e=1:size(E,1) + if nargin > 1 && ischar(eloc_angles) + chan = E(e,4:7); + fprintf('%d %g %g %s\n',E(e,1),c(e),h(e),chan); + fprintf(fid,'%d %g %g %s\n',E(e,1),c(e),h(e),chan); + end +end + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/union_bc.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/union_bc.m new file mode 100644 index 0000000..a307b3b --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/union_bc.m @@ -0,0 +1,56 @@ +% union_bc - union backward compatible with Matlab versions prior to 2013a + +% Copyright (C) 2013 Arnaud Delorme +% +% This file is part of EEGLAB, see http://www.eeglab.org +% for the documentation and details. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +% THE POSSIBILITY OF SUCH DAMAGE. + +function [C,IA,IB] = union_bc(A,B,varargin) + +errorFlag = error_bc; + +v = version; +indp = find(v == '.'); +v = str2num(v(1:indp(2)-1)); +if v > 7.19, v = floor(v) + rem(v,1)/10; end + +if nargin > 2 + ind = strmatch('legacy', varargin); + if ~isempty(ind) + varargin(ind) = []; + end +end + +if v >= 7.14 + [C,IA,IB] = union(A,B,varargin{:},'legacy'); + if errorFlag + [C2,IA2,IB2] = union(A,B,varargin{:}); + if (~isequal(C, C2) || ~isequal(IA, IA2) || ~isequal(IB, IB2)) + warning('backward compatibility issue with call to union function'); + end + end +else + [C,IA,IB] = union(A,B,varargin{:}); +end diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/vararg2str.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/vararg2str.m new file mode 100644 index 0000000..3fec102 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/private/vararg2str.m @@ -0,0 +1,241 @@ +% vararg2str() - transform arguments into string for evaluation +% using the eval() command +% +% Usage: +% >> strout = vararg2str( allargs ); +% >> strout = vararg2str( allargs, inputnames, inputnum, nostrconv ); +% +% Inputs: +% allargs - Cell array containing all arguments +% inputnames - Cell array of input names for these arguments, if any. +% inputnum - Vector of indices for all inputs. If present, the +% string output may by replaced by varargin{num}. +% Include NaN in the vector to avoid specific parameters +% being converted in this way. +% nostrconv - Vector of 0s and 1s indicating where the string +% should be not be converted. +% +% Outputs: +% strout - output string +% +% Author: Arnaud Delorme, CNL / Salk Institute, 9 April 2002 + +% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 9 April 2002 +% +% This file is part of EEGLAB, see http://www.eeglab.org +% for the documentation and details. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions are met: +% +% 1. Redistributions of source code must retain the above copyright notice, +% this list of conditions and the following disclaimer. +% +% 2. Redistributions in binary form must reproduce the above copyright notice, +% this list of conditions and the following disclaimer in the documentation +% and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +% THE POSSIBILITY OF SUCH DAMAGE. + +function strout = vararg2str(allargs, inputnam, inputnum, int2str ); + +if nargin < 1 + help vararg2str; + return; +end +if isempty(allargs) + strout = ''; + return; +end + +% default arguments +% ----------------- +if nargin < 2 + inputnam(1:length(allargs)) = {''}; +else + if length(inputnam) < length(allargs) + inputnam(end+1:length(allargs)) = {''}; + end +end +if nargin < 3 + inputnum(1:length(allargs)) = NaN; +else + if length(inputnum) < length(allargs) + inputnum(end+1:length(allargs)) = NaN; + end +end +if nargin < 4 + int2str(1:length(allargs)) = 0; +else + if length(int2str) < length(allargs) + int2str(end+1:length(allargs)) = 0; + end +end +if ~iscell( allargs ) + allargs = { allargs }; +end + +% actual conversion +% ----------------- +strout = ''; +for index = 1:length(allargs) + tmpvar = allargs{index}; + if ~isempty(inputnam{index}) + strout = [ strout ',' inputnam{index} ]; + else + if ischar( tmpvar ) + if int2str(index) + strout = [ strout ',' tmpvar ]; + else + strout = [ strout ',' str2str( tmpvar ) ]; + end + elseif isnumeric( tmpvar ) || islogical( tmpvar ) + strout = [ strout ',' array2str( tmpvar ) ]; + elseif iscell( tmpvar ) + tmpres = vararg2str( tmpvar ); +% comas = find( tmpres == ',' ); +% tmpres(comas) = ' '; + strout = [ strout ',{' tmpres '}' ]; + elseif isstruct(tmpvar) + strout = [ strout ',' struct2str( tmpvar ) ]; + else + error('Unrecognized input'); + end + end + +end +if ~isempty(strout) + strout = strout(2:end); +end + +% convert string to string +% ------------------------ +function str = str2str( array ) + if isempty( array), str = ''''''; return; end + str = ''; + for index = 1:size(array,1) + tmparray = deblank(array(index,:)); + if isempty(tmparray) + str = [ str ','' ''' ]; + else + str = [ str ',''' doublequotes(tmparray) '''' ]; + end + end + if size(array,1) > 1 + str = [ 'strvcat(' str(2:end) ')']; + else + str = str(2:end); + end; +return; + +% convert array to string +% ----------------------- +function str = array2str( array ) + if isempty( array), str = '[]'; return; end + if prod(size(array)) == 1, str = num2str(array); return; end + if size(array,1) == 1, str = [ '[' contarray(array) '] ' ]; return; end + if size(array,2) == 1, str = [ '[' contarray(array') ']'' ' ]; return; end + str = ''; + for index = 1:size(array,1) + str = [ str ';' contarray(array(index,:)) ]; + end + str = [ '[' str(2:end) ']' ]; +return; + +% convert struct to string +% ------------------------ +function str = struct2str( structure ) + if isempty( structure ) + str = 'struct([])'; return; + end + str = ''; + allfields = fieldnames( structure ); + for index = 1:length( allfields ) + strtmp = ''; + eval( [ 'allcontent = { structure.' allfields{index} ' };' ] ); % getfield generates a bug + str = [ str, '''' allfields{index} ''',{' vararg2str( allcontent ) '},' ]; + end + str = [ 'struct(' str(1:end-1) ')' ]; +return; + +% double the quotes in strings +% ---------------------------- +function str = doublequotes( str ) + quoteloc = union_bc(findstr( str, ''''), union(findstr(str, '%'), findstr(str, '\'))); + if ~isempty(quoteloc) + for index = length(quoteloc):-1:1 + str = [ str(1:quoteloc(index)) str(quoteloc(index):end) ]; + end + end +return; + +% test continuous arrays +% ---------------------- +function str = contarray( array ) + array = double(array); + tmpind = find( round(array) ~= array ); + if prod(size(array)) == 1 + str = num2str(array); + return; + end + if size(array,1) == 1 && size(array,2) == 2 + str = [num2str(array(1)) ' ' num2str(array(2))]; + return; + end + if isempty(tmpind) || all(isnan(array(tmpind))) + str = num2str(array(1)); + skip = 0; + indent = array(2) - array(1); + for index = 2:length(array) + if array(index) ~= array(index-1)+indent || indent == 0 + if skip <= 1 + if skip == 0 + str = [str ' ' num2str(array(index))]; + else + str = [str ' ' num2str(array(index-1)) ' ' num2str(array(index))]; + end + else + if indent == 1 + str = [str ':' num2str(array(index-1)) ' ' num2str(array(index))]; + else + str = [str ':' num2str(indent) ':' num2str(array(index-1)) ' ' num2str(array(index))]; + end + end + skip = 0; + indent = array(index) - array(index-1); + else + skip = skip + 1; + end + end + if array(index) == array(index-1)+indent + if skip ~= 0 + if indent == 1 + str = [str ':' num2str(array(index)) ]; + elseif indent == 0 + str = [str ' ' num2str(array(index)) ]; + else + str = [str ':' num2str(indent) ':' num2str(array(index)) ]; + end + end + end + else + if length(array) < 10 + str = num2str(array(1)); + for index = 2:length(array) + str = [str ' ' num2str(array(index)) ]; + end + else + str = num2str(double(array)); + end + end + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/test_mff_files.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/test_mff_files.m new file mode 100644 index 0000000..76b3b78 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/test_mff_files.m @@ -0,0 +1,220 @@ +% Function to test a collection of MFF files + +% This file is part of mffmatlabio. +% +% mffmatlabio is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% mffmatlabio is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with mffmatlabio. If not, see . + +clear +if ispc + baseFolder = 'z:/data/philips'; + outputFolder = ''; + error('Change folders'); +elseif ismac + baseFolder = '/Users/arno/GoogleDrive/EGI'; + outputFolder = '/data/philips/temp/'; +else + baseFolder = '/home/xxx/matlab'; +end + +if exist('OCTAVE_VERSION', 'builtin') ~= 0 + confirm_recursive_rmdir(false); +end + +removeICA = 0; +testtarget = 'eeglab'; % may be matlab, eeglab, fileio or fileioeeglab (compare EEGLAB and file-io) - not case sensitive + +if ~strcmpi(testtarget, 'matlab') && ~strcmpi(testtarget, 'fileio') + if ~exist('eeglab.m') + addpath('/data/matlab/eeglab/'); + end + eeglab; close +end + +inputFilenames = []; +inputFilenames(end+1).file = 'MFF_Files/Bugs/RHYM_MFF_issue19/AA_1756.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/RHYM_MFF_issue19/AA_1845.mff'; + +inputFilenames(end+1).file = 'MFF_Files/Unprocessed Continuous/32 channels/NIA_333ms_HCGSN32_test01.mff'; +inputFilenames(end+1).file = 'MFF_Files/Unprocessed Continuous/128 channels/GNG2_002_1v_cln.nsf.mff'; +inputFilenames(end+1).file = 'MFF_Files/Unprocessed Continuous/256 channels/VTD_993.1.ses.mff'; +inputFilenames(end+1).file = 'MFF_Files/Unprocessed Continuous/64 channels/NIA_333msHCGSN64_test01.mff'; +inputFilenames(end+1).file = 'MFF_Files/Continuous with Video/ZZ2_018 0416 2110.mff'; +inputFilenames(end+1).file = 'MFF_Files/Grand Average Multiple Subjects/GNG_F_Day_1_GAve.mff'; inputFilenames(end).info = 'Differences in begintime have been verified and are OK (begintime diff less than 10 microsec)'; % dataset 6 +inputFilenames(end+1).file = 'MFF_Files/Individual Averaging multiple categories/LLL_01.1_T108_0691.ave.mff'; +inputFilenames(end+1).file = 'MFF_Files/Individual Averaging multiple subjects/GNG_F_Day_1_Combined_blc_ref.mff'; inputFilenames(end).info = 'Differences in begintime have been verified and are OK (begintime diff less than 10 microsec)'; % dataset 8 +inputFilenames(end+1).file = 'MFF_Files/Segmented with multiple categories/NIA_P_013.ses.fil.seg.mff'; + +inputFilenames(end+1).file = 'MFF_Files/OtherFilesArnaud/9999_20160309_011903.mff'; inputFilenames(end).info = 'Differences in begintime have been verified and are OK (begintime diff less than 10 microsec)'; % dataset 10 +inputFilenames(end+1).file = 'MFF_Files/OtherFilesArnaud/coma_LA_MOH1_20160411_060749.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesArnaud/data.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesArnaud/multiSubj_seg_LLL_06.cmbave.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesArnaud/Nicolas_CerCo_SI_STE_test1_20151009_034300.mff'; + +inputFilenames(end+1).file = 'MFF_Files/OtherFilesDavid/ATD256_1.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesDavid/GNG2_014_1s_cln.seg.mff'; inputFilenames(end).info = 'Differences need further investigation - has been transmitted to Philips for comments'; % dataset 16 POTENTIAL PROBLEM - % 16 file corrupted or dicontinuity to take into account (event latencies are not consistent with block latencies - this could be corrected ) +inputFilenames(end+1).file = 'MFF_Files/OtherFilesDavid/VTD_7Ss_bcr.gav.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesDavid/VTD_993.1.ses .mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesDavid/4ms_5uV.nsr.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesDavid/01_024 0531 1145_seg_fil_bcr_ave_WITH_AUTONOMOUS.mff'; + +inputFilenames(end+1).file = 'MFF_Files/OtherFilesRobert/bug1427/Long64ChannelWithEvents.mff'; inputFilenames(end).info = 'Differences in begintime have been verified and are OK (less than 10 microseconds)'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesRobert/bug1427/NS500Sine6Hz.mff'; inputFilenames(end).info = 'Differences in begintime due to version 0 vs version 3 - OK'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesRobert/bug629/pilot05_test 20110120 1433.mff'; % has autonomous data +inputFilenames(end+1).file = 'MFF_Files/OtherFilesRobert/original/eeg/egi/NS500Sine6Hz.mff'; 'Differences in begintime due to File version 0 vs version 3 (nanoseconds vs microseconds) - OK'; + +inputFilenames(end+1).file = 'MFF_Files/Bugs/SPBI023_20150414_1357.mff'; +inputFilenames(end+1).file = 'MFF_Files/Treys_files/MMVTD_Continuous_EEG.mff'; +inputFilenames(end+1).file = 'MFF_Files/Treys_files/MMI_HC1_20180314_093330_physio_only.mff'; inputFilenames(end).info = 'Issue with ''relativeBeginTime (event 364 differs) - field is not exported back and is not 0 in original file - field not used anyway'; + +inputFilenames(end+1).file = 'MFF_Files/OtherFilesJoe/SLI_30.ave.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesJoe/EEG-fMRI_seg_1.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesJoe/1001_fil_bcr_ref_seg.mff'; + +inputFilenames(end+1).file = 'MFF_Files/OtherFilesKyle/Grand_Average_Example.mff'; inputFilenames(end).info = 'Differences in MFF keys and begin latencies have been verified - latencies are identical by the way'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesKyle/Individual_Subject_Segmented_Example.mff'; inputFilenames(end).info = 'Latency differences have been verified'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesKyle/Multiple_Subject_Averages_Example.mff'; + +inputFilenames(end+1).file = 'MFF_Files/OtherFilesMark/MMVTD_fil_fil_seg_1_ave.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesMark/MMVTD_fil_fil_seg_1.mff'; +inputFilenames(end+1).file = 'MFF_Files/OtherFilesMark/MMVTD_fil.mff'; + +inputFilenames(end+1).file = 'MFF_Files/Bugs/14_20191101_105925.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/catherine/PS38_V1_S1_fMRI_Vis_block_20180516_104228.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/catherine/TestIO_PS38_V1_S1_fMRI_Vis_block_20180516_104228_mrr_fil_bcr_qrs_obs_seg.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/catherine/TestIO_PS38_V1_S1_fMRI_Vis_block_20180516_104228.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/forArnoFromJoe2/demo_20130911_1214NS5_seg.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/forArnoFromJoe2/GNG2_002_1v_cln.seg.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/forArnoFromJoe2/NIA_P_013.ses.fil.seg.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue1/samp_file.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue4/0027_Sungjin_20170403_114721_Hfil_Lfil_seg_bcr_blc_ref.mff'; inputFilenames(end).info = 'File with categories and also missing data portions - cannot be properly handled by EEGLAB'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue6/Baseline_PreNback.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue16/s34_control_20190507_022838.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue17/AV1_AV.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/KHA_SEP_20180529_110628_epoched_300ms_ave.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/KHA_SEP_20180529_110628_epoched_300ms.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/KHA_SEP_20180529_110628.mff'; inputFilenames(end).info = 'One channel difference OK (E1001 vs E129) because eeg_importcoordinates does not store chan number (1001 in original)'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/mattan/2002 20120824 dis copy.mff'; inputFilenames(end).info = 'Differences in begintime have been verified and are OK (begintime diff than 10 microseconds)'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/Piezo_EqptTest1K_8_6_15.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/Priefer_AV1_AV_import_export_issue_to_test_in_NETstation/AV1_AV.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/SPBI023_20150414_1357.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/trevor/SSDE_P004_RSEEG_EO_BS_20180922_042706.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/zhaodi.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue21/EEG_VisualMotor_Run01.mff'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue22/CNTL001_P50Sup_T1_20150608_1530.mff'; inputFilenames(end).info = 'Differences checked and OK - reference renamed for some reason'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue25/2197LA_creativity1.mff'; inputFilenames(end).info = 'Differences checked and OK - reference renamed for some reason'; +inputFilenames(end+1).file = 'MFF_Files/Bugs/issue28/auditory_run01.mff'; inputFilenames(end).info = 'Differences checked and OK - reference renamed for some reason'; + +%% +ALLEEG = []; +% the error is with dataset 7 +fileDairy = sprintf('%s-%s.txt', computer, datestr(now, 'yyyymmddTHHMMSS')); +datasetsToLoad = 1:length(inputFilenames); % dataset 16 POTENTIAL PROBLEM + +% scan file content +% for iFile = datasetsToLoad %1 %[20 23] %1:length(datasetsToLoad) +% type(fullfile(fullfile(baseFolder, inputFilenames(iFile).file), 'info.xml')); +% %EEG = mff_importinfo(fullfile(baseFolder, inputFilenames{iFile})); +% end +% return + +for iFile = length(datasetsToLoad) + errorMsg = ''; + + fprintf('Reading file %s\n', inputFilenames(iFile).file); + outputFile = fullfile(outputFolder, [ 'mffmatlabio/testexport' int2str(ispc) '_' int2str(iFile) '.mff' ] ); + if exist(outputFile) + rmdir(outputFile, 's') + end + + if strcmpi(testtarget, 'eeglab') + + % test EEGLAB import/export + EEG = mff_import(fullfile(baseFolder, inputFilenames(iFile).file)); + + if removeICA + EEG = pop_eegfiltnew(EEG, [],1,826,1,[],0); + EEG = pop_runica(EEG, 'pca', 5); + EEG = pop_subcomp(EEG, 1); + end + + mff_export(EEG, outputFile); + EEG2 = mff_import(outputFile); + + else + + if strcmpi(testtarget, 'matlab') + EEG2 = mff_import(fullfile(baseFolder, inputFilenames(iFile).file)); + else + + try + ft_defaults; + hdr = ft_read_header(fullfile(baseFolder, inputFilenames(iFile).file), 'headerformat', 'egi_mff_v3'); + event = ft_read_event( fullfile(baseFolder, inputFilenames(iFile).file), 'eventformat', 'egi_mff_v3', 'header', hdr); + dat = ft_read_data( fullfile(baseFolder, inputFilenames(iFile).file), 'dataformat', 'egi_mff_v3', 'header', hdr); + EEG = pop_fileio2(hdr, dat, event); + catch + l = lasterror; + errorMsg = l.message; + end + + if strcmpi(testtarget, 'fileioeeglab') + EEG2 = mff_import(fullfile(baseFolder, inputFilenames(iFile).file)); + else + try + ft_write_data(outputFile, dat, 'header', hdr, 'event', event, 'dataformat', 'mff'); + % mff_fileio_write(outputFile, header, dat, event); + hdr2 = ft_read_header(outputFile, 'headerformat', 'egi_mff_v3'); + event2 = ft_read_event( outputFile, 'eventformat', 'egi_mff_v3', 'header', hdr); + dat2 = ft_read_data( outputFile, 'dataformat', 'egi_mff_v3', 'header', hdr); + EEG2 = pop_fileio2(hdr2, dat2, event2); + catch + l = lasterror; + errorMsg = l.message; + end + end + end + end + + if ~strcmpi(testtarget, 'matlab') + diary(fileDairy); + disp('-------------------------') + fprintf('File number %d\nComparing reimported file %s\n', iFile, inputFilenames(iFile).file); + if isempty(errorMsg) + eeg_compare(EEG, EEG2); + if ~isempty(inputFilenames(iFile).info) + disp(inputFilenames(iFile).info); + disp(inputFilenames(iFile).info); + end + else + disp(errorMsg); + end + diary + if length(datasetsToLoad) == 1 + [ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG); + eeglab redraw; + end + else + disp('CANNOT COMPARE IMPORTED AND EXPORTED FILES USING THIS MODE'); + end +end +diary off; +return + +%events = read_mff_event('../MFF_Files/Individual Averaging multiple categories/LLL_01.1_T108_0691.ave.mff', []); + +%% +%EEG = mff_importsignal(inputFilenames{4}); + +%% + diff --git a/code/eeglab13_4_4b/plugins/mffmatlabio-master/test_single_fileio_file.m b/code/eeglab13_4_4b/plugins/mffmatlabio-master/test_single_fileio_file.m new file mode 100644 index 0000000..78c8504 --- /dev/null +++ b/code/eeglab13_4_4b/plugins/mffmatlabio-master/test_single_fileio_file.m @@ -0,0 +1,12 @@ +% Script to test a single File-IO file + +file = '/Users/arno/GoogleDrive/EGI/Net Station Files from EGI/Unprocessed Continuous/32 channels/NIA_333ms_HCGSN32_test01.mff'; +file = '/Users/arno/GoogleDrive/EGI/Net Station Files from EGI/OtherFilesDavid/01_024 0531 1145_seg_fil_bcr_ave_WITH_AUTONOMOUS.mff'; +tmpfile = '/Users/arno/temp/test.mff'; +hdr = ft_read_header(file, 'headerformat', 'egi_mff_v3'); +evt = ft_read_event( file, 'eventformat', 'egi_mff_v3', 'header', hdr); +data = ft_read_data( file, 'dataformat', 'egi_mff_v3', 'header', hdr); +%evt = ft_read_event( file, 'eventformat', 'egi_mff_v3'); +%data = ft_read_data( file, 'dataformat', 'egi_mff_v3'); + +ft_write_data(tmpfile, data, 'header', hdr, 'event', evt, 'dataformat', 'mff'); diff --git a/code/eeglab13_4_4b/sample_data/1ST_README.txt b/code/eeglab13_4_4b/sample_data/1ST_README.txt new file mode 100644 index 0000000..6f8bd32 --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/1ST_README.txt @@ -0,0 +1,4 @@ +This directory contains sample data for EEGLAB. +The sample data file for the tutorial can be obtained from + http://sccn.ucsd.edu/eeglab/download/eeglab_data.set +(this file may not be included in the EEGLAB distribution because of its size). diff --git a/code/eeglab13_4_4b/sample_data/eeglab_chan32.locs b/code/eeglab13_4_4b/sample_data/eeglab_chan32.locs new file mode 100644 index 0000000..0fc8ebd --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/eeglab_chan32.locs @@ -0,0 +1,32 @@ +1 0 0.50669 FPz +2 23 0.71 EOG1 +3 -39.947 0.34459 F3 +4 0 0.25338 Fz +5 39.897 0.3445 F4 +6 -43 0.65 EOG2 +7 -69.332 0.40823 FC5 +8 -44.925 0.18118 FC1 +9 44.925 0.18118 FC2 +10 69.332 0.40823 FC6 +11 -90 0.53318 T7 +12 -90 0.26669 C3 +13 90 0.26667 C4 +14 0 0 Cz +15 90 0.53318 T8 +16 -110.67 0.40823 CP5 +17 -135.07 0.18118 CP1 +18 135.07 0.18118 CP2 +19 110.67 0.40823 CP6 +20 -126.09 0.52808 P7 +21 -140.05 0.34459 P3 +22 180 0.25338 Pz +23 140.1 0.3445 P4 +24 126.13 0.52807 P8 +25 -144.11 0.52233 PO7 +26 -157.54 0.42113 PO3 +27 180 0.37994 POz +28 157.54 0.42113 PO4 +29 144.14 0.52231 PO8 +30 -162.07 0.51499 O1 +31 180 0.50669 Oz +32 162.07 0.51499 O2 diff --git a/code/eeglab13_4_4b/sample_data/eeglab_data.fdt b/code/eeglab13_4_4b/sample_data/eeglab_data.fdt new file mode 100644 index 0000000..fc24ce5 Binary files /dev/null and b/code/eeglab13_4_4b/sample_data/eeglab_data.fdt differ diff --git a/code/eeglab13_4_4b/sample_data/eeglab_data.set b/code/eeglab13_4_4b/sample_data/eeglab_data.set new file mode 100644 index 0000000..c0aef4b Binary files /dev/null and b/code/eeglab13_4_4b/sample_data/eeglab_data.set differ diff --git a/code/eeglab13_4_4b/sample_data/eeglab_data_epochs_ica.fdt b/code/eeglab13_4_4b/sample_data/eeglab_data_epochs_ica.fdt new file mode 100644 index 0000000..7e04dbe Binary files /dev/null and b/code/eeglab13_4_4b/sample_data/eeglab_data_epochs_ica.fdt differ diff --git a/code/eeglab13_4_4b/sample_data/eeglab_data_epochs_ica.set b/code/eeglab13_4_4b/sample_data/eeglab_data_epochs_ica.set new file mode 100644 index 0000000..1aaa9da Binary files /dev/null and b/code/eeglab13_4_4b/sample_data/eeglab_data_epochs_ica.set differ diff --git a/code/eeglab13_4_4b/sample_data/pnas.adt b/code/eeglab13_4_4b/sample_data/pnas.adt new file mode 100644 index 0000000..da12981 --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/pnas.adt @@ -0,0 +1,28 @@ + 2.7949403e+00 1.2960035e+01 2.2714752e+01 1.4974186e+01 5.3417582e+01 4.1893997e+01 4.3704120e+00 1.2851544e+01 6.2147516e+00 1.3804374e+01 9.3373931e+00 9.6864497e+00 3.8771355e+01 1.9879846e+01 -3.4879588e+01 -5.7087135e+01 -4.8856003e+01 -3.6134305e+01 -1.1578899e+00 -1.2200343e+01 2.3002487e+01 -1.4775814e+01 -6.9256946e+01 -7.1351286e+01 -5.4639022e+01 -4.7624871e+01 -4.7332418e+01 -4.1021097e+01 1.0945884e+01 -6.5210974e+00 -4.9648456e+01 -6.5544682e+01 -5.1153173e+01 -5.1346569e+01 -5.3058833e+01 -2.9681475e+01 -9.8890220e+00 -9.6107201e+00 -1.8346569e+01 -1.9120154e+01 -3.5635503e+00 -2.2003427e+00 9.8656950e+00 1.0559091e+01 2.2516638e+01 3.7147516e+00 -3.8511663e+01 -4.2110720e+01 -4.9610720e+01 -6.2488079e+01 -5.6511663e+01 -6.4455060e+01 -6.0101286e+01 -4.4077701e+01 -6.1799399e+01 -9.4719211e+01 -9.6370154e+01 -8.0006946e+01 -7.9313550e+01 -8.3837135e+01 -7.5124871e+01 -6.9922041e+01 -8.3511663e+01 -6.6940909e+01 -5.2733362e+01 -4.9884305e+01 -5.7955060e+01 -6.5950343e+01 -1.0031355e+02 -1.0292204e+02 -9.1431475e+01 -1.0223336e+02 -1.0530412e+02 -1.0501166e+02 -1.0592204e+02 -9.6898456e+01 -9.8011663e+01 -1.0479468e+02 -1.0773808e+02 -9.8068267e+01 -9.3374871e+01 -8.4535248e+01 -7.4172041e+01 -5.9898456e+01 -4.1139022e+01 -2.4639022e+01 -3.1950343e+01 -2.8436192e+01 -1.8346569e+01 -1.1488079e+01 1.5351544e+01 3.0590912e+00 2.5431733e+01 3.8346827e+01 1.6011921e+01 1.9148714e+01 3.2724186e+01 3.6436450e+01 3.4224186e+01 3.8110978e+01 5.9672299e+01 5.2587393e+01 1.2059091e+01 -3.0446823e+00 3.7572045e+00 6.4600346e+00 -4.6248710e+00 -1.5021097e+01 1.1931733e+01 -9.8182672e+00 -6.0341852e+01 -7.4148456e+01 -6.7431475e+01 -7.4233362e+01 -8.8389022e+01 -9.5733362e+01 -7.1615437e+01 -8.1436192e+01 -1.2370034e+02 -1.2872864e+02 -1.1818147e+02 -1.2621921e+02 -1.2046921e+02 -1.2013430e+02 -8.5157890e+01 -8.2723928e+01 -1.3506827e+02 -1.4447393e+02 -1.2243147e+02 -1.0553525e+02 -1.0630412e+02 -1.0860129e+02 -7.4818267e+01 -7.2365437e+01 -1.1140789e+02 -1.2806827e+02 -1.0650223e+02 -1.0474280e+02 -9.7502230e+01 -1.0916732e+02 -7.4874871e+01 -8.1464494e+01 -1.1565317e+02 -1.0454468e+02 -8.6690909e+01 -7.6186192e+01 -7.6403173e+01 -7.5492796e+01 -3.0266380e+01 -3.1134305e+01 -6.7134305e+01 -7.6393739e+01 -6.7374871e+01 -5.0568267e+01 -4.7313550e+01 -3.3228645e+01 6.8845629e+00 -5.3053140e-01 -2.9723928e+01 -8.2239276e+00 6.7241856e+00 1.2634563e+01 4.5921101e+00 8.7383365e+00 2.6181733e+01 1.8478903e+01 -2.2955060e+01 -3.1214494e+01 -9.5022295e+00 -7.9267578e+00 -1.6058833e+01 2.4930535e+00 1.6794940e+01 4.4506007e+00 -2.3450343e+01 -1.6426758e+01 -7.3843050e+00 -3.7899654e+00 7.0166384e+00 -2.7946823e+00 2.8497770e+01 2.1780789e+01 -1.6530531e+01 -1.9035248e+01 1.2776072e+01 9.8609780e+00 1.1087393e+01 5.7572045e+00 2.8601544e+01 2.8049657e+01 -5.9597767e+00 -4.6201540e+00 2.4238337e+01 1.7713554e+00 1.0233620e+01 1.9011921e+01 4.9304374e+01 3.8408148e+01 -8.1720408e+00 -1.4129588e+01 -9.6673239e+00 3.4506007e+00 -2.6861918e+00 1.0280789e+01 3.4063808e+01 2.5516638e+01 -8.1248710e+00 -3.0738079e+01 -2.5389022e+01 -1.3172041e+01 -1.7663805e+00 -1.0662607e+01 5.7713554e+00 -3.2522295e+00 -2.4431475e+01 -2.4870154e+01 -8.9126069e+00 -8.3324182e+00 2.1156950e+00 -1.7181475e+01 4.6846827e+01 2.7790223e+01 -2.0374871e+01 -1.7389022e+01 -7.8748710e+00 1.3798460e+00 1.2540223e+01 1.3799657e+01 5.7370412e+01 5.0728903e+01 5.1204120e+00 -3.4031729e+00 2.6864497e+00 1.0304374e+01 1.5450601e+01 6.5402233e+00 2.7158148e+01 1.8898714e+01 -2.4997513e+01 -4.1209777e+01 -1.8228645e+01 -3.3088333e+00 4.5024875e+00 1.2884563e+01 6.3393997e+01 5.0035506e+01 1.2855063e+00 2.8279592e+00 1.0087393e+01 2.5375129e+01 3.8658148e+01 3.9903431e+01 6.5771355e+01 7.7639280e+01 2.1610978e+01 7.7053177e+00 2.3908148e+01 3.9530789e+01 4.3148714e+01 3.6988337e+01 6.8195884e+01 5.2634563e+01 1.5530789e+01 8.0732422e+00 2.3073242e+01 4.8068525e+01 4.5271355e+01 3.3214752e+01 5.9596827e+01 5.0865695e+01 6.9600346e+00 2.8373931e+00 1.3464752e+01 5.5969469e+01 4.4922299e+01 2.8955318e+01 7.5757204e+01 6.2964752e+01 2.5393997e+01 4.6917582e+01 7.3667582e+01 7.4210035e+01 8.7257204e+01 9.6634563e+01 1.3626664e+02 1.2689871e+02 8.9238337e+01 8.5077959e+01 8.5615695e+01 8.6153431e+01 9.5049657e+01 9.9313808e+01 1.1215815e+02 1.2264400e+02 7.7610978e+01 8.0969469e+01 8.7177016e+01 7.1988337e+01 9.4596827e+01 6.1172299e+01 8.9714752e+01 9.3728903e+01 5.7865695e+01 5.4535506e+01 6.1695884e+01 8.4068525e+01 7.0587393e+01 8.6955318e+01 1.4551664e+02 1.3746475e+02 9.7110978e+01 7.5497770e+01 + 5.7082289e+00 1.2892191e+01 2.4812003e+01 1.7033701e+01 6.3429927e+01 3.9321436e+01 5.4582289e+00 1.6326153e+01 1.0420493e+01 1.8613889e+01 1.6557286e+01 1.9613889e+01 5.7840304e+01 2.9062003e+01 -2.2683281e+01 -4.1169130e+01 -3.3900262e+01 -1.9197431e+01 1.5736531e+01 9.2049307e-01 4.1392191e+01 -8.0606390e+00 -5.7032337e+01 -5.4334224e+01 -3.3871960e+01 -2.5787054e+01 -2.8687997e+01 -2.2008752e+01 3.8330870e+01 9.7601157e+00 -3.4159696e+01 -4.8239884e+01 -3.4791771e+01 -3.8461582e+01 -4.1414413e+01 -1.9508752e+01 4.6752101e+00 -5.2917711e+00 -9.1785635e+00 -1.0560639e+01 7.1280402e+00 4.0289836e+00 2.2033701e+01 2.1533701e+01 3.3264833e+01 1.2571436e+01 -3.1966299e+01 -2.7848375e+01 -3.2320073e+01 -4.2603092e+01 -3.2107809e+01 -3.9074790e+01 -3.2617243e+01 -2.2716299e+01 -4.7923847e+01 -8.2980450e+01 -8.5607809e+01 -7.4480450e+01 -8.1810639e+01 -9.2461582e+01 -8.7088941e+01 -9.1022903e+01 -1.0870687e+02 -9.6504035e+01 -8.3890828e+01 -8.7513469e+01 -9.2975733e+01 -1.0629177e+02 -1.3750875e+02 -1.3953234e+02 -1.2816913e+02 -1.4092385e+02 -1.4398988e+02 -1.4006536e+02 -1.3555592e+02 -1.2588139e+02 -1.2119271e+02 -1.2855592e+02 -1.2814554e+02 -1.1987668e+02 -1.1317856e+02 -1.0769271e+02 -9.7961582e+01 -8.9239884e+01 -7.2838941e+01 -5.7612526e+01 -7.1348375e+01 -6.9607809e+01 -6.2381394e+01 -5.5508752e+01 -2.8914413e+01 -4.9617243e+01 -2.3107809e+01 -1.9824790e+01 -4.4966299e+01 -4.0725733e+01 -2.4022903e+01 -1.7598375e+01 -2.1871960e+01 -1.6923847e+01 1.4283701e+01 1.1374742e+00 -3.6320073e+01 -4.6287054e+01 -3.6046488e+01 -3.1221016e+01 -3.8857809e+01 -4.8027620e+01 -9.6408277e+00 -3.8796488e+01 -8.9706865e+01 -9.3805922e+01 -8.3197431e+01 -8.6904979e+01 -9.9645545e+01 -1.0201819e+02 -7.0612526e+01 -8.7206865e+01 -1.2468328e+02 -1.2685781e+02 -1.1706064e+02 -1.2278234e+02 -1.2007007e+02 -1.1745687e+02 -8.1371960e+01 -8.8103092e+01 -1.4510309e+02 -1.4829649e+02 -1.2185781e+02 -1.0638139e+02 -1.0701819e+02 -1.1398045e+02 -7.1221016e+01 -7.7725733e+01 -1.1423988e+02 -1.2938611e+02 -1.0467385e+02 -1.0232479e+02 -9.8452148e+01 -1.1346630e+02 -7.3305922e+01 -8.7489884e+01 -1.1918328e+02 -1.0219271e+02 -7.5216299e+01 -6.5268186e+01 -6.1277620e+01 -5.6607809e+01 -8.5747899e+00 -1.6140828e+01 -5.0692714e+01 -5.5235167e+01 -4.7603092e+01 -2.8107809e+01 -2.2070073e+01 -7.5795069e+00 3.7189361e+01 1.8024267e+01 -6.5181862e+00 1.5760116e+01 2.7821436e+01 3.3477097e+01 2.2840304e+01 2.5991248e+01 4.7519550e+01 3.2670493e+01 -8.4285635e+00 -9.4662994e+00 1.5646908e+01 1.4977097e+01 1.1444078e+01 2.8293135e+01 5.0316719e+01 3.2595021e+01 6.6374742e+00 1.8095021e+01 2.2429927e+01 3.0146908e+01 3.7745965e+01 3.1132757e+01 7.0401625e+01 5.1363889e+01 1.2873323e+01 1.3444078e+01 4.3538418e+01 3.9212946e+01 3.7778984e+01 3.5312003e+01 6.4977097e+01 5.3439361e+01 1.9665776e+01 2.9609172e+01 5.1033701e+01 2.9345021e+01 3.8316719e+01 4.3028984e+01 7.6052569e+01 5.0373323e+01 3.7804024e-01 -5.0747899e+00 -4.9946013e+00 1.0010116e+01 3.6044553e+00 1.9043135e+01 4.5401625e+01 3.2420493e+01 -4.7101636e-01 -1.8367243e+01 -1.1423847e+01 4.7176629e+00 1.4382757e+01 6.3686063e+00 2.5250682e+01 3.9629459e+00 -1.6320073e+01 -1.5244601e+01 5.6671949e-01 2.4818138e+00 1.1731814e+01 -7.4993182e+00 6.3014833e+01 2.8604455e+01 -1.6357809e+01 -1.2353092e+01 -3.5087522e+00 4.7978516e+00 1.3208229e+01 1.2915776e+01 6.3882757e+01 4.6156342e+01 -2.3578088e+00 -4.5559220e+00 -1.0181862e+00 8.9252101e+00 1.5434644e+01 1.8403044e+00 2.9486531e+01 1.3043135e+01 -2.9258752e+01 -4.4395545e+01 -1.4334224e+01 -1.7162994e+00 4.5006818e+00 1.6217663e+01 7.3816719e+01 4.4505399e+01 -1.2446013e+00 8.1200251e-01 8.4346440e+00 2.3675210e+01 3.5878040e+01 3.7694078e+01 7.3071436e+01 7.1812003e+01 1.8373323e+01 7.8544553e+00 2.0925210e+01 3.7019550e+01 3.8849738e+01 3.5264833e+01 7.4472380e+01 4.7453512e+01 1.0382757e+01 6.4865308e+00 2.7095021e+01 5.2335587e+01 5.0948795e+01 3.8783701e+01 7.4444078e+01 5.6826153e+01 1.3731814e+01 1.2066719e+01 2.3080870e+01 6.5854455e+01 5.1585587e+01 3.8642191e+01 8.7694078e+01 6.1019550e+01 2.4868606e+01 4.4363889e+01 6.3703512e+01 5.7444078e+01 6.6793135e+01 7.3396908e+01 1.1900068e+02 1.0197710e+02 6.7175210e+01 6.4618606e+01 6.9774267e+01 7.1892191e+01 8.1132757e+01 8.7109172e+01 1.0817993e+02 1.1212804e+02 6.7462946e+01 8.0783701e+01 8.5477097e+01 9.6198795e+01 9.8283701e+01 8.5760116e+01 1.2237804e+02 9.9519550e+01 6.0510116e+01 5.5062003e+01 6.2552569e+01 8.2642191e+01 8.7547852e+01 8.5014833e+01 1.4612804e+02 1.2552427e+02 8.5415776e+01 6.9599738e+01 + -4.9151496e-01 5.1499945e+00 1.4546221e+01 8.1311265e+00 5.4645277e+01 2.3484900e+01 -5.0198168e+00 2.4471643e+00 -5.2453383e-01 9.1594284e+00 1.2437730e+01 2.0366976e+01 6.5249051e+01 3.1937730e+01 -1.6076421e+01 -3.2708496e+01 -2.7510383e+01 -1.0783968e+01 2.5517919e+01 1.4041504e+01 5.8588674e+01 7.7349001e+00 -3.7666043e+01 -3.6708496e+01 -2.0472647e+01 -1.7208496e+01 -2.0581138e+01 -1.0694345e+01 5.0786787e+01 1.9772636e+01 -2.1246232e+01 -3.4496232e+01 -2.6519817e+01 -3.4703779e+01 -3.6194345e+01 -1.4859439e+01 8.9990511e+00 -1.1335855e+01 -1.8293402e+01 -2.7949062e+01 -1.8642458e+01 -2.7288685e+01 -1.0425477e+01 -1.0722647e+01 2.2207492e+00 -1.2274534e+01 -5.0015100e+01 -4.2977364e+01 -4.6203779e+01 -5.2552836e+01 -4.0807553e+01 -4.3713213e+01 -3.1081138e+01 -1.9217930e+01 -4.0566987e+01 -6.7340572e+01 -6.1670760e+01 -4.6241515e+01 -4.3208496e+01 -4.7104723e+01 -3.4939628e+01 -3.7081138e+01 -4.8850006e+01 -3.7585855e+01 -2.4340572e+01 -2.4496232e+01 -2.5194345e+01 -3.7283968e+01 -6.0137741e+01 -6.1411326e+01 -5.3467930e+01 -6.5868873e+01 -7.1340572e+01 -6.9727364e+01 -6.7109439e+01 -6.4722647e+01 -6.0854723e+01 -7.1765100e+01 -7.2255666e+01 -6.7397175e+01 -6.2934911e+01 -6.0128307e+01 -5.0623590e+01 -4.7005666e+01 -3.1722647e+01 -2.1793402e+01 -3.8274534e+01 -3.9581138e+01 -3.6925477e+01 -3.3066987e+01 -9.4679301e+00 -3.3076421e+01 -7.8264206e+00 -1.2821704e+01 -3.7364156e+01 -3.4076421e+01 -1.8434911e+01 -1.0548119e+01 -1.1316987e+01 -1.8641565e+00 3.5041504e+01 1.9112259e+01 -1.2312270e+01 -1.6661326e+01 -3.9962319e+00 4.0273530e+00 2.9565982e+00 2.8292398e+00 5.2664145e+01 3.1164145e+01 -8.6188735e+00 -3.5000553e-01 1.8253768e+01 2.4947164e+01 2.7466032e+01 3.9088674e+01 8.1475466e+01 6.7447164e+01 3.9282070e+01 4.2300938e+01 5.2366976e+01 5.1451881e+01 5.3890561e+01 5.8414145e+01 9.5918862e+01 8.6480183e+01 3.2909428e+01 3.0126410e+01 5.4079240e+01 6.3315089e+01 6.3989617e+01 5.7970749e+01 1.0261698e+02 8.8404711e+01 5.3678296e+01 3.9381127e+01 6.0187730e+01 6.2065089e+01 6.4286787e+01 5.0749051e+01 9.1994334e+01 7.0461315e+01 3.8300938e+01 5.0239617e+01 7.5442447e+01 8.2220749e+01 8.4800938e+01 9.0833957e+01 1.3431509e+02 1.1757924e+02 7.6003768e+01 6.6678296e+01 6.7211315e+01 8.1720749e+01 8.9635844e+01 1.0084339e+02 1.4217830e+02 1.1309811e+02 8.6277353e+01 9.7914145e+01 1.0191415e+02 1.0302735e+02 9.3933013e+01 9.8645277e+01 1.2059339e+02 9.7466032e+01 5.5008485e+01 4.9777353e+01 7.0348108e+01 6.4895277e+01 6.3947164e+01 7.8503768e+01 1.0404150e+02 8.2399994e+01 5.5357542e+01 6.4881127e+01 6.0447164e+01 6.6951881e+01 6.7895277e+01 6.0833957e+01 9.7494334e+01 6.9956598e+01 2.9942447e+01 2.8135844e+01 5.2272636e+01 5.0763202e+01 5.0338674e+01 4.8550938e+01 8.0239617e+01 6.1395277e+01 3.2433013e+01 4.4183013e+01 5.9975466e+01 4.0815089e+01 5.0112259e+01 5.3739617e+01 8.5980183e+01 5.2928296e+01 6.7349001e+00 5.7452277e-01 1.8773032e-01 1.5574523e+01 1.3187730e+01 3.0093391e+01 6.0645277e+01 4.3154711e+01 1.2055655e+01 -3.5764206e+00 7.4905108e-01 1.8310372e+01 2.2862259e+01 1.6626410e+01 3.6102825e+01 7.9660322e+00 -1.2916043e+01 -1.5213213e+01 -4.0198168e+00 -5.2934018e+00 1.8999945e+00 -1.3934911e+01 5.8480183e+01 2.1574523e+01 -1.9335855e+01 -1.5840572e+01 -9.0198168e+00 -2.2745338e+00 5.0745228e+00 3.9565982e+00 5.4678296e+01 3.0871693e+01 -1.5722647e+01 -1.8298119e+01 -1.8170760e+01 -6.9584961e+00 5.1028247e+00 -3.2037791e+00 3.4296221e+01 1.5428296e+01 -2.0321704e+01 -3.5944345e+01 -1.0793402e+01 -5.0009489e+00 -7.2698168e+00 -1.9434515e-01 5.3951881e+01 1.0164145e+01 -3.7430194e+01 -4.2161326e+01 -3.8378307e+01 -3.0699062e+01 -2.1354723e+01 -2.0043402e+01 2.1753768e+01 1.5291504e+01 -2.9048119e+01 -3.6199062e+01 -2.1604723e+01 -3.9537791e+00 3.1037183e-01 1.9849001e+00 4.5178296e+01 1.7466032e+01 -1.3911326e+01 -1.8321704e+01 2.3669756e+00 2.3640561e+01 2.3475466e+01 1.3956598e+01 5.3711315e+01 3.1022636e+01 -9.6235904e+00 -1.2689628e+01 -4.6849112e+00 3.0871693e+01 1.3333957e+01 2.5376806e-01 4.6866976e+01 1.4503768e+01 -2.0949062e+01 -6.8688735e+00 -7.6981685e-01 -1.6307553e+01 -1.5873590e+01 -1.3019817e+01 3.0013202e+01 1.2008485e+01 -1.6199062e+01 -1.5524534e+01 -3.1518923e+00 1.4896171e+00 1.4805655e+01 2.5654711e+01 5.7282070e+01 6.1484900e+01 2.4928296e+01 4.2192447e+01 4.4805655e+01 5.6017919e+01 5.4602825e+01 3.9786787e+01 7.7083957e+01 4.8791504e+01 7.2490511e+00 -4.4207602e+00 -2.4584961e+00 1.0333957e+01 1.2541504e+01 1.1616976e+01 7.0074523e+01 4.2366976e+01 9.0942843e-01 -1.4463213e+01 + -1.4353147e+01 -1.7046543e+01 -8.7399396e+00 -1.7140883e+01 3.5613834e+01 -6.7871094e+00 -3.4249374e+01 -2.0739940e+01 -1.6320128e+01 -2.1644679e+00 -3.8616598e-01 1.1335532e+01 6.2906287e+01 2.6170438e+01 -1.3489940e+01 -3.0475789e+01 -2.2282392e+01 -3.2729584e+00 3.9090249e+01 3.0208174e+01 7.5901570e+01 2.0901570e+01 -2.3305977e+01 -1.1131449e+01 6.4581736e+00 3.6940227e+00 -2.2588075e+00 8.2176076e+00 7.2406287e+01 3.6109117e+01 -1.7823924e+00 -1.9966355e+01 -1.8004091e+01 -2.5768241e+01 -2.4598430e+01 -5.4757886e+00 1.5717608e+01 -1.6872015e+01 -1.8626732e+01 -2.8159751e+01 -1.7678619e+01 -3.2754091e+01 -1.3843713e+01 -1.4320128e+01 7.6232680e+00 -1.5418264e+00 -4.1447487e+01 -3.3900317e+01 -4.0867298e+01 -3.9622015e+01 -2.5126732e+01 -2.8060694e+01 -1.1324845e+01 -6.9276975e-01 -1.6555977e+01 -3.3551260e+01 -2.0555977e+01 -1.0140883e+01 -5.5040905e+00 -2.5701282e+00 1.4510060e+01 1.3316664e+01 -2.1172981e+00 7.0147774e+00 1.7703457e+01 2.1764777e+01 2.1538362e+01 1.0619472e+00 -2.0315411e+01 -2.4518241e+01 -1.3263524e+01 -2.0008807e+01 -2.8376732e+01 -2.4574845e+01 -2.4310694e+01 -2.0338996e+01 -8.6833358e+00 -2.1310694e+01 -2.0122015e+01 -1.8867298e+01 -9.5040905e+00 -8.8861660e+00 3.9911925e+00 -4.8908830e+00 6.5430793e+00 1.6212891e+01 -2.4474867e+00 -3.5182415e+00 -9.1597509e+00 -8.7022037e+00 1.1241193e+01 -1.2603147e+01 1.4222325e+01 -5.7116377e+00 -3.4400317e+01 -3.5768241e+01 -1.9565411e+01 -1.0103147e+01 -1.9249374e+01 -1.1197487e+01 2.6241193e+01 5.0855321e+00 -2.2522958e+01 -2.3796543e+01 -1.5499374e+01 -7.6455999e+00 -1.7163547e+00 1.9015699e+00 6.2934589e+01 3.2420438e+01 -7.7493735e+00 1.0170438e+01 2.9953457e+01 4.0745909e+01 4.3368551e+01 5.7250626e+01 9.9873268e+01 8.2552513e+01 5.8745909e+01 5.7146853e+01 6.0911004e+01 5.7212891e+01 6.1363834e+01 7.1444023e+01 1.0598176e+02 8.5373268e+01 2.8915721e+01 3.1882702e+01 5.5571381e+01 6.2354400e+01 5.6302513e+01 4.8184589e+01 1.0252893e+02 7.9995909e+01 5.3076098e+01 3.6302513e+01 5.5094966e+01 6.2236476e+01 7.0057230e+01 6.1977042e+01 1.0325063e+02 7.4194023e+01 3.7156287e+01 5.0689306e+01 7.6835532e+01 7.1156287e+01 7.1557230e+01 7.7099683e+01 1.2379780e+02 1.0031195e+02 5.1321381e+01 3.9505343e+01 3.6444023e+01 4.8694023e+01 5.8538362e+01 6.7477042e+01 1.0456195e+02 6.2387419e+01 3.8090249e+01 4.5010060e+01 5.0052513e+01 4.6382702e+01 3.5354400e+01 4.3387419e+01 7.2566664e+01 4.8066664e+01 3.9298718e+00 8.8741893e-01 2.0783645e+01 1.8368551e+01 2.5769494e+01 3.3363834e+01 6.1411004e+01 3.1222325e+01 8.7836453e+00 2.2849683e+01 1.0802513e+01 1.6948740e+01 1.2722325e+01 1.1694023e+01 5.3651570e+01 2.0175155e+01 -2.6008807e+01 -2.9791826e+01 -6.6550339e+00 -5.8484301e+00 -4.7352226e+00 -8.8531471e+00 2.6316664e+01 -9.8430130e-02 -2.2730506e+01 -8.0182415e+00 -2.8154113e+00 -2.1013524e+01 -1.2857864e+01 1.3449661e+00 4.3330815e+01 -1.1729805e-01 -3.9730506e+01 -4.6282392e+01 -4.1947487e+01 -1.9989940e+01 -1.9834279e+01 -4.9380528e+00 2.9104400e+01 1.1816664e+01 -1.7320128e+01 -2.4772958e+01 -2.7060694e+01 -8.5984301e+00 -3.4757886e+00 -5.7729584e+00 2.1745909e+01 -1.8117298e+01 -3.9239940e+01 -4.1343713e+01 -2.6876732e+01 -2.4027675e+01 -2.1263524e+01 -3.4725789e+01 3.5717608e+01 -7.2116377e+00 -4.4711638e+01 -4.3155034e+01 -4.1263524e+01 -4.0107864e+01 -3.0721072e+01 -2.6386166e+01 2.8311947e+01 -8.3578641e+00 -5.5461638e+01 -5.1084279e+01 -5.2150317e+01 -3.2791826e+01 -2.4301260e+01 -3.3768241e+01 1.7033645e+01 -4.3908830e+00 -3.3584279e+01 -4.8560694e+01 -2.3263524e+01 -2.0829562e+01 -2.1419185e+01 -1.2933336e+01 3.8887419e+01 -1.7239940e+01 -6.7376732e+01 -6.7504091e+01 -5.9197487e+01 -5.6225789e+01 -4.7546543e+01 -4.8791826e+01 5.4110038e+00 -1.1065411e+01 -5.0485223e+01 -6.0636166e+01 -4.7848430e+01 -2.8046543e+01 -2.5471072e+01 -1.9206921e+01 2.3028928e+01 -1.3744657e+01 -4.2287109e+01 -4.2749374e+01 -1.5428619e+01 4.3079304e-02 4.3355321e+00 -2.2540905e+00 4.9689306e+01 2.4411004e+01 -1.9692770e+01 -2.1664468e+01 -1.8008807e+01 1.8194023e+01 1.0242114e+00 -1.2041826e+01 3.4519494e+01 -6.5984301e+00 -3.6909751e+01 -1.9471072e+01 -1.8820128e+01 -3.9447487e+01 -4.2876732e+01 -3.5504091e+01 9.7930793e+00 -1.1914468e+01 -4.2942770e+01 -4.8235223e+01 -3.3409751e+01 -2.7296543e+01 -1.3659751e+01 -1.0414468e+01 2.2439306e+01 1.6750626e+01 -1.5305977e+01 7.1987397e+00 4.4959095e+00 2.0882702e+01 1.8321381e+01 1.1293079e+01 5.8609117e+01 2.7000626e+01 -1.5244657e+01 -2.4876732e+01 -1.7796543e+01 -4.2069207e+00 7.0817364e-01 3.8362323e-02 5.8010060e+01 2.6802513e+01 -1.6438053e+01 -2.7329562e+01 + 4.8249005e+00 1.0938108e+01 2.1989995e+01 1.2164523e+01 6.1754146e+01 1.4169240e+01 -4.3307599e+00 -2.2317033e+00 -1.9298165e+00 4.9428250e+00 2.3107496e+00 1.1645231e+00 4.8183391e+01 -1.8401938e+00 -4.9972269e+01 -6.3821326e+01 -5.4005288e+01 -3.3085477e+01 6.0749558e-02 -1.4519439e+01 2.8122070e+01 -3.3778873e+01 -7.4293024e+01 -6.7519439e+01 -5.0920383e+01 -4.0245854e+01 -4.4076043e+01 -3.6302458e+01 2.2353202e+01 -1.7354345e+01 -5.5788307e+01 -6.3024156e+01 -5.1212835e+01 -5.6665666e+01 -4.7066609e+01 -2.8656232e+01 2.2588628e+00 -2.0528873e+01 -1.6066609e+01 -2.0175099e+01 -3.9675523e+00 -1.1755288e+01 6.5890514e+00 4.7965986e+00 1.4428674e+01 -9.3071750e+00 -5.2302458e+01 -5.1076043e+01 -6.1340194e+01 -7.0278873e+01 -6.7363779e+01 -7.7991137e+01 -6.3109062e+01 -5.7406232e+01 -8.5660949e+01 -1.0903359e+02 -9.6491137e+01 -8.7632647e+01 -8.3099628e+01 -8.5623213e+01 -6.8156232e+01 -7.4981703e+01 -8.3656232e+01 -7.0750571e+01 -5.4439250e+01 -5.6774156e+01 -5.7245854e+01 -7.8632647e+01 -9.9255288e+01 -9.9726986e+01 -9.2340194e+01 -1.0011378e+02 -1.0508548e+02 -1.0632133e+02 -1.0403831e+02 -1.0244868e+02 -9.5642081e+01 -1.1120340e+02 -1.0637321e+02 -9.9972269e+01 -8.9443967e+01 -8.4443967e+01 -6.8203401e+01 -6.2354345e+01 -4.0637364e+01 -2.5127930e+01 -3.7250571e+01 -3.1981703e+01 -3.0458118e+01 -1.9005288e+01 4.3909382e+00 -1.2528873e+01 2.4442825e+01 1.9155089e+01 9.0980616e-01 4.2305609e+00 1.7735278e+01 2.0353202e+01 1.4839051e+01 1.7301316e+01 5.1296599e+01 2.2211693e+01 -1.1712835e+01 -2.0406232e+01 -1.4109062e+01 -1.4179816e+01 -2.0689250e+01 -3.2939250e+01 1.0126787e+01 -3.3623213e+01 -8.0193967e+01 -7.8000571e+01 -7.2547741e+01 -7.9849628e+01 -9.4410949e+01 -9.3208118e+01 -6.0802458e+01 -9.3354345e+01 -1.2026944e+02 -1.1680246e+02 -1.1636378e+02 -1.1582604e+02 -1.1448170e+02 -1.0699585e+02 -6.6363779e+01 -8.5425099e+01 -1.3772227e+02 -1.3389208e+02 -1.0577416e+02 -1.0053831e+02 -1.0012793e+02 -1.0339208e+02 -5.3854345e+01 -7.9458118e+01 -1.0718925e+02 -1.1816567e+02 -9.7113779e+01 -9.0245854e+01 -8.7972269e+01 -1.0016095e+02 -5.0505288e+01 -8.0585477e+01 -1.0679774e+02 -9.2165666e+01 -6.6109062e+01 -6.4571326e+01 -6.7953401e+01 -5.9524156e+01 -6.8354769e+00 -3.0552458e+01 -6.2373213e+01 -6.2887364e+01 -5.6495854e+01 -4.2618496e+01 -3.2462835e+01 -2.0651515e+01 2.8725844e+01 -5.2788731e+00 -2.0127930e+01 1.9994288e+00 1.3353202e+01 1.5975844e+01 6.5182967e+00 7.3767873e+00 3.9801316e+01 8.8249005e+00 -2.6349628e+01 -2.3335477e+01 -7.5057120e-01 -7.7694391e+00 9.2395710e-01 6.8909382e+00 3.4622070e+01 2.0843345e+00 -1.9476986e+01 1.4565522e-01 -6.8071750e+00 6.3249005e+00 5.5041458e+00 -2.2226931e-01 4.6560750e+01 1.2829617e+01 -2.1854345e+01 -9.2883070e+00 1.4438108e+01 1.5405089e+01 9.8437684e+00 3.4192401e+00 4.3150372e+01 1.5032448e+01 -1.1826043e+01 9.4239571e+00 1.5268297e+01 -4.3307599e+00 7.5607496e+00 1.9004146e+01 5.6876787e+01 1.8367353e+01 -1.6311892e+01 -1.3590194e+01 -1.2151515e+01 3.9239571e+00 -3.6845335e+00 8.2447118e+00 4.0518297e+01 9.5513156e+00 -1.8627930e+01 -3.2307175e+01 -2.8278873e+01 -7.2269863e+00 -9.2269863e+00 -1.2693967e+01 1.4301316e+01 -1.9797741e+01 -2.7722269e+01 -2.5354345e+01 -1.2085477e+01 -7.5524580e+00 -7.2458542e+00 -1.5415666e+01 5.7867353e+01 1.0249429e+01 -2.3703401e+01 -1.2774156e+01 -2.0194391e+00 3.8532024e+00 1.7494712e+01 2.1183391e+01 7.3560750e+01 3.9942825e+01 -2.1283535e-01 4.9899948e+00 1.3622126e-01 1.4923957e+01 1.4239995e+01 1.4192401e+00 4.0895655e+01 3.1786741e+00 -2.3722269e+01 -3.5274156e+01 -3.2269863e+00 3.6315043e+00 1.3678674e+01 2.3296599e+01 8.5749429e+01 3.8027731e+01 3.9145231e+00 9.2399948e+00 2.1857919e+01 3.3423957e+01 4.4876787e+01 3.6475844e+01 9.3862636e+01 6.4862636e+01 2.4159806e+01 1.9372070e+01 3.6636221e+01 4.7659806e+01 4.5589051e+01 4.3188108e+01 8.3739995e+01 4.0895655e+01 1.1886221e+01 9.0513156e+00 3.5584334e+01 5.1862636e+01 4.9263580e+01 3.3414523e+01 7.6570184e+01 4.4277731e+01 7.1975420e+00 1.1791882e+01 2.6112636e+01 6.4065467e+01 4.4565467e+01 3.8098485e+01 8.8202259e+01 4.7414523e+01 2.2367353e+01 5.7112636e+01 7.6612636e+01 7.8065467e+01 9.1367353e+01 9.9353202e+01 1.4617396e+02 1.1568339e+02 8.4909806e+01 7.9060750e+01 8.8395655e+01 9.1980561e+01 9.9739995e+01 9.7376787e+01 1.2891924e+02 1.1598999e+02 7.5334334e+01 8.9673957e+01 8.8556033e+01 7.6725844e+01 9.3409806e+01 7.5541882e+01 1.1680132e+02 8.2839051e+01 5.0084334e+01 4.9900372e+01 6.7650372e+01 8.6928674e+01 6.8773014e+01 9.5777731e+01 1.6463150e+02 1.2800415e+02 8.9273014e+01 8.4202259e+01 + 3.7420862e+00 7.3552937e+00 2.0449633e+01 1.3242086e+01 6.8185482e+01 1.9907180e+01 6.1100107e+00 1.4836426e+01 1.7364728e+01 1.3326992e+01 9.3977465e+00 1.1529822e+01 5.4676048e+01 -3.2862157e+00 -4.4753197e+01 -5.3498480e+01 -4.6385272e+01 -2.0130555e+01 6.6194446e+00 -1.1017348e+01 3.1558124e+01 -3.1069235e+01 -7.3243763e+01 -6.0880555e+01 -5.0583386e+01 -4.5989046e+01 -5.3163574e+01 -3.9823952e+01 1.6765671e+01 -2.4649423e+01 -5.9526782e+01 -5.9946593e+01 -4.7479612e+01 -5.3899423e+01 -4.5960744e+01 -3.1701310e+01 6.8548239e-01 -2.5823952e+01 -1.4559801e+01 -1.7191876e+01 1.8552937e+00 -3.5739516e+00 1.6803407e+01 1.4661897e+01 2.0364728e+01 -4.1918761e+00 -4.7465461e+01 -4.6206027e+01 -5.2423008e+01 -5.8088103e+01 -5.4423008e+01 -6.2517348e+01 -4.4069235e+01 -3.7847536e+01 -6.8583386e+01 -8.9927725e+01 -7.8932442e+01 -7.1097536e+01 -6.7856970e+01 -7.0696593e+01 -5.5432442e+01 -6.1300367e+01 -6.6276782e+01 -5.0592820e+01 -3.1970178e+01 -3.6102253e+01 -3.7489046e+01 -6.0239046e+01 -7.6682442e+01 -7.6753197e+01 -6.9880555e+01 -7.6724895e+01 -8.4536216e+01 -8.5456027e+01 -7.9380555e+01 -8.5644706e+01 -7.1394706e+01 -8.9451310e+01 -8.3597536e+01 -7.6498480e+01 -6.8031499e+01 -6.4290933e+01 -4.5937159e+01 -4.2437159e+01 -1.9819235e+01 -5.1258384e+00 -1.0503197e+01 -1.8852723e+00 1.3222748e+00 1.5661897e+01 4.1487369e+01 2.3661897e+01 6.4808124e+01 5.9619445e+01 4.8293973e+01 5.0364728e+01 6.3482652e+01 6.6185482e+01 5.7855294e+01 5.5586426e+01 9.5355294e+01 5.5506237e+01 2.3893030e+01 1.8888313e+01 2.3959067e+01 2.0539256e+01 1.2746803e+01 -1.6829120e-01 3.9143030e+01 -7.7154610e+00 -5.2003197e+01 -4.8687159e+01 -4.5300367e+01 -5.7408857e+01 -6.8564518e+01 -6.5267348e+01 -3.2984329e+01 -7.1715461e+01 -9.9309801e+01 -9.2418291e+01 -9.5923008e+01 -9.3757914e+01 -9.4489046e+01 -8.4366404e+01 -4.3998480e+01 -6.6427725e+01 -1.1668716e+02 -1.0704093e+02 -7.8691876e+01 -7.6210744e+01 -7.2970178e+01 -7.4446593e+01 -2.1248480e+01 -5.3970178e+01 -8.2710744e+01 -9.0517348e+01 -7.3677725e+01 -6.7404140e+01 -6.8885272e+01 -8.1838103e+01 -3.2710744e+01 -6.5220178e+01 -8.8956027e+01 -7.6526782e+01 -5.3059801e+01 -5.0224895e+01 -5.5055084e+01 -4.5201310e+01 6.0392560e+00 -2.5753197e+01 -6.0380555e+01 -5.8135272e+01 -5.0177725e+01 -3.6423008e+01 -2.2753197e+01 -1.2314518e+01 3.6506237e+01 -8.6168743e-01 -1.1206027e+01 1.0676048e+01 1.9822275e+01 2.5600577e+01 1.7746803e+01 1.6520388e+01 4.7770388e+01 1.1171331e+01 -2.3597536e+01 -2.0215461e+01 -2.4748950e+00 -1.3163574e+01 -1.0314987e+00 8.4114276e-01 3.1308124e+01 -7.2489497e-01 -2.0088103e+01 2.0675579e+00 -6.1447063e+00 1.0534539e+01 3.8222748e+00 -2.7343289e+00 4.4496803e+01 8.4685013e+00 -2.5654140e+01 -7.9560270e+00 1.1959067e+01 1.4826992e+01 1.3279822e+01 7.2892560e+00 4.7647747e+01 1.6393030e+01 -1.0682442e+01 1.3916614e+01 1.8326992e+01 2.3175579e+00 1.1959067e+01 2.7095860e+01 6.7350577e+01 2.5015671e+01 -6.8711214e+00 -6.6164044e+00 -7.7909327e+00 5.5769918e+00 4.8736918e-01 1.5091143e+01 4.6977935e+01 1.4482652e+01 -1.3465461e+01 -2.3474895e+01 -2.2088103e+01 1.6571805e+00 -2.2909327e+00 -4.7060270e+00 2.2666614e+01 -1.3158857e+01 -1.9781499e+01 -1.7724895e+01 -2.4607440e+00 2.6901994e+00 2.0388045e-02 -3.5079138e+00 6.6996803e+01 1.2242086e+01 -1.9460744e+01 -7.8003667e+00 -1.2060270e+00 4.4920862e+00 9.6288786e+00 1.7091143e+01 6.6751520e+01 2.9171331e+01 -9.0031969e+00 1.2515201e+00 -5.9800634e-02 1.5260954e+01 1.8572275e+01 3.3364258e+00 4.7449633e+01 9.5859744e-02 -2.6743763e+01 -3.5941876e+01 -3.4088572e+00 2.5392560e+00 8.5298220e+00 1.5091143e+01 7.7303407e+01 2.2091143e+01 -3.9371591e+00 -6.5414026e-01 1.2043973e+01 2.7916614e+01 3.8454350e+01 2.7784539e+01 8.7076992e+01 4.7190199e+01 1.0161897e+01 8.0015201e+00 2.8067558e+01 3.8987369e+01 3.4463784e+01 3.2907180e+01 7.8223218e+01 3.1062841e+01 7.9118975e+00 8.4826522e+00 3.0289256e+01 4.2176048e+01 3.8369445e+01 2.2284539e+01 6.9062841e+01 2.8902464e+01 -6.5692346e+00 -1.4890459e+00 1.8242086e+01 5.3704350e+01 1.4039256e+01 3.2845860e+01 8.0251520e+01 3.7166614e+01 1.6694916e+01 5.1218501e+01 6.6025105e+01 6.5709067e+01 7.7916614e+01 8.7298690e+01 1.3504397e+02 1.0202982e+02 7.2426048e+01 6.4246803e+01 5.5510954e+01 5.7076992e+01 6.6586426e+01 6.2100577e+01 9.6397747e+01 9.6256237e+01 5.6218501e+01 7.0638313e+01 7.0907180e+01 6.3638313e+01 5.9779822e+01 4.3770388e+01 8.7878879e+01 5.1468501e+01 2.0350577e+01 1.8572275e+01 5.4477935e+01 5.1808124e+01 4.8893030e+01 7.9161897e+01 1.4486473e+02 1.0327039e+02 6.4364728e+01 6.0303407e+01 + 2.2203627e+01 2.5288533e+01 3.1326269e+01 2.2246080e+01 7.1415891e+01 1.3264948e+01 4.5762686e+00 8.3098559e-01 4.9677780e+00 6.9300422e+00 8.7649479e+00 1.2901740e+01 6.1080986e+01 3.5102309e+00 -3.8862411e+01 -4.5919014e+01 -3.5282222e+01 -5.5699578e+00 2.5821552e+01 1.1246080e+01 4.8731929e+01 -1.7980335e+01 -5.2923731e+01 -4.4305807e+01 -2.7376562e+01 -1.8876562e+01 -2.6862411e+01 -8.4944861e+00 5.0769665e+01 4.9489101e+00 -3.0834109e+01 -3.1640713e+01 -2.2626562e+01 -3.1419014e+01 -2.1527505e+01 -6.7303352e+00 2.3283816e+01 -1.2565241e+01 -7.1784484e+00 -1.4607694e+01 -1.1124106e+00 -7.4425993e+00 1.4486646e+01 1.7279099e+01 2.2288533e+01 -2.7504975e-02 -3.6999203e+01 -3.7494486e+01 -4.9786939e+01 -5.3602977e+01 -5.3362411e+01 -6.7235052e+01 -4.9442599e+01 -4.8621845e+01 -8.6904863e+01 -1.0739543e+02 -9.3286939e+01 -9.0381279e+01 -8.8725618e+01 -9.2428448e+01 -7.4683165e+01 -8.4994486e+01 -9.1834109e+01 -8.6584109e+01 -7.0461467e+01 -7.4739769e+01 -6.8706750e+01 -9.5154863e+01 -1.0742373e+02 -1.0403222e+02 -9.9329392e+01 -1.0564543e+02 -1.1335298e+02 -1.1490958e+02 -1.0674920e+02 -1.0969732e+02 -9.8452033e+01 -1.1763128e+02 -1.1334354e+02 -1.0958411e+02 -1.0004637e+02 -9.8437882e+01 -8.0989769e+01 -8.6494486e+01 -6.6013354e+01 -5.7961467e+01 -7.4489769e+01 -6.8621845e+01 -6.8216184e+01 -5.6815241e+01 -3.6890713e+01 -5.6810524e+01 -2.0211467e+01 -3.8923731e+01 -5.7593543e+01 -5.3852977e+01 -3.8584109e+01 -3.3121845e+01 -3.4933165e+01 -3.1381279e+01 1.1043250e+01 -2.3527505e+01 -5.2235052e+01 -5.2475618e+01 -4.1282222e+01 -3.8456750e+01 -3.8494486e+01 -4.2192599e+01 8.8168346e+00 -3.6433165e+01 -7.6239769e+01 -6.4532222e+01 -5.3409580e+01 -5.6319958e+01 -6.2117128e+01 -5.0933165e+01 -1.3513354e+01 -5.2980335e+01 -7.3098260e+01 -6.0324675e+01 -6.2518071e+01 -5.7541656e+01 -6.1291656e+01 -5.1117128e+01 -1.0480335e+01 -4.0532222e+01 -9.3527505e+01 -8.2400146e+01 -5.1956750e+01 -5.1065241e+01 -5.0485052e+01 -5.3437882e+01 1.5338158e+00 -3.2541656e+01 -5.6824675e+01 -6.0985052e+01 -4.3994486e+01 -3.5371845e+01 -3.4923731e+01 -4.6065241e+01 3.8074007e+00 -3.3371845e+01 -5.5871845e+01 -3.9782222e+01 -1.1385996e+01 -8.9378823e+00 -1.0433165e+01 3.4206082e+00 5.2076269e+01 1.9897023e+01 -1.4885996e+01 -1.2508637e+01 -5.4614672e+00 5.0385328e+00 2.3297967e+01 3.3496080e+01 8.1830986e+01 3.7231929e+01 2.6547967e+01 4.4746080e+01 4.9585703e+01 5.0444193e+01 4.5901740e+01 4.5165891e+01 7.8670608e+01 4.0797967e+01 7.6281554e+00 1.1977212e+01 3.4387589e+01 2.3425325e+01 3.7552684e+01 4.2873438e+01 7.4901740e+01 3.8746080e+01 1.9543250e+01 4.1387589e+01 2.7802684e+01 4.6500797e+01 4.1213061e+01 3.9812118e+01 8.5821552e+01 4.3496080e+01 9.2649479e+00 2.4397023e+01 3.8953627e+01 4.4085703e+01 3.6227212e+01 3.1260231e+01 7.4307401e+01 3.4128155e+01 9.0243818e+00 3.7099854e+01 3.2788533e+01 1.8236646e+01 2.6095137e+01 3.6411174e+01 7.1453627e+01 2.0203627e+01 -1.1569958e+01 -8.0699578e+00 -5.7256182e+00 1.1746080e+01 8.6989101e+00 2.0038533e+01 5.4170608e+01 1.6406457e+01 -1.2801090e+01 -1.6989769e+01 -1.4216184e+01 1.0614004e+01 6.6989101e+00 3.6847592e+00 3.2684759e+01 -1.1692599e+01 -2.0385996e+01 -1.9098260e+01 -7.2492031e+00 -4.3624106e+00 -7.0180710e+00 -8.5039201e+00 5.7448910e+01 3.3592875e+00 -2.6263354e+01 -1.5919014e+01 -3.5982597e+00 3.3828724e+00 9.9158913e+00 1.9147023e+01 7.2967778e+01 2.4109287e+01 -1.5013354e+01 -7.3293918e+00 -1.3041656e+01 4.6658913e+00 8.5951365e+00 -6.6454295e+00 3.9750797e+01 -8.1737314e+00 -3.2904863e+01 -3.9513354e+01 -6.8199578e+00 -1.7775050e+00 5.3451365e+00 1.5566835e+01 7.8326269e+01 1.3288533e+01 -1.2881279e+01 -1.0513354e+01 9.7249503e-01 1.2326269e+01 2.0906457e+01 1.2349854e+01 7.6859287e+01 3.1231929e+01 -3.4944861e+00 -5.3199578e+00 8.5479667e+00 1.8599854e+01 1.4769665e+01 1.4481929e+01 5.3647023e+01 3.2932497e+00 -2.0862411e+01 -2.1635996e+01 6.9347592e+00 1.9694193e+01 1.7359287e+01 4.4300422e+00 5.0062118e+01 8.4064573e+00 -2.3626562e+01 -1.9598260e+01 1.1517403e+00 3.1147023e+01 1.1948910e+01 1.1779099e+01 6.1029099e+01 1.3080986e+01 -6.3199578e+00 2.6114004e+01 3.0297967e+01 2.7170608e+01 3.8147023e+01 4.4981929e+01 9.2345137e+01 5.9208344e+01 3.4821552e+01 2.9335703e+01 4.4566835e+01 4.6132872e+01 5.4599854e+01 5.0656457e+01 8.8147023e+01 6.5071552e+01 3.4755514e+01 5.1859287e+01 4.8231929e+01 6.0934759e+01 5.6264948e+01 4.1217778e+01 8.4642306e+01 4.4764948e+01 1.2840420e+01 5.6092875e+00 2.1302684e+01 3.6647023e+01 3.4878155e+01 4.8090420e+01 1.1471778e+02 6.9029099e+01 3.1019665e+01 3.5279099e+01 + 6.1903468e+00 1.0855441e+01 2.0737517e+01 1.7473366e+01 6.9350724e+01 1.3152611e+01 7.9969505e+00 6.5063845e+00 1.8987517e+01 1.7341290e+01 1.9067705e+01 2.4492234e+01 6.9232800e+01 1.1902611e+01 -2.7106823e+01 -3.3861540e+01 -2.9903993e+01 -3.6728608e+00 1.9534686e+01 8.1667619e+00 3.9275252e+01 -2.3399276e+01 -5.7988899e+01 -4.4333238e+01 -3.4036068e+01 -2.7668144e+01 -3.4026634e+01 -1.0993615e+01 4.1864875e+01 -5.1304079e+00 -3.8776634e+01 -3.4564370e+01 -2.6630408e+01 -4.2168144e+01 -3.1441729e+01 -1.7720031e+01 1.2666762e+01 -1.8337955e+01 -6.7483325e+00 -8.8049362e+00 4.6620449e+00 -9.4172870e-01 1.5190347e+01 1.5284686e+01 1.8525252e+01 -6.6162570e+00 -3.9569087e+01 -3.4460597e+01 -3.9031351e+01 -4.0177578e+01 -3.6710597e+01 -4.4771917e+01 -1.9394559e+01 -1.7762483e+01 -5.3668144e+01 -6.9069087e+01 -5.5196446e+01 -5.0597389e+01 -5.0097389e+01 -5.5550219e+01 -4.0738899e+01 -5.5465314e+01 -5.7187012e+01 -4.7172861e+01 -3.2394559e+01 -3.7979465e+01 -3.5187012e+01 -6.3644559e+01 -7.6663427e+01 -6.8488899e+01 -6.8687012e+01 -7.7554936e+01 -8.3300219e+01 -8.4168144e+01 -7.4276634e+01 -7.9413427e+01 -6.4106823e+01 -8.5073804e+01 -7.6526634e+01 -7.0073804e+01 -6.2380408e+01 -6.2592672e+01 -4.2111540e+01 -4.4668144e+01 -2.6432295e+01 -1.8196446e+01 -2.7776634e+01 -1.8262483e+01 -1.4054936e+01 -2.2813513e+00 1.4511101e+01 -3.7388985e+00 3.5062988e+01 2.1506385e+01 6.9167619e+00 9.8931770e+00 2.2081856e+01 2.7680913e+01 2.3756385e+01 2.7487517e+01 6.9039403e+01 3.0643177e+01 3.2092147e+00 6.2280826e+00 1.4322422e+01 1.2978083e+01 7.7233656e+00 2.1997807e+00 4.4912045e+01 -1.8945589e+00 -4.0026634e+01 -2.9498332e+01 -1.9125691e+01 -2.3168144e+01 -2.8059653e+01 -1.6003049e+01 1.8765818e+01 -2.3389842e+01 -4.3356823e+01 -3.1149276e+01 -3.8309653e+01 -3.1809653e+01 -3.5951163e+01 -2.4366257e+01 1.4279969e+01 -1.8767200e+01 -6.4106823e+01 -5.0545502e+01 -2.1885125e+01 -2.1866257e+01 -2.1866257e+01 -2.0951163e+01 3.0638460e+01 -6.8238042e+00 -3.0059653e+01 -3.3767200e+01 -1.9625691e+01 -1.1644559e+01 -1.3691729e+01 -2.5606823e+01 1.9704498e+01 -1.8418144e+01 -3.6328521e+01 -2.4347389e+01 2.6950638e+00 6.1620449e+00 3.7422336e+00 1.9676196e+01 6.6303554e+01 2.8629026e+01 -5.7341815e+00 -7.9550228e-01 7.1620449e+00 1.6298837e+01 3.5152611e+01 4.8105441e+01 9.2053554e+01 4.5346007e+01 4.0256385e+01 5.5850724e+01 5.8633743e+01 5.7893177e+01 5.5369592e+01 5.3487517e+01 8.3119592e+01 4.0855441e+01 9.0771392e+00 1.7242234e+01 3.4897894e+01 1.9440347e+01 3.5666762e+01 3.7610158e+01 6.8978083e+01 3.4864875e+01 1.7869592e+01 4.0341290e+01 2.5350724e+01 4.6652611e+01 3.7515818e+01 3.4110158e+01 7.8553554e+01 3.7011101e+01 3.2988373e+00 2.3765818e+01 3.9209215e+01 4.2973366e+01 3.8695064e+01 3.4713932e+01 7.5921479e+01 3.6011101e+01 1.3765818e+01 4.4053554e+01 3.8600724e+01 2.8166762e+01 3.4756385e+01 4.7581856e+01 8.0284686e+01 2.8888460e+01 -3.1775778e+00 -1.9511627e+00 -3.2247476e+00 1.0699781e+01 1.0162045e+01 2.2897894e+01 5.5199781e+01 1.9869592e+01 -1.0668144e+01 -1.1545502e+01 -1.0847389e+01 1.5213932e+01 9.2752524e+00 7.8648751e+00 3.4846007e+01 -5.5879551e+00 -1.1366257e+01 -1.3413427e+01 -8.3795511e-01 7.2658185e+00 3.1243090e+00 4.1903468e+00 6.4728083e+01 1.0798837e+01 -1.8191729e+01 -1.1050219e+01 -3.0879551e+00 -1.0455023e+00 1.6950638e+00 1.0614875e+01 6.0567705e+01 7.2186487e+00 -2.8267200e+01 -1.9946446e+01 -2.3729465e+01 -4.7624834e+00 1.8884600e+00 -1.2993615e+01 3.3459215e+01 -1.6276634e+01 -4.1139842e+01 -4.2663427e+01 -1.0701163e+01 -6.7294645e+00 -6.8229474e-01 1.0562988e+01 6.8496951e+01 4.8035543e+00 -1.4875691e+01 -1.1403993e+01 8.5544111e-01 1.3935630e+01 2.1822422e+01 1.1610158e+01 7.3949781e+01 1.9459215e+01 -9.7907853e+00 -1.2870974e+01 5.1384600e+00 1.4039403e+01 9.7799694e+00 1.3506385e+01 5.9784686e+01 7.8082713e+00 -1.3187012e+01 -1.3130408e+01 1.3779969e+01 2.4317705e+01 2.2709215e+01 8.5818562e+00 5.4897894e+01 1.2053554e+01 -1.5488899e+01 -1.0366257e+01 1.3756385e+01 4.3879026e+01 2.7662045e+01 2.9015818e+01 7.3544120e+01 2.8412045e+01 1.2605441e+01 4.2869592e+01 4.0704498e+01 3.6237517e+01 4.3185630e+01 4.8218649e+01 9.1322422e+01 5.4048837e+01 3.1015818e+01 1.8817705e+01 3.2232800e+01 3.8350724e+01 4.6812988e+01 4.4581856e+01 8.2544120e+01 5.7346007e+01 3.1770535e+01 4.8864875e+01 4.9624309e+01 6.2346007e+01 5.8591290e+01 4.6794120e+01 8.8482800e+01 4.9836573e+01 2.4105441e+01 1.6147894e+01 3.3011101e+01 4.7459215e+01 4.3709215e+01 5.7624309e+01 1.1795921e+02 7.0195064e+01 3.3784686e+01 3.3275252e+01 + -8.3423773e-01 1.0429913e+01 9.2318000e+00 1.0090291e+01 5.7104442e+01 -6.7068792e+00 -2.0985181e+01 -3.3673860e+01 -2.4079521e+01 -1.7183294e+01 -2.1031057e+00 -8.5782263e-01 4.0845008e+01 -1.0485181e+01 -5.0018200e+01 -6.1796502e+01 -4.4461596e+01 -3.6725660e-01 3.1071423e+01 1.5745951e+01 3.6184630e+01 -3.1183294e+01 -6.8188011e+01 -4.9249332e+01 -2.7838955e+01 -2.4329521e+01 -3.6683294e+01 -1.1125396e+00 4.9208215e+01 -6.1455585e+00 -4.3688011e+01 -3.0574804e+01 -2.0296502e+01 -3.3301219e+01 -2.3225747e+01 -1.7923860e+01 3.6657623e+00 -3.1730464e+01 -2.4093672e+01 -3.9235181e+01 -2.8357823e+01 -2.5796502e+01 2.1846302e+00 4.2459510e+00 2.3921774e+00 -2.3084238e+01 -5.1192728e+01 -5.5371974e+01 -6.5320087e+01 -6.3452162e+01 -5.4447445e+01 -6.8588955e+01 -4.7570087e+01 -3.9735181e+01 -7.4419143e+01 -7.9862540e+01 -6.7357823e+01 -6.4697445e+01 -4.7971030e+01 -4.3249332e+01 -1.8904992e+01 -2.7098389e+01 -3.3461596e+01 -3.6989898e+01 -1.4334238e+01 -1.9791785e+01 -4.7917849e+00 -4.1032351e+01 -5.3952162e+01 -4.4447445e+01 -4.5555936e+01 -5.5452162e+01 -6.6532351e+01 -6.6890842e+01 -6.1820087e+01 -6.5537068e+01 -5.7838955e+01 -7.3145558e+01 -6.3070087e+01 -5.3654992e+01 -5.5730464e+01 -4.6654992e+01 -3.0211596e+01 -3.8428577e+01 -1.4654992e+01 -8.2446151e+00 -2.7617257e+01 -2.2131408e+01 -1.8211596e+01 3.5808566e+00 2.3175196e+01 2.2223660e+00 3.1061989e+01 -1.6914339e-01 -5.0134830e+00 5.3827434e+00 7.9676491e+00 1.2231800e+01 1.2392177e+01 1.6043121e+01 6.2354442e+01 2.0217649e+01 -2.2692728e+01 -1.6598389e+01 1.6374604e+00 4.0195359e+00 5.3968943e+00 5.4534981e+00 4.8915762e+01 3.3968943e+00 -3.3518200e+01 -2.3942728e+01 -1.5145558e+01 -8.5606528e+00 -1.3320087e+01 1.0788404e+01 3.7830857e+01 -1.2942728e+01 -2.0235181e+01 8.8274340e-01 -1.0282351e+01 -3.0121886e-01 -3.3895471e-01 1.1703498e+01 5.6014819e+01 1.4014819e+01 -4.0650275e+01 -2.9857823e+01 -1.7068792e+00 2.4252838e-02 1.0572717e+00 -5.2823509e+00 6.2755385e+01 1.7760102e+01 -6.5182000e+00 -4.1125396e+00 -3.3861245e+00 7.6563283e+00 1.0146894e+01 5.1953586e-01 4.3250668e+01 1.5855736e+00 -2.9904992e+01 -1.2975747e+01 9.9299132e+00 1.3245951e+01 1.1142177e+01 2.7967649e+01 6.2717649e+01 1.9826140e+01 -1.8447445e+01 -1.2485181e+01 -9.9568792e+00 4.6468943e+00 2.6368592e+01 3.0137460e+01 6.8321423e+01 1.8128026e+01 1.3264819e+01 3.1010102e+01 2.4708215e+01 2.8547838e+01 3.1675196e+01 3.6236517e+01 7.3807272e+01 2.9505385e+01 -9.1502755e+00 -3.3423773e-01 1.7986517e+01 1.1684630e+01 2.5915762e+01 3.0345008e+01 5.3962932e+01 1.2656328e+01 -3.4097094e+00 2.2142177e+01 5.9251962e+00 2.7665762e+01 2.6576140e+01 3.5146894e+01 7.3552555e+01 1.9580857e+01 -1.0169143e+01 1.2845008e+01 1.6623309e+01 2.7420479e+01 1.8095008e+01 2.5033687e+01 5.9288404e+01 1.2000668e+01 -1.8357823e+01 2.0623309e+01 7.8167057e+00 1.4959510e+00 1.2528970e+01 2.0109158e+01 4.8925196e+01 -7.0700868e+00 -2.8305936e+01 -1.6216313e+01 -1.4782351e+01 3.2931208e+00 8.6859246e-01 1.0981800e+01 4.2519536e+01 8.3921774e+00 -1.1838955e+01 -1.9947445e+01 -1.9744615e+01 9.5148189e+00 2.1657623e+00 3.8274340e-01 2.9406328e+01 -2.1022917e+01 -2.7400275e+01 -1.7838955e+01 -1.2749332e+01 -9.0970943e-01 -1.5838955e+01 -4.7729170e+00 5.5104442e+01 -6.2398981e+00 -3.1188011e+01 -2.3485181e+01 -1.3711596e+01 5.9629321e+00 8.4029057e-01 1.5679913e+01 6.7411045e+01 4.2082151e+00 -3.2362540e+01 -1.5782351e+01 -2.0989898e+01 -4.1172566e+00 1.3123309e+01 2.1893472e+00 4.8962932e+01 -6.2021623e+00 -3.7636125e+01 -3.7263483e+01 -1.2659709e+01 -1.7446151e+00 5.7931208e+00 1.2080857e+01 7.3175196e+01 -1.0277634e+01 -2.6070087e+01 -6.6172566e+00 1.2330944e-01 -5.2763395e-01 7.2553849e+00 1.1610453e+00 6.9651611e+01 7.0431208e+00 -2.9645558e+01 -2.8188011e+01 -1.0994615e+01 6.6705668e-02 1.3043121e+01 6.9406416e-01 3.2764819e+01 -1.4041785e+01 -3.7225747e+01 -4.5801219e+01 -1.6390842e+01 -2.4851811e+00 -1.8801131e-01 -4.2068792e+00 3.1566706e+01 -1.5909709e+01 -4.4112540e+01 -3.8772917e+01 -7.3436717e+00 3.6657623e+00 -1.0504049e+01 5.8450076e+00 4.8962932e+01 -1.0890842e+01 -2.5777634e+01 8.2648189e+00 -8.7776340e+00 -6.0936717e+00 1.6543121e+01 2.3684630e+01 6.0684630e+01 2.1958215e+01 8.3733094e+00 1.9912340e+00 1.6698781e+01 2.2415762e+01 3.3283687e+01 1.6142177e+01 5.1528970e+01 2.3486517e+01 5.6657623e+00 1.2076140e+01 5.3450076e+00 2.8859158e+01 2.3944064e+01 6.1799132e+00 4.5944064e+01 1.6731800e+01 -1.6777634e+01 -3.0654992e+01 -2.0447445e+01 2.9157623e+00 9.3463020e-01 2.7774253e+01 9.1613875e+01 3.6948781e+01 -1.0414426e+01 -4.3012189e+00 + -3.3959500e-01 -2.3537459e+00 -3.4056327e+00 -1.5754441e+00 4.6084933e+01 -4.5141233e+00 -8.3487802e-01 -9.9197837e+00 7.6698390e+00 6.3538012e+00 9.9481408e+00 2.9070782e+01 6.8608518e+01 9.5613484e+00 -2.0665067e+01 -2.7249972e+01 -1.7207520e+01 1.7660405e+01 3.2518896e+01 3.0476443e+01 5.0650971e+01 -8.7594063e+00 -3.7245255e+01 -2.3396199e+01 -2.6806576e+01 -1.9014123e+01 -1.8037708e+01 1.7915122e+01 5.0037763e+01 -2.8018592e+00 -2.9462237e+01 -3.3764123e+01 -2.9070727e+01 -4.9721670e+01 -3.3716953e+01 -1.6745255e+01 8.3443673e+00 -3.6245255e+01 -2.7957520e+01 -2.5212237e+01 -1.0198086e+01 -2.5612931e+00 1.5688707e+01 1.9594367e+01 1.5316065e+01 -4.8301610e+00 -2.9089595e+01 -2.7589595e+01 -2.3721670e+01 -1.6377331e+01 -1.8400916e+01 -2.2037708e+01 1.0349084e+01 1.7014179e+01 -1.4792425e+01 -2.3787708e+01 -7.6603497e+00 -1.9811044e+00 5.9387069e+00 1.1339650e+01 2.7028330e+01 8.3679522e+00 9.8962541e+00 1.8655688e+01 3.5613235e+01 2.4589650e+01 4.2504745e+01 1.2764179e+01 4.1040500e-01 4.7311597e+00 -4.3537459e+00 -1.9882048e+01 -2.6051859e+01 -2.1485821e+01 -1.2858463e+01 -2.4641482e+01 -1.2188652e+01 -3.1778274e+01 -1.7485821e+01 -7.4292176e+00 -1.1514123e+01 -1.6377331e+01 5.4528578e+00 5.8019144e+00 2.3377386e+01 3.0382103e+01 1.5037763e+01 2.4599084e+01 3.4551914e+01 3.8273613e+01 4.0009462e+01 2.6853801e+01 6.2900971e+01 4.5773613e+01 3.5424556e+01 3.9514179e+01 5.0287763e+01 4.3721726e+01 4.8132103e+01 5.2004745e+01 9.6353801e+01 5.8551914e+01 4.3037763e+01 5.0900971e+01 5.0471726e+01 4.6372669e+01 5.4891537e+01 4.8122669e+01 8.8174556e+01 4.5731160e+01 4.6179522e+00 1.8122669e+01 2.4547197e+01 2.7957575e+01 2.8915122e+01 4.9660405e+01 7.5500028e+01 2.9028330e+01 2.1641537e+01 3.4094367e+01 2.6240594e+01 3.0693424e+01 2.1169839e+01 3.8561348e+01 8.0221726e+01 4.3726443e+01 3.5896503e+00 1.9688707e+01 4.6594367e+01 3.8816065e+01 3.3707575e+01 3.9905688e+01 8.8863235e+01 4.9122669e+01 2.6740594e+01 2.5632103e+01 3.2820782e+01 4.2179273e+01 3.1297197e+01 3.2165122e+01 6.8056631e+01 2.1207575e+01 -2.3557267e-02 7.7405937e+00 3.1056631e+01 4.0679273e+01 3.5334933e+01 5.8183990e+01 1.0104720e+02 4.9405688e+01 8.4670088e+00 1.2169839e+01 2.6896254e+01 2.5042480e+01 4.2443424e+01 6.9683990e+01 1.0567456e+02 4.8183990e+01 4.9367952e+01 5.5693424e+01 5.3551914e+01 5.2089650e+01 5.3717009e+01 5.0778330e+01 7.9207575e+01 3.3665122e+01 6.9056880e+00 1.2146254e+01 2.7882103e+01 1.0372669e+01 3.0221726e+01 3.8226443e+01 5.8004745e+01 1.7014179e+01 2.8019144e+00 2.5533047e+01 4.4151220e+00 2.2438707e+01 1.1429273e+01 1.9056631e+01 6.7646254e+01 2.1358518e+01 -6.7169535e+00 1.6448141e+01 2.0915122e+01 3.3839650e+01 3.0424556e+01 2.9226443e+01 6.8533047e+01 2.5419839e+01 7.4104050e+00 3.8443424e+01 2.0382103e+01 1.7476443e+01 2.9816065e+01 5.2254745e+01 7.9254745e+01 2.9033047e+01 6.5424805e+00 3.6604050e+00 5.8019144e+00 2.2207575e+01 2.0820782e+01 2.9396254e+01 6.6943424e+01 2.6589650e+01 -7.1084629e+00 -1.2080161e+01 -1.2405633e+01 1.1820782e+01 2.8019144e+00 9.3821031e+00 3.8018896e+01 -4.9716705e+00 -1.2009406e+01 -5.9999724e+00 5.1651220e+00 2.0391537e+01 5.6273861e+00 3.0075499e+01 7.8514179e+01 1.8174556e+01 -6.6650667e+00 -8.5846293e-01 3.7594616e+00 9.1509710e+00 1.4094367e+01 3.1136820e+01 6.4905688e+01 9.3113484e+00 -2.1400916e+01 -8.8914818e+00 -1.9174501e+01 1.8632352e+00 8.1934239e+00 -4.2425192e-02 5.0424556e+01 -4.6650667e+00 -2.6655633e+01 -1.4797142e+01 1.6273613e+01 1.2952858e+01 1.5863235e+01 3.3528330e+01 7.3655688e+01 7.9764427e+00 3.8773861e+00 -2.3537459e+00 -1.7924252e+00 1.7617952e+01 2.3650971e+01 1.7712292e+01 8.7353801e+01 3.0089650e+01 3.4905937e+00 8.0471974e+00 1.7745311e+01 3.1547197e+01 1.9500028e+01 2.4905688e+01 6.1278330e+01 1.9353801e+01 -7.1131799e+00 -1.0806576e+01 1.7500028e+01 2.2391537e+01 2.6146254e+01 1.3561348e+01 4.6863235e+01 -2.6320478e+00 -2.6877331e+01 -1.2948086e+01 1.9910405e+01 4.0533047e+01 1.6655688e+01 3.0556631e+01 7.0599084e+01 2.4575499e+01 1.5750028e+01 4.4235877e+01 3.0726443e+01 2.1632103e+01 3.1981160e+01 4.3528330e+01 8.5429273e+01 3.5367952e+01 1.3797197e+01 5.8632352e+00 1.7240594e+01 2.4273613e+01 3.8160405e+01 3.5688707e+01 6.5056631e+01 3.1820782e+01 1.1207575e+01 2.5556631e+01 2.7731160e+01 4.7089650e+01 4.2386820e+01 3.5367952e+01 7.1806631e+01 2.7910405e+01 1.0462292e+01 3.6226691e+00 2.1877386e+01 2.9679273e+01 2.5580216e+01 4.7292480e+01 9.7896254e+01 6.0396254e+01 2.1193424e+01 1.1641537e+01 + 1.3936703e+01 1.9894250e+01 2.0365948e+01 2.4776326e+01 5.7795194e+01 -3.0632969e+00 -2.5669314e-01 -7.1717875e+00 5.0970804e+00 2.0734955e+00 1.1153684e+01 2.0931986e+01 5.6314062e+01 -1.2991460e+00 -3.4808580e+01 -3.3888769e+01 -2.3086882e+01 1.2691420e+01 2.8299911e+01 3.3814062e+01 4.6460288e+01 -1.8077448e+01 -4.0261410e+01 -2.7511410e+01 -1.8091599e+01 -1.2959523e+01 -1.8218957e+01 1.6153684e+01 5.0163118e+01 2.2338729e+00 -2.7879335e+01 -2.0553863e+01 -2.0393486e+01 -3.1846316e+01 -1.1643486e+01 -3.9972592e+00 1.9658401e+01 -1.5827448e+01 -1.4586882e+01 -1.5450089e+01 -1.1794429e+01 -1.2945372e+01 3.5074578e+00 1.0252741e+01 6.6395333e+00 -1.7020844e+01 -3.6822731e+01 -3.9714240e+01 -4.7171787e+01 -4.0964240e+01 -4.2110467e+01 -4.9143486e+01 -2.5365184e+01 -2.7695372e+01 -6.6082165e+01 -7.5152920e+01 -5.5973674e+01 -5.3983108e+01 -5.0676504e+01 -4.9086882e+01 -3.3270844e+01 -5.0162354e+01 -4.5218957e+01 -4.4313297e+01 -3.1162354e+01 -3.6534995e+01 -3.0124618e+01 -6.8143486e+01 -7.0478391e+01 -5.9270844e+01 -6.6016127e+01 -6.8884052e+01 -7.6266127e+01 -7.9629335e+01 -6.6134052e+01 -7.2676504e+01 -6.3176504e+01 -7.9398203e+01 -7.2501976e+01 -7.0964240e+01 -6.2280278e+01 -5.9728391e+01 -4.4766127e+01 -5.0534995e+01 -3.3860467e+01 -3.5973674e+01 -4.8303863e+01 -4.0473674e+01 -3.9006693e+01 -2.4351033e+01 -2.0926504e+01 -3.0582165e+01 -1.6246177e+00 -3.1987825e+01 -4.0978391e+01 -3.2086882e+01 -2.6879335e+01 -2.1440655e+01 -1.4676504e+01 -8.5066931e+00 2.6323496e+01 -1.2374618e+01 -3.1700089e+01 -2.1940655e+01 -9.7331082e+00 -8.6199007e+00 3.7538233e-01 1.3134816e+01 4.9337646e+01 7.5216087e+00 -1.7063297e+01 4.1017974e+00 1.7526326e+01 2.1248024e+01 2.5097080e+01 4.9342363e+01 7.9639533e+01 3.5908401e+01 2.8969722e+01 4.9233873e+01 4.2507458e+01 4.9988590e+01 4.2507458e+01 6.1847080e+01 9.1889533e+01 4.4658401e+01 7.9225521e+00 2.7488590e+01 5.3224439e+01 4.8153684e+01 4.5856514e+01 5.3790477e+01 9.9696137e+01 5.5738590e+01 3.5931986e+01 4.5328213e+01 5.1215005e+01 6.2672552e+01 5.9417835e+01 5.8549911e+01 9.1715005e+01 5.0431986e+01 3.9809345e+01 5.4101797e+01 7.5681986e+01 7.8535760e+01 7.8158401e+01 9.9526326e+01 1.3136123e+02 8.4681986e+01 5.2837646e+01 5.4337646e+01 6.5941420e+01 6.5809345e+01 8.5163118e+01 9.7177269e+01 1.2713953e+02 7.3389533e+01 7.2582930e+01 8.5427269e+01 8.2941420e+01 8.1073496e+01 8.4554628e+01 8.5101797e+01 1.0919614e+02 6.3248024e+01 3.5667835e+01 4.9450854e+01 6.7762175e+01 5.0082930e+01 7.1837646e+01 7.5375382e+01 9.6186703e+01 5.9785760e+01 4.6087646e+01 6.5106514e+01 4.8979156e+01 6.8078213e+01 5.6960288e+01 6.0516892e+01 8.9611231e+01 4.2526326e+01 1.2960288e+01 3.4059345e+01 4.0922552e+01 4.8205571e+01 3.8545194e+01 3.7677269e+01 7.0281043e+01 2.4196137e+01 8.9650050e+00 4.3483873e+01 2.3564062e+01 2.1238590e+01 2.6299911e+01 4.0512175e+01 5.9243307e+01 1.9980238e+00 -2.0917070e+01 -1.4662354e+01 -1.1119901e+01 8.9896724e-01 9.1206654e+00 2.2148967e+01 5.0163118e+01 1.0252741e+01 -1.8794429e+01 -1.4520844e+01 -1.2464240e+01 1.1903684e+01 1.2951937e+00 3.4791559e+00 2.1125382e+01 -2.2978391e+01 -2.7568014e+01 -2.5308580e+01 -1.8987825e+01 -1.0336882e+01 -2.1968957e+01 -8.8876861e-01 3.8045194e+01 -2.1251976e+01 -3.9355750e+01 -3.1912354e+01 -2.0506693e+01 -1.2671787e+01 -1.1534995e+01 1.1809345e+01 4.9469722e+01 -9.9642403e+00 -3.5468957e+01 -2.4101033e+01 -2.8134052e+01 -8.6812214e+00 -6.5915988e+00 -1.1270844e+01 2.9752741e+01 -2.5058580e+01 -4.6351033e+01 -3.8723674e+01 -1.6101033e+01 -1.7096316e+01 -1.3129335e+01 7.1961371e+00 4.0837646e+01 -3.5992542e+01 -4.9374618e+01 -5.2001976e+01 -4.1973674e+01 -3.3860467e+01 -2.6516127e+01 -2.8921787e+01 3.0040477e+01 -3.0832165e+01 -5.3733108e+01 -4.7299146e+01 -3.2365184e+01 -2.3615184e+01 -2.5553863e+01 -1.4742542e+01 1.4870665e+01 -3.4412354e+01 -4.9185938e+01 -3.9784995e+01 -9.0302780e+00 -3.2378252e+00 -5.5066931e+00 -7.6576365e+00 2.6648967e+01 -1.8751976e+01 -4.2869901e+01 -3.8549146e+01 -1.1185938e+01 -1.2755611e+00 -1.9398203e+01 -5.6387686e+00 2.0493307e+01 -3.1063297e+01 -3.9964240e+01 -1.6209523e+01 -2.6704806e+01 -2.9841599e+01 -2.4884052e+01 -8.4689573e+00 2.5898967e+01 -1.1464240e+01 -1.8648203e+01 -2.2605750e+01 -6.0680139e+00 5.4047667e-01 1.1347080e+01 1.2262175e+01 4.9474439e+01 1.5644250e+01 5.8046276e+00 2.0516892e+01 1.7328213e+01 3.1068779e+01 2.6205571e+01 2.3045194e+01 5.2200854e+01 6.5546276e+00 -2.1068014e+01 -2.9492542e+01 -1.5756693e+01 -5.6482026e+00 -1.2841599e+01 1.5097080e+01 5.8516892e+01 9.8093446e+00 -2.3275561e+01 -1.6917070e+01 + -4.9875673e+00 9.4639501e-01 9.7469690e-01 1.5649225e+01 4.7149225e+01 -8.8696427e+00 -3.7375673e+00 -5.2281333e+00 1.2691678e+01 1.0814320e+01 2.1408659e+01 3.7536018e+01 6.5951112e+01 7.0171497e+00 -2.6152662e+01 -2.4742284e+01 -1.5841341e+01 1.8587904e+01 2.7403942e+01 3.8752999e+01 4.1635074e+01 -2.2374360e+01 -4.0978133e+01 -2.3383794e+01 -1.6808322e+01 -1.1308322e+01 -1.4275303e+01 2.4743565e+01 4.6696395e+01 -3.5394540e+00 -3.2072473e+01 -2.4751718e+01 -2.8162096e+01 -4.3879077e+01 -2.2591341e+01 -1.4369643e+01 6.9133761e+00 -2.5945114e+01 -2.4930963e+01 -2.2407379e+01 -2.1001718e+01 -1.9600775e+01 -5.9734163e+00 1.8662063e+00 -2.2611522e+00 -2.8497001e+01 -4.0534737e+01 -3.9803605e+01 -4.4586624e+01 -3.3671530e+01 -3.1256435e+01 -3.0954548e+01 -3.3979446e+00 -5.1998314e+00 -4.1978133e+01 -4.8416813e+01 -2.5364926e+01 -2.1322473e+01 -1.6572473e+01 -1.4506435e+01 1.4228101e+00 -1.6440397e+01 -6.8837937e+00 -4.3224729e+00 6.9511120e+00 -5.2530310e-01 4.6633761e+00 -3.6624360e+01 -3.7699831e+01 -2.6397945e+01 -3.7850775e+01 -4.4926246e+01 -4.9798888e+01 -5.2666813e+01 -4.0171530e+01 -4.7794171e+01 -3.9199831e+01 -5.5355492e+01 -4.6091341e+01 -4.4015869e+01 -3.7624360e+01 -3.4770586e+01 -1.7652662e+01 -2.0091341e+01 -5.0724729e+00 -9.7658691e+00 -2.1930963e+01 -1.5261152e+01 -1.6846058e+01 -3.6620956e+00 -7.7328503e+00 -1.4294171e+01 1.1469980e+01 -1.8836624e+01 -2.5808322e+01 -1.7732850e+01 -1.3289454e+01 -9.2753031e+00 -3.8649257e+00 4.1492252e+00 3.5309603e+01 -6.5205861e+00 -2.3827190e+01 -1.2525303e+01 -2.8790767e+00 -4.4262465e+00 8.1903652e-01 1.5776584e+01 4.6215263e+01 4.6303573e+00 -1.5879077e+01 7.0029988e+00 2.1677527e+01 2.4361489e+01 3.0663376e+01 5.7852055e+01 8.4389791e+01 4.0635074e+01 3.2625640e+01 5.3177527e+01 4.4186961e+01 5.2875640e+01 4.5908659e+01 6.8144508e+01 9.4809603e+01 4.4663376e+01 1.4012433e+01 3.3144508e+01 5.7163376e+01 5.1833187e+01 4.7427527e+01 6.2328470e+01 1.0347470e+02 5.7036018e+01 3.5969980e+01 4.8550169e+01 5.2403942e+01 6.4757716e+01 5.8913376e+01 6.0988848e+01 8.9163376e+01 4.6319037e+01 4.1120923e+01 5.5120923e+01 7.5111489e+01 7.7903942e+01 7.6738848e+01 1.0368696e+02 1.3175772e+02 8.1446395e+01 5.0597338e+01 5.1337904e+01 6.4918093e+01 6.5012433e+01 8.6139791e+01 1.0369168e+02 1.2602187e+02 7.1460546e+01 7.3012433e+01 8.1955829e+01 7.6252999e+01 7.0771867e+01 7.3201112e+01 7.4663376e+01 9.3342621e+01 4.3875640e+01 1.7918093e+01 3.5040735e+01 4.7748282e+01 2.8536018e+01 5.2564320e+01 5.7653942e+01 7.4889791e+01 3.7347338e+01 2.6776584e+01 4.4781301e+01 2.8635074e+01 4.9389791e+01 3.7715263e+01 4.5201112e+01 6.8394508e+01 2.0182244e+01 -9.1196427e+00 1.5177527e+01 2.0403942e+01 2.8069037e+01 2.2903942e+01 2.5672810e+01 5.6295452e+01 1.2649225e+01 9.6997992e-01 3.7229414e+01 1.7300169e+01 1.8347338e+01 2.2587904e+01 4.0804886e+01 5.3738848e+01 -5.3885107e+00 -2.8185680e+01 -2.3270586e+01 -2.0232850e+01 -1.0534737e+01 6.1148935e-01 1.4663376e+01 4.0271867e+01 9.2281010e-01 -2.7114926e+01 -1.9685680e+01 -1.6176246e+01 9.2954516e+00 -1.2092654e+00 3.2671497e+00 1.7677527e+01 -2.3747001e+01 -2.8166813e+01 -2.5105492e+01 -1.9647945e+01 -8.6951144e+00 -2.1402662e+01 9.7813007e+00 4.0304886e+01 -1.8912096e+01 -3.5402662e+01 -3.0209265e+01 -2.3180963e+01 -1.7567756e+01 -2.0836624e+01 4.0690365e+00 3.3418093e+01 -2.9360209e+01 -5.4327190e+01 -4.4407379e+01 -4.5808322e+01 -2.4048888e+01 -2.0497001e+01 -1.7157379e+01 2.3418093e+01 -2.9025303e+01 -4.9850775e+01 -3.7888511e+01 -1.5313039e+01 -1.6803605e+01 -1.2015869e+01 1.2677527e+01 3.8569037e+01 -3.6581907e+01 -4.7822473e+01 -4.8761152e+01 -3.7185680e+01 -2.6864926e+01 -1.8690397e+01 -1.7412096e+01 3.6356772e+01 -2.7940397e+01 -4.6567756e+01 -4.0364926e+01 -2.2935680e+01 -1.2596058e+01 -1.4081907e+01 2.6822441e+00 2.9295452e+01 -1.9487567e+01 -3.5048888e+01 -2.4157379e+01 5.2718667e+00 9.6256403e+00 8.9228101e+00 1.3710546e+01 4.5488848e+01 -1.2894540e+00 -2.2902662e+01 -1.7162096e+01 1.5672810e+01 2.4710546e+01 6.4369610e+00 2.5304886e+01 4.7441678e+01 -3.9403974e+00 -1.1331907e+01 9.3331875e+00 -5.5253031e+00 -1.1982850e+01 -1.2053605e+01 1.9180931e+00 2.7781301e+01 -1.4100775e+01 -2.1303605e+01 -2.7836624e+01 -1.2237567e+01 -1.2658691e+00 1.3686961e+01 2.0163376e+01 5.9064320e+01 2.4441678e+01 2.0606772e+01 3.5696395e+01 3.2814320e+01 4.5800169e+01 3.9672810e+01 4.3375640e+01 6.8870923e+01 2.5932244e+01 5.8520554e+00 -5.9605782e-01 1.6243565e+01 2.5069037e+01 1.6837904e+01 4.7031301e+01 8.1597338e+01 2.9361489e+01 -8.6385107e+00 -5.6998314e+00 + -1.8996582e+01 -6.8786575e+00 -1.2463563e+01 7.9845500e+00 2.8418512e+01 -2.0553186e+01 -1.2189978e+01 -1.5958846e+01 -6.2041292e+00 -1.0053186e+01 -6.3337448e-01 3.3100217e+00 2.7484550e+01 -2.7991865e+01 -6.0256016e+01 -5.5057903e+01 -4.4345639e+01 -9.3173367e+00 -5.6946952e+00 1.2064739e+01 4.6779463e+00 -5.5444695e+01 -6.1086205e+01 -4.6756016e+01 -3.9425827e+01 -4.0609790e+01 -4.2944695e+01 -6.7937518e+00 2.8005878e+00 -4.1694695e+01 -6.5204129e+01 -5.3557903e+01 -5.4557903e+01 -5.5977714e+01 -3.5671110e+01 -2.9156959e+01 -3.5767707e+00 -3.1128658e+01 -2.5397525e+01 -1.3482431e+01 -1.1152242e+01 -9.9541292e+00 -8.6192235e+00 5.3241727e+00 3.2015312e+00 -2.7213563e+01 -4.4161676e+01 -5.6704129e+01 -6.3977714e+01 -5.1406959e+01 -5.0623941e+01 -5.9496582e+01 -3.5265450e+01 -4.2208846e+01 -7.7208846e+01 -8.4298469e+01 -7.1001299e+01 -6.8855073e+01 -6.8279601e+01 -5.2053186e+01 -3.3647525e+01 -4.8138091e+01 -3.1378658e+01 -2.5760733e+01 -1.0633374e+01 -1.1958846e+01 -4.8739405e+00 -4.0020167e+01 -3.8364507e+01 -2.3869224e+01 -3.3774884e+01 -3.3421110e+01 -3.9671110e+01 -4.8293752e+01 -2.9935261e+01 -3.7623941e+01 -3.8279601e+01 -5.1322054e+01 -4.1619224e+01 -3.9675827e+01 -2.2642808e+01 -1.1444695e+01 1.7062482e+00 8.1590783e+00 2.7517569e+01 3.5989267e+01 3.4210965e+01 4.0475116e+01 4.2748701e+01 6.2126059e+01 6.2616626e+01 7.3913795e+01 9.8951531e+01 7.3843041e+01 6.6413795e+01 7.7923229e+01 7.9352475e+01 8.2885493e+01 8.4187380e+01 8.7479833e+01 1.0192795e+02 5.5975116e+01 3.6970399e+01 4.3814739e+01 3.7088324e+01 2.5140210e+01 2.8253418e+01 3.6352475e+01 4.0140210e+01 -1.5590922e+01 -4.3076771e+01 -3.3133374e+01 -3.6444695e+01 -5.1015450e+01 -6.0826771e+01 -4.3180544e+01 -2.3057903e+01 -6.5576771e+01 -7.6010733e+01 -6.3345639e+01 -7.4567337e+01 -6.4076771e+01 -9.0062620e+01 -4.8402242e+01 -3.0534318e+01 -7.6312620e+01 -1.0042583e+02 -8.3567337e+01 -5.8605073e+01 -6.9727714e+01 -6.8619224e+01 -5.3373941e+01 -2.0340922e+01 -6.6708846e+01 -8.9958846e+01 -7.4076771e+01 -7.9072054e+01 -6.7373941e+01 -7.7906959e+01 -6.2623941e+01 -4.9265450e+01 -9.3770167e+01 -8.8072054e+01 -7.5897525e+01 -6.8911676e+01 -7.4265450e+01 -9.9336205e+01 -6.8421110e+01 -4.3090922e+01 -6.5166393e+01 -1.1555319e+02 -1.0901073e+02 -9.3039035e+01 -9.7133374e+01 -6.0491865e+01 -3.6388091e+01 -3.4774884e+01 -6.2888091e+01 -5.2883374e+01 -3.8185261e+01 -4.2383374e+01 -4.0029601e+01 -3.6557903e+01 -3.1397525e+01 -1.6373941e+01 -5.9840922e+01 -7.5902242e+01 -6.4123941e+01 -4.6689978e+01 -5.5359790e+01 -2.6925827e+01 -2.7850356e+01 -4.1930544e+01 -5.5024884e+01 -5.9501299e+01 -3.7142808e+01 -4.7373941e+01 -3.1685261e+01 -6.0831488e+01 -3.0576771e+01 -4.4211103e+00 -4.0307903e+01 -5.4779601e+01 -2.0175827e+01 -1.9166393e+01 -1.1024884e+01 -1.8435261e+01 -1.1213563e+01 1.2192097e+01 -2.3161676e+01 -3.4873941e+01 3.2722859e+00 -2.0175827e+01 -1.6699412e+01 5.6002174e-01 2.2432663e+01 3.6149644e+01 -1.7010733e+01 -3.3303186e+01 -1.9666393e+01 -8.5626198e+00 -7.1333745e+00 -7.2701669e+00 7.5222859e+00 2.6894927e+01 -7.6758273e+00 -3.4331488e+01 -2.8090922e+01 -1.8529601e+01 -2.8739405e+00 -1.5586205e+01 -1.0260733e+01 1.1659078e+01 -2.0869224e+01 -2.1652242e+01 -1.0072054e+01 -3.6946952e+00 1.1307765e+00 -2.1076771e+01 1.7588324e+01 4.6687380e+01 -1.2072054e+01 -1.8241865e+01 -1.1213563e+01 -6.0978958e-01 9.5694557e+00 1.6154361e+01 4.5984550e+01 6.9470399e+01 2.0012852e+01 1.0553048e+00 1.6239267e+01 1.8404361e+01 3.3272286e+01 2.8196814e+01 2.8644927e+01 5.3512852e+01 1.0838324e+01 -4.9258273e+00 6.5364368e+00 2.5394927e+01 3.2927946e+01 4.1942097e+01 6.5366626e+01 8.9541154e+01 2.9305305e+01 2.2168512e+01 3.0394927e+01 4.6149644e+01 5.8644927e+01 5.8899644e+01 6.5946814e+01 1.2064493e+02 6.3343041e+01 4.5970399e+01 5.8201531e+01 7.0937380e+01 7.6187380e+01 7.4545871e+01 8.4814739e+01 9.7286437e+01 5.3031720e+01 4.1310022e+01 2.8135493e+01 5.1390210e+01 5.5130776e+01 4.6418512e+01 7.3998701e+01 9.7173229e+01 5.2376059e+01 3.4942097e+01 1.8677946e+01 5.5201531e+01 6.4380776e+01 4.5267569e+01 6.5460965e+01 1.0129115e+02 5.5423229e+01 6.5475116e+01 9.4324173e+01 7.1729833e+01 7.5762852e+01 8.5748701e+01 1.1244210e+02 1.3765436e+02 9.6187380e+01 8.7696814e+01 8.1588324e+01 9.7225116e+01 1.0944681e+02 1.1237134e+02 9.2659078e+01 1.3836663e+02 1.0091851e+02 9.1239267e+01 1.0901757e+02 1.0216380e+02 1.0682417e+02 1.0400813e+02 1.0890436e+02 1.2458361e+02 8.0550588e+01 4.4687380e+01 6.8635493e+01 9.5442097e+01 1.0860719e+02 7.1343041e+01 1.1347512e+02 1.5457889e+02 1.1728644e+02 6.3456248e+01 6.6588324e+01 + -3.7963342e+01 -3.8104851e+01 -4.0609568e+01 -4.1788814e+01 -5.8751078e+01 -6.3534097e+01 -5.3095418e+01 -5.3751078e+01 -6.9246361e+01 -4.2340701e+01 -4.6043531e+01 -5.3383153e+01 -5.1312399e+01 -4.9274663e+01 -5.4416172e+01 -5.6114285e+01 -6.7534097e+01 -7.3552965e+01 -6.9312399e+01 -6.7760512e+01 -7.1236927e+01 -6.9241644e+01 -6.0029380e+01 -6.6751078e+01 -7.5935040e+01 -6.7302965e+01 -5.4081267e+01 -5.1420889e+01 -5.4850135e+01 -5.4038814e+01 -6.7354851e+01 -5.8369002e+01 -5.7755795e+01 -4.9746361e+01 -5.6236927e+01 -3.4793531e+01 -3.4619002e+01 -3.3293531e+01 -3.5543531e+01 -4.7817116e+01 -4.3081267e+01 -4.8090701e+01 -4.9609568e+01 -4.5534097e+01 -4.6213342e+01 -5.1302965e+01 -5.8354851e+01 -4.6142587e+01 -4.5199191e+01 -4.6265229e+01 -5.6590701e+01 -6.4760512e+01 -5.8982210e+01 -6.6005795e+01 -7.1779380e+01 -7.2850135e+01 -7.7765229e+01 -6.7600135e+01 -5.8666172e+01 -5.1614285e+01 -5.6982210e+01 -5.4977493e+01 -4.9038814e+01 -4.2335984e+01 -4.1633153e+01 -5.0760512e+01 -5.4435040e+01 -5.7765229e+01 -6.1133153e+01 -7.3722776e+01 -8.2557682e+01 -8.5430323e+01 -7.6284097e+01 -5.1864285e+01 -4.7439757e+01 -5.8718059e+01 -7.5246361e+01 -8.6142587e+01 -5.8548248e+01 -6.8633153e+01 -7.7208625e+01 -8.2288814e+01 -8.4166172e+01 -7.6694474e+01 -6.5048248e+01 -4.9218059e+01 -6.9788814e+01 -7.3642587e+01 -8.0449191e+01 -6.7317116e+01 -5.3821833e+01 -5.3100135e+01 -4.9609568e+01 -4.7161455e+01 -4.7222776e+01 -4.4619002e+01 -4.8892587e+01 -5.3534097e+01 -4.1501078e+01 -5.0430323e+01 -5.0260512e+01 -3.5288814e+01 -6.5850135e+01 -7.2420889e+01 -5.8958625e+01 -4.0152021e+01 -3.9812399e+01 -6.8689757e+01 -5.4019946e+01 -6.0939757e+01 -5.4543531e+01 -6.4397304e+01 -5.9930323e+01 -6.3463342e+01 -6.1727493e+01 -3.9298248e+01 -4.0496361e+01 -6.0576550e+01 -6.7902021e+01 -5.2968059e+01 -5.9052965e+01 -6.9038814e+01 -5.7222776e+01 -5.5633153e+01 -4.4628436e+01 -4.8109568e+01 -4.5213342e+01 -4.6255795e+01 -6.4265229e+01 -5.3119002e+01 -2.6137870e+01 -2.6218059e+01 -4.0269946e+01 -5.1430323e+01 -5.8312399e+01 -7.2302965e+01 -4.8925606e+01 -3.7119002e+01 -4.9628436e+01 -4.6354851e+01 -3.1850135e+01 -3.5741644e+01 -3.1067116e+01 -3.7081267e+01 -5.5081267e+01 -4.6529380e+01 -4.7274663e+01 -4.4420889e+01 -2.9048248e+01 -3.7680323e+01 -4.2590701e+01 -2.5477493e+01 -2.9232210e+01 -3.0859568e+01 -2.8449191e+01 -2.5354851e+01 -2.9387870e+01 -3.0269946e+01 -1.5246361e+01 -1.7642587e+01 -1.7293531e+01 -2.2977493e+01 -1.0496361e+01 3.4894881e+00 -2.1562399e+01 -1.6732210e+01 -1.5359568e+01 -1.2689757e+01 -9.2746628e+00 -6.8029647e+00 -8.9256062e+00 -1.3015229e+01 -8.7793798e+00 -1.4477493e+01 -1.7835984e+01 -2.3694474e+01 -9.6001345e+00 -1.5510512e+01 -1.7840701e+01 -2.4736927e+01 -2.6081267e+01 -1.3883153e+01 -7.6897571e+00 -6.9916439e+00 -1.4444741e+00 -1.5958625e+01 -5.1001345e+00 -1.8925873e+00 -2.2039081e+00 8.3668466e+00 -7.4303232e+00 -1.3222776e+01 -1.5199191e+01 -4.9680590e+00 -5.3265496e+00 -4.8501345e+00 -1.5076550e+01 -9.7749300e-01 -7.5152288e+00 -1.0034097e+01 -4.6284364e+00 -2.6774663e+01 -2.2133153e+01 -2.2322100e+00 1.1918733e+01 1.7970620e+01 1.0522507e+01 2.2347712e+00 -7.1614553e+00 -2.6520213e+00 1.9475337e+01 1.0951752e+01 1.5230054e+01 1.3890432e+01 1.4682884e+01 1.7027224e+01 1.7649865e+01 2.0904582e+01 2.3036658e+01 4.4291375e+01 3.9498922e+01 3.4178167e+01 4.4871564e+01 3.5748922e+01 4.1008356e+01 2.7489488e+01 3.7824394e+01 4.1399865e+01 4.2890432e+01 7.0376281e+01 7.6876281e+01 6.3701752e+01 6.3975337e+01 5.7428167e+01 5.1734771e+01 7.7616847e+01 6.1546092e+01 5.1998922e+01 5.4932884e+01 5.4871564e+01 6.6046092e+01 6.0343262e+01 5.8211186e+01 7.7267790e+01 8.7970620e+01 8.7687601e+01 7.3880998e+01 8.1310243e+01 7.2720620e+01 7.7130998e+01 8.8003639e+01 9.5522507e+01 1.0255553e+02 8.2192318e+01 7.7093262e+01 9.4107413e+01 1.0666402e+02 9.3649865e+01 1.0702722e+02 1.0859798e+02 1.0982439e+02 1.1460741e+02 1.1158854e+02 1.0889515e+02 1.3203666e+02 1.3124421e+02 1.3012628e+02 1.2265458e+02 1.1561213e+02 1.1829137e+02 1.3646590e+02 1.2920175e+02 1.1966873e+02 1.1071119e+02 1.2227251e+02 1.4539043e+02 1.5837156e+02 1.5006968e+02 1.4451307e+02 1.4884798e+02 1.6281024e+02 1.5947062e+02 1.6482439e+02 1.6820175e+02 1.6307439e+02 1.7305081e+02 1.7497534e+02 1.7815458e+02 1.9388571e+02 1.7767817e+02 1.7083854e+02 1.9799421e+02 1.9892817e+02 1.9423477e+02 1.8759798e+02 1.9555081e+02 1.9626779e+02 1.9581968e+02 1.9554137e+02 1.8981968e+02 1.9618760e+02 2.0578194e+02 1.9151307e+02 1.8862156e+02 1.9632911e+02 2.0872534e+02 2.1758854e+02 2.3056968e+02 2.2365930e+02 2.1444704e+02 2.1043288e+02 2.2375836e+02 + -3.6478383e+01 -1.7379618e+01 -1.7342581e+01 -2.1552457e+01 2.9756185e+01 2.6003098e+01 -4.4564803e+01 -5.0675914e+01 -4.8787025e+01 -4.2280852e+01 -4.0293198e+01 -3.9503074e+01 -2.5401114e+00 -8.5648028e+00 -3.2231469e+01 -4.6996902e+01 -5.4256161e+01 -6.0317889e+01 -4.8429000e+01 -5.9861099e+01 -4.1169741e+01 -4.9712951e+01 -8.4070976e+01 -8.2663568e+01 -6.7317889e+01 -4.7219124e+01 -3.4861099e+01 -3.5367272e+01 6.3487775e+00 -2.6379618e+01 -5.9330235e+01 -4.5021593e+01 -3.3749988e+01 -4.1095667e+01 -4.8774679e+01 -7.9845558e+00 -8.4290003e+00 -2.4984556e+01 -7.4540111e+01 -9.0873445e+01 -7.6873445e+01 -6.4799371e+01 -6.9293198e+01 -6.1984556e+01 -4.9194432e+01 -3.7651223e+01 -6.8885790e+01 -6.5885790e+01 -5.7601840e+01 -6.3922827e+01 -7.6466037e+01 -4.9984556e+01 -4.5675914e+01 -6.2206778e+01 -8.1552457e+01 -9.3095667e+01 -1.0247838e+02 -9.3663568e+01 -9.2490729e+01 -9.1749988e+01 -8.3330235e+01 -8.5317889e+01 -1.1328085e+02 -9.5070976e+01 -8.8601840e+01 -8.9638877e+01 -8.6762334e+01 -8.1490729e+01 -9.1108013e+01 -1.0131789e+02 -1.2677468e+02 -1.3952777e+02 -1.2612036e+02 -1.2694752e+02 -1.2947838e+02 -1.1435493e+02 -1.0026851e+02 -7.7021593e+01 -9.6379618e+01 -1.2436727e+02 -1.4187344e+02 -1.1846604e+02 -9.7787025e+01 -7.9108013e+01 -4.2157395e+01 -1.7206778e+01 -6.3058630e+01 -6.0503074e+01 -2.6601840e+01 1.5138901e+01 3.0225321e+01 6.0126555e+01 7.8743839e+01 9.2410506e+01 6.9854950e+01 9.3879642e+01 1.0744754e+02 1.2681791e+02 1.3512656e+02 1.5389199e+02 1.9912656e+02 1.8587964e+02 1.5116359e+02 1.6737347e+02 1.6845989e+02 1.5728705e+02 1.4047223e+02 1.3180557e+02 1.7694137e+02 1.6195372e+02 1.1343520e+02 1.0711421e+02 8.6101864e+01 9.3496926e+01 8.1175938e+01 7.6175938e+01 1.0657100e+02 6.3422852e+01 3.4583345e+01 4.5200629e+01 2.8608037e+01 7.1635923e+00 1.0154442e+00 1.2064827e+01 2.1768531e+01 -2.8700605e+01 -8.8799371e+01 -8.5589494e+01 -7.3527766e+01 -8.4873445e+01 -9.2108013e+01 -1.0002159e+02 -9.2231469e+01 -1.1252777e+02 -1.5824382e+02 -1.6951542e+02 -1.6037962e+02 -1.6186110e+02 -1.6271295e+02 -1.5549073e+02 -1.4333023e+02 -1.5246604e+02 -1.7000925e+02 -1.8491048e+02 -1.8873764e+02 -1.9002159e+02 -1.9652777e+02 -1.9842900e+02 -1.5724382e+02 -1.6240431e+02 -2.2360184e+02 -2.0773764e+02 -1.9144135e+02 -1.9057715e+02 -2.0214505e+02 -1.8863888e+02 -1.5367591e+02 -1.3373764e+02 -1.6292283e+02 -1.6197221e+02 -1.5229320e+02 -1.4294752e+02 -1.0355246e+02 -1.2314505e+02 -1.0594752e+02 -1.3150307e+02 -1.6919443e+02 -1.6437962e+02 -1.7682406e+02 -1.5815740e+02 -1.5078702e+02 -1.4429320e+02 -9.1317889e+01 -8.0009247e+01 -1.4486110e+02 -1.5171295e+02 -1.6292283e+02 -1.4900925e+02 -1.4807098e+02 -1.2529320e+02 -9.2651223e+01 -8.8083321e+01 -1.2592283e+02 -1.1547838e+02 -8.9330235e+01 -7.3638877e+01 -7.4527766e+01 -1.0141665e+02 -5.6552457e+01 -4.6638877e+01 -7.2675914e+01 -5.5317889e+01 -5.3058630e+01 -5.3354926e+01 -5.8799371e+01 -4.4651223e+01 -1.9182087e+01 -1.2626531e+01 -6.0046284e+01 -5.7848753e+01 -5.5762334e+01 -6.9787025e+01 -6.9787025e+01 -7.1083321e+01 -3.4280852e+01 -2.2799371e+01 -8.2540111e+01 -8.5256161e+01 -7.0280852e+01 -7.8861099e+01 -8.0070976e+01 -1.0402159e+02 -8.9898136e+01 -1.0167591e+02 -1.5045369e+02 -1.5060184e+02 -1.3916974e+02 -1.2452777e+02 -1.1562653e+02 -1.1094752e+02 -7.2762334e+01 -1.0146604e+02 -1.1952777e+02 -1.0289814e+02 -8.7589494e+01 -8.2243815e+01 -8.7675914e+01 -9.6799371e+01 -6.7416655e+01 -7.2996902e+01 -1.1489814e+02 -1.0030554e+02 -8.7342581e+01 -9.7490729e+01 -8.4466037e+01 -7.0577148e+01 -3.6737642e+01 -6.7626531e+01 -1.2300925e+02 -1.1494752e+02 -1.0399690e+02 -9.8712951e+01 -8.8503074e+01 -1.0299690e+02 -5.6305543e+01 -5.6700605e+01 -9.9021593e+01 -8.4898136e+01 -7.7996902e+01 -9.1589494e+01 -5.5614185e+01 -5.4885790e+01 -3.5675914e+01 -3.2848753e+01 -8.1663568e+01 -8.6824062e+01 -9.0354926e+01 -5.1231469e+01 -6.3268506e+01 -5.2108013e+01 -3.5466037e+01 -1.8774679e+01 -5.8083321e+01 -5.0811716e+01 -3.7145050e+01 -3.3429000e+01 -3.0688260e+01 -1.2009247e+01 3.6657419e+01 1.2645074e+01 -2.1898136e+01 -2.1898136e+01 -3.4774679e+01 -2.5083321e+01 -2.1898136e+01 4.0154442e+00 3.3212975e+01 4.5583345e+01 -6.3055435e+00 -5.3811716e+01 -3.9614185e+01 -4.5515420e+01 -2.2219124e+01 -5.9351731e+00 2.7299395e+01 5.0927132e-01 -2.9688260e+01 -4.7515420e+01 -4.6564803e+01 -2.3638877e+01 2.1297502e-01 1.0645074e+01 4.4867296e+01 2.7768531e+01 -2.8379618e+01 -3.3515420e+01 -4.0046284e+01 -3.2317889e+01 -2.3910482e+01 -2.3725297e+01 1.4398160e+01 4.5216170e+00 -2.4898136e+01 -3.9293198e+01 -2.2108013e+01 -9.3517313e-01 -1.0861099e+01 -2.6959864e+01 2.3117405e+00 -4.7838301e-01 -5.4404309e+01 -6.5194432e+01 + -4.2542788e+01 -2.5258837e+01 -2.8295874e+01 -2.8703282e+01 1.9457212e+01 6.3707923e+00 -6.4024269e+01 -6.5332911e+01 -6.0777356e+01 -5.9061306e+01 -5.4369948e+01 -5.6011924e+01 -9.8761212e+00 -2.5036615e+01 -5.0369948e+01 -6.5406985e+01 -7.3468714e+01 -6.9777356e+01 -5.5715627e+01 -5.8456368e+01 -3.7295874e+01 -4.9505751e+01 -8.1740319e+01 -7.6382294e+01 -6.5382294e+01 -5.4592171e+01 -4.4641553e+01 -4.3900813e+01 6.4239728e-01 -4.0666245e+01 -7.9061306e+01 -6.5740319e+01 -5.3172418e+01 -6.1444022e+01 -6.1579825e+01 -2.4752664e+01 -3.0221800e+01 -4.6147726e+01 -8.7135380e+01 -9.2518097e+01 -7.7123035e+01 -6.6814393e+01 -7.4419331e+01 -6.6690936e+01 -5.3431677e+01 -4.2320566e+01 -7.1888467e+01 -6.0468714e+01 -5.0715627e+01 -5.7221800e+01 -6.6011924e+01 -4.4826739e+01 -4.4283529e+01 -6.6913158e+01 -8.9789701e+01 -9.6123035e+01 -1.0885143e+02 -9.6283529e+01 -9.4110689e+01 -9.0234146e+01 -7.5802047e+01 -7.7345257e+01 -1.0530822e+02 -8.8592171e+01 -7.8567479e+01 -8.7579825e+01 -8.5876121e+01 -8.8419331e+01 -9.2246492e+01 -1.0322180e+02 -1.2496254e+02 -1.3769094e+02 -1.3536995e+02 -1.3944402e+02 -1.4518476e+02 -1.3145637e+02 -1.0950575e+02 -9.8283529e+01 -1.1755513e+02 -1.4622180e+02 -1.5833291e+02 -1.3499958e+02 -1.1598723e+02 -9.0098343e+01 -4.4826739e+01 -2.0431677e+01 -6.6542788e+01 -5.6876121e+01 -1.6369948e+01 2.9346101e+01 5.0259681e+01 8.9197953e+01 1.1292635e+02 1.2833376e+02 1.1191400e+02 1.4927203e+02 1.6376585e+02 1.9112388e+02 1.9571647e+02 2.1645721e+02 2.6804980e+02 2.4377820e+02 2.1200042e+02 2.2670413e+02 2.2330906e+02 2.1413622e+02 2.0085227e+02 1.8900042e+02 2.3004980e+02 2.0080289e+02 1.5245721e+02 1.4459301e+02 1.2514857e+02 1.3002511e+02 1.1361771e+02 1.1076585e+02 1.4870413e+02 9.1420175e+01 6.3518940e+01 6.4370792e+01 4.1469558e+01 1.8543632e+01 1.1926348e+01 2.6346101e+01 3.1679434e+01 -3.0802047e+01 -9.4246492e+01 -9.1184763e+01 -8.9987232e+01 -1.1075266e+02 -1.2062921e+02 -1.3212303e+02 -1.1970328e+02 -1.4486378e+02 -1.9546871e+02 -2.0775266e+02 -2.0001192e+02 -1.9108600e+02 -1.9136995e+02 -1.8143168e+02 -1.6882674e+02 -1.8455513e+02 -1.9424649e+02 -2.0125884e+02 -1.9555513e+02 -1.8808600e+02 -1.8272797e+02 -1.7001192e+02 -1.0724649e+02 -1.1401192e+02 -1.6856748e+02 -1.3913538e+02 -1.1749341e+02 -1.1414773e+02 -1.1918476e+02 -1.0603662e+02 -6.4332911e+01 -4.7123035e+01 -6.8493405e+01 -6.0382294e+01 -4.4839084e+01 -3.4592171e+01 1.0173261e+01 -1.1184763e+01 1.3321410e+01 -1.9579825e+01 -5.2123035e+01 -4.2271183e+01 -5.3468714e+01 -4.2061306e+01 -4.0913158e+01 -5.0345257e+01 2.0868417e+00 -3.9501953e+00 -7.1431677e+01 -7.4703282e+01 -9.5974887e+01 -8.0913158e+01 -8.4295874e+01 -6.2147726e+01 -2.3653899e+01 -3.5962541e+01 -6.7406985e+01 -5.3419331e+01 -2.5197109e+01 -9.6045163e+00 -1.1345257e+01 -3.9456368e+01 9.8152368e+00 1.0691780e+01 -1.4826739e+01 -8.2673852e-01 -5.3699484e+00 -2.2341459e+00 -3.5551336e+00 1.1309064e+01 4.6173261e+01 3.8938694e+01 -2.7526644e+00 2.3214096e+00 4.6300516e+00 -1.2246492e+01 -1.8061306e+01 -2.3061306e+01 1.7395484e+01 2.2963385e+01 -4.3431677e+01 -4.7629208e+01 -3.4419331e+01 -4.3048961e+01 -4.4653899e+01 -6.6579825e+01 -4.9789701e+01 -7.7160072e+01 -1.2897489e+02 -1.2518476e+02 -1.1312303e+02 -1.0457982e+02 -1.0272797e+02 -9.1604516e+01 -4.9678590e+01 -8.4283529e+01 -1.0014773e+02 -8.7765010e+01 -7.4444022e+01 -6.2320566e+01 -6.6098343e+01 -7.2604516e+01 -4.9974887e+01 -6.2925504e+01 -1.0260452e+02 -8.2542788e+01 -7.1456368e+01 -8.3826739e+01 -6.8308220e+01 -5.9653899e+01 -1.7481060e+01 -6.2592171e+01 -1.1613538e+02 -1.1130822e+02 -9.8567479e+01 -8.7666245e+01 -7.7209455e+01 -8.5789701e+01 -3.1369948e+01 -3.7937850e+01 -7.4271183e+01 -5.4505751e+01 -4.9913158e+01 -6.4900813e+01 -2.4246492e+01 -2.3925504e+01 3.9548370e-01 -5.6168620e+00 -5.9024269e+01 -5.9123035e+01 -5.9579825e+01 -1.8999578e+01 -3.3999578e+01 -3.0592171e+01 -1.1641553e+01 -1.9131583e+00 -3.9703282e+01 -2.7481060e+01 -1.6283529e+01 -1.5036615e+01 -1.2518097e+01 1.3531286e+01 6.4272027e+01 2.5481903e+01 -8.9872323e+00 -3.5304422e+00 -1.6703282e+01 -2.8390842e+00 2.0868417e+00 2.4555978e+01 6.3099187e+01 6.5531286e+01 1.2309064e+01 -3.2431677e+01 -2.2283529e+01 -2.7814393e+01 -2.8884669e+00 1.8555978e+01 5.8321410e+01 2.2383138e+01 -5.4563682e+00 -1.4802047e+01 -8.1847632e+00 2.0605360e+01 4.4889311e+01 5.3741163e+01 9.2420175e+01 7.3358447e+01 1.8555978e+01 1.6938694e+01 3.5065948e+00 1.7185607e+01 2.5333755e+01 2.8099187e+01 7.0234990e+01 4.8580669e+01 1.9037459e+01 9.1732615e+00 3.4494249e+01 5.4457212e+01 3.4481903e+01 2.1864620e+01 5.6222644e+01 5.1160916e+01 -1.3452570e+00 -1.0123035e+01 + -2.5958321e+01 -1.7760790e+01 -2.7958321e+01 -2.8439803e+01 1.6572543e+01 -2.3904200e+00 -6.6291655e+01 -6.7538568e+01 -6.0538568e+01 -6.4921284e+01 -5.9229926e+01 -6.0353383e+01 -1.4402766e+01 -3.3674371e+01 -5.9341037e+01 -7.1945976e+01 -7.9958321e+01 -7.2094124e+01 -6.0365729e+01 -5.6007704e+01 -3.1983013e+01 -4.6155852e+01 -7.4550914e+01 -6.8575605e+01 -6.3180543e+01 -5.6674371e+01 -4.9229926e+01 -4.1983013e+01 1.1527898e+00 -3.5995358e+01 -6.7415111e+01 -5.6291655e+01 -4.4945976e+01 -5.9402766e+01 -5.3587951e+01 -2.3094124e+01 -2.4402766e+01 -3.3896593e+01 -6.8624988e+01 -6.6822519e+01 -5.2069432e+01 -4.3452148e+01 -5.3242272e+01 -4.9489185e+01 -3.9810173e+01 -3.4328692e+01 -6.0575605e+01 -4.9908939e+01 -4.5118815e+01 -5.2266963e+01 -5.5476840e+01 -3.2550914e+01 -2.6563260e+01 -4.4871902e+01 -6.5649679e+01 -6.6205235e+01 -7.8785482e+01 -6.7489185e+01 -6.2192889e+01 -5.7291655e+01 -3.8699062e+01 -3.8291655e+01 -5.6402766e+01 -3.8563260e+01 -2.2847210e+01 -2.9180543e+01 -1.7686716e+01 -1.9612642e+01 -1.7501531e+01 -3.0686716e+01 -4.8229926e+01 -5.4884247e+01 -5.0662025e+01 -5.0044741e+01 -5.1760790e+01 -3.5748445e+01 -7.4891855e+00 -6.1681978e+00 -2.6402766e+01 -5.9933630e+01 -7.3205235e+01 -6.0168198e+01 -5.0402766e+01 -3.3094124e+01 3.9799503e+00 1.6239210e+01 -3.9933630e+01 -4.6427457e+01 -2.4896593e+01 -1.4644941e+00 5.7083454e+00 3.1658963e+01 4.2683654e+01 4.4658963e+01 2.0115753e+01 4.8893531e+01 4.8621926e+01 6.7918222e+01 6.5683654e+01 7.9066370e+01 1.2606637e+02 9.3893531e+01 6.7560197e+01 8.1251555e+01 7.9066370e+01 7.6177481e+01 6.8461432e+01 6.4251555e+01 1.1147378e+02 8.8251555e+01 5.7165136e+01 5.7942913e+01 5.2016987e+01 6.1597234e+01 5.5177481e+01 5.9609580e+01 1.0494291e+02 5.3770074e+01 3.7547852e+01 4.5288592e+01 3.1313284e+01 1.7621926e+01 1.9486123e+01 4.2177481e+01 6.1054024e+01 1.2387358e+01 -3.0007704e+01 -1.3217581e+01 -4.2299262e+00 -1.7995358e+01 -1.8513877e+01 -1.9575605e+01 8.8811849e+00 -7.0077040e+00 -4.6908939e+01 -5.2649679e+01 -4.6600297e+01 -3.3908939e+01 -3.9254618e+01 -3.1007704e+01 -1.5662025e+01 -3.0131161e+01 -3.3291655e+01 -3.5970667e+01 -3.1563260e+01 -2.5489185e+01 -2.2921284e+01 -1.7711408e+01 3.8819457e+01 1.6609580e+01 -3.9254618e+01 -1.8908939e+01 -7.0941237e+00 -1.9797827e+01 -2.9489185e+01 -2.3513877e+01 1.0337975e+01 1.8905876e+01 -4.8842472e+00 -2.2299262e+00 6.2145182e+00 1.0288592e+01 4.9807111e+01 2.6955259e+01 5.1140444e+01 1.3239210e+01 -1.2958321e+01 -6.1435065e+00 -1.4600297e+01 -6.0447410e+00 -8.0570867e+00 -1.9106469e+01 2.9979950e+01 1.7498469e+01 -4.2131161e+01 -3.8526223e+01 -5.8859556e+01 -4.2662025e+01 -4.4983013e+01 -2.4217581e+01 1.5733037e+01 -8.1311608e+00 -3.5662025e+01 -2.1402766e+01 4.2762466e+00 1.7189827e+01 1.4016987e+01 -9.5756052e+00 3.6263901e+01 2.8152790e+01 3.0910614e+00 1.1844148e+01 2.9058763e+00 2.9922960e+00 -1.1435065e+00 8.5231602e+00 4.8621926e+01 3.7066370e+01 2.6836540e+00 6.7083454e+00 6.0540244e+00 -1.1279309e+01 -1.3081778e+01 -1.4785482e+01 3.1918222e+01 3.7276247e+01 -2.3229926e+01 -2.4797827e+01 -1.2723753e+01 -2.0896593e+01 -2.0649679e+01 -3.6452148e+01 -1.1933630e+01 -3.8575605e+01 -8.2501531e+01 -7.4266963e+01 -5.4723753e+01 -4.8020050e+01 -4.7686716e+01 -3.3032395e+01 3.7824195e+00 -3.3834864e+01 -5.1464494e+01 -4.3229926e+01 -3.3637334e+01 -2.4094124e+01 -2.6205235e+01 -2.6983013e+01 -4.9459756e+00 -2.2365729e+01 -5.6871902e+01 -3.7908939e+01 -3.0797827e+01 -4.5242272e+01 -2.9069432e+01 -2.2007704e+01 2.2128098e+01 -2.5205235e+01 -6.9205235e+01 -6.1699062e+01 -4.7007704e+01 -3.9081778e+01 -3.5378074e+01 -4.6316346e+01 1.1276247e+01 1.5478516e+00 -2.8353383e+01 -1.0106469e+01 -1.1587951e+01 -2.8094124e+01 4.8935306e+00 2.5725429e+00 2.9856494e+01 2.0449086e+01 -2.8365729e+01 -3.0279309e+01 -3.2723753e+01 -1.1311608e+00 -2.1094124e+01 -2.3674371e+01 -3.9089386e+00 3.7501206e-01 -3.4859556e+01 -2.4587951e+01 -1.6822519e+01 -2.1155852e+01 -2.8229926e+01 -9.9089386e+00 3.0523160e+01 -1.4600297e+01 -4.5229926e+01 -3.6859556e+01 -4.6415111e+01 -3.1452148e+01 -2.9378074e+01 -7.1188151e+00 3.8733037e+01 3.7794765e+01 -1.1476840e+01 -4.7489185e+01 -3.7871902e+01 -4.0600297e+01 -1.3711408e+01 9.0663701e+00 5.0955259e+01 1.3165136e+01 -1.0711408e+01 -1.5069432e+01 -1.1390420e+01 1.0449086e+01 3.1140444e+01 4.2214518e+01 8.4091061e+01 6.6819457e+01 1.9547852e+01 1.6498469e+01 2.0046417e+00 1.4560197e+01 2.5523160e+01 3.1523160e+01 7.2288592e+01 4.4288592e+01 1.6202173e+01 7.8564935e+00 3.4449086e+01 5.1671308e+01 2.9263901e+01 1.9115753e+01 5.3399703e+01 4.1696000e+01 -6.0941237e+00 -1.7983013e+01 + -2.0282841e+00 7.2062838e+00 7.2803578e+00 7.9346788e+00 4.4354432e+01 1.2848259e+01 -4.0386309e+01 -2.6867790e+01 -2.2287543e+01 -4.0694951e+01 -4.2497420e+01 -4.0522111e+01 2.2416160e+01 -2.2751977e+00 -3.4127050e+01 -5.8917173e+01 -6.8201124e+01 -4.4929519e+01 -3.3941864e+01 -3.5386309e+01 -2.3213469e+01 -4.0336926e+01 -5.7917173e+01 -4.1744334e+01 -4.1781371e+01 -4.9583840e+01 -4.5398655e+01 -2.7522111e+01 2.6317395e+01 -1.4176432e+01 -5.1694951e+01 -4.5559148e+01 -2.8694951e+01 -3.2065321e+01 -2.0497420e+01 1.0087529e+00 -3.6579138e+00 -3.0776669e+00 -2.7052976e+01 -2.0694951e+01 -1.2238161e+01 -1.7571494e+01 -2.1361617e+01 -2.0776669e+00 1.6724802e+01 1.1156901e+01 -2.9756679e+01 -1.7040630e+01 -6.6702595e+00 -5.3369261e+00 -1.0929519e+01 -2.3739632e+00 2.4038146e+00 -1.3423346e+01 -2.5114704e+01 -2.6583840e+01 -5.0411000e+01 -4.5423346e+01 -3.4608531e+01 -1.6657914e+01 -3.5344570e+00 -1.2707296e+01 -4.1065321e+01 -1.9657914e+01 1.1156901e+01 2.5149257e+00 1.0860605e+01 -6.1270496e+00 2.6754196e+00 -6.4233459e+00 -1.2509766e+01 -1.8040630e+01 -2.6682605e+01 -1.9015938e+01 -8.1517409e+00 1.8786531e+01 5.0416160e+01 3.5613691e+01 1.6403815e+01 -1.2497420e+01 -7.5221113e+00 -1.1270496e+00 -8.8307533e+00 -4.7272859e-01 4.2416160e+01 5.4576654e+01 -7.4850743e+00 -2.2583840e+01 -1.6299889e+01 -2.2581501e-01 9.8606047e+00 2.7823568e+01 2.7872950e+01 5.4408517e+00 -2.3287543e+01 1.0663074e+01 4.2927035e+00 1.2613691e+01 -9.5468027e+00 2.0334443e+00 5.1638383e+01 1.6292704e+01 -1.2769025e+01 -1.2707296e+01 -2.1571494e+01 -2.0719642e+01 -1.3645568e+01 -1.7596185e+01 2.4317395e+01 -9.3122348e+00 -2.9534457e+01 -1.1880136e+01 -1.5571494e+01 -9.2381607e+00 -2.1966556e+01 -1.1497420e+01 5.3428506e+01 7.6013455e+00 -4.1517409e+00 -7.9171730e+00 -1.2448037e+01 -1.0139395e+01 3.4408517e+00 3.2391469e+01 4.5712457e+01 1.1322097e+00 -2.1670259e+01 1.2193938e+01 1.7984062e+01 -6.7813706e+00 -8.4480372e+00 -2.3816069e-01 4.7971716e+01 2.6119864e+01 -1.8608531e+01 -2.3929519e+01 -1.6102358e+01 1.3860605e+01 4.4408517e+00 1.0218629e+01 1.8119864e+01 2.6630739e+00 1.5268012e+01 2.0626037e+01 1.7860605e+01 9.1445554e+00 1.2663074e+01 2.6206284e+01 9.6070481e+01 5.9527271e+01 -3.1640866e+00 1.7379123e+01 3.3132210e+01 2.8329741e+01 1.6959370e+01 1.1218629e+01 4.0551963e+01 4.8082827e+01 3.4589000e+01 2.8428506e+01 2.7811222e+01 2.1848259e+01 6.3070481e+01 4.9403815e+01 7.5724802e+01 2.9317395e+01 -1.4727286e+00 7.6260368e+00 1.5848259e+01 2.7243321e+01 2.4095173e+01 4.2309751e+00 6.1514926e+01 4.7897642e+01 4.3173949e+00 5.0210986e+00 -2.6015938e+01 -9.3616175e+00 -5.8924817e+00 2.4268012e+01 6.4687765e+01 1.6477889e+01 -1.6966556e+01 1.2309751e+00 3.9070481e+01 4.5255666e+01 3.1539617e+01 -1.9048274e+00 4.8823568e+01 4.2107518e+01 1.9033444e+01 2.2650728e+01 -4.7937162e+00 -8.1840760e-01 4.2680122e+00 1.5502580e+01 5.7255666e+01 2.3119864e+01 -2.7319878e+00 8.7124566e+00 1.4391469e+01 -7.4603829e+00 -1.8213469e+01 -2.1880136e+01 3.5329741e+01 5.1465543e+01 -8.2381607e+00 -1.5448037e+01 -1.1114704e+01 -1.0077667e+01 2.9717159e+00 -9.4727286e+00 1.5132210e+01 -2.2966556e+01 -5.7620877e+01 -3.5843099e+01 -1.1793716e+01 -1.2213469e+01 -2.5620877e+01 -2.6208767e+00 3.7070481e+01 1.7865307e+00 -2.1287543e+01 -2.7040630e+01 -1.9238161e+01 -7.0776669e+00 7.4949363e-01 2.5643084e+00 1.1613691e+01 -1.7312235e+01 -4.3793716e+01 -9.8184076e+00 -8.3863088e+00 -2.9386309e+01 -1.5497420e+01 -6.3322242e-01 6.3193938e+01 1.0872950e+01 -2.9781371e+01 -3.3534457e+01 -1.7596185e+01 1.2556665e+00 4.5643084e+00 -9.3986545e+00 3.5033444e+01 1.9391469e+01 8.7295042e-01 2.2650728e+01 1.3366778e+01 -1.5670259e+01 1.6169247e+01 2.3305049e+01 6.6107518e+01 4.9206284e+01 -5.2505064e+00 -1.2559148e+01 -8.3986545e+00 3.4021099e+01 1.0045790e+01 -1.6949508e+00 1.8033444e+01 1.9243321e+01 -2.8060619e+00 4.7001109e+00 3.6383825e+00 -1.9435692e+01 -3.2275198e+01 -2.7072965e+00 3.6181592e+01 -2.0201124e+01 -6.1361617e+01 -4.6657914e+01 -4.7954210e+01 -2.9213469e+01 -3.4398655e+01 -2.9954210e+01 1.9070481e+01 1.6860605e+01 -2.2188778e+01 -5.4336926e+01 -5.5287543e+01 -6.5164087e+01 -3.3003593e+01 1.9346788e+00 4.0379123e+01 -1.2398655e+01 -4.3892482e+01 -4.5262852e+01 -3.2843099e+01 -1.2941864e+01 -3.8630883e-01 -8.9248167e-01 4.4070481e+01 2.9749494e+01 -1.2657914e+01 -2.1127050e+01 -5.3052976e+01 -3.9373963e+01 -2.0731988e+01 -1.1393953e+00 3.6872950e+01 -6.1764323e+00 -3.1114704e+01 -3.0978901e+01 1.1786531e+01 2.2860605e+01 -9.5097656e+00 -2.0299889e+01 2.9107518e+01 3.2144555e+01 -1.1423346e+01 -2.6670259e+01 + -3.0850936e+01 -1.8604022e+01 -2.4925010e+01 -1.3937355e+01 3.5679929e+01 1.6428916e+00 -5.4641059e+01 -5.4974392e+01 -4.6159578e+01 -4.9468220e+01 -4.0208960e+01 -3.8048466e+01 1.1976225e+01 -1.3073158e+01 -3.6048466e+01 -4.6813899e+01 -5.6023775e+01 -4.7443528e+01 -4.9529948e+01 -4.9616368e+01 -2.5863281e+01 -5.1097849e+01 -7.7406491e+01 -5.7776861e+01 -4.5678096e+01 -3.3147232e+01 -2.8702787e+01 -1.7171923e+01 1.3198447e+01 -3.1073158e+01 -5.6912664e+01 -4.8653405e+01 -3.2776861e+01 -5.0171923e+01 -3.0085503e+01 -5.7521701e+00 -1.3480565e+01 -3.2727479e+01 -8.0147232e+01 -7.9999084e+01 -6.9097849e+01 -6.2245997e+01 -6.9628713e+01 -5.4542294e+01 -3.8196615e+01 -4.1097849e+01 -6.9443528e+01 -5.9727479e+01 -5.7196615e+01 -6.8912664e+01 -6.9023775e+01 -4.6171923e+01 -3.8171923e+01 -5.8147232e+01 -8.3344763e+01 -8.0875627e+01 -9.4813899e+01 -9.1529948e+01 -8.7591676e+01 -8.7171923e+01 -7.7739824e+01 -9.0949701e+01 -1.1239415e+02 -1.0036945e+02 -8.3863281e+01 -9.9752170e+01 -8.7233652e+01 -9.4628713e+01 -9.2184269e+01 -1.1643118e+02 -1.2940649e+02 -1.3041884e+02 -1.2941884e+02 -1.2667810e+02 -1.2292501e+02 -1.1399908e+02 -8.0122541e+01 -8.7900318e+01 -1.0246822e+02 -1.2860402e+02 -1.2722131e+02 -1.0651760e+02 -9.6431182e+01 -7.4813899e+01 -2.4406491e+01 -1.8097849e+01 -6.1295380e+01 -5.0443528e+01 -1.4653405e+01 2.2741657e+01 3.9791040e+01 6.8037953e+01 8.6605855e+01 8.3791040e+01 6.3926842e+01 1.0108734e+02 1.0398857e+02 1.2566758e+02 1.2961820e+02 1.4748240e+02 2.0049474e+02 1.6206264e+02 1.4372931e+02 1.6011203e+02 1.4797622e+02 1.3726018e+02 1.2627252e+02 1.2324783e+02 1.7398857e+02 1.2909968e+02 1.0349474e+02 9.5260176e+01 8.3778694e+01 8.2704620e+01 6.3865114e+01 6.6260176e+01 1.0682808e+02 4.3507089e+01 3.5173756e+01 3.6778694e+01 2.3223139e+01 5.7786941e+00 5.2601755e+00 1.8926842e+01 2.3272521e+01 -4.1480565e+01 -8.3270689e+01 -5.8616368e+01 -5.4554639e+01 -6.4171923e+01 -6.8727479e+01 -7.6381800e+01 -5.4073158e+01 -8.9826244e+01 -1.3120896e+02 -1.3192501e+02 -1.3148057e+02 -1.1696205e+02 -1.2778921e+02 -1.1825834e+02 -9.8875627e+01 -1.3004847e+02 -1.3593736e+02 -1.4808550e+02 -1.5559168e+02 -1.5680155e+02 -1.6420896e+02 -1.6399908e+02 -1.0207316e+02 -1.4399908e+02 -1.9522131e+02 -1.7036945e+02 -1.5535711e+02 -1.6781390e+02 -1.7250526e+02 -1.5906081e+02 -1.2233242e+02 -1.2265340e+02 -1.4162871e+02 -1.4383859e+02 -1.3111019e+02 -1.2522131e+02 -8.7900318e+01 -1.1411019e+02 -8.8492911e+01 -1.3813489e+02 -1.6280155e+02 -1.6090032e+02 -1.6360402e+02 -1.5096205e+02 -1.3790032e+02 -1.3376452e+02 -6.6838590e+01 -8.4925010e+01 -1.3835711e+02 -1.3192501e+02 -1.5376452e+02 -1.3532007e+02 -1.3329538e+02 -1.1544353e+02 -6.3653405e+01 -1.0261637e+02 -1.2586328e+02 -1.0301143e+02 -7.9147232e+01 -6.6023775e+01 -7.2962047e+01 -9.2875627e+01 -3.7887973e+01 -5.1480565e+01 -6.4171923e+01 -5.0776861e+01 -5.8245997e+01 -5.1962047e+01 -5.4739824e+01 -4.5233652e+01 2.5935089e+00 -3.0233652e+01 -5.9776861e+01 -5.5468220e+01 -5.3406491e+01 -7.0702787e+01 -6.6023775e+01 -6.8171923e+01 -1.2443528e+01 -1.8949701e+01 -7.3406491e+01 -6.3604022e+01 -5.5665750e+01 -5.7468220e+01 -6.9332417e+01 -8.9727479e+01 -6.0258343e+01 -1.0261637e+02 -1.3954229e+02 -1.3323365e+02 -1.0941884e+02 -9.8653405e+01 -9.8048466e+01 -7.3986738e+01 -4.7826244e+01 -8.6406491e+01 -9.6702787e+01 -8.1505257e+01 -7.4480565e+01 -7.0307726e+01 -7.6221306e+01 -7.7171923e+01 -5.1344763e+01 -7.3480565e+01 -9.9616368e+01 -7.6776861e+01 -7.2949701e+01 -8.5826244e+01 -6.7974392e+01 -6.0357108e+01 -1.0641059e+01 -7.3320071e+01 -1.0475217e+02 -1.0369044e+02 -8.7196615e+01 -7.9159578e+01 -8.2455874e+01 -9.2011429e+01 -3.5715133e+01 -6.1344763e+01 -9.0245997e+01 -6.8122541e+01 -7.2295380e+01 -7.8542294e+01 -4.7937355e+01 -5.2480565e+01 -2.1060812e+01 -4.3813899e+01 -9.0332417e+01 -8.9986738e+01 -8.4542294e+01 -5.0270689e+01 -5.7492911e+01 -5.3221306e+01 -2.1727479e+01 -2.5023775e+01 -5.5468220e+01 -3.9320071e+01 -3.1912664e+01 -2.9739824e+01 -3.0591676e+01 3.7953318e-02 4.6037953e+01 -7.5217014e-01 -3.0283034e+01 -2.0591676e+01 -2.9801553e+01 -1.7245997e+01 -8.6163677e+00 7.2972126e+00 5.6963879e+01 4.1729311e+01 -1.6381800e+01 -4.4554639e+01 -3.2344763e+01 -3.6455874e+01 -9.3817998e+00 1.0025608e+01 4.8334250e+01 -1.3447627e+00 -3.0357108e+01 -3.2233652e+01 -3.0776861e+01 -6.1595775e+00 1.0112027e+01 1.6741657e+01 5.6000916e+01 2.0260176e+01 -2.4752170e+01 -2.0221306e+01 -3.6208960e+01 -2.3468220e+01 -1.6739824e+01 -1.0566985e+01 2.9741657e+01 -1.9497010e+00 -2.7702787e+01 -3.8369454e+01 -8.3817998e+00 9.5317805e+00 -1.1245997e+01 -2.3221306e+01 1.9433015e+01 -2.2830343e+00 -4.3357108e+01 -5.1937355e+01 + -3.1353359e+01 -1.8624964e+01 -2.8489161e+01 -1.2439779e+01 4.3436765e+01 6.3997275e+00 -4.3266939e+01 -4.8316322e+01 -3.9341013e+01 -4.5402742e+01 -3.4353359e+01 -3.4094100e+01 1.1905900e+01 -1.6662001e+01 -3.7995334e+01 -4.7649655e+01 -5.4612618e+01 -4.7587927e+01 -6.1464470e+01 -6.2773112e+01 -3.7489161e+01 -6.5427433e+01 -9.4131137e+01 -7.4427433e+01 -6.1316322e+01 -4.7958297e+01 -4.4563235e+01 -2.5106445e+01 4.1157769e+00 -3.6353359e+01 -5.2982989e+01 -4.4773112e+01 -2.8513853e+01 -5.2773112e+01 -2.7859532e+01 -8.1928651e+00 -1.7353359e+01 -3.9649655e+01 -8.9896569e+01 -8.3143482e+01 -7.1662001e+01 -6.4032371e+01 -7.2365705e+01 -5.8118791e+01 -4.0415087e+01 -4.7674347e+01 -6.8711384e+01 -5.7501507e+01 -5.8217556e+01 -7.2328668e+01 -7.0205211e+01 -5.0982989e+01 -4.4908914e+01 -6.3279285e+01 -8.9341013e+01 -8.2143482e+01 -9.1587927e+01 -8.3106445e+01 -8.0587927e+01 -8.4871877e+01 -7.8723729e+01 -9.2748421e+01 -1.0332867e+02 -8.3402742e+01 -6.0600272e+01 -8.1007680e+01 -6.4748421e+01 -7.5982989e+01 -7.4266939e+01 -1.0960027e+02 -1.2673607e+02 -1.2448916e+02 -1.2360027e+02 -1.1526694e+02 -1.0973607e+02 -1.0769904e+02 -6.8513853e+01 -8.0760766e+01 -9.7760766e+01 -1.2576077e+02 -1.2564966e+02 -1.0306941e+02 -9.0217556e+01 -6.7353359e+01 -1.4995334e+01 -1.9908914e+01 -6.6402742e+01 -5.4415087e+01 -2.0007680e+01 1.1017011e+01 2.3942937e+01 4.8066394e+01 6.7905900e+01 6.7770098e+01 5.1881209e+01 9.2177505e+01 9.5140468e+01 1.1674541e+02 1.2607874e+02 1.4247380e+02 1.9636269e+02 1.5047380e+02 1.3635034e+02 1.5779479e+02 1.4679479e+02 1.4132565e+02 1.3214047e+02 1.3246146e+02 1.8239973e+02 1.3095528e+02 1.1063430e+02 9.5288616e+01 8.6955283e+01 8.6017011e+01 6.7115777e+01 6.9584913e+01 1.0511578e+02 3.3708370e+01 2.9770098e+01 2.8523184e+01 1.3918246e+01 -7.3039762e+00 -8.7731120e+00 4.6342954e+00 1.0757752e+01 -5.3131137e+01 -9.4180519e+01 -6.9192865e+01 -7.4624964e+01 -8.8168174e+01 -8.8229902e+01 -9.4736075e+01 -7.4958297e+01 -1.1752620e+02 -1.5274842e+02 -1.4973607e+02 -1.5408175e+02 -1.4087188e+02 -1.5488422e+02 -1.4737805e+02 -1.2313114e+02 -1.5543978e+02 -1.6139040e+02 -1.7041509e+02 -1.7393361e+02 -1.7350151e+02 -1.8337805e+02 -1.8585953e+02 -1.2225459e+02 -1.7506941e+02 -2.1764966e+02 -1.9246447e+02 -1.7657558e+02 -1.9235336e+02 -1.9152620e+02 -1.7451385e+02 -1.3618052e+02 -1.4295830e+02 -1.6293361e+02 -1.6576077e+02 -1.4887188e+02 -1.3500768e+02 -9.6106445e+01 -1.2210645e+02 -9.0217556e+01 -1.4060027e+02 -1.5900768e+02 -1.6010645e+02 -1.6214348e+02 -1.5561262e+02 -1.3857558e+02 -1.3726694e+02 -7.2600272e+01 -1.0421756e+02 -1.6098299e+02 -1.5347682e+02 -1.7056324e+02 -1.4669904e+02 -1.3719287e+02 -1.1767435e+02 -5.9970643e+01 -1.0935336e+02 -1.2908175e+02 -1.0558793e+02 -8.8415087e+01 -7.9242248e+01 -8.5526198e+01 -9.9649655e+01 -4.0871877e+01 -6.1834840e+01 -6.7908914e+01 -5.4785458e+01 -5.8859532e+01 -5.0526198e+01 -5.4266939e+01 -4.7168174e+01 2.8688633e+00 -3.4723729e+01 -5.7501507e+01 -5.4921260e+01 -5.9736075e+01 -8.0711384e+01 -7.1501507e+01 -7.5563235e+01 -2.4180519e+01 -3.9945951e+01 -9.3810149e+01 -8.3452124e+01 -7.3773112e+01 -7.5847186e+01 -9.2748421e+01 -1.1071138e+02 -7.8378050e+01 -1.2045212e+02 -1.5164966e+02 -1.4642743e+02 -1.2495830e+02 -1.1767435e+02 -1.1939040e+02 -9.3205211e+01 -7.1044717e+01 -1.0935336e+02 -1.1525459e+02 -9.5279285e+01 -8.5192865e+01 -7.8489161e+01 -9.1106445e+01 -8.9279285e+01 -6.4476816e+01 -9.3982989e+01 -1.1719287e+02 -9.5662001e+01 -9.2550890e+01 -1.0257558e+02 -8.1970643e+01 -7.7057063e+01 -3.1550890e+01 -1.0135336e+02 -1.2798299e+02 -1.2273607e+02 -1.0429163e+02 -9.5180519e+01 -9.5427433e+01 -9.9341013e+01 -3.6686692e+01 -6.8600272e+01 -9.7995334e+01 -7.6662001e+01 -8.7575581e+01 -8.5291630e+01 -4.8550890e+01 -5.1365705e+01 -1.5871877e+01 -4.0180519e+01 -8.1748421e+01 -7.8378050e+01 -7.1192865e+01 -4.4600272e+01 -5.2094100e+01 -5.2674347e+01 -1.6600272e+01 -2.6168174e+01 -5.8118791e+01 -3.8686692e+01 -3.1859532e+01 -2.7020026e+01 -2.7192865e+01 4.2392337e+00 4.6893555e+01 -4.8595317e+00 -3.2192865e+01 -2.0958297e+01 -3.3032371e+01 -2.5057063e+01 -1.5760766e+01 -1.9459515e+00 4.9510839e+01 2.8844172e+01 -3.0995334e+01 -5.7291630e+01 -4.5476816e+01 -4.6279285e+01 -2.3513853e+01 -8.6866922e+00 3.0066394e+01 -1.9378050e+01 -4.5069408e+01 -4.7266939e+01 -4.5007680e+01 -1.5192865e+01 2.3997275e+00 9.9182460e+00 4.7177505e+01 4.1528139e+00 -3.9044717e+01 -3.5476816e+01 -4.8526198e+01 -3.6612618e+01 -2.7995334e+01 -1.9773112e+01 1.8905900e+01 -1.1229902e+01 -3.5723729e+01 -4.5094100e+01 -1.5217556e+01 -4.3410132e+00 -2.9501507e+01 -4.0316322e+01 4.7083695e+00 -2.6007680e+01 -6.7328668e+01 -8.0390396e+01 + -3.2395351e+01 -2.7654610e+01 -4.0173129e+01 -2.2765721e+01 2.5814525e+01 -1.9605228e+01 -6.3975598e+01 -6.5531154e+01 -5.1037326e+01 -6.0543499e+01 -4.8975598e+01 -4.4481771e+01 7.7281057e+00 -2.0395351e+01 -4.5185475e+01 -5.6074363e+01 -6.0222512e+01 -3.7778067e+01 -4.3383005e+01 -3.6605228e+01 -1.0148438e+01 -4.3457079e+01 -6.7580536e+01 -4.9395351e+01 -4.1160783e+01 -3.5296586e+01 -3.8987944e+01 -1.8308931e+01 3.6293403e+00 -4.2963252e+01 -6.2765721e+01 -5.8099055e+01 -4.0407697e+01 -6.1716339e+01 -2.6000289e+01 -1.3654610e+01 -2.1728684e+01 -3.8876833e+01 -8.0247203e+01 -7.0086709e+01 -6.2728684e+01 -5.9531154e+01 -6.9123746e+01 -5.3592882e+01 -3.4592882e+01 -4.3234857e+01 -6.1950907e+01 -5.1037326e+01 -4.7123746e+01 -6.1395351e+01 -5.5617573e+01 -3.5296586e+01 -2.7963252e+01 -5.0308931e+01 -7.9222512e+01 -7.4247203e+01 -8.7815104e+01 -8.2173129e+01 -7.4617573e+01 -7.2037326e+01 -5.9197820e+01 -7.8469425e+01 -9.3469425e+01 -8.4296586e+01 -6.3259549e+01 -8.2963252e+01 -7.1111400e+01 -8.1963252e+01 -7.2074363e+01 -1.0016078e+02 -1.0956819e+02 -1.0667930e+02 -1.1718547e+02 -1.1224720e+02 -1.0270399e+02 -9.9370660e+01 -5.4111400e+01 -7.5605228e+01 -9.1913870e+01 -1.1928424e+02 -1.1295091e+02 -9.5926215e+01 -9.2506462e+01 -7.0210166e+01 -1.2741030e+01 -1.8642265e+01 -6.3345968e+01 -5.4234857e+01 -1.9185475e+01 1.0567612e+01 2.7024402e+01 4.9999711e+01 6.9234279e+01 6.2715760e+01 4.8221933e+01 9.0221933e+01 9.3036748e+01 1.1171576e+02 1.1320959e+02 1.2839477e+02 1.8206144e+02 1.3314786e+02 1.2108613e+02 1.3695033e+02 1.2074045e+02 1.1044416e+02 1.0192564e+02 1.0656761e+02 1.5262934e+02 9.5802180e+01 8.2234279e+01 7.3937982e+01 7.3987365e+01 7.1468846e+01 5.5518229e+01 6.2728106e+01 1.0751823e+02 4.1209587e+01 3.9073785e+01 3.3456501e+01 1.8567612e+01 5.6540316e+00 9.3330440e+00 2.4172550e+01 2.4999711e+01 -4.1259549e+01 -7.3049672e+01 -4.4469425e+01 -4.5062018e+01 -5.5345968e+01 -5.4518808e+01 -5.9963252e+01 -3.0592882e+01 -6.9827450e+01 -1.0767930e+02 -1.0450646e+02 -1.0656819e+02 -8.5691647e+01 -9.6864487e+01 -9.2222512e+01 -7.0271894e+01 -1.0311140e+02 -1.0046943e+02 -1.0143239e+02 -1.0495091e+02 -9.5864487e+01 -9.7716339e+01 -9.0987944e+01 -2.0197820e+01 -7.3444734e+01 -1.1340770e+02 -8.8358314e+01 -6.9950907e+01 -8.5778067e+01 -8.7407697e+01 -7.3703993e+01 -3.8197820e+01 -4.8778067e+01 -6.2358314e+01 -6.8024981e+01 -5.6876833e+01 -4.6024981e+01 -1.0432388e+01 -3.3765721e+01 -4.6793017e+00 -5.9864487e+01 -7.3345968e+01 -7.3160783e+01 -7.1148438e+01 -6.6531154e+01 -5.7691647e+01 -6.2642265e+01 -1.0373264e+00 -3.4531154e+01 -7.9481771e+01 -7.2592882e+01 -9.6370660e+01 -8.1605228e+01 -7.3864487e+01 -6.0963252e+01 -8.8644869e+00 -6.7592882e+01 -8.7136092e+01 -5.9086709e+01 -3.6531154e+01 -2.3296586e+01 -3.2506462e+01 -4.5062018e+01 1.1950328e+01 -1.2148438e+01 -1.9765721e+01 -1.3296586e+01 -2.7568191e+01 -2.0642265e+01 -2.0234857e+01 -1.5481771e+01 3.9098476e+01 -8.6669560e+00 -2.5123746e+01 -1.8938561e+01 -1.9531154e+01 -4.0950907e+01 -3.6753376e+01 -3.9815104e+01 1.9839217e+01 2.8268711e+00 -4.3864487e+01 -3.4716339e+01 -2.8049672e+01 -2.3778067e+01 -3.6136092e+01 -5.5913870e+01 -2.5864487e+01 -7.7555845e+01 -1.0971634e+02 -1.0212375e+02 -7.7308931e+01 -7.3827450e+01 -7.9703993e+01 -4.6703993e+01 -2.7666956e+01 -7.0062018e+01 -7.5617573e+01 -6.4000289e+01 -5.4160783e+01 -4.3296586e+01 -4.8753376e+01 -4.7123746e+01 -2.7271894e+01 -6.2370660e+01 -7.9197820e+01 -5.5518808e+01 -5.3099055e+01 -6.6000289e+01 -4.2284240e+01 -3.4815104e+01 1.7518229e+01 -5.4666956e+01 -7.9457079e+01 -8.0605228e+01 -6.2864487e+01 -4.7469425e+01 -5.5284240e+01 -5.9210166e+01 -1.1731289e+00 -3.6839796e+01 -5.3617573e+01 -3.2494117e+01 -5.0716339e+01 -5.3160783e+01 -2.3703993e+01 -2.3469425e+01 1.2456501e+01 -2.4099055e+01 -6.5741030e+01 -6.5333623e+01 -5.6185475e+01 -3.2741030e+01 -3.4839796e+01 -4.1987944e+01 -4.8768326e+00 -1.7815104e+01 -4.0901524e+01 -2.2728684e+01 -2.1457079e+01 -2.1852141e+01 -2.1358314e+01 1.1728106e+01 5.0320698e+01 -4.4941165e+00 -3.1617573e+01 -2.0420042e+01 -2.2876833e+01 -1.0247203e+01 1.8489583e-01 1.2073785e+01 6.9234279e+01 4.9086130e+01 -8.0990548e+00 -2.8037326e+01 -2.2333623e+01 -2.0728684e+01 6.7898341e+00 2.8110822e+01 6.4407118e+01 9.2342785e+00 -2.0197820e+01 -1.5679302e+01 -1.3383005e+01 1.4221933e+01 2.7728106e+01 3.3209587e+01 7.4308353e+01 3.4851563e+01 -8.6448688e-01 1.0737847e+00 -1.6444734e+01 -3.2225116e+00 6.5058835e+00 1.6555266e+01 4.9987365e+01 1.2999711e+01 -1.0111400e+01 -1.5765721e+01 2.0913291e+01 3.6160204e+01 9.6046489e+00 2.3453897e+00 4.7703414e+01 1.9258970e+01 -1.3555845e+01 -2.3383005e+01 + -2.7721945e+01 -1.8326883e+01 -3.3252809e+01 -1.0376266e+01 4.0648425e+01 -3.7589820e+00 -4.1067624e+01 -4.4376266e+01 -3.2857747e+01 -4.4709599e+01 -3.4586142e+01 -3.2400957e+01 9.9570674e+00 -2.2783673e+01 -4.5351575e+01 -5.3684908e+01 -5.8450340e+01 -3.9240463e+01 -5.2524414e+01 -4.4845402e+01 -1.7820710e+01 -5.1030587e+01 -7.5610834e+01 -5.5561451e+01 -4.9228118e+01 -4.0376266e+01 -4.4092315e+01 -1.8166389e+01 3.9817588e+00 -3.5228118e+01 -4.7635525e+01 -4.3524414e+01 -3.1363920e+01 -6.1536760e+01 -2.3610834e+01 -1.7413303e+01 -2.5771328e+01 -4.3228118e+01 -8.1586142e+01 -6.7228118e+01 -5.5882439e+01 -4.9450340e+01 -6.1635525e+01 -4.9796019e+01 -3.0289846e+01 -4.5524414e+01 -5.9092315e+01 -4.5178735e+01 -4.2265155e+01 -5.5388612e+01 -4.6944167e+01 -3.3462686e+01 -3.0228118e+01 -4.9524414e+01 -7.6252809e+01 -6.8499723e+01 -7.4968859e+01 -7.0030587e+01 -6.3697254e+01 -6.6191081e+01 -5.0363920e+01 -7.3104661e+01 -7.5993550e+01 -5.9894784e+01 -3.4796019e+01 -5.3598488e+01 -4.1746636e+01 -5.4487377e+01 -4.5166389e+01 -8.4265155e+01 -9.5499723e+01 -8.9055278e+01 -9.6117007e+01 -9.0746636e+01 -7.6758982e+01 -7.6635525e+01 -2.9968859e+01 -5.2240463e+01 -6.6709599e+01 -9.3845402e+01 -8.8672562e+01 -7.0647871e+01 -6.1684908e+01 -3.9104661e+01 1.9747191e+01 4.0151186e-01 -4.6191081e+01 -3.6870093e+01 -5.2775005e+00 1.6882993e+01 3.0932376e+01 5.3463240e+01 7.3018796e+01 6.9352129e+01 5.9179290e+01 9.6562006e+01 9.7191635e+01 1.1431509e+02 1.2271015e+02 1.3746324e+02 1.8561139e+02 1.3415460e+02 1.2679657e+02 1.4675954e+02 1.3351262e+02 1.3169781e+02 1.2294472e+02 1.2532744e+02 1.6804349e+02 1.0984596e+02 9.9500277e+01 8.3796574e+01 8.5290401e+01 8.0623734e+01 6.6142253e+01 7.1759537e+01 1.0259904e+02 3.4290401e+01 2.9142253e+01 2.1549660e+01 4.6360798e+00 -1.0400957e+01 -7.7095992e+00 5.7348452e+00 7.2780551e+00 -5.6030587e+01 -8.8178735e+01 -6.3203426e+01 -7.5191081e+01 -9.2672562e+01 -9.2388612e+01 -9.6882439e+01 -7.6919476e+01 -1.1987009e+02 -1.5064787e+02 -1.3925281e+02 -1.4417874e+02 -1.2077133e+02 -1.2978367e+02 -1.2370960e+02 -9.3289846e+01 -1.2456145e+02 -1.2407997e+02 -1.2052441e+02 -1.1625281e+02 -1.0735157e+02 -1.1012935e+02 -1.0462318e+02 -3.4092315e+01 -9.1758982e+01 -1.2100590e+02 -9.4981204e+01 -8.1956513e+01 -1.0356145e+02 -1.0070960e+02 -8.3400957e+01 -4.3981204e+01 -5.4771328e+01 -6.4240463e+01 -6.3265155e+01 -5.0055278e+01 -3.4240463e+01 1.5002773e+00 -1.8191081e+01 9.4632403e+00 -4.7289846e+01 -5.7388612e+01 -6.3055278e+01 -6.1339229e+01 -6.2203426e+01 -5.3018241e+01 -5.6178735e+01 7.8422791e-01 -4.4746636e+01 -9.2178735e+01 -9.1425649e+01 -1.1231454e+02 -9.4660217e+01 -8.2919476e+01 -7.2215772e+01 -1.5944167e+01 -7.8499723e+01 -9.4351575e+01 -6.8919476e+01 -5.4178735e+01 -4.2610834e+01 -5.5808365e+01 -6.2907130e+01 -3.4997227e+00 -3.5252809e+01 -3.5030587e+01 -3.0758982e+01 -3.9252809e+01 -3.2462686e+01 -2.9536760e+01 -2.5018241e+01 2.6784228e+01 -1.9314538e+01 -2.8684908e+01 -2.6228118e+01 -3.1289846e+01 -5.4820710e+01 -4.5178735e+01 -4.7820710e+01 1.4632403e+00 -2.2339229e+01 -6.8499723e+01 -5.7870093e+01 -5.0697254e+01 -4.9635525e+01 -6.7475031e+01 -7.8018241e+01 -4.7845402e+01 -9.5561451e+01 -1.1719108e+02 -1.0775898e+02 -8.4536760e+01 -7.9450340e+01 -8.2154044e+01 -4.6771328e+01 -3.7536760e+01 -7.8697254e+01 -8.2487377e+01 -7.0240463e+01 -5.9956513e+01 -5.1561451e+01 -6.1968859e+01 -5.2351575e+01 -3.1697254e+01 -6.8475031e+01 -8.3400957e+01 -6.2993550e+01 -6.2907130e+01 -7.3215772e+01 -4.9993550e+01 -4.9228118e+01 -1.0400957e+01 -8.6030587e+01 -1.0295651e+02 -9.9857747e+01 -7.7845402e+01 -6.1882439e+01 -6.7981204e+01 -6.1919476e+01 6.2373409e-01 -3.7956513e+01 -5.5845402e+01 -3.5178735e+01 -5.6363920e+01 -4.6981204e+01 -1.1870093e+01 -1.0228118e+01 2.7599043e+01 -4.3145375e+00 -3.9104661e+01 -3.8783673e+01 -2.7820710e+01 -1.3191081e+01 -1.6277500e+01 -2.6857747e+01 1.4796574e+01 -2.4873770e+00 -2.4166389e+01 -4.1910807e+00 -3.2651548e+00 -4.1540437e+00 -7.2528091e+00 2.4006450e+01 5.6055833e+01 7.4719088e-01 -2.5005896e+01 -1.4536760e+01 -1.8549105e+01 -9.7713276e+00 5.1262297e-01 1.1870648e+01 6.5895339e+01 4.0524969e+01 -2.0647871e+01 -3.6721945e+01 -3.0079970e+01 -2.1672562e+01 -6.4787085e-01 1.4697808e+01 5.1932376e+01 5.0434872e+00 -2.0734291e+01 -1.3610834e+01 -1.0018241e+01 1.9673117e+01 3.2710154e+01 4.6364475e+01 8.1327438e+01 3.6228672e+01 -1.8947844e+00 -3.2281178e+00 -1.5660217e+01 -4.0799696e+00 6.7595366e+00 2.2241018e+01 5.2500277e+01 1.6944722e+01 -4.1910807e+00 -8.6849079e+00 1.9722500e+01 2.6944722e+01 -2.0799696e+00 -6.1293523e+00 3.9463240e+01 8.3361063e-01 -3.2079970e+01 -4.7623179e+01 + -1.6158468e+01 -2.8602913e+01 -2.5751061e+01 1.7551119e+00 5.8458816e+01 -1.4177276e+00 -3.9368345e+01 -3.5121431e+01 -1.9467110e+01 -2.1232542e+01 -1.3355999e+01 -7.7016782e+00 3.1384742e+01 4.3600502e+00 -2.1960938e+01 -3.0306617e+01 -2.1183160e+01 1.0890914e+01 -9.3436535e+00 -5.8992091e+00 1.2878569e+01 -2.2393036e+01 -3.7874518e+01 -9.4918017e+00 -1.1047357e+01 -1.1825135e+01 -1.3528839e+01 1.2705729e+01 3.0952643e+01 -6.8498264e+00 -3.3615258e+01 -3.2862172e+01 -9.1461227e+00 -2.7701678e+01 1.8767458e+01 1.2298322e+01 6.6440008e+00 -1.3195505e+01 -4.7615258e+01 -4.1479456e+01 -2.3800444e+01 -2.7874518e+01 -4.2788098e+01 -2.9652296e+01 -3.8251350e+00 -1.2862172e+01 -3.3318962e+01 -2.6960938e+01 -1.3788098e+01 -3.5183160e+01 -2.0676987e+01 1.5946181e+00 8.7551119e+00 -1.3627604e+01 -4.8652296e+01 -5.0343654e+01 -5.9096740e+01 -4.6763407e+01 -3.1318962e+01 -1.9726370e+01 -9.7880980e+00 -4.6899209e+01 -6.4380691e+01 -4.9158468e+01 -1.1368345e+01 -3.2059703e+01 -2.3269579e+01 -3.1825135e+01 -2.4035012e+01 -4.5825135e+01 -5.0220197e+01 -5.5442419e+01 -6.8467110e+01 -5.9121431e+01 -3.7862172e+01 -3.8244888e+01 1.9878569e+01 -1.7355999e+01 -3.8109086e+01 -6.0331308e+01 -5.5504147e+01 -5.1355999e+01 -6.0220197e+01 -3.6516493e+01 3.2113137e+01 6.6810378e+00 -4.8997975e+01 -5.0010320e+01 -1.0788098e+01 4.8415316e+00 7.1748650e+00 3.0100791e+01 4.1853877e+01 2.0767458e+01 2.7674576e+00 4.6236593e+01 4.7952643e+01 4.7409433e+01 4.7310667e+01 5.5619309e+01 9.7520544e+01 4.0051408e+01 4.2026717e+01 5.9421779e+01 3.8150174e+01 2.6483507e+01 2.4631655e+01 3.9471161e+01 7.7397087e+01 2.1977334e+01 3.6236593e+01 1.9026717e+01 3.2767458e+01 2.3866223e+01 1.3347704e+01 3.2051408e+01 7.6508198e+01 1.1113137e+01 1.6409433e+01 1.2656346e+01 4.2983218e+00 3.0514082e+00 1.5520544e+01 2.8619309e+01 2.6631655e+01 -3.1738715e+01 -4.0874518e+01 -1.0837481e+01 -9.1831597e+00 -1.0874518e+01 -9.0473573e+00 -1.3393036e+01 1.4446470e+01 -2.0084394e+01 -4.6528839e+01 -3.2146123e+01 -4.2405382e+01 -2.2714024e+01 -3.7244888e+01 -3.9812789e+01 -1.8775752e+01 -5.3886863e+01 -3.9331308e+01 -5.2195505e+01 -6.3948592e+01 -5.0232542e+01 -6.8306617e+01 -5.3393036e+01 1.3483507e+01 -4.3096740e+01 -7.3960938e+01 -5.1726370e+01 -4.1541184e+01 -6.4454765e+01 -6.1948592e+01 -4.1244888e+01 -1.8343654e+01 -2.8306617e+01 -5.1714024e+01 -7.5923900e+01 -5.2874518e+01 -3.5294271e+01 -1.1578221e+01 -3.2343654e+01 -1.1602913e+01 -7.5257234e+01 -7.7714024e+01 -8.7417728e+01 -6.7726370e+01 -5.6269579e+01 -5.0491802e+01 -4.7689333e+01 6.5822724e+00 -2.5109086e+01 -5.5763407e+01 -4.8997975e+01 -7.1899209e+01 -5.5207851e+01 -4.3627604e+01 -4.6318962e+01 1.1668692e+01 -6.2602913e+01 -7.8121431e+01 -5.2281925e+01 -1.6862172e+01 -1.5306617e+01 -3.0973283e+01 -3.3911555e+01 1.0162519e+01 -2.1442419e+01 -2.1368345e+01 -1.4170814e+01 -2.5244888e+01 -2.5615258e+01 -2.7714024e+01 -2.4467110e+01 3.4927951e+01 -1.7726370e+01 -1.9714024e+01 -8.4053819e+00 -2.4257234e+01 -4.5220197e+01 -4.3467110e+01 -3.3899209e+01 3.0792149e+01 -3.5011574e-02 -3.0430073e+01 -2.4504147e+01 -1.6541184e+01 -2.0720486e+00 -2.0109086e+01 -3.3615258e+01 5.3106674e+00 -5.2936246e+01 -7.2195505e+01 -5.6096740e+01 -3.4553530e+01 -3.4899209e+01 -3.7923900e+01 1.0026717e+01 1.8051408e+01 -3.5689333e+01 -3.6146123e+01 -3.8627604e+01 -3.1578221e+01 -2.1491802e+01 -2.8479456e+01 -1.3701678e+01 -1.9115548e+00 -5.1158468e+01 -4.6788098e+01 -2.6355999e+01 -3.9652296e+01 -6.0294271e+01 -1.5751061e+01 6.5575810e+00 4.9063754e+01 -3.7714024e+01 -5.7405382e+01 -6.0109086e+01 -3.5948592e+01 -9.4424190e+00 -1.6837481e+01 -1.8269579e+01 2.6039063e+01 -1.3207851e+01 -2.5220197e+01 -9.8251350e+00 -3.4714024e+01 -3.6059703e+01 -1.0269579e+01 -1.0294271e+01 3.1903260e+01 -1.6923900e+01 -5.1553530e+01 -5.4146123e+01 -4.2936246e+01 -3.4133777e+01 -1.8960938e+01 -1.8849826e+01 1.6495853e+01 -5.7880980e+00 -3.4812789e+01 -1.7072049e+01 -1.5133777e+01 -1.0960938e+01 -1.3590567e+01 1.8890914e+01 4.1310667e+01 -6.6029128e+00 -2.7059703e+01 -6.7387153e+00 -1.0207851e+01 -1.2343654e+01 1.1137828e+01 1.9100791e+01 6.9100791e+01 3.7421779e+01 -6.6276042e+00 -1.5985629e+01 -1.6590567e+01 -1.3553530e+01 1.4211902e+01 2.9693383e+01 4.9174865e+01 -6.6276042e+00 -3.2602913e+01 -2.6504147e+01 -1.9862172e+01 7.5452353e+00 2.4927951e+01 2.8964988e+01 7.0211902e+01 2.9705729e+01 -2.7757523e+00 -1.6269579e+01 -3.7664641e+01 -1.2430073e+01 2.8044946e+00 1.2582272e+01 4.4792149e+01 -2.7016782e+00 -2.4343654e+01 -2.3751061e+01 2.6384742e+01 4.5310667e+01 4.9773341e+00 3.8474151e-01 3.5853877e+01 2.0390625e+00 -2.4627604e+01 -2.3788098e+01 + -2.7414677e+01 -1.6241838e+01 -3.4846776e+01 6.1001399e-01 5.2832236e+01 -1.6122082e+00 -2.4019616e+01 -2.2698628e+01 -1.2352949e+01 -2.3994924e+01 -4.8714675e+00 6.5976683e+00 2.8424829e+01 -1.8714675e+00 -1.9636900e+01 -1.1735665e+01 -2.3451714e+01 -1.2970233e+01 -2.5501097e+01 -1.3352949e+01 1.4844582e+01 -2.5389986e+01 -2.9649245e+01 -4.3159119e+00 -6.4887514e+00 2.0791498e+00 7.9149788e-02 2.7202607e+01 3.7400137e+01 4.0013744e-01 -1.1957887e+01 -8.0936897e+00 1.3507547e+00 -2.6476406e+01 1.9461866e+01 1.0770508e+01 -6.0936897e+00 -1.6809739e+01 -5.6118381e+01 -3.4464060e+01 -1.8748011e+01 -2.2636900e+01 -3.1612208e+01 -1.8254184e+01 3.4001374e+00 -2.9464060e+01 -4.6859122e+01 -2.5673937e+01 -2.2772702e+01 -3.5673937e+01 -2.6834430e+01 -1.0217147e+01 -2.0196156e+00 -1.9673937e+01 -3.9451714e+01 -2.4402332e+01 -1.9402332e+01 -2.4365295e+01 -2.5612208e+01 -3.7118381e+01 -1.5933196e+01 -4.0315912e+01 -3.3957887e+01 -2.2056653e+01 6.5853226e+00 -6.9949243e+00 1.0017421e+01 3.8445819e+00 1.3449520e+01 -3.6846776e+01 -5.0501097e+01 -3.4291221e+01 -3.9093690e+01 -3.3019616e+01 -8.8344305e+00 -1.9735665e+01 1.6844582e+01 5.6063127e-01 -1.9686282e+01 -4.2414677e+01 -4.7748011e+01 -3.3254184e+01 -2.8229492e+01 -2.5751712e+00 5.2696434e+01 1.3807545e+01 -3.0007270e+01 -2.4649245e+01 -8.9949243e+00 2.3384090e+00 1.1326063e+01 2.1202607e+01 3.2177915e+01 2.3721125e+01 1.5017421e+01 4.4572977e+01 4.0498903e+01 3.4807545e+01 4.3412483e+01 5.8881619e+01 9.7202607e+01 4.3486557e+01 2.7893965e+01 3.8708779e+01 3.2523594e+01 2.6572977e+01 1.6634705e+01 3.3251989e+01 7.6338409e+01 2.0264335e+01 2.1190261e+01 7.3347078e-01 1.2955693e+01 1.1326063e+01 9.9063103e+00 2.5511249e+01 4.2819891e+01 -1.2933196e+01 -1.3282576e+00 -4.7640577e-01 -1.9118381e+01 -3.4945542e+01 -2.2945542e+01 -8.0319613e+00 -7.0689984e+00 -5.4501097e+01 -6.9846776e+01 -3.6599863e+01 -5.0933196e+01 -7.0291221e+01 -7.1167764e+01 -6.3871467e+01 -3.6204801e+01 -7.6192455e+01 -9.1513443e+01 -6.9513443e+01 -7.7748011e+01 -6.5723319e+01 -8.2192455e+01 -7.8266529e+01 -4.5538134e+01 -6.9698628e+01 -7.4217147e+01 -7.0414677e+01 -7.6883813e+01 -7.7599863e+01 -8.7760356e+01 -7.2118381e+01 -1.0155418e+01 -8.5859122e+01 -9.9229492e+01 -7.7822085e+01 -8.4550480e+01 -1.1732826e+02 -1.1769863e+02 -9.6760356e+01 -6.3167764e+01 -7.8167764e+01 -7.7427023e+01 -7.2846776e+01 -7.2748011e+01 -5.4019616e+01 -2.8624554e+01 -3.5525788e+01 -6.5257885e+00 -5.4488751e+01 -7.2315912e+01 -8.9550480e+01 -8.4068998e+01 -8.5229492e+01 -7.3192455e+01 -6.2365295e+01 -2.8591218e+00 -4.9328258e+01 -9.2068998e+01 -9.1982579e+01 -1.0559986e+02 -8.2056653e+01 -6.2019616e+01 -6.2217147e+01 -1.2636900e+01 -6.4970233e+01 -7.9649245e+01 -5.5019616e+01 -4.5538134e+01 -4.6192455e+01 -6.7402332e+01 -5.5575171e+01 3.8322362e+00 -3.7698628e+01 -3.8834430e+01 -3.7056653e+01 -3.8723319e+01 -3.1278875e+01 -2.2315912e+01 -2.8241838e+01 1.5066804e+01 -3.0118381e+01 -2.7797393e+01 -2.7007270e+01 -3.4871467e+01 -4.5439369e+01 -3.8328258e+01 -4.0254184e+01 -6.9862799e-01 -2.9254184e+01 -6.6031961e+01 -4.6513443e+01 -4.7402332e+01 -4.7106035e+01 -6.6822085e+01 -6.5180109e+01 -3.9081344e+01 -9.3402332e+01 -9.7476406e+01 -8.5068998e+01 -5.7278875e+01 -5.0859122e+01 -6.1217147e+01 -1.4673937e+01 -9.5381342e+00 -5.8538134e+01 -6.5772702e+01 -4.9414677e+01 -4.4143072e+01 -3.3982579e+01 -4.5587517e+01 -3.1068998e+01 -1.3772702e+01 -5.3476406e+01 -6.4081344e+01 -4.7908505e+01 -5.4575171e+01 -5.3933196e+01 -3.4562826e+01 -2.5538134e+01 2.3137177e+00 -8.0155418e+01 -9.6970233e+01 -9.5044307e+01 -7.2612208e+01 -4.4340603e+01 -6.0673937e+01 -5.3525788e+01 1.4572977e+01 -3.8871467e+01 -5.7550480e+01 -4.2859122e+01 -7.0501097e+01 -5.0167764e+01 -1.6661591e+01 -1.7501097e+01 2.2338409e+01 -1.5241838e+01 -3.9686282e+01 -3.6451714e+01 -1.3501097e+01 3.5359399e+00 6.4705102e-01 -9.3035663e+00 3.6214952e+01 8.3260634e+00 -9.2912206e+00 1.4696434e+01 6.9310016e+00 1.9680387e+00 -6.2912206e+00 1.7795199e+01 4.8005076e+01 -4.6122082e+00 -2.3402332e+01 -1.2352949e+01 -1.2933196e+01 -9.0072700e+00 4.2396436e+00 1.6140878e+01 7.3659397e+01 3.8140878e+01 -2.3007270e+01 -2.5562826e+01 -2.5525788e+01 -1.9797393e+01 -6.0319613e+00 1.5301372e+01 5.9177915e+01 1.2387792e+01 -2.4093690e+01 -2.7217147e+01 -2.2476406e+01 7.4865572e+00 1.3647051e+01 3.6375446e+01 7.2227298e+01 1.7177915e+01 -1.2649245e+01 -1.7599863e+01 -3.0007270e+01 -1.3686282e+01 -5.5628255e+00 1.2721125e+01 3.1548286e+01 -1.4307243e-01 -9.4393687e+00 -1.1797393e+01 1.1548286e+01 1.6560631e+01 -1.4118381e+01 -1.4439369e+01 3.2881619e+01 -1.2673937e+01 -4.4167764e+01 -5.7896159e+01 + 4.3273655e+00 4.8211926e+00 -1.1833128e+01 1.7845884e+01 4.6290328e+01 -1.6697326e+01 -3.7907202e+01 -4.2055351e+01 -2.9709672e+01 -4.2931894e+01 -3.3092388e+01 -1.6549178e+01 1.8179217e+01 -1.1462758e+01 -3.5586215e+01 -4.5833128e+01 -4.8289918e+01 -1.3808437e+01 -2.4968931e+01 -1.6326956e+01 3.5866247e+00 -3.2141770e+01 -4.5944239e+01 -2.9907202e+01 -2.4450412e+01 -2.1018314e+01 -3.1709672e+01 7.4261309e+00 1.0277983e+01 -2.9228190e+01 -3.4092388e+01 -3.4030659e+01 -2.2005968e+01 -4.8919548e+01 9.3230372e-01 7.2242718e-01 -4.0306592e+00 -2.2092388e+01 -5.1561523e+01 -3.2104733e+01 -2.7203499e+01 -2.7783746e+01 -3.8660289e+01 -2.7277573e+01 -3.8331284e+00 -3.1401030e+01 -4.2413375e+01 -2.8870165e+01 -2.1660289e+01 -3.9512141e+01 -2.1919548e+01 -1.3005968e+01 -1.2413375e+01 -2.7660289e+01 -4.9326956e+01 -4.5610906e+01 -5.1289918e+01 -4.4647943e+01 -2.8709672e+01 -2.3067696e+01 -8.7343629e+00 -3.7981277e+01 -3.4931894e+01 -2.7055351e+01 -1.2405358e+00 -1.4919548e+01 -2.4504123e+00 -1.4845474e+01 -3.4010296e+00 -3.5314610e+01 -4.3882511e+01 -3.7894857e+01 -5.1166462e+01 -4.5117079e+01 -2.2549178e+01 -2.2956585e+01 2.3265637e+01 -8.3269555e+00 -3.3388684e+01 -6.2129425e+01 -5.0759054e+01 -3.6203499e+01 -3.7919548e+01 -1.9956585e+01 3.1549588e+01 -4.3146099e+00 -4.1104733e+01 -3.3055351e+01 -5.8701654e+00 7.6360074e+00 2.0327365e+01 3.3981686e+01 4.8697736e+01 3.2080452e+01 2.7784156e+01 5.8574279e+01 5.4784156e+01 6.0389094e+01 6.4265637e+01 8.3734773e+01 1.1194465e+02 6.0265637e+01 6.0895267e+01 7.8500205e+01 6.4413785e+01 5.7092798e+01 5.2265637e+01 7.1240946e+01 1.0345082e+02 4.4821193e+01 4.7389094e+01 3.6500205e+01 5.4784156e+01 5.0043415e+01 4.3389094e+01 6.5475514e+01 8.7956995e+01 3.4413785e+01 4.0882921e+01 3.2265637e+01 1.9105143e+01 2.0858230e+01 3.2747119e+01 4.9561933e+01 4.0944649e+01 -1.8882511e+01 -3.2252881e+01 -8.2078270e-01 -5.9812765e+00 -1.6302264e+01 -8.6109062e+00 -1.5121407e+00 2.3956995e+01 -2.0907202e+01 -4.5228190e+01 -2.9252881e+01 -3.6487449e+01 -1.6549178e+01 -2.2672635e+01 -2.0154116e+01 5.7427903e-01 -2.8363993e+01 -2.7672635e+01 -1.7635598e+01 -1.6660289e+01 -9.5985605e+00 -8.9195481e+00 4.1545259e+00 5.7376748e+01 -6.6973259e+00 -2.2845474e+01 -5.4751037e+00 6.6853901e+00 -1.5512141e+01 -1.5265227e+01 -2.8084370e+00 2.7969341e+01 4.9569951e+00 1.2983459e-01 -5.3393012e+00 -1.9072024e+00 2.0080452e+01 3.4771810e+01 2.6364402e+01 4.2339711e+01 -1.1796091e+01 -1.0425721e+01 -1.7956585e+01 -3.9195481e+00 -5.8207827e+00 -5.6602889e+00 -1.5615234e+00 4.8290328e+01 -4.1788074e+00 -2.9586215e+01 -2.9919548e+01 -4.0993622e+01 -3.2178807e+01 -1.2672635e+01 -9.9362220e-01 4.3500205e+01 -2.3907202e+01 -3.2610906e+01 3.2039087e+00 2.2882921e+01 3.0598970e+01 8.2903284e+00 1.3487859e+01 6.0327365e+01 2.2142180e+01 2.1734773e+01 1.9956995e+01 4.4137852e+00 4.6853901e+00 1.4327365e+01 1.6463168e+01 6.4734773e+01 5.3150198e+00 5.1792173e+00 1.0561933e+01 6.5125506e+00 -1.3783746e+01 -1.1191153e+01 -3.4010296e+00 4.5450822e+01 9.4631679e+00 -1.9635598e+01 -1.2401030e+01 -1.2610906e+01 2.6730445e+00 -1.0610906e+01 -1.9635598e+01 3.0187235e+00 -5.0956585e+01 -6.2919548e+01 -5.4425721e+01 -2.9968931e+01 -2.9191153e+01 -3.5178807e+01 9.8582296e+00 4.2162543e+00 -3.2549178e+01 -3.5734363e+01 -2.5796091e+01 -1.6043005e+01 -9.1294247e+00 -1.9351647e+01 -5.7714000e+00 5.5866247e+00 -4.1413375e+01 -4.0277573e+01 -2.0104733e+01 -2.8487449e+01 -3.3660289e+01 -7.7590543e+00 6.0927976e+00 3.5142180e+01 -4.0351647e+01 -4.8092388e+01 -5.2215844e+01 -3.5265227e+01 -1.6104733e+01 -3.3697326e+01 -2.0413375e+01 2.6450822e+01 -1.7166462e+01 -1.6129425e+01 -4.1337529e-01 -3.1462758e+01 -1.7833128e+01 -6.3559751e-01 7.2039087e+00 4.0006378e+01 -6.3763383e+00 -3.1376338e+01 -3.6549178e+01 -1.4771400e+01 -1.4907202e+01 -1.4610906e+01 -2.6302264e+01 1.4858230e+01 -1.2944239e+01 -2.4499795e+01 -5.5368321e+00 -1.1783746e+01 -1.5833128e+01 -1.6203499e+01 2.0771810e+01 3.7092798e+01 -1.5524486e+01 -3.6450412e+01 -3.1067696e+01 -2.5166462e+01 -2.1722017e+01 -7.4997950e+00 3.9446494e+00 5.6179217e+01 2.3203909e+01 -3.4339301e+01 -3.3117079e+01 -3.8598560e+01 -2.6425721e+01 8.0451871e-02 2.3771810e+01 4.2105143e+01 -3.5738691e+00 -2.6573869e+01 -1.7475104e+01 -1.0573869e+01 2.0339711e+01 2.8561933e+01 4.4870575e+01 7.2302674e+01 2.6549588e+01 7.1792173e+00 -2.7757282e-01 -9.3269555e+00 3.8088469e+00 1.6463168e+01 4.0969341e+01 5.7660699e+01 1.9981686e+01 4.7224272e+00 9.7471185e+00 4.2339711e+01 4.4932304e+01 1.8277983e+01 2.1537242e+01 6.1561933e+01 2.0031069e+01 1.5989704e+00 -6.0676963e+00 + 6.8424720e+00 7.8671634e+00 -9.7748119e+00 2.5200497e+01 5.4570867e+01 -9.1204909e+00 -2.2935306e+01 -2.7663701e+01 -1.8194565e+01 -3.1676046e+01 -2.4429133e+01 -6.4044416e+00 1.6410373e+01 -1.7527898e+01 -4.5305676e+01 -5.4873577e+01 -5.6898269e+01 -2.6676046e+01 -3.9540244e+01 -2.6700738e+01 -7.1204909e+00 -4.4972343e+01 -5.8305676e+01 -4.1071108e+01 -3.3577281e+01 -2.4169874e+01 -3.2688392e+01 1.4694324e+01 1.3546176e+01 -2.6108145e+01 -2.3947651e+01 -2.3392096e+01 -1.6848886e+01 -4.5293330e+01 5.9535831e+00 3.3239535e+00 -3.4271316e-01 -2.0552590e+01 -4.7997034e+01 -2.5540244e+01 -1.7157528e+01 -1.4910614e+01 -2.5206911e+01 -1.7318022e+01 4.2992622e+00 -2.8663701e+01 -3.5330367e+01 -1.9503207e+01 -1.3379750e+01 -3.0787158e+01 -1.0243948e+01 -3.2192564e+00 -9.6143181e+00 -2.6922960e+01 -4.9305676e+01 -4.7811849e+01 -5.0206911e+01 -4.6206911e+01 -3.2725429e+01 -2.5614318e+01 -9.8488860e+00 -3.8231602e+01 -2.7355059e+01 -1.4861232e+01 8.2992622e+00 -1.6637008e+00 1.1632595e+01 -4.4147859e-01 8.9535831e+00 -2.5305676e+01 -3.3503207e+01 -2.3379750e+01 -3.0947651e+01 -2.3503207e+01 2.9042004e+00 4.6819782e+00 4.8620250e+01 2.0299262e+01 -7.4908613e+00 -3.4515553e+01 -2.0429133e+01 -3.4908613e+00 -1.0957996e+00 1.7274571e+01 6.5509139e+01 2.0114077e+01 -1.7799503e+01 -1.1898269e+01 1.1101731e+01 1.9793089e+01 2.9570867e+01 4.3904200e+01 5.5842472e+01 3.4768398e+01 2.9126423e+01 5.3410373e+01 5.3509139e+01 5.5422719e+01 6.2620250e+01 8.6262225e+01 1.0753383e+02 5.5311608e+01 5.9089386e+01 7.8583213e+01 6.8706670e+01 6.3817781e+01 5.6484447e+01 8.1620250e+01 1.1076840e+02 5.5077040e+01 6.3447410e+01 5.1212842e+01 6.8237534e+01 6.1793089e+01 5.4101731e+01 7.7694324e+01 8.7644941e+01 3.4805435e+01 4.1509139e+01 3.1842472e+01 1.7595558e+01 1.7583213e+01 3.2719015e+01 5.2558521e+01 4.0879509e+01 -1.5614318e+01 -2.5206911e+01 2.6572868e+00 -1.3429133e+01 -2.8132837e+01 -2.3034071e+01 -1.6515553e+01 2.4227189e+00 -4.2811849e+01 -6.0132837e+01 -4.0367405e+01 -4.7601972e+01 -2.9169874e+01 -3.3836540e+01 -2.9713084e+01 -4.2933304e+00 -2.7429133e+01 -3.0441479e+01 -1.9997034e+01 -1.7453824e+01 -1.0811849e+01 -7.5772811e+00 9.4967930e+00 5.6533830e+01 -1.1663701e+01 -1.7787158e+01 -3.2192564e+00 -9.3798225e-03 -2.8589627e+01 -2.4688392e+01 -1.9229601e+00 3.4904200e+01 9.8548177e+00 8.7683980e+00 6.3362992e+00 1.1558521e+01 4.0398028e+01 5.2138768e+01 4.6669633e+01 5.8620250e+01 4.2869165e+00 3.3116078e+00 -1.2577281e+01 -1.8241946e+00 -8.9106144e+00 -1.1688392e+01 2.9165461e+00 4.7583213e+01 -1.4355059e+01 -4.2392096e+01 -4.5898269e+01 -5.1676046e+01 -4.4552590e+01 -2.4231602e+01 -1.1713084e+01 2.9719015e+01 -3.5293330e+01 -3.9293330e+01 -4.9229601e+00 9.9288918e+00 1.8262225e+01 -7.6390095e+00 5.6449412e+00 4.9706670e+01 7.7437066e+00 1.3040003e+01 1.2756052e+01 7.5605228e-01 1.1758054e+00 1.1570867e+01 1.7077040e+01 6.0607904e+01 3.1511140e+00 4.5338301e+00 6.4597560e+00 -7.0073785e-01 -1.8614318e+01 -1.3379750e+01 1.7580536e-01 4.3398028e+01 1.4967930e+00 -2.4799503e+01 -1.4404442e+01 -1.9959997e+01 -7.5402440e+00 -2.4206911e+01 -2.6108145e+01 -5.3056761e+00 -5.6984688e+01 -6.0984688e+01 -5.3601972e+01 -3.0601972e+01 -2.4663701e+01 -2.7861232e+01 1.8274571e+01 5.9165461e+00 -3.0490861e+01 -3.6959997e+01 -2.6046417e+01 -1.7318022e+01 -1.1774812e+01 -2.3145182e+01 -5.5155527e+00 5.7807436e+00 -4.3676046e+01 -4.1021726e+01 -2.1997034e+01 -3.0490861e+01 -3.4219256e+01 -1.1330367e+01 1.6202498e+00 1.8780744e+01 -5.6392096e+01 -5.7034071e+01 -5.4490861e+01 -3.5861232e+01 -1.7626664e+01 -3.4836540e+01 -1.1848886e+01 3.3336299e+01 -1.1626664e+01 -7.4414786e+00 9.5214844e+00 -2.2009380e+01 1.0153115e+00 2.0867163e+01 3.2163460e+01 6.5867163e+01 2.0101731e+01 3.1881510e+00 -6.2666377e-01 2.5657287e+01 2.0595558e+01 1.8916546e+01 8.7930893e+00 4.8225188e+01 1.7163460e+01 7.4350646e+00 2.2854818e+01 1.2398028e+01 4.4103733e+00 1.3362992e+00 3.5200497e+01 4.2015312e+01 -1.4379750e+01 -3.1626664e+01 -2.8206911e+01 -2.1021726e+01 -1.8293330e+01 -2.5896267e+00 1.4632595e+01 6.3805435e+01 2.3373336e+01 -3.6206911e+01 -3.1330367e+01 -3.2416787e+01 -1.4811849e+01 8.4227189e+00 3.2249879e+01 4.6163460e+01 6.2992622e+00 -1.3762466e+01 -3.2439477e+00 3.3362992e+00 3.3422719e+01 4.0360991e+01 6.3533830e+01 8.5941237e+01 3.3731361e+01 1.1941237e+01 2.1017313e+00 -4.1328366e+00 7.6819782e+00 2.1089386e+01 5.0188151e+01 6.4040003e+01 2.7756052e+01 1.3644941e+01 2.0151114e+01 4.7002966e+01 4.4163460e+01 1.8027657e+01 2.4891855e+01 6.0077040e+01 6.8054350e+00 -1.0935306e+01 -2.1972343e+01 + -3.4295079e+01 -1.9727177e+01 -3.6690140e+01 -8.7532552e-01 1.7235786e+01 -4.5221005e+01 -4.6517301e+01 -4.7171622e+01 -3.5900017e+01 -4.9974091e+01 -3.7998782e+01 -5.6668355e-01 2.3420971e+01 -5.3568070e+00 -3.3690140e+01 -4.7270387e+01 -4.6653103e+01 -1.3541992e+01 -3.5887671e+01 -3.4924708e+01 -2.8221005e+01 -6.5690140e+01 -6.5430881e+01 -4.8307424e+01 -3.7801251e+01 -3.1282733e+01 -3.9677795e+01 7.7296128e+00 -9.7409095e-01 -4.7097548e+01 -5.2270387e+01 -4.0480264e+01 -3.4011128e+01 -5.7739523e+01 -1.7924708e+01 -2.0579029e+01 -2.2467918e+01 -4.8801251e+01 -6.8875326e+01 -5.6529647e+01 -5.3344461e+01 -5.7566684e+01 -5.5406190e+01 -3.5418535e+01 -1.6986437e+01 -5.6430881e+01 -6.7048165e+01 -4.9591375e+01 -4.0974091e+01 -5.4727177e+01 -3.6912363e+01 -3.8307424e+01 -4.1221005e+01 -4.8307424e+01 -6.9134585e+01 -7.8616066e+01 -8.6406190e+01 -8.1381498e+01 -7.0739523e+01 -6.2788906e+01 -6.6443227e+01 -1.0881360e+02 -1.0373952e+02 -9.3566684e+01 -6.6035819e+01 -7.8554338e+01 -6.7319770e+01 -8.2924708e+01 -7.3887671e+01 -9.6838288e+01 -1.0783829e+02 -1.0150496e+02 -1.1231977e+02 -1.0448026e+02 -7.3677795e+01 -7.1776560e+01 -4.0517301e+01 -7.3900017e+01 -9.9369153e+01 -1.0818397e+02 -7.8825943e+01 -6.9344461e+01 -7.2418535e+01 -4.5504955e+01 -2.2703872e+00 -4.2369153e+01 -6.2690140e+01 -5.8801251e+01 -2.7245696e+01 -1.3048165e+01 5.5814646e+00 1.8902452e+01 2.7606156e+01 1.7419584e+00 1.3715881e+00 2.8285168e+01 2.6050600e+01 2.1001218e+01 2.8630847e+01 5.5951835e+01 7.7877761e+01 2.8470353e+01 3.5976526e+01 4.5865415e+01 3.5778995e+01 2.5174057e+01 2.0025909e+01 4.7976526e+01 5.8087637e+01 5.5938103e+00 1.1223440e+01 -9.0001688e-01 9.3948929e-01 -1.3393844e+01 -2.0825943e+01 1.0334551e+01 2.0285168e+01 -2.6788906e+01 -2.1961745e+01 -3.3727177e+01 -4.5900017e+01 -3.6554338e+01 -2.5739523e+01 -1.8134585e+01 -3.9109893e+01 -8.9714832e+01 -8.7307424e+01 -5.3122239e+01 -6.2319770e+01 -7.5307424e+01 -7.3677795e+01 -6.4998782e+01 -5.8739523e+01 -1.0608520e+02 -1.3087533e+02 -1.1548026e+02 -1.1686298e+02 -9.7332116e+01 -1.1025804e+02 -1.1369014e+02 -1.0003582e+02 -1.2188767e+02 -1.2480125e+02 -1.3664076e+02 -1.5514693e+02 -1.7192471e+02 -1.8219631e+02 -1.5119631e+02 -1.2312224e+02 -1.9599878e+02 -2.0422100e+02 -1.8415928e+02 -1.6980125e+02 -1.9771483e+02 -1.9957903e+02 -1.8803582e+02 -1.5002347e+02 -1.7148026e+02 -1.7436915e+02 -1.8309755e+02 -1.8175187e+02 -1.5434446e+02 -1.5218397e+02 -1.4728273e+02 -1.4336915e+02 -1.9759137e+02 -1.9967779e+02 -2.0756668e+02 -1.7940619e+02 -1.7909755e+02 -1.7838150e+02 -1.4566545e+02 -9.4690140e+01 -1.4656668e+02 -1.7807286e+02 -1.8249261e+02 -1.9035681e+02 -1.8352965e+02 -1.5183829e+02 -1.4309755e+02 -1.0413458e+02 -1.7577656e+02 -1.7671483e+02 -1.3718397e+02 -1.2307286e+02 -1.2813458e+02 -1.6219631e+02 -1.3504817e+02 -8.7085202e+01 -1.1739384e+02 -1.0844323e+02 -1.1272718e+02 -1.1975187e+02 -1.1607286e+02 -9.2714832e+01 -9.1307424e+01 -5.6714832e+01 -1.2051730e+02 -1.2522100e+02 -1.1010989e+02 -1.1983829e+02 -1.3566545e+02 -1.3239384e+02 -1.0613458e+02 -6.6085202e+01 -1.0423335e+02 -1.2771483e+02 -1.2588767e+02 -1.2293705e+02 -1.0580125e+02 -1.2131977e+02 -1.2493705e+02 -1.1967779e+02 -1.7382594e+02 -1.7757903e+02 -1.6294940e+02 -1.4077656e+02 -1.3590002e+02 -1.3829508e+02 -9.6862980e+01 -1.0022100e+02 -1.3286298e+02 -1.3383829e+02 -1.2323335e+02 -1.1802347e+02 -1.1051730e+02 -1.2177656e+02 -1.0393705e+02 -9.7788906e+01 -1.4608520e+02 -1.3257903e+02 -1.0490002e+02 -1.1746792e+02 -1.2731977e+02 -1.0746792e+02 -8.0875326e+01 -6.7702486e+01 -1.4476421e+02 -1.5173952e+02 -1.4385063e+02 -1.2102347e+02 -1.0401113e+02 -1.2630742e+02 -1.1009755e+02 -7.5640758e+01 -1.1728273e+02 -1.0856668e+02 -9.5011128e+01 -1.3155434e+02 -1.1176421e+02 -9.8455572e+01 -8.4875326e+01 -5.8282733e+01 -1.0575187e+02 -1.3176421e+02 -1.3923335e+02 -9.4579029e+01 -9.5109893e+01 -9.4801251e+01 -9.6912363e+01 -5.5109893e+01 -8.4196313e+01 -8.9862980e+01 -6.6961745e+01 -7.5011128e+01 -7.7665449e+01 -6.6554338e+01 -1.6875326e+01 -6.7889058e+00 -5.6344461e+01 -7.4319770e+01 -7.2221005e+01 -6.0603721e+01 -6.2258042e+01 -4.9665449e+01 -4.4245696e+01 5.0506004e+00 -2.4566684e+01 -8.0998782e+01 -7.4035819e+01 -8.6974091e+01 -6.7048165e+01 -4.4640758e+01 -2.4690140e+01 -2.9677795e+01 -7.5949400e+01 -9.9653103e+01 -8.9072856e+01 -7.0628412e+01 -5.0529647e+01 -5.3097548e+01 -2.6529647e+01 -1.2332116e+01 -6.4430881e+01 -8.1788906e+01 -9.0764214e+01 -9.9776560e+01 -8.3529647e+01 -6.8702486e+01 -4.7690140e+01 -3.9924708e+01 -7.0640758e+01 -8.6393844e+01 -7.9418535e+01 -5.1579029e+01 -5.5665449e+01 -8.0541992e+01 -7.1739523e+01 -3.8788906e+01 -8.4245696e+01 -9.5850634e+01 -1.0925804e+02 + -5.9968087e+01 -7.3573025e+01 -6.3980433e+01 -6.4647099e+01 -6.5227346e+01 -7.5758210e+01 -8.7931050e+01 -8.1165618e+01 -7.8671791e+01 -8.1548334e+01 -7.4548334e+01 -9.4350803e+01 -1.0710389e+02 -9.7844630e+01 -8.6461914e+01 -7.8054507e+01 -1.0665944e+02 -1.1601747e+02 -1.2028907e+02 -1.0222735e+02 -8.5375494e+01 -1.0559772e+02 -1.0212858e+02 -1.0774586e+02 -9.5054507e+01 -8.1400186e+01 -8.6535988e+01 -9.8647099e+01 -9.4684136e+01 -1.0410389e+02 -8.7856976e+01 -8.2881667e+01 -9.3252038e+01 -8.8684136e+01 -8.7671791e+01 -8.1807593e+01 -6.5881667e+01 -7.7782902e+01 -9.0992778e+01 -9.6066852e+01 -9.2449568e+01 -1.0035080e+02 -9.3745865e+01 -9.0968087e+01 -8.8721173e+01 -8.9659445e+01 -1.0459772e+02 -1.1288167e+02 -1.1211624e+02 -1.0910389e+02 -9.7449568e+01 -1.0394340e+02 -1.1152364e+02 -1.0890636e+02 -9.4770556e+01 -1.0098043e+02 -1.0732611e+02 -1.2374586e+02 -1.1388167e+02 -1.1927673e+02 -1.0872117e+02 -9.0486605e+01 -1.2291870e+02 -1.3109154e+02 -1.3421500e+02 -1.3228907e+02 -1.2261006e+02 -1.3851130e+02 -1.3168414e+02 -1.3022735e+02 -1.3852364e+02 -1.2399278e+02 -1.2625204e+02 -1.1421500e+02 -1.3015327e+02 -1.1642488e+02 -1.2704216e+02 -1.2347426e+02 -1.3677056e+02 -1.4611624e+02 -1.4240019e+02 -1.3163475e+02 -1.1949895e+02 -1.1553599e+02 -1.0906685e+02 -1.2620265e+02 -1.2712858e+02 -1.1179525e+02 -1.0747426e+02 -1.0432611e+02 -9.0758210e+01 -8.8634754e+01 -8.3856976e+01 -9.5474260e+01 -7.3696482e+01 -7.1585371e+01 -7.7523642e+01 -6.7535988e+01 -7.3449568e+01 -7.3807593e+01 -7.6511297e+01 -5.8363149e+01 -5.2745865e+01 -5.8474260e+01 -6.2795247e+01 -8.0326112e+01 -7.1585371e+01 -7.1634754e+01 -6.4832284e+01 -7.5227346e+01 -7.6659445e+01 -8.6894013e+01 -9.4066852e+01 -9.0091544e+01 -7.9079198e+01 -8.8140926e+01 -1.0352364e+02 -1.0559772e+02 -9.5968087e+01 -1.0098043e+02 -9.8437223e+01 -1.2137549e+02 -1.1658537e+02 -1.2083228e+02 -1.3399278e+02 -1.1265944e+02 -1.2231377e+02 -1.3744957e+02 -1.1449895e+02 -1.0252364e+02 -1.1553599e+02 -1.2135080e+02 -1.4202982e+02 -1.4789401e+02 -1.1780759e+02 -1.2057303e+02 -1.3816562e+02 -1.3659772e+02 -1.2607920e+02 -1.1774586e+02 -1.1268414e+02 -1.2206685e+02 -1.3710389e+02 -1.3416562e+02 -1.2022735e+02 -1.1777056e+02 -1.2170883e+02 -1.3977056e+02 -1.2598043e+02 -1.2801747e+02 -1.2073352e+02 -1.2261006e+02 -1.3584463e+02 -1.2788167e+02 -1.0907920e+02 -1.1661006e+02 -1.0473352e+02 -1.1030142e+02 -1.1152364e+02 -1.2737549e+02 -1.1216562e+02 -1.1472117e+02 -1.2669648e+02 -1.2720265e+02 -1.3689401e+02 -1.3372117e+02 -1.0986932e+02 -1.2943722e+02 -1.3370883e+02 -1.3227673e+02 -1.1662241e+02 -1.1925204e+02 -1.3138784e+02 -1.3257303e+02 -1.1373352e+02 -1.0804216e+02 -9.8165618e+01 -9.7227346e+01 -9.2955741e+01 -9.1252038e+01 -1.0098043e+02 -9.8844630e+01 -9.0585371e+01 -1.0117796e+02 -1.0499278e+02 -1.0216562e+02 -9.4832284e+01 -7.6313766e+01 -7.3931050e+01 -8.9931050e+01 -8.1511297e+01 -8.0560679e+01 -8.7610062e+01 -9.2881667e+01 -9.9535988e+01 -9.0548334e+01 -8.5832284e+01 -9.5758210e+01 -8.3807593e+01 -8.6647099e+01 -9.1770556e+01 -9.6153272e+01 -8.6745865e+01 -7.0313766e+01 -8.7696482e+01 -9.6795247e+01 -7.4585371e+01 -5.7856976e+01 -7.0276729e+01 -7.6585371e+01 -7.7066852e+01 -8.2671791e+01 -6.8560679e+01 -7.8770556e+01 -7.6573025e+01 -8.9424877e+01 -9.1215000e+01 -7.4560679e+01 -6.5881667e+01 -6.4573025e+01 -7.1980433e+01 -6.8486605e+01 -5.3387840e+01 -4.4449568e+01 -7.8474260e+01 -9.2239692e+01 -7.8535988e+01 -7.3832284e+01 -5.7721173e+01 -5.1498951e+01 -6.3116235e+01 -6.0745865e+01 -6.3832284e+01 -5.1992778e+01 -5.2881667e+01 -6.4758210e+01 -6.4276729e+01 -7.0116235e+01 -5.7622408e+01 -4.8906359e+01 -4.0758210e+01 -5.0708828e+01 -5.9684136e+01 -5.0622408e+01 -6.2523642e+01 -6.9400186e+01 -5.7202655e+01 -5.0671791e+01 -3.1140926e+01 -3.9177963e+01 -6.6375494e+01 -7.0326112e+01 -6.0091544e+01 -4.4190309e+01 -2.8573025e+01 -3.0412531e+01 -4.9622408e+01 -5.9264383e+01 -4.6671791e+01 -5.1721173e+01 -4.9338457e+01 -4.3252038e+01 -4.1770556e+01 -4.4856976e+01 -3.3560679e+01 -2.6931050e+01 -3.0239692e+01 -4.1424877e+01 -3.5264383e+01 -6.9927783e+00 -1.9091544e+01 -2.2918704e+01 -3.6745865e+01 -3.2289075e+01 -2.5017470e+01 -1.6721173e+01 -2.5560679e+01 -4.7992778e+01 -5.4535988e+01 -3.2721173e+01 -3.2931050e+01 -3.3634754e+01 -3.3079198e+01 -3.5276729e+01 -1.5424877e+01 -1.1461914e+01 -2.8869321e+01 -4.1597717e+01 -3.8424877e+01 -2.4647099e+01 -2.0992778e+01 -2.1437223e+01 -2.0511297e+01 -3.5066852e+01 -3.2474260e+01 -2.8079198e+01 -1.8943396e+01 -1.6289075e+01 -3.9585371e+01 -2.6202655e+01 -1.7832284e+01 -4.6347536e+00 -3.8199388e+00 -1.9239692e+01 -2.5523642e+01 -2.4758210e+01 -8.9927783e+00 -1.9005124e+01 -3.2560679e+01 -3.4795247e+01 -2.8005124e+01 -9.5853709e+00 diff --git a/code/eeglab13_4_4b/sample_data/pnas.flt b/code/eeglab13_4_4b/sample_data/pnas.flt new file mode 100644 index 0000000..3ef99db --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/pnas.flt @@ -0,0 +1 @@ + -9.8132702405876546e-03 -1.6564081383952081e-03 9.7893636917227109e-03 1.9453563627893026e-02 2.1761877079657117e-02 1.3318297346893189e-02 -4.8278141361586552e-03 -2.6471677510898992e-02 -4.1709525588446594e-02 -4.0287280150142324e-02 -1.5696917162002055e-02 3.1587852122769593e-02 9.3159120347067512e-02 1.5462064930532377e-01 1.9992195989899980e-01 2.1658703166222329e-01 1.9992195989899980e-01 1.5462064930532377e-01 9.3159120347067512e-02 3.1587852122769593e-02 -1.5696917162002055e-02 -4.0287280150142324e-02 -4.1709525588446594e-02 -2.6471677510898992e-02 -4.8278141361586552e-03 1.3318297346893189e-02 2.1761877079657117e-02 1.9453563627893026e-02 9.7893636917227109e-03 -1.6564081383952081e-03 -9.8132702405876546e-03 diff --git a/code/eeglab13_4_4b/sample_data/pnas_chan.locs b/code/eeglab13_4_4b/sample_data/pnas_chan.locs new file mode 100644 index 0000000..1168111 --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/pnas_chan.locs @@ -0,0 +1,31 @@ +1 10 0.499 EOG1 +2 -33 0.31 F3.. +3 0 0.225 Fz.. +4 33 0.31 F4.. +5 -20 0.499 EOG2 +6 -69 0.36 FC5. +7 -45 0.16 FC1. +8 45 0.16 FC2. +9 69 0.36 FC6. +10 -90 0.46 T7.. +11 -90 0.225 C3.. +12 90 0.225 C4.. +13 90 0 Cz.. +14 90 0.46 T8.. +15 -111 0.36 CP5. +16 -135 0.15 CP1. +17 135 0.15 CP2. +18 111 0.36 CP6. +19 -126 0.46 P7.. +20 -147 0.31 P3.. +21 180 0.225 Pz.. +22 147 0.31 P4.. +23 126 0.46 P8.. +24 -144 0.46 PO7. +25 -155 0.37 PO3. +26 180 0.345 POz. +27 155 0.37 PO4. +28 144 0.46 PO8. +29 -162 0.46 O1.. +30 180 0.46 Oz.. +31 162 0.46 O2.. diff --git a/code/eeglab13_4_4b/sample_data/pnas_chan14.locs b/code/eeglab13_4_4b/sample_data/pnas_chan14.locs new file mode 100644 index 0000000..155ac6e --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/pnas_chan14.locs @@ -0,0 +1,14 @@ + 1 0 .181 Fz.. + 2 0 0 Cz.. + 3 180 .181 Pz.. + 4 180 .352 Oz.. + 5 -39 .231 F3.. + 6 39 .231 F4.. + 7 -90 .181 C3.. + 8 90 .181 C4.. + 9 -90 .352 T3.. +10 90 .352 T4.. +11 -142 .231 P3.. +12 142 .231 P4.. +13 0 .352 Fpz. +14 0 .501 EOG. diff --git a/code/eeglab13_4_4b/sample_data/scanned72.dat b/code/eeglab13_4_4b/sample_data/scanned72.dat new file mode 100644 index 0000000..a384fd5 --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/scanned72.dat @@ -0,0 +1,72 @@ + Nasion 78 0.315772 9.050142 0.000000 + Left 76 -6.672964 0.000000 -0.000000 + Right 82 6.672964 -0.000000 0.000000 + F7 69 -6.037982 6.367048 4.319882 + C5 69 -6.699782 2.155084 8.506571 + Fz 69 0.246231 8.721723 10.316833 + F3A 69 -3.250437 9.720578 5.911353 + F1 69 -1.708955 8.796163 9.782022 + F5 69 -5.124611 7.670965 6.390680 + C1A 69 -2.185352 6.386558 11.823852 + C3A 69 -4.461506 6.172830 10.179628 + C5A 69 -6.735288 5.139266 7.472328 + Fp1 69 -2.759503 9.499158 3.377193 + F3 69 -3.675483 8.594835 8.488358 + CZA 69 -0.046459 6.353436 12.617018 + Fp2 69 3.432305 9.249283 3.254234 + F4 69 4.559260 7.630838 9.304662 + C4 69 5.423925 2.615268 12.078911 + F8 69 6.634672 5.390807 4.856583 + T4 69 7.451251 0.811229 6.709445 + Cz 69 0.172888 3.728432 14.383917 + Fpz 69 0.643352 10.276821 3.329112 + F4A 69 4.365869 9.223080 6.223696 + F2 69 2.299062 8.941098 9.720611 + F6 69 5.863415 7.303947 6.675682 + C2A 69 2.923029 6.077483 12.064863 + C4A 69 4.836634 5.794793 10.854521 + C6A 69 6.959893 4.553841 7.729560 + C2 69 2.970325 3.270258 13.808484 + C3 69 -5.353951 3.298367 11.520657 + C6 69 7.231327 1.892960 8.795976 + T3 69 -7.137878 -0.183280 7.045209 + A2 69 6.940012 -3.048743 -1.417376 + C1 69 -2.863441 3.466152 13.622113 + R_mass 69 5.706901 0.819327 -3.385603 + C1P 69 -3.502114 0.733695 14.430470 + C3P 69 -5.453512 0.527465 12.529007 + TCP1 69 -6.526342 0.106628 10.197007 + T3L 69 -6.984420 -0.574596 7.278453 + P1 69 -3.301347 -1.969923 14.072402 + P3 69 -4.944181 -2.327682 12.161263 + P5 69 -5.746031 -2.873293 10.061667 + T5 69 -6.059329 -3.857033 8.011287 + P1P 69 -0.429041 -4.649065 12.834533 + P3P 69 -2.786597 -4.446001 12.518089 + CB1 69 -4.418149 -4.960315 10.050617 + O1 69 -0.811348 -6.894541 10.673660 + PZA 69 -0.340359 1.330175 15.285386 + Pz 69 -0.653197 -2.055649 14.765916 + O2 69 4.360790 -5.900755 9.660142 + C2P 69 2.018138 0.764484 15.349454 + C4P 69 5.338191 0.581931 13.366700 + TCP2 69 7.873487 -0.838266 10.370255 + T4L 69 7.174596 -2.091462 6.837076 + P2 69 2.185051 -1.998135 14.753249 + P4 69 4.495465 -2.549090 13.084474 + P6 69 5.978067 -3.140311 10.577817 + T6 69 6.290988 -3.732049 8.288452 + P2P 69 3.326320 -4.727647 12.027169 + P4P 69 3.714074 -4.843071 11.825611 + PZP 69 1.376477 -4.954117 12.450267 + Oz 69 1.520718 -6.694559 11.328948 + CB2 69 4.597125 -5.644491 9.718284 + EOG 69 -6.061646 4.345318 -2.569613 + R_Or 69 1.977808 2.037790 -8.421231 + REDC 69 20.238485 -8.252245 -48.826134 + LEDC 69 -13.406289 -10.052842 -51.758907 + RFDS 69 16.091854 -10.635201 -47.505543 + RAPB 69 3.023316 -2.488422 -60.407063 + LAPB 69 2.709469 -9.377318 -62.828762 + Centroid 67 0.000000 0.000000 0.000000 + REF. 88 6.672964 -0.000000 0.000000 diff --git a/code/eeglab13_4_4b/sample_data/tutorial_eventtable.txt b/code/eeglab13_4_4b/sample_data/tutorial_eventtable.txt new file mode 100644 index 0000000..d896420 --- /dev/null +++ b/code/eeglab13_4_4b/sample_data/tutorial_eventtable.txt @@ -0,0 +1,101 @@ +Latency Type Position +1 target 1 +2.3047 response 1 +3 target 2 +4.7707 response 2 +5 target 1 +6.5979 response 1 +7 target 1 +8.4367 response 1 +9 target 2 +10.3136 response 2 +11 target 1 +12.7613 response 1 +13 target 2 +14.6907 response 2 +15 target 2 +16.3534 response 2 +17 target 2 +18.5697 response 2 +19 target 1 +20.6131 response 1 +21 target 2 +22.5991 response 2 +23 target 1 +24.5273 response 1 +25 target 1 +26.4222 response 1 +27 target 1 +28.3912 response 1 +29 target 2 +30.4814 response 2 +31 target 1 +32.5853 response 1 +33 target 1 +34.6527 response 1 +35 target 2 +36.4148 response 2 +37 target 1 +38.4608 response 1 +39 target 2 +40.4373 response 2 +41 target 2 +42.5778 response 2 +43 target 2 +44.6871 response 2 +45 target 1 +46.3559 response 1 +47 target 2 +48.6695 response 2 +49 target 1 +50.7648 response 1 +51 target 1 +52.46 response 1 +53 target 1 +54.7444 response 1 +55 target 2 +56.5685 response 2 +57 target 1 +58.3038 response 1 +59 target 1 +60.5293 response 1 +61 target 2 +62.6455 response 2 +63 target 1 +64.4656 response 1 +65 target 2 +66.7404 response 2 +67 target 2 +68.7532 response 2 +69 target 2 +70.6971 response 2 +71 target 1 +72.6612 response 1 +73 target 2 +74.5186 response 2 +75 target 1 +76.6668 response 1 +77 target 1 +78.3139 response 1 +79 target 1 +80.7384 response 1 +81 target 2 +82.785 response 2 +83 target 1 +84.306 response 1 +85 target 1 +86.3696 response 1 +87 target 2 +88.6319 response 2 +89 target 1 +90.6019 response 1 +91 target 2 +92.6735 response 2 +93 target 2 +94.5582 response 2 +95 target 2 +96.3136 response 2 +97 target 1 +98.6383 response 1 +99 target 2 +100.5575 response 2 diff --git a/code/eeglab13_4_4b/sample_locs/1ST_README.txt b/code/eeglab13_4_4b/sample_locs/1ST_README.txt new file mode 100644 index 0000000..67dbadb --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/1ST_README.txt @@ -0,0 +1,19 @@ +This directory contains sample electrode location files for the standard +10-20 and 10-10 Systems in EEGLAB format. Copy these files, +then delete and/or add channels to match your electrode caps. You may +other standard electrode cap location files at the EEGLAB website. +".locs" files contain polar coordiantes. ".ced" files contain electrode +positions in polar, 3-D cartesian and 3-D spherical coordinate frames. + +These files can also be converted to other formats (e.g., BESA, etc.) +using the EEGLAB channel editor: Under Matlab, move to this directory +(folder) and type + + >> pop_chanedit(readlocs('Standard-10-20-Cap81.ced')); + +Then, in the resulting pop-up window, press the button "Save others" +(Note: You may need to start + + >> eeglab + +first to allow Matlab to find the channel editing function). diff --git a/code/eeglab13_4_4b/sample_locs/GSN-HydroCel-257.sfp b/code/eeglab13_4_4b/sample_locs/GSN-HydroCel-257.sfp new file mode 100644 index 0000000..142b564 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN-HydroCel-257.sfp @@ -0,0 +1,257 @@ +E1 6.96223 5.38242 -2.19061 +E2 6.48414 6.40424 -0.14004 +E3 5.69945 7.20796 1.79088 +E4 4.81093 7.77321 3.65006 +E5 3.61962 7.47782 5.50947 +E6 2.25278 6.46157 6.96317 +E7 1.18879 5.21755 8.13378 +E8 0.00000 3.59608 8.75111 +E9 -1.15339 1.51369 9.19904 +E10 5.94022 7.38337 -1.51513 +E11 5.07624 8.37264 0.40595 +E12 3.87946 9.03611 2.51559 +E13 2.60756 8.97868 4.39107 +E14 1.23344 8.11574 6.06161 +E15 0.00000 6.81181 7.28186 +E16 -1.18879 5.21755 8.13378 +E17 -2.29559 2.91372 8.55810 +E18 4.06489 9.40559 -0.89098 +E19 2.86784 10.01456 0.85212 +E20 1.42153 10.06322 2.84803 +E21 0.00000 9.40339 4.65829 +E22 -1.23344 8.11574 6.06161 +E23 -2.25278 6.46157 6.96317 +E24 -3.34467 4.40891 7.67253 +E25 1.39547 10.65281 -0.61138 +E26 0.00000 10.68996 1.00542 +E27 -1.42153 10.06322 2.84803 +E28 -2.60756 8.97868 4.39107 +E29 -3.61962 7.47782 5.50947 +E30 -4.49828 5.59395 6.28801 +E31 0.00000 10.56381 -2.05108 +E32 -1.39547 10.65281 -0.61138 +E33 -2.86784 10.01456 0.85212 +E34 -3.87946 9.03611 2.51559 +E35 -4.81093 7.77321 3.65006 +E36 -5.10466 6.41586 4.77815 +E37 -4.06489 9.40559 -0.89098 +E38 -5.07624 8.37264 0.40595 +E39 -5.69945 7.20796 1.79088 +E40 -6.16984 6.11292 3.29612 +E41 -6.01447 4.93908 4.85771 +E42 -5.33943 3.80220 6.32664 +E43 -4.64127 2.57224 7.50868 +E44 -3.53746 1.07133 8.47419 +E45 -1.99458 -0.60998 9.28870 +E46 -5.94022 7.38337 -1.51513 +E47 -6.48414 6.40424 -0.14004 +E48 -6.97545 5.35131 1.30741 +E49 -7.10064 4.23342 2.91874 +E50 -6.86564 3.16240 4.76800 +E51 -6.11380 1.94213 6.23844 +E52 -5.31389 0.60081 7.48811 +E53 -3.72368 -1.14573 8.58697 +E54 -6.96223 5.38242 -2.19061 +E55 -7.31613 4.37155 -0.61128 +E56 -7.66385 3.29619 1.04415 +E57 -7.62423 2.30205 2.81799 +E58 -7.36570 1.34368 4.60382 +E59 -6.70292 0.06004 6.23992 +E60 -5.40372 -1.61247 7.47343 +E61 -7.54098 3.05323 -2.51935 +E62 -7.77059 2.06323 -0.80729 +E63 -7.96921 1.20744 0.97332 +E64 -8.06621 0.40109 2.78565 +E65 -7.60767 -0.56840 4.59939 +E66 -6.81554 -1.94522 5.93053 +E67 -7.69315 1.74041 -4.18153 +E68 -7.74468 1.05291 -2.47059 +E69 -7.93758 0.07220 -0.96992 +E70 -7.98893 -0.75212 0.84194 +E71 -8.05947 -1.50296 2.76753 +E72 -7.56445 -2.31141 4.30327 +E73 -7.52646 0.73096 -5.96025 +E74 -7.76752 -1.84131 -0.92719 +E75 -7.79279 -2.73175 1.10033 +E76 -7.46191 -3.49308 2.95937 +E77 -6.86934 -3.79448 4.89401 +E78 -5.65276 -3.84604 6.52108 +E79 -4.12465 -3.54800 7.95405 +E80 -2.23647 -2.95809 8.92461 +E81 0.00000 -1.93834 9.45867 +E82 -7.12806 -0.49186 -7.34929 +E83 -7.37920 -3.49709 -2.18347 +E84 -7.52183 -3.70044 -0.51432 +E85 -7.15214 -4.71132 1.51762 +E86 -6.48817 -5.15829 3.47294 +E87 -5.53051 -5.46184 5.50189 +E88 -4.03809 -5.23807 7.04455 +E89 -2.29514 -4.87829 8.27223 +E90 0.00000 -3.74195 9.02791 +E91 -6.82585 -1.86426 -8.69399 +E92 -6.74047 -2.84840 -6.74712 +E93 -6.78379 -4.01784 -5.01755 +E94 -7.03346 -4.45090 -3.54895 +E95 -6.99052 -5.01694 -1.88810 +E96 -6.67571 -5.73608 0.10234 +E97 -5.96851 -6.52864 2.03293 +E98 -5.10822 -6.74936 3.92134 +E99 -3.75216 -6.67734 5.63719 +E100 -2.14874 -6.29190 7.11453 +E101 0.00000 -7.15042 6.95434 +E102 -6.36989 -3.82470 -8.20622 +E103 -6.24349 -4.62250 -6.49623 +E104 -6.09726 -5.61090 -4.67894 +E105 -6.31441 -6.01299 -3.25921 +E106 -5.98418 -6.74733 -1.40314 +E107 -5.23709 -7.57398 0.46627 +E108 -4.29098 -8.11323 2.38442 +E109 -3.24277 -8.15293 4.22025 +E110 -1.73181 -7.63850 5.69360 +E111 -5.63580 -5.80367 -7.74857 +E112 -5.38718 -6.45180 -6.16689 +E113 -5.08285 -7.32643 -4.32109 +E114 -5.27282 -7.46584 -2.87485 +E115 -4.13620 -8.61230 -1.04503 +E116 -3.13323 -9.13629 0.81878 +E117 -1.94503 -9.23415 2.62135 +E118 -1.09312 -8.74110 4.13810 +E119 0.00000 -8.09146 5.34087 +E120 -4.70608 -7.21970 -7.52955 +E121 -4.20415 -7.81153 -5.84368 +E122 -3.62234 -8.59338 -4.04243 +E123 -3.02717 -9.45363 -1.95941 +E124 -2.20152 -9.70916 -0.63755 +E125 -1.01682 -9.71656 0.95467 +E126 0.00000 -9.23206 2.54671 +E127 1.09312 -8.74110 4.13810 +E128 1.73181 -7.63850 5.69360 +E129 2.14874 -6.29190 7.11453 +E130 2.29514 -4.87829 8.27223 +E131 2.23647 -2.95809 8.92461 +E132 1.99458 -0.60998 9.28870 +E133 -3.45625 -8.57317 -6.82654 +E134 -2.71528 -8.94646 -5.55376 +E135 -2.03205 -9.56166 -3.44989 +E136 -0.91885 -9.62744 -2.21054 +E137 0.00000 -9.58535 -0.88629 +E138 1.01682 -9.71656 0.95467 +E139 1.94503 -9.23415 2.62135 +E140 3.24277 -8.15293 4.22025 +E141 3.75216 -6.67734 5.63719 +E142 4.03809 -5.23807 7.04455 +E143 4.12465 -3.54800 7.95405 +E144 3.72368 -1.14573 8.58697 +E145 -1.88533 -9.22031 -6.79889 +E146 -1.06111 -9.53369 -5.45325 +E147 0.00000 -9.48329 -3.84204 +E148 0.91885 -9.62744 -2.21054 +E149 2.20152 -9.70916 -0.63755 +E150 3.13323 -9.13629 0.81878 +E151 4.29098 -8.11323 2.38442 +E152 5.10822 -6.74936 3.92134 +E153 5.53051 -5.46184 5.50189 +E154 5.65276 -3.84604 6.52108 +E155 5.40372 -1.61247 7.47343 +E156 1.06111 -9.53369 -5.45325 +E157 2.03205 -9.56166 -3.44989 +E158 3.02717 -9.45363 -1.95941 +E159 4.13620 -8.61230 -1.04503 +E160 5.23709 -7.57398 0.46627 +E161 5.96851 -6.52864 2.03293 +E162 6.48817 -5.15829 3.47294 +E163 6.86934 -3.79448 4.89401 +E164 6.81554 -1.94522 5.93053 +E165 1.88533 -9.22031 -6.79889 +E166 2.71528 -8.94646 -5.55376 +E167 3.62234 -8.59338 -4.04243 +E168 5.27282 -7.46584 -2.87485 +E169 5.98418 -6.74733 -1.40314 +E170 6.67571 -5.73608 0.10234 +E171 7.15214 -4.71132 1.51762 +E172 7.46191 -3.49308 2.95937 +E173 7.56445 -2.31141 4.30327 +E174 3.45625 -8.57317 -6.82654 +E175 4.20415 -7.81153 -5.84368 +E176 5.08285 -7.32643 -4.32109 +E177 6.31441 -6.01299 -3.25921 +E178 6.99052 -5.01694 -1.88810 +E179 7.52183 -3.70044 -0.51432 +E180 7.79279 -2.73175 1.10033 +E181 8.05947 -1.50296 2.76753 +E182 7.60767 -0.56840 4.59939 +E183 6.70292 0.06004 6.23992 +E184 5.31389 0.60081 7.48811 +E185 3.53746 1.07133 8.47419 +E186 1.15339 1.51369 9.19904 +E187 4.70608 -7.21970 -7.52955 +E188 5.38718 -6.45180 -6.16689 +E189 6.09726 -5.61090 -4.67894 +E190 7.03346 -4.45090 -3.54895 +E191 7.37920 -3.49709 -2.18347 +E192 7.76752 -1.84131 -0.92719 +E193 7.98893 -0.75212 0.84194 +E194 8.06621 0.40109 2.78565 +E195 7.36570 1.34368 4.60382 +E196 6.11380 1.94213 6.23844 +E197 4.64127 2.57224 7.50868 +E198 2.29559 2.91372 8.55810 +E199 5.63580 -5.80367 -7.74857 +E200 6.24349 -4.62250 -6.49623 +E201 6.78379 -4.01784 -5.01755 +E202 7.93758 0.07220 -0.96992 +E203 7.96921 1.20744 0.97332 +E204 7.62423 2.30205 2.81799 +E205 6.86564 3.16240 4.76800 +E206 5.33943 3.80220 6.32664 +E207 3.34467 4.40891 7.67253 +E208 6.36989 -3.82470 -8.20622 +E209 6.74047 -2.84840 -6.74712 +E210 7.74468 1.05291 -2.47059 +E211 7.77059 2.06323 -0.80729 +E212 7.66385 3.29619 1.04415 +E213 7.10064 4.23342 2.91874 +E214 6.01447 4.93908 4.85771 +E215 4.49828 5.59395 6.28801 +E216 6.82585 -1.86426 -8.69399 +E217 7.12806 -0.49186 -7.34929 +E218 7.52646 0.73096 -5.96025 +E219 7.69315 1.74041 -4.18153 +E220 7.54098 3.05323 -2.51935 +E221 7.31613 4.37155 -0.61128 +E222 6.97545 5.35131 1.30741 +E223 6.16984 6.11292 3.29612 +E224 5.10466 6.41586 4.77815 +E225 7.62652 3.24782 -4.40493 +E226 7.24346 4.80120 -4.77214 +E227 7.55603 2.52648 -6.26962 +E228 7.38028 1.35743 -7.84943 +E229 6.86103 -0.14155 -9.14913 +E230 6.74159 5.99080 -5.83258 +E231 7.22458 4.14855 -6.88918 +E232 7.31422 3.19647 -8.44268 +E233 7.09051 1.66694 -9.77213 +E234 5.88750 7.22674 -6.54736 +E235 6.65934 5.64059 -7.65729 +E236 6.75138 4.62427 -9.03070 +E237 6.58044 3.33743 -10.39707 +E238 4.69146 8.22723 -6.78260 +E239 5.81346 6.42065 -8.65026 +E240 6.04363 5.37051 -9.81363 +E241 -4.69146 8.22723 -6.78260 +E242 -5.81346 6.42065 -8.65026 +E243 -6.04363 5.37051 -9.81363 +E244 -5.88750 7.22674 -6.54736 +E245 -6.65934 5.64059 -7.65729 +E246 -6.75138 4.62427 -9.03070 +E247 -6.58044 3.33743 -10.39707 +E248 -6.74159 5.99080 -5.83258 +E249 -7.22458 4.14855 -6.88918 +E250 -7.31422 3.19647 -8.44268 +E251 -7.09051 1.66694 -9.77213 +E252 -7.24346 4.80120 -4.77214 +E253 -7.62652 3.24782 -4.40493 +E254 -7.55603 2.52648 -6.26962 +E255 -7.38028 1.35743 -7.84943 +E256 -6.86103 -0.14155 -9.14913 +Cz 0.00000 0.00000 9.68308 diff --git a/code/eeglab13_4_4b/sample_locs/GSN-HydroCel-32.sfp b/code/eeglab13_4_4b/sample_locs/GSN-HydroCel-32.sfp new file mode 100644 index 0000000..c6becaf --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN-HydroCel-32.sfp @@ -0,0 +1,39 @@ +FidNz 0 9.071585155 -2.359754454 +FidT9 -6.711765 0.040402876 -3.251600355 +FidT10 6.711765 0.040402876 -3.251600355 +E1 -2.695405558 8.884820317 1.088308144 +E2 2.695405558 8.884820317 1.088308144 +E3 -4.459387187 6.021159964 4.365321482 +E4 4.459387187 6.021159964 4.365321482 +E5 -5.47913021 0.284948655 6.38332782 +E6 5.47913021 0.284948655 6.38332782 +E7 -5.831241498 -4.494821698 4.955347697 +E8 5.831241498 -4.494821698 4.955347697 +E9 -2.738838019 -8.607966849 0.239368223 +E10 2.738838019 -8.607966849 0.239368223 +E11 -6.399087198 4.127248875 -0.356852241 +E12 6.399087198 4.127248875 -0.356852241 +E13 -7.304625099 -1.866238006 -0.629182006 +E14 7.304625099 -1.866238006 -0.629182006 +E15 -6.034746843 -5.755782196 0.051843011 +E16 6.034746843 -5.755782196 0.051843011 +E17 0 7.96264703 5.044718001 +E18 0 9.271139705 -2.211516434 +E19 0 -6.676694032 6.465208258 +E20 0 -8.996686498 0.487952047 +E21 -6.518995129 2.417299399 -5.253637073 +E22 6.518995129 2.417299399 -5.253637073 +E23 -6.174969392 -2.458138877 -5.637380998 +E24 6.174969392 -2.458138877 -5.637380998 +E25 -3.784983913 -6.401014415 -5.260040689 +E26 3.784983913 -6.401014415 -5.260040689 +E27 0 9.087440894 1.333345013 +E28 0 3.806770224 7.891304964 +E29 -3.743504949 6.649204911 -6.530243068 +E30 3.743504949 6.649204911 -6.530243068 +E31 -6.118458137 4.523870113 -4.409174427 +E32 6.118458137 4.523870113 -4.409174427 +Cz 0 0 8.899186843 + + + diff --git a/code/eeglab13_4_4b/sample_locs/GSN128.sfp b/code/eeglab13_4_4b/sample_locs/GSN128.sfp new file mode 100644 index 0000000..8647159 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN128.sfp @@ -0,0 +1,131 @@ +FidNz 0.00000 10.0073 -3.56218 +FidT9 -7.02116 -0.268384 -3.70241 +FidT10 7.02116 -0.268385 -3.70241 +E1 5.56273 7.05836 -2.13833 +E2 5.33400 7.94136 0.237100 +E3 4.25700 8.61151 2.77296 +E4 2.68245 8.04222 5.31354 +E5 1.63804 6.33091 7.00984 +E6 0.00000 3.89585 8.14682 +E7 -1.41305 1.74142 8.45875 +E8 4.09179 9.34083 -1.72351 +E9 3.35560 9.82549 0.750687 +E10 2.39622 9.61435 3.51510 +E11 0.00000 8.60698 5.88719 +E12 -1.63804 6.33091 7.00984 +E13 -2.67447 3.66109 7.65927 +E14 1.98400 10.6090 -1.23837 +E15 1.21058 10.6507 1.24742 +E16 0.00000 10.1982 3.52745 +E17 0.00000 10.5352 -2.71023 +E18 -1.21058 10.6507 1.24742 +E19 -2.39622 9.61435 3.51510 +E20 -2.68245 8.04222 5.31354 +E21 -3.73580 5.67672 6.23543 +E22 -1.98400 10.6090 -1.23837 +E23 -3.35560 9.82549 0.750687 +E24 -4.25700 8.61151 2.77296 +E25 -4.72647 6.94583 4.29259 +E26 -4.09179 9.34083 -1.72351 +E27 -5.33400 7.94136 0.237100 +E28 -5.88862 6.37719 2.05983 +E29 -6.08477 4.58172 4.04119 +E30 -5.17735 3.01496 6.17561 +E31 -3.90573 0.976844 7.58964 +E32 -2.28818 -1.22344 8.35468 +E33 -5.56273 7.05836 -2.13833 +E34 -6.28567 5.66018 -0.325478 +E35 -6.93929 3.71219 1.96627 +E36 -6.96513 2.25109 3.83809 +E37 -6.20327 0.279191 5.88833 +E38 -4.74906 -1.83783 7.20099 +E39 -6.56444 4.49436 -3.36122 +E40 -7.18868 2.65809 -0.876653 +E41 -7.57948 1.34926 1.26836 +E42 -7.53633 -0.164728 2.96011 +E43 -6.50984 -2.56096 5.22143 +E44 -6.57111 3.02934 -6.21266 +E45 -7.03162 1.52278 -3.42515 +E46 -7.56327 0.234217 -1.09244 +E47 -7.60231 -1.46741 1.03584 +E48 -7.31578 -2.81422 2.60868 +E49 -6.85902 0.835981 -6.60769 +E50 -7.34918 -2.88101 -1.38637 +E51 -7.07415 -3.97624 0.553357 +E52 -6.50248 -4.94704 3.10276 +E53 -5.07956 -4.82594 5.55724 +E54 -2.51032 -4.19736 7.58563 +E55 0.00000 -3.20127 8.28249 +E56 -6.17315 -3.59608 -6.94128 +E57 -6.90343 -4.02463 -3.54669 +E58 -6.47645 -5.20816 -1.59903 +E59 -5.98530 -6.31619 0.766718 +E60 -4.81515 -6.89084 3.53716 +E61 -2.75579 -6.50084 5.69942 +E62 0.00000 -5.62431 7.10652 +E63 -5.39665 -5.02163 -6.61401 +E64 -5.86075 -6.14775 -3.44080 +E65 -4.91210 -7.52740 -1.54431 +E66 -3.93870 -8.41313 0.986116 +E67 -2.51978 -8.20562 3.54410 +E68 0.00000 -7.23943 5.62067 +E69 -4.02983 -6.94455 -6.30024 +E70 -3.70296 -8.32350 -3.37134 +E71 -2.84669 -9.16834 -1.31470 +E72 -1.99322 -9.32289 1.02896 +E73 0.00000 -8.85649 2.83601 +E74 -2.17486 -8.43156 -6.40705 +E75 -2.09545 -9.09985 -3.99044 +E76 0.00000 -9.70481 -0.946568 +E77 1.99322 -9.32289 1.02896 +E78 2.51978 -8.20562 3.54410 +E79 2.75579 -6.50084 5.69942 +E80 2.51032 -4.19736 7.58563 +E81 2.28818 -1.22344 8.35468 +E82 0.00000 -8.93823 -6.11277 +E83 2.09545 -9.10442 -3.65547 +E84 2.84669 -9.16834 -1.31470 +E85 3.93870 -8.41313 0.986116 +E86 4.81515 -6.89084 3.53716 +E87 5.07956 -4.82594 5.55724 +E88 4.74906 -1.83783 7.20099 +E89 2.17486 -8.43156 -6.40705 +E90 3.70296 -8.32350 -3.37134 +E91 4.91210 -7.52740 -1.54431 +E92 5.98530 -6.31619 0.766718 +E93 6.50248 -4.94704 3.10276 +E94 6.50984 -2.56096 5.22143 +E95 4.02983 -6.94455 -6.30024 +E96 5.86075 -6.14775 -3.44080 +E97 6.47645 -5.20816 -1.59903 +E98 7.07415 -3.97624 0.553357 +E99 7.31578 -2.81422 2.60868 +E100 5.39665 -5.02163 -6.61401 +E101 6.90343 -4.01898 -3.96056 +E102 7.34918 -2.88101 -1.38637 +E103 7.60231 -1.46741 1.03584 +E104 7.53633 -0.553802 2.95480 +E105 6.20327 0.279191 5.88833 +E106 3.90573 0.976844 7.58964 +E107 1.41305 1.74142 8.45875 +E108 6.17315 -3.59608 -6.94128 +E109 7.56327 0.234217 -1.09244 +E110 7.57948 1.34926 1.26836 +E111 6.96513 2.25109 3.83809 +E112 5.17735 3.01496 6.17561 +E113 2.67447 3.66109 7.65927 +E114 6.85902 0.835981 -6.60769 +E115 7.03162 1.52278 -3.42515 +E116 7.18868 2.65809 -0.876653 +E117 6.93929 3.71219 1.96627 +E118 6.08477 4.58172 4.04119 +E119 3.73580 5.67672 6.23543 +E120 6.57111 3.02934 -6.21266 +E121 6.56444 4.49436 -3.36122 +E122 6.28567 5.66018 -0.325478 +E123 5.88862 6.37719 2.05983 +E124 4.72647 6.94583 4.29259 +E125 5.99993 5.54263 -5.73733 +E126 3.34246 7.17773 -8.08502 +E127 -3.34246 7.17773 -8.08502 +E128 -5.99993 5.54263 -5.73733 diff --git a/code/eeglab13_4_4b/sample_locs/GSN129.sfp b/code/eeglab13_4_4b/sample_locs/GSN129.sfp new file mode 100644 index 0000000..4a0a2d7 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN129.sfp @@ -0,0 +1,132 @@ +FidNz 0.00000 10.0073 -3.56218 +FidT9 -7.02116 -0.268384 -3.70241 +FidT10 7.02116 -0.268385 -3.70241 +E1 5.56273 7.05836 -2.13833 +E2 5.33400 7.94136 0.237100 +E3 4.25700 8.61151 2.77296 +E4 2.68245 8.04222 5.31354 +E5 1.63804 6.33091 7.00984 +E6 0.00000 3.89585 8.14682 +E7 -1.41305 1.74142 8.45875 +E8 4.09179 9.34083 -1.72351 +E9 3.35560 9.82549 0.750687 +E10 2.39622 9.61435 3.51510 +E11 0.00000 8.60698 5.88719 +E12 -1.63804 6.33091 7.00984 +E13 -2.67447 3.66109 7.65927 +E14 1.98400 10.6090 -1.23837 +E15 1.21058 10.6507 1.24742 +E16 0.00000 10.1982 3.52745 +E17 0.00000 10.5352 -2.71023 +E18 -1.21058 10.6507 1.24742 +E19 -2.39622 9.61435 3.51510 +E20 -2.68245 8.04222 5.31354 +E21 -3.73580 5.67672 6.23543 +E22 -1.98400 10.6090 -1.23837 +E23 -3.35560 9.82549 0.750687 +E24 -4.25700 8.61151 2.77296 +E25 -4.72647 6.94583 4.29259 +E26 -4.09179 9.34083 -1.72351 +E27 -5.33400 7.94136 0.237100 +E28 -5.88862 6.37719 2.05983 +E29 -6.08477 4.58172 4.04119 +E30 -5.17735 3.01496 6.17561 +E31 -3.90573 0.976844 7.58964 +E32 -2.28818 -1.22344 8.35468 +E33 -5.56273 7.05836 -2.13833 +E34 -6.28567 5.66018 -0.325478 +E35 -6.93929 3.71219 1.96627 +E36 -6.96513 2.25109 3.83809 +E37 -6.20327 0.279191 5.88833 +E38 -4.74906 -1.83783 7.20099 +E39 -6.56444 4.49436 -3.36122 +E40 -7.18868 2.65809 -0.876653 +E41 -7.57948 1.34926 1.26836 +E42 -7.53633 -0.164728 2.96011 +E43 -6.50984 -2.56096 5.22143 +E44 -6.57111 3.02934 -6.21266 +E45 -7.03162 1.52278 -3.42515 +E46 -7.56327 0.234217 -1.09244 +E47 -7.60231 -1.46741 1.03584 +E48 -7.31578 -2.81422 2.60868 +E49 -6.85902 0.835981 -6.60769 +E50 -7.34918 -2.88101 -1.38637 +E51 -7.07415 -3.97624 0.553357 +E52 -6.50248 -4.94704 3.10276 +E53 -5.07956 -4.82594 5.55724 +E54 -2.51032 -4.19736 7.58563 +E55 0.00000 -3.20127 8.28249 +E56 -6.17315 -3.59608 -6.94128 +E57 -6.90343 -4.02463 -3.54669 +E58 -6.47645 -5.20816 -1.59903 +E59 -5.98530 -6.31619 0.766718 +E60 -4.81515 -6.89084 3.53716 +E61 -2.75579 -6.50084 5.69942 +E62 0.00000 -5.62431 7.10652 +E63 -5.39665 -5.02163 -6.61401 +E64 -5.86075 -6.14775 -3.44080 +E65 -4.91210 -7.52740 -1.54431 +E66 -3.93870 -8.41313 0.986116 +E67 -2.51978 -8.20562 3.54410 +E68 0.00000 -7.23943 5.62067 +E69 -4.02983 -6.94455 -6.30024 +E70 -3.70296 -8.32350 -3.37134 +E71 -2.84669 -9.16834 -1.31470 +E72 -1.99322 -9.32289 1.02896 +E73 0.00000 -8.85649 2.83601 +E74 -2.17486 -8.43156 -6.40705 +E75 -2.09545 -9.09985 -3.99044 +E76 0.00000 -9.70481 -0.946568 +E77 1.99322 -9.32289 1.02896 +E78 2.51978 -8.20562 3.54410 +E79 2.75579 -6.50084 5.69942 +E80 2.51032 -4.19736 7.58563 +E81 2.28818 -1.22344 8.35468 +E82 0.00000 -8.93823 -6.11277 +E83 2.09545 -9.10442 -3.65547 +E84 2.84669 -9.16834 -1.31470 +E85 3.93870 -8.41313 0.986116 +E86 4.81515 -6.89084 3.53716 +E87 5.07956 -4.82594 5.55724 +E88 4.74906 -1.83783 7.20099 +E89 2.17486 -8.43156 -6.40705 +E90 3.70296 -8.32350 -3.37134 +E91 4.91210 -7.52740 -1.54431 +E92 5.98530 -6.31619 0.766718 +E93 6.50248 -4.94704 3.10276 +E94 6.50984 -2.56096 5.22143 +E95 4.02983 -6.94455 -6.30024 +E96 5.86075 -6.14775 -3.44080 +E97 6.47645 -5.20816 -1.59903 +E98 7.07415 -3.97624 0.553357 +E99 7.31578 -2.81422 2.60868 +E100 5.39665 -5.02163 -6.61401 +E101 6.90343 -4.01898 -3.96056 +E102 7.34918 -2.88101 -1.38637 +E103 7.60231 -1.46741 1.03584 +E104 7.53633 -0.553802 2.95480 +E105 6.20327 0.279191 5.88833 +E106 3.90573 0.976844 7.58964 +E107 1.41305 1.74142 8.45875 +E108 6.17315 -3.59608 -6.94128 +E109 7.56327 0.234217 -1.09244 +E110 7.57948 1.34926 1.26836 +E111 6.96513 2.25109 3.83809 +E112 5.17735 3.01496 6.17561 +E113 2.67447 3.66109 7.65927 +E114 6.85902 0.835981 -6.60769 +E115 7.03162 1.52278 -3.42515 +E116 7.18868 2.65809 -0.876653 +E117 6.93929 3.71219 1.96627 +E118 6.08477 4.58172 4.04119 +E119 3.73580 5.67672 6.23543 +E120 6.57111 3.02934 -6.21266 +E121 6.56444 4.49436 -3.36122 +E122 6.28567 5.66018 -0.325478 +E123 5.88862 6.37719 2.05983 +E124 4.72647 6.94583 4.29259 +E125 5.99993 5.54263 -5.73733 +E126 3.34246 7.17773 -8.08502 +E127 -3.34246 7.17773 -8.08502 +E128 -5.99993 5.54263 -5.73733 +Cz 0.00000 0.00000 8.53129 diff --git a/code/eeglab13_4_4b/sample_locs/GSN256.sfp b/code/eeglab13_4_4b/sample_locs/GSN256.sfp new file mode 100644 index 0000000..35422fe --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN256.sfp @@ -0,0 +1,259 @@ +FidNz 0.00000 10.7078 -2.23364 +FidT9 -6.93522 0.197600 -3.70686 +FidT10 6.93522 0.197599 -3.70686 +E1 5.75790 6.62432 -1.53854 +E2 5.52174 7.30351 0.694727 +E3 4.95349 7.94930 2.56738 +E4 3.85574 8.54117 3.99289 +E5 2.71961 7.72178 6.00262 +E6 1.92314 6.72239 7.15184 +E7 1.25910 5.30906 8.01133 +E8 0.00000 3.65242 8.59563 +E9 -1.27938 1.38207 8.83781 +E10 4.33076 9.10489 -0.456432 +E11 3.71990 9.45601 1.36974 +E12 2.90818 9.80075 2.98281 +E13 1.79771 9.48181 4.59757 +E14 1.22587 8.24023 6.41240 +E15 0.00000 6.83756 7.55893 +E16 -1.25910 5.30906 8.01133 +E17 -1.95277 2.97498 8.31184 +E18 2.67867 10.3805 -0.0708818 +E19 1.77016 10.4704 1.52597 +E20 1.00632 10.4147 3.22706 +E21 0.00000 9.70113 5.05936 +E22 -1.22587 8.24023 6.41240 +E23 -1.92314 6.72239 7.15184 +E24 -2.88633 4.65900 7.53095 +E25 0.898575 10.9643 -0.127806 +E26 -1.00632 10.4147 3.22706 +E27 -1.79771 9.48181 4.59757 +E28 -2.71961 7.72178 6.00262 +E29 -3.62712 6.13348 6.42186 +E30 0.00000 10.6438 -1.81009 +E31 -0.898575 10.9643 -0.127806 +E32 -1.77016 10.4704 1.52597 +E33 -2.90818 9.80075 2.98281 +E34 -3.85574 8.54117 3.99289 +E35 -4.07060 7.21250 5.11643 +E36 -2.67867 10.3805 -0.0708818 +E37 -3.71990 9.45601 1.36974 +E38 -4.95349 7.94930 2.56738 +E39 -5.25861 6.86154 3.64378 +E40 -5.25689 5.40776 5.06291 +E41 -4.72603 4.06397 6.49209 +E42 -3.74965 2.61469 7.53390 +E43 -2.87131 0.831389 8.28815 +E44 -1.90213 -0.759280 8.69498 +E45 -4.33076 9.10489 -0.456432 +E46 -5.52174 7.30351 0.694727 +E47 -6.02820 6.13210 1.91938 +E48 -6.31200 4.75572 3.38583 +E49 -6.12044 3.26214 5.00780 +E50 -5.57852 1.87022 6.25549 +E51 -4.63946 0.258372 7.33882 +E52 -3.42838 -1.27134 8.08914 +E53 -5.75790 6.62432 -1.53854 +E54 -6.36271 5.27478 0.164284 +E55 -6.78901 4.08492 1.40691 +E56 -7.04518 2.54581 2.94754 +E57 -6.75706 1.25264 4.56985 +E58 -6.44532 -0.0694811 5.58243 +E59 -5.19342 -1.63703 6.99357 +E60 -6.57224 4.35910 -1.80338 +E61 -7.00281 3.09259 -0.148059 +E62 -7.35939 1.89135 1.10228 +E63 -7.47446 0.552676 2.55808 +E64 -7.21629 -1.13867 4.08258 +E65 -6.60933 -2.25159 5.32786 +E66 -6.90761 2.72130 -3.87155 +E67 -7.03205 1.69512 -2.07023 +E68 -7.39816 0.486697 -0.419844 +E69 -7.69904 -0.963886 0.996840 +E70 -7.49455 -1.90576 2.43981 +E71 -7.17268 -2.71354 3.48190 +E72 -6.53038 1.34611 -6.19274 +E73 -7.50334 -1.83444 -0.353166 +E74 -7.34131 -3.05263 0.725688 +E75 -7.05095 -4.02598 2.25103 +E76 -6.47072 -4.31379 4.35851 +E77 -5.43994 -4.21068 6.07138 +E78 -3.71250 -3.69419 7.54817 +E79 -2.07885 -3.01495 8.40273 +E80 0.00000 -2.35814 8.81349 +E81 -6.26831 0.425343 -7.95707 +E82 -7.24073 -3.13627 -2.18818 +E83 -7.03505 -3.94507 -0.825989 +E84 -6.78840 -4.87309 0.842564 +E85 -6.19129 -5.84623 2.64445 +E86 -5.24315 -6.18197 4.61339 +E87 -4.00975 -5.93756 6.01370 +E88 -2.15155 -5.22992 7.40642 +E89 0.00000 -4.28973 8.20648 +E90 -5.93170 -0.326612 -9.25207 +E91 -6.16243 -1.50709 -7.97157 +E92 -6.63032 -2.88778 -5.78296 +E93 -6.71597 -4.08433 -4.31242 +E94 -6.59524 -5.04495 -2.59194 +E95 -6.16011 -6.13035 -0.660797 +E96 -5.59034 -7.05503 0.665566 +E97 -5.01497 -7.31906 2.90869 +E98 -3.55593 -7.44472 4.47981 +E99 -2.00737 -7.02777 5.86462 +E100 0.00000 -6.27852 6.81554 +E101 -5.40912 -1.55133 -10.9424 +E102 -5.66028 -2.67606 -9.18007 +E103 -5.60464 -3.59070 -7.58251 +E104 -5.81044 -4.57212 -6.05619 +E105 -5.96798 -5.71059 -4.29892 +E106 -5.65113 -6.80705 -2.43987 +E107 -4.84519 -7.87060 -0.720284 +E108 -3.91097 -8.54609 1.03933 +E109 -2.96459 -8.61861 2.74870 +E110 -1.46882 -8.23756 4.26985 +E111 0.00000 -7.72692 5.23884 +E112 -4.57738 -4.25921 -9.42499 +E113 -4.51575 -5.06660 -7.72097 +E114 -4.61298 -6.17683 -6.17752 +E115 -4.53958 -7.41821 -4.39725 +E116 -3.86894 -8.58666 -2.35023 +E117 -3.09048 -9.23476 -0.533743 +E118 -1.75042 -9.47414 1.07781 +E119 -0.964285 -9.16409 2.32552 +E120 0.00000 -8.61961 3.79683 +E121 -3.47042 -5.89857 -9.20197 +E122 -3.55763 -6.39016 -7.50694 +E123 -3.35280 -7.54959 -6.05863 +E124 -2.62691 -8.49471 -4.75557 +E125 -2.01785 -9.41827 -2.52632 +E126 -0.958566 -9.88857 -0.741855 +E127 0.00000 -9.73794 0.766790 +E128 0.964285 -9.16409 2.32552 +E129 1.46882 -8.23756 4.26985 +E130 2.00737 -7.02777 5.86462 +E131 2.15155 -5.22992 7.40642 +E132 2.07885 -3.01495 8.40273 +E133 1.90213 -0.759280 8.69498 +E134 -2.56859 -6.67651 -9.20561 +E135 -2.11945 -7.38543 -7.66441 +E136 -1.57294 -8.15509 -6.24421 +E137 -1.05855 -9.10944 -4.46274 +E138 0.00000 -9.71661 -2.71232 +E139 0.958566 -9.88857 -0.741855 +E140 1.75042 -9.47414 1.07781 +E141 2.96459 -8.61861 2.74870 +E142 3.55593 -7.44472 4.47981 +E143 4.00975 -5.93756 6.01370 +E144 3.71250 -3.69419 7.54817 +E145 3.42838 -1.27134 8.08914 +E146 -1.23669 -7.65431 -9.15612 +E147 -0.758553 -7.90446 -7.62359 +E148 0.00000 -8.34512 -6.12448 +E149 1.05855 -9.10944 -4.46274 +E150 2.01785 -9.41827 -2.52632 +E151 3.09048 -9.23476 -0.533743 +E152 3.91097 -8.54609 1.03933 +E153 5.01497 -7.31906 2.90869 +E154 5.24315 -6.18197 4.61339 +E155 5.43994 -4.21068 6.07138 +E156 5.19342 -1.63703 6.99357 +E157 0.758553 -7.90446 -7.62359 +E158 1.57294 -8.15509 -6.24421 +E159 2.62691 -8.49471 -4.75557 +E160 3.86894 -8.58666 -2.35023 +E161 4.84519 -7.87060 -0.720284 +E162 5.59034 -7.05503 0.665566 +E163 6.19129 -5.84623 2.64445 +E164 6.47072 -4.31379 4.35851 +E165 6.60933 -2.25159 5.32786 +E166 1.23669 -7.65431 -9.15612 +E167 2.11945 -7.38543 -7.66441 +E168 3.35280 -7.54959 -6.05863 +E169 4.53958 -7.41821 -4.39725 +E170 5.65113 -6.80705 -2.43987 +E171 6.16011 -6.13035 -0.660797 +E172 6.78840 -4.87309 0.842564 +E173 7.05095 -4.02598 2.25103 +E174 7.17268 -2.71354 3.48190 +E175 2.56859 -6.67651 -9.20561 +E176 3.55763 -6.39016 -7.50694 +E177 4.61298 -6.17683 -6.17752 +E178 5.96798 -5.71059 -4.29892 +E179 6.59524 -5.04495 -2.59194 +E180 7.03505 -3.94507 -0.825989 +E181 7.34131 -3.05263 0.725688 +E182 7.49455 -1.90576 2.43981 +E183 7.21629 -0.659263 4.14978 +E184 6.44532 -0.0694811 5.58243 +E185 4.63946 0.258372 7.33882 +E186 2.87131 0.831389 8.28815 +E187 1.27938 1.38207 8.83781 +E188 3.47042 -5.89857 -9.20197 +E189 4.51575 -5.06660 -7.72097 +E190 5.81044 -4.57212 -6.05619 +E191 6.71597 -4.08433 -4.31242 +E192 7.24073 -3.13627 -2.18818 +E193 7.50334 -1.83444 -0.353166 +E194 7.69904 0.0210864 1.13490 +E195 7.47446 0.552676 2.55808 +E196 6.75706 1.25264 4.56985 +E197 5.57852 1.87022 6.25549 +E198 3.74965 2.61469 7.53390 +E199 1.95277 2.97498 8.31184 +E200 4.57738 -4.25921 -9.42499 +E201 5.60464 -3.59070 -7.58251 +E202 6.63032 -2.88778 -5.78296 +E203 7.39816 0.486697 -0.419844 +E204 7.35939 1.89135 1.10228 +E205 7.04518 2.54581 2.94754 +E206 6.12044 3.26214 5.00780 +E207 4.72603 4.06397 6.49209 +E208 2.88633 4.65900 7.53095 +E209 5.66028 -2.67606 -9.18007 +E210 6.16243 -1.50709 -7.97157 +E211 7.03205 1.69512 -2.07023 +E212 7.00281 3.09259 -0.148059 +E213 6.78901 4.08492 1.40691 +E214 6.31200 4.75572 3.38583 +E215 5.25689 5.40776 5.06291 +E216 3.62712 6.13348 6.42186 +E217 5.40912 -1.55133 -10.9424 +E218 5.93170 -0.326612 -9.25207 +E219 6.26831 0.425343 -7.95707 +E220 6.53038 1.34611 -6.19274 +E221 6.90761 2.72130 -3.87155 +E222 6.57224 4.35910 -1.80338 +E223 6.36271 5.27478 0.164284 +E224 6.02820 6.13210 1.91938 +E225 5.25861 6.86154 3.64378 +E226 4.07060 7.21250 5.11643 +E227 6.06869 5.71823 -3.21657 +E228 6.52883 4.49674 -4.69960 +E229 6.44900 2.92003 -6.04545 +E230 6.16935 2.08181 -7.92954 +E231 5.81164 1.30701 -9.31030 +E232 5.08583 0.121009 -11.0429 +E233 5.73569 5.71538 -6.44150 +E234 6.03905 4.24157 -7.44683 +E235 5.93203 3.07676 -8.95744 +E236 5.32716 1.97640 -10.6333 +E237 5.12817 2.76425 -8.72939 +E238 5.31962 6.19299 -7.56377 +E239 5.46165 5.03876 -8.74178 +E240 5.34669 4.04690 -10.1039 +E241 3.25991 8.37938 -6.92283 +E242 -3.25991 8.37938 -6.92283 +E243 -5.12817 2.76425 -8.72939 +E244 -5.31962 6.19299 -7.56377 +E245 -5.46165 5.03876 -8.74178 +E246 -5.34669 4.04690 -10.1039 +E247 -5.73569 5.71538 -6.44150 +E248 -6.03905 4.24157 -7.44683 +E249 -5.93203 3.07676 -8.95744 +E250 -5.32716 1.97640 -10.6333 +E251 -6.06869 5.71823 -3.21657 +E252 -6.52883 4.49674 -4.69960 +E253 -6.44900 2.92003 -6.04545 +E254 -6.16935 2.08181 -7.92954 +E255 -5.81164 1.30701 -9.31030 +E256 -5.08583 0.121009 -11.0429 diff --git a/code/eeglab13_4_4b/sample_locs/GSN257.sfp b/code/eeglab13_4_4b/sample_locs/GSN257.sfp new file mode 100644 index 0000000..47773e6 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN257.sfp @@ -0,0 +1,260 @@ +FidNz 0.00000 10.7078 -2.23364 +FidT9 -6.93522 0.197600 -3.70686 +FidT10 6.93522 0.197599 -3.70686 +E1 5.75790 6.62432 -1.53854 +E2 5.52174 7.30351 0.694727 +E3 4.95349 7.94930 2.56738 +E4 3.85574 8.54117 3.99289 +E5 2.71961 7.72178 6.00262 +E6 1.92314 6.72239 7.15184 +E7 1.25910 5.30906 8.01133 +E8 0.00000 3.65242 8.59563 +E9 -1.27938 1.38207 8.83781 +E10 4.33076 9.10489 -0.456432 +E11 3.71990 9.45601 1.36974 +E12 2.90818 9.80075 2.98281 +E13 1.79771 9.48181 4.59757 +E14 1.22587 8.24023 6.41240 +E15 0.00000 6.83756 7.55893 +E16 -1.25910 5.30906 8.01133 +E17 -1.95277 2.97498 8.31184 +E18 2.67867 10.3805 -0.0708818 +E19 1.77016 10.4704 1.52597 +E20 1.00632 10.4147 3.22706 +E21 0.00000 9.70113 5.05936 +E22 -1.22587 8.24023 6.41240 +E23 -1.92314 6.72239 7.15184 +E24 -2.88633 4.65900 7.53095 +E25 0.898575 10.9643 -0.127806 +E26 -1.00632 10.4147 3.22706 +E27 -1.79771 9.48181 4.59757 +E28 -2.71961 7.72178 6.00262 +E29 -3.62712 6.13348 6.42186 +E30 0.00000 10.6438 -1.81009 +E31 -0.898575 10.9643 -0.127806 +E32 -1.77016 10.4704 1.52597 +E33 -2.90818 9.80075 2.98281 +E34 -3.85574 8.54117 3.99289 +E35 -4.07060 7.21250 5.11643 +E36 -2.67867 10.3805 -0.0708818 +E37 -3.71990 9.45601 1.36974 +E38 -4.95349 7.94930 2.56738 +E39 -5.25861 6.86154 3.64378 +E40 -5.25689 5.40776 5.06291 +E41 -4.72603 4.06397 6.49209 +E42 -3.74965 2.61469 7.53390 +E43 -2.87131 0.831389 8.28815 +E44 -1.90213 -0.759280 8.69498 +E45 -4.33076 9.10489 -0.456432 +E46 -5.52174 7.30351 0.694727 +E47 -6.02820 6.13210 1.91938 +E48 -6.31200 4.75572 3.38583 +E49 -6.12044 3.26214 5.00780 +E50 -5.57852 1.87022 6.25549 +E51 -4.63946 0.258372 7.33882 +E52 -3.42838 -1.27134 8.08914 +E53 -5.75790 6.62432 -1.53854 +E54 -6.36271 5.27478 0.164284 +E55 -6.78901 4.08492 1.40691 +E56 -7.04518 2.54581 2.94754 +E57 -6.75706 1.25264 4.56985 +E58 -6.44532 -0.0694811 5.58243 +E59 -5.19342 -1.63703 6.99357 +E60 -6.57224 4.35910 -1.80338 +E61 -7.00281 3.09259 -0.148059 +E62 -7.35939 1.89135 1.10228 +E63 -7.47446 0.552676 2.55808 +E64 -7.21629 -1.13867 4.08258 +E65 -6.60933 -2.25159 5.32786 +E66 -6.90761 2.72130 -3.87155 +E67 -7.03205 1.69512 -2.07023 +E68 -7.39816 0.486697 -0.419844 +E69 -7.69904 -0.963886 0.996840 +E70 -7.49455 -1.90576 2.43981 +E71 -7.17268 -2.71354 3.48190 +E72 -6.53038 1.34611 -6.19274 +E73 -7.50334 -1.83444 -0.353166 +E74 -7.34131 -3.05263 0.725688 +E75 -7.05095 -4.02598 2.25103 +E76 -6.47072 -4.31379 4.35851 +E77 -5.43994 -4.21068 6.07138 +E78 -3.71250 -3.69419 7.54817 +E79 -2.07885 -3.01495 8.40273 +E80 0.00000 -2.35814 8.81349 +E81 -6.26831 0.425343 -7.95707 +E82 -7.24073 -3.13627 -2.18818 +E83 -7.03505 -3.94507 -0.825989 +E84 -6.78840 -4.87309 0.842564 +E85 -6.19129 -5.84623 2.64445 +E86 -5.24315 -6.18197 4.61339 +E87 -4.00975 -5.93756 6.01370 +E88 -2.15155 -5.22992 7.40642 +E89 0.00000 -4.28973 8.20648 +E90 -5.93170 -0.326612 -9.25207 +E91 -6.16243 -1.50709 -7.97157 +E92 -6.63032 -2.88778 -5.78296 +E93 -6.71597 -4.08433 -4.31242 +E94 -6.59524 -5.04495 -2.59194 +E95 -6.16011 -6.13035 -0.660797 +E96 -5.59034 -7.05503 0.665566 +E97 -5.01497 -7.31906 2.90869 +E98 -3.55593 -7.44472 4.47981 +E99 -2.00737 -7.02777 5.86462 +E100 0.00000 -6.27852 6.81554 +E101 -5.40912 -1.55133 -10.9424 +E102 -5.66028 -2.67606 -9.18007 +E103 -5.60464 -3.59070 -7.58251 +E104 -5.81044 -4.57212 -6.05619 +E105 -5.96798 -5.71059 -4.29892 +E106 -5.65113 -6.80705 -2.43987 +E107 -4.84519 -7.87060 -0.720284 +E108 -3.91097 -8.54609 1.03933 +E109 -2.96459 -8.61861 2.74870 +E110 -1.46882 -8.23756 4.26985 +E111 0.00000 -7.72692 5.23884 +E112 -4.57738 -4.25921 -9.42499 +E113 -4.51575 -5.06660 -7.72097 +E114 -4.61298 -6.17683 -6.17752 +E115 -4.53958 -7.41821 -4.39725 +E116 -3.86894 -8.58666 -2.35023 +E117 -3.09048 -9.23476 -0.533743 +E118 -1.75042 -9.47414 1.07781 +E119 -0.964285 -9.16409 2.32552 +E120 0.00000 -8.61961 3.79683 +E121 -3.47042 -5.89857 -9.20197 +E122 -3.55763 -6.39016 -7.50694 +E123 -3.35280 -7.54959 -6.05863 +E124 -2.62691 -8.49471 -4.75557 +E125 -2.01785 -9.41827 -2.52632 +E126 -0.958566 -9.88857 -0.741855 +E127 0.00000 -9.73794 0.766790 +E128 0.964285 -9.16409 2.32552 +E129 1.46882 -8.23756 4.26985 +E130 2.00737 -7.02777 5.86462 +E131 2.15155 -5.22992 7.40642 +E132 2.07885 -3.01495 8.40273 +E133 1.90213 -0.759280 8.69498 +E134 -2.56859 -6.67651 -9.20561 +E135 -2.11945 -7.38543 -7.66441 +E136 -1.57294 -8.15509 -6.24421 +E137 -1.05855 -9.10944 -4.46274 +E138 0.00000 -9.71661 -2.71232 +E139 0.958566 -9.88857 -0.741855 +E140 1.75042 -9.47414 1.07781 +E141 2.96459 -8.61861 2.74870 +E142 3.55593 -7.44472 4.47981 +E143 4.00975 -5.93756 6.01370 +E144 3.71250 -3.69419 7.54817 +E145 3.42838 -1.27134 8.08914 +E146 -1.23669 -7.65431 -9.15612 +E147 -0.758553 -7.90446 -7.62359 +E148 0.00000 -8.34512 -6.12448 +E149 1.05855 -9.10944 -4.46274 +E150 2.01785 -9.41827 -2.52632 +E151 3.09048 -9.23476 -0.533743 +E152 3.91097 -8.54609 1.03933 +E153 5.01497 -7.31906 2.90869 +E154 5.24315 -6.18197 4.61339 +E155 5.43994 -4.21068 6.07138 +E156 5.19342 -1.63703 6.99357 +E157 0.758553 -7.90446 -7.62359 +E158 1.57294 -8.15509 -6.24421 +E159 2.62691 -8.49471 -4.75557 +E160 3.86894 -8.58666 -2.35023 +E161 4.84519 -7.87060 -0.720284 +E162 5.59034 -7.05503 0.665566 +E163 6.19129 -5.84623 2.64445 +E164 6.47072 -4.31379 4.35851 +E165 6.60933 -2.25159 5.32786 +E166 1.23669 -7.65431 -9.15612 +E167 2.11945 -7.38543 -7.66441 +E168 3.35280 -7.54959 -6.05863 +E169 4.53958 -7.41821 -4.39725 +E170 5.65113 -6.80705 -2.43987 +E171 6.16011 -6.13035 -0.660797 +E172 6.78840 -4.87309 0.842564 +E173 7.05095 -4.02598 2.25103 +E174 7.17268 -2.71354 3.48190 +E175 2.56859 -6.67651 -9.20561 +E176 3.55763 -6.39016 -7.50694 +E177 4.61298 -6.17683 -6.17752 +E178 5.96798 -5.71059 -4.29892 +E179 6.59524 -5.04495 -2.59194 +E180 7.03505 -3.94507 -0.825989 +E181 7.34131 -3.05263 0.725688 +E182 7.49455 -1.90576 2.43981 +E183 7.21629 -0.659263 4.14978 +E184 6.44532 -0.0694811 5.58243 +E185 4.63946 0.258372 7.33882 +E186 2.87131 0.831389 8.28815 +E187 1.27938 1.38207 8.83781 +E188 3.47042 -5.89857 -9.20197 +E189 4.51575 -5.06660 -7.72097 +E190 5.81044 -4.57212 -6.05619 +E191 6.71597 -4.08433 -4.31242 +E192 7.24073 -3.13627 -2.18818 +E193 7.50334 -1.83444 -0.353166 +E194 7.69904 0.0210864 1.13490 +E195 7.47446 0.552676 2.55808 +E196 6.75706 1.25264 4.56985 +E197 5.57852 1.87022 6.25549 +E198 3.74965 2.61469 7.53390 +E199 1.95277 2.97498 8.31184 +E200 4.57738 -4.25921 -9.42499 +E201 5.60464 -3.59070 -7.58251 +E202 6.63032 -2.88778 -5.78296 +E203 7.39816 0.486697 -0.419844 +E204 7.35939 1.89135 1.10228 +E205 7.04518 2.54581 2.94754 +E206 6.12044 3.26214 5.00780 +E207 4.72603 4.06397 6.49209 +E208 2.88633 4.65900 7.53095 +E209 5.66028 -2.67606 -9.18007 +E210 6.16243 -1.50709 -7.97157 +E211 7.03205 1.69512 -2.07023 +E212 7.00281 3.09259 -0.148059 +E213 6.78901 4.08492 1.40691 +E214 6.31200 4.75572 3.38583 +E215 5.25689 5.40776 5.06291 +E216 3.62712 6.13348 6.42186 +E217 5.40912 -1.55133 -10.9424 +E218 5.93170 -0.326612 -9.25207 +E219 6.26831 0.425343 -7.95707 +E220 6.53038 1.34611 -6.19274 +E221 6.90761 2.72130 -3.87155 +E222 6.57224 4.35910 -1.80338 +E223 6.36271 5.27478 0.164284 +E224 6.02820 6.13210 1.91938 +E225 5.25861 6.86154 3.64378 +E226 4.07060 7.21250 5.11643 +E227 6.06869 5.71823 -3.21657 +E228 6.52883 4.49674 -4.69960 +E229 6.44900 2.92003 -6.04545 +E230 6.16935 2.08181 -7.92954 +E231 5.81164 1.30701 -9.31030 +E232 5.08583 0.121009 -11.0429 +E233 5.73569 5.71538 -6.44150 +E234 6.03905 4.24157 -7.44683 +E235 5.93203 3.07676 -8.95744 +E236 5.32716 1.97640 -10.6333 +E237 5.12817 2.76425 -8.72939 +E238 5.31962 6.19299 -7.56377 +E239 5.46165 5.03876 -8.74178 +E240 5.34669 4.04690 -10.1039 +E241 3.25991 8.37938 -6.92283 +E242 -3.25991 8.37938 -6.92283 +E243 -5.12817 2.76425 -8.72939 +E244 -5.31962 6.19299 -7.56377 +E245 -5.46165 5.03876 -8.74178 +E246 -5.34669 4.04690 -10.1039 +E247 -5.73569 5.71538 -6.44150 +E248 -6.03905 4.24157 -7.44683 +E249 -5.93203 3.07676 -8.95744 +E250 -5.32716 1.97640 -10.6333 +E251 -6.06869 5.71823 -3.21657 +E252 -6.52883 4.49674 -4.69960 +E253 -6.44900 2.92003 -6.04545 +E254 -6.16935 2.08181 -7.92954 +E255 -5.81164 1.30701 -9.31030 +E256 -5.08583 0.121009 -11.0429 +Cz 0.00000 0.00000 8.95379 diff --git a/code/eeglab13_4_4b/sample_locs/GSN64v2_0.sfp b/code/eeglab13_4_4b/sample_locs/GSN64v2_0.sfp new file mode 100644 index 0000000..9d0e313 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN64v2_0.sfp @@ -0,0 +1,67 @@ +FidNz 0.00000 10.3855 -1.81526 +FidT9 -7.00399 0.368267 -3.69381 +FidT10 7.00399 0.368267 -3.69381 +E1 4.82147 8.46376 -0.0639843 +E2 3.44999 9.06441 2.97064 +E3 1.90275 7.64198 6.40285 +E4 0.00000 5.21914 8.19540 +E5 -1.72628 2.48578 8.55637 +E6 1.59679 10.5184 0.515771 +E7 0.00000 9.90900 4.03918 +E8 -1.90275 7.64198 6.40285 +E9 -3.44910 4.88753 7.22782 +E10 0.00000 10.2056 -1.61817 +E11 -1.59679 10.5184 0.515771 +E12 -3.44999 9.06441 2.97064 +E13 -4.77336 6.69969 4.57236 +E14 -4.82147 8.46376 -0.0639843 +E15 -6.08393 6.13847 1.57273 +E16 -6.30320 3.70148 4.22719 +E17 -5.28740 1.30272 6.65006 +E18 -2.89239 -1.49571 8.18118 +E19 -6.49644 4.76669 -1.91820 +E20 -7.25734 2.59912 0.903444 +E21 -7.34336 0.287481 3.19674 +E22 -5.94121 -2.42769 5.97948 +E23 -6.70321 2.34743 -5.19168 +E24 -7.64626 -1.18501 0.271229 +E25 -7.24521 -2.89502 2.68804 +E26 -7.06353 -3.24230 -2.70838 +E27 -6.78539 -4.61900 -0.234471 +E28 -5.98166 -5.75781 2.97462 +E29 -3.38310 -5.87378 6.25655 +E30 0.00000 -4.05271 8.13937 +E31 -5.64139 -6.07135 -3.51430 +E32 -4.88083 -7.67925 -0.352208 +E33 -3.16769 -8.12261 3.13635 +E34 0.00000 -7.14834 5.87509 +E35 -4.27348 -6.69422 -6.35512 +E36 -3.08195 -8.59131 -3.53248 +E37 -1.79973 -9.42935 -0.256676 +E38 0.00000 -8.99684 2.56482 +E39 0.00000 -9.12413 -3.87835 +E40 1.79973 -9.42935 -0.256676 +E41 3.16769 -8.12261 3.13635 +E42 3.38310 -5.87378 6.25655 +E43 2.89239 -1.49571 8.18118 +E44 3.08195 -8.59131 -3.53248 +E45 4.88083 -7.67925 -0.352208 +E46 5.98166 -5.75781 2.97462 +E47 5.94121 -2.42769 5.97948 +E48 5.64139 -6.07135 -3.51430 +E49 6.78539 -4.61900 -0.234471 +E50 7.24521 -2.89502 2.68804 +E51 7.06353 -3.24230 -2.70838 +E52 7.64626 -1.18501 0.271229 +E53 7.34336 0.287481 3.19674 +E54 5.28740 1.30272 6.65006 +E55 1.72628 2.48578 8.55637 +E56 7.25734 2.59912 0.903444 +E57 6.30320 3.70148 4.22719 +E58 3.44910 4.88753 7.22782 +E59 6.70321 2.34743 -5.19168 +E60 6.49644 4.76669 -1.91820 +E61 6.08393 6.13847 1.57273 +E62 4.77336 6.69969 4.57236 +E63 3.82315 7.90175 -7.06073 +E64 -3.82315 7.90175 -7.06073 diff --git a/code/eeglab13_4_4b/sample_locs/GSN65v2_0.sfp b/code/eeglab13_4_4b/sample_locs/GSN65v2_0.sfp new file mode 100644 index 0000000..fa8e6ba --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/GSN65v2_0.sfp @@ -0,0 +1,68 @@ +FidNz 0.00000 10.3855 -1.81526 +FidT9 -7.00399 0.368267 -3.69381 +FidT10 7.00399 0.368267 -3.69381 +E1 4.82147 8.46376 -0.0639843 +E2 3.44999 9.06441 2.97064 +E3 1.90275 7.64198 6.40285 +E4 0.00000 5.21914 8.19540 +E5 -1.72628 2.48578 8.55637 +E6 1.59679 10.5184 0.515771 +E7 0.00000 9.90900 4.03918 +E8 -1.90275 7.64198 6.40285 +E9 -3.44910 4.88753 7.22782 +E10 0.00000 10.2056 -1.61817 +E11 -1.59679 10.5184 0.515771 +E12 -3.44999 9.06441 2.97064 +E13 -4.77336 6.69969 4.57236 +E14 -4.82147 8.46376 -0.0639843 +E15 -6.08393 6.13847 1.57273 +E16 -6.30320 3.70148 4.22719 +E17 -5.28740 1.30272 6.65006 +E18 -2.89239 -1.49571 8.18118 +E19 -6.49644 4.76669 -1.91820 +E20 -7.25734 2.59912 0.903444 +E21 -7.34336 0.287481 3.19674 +E22 -5.94121 -2.42769 5.97948 +E23 -6.70321 2.34743 -5.19168 +E24 -7.64626 -1.18501 0.271229 +E25 -7.24521 -2.89502 2.68804 +E26 -7.06353 -3.24230 -2.70838 +E27 -6.78539 -4.61900 -0.234471 +E28 -5.98166 -5.75781 2.97462 +E29 -3.38310 -5.87378 6.25655 +E30 0.00000 -4.05271 8.13937 +E31 -5.64139 -6.07135 -3.51430 +E32 -4.88083 -7.67925 -0.352208 +E33 -3.16769 -8.12261 3.13635 +E34 0.00000 -7.14834 5.87509 +E35 -4.27348 -6.69422 -6.35512 +E36 -3.08195 -8.59131 -3.53248 +E37 -1.79973 -9.42935 -0.256676 +E38 0.00000 -8.99684 2.56482 +E39 0.00000 -9.12413 -3.87835 +E40 1.79973 -9.42935 -0.256676 +E41 3.16769 -8.12261 3.13635 +E42 3.38310 -5.87378 6.25655 +E43 2.89239 -1.49571 8.18118 +E44 3.08195 -8.59131 -3.53248 +E45 4.88083 -7.67925 -0.352208 +E46 5.98166 -5.75781 2.97462 +E47 5.94121 -2.42769 5.97948 +E48 5.64139 -6.07135 -3.51430 +E49 6.78539 -4.61900 -0.234471 +E50 7.24521 -2.89502 2.68804 +E51 7.06353 -3.24230 -2.70838 +E52 7.64626 -1.18501 0.271229 +E53 7.34336 0.287481 3.19674 +E54 5.28740 1.30272 6.65006 +E55 1.72628 2.48578 8.55637 +E56 7.25734 2.59912 0.903444 +E57 6.30320 3.70148 4.22719 +E58 3.44910 4.88753 7.22782 +E59 6.70321 2.34743 -5.19168 +E60 6.49644 4.76669 -1.91820 +E61 6.08393 6.13847 1.57273 +E62 4.77336 6.69969 4.57236 +E63 3.82315 7.90175 -7.06073 +E64 -3.82315 7.90175 -7.06073 +Cz 0.00000 0.00000 8.94282 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap33.ced b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap33.ced new file mode 100644 index 0000000..8c64314 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap33.ced @@ -0,0 +1,34 @@ +Number labels theta radius X Y Z sph_theta sph_phi sph_radius +1 Fp1 -18 0.511 0.95 0.309 -0.0349 18 -2 1 +2 Fp2 18 0.511 0.95 -0.309 -0.0349 -18 -2 1 +3 F9 -55 0.639 0.52 0.742 -0.423 55 -25 1 +4 F7 -54 0.511 0.587 0.809 -0.0349 54 -2 1 +5 F3 -39 0.333 0.673 0.545 0.5 39 30 1 +6 Fz 0 0.256 0.719 -0 0.695 -0 44 1 +7 F4 39 0.333 0.673 -0.545 0.5 -39 30 1 +8 F8 54 0.511 0.587 -0.809 -0.0349 -54 -2 1 +9 F10 55 0.639 0.52 -0.742 -0.423 -55 -25 1 +10 FC5 -69 0.394 0.339 0.883 0.326 69 19 1 +11 FC1 -45 0.178 0.375 0.375 0.848 45 58 1 +12 FC2 45 0.178 0.375 -0.375 0.848 -45 58 1 +13 FC6 69 0.394 0.339 -0.883 0.326 -69 19 1 +14 T9 -90 0.639 5.55e-17 0.906 -0.423 90 -25 1 +15 T7 -90 0.511 6.12e-17 0.999 -0.0349 90 -2 1 +16 C3 -90 0.256 4.4e-17 0.719 0.695 90 44 1 +17 Cz 90 0 3.75e-33 -6.12e-17 1 -90 90 1 +18 C4 90 0.256 4.4e-17 -0.719 0.695 -90 44 1 +19 T8 90 0.511 6.12e-17 -0.999 -0.0349 -90 -2 1 +20 T10 90 0.639 5.55e-17 -0.906 -0.423 -90 -25 1 +21 CP5 -111 0.394 -0.339 0.883 0.326 111 19 1 +22 CP1 -135 0.178 -0.375 0.375 0.848 135 58 1 +23 CP2 135 0.178 -0.375 -0.375 0.848 -135 58 1 +24 CP6 111 0.394 -0.339 -0.883 0.326 -111 19 1 +25 P9 -126 0.639 -0.533 0.733 -0.423 126 -25 1 +26 P7 -126 0.511 -0.587 0.809 -0.0349 126 -2 1 +27 P3 -141 0.333 -0.673 0.545 0.5 141 30 1 +28 Pz 180 0.256 -0.719 -8.81e-17 0.695 -180 44 1 +29 P4 141 0.333 -0.673 -0.545 0.5 -141 30 1 +30 P8 126 0.511 -0.587 -0.809 -0.0349 -126 -2 1 +31 P10 126 0.639 -0.533 -0.733 -0.423 -126 -25 1 +32 O1 -162 0.511 -0.95 0.309 -0.0349 162 -2 1 +33 O2 162 0.511 -0.95 -0.309 -0.0349 -162 -2 1 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap33.locs b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap33.locs new file mode 100644 index 0000000..a9a441d --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap33.locs @@ -0,0 +1,33 @@ +1 -18 0.51111 Fp1 +2 18 0.51111 Fp2 +3 -55 0.63889 F9 +4 -54 0.51111 F7 +5 -39 0.33333 F3 +6 0 0.25556 Fz +7 39 0.33333 F4 +8 54 0.51111 F8 +9 55 0.63889 F10 +10 -69 0.39444 FC5 +11 -45 0.17778 FC1 +12 45 0.17778 FC2 +13 69 0.39444 FC6 +14 -90 0.63889 T9 +15 -90 0.51111 T7 +16 -90 0.25556 C3 +17 90 0 Cz +18 90 0.25556 C4 +19 90 0.51111 T8 +20 90 0.63889 T10 +21 -111 0.39444 CP5 +22 -135 0.17778 CP1 +23 135 0.17778 CP2 +24 111 0.39444 CP6 +25 -126 0.63889 P9 +26 -126 0.51111 P7 +27 -141 0.33333 P3 +28 180 0.25556 Pz +29 141 0.33333 P4 +30 126 0.51111 P8 +31 126 0.63889 P10 +32 -162 0.51111 O1 +33 162 0.51111 O2 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap47.ced b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap47.ced new file mode 100644 index 0000000..507ee93 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap47.ced @@ -0,0 +1,48 @@ +Number labels theta radius X Y Z sph_theta sph_phi sph_radius +1 Fpz 0 0.536 0.993 -0 -0.114 -0 -6.56 1 +2 Fz 0 0.275 0.761 -0 0.649 -0 40.5 1 +3 Cz 0 0.0005 0.00157 -0 1 -0 89.9 1 +4 Pz 180 0.274 -0.759 -9.29e-17 0.652 -180 40.7 1 +5 Oz 180 0.535 -0.994 -1.22e-16 -0.111 -180 -6.39 1 +6 Iz 180 0.66 -0.876 -1.07e-16 -0.483 -180 -28.9 1 +7 Fp1 -18 0.536 0.945 0.307 -0.114 18 -6.56 1 +8 Fp2 18 0.536 0.945 -0.307 -0.114 -18 -6.56 1 +9 AF9 -42 0.661 0.65 0.586 -0.485 42 -29 1 +10 AF5 -33 0.47 0.835 0.542 0.0948 33 5.44 1 +11 AF1 -11 0.408 0.941 0.183 0.286 11 16.6 1 +12 AF2 11 0.408 0.941 -0.183 0.286 -11 16.6 1 +13 AF6 33 0.47 0.835 -0.542 0.0948 -33 5.44 1 +14 AF10 42 0.661 0.65 -0.586 -0.485 -42 -29 1 +15 F7 -54 0.536 0.584 0.804 -0.114 54 -6.53 1 +16 F3 -39 0.356 0.7 0.566 0.436 39 25.9 1 +17 F4 39 0.356 0.7 -0.566 0.436 -39 25.9 1 +18 F8 54 0.536 0.584 -0.804 -0.114 -54 -6.53 1 +19 FT9 -72 0.661 0.27 0.832 -0.484 72 -29 1 +20 FC5 -69 0.419 0.347 0.903 0.252 69 14.6 1 +21 FC1 -44.9 0.192 0.402 0.401 0.823 44.9 55.4 1 +22 FC2 44.9 0.192 0.402 -0.401 0.823 -44.9 55.4 1 +23 FC6 69 0.419 0.347 -0.903 0.252 -69 14.6 1 +24 FT10 72 0.661 0.27 -0.832 -0.484 -72 -29 1 +25 T7 -90 0.536 -0.000173 0.994 -0.113 90 -6.48 1 +26 C3 -89.9 0.275 0.000928 0.759 0.651 89.9 40.6 1 +27 C4 89.9 0.275 0.000928 -0.759 0.651 -89.9 40.6 1 +28 T8 90 0.536 -0.000173 -0.994 -0.113 -90 -6.48 1 +29 TP9 -110 0.661 -0.3 0.822 -0.483 110 -28.9 1 +30 CP5 -111 0.418 -0.346 0.903 0.253 111 14.7 1 +31 CP1 -135 0.192 -0.4 0.401 0.824 135 55.5 1 +32 CP2 135 0.192 -0.4 -0.401 0.824 -135 55.5 1 +33 CP6 111 0.418 -0.346 -0.903 0.253 -111 14.7 1 +34 TP10 110 0.661 -0.3 -0.822 -0.483 -110 -28.9 1 +35 P7 -126 0.536 -0.584 0.804 -0.112 126 -6.43 1 +36 P3 -141 0.355 -0.698 0.566 0.439 141 26 1 +37 P4 141 0.355 -0.698 -0.566 0.439 -141 26 1 +38 P8 126 0.536 -0.584 -0.804 -0.112 -126 -6.43 1 +39 PO9 -145 0.66 -0.718 0.502 -0.483 145 -28.9 1 +40 PO5 -147 0.469 -0.835 0.542 0.0974 147 5.59 1 +41 PO1 -169 0.407 -0.94 0.183 0.289 169 16.8 1 +42 PO2 169 0.407 -0.94 -0.183 0.289 -169 16.8 1 +43 PO6 147 0.469 -0.835 -0.542 0.0974 -147 5.59 1 +44 PO10 145 0.66 -0.718 -0.502 -0.483 -145 -28.9 1 +45 O1 -162 0.536 -0.945 0.307 -0.111 162 -6.4 1 +46 O2 162 0.536 -0.945 -0.307 -0.111 -162 -6.4 1 +47 Nz 0 0.661 0.874 -0 -0.485 -0 -29 1 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap47.locs b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap47.locs new file mode 100644 index 0000000..b150113 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-10-Cap47.locs @@ -0,0 +1,47 @@ +1 0 0.53644 Fpz +2 0 0.275 Fz +3 0 0.00055556 Cz +4 180 0.27389 Pz +5 180 0.5355 Oz +6 180 0.66056 Iz +7 -18 0.53644 Fp1 +8 18 0.53644 Fp2 +9 -42 0.66111 AF9 +10 -33 0.46978 AF5 +11 -11 0.40778 AF1 +12 11 0.40778 AF2 +13 33 0.46978 AF6 +14 42 0.66111 AF10 +15 -54 0.53628 F7 +16 -39 0.35611 F3 +17 39 0.35611 F4 +18 54 0.53628 F8 +19 -72 0.66111 FT9 +20 -69 0.41889 FC5 +21 -44.9 0.19222 FC1 +22 44.9 0.19222 FC2 +23 69 0.41889 FC6 +24 72 0.66111 FT10 +25 -90 0.536 T7 +26 -89.9 0.27444 C3 +27 89.9 0.27444 C4 +28 90 0.536 T8 +29 -110 0.66056 TP9 +30 -111 0.41833 CP5 +31 -135 0.19167 CP1 +32 135 0.19167 CP2 +33 111 0.41833 CP6 +34 110 0.66056 TP10 +35 -126 0.53572 P7 +36 -141 0.35556 P3 +37 141 0.35556 P4 +38 126 0.53572 P8 +39 -145 0.66056 PO9 +40 -147 0.46894 PO5 +41 -169 0.40667 PO1 +42 169 0.40667 PO2 +43 147 0.46894 PO6 +44 145 0.66056 PO10 +45 -162 0.53556 O1 +46 162 0.53556 O2 +47 0 0.66111 Nz diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap19.ced b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap19.ced new file mode 100644 index 0000000..f0b200a --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap19.ced @@ -0,0 +1,20 @@ +Number labels theta radius X Y Z sph_theta sph_phi sph_radius +1 Fp1 -18 0.511 0.95 0.309 -0.0349 18 -2 1 +2 Fp2 18 0.511 0.95 -0.309 -0.0349 -18 -2 1 +3 F7 -54 0.511 0.587 0.809 -0.0349 54 -2 1 +4 F3 -39 0.333 0.673 0.545 0.5 39 30 1 +5 Fz 0 0.256 0.719 -0 0.695 -0 44 1 +6 F4 39 0.333 0.673 -0.545 0.5 -39 30 1 +7 F8 54 0.511 0.587 -0.809 -0.0349 -54 -2 1 +8 T7 -90 0.511 6.12e-17 0.999 -0.0349 90 -2 1 +9 C3 -90 0.256 4.4e-17 0.719 0.695 90 44 1 +10 Cz 90 0 3.75e-33 -6.12e-17 1 -90 90 1 +11 C4 90 0.256 4.4e-17 -0.719 0.695 -90 44 1 +12 T8 90 0.511 6.12e-17 -0.999 -0.0349 -90 -2 1 +13 P7 -126 0.511 -0.587 0.809 -0.0349 126 -2 1 +14 P3 -141 0.333 -0.673 0.545 0.5 141 30 1 +15 Pz 180 0.256 -0.719 -8.81e-17 0.695 -180 44 1 +16 P4 141 0.333 -0.673 -0.545 0.5 -141 30 1 +17 P8 126 0.511 -0.587 -0.809 -0.0349 -126 -2 1 +18 O1 -162 0.511 -0.95 0.309 -0.0349 162 -2 1 +19 O2 162 0.511 -0.95 -0.309 -0.0349 -162 -2 1 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap19.locs b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap19.locs new file mode 100644 index 0000000..54b30c3 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap19.locs @@ -0,0 +1,19 @@ +1 -18 0.51111 Fp1 +2 18 0.51111 Fp2 +3 -54 0.51111 F7 +4 -39 0.33333 F3 +5 0 0.25556 Fz +6 39 0.33333 F4 +7 54 0.51111 F8 +8 -90 0.51111 T7 +9 -90 0.25556 C3 +10 90 0 Cz +11 90 0.25556 C4 +12 90 0.51111 T8 +13 -126 0.51111 P7 +14 -141 0.33333 P3 +15 180 0.25556 Pz +16 141 0.33333 P4 +17 126 0.51111 P8 +18 -162 0.51111 O1 +19 162 0.51111 O2 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap25.ced b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap25.ced new file mode 100644 index 0000000..b1a141c --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap25.ced @@ -0,0 +1,26 @@ +Number labels theta radius X Y Z sph_theta sph_phi sph_radius +1 Fp1 -18 0.511 0.95 0.309 -0.0349 18 -2 1 +2 Fp2 18 0.511 0.95 -0.309 -0.0349 -18 -2 1 +3 F9 -55 0.639 0.52 0.742 -0.423 55 -25 1 +4 F7 -54 0.511 0.587 0.809 -0.0349 54 -2 1 +5 F3 -39 0.333 0.673 0.545 0.5 39 30 1 +6 Fz 0 0.256 0.719 -0 0.695 -0 44 1 +7 F4 39 0.333 0.673 -0.545 0.5 -39 30 1 +8 F8 54 0.511 0.587 -0.809 -0.0349 -54 -2 1 +9 F10 55 0.639 0.52 -0.742 -0.423 -55 -25 1 +10 T9 -90 0.639 5.55e-17 0.906 -0.423 90 -25 1 +11 T7 -90 0.511 6.12e-17 0.999 -0.0349 90 -2 1 +12 C3 -90 0.256 4.4e-17 0.719 0.695 90 44 1 +13 Cz 90 0 3.75e-33 -6.12e-17 1 -90 90 1 +14 C4 90 0.256 4.4e-17 -0.719 0.695 -90 44 1 +15 T8 90 0.511 6.12e-17 -0.999 -0.0349 -90 -2 1 +16 T10 90 0.639 5.55e-17 -0.906 -0.423 -90 -25 1 +17 P9 -126 0.639 -0.533 0.733 -0.423 126 -25 1 +18 P7 -126 0.511 -0.587 0.809 -0.0349 126 -2 1 +19 P3 -141 0.333 -0.673 0.545 0.5 141 30 1 +20 Pz 180 0.256 -0.719 -8.81e-17 0.695 -180 44 1 +21 P4 141 0.333 -0.673 -0.545 0.5 -141 30 1 +22 P8 126 0.511 -0.587 -0.809 -0.0349 -126 -2 1 +23 P10 126 0.639 -0.533 -0.733 -0.423 -126 -25 1 +24 O1 -162 0.511 -0.95 0.309 -0.0349 162 -2 1 +25 O2 162 0.511 -0.95 -0.309 -0.0349 -162 -2 1 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap25.locs b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap25.locs new file mode 100644 index 0000000..fe8a8cb --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap25.locs @@ -0,0 +1,25 @@ +1 -18 0.51111 Fp1 +2 18 0.51111 Fp2 +3 -55 0.63889 F9 +4 -54 0.51111 F7 +5 -39 0.33333 F3 +6 0 0.25556 Fz +7 39 0.33333 F4 +8 54 0.51111 F8 +9 55 0.63889 F10 +10 -90 0.63889 T9 +11 -90 0.51111 T7 +12 -90 0.25556 C3 +13 90 0 Cz +14 90 0.25556 C4 +15 90 0.51111 T8 +16 90 0.63889 T10 +17 -126 0.63889 P9 +18 -126 0.51111 P7 +19 -141 0.33333 P3 +20 180 0.25556 Pz +21 141 0.33333 P4 +22 126 0.51111 P8 +23 126 0.63889 P10 +24 -162 0.51111 O1 +25 162 0.51111 O2 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap81.ced b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap81.ced new file mode 100644 index 0000000..34562ac --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap81.ced @@ -0,0 +1,82 @@ +Number labels theta radius X Y Z sph_theta sph_phi sph_radius +1 FP1 -18 0.511 0.95 0.309 -0.0349 18 -2 1 +2 FPZ 0 0.511 0.999 -0 -0.0349 -0 -2 1 +3 FP2 18 0.511 0.95 -0.309 -0.0349 -18 -2 1 +4 Nz 0 0.622 0.927 -0 -0.375 -0 -22 1 +5 AF9 -43 0.639 0.663 0.618 -0.423 43 -25 1 +6 AF7 -38 0.511 0.788 0.615 -0.0349 38 -2 1 +7 AF3 -23 0.411 0.885 0.376 0.276 23 16 1 +8 AFZ 0 0.383 0.934 -0 0.358 -0 21 1 +9 AF4 23 0.411 0.885 -0.376 0.276 -23 16 1 +10 AF8 38 0.511 0.788 -0.615 -0.0349 -38 -2 1 +11 AF10 43 0.639 0.663 -0.618 -0.423 -43 -25 1 +12 F9 -55 0.639 0.52 0.742 -0.423 55 -25 1 +13 F7 -54 0.511 0.587 0.809 -0.0349 54 -2 1 +14 F5 -49 0.417 0.634 0.729 0.259 49 15 1 +15 F3 -39 0.333 0.673 0.545 0.5 39 30 1 +16 F1 -22 0.278 0.71 0.287 0.643 22 40 1 +17 FZ 0 0.256 0.719 -0 0.695 -0 44 1 +18 F2 22 0.278 0.71 -0.287 0.643 -22 40 1 +19 F4 39 0.333 0.673 -0.545 0.5 -39 30 1 +20 F6 49 0.417 0.634 -0.729 0.259 -49 15 1 +21 F8 54 0.511 0.587 -0.809 -0.0349 -54 -2 1 +22 F10 55 0.639 0.52 -0.742 -0.423 -55 -25 1 +23 FT9 -72 0.639 0.28 0.862 -0.423 72 -25 1 +24 FT7 -72 0.511 0.309 0.95 -0.0349 72 -2 1 +25 FC5 -69 0.394 0.339 0.883 0.326 69 19 1 +26 FC3 -62 0.278 0.36 0.676 0.643 62 40 1 +27 FC1 -45 0.178 0.375 0.375 0.848 45 58 1 +28 FCz 0 0.128 0.391 -0 0.921 -0 67 1 +29 FC2 45 0.178 0.375 -0.375 0.848 -45 58 1 +30 FC4 62 0.278 0.36 -0.676 0.643 -62 40 1 +31 FC6 69 0.394 0.339 -0.883 0.326 -69 19 1 +32 FT8 72 0.511 0.309 -0.95 -0.0349 -72 -2 1 +33 FT10 72 0.639 0.28 -0.862 -0.423 -72 -25 1 +34 T9 -90 0.639 5.55e-17 0.906 -0.423 90 -25 1 +35 T7 -90 0.511 6.12e-17 0.999 -0.0349 90 -2 1 +36 C5 -90 0.383 5.72e-17 0.934 0.358 90 21 1 +37 C3 -90 0.256 4.4e-17 0.719 0.695 90 44 1 +38 C1 -90 0.128 2.39e-17 0.391 0.921 90 67 1 +39 Cz 90 0 3.75e-33 -6.12e-17 1 -90 90 1 +40 C2 90 0.128 2.39e-17 -0.391 0.921 -90 67 1 +41 C4 90 0.256 4.4e-17 -0.719 0.695 -90 44 1 +42 C6 90 0.383 5.72e-17 -0.934 0.358 -90 21 1 +43 T8 90 0.511 6.12e-17 -0.999 -0.0349 -90 -2 1 +44 T10 90 0.639 5.55e-17 -0.906 -0.423 -90 -25 1 +45 TP9 -108 0.639 -0.28 0.862 -0.423 108 -25 1 +46 TP7 -108 0.511 -0.309 0.95 -0.0349 108 -2 1 +47 CP5 -111 0.394 -0.339 0.883 0.326 111 19 1 +48 CP3 -118 0.278 -0.36 0.676 0.643 118 40 1 +49 CP1 -135 0.178 -0.375 0.375 0.848 135 58 1 +50 CPZ 180 0.128 -0.391 -4.79e-17 0.921 -180 67 1 +51 CP2 135 0.178 -0.375 -0.375 0.848 -135 58 1 +52 CP4 118 0.278 -0.36 -0.676 0.643 -118 40 1 +53 CP6 111 0.394 -0.339 -0.883 0.326 -111 19 1 +54 TP8 108 0.511 -0.309 -0.95 -0.0349 -108 -2 1 +55 TP10 108 0.639 -0.28 -0.862 -0.423 -108 -25 1 +56 P9 -126 0.639 -0.533 0.733 -0.423 126 -25 1 +57 P7 -126 0.511 -0.587 0.809 -0.0349 126 -2 1 +58 P5 -131 0.417 -0.634 0.729 0.259 131 15 1 +59 P3 -141 0.333 -0.673 0.545 0.5 141 30 1 +60 P1 -158 0.278 -0.71 0.287 0.643 158 40 1 +61 PZ 180 0.256 -0.719 -8.81e-17 0.695 -180 44 1 +62 P2 158 0.278 -0.71 -0.287 0.643 -158 40 1 +63 P4 141 0.333 -0.673 -0.545 0.5 -141 30 1 +64 P6 131 0.417 -0.634 -0.729 0.259 -131 15 1 +65 P8 126 0.511 -0.587 -0.809 -0.0349 -126 -2 1 +66 P10 126 0.639 -0.533 -0.733 -0.423 -126 -25 1 +67 PO9 -144 0.639 -0.733 0.533 -0.423 144 -25 1 +68 PO7 -144 0.511 -0.809 0.587 -0.0349 144 -2 1 +69 PO3 -157 0.411 -0.885 0.376 0.276 157 16 1 +70 POz 180 0.383 -0.934 -1.14e-16 0.358 -180 21 1 +71 PO4 157 0.411 -0.885 -0.376 0.276 -157 16 1 +72 PO8 144 0.511 -0.809 -0.587 -0.0349 -144 -2 1 +73 PO10 144 0.639 -0.733 -0.533 -0.423 -144 -25 1 +74 O1 -162 0.511 -0.95 0.309 -0.0349 162 -2 1 +75 Oz 180 0.511 -0.999 -1.22e-16 -0.0349 -180 -2 1 +76 O2 162 0.511 -0.95 -0.309 -0.0349 -162 -2 1 +77 O9 -162 0.639 -0.862 0.28 -0.423 162 -25 1 +78 O10 162 0.639 -0.862 -0.28 -0.423 -162 -25 1 +79 CB1 -135 0.722 -0.542 0.542 -0.643 135 -40 1 +80 CB2 135 0.722 -0.542 -0.542 -0.643 -135 -40 1 +81 Iz 180 0.639 -0.906 -1.11e-16 -0.423 -180 -25 1 diff --git a/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap81.locs b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap81.locs new file mode 100644 index 0000000..d7b5cc1 --- /dev/null +++ b/code/eeglab13_4_4b/sample_locs/Standard-10-20-Cap81.locs @@ -0,0 +1,81 @@ +1 -18 0.51111 Fp1 +2 0 0.51111 Fpz +3 18 0.51111 Fp2 +4 0 0.62222 Nz +5 -43 0.63889 AF9 +6 -38 0.51111 AF7 +7 -23 0.41111 AF3 +8 0 0.38333 AFz +9 23 0.41111 AF4 +10 38 0.51111 AF8 +11 43 0.63889 AF10 +12 -55 0.63889 F9 +13 -54 0.51111 F7 +14 -49 0.41667 F5 +15 -39 0.33333 F3 +16 -22 0.27778 F1 +17 0 0.25556 Fz +18 22 0.27778 F2 +19 39 0.33333 F4 +20 49 0.41667 F6 +21 54 0.51111 F8 +22 55 0.63889 F10 +23 -72 0.63889 FT9 +24 -72 0.51111 FT7 +25 -69 0.39444 FC5 +26 -62 0.27778 FC3 +27 -45 0.17778 FC1 +28 0 0.12778 FCz +29 45 0.17778 FC2 +30 62 0.27778 FC4 +31 69 0.39444 FC6 +32 72 0.51111 FT8 +33 72 0.63889 FT10 +34 -90 0.63889 T9 +35 -90 0.51111 T7 +36 -90 0.38333 C5 +37 -90 0.25556 C3 +38 -90 0.12778 C1 +39 90 0 Cz +40 90 0.12778 C2 +41 90 0.25556 C4 +42 90 0.38333 C6 +43 90 0.51111 T8 +44 90 0.63889 T10 +45 -108 0.63889 TP9 +46 -108 0.51111 TP7 +47 -111 0.39444 CP5 +48 -118 0.27778 CP3 +49 -135 0.17778 CP1 +50 180 0.12778 CPz +51 135 0.17778 CP2 +52 118 0.27778 CP4 +53 111 0.39444 CP6 +54 108 0.51111 TP8 +55 108 0.63889 TP10 +56 -126 0.63889 P9 +57 -126 0.51111 P7 +58 -131 0.41667 P5 +59 -141 0.33333 P3 +60 -158 0.27778 P1 +61 180 0.25556 Pz +62 158 0.27778 P2 +63 141 0.33333 P4 +64 131 0.41667 P6 +65 126 0.51111 P8 +66 126 0.63889 P10 +67 -144 0.63889 PO9 +68 -144 0.51111 PO7 +69 -157 0.41111 PO3 +70 180 0.38333 POz +71 157 0.41111 PO4 +72 144 0.51111 PO8 +73 144 0.63889 PO10 +74 -162 0.51111 O1 +75 180 0.51111 Oz +76 162 0.51111 O2 +77 -162 0.63889 O9 +78 162 0.63889 O10 +79 -135 0.72222 CB1 +80 135 0.72222 CB2 +81 180 0.63889 Iz diff --git a/code/thrive_eeg/MADE_pipeline_v1_0_thrive.m b/code/thrive_eeg/MADE_pipeline_v1_0_thrive.m new file mode 100644 index 0000000..9e6119b --- /dev/null +++ b/code/thrive_eeg/MADE_pipeline_v1_0_thrive.m @@ -0,0 +1,915 @@ +%%to Run on FIU HPC% +% create a local cluster object +cluster = parcluster('local'); + +% start matlabpool with max workers set in the slurm file +parpool(cluster, str2num(getenv('SLURM_CPUS_ON_NODE'))) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This script was initially edited by George Buzzell for the NDC Lab EEG +% Training Workshop on 10/21, then modified by George Buzzell and Kianoosh Hosseini to preprocess THRIVE dataset. +% +% +% ************************************************************************ +% The Maryland Analysis of Developmental EEG (MADE) Pipeline +% Version 1.0 +% Developed at the Child Development Lab, University of Maryland, College Park + +% Contributors to MADE pipeline: +% Ranjan Debnath (rdebnath@umd.edu) +% George A. Buzzell (gbuzzell@umd.edu) +% Santiago Morales Pamplona (moraless@umd.edu) +% Stephanie Leach (sleach12@umd.edu) +% Maureen Elizabeth Bowers (mbowers1@umd.edu) +% Nathan A. Fox (fox@umd.edu) + +% MADE uses EEGLAB toolbox and some of its plugins. Before running the pipeline, you have to install the following: +% EEGLab: https://sccn.ucsd.edu/eeglab/downloadtoolbox.php/download.php + +% You also need to download the following plugins/extensions from here: https://sccn.ucsd.edu/wiki/EEGLAB_Extensions +% Specifically, download: +% MFFMatlabIO: https://github.com/arnodelorme/mffmatlabio/blob/master/README.txt +% FASTER: https://sourceforge.net/projects/faster/ +% ADJUST: https://www.nitrc.org/projects/adjust/ [Maybe we will replace this with our own GitHub link?] + +% After downloading these plugins (as zip files), you need to place it in the eeglab/plugins folder. +% For instance, for FASTER, you uncompress the downloaded extension file (e.g., 'FASTER.zip') and place it in the main EEGLAB "plugins" sub-directory/sub-folder. +% After placing all the required plugins, add the EEGLAB folder to your path by using the following code: + +% addpath(genpath(('...')) % Enter the path of the EEGLAB folder in this line +% Please cite the following references for in any manuscripts produced utilizing MADE pipeline: + +% EEGLAB: A Delorme & S Makeig (2004) EEGLAB: an open source toolbox for +% analysis of single-trial EEG dynamics. Journal of Neuroscience Methods, 134, 9?21. + +% firfilt (filter plugin): developed by Andreas Widmann (https://home.uni-leipzig.de/biocog/content/de/mitarbeiter/widmann/eeglab-plugins/) + +% FASTER: Nolan, H., Whelan, R., Reilly, R.B., 2010. FASTER: Fully Automated Statistical +% Thresholding for EEG artifact Rejection. Journal of Neuroscience Methods, 192, 152?162. + +% ADJUST: Mognon, A., Jovicich, J., Bruzzone, L., Buiatti, M., 2011. ADJUST: An automatic EEG +% artifact detector based on the joint use of spatial and temporal features. Psychophysiology, 48, 229?240. +% Our group has modified ADJUST plugin to improve selection of ICA components containing artifacts + +% This pipeline is released under the GNU General Public License version 3. + +% ************************************************************************ + +%% User input: user provide relevant information to be used for data processing +% Preprocessing of EEG data involves using some common parameters for +% every subject. This part of the script initializes the common parameters. + +clear % clear matlab workspace +clc % clear matlab command window + +%% MUST EDIT THIS +%running in "EEG_training" folder on your computer +main_dir = '/home/data/NDClab/datasets/thrive-dataset'; %directory on the HPC + +%% Setting up other things + +%Location of MADE and ADJUSTED-ADJUST scripts +addpath(genpath([main_dir filesep 'code' filesep 'thrive_eeg']));% enter the path of the folder in this line + +%Location of EEGlab +addpath(genpath([main_dir filesep 'code' filesep 'eeglab13_4_4b']));% enter the path of the EEGLAB folder in this line + +%remove path to octave functions inside matlab to prevent errors when +rmpath([main_dir filesep 'code' filesep 'eeglab13_4_4b' filesep 'functions' filesep 'octavefunc' filesep 'signal']) + +% 1. Enter the path of the folder that has the raw data to be analyzed +rawdata_location_parent = [main_dir filesep 'sourcedata' filesep 'raw' filesep 's1_r1' filesep 'eeg']; + + +% 2. Enter the path of the channel location file +channel_locations = loadbvef('/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED-64only.bvef'); + + +%need to modify for social vs nonsocial + +% STIMULUS TRIGGERS +% passage text appears on-screen: 11 +% passage text disappears (participant proceeded to the next screen): 10 +% challenge text appears on-screen: 21 +% +% RESPONSE TRIGGERS +% error response to challenge question: 30 +% correct response to challenge question: 31 + +stimulus_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54'}; % enter the stimulus markers that need to be adjusted for time offset +response_markers = {}; % enter the response makers that need to be adjusted for time offset + +% 5. Do you want to down sample the data? +down_sample = 1; % 0 = NO (no down sampling), 1 = YES (down sampling) +sampling_rate = 1000; % set sampling rate (in Hz), if you want to down sample + +% 6. Do you want to delete the outer layer of the channels? (Rationale has been described in MADE manuscript) +% This fnction can also be used to down sample electrodes. For example, if EEG was recorded with 128 channels but you would +% like to analyse only 64 channels, you can assign the list of channnels to be excluded in the 'outerlayer_channel' variable. +% Can also use this to remove ocular channels if they are in non-standard +% locations +delete_outerlayer = 0; % 0 = NO (do not delete outer layer), 1 = YES (delete outerlayer); +% If you want to delete outer layer, make a list of channels to be deleted +outerlayer_channel = {'16','15','12','13','8','31','26','25','30','32','60','64','61','62','56','57','63','41','46','45','48'}; % list of channels + +% 7. Initialize the filters +highpass = .1; % High-pass frequency +lowpass = 49; % Low-pass frequency. We recommend low-pass filter at/below line noise frequency (see manuscript for detail) + +% 8. Are you processing task-related or resting-state EEG data? +task_eeg = 1; % 0 = resting, 1 = task +task_event_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54', 'S 11', 'S 12', 'S 21', 'S 22'}; % enter all the event/condition markers (i.e., stim + resp markers) + +% 9. Do you want to epoch/segment your data? +epoch_data = 1; % 0 = NO (do not epoch), 1 = YES (epoch data) +task_epoch_length = [-1 2]; % epoch length in second +dummy_events ={'999'}; % enter dummy events name + +% 10. Do you want to remove/correct baseline? +remove_baseline = 1; % 0 = NO (no baseline correction), 1 = YES (baseline correction) +baseline_window = []; % baseline period in milliseconds (MS) [] = entire epoch + +% 11. Do you want to remove artifact laden epoch based on voltage threshold? +voltthres_rejection = 1; % 0 = NO, 1 = YES +volt_threshold = [-125 125]; % lower and upper threshold (in ?V) + +% 12. Do you want to perform epoch level channel interpolation for artifact laden epoch? (see manuscript for detail) +interp_epoch = 1; % 0 = NO, 1 = YES. +frontal_channels = {'14','11','10','43','44','47'}; % If you set interp_epoch = 1, enter the list of frontal channels to check (see manuscript for detail) + +%13. Do you want to interpolate the bad channels that were removed from data? +interp_channels = 1; % 0 = NO (Do not interpolate), 1 = YES (interpolate missing channels) + +% 14. Do you want to rereference your data? +rerefer_data = 1; % 0 = NO, 1 = YES +reref=[]; % Enter electrode name/s or number/s to be used for rereferencing +% For channel name/s enter, reref = {'channel_name', 'channel_name'}; +% For channel number/s enter, reref = [channel_number, channel_number]; +% For average rereference enter, reref = []; default is average rereference + +% 15. Do you want to save interim results? +save_interim_result = 1; % 0 = NO (Do not save) 1 = YES (save interim results) + +% 16. How do you want to save your data? .set or .mat +output_format = 1; % 1 = .set (EEGLAB data structure), 2 = .mat (Matlab data structure) + +% ********* no need to edit beyond this point for EGI .mff data ********** +% ********* for non-.mff data format edit data import function *********** +% ********* below using relevant data import plugin from EEGLAB ********** + + +% List subject folders under EEG folder +cd (rawdata_location_parent) +data_folder_lists = dir; +data_folder_lists = data_folder_lists(~ismember({data_folder_lists.name},{'.', '..', '.DS_Store'})); +data_folder_lists = {data_folder_lists.name}; +data_folder_lists = string(data_folder_lists); +for file_locater_counter = 1:length(data_folder_lists) % This for loop lists the folders containing the main data files + rawdata_location = fullfile(rawdata_location_parent, data_folder_lists(file_locater_counter)); + rawdata_location = char(rawdata_location); + + % Enter the path of the folder where you want to save the processed data + output_location = [main_dir filesep 'derivatives' filesep 's1_r1' filesep 'eeg' filesep 'preprocessed' ]; + % update the output_location + output_location = fullfile(output_location, data_folder_lists(file_locater_counter)); + output_location = char(output_location); + + % Read files to analyses + datafile_names=dir([rawdata_location filesep '*.vhdr']); + datafile_names=datafile_names(~ismember({datafile_names.name},{'.', '..', '.DS_Store'})); + datafile_names={datafile_names.name}; + [filepath,name,ext] = fileparts(char(datafile_names{1})); + + + + + %% Check whether EEGLAB and all necessary plugins are in Matlab path. + if exist('eeglab','file')==0 + error(['Please make sure EEGLAB is on your Matlab path. Please see EEGLAB' ... + 'wiki page for download and instalation instructions']); + end + + if exist('pop_firws', 'file')==0 + error(['Please make sure "firfilt" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('channel_properties', 'file')==0 + error(['Please make sure "FASTER" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('ADJUST', 'file')==0 + error(['Please make sure you download modified "ADJUST" plugin from GitHub (link is in MADE manuscript)' ... + ' and ADJUST is in EEGLAB plugin folder and on Matlab path.']); + end + + %% Create output folders to save data + if save_interim_result == 1 + if exist([output_location filesep 'filtered_data'], 'dir') == 0 + mkdir([output_location filesep 'filtered_data']) + end + if exist([output_location filesep 'ica_data'], 'dir') == 0 + mkdir([output_location filesep 'ica_data']) + end + end + if exist([output_location filesep 'processed_data'], 'dir') == 0 + mkdir([output_location filesep 'processed_data']) + end + + %% Initialize output variables + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + %% Loop over all data files + + % switch to output directory + cd(output_location); + + for subject=1:length(datafile_names) + + %% Initialize EEG structurem, output variables, and report table + EEG=[]; %initialize eeg structure + report_table = []; %report table that will be created and writen to disk (appended) after processing completes for this participant + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + fprintf('\n\n\n*** Processing subject %d (%s) ***\n\n\n', subject, datafile_names{subject}); + + %% STEP 1: Import EEG data file and relevant information + + %load in raw data + EEG = pop_loadbv(rawdata_location, datafile_names{subject}); + EEG = eeg_checkset(EEG); + + %% STEP 4: Change sampling rate + if down_sample==1 + if floor(sampling_rate) > EEG.srate + error ('Sampling rate cannot be higher than recorded sampling rate'); + elseif floor(sampling_rate) ~= EEG.srate + EEG = pop_resample( EEG, sampling_rate); + EEG = eeg_checkset( EEG ); + end + end + + %make a copy of GSR and sync channels, then delete from eeg structure + + gsrChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + + syncChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + + + %add in ref channels + origData = EEG.data; + [origData_NumRows, origData_NumCols] = size(origData); + EEG.data = NaN(origData_NumRows+1, origData_NumCols); + EEG.data(1,:) = 0; %add ref as zeros + EEG.data(2:end,:) = origData; %copy over orig EEG data + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + + %delete ground from newChanLocs + modNewChanlocs = channel_locations(2:end); + + %replace chanlocs with + EEG.chanlocs = modNewChanlocs; + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + %update/refresh eeglab and plot + %eeglab redraw + + % Check whether the channel locations were properly imported. The EEG signals and channel numbers should be same. + if size(EEG.data, 1) ~= length(EEG.chanlocs) + error('The size of the data does not match with channel numbers.'); + end + + %% STEP 1b: convert all type field markers to string (if not already) + + %loop through all the type markes, if numeric, convert to string + % (Given that this script assumes that "type" field markers are strings, we need to + % convert all type field markers to string, in case they are not + % already) + for atm=1:length({EEG.event.type}) + if isnumeric(EEG.event(atm).type) + EEG.event(atm).type = num2str(EEG.event(atm).type); + end + end + + + %% STEP 5: Delete outer layer of channels + chans_labels=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels{i}= EEG.chanlocs(i).labels; + end + + if delete_outerlayer==1 + [chans,chansidx] = ismember(outerlayer_channel, chans_labels); + outerlayer_channel_idx = chansidx(chansidx ~= 0); + if isempty(outerlayer_channel_idx)==1 + error(['None of the outer layer channels present in channel locations of data.'... + ' Make sure outer layer channels are present in channel labels of data (EEG.chanlocs.labels).']); + else + EEG = pop_select( EEG,'nochannel', outerlayer_channel_idx); + EEG = eeg_checkset( EEG ); + end + end + + %% STEP 6: Filter data + % Calculate filter order using the formula: m = dF / (df / fs), where m = filter order, + % df = transition band width, dF = normalized transition width, fs = sampling rate + % dF is specific for the window type. Hamming window dF = 3.3 + + high_transband = highpass; % high pass transition band + low_transband = 10; % low pass transition band + + hp_fl_order = 3.3 / (high_transband / EEG.srate); + lp_fl_order = 3.3 / (low_transband / EEG.srate); + + % Round filter order to next higher even integer. Filter order is always even integer. + if mod(floor(hp_fl_order),2) == 0 + hp_fl_order=floor(hp_fl_order); + elseif mod(floor(hp_fl_order),2) == 1 + hp_fl_order=floor(hp_fl_order)+1; + end + + if mod(floor(lp_fl_order),2) == 0 + lp_fl_order=floor(lp_fl_order)+2; + elseif mod(floor(lp_fl_order),2) == 1 + lp_fl_order=floor(lp_fl_order)+1; + end + + % Calculate cutoff frequency + high_cutoff = highpass/2; + low_cutoff = lowpass + (low_transband/2); + + % Performing high pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', high_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', hp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % + + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + % Performing low pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', low_cutoff, 'ftype', 'lowpass', 'wtype', 'hamming', 'forder', lp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % pop_firws() - transition band width: 10 Hz + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + %% STEP 7: Run faster to find bad channels + % First check whether reference channel (i.e. zeroed channels) is present in data + % reference channel is needed to run faster + ref_chan=[]; FASTbadChans=[]; all_chan_bad_FAST=0; + ref_chan=find(any(EEG.data, 2)==0); + if numel(ref_chan)>1 + error(['There are more than 1 zeroed channel (i.e. zero value throughout recording) in data.'... + ' Only reference channel should be zeroed channel. Delete the zeroed channel/s which is not reference channel.']); + elseif numel(ref_chan)==1 + list_properties = channel_properties(EEG, 1:EEG.nbchan, ref_chan); % run faster + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + FASTbadChans=FASTbadChans(FASTbadChans~=ref_chan); + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + % EEG = pop_select( EEG,'nochannel', ref_chan); % a bug [kia + % removed it as George said] + EEG = eeg_checkset(EEG); + channels_analysed=EEG.chanlocs; % keep full channel locations to use later for interpolation of bad channels + elseif numel(ref_chan)==0 + warning('Reference channel is not present in data. channel 1 will be used as reference channel.'); + ref_chan=find(strcmp({EEG.chanlocs.labels}, '1')); % find Cz channel index + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = pop_reref( EEG_copy, ref_chan,'keepref','on'); % rerefer to Cz in copied dataset + EEG_copy = eeg_checkset(EEG_copy); + list_properties = channel_properties(EEG_copy, 1:EEG_copy.nbchan, ref_chan); % run faster on copied dataset + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + channels_analysed=EEG.chanlocs; + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + end + + % If FASTER identifies all channels as bad channels, save the dataset + % at this stage and ignore the remaining of the preprocessing. + if numel(FASTbadChans)==EEG.nbchan || numel(FASTbadChans)+1==EEG.nbchan + all_chan_bad_FAST=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + else + % Reject channels that are bad as identified by Faster + EEG = pop_select( EEG,'nochannel', FASTbadChans); + EEG = eeg_checkset(EEG); + if numel(ref_chan)==1 + ref_chan=find(any(EEG.data, 2)==0); + EEG = pop_select( EEG,'nochannel', ref_chan); % remove reference channel + end + end + + if numel(FASTbadChans)==0 + faster_bad_channels='0'; + else + faster_bad_channels=num2str(FASTbadChans'); + end + + if all_chan_bad_FAST==1 + faster_bad_channels='0'; + ica_preparation_bad_channels='0'; + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next subject + end + + %% Save data after running filter and FASTER function, if saving interim results was preferred + if save_interim_result ==1 + if output_format==1 + EEG = eeg_checkset( EEG ); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_filtered_data')); + EEG = pop_saveset( EEG,'filename',strrep(datafile_names{subject}, ext, '_filtered_data.set'),'filepath', [output_location filesep 'filtered_data' filesep]); % save .set format + elseif output_format==2 + save([[output_location filesep 'filtered_data' filesep ] strrep(datafile_names{subject}, ext, '_filtered_data.mat')], 'EEG'); % save .mat format + end + end + + %% STEP 8: Prepare data for ICA + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = eeg_checkset(EEG_copy); + + % Perform 1Hz high pass filter on copied dataset + transband = 1; + fl_cutoff = transband/2; + fl_order = 3.3 / (transband / EEG.srate); + + if mod(floor(fl_order),2) == 0 + fl_order=floor(fl_order); + elseif mod(floor(fl_order),2) == 1 + fl_order=floor(fl_order)+1; + end + + EEG_copy = pop_firws(EEG_copy, 'fcutoff', fl_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', fl_order, 'minphase', 0); + EEG_copy = eeg_checkset(EEG_copy); + + % Create 1 second epoch + EEG_copy=eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + % Find bad epochs and delete them from dataset + vol_thrs = [-1000 1000]; % [lower upper] threshold limit(s) in mV. + emg_thrs = [-100 30]; % [lower upper] threshold limit(s) in dB. + emg_freqs_limit = [20 40]; % [lower upper] frequency limit(s) in Hz. + + % Find channel/s with xx% of artifacted 1-second epochs and delete them + chanCounter = 1; ica_prep_badChans = []; + numEpochs =EEG_copy.trials; % find the number of epochs + all_bad_channels=0; + + for ch=1:EEG_copy.nbchan + % Find artifaceted epochs by detecting outlier voltage + EEG_copy = pop_eegthresh(EEG_copy,1, ch, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax, 0, 0); + EEG_copy = eeg_checkset( EEG_copy ); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using thresholding of frequencies in the data. + % this method mainly rejects muscle movement (EMG) artifacts + EEG_copy = pop_rejspec( EEG_copy, 1,'elecrange',ch ,'method','fft','threshold', emg_thrs, 'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find number of artifacted epochs + EEG_copy = eeg_checkset( EEG_copy ); + EEG_copy = eeg_rejsuperpose( EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + artifacted_epochs=EEG_copy.reject.rejglobal; + + % Find bad channel / channel with more than 20% artifacted epochs + if sum(artifacted_epochs) > (numEpochs*20/100) + ica_prep_badChans(chanCounter) = ch; + chanCounter=chanCounter+1; + end + end + + % If all channels are bad, save the dataset at this stage and ignore the remaining of the preprocessing. + if numel(ica_prep_badChans)==EEG.nbchan || numel(ica_prep_badChans)+1==EEG.nbchan + all_bad_channels=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + + else + % Reject bad channel - channel with more than xx% artifacted epochs + EEG_copy = pop_select( EEG_copy,'nochannel', ica_prep_badChans); + EEG_copy = eeg_checkset(EEG_copy); + end + + if numel(ica_prep_badChans)==0 + ica_preparation_bad_channels='0'; + else + ica_preparation_bad_channels=num2str(ica_prep_badChans); + end + + if all_bad_channels == 1 + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + % Find the artifacted epochs across all channels and reject them before doing ICA. + EEG_copy = pop_eegthresh(EEG_copy,1, 1:EEG_copy.nbchan, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax,0,0); + EEG_copy = eeg_checkset(EEG_copy); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using power threshold in 20-40Hz frequency band. + % This method mainly rejects muscle movement (EMG) artifacts. + EEG_copy = pop_rejspec(EEG_copy, 1,'elecrange', 1:EEG_copy.nbchan, 'method', 'fft', 'threshold', emg_thrs ,'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find the number of artifacted epochs and reject them + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = eeg_rejsuperpose(EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + reject_artifacted_epochs=EEG_copy.reject.rejglobal; + EEG_copy = pop_rejepoch(EEG_copy, reject_artifacted_epochs, 0); + + %% STEP 9: Run ICA + length_ica_data=EEG_copy.trials; % length of data (in second) fed into ICA + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = pop_runica(EEG_copy, 'icatype', 'runica', 'extended', 1, 'stop', 1E-7, 'interupt','off'); + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'), 'filepath', [output_location filesep 'ica_data' filesep]); + + % Find the ICA weights that would be transferred to the original dataset + ICA_WINV=EEG_copy.icawinv; + ICA_SPHERE=EEG_copy.icasphere; + ICA_WEIGHTS=EEG_copy.icaweights; + ICA_CHANSIND=EEG_copy.icachansind; + + % If channels were removed from copied dataset during preparation of ica, then remove + % those channels from original dataset as well before transferring ica weights. + EEG = eeg_checkset(EEG); + EEG = pop_select(EEG,'nochannel', ica_prep_badChans); + + % Transfer the ICA weights of the copied dataset to the original dataset + EEG.icawinv=ICA_WINV; + EEG.icasphere=ICA_SPHERE; + EEG.icaweights=ICA_WEIGHTS; + EEG.icachansind=ICA_CHANSIND; + EEG = eeg_checkset(EEG); + + %% STEP 10: Run adjust to find artifacted ICA components + badICs=[]; EEG_copy =[]; + EEG_copy = EEG; + EEG_copy = eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + if save_interim_result==1 + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'ica_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + else + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'processed_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + end + close all; + + + + % Mark the bad ICs found by ADJUST + for ic=1:length(badICs) + EEG.reject.gcompreject(1, badICs(ic))=1; + EEG = eeg_checkset(EEG); + end + total_ICs=size(EEG.icasphere, 1); + if numel(badICs)==0 + ICs_removed='0'; + else + ICs_removed=num2str(double(badICs)); + end + + %% Save dataset after ICA, if saving interim results was preferred + if save_interim_result==1 + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_ica_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'ica_data' filesep ] strrep(datafile_names{subject}, ext, '_ica_data.mat')], 'EEG'); % save .mat format + end + end + + %Ran up to here.... + + %no manual review/selection of ica artifact performed... + + + + %% STEP 11: Remove artifacted ICA components from data + all_bad_ICs=0; + ICs2remove=find(EEG.reject.gcompreject); % find ICs to remove + + % If all ICs and bad, save data at this stage and ignore rest of the preprocessing for this subject. + if numel(ICs2remove)==total_ICs + all_bad_ICs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.mat')], 'EEG'); % save .mat format + end + else + EEG = eeg_checkset( EEG ); + EEG = pop_subcomp( EEG, ICs2remove, 0); % remove ICs from dataset + end + + if all_bad_ICs==1 + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + %% STEP 12: Segment data into fixed length epochs + + %run event labeling script + edit_event_markers_thrive + + if epoch_data==1 + if task_eeg ==1 % task eeg + EEG = eeg_checkset(EEG); + EEG = pop_epoch(EEG, task_event_markers, task_epoch_length, 'epochinfo', 'yes'); + elseif task_eeg==0 % resting eeg + if overlap_epoch==1 + EEG=eeg_regepochs(EEG,'recurrence',(rest_epoch_length/2),'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + else + EEG=eeg_regepochs(EEG,'recurrence',rest_epoch_length,'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + end + end + end + + total_epochs_before_artifact_rejection=EEG.trials; + + %% STEP 13: Remove baseline + if remove_baseline==1 + EEG = eeg_checkset( EEG ); + EEG = pop_rmbase( EEG, baseline_window); + end + + %% STEP 14: Artifact rejection + all_bad_epochs=0; + if voltthres_rejection==1 % check voltage threshold rejection + if interp_epoch==1 % check epoch level channel interpolation + chans=[]; chansidx=[];chans_labels2=[]; + chans_labels2=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels2{i}= EEG.chanlocs(i).labels; + end + [chans,chansidx] = ismember(frontal_channels, chans_labels2); + frontal_channels_idx = chansidx(chansidx ~= 0); + badChans = zeros(EEG.nbchan, EEG.trials); + badepoch=zeros(1, EEG.trials); + if isempty(frontal_channels_idx)==1 % check whether there is any frontal channel in dataset to check + warning('No frontal channels from the list present in the data. Only epoch interpolation will be performed.'); + else + % find artifaceted epochs by detecting outlier voltage in the specified channels list and remove epoch if artifacted in those channels + for ch =1:length(frontal_channels_idx) + EEG = pop_eegthresh(EEG,1, frontal_channels_idx(ch), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset( EEG ); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + for ii=1:size(badChans, 2) + badepoch(ii)=sum(badChans(:,ii)); + end + badepoch=logical(badepoch); + end + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch( EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + + if all_bad_epochs==1 + warning(['No usable data for datafile', datafile_names{subject}]); + else + % Interpolate artifacted data for all reaming channels + badChans = zeros(EEG.nbchan, EEG.trials); + % Find artifacted epochs by detecting outlier voltage but don't remove + for ch=1:EEG.nbchan + EEG = pop_eegthresh(EEG,1, ch, volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose(EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + tmpData = zeros(EEG.nbchan, EEG.pnts, EEG.trials); + for e = 1:EEG.trials + % Initialize variables EEGe and EEGe_interp; + EEGe = []; EEGe_interp = []; badChanNum = []; + % Select only this epoch (e) + EEGe = pop_selectevent( EEG, 'epoch', e, 'deleteevents', 'off', 'deleteepochs', 'on', 'invertepochs', 'off'); + badChanNum = find(badChans(:,e)==1); % find which channels are bad for this epoch + EEGe_interp = eeg_interp(EEGe,badChanNum); %interpolate the bad channels for this epoch + tmpData(:,:,e) = EEGe_interp.data; % store interpolated data into matrix + end + EEG.data = tmpData; % now that all of the epochs have been interpolated, write the data back to the main file + + % If more than 10% of channels in an epoch were interpolated, reject that epoch + badepoch=zeros(1, EEG.trials); + for ei=1:EEG.trials + NumbadChan = badChans(:,ei); % find how many channels are bad in an epoch + if sum(NumbadChan) > round((10/100)*EEG.nbchan)% check if more than 10% are bad + badepoch (ei)= sum(NumbadChan); + end + end + badepoch=logical(badepoch); + end + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + else % if no epoch level channel interpolation + EEG = pop_eegthresh(EEG, 1, (1:EEG.nbchan), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax, 0, 0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + end % end of epoch level channel interpolation if statement + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(EEG.reject.rejthresh)==EEG.trials || sum(EEG.reject.rejthresh)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG,(EEG.reject.rejthresh), 0); + EEG = eeg_checkset(EEG); + end + end % end of voltage threshold rejection if statement + + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'), 'filepath', [output_location filesep 'processed_data' filesep]); + + + + % if all epochs are found bad during artifact rejection + if all_bad_epochs==1 + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + else + total_epochs_after_artifact_rejection=EEG.trials; + end + + %% STEP 15: Interpolate deleted channels + if interp_channels==1 + EEG = eeg_interp(EEG, channels_analysed); + EEG = eeg_checkset(EEG); + end + if numel(FASTbadChans)==0 && numel(ica_prep_badChans)==0 + total_channels_interpolated=0; + else + total_channels_interpolated=numel(FASTbadChans)+ numel(ica_prep_badChans); + end + + %% STEP 16: Rereference data + if rerefer_data==1 + if iscell(reref)==1 + reref_idx=zeros(1, length(reref)); + for rr=1:length(reref) + reref_idx(rr)=find(strcmp({EEG.chanlocs.labels}, reref{rr})); + end + EEG = eeg_checkset(EEG); + EEG = pop_reref( EEG, reref_idx); + else + EEG = eeg_checkset(EEG); + EEG = pop_reref(EEG, reref); + end + end + + %% Save processed data + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_processed_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_processed_data.mat')], 'EEG'); % save .mat format + end + + %% create, write/append table on each iteration of loop + + %Create the report table for all the data files with relevant preprocessing outputs. + report_table=table({datafile_names{subject}}, {datetime('now')}, {reference_used_for_faster}, {faster_bad_channels}, {ica_preparation_bad_channels}, {length_ica_data}, ... + {total_ICs}, {ICs_removed}, {total_epochs_before_artifact_rejection}, {total_epochs_after_artifact_rejection}, {total_channels_interpolated}); + + report_table.Properties.VariableNames={'datafile_names', 'date_processed', 'reference_used_for_faster', 'faster_bad_channels', ... + 'ica_preparation_bad_channels', 'length_ica_data', 'total_ICs', 'ICs_removed', 'total_epochs_before_artifact_rejection', ... + 'total_epochs_after_artifact_rejection', 'total_channels_interpolated'}; + + %write/append table to disk + writetable(report_table, [output_location filesep 'MADE_preprocessing_report.csv'], "WriteMode", "append"); + % final_report_table = vertcat(final_report_table, report_table); + + + end % end of subject loop + + %writetable(final_report_table, [output_location filesep 'MADE_preprocessing_report.csv']); + + + +end diff --git a/code/thrive_eeg/MADE_pipeline_v1_0_thrive_01.m b/code/thrive_eeg/MADE_pipeline_v1_0_thrive_01.m new file mode 100644 index 0000000..0d7c37a --- /dev/null +++ b/code/thrive_eeg/MADE_pipeline_v1_0_thrive_01.m @@ -0,0 +1,913 @@ +%%to Run on FIU HPC% +% create a local cluster object +cluster = parcluster('local'); + +% start matlabpool with max workers set in the slurm file +parpool(cluster, str2num(getenv('SLURM_CPUS_ON_NODE'))) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This script was initially edited by George Buzzell for the NDC Lab EEG +% Training Workshop on 10/21, then modified by George Buzzell and Kianoosh Hosseini to preprocess THRIVE dataset. +% +% +% ************************************************************************ +% The Maryland Analysis of Developmental EEG (MADE) Pipeline +% Version 1.0 +% Developed at the Child Development Lab, University of Maryland, College Park + +% Contributors to MADE pipeline: +% Ranjan Debnath (rdebnath@umd.edu) +% George A. Buzzell (gbuzzell@umd.edu) +% Santiago Morales Pamplona (moraless@umd.edu) +% Stephanie Leach (sleach12@umd.edu) +% Maureen Elizabeth Bowers (mbowers1@umd.edu) +% Nathan A. Fox (fox@umd.edu) + +% MADE uses EEGLAB toolbox and some of its plugins. Before running the pipeline, you have to install the following: +% EEGLab: https://sccn.ucsd.edu/eeglab/downloadtoolbox.php/download.php + +% You also need to download the following plugins/extensions from here: https://sccn.ucsd.edu/wiki/EEGLAB_Extensions +% Specifically, download: +% MFFMatlabIO: https://github.com/arnodelorme/mffmatlabio/blob/master/README.txt +% FASTER: https://sourceforge.net/projects/faster/ +% ADJUST: https://www.nitrc.org/projects/adjust/ [Maybe we will replace this with our own GitHub link?] + +% After downloading these plugins (as zip files), you need to place it in the eeglab/plugins folder. +% For instance, for FASTER, you uncompress the downloaded extension file (e.g., 'FASTER.zip') and place it in the main EEGLAB "plugins" sub-directory/sub-folder. +% After placing all the required plugins, add the EEGLAB folder to your path by using the following code: + +% addpath(genpath(('...')) % Enter the path of the EEGLAB folder in this line +% Please cite the following references for in any manuscripts produced utilizing MADE pipeline: + +% EEGLAB: A Delorme & S Makeig (2004) EEGLAB: an open source toolbox for +% analysis of single-trial EEG dynamics. Journal of Neuroscience Methods, 134, 9?21. + +% firfilt (filter plugin): developed by Andreas Widmann (https://home.uni-leipzig.de/biocog/content/de/mitarbeiter/widmann/eeglab-plugins/) + +% FASTER: Nolan, H., Whelan, R., Reilly, R.B., 2010. FASTER: Fully Automated Statistical +% Thresholding for EEG artifact Rejection. Journal of Neuroscience Methods, 192, 152?162. + +% ADJUST: Mognon, A., Jovicich, J., Bruzzone, L., Buiatti, M., 2011. ADJUST: An automatic EEG +% artifact detector based on the joint use of spatial and temporal features. Psychophysiology, 48, 229?240. +% Our group has modified ADJUST plugin to improve selection of ICA components containing artifacts + +% This pipeline is released under the GNU General Public License version 3. + +% ************************************************************************ + +%% User input: user provide relevant information to be used for data processing +% Preprocessing of EEG data involves using some common parameters for +% every subject. This part of the script initializes the common parameters. + +clear % clear matlab workspace +clc % clear matlab command window + +%% MUST EDIT THIS +%running in "EEG_training" folder on your computer +main_dir = '/home/data/NDClab/datasets/thrive-dataset'; %directory on the HPC + +%% Setting up other things + +%Location of MADE and ADJUSTED-ADJUST scripts +addpath(genpath([main_dir filesep 'code' filesep 'thrive_eeg']));% enter the path of the folder in this line + +%Location of EEGlab +addpath(genpath([main_dir filesep 'code' filesep 'eeglab13_4_4b']));% enter the path of the EEGLAB folder in this line + +%remove path to octave functions inside matlab to prevent errors when +rmpath([main_dir filesep 'code' filesep 'eeglab13_4_4b' filesep 'functions' filesep 'octavefunc' filesep 'signal']) + +% 1. Enter the path of the folder that has the raw data to be analyzed +rawdata_location_parent = [main_dir filesep 'sourcedata' filesep 'raw' filesep 's1_r1' filesep 'eeg']; + +% 2. Enter the path of the channel location file +channel_locations = loadbvef('/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED-64only.bvef'); + + +%need to modify for social vs nonsocial + +% STIMULUS TRIGGERS +% passage text appears on-screen: 11 +% passage text disappears (participant proceeded to the next screen): 10 +% challenge text appears on-screen: 21 +% +% RESPONSE TRIGGERS +% error response to challenge question: 30 +% correct response to challenge question: 31 + +stimulus_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54'}; % enter the stimulus markers that need to be adjusted for time offset +response_markers = {}; % enter the response makers that need to be adjusted for time offset + +% 5. Do you want to down sample the data? +down_sample = 1; % 0 = NO (no down sampling), 1 = YES (down sampling) +sampling_rate = 1000; % set sampling rate (in Hz), if you want to down sample + +% 6. Do you want to delete the outer layer of the channels? (Rationale has been described in MADE manuscript) +% This fnction can also be used to down sample electrodes. For example, if EEG was recorded with 128 channels but you would +% like to analyse only 64 channels, you can assign the list of channnels to be excluded in the 'outerlayer_channel' variable. +% Can also use this to remove ocular channels if they are in non-standard +% locations +delete_outerlayer = 0; % 0 = NO (do not delete outer layer), 1 = YES (delete outerlayer); +% If you want to delete outer layer, make a list of channels to be deleted +outerlayer_channel = {'16','15','12','13','8','31','26','25','30','32','60','64','61','62','56','57','63','41','46','45','48'}; % list of channels + +% 7. Initialize the filters +highpass = .1; % High-pass frequency +lowpass = 49; % Low-pass frequency. We recommend low-pass filter at/below line noise frequency (see manuscript for detail) + +% 8. Are you processing task-related or resting-state EEG data? +task_eeg = 1; % 0 = resting, 1 = task +task_event_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54', 'S 11', 'S 12', 'S 21', 'S 22'}; % enter all the event/condition markers (i.e., stim + resp markers) + +% 9. Do you want to epoch/segment your data? +epoch_data = 1; % 0 = NO (do not epoch), 1 = YES (epoch data) +task_epoch_length = [-1 2]; % epoch length in second +dummy_events ={'999'}; % enter dummy events name + +% 10. Do you want to remove/correct baseline? +remove_baseline = 1; % 0 = NO (no baseline correction), 1 = YES (baseline correction) +baseline_window = []; % baseline period in milliseconds (MS) [] = entire epoch + +% 11. Do you want to remove artifact laden epoch based on voltage threshold? +voltthres_rejection = 1; % 0 = NO, 1 = YES +volt_threshold = [-125 125]; % lower and upper threshold (in ?V) + +% 12. Do you want to perform epoch level channel interpolation for artifact laden epoch? (see manuscript for detail) +interp_epoch = 1; % 0 = NO, 1 = YES. +frontal_channels = {'14','11','10','43','44','47'}; % If you set interp_epoch = 1, enter the list of frontal channels to check (see manuscript for detail) + +%13. Do you want to interpolate the bad channels that were removed from data? +interp_channels = 1; % 0 = NO (Do not interpolate), 1 = YES (interpolate missing channels) + +% 14. Do you want to rereference your data? +rerefer_data = 1; % 0 = NO, 1 = YES +reref=[]; % Enter electrode name/s or number/s to be used for rereferencing +% For channel name/s enter, reref = {'channel_name', 'channel_name'}; +% For channel number/s enter, reref = [channel_number, channel_number]; +% For average rereference enter, reref = []; default is average rereference + +% 15. Do you want to save interim results? +save_interim_result = 1; % 0 = NO (Do not save) 1 = YES (save interim results) + +% 16. How do you want to save your data? .set or .mat +output_format = 1; % 1 = .set (EEGLAB data structure), 2 = .mat (Matlab data structure) + +% ********* no need to edit beyond this point for EGI .mff data ********** +% ********* for non-.mff data format edit data import function *********** +% ********* below using relevant data import plugin from EEGLAB ********** + + +% List subject folders under EEG folder +cd (rawdata_location_parent) +data_folder_lists = dir; +data_folder_lists = data_folder_lists(~ismember({data_folder_lists.name},{'.', '..', '.DS_Store'})); +data_folder_lists = {data_folder_lists.name}; +data_folder_lists = string(data_folder_lists); +%for file_locater_counter = 1:length(data_folder_lists) % This for loop lists the folders containing the main data files +for file_locater_counter = 1:2 + rawdata_location = fullfile(rawdata_location_parent, data_folder_lists(file_locater_counter)); + rawdata_location = char(rawdata_location); + + % Enter the path of the folder where you want to save the processed data + output_location = [main_dir filesep 'derivatives' filesep 's1_r1' filesep 'eeg' filesep 'preprocessed' ]; + % update the output_location + output_location = fullfile(output_location, data_folder_lists(file_locater_counter)); + output_location = char(output_location); + + % Read files to analyses + datafile_names=dir([rawdata_location filesep '*.vhdr']); + datafile_names=datafile_names(~ismember({datafile_names.name},{'.', '..', '.DS_Store'})); + datafile_names={datafile_names.name}; + [filepath,name,ext] = fileparts(char(datafile_names{1})); + + + + + %% Check whether EEGLAB and all necessary plugins are in Matlab path. + if exist('eeglab','file')==0 + error(['Please make sure EEGLAB is on your Matlab path. Please see EEGLAB' ... + 'wiki page for download and instalation instructions']); + end + + if exist('pop_firws', 'file')==0 + error(['Please make sure "firfilt" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('channel_properties', 'file')==0 + error(['Please make sure "FASTER" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('ADJUST', 'file')==0 + error(['Please make sure you download modified "ADJUST" plugin from GitHub (link is in MADE manuscript)' ... + ' and ADJUST is in EEGLAB plugin folder and on Matlab path.']); + end + + %% Create output folders to save data + if save_interim_result == 1 + if exist([output_location filesep 'filtered_data'], 'dir') == 0 + mkdir([output_location filesep 'filtered_data']) + end + if exist([output_location filesep 'ica_data'], 'dir') == 0 + mkdir([output_location filesep 'ica_data']) + end + end + if exist([output_location filesep 'processed_data'], 'dir') == 0 + mkdir([output_location filesep 'processed_data']) + end + + %% Initialize output variables + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + %% Loop over all data files + + % switch to output directory + cd(output_location); + + for subject=1:length(datafile_names) + + %% Initialize EEG structurem, output variables, and report table + EEG=[]; %initialize eeg structure + report_table = []; %report table that will be created and writen to disk (appended) after processing completes for this participant + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + fprintf('\n\n\n*** Processing subject %d (%s) ***\n\n\n', subject, datafile_names{subject}); + + %% STEP 1: Import EEG data file and relevant information + + %load in raw data + EEG = pop_loadbv(rawdata_location, datafile_names{subject}); + EEG = eeg_checkset(EEG); + + %% STEP 4: Change sampling rate + if down_sample==1 + if floor(sampling_rate) > EEG.srate + error ('Sampling rate cannot be higher than recorded sampling rate'); + elseif floor(sampling_rate) ~= EEG.srate + EEG = pop_resample( EEG, sampling_rate); + EEG = eeg_checkset( EEG ); + end + end + %make a copy of GSR and sync channels, then delete from eeg structure + + gsrChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + + syncChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + %add in ref channels + origData = EEG.data; + [origData_NumRows, origData_NumCols] = size(origData); + EEG.data = NaN(origData_NumRows+1, origData_NumCols); + EEG.data(1,:) = 0; %add ref as zeros + EEG.data(2:end,:) = origData; %copy over orig EEG data + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + + %delete ground from newChanLocs + modNewChanlocs = channel_locations(2:end); + + %replace chanlocs with + EEG.chanlocs = modNewChanlocs; + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + %update/refresh eeglab and plot + %eeglab redraw + + % Check whether the channel locations were properly imported. The EEG signals and channel numbers should be same. + if size(EEG.data, 1) ~= length(EEG.chanlocs) + error('The size of the data does not match with channel numbers.'); + end + + %% STEP 1b: convert all type field markers to string (if not already) + + %loop through all the type markes, if numeric, convert to string + % (Given that this script assumes that "type" field markers are strings, we need to + % convert all type field markers to string, in case they are not + % already) + for atm=1:length({EEG.event.type}) + if isnumeric(EEG.event(atm).type) + EEG.event(atm).type = num2str(EEG.event(atm).type); + end + end + + + %% STEP 5: Delete outer layer of channels + chans_labels=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels{i}= EEG.chanlocs(i).labels; + end + + if delete_outerlayer==1 + [chans,chansidx] = ismember(outerlayer_channel, chans_labels); + outerlayer_channel_idx = chansidx(chansidx ~= 0); + if isempty(outerlayer_channel_idx)==1 + error(['None of the outer layer channels present in channel locations of data.'... + ' Make sure outer layer channels are present in channel labels of data (EEG.chanlocs.labels).']); + else + EEG = pop_select( EEG,'nochannel', outerlayer_channel_idx); + EEG = eeg_checkset( EEG ); + end + end + + %% STEP 6: Filter data + % Calculate filter order using the formula: m = dF / (df / fs), where m = filter order, + % df = transition band width, dF = normalized transition width, fs = sampling rate + % dF is specific for the window type. Hamming window dF = 3.3 + + high_transband = highpass; % high pass transition band + low_transband = 10; % low pass transition band + + hp_fl_order = 3.3 / (high_transband / EEG.srate); + lp_fl_order = 3.3 / (low_transband / EEG.srate); + + % Round filter order to next higher even integer. Filter order is always even integer. + if mod(floor(hp_fl_order),2) == 0 + hp_fl_order=floor(hp_fl_order); + elseif mod(floor(hp_fl_order),2) == 1 + hp_fl_order=floor(hp_fl_order)+1; + end + + if mod(floor(lp_fl_order),2) == 0 + lp_fl_order=floor(lp_fl_order)+2; + elseif mod(floor(lp_fl_order),2) == 1 + lp_fl_order=floor(lp_fl_order)+1; + end + + % Calculate cutoff frequency + high_cutoff = highpass/2; + low_cutoff = lowpass + (low_transband/2); + + % Performing high pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', high_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', hp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % + + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + % Performing low pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', low_cutoff, 'ftype', 'lowpass', 'wtype', 'hamming', 'forder', lp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % pop_firws() - transition band width: 10 Hz + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + %% STEP 7: Run faster to find bad channels + % First check whether reference channel (i.e. zeroed channels) is present in data + % reference channel is needed to run faster + ref_chan=[]; FASTbadChans=[]; all_chan_bad_FAST=0; + ref_chan=find(any(EEG.data, 2)==0); + if numel(ref_chan)>1 + error(['There are more than 1 zeroed channel (i.e. zero value throughout recording) in data.'... + ' Only reference channel should be zeroed channel. Delete the zeroed channel/s which is not reference channel.']); + elseif numel(ref_chan)==1 + list_properties = channel_properties(EEG, 1:EEG.nbchan, ref_chan); % run faster + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + FASTbadChans=FASTbadChans(FASTbadChans~=ref_chan); + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + % EEG = pop_select( EEG,'nochannel', ref_chan); % a bug [kia + % removed it as George said] + EEG = eeg_checkset(EEG); + channels_analysed=EEG.chanlocs; % keep full channel locations to use later for interpolation of bad channels + elseif numel(ref_chan)==0 + warning('Reference channel is not present in data. channel 1 will be used as reference channel.'); + ref_chan=find(strcmp({EEG.chanlocs.labels}, '1')); % find Cz channel index + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = pop_reref( EEG_copy, ref_chan,'keepref','on'); % rerefer to Cz in copied dataset + EEG_copy = eeg_checkset(EEG_copy); + list_properties = channel_properties(EEG_copy, 1:EEG_copy.nbchan, ref_chan); % run faster on copied dataset + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + channels_analysed=EEG.chanlocs; + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + end + + % If FASTER identifies all channels as bad channels, save the dataset + % at this stage and ignore the remaining of the preprocessing. + if numel(FASTbadChans)==EEG.nbchan || numel(FASTbadChans)+1==EEG.nbchan + all_chan_bad_FAST=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + else + % Reject channels that are bad as identified by Faster + EEG = pop_select( EEG,'nochannel', FASTbadChans); + EEG = eeg_checkset(EEG); + if numel(ref_chan)==1 + ref_chan=find(any(EEG.data, 2)==0); + EEG = pop_select( EEG,'nochannel', ref_chan); % remove reference channel + end + end + + if numel(FASTbadChans)==0 + faster_bad_channels='0'; + else + faster_bad_channels=num2str(FASTbadChans'); + end + + if all_chan_bad_FAST==1 + faster_bad_channels='0'; + ica_preparation_bad_channels='0'; + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next subject + end + + %% Save data after running filter and FASTER function, if saving interim results was preferred + if save_interim_result ==1 + if output_format==1 + EEG = eeg_checkset( EEG ); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_filtered_data')); + EEG = pop_saveset( EEG,'filename',strrep(datafile_names{subject}, ext, '_filtered_data.set'),'filepath', [output_location filesep 'filtered_data' filesep]); % save .set format + elseif output_format==2 + save([[output_location filesep 'filtered_data' filesep ] strrep(datafile_names{subject}, ext, '_filtered_data.mat')], 'EEG'); % save .mat format + end + end + + %% STEP 8: Prepare data for ICA + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = eeg_checkset(EEG_copy); + + % Perform 1Hz high pass filter on copied dataset + transband = 1; + fl_cutoff = transband/2; + fl_order = 3.3 / (transband / EEG.srate); + + if mod(floor(fl_order),2) == 0 + fl_order=floor(fl_order); + elseif mod(floor(fl_order),2) == 1 + fl_order=floor(fl_order)+1; + end + + EEG_copy = pop_firws(EEG_copy, 'fcutoff', fl_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', fl_order, 'minphase', 0); + EEG_copy = eeg_checkset(EEG_copy); + + % Create 1 second epoch + EEG_copy=eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + % Find bad epochs and delete them from dataset + vol_thrs = [-1000 1000]; % [lower upper] threshold limit(s) in mV. + emg_thrs = [-100 30]; % [lower upper] threshold limit(s) in dB. + emg_freqs_limit = [20 40]; % [lower upper] frequency limit(s) in Hz. + + % Find channel/s with xx% of artifacted 1-second epochs and delete them + chanCounter = 1; ica_prep_badChans = []; + numEpochs =EEG_copy.trials; % find the number of epochs + all_bad_channels=0; + + for ch=1:EEG_copy.nbchan + % Find artifaceted epochs by detecting outlier voltage + EEG_copy = pop_eegthresh(EEG_copy,1, ch, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax, 0, 0); + EEG_copy = eeg_checkset( EEG_copy ); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using thresholding of frequencies in the data. + % this method mainly rejects muscle movement (EMG) artifacts + EEG_copy = pop_rejspec( EEG_copy, 1,'elecrange',ch ,'method','fft','threshold', emg_thrs, 'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find number of artifacted epochs + EEG_copy = eeg_checkset( EEG_copy ); + EEG_copy = eeg_rejsuperpose( EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + artifacted_epochs=EEG_copy.reject.rejglobal; + + % Find bad channel / channel with more than 20% artifacted epochs + if sum(artifacted_epochs) > (numEpochs*20/100) + ica_prep_badChans(chanCounter) = ch; + chanCounter=chanCounter+1; + end + end + + % If all channels are bad, save the dataset at this stage and ignore the remaining of the preprocessing. + if numel(ica_prep_badChans)==EEG.nbchan || numel(ica_prep_badChans)+1==EEG.nbchan + all_bad_channels=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + + else + % Reject bad channel - channel with more than xx% artifacted epochs + EEG_copy = pop_select( EEG_copy,'nochannel', ica_prep_badChans); + EEG_copy = eeg_checkset(EEG_copy); + end + + if numel(ica_prep_badChans)==0 + ica_preparation_bad_channels='0'; + else + ica_preparation_bad_channels=num2str(ica_prep_badChans); + end + + if all_bad_channels == 1 + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + % Find the artifacted epochs across all channels and reject them before doing ICA. + EEG_copy = pop_eegthresh(EEG_copy,1, 1:EEG_copy.nbchan, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax,0,0); + EEG_copy = eeg_checkset(EEG_copy); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using power threshold in 20-40Hz frequency band. + % This method mainly rejects muscle movement (EMG) artifacts. + EEG_copy = pop_rejspec(EEG_copy, 1,'elecrange', 1:EEG_copy.nbchan, 'method', 'fft', 'threshold', emg_thrs ,'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find the number of artifacted epochs and reject them + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = eeg_rejsuperpose(EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + reject_artifacted_epochs=EEG_copy.reject.rejglobal; + EEG_copy = pop_rejepoch(EEG_copy, reject_artifacted_epochs, 0); + + %% STEP 9: Run ICA + length_ica_data=EEG_copy.trials; % length of data (in second) fed into ICA + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = pop_runica(EEG_copy, 'icatype', 'runica', 'extended', 1, 'stop', 1E-7, 'interupt','off'); + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'), 'filepath', [output_location filesep 'ica_data' filesep]); + + % Find the ICA weights that would be transferred to the original dataset + ICA_WINV=EEG_copy.icawinv; + ICA_SPHERE=EEG_copy.icasphere; + ICA_WEIGHTS=EEG_copy.icaweights; + ICA_CHANSIND=EEG_copy.icachansind; + + % If channels were removed from copied dataset during preparation of ica, then remove + % those channels from original dataset as well before transferring ica weights. + EEG = eeg_checkset(EEG); + EEG = pop_select(EEG,'nochannel', ica_prep_badChans); + + % Transfer the ICA weights of the copied dataset to the original dataset + EEG.icawinv=ICA_WINV; + EEG.icasphere=ICA_SPHERE; + EEG.icaweights=ICA_WEIGHTS; + EEG.icachansind=ICA_CHANSIND; + EEG = eeg_checkset(EEG); + + %% STEP 10: Run adjust to find artifacted ICA components + badICs=[]; EEG_copy =[]; + EEG_copy = EEG; + EEG_copy = eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + if save_interim_result==1 + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'ica_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + else + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'processed_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + end + close all; + + + + % Mark the bad ICs found by ADJUST + for ic=1:length(badICs) + EEG.reject.gcompreject(1, badICs(ic))=1; + EEG = eeg_checkset(EEG); + end + total_ICs=size(EEG.icasphere, 1); + if numel(badICs)==0 + ICs_removed='0'; + else + ICs_removed=num2str(double(badICs)); + end + + %% Save dataset after ICA, if saving interim results was preferred + if save_interim_result==1 + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_ica_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'ica_data' filesep ] strrep(datafile_names{subject}, ext, '_ica_data.mat')], 'EEG'); % save .mat format + end + end + + %Ran up to here.... + + %no manual review/selection of ica artifact performed... + + + + %% STEP 11: Remove artifacted ICA components from data + all_bad_ICs=0; + ICs2remove=find(EEG.reject.gcompreject); % find ICs to remove + + % If all ICs and bad, save data at this stage and ignore rest of the preprocessing for this subject. + if numel(ICs2remove)==total_ICs + all_bad_ICs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.mat')], 'EEG'); % save .mat format + end + else + EEG = eeg_checkset( EEG ); + EEG = pop_subcomp( EEG, ICs2remove, 0); % remove ICs from dataset + end + + if all_bad_ICs==1 + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + %% STEP 12: Segment data into fixed length epochs + + %run event labeling script + edit_event_markers_thrive + + if epoch_data==1 + if task_eeg ==1 % task eeg + EEG = eeg_checkset(EEG); + EEG = pop_epoch(EEG, task_event_markers, task_epoch_length, 'epochinfo', 'yes'); + elseif task_eeg==0 % resting eeg + if overlap_epoch==1 + EEG=eeg_regepochs(EEG,'recurrence',(rest_epoch_length/2),'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + else + EEG=eeg_regepochs(EEG,'recurrence',rest_epoch_length,'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + end + end + end + + total_epochs_before_artifact_rejection=EEG.trials; + + %% STEP 13: Remove baseline + if remove_baseline==1 + EEG = eeg_checkset( EEG ); + EEG = pop_rmbase( EEG, baseline_window); + end + + %% STEP 14: Artifact rejection + all_bad_epochs=0; + if voltthres_rejection==1 % check voltage threshold rejection + if interp_epoch==1 % check epoch level channel interpolation + chans=[]; chansidx=[];chans_labels2=[]; + chans_labels2=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels2{i}= EEG.chanlocs(i).labels; + end + [chans,chansidx] = ismember(frontal_channels, chans_labels2); + frontal_channels_idx = chansidx(chansidx ~= 0); + badChans = zeros(EEG.nbchan, EEG.trials); + badepoch=zeros(1, EEG.trials); + if isempty(frontal_channels_idx)==1 % check whether there is any frontal channel in dataset to check + warning('No frontal channels from the list present in the data. Only epoch interpolation will be performed.'); + else + % find artifaceted epochs by detecting outlier voltage in the specified channels list and remove epoch if artifacted in those channels + for ch =1:length(frontal_channels_idx) + EEG = pop_eegthresh(EEG,1, frontal_channels_idx(ch), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset( EEG ); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + for ii=1:size(badChans, 2) + badepoch(ii)=sum(badChans(:,ii)); + end + badepoch=logical(badepoch); + end + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch( EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + + if all_bad_epochs==1 + warning(['No usable data for datafile', datafile_names{subject}]); + else + % Interpolate artifacted data for all reaming channels + badChans = zeros(EEG.nbchan, EEG.trials); + % Find artifacted epochs by detecting outlier voltage but don't remove + for ch=1:EEG.nbchan + EEG = pop_eegthresh(EEG,1, ch, volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose(EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + tmpData = zeros(EEG.nbchan, EEG.pnts, EEG.trials); + for e = 1:EEG.trials + % Initialize variables EEGe and EEGe_interp; + EEGe = []; EEGe_interp = []; badChanNum = []; + % Select only this epoch (e) + EEGe = pop_selectevent( EEG, 'epoch', e, 'deleteevents', 'off', 'deleteepochs', 'on', 'invertepochs', 'off'); + badChanNum = find(badChans(:,e)==1); % find which channels are bad for this epoch + EEGe_interp = eeg_interp(EEGe,badChanNum); %interpolate the bad channels for this epoch + tmpData(:,:,e) = EEGe_interp.data; % store interpolated data into matrix + end + EEG.data = tmpData; % now that all of the epochs have been interpolated, write the data back to the main file + + % If more than 10% of channels in an epoch were interpolated, reject that epoch + badepoch=zeros(1, EEG.trials); + for ei=1:EEG.trials + NumbadChan = badChans(:,ei); % find how many channels are bad in an epoch + if sum(NumbadChan) > round((10/100)*EEG.nbchan)% check if more than 10% are bad + badepoch (ei)= sum(NumbadChan); + end + end + badepoch=logical(badepoch); + end + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + else % if no epoch level channel interpolation + EEG = pop_eegthresh(EEG, 1, (1:EEG.nbchan), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax, 0, 0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + end % end of epoch level channel interpolation if statement + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(EEG.reject.rejthresh)==EEG.trials || sum(EEG.reject.rejthresh)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG,(EEG.reject.rejthresh), 0); + EEG = eeg_checkset(EEG); + end + end % end of voltage threshold rejection if statement + + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'), 'filepath', [output_location filesep 'processed_data' filesep]); + + + + % if all epochs are found bad during artifact rejection + if all_bad_epochs==1 + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + else + total_epochs_after_artifact_rejection=EEG.trials; + end + + %% STEP 15: Interpolate deleted channels + if interp_channels==1 + EEG = eeg_interp(EEG, channels_analysed); + EEG = eeg_checkset(EEG); + end + if numel(FASTbadChans)==0 && numel(ica_prep_badChans)==0 + total_channels_interpolated=0; + else + total_channels_interpolated=numel(FASTbadChans)+ numel(ica_prep_badChans); + end + + %% STEP 16: Rereference data + if rerefer_data==1 + if iscell(reref)==1 + reref_idx=zeros(1, length(reref)); + for rr=1:length(reref) + reref_idx(rr)=find(strcmp({EEG.chanlocs.labels}, reref{rr})); + end + EEG = eeg_checkset(EEG); + EEG = pop_reref( EEG, reref_idx); + else + EEG = eeg_checkset(EEG); + EEG = pop_reref(EEG, reref); + end + end + + %% Save processed data + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_processed_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_processed_data.mat')], 'EEG'); % save .mat format + end + + %% create, write/append table on each iteration of loop + + %Create the report table for all the data files with relevant preprocessing outputs. + report_table=table({datafile_names{subject}}, {datetime('now')}, {reference_used_for_faster}, {faster_bad_channels}, {ica_preparation_bad_channels}, {length_ica_data}, ... + {total_ICs}, {ICs_removed}, {total_epochs_before_artifact_rejection}, {total_epochs_after_artifact_rejection}, {total_channels_interpolated}); + + report_table.Properties.VariableNames={'datafile_names', 'date_processed', 'reference_used_for_faster', 'faster_bad_channels', ... + 'ica_preparation_bad_channels', 'length_ica_data', 'total_ICs', 'ICs_removed', 'total_epochs_before_artifact_rejection', ... + 'total_epochs_after_artifact_rejection', 'total_channels_interpolated'}; + + %write/append table to disk + writetable(report_table, [output_location filesep 'MADE_preprocessing_report.csv'], "WriteMode", "append"); + % final_report_table = vertcat(final_report_table, report_table); + + + end % end of subject loop + + %writetable(final_report_table, [output_location filesep 'MADE_preprocessing_report.csv']); + + + +end + \ No newline at end of file diff --git a/code/thrive_eeg/MADE_pipeline_v1_0_thrive_02.m b/code/thrive_eeg/MADE_pipeline_v1_0_thrive_02.m new file mode 100644 index 0000000..eb5d4f9 --- /dev/null +++ b/code/thrive_eeg/MADE_pipeline_v1_0_thrive_02.m @@ -0,0 +1,916 @@ +%%to Run on FIU HPC% +% create a local cluster object +cluster = parcluster('local'); + +% start matlabpool with max workers set in the slurm file +parpool(cluster, str2num(getenv('SLURM_CPUS_ON_NODE'))) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This script was initially edited by George Buzzell for the NDC Lab EEG +% Training Workshop on 10/21, then modified by George Buzzell and Kianoosh Hosseini to preprocess THRIVE dataset. +% +% +% ************************************************************************ +% The Maryland Analysis of Developmental EEG (MADE) Pipeline +% Version 1.0 +% Developed at the Child Development Lab, University of Maryland, College Park + +% Contributors to MADE pipeline: +% Ranjan Debnath (rdebnath@umd.edu) +% George A. Buzzell (gbuzzell@umd.edu) +% Santiago Morales Pamplona (moraless@umd.edu) +% Stephanie Leach (sleach12@umd.edu) +% Maureen Elizabeth Bowers (mbowers1@umd.edu) +% Nathan A. Fox (fox@umd.edu) + +% MADE uses EEGLAB toolbox and some of its plugins. Before running the pipeline, you have to install the following: +% EEGLab: https://sccn.ucsd.edu/eeglab/downloadtoolbox.php/download.php + +% You also need to download the following plugins/extensions from here: https://sccn.ucsd.edu/wiki/EEGLAB_Extensions +% Specifically, download: +% MFFMatlabIO: https://github.com/arnodelorme/mffmatlabio/blob/master/README.txt +% FASTER: https://sourceforge.net/projects/faster/ +% ADJUST: https://www.nitrc.org/projects/adjust/ [Maybe we will replace this with our own GitHub link?] + +% After downloading these plugins (as zip files), you need to place it in the eeglab/plugins folder. +% For instance, for FASTER, you uncompress the downloaded extension file (e.g., 'FASTER.zip') and place it in the main EEGLAB "plugins" sub-directory/sub-folder. +% After placing all the required plugins, add the EEGLAB folder to your path by using the following code: + +% addpath(genpath(('...')) % Enter the path of the EEGLAB folder in this line +% Please cite the following references for in any manuscripts produced utilizing MADE pipeline: + +% EEGLAB: A Delorme & S Makeig (2004) EEGLAB: an open source toolbox for +% analysis of single-trial EEG dynamics. Journal of Neuroscience Methods, 134, 9?21. + +% firfilt (filter plugin): developed by Andreas Widmann (https://home.uni-leipzig.de/biocog/content/de/mitarbeiter/widmann/eeglab-plugins/) + +% FASTER: Nolan, H., Whelan, R., Reilly, R.B., 2010. FASTER: Fully Automated Statistical +% Thresholding for EEG artifact Rejection. Journal of Neuroscience Methods, 192, 152?162. + +% ADJUST: Mognon, A., Jovicich, J., Bruzzone, L., Buiatti, M., 2011. ADJUST: An automatic EEG +% artifact detector based on the joint use of spatial and temporal features. Psychophysiology, 48, 229?240. +% Our group has modified ADJUST plugin to improve selection of ICA components containing artifacts + +% This pipeline is released under the GNU General Public License version 3. + +% ************************************************************************ + +%% User input: user provide relevant information to be used for data processing +% Preprocessing of EEG data involves using some common parameters for +% every subject. This part of the script initializes the common parameters. + +clear % clear matlab workspace +clc % clear matlab command window + +%% MUST EDIT THIS +%running in "EEG_training" folder on your computer +main_dir = '/home/data/NDClab/datasets/thrive-dataset'; %directory on the HPC + +%% Setting up other things + +%Location of MADE and ADJUSTED-ADJUST scripts +addpath(genpath([main_dir filesep 'code' filesep 'thrive_eeg']));% enter the path of the folder in this line + +%Location of EEGlab +addpath(genpath([main_dir filesep 'code' filesep 'eeglab13_4_4b']));% enter the path of the EEGLAB folder in this line + +%remove path to octave functions inside matlab to prevent errors when +rmpath([main_dir filesep 'code' filesep 'eeglab13_4_4b' filesep 'functions' filesep 'octavefunc' filesep 'signal']) + +% 1. Enter the path of the folder that has the raw data to be analyzed +rawdata_location_parent = [main_dir filesep 'sourcedata' filesep 'raw' filesep 's1_r1' filesep 'eeg']; + +% 2. Enter the path of the channel location file +channel_locations = loadbvef('/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED-64only.bvef'); + + +%need to modify for social vs nonsocial + +% STIMULUS TRIGGERS +% passage text appears on-screen: 11 +% passage text disappears (participant proceeded to the next screen): 10 +% challenge text appears on-screen: 21 +% +% RESPONSE TRIGGERS +% error response to challenge question: 30 +% correct response to challenge question: 31 + +stimulus_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54'}; % enter the stimulus markers that need to be adjusted for time offset +response_markers = {}; % enter the response makers that need to be adjusted for time offset + +% 5. Do you want to down sample the data? +down_sample = 1; % 0 = NO (no down sampling), 1 = YES (down sampling) +sampling_rate = 1000; % set sampling rate (in Hz), if you want to down sample + +% 6. Do you want to delete the outer layer of the channels? (Rationale has been described in MADE manuscript) +% This fnction can also be used to down sample electrodes. For example, if EEG was recorded with 128 channels but you would +% like to analyse only 64 channels, you can assign the list of channnels to be excluded in the 'outerlayer_channel' variable. +% Can also use this to remove ocular channels if they are in non-standard +% locations +delete_outerlayer = 0; % 0 = NO (do not delete outer layer), 1 = YES (delete outerlayer); +% If you want to delete outer layer, make a list of channels to be deleted +outerlayer_channel = {'16','15','12','13','8','31','26','25','30','32','60','64','61','62','56','57','63','41','46','45','48'}; % list of channels + +% 7. Initialize the filters +highpass = .1; % High-pass frequency +lowpass = 49; % Low-pass frequency. We recommend low-pass filter at/below line noise frequency (see manuscript for detail) + +% 8. Are you processing task-related or resting-state EEG data? +task_eeg = 1; % 0 = resting, 1 = task +task_event_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54', 'S 11', 'S 12', 'S 21', 'S 22'}; % enter all the event/condition markers (i.e., stim + resp markers) + +% 9. Do you want to epoch/segment your data? +epoch_data = 1; % 0 = NO (do not epoch), 1 = YES (epoch data) +task_epoch_length = [-1 2]; % epoch length in second +dummy_events ={'999'}; % enter dummy events name + +% 10. Do you want to remove/correct baseline? +remove_baseline = 1; % 0 = NO (no baseline correction), 1 = YES (baseline correction) +baseline_window = []; % baseline period in milliseconds (MS) [] = entire epoch + +% 11. Do you want to remove artifact laden epoch based on voltage threshold? +voltthres_rejection = 1; % 0 = NO, 1 = YES +volt_threshold = [-125 125]; % lower and upper threshold (in ?V) + +% 12. Do you want to perform epoch level channel interpolation for artifact laden epoch? (see manuscript for detail) +interp_epoch = 1; % 0 = NO, 1 = YES. +frontal_channels = {'14','11','10','43','44','47'}; % If you set interp_epoch = 1, enter the list of frontal channels to check (see manuscript for detail) + +%13. Do you want to interpolate the bad channels that were removed from data? +interp_channels = 1; % 0 = NO (Do not interpolate), 1 = YES (interpolate missing channels) + +% 14. Do you want to rereference your data? +rerefer_data = 1; % 0 = NO, 1 = YES +reref=[]; % Enter electrode name/s or number/s to be used for rereferencing +% For channel name/s enter, reref = {'channel_name', 'channel_name'}; +% For channel number/s enter, reref = [channel_number, channel_number]; +% For average rereference enter, reref = []; default is average rereference + +% 15. Do you want to save interim results? +save_interim_result = 1; % 0 = NO (Do not save) 1 = YES (save interim results) + +% 16. How do you want to save your data? .set or .mat +output_format = 1; % 1 = .set (EEGLAB data structure), 2 = .mat (Matlab data structure) + +% ********* no need to edit beyond this point for EGI .mff data ********** +% ********* for non-.mff data format edit data import function *********** +% ********* below using relevant data import plugin from EEGLAB ********** + + +% List subject folders under EEG folder +cd (rawdata_location_parent) +data_folder_lists = dir; +data_folder_lists = data_folder_lists(~ismember({data_folder_lists.name},{'.', '..', '.DS_Store'})); +data_folder_lists = {data_folder_lists.name}; +data_folder_lists = string(data_folder_lists); +%for file_locater_counter = 1:length(data_folder_lists) % This for loop lists the folders containing the main data files +for file_locater_counter = 4:-1:3 + rawdata_location = fullfile(rawdata_location_parent, data_folder_lists(file_locater_counter)); + rawdata_location = char(rawdata_location); + + % Enter the path of the folder where you want to save the processed data + output_location = [main_dir filesep 'derivatives' filesep 's1_r1' filesep 'eeg' filesep 'preprocessed' ]; + % update the output_location + output_location = fullfile(output_location, data_folder_lists(file_locater_counter)); + output_location = char(output_location); + + % Read files to analyses + datafile_names=dir([rawdata_location filesep '*.vhdr']); + datafile_names=datafile_names(~ismember({datafile_names.name},{'.', '..', '.DS_Store'})); + datafile_names={datafile_names.name}; + [filepath,name,ext] = fileparts(char(datafile_names{1})); + + + + + %% Check whether EEGLAB and all necessary plugins are in Matlab path. + if exist('eeglab','file')==0 + error(['Please make sure EEGLAB is on your Matlab path. Please see EEGLAB' ... + 'wiki page for download and instalation instructions']); + end + + if exist('pop_firws', 'file')==0 + error(['Please make sure "firfilt" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('channel_properties', 'file')==0 + error(['Please make sure "FASTER" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('ADJUST', 'file')==0 + error(['Please make sure you download modified "ADJUST" plugin from GitHub (link is in MADE manuscript)' ... + ' and ADJUST is in EEGLAB plugin folder and on Matlab path.']); + end + + %% Create output folders to save data + if save_interim_result == 1 + if exist([output_location filesep 'filtered_data'], 'dir') == 0 + mkdir([output_location filesep 'filtered_data']) + end + if exist([output_location filesep 'ica_data'], 'dir') == 0 + mkdir([output_location filesep 'ica_data']) + end + end + if exist([output_location filesep 'processed_data'], 'dir') == 0 + mkdir([output_location filesep 'processed_data']) + end + + %% Initialize output variables + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + %% Loop over all data files + + % switch to output directory + cd(output_location); + + for subject=1:length(datafile_names) + + %% Initialize EEG structurem, output variables, and report table + EEG=[]; %initialize eeg structure + report_table = []; %report table that will be created and writen to disk (appended) after processing completes for this participant + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + fprintf('\n\n\n*** Processing subject %d (%s) ***\n\n\n', subject, datafile_names{subject}); + + %% STEP 1: Import EEG data file and relevant information + + %load in raw data + EEG = pop_loadbv(rawdata_location, datafile_names{subject}); + EEG = eeg_checkset(EEG); + + %% STEP 4: Change sampling rate + if down_sample==1 + if floor(sampling_rate) > EEG.srate + error ('Sampling rate cannot be higher than recorded sampling rate'); + elseif floor(sampling_rate) ~= EEG.srate + EEG = pop_resample( EEG, sampling_rate); + EEG = eeg_checkset( EEG ); + end + end + + %make a copy of GSR and sync channels, then delete from eeg structure + + gsrChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + + syncChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + %for debugging only: + %save('pulseChan', 'pulseChan'); + + %add in ref channels + origData = EEG.data; + [origData_NumRows, origData_NumCols] = size(origData); + EEG.data = NaN(origData_NumRows+1, origData_NumCols); + EEG.data(1,:) = 0; %add ref as zeros + EEG.data(2:end,:) = origData; %copy over orig EEG data + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + + %delete ground from newChanLocs + modNewChanlocs = channel_locations(2:end); + + %replace chanlocs with + EEG.chanlocs = modNewChanlocs; + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + %update/refresh eeglab and plot + %eeglab redraw + + % Check whether the channel locations were properly imported. The EEG signals and channel numbers should be same. + if size(EEG.data, 1) ~= length(EEG.chanlocs) + error('The size of the data does not match with channel numbers.'); + end + + %% STEP 1b: convert all type field markers to string (if not already) + + %loop through all the type markes, if numeric, convert to string + % (Given that this script assumes that "type" field markers are strings, we need to + % convert all type field markers to string, in case they are not + % already) + for atm=1:length({EEG.event.type}) + if isnumeric(EEG.event(atm).type) + EEG.event(atm).type = num2str(EEG.event(atm).type); + end + end + + + %% STEP 5: Delete outer layer of channels + chans_labels=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels{i}= EEG.chanlocs(i).labels; + end + + if delete_outerlayer==1 + [chans,chansidx] = ismember(outerlayer_channel, chans_labels); + outerlayer_channel_idx = chansidx(chansidx ~= 0); + if isempty(outerlayer_channel_idx)==1 + error(['None of the outer layer channels present in channel locations of data.'... + ' Make sure outer layer channels are present in channel labels of data (EEG.chanlocs.labels).']); + else + EEG = pop_select( EEG,'nochannel', outerlayer_channel_idx); + EEG = eeg_checkset( EEG ); + end + end + + %% STEP 6: Filter data + % Calculate filter order using the formula: m = dF / (df / fs), where m = filter order, + % df = transition band width, dF = normalized transition width, fs = sampling rate + % dF is specific for the window type. Hamming window dF = 3.3 + + high_transband = highpass; % high pass transition band + low_transband = 10; % low pass transition band + + hp_fl_order = 3.3 / (high_transband / EEG.srate); + lp_fl_order = 3.3 / (low_transband / EEG.srate); + + % Round filter order to next higher even integer. Filter order is always even integer. + if mod(floor(hp_fl_order),2) == 0 + hp_fl_order=floor(hp_fl_order); + elseif mod(floor(hp_fl_order),2) == 1 + hp_fl_order=floor(hp_fl_order)+1; + end + + if mod(floor(lp_fl_order),2) == 0 + lp_fl_order=floor(lp_fl_order)+2; + elseif mod(floor(lp_fl_order),2) == 1 + lp_fl_order=floor(lp_fl_order)+1; + end + + % Calculate cutoff frequency + high_cutoff = highpass/2; + low_cutoff = lowpass + (low_transband/2); + + % Performing high pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', high_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', hp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % + + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + % Performing low pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', low_cutoff, 'ftype', 'lowpass', 'wtype', 'hamming', 'forder', lp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % pop_firws() - transition band width: 10 Hz + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + %% STEP 7: Run faster to find bad channels + % First check whether reference channel (i.e. zeroed channels) is present in data + % reference channel is needed to run faster + ref_chan=[]; FASTbadChans=[]; all_chan_bad_FAST=0; + ref_chan=find(any(EEG.data, 2)==0); + if numel(ref_chan)>1 + error(['There are more than 1 zeroed channel (i.e. zero value throughout recording) in data.'... + ' Only reference channel should be zeroed channel. Delete the zeroed channel/s which is not reference channel.']); + elseif numel(ref_chan)==1 + list_properties = channel_properties(EEG, 1:EEG.nbchan, ref_chan); % run faster + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + FASTbadChans=FASTbadChans(FASTbadChans~=ref_chan); + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + % EEG = pop_select( EEG,'nochannel', ref_chan); % a bug [kia + % removed it as George said] + EEG = eeg_checkset(EEG); + channels_analysed=EEG.chanlocs; % keep full channel locations to use later for interpolation of bad channels + elseif numel(ref_chan)==0 + warning('Reference channel is not present in data. channel 1 will be used as reference channel.'); + ref_chan=find(strcmp({EEG.chanlocs.labels}, '1')); % find Cz channel index + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = pop_reref( EEG_copy, ref_chan,'keepref','on'); % rerefer to Cz in copied dataset + EEG_copy = eeg_checkset(EEG_copy); + list_properties = channel_properties(EEG_copy, 1:EEG_copy.nbchan, ref_chan); % run faster on copied dataset + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + channels_analysed=EEG.chanlocs; + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + end + + % If FASTER identifies all channels as bad channels, save the dataset + % at this stage and ignore the remaining of the preprocessing. + if numel(FASTbadChans)==EEG.nbchan || numel(FASTbadChans)+1==EEG.nbchan + all_chan_bad_FAST=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + else + % Reject channels that are bad as identified by Faster + EEG = pop_select( EEG,'nochannel', FASTbadChans); + EEG = eeg_checkset(EEG); + if numel(ref_chan)==1 + ref_chan=find(any(EEG.data, 2)==0); + EEG = pop_select( EEG,'nochannel', ref_chan); % remove reference channel + end + end + + if numel(FASTbadChans)==0 + faster_bad_channels='0'; + else + faster_bad_channels=num2str(FASTbadChans'); + end + + if all_chan_bad_FAST==1 + faster_bad_channels='0'; + ica_preparation_bad_channels='0'; + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next subject + end + + %% Save data after running filter and FASTER function, if saving interim results was preferred + if save_interim_result ==1 + if output_format==1 + EEG = eeg_checkset( EEG ); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_filtered_data')); + EEG = pop_saveset( EEG,'filename',strrep(datafile_names{subject}, ext, '_filtered_data.set'),'filepath', [output_location filesep 'filtered_data' filesep]); % save .set format + elseif output_format==2 + save([[output_location filesep 'filtered_data' filesep ] strrep(datafile_names{subject}, ext, '_filtered_data.mat')], 'EEG'); % save .mat format + end + end + + %% STEP 8: Prepare data for ICA + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = eeg_checkset(EEG_copy); + + % Perform 1Hz high pass filter on copied dataset + transband = 1; + fl_cutoff = transband/2; + fl_order = 3.3 / (transband / EEG.srate); + + if mod(floor(fl_order),2) == 0 + fl_order=floor(fl_order); + elseif mod(floor(fl_order),2) == 1 + fl_order=floor(fl_order)+1; + end + + EEG_copy = pop_firws(EEG_copy, 'fcutoff', fl_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', fl_order, 'minphase', 0); + EEG_copy = eeg_checkset(EEG_copy); + + % Create 1 second epoch + EEG_copy=eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + % Find bad epochs and delete them from dataset + vol_thrs = [-1000 1000]; % [lower upper] threshold limit(s) in mV. + emg_thrs = [-100 30]; % [lower upper] threshold limit(s) in dB. + emg_freqs_limit = [20 40]; % [lower upper] frequency limit(s) in Hz. + + % Find channel/s with xx% of artifacted 1-second epochs and delete them + chanCounter = 1; ica_prep_badChans = []; + numEpochs =EEG_copy.trials; % find the number of epochs + all_bad_channels=0; + + for ch=1:EEG_copy.nbchan + % Find artifaceted epochs by detecting outlier voltage + EEG_copy = pop_eegthresh(EEG_copy,1, ch, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax, 0, 0); + EEG_copy = eeg_checkset( EEG_copy ); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using thresholding of frequencies in the data. + % this method mainly rejects muscle movement (EMG) artifacts + EEG_copy = pop_rejspec( EEG_copy, 1,'elecrange',ch ,'method','fft','threshold', emg_thrs, 'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find number of artifacted epochs + EEG_copy = eeg_checkset( EEG_copy ); + EEG_copy = eeg_rejsuperpose( EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + artifacted_epochs=EEG_copy.reject.rejglobal; + + % Find bad channel / channel with more than 20% artifacted epochs + if sum(artifacted_epochs) > (numEpochs*20/100) + ica_prep_badChans(chanCounter) = ch; + chanCounter=chanCounter+1; + end + end + + % If all channels are bad, save the dataset at this stage and ignore the remaining of the preprocessing. + if numel(ica_prep_badChans)==EEG.nbchan || numel(ica_prep_badChans)+1==EEG.nbchan + all_bad_channels=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + + else + % Reject bad channel - channel with more than xx% artifacted epochs + EEG_copy = pop_select( EEG_copy,'nochannel', ica_prep_badChans); + EEG_copy = eeg_checkset(EEG_copy); + end + + if numel(ica_prep_badChans)==0 + ica_preparation_bad_channels='0'; + else + ica_preparation_bad_channels=num2str(ica_prep_badChans); + end + + if all_bad_channels == 1 + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + % Find the artifacted epochs across all channels and reject them before doing ICA. + EEG_copy = pop_eegthresh(EEG_copy,1, 1:EEG_copy.nbchan, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax,0,0); + EEG_copy = eeg_checkset(EEG_copy); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using power threshold in 20-40Hz frequency band. + % This method mainly rejects muscle movement (EMG) artifacts. + EEG_copy = pop_rejspec(EEG_copy, 1,'elecrange', 1:EEG_copy.nbchan, 'method', 'fft', 'threshold', emg_thrs ,'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find the number of artifacted epochs and reject them + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = eeg_rejsuperpose(EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + reject_artifacted_epochs=EEG_copy.reject.rejglobal; + EEG_copy = pop_rejepoch(EEG_copy, reject_artifacted_epochs, 0); + + %% STEP 9: Run ICA + length_ica_data=EEG_copy.trials; % length of data (in second) fed into ICA + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = pop_runica(EEG_copy, 'icatype', 'runica', 'extended', 1, 'stop', 1E-7, 'interupt','off'); + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'), 'filepath', [output_location filesep 'ica_data' filesep]); + + % Find the ICA weights that would be transferred to the original dataset + ICA_WINV=EEG_copy.icawinv; + ICA_SPHERE=EEG_copy.icasphere; + ICA_WEIGHTS=EEG_copy.icaweights; + ICA_CHANSIND=EEG_copy.icachansind; + + % If channels were removed from copied dataset during preparation of ica, then remove + % those channels from original dataset as well before transferring ica weights. + EEG = eeg_checkset(EEG); + EEG = pop_select(EEG,'nochannel', ica_prep_badChans); + + % Transfer the ICA weights of the copied dataset to the original dataset + EEG.icawinv=ICA_WINV; + EEG.icasphere=ICA_SPHERE; + EEG.icaweights=ICA_WEIGHTS; + EEG.icachansind=ICA_CHANSIND; + EEG = eeg_checkset(EEG); + + %% STEP 10: Run adjust to find artifacted ICA components + badICs=[]; EEG_copy =[]; + EEG_copy = EEG; + EEG_copy = eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + if save_interim_result==1 + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'ica_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + else + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'processed_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + end + close all; + + + + % Mark the bad ICs found by ADJUST + for ic=1:length(badICs) + EEG.reject.gcompreject(1, badICs(ic))=1; + EEG = eeg_checkset(EEG); + end + total_ICs=size(EEG.icasphere, 1); + if numel(badICs)==0 + ICs_removed='0'; + else + ICs_removed=num2str(double(badICs)); + end + + %% Save dataset after ICA, if saving interim results was preferred + if save_interim_result==1 + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_ica_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'ica_data' filesep ] strrep(datafile_names{subject}, ext, '_ica_data.mat')], 'EEG'); % save .mat format + end + end + + %Ran up to here.... + + %no manual review/selection of ica artifact performed... + + + + %% STEP 11: Remove artifacted ICA components from data + all_bad_ICs=0; + ICs2remove=find(EEG.reject.gcompreject); % find ICs to remove + + % If all ICs and bad, save data at this stage and ignore rest of the preprocessing for this subject. + if numel(ICs2remove)==total_ICs + all_bad_ICs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.mat')], 'EEG'); % save .mat format + end + else + EEG = eeg_checkset( EEG ); + EEG = pop_subcomp( EEG, ICs2remove, 0); % remove ICs from dataset + end + + if all_bad_ICs==1 + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + %% STEP 12: Segment data into fixed length epochs + + %run event labeling script + edit_event_markers_thrive + + if epoch_data==1 + if task_eeg ==1 % task eeg + EEG = eeg_checkset(EEG); + EEG = pop_epoch(EEG, task_event_markers, task_epoch_length, 'epochinfo', 'yes'); + elseif task_eeg==0 % resting eeg + if overlap_epoch==1 + EEG=eeg_regepochs(EEG,'recurrence',(rest_epoch_length/2),'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + else + EEG=eeg_regepochs(EEG,'recurrence',rest_epoch_length,'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + end + end + end + + total_epochs_before_artifact_rejection=EEG.trials; + + %% STEP 13: Remove baseline + if remove_baseline==1 + EEG = eeg_checkset( EEG ); + EEG = pop_rmbase( EEG, baseline_window); + end + + %% STEP 14: Artifact rejection + all_bad_epochs=0; + if voltthres_rejection==1 % check voltage threshold rejection + if interp_epoch==1 % check epoch level channel interpolation + chans=[]; chansidx=[];chans_labels2=[]; + chans_labels2=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels2{i}= EEG.chanlocs(i).labels; + end + [chans,chansidx] = ismember(frontal_channels, chans_labels2); + frontal_channels_idx = chansidx(chansidx ~= 0); + badChans = zeros(EEG.nbchan, EEG.trials); + badepoch=zeros(1, EEG.trials); + if isempty(frontal_channels_idx)==1 % check whether there is any frontal channel in dataset to check + warning('No frontal channels from the list present in the data. Only epoch interpolation will be performed.'); + else + % find artifaceted epochs by detecting outlier voltage in the specified channels list and remove epoch if artifacted in those channels + for ch =1:length(frontal_channels_idx) + EEG = pop_eegthresh(EEG,1, frontal_channels_idx(ch), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset( EEG ); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + for ii=1:size(badChans, 2) + badepoch(ii)=sum(badChans(:,ii)); + end + badepoch=logical(badepoch); + end + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch( EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + + if all_bad_epochs==1 + warning(['No usable data for datafile', datafile_names{subject}]); + else + % Interpolate artifacted data for all reaming channels + badChans = zeros(EEG.nbchan, EEG.trials); + % Find artifacted epochs by detecting outlier voltage but don't remove + for ch=1:EEG.nbchan + EEG = pop_eegthresh(EEG,1, ch, volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose(EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + tmpData = zeros(EEG.nbchan, EEG.pnts, EEG.trials); + for e = 1:EEG.trials + % Initialize variables EEGe and EEGe_interp; + EEGe = []; EEGe_interp = []; badChanNum = []; + % Select only this epoch (e) + EEGe = pop_selectevent( EEG, 'epoch', e, 'deleteevents', 'off', 'deleteepochs', 'on', 'invertepochs', 'off'); + badChanNum = find(badChans(:,e)==1); % find which channels are bad for this epoch + EEGe_interp = eeg_interp(EEGe,badChanNum); %interpolate the bad channels for this epoch + tmpData(:,:,e) = EEGe_interp.data; % store interpolated data into matrix + end + EEG.data = tmpData; % now that all of the epochs have been interpolated, write the data back to the main file + + % If more than 10% of channels in an epoch were interpolated, reject that epoch + badepoch=zeros(1, EEG.trials); + for ei=1:EEG.trials + NumbadChan = badChans(:,ei); % find how many channels are bad in an epoch + if sum(NumbadChan) > round((10/100)*EEG.nbchan)% check if more than 10% are bad + badepoch (ei)= sum(NumbadChan); + end + end + badepoch=logical(badepoch); + end + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + else % if no epoch level channel interpolation + EEG = pop_eegthresh(EEG, 1, (1:EEG.nbchan), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax, 0, 0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + end % end of epoch level channel interpolation if statement + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(EEG.reject.rejthresh)==EEG.trials || sum(EEG.reject.rejthresh)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG,(EEG.reject.rejthresh), 0); + EEG = eeg_checkset(EEG); + end + end % end of voltage threshold rejection if statement + + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'), 'filepath', [output_location filesep 'processed_data' filesep]); + + + + % if all epochs are found bad during artifact rejection + if all_bad_epochs==1 + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + else + total_epochs_after_artifact_rejection=EEG.trials; + end + + %% STEP 15: Interpolate deleted channels + if interp_channels==1 + EEG = eeg_interp(EEG, channels_analysed); + EEG = eeg_checkset(EEG); + end + if numel(FASTbadChans)==0 && numel(ica_prep_badChans)==0 + total_channels_interpolated=0; + else + total_channels_interpolated=numel(FASTbadChans)+ numel(ica_prep_badChans); + end + + %% STEP 16: Rereference data + if rerefer_data==1 + if iscell(reref)==1 + reref_idx=zeros(1, length(reref)); + for rr=1:length(reref) + reref_idx(rr)=find(strcmp({EEG.chanlocs.labels}, reref{rr})); + end + EEG = eeg_checkset(EEG); + EEG = pop_reref( EEG, reref_idx); + else + EEG = eeg_checkset(EEG); + EEG = pop_reref(EEG, reref); + end + end + + %% Save processed data + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_processed_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_processed_data.mat')], 'EEG'); % save .mat format + end + + %% create, write/append table on each iteration of loop + + %Create the report table for all the data files with relevant preprocessing outputs. + report_table=table({datafile_names{subject}}, {datetime('now')}, {reference_used_for_faster}, {faster_bad_channels}, {ica_preparation_bad_channels}, {length_ica_data}, ... + {total_ICs}, {ICs_removed}, {total_epochs_before_artifact_rejection}, {total_epochs_after_artifact_rejection}, {total_channels_interpolated}); + + report_table.Properties.VariableNames={'datafile_names', 'date_processed', 'reference_used_for_faster', 'faster_bad_channels', ... + 'ica_preparation_bad_channels', 'length_ica_data', 'total_ICs', 'ICs_removed', 'total_epochs_before_artifact_rejection', ... + 'total_epochs_after_artifact_rejection', 'total_channels_interpolated'}; + + %write/append table to disk + writetable(report_table, [output_location filesep 'MADE_preprocessing_report.csv'], "WriteMode", "append"); + % final_report_table = vertcat(final_report_table, report_table); + + + end % end of subject loop + + %writetable(final_report_table, [output_location filesep 'MADE_preprocessing_report.csv']); + + + +end diff --git a/code/thrive_eeg/MADE_pipeline_v1_0_thrive_03.m b/code/thrive_eeg/MADE_pipeline_v1_0_thrive_03.m new file mode 100644 index 0000000..40cf4a7 --- /dev/null +++ b/code/thrive_eeg/MADE_pipeline_v1_0_thrive_03.m @@ -0,0 +1,915 @@ +%%to Run on FIU HPC% +% create a local cluster object +cluster = parcluster('local'); + +% start matlabpool with max workers set in the slurm file +parpool(cluster, str2num(getenv('SLURM_CPUS_ON_NODE'))) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This script was initially edited by George Buzzell for the NDC Lab EEG +% Training Workshop on 10/21, then modified by George Buzzell and Kianoosh Hosseini to preprocess THRIVE dataset. +% +% +% ************************************************************************ +% The Maryland Analysis of Developmental EEG (MADE) Pipeline +% Version 1.0 +% Developed at the Child Development Lab, University of Maryland, College Park + +% Contributors to MADE pipeline: +% Ranjan Debnath (rdebnath@umd.edu) +% George A. Buzzell (gbuzzell@umd.edu) +% Santiago Morales Pamplona (moraless@umd.edu) +% Stephanie Leach (sleach12@umd.edu) +% Maureen Elizabeth Bowers (mbowers1@umd.edu) +% Nathan A. Fox (fox@umd.edu) + +% MADE uses EEGLAB toolbox and some of its plugins. Before running the pipeline, you have to install the following: +% EEGLab: https://sccn.ucsd.edu/eeglab/downloadtoolbox.php/download.php + +% You also need to download the following plugins/extensions from here: https://sccn.ucsd.edu/wiki/EEGLAB_Extensions +% Specifically, download: +% MFFMatlabIO: https://github.com/arnodelorme/mffmatlabio/blob/master/README.txt +% FASTER: https://sourceforge.net/projects/faster/ +% ADJUST: https://www.nitrc.org/projects/adjust/ [Maybe we will replace this with our own GitHub link?] + +% After downloading these plugins (as zip files), you need to place it in the eeglab/plugins folder. +% For instance, for FASTER, you uncompress the downloaded extension file (e.g., 'FASTER.zip') and place it in the main EEGLAB "plugins" sub-directory/sub-folder. +% After placing all the required plugins, add the EEGLAB folder to your path by using the following code: + +% addpath(genpath(('...')) % Enter the path of the EEGLAB folder in this line +% Please cite the following references for in any manuscripts produced utilizing MADE pipeline: + +% EEGLAB: A Delorme & S Makeig (2004) EEGLAB: an open source toolbox for +% analysis of single-trial EEG dynamics. Journal of Neuroscience Methods, 134, 9?21. + +% firfilt (filter plugin): developed by Andreas Widmann (https://home.uni-leipzig.de/biocog/content/de/mitarbeiter/widmann/eeglab-plugins/) + +% FASTER: Nolan, H., Whelan, R., Reilly, R.B., 2010. FASTER: Fully Automated Statistical +% Thresholding for EEG artifact Rejection. Journal of Neuroscience Methods, 192, 152?162. + +% ADJUST: Mognon, A., Jovicich, J., Bruzzone, L., Buiatti, M., 2011. ADJUST: An automatic EEG +% artifact detector based on the joint use of spatial and temporal features. Psychophysiology, 48, 229?240. +% Our group has modified ADJUST plugin to improve selection of ICA components containing artifacts + +% This pipeline is released under the GNU General Public License version 3. + +% ************************************************************************ + +%% User input: user provide relevant information to be used for data processing +% Preprocessing of EEG data involves using some common parameters for +% every subject. This part of the script initializes the common parameters. + +clear % clear matlab workspace +clc % clear matlab command window + +%% MUST EDIT THIS +%running in "EEG_training" folder on your computer +main_dir = '/home/data/NDClab/datasets/thrive-dataset'; %directory on the HPC + +%% Setting up other things + +%Location of MADE and ADJUSTED-ADJUST scripts +addpath(genpath([main_dir filesep 'code' filesep 'thrive_eeg']));% enter the path of the folder in this line + +%Location of EEGlab +addpath(genpath([main_dir filesep 'code' filesep 'eeglab13_4_4b']));% enter the path of the EEGLAB folder in this line + +%remove path to octave functions inside matlab to prevent errors when +rmpath([main_dir filesep 'code' filesep 'eeglab13_4_4b' filesep 'functions' filesep 'octavefunc' filesep 'signal']) + +% 1. Enter the path of the folder that has the raw data to be analyzed +rawdata_location_parent = [main_dir filesep 'sourcedata' filesep 'raw' filesep 's1_r1' filesep 'eeg']; + +% 2. Enter the path of the channel location file +channel_locations = loadbvef('/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED-64only.bvef'); + + +%need to modify for social vs nonsocial + +% STIMULUS TRIGGERS +% passage text appears on-screen: 11 +% passage text disappears (participant proceeded to the next screen): 10 +% challenge text appears on-screen: 21 +% +% RESPONSE TRIGGERS +% error response to challenge question: 30 +% correct response to challenge question: 31 + +stimulus_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54'}; % enter the stimulus markers that need to be adjusted for time offset +response_markers = {}; % enter the response makers that need to be adjusted for time offset + +% 5. Do you want to down sample the data? +down_sample = 1; % 0 = NO (no down sampling), 1 = YES (down sampling) +sampling_rate = 1000; % set sampling rate (in Hz), if you want to down sample + +% 6. Do you want to delete the outer layer of the channels? (Rationale has been described in MADE manuscript) +% This fnction can also be used to down sample electrodes. For example, if EEG was recorded with 128 channels but you would +% like to analyse only 64 channels, you can assign the list of channnels to be excluded in the 'outerlayer_channel' variable. +% Can also use this to remove ocular channels if they are in non-standard +% locations +delete_outerlayer = 0; % 0 = NO (do not delete outer layer), 1 = YES (delete outerlayer); +% If you want to delete outer layer, make a list of channels to be deleted +outerlayer_channel = {'16','15','12','13','8','31','26','25','30','32','60','64','61','62','56','57','63','41','46','45','48'}; % list of channels + +% 7. Initialize the filters +highpass = .1; % High-pass frequency +lowpass = 49; % Low-pass frequency. We recommend low-pass filter at/below line noise frequency (see manuscript for detail) + +% 8. Are you processing task-related or resting-state EEG data? +task_eeg = 1; % 0 = resting, 1 = task +task_event_markers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54', 'S 11', 'S 12', 'S 21', 'S 22'}; % enter all the event/condition markers (i.e., stim + resp markers) + +% 9. Do you want to epoch/segment your data? +epoch_data = 1; % 0 = NO (do not epoch), 1 = YES (epoch data) +task_epoch_length = [-1 2]; % epoch length in second +dummy_events ={'999'}; % enter dummy events name + +% 10. Do you want to remove/correct baseline? +remove_baseline = 1; % 0 = NO (no baseline correction), 1 = YES (baseline correction) +baseline_window = []; % baseline period in milliseconds (MS) [] = entire epoch + +% 11. Do you want to remove artifact laden epoch based on voltage threshold? +voltthres_rejection = 1; % 0 = NO, 1 = YES +volt_threshold = [-125 125]; % lower and upper threshold (in ?V) + +% 12. Do you want to perform epoch level channel interpolation for artifact laden epoch? (see manuscript for detail) +interp_epoch = 1; % 0 = NO, 1 = YES. +frontal_channels = {'14','11','10','43','44','47'}; % If you set interp_epoch = 1, enter the list of frontal channels to check (see manuscript for detail) + +%13. Do you want to interpolate the bad channels that were removed from data? +interp_channels = 1; % 0 = NO (Do not interpolate), 1 = YES (interpolate missing channels) + +% 14. Do you want to rereference your data? +rerefer_data = 1; % 0 = NO, 1 = YES +reref=[]; % Enter electrode name/s or number/s to be used for rereferencing +% For channel name/s enter, reref = {'channel_name', 'channel_name'}; +% For channel number/s enter, reref = [channel_number, channel_number]; +% For average rereference enter, reref = []; default is average rereference + +% 15. Do you want to save interim results? +save_interim_result = 1; % 0 = NO (Do not save) 1 = YES (save interim results) + +% 16. How do you want to save your data? .set or .mat +output_format = 1; % 1 = .set (EEGLAB data structure), 2 = .mat (Matlab data structure) + +% ********* no need to edit beyond this point for EGI .mff data ********** +% ********* for non-.mff data format edit data import function *********** +% ********* below using relevant data import plugin from EEGLAB ********** + + +% List subject folders under EEG folder +cd (rawdata_location_parent) +data_folder_lists = dir; +data_folder_lists = data_folder_lists(~ismember({data_folder_lists.name},{'.', '..', '.DS_Store'})); +data_folder_lists = {data_folder_lists.name}; +data_folder_lists = string(data_folder_lists); +%for file_locater_counter = 1:length(data_folder_lists) % This for loop lists the folders containing the main data files +for file_locater_counter = 5:7 + rawdata_location = fullfile(rawdata_location_parent, data_folder_lists(file_locater_counter)); + rawdata_location = char(rawdata_location); + + % Enter the path of the folder where you want to save the processed data + output_location = [main_dir filesep 'derivatives' filesep 's1_r1' filesep 'eeg' filesep 'preprocessed' ]; + % update the output_location + output_location = fullfile(output_location, data_folder_lists(file_locater_counter)); + output_location = char(output_location); + + + % Read files to analyses + datafile_names=dir([rawdata_location filesep '*.vhdr']); + datafile_names=datafile_names(~ismember({datafile_names.name},{'.', '..', '.DS_Store'})); + datafile_names={datafile_names.name}; + [filepath,name,ext] = fileparts(char(datafile_names{1})); + + + + + %% Check whether EEGLAB and all necessary plugins are in Matlab path. + if exist('eeglab','file')==0 + error(['Please make sure EEGLAB is on your Matlab path. Please see EEGLAB' ... + 'wiki page for download and instalation instructions']); + end + + if exist('pop_firws', 'file')==0 + error(['Please make sure "firfilt" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('channel_properties', 'file')==0 + error(['Please make sure "FASTER" plugin is in EEGLAB plugin folder and on Matlab path.' ... + ' Please see EEGLAB wiki page for download and instalation instructions of plugins.']); + end + + if exist('ADJUST', 'file')==0 + error(['Please make sure you download modified "ADJUST" plugin from GitHub (link is in MADE manuscript)' ... + ' and ADJUST is in EEGLAB plugin folder and on Matlab path.']); + end + + %% Create output folders to save data + if save_interim_result == 1 + if exist([output_location filesep 'filtered_data'], 'dir') == 0 + mkdir([output_location filesep 'filtered_data']) + end + if exist([output_location filesep 'ica_data'], 'dir') == 0 + mkdir([output_location filesep 'ica_data']) + end + end + if exist([output_location filesep 'processed_data'], 'dir') == 0 + mkdir([output_location filesep 'processed_data']) + end + + %% Initialize output variables + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + %% Loop over all data files + + % switch to output directory + cd(output_location); + + for subject=1:length(datafile_names) + + %% Initialize EEG structurem, output variables, and report table + EEG=[]; %initialize eeg structure + report_table = []; %report table that will be created and writen to disk (appended) after processing completes for this participant + reference_used_for_faster=[]; % reference channel used for running faster to identify bad channel/s + faster_bad_channels=[]; % number of bad channel/s identified by faster + ica_preparation_bad_channels=[]; % number of bad channel/s due to channel/s exceeding xx% of artifacted epochs + length_ica_data=[]; % length of data (in second) fed into ICA decomposition + total_ICs=[]; % total independent components (ICs) + ICs_removed=[]; % number of artifacted ICs + total_epochs_before_artifact_rejection=[]; + total_epochs_after_artifact_rejection=[]; + total_channels_interpolated=[]; % total_channels_interpolated=faster_bad_channels+ica_preparation_bad_channels + + + fprintf('\n\n\n*** Processing subject %d (%s) ***\n\n\n', subject, datafile_names{subject}); + + %% STEP 1: Import EEG data file and relevant information + + %load in raw data + EEG = pop_loadbv(rawdata_location, datafile_names{subject}); + EEG = eeg_checkset(EEG); + + %% STEP 4: Change sampling rate + if down_sample==1 + if floor(sampling_rate) > EEG.srate + error ('Sampling rate cannot be higher than recorded sampling rate'); + elseif floor(sampling_rate) ~= EEG.srate + EEG = pop_resample( EEG, sampling_rate); + EEG = eeg_checkset( EEG ); + end + end + + %make a copy of GSR and sync channels, then delete from eeg structure + + gsrChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + + syncChan = EEG.data(64, :); + EEG = pop_select( EEG,'nochannel', 64); + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + + %add in ref channels + origData = EEG.data; + [origData_NumRows, origData_NumCols] = size(origData); + EEG.data = NaN(origData_NumRows+1, origData_NumCols); + EEG.data(1,:) = 0; %add ref as zeros + EEG.data(2:end,:) = origData; %copy over orig EEG data + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + + %delete ground from newChanLocs + modNewChanlocs = channel_locations(2:end); + + %replace chanlocs with + EEG.chanlocs = modNewChanlocs; + EEG = eeg_checkset( EEG ); + %[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); + + %update/refresh eeglab and plot + %eeglab redraw + + % Check whether the channel locations were properly imported. The EEG signals and channel numbers should be same. + if size(EEG.data, 1) ~= length(EEG.chanlocs) + error('The size of the data does not match with channel numbers.'); + end + + %% STEP 1b: convert all type field markers to string (if not already) + + %loop through all the type markes, if numeric, convert to string + % (Given that this script assumes that "type" field markers are strings, we need to + % convert all type field markers to string, in case they are not + % already) + for atm=1:length({EEG.event.type}) + if isnumeric(EEG.event(atm).type) + EEG.event(atm).type = num2str(EEG.event(atm).type); + end + end + + + %% STEP 5: Delete outer layer of channels + chans_labels=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels{i}= EEG.chanlocs(i).labels; + end + + if delete_outerlayer==1 + [chans,chansidx] = ismember(outerlayer_channel, chans_labels); + outerlayer_channel_idx = chansidx(chansidx ~= 0); + if isempty(outerlayer_channel_idx)==1 + error(['None of the outer layer channels present in channel locations of data.'... + ' Make sure outer layer channels are present in channel labels of data (EEG.chanlocs.labels).']); + else + EEG = pop_select( EEG,'nochannel', outerlayer_channel_idx); + EEG = eeg_checkset( EEG ); + end + end + + %% STEP 6: Filter data + % Calculate filter order using the formula: m = dF / (df / fs), where m = filter order, + % df = transition band width, dF = normalized transition width, fs = sampling rate + % dF is specific for the window type. Hamming window dF = 3.3 + + high_transband = highpass; % high pass transition band + low_transband = 10; % low pass transition band + + hp_fl_order = 3.3 / (high_transband / EEG.srate); + lp_fl_order = 3.3 / (low_transband / EEG.srate); + + % Round filter order to next higher even integer. Filter order is always even integer. + if mod(floor(hp_fl_order),2) == 0 + hp_fl_order=floor(hp_fl_order); + elseif mod(floor(hp_fl_order),2) == 1 + hp_fl_order=floor(hp_fl_order)+1; + end + + if mod(floor(lp_fl_order),2) == 0 + lp_fl_order=floor(lp_fl_order)+2; + elseif mod(floor(lp_fl_order),2) == 1 + lp_fl_order=floor(lp_fl_order)+1; + end + + % Calculate cutoff frequency + high_cutoff = highpass/2; + low_cutoff = lowpass + (low_transband/2); + + % Performing high pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', high_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', hp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % + + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + % Performing low pass filtering + EEG = eeg_checkset( EEG ); + EEG = pop_firws(EEG, 'fcutoff', low_cutoff, 'ftype', 'lowpass', 'wtype', 'hamming', 'forder', lp_fl_order, 'minphase', 0); + EEG = eeg_checkset( EEG ); + + % pop_firws() - transition band width: 10 Hz + % pop_firws() - filter window type hamming ('wtype', 'hamming') + % pop_firws() - applying zero-phase (non-causal) filter ('minphase', 0) + + %% STEP 7: Run faster to find bad channels + % First check whether reference channel (i.e. zeroed channels) is present in data + % reference channel is needed to run faster + ref_chan=[]; FASTbadChans=[]; all_chan_bad_FAST=0; + ref_chan=find(any(EEG.data, 2)==0); + if numel(ref_chan)>1 + error(['There are more than 1 zeroed channel (i.e. zero value throughout recording) in data.'... + ' Only reference channel should be zeroed channel. Delete the zeroed channel/s which is not reference channel.']); + elseif numel(ref_chan)==1 + list_properties = channel_properties(EEG, 1:EEG.nbchan, ref_chan); % run faster + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + FASTbadChans=FASTbadChans(FASTbadChans~=ref_chan); + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + % EEG = pop_select( EEG,'nochannel', ref_chan); % a bug [kia + % removed it as George said] + EEG = eeg_checkset(EEG); + channels_analysed=EEG.chanlocs; % keep full channel locations to use later for interpolation of bad channels + elseif numel(ref_chan)==0 + warning('Reference channel is not present in data. channel 1 will be used as reference channel.'); + ref_chan=find(strcmp({EEG.chanlocs.labels}, '1')); % find Cz channel index + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = pop_reref( EEG_copy, ref_chan,'keepref','on'); % rerefer to Cz in copied dataset + EEG_copy = eeg_checkset(EEG_copy); + list_properties = channel_properties(EEG_copy, 1:EEG_copy.nbchan, ref_chan); % run faster on copied dataset + FASTbadIdx=min_z(list_properties); + FASTbadChans=find(FASTbadIdx==1); + channels_analysed=EEG.chanlocs; + reference_used_for_faster={EEG.chanlocs(ref_chan).labels}; + end + + % If FASTER identifies all channels as bad channels, save the dataset + % at this stage and ignore the remaining of the preprocessing. + if numel(FASTbadChans)==EEG.nbchan || numel(FASTbadChans)+1==EEG.nbchan + all_chan_bad_FAST=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + else + % Reject channels that are bad as identified by Faster + EEG = pop_select( EEG,'nochannel', FASTbadChans); + EEG = eeg_checkset(EEG); + if numel(ref_chan)==1 + ref_chan=find(any(EEG.data, 2)==0); + EEG = pop_select( EEG,'nochannel', ref_chan); % remove reference channel + end + end + + if numel(FASTbadChans)==0 + faster_bad_channels='0'; + else + faster_bad_channels=num2str(FASTbadChans'); + end + + if all_chan_bad_FAST==1 + faster_bad_channels='0'; + ica_preparation_bad_channels='0'; + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next subject + end + + %% Save data after running filter and FASTER function, if saving interim results was preferred + if save_interim_result ==1 + if output_format==1 + EEG = eeg_checkset( EEG ); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_filtered_data')); + EEG = pop_saveset( EEG,'filename',strrep(datafile_names{subject}, ext, '_filtered_data.set'),'filepath', [output_location filesep 'filtered_data' filesep]); % save .set format + elseif output_format==2 + save([[output_location filesep 'filtered_data' filesep ] strrep(datafile_names{subject}, ext, '_filtered_data.mat')], 'EEG'); % save .mat format + end + end + + %% STEP 8: Prepare data for ICA + EEG_copy=[]; + EEG_copy=EEG; % make a copy of the dataset + EEG_copy = eeg_checkset(EEG_copy); + + % Perform 1Hz high pass filter on copied dataset + transband = 1; + fl_cutoff = transband/2; + fl_order = 3.3 / (transband / EEG.srate); + + if mod(floor(fl_order),2) == 0 + fl_order=floor(fl_order); + elseif mod(floor(fl_order),2) == 1 + fl_order=floor(fl_order)+1; + end + + EEG_copy = pop_firws(EEG_copy, 'fcutoff', fl_cutoff, 'ftype', 'highpass', 'wtype', 'hamming', 'forder', fl_order, 'minphase', 0); + EEG_copy = eeg_checkset(EEG_copy); + + % Create 1 second epoch + EEG_copy=eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + % Find bad epochs and delete them from dataset + vol_thrs = [-1000 1000]; % [lower upper] threshold limit(s) in mV. + emg_thrs = [-100 30]; % [lower upper] threshold limit(s) in dB. + emg_freqs_limit = [20 40]; % [lower upper] frequency limit(s) in Hz. + + % Find channel/s with xx% of artifacted 1-second epochs and delete them + chanCounter = 1; ica_prep_badChans = []; + numEpochs =EEG_copy.trials; % find the number of epochs + all_bad_channels=0; + + for ch=1:EEG_copy.nbchan + % Find artifaceted epochs by detecting outlier voltage + EEG_copy = pop_eegthresh(EEG_copy,1, ch, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax, 0, 0); + EEG_copy = eeg_checkset( EEG_copy ); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using thresholding of frequencies in the data. + % this method mainly rejects muscle movement (EMG) artifacts + EEG_copy = pop_rejspec( EEG_copy, 1,'elecrange',ch ,'method','fft','threshold', emg_thrs, 'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find number of artifacted epochs + EEG_copy = eeg_checkset( EEG_copy ); + EEG_copy = eeg_rejsuperpose( EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + artifacted_epochs=EEG_copy.reject.rejglobal; + + % Find bad channel / channel with more than 20% artifacted epochs + if sum(artifacted_epochs) > (numEpochs*20/100) + ica_prep_badChans(chanCounter) = ch; + chanCounter=chanCounter+1; + end + end + + % If all channels are bad, save the dataset at this stage and ignore the remaining of the preprocessing. + if numel(ica_prep_badChans)==EEG.nbchan || numel(ica_prep_badChans)+1==EEG.nbchan + all_bad_channels=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_channels.mat')], 'EEG'); % save .mat format + end + + else + % Reject bad channel - channel with more than xx% artifacted epochs + EEG_copy = pop_select( EEG_copy,'nochannel', ica_prep_badChans); + EEG_copy = eeg_checkset(EEG_copy); + end + + if numel(ica_prep_badChans)==0 + ica_preparation_bad_channels='0'; + else + ica_preparation_bad_channels=num2str(ica_prep_badChans); + end + + if all_bad_channels == 1 + length_ica_data=0; + total_ICs=0; + ICs_removed='0'; + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + % Find the artifacted epochs across all channels and reject them before doing ICA. + EEG_copy = pop_eegthresh(EEG_copy,1, 1:EEG_copy.nbchan, vol_thrs(1), vol_thrs(2), EEG_copy.xmin, EEG_copy.xmax,0,0); + EEG_copy = eeg_checkset(EEG_copy); + + % 1 : data type (1: electrode, 0: component) + % 0 : display with previously marked rejections? (0: no, 1: yes) + % 0 : reject marked trials? (0: no (but store the marks), 1:yes) + + % Find artifaceted epochs by using power threshold in 20-40Hz frequency band. + % This method mainly rejects muscle movement (EMG) artifacts. + EEG_copy = pop_rejspec(EEG_copy, 1,'elecrange', 1:EEG_copy.nbchan, 'method', 'fft', 'threshold', emg_thrs ,'freqlimits', emg_freqs_limit, 'eegplotplotallrej', 0, 'eegplotreject', 0); + + % method : method to compute spectrum (fft) + % threshold : [lower upper] threshold limit(s) in dB. + % freqlimits : [lower upper] frequency limit(s) in Hz. + % eegplotplotallrej : 0 = Do not superpose rejection marks on previous marks stored in the dataset. + % eegplotreject : 0 = Do not reject marked trials (but store the marks). + + % Find the number of artifacted epochs and reject them + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = eeg_rejsuperpose(EEG_copy, 1, 1, 1, 1, 1, 1, 1, 1); + reject_artifacted_epochs=EEG_copy.reject.rejglobal; + EEG_copy = pop_rejepoch(EEG_copy, reject_artifacted_epochs, 0); + + %% STEP 9: Run ICA + length_ica_data=EEG_copy.trials; % length of data (in second) fed into ICA + EEG_copy = eeg_checkset(EEG_copy); + EEG_copy = pop_runica(EEG_copy, 'icatype', 'runica', 'extended', 1, 'stop', 1E-7, 'interupt','off'); + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_ica_data_immediate.set'), 'filepath', [output_location filesep 'ica_data' filesep]); + + % Find the ICA weights that would be transferred to the original dataset + ICA_WINV=EEG_copy.icawinv; + ICA_SPHERE=EEG_copy.icasphere; + ICA_WEIGHTS=EEG_copy.icaweights; + ICA_CHANSIND=EEG_copy.icachansind; + + % If channels were removed from copied dataset during preparation of ica, then remove + % those channels from original dataset as well before transferring ica weights. + EEG = eeg_checkset(EEG); + EEG = pop_select(EEG,'nochannel', ica_prep_badChans); + + % Transfer the ICA weights of the copied dataset to the original dataset + EEG.icawinv=ICA_WINV; + EEG.icasphere=ICA_SPHERE; + EEG.icaweights=ICA_WEIGHTS; + EEG.icachansind=ICA_CHANSIND; + EEG = eeg_checkset(EEG); + + %% STEP 10: Run adjust to find artifacted ICA components + badICs=[]; EEG_copy =[]; + EEG_copy = EEG; + EEG_copy = eeg_regepochs(EEG_copy,'recurrence', 1, 'limits',[0 1], 'rmbase', [NaN], 'eventtype', '999'); % insert temporary marker 1 second apart and create epochs + EEG_copy = eeg_checkset(EEG_copy); + + if save_interim_result==1 + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'ica_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + else + badICs = adjusted_ADJUST(EEG_copy, [[output_location filesep 'processed_data' filesep] strrep(datafile_names{subject}, ext, '_adjust_report')]); + end + close all; + + + + % Mark the bad ICs found by ADJUST + for ic=1:length(badICs) + EEG.reject.gcompreject(1, badICs(ic))=1; + EEG = eeg_checkset(EEG); + end + total_ICs=size(EEG.icasphere, 1); + if numel(badICs)==0 + ICs_removed='0'; + else + ICs_removed=num2str(double(badICs)); + end + + %% Save dataset after ICA, if saving interim results was preferred + if save_interim_result==1 + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_ica_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_ica_data.set'),'filepath', [output_location filesep 'ica_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'ica_data' filesep ] strrep(datafile_names{subject}, ext, '_ica_data.mat')], 'EEG'); % save .mat format + end + end + + %Ran up to here.... + + %no manual review/selection of ica artifact performed... + + + + %% STEP 11: Remove artifacted ICA components from data + all_bad_ICs=0; + ICs2remove=find(EEG.reject.gcompreject); % find ICs to remove + + % If all ICs and bad, save data at this stage and ignore rest of the preprocessing for this subject. + if numel(ICs2remove)==total_ICs + all_bad_ICs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_ICs.mat')], 'EEG'); % save .mat format + end + else + EEG = eeg_checkset( EEG ); + EEG = pop_subcomp( EEG, ICs2remove, 0); % remove ICs from dataset + end + + if all_bad_ICs==1 + total_epochs_before_artifact_rejection=0; + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + end + + %% STEP 12: Segment data into fixed length epochs + + %run event labeling script + edit_event_markers_thrive + + if epoch_data==1 + if task_eeg ==1 % task eeg + EEG = eeg_checkset(EEG); + EEG = pop_epoch(EEG, task_event_markers, task_epoch_length, 'epochinfo', 'yes'); + elseif task_eeg==0 % resting eeg + if overlap_epoch==1 + EEG=eeg_regepochs(EEG,'recurrence',(rest_epoch_length/2),'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + else + EEG=eeg_regepochs(EEG,'recurrence',rest_epoch_length,'limits',[0 rest_epoch_length], 'rmbase', [NaN], 'eventtype', char(dummy_events)); + EEG = eeg_checkset(EEG); + end + end + end + + total_epochs_before_artifact_rejection=EEG.trials; + + %% STEP 13: Remove baseline + if remove_baseline==1 + EEG = eeg_checkset( EEG ); + EEG = pop_rmbase( EEG, baseline_window); + end + + %% STEP 14: Artifact rejection + all_bad_epochs=0; + if voltthres_rejection==1 % check voltage threshold rejection + if interp_epoch==1 % check epoch level channel interpolation + chans=[]; chansidx=[];chans_labels2=[]; + chans_labels2=cell(1,EEG.nbchan); + for i=1:EEG.nbchan + chans_labels2{i}= EEG.chanlocs(i).labels; + end + [chans,chansidx] = ismember(frontal_channels, chans_labels2); + frontal_channels_idx = chansidx(chansidx ~= 0); + badChans = zeros(EEG.nbchan, EEG.trials); + badepoch=zeros(1, EEG.trials); + if isempty(frontal_channels_idx)==1 % check whether there is any frontal channel in dataset to check + warning('No frontal channels from the list present in the data. Only epoch interpolation will be performed.'); + else + % find artifaceted epochs by detecting outlier voltage in the specified channels list and remove epoch if artifacted in those channels + for ch =1:length(frontal_channels_idx) + EEG = pop_eegthresh(EEG,1, frontal_channels_idx(ch), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset( EEG ); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + for ii=1:size(badChans, 2) + badepoch(ii)=sum(badChans(:,ii)); + end + badepoch=logical(badepoch); + end + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epoch.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch( EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + + if all_bad_epochs==1 + warning(['No usable data for datafile', datafile_names{subject}]); + else + % Interpolate artifacted data for all reaming channels + badChans = zeros(EEG.nbchan, EEG.trials); + % Find artifacted epochs by detecting outlier voltage but don't remove + for ch=1:EEG.nbchan + EEG = pop_eegthresh(EEG,1, ch, volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax,0,0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose(EEG, 1, 1, 1, 1, 1, 1, 1, 1); + badChans(ch,:) = EEG.reject.rejglobal; + end + tmpData = zeros(EEG.nbchan, EEG.pnts, EEG.trials); + for e = 1:EEG.trials + % Initialize variables EEGe and EEGe_interp; + EEGe = []; EEGe_interp = []; badChanNum = []; + % Select only this epoch (e) + EEGe = pop_selectevent( EEG, 'epoch', e, 'deleteevents', 'off', 'deleteepochs', 'on', 'invertepochs', 'off'); + badChanNum = find(badChans(:,e)==1); % find which channels are bad for this epoch + EEGe_interp = eeg_interp(EEGe,badChanNum); %interpolate the bad channels for this epoch + tmpData(:,:,e) = EEGe_interp.data; % store interpolated data into matrix + end + EEG.data = tmpData; % now that all of the epochs have been interpolated, write the data back to the main file + + % If more than 10% of channels in an epoch were interpolated, reject that epoch + badepoch=zeros(1, EEG.trials); + for ei=1:EEG.trials + NumbadChan = badChans(:,ei); % find how many channels are bad in an epoch + if sum(NumbadChan) > round((10/100)*EEG.nbchan)% check if more than 10% are bad + badepoch (ei)= sum(NumbadChan); + end + end + badepoch=logical(badepoch); + end + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(badepoch)==EEG.trials || sum(badepoch)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG, badepoch, 0); + EEG = eeg_checkset(EEG); + end + else % if no epoch level channel interpolation + EEG = pop_eegthresh(EEG, 1, (1:EEG.nbchan), volt_threshold(1), volt_threshold(2), EEG.xmin, EEG.xmax, 0, 0); + EEG = eeg_checkset(EEG); + EEG = eeg_rejsuperpose( EEG, 1, 1, 1, 1, 1, 1, 1, 1); + end % end of epoch level channel interpolation if statement + + % If all epochs are artifacted, save the dataset and ignore rest of the preprocessing for this subject. + if sum(EEG.reject.rejthresh)==EEG.trials || sum(EEG.reject.rejthresh)+1==EEG.trials + all_bad_epochs=1; + warning(['No usable data for datafile', datafile_names{subject}]); + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_no_usable_data_all_bad_epochs.mat')], 'EEG'); % save .mat format + end + else + EEG = pop_rejepoch(EEG,(EEG.reject.rejthresh), 0); + EEG = eeg_checkset(EEG); + end + end % end of voltage threshold rejection if statement + + + % %save data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + % %load data here for training purposes only (usually do not save here) + % %only doing this to allow for skipping the full run of ica + % EEG = pop_loadset( 'filename', strrep(datafile_names{subject}, ext, '_processed_data_immediate.set'), 'filepath', [output_location filesep 'processed_data' filesep]); + + + + % if all epochs are found bad during artifact rejection + if all_bad_epochs==1 + total_epochs_after_artifact_rejection=0; + total_channels_interpolated=0; + continue % ignore rest of the processing and go to next datafile + else + total_epochs_after_artifact_rejection=EEG.trials; + end + + %% STEP 15: Interpolate deleted channels + if interp_channels==1 + EEG = eeg_interp(EEG, channels_analysed); + EEG = eeg_checkset(EEG); + end + if numel(FASTbadChans)==0 && numel(ica_prep_badChans)==0 + total_channels_interpolated=0; + else + total_channels_interpolated=numel(FASTbadChans)+ numel(ica_prep_badChans); + end + + %% STEP 16: Rereference data + if rerefer_data==1 + if iscell(reref)==1 + reref_idx=zeros(1, length(reref)); + for rr=1:length(reref) + reref_idx(rr)=find(strcmp({EEG.chanlocs.labels}, reref{rr})); + end + EEG = eeg_checkset(EEG); + EEG = pop_reref( EEG, reref_idx); + else + EEG = eeg_checkset(EEG); + EEG = pop_reref(EEG, reref); + end + end + + %% Save processed data + if output_format==1 + EEG = eeg_checkset(EEG); + EEG = pop_editset(EEG, 'setname', strrep(datafile_names{subject}, ext, '_processed_data')); + EEG = pop_saveset(EEG, 'filename', strrep(datafile_names{subject}, ext, '_processed_data.set'),'filepath', [output_location filesep 'processed_data' filesep ]); % save .set format + elseif output_format==2 + save([[output_location filesep 'processed_data' filesep ] strrep(datafile_names{subject}, ext, '_processed_data.mat')], 'EEG'); % save .mat format + end + + %% create, write/append table on each iteration of loop + + %Create the report table for all the data files with relevant preprocessing outputs. + report_table=table({datafile_names{subject}}, {datetime('now')}, {reference_used_for_faster}, {faster_bad_channels}, {ica_preparation_bad_channels}, {length_ica_data}, ... + {total_ICs}, {ICs_removed}, {total_epochs_before_artifact_rejection}, {total_epochs_after_artifact_rejection}, {total_channels_interpolated}); + + report_table.Properties.VariableNames={'datafile_names', 'date_processed', 'reference_used_for_faster', 'faster_bad_channels', ... + 'ica_preparation_bad_channels', 'length_ica_data', 'total_ICs', 'ICs_removed', 'total_epochs_before_artifact_rejection', ... + 'total_epochs_after_artifact_rejection', 'total_channels_interpolated'}; + + %write/append table to disk + writetable(report_table, [output_location filesep 'MADE_preprocessing_report.csv'], "WriteMode", "append"); + % final_report_table = vertcat(final_report_table, report_table); + + + end % end of subject loop + + %writetable(final_report_table, [output_location filesep 'MADE_preprocessing_report.csv']); + + + +end diff --git a/code/thrive_eeg/adjusted_adjust_scripts/MARA_extract_time_freq_features.m b/code/thrive_eeg/adjusted_adjust_scripts/MARA_extract_time_freq_features.m new file mode 100644 index 0000000..80ee345 --- /dev/null +++ b/code/thrive_eeg/adjusted_adjust_scripts/MARA_extract_time_freq_features.m @@ -0,0 +1,187 @@ +function [features, values_m, values_a] = MARA_extract_time_freq_features(EEG) +% function [features, values_m, values_a] = MARA_extract_time_freq_features(EEG) +% +% values_m = avg. resid value btw 20 and 50 Hz +% values_a = avg. resid value btw 8 and 13 Hz +% features = list of components with bumps +% +data = EEG.data; +fs = EEG.srate; + +% transform epoched data into continous data +if length(size(data)) == 3 + s = size(data); + data = reshape(data, [EEG.nbchan, prod(s(2:3))]); +end + +%downsample (to 100-200Hz) +factor = max(floor(EEG.srate/100),1); +data = data(:, 1:factor:end); +fs = round(fs/factor); + +%compute icaactivation and standardise variance to 1 +icacomps = (EEG.icaweights * EEG.icasphere * data)'; +icacomps = icacomps./repmat(std(icacomps,0,1),length(icacomps(:,1)),1); +icacomps = icacomps'; + +%creating a matrix to help us check for peaks in data +change=[0 linspace(-1,1,50)]; +components_with_bumps = []; +components_with_bumps_2 = []; +components_with_plats = []; +components_with_plats_2 = []; +pxx_matrix = zeros(length(icacomps(:,1)),51); +resids_pxx_matrix = zeros(length(icacomps(:,1)),50); + +%run through all the components +for ic=1:length(icacomps(:,1)) + fprintf('.'); + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Proc Spectrum for Channel + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + [pxx,freq,speccomp,contrib,specstd] = spectopo(icacomps(ic,:), fs, fs); + pxx = 10*log10(pxx * 100/2); + pxx_matrix(ic,1:51)=pxx(1:51); + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Get the residual values + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + pxx = real(pxx); %need for spectopo + pxx = pxx*-1; %need for spectopo + OneOverF = (1./freq); + lm_pxx = fitlm(OneOverF(2:51),pxx(2:51)); + resids_pxx = lm_pxx.Residuals.Standardized; + resids_pxx_matrix(ic,1:50)=resids_pxx; + + % at one point we were looking at power to try and identify muscle acitivity, but we have not + % found it as useful as the peak finder +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % The average log band power between 8 and 13 Hz +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% p = 0; +% for i = 8:13 +% p = p + resids_pxx(i); +% end +% Hz8_13 = p / (13-8+1); +% values_a(1,ic) = Hz8_13; +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % The average residual of the log band power between 20 and 50 Hz +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% p = 0; +% for fv = 20:49 +% p = p + resids_pxx(fv); +% end +% Hz20_50 = p / (50-20+1); +% values_m(1,ic) = Hz20_50; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Checking for bumps between 5 and 15 Hz + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % look for peaks with the residual values + [pks, locs, widths, proms] = findpeaks(resids_pxx(4:16),[4:16]); %looks for peaks btw 5 and 15 Hz (1 less and more so any bumps at 5 or 15 are caught) + for numPeaks = 1:length(pks) %in case we have mult. peaks + if (proms(numPeaks) > 0.3 && pks(numPeaks)>1 && widths(numPeaks) > 0.9) %conservative +% if (proms(numPeaks) > 0.5 && pks(numPeaks)>1 && widths(numPeaks) > 0.9) %liberal + components_with_bumps = [components_with_bumps ic]; + end + end + + %%%%%%%%%%%%%%%% + % We are not sure if this chunk without the residuals is needed... + % the code above just seemed too cautious + % We are testing it now and might make changes + + % look for peaks with the NON-residual values + % much more liberal threshold + % above code using the residual values sometimes gets tiny plateaus or noise + % the below code doesn't catch that stuff + [pks, locs, widths, proms] = findpeaks(pxx(5:17),[5:17]); %looks for peaks btw 5 and 15 Hz (1 less and more so any bumps at 5 or 15 are caught) + for numPeaks = 1:length(pks) %in case we have mult. peaks + if (proms(numPeaks) > 0.15) %conservative +% if (proms(numPeaks) > 0.35) %liberal + components_with_bumps_2 = [components_with_bumps_2 ic]; + end + end + %%%%%%%%%%%%%%% + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Checking for plateaus between 5 and 15 Hz for first 7 components + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + if ic < 8 + [pks, locs, widths, proms] = findpeaks(resids_pxx(4:16),[4:16]); + for numPeaks = 1:length(pks) %in case we have mult. peaks + if (proms(numPeaks) > 0.15 && pks(numPeaks)>1) %conservative +% if (proms(numPeaks) > 0.15 && pks(numPeaks)>1) %liberal + components_with_plats = [components_with_plats ic]; + end + end + + %%%%%%%%%%%%%%%% + % We are not sure if this chunk without the residuals is needed... + % the code above just seemed too cautious + % We are testing it now and might make changes + [pks, locs, widths, proms] = findpeaks(pxx(5:17)+(10*change(5:17)),[5:17]); + for numPeaks = 1:length(pks) %in case we have mult. peaks + if (proms(numPeaks) > 0.05) %consevative +% if (proms(numPeaks) > 0.05) %liberal + components_with_plats_2 = [components_with_plats_2 ic]; + end + end + %%%%%%%%%%%%%%% + + end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %Append Features + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %features(:,ic)= [Hz8_13]; +end + +% intialize these for later +features = []; % this will be our output matrix (our list of components with bumps) +features_2 = []; +% combine the two components with bumps matrices +components_with_bumps = unique(components_with_bumps); +components_with_bumps_2 = unique(components_with_bumps_2); +for check=1:length(components_with_bumps) + if sum(components_with_bumps(check) == components_with_bumps_2) + % if they both have a component, add it to the features matrix + features = [features components_with_bumps(check)]; + end +end +% combine the two components with plateaus matrices +components_with_plats = unique(components_with_plats); +components_with_plats_2 = unique(components_with_plats_2); +for check=1:length(components_with_plats) + if sum(components_with_plats(check) == components_with_plats_2) + features_2 = [features_2 components_with_plats(check)]; + end +end +% combine the components with bumps matrix and the plateau matrix +features = unique([features features_2]); %output matrix (list of components with bumps) + +% plot componetns with bumps and components w/o bumps +figure; hold on; +bumps=subplot(2,1,1); +for jj=1:length(features) + plot(bumps,1:50,resids_pxx_matrix(features(jj),:)) + hold on +end +title(bumps,'ICs with Bumps') + +good_ics=1:EEG.nbchan; +good_ics(features)=[]; +nobumps=subplot(2,1,2); +for gg=1:length(good_ics) + plot(nobumps,1:50,resids_pxx_matrix(good_ics(gg),:)) + hold on +end +title(nobumps,'ICs without Bumps') + +par_id=strsplit(EEG.setname,'_') +saveas(gcf,[par_id{1} '.jpg']) + +%open a new figure for the spectopo output +hold off; figure; + +% features = unique(components_with_bumps); +disp('.'); +end \ No newline at end of file diff --git a/code/thrive_eeg/adjusted_adjust_scripts/Spatial_Info_eyes.m b/code/thrive_eeg/adjusted_adjust_scripts/Spatial_Info_eyes.m new file mode 100644 index 0000000..0c3376b --- /dev/null +++ b/code/thrive_eeg/adjusted_adjust_scripts/Spatial_Info_eyes.m @@ -0,0 +1,114 @@ +function ICs_to_keep = Spatial_Info_eyes(blinks,eye_electrodes,topog,chanlocs,n) +% function discs_to_keep = Spatial_Info_discs(EEG) +% +% figures out if eye stuff rejected by adjust should be kept +% - keeps them if there's too much spread + +%define variables +ICs_to_keep = []; +arb_dist = 5.5; +arb_zval = 2; + +%Code from Beall +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Get Z-Scores Matrix +zmatrix = zeros(n,n); +for i=1:n % for each topography + curr_vect = zeros(n); + %deep copy ICA matrix + for h=1:n + zmatrix(i,h) = topog(i,h); + end + for h=1:n + curr_vect(h,1) = topog(i,h); + end + z_vect = zscore(curr_vect); + for h=1:n + zmatrix(i,h) = z_vect(h,1); + end +end +% _ _ +% zmatrix = | z11 z12 z13 ... | row1 = IC1 +% | z21 z22 z23 ... | row2 = IC2 +% | z31 z32 z33 ... | ... +% |_... ... ... zij_| +% col1=E1 col2=E2 ... nxn matrix (n=#components) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%list of channels on the outside of the head +% Find electrodes in outer ring +dimouterring=0; %number of electrodes +indexor=zeros(1,n); %indices of electrodes +for k=1:n + if (chanlocs(1,k).radius>0.51) + dimouterring=dimouterring+1; %count electrodes + indexor(1,dimouterring)=k; + end +end +outer_ring = nonzeros(indexor); +% 64-chan net: outer_ring = [1 17 18 23 24 29 32 43 47 52 55 58]; +% 128-chan net: outer_ring = [48 43 49 56 63 68 73 81 88 94 99 107 113 120 119 17 128 125 127 126]; +outer_ring = unique([outer_ring' eye_electrodes']); + +dimhigherthresh=0; +indexht=zeros(1,n); +for k=1:n + if (chanlocs(1,k).radius>0.35 && chanlocs(1,k).radius<0.5 && abs(chanlocs(1,k).theta)<20) + dimhigherthresh=dimhigherthresh+1; + indexht(1,dimhigherthresh)=k; + end +end +higherthresh = nonzeros(indexht)'; + +keep_IC = []; % will be the list of ICs to keep +for ic=1:n + if sum(ic==blinks)>0 % if this IC matches any numbers in the eye artifact list + % find any channels/electrodes that have high activity (z>2) + chans=find(abs(zmatrix(ic,:))>arb_zval); %grabs any chans/electrodes that are above thresh + + % delete the outer ring(s) of electrodes + % We only care about the spread over more central sites for eye stuff + chans_to_delete=[]; + for e=1:length(chans) + if find(outer_ring == chans(e)) > 0 + % delete this chan/electrode from the list of chans (we don't care about it) + chans_to_delete=[chans_to_delete e]; + end + if find(higherthresh == chans(e)) > 0 + if zmatrix(ic,chans(e))<2.5 + % this channel isn't above the higher threshold set for this ring on the net + chans_to_delete=[chans_to_delete e]; + end + end + end + chans(unique(chans_to_delete))=[]; + + % calculate the distance between the points + pts_matrix_3D=[]; + dist_matrix=[]; + for c=1:length(chans) % loop through list of chans above the threshold value and get a list of points + pts_matrix_3D=[pts_matrix_3D; chanlocs(1,chans(c)).X chanlocs(1,chans(c)).Y chanlocs(1,chans(c)).Z]; + end + dist_matrix = pdist(pts_matrix_3D,'euclidean'); % calculate distances btw all pts. above the threshold + + % figure out if component should be kept + corresponding_pts = []; % gives us the indices of the points + for jj=1:length(chans)-1 + corresponding_pts = [corresponding_pts; (jj*ones(1,length(chans)-jj))' ((jj+1):length(chans))']; + end + dists_below_thresh = find(dist_matrix0 % if any pts are within the arbitrary distance + most_com = mode(pts_within_dist(:)); % lets us know if eye stuff spreads too far into the head + if length(find(pts_within_dist(:) == most_com))>1 + keep_IC = [keep_IC ic]; + end + end + ICs_to_keep = unique(keep_IC); + else + % skip (we don't need to waste time looking at it if it won't be rejected) + end +end + +end % end of function \ No newline at end of file diff --git a/code/thrive_eeg/adjusted_adjust_scripts/adjusted_ADJUST.m b/code/thrive_eeg/adjusted_adjust_scripts/adjusted_ADJUST.m new file mode 100644 index 0000000..ffed29e --- /dev/null +++ b/code/thrive_eeg/adjusted_adjust_scripts/adjusted_ADJUST.m @@ -0,0 +1,601 @@ + +% adjusted_ADJUST() - Automatic EEG artifact Detector optimized for +% pediatric data +% +% Usage: +% >> [art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... +% soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, nuovaV, soglia_D, maxdin]=adjusted_ADJUST (EEG,out) +% +% Inputs: +% EEG - current dataset structure or structure array (has to be epoched) +% out - (string) report file name +% +% Outputs: +% art - List of artifacted ICs +% horiz - List of HEM ICs +% vert - List of VEM ICs +% blink - List of EB ICs +% disc - List of GD ICs +% soglia_DV - SVD threshold +% diff_var - SVD feature values +% soglia_K - TK threshold +% meanK - TK feature values +% soglia_SED - SED threshold +% SED - SED feature values +% soglia_SAD - SAD threshold +% SAD - SAD feature values +% soglia_GDSF- GDSF threshold +% GDSF - GDSF feature values +% soglia_V - MEV threshold +% nuovaV - MEV feature values +% +% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ADJUST +% Automatic EEG artifact Detector based on the Joint Use of Spatial and Temporal features +% +% Developed 2007-2014 +% Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% Last update: 02/05/2014 by Marco Buiatti +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Reference paper: +% Mognon A, Jovicich J, Bruzzone L, Buiatti M, +% ADJUST: An Automatic EEG artifact Detector based on the Joint Use of Spatial and Temporal features. +% Psychophysiology 48 (2), 229-240 (2011). +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% adjusted_ADJUST +% a modified version of ADJUST that has been optimized with pediatric data and geodesic sensor nets +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Reference paper: +% Leach, S.C., Morales, S., Bowers, M. E., Buzzell, G. A., Debnath, R., Beall, D., Fox, N. A., (submitted). +% Adjusting ADJUST: Optimizing the ADJUST Algorithm for Pediatric Data Using Geodesic Nets. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Copyright (C) 2009-2014 Andrea Mognon (1) and Marco Buiatti (2), +% (1) Center for Mind/Brain Sciences, University of Trento, Italy +% (2) INSERM U992 - Cognitive Neuroimaging Unit, Gif sur Yvette, France +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% VERSIONS LOG +% +% 02/05/14: Modified text in Report.txt (MB). +% +% 30/03/14: Removed 'message to the user' (redundant). (MB) +% +% 22/03/14: kurtosis is replaced by kurt for compatibility if signal processing +% toolbox is missing (MB). +% +% V2 (07 OCTOBER 2010) - by Andrea Mognon +% Added input 'nchannels' to compute_SAD and compute_SED_NOnorm; +% this is useful to differentiate the number of ICs (n) and the number of +% sensors (nchannels); +% bug reported by Guido Hesselman on October, 1 2010. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% function [art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, meanK, soglia_SED, SED, soglia_SAD, SAD, ... +% soglia_GDSF, GDSF, soglia_V, nuovaV, soglia_D, maxdin]=ADJUST (EEG,out) +function [art, horiz, vert, blink, disc,... + soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... + soglia_GDSF, med2_GDSF, GDSF, soglia_V, med2_V, nuovaV, soglia_D, maxdin]=adjusted_ADJUST (EEG,out) + + +%% Settings + +% ---------------------------------------------------- +% | Change experimental settings in this section | +% ---------------------------------------------------- + +% ---------------------------------------------------- +% | Initial message to user: | +% ---------------------------------------------------- +% +% disp(' ') +% disp('Detects Horizontal and Vertical eye movements,') +% disp('Blinks and Discontinuities in dataset:') +% disp([EEG.filename]) +% disp(' ') + +% ---------------------------------------------------- +% | Collect useful data from EEG structure | +% ---------------------------------------------------- + +%number of ICs=size(EEG.icawinv,1); + +%number of time points=size(EEG.data,2); + +if length(size(EEG.data))==3 + + num_epoch=size(EEG.data,3); + +else + + num_epoch=0; + +end + +% Check the presence of ICA activations + +if isempty(EEG.icaact) + disp('EEG.icaact not present. Recomputed from data.'); + if length(size(EEG.data))==3 +% EEG.icaact = EEG.icaweights*EEG.icasphere*reshape(EEG.data, size(EEG.icawinv,1), num_epoch*size(EEG.data,2)); +% EEG.icaact = reshape(EEG.icaact,size(EEG.icawinv,1),size(EEG.data,2), num_epoch); + EEG.icaact = reshape(EEG.icaweights*EEG.icasphere*reshape(EEG.data,[size(EEG.data,1)... + size(EEG.data,2)*size(EEG.data,3)]),[size(EEG.data,1) size(EEG.data,2) size(EEG.data,3)]); + else EEG.icaact = EEG.icaweights*EEG.icasphere*EEG.data; + end +end + +topografie=EEG.icawinv'; %computes IC topographies + +% Topographies and time courses normalization +% +% disp(' '); +% disp('Normalizing topographies...') +% disp('Scaling time courses...') + +for i=1:size(EEG.icawinv,2) % number of ICs + + ScalingFactor=norm(topografie(i,:)); + + topografie(i,:)=topografie(i,:)/ScalingFactor; + + if length(size(EEG.data))==3 + EEG.icaact(i,:,:)=ScalingFactor*EEG.icaact(i,:,:); + else + EEG.icaact(i,:)=ScalingFactor*EEG.icaact(i,:); + end + +end +% +% disp('Done.') +% disp(' ') + +% Variables memorizing artifacted ICs indexes + +blink=[]; + +horiz=[]; + +vert=[]; + +disc=[]; + +%% Check EEG channel position information +nopos_channels=[]; +for el=1:length(EEG.chanlocs) + if(any(isempty(EEG.chanlocs(1,el).X)&isempty(EEG.chanlocs(1,el).Y)&isempty(EEG.chanlocs(1,el).Z)&isempty(EEG.chanlocs(1,el).theta)&isempty(EEG.chanlocs(1,el).radius))) + nopos_channels=[nopos_channels el]; + end; +end + +if ~isempty(nopos_channels) + warning(['Channels ' num2str(nopos_channels) ' have incomplete location information. They will NOT be used to compute ADJUST spatial features']); + disp(' '); +end; + +pos_channels=setdiff(1:length(EEG.chanlocs),nopos_channels); + +%% Feature extraction + +disp(' ') +disp('Features Extraction:') + +%GDSF - General Discontinuity Spatial Feature + +disp('GDSF - General Discontinuity Spatial Feature...') + +GDSF = compute_GD_feat(topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); + + +%SED - Spatial Eye Difference + +disp('SED - Spatial Eye Difference...') + +[SED,medie_left,medie_right]=computeSED_NOnorm(topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); + + +%SAD - Spatial Average Difference + +disp('SAD - Spatial Average Difference...') + +[SAD,var_front,var_back,mean_front,mean_back]=computeSAD(topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); + + +%SVD - Spatial Variance Difference between front zone and back zone + +diff_var=var_front-var_back; + +%epoch dynamic range, variance and kurtosis + +K=zeros(num_epoch,size(EEG.icawinv,2)); %kurtosis +Kloc=K; + +Vmax=zeros(num_epoch,size(EEG.icawinv,2)); %variance + +% disp('Computing variance and kurtosis of all epochs...') + +for i=1:size(EEG.icawinv,2) % number of ICs + + for j=1:num_epoch + Vmax(j,i)=var(EEG.icaact(i,:,j)); +% Kloc(j,i)=kurtosis(EEG.icaact(i,:,j)); + K(j,i)=kurt(EEG.icaact(i,:,j)); + end +end + +% check that kurt and kurtosis give the same values: +% [a,b]=max(abs(Kloc(:)-K(:))) + +%TK - Temporal Kurtosis + +disp('Temporal Kurtosis...') + +meanK=zeros(1,size(EEG.icawinv,2)); + +for i=1:size(EEG.icawinv,2) + if num_epoch>100 + meanK(1,i)=trim_and_mean(K(:,i)); + else meanK(1,i)=mean(K(:,i)); + end + +end + + +%MEV - Maximum Epoch Variance + +disp('Maximum epoch variance...') + +maxvar=zeros(1,size(EEG.icawinv,2)); +meanvar=zeros(1,size(EEG.icawinv,2)); + + +for i=1:size(EEG.icawinv,2) + if num_epoch>100 + maxvar(1,i)=trim_and_max(Vmax(:,i)'); + meanvar(1,i)=trim_and_mean(Vmax(:,i)'); + else + maxvar(1,i)=max(Vmax(:,i)); + meanvar(1,i)=mean(Vmax(:,i)); + end +end + +% MEV in reviewed formulation: + +nuovaV=maxvar./meanvar; + + + +%% Thresholds computation + +disp('Computing EM thresholds...') + +% soglia_K=EM(meanK); +% +% soglia_SED=EM(SED); +% +% soglia_SAD=EM(SAD); +% +% soglia_GDSF=EM(GDSF); +% +% soglia_V=EM(nuovaV); +[soglia_K,med1_K,med2_K]=EM(meanK); + +[soglia_SED,med1_SED,med2_SED]=EM(SED); + +[soglia_SAD,med1_SAD,med2_SAD]=EM(SAD); + +[soglia_GDSF,med1_GDSF,med2_GDSF]=EM(GDSF); + +[soglia_V,med1_V,med2_V]=EM(nuovaV); + +%% Output file header + +% ---------------------------------------------------- +% | Opens report file and writes header | +% ---------------------------------------------------- + +file=fopen(out,'w'); + +fprintf(file,'ADJUST\n'); + +fprintf(file,'Automatic EEG artifacts Detector optimized for pediatric data\n\n'); + +fprintf(file,'adapted from Andrea Mognon and Marco Buiatti (2009-2014)\n\n'); + +fprintf(file,['Analyzed dataset: ' EEG.filename '\n']); + +fprintf(file,['Analysis date: ' date '\n']); + +fprintf(file,'Analysis carried out on the %d Independent Components\n\n',size(EEG.icawinv,2)); + +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% adjusted_ADJUST modification %%% +% find all ICs with bumps btw 5 and 15 Hz %%% +cwb=MARA_extract_time_freq_features(EEG); %%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Horizontal eye movements (HEM) + +disp(' '); +disp('Artifact Identification:'); +disp('Horizontal Eye Movements...') + +% ---------------------------------------------------- +% | Writes HEM header in the report file | +% ---------------------------------------------------- + +fprintf(file,'> HEM - Horizontal movements\n\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'SED - Spatial eye difference (threshold=%f)\n',soglia_SED); + +fprintf(file,'MEV - Maximum epoch variance (threshold=%f)\n\n',soglia_V); + +fprintf(file,'ICs with Horizontal eye movements:\n'); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% adjusted_ADJUST modification %%% +% horizontal eye movement detection code %%% +horiz=beall_horizontal(cwb,topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% horiz = intersect(intersect(find(SED>=soglia_SED),find(medie_left.*medie_right<0)),... +% (find(nuovaV>=soglia_V))); +% horiz = intersect(find(nuovaV>=soglia_V),horiz) + +hor_bool=1; %true if there are artifacted ICs + +if isempty(horiz) %no IC found + + fprintf(file,'/ \n'); + + hor_bool=0; + +else + + fprintf(file,[num2str(horiz) '\n']); + fprintf(file,'\n'); + +end + + + +%% Vertical eye movements (VEM) + +disp('Vertical Eye Movements...') + +% ---------------------------------------------------- +% | Writes VEM header in the report file | +% ---------------------------------------------------- + + +fprintf(file,'>> VEM - Vertical movements\n\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'SAD - Spatial average difference (threshold=%f)\n',soglia_SAD); + +fprintf(file,'MEV - Maximum epoch variance (threshold=%f)\n\n',soglia_V); + +fprintf(file,'ICs with Vertical eye movements:\n'); + + + + +vert=intersect(intersect(find(SAD>=soglia_SAD),find(medie_left.*medie_right>0)),... + intersect(find(diff_var>0),find(nuovaV>=soglia_V))); + + + +ver_bool=1; %true if there are artifacted ICs + +if isempty(vert) %no artifact found + + fprintf(file,'/ \n'); + + ver_bool=0; +else + + fprintf(file,[num2str(vert) '\n']); + fprintf(file,'\n'); +end + + + + +%% Eye Blink (EB) + +disp('Eye Blinks...') + +% ---------------------------------------------------- +% | Writes EB header in the report file | +% ---------------------------------------------------- + +fprintf(file,'>>> EB - Blinks\n\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'SAD (threshold=%f)\n',soglia_SAD); + +fprintf(file,'TK - Temporal kurtosis (threshold=%f)\n\n',soglia_K); + +fprintf(file,'ICs with Blinks:\n'); + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% adjusted_ADJUST modification %%% +% blink detection code %%% +blink=beall_blink_detection(cwb,topografie,EEG.chanlocs(1,pos_channels),size(EEG.icawinv,2)); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% blink = intersect ( intersect( find(SAD>=soglia_SAD),find(medie_left.*medie_right>0) ) ,... +% intersect ( find(meanK>=soglia_K),find(diff_var>0) )); +% blink = intersect( find(meanK>=soglia_K), blink ) + +bl_bool=1; %true if there are artifacted ICs + +if isempty(blink) %no blink component + + fprintf(file,'/ \n'); + + bl_bool=0; +else + + fprintf(file,[num2str(blink) '\n']); + fprintf(file,'\n'); +end + + + +%% Generic Discontinuities (GD) + +disp('Generic Discontinuities...') + +% ---------------------------------------------------- +% | Writes GD header in the report file | +% ---------------------------------------------------- + +fprintf(file,'>>>> GD - Discontinuities\n'); + +fprintf(file,'Classification based on features:\n'); + +fprintf(file,'GDSF - Generic Discontinuities Spatial Feature (threshold=%f)\n',soglia_GDSF); + +fprintf(file,'MEV - Maximum epoch variance (threshold=%f)\n\n',soglia_V); + +fprintf(file,'ICs with Generic Discontinuities:\n'); + + +disc=intersect(find(GDSF>=soglia_GDSF),find(nuovaV>=soglia_V)); + + +dsc_bool=1; %true if there are discontinuities + +if isempty(disc) %no discontinuities + + fprintf(file,'/ \n'); + + dsc_bool=0; +else + + fprintf(file,[num2str(disc) '\n']); + fprintf(file,'\n'); +end + +%% + +aic=unique([blink disc horiz vert]); +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% adjusted_ADJUST modification % % +% loop through artifacted ICs and remove any ICs that have bumps % +remove_indices=[]; % +for ii = 1:length(aic) % + for jj = 1:length(cwb) %components_with_bumps % + if aic(ii) == cwb(jj) %components_with_bumps(jj) % + remove_indices = [remove_indices ii]; % + end % + end % +end % +aic(remove_indices)=[]; % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +fprintf(file,'Artifacted ICs (total):\n'); + fprintf(file,[num2str(aic) '\n']); + fprintf(file,'\n'); + + + +%% Displaying results + +% ---------------------------------------------------- +% | Write message to user: report file name | +% ---------------------------------------------------- + +disp(' ') +disp(['Results in <' out '>.']) + + +fclose(file); + +%compute output variable +art = nonzeros( union (union(blink,horiz) , union(vert,disc)) )'; %artifact ICs +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% adjusted_ADJUST modification % +remove_indices=[]; % +for ii = 1:length(art) % + for jj = 1:length(cwb) %components_with_bumps % + if art(ii) == cwb(jj) %components_with_bumps(jj) % + remove_indices = [remove_indices ii]; % + end % + end % +end % +art(remove_indices)=[]; % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% these three are old outputs which are no more necessary in latest ADJUST version. +soglia_D=0; +soglia_DV=0; +maxdin=zeros(1,size(EEG.icawinv,2)); + +return + +%% The following sections have been moved to interface_ADJ in order to manage +%% continuous data + +% +% %% Saving artifacted ICs for further analysis +% +% nome=['List_' EEG.setname '.mat']; +% +% save (nome, 'blink', 'horiz', 'vert', 'disc'); +% +% disp(' ') +% disp(['Artifact ICs list saved in ' nome]); +% +% +% %% IC show & remove +% % show all ICs; detected ICs are highlighted in red color. Based on +% % pop_selectcomps. +% +% art = nonzeros( union (union(blink,horiz) , union(vert,disc)) )'; %artifact ICs +% +% % [EEG] = pop_selectcomps_ADJ( EEG, 1:size(EEG.icawinv,1), art, horiz, vert, blink, disc,... +% % soglia_DV, diff_var, soglia_K, meanK, soglia_SED, SED, soglia_SAD, SAD, ... +% % soglia_TDR, topog_DR, soglia_V, maxvar, soglia_D, maxdin ); +% [EEG] = pop_selectcomps_ADJ( EEG, 1:size(EEG.icawinv,1), art, horiz, vert, blink, disc,... +% soglia_DV, diff_var, soglia_K, med2_K, meanK, soglia_SED, med2_SED, SED, soglia_SAD, med2_SAD, SAD, ... +% soglia_GDSF, med2_GDSF, topog_DR, soglia_V, med2_V, maxvar, soglia_D, maxdin ); + diff --git a/code/thrive_eeg/adjusted_adjust_scripts/beall_blink_detection.m b/code/thrive_eeg/adjusted_adjust_scripts/beall_blink_detection.m new file mode 100644 index 0000000..741b2bb --- /dev/null +++ b/code/thrive_eeg/adjusted_adjust_scripts/beall_blink_detection.m @@ -0,0 +1,265 @@ +% Author: Daniel J. Beall +% Email: DJBEALL1101@gmail.com +% +% beall_blink_detection() - Returns list of ICA components marked as a blink +% +% Usage: +% >> [blinks]=beall_blink_detection(cwb,topog,chanlocs,n); +% +% Inputs: +% cwb - list of components with bumps +% topog - topographies vector +% chanlocs - EEG.chanlocs struct +% n - number of ICs +% nchannels - number of channels +% Outputs: +% blinks - list of detected blinks +% + +function [blinks] = beall_blink_detection(cwb,topog,chanlocs,n) + +blinks = []; +nchannels=length(chanlocs); + +%% Get Z-Scores Matrix +zmatrix = zeros(n,n); +for i=1:n % for each topography + curr_vect = zeros(n); + %deep copy ICA matrix + for h=1:n + zmatrix(i,h) = topog(i,h); + end + for h=1:n + curr_vect(h,1) = topog(i,h); + end + z_vect = zscore(curr_vect); + for h=1:n + zmatrix(i,h) = z_vect(h,1); + end +end +% _ _ +% zmatrix = | z11 z12 z13 ... | row1 = IC1 +% | z21 z22 z23 ... | row2 = IC2 +% | z31 z32 z33 ... | ... +% |_... ... ... zij_| +% col1=E1 col2=E2 ... nxn matrix (n=#components) + +%% Define scalp zones + +% Find electrodes in Frontal Area (FA) +dimlefteyes=0; %number of electrodes +index1=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + %if (chanlocs(1,k).theta > -28 && chanlocs(1,k).theta < 0) && (chanlocs(1,k).radius>0.45) && (chanlocs(1,k).radius<0.58) %electrodes are in FA + if (chanlocs(1,k).theta > -60 && chanlocs(1,k).theta < 0) && (chanlocs(1,k).radius>0.45) && (chanlocs(1,k).radius<0.60) + dimlefteyes=dimlefteyes+1; %count electrodes + index1(1,dimlefteyes)=k; + end +end + +dimrighteyes=0; %number of electrodes +index2=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + %if (chanlocs(1,k).theta < 28 && chanlocs(1,k).theta > 0) && (chanlocs(1,k).radius>0.45) && (chanlocs(1,k).radius<0.58) %electrodes are in FA + if (chanlocs(1,k).theta < 60 && chanlocs(1,k).theta > 0) && (chanlocs(1,k).radius>0.45) && (chanlocs(1,k).radius<0.60) + dimrighteyes=dimrighteyes+1; %count electrodes + index2(1,dimrighteyes)=k; + end +end + +dimcentereyes=0; %number of electrodes +index3=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if(abs(chanlocs(1,k).theta) < 20) && (chanlocs(1,k).radius>0.45) %electrodes are in FA + dimcentereyes=dimcentereyes+1; %count electrodes + index3(1,dimcentereyes)=k; + end +end +%add in code in case E5 and E10 are deleted in a 64-chan net +if dimcentereyes==0 + for k=1:nchannels + if(abs(chanlocs(1,k).theta) == 0) && (chanlocs(1,k).radius>0.39) + dimcentereyes=dimcentereyes+1; %count electrodes + index3(1,dimcentereyes)=k; + end + end +end + +% Find electrodes in everywhere else +dimcenter=0; %number of electrodes +indexc=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if( (abs(chanlocs(1,k).theta)) > 35 && abs(chanlocs(1,k).theta) < 109 && (chanlocs(1,k).radius<0.45) ) + dimcenter=dimcenter+1; %count electrodes + indexc(1,dimcenter)=k; + end +end + +dimbackleft=0; %number of electrodes +indexbl=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if (chanlocs(1,k).theta <= -109) && (chanlocs(1,k).radius<0.55) %electrodes are in FA + dimbackleft=dimbackleft+1; %count electrodes + indexbl(1,dimbackleft)=k; + end +end + +dimbackright=0; %number of electrodes +indexbr=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if (chanlocs(1,k).theta >= 109) && (chanlocs(1,k).radius<0.55) %electrodes are in FA + dimbackright=dimbackright+1; %count electrodes + indexbr(1,dimbackright)=k; + end +end + +%% z-scores of the front and back + +% NOTE: +% ica struct is used for debugging purposed only +% and has no impact on the actual script run, +% just ignore it. + +blinksCount = 1; +for i=1:n % for each topography + + % create FA electrodes vector + zfrontlefteyes=zeros(1,dimlefteyes); + for h=1:dimlefteyes + zfrontlefteyes(1,h)=zmatrix(i,index1(1,h)); + end + ica(i).lefteyeArr = zfrontlefteyes; + + zfrontrighteyes=zeros(1,dimrighteyes); + for h=1:dimrighteyes + zfrontrighteyes(1,h)=zmatrix(i,index2(1,h)); + end + ica(i).righteyeArr = zfrontrighteyes; + + zcentereyes=zeros(1,dimcentereyes); + for h=1:dimcentereyes + zcentereyes(1,h)=zmatrix(i,index3(1,h)); + end + ica(i).centereyeArr = zcentereyes; + + % create other electrodes vectors + zcenter=zeros(1,dimcenter); + for h=1:dimcenter + zcenter(1,h)=zmatrix(i,indexc(1,h)); + end + ica(i).chArr = zcenter; + + zbackl=zeros(1,dimbackleft); + for h=1:dimbackleft + zbackl(1,h)=zmatrix(i,indexbl(1,h)); + end + ica(i).blArr = zbackl; + + zbackr=zeros(1,dimbackright); + for h=1:dimbackright + zbackr(1,h)=zmatrix(i,indexbr(1,h)); + end + ica(i).brArr = zbackr; + + % Calculates the mean of each z-score vector + % Sums the absolute value of each element in the vector, + % then divides that by the number of elements. + le = 0; + for j=1:dimlefteyes + le = le + abs(zfrontlefteyes(1,j)); + end + le = le/dimlefteyes; + ica(i).lemean = le; + + re = 0; + for j=1:dimrighteyes + re = re + abs(zfrontrighteyes(1,j)); + end + re = re/dimrighteyes; + ica(i).remean = re; + + ce = 0; + for j=1:dimcentereyes + ce = ce + zcentereyes(1,j); %removed abs() around zcentereyes b/c they should be the same sign (1/29/19) + end + ce = ce/dimcentereyes; + ica(i).cemean = ce; + + ch = 0; + for j=1:dimcenter + ch = ch + abs(zcenter(1,j)); + end + ch = ch/dimcenter; + ica(i).chmean = ch; + + bl = 0; + for j=1:dimbackleft + bl = bl + abs(zbackl(1,j)); + end + bl = bl/dimbackleft; + ica(i).blmean = bl; + + br = 0; + for j=1:dimbackright + br = br + abs(zbackr(1,j)); + end + br = br/dimbackright; + ica(i).brmean = br; + + % if one of the means of the eye vectors pass a certain threshold and + % all of the back are below a certain threshold, then we reject + if (abs(le) > 2 || abs(ce) > 2.5 || abs(re) > 2) %if high activity at front + if (mean([abs(bl) abs(br) abs(ch)]) < 1) % if low activity in back + if ( (var([zbackl zbackr]') < 0.15 || var([abs(zbackl) abs(zbackr)]')<0.075) && var([zfrontlefteyes zfrontrighteyes]')>var([zbackl zbackr]') ) %if low variance in back and greater variance in front + blinks(blinksCount) = i; + blinksCount = blinksCount + 1; + end + end + end + +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%STEPH EDIT TO CODE 1/18/19 % +%find all ICs with bumps btw 5 and 15 Hz % +%cwb=MARAcode_alphapeak(EEG); % +%loop through artifacted ICs and remove any ICs that have bumps % +remove_indices=[]; % +for ii = 1:length(blinks) % + for jj = 1:length(cwb)%components_with_bumps) % + if blinks(ii) == cwb(jj)%components_with_bumps(jj) % + remove_indices = [remove_indices ii]; % + end % + end % +end % +blinks(remove_indices)=[]; % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%STEPH EDIT TO ADJUST CODE 2/8/19 % +if length(blinks)>0 % + % eye_electrodes is entered into the func below to check % + % that the eye artifacts doesn't go too far into the head % + eye_electrodes=[]; % + for e=1:n % + if(chanlocs(1,e).radius>0.45 && chanlocs(1,e).radius<0.54) + if(abs(chanlocs(1,e).theta)<17) % + eye_electrodes(e) = e; % + end % + end % + end % + eye_electrodes = nonzeros(eye_electrodes); % + sec = Spatial_Info_eyes(blinks,eye_electrodes,topog,chanlocs,n); + remove_indices=[]; % + for ii = 1:length(blinks) % + for jj = 1:length(sec)%blinks_to_keep % + if blinks(ii) == sec(jj) % + remove_indices = [remove_indices ii]; % + end % + end % + end % + blinks(remove_indices)=[]; % +end % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +disp('End Blink Detection'); diff --git a/code/thrive_eeg/adjusted_adjust_scripts/beall_horizontal.m b/code/thrive_eeg/adjusted_adjust_scripts/beall_horizontal.m new file mode 100644 index 0000000..6323cfc --- /dev/null +++ b/code/thrive_eeg/adjusted_adjust_scripts/beall_horizontal.m @@ -0,0 +1,235 @@ +% Author: Daniel J. Beall +% Email: DJBEALL1101@gmail.com +% +% beall_horizontal() - Returns list of ICA components marked with +% horizontal eye movement +% +% Usage: +% >> [horizontal] = beall_horizontal(cwb,topog,chanlocs,n); +% +% Inputs: +% cwb - list of components with bumps +% topog - topographies vector +% chanlocs - EEG.chanlocs struct +% n - number of ICs +% nchannels - number of channels +% Outputs: +% horizontal - list of detected blinks +% + +function [horizontal] = beall_horizontal(cwb,topog,chanlocs,n) + +horizontal = []; +nchannels=length(chanlocs); + +%% Get Z-Scores Matrix +zmatrix = zeros(n,n); +for i=1:n % for each topography + curr_vect = zeros(n); + %deep copy ICA matrix + for h=1:n + zmatrix(i,h) = topog(i,h); + end + for h=1:n + curr_vect(h,1) = topog(i,h); + end + z_vect = zscore(curr_vect); + for h=1:n + zmatrix(i,h) = z_vect(h,1); + end +end +% _ _ +% zmatrix = | z11 z12 z13 ... | row1 = IC1 +% | z21 z22 z23 ... | row2 = IC2 +% | z31 z32 z33 ... | ... +% |_... ... ... zij_| +% col1=E1 col2=E2 ... nxn matrix (n=#components) + +%% Define scalp zones + +% Find electrodes in Frontal Area (FA) +dimlefteyes=0; %number of electrodes +index1=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + %if (chanlocs(1,k).theta > -62 && chanlocs(1,k).theta < -38) && (chanlocs(1,k).radius>0.39) %electrodes are in FA + if (chanlocs(1,k).theta > -62 && chanlocs(1,k).theta < -35) && (chanlocs(1,k).radius>0.5) + dimlefteyes=dimlefteyes+1; %count electrodes + index1(1,dimlefteyes)=k; + end +end + +dimrighteyes=0; %number of electrodes +index2=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if (chanlocs(1,k).theta < 62 && chanlocs(1,k).theta > 35) && (chanlocs(1,k).radius>0.5) %electrodes are in FA + dimrighteyes=dimrighteyes+1; %count electrodes + index2(1,dimrighteyes)=k; + end +end + +% Find electrodes in everywhere else +dimcenter=0; %number of electrodes +indexc=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if( (abs(chanlocs(1,k).theta)) > 35 && abs(chanlocs(1,k).theta) < 109 && (chanlocs(1,k).radius<0.45) ) + dimcenter=dimcenter+1; %count electrodes + indexc(1,dimcenter)=k; + end +end + +dimbackleft=0; %number of electrodes +indexbl=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if (chanlocs(1,k).theta <= -109) && (chanlocs(1,k).radius<0.55) %electrodes are in FA + dimbackleft=dimbackleft+1; %count electrodes + indexbl(1,dimbackleft)=k; + end +end + +dimbackright=0; %number of electrodes +indexbr=zeros(1,nchannels); %indexes of electrodes +for k=1:nchannels + if (chanlocs(1,k).theta >= 109) && (chanlocs(1,k).radius<0.55) %electrodes are in FA + dimbackright=dimbackright+1; %count electrodes + indexbr(1,dimbackright)=k; + end +end + +%% z-scores of the front and back + +% NOTE: +% ica struct is used for debugging purposed only +% and has no impact on the actual script run, +% just ignore it. + +horizontalCount = 1; +for i=1:n % for each topography + + % create FA electrodes vector + zfrontlefteyes=zeros(1,dimlefteyes); + for h=1:dimlefteyes + zfrontlefteyes(1,h)=zmatrix(i,index1(1,h)); + end + ica(i).lefteyeArr = zfrontlefteyes; + + zfrontrighteyes=zeros(1,dimrighteyes); + for h=1:dimrighteyes + zfrontrighteyes(1,h)=zmatrix(i,index2(1,h)); + end + ica(i).righteyeArr = zfrontrighteyes; + + % create other electrodes vectors + zcenter=zeros(1,dimcenter); + for h=1:dimcenter + zcenter(1,h)=zmatrix(i,indexc(1,h)); + end + ica(i).chArr = zcenter; + + zbackl=zeros(1,dimbackleft); + for h=1:dimbackleft + zbackl(1,h)=zmatrix(i,indexbl(1,h)); + end + ica(i).blArr = zbackl; + + zbackr=zeros(1,dimbackright); + for h=1:dimbackright + zbackr(1,h)=zmatrix(i,indexbr(1,h)); + end + ica(i).brArr = zbackr; + + % Calculates the mean of each z-score vector. + % Sums the absolute value of each element in the vector, + % then divides that by the number of elements. + le = 0; + for j=1:dimlefteyes + le = le + abs(zfrontlefteyes(1,j)); + end + le = le/dimlefteyes; + ica(i).lemean = le; + + re = 0; + for j=1:dimrighteyes + re = re + abs(zfrontrighteyes(1,j)); + end + re = re/dimrighteyes; + ica(i).remean = re; + + ch = 0; + for j=1:dimcenter + ch = ch + abs(zcenter(1,j)); + end + ch = ch/dimcenter; + ica(i).chmean = ch; + + bl = 0; + for j=1:dimbackleft + bl = bl + abs(zbackl(1,j)); + end + bl = bl/dimbackleft; + ica(i).blmean = bl; + + br = 0; + for j=1:dimbackright + br = br + abs(zbackr(1,j)); + end + br = br/dimbackright; + ica(i).brmean = br; + + % if the left or right side pass a certain threshold and all of the + % back are below a certain threshold, then we reject + if(abs(le) > 2 || abs(re) > 2) %if high activity in front + if (mean([abs(bl) abs(br) abs(ch)]) < 1) %if low activity in back + if((var([zbackl zbackr]')<0.15 || var([abs(zbackl) abs(zbackr)]')<0.075) && var([zfrontlefteyes zfrontrighteyes]')>2.5) %if low variance in back and high variance in front + horizontal(horizontalCount) = i; + horizontalCount = horizontalCount + 1; + end + end + end + +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%STEPH EDIT TO CODE 1/18/19 % +%find all ICs with bumps btw 5 and 15 Hz % +%cwb=MARAcode_alphapeak(EEG); % +%loop through artifacted ICs and remove any ICs that have bumps % +remove_indices=[]; % +for ii = 1:length(horizontal) % + for jj = 1:length(cwb)%components_with_bumps) % + if horizontal(ii) == cwb(jj)%components_with_bumps(jj) % + remove_indices = [remove_indices ii]; % + end % + end % +end % +horizontal(remove_indices)=[]; % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%STEPH EDIT TO ADJUST CODE 2/8/19 % +% makes is so the func works for 64 and 128 chan nets % +if length(horizontal) > 0 %if there are artifacts % + % eye_electrodes is entered into the func below that checks % + % that the eye artifacts doesn't go too far into the head % + eye_electrodes=[]; % + for e=1:n % + if(chanlocs(1,e).radius>0.51 && chanlocs(1,e).radius<0.60) + if((abs(chanlocs(1,e).theta))>27 && abs(chanlocs(1,e).theta)<58) + eye_electrodes(e) = e; % + end % + end % + end % + eye_electrodes = nonzeros(eye_electrodes); % + sec = Spatial_Info_eyes(horizontal,eye_electrodes,topog,chanlocs,n); + remove_indices=[]; % + for ii = 1:length(horizontal) % + for jj = 1:length(sec)%horiz_to_keep ) % + if horizontal(ii) == sec(jj) % + remove_indices = [remove_indices ii]; % + end % + end % + end % + horizontal(remove_indices)=[]; % +end % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +disp('End Horizontal Eye Movement Detection'); diff --git a/code/thrive_eeg/appendix_scripts/edit_event_markers_thrive.m b/code/thrive_eeg/appendix_scripts/edit_event_markers_thrive.m new file mode 100644 index 0000000..df40354 --- /dev/null +++ b/code/thrive_eeg/appendix_scripts/edit_event_markers_thrive.m @@ -0,0 +1,468 @@ +% +%%%%%% Label event markers%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% This script labels the thrive flanker task data. Labelling includes basic +% information about stimulus type and responses, as well as exhaustive +% labeling of prior/next trial data. + +%% debug code +% Kia commented debug code +%EEG = pop_loadbv('/Users/kihossei/OneDrive - Florida International University/Projects/sfe/scripts/sfe-dataset/sourcedata/raw/eeg', '160015_sfe_eeg_s1-r1-e1.vhdr'); +%EEG = eeg_checkset(EEG); +%EEG = pop_resample( EEG, 250); +%EEG = eeg_checkset( EEG ); +%for atm=1:length({EEG.event.type}) + % if isnumeric(EEG.event(atm).type) + % EEG.event(atm).type = num2str(EEG.event(atm).type); + % end +%end +%% + +%% event codes from task + +% %practice trials +% leftStim1 leftStim2 stimNum congruent target +% img/rightArrow.png img/rightArrow.png 1 1 right +% img/leftArrow.png img/leftArrow.png 2 1 left +% img/leftArrow.png img/leftArrow.png 3 0 right +% img/rightArrow.png img/rightArrow.png 4 0 left +% %nonsocial condition +% img/rightArrow.png img/rightArrow.png 41 1 right +% img/leftArrow.png img/leftArrow.png 42 1 left +% img/leftArrow.png img/leftArrow.png 43 0 right +% img/rightArrow.png img/rightArrow.png 44 0 left +% %social condition +% img/rightArrow.png img/rightArrow.png 51 1 right +% img/leftArrow.png img/leftArrow.png 52 1 left +% img/leftArrow.png img/leftArrow.png 53 0 right +% img/rightArrow.png img/rightArrow.png 54 0 left + +%correct response: 11 +%error response: 12 +%technically correct response, but not the first response made: 21 +%technically error response, but not the first response made: 22 + +%all stim and resp markers for the task +all_stimMarkers = {'S 1', 'S 2', 'S 3', 'S 4', 'S 41', 'S 42', 'S 43', ... + 'S 44', 'S 51', 'S 52', 'S 53', 'S 54'}; +all_respMarkers = {'S 11', 'S 12', 'S 21', 'S 22'}; + +%subsets of stim/resp markers to be used in switch statements when +%labelling +practice_stimMarkers = {'S 1', 'S 2', 'S 3', 'S 4'}; +mainTask_stimMarkers = {'S 41', 'S 42', 'S 43', 'S 44', 'S 51', 'S 52', 'S 53', 'S 54'}; + +ns_stimMarkers = {'S 41', 'S 42', 'S 43', 'S 44'}; +s_stimMarkers = {'S 51', 'S 52', 'S 53', 'S 54'}; + +rightTarDir_stimMarkers = {'S 1', 'S 3', 'S 41', 'S 43', 'S 51', 'S 53'}; +leftTarDir_stimMarkers = {'S 2', 'S 4', 'S 42', 'S 44', 'S 52', 'S 54'}; + +congruent_stimMarkers = {'S 1', 'S 2', 'S 41', 'S 42', 'S 51', 'S 52'}; +incongruent_stimMarkers = {'S 3', 'S 4', 'S 43', 'S 44', 'S 53', 'S 54'}; + +first_RespMarkers = {'S 11', 'S 12'}; +extra_RespMarkers = {'S 21', 'S 22'}; + +corr_RespMarkers = {'S 11'}; +error_RespMarkers = {'S 12'}; + +%specify cutoff (in s) for how fast a valid rt can be +validRt_cutoff = .150; + + +%% Add labels to the event structure +EEG = pop_editeventfield( EEG, 'indices', strcat('1:', int2str(length(EEG.event))), ... + 'observation','NaN', 'eventType','NaN', 'targetDir','NaN', 'congruency','NaN', 'responded','NaN', 'accuracy','NaN', ... + 'rt','NaN', 'validRt','NaN', 'extraResponse','NaN', 'validTrial','NaN', ... + 'prevTargetDir','NaN', 'prevCongruency','NaN', 'prevResponded','NaN', ... + 'prevAccuracy','NaN', 'prevRt','NaN', 'prevValidRt','NaN', ... + 'prevExtraResponse','NaN', 'prevValidTrial','NaN', ... + 'nextTargetDir','NaN', 'nextCongruency','NaN', 'nextResponded','NaN', 'nextAccuracy','NaN', ... + 'nextRt','NaN', 'nextValidRt','NaN', 'nextExtraResponse','NaN', ... + 'nextValidTrial','NaN'); +EEG = eeg_checkset( EEG ); + +%note:accuracy and rt always corresponds to first response +% 'observation' = ns, s +% 'eventType' - stim, resp +% 'targetDir' - l, r +% 'congruency' - c, i +% 'responded' - 1, 0 as str +% 'accuracy' - 1, 0 as str copied from trsp +% 'rt' - +% 'validRt' - +% 'extraResponse' - 1, 0 as str +% 'validTrial' - 1 if single, validRt response, else 0 + +% 'prevTargetDir' - l, r +% 'prevCongruency' - c, i +% 'prevResponded' - 1, 0 as str +% 'prevAccuracy' - 1, 0 as str copied from trsp +% 'prevRt' - +% 'prevValidRt' - +% 'prevExtraResponse' - 1, 0 as str +% 'prevValidTrial' - 1 if single, validRt response, else 0 + +% 'nextTargetDir' - l, r +% 'nextCongruency' - c, i +% 'nextResponded' - 1, 0 as str +% 'nextAccuracy' - 1, 0 as str copied from trsp +% 'nextRt' - +% 'nextValidRt' - +% 'nextExtraResponse' - 1, 0 as str +% 'nextValidTrial' - 1 if single, validRt response, else 0 + +%% loop to label markers + +%find all stimMarker events and store their event numbers in all_stimMarkers_idx + %all_stimMarkers_idx = find(ismember({EEG.event.type},mainTask_stimMarkers)); + +all_stimMarkers_eventNums = find(ismember({EEG.event.type},all_stimMarkers)); + +% fix "Index exceeds the number of array elements." +total_eventNums = size(EEG.event,2); + +%loop through all stim marker event numbers idented in the all_stimMarkers_eventNums vector and label +for t = all_stimMarkers_eventNums %t = event numbers stored in all_stimMarkers_eventNums + + stimEventNum = t; + + %label that this is a stimulus event + EEG.event(t).eventType = 'stim'; + + %find which TRIAL # this is, useful for context labelling + stimTrialNum = find(all_stimMarkers_eventNums==t); + + %figure out what the next Trsp EVENT # is, unless this is the last + %trial in a block. we determine if two stimuli are from seperate blocks + %by checking the amount of time between events. The ITI is 1.5-2 sec + %for this task, so each trial shoulod be within <2 sec of each other + %(we use a cutoff just above this at 3 s). + if stimTrialNum == length(all_stimMarkers_eventNums) + nextStimEventNum = 0; + elseif (EEG.event(all_stimMarkers_eventNums(stimTrialNum+1)).latency - EEG.event(all_stimMarkers_eventNums(stimTrialNum)).latency)/EEG.srate < 3 + nextStimEventNum = all_stimMarkers_eventNums(stimTrialNum+1); + else + nextStimEventNum = 0; + end + + %figure out what the previous Trsp EVENT # is, unless this is the + %first trial in a block. we determine if two stimuli are from seperate blocks + %by checking the amount of time between events. The ITI is 1.5-2 sec + %for this task, so each trial shoulod be within <2 sec of each other + %(we use a cutoff just above this at 3 s). + if stimTrialNum == 1 + prevStimEventNum = 0; + elseif (EEG.event(all_stimMarkers_eventNums(stimTrialNum)).latency - EEG.event(all_stimMarkers_eventNums(stimTrialNum-1)).latency)/EEG.srate < 3 + prevStimEventNum = all_stimMarkers_eventNums(stimTrialNum-1); + else + prevStimEventNum = 0; + end + + + %figure out if a response was made. if so, identify event # of + %response marker, rt, rt validity, accuracy, presence of extra responses. + switch EEG.event(t+1).type + + case first_RespMarkers %if there was a response + + EEG.event(t+1).eventType = 'resp'; + responded = 1; + respEventNum = t+1; + + %if there was a response, then get rt of response + rt = (EEG.event(t+1).latency - EEG.event(t).latency)/EEG.srate; + + %if there was a response, then determine if rt is valid or not + if rt > validRt_cutoff + validRt = 1; + else + validRt = 0; + end + + %if there was a response, then get accuracy of response + switch EEG.event(t+1).type + case corr_RespMarkers %if correct response + accuracy = 1; + case error_RespMarkers %if error response + accuracy = 0; + end + + %if there was a response, then look if there was at least one + %extra response after the first response + % fix "Index exceeds the number of array elements." + if t+2 <= total_eventNums + switch EEG.event(t+2).type + case extra_RespMarkers %if at least one extra response + extraResponse = 1; + otherwise %if NO response + extraResponse = 0; + end + else + extraResponse = 0; + end + + %deterimine if a valid trial or not (single, valid rt response) + if responded == 1 && validRt == 1 && extraResponse == 0 + validTrial = 1; + else + validTrial = 0; + end + + otherwise %if NO response + responded = 0; + extraResponse = 0; + respEventNum = 0; + accuracy = 0; + rt = 0; + validRt = 0; + validTrial = 0; + + end + + %loop to label 1/2 events per trial + for eventNum = [stimEventNum respEventNum] + + %if trial had no response, RespEventNum will be zero + if eventNum ~= 0 + + %label observation condition (nonsocial vs social) + switch EEG.event(t).type + case ns_stimMarkers + EEG.event(eventNum).observation = 'ns'; + case s_stimMarkers + EEG.event(eventNum).observation = 's'; + end + + %label stimulus target direction (right vs left) + switch EEG.event(t).type + case rightTarDir_stimMarkers + EEG.event(eventNum).targetDir = 'r'; + case leftTarDir_stimMarkers + EEG.event(eventNum).targetDir = 'l'; + end + + %label stimulus congruency (congruent vs incongruent) + switch EEG.event(t).type + case congruent_stimMarkers + EEG.event(eventNum).congruency = 'c'; + case incongruent_stimMarkers + EEG.event(eventNum).congruency = 'i'; + end + + %label whether response for this trial or not + EEG.event(eventNum).responded = responded; + + %label whether there were extra responses for this trial or not + EEG.event(eventNum).extraResponse = extraResponse; + + %label accuracy for this trial + EEG.event(eventNum).accuracy = accuracy; + + %label rt for this trial + EEG.event(eventNum).rt = rt; + + %label whether rt was valid for this trial or not + EEG.event(eventNum).validRt = validRt; + + %label whether valid trial or not (single, valid rt response) + EEG.event(eventNum).validTrial = validTrial; + + + %If this is not the last trial in a block, then also label the + %current stim event based on the next trial + if nextStimEventNum ~= 0 + + %figure out if a response was made on the NEXT TRIAL. if so, identify event # of + %response marker, rt, rt validity, accuracy, presence of extra responses. + switch EEG.event(nextStimEventNum+1).type + + case first_RespMarkers %if there was a response + nextResponded = 1; + nextRespEventNum = nextStimEventNum+1; + + %if there was a response, then get rt of response + nextRt = (EEG.event(nextStimEventNum+1).latency - EEG.event(nextStimEventNum).latency)/EEG.srate; + + %if there was a response, then determine if rt is valid or not + if nextRt > validRt_cutoff + nextValidRt = 1; + else + nextValidRt = 0; + end + + %if there was a response, then get accuracy of response + switch EEG.event(nextStimEventNum+1).type + case corr_RespMarkers %if correct response + nextAccuracy = 1; + case error_RespMarkers %if error response + nextAccuracy = 0; + end + + %if there was a response, then look if there was at least one + %extra response after the first response + % fix "Index exceeds the number of array elements." + if nextStimEventNum+2 <= total_eventNums + switch EEG.event(nextStimEventNum+2).type + case extra_RespMarkers %if at least one extra response + nextExtraResponse = 1; + otherwise %if NO response + nextExtraResponse = 0; + end + else + nextExtraResponse = 0; + end + + %deterimine if a valid trial or not (single, valid rt response) + if nextResponded == 1 && nextValidRt == 1 && nextExtraResponse == 0 + nextValidTrial = 1; + else + nextValidTrial = 0; + end + + otherwise %if NO response + nextResponded = 0; + nextExtraResponse = 0; + nextRespEventNum = 0; + nextAccuracy = 0; + nextRt = 0; + nextValidRt = 0; + nextValidTrial = 0; + + end %end switch to determine if response made on next trial + + %label next stimulus target direction (right vs left) + switch EEG.event(nextStimEventNum).type + case rightTarDir_stimMarkers + EEG.event(eventNum).nextTargetDir = 'r'; + case leftTarDir_stimMarkers + EEG.event(eventNum).nextTargetDir = 'l'; + end + + %label next stimulus congruency (congruent vs incongruent) + switch EEG.event(nextStimEventNum).type + case congruent_stimMarkers + EEG.event(eventNum).nextCongruency = 'c'; + case incongruent_stimMarkers + EEG.event(eventNum).nextCongruency = 'i'; + end + + %label this trial based on whether response on next trial or not + EEG.event(eventNum).nextResponded = nextResponded; + + %label this trial based on whether there were extra responses on next trial or not + EEG.event(eventNum).nextExtraResponse = nextExtraResponse; + + %label this trial based on accuracy of next trial + EEG.event(eventNum).nextAccuracy = nextAccuracy; + + %label this trial based on rt of next trial + EEG.event(eventNum).nextRt = nextRt; + + %label this trial based on whether rt was valid for next trial or not + EEG.event(eventNum).nextValidRt = nextValidRt; + + %label this trial based on whether next trial is a valid trial or not (single, valid rt response) + EEG.event(eventNum).nextValidTrial = nextValidTrial; + + end %end conditional: if nextStimEventNum ~= 0 + + %If this is not the first trial in a block, then also label the + %current stim event based on the prior trial + if prevStimEventNum ~= 0 + + %figure out if a response was made on the PREVIOUS TRIAL. if so, identify event # of + %response marker, rt, rt validity, accuracy, presence of extra responses. + switch EEG.event(prevStimEventNum+1).type + + case first_RespMarkers %if there was a response + prevResponded = 1; + prevRespEventNum = prevStimEventNum+1; + + %if there was a response, then get rt of response + prevRt = (EEG.event(prevStimEventNum+1).latency - EEG.event(prevStimEventNum).latency)/EEG.srate; + + %if there was a response, then determine if rt is valid or not + if prevRt > validRt_cutoff + prevValidRt = 1; + else + prevValidRt = 0; + end + + %if there was a response, then get accuracy of response + switch EEG.event(prevStimEventNum+1).type + case corr_RespMarkers %if correct response + prevAccuracy = 1; + case error_RespMarkers %if error response + prevAccuracy = 0; + end + + %if there was a response, then look if there was at least one + %extra response after the first response + switch EEG.event(prevStimEventNum+2).type + case extra_RespMarkers %if at least one extra response + prevExtraResponse = 1; + otherwise %if NO response + prevExtraResponse = 0; + end + + %deterimine if a valid trial or not (single, valid rt response) + if prevResponded == 1 && prevValidRt == 1 && prevExtraResponse == 0 + prevValidTrial = 1; + else + prevValidTrial = 0; + end + + otherwise %if NO response + prevResponded = 0; + prevExtraResponse = 0; + prevRespEventNum = 0; + prevAccuracy = 0; + prevRt = 0; + prevValidRt = 0; + prevValidTrial = 0; + + end %end switch to determine if response made on previous trial + + %label prev stimulus target direction (right vs left) + switch EEG.event(prevStimEventNum).type + case rightTarDir_stimMarkers + EEG.event(eventNum).prevTargetDir = 'r'; + case leftTarDir_stimMarkers + EEG.event(eventNum).prevTargetDir = 'l'; + end + + %label prev stimulus congruency (congruent vs incongruent) + switch EEG.event(prevStimEventNum).type + case congruent_stimMarkers + EEG.event(eventNum).prevCongruency = 'c'; + case incongruent_stimMarkers + EEG.event(eventNum).prevCongruency = 'i'; + end + + %label this trial based on whether response on prev trial or not + EEG.event(eventNum).prevResponded = prevResponded; + + %label this trial based on whether there were extra responses on prev trial or not + EEG.event(eventNum).prevExtraResponse = prevExtraResponse; + + %label this trial based on accuracy of prev trial + EEG.event(eventNum).prevAccuracy = prevAccuracy; + + %label this trial based on rt of prev trial + EEG.event(eventNum).prevRt = prevRt; + + %label this trial based on whether rt was valid for prev trial or not + EEG.event(eventNum).prevValidRt = prevValidRt; + + %label this trial based on whether prev trial is a valid trial or not (single, valid rt response) + EEG.event(eventNum).prevValidTrial = prevValidTrial; + + end %end conditional: if prevStimEventNum ~= 0 + + end %end if eventNum ~=0 conditional + + end %end loop through eventNum (stim, resp) for this trial + +end %end loop through all_stimMarkers_eventNums (all trials) diff --git a/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED-64only.bvef b/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED-64only.bvef new file mode 100644 index 0000000..3033d1d --- /dev/null +++ b/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED-64only.bvef @@ -0,0 +1,458 @@ + + + + + GND + 98 + 90 + 1 + + + 1 + 17 + 90 + 1 + 1 + + + 2 + -34 + -60 + 1 + 2 + + + 3 + -34 + 0 + 1 + 3 + + + 4 + -51 + -34 + 1 + 4 + + + 5 + -51 + -78 + 1 + 5 + + + 6 + -68 + -54 + 1 + 6 + + + 7 + -68 + -18 + 1 + 7 + + + 8 + -85 + -12 + 1 + 8 + + + 9 + -85 + -46 + 1 + 9 + + + 10 + -85 + -81 + 1 + 10 + + + 11 + -100 + -58 + 1 + 11 + + + 12 + -102 + -26 + 1 + 12 + + + 13 + -119 + -10 + 1 + 13 + + + 14 + -119 + -44 + 1 + 14 + + + 15 + -136 + -36 + 1 + 15 + + + 16 + -151 + -70 + 0 + 16 + + + 17 + 17 + -90 + 1 + 17 + + + 18 + -34 + 60 + 1 + 18 + + + 19 + -51 + 78 + 1 + 19 + + + 20 + -51 + 34 + 1 + 20 + + + 21 + -68 + 18 + 1 + 21 + + + 22 + -68 + 54 + 1 + 22 + + + 23 + 68 + -90 + 1 + 23 + + + 24 + -85 + 56 + 1 + 24 + + + 25 + -85 + 22 + 1 + 25 + + + 26 + -102 + 10 + 1 + 26 + + + 27 + -102 + 42 + 1 + 27 + + + 28 + -102 + 74 + 1 + 28 + + + 29 + -119 + 58 + 1 + 29 + + + 30 + -119 + 26 + 1 + 30 + + + 31 + -136 + 11 + 1 + 31 + + + 32 + -136 + 71 + 1 + 32 + + + 33 + 0 + 0 + 1 + 33 + + + 34 + 34 + 60 + 1 + 34 + + + 35 + 34 + 0 + 1 + 35 + + + 36 + 51 + 34 + 1 + 36 + + + 37 + 51 + 79 + 1 + 37 + + + 38 + 68 + 90 + 1 + 38 + + + 39 + 68 + 54 + 1 + 39 + + + 40 + 68 + 18 + 1 + 40 + + + 41 + 85 + 12 + 1 + 41 + + + 42 + 85 + 46 + 1 + 42 + + + 43 + 85 + 81 + 1 + 43 + + + 44 + 100 + 58 + 1 + 44 + + + 45 + 102 + 26 + 1 + 45 + + + 46 + 119 + 10 + 1 + 46 + + + 47 + 119 + 44 + 1 + 47 + + + 48 + 136 + 36 + 1 + 48 + + + 49 + 34 + -60 + 1 + 49 + + + 50 + 51 + -78 + 1 + 50 + + + 51 + 51 + -34 + 1 + 51 + + + 52 + 68 + -18 + 1 + 52 + + + 53 + 68 + -54 + 1 + 53 + + + 54 + 85 + -90 + 1 + 54 + + + 55 + 85 + -56 + 1 + 55 + + + 56 + 85 + -22 + 1 + 56 + + + 57 + 102 + -10 + 1 + 57 + + + 58 + 102 + -42 + 1 + 58 + + + 59 + 102 + -74 + 1 + 59 + + + 60 + 119 + -90 + 1 + 60 + + + 61 + 119 + -58 + 1 + 61 + + + 62 + 119 + -26 + 1 + 62 + + + 63 + 136 + -11 + 1 + 63 + + + 64 + 136 + -71 + 1 + 64 + + \ No newline at end of file diff --git a/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED.bvef b/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED.bvef new file mode 100644 index 0000000..4280b7f --- /dev/null +++ b/code/thrive_eeg/chan_locs_files/electrode_locs_files/CACS-128-X7-FIXED.bvef @@ -0,0 +1,906 @@ + + + + + GND + 98 + 90 + 1 + + + 1 + 17 + 90 + 1 + 1 + + + 2 + -34 + -60 + 1 + 2 + + + 3 + -34 + 0 + 1 + 3 + + + 4 + -51 + -34 + 1 + 4 + + + 5 + -51 + -78 + 1 + 5 + + + 6 + -68 + -54 + 1 + 6 + + + 7 + -68 + -18 + 1 + 7 + + + 8 + -85 + -12 + 1 + 8 + + + 9 + -85 + -46 + 1 + 9 + + + 10 + -85 + -81 + 1 + 10 + + + 11 + -100 + -58 + 1 + 11 + + + 12 + -102 + -26 + 1 + 12 + + + 13 + -119 + -10 + 1 + 13 + + + 14 + -119 + -44 + 1 + 14 + + + 15 + -136 + -36 + 1 + 15 + + + 16 + -151 + -70 + 0 + 16 + + + 17 + 17 + -90 + 1 + 17 + + + 18 + -34 + 60 + 1 + 18 + + + 19 + -51 + 78 + 1 + 19 + + + 20 + -51 + 34 + 1 + 20 + + + 21 + -68 + 18 + 1 + 21 + + + 22 + -68 + 54 + 1 + 22 + + + 23 + 68 + -90 + 1 + 23 + + + 24 + -85 + 56 + 1 + 24 + + + 25 + -85 + 22 + 1 + 25 + + + 26 + -102 + 10 + 1 + 26 + + + 27 + -102 + 42 + 1 + 27 + + + 28 + -102 + 74 + 1 + 28 + + + 29 + -119 + 58 + 1 + 29 + + + 30 + -119 + 26 + 1 + 30 + + + 31 + -136 + 11 + 1 + 31 + + + 32 + -136 + 71 + 1 + 32 + + + 33 + 0 + 0 + 1 + 33 + + + 34 + 34 + 60 + 1 + 34 + + + 35 + 34 + 0 + 1 + 35 + + + 36 + 51 + 34 + 1 + 36 + + + 37 + 51 + 79 + 1 + 37 + + + 38 + 68 + 90 + 1 + 38 + + + 39 + 68 + 54 + 1 + 39 + + + 40 + 68 + 18 + 1 + 40 + + + 41 + 85 + 12 + 1 + 41 + + + 42 + 85 + 46 + 1 + 42 + + + 43 + 85 + 81 + 1 + 43 + + + 44 + 100 + 58 + 1 + 44 + + + 45 + 102 + 26 + 1 + 45 + + + 46 + 119 + 10 + 1 + 46 + + + 47 + 119 + 44 + 1 + 47 + + + 48 + 136 + 36 + 1 + 48 + + + 49 + 34 + -60 + 1 + 49 + + + 50 + 51 + -78 + 1 + 50 + + + 51 + 51 + -34 + 1 + 51 + + + 52 + 68 + -18 + 1 + 52 + + + 53 + 68 + -54 + 1 + 53 + + + 54 + 85 + -90 + 1 + 54 + + + 55 + 85 + -56 + 1 + 55 + + + 56 + 85 + -22 + 1 + 56 + + + 57 + 102 + -10 + 1 + 57 + + + 58 + 102 + -42 + 1 + 58 + + + 59 + 102 + -74 + 1 + 59 + + + 60 + 119 + -90 + 1 + 60 + + + 61 + 119 + -58 + 1 + 61 + + + 62 + 119 + -26 + 1 + 62 + + + 63 + 136 + -11 + 1 + 63 + + + 64 + 136 + -71 + 1 + 64 + + + 65 + -17 + -31 + 1 + 65 + + + 66 + -17 + 31 + 1 + 66 + + + 67 + -34 + -30 + 1 + 67 + + + 68 + -51 + -56 + 1 + 68 + + + 69 + -51 + -12 + 1 + 69 + + + 70 + -51 + 13 + 1 + 70 + + + 71 + -68 + 0 + 1 + 71 + + + 72 + -68 + -36 + 1 + 72 + + + 73 + -68 + -72 + 1 + 73 + + + 74 + -85 + -63 + 1 + 74 + + + 75 + -85 + -29 + 1 + 75 + + + 76 + -102 + -10 + 1 + 76 + + + 77 + -102 + -42 + 1 + 77 + + + 78 + -98 + -74 + 1 + 78 + + + 79 + -119 + -27 + 1 + 79 + + + 80 + -136 + -18 + 1 + 80 + + + 81 + -34 + 31 + 1 + 81 + + + 82 + 35 + -90 + 1 + 82 + + + 83 + -51 + 56 + 1 + 83 + + + 84 + -68 + 72 + 1 + 84 + + + 85 + -68 + 36 + 1 + 85 + + + 86 + -85 + 5 + 1 + 86 + + + 87 + -85 + 39 + 1 + 87 + + + 88 + -85 + 73 + 1 + 88 + + + 89 + 102 + -90 + 1 + 89 + + + 90 + -102 + 58 + 1 + 90 + + + 91 + -102 + 26 + 1 + 91 + + + 92 + -119 + 10 + 1 + 92 + + + 93 + -119 + 42 + 1 + 93 + + + 94 + -119 + 74 + 1 + 94 + + + 95 + -136 + 51 + 1 + 95 + + + 96 + -136 + 29 + 1 + 96 + + + 97 + 17 + 30 + 1 + 97 + + + 98 + 17 + -30 + 1 + 98 + + + 99 + 34 + 30 + 1 + 99 + + + 100 + 34 + 90 + 1 + 100 + + + 101 + 51 + 56 + 1 + 101 + + + 102 + 51 + 12 + 1 + 102 + + + 103 + 68 + 0 + 1 + 103 + + + 104 + 68 + 36 + 1 + 104 + + + 105 + 68 + 72 + 1 + 105 + + + 106 + 85 + 63 + 1 + 106 + + + 107 + 85 + 29 + 1 + 107 + + + 108 + 102 + 10 + 1 + 108 + + + 109 + 102 + 42 + 1 + 109 + + + 110 + 98 + 74 + 1 + 110 + + + 111 + 119 + 27 + 1 + 111 + + + 112 + 136 + 18 + 1 + 112 + + + 113 + 34 + -31 + 1 + 113 + + + 114 + 51 + -13 + 1 + 114 + + + 115 + 51 + -56 + 1 + 115 + + + 116 + 68 + -72 + 1 + 116 + + + 117 + 68 + -36 + 1 + 117 + + + 118 + 85 + -5 + 1 + 118 + + + 119 + 85 + -39 + 1 + 119 + + + 120 + 85 + -73 + 1 + 120 + + + 121 + 102 + -58 + 1 + 121 + + + 122 + 102 + -26 + 1 + 122 + + + 123 + 119 + -10 + 1 + 123 + + + 124 + 119 + -42 + 1 + 124 + + + 125 + 119 + -74 + 1 + 125 + + + 126 + 136 + -90 + 1 + 126 + + + 127 + 136 + -51 + 1 + 127 + + + 128 + 136 + -29 + 1 + 128 + + \ No newline at end of file diff --git a/code/thrive_eeg/fontconfig/12b26b760a24f8b4feb03ad48a333a72-le64.cache-3 b/code/thrive_eeg/fontconfig/12b26b760a24f8b4feb03ad48a333a72-le64.cache-3 new file mode 100644 index 0000000..f30279c Binary files /dev/null and b/code/thrive_eeg/fontconfig/12b26b760a24f8b4feb03ad48a333a72-le64.cache-3 differ diff --git a/code/thrive_eeg/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-3 b/code/thrive_eeg/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-3 new file mode 100644 index 0000000..8fa264d Binary files /dev/null and b/code/thrive_eeg/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-3 differ diff --git a/code/thrive_eeg/slurm-10424247.out b/code/thrive_eeg/slurm-10424247.out new file mode 100644 index 0000000..7cc5637 --- /dev/null +++ b/code/thrive_eeg/slurm-10424247.out @@ -0,0 +1,11337 @@ +/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg +n051.panther.net +Wed Jun 21 10:55:14 EDT 2023 + + < M A T L A B (R) > + Copyright 1984-2021 The MathWorks, Inc. + R2021b (9.11.0.1769968) 64-bit (glnxa64) + September 17, 2021 + + +To get started, type doc. +For product information, visit www.mathworks.com. + +>> >> >> >> >> >> Starting parallel pool (parpool) using the 'local' profile ... +Connected to the parallel pool (number of workers: 4). + +ans = + + ProcessPool with properties: + + Connected: true + NumWorkers: 4 + Cluster: local + AttachedFiles: {} + AutoAddClientPath: true + IdleTimeout: 30 minutes (30 minutes remaining) + SpmdEnabled: true + +>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> + + +*** Processing subject 1 (sub-3000008_all_eeg_s1_r1_e1.vhdr) *** + + +pop_loadbv(): reading header file +Done. +pop_loadbv(): reading EEG data +pop_loadbv(): scaling EEG data +pop_loadbv(): reading marker file +Done. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +eeg_checkset warning: number of columns in data (64) does not match the number of channels (63): corrected +eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed +[Warning: channel labels should not be empty, creating unique labels] +Warning: the size of the channel location structure does not match with + number of channels. Channel information have been removed. +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 60:59= - 10%, ETE 55:26= \ 15%, ETE 51:31= | 20%, ETE 48:18= / 25%, ETE 44:57= - 30%, ETE 41:58= \ 35%, ETE 38:52= | 40%, ETE 35:50= / 45%, ETE 32:47= - 50%, ETE 29:49= \ 55%, ETE 26:48= | 60%, ETE 23:48= / 65%, ETE 20:48= - 70%, ETE 17:48= \ 75%, ETE 14:50= | 80%, ETE 11:52= / 85%, ETE 08:54= - 90%, ETE 05:56= \ 95%, ETE 02:58=| 100%, ETE 00:00 +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 01:14= - 10%, ETE 00:47= \ 15%, ETE 00:37= | 20%, ETE 00:32= / 25%, ETE 00:28= - 30%, ETE 00:25= \ 35%, ETE 00:22= | 40%, ETE 00:20= / 45%, ETE 00:18= - 50%, ETE 00:16= \ 55%, ETE 00:14= | 60%, ETE 00:13= / 65%, ETE 00:11= - 70%, ETE 00:10= \ 75%, ETE 00:08= | 80%, ETE 00:06= / 85%, ETE 00:05= - 90%, ETE 00:03= \ 95%, ETE 00:02=| 100%, ETE 00:00 +Removing 3 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Saving dataset... +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 04:02= - 10%, ETE 03:38= \ 15%, ETE 03:22= | 20%, ETE 03:09= / 25%, ETE 03:01= - 30%, ETE 02:50= \ 35%, ETE 02:37= | 40%, ETE 02:24= / 45%, ETE 02:12= - 50%, ETE 02:00= \ 55%, ETE 01:47= | 60%, ETE 01:35= / 65%, ETE 01:23= - 70%, ETE 01:11= \ 75%, ETE 00:59= | 80%, ETE 00:48= / 85%, ETE 00:36= - 90%, ETE 00:24= \ 95%, ETE 00:12=| 100%, ETE 00:00 +The input dataset will be split into 8110 epochs of 1 s +Epochs will overlap by 0%. +Inserting 8110 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560.......................................6600.................... +...................6640.......................................6680.......... +.............................6720.......................................6760 +.......................................6800.............................. +.........6840.......................................6880.................... +...................6920.......................................6960.......... +.............................7000.......................................7040 +.......................................7080.............................. +.........7120.......................................7160.................... +...................7200.......................................7240.......... +.............................7280.......................................7320 +.......................................7360.............................. +.........7400.......................................7440.................... +...................7480.......................................7520.......... +.............................7560.......................................7600 +.......................................7640.............................. +.........7680.......................................7720.................... +...................7760.......................................7800.......... +.............................7840.......................................7880 +.......................................7920.............................. +.........7960.......................................8000.................... +...................8040.......................................8080.......... +.................... +Sorting the event table. +Splitting the data into 8110 1.00-s epochs +pop_epoch():8110 epochs selected +Epoching... +pop_epoch():8110 epochs generated +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +1 channel selected +1463/8109 trials marked for rejection + +1 channel selected +1724/8109 trials marked for rejection +1 channel selected +3511/8109 trials marked for rejection + +1 channel selected +345/8109 trials marked for rejection +1 channel selected +1337/8109 trials marked for rejection + +1 channel selected +2026/8109 trials marked for rejection +1 channel selected +1316/8109 trials marked for rejection + +1 channel selected +1736/8109 trials marked for rejection +1 channel selected +1164/8109 trials marked for rejection + +1 channel selected +1457/8109 trials marked for rejection +1 channel selected +1189/8109 trials marked for rejection + +1 channel selected +1483/8109 trials marked for rejection +1 channel selected +1199/8109 trials marked for rejection + +1 channel selected +1458/8109 trials marked for rejection +1 channel selected +1199/8109 trials marked for rejection + +1 channel selected +1456/8109 trials marked for rejection +1 channel selected +1231/8109 trials marked for rejection + +1 channel selected +1517/8109 trials marked for rejection +1 channel selected +1197/8109 trials marked for rejection + +1 channel selected +1456/8109 trials marked for rejection +1 channel selected +1193/8109 trials marked for rejection + +1 channel selected +1455/8109 trials marked for rejection +1 channel selected +1302/8109 trials marked for rejection + +1 channel selected +1492/8109 trials marked for rejection +1 channel selected +1760/8109 trials marked for rejection + +1 channel selected +1719/8109 trials marked for rejection +1 channel selected +1719/8109 trials marked for rejection + +1 channel selected +1980/8109 trials marked for rejection +1 channel selected +1603/8109 trials marked for rejection + +1 channel selected +1744/8109 trials marked for rejection +1 channel selected +1536/8109 trials marked for rejection + +1 channel selected +1999/8109 trials marked for rejection +1 channel selected +1189/8109 trials marked for rejection + +1 channel selected +1459/8109 trials marked for rejection +1 channel selected +1386/8109 trials marked for rejection + +1 channel selected +1974/8109 trials marked for rejection +1 channel selected +1187/8109 trials marked for rejection + +1 channel selected +1452/8109 trials marked for rejection +1 channel selected +1911/8109 trials marked for rejection + +1 channel selected +1571/8109 trials marked for rejection +1 channel selected +1174/8109 trials marked for rejection + +1 channel selected +1454/8109 trials marked for rejection +1 channel selected +1319/8109 trials marked for rejection + +1 channel selected +1661/8109 trials marked for rejection +1 channel selected +2680/8109 trials marked for rejection + +1 channel selected +388/8109 trials marked for rejection +1 channel selected +1472/8109 trials marked for rejection + +1 channel selected +1509/8109 trials marked for rejection +1 channel selected +1698/8109 trials marked for rejection + +1 channel selected +1864/8109 trials marked for rejection +1 channel selected +1230/8109 trials marked for rejection + +1 channel selected +1464/8109 trials marked for rejection +1 channel selected +3389/8109 trials marked for rejection + +1 channel selected +1462/8109 trials marked for rejection +1 channel selected +1712/8109 trials marked for rejection + +1 channel selected +744/8109 trials marked for rejection +1 channel selected +1877/8109 trials marked for rejection + +1 channel selected +1887/8109 trials marked for rejection +1 channel selected +1659/8109 trials marked for rejection + +1 channel selected +76/8109 trials marked for rejection +1 channel selected +1333/8109 trials marked for rejection + +1 channel selected +1440/8109 trials marked for rejection +1 channel selected +1217/8109 trials marked for rejection + +1 channel selected +519/8109 trials marked for rejection +1 channel selected +1350/8109 trials marked for rejection + +1 channel selected +1437/8109 trials marked for rejection +1 channel selected +1473/8109 trials marked for rejection + +1 channel selected +1355/8109 trials marked for rejection +1 channel selected +1238/8109 trials marked for rejection + +1 channel selected +1357/8109 trials marked for rejection +1 channel selected +1361/8109 trials marked for rejection + +1 channel selected +1391/8109 trials marked for rejection +1 channel selected +1307/8109 trials marked for rejection + +1 channel selected +819/8109 trials marked for rejection +1 channel selected +1197/8109 trials marked for rejection + +1 channel selected +1230/8109 trials marked for rejection +1 channel selected +1194/8109 trials marked for rejection + +1 channel selected +1299/8109 trials marked for rejection +1 channel selected +1153/8109 trials marked for rejection + +1 channel selected +1032/8109 trials marked for rejection +1 channel selected +2926/8109 trials marked for rejection + +1 channel selected +215/8109 trials marked for rejection +1 channel selected +3220/8109 trials marked for rejection + +1 channel selected +287/8109 trials marked for rejection +1 channel selected +1143/8109 trials marked for rejection + +1 channel selected +1093/8109 trials marked for rejection +1 channel selected +1167/8109 trials marked for rejection + +1 channel selected +1143/8109 trials marked for rejection +1 channel selected +1283/8109 trials marked for rejection + +1 channel selected +1396/8109 trials marked for rejection +1 channel selected +1507/8109 trials marked for rejection + +1 channel selected +1493/8109 trials marked for rejection +1 channel selected +1145/8109 trials marked for rejection + +1 channel selected +1338/8109 trials marked for rejection +1 channel selected +1170/8109 trials marked for rejection + +1 channel selected +1303/8109 trials marked for rejection +1 channel selected +1249/8109 trials marked for rejection + +1 channel selected +1303/8109 trials marked for rejection +1 channel selected +1405/8109 trials marked for rejection + +1 channel selected +374/8109 trials marked for rejection +1 channel selected +4507/8109 trials marked for rejection + +1 channel selected +76/8109 trials marked for rejection +1 channel selected +1141/8109 trials marked for rejection + +1 channel selected +1237/8109 trials marked for rejection +1 channel selected +1479/8109 trials marked for rejection + +1 channel selected +75/8109 trials marked for rejection +1 channel selected +1264/8109 trials marked for rejection + +1 channel selected +1237/8109 trials marked for rejection +1 channel selected +1157/8109 trials marked for rejection + +1 channel selected +1015/8109 trials marked for rejection +1 channel selected +1318/8109 trials marked for rejection + +1 channel selected +824/8109 trials marked for rejection +1 channel selected +4918/8109 trials marked for rejection + +1 channel selected +276/8109 trials marked for rejection +1 channel selected +1168/8109 trials marked for rejection + +1 channel selected +873/8109 trials marked for rejection +1 channel selected +4380/8109 trials marked for rejection + +1 channel selected +135/8109 trials marked for rejection +1 channel selected +1534/8109 trials marked for rejection + +1 channel selected +56/8109 trials marked for rejection +Removing 23 channel(s)... +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +37 channel selected +2533/8109 trials marked for rejection + +37 channel selected +1815/8109 trials marked for rejection +2617/8109 trials rejected +Removing 2617 trial(s)... +Pop_select: removing 6126 unreferenced events +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform + +Attempting to convert data matrix to double precision for more accurate ICA results. + +Input data size [37,5492000] = 37 channels, 5492000 frames/nFinding 37 ICA components using extended ICA. +Kurtosis will be calculated initially every 1 blocks using 6000 data points. +Decomposing 4011 frames per ICA weight ((1369)^2 = 5492000 weights, Initial learning rate will be 0.001, block size 78. +Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg. +Training will end when wchange < 1e-07 or after 512 steps. +Online bias adjustment will be used. +Removing mean of each channel ... +Final training data range: -998.258 to 997.82 +Computing the sphering matrix... +Starting weights are the identity matrix ... +Sphering the data ... +Beginning ICA training ... first training step may be slow ... +IdleTimeout has been reached. +Parallel pool using the 'local' profile is shutting down. +Lowering learning rate to 0.0009 and starting again. +Lowering learning rate to 0.00081 and starting again. +Lowering learning rate to 0.000729 and starting again. +Lowering learning rate to 0.0006561 and starting again. +Lowering learning rate to 0.00059049 and starting again. +Lowering learning rate to 0.000531441 and starting again. +Lowering learning rate to 0.000478297 and starting again. +Lowering learning rate to 0.000430467 and starting again. +Lowering learning rate to 0.00038742 and starting again. +Lowering learning rate to 0.000348678 and starting again. +Lowering learning rate to 0.000313811 and starting again. +Lowering learning rate to 0.00028243 and starting again. +Lowering learning rate to 0.000254187 and starting again. +Lowering learning rate to 0.000228768 and starting again. +Lowering learning rate to 0.000205891 and starting again. +Lowering learning rate to 0.000185302 and starting again. +Lowering learning rate to 0.000166772 and starting again. +Lowering learning rate to 0.000150095 and starting again. +Lowering learning rate to 0.000135085 and starting again. +Lowering learning rate to 0.000121577 and starting again. +step 1 - lrate 0.000122, wchange 19.33792530, angledelta 0.0 deg +Lowering learning rate to 0.000109419 and starting again. +Lowering learning rate to 9.84771e-05 and starting again. +step 1 - lrate 0.000098, wchange 20.32701724, angledelta 0.0 deg +step 2 - lrate 0.000098, wchange 0.85548589, angledelta 0.0 deg +step 3 - lrate 0.000098, wchange 1.81317099, angledelta 86.6 deg +step 4 - lrate 0.000097, wchange 1.96462051, angledelta 105.0 deg +step 5 - lrate 0.000095, wchange 1.64539791, angledelta 104.3 deg +step 6 - lrate 0.000093, wchange 1.12244091, angledelta 85.5 deg +step 7 - lrate 0.000091, wchange 3.39839548, angledelta 128.8 deg +step 8 - lrate 0.000089, wchange 0.34923529, angledelta 103.4 deg +step 9 - lrate 0.000087, wchange 1.23970130, angledelta 110.5 deg +step 10 - lrate 0.000085, wchange 0.73277759, angledelta 129.0 deg +step 11 - lrate 0.000084, wchange 0.77943970, angledelta 106.1 deg +step 12 - lrate 0.000082, wchange 1.29518536, angledelta 108.0 deg +step 13 - lrate 0.000080, wchange 0.46551877, angledelta 119.7 deg +step 14 - lrate 0.000079, wchange 0.71228618, angledelta 140.9 deg +step 15 - lrate 0.000077, wchange 0.70869890, angledelta 122.7 deg +step 16 - lrate 0.000076, wchange 1.20022581, angledelta 110.4 deg +step 17 - lrate 0.000074, wchange 0.34330842, angledelta 155.4 deg +step 18 - lrate 0.000073, wchange 1.21045937, angledelta 130.0 deg +step 19 - lrate 0.000071, wchange 1.52077287, angledelta 157.8 deg +step 20 - lrate 0.000070, wchange 0.91192961, angledelta 155.9 deg +step 21 - lrate 0.000068, wchange 0.73728084, angledelta 157.5 deg +step 22 - lrate 0.000067, wchange 0.11495435, angledelta 64.5 deg +step 23 - lrate 0.000066, wchange 1.70071609, angledelta 131.8 deg +step 24 - lrate 0.000064, wchange 0.27962843, angledelta 111.3 deg +step 25 - lrate 0.000063, wchange 1.32763277, angledelta 98.3 deg +step 26 - lrate 0.000062, wchange 0.86456457, angledelta 125.7 deg +step 27 - lrate 0.000061, wchange 0.28266679, angledelta 122.4 deg +step 28 - lrate 0.000059, wchange 0.23572390, angledelta 57.2 deg +step 29 - lrate 0.000059, wchange 0.19309377, angledelta 48.3 deg +step 30 - lrate 0.000059, wchange 0.16592876, angledelta 92.6 deg +step 31 - lrate 0.000058, wchange 1.48704278, angledelta 117.7 deg +step 32 - lrate 0.000057, wchange 0.19886709, angledelta 66.6 deg +step 33 - lrate 0.000056, wchange 1.01435926, angledelta 141.0 deg +step 34 - lrate 0.000055, wchange 0.08074556, angledelta 94.1 deg +step 35 - lrate 0.000054, wchange 1.19532987, angledelta 76.3 deg +step 36 - lrate 0.000053, wchange 1.62497871, angledelta 168.6 deg +step 37 - lrate 0.000052, wchange 0.04923846, angledelta 114.3 deg +step 38 - lrate 0.000051, wchange 0.08683120, angledelta 124.4 deg +step 39 - lrate 0.000050, wchange 0.09455351, angledelta 126.6 deg +step 40 - lrate 0.000049, wchange 0.77803523, angledelta 70.8 deg +step 41 - lrate 0.000048, wchange 0.89760181, angledelta 93.8 deg +step 42 - lrate 0.000047, wchange 0.08673650, angledelta 78.0 deg +step 43 - lrate 0.000046, wchange 0.83178221, angledelta 137.7 deg +step 44 - lrate 0.000045, wchange 0.10528112, angledelta 77.0 deg +step 45 - lrate 0.000044, wchange 0.15270024, angledelta 137.5 deg +step 46 - lrate 0.000043, wchange 0.99733847, angledelta 58.6 deg +step 47 - lrate 0.000043, wchange 0.05709775, angledelta 96.6 deg +step 48 - lrate 0.000042, wchange 0.06150424, angledelta 128.4 deg +step 49 - lrate 0.000041, wchange 0.06715593, angledelta 102.8 deg +step 50 - lrate 0.000040, wchange 0.11111214, angledelta 129.1 deg +step 51 - lrate 0.000040, wchange 1.12163444, angledelta 124.3 deg +step 52 - lrate 0.000039, wchange 0.14318177, angledelta 141.8 deg +step 53 - lrate 0.000038, wchange 0.11703474, angledelta 90.6 deg +step 54 - lrate 0.000037, wchange 0.10901242, angledelta 126.5 deg +step 55 - lrate 0.000037, wchange 0.03780552, angledelta 92.2 deg +step 56 - lrate 0.000036, wchange 1.18997270, angledelta 107.4 deg +step 57 - lrate 0.000035, wchange 0.05899773, angledelta 99.5 deg +step 58 - lrate 0.000034, wchange 0.09721008, angledelta 113.5 deg +step 59 - lrate 0.000034, wchange 0.56139728, angledelta 69.4 deg +step 60 - lrate 0.000033, wchange 0.05687231, angledelta 83.0 deg +step 61 - lrate 0.000032, wchange 0.05316756, angledelta 85.8 deg +step 62 - lrate 0.000032, wchange 0.11443012, angledelta 138.6 deg +step 63 - lrate 0.000031, wchange 0.04938473, angledelta 107.9 deg +step 64 - lrate 0.000031, wchange 0.07906636, angledelta 124.1 deg +step 65 - lrate 0.000030, wchange 0.03153947, angledelta 93.0 deg +step 66 - lrate 0.000029, wchange 0.07543459, angledelta 120.3 deg +step 67 - lrate 0.000029, wchange 0.03770202, angledelta 110.5 deg +step 68 - lrate 0.000028, wchange 0.07261454, angledelta 122.5 deg +step 69 - lrate 0.000028, wchange 0.02668138, angledelta 119.1 deg +step 70 - lrate 0.000027, wchange 0.05655425, angledelta 119.7 deg +step 71 - lrate 0.000026, wchange 0.02993800, angledelta 121.8 deg +step 72 - lrate 0.000026, wchange 0.02649783, angledelta 103.5 deg +step 73 - lrate 0.000025, wchange 0.03543307, angledelta 104.3 deg +step 74 - lrate 0.000025, wchange 0.03609767, angledelta 136.7 deg +step 75 - lrate 0.000024, wchange 0.02833489, angledelta 132.5 deg +step 76 - lrate 0.000024, wchange 0.03572013, angledelta 108.8 deg +step 77 - lrate 0.000023, wchange 0.04132598, angledelta 135.0 deg +step 78 - lrate 0.000023, wchange 0.02629194, angledelta 130.5 deg +step 79 - lrate 0.000023, wchange 0.04231953, angledelta 123.2 deg +step 80 - lrate 0.000022, wchange 0.02478801, angledelta 134.3 deg +step 81 - lrate 0.000022, wchange 0.02296665, angledelta 85.5 deg +step 82 - lrate 0.000021, wchange 0.01767225, angledelta 108.5 deg +step 83 - lrate 0.000021, wchange 0.01906429, angledelta 117.8 deg +step 84 - lrate 0.000020, wchange 0.02258388, angledelta 124.0 deg +step 85 - lrate 0.000020, wchange 0.02531739, angledelta 131.8 deg +step 86 - lrate 0.000020, wchange 0.04157510, angledelta 105.2 deg +step 87 - lrate 0.000019, wchange 0.01929815, angledelta 111.9 deg +step 88 - lrate 0.000019, wchange 0.01790146, angledelta 120.4 deg +step 89 - lrate 0.000018, wchange 0.02655259, angledelta 110.6 deg +step 90 - lrate 0.000018, wchange 0.02268617, angledelta 132.2 deg +step 91 - lrate 0.000018, wchange 0.05672165, angledelta 124.6 deg +step 92 - lrate 0.000017, wchange 0.02352653, angledelta 115.2 deg +step 93 - lrate 0.000017, wchange 0.03281811, angledelta 94.2 deg +step 94 - lrate 0.000017, wchange 0.02151872, angledelta 111.4 deg +step 95 - lrate 0.000016, wchange 0.01596098, angledelta 87.9 deg +step 96 - lrate 0.000016, wchange 0.02220108, angledelta 118.6 deg +step 97 - lrate 0.000016, wchange 0.03562537, angledelta 96.5 deg +step 98 - lrate 0.000015, wchange 0.05180541, angledelta 145.5 deg +step 99 - lrate 0.000015, wchange 0.01880625, angledelta 91.4 deg +step 100 - lrate 0.000015, wchange 0.02951894, angledelta 114.7 deg +step 101 - lrate 0.000014, wchange 0.02542390, angledelta 139.2 deg +step 102 - lrate 0.000014, wchange 0.03348596, angledelta 119.3 deg +step 103 - lrate 0.000014, wchange 0.02414074, angledelta 124.1 deg +step 104 - lrate 0.000014, wchange 0.03483963, angledelta 105.8 deg +step 105 - lrate 0.000013, wchange 0.02220088, angledelta 136.3 deg +step 106 - lrate 0.000013, wchange 0.01615024, angledelta 101.2 deg +step 107 - lrate 0.000013, wchange 0.03055002, angledelta 142.7 deg +step 108 - lrate 0.000013, wchange 0.01539023, angledelta 121.0 deg +step 109 - lrate 0.000012, wchange 0.01015830, angledelta 125.5 deg +step 110 - lrate 0.000012, wchange 0.03460101, angledelta 99.6 deg +step 111 - lrate 0.000012, wchange 0.04717423, angledelta 122.6 deg +step 112 - lrate 0.000012, wchange 0.02647968, angledelta 122.7 deg +step 113 - lrate 0.000011, wchange 0.01945791, angledelta 120.9 deg +step 114 - lrate 0.000011, wchange 0.03638147, angledelta 124.2 deg +step 115 - lrate 0.000011, wchange 0.02770000, angledelta 135.1 deg +step 116 - lrate 0.000011, wchange 0.00699928, angledelta 115.5 deg +step 117 - lrate 0.000010, wchange 0.01924767, angledelta 113.7 deg +step 118 - lrate 0.000010, wchange 0.03042562, angledelta 148.9 deg +step 119 - lrate 0.000010, wchange 0.02049504, angledelta 142.9 deg +step 120 - lrate 0.000010, wchange 0.01205298, angledelta 125.3 deg +step 121 - lrate 0.000010, wchange 0.01133524, angledelta 124.1 deg +step 122 - lrate 0.000009, wchange 0.00617394, angledelta 112.8 deg +step 123 - lrate 0.000009, wchange 0.01102939, angledelta 119.4 deg +step 124 - lrate 0.000009, wchange 0.01887905, angledelta 111.7 deg +step 125 - lrate 0.000009, wchange 0.01890175, angledelta 113.2 deg +step 126 - lrate 0.000009, wchange 0.02876802, angledelta 131.9 deg +step 127 - lrate 0.000009, wchange 0.00672559, angledelta 127.9 deg +step 128 - lrate 0.000008, wchange 0.01028693, angledelta 85.2 deg +step 129 - lrate 0.000008, wchange 0.02201389, angledelta 117.8 deg +step 130 - lrate 0.000008, wchange 0.01475938, angledelta 137.6 deg +step 131 - lrate 0.000008, wchange 0.00824238, angledelta 128.7 deg +step 132 - lrate 0.000008, wchange 0.01280473, angledelta 104.8 deg +step 133 - lrate 0.000008, wchange 0.00586631, angledelta 108.5 deg +step 134 - lrate 0.000007, wchange 0.01596703, angledelta 108.4 deg +step 135 - lrate 0.000007, wchange 0.01173460, angledelta 119.6 deg +step 136 - lrate 0.000007, wchange 0.00863883, angledelta 137.5 deg +step 137 - lrate 0.000007, wchange 0.00458465, angledelta 120.0 deg +step 138 - lrate 0.000007, wchange 0.00607292, angledelta 108.7 deg +step 139 - lrate 0.000007, wchange 0.00357112, angledelta 106.6 deg +step 140 - lrate 0.000007, wchange 0.00637825, angledelta 118.5 deg +step 141 - lrate 0.000006, wchange 0.03317962, angledelta 122.1 deg +step 142 - lrate 0.000006, wchange 0.01231852, angledelta 141.7 deg +step 143 - lrate 0.000006, wchange 0.00920903, angledelta 81.2 deg +step 144 - lrate 0.000006, wchange 0.00549826, angledelta 111.4 deg +step 145 - lrate 0.000006, wchange 0.01412067, angledelta 119.8 deg +step 146 - lrate 0.000006, wchange 0.00855943, angledelta 113.1 deg +step 147 - lrate 0.000006, wchange 0.01124357, angledelta 118.6 deg +step 148 - lrate 0.000006, wchange 0.00782535, angledelta 73.6 deg +step 149 - lrate 0.000005, wchange 0.02793715, angledelta 133.0 deg +step 150 - lrate 0.000005, wchange 0.01149192, angledelta 152.5 deg +step 151 - lrate 0.000005, wchange 0.00679119, angledelta 119.9 deg +step 152 - lrate 0.000005, wchange 0.00959448, angledelta 134.1 deg +step 153 - lrate 0.000005, wchange 0.00638626, angledelta 137.6 deg +step 154 - lrate 0.000005, wchange 0.00528394, angledelta 110.0 deg +step 155 - lrate 0.000005, wchange 0.01308149, angledelta 111.8 deg +step 156 - lrate 0.000005, wchange 0.00934081, angledelta 145.7 deg +step 157 - lrate 0.000005, wchange 0.00717073, angledelta 108.6 deg +step 158 - lrate 0.000005, wchange 0.00909063, angledelta 127.6 deg +step 159 - lrate 0.000004, wchange 0.00429225, angledelta 125.1 deg +step 160 - lrate 0.000004, wchange 0.00635557, angledelta 69.7 deg +step 161 - lrate 0.000004, wchange 0.01053033, angledelta 144.9 deg +step 162 - lrate 0.000004, wchange 0.00249832, angledelta 116.2 deg +step 163 - lrate 0.000004, wchange 0.00258350, angledelta 116.7 deg +step 164 - lrate 0.000004, wchange 0.00314995, angledelta 127.0 deg +step 165 - lrate 0.000004, wchange 0.01268392, angledelta 97.9 deg +step 166 - lrate 0.000004, wchange 0.00397241, angledelta 124.0 deg +step 167 - lrate 0.000004, wchange 0.00358709, angledelta 101.7 deg +step 168 - lrate 0.000004, wchange 0.00634274, angledelta 110.5 deg +step 169 - lrate 0.000004, wchange 0.00524960, angledelta 118.3 deg +step 170 - lrate 0.000004, wchange 0.00513114, angledelta 104.4 deg +step 171 - lrate 0.000004, wchange 0.00536085, angledelta 125.8 deg +step 172 - lrate 0.000003, wchange 0.00233895, angledelta 105.1 deg +step 173 - lrate 0.000003, wchange 0.00341771, angledelta 135.0 deg +step 174 - lrate 0.000003, wchange 0.00202033, angledelta 128.2 deg +step 175 - lrate 0.000003, wchange 0.00262266, angledelta 113.7 deg +step 176 - lrate 0.000003, wchange 0.00334695, angledelta 114.6 deg +step 177 - lrate 0.000003, wchange 0.00335251, angledelta 134.1 deg +step 178 - lrate 0.000003, wchange 0.00258445, angledelta 108.3 deg +step 179 - lrate 0.000003, wchange 0.00343413, angledelta 116.1 deg +step 180 - lrate 0.000003, wchange 0.00415860, angledelta 106.5 deg +step 181 - lrate 0.000003, wchange 0.00244510, angledelta 136.9 deg +step 182 - lrate 0.000003, wchange 0.00210028, angledelta 112.5 deg +step 183 - lrate 0.000003, wchange 0.00260067, angledelta 115.7 deg +step 184 - lrate 0.000003, wchange 0.00229715, angledelta 100.9 deg +step 185 - lrate 0.000003, wchange 0.00315949, angledelta 108.2 deg +step 186 - lrate 0.000003, wchange 0.00427009, angledelta 120.2 deg +step 187 - lrate 0.000003, wchange 0.00263857, angledelta 104.4 deg +step 188 - lrate 0.000002, wchange 0.00396138, angledelta 115.0 deg +step 189 - lrate 0.000002, wchange 0.00597066, angledelta 140.2 deg +step 190 - lrate 0.000002, wchange 0.00310964, angledelta 120.9 deg +step 191 - lrate 0.000002, wchange 0.00364376, angledelta 136.8 deg +step 192 - lrate 0.000002, wchange 0.00478418, angledelta 130.4 deg +step 193 - lrate 0.000002, wchange 0.00161623, angledelta 123.5 deg +step 194 - lrate 0.000002, wchange 0.00320148, angledelta 89.5 deg +step 195 - lrate 0.000002, wchange 0.00342082, angledelta 139.1 deg +step 196 - lrate 0.000002, wchange 0.00295793, angledelta 137.3 deg +step 197 - lrate 0.000002, wchange 0.00192573, angledelta 107.4 deg +step 198 - lrate 0.000002, wchange 0.00338312, angledelta 112.5 deg +step 199 - lrate 0.000002, wchange 0.00185804, angledelta 89.6 deg +step 200 - lrate 0.000002, wchange 0.00420706, angledelta 138.1 deg +step 201 - lrate 0.000002, wchange 0.00214036, angledelta 127.1 deg +step 202 - lrate 0.000002, wchange 0.00161032, angledelta 111.3 deg +step 203 - lrate 0.000002, wchange 0.00171360, angledelta 112.1 deg +step 204 - lrate 0.000002, wchange 0.00132144, angledelta 119.4 deg +step 205 - lrate 0.000002, wchange 0.00242452, angledelta 87.3 deg +step 206 - lrate 0.000002, wchange 0.00522140, angledelta 120.0 deg +step 207 - lrate 0.000002, wchange 0.00165279, angledelta 111.2 deg +step 208 - lrate 0.000002, wchange 0.00116370, angledelta 105.4 deg +step 209 - lrate 0.000002, wchange 0.00210917, angledelta 106.4 deg +step 210 - lrate 0.000002, wchange 0.00130427, angledelta 120.5 deg +step 211 - lrate 0.000002, wchange 0.00113007, angledelta 105.8 deg +step 212 - lrate 0.000002, wchange 0.00090941, angledelta 122.4 deg +step 213 - lrate 0.000002, wchange 0.00169740, angledelta 99.6 deg +step 214 - lrate 0.000001, wchange 0.00279995, angledelta 125.6 deg +step 215 - lrate 0.000001, wchange 0.00268244, angledelta 141.3 deg +step 216 - lrate 0.000001, wchange 0.00124683, angledelta 121.0 deg +step 217 - lrate 0.000001, wchange 0.00288728, angledelta 118.6 deg +step 218 - lrate 0.000001, wchange 0.00244020, angledelta 142.4 deg +step 219 - lrate 0.000001, wchange 0.00116745, angledelta 94.3 deg +step 220 - lrate 0.000001, wchange 0.00104635, angledelta 131.1 deg +step 221 - lrate 0.000001, wchange 0.00119596, angledelta 121.9 deg +step 222 - lrate 0.000001, wchange 0.00153349, angledelta 129.2 deg +step 223 - lrate 0.000001, wchange 0.00137846, angledelta 113.1 deg +step 224 - lrate 0.000001, wchange 0.00182895, angledelta 135.6 deg +step 225 - lrate 0.000001, wchange 0.00132368, angledelta 142.0 deg +step 226 - lrate 0.000001, wchange 0.00152187, angledelta 128.1 deg +step 227 - lrate 0.000001, wchange 0.00213237, angledelta 138.5 deg +step 228 - lrate 0.000001, wchange 0.00403302, angledelta 139.8 deg +step 229 - lrate 0.000001, wchange 0.00122920, angledelta 146.2 deg +step 230 - lrate 0.000001, wchange 0.00059319, angledelta 118.9 deg +step 231 - lrate 0.000001, wchange 0.00088090, angledelta 120.3 deg +step 232 - lrate 0.000001, wchange 0.00173058, angledelta 123.9 deg +step 233 - lrate 0.000001, wchange 0.00206230, angledelta 150.6 deg +step 234 - lrate 0.000001, wchange 0.00098938, angledelta 119.8 deg +step 235 - lrate 0.000001, wchange 0.00197139, angledelta 85.5 deg +step 236 - lrate 0.000001, wchange 0.00220227, angledelta 139.1 deg +step 237 - lrate 0.000001, wchange 0.00076585, angledelta 110.6 deg +step 238 - lrate 0.000001, wchange 0.00058743, angledelta 109.5 deg +step 239 - lrate 0.000001, wchange 0.00110097, angledelta 89.3 deg +step 240 - lrate 0.000001, wchange 0.00242399, angledelta 145.3 deg +step 241 - lrate 0.000001, wchange 0.00076207, angledelta 113.3 deg +step 242 - lrate 0.000001, wchange 0.00136961, angledelta 120.9 deg +step 243 - lrate 0.000001, wchange 0.00134596, angledelta 143.1 deg +step 244 - lrate 0.000001, wchange 0.00122733, angledelta 140.5 deg +step 245 - lrate 0.000001, wchange 0.00106302, angledelta 117.2 deg +step 246 - lrate 0.000001, wchange 0.00141075, angledelta 143.5 deg +step 247 - lrate 0.000001, wchange 0.00103593, angledelta 116.0 deg +step 248 - lrate 0.000001, wchange 0.00023297, angledelta 110.3 deg +step 249 - lrate 0.000001, wchange 0.00078691, angledelta 112.8 deg +step 250 - lrate 0.000001, wchange 0.00053273, angledelta 115.0 deg +step 251 - lrate 0.000001, wchange 0.00072434, angledelta 127.0 deg +step 252 - lrate 0.000001, wchange 0.00037795, angledelta 98.0 deg +step 253 - lrate 0.000001, wchange 0.00081682, angledelta 120.4 deg +step 254 - lrate 0.000001, wchange 0.00063677, angledelta 134.8 deg +step 255 - lrate 0.000001, wchange 0.00039905, angledelta 110.9 deg +step 256 - lrate 0.000001, wchange 0.00075823, angledelta 102.5 deg +step 257 - lrate 0.000001, wchange 0.00077190, angledelta 141.7 deg +step 258 - lrate 0.000001, wchange 0.00032217, angledelta 111.9 deg +step 259 - lrate 0.000001, wchange 0.00077478, angledelta 105.5 deg +step 260 - lrate 0.000001, wchange 0.00089853, angledelta 138.4 deg +step 261 - lrate 0.000001, wchange 0.00076872, angledelta 137.9 deg +step 262 - lrate 0.000001, wchange 0.00101515, angledelta 148.1 deg +step 263 - lrate 0.000001, wchange 0.00065029, angledelta 140.6 deg +step 264 - lrate 0.000001, wchange 0.00034542, angledelta 97.6 deg +step 265 - lrate 0.000001, wchange 0.00093355, angledelta 123.4 deg +step 266 - lrate 0.000001, wchange 0.00064959, angledelta 135.3 deg +step 267 - lrate 0.000001, wchange 0.00058642, angledelta 92.7 deg +step 268 - lrate 0.000000, wchange 0.00098170, angledelta 138.0 deg +step 269 - lrate 0.000000, wchange 0.00043197, angledelta 120.8 deg +step 270 - lrate 0.000000, wchange 0.00032667, angledelta 122.9 deg +step 271 - lrate 0.000000, wchange 0.00023859, angledelta 92.3 deg +step 272 - lrate 0.000000, wchange 0.00026351, angledelta 125.6 deg +step 273 - lrate 0.000000, wchange 0.00041815, angledelta 122.7 deg +step 274 - lrate 0.000000, wchange 0.00032621, angledelta 133.8 deg +step 275 - lrate 0.000000, wchange 0.00036765, angledelta 101.9 deg +step 276 - lrate 0.000000, wchange 0.00025432, angledelta 110.8 deg +step 277 - lrate 0.000000, wchange 0.00020529, angledelta 126.3 deg +step 278 - lrate 0.000000, wchange 0.00031884, angledelta 123.3 deg +step 279 - lrate 0.000000, wchange 0.00017144, angledelta 123.6 deg +step 280 - lrate 0.000000, wchange 0.00036037, angledelta 106.5 deg +step 281 - lrate 0.000000, wchange 0.00058059, angledelta 121.4 deg +step 282 - lrate 0.000000, wchange 0.00031017, angledelta 142.7 deg +step 283 - lrate 0.000000, wchange 0.00021942, angledelta 101.1 deg +step 284 - lrate 0.000000, wchange 0.00016972, angledelta 110.4 deg +step 285 - lrate 0.000000, wchange 0.00021575, angledelta 126.2 deg +step 286 - lrate 0.000000, wchange 0.00013450, angledelta 111.4 deg +step 287 - lrate 0.000000, wchange 0.00020776, angledelta 117.5 deg +step 288 - lrate 0.000000, wchange 0.00024056, angledelta 132.1 deg +step 289 - lrate 0.000000, wchange 0.00016160, angledelta 125.7 deg +step 290 - lrate 0.000000, wchange 0.00019140, angledelta 111.4 deg +step 291 - lrate 0.000000, wchange 0.00014145, angledelta 120.4 deg +step 292 - lrate 0.000000, wchange 0.00011607, angledelta 122.0 deg +step 293 - lrate 0.000000, wchange 0.00024455, angledelta 124.0 deg +step 294 - lrate 0.000000, wchange 0.00040369, angledelta 149.3 deg +step 295 - lrate 0.000000, wchange 0.00032379, angledelta 150.0 deg +step 296 - lrate 0.000000, wchange 0.00005596, angledelta 109.6 deg +step 297 - lrate 0.000000, wchange 0.00013124, angledelta 95.8 deg +step 298 - lrate 0.000000, wchange 0.00023689, angledelta 83.8 deg +step 299 - lrate 0.000000, wchange 0.00024825, angledelta 147.8 deg +step 300 - lrate 0.000000, wchange 0.00013589, angledelta 131.0 deg +step 301 - lrate 0.000000, wchange 0.00010995, angledelta 104.1 deg +step 302 - lrate 0.000000, wchange 0.00008843, angledelta 115.3 deg +step 303 - lrate 0.000000, wchange 0.00013667, angledelta 110.7 deg +step 304 - lrate 0.000000, wchange 0.00006696, angledelta 129.3 deg +step 305 - lrate 0.000000, wchange 0.00005856, angledelta 119.4 deg +step 306 - lrate 0.000000, wchange 0.00012334, angledelta 130.2 deg +step 307 - lrate 0.000000, wchange 0.00009844, angledelta 130.3 deg +step 308 - lrate 0.000000, wchange 0.00006052, angledelta 111.9 deg +step 309 - lrate 0.000000, wchange 0.00013622, angledelta 111.5 deg +step 310 - lrate 0.000000, wchange 0.00006486, angledelta 123.0 deg +step 311 - lrate 0.000000, wchange 0.00003831, angledelta 109.9 deg +step 312 - lrate 0.000000, wchange 0.00006408, angledelta 111.0 deg +step 313 - lrate 0.000000, wchange 0.00006317, angledelta 126.9 deg +step 314 - lrate 0.000000, wchange 0.00010327, angledelta 107.1 deg +step 315 - lrate 0.000000, wchange 0.00005944, angledelta 115.7 deg +step 316 - lrate 0.000000, wchange 0.00004787, angledelta 110.6 deg +step 317 - lrate 0.000000, wchange 0.00003937, angledelta 106.8 deg +step 318 - lrate 0.000000, wchange 0.00005930, angledelta 117.4 deg +step 319 - lrate 0.000000, wchange 0.00005276, angledelta 131.3 deg +step 320 - lrate 0.000000, wchange 0.00004605, angledelta 90.9 deg +step 321 - lrate 0.000000, wchange 0.00003466, angledelta 134.7 deg +step 322 - lrate 0.000000, wchange 0.00003690, angledelta 126.5 deg +step 323 - lrate 0.000000, wchange 0.00003056, angledelta 118.7 deg +step 324 - lrate 0.000000, wchange 0.00003513, angledelta 101.8 deg +step 325 - lrate 0.000000, wchange 0.00002175, angledelta 96.3 deg +step 326 - lrate 0.000000, wchange 0.00010236, angledelta 128.0 deg +step 327 - lrate 0.000000, wchange 0.00003298, angledelta 114.4 deg +step 328 - lrate 0.000000, wchange 0.00004389, angledelta 74.1 deg +step 329 - lrate 0.000000, wchange 0.00004010, angledelta 123.1 deg +step 330 - lrate 0.000000, wchange 0.00002202, angledelta 125.7 deg +step 331 - lrate 0.000000, wchange 0.00001406, angledelta 105.8 deg +step 332 - lrate 0.000000, wchange 0.00001833, angledelta 105.0 deg +step 333 - lrate 0.000000, wchange 0.00005728, angledelta 131.1 deg +step 334 - lrate 0.000000, wchange 0.00001315, angledelta 100.9 deg +step 335 - lrate 0.000000, wchange 0.00002143, angledelta 110.9 deg +step 336 - lrate 0.000000, wchange 0.00001446, angledelta 116.3 deg +step 337 - lrate 0.000000, wchange 0.00001126, angledelta 118.1 deg +step 338 - lrate 0.000000, wchange 0.00000687, angledelta 116.6 deg +step 339 - lrate 0.000000, wchange 0.00001517, angledelta 108.8 deg +step 340 - lrate 0.000000, wchange 0.00000745, angledelta 110.7 deg +step 341 - lrate 0.000000, wchange 0.00001057, angledelta 106.3 deg +step 342 - lrate 0.000000, wchange 0.00000956, angledelta 120.3 deg +step 343 - lrate 0.000000, wchange 0.00001407, angledelta 118.2 deg +step 344 - lrate 0.000000, wchange 0.00002967, angledelta 133.1 deg +step 345 - lrate 0.000000, wchange 0.00002125, angledelta 56.2 deg +step 346 - lrate 0.000000, wchange 0.00002145, angledelta 143.4 deg +step 347 - lrate 0.000000, wchange 0.00001817, angledelta 137.2 deg +step 348 - lrate 0.000000, wchange 0.00001538, angledelta 121.6 deg +step 349 - lrate 0.000000, wchange 0.00000739, angledelta 103.5 deg +step 350 - lrate 0.000000, wchange 0.00000629, angledelta 91.3 deg +step 351 - lrate 0.000000, wchange 0.00001625, angledelta 114.8 deg +step 352 - lrate 0.000000, wchange 0.00000642, angledelta 132.7 deg +step 353 - lrate 0.000000, wchange 0.00000590, angledelta 76.4 deg +step 354 - lrate 0.000000, wchange 0.00000433, angledelta 107.2 deg +step 355 - lrate 0.000000, wchange 0.00000316, angledelta 105.7 deg +step 356 - lrate 0.000000, wchange 0.00000649, angledelta 114.9 deg +step 357 - lrate 0.000000, wchange 0.00000666, angledelta 122.9 deg +step 358 - lrate 0.000000, wchange 0.00000297, angledelta 119.3 deg +step 359 - lrate 0.000000, wchange 0.00000290, angledelta 111.3 deg +step 360 - lrate 0.000000, wchange 0.00000303, angledelta 102.1 deg +step 361 - lrate 0.000000, wchange 0.00000344, angledelta 118.7 deg +step 362 - lrate 0.000000, wchange 0.00000702, angledelta 104.8 deg +step 363 - lrate 0.000000, wchange 0.00000363, angledelta 139.0 deg +step 364 - lrate 0.000000, wchange 0.00000257, angledelta 111.7 deg +step 365 - lrate 0.000000, wchange 0.00000729, angledelta 129.7 deg +step 366 - lrate 0.000000, wchange 0.00000165, angledelta 92.7 deg +step 367 - lrate 0.000000, wchange 0.00000211, angledelta 121.4 deg +step 368 - lrate 0.000000, wchange 0.00000777, angledelta 112.0 deg +step 369 - lrate 0.000000, wchange 0.00000257, angledelta 112.8 deg +step 370 - lrate 0.000000, wchange 0.00000266, angledelta 110.5 deg +step 371 - lrate 0.000000, wchange 0.00000147, angledelta 83.6 deg +step 372 - lrate 0.000000, wchange 0.00000264, angledelta 121.4 deg +step 373 - lrate 0.000000, wchange 0.00000098, angledelta 89.6 deg +step 374 - lrate 0.000000, wchange 0.00000158, angledelta 109.3 deg +step 375 - lrate 0.000000, wchange 0.00000099, angledelta 80.5 deg +step 376 - lrate 0.000000, wchange 0.00000143, angledelta 110.0 deg +step 377 - lrate 0.000000, wchange 0.00000149, angledelta 92.8 deg +step 378 - lrate 0.000000, wchange 0.00000093, angledelta 117.6 deg +step 379 - lrate 0.000000, wchange 0.00000101, angledelta 127.6 deg +step 380 - lrate 0.000000, wchange 0.00000129, angledelta 119.6 deg +step 381 - lrate 0.000000, wchange 0.00000074, angledelta 123.3 deg +step 382 - lrate 0.000000, wchange 0.00000071, angledelta 121.6 deg +step 383 - lrate 0.000000, wchange 0.00000104, angledelta 128.2 deg +step 384 - lrate 0.000000, wchange 0.00000080, angledelta 124.1 deg +step 385 - lrate 0.000000, wchange 0.00000047, angledelta 78.3 deg +step 386 - lrate 0.000000, wchange 0.00000043, angledelta 80.7 deg +step 387 - lrate 0.000000, wchange 0.00000035, angledelta 92.7 deg +step 388 - lrate 0.000000, wchange 0.00000050, angledelta 97.8 deg +step 389 - lrate 0.000000, wchange 0.00000025, angledelta 101.1 deg +step 390 - lrate 0.000000, wchange 0.00000031, angledelta 104.3 deg +step 391 - lrate 0.000000, wchange 0.00000033, angledelta 95.8 deg +step 392 - lrate 0.000000, wchange 0.00000043, angledelta 123.4 deg +step 393 - lrate 0.000000, wchange 0.00000041, angledelta 114.7 deg +step 394 - lrate 0.000000, wchange 0.00000021, angledelta 96.8 deg +step 395 - lrate 0.000000, wchange 0.00000039, angledelta 103.2 deg +step 396 - lrate 0.000000, wchange 0.00000041, angledelta 122.4 deg +step 397 - lrate 0.000000, wchange 0.00000032, angledelta 117.6 deg +step 398 - lrate 0.000000, wchange 0.00000015, angledelta 103.5 deg +step 399 - lrate 0.000000, wchange 0.00000013, angledelta 103.3 deg +step 400 - lrate 0.000000, wchange 0.00000018, angledelta 81.6 deg +step 401 - lrate 0.000000, wchange 0.00000022, angledelta 108.6 deg +step 402 - lrate 0.000000, wchange 0.00000037, angledelta 55.7 deg +step 403 - lrate 0.000000, wchange 0.00000018, angledelta 121.3 deg +step 404 - lrate 0.000000, wchange 0.00000011, angledelta 99.4 deg +step 405 - lrate 0.000000, wchange 0.00000018, angledelta 100.2 deg +step 406 - lrate 0.000000, wchange 0.00000016, angledelta 114.8 deg +step 407 - lrate 0.000000, wchange 0.00000018, angledelta 114.5 deg +step 408 - lrate 0.000000, wchange 0.00000020, angledelta 134.8 deg +step 409 - lrate 0.000000, wchange 0.00000015, angledelta 103.7 deg +step 410 - lrate 0.000000, wchange 0.00000015, angledelta 94.1 deg +step 411 - lrate 0.000000, wchange 0.00000007, angledelta 108.6 deg +Sorting components in descending order of mean projected variance ... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Removing 23 channel(s)... +Event resorted by increasing latencies. +Scaling components to RMS microvolt +The input dataset will be split into 8110 epochs of 1 s +Epochs will overlap by 0%. +Inserting 8110 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560.......................................6600.................... +...................6640.......................................6680.......... +.............................6720.......................................6760 +.......................................6800.............................. +.........6840.......................................6880.................... +...................6920.......................................6960.......... +.............................7000.......................................7040 +.......................................7080.............................. +.........7120.......................................7160.................... +...................7200.......................................7240.......... +.............................7280.......................................7320 +.......................................7360.............................. +.........7400.......................................7440.................... +...................7480.......................................7520.......... +.............................7560.......................................7600 +.......................................7640.............................. +.........7680.......................................7720.................... +...................7760.......................................7800.......... +.............................7840.......................................7880 +.......................................7920.............................. +.........7960.......................................8000.................... +...................8040.......................................8080.......... +.................... +Sorting the event table. +Splitting the data into 8110 1.00-s epochs +pop_epoch():8110 epochs selected +Epoching... +pop_epoch():8110 epochs generated +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +Scaling components to RMS microvolt +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Scaling components to RMS microvolt +Scaling components to RMS microvolt +EEG.icaact not present. Recomputed from data. + +Features Extraction: +GDSF - General Discontinuity Spatial Feature... +SED - Spatial Eye Difference... +SAD - Spatial Average Difference... +Temporal Kurtosis... +Maximum epoch variance... +Computing EM thresholds... +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index + +par_id = + + 1x8 cell array + + Columns 1 through 6 + + {'sub-3000008'} {'all'} {'eeg'} {'s1'} {'r1'} {'e1'} + + Columns 7 through 8 + + {'filtered'} {'data - 1-s epochs'} + +. + +Artifact Identification: +Horizontal Eye Movements... +End Horizontal Eye Movement Detection +Vertical Eye Movements... +Eye Blinks... +End Blink Detection +Generic Discontinuities... + +Results in . +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Saving dataset... +Scaling components to RMS microvolt +Computing projection .... +pop_editeventfield(): creating new field 'observation' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'eventType' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'targetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'congruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'responded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'accuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'rt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'extraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidTrial' +pop-editeventfield(): updating urevent structure +Event resorted by increasing latencies. +pop_epoch():2087 epochs selected +Epoching... +pop_epoch():2087 epochs generated +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'observation' made uniform +eeg_checkset note: value format of event field 'eventType' made uniform +eeg_checkset note: value format of event field 'targetDir' made uniform +eeg_checkset note: value format of event field 'congruency' made uniform +eeg_checkset note: value format of event field 'prevTargetDir' made uniform +eeg_checkset note: value format of event field 'prevCongruency' made uniform +eeg_checkset note: value format of event field 'nextTargetDir' made uniform +eeg_checkset note: value format of event field 'nextCongruency' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +pop_rmbase(): Removing baseline... +1 channel selected +937/2087 trials marked for rejection +1 channel selected +1305/2087 trials marked for rejection +1 channel selected +1266/2087 trials marked for rejection +1 channel selected +1209/2087 trials marked for rejection +1 channel selected +1335/2087 trials marked for rejection +1 channel selected +817/2087 trials marked for rejection +1348/2087 trials rejected +Removing 1348 trial(s)... +Pop_select: removing 4817 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +9/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +19/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +152/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +5/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +471/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +38/739 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +739/739 trials marked for rejection +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2566 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2561 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2561 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2562 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2564 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2563 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 738 trial(s)... +Pop_select: removing 2565 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +3/739 trials rejected +Removing 3 trial(s)... +Pop_select: removing 9 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +0/736 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Interpolating 27 channels... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Re-referencing data +Scaling components to RMS microvolt +Error: some channels not used for ICA decomposition are used for rereferencing + the ICA decomposition has been removed +Saving dataset... + + + +*** Processing subject 1 (sub-3000011_all_eeg_s1_r1_e1.vhdr) *** + + +pop_loadbv(): reading header file +Done. +pop_loadbv(): reading EEG data +pop_loadbv(): scaling EEG data +pop_loadbv(): reading marker file +Done. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +eeg_checkset warning: number of columns in data (64) does not match the number of channels (63): corrected +eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed +[Warning: channel labels should not be empty, creating unique labels] +Warning: the size of the channel location structure does not match with + number of channels. Channel information have been removed. +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 50:28= - 10%, ETE 45:32= \ 15%, ETE 42:15= | 20%, ETE 39:23= / 25%, ETE 36:44= - 30%, ETE 34:09= \ 35%, ETE 31:39= | 40%, ETE 29:10= / 45%, ETE 26:42= - 50%, ETE 24:15= \ 55%, ETE 21:48= | 60%, ETE 19:22= / 65%, ETE 16:57= - 70%, ETE 14:32= \ 75%, ETE 12:07= | 80%, ETE 09:42= / 85%, ETE 07:17= - 90%, ETE 04:52= \ 95%, ETE 02:26=| 100%, ETE 00:00 +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 01:09= - 10%, ETE 00:43= \ 15%, ETE 00:34= | 20%, ETE 00:28= / 25%, ETE 00:25= - 30%, ETE 00:22= \ 35%, ETE 00:20= | 40%, ETE 00:18= / 45%, ETE 00:16= - 50%, ETE 00:14= \ 55%, ETE 00:13= | 60%, ETE 00:11= / 65%, ETE 00:10= - 70%, ETE 00:08= \ 75%, ETE 00:07= | 80%, ETE 00:06= / 85%, ETE 00:04= - 90%, ETE 00:03= \ 95%, ETE 00:02=| 100%, ETE 00:00 +Removing 2 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Saving dataset... +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 03:40= - 10%, ETE 03:12= \ 15%, ETE 02:56= | 20%, ETE 02:43= / 25%, ETE 02:32= - 30%, ETE 02:22= \ 35%, ETE 02:11= | 40%, ETE 02:01= / 45%, ETE 01:51= - 50%, ETE 01:40= \ 55%, ETE 01:30= | 60%, ETE 01:20= / 65%, ETE 01:10= - 70%, ETE 01:00= \ 75%, ETE 00:50= | 80%, ETE 00:40= / 85%, ETE 00:30= - 90%, ETE 00:20= \ 95%, ETE 00:10=| 100%, ETE 00:00 +The input dataset will be split into 6661 epochs of 1 s +Epochs will overlap by 0%. +Inserting 6661 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560.......................................6600.................... +...................6640..................... +Sorting the event table. +Splitting the data into 6661 1.00-s epochs +pop_epoch():6661 epochs selected +Epoching... +pop_epoch():6661 epochs generated +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +17/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +5/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +2/6660 trials marked for rejection + +1 channel selected +17/6660 trials marked for rejection +1 channel selected +52/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +2/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +211/6660 trials marked for rejection + +1 channel selected +190/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +3/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +18/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +22/6660 trials marked for rejection + +1 channel selected +27/6660 trials marked for rejection +1 channel selected +15/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +7/6660 trials marked for rejection + +1 channel selected +1/6660 trials marked for rejection +1 channel selected +51/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +0/6660 trials marked for rejection + +1 channel selected +0/6660 trials marked for rejection +1 channel selected +22/6660 trials marked for rejection + +1 channel selected +30/6660 trials marked for rejection +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +61 channel selected +311/6660 trials marked for rejection + +61 channel selected +268/6660 trials marked for rejection +363/6660 trials rejected +Removing 363 trial(s)... +Pop_select: removing 798 unreferenced events +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform + +Attempting to convert data matrix to double precision for more accurate ICA results. + +Input data size [61,6297000] = 61 channels, 6297000 frames/nFinding 61 ICA components using extended ICA. +Kurtosis will be calculated initially every 1 blocks using 6000 data points. +Decomposing 1692 frames per ICA weight ((3721)^2 = 6297000 weights, Initial learning rate will be 0.001, block size 79. +Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg. +Training will end when wchange < 1e-07 or after 512 steps. +Online bias adjustment will be used. +Removing mean of each channel ... +Final training data range: -992.352 to 995.408 +Computing the sphering matrix... +{Out of memory. + +Error in cov (line 154) +xc = x - sum(x,1)./m; % Remove mean + +Error in runica (line 732) + sphere = 2.0*inv(sqrtm(double(cov(data')))); % find the "sphering" matrix = spher() + +Error in pop_runica (line 379) + [EEG.icaweights,EEG.icasphere] = runica( tmpdata, 'lrate', 0.001, g.options{:} ); +} +>> \ No newline at end of file diff --git a/code/thrive_eeg/slurm-10424248.out b/code/thrive_eeg/slurm-10424248.out new file mode 100644 index 0000000..767f2ec --- /dev/null +++ b/code/thrive_eeg/slurm-10424248.out @@ -0,0 +1,557 @@ +/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg +n051.panther.net +Wed Jun 21 10:55:17 EDT 2023 + + < M A T L A B (R) > + Copyright 1984-2021 The MathWorks, Inc. + R2021b (9.11.0.1769968) 64-bit (glnxa64) + September 17, 2021 + + +To get started, type doc. +For product information, visit www.mathworks.com. + +>> >> >> >> >> >> Starting parallel pool (parpool) using the 'local' profile ... +Connected to the parallel pool (number of workers: 4). + +ans = + + ProcessPool with properties: + + Connected: true + NumWorkers: 4 + Cluster: local + AttachedFiles: {} + AutoAddClientPath: true + IdleTimeout: 30 minutes (30 minutes remaining) + SpmdEnabled: true + +>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> + + +*** Processing subject 1 (sub-3000003_all_eeg_s1_r1_e1.vhdr) *** + + +pop_loadbv(): reading header file +Done. +pop_loadbv(): reading EEG data +pop_loadbv(): scaling EEG data +pop_loadbv(): reading marker file +Done. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +eeg_checkset warning: number of columns in data (64) does not match the number of channels (63): corrected +eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed +[Warning: channel labels should not be empty, creating unique labels] +Warning: the size of the channel location structure does not match with + number of channels. Channel information have been removed. +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 50:49= - 10%, ETE 45:39= \ 15%, ETE 42:09= | 20%, ETE 39:15= / 25%, ETE 36:40= - 30%, ETE 34:01= \ 35%, ETE 31:32= | 40%, ETE 29:02= / 45%, ETE 26:35= - 50%, ETE 24:08= \ 55%, ETE 21:40= | 60%, ETE 19:15= / 65%, ETE 16:51= - 70%, ETE 14:26= \ 75%, ETE 12:01= | 80%, ETE 09:36= / 85%, ETE 07:12= - 90%, ETE 04:48= \ 95%, ETE 02:24=| 100%, ETE 00:00 +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 00:56= - 10%, ETE 00:37= \ 15%, ETE 00:29= | 20%, ETE 00:25= / 25%, ETE 00:22= - 30%, ETE 00:20= \ 35%, ETE 00:18= | 40%, ETE 00:16= / 45%, ETE 00:15= - 50%, ETE 00:13= \ 55%, ETE 00:12= | 60%, ETE 00:10= / 65%, ETE 00:09= - 70%, ETE 00:08= \ 75%, ETE 00:06= | 80%, ETE 00:05= / 85%, ETE 00:04= - 90%, ETE 00:03= \ 95%, ETE 00:02=| 100%, ETE 00:00 +Removing 4 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Saving dataset... +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 03:21= - 10%, ETE 02:56= \ 15%, ETE 02:42= | 20%, ETE 02:31= / 25%, ETE 02:20= - 30%, ETE 02:10= \ 35%, ETE 02:00= | 40%, ETE 01:51= / 45%, ETE 01:41= - 50%, ETE 01:32= \ 55%, ETE 01:23= | 60%, ETE 01:14= / 65%, ETE 01:04= - 70%, ETE 00:55= \ 75%, ETE 00:46= | 80%, ETE 00:37= / 85%, ETE 00:28= - 90%, ETE 00:19= \ 95%, ETE 00:10=| 100%, ETE 00:00 +The input dataset will be split into 6568 epochs of 1 s +Epochs will overlap by 0%. +Inserting 6568 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560........ +Sorting the event table. +Splitting the data into 6568 1.00-s epochs +pop_epoch():6568 epochs selected +Epoching... +pop_epoch():6568 epochs generated +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +7/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +15/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +2/6567 trials marked for rejection + +1 channel selected +1/6567 trials marked for rejection +1 channel selected +2/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +6/6567 trials marked for rejection +1 channel selected +855/6567 trials marked for rejection + +1 channel selected +280/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +3/6567 trials marked for rejection + +1 channel selected +12/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +3/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +1/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +729/6567 trials marked for rejection + +1 channel selected +343/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +7/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +13/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +6/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +3/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +5/6567 trials marked for rejection + +1 channel selected +4/6567 trials marked for rejection +1 channel selected +3212/6567 trials marked for rejection + +1 channel selected +5/6567 trials marked for rejection +Removing 1 channel(s)... +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +58 channel selected +1080/6567 trials marked for rejection + +58 channel selected +547/6567 trials marked for rejection +1103/6567 trials rejected +Removing 1103 trial(s)... +Pop_select: removing 2496 unreferenced events +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform + +Attempting to convert data matrix to double precision for more accurate ICA results. + +Input data size [58,5464000] = 58 channels, 5464000 frames/nFinding 58 ICA components using extended ICA. +Kurtosis will be calculated initially every 1 blocks using 6000 data points. +Decomposing 1624 frames per ICA weight ((3364)^2 = 5464000 weights, Initial learning rate will be 0.001, block size 78. +Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg. +Training will end when wchange < 1e-07 or after 512 steps. +Online bias adjustment will be used. +Removing mean of each channel ... +Final training data range: -998.312 to 998.465 +Computing the sphering matrix... +Starting weights are the identity matrix ... +Sphering the data ... +Beginning ICA training ... first training step may be slow ... +IdleTimeout has been reached. +Parallel pool using the 'local' profile is shutting down. +Lowering learning rate to 0.0009 and starting again. +Lowering learning rate to 0.00081 and starting again. +Lowering learning rate to 0.000729 and starting again. +Lowering learning rate to 0.0006561 and starting again. +Lowering learning rate to 0.00059049 and starting again. +Lowering learning rate to 0.000531441 and starting again. +Lowering learning rate to 0.000478297 and starting again. +Lowering learning rate to 0.000430467 and starting again. +Lowering learning rate to 0.00038742 and starting again. +Lowering learning rate to 0.000348678 and starting again. +Lowering learning rate to 0.000313811 and starting again. +step 1 - lrate 0.000314, wchange 44.27265881, angledelta 0.0 deg +Lowering learning rate to 0.00028243 and starting again. +Lowering learning rate to 0.000254187 and starting again. +Lowering learning rate to 0.000228768 and starting again. +step 1 - lrate 0.000229, wchange 37.58996724, angledelta 0.0 deg +step 2 - lrate 0.000229, wchange 4.17113026, angledelta 0.0 deg +step 3 - lrate 0.000229, wchange 4.71968440, angledelta 96.1 deg +Lowering learning rate to 0.000201773 and starting again. +step 1 - lrate 0.000202, wchange 35.13214573, angledelta 0.0 deg +step 2 - lrate 0.000202, wchange 2.53835087, angledelta 0.0 deg +step 3 - lrate 0.000202, wchange 2.65254081, angledelta 94.4 deg +/tmp/slurmd/job10424248/slurm_script: line 17: 21760 Killed matlab -nodisplay < MADE_pipeline_v1_0_thrive_02.m diff --git a/code/thrive_eeg/slurm-10424249.out b/code/thrive_eeg/slurm-10424249.out new file mode 100644 index 0000000..1a1e8a1 --- /dev/null +++ b/code/thrive_eeg/slurm-10424249.out @@ -0,0 +1,40331 @@ +/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg +n051.panther.net +Wed Jun 21 10:55:20 EDT 2023 + + < M A T L A B (R) > + Copyright 1984-2021 The MathWorks, Inc. + R2021b (9.11.0.1769968) 64-bit (glnxa64) + September 17, 2021 + + +To get started, type doc. +For product information, visit www.mathworks.com. + +>> >> >> >> >> >> Starting parallel pool (parpool) using the 'local' profile ... +Connected to the parallel pool (number of workers: 4). + +ans = + + ProcessPool with properties: + + Connected: true + NumWorkers: 4 + Cluster: local + AttachedFiles: {} + AutoAddClientPath: true + IdleTimeout: 30 minutes (30 minutes remaining) + SpmdEnabled: true + +>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> + + +*** Processing subject 1 (sub-3000001_all_eeg_s1_r1_e1.vhdr) *** + + +pop_loadbv(): reading header file +Done. +pop_loadbv(): reading EEG data +pop_loadbv(): scaling EEG data +pop_loadbv(): reading marker file +Done. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +eeg_checkset warning: number of columns in data (64) does not match the number of channels (63): corrected +eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed +[Warning: channel labels should not be empty, creating unique labels] +Warning: the size of the channel location structure does not match with + number of channels. Channel information have been removed. +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 60:02= - 10%, ETE 54:48= \ 15%, ETE 50:49= | 20%, ETE 47:45= / 25%, ETE 44:23= - 30%, ETE 41:24= \ 35%, ETE 38:18= | 40%, ETE 35:18= / 45%, ETE 32:17= - 50%, ETE 29:19= \ 55%, ETE 26:23= | 60%, ETE 23:26= / 65%, ETE 20:29= - 70%, ETE 17:32= \ 75%, ETE 14:35= | 80%, ETE 11:40= / 85%, ETE 08:44= - 90%, ETE 05:49= \ 95%, ETE 02:55=| 100%, ETE 00:00 +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 01:11= - 10%, ETE 00:46= \ 15%, ETE 00:38= | 20%, ETE 00:33= / 25%, ETE 00:29= - 30%, ETE 00:26= \ 35%, ETE 00:24= | 40%, ETE 00:22= / 45%, ETE 00:19= - 50%, ETE 00:17= \ 55%, ETE 00:15= | 60%, ETE 00:14= / 65%, ETE 00:12= - 70%, ETE 00:10= \ 75%, ETE 00:09= | 80%, ETE 00:07= / 85%, ETE 00:05= - 90%, ETE 00:04= \ 95%, ETE 00:02=| 100%, ETE 00:00 +Removing 2 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Saving dataset... +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 04:13= - 10%, ETE 03:44= \ 15%, ETE 03:29= | 20%, ETE 03:14= / 25%, ETE 03:00= - 30%, ETE 02:47= \ 35%, ETE 02:34= | 40%, ETE 02:23= / 45%, ETE 02:12= - 50%, ETE 02:00= \ 55%, ETE 01:48= | 60%, ETE 01:36= / 65%, ETE 01:24= - 70%, ETE 01:12= \ 75%, ETE 01:00= | 80%, ETE 00:48= / 85%, ETE 00:36= - 90%, ETE 00:24= \ 95%, ETE 00:12=| 100%, ETE 00:00 +The input dataset will be split into 7638 epochs of 1 s +Epochs will overlap by 0%. +Inserting 7638 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560.......................................6600.................... +...................6640.......................................6680.......... +.............................6720.......................................6760 +.......................................6800.............................. +.........6840.......................................6880.................... +...................6920.......................................6960.......... +.............................7000.......................................7040 +.......................................7080.............................. +.........7120.......................................7160.................... +...................7200.......................................7240.......... +.............................7280.......................................7320 +.......................................7360.............................. +.........7400.......................................7440.................... +...................7480.......................................7520.......... +.............................7560.......................................7600 +...................................... +Sorting the event table. +Splitting the data into 7638 1.00-s epochs +pop_epoch():7638 epochs selected +Epoching... +pop_epoch():7638 epochs generated +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +19/7637 trials marked for rejection +1 channel selected +21/7637 trials marked for rejection + +1 channel selected +20/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +21/7637 trials marked for rejection +1 channel selected +20/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +19/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +1 channel selected +56/7637 trials marked for rejection + +1 channel selected +18/7637 trials marked for rejection +1 channel selected +23/7637 trials marked for rejection + +1 channel selected +14/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +14/7637 trials marked for rejection +1 channel selected +18/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +20/7637 trials marked for rejection + +1 channel selected +19/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +19/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +18/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +18/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +28/7637 trials marked for rejection + +1 channel selected +20/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +19/7637 trials marked for rejection +1 channel selected +18/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +18/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +17/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +21/7637 trials marked for rejection +1 channel selected +18/7637 trials marked for rejection + +1 channel selected +23/7637 trials marked for rejection +1 channel selected +25/7637 trials marked for rejection + +1 channel selected +20/7637 trials marked for rejection +1 channel selected +18/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +1 channel selected +22/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +18/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +18/7637 trials marked for rejection + +1 channel selected +21/7637 trials marked for rejection +1 channel selected +27/7637 trials marked for rejection + +1 channel selected +14/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +15/7637 trials marked for rejection +1 channel selected +20/7637 trials marked for rejection + +1 channel selected +14/7637 trials marked for rejection +1 channel selected +18/7637 trials marked for rejection + +1 channel selected +20/7637 trials marked for rejection +1 channel selected +21/7637 trials marked for rejection + +1 channel selected +17/7637 trials marked for rejection +1 channel selected +16/7637 trials marked for rejection + +1 channel selected +16/7637 trials marked for rejection +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +61 channel selected +111/7637 trials marked for rejection + +61 channel selected +66/7637 trials marked for rejection +135/7637 trials rejected +Removing 135 trial(s)... +Pop_select: removing 284 unreferenced events +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform + +Attempting to convert data matrix to double precision for more accurate ICA results. + +Input data size [61,7502000] = 61 channels, 7502000 frames/nFinding 61 ICA components using extended ICA. +Kurtosis will be calculated initially every 1 blocks using 6000 data points. +Decomposing 2016 frames per ICA weight ((3721)^2 = 7502000 weights, Initial learning rate will be 0.001, block size 80. +Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg. +Training will end when wchange < 1e-07 or after 512 steps. +Online bias adjustment will be used. +Removing mean of each channel ... +Final training data range: -987.941 to 996.378 +Computing the sphering matrix... +Starting weights are the identity matrix ... +Sphering the data ... +Beginning ICA training ... first training step may be slow ... +IdleTimeout has been reached. +Parallel pool using the 'local' profile is shutting down. +Lowering learning rate to 0.0009 and starting again. +Lowering learning rate to 0.00081 and starting again. +Lowering learning rate to 0.000729 and starting again. +Lowering learning rate to 0.0006561 and starting again. +Lowering learning rate to 0.00059049 and starting again. +Lowering learning rate to 0.000531441 and starting again. +Lowering learning rate to 0.000478297 and starting again. +Lowering learning rate to 0.000430467 and starting again. +Lowering learning rate to 0.00038742 and starting again. +Lowering learning rate to 0.000348678 and starting again. +Lowering learning rate to 0.000313811 and starting again. +Lowering learning rate to 0.00028243 and starting again. +Lowering learning rate to 0.000254187 and starting again. +Lowering learning rate to 0.000228768 and starting again. +Lowering learning rate to 0.000205891 and starting again. +Lowering learning rate to 0.000185302 and starting again. +Lowering learning rate to 0.000166772 and starting again. +Lowering learning rate to 0.000150095 and starting again. +Lowering learning rate to 0.000135085 and starting again. +Lowering learning rate to 0.000121577 and starting again. +Lowering learning rate to 0.000109419 and starting again. +Lowering learning rate to 9.84771e-05 and starting again. +Lowering learning rate to 8.86294e-05 and starting again. +Lowering learning rate to 7.97664e-05 and starting again. +Lowering learning rate to 7.17898e-05 and starting again. +Lowering learning rate to 6.46108e-05 and starting again. +step 1 - lrate 0.000065, wchange 39.64960677, angledelta 0.0 deg +step 2 - lrate 0.000065, wchange 1.91202404, angledelta 0.0 deg +step 3 - lrate 0.000065, wchange 1.09658632, angledelta 81.7 deg +step 4 - lrate 0.000063, wchange 0.83504986, angledelta 118.1 deg +step 5 - lrate 0.000062, wchange 0.84431928, angledelta 117.5 deg +step 6 - lrate 0.000061, wchange 0.75025008, angledelta 129.4 deg +step 7 - lrate 0.000060, wchange 2.00345119, angledelta 125.8 deg +step 8 - lrate 0.000058, wchange 0.73133082, angledelta 121.5 deg +Lowering learning rate to 5.15115e-05 and starting again. +step 1 - lrate 0.000052, wchange 33.18861988, angledelta 0.0 deg +step 2 - lrate 0.000052, wchange 2.72689274, angledelta 0.0 deg +step 3 - lrate 0.000052, wchange 2.18312718, angledelta 87.1 deg +step 4 - lrate 0.000050, wchange 1.90489216, angledelta 144.4 deg +step 5 - lrate 0.000049, wchange 0.91288876, angledelta 107.9 deg +step 6 - lrate 0.000048, wchange 1.43286252, angledelta 97.6 deg +step 7 - lrate 0.000048, wchange 1.26822950, angledelta 132.3 deg +step 8 - lrate 0.000047, wchange 1.45628931, angledelta 89.0 deg +step 9 - lrate 0.000046, wchange 1.31269571, angledelta 124.8 deg +step 10 - lrate 0.000045, wchange 0.97563698, angledelta 110.3 deg +step 11 - lrate 0.000044, wchange 1.10057777, angledelta 117.7 deg +step 12 - lrate 0.000043, wchange 1.56079221, angledelta 114.1 deg +step 13 - lrate 0.000042, wchange 0.47206721, angledelta 105.3 deg +step 14 - lrate 0.000041, wchange 0.68657900, angledelta 139.4 deg +step 15 - lrate 0.000040, wchange 1.15294013, angledelta 120.8 deg +step 16 - lrate 0.000040, wchange 1.11474809, angledelta 122.2 deg +step 17 - lrate 0.000039, wchange 0.99282390, angledelta 106.5 deg +step 18 - lrate 0.000038, wchange 0.66906710, angledelta 116.4 deg +step 19 - lrate 0.000037, wchange 1.12032705, angledelta 119.9 deg +step 20 - lrate 0.000037, wchange 0.66263750, angledelta 130.3 deg +step 21 - lrate 0.000036, wchange 0.49260921, angledelta 109.6 deg +step 22 - lrate 0.000035, wchange 1.30424377, angledelta 105.0 deg +step 23 - lrate 0.000034, wchange 0.69779592, angledelta 145.4 deg +step 24 - lrate 0.000034, wchange 0.73734205, angledelta 113.4 deg +step 25 - lrate 0.000033, wchange 0.18516934, angledelta 102.5 deg +step 26 - lrate 0.000032, wchange 0.28518580, angledelta 127.8 deg +step 27 - lrate 0.000032, wchange 0.61612879, angledelta 73.5 deg +step 28 - lrate 0.000031, wchange 0.24803278, angledelta 102.5 deg +step 29 - lrate 0.000030, wchange 1.25342548, angledelta 112.2 deg +step 30 - lrate 0.000030, wchange 0.20147755, angledelta 118.1 deg +step 31 - lrate 0.000029, wchange 0.51886652, angledelta 111.9 deg +step 32 - lrate 0.000029, wchange 0.68955264, angledelta 138.2 deg +step 33 - lrate 0.000028, wchange 0.92594795, angledelta 146.4 deg +step 34 - lrate 0.000028, wchange 0.83250827, angledelta 147.6 deg +step 35 - lrate 0.000027, wchange 1.01403936, angledelta 145.9 deg +step 36 - lrate 0.000026, wchange 0.12221335, angledelta 126.7 deg +step 37 - lrate 0.000026, wchange 0.89227718, angledelta 82.6 deg +step 38 - lrate 0.000025, wchange 0.78557903, angledelta 130.1 deg +step 39 - lrate 0.000025, wchange 0.18036436, angledelta 92.8 deg +step 40 - lrate 0.000024, wchange 0.08216211, angledelta 102.9 deg +step 41 - lrate 0.000024, wchange 0.32162714, angledelta 115.8 deg +step 42 - lrate 0.000023, wchange 0.30989445, angledelta 151.0 deg +step 43 - lrate 0.000023, wchange 0.10641576, angledelta 102.3 deg +step 44 - lrate 0.000022, wchange 0.14401894, angledelta 129.2 deg +step 45 - lrate 0.000022, wchange 0.12213134, angledelta 110.9 deg +step 46 - lrate 0.000022, wchange 0.48015045, angledelta 79.8 deg +step 47 - lrate 0.000021, wchange 0.21039047, angledelta 136.7 deg +step 48 - lrate 0.000021, wchange 0.47749288, angledelta 75.9 deg +step 49 - lrate 0.000020, wchange 0.08588258, angledelta 102.2 deg +step 50 - lrate 0.000020, wchange 0.10849537, angledelta 117.1 deg +step 51 - lrate 0.000020, wchange 0.07699739, angledelta 117.4 deg +step 52 - lrate 0.000019, wchange 0.09582622, angledelta 113.2 deg +step 53 - lrate 0.000019, wchange 0.11251877, angledelta 132.4 deg +step 54 - lrate 0.000018, wchange 0.09931836, angledelta 116.7 deg +step 55 - lrate 0.000018, wchange 0.07589650, angledelta 115.3 deg +step 56 - lrate 0.000018, wchange 0.07404705, angledelta 116.3 deg +step 57 - lrate 0.000017, wchange 0.06378191, angledelta 117.9 deg +step 58 - lrate 0.000017, wchange 0.09160309, angledelta 113.0 deg +step 59 - lrate 0.000017, wchange 0.11760391, angledelta 130.0 deg +step 60 - lrate 0.000016, wchange 0.06393946, angledelta 100.5 deg +step 61 - lrate 0.000016, wchange 0.09378029, angledelta 117.8 deg +step 62 - lrate 0.000016, wchange 0.11150136, angledelta 119.8 deg +step 63 - lrate 0.000015, wchange 0.07354177, angledelta 124.2 deg +step 64 - lrate 0.000015, wchange 0.06913136, angledelta 125.6 deg +step 65 - lrate 0.000015, wchange 0.07697116, angledelta 118.2 deg +step 66 - lrate 0.000014, wchange 0.07709015, angledelta 125.7 deg +step 67 - lrate 0.000014, wchange 0.07372523, angledelta 125.5 deg +step 68 - lrate 0.000014, wchange 0.07944269, angledelta 116.5 deg +step 69 - lrate 0.000014, wchange 0.04465926, angledelta 117.3 deg +step 70 - lrate 0.000013, wchange 0.06793066, angledelta 106.6 deg +step 71 - lrate 0.000013, wchange 0.06919127, angledelta 118.9 deg +step 72 - lrate 0.000013, wchange 0.04616300, angledelta 109.2 deg +step 73 - lrate 0.000013, wchange 0.05813862, angledelta 104.1 deg +step 74 - lrate 0.000012, wchange 0.06130078, angledelta 123.5 deg +step 75 - lrate 0.000012, wchange 0.05711492, angledelta 108.2 deg +step 76 - lrate 0.000012, wchange 0.05205842, angledelta 123.4 deg +step 77 - lrate 0.000012, wchange 0.04803822, angledelta 125.0 deg +step 78 - lrate 0.000011, wchange 0.06135957, angledelta 118.7 deg +step 79 - lrate 0.000011, wchange 0.04771704, angledelta 128.4 deg +step 80 - lrate 0.000011, wchange 0.03455885, angledelta 110.4 deg +step 81 - lrate 0.000011, wchange 0.06406770, angledelta 114.8 deg +step 82 - lrate 0.000010, wchange 0.05721260, angledelta 127.5 deg +step 83 - lrate 0.000010, wchange 0.04181523, angledelta 124.6 deg +step 84 - lrate 0.000010, wchange 0.04214665, angledelta 124.4 deg +step 85 - lrate 0.000010, wchange 0.04144315, angledelta 127.7 deg +step 86 - lrate 0.000010, wchange 0.05743399, angledelta 126.9 deg +step 87 - lrate 0.000009, wchange 0.05018922, angledelta 131.5 deg +step 88 - lrate 0.000009, wchange 0.03459144, angledelta 116.1 deg +step 89 - lrate 0.000009, wchange 0.02812406, angledelta 121.9 deg +step 90 - lrate 0.000009, wchange 0.02635916, angledelta 108.2 deg +step 91 - lrate 0.000009, wchange 0.05088978, angledelta 124.3 deg +step 92 - lrate 0.000009, wchange 0.02528126, angledelta 106.2 deg +step 93 - lrate 0.000008, wchange 0.07115514, angledelta 116.0 deg +step 94 - lrate 0.000008, wchange 0.03824375, angledelta 127.9 deg +step 95 - lrate 0.000008, wchange 0.05480006, angledelta 100.2 deg +step 96 - lrate 0.000008, wchange 0.03477938, angledelta 115.0 deg +step 97 - lrate 0.000008, wchange 0.05668814, angledelta 119.4 deg +step 98 - lrate 0.000008, wchange 0.02809686, angledelta 118.9 deg +step 99 - lrate 0.000007, wchange 0.02528276, angledelta 114.3 deg +step 100 - lrate 0.000007, wchange 0.02573547, angledelta 123.2 deg +step 101 - lrate 0.000007, wchange 0.02854221, angledelta 123.1 deg +step 102 - lrate 0.000007, wchange 0.02506985, angledelta 122.0 deg +step 103 - lrate 0.000007, wchange 0.02526215, angledelta 114.7 deg +step 104 - lrate 0.000007, wchange 0.03681671, angledelta 118.9 deg +step 105 - lrate 0.000007, wchange 0.03333468, angledelta 127.4 deg +step 106 - lrate 0.000006, wchange 0.02259915, angledelta 102.4 deg +step 107 - lrate 0.000006, wchange 0.03204233, angledelta 108.7 deg +step 108 - lrate 0.000006, wchange 0.03295923, angledelta 125.9 deg +step 109 - lrate 0.000006, wchange 0.02163129, angledelta 114.7 deg +step 110 - lrate 0.000006, wchange 0.04097813, angledelta 116.2 deg +step 111 - lrate 0.000006, wchange 0.03333298, angledelta 135.3 deg +step 112 - lrate 0.000006, wchange 0.03698727, angledelta 95.7 deg +step 113 - lrate 0.000006, wchange 0.03410947, angledelta 126.0 deg +step 114 - lrate 0.000005, wchange 0.02597257, angledelta 123.7 deg +step 115 - lrate 0.000005, wchange 0.03345093, angledelta 132.7 deg +step 116 - lrate 0.000005, wchange 0.02494497, angledelta 123.5 deg +step 117 - lrate 0.000005, wchange 0.01505508, angledelta 116.6 deg +step 118 - lrate 0.000005, wchange 0.02174918, angledelta 107.8 deg +step 119 - lrate 0.000005, wchange 0.02076993, angledelta 129.2 deg +step 120 - lrate 0.000005, wchange 0.01398235, angledelta 118.8 deg +step 121 - lrate 0.000005, wchange 0.01931563, angledelta 114.8 deg +step 122 - lrate 0.000005, wchange 0.01883976, angledelta 126.2 deg +step 123 - lrate 0.000005, wchange 0.01321315, angledelta 108.4 deg +step 124 - lrate 0.000004, wchange 0.01871149, angledelta 111.7 deg +step 125 - lrate 0.000004, wchange 0.02098797, angledelta 131.7 deg +step 126 - lrate 0.000004, wchange 0.03294718, angledelta 87.5 deg +step 127 - lrate 0.000004, wchange 0.04269780, angledelta 135.9 deg +step 128 - lrate 0.000004, wchange 0.01502249, angledelta 124.1 deg +step 129 - lrate 0.000004, wchange 0.01407821, angledelta 110.9 deg +step 130 - lrate 0.000004, wchange 0.01481135, angledelta 110.2 deg +step 131 - lrate 0.000004, wchange 0.01704665, angledelta 120.6 deg +step 132 - lrate 0.000004, wchange 0.01251122, angledelta 124.3 deg +step 133 - lrate 0.000004, wchange 0.01262748, angledelta 113.2 deg +step 134 - lrate 0.000004, wchange 0.01105510, angledelta 115.9 deg +step 135 - lrate 0.000004, wchange 0.01151220, angledelta 118.4 deg +step 136 - lrate 0.000004, wchange 0.01117291, angledelta 122.2 deg +step 137 - lrate 0.000003, wchange 0.01436322, angledelta 101.3 deg +step 138 - lrate 0.000003, wchange 0.01800953, angledelta 128.6 deg +step 139 - lrate 0.000003, wchange 0.01213446, angledelta 110.6 deg +step 140 - lrate 0.000003, wchange 0.01433338, angledelta 121.6 deg +step 141 - lrate 0.000003, wchange 0.01080916, angledelta 117.0 deg +step 142 - lrate 0.000003, wchange 0.01080566, angledelta 119.0 deg +step 143 - lrate 0.000003, wchange 0.00960873, angledelta 121.6 deg +step 144 - lrate 0.000003, wchange 0.01239928, angledelta 116.1 deg +step 145 - lrate 0.000003, wchange 0.02495997, angledelta 133.1 deg +step 146 - lrate 0.000003, wchange 0.01762509, angledelta 137.6 deg +step 147 - lrate 0.000003, wchange 0.00920246, angledelta 132.1 deg +step 148 - lrate 0.000003, wchange 0.00992625, angledelta 96.4 deg +step 149 - lrate 0.000003, wchange 0.01489051, angledelta 126.1 deg +step 150 - lrate 0.000003, wchange 0.01244018, angledelta 135.8 deg +step 151 - lrate 0.000003, wchange 0.01062741, angledelta 118.6 deg +step 152 - lrate 0.000003, wchange 0.01505875, angledelta 107.8 deg +step 153 - lrate 0.000002, wchange 0.01200852, angledelta 134.0 deg +step 154 - lrate 0.000002, wchange 0.00917699, angledelta 118.7 deg +step 155 - lrate 0.000002, wchange 0.01190385, angledelta 120.7 deg +step 156 - lrate 0.000002, wchange 0.01379695, angledelta 123.3 deg +step 157 - lrate 0.000002, wchange 0.00933955, angledelta 127.6 deg +step 158 - lrate 0.000002, wchange 0.01310370, angledelta 123.6 deg +step 159 - lrate 0.000002, wchange 0.00771774, angledelta 128.7 deg +step 160 - lrate 0.000002, wchange 0.01029390, angledelta 99.8 deg +step 161 - lrate 0.000002, wchange 0.00977708, angledelta 120.4 deg +step 162 - lrate 0.000002, wchange 0.00887037, angledelta 103.5 deg +step 163 - lrate 0.000002, wchange 0.01100414, angledelta 124.0 deg +step 164 - lrate 0.000002, wchange 0.00594290, angledelta 115.3 deg +step 165 - lrate 0.000002, wchange 0.00838664, angledelta 109.1 deg +step 166 - lrate 0.000002, wchange 0.00601038, angledelta 115.1 deg +step 167 - lrate 0.000002, wchange 0.01182960, angledelta 117.7 deg +step 168 - lrate 0.000002, wchange 0.00613542, angledelta 131.4 deg +step 169 - lrate 0.000002, wchange 0.00621397, angledelta 120.3 deg +step 170 - lrate 0.000002, wchange 0.00747786, angledelta 128.1 deg +step 171 - lrate 0.000002, wchange 0.00519866, angledelta 116.7 deg +step 172 - lrate 0.000002, wchange 0.00505064, angledelta 111.5 deg +step 173 - lrate 0.000002, wchange 0.00458004, angledelta 120.4 deg +step 174 - lrate 0.000002, wchange 0.00576183, angledelta 117.9 deg +step 175 - lrate 0.000002, wchange 0.00646488, angledelta 117.9 deg +step 176 - lrate 0.000002, wchange 0.00604363, angledelta 133.1 deg +step 177 - lrate 0.000002, wchange 0.00712669, angledelta 127.1 deg +step 178 - lrate 0.000002, wchange 0.00492661, angledelta 131.0 deg +step 179 - lrate 0.000001, wchange 0.00444570, angledelta 120.0 deg +step 180 - lrate 0.000001, wchange 0.00637830, angledelta 130.1 deg +step 181 - lrate 0.000001, wchange 0.00413002, angledelta 123.7 deg +step 182 - lrate 0.000001, wchange 0.00517970, angledelta 119.1 deg +step 183 - lrate 0.000001, wchange 0.00490828, angledelta 125.7 deg +step 184 - lrate 0.000001, wchange 0.00897212, angledelta 124.1 deg +step 185 - lrate 0.000001, wchange 0.00376334, angledelta 125.3 deg +step 186 - lrate 0.000001, wchange 0.00469589, angledelta 113.6 deg +step 187 - lrate 0.000001, wchange 0.00500570, angledelta 132.2 deg +step 188 - lrate 0.000001, wchange 0.00612551, angledelta 127.8 deg +step 189 - lrate 0.000001, wchange 0.00458716, angledelta 136.5 deg +step 190 - lrate 0.000001, wchange 0.00425169, angledelta 124.9 deg +step 191 - lrate 0.000001, wchange 0.00348325, angledelta 109.2 deg +step 192 - lrate 0.000001, wchange 0.00445101, angledelta 120.6 deg +step 193 - lrate 0.000001, wchange 0.00351382, angledelta 110.1 deg +step 194 - lrate 0.000001, wchange 0.00326460, angledelta 118.0 deg +step 195 - lrate 0.000001, wchange 0.00452968, angledelta 116.5 deg +step 196 - lrate 0.000001, wchange 0.00678787, angledelta 116.7 deg +step 197 - lrate 0.000001, wchange 0.00485482, angledelta 125.5 deg +step 198 - lrate 0.000001, wchange 0.00379591, angledelta 120.6 deg +step 199 - lrate 0.000001, wchange 0.00480570, angledelta 108.1 deg +step 200 - lrate 0.000001, wchange 0.00624173, angledelta 129.7 deg +step 201 - lrate 0.000001, wchange 0.00368105, angledelta 125.4 deg +step 202 - lrate 0.000001, wchange 0.00300280, angledelta 115.9 deg +step 203 - lrate 0.000001, wchange 0.00225468, angledelta 118.7 deg +step 204 - lrate 0.000001, wchange 0.00259074, angledelta 117.1 deg +step 205 - lrate 0.000001, wchange 0.00460645, angledelta 105.7 deg +step 206 - lrate 0.000001, wchange 0.00336411, angledelta 131.9 deg +step 207 - lrate 0.000001, wchange 0.00266341, angledelta 105.6 deg +step 208 - lrate 0.000001, wchange 0.00393490, angledelta 127.5 deg +step 209 - lrate 0.000001, wchange 0.00284371, angledelta 128.8 deg +step 210 - lrate 0.000001, wchange 0.00184050, angledelta 104.7 deg +step 211 - lrate 0.000001, wchange 0.00222377, angledelta 112.6 deg +step 212 - lrate 0.000001, wchange 0.00214341, angledelta 124.0 deg +step 213 - lrate 0.000001, wchange 0.00206651, angledelta 118.3 deg +step 214 - lrate 0.000001, wchange 0.00264534, angledelta 128.6 deg +step 215 - lrate 0.000001, wchange 0.00191261, angledelta 122.5 deg +step 216 - lrate 0.000001, wchange 0.00233186, angledelta 125.4 deg +step 217 - lrate 0.000001, wchange 0.00364306, angledelta 135.5 deg +step 218 - lrate 0.000001, wchange 0.00296617, angledelta 129.6 deg +step 219 - lrate 0.000001, wchange 0.00186538, angledelta 129.6 deg +step 220 - lrate 0.000001, wchange 0.00167671, angledelta 111.1 deg +step 221 - lrate 0.000001, wchange 0.00493925, angledelta 125.9 deg +step 222 - lrate 0.000001, wchange 0.00344534, angledelta 140.3 deg +step 223 - lrate 0.000001, wchange 0.00174360, angledelta 114.1 deg +step 224 - lrate 0.000001, wchange 0.00195155, angledelta 122.8 deg +step 225 - lrate 0.000001, wchange 0.00176164, angledelta 134.4 deg +step 226 - lrate 0.000001, wchange 0.00164081, angledelta 121.6 deg +step 227 - lrate 0.000001, wchange 0.00174175, angledelta 125.2 deg +step 228 - lrate 0.000001, wchange 0.00140052, angledelta 112.8 deg +step 229 - lrate 0.000001, wchange 0.00180885, angledelta 126.3 deg +step 230 - lrate 0.000001, wchange 0.00164530, angledelta 121.9 deg +step 231 - lrate 0.000001, wchange 0.00126318, angledelta 122.7 deg +step 232 - lrate 0.000001, wchange 0.00209702, angledelta 120.4 deg +step 233 - lrate 0.000000, wchange 0.00188980, angledelta 133.0 deg +step 234 - lrate 0.000000, wchange 0.00121151, angledelta 120.5 deg +step 235 - lrate 0.000000, wchange 0.00194024, angledelta 118.1 deg +step 236 - lrate 0.000000, wchange 0.00146100, angledelta 134.8 deg +step 237 - lrate 0.000000, wchange 0.00076242, angledelta 115.3 deg +step 238 - lrate 0.000000, wchange 0.00084616, angledelta 114.5 deg +step 239 - lrate 0.000000, wchange 0.00100574, angledelta 112.1 deg +step 240 - lrate 0.000000, wchange 0.00139586, angledelta 121.5 deg +step 241 - lrate 0.000000, wchange 0.00182537, angledelta 128.3 deg +step 242 - lrate 0.000000, wchange 0.00147371, angledelta 118.7 deg +step 243 - lrate 0.000000, wchange 0.00127850, angledelta 129.4 deg +step 244 - lrate 0.000000, wchange 0.00148061, angledelta 114.9 deg +step 245 - lrate 0.000000, wchange 0.00155998, angledelta 134.0 deg +step 246 - lrate 0.000000, wchange 0.00083469, angledelta 122.9 deg +step 247 - lrate 0.000000, wchange 0.00104989, angledelta 104.2 deg +step 248 - lrate 0.000000, wchange 0.00095437, angledelta 119.1 deg +step 249 - lrate 0.000000, wchange 0.00163417, angledelta 128.1 deg +step 250 - lrate 0.000000, wchange 0.00080414, angledelta 102.2 deg +step 251 - lrate 0.000000, wchange 0.00080213, angledelta 129.2 deg +step 252 - lrate 0.000000, wchange 0.00077414, angledelta 111.8 deg +step 253 - lrate 0.000000, wchange 0.00101392, angledelta 132.9 deg +step 254 - lrate 0.000000, wchange 0.00056414, angledelta 133.5 deg +step 255 - lrate 0.000000, wchange 0.00055504, angledelta 107.8 deg +step 256 - lrate 0.000000, wchange 0.00109540, angledelta 132.8 deg +step 257 - lrate 0.000000, wchange 0.00151861, angledelta 133.2 deg +step 258 - lrate 0.000000, wchange 0.00055774, angledelta 133.7 deg +step 259 - lrate 0.000000, wchange 0.00063194, angledelta 91.4 deg +step 260 - lrate 0.000000, wchange 0.00052224, angledelta 126.7 deg +step 261 - lrate 0.000000, wchange 0.00056681, angledelta 109.2 deg +step 262 - lrate 0.000000, wchange 0.00050339, angledelta 118.8 deg +step 263 - lrate 0.000000, wchange 0.00049640, angledelta 107.8 deg +step 264 - lrate 0.000000, wchange 0.00069452, angledelta 119.4 deg +step 265 - lrate 0.000000, wchange 0.00061613, angledelta 125.2 deg +step 266 - lrate 0.000000, wchange 0.00113678, angledelta 136.1 deg +step 267 - lrate 0.000000, wchange 0.00078431, angledelta 140.0 deg +step 268 - lrate 0.000000, wchange 0.00044969, angledelta 93.2 deg +step 269 - lrate 0.000000, wchange 0.00055057, angledelta 124.7 deg +step 270 - lrate 0.000000, wchange 0.00037083, angledelta 115.4 deg +step 271 - lrate 0.000000, wchange 0.00048092, angledelta 123.4 deg +step 272 - lrate 0.000000, wchange 0.00066194, angledelta 131.6 deg +step 273 - lrate 0.000000, wchange 0.00036587, angledelta 128.8 deg +step 274 - lrate 0.000000, wchange 0.00031047, angledelta 117.3 deg +step 275 - lrate 0.000000, wchange 0.00030334, angledelta 119.4 deg +step 276 - lrate 0.000000, wchange 0.00030220, angledelta 127.3 deg +step 277 - lrate 0.000000, wchange 0.00039132, angledelta 112.4 deg +step 278 - lrate 0.000000, wchange 0.00035952, angledelta 122.6 deg +step 279 - lrate 0.000000, wchange 0.00026847, angledelta 117.5 deg +step 280 - lrate 0.000000, wchange 0.00028082, angledelta 122.7 deg +step 281 - lrate 0.000000, wchange 0.00029542, angledelta 127.1 deg +step 282 - lrate 0.000000, wchange 0.00019363, angledelta 114.0 deg +step 283 - lrate 0.000000, wchange 0.00027126, angledelta 115.2 deg +step 284 - lrate 0.000000, wchange 0.00031896, angledelta 119.1 deg +step 285 - lrate 0.000000, wchange 0.00029376, angledelta 119.5 deg +step 286 - lrate 0.000000, wchange 0.00022176, angledelta 110.1 deg +step 287 - lrate 0.000000, wchange 0.00023316, angledelta 118.4 deg +step 288 - lrate 0.000000, wchange 0.00014713, angledelta 125.0 deg +step 289 - lrate 0.000000, wchange 0.00014279, angledelta 113.1 deg +step 290 - lrate 0.000000, wchange 0.00018489, angledelta 105.7 deg +step 291 - lrate 0.000000, wchange 0.00026489, angledelta 122.0 deg +step 292 - lrate 0.000000, wchange 0.00018027, angledelta 125.9 deg +step 293 - lrate 0.000000, wchange 0.00017989, angledelta 129.1 deg +step 294 - lrate 0.000000, wchange 0.00013101, angledelta 107.0 deg +step 295 - lrate 0.000000, wchange 0.00012737, angledelta 108.6 deg +step 296 - lrate 0.000000, wchange 0.00010957, angledelta 115.7 deg +step 297 - lrate 0.000000, wchange 0.00014887, angledelta 114.9 deg +step 298 - lrate 0.000000, wchange 0.00016294, angledelta 117.0 deg +step 299 - lrate 0.000000, wchange 0.00012065, angledelta 123.9 deg +step 300 - lrate 0.000000, wchange 0.00014959, angledelta 120.4 deg +step 301 - lrate 0.000000, wchange 0.00016846, angledelta 113.7 deg +step 302 - lrate 0.000000, wchange 0.00009021, angledelta 107.2 deg +step 303 - lrate 0.000000, wchange 0.00010843, angledelta 111.0 deg +step 304 - lrate 0.000000, wchange 0.00007990, angledelta 123.8 deg +step 305 - lrate 0.000000, wchange 0.00007931, angledelta 122.7 deg +step 306 - lrate 0.000000, wchange 0.00009047, angledelta 126.9 deg +step 307 - lrate 0.000000, wchange 0.00007408, angledelta 122.1 deg +step 308 - lrate 0.000000, wchange 0.00006520, angledelta 127.1 deg +step 309 - lrate 0.000000, wchange 0.00009560, angledelta 125.0 deg +step 310 - lrate 0.000000, wchange 0.00006690, angledelta 126.0 deg +step 311 - lrate 0.000000, wchange 0.00008312, angledelta 122.5 deg +step 312 - lrate 0.000000, wchange 0.00005495, angledelta 124.3 deg +step 313 - lrate 0.000000, wchange 0.00006001, angledelta 102.5 deg +step 314 - lrate 0.000000, wchange 0.00007685, angledelta 118.5 deg +step 315 - lrate 0.000000, wchange 0.00002739, angledelta 102.1 deg +step 316 - lrate 0.000000, wchange 0.00004478, angledelta 102.5 deg +step 317 - lrate 0.000000, wchange 0.00002909, angledelta 123.2 deg +step 318 - lrate 0.000000, wchange 0.00004180, angledelta 109.3 deg +step 319 - lrate 0.000000, wchange 0.00003668, angledelta 113.9 deg +step 320 - lrate 0.000000, wchange 0.00003309, angledelta 119.4 deg +step 321 - lrate 0.000000, wchange 0.00002522, angledelta 92.1 deg +step 322 - lrate 0.000000, wchange 0.00002666, angledelta 109.3 deg +step 323 - lrate 0.000000, wchange 0.00003131, angledelta 108.3 deg +step 324 - lrate 0.000000, wchange 0.00002022, angledelta 111.6 deg +step 325 - lrate 0.000000, wchange 0.00002589, angledelta 117.1 deg +step 326 - lrate 0.000000, wchange 0.00001449, angledelta 112.7 deg +step 327 - lrate 0.000000, wchange 0.00001479, angledelta 99.4 deg +step 328 - lrate 0.000000, wchange 0.00001717, angledelta 105.9 deg +step 329 - lrate 0.000000, wchange 0.00001381, angledelta 111.5 deg +step 330 - lrate 0.000000, wchange 0.00002127, angledelta 113.6 deg +step 331 - lrate 0.000000, wchange 0.00001965, angledelta 115.9 deg +step 332 - lrate 0.000000, wchange 0.00002162, angledelta 110.5 deg +step 333 - lrate 0.000000, wchange 0.00001071, angledelta 121.7 deg +step 334 - lrate 0.000000, wchange 0.00001058, angledelta 96.1 deg +step 335 - lrate 0.000000, wchange 0.00000784, angledelta 96.9 deg +step 336 - lrate 0.000000, wchange 0.00000727, angledelta 101.3 deg +step 337 - lrate 0.000000, wchange 0.00001163, angledelta 102.4 deg +step 338 - lrate 0.000000, wchange 0.00000838, angledelta 108.5 deg +step 339 - lrate 0.000000, wchange 0.00001453, angledelta 119.2 deg +step 340 - lrate 0.000000, wchange 0.00000855, angledelta 85.0 deg +step 341 - lrate 0.000000, wchange 0.00000732, angledelta 120.0 deg +step 342 - lrate 0.000000, wchange 0.00000507, angledelta 101.4 deg +step 343 - lrate 0.000000, wchange 0.00000629, angledelta 101.3 deg +step 344 - lrate 0.000000, wchange 0.00000948, angledelta 107.2 deg +step 345 - lrate 0.000000, wchange 0.00000413, angledelta 105.6 deg +step 346 - lrate 0.000000, wchange 0.00000348, angledelta 102.0 deg +step 347 - lrate 0.000000, wchange 0.00000525, angledelta 98.4 deg +step 348 - lrate 0.000000, wchange 0.00000520, angledelta 105.5 deg +step 349 - lrate 0.000000, wchange 0.00000421, angledelta 102.9 deg +step 350 - lrate 0.000000, wchange 0.00000350, angledelta 103.3 deg +step 351 - lrate 0.000000, wchange 0.00000346, angledelta 99.5 deg +step 352 - lrate 0.000000, wchange 0.00000295, angledelta 89.3 deg +step 353 - lrate 0.000000, wchange 0.00000394, angledelta 112.1 deg +step 354 - lrate 0.000000, wchange 0.00000334, angledelta 91.8 deg +step 355 - lrate 0.000000, wchange 0.00000263, angledelta 98.7 deg +step 356 - lrate 0.000000, wchange 0.00000235, angledelta 102.1 deg +step 357 - lrate 0.000000, wchange 0.00000270, angledelta 94.4 deg +step 358 - lrate 0.000000, wchange 0.00000215, angledelta 97.6 deg +step 359 - lrate 0.000000, wchange 0.00000188, angledelta 102.7 deg +step 360 - lrate 0.000000, wchange 0.00000230, angledelta 91.3 deg +step 361 - lrate 0.000000, wchange 0.00000161, angledelta 120.2 deg +step 362 - lrate 0.000000, wchange 0.00000201, angledelta 99.0 deg +step 363 - lrate 0.000000, wchange 0.00000119, angledelta 95.1 deg +step 364 - lrate 0.000000, wchange 0.00000148, angledelta 95.7 deg +step 365 - lrate 0.000000, wchange 0.00000139, angledelta 118.1 deg +step 366 - lrate 0.000000, wchange 0.00000103, angledelta 108.6 deg +step 367 - lrate 0.000000, wchange 0.00000087, angledelta 93.3 deg +step 368 - lrate 0.000000, wchange 0.00000106, angledelta 95.5 deg +step 369 - lrate 0.000000, wchange 0.00000103, angledelta 116.4 deg +step 370 - lrate 0.000000, wchange 0.00000106, angledelta 94.1 deg +step 371 - lrate 0.000000, wchange 0.00000110, angledelta 104.8 deg +step 372 - lrate 0.000000, wchange 0.00000096, angledelta 110.0 deg +step 373 - lrate 0.000000, wchange 0.00000065, angledelta 99.4 deg +step 374 - lrate 0.000000, wchange 0.00000066, angledelta 96.4 deg +step 375 - lrate 0.000000, wchange 0.00000055, angledelta 104.7 deg +step 376 - lrate 0.000000, wchange 0.00000053, angledelta 87.5 deg +step 377 - lrate 0.000000, wchange 0.00000049, angledelta 107.1 deg +step 378 - lrate 0.000000, wchange 0.00000044, angledelta 97.4 deg +step 379 - lrate 0.000000, wchange 0.00000044, angledelta 107.3 deg +step 380 - lrate 0.000000, wchange 0.00000038, angledelta 96.4 deg +step 381 - lrate 0.000000, wchange 0.00000031, angledelta 98.3 deg +step 382 - lrate 0.000000, wchange 0.00000025, angledelta 111.7 deg +step 383 - lrate 0.000000, wchange 0.00000033, angledelta 86.7 deg +step 384 - lrate 0.000000, wchange 0.00000023, angledelta 102.2 deg +step 385 - lrate 0.000000, wchange 0.00000028, angledelta 93.6 deg +step 386 - lrate 0.000000, wchange 0.00000056, angledelta 106.0 deg +step 387 - lrate 0.000000, wchange 0.00000022, angledelta 116.8 deg +step 388 - lrate 0.000000, wchange 0.00000023, angledelta 107.6 deg +step 389 - lrate 0.000000, wchange 0.00000031, angledelta 111.4 deg +step 390 - lrate 0.000000, wchange 0.00000016, angledelta 81.3 deg +step 391 - lrate 0.000000, wchange 0.00000014, angledelta 101.9 deg +step 392 - lrate 0.000000, wchange 0.00000016, angledelta 80.6 deg +step 393 - lrate 0.000000, wchange 0.00000015, angledelta 105.9 deg +step 394 - lrate 0.000000, wchange 0.00000015, angledelta 79.5 deg +step 395 - lrate 0.000000, wchange 0.00000013, angledelta 98.9 deg +step 396 - lrate 0.000000, wchange 0.00000012, angledelta 106.8 deg +step 397 - lrate 0.000000, wchange 0.00000015, angledelta 77.8 deg +step 398 - lrate 0.000000, wchange 0.00000011, angledelta 99.6 deg +step 399 - lrate 0.000000, wchange 0.00000007, angledelta 88.8 deg +Sorting components in descending order of mean projected variance ... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +The input dataset will be split into 7638 epochs of 1 s +Epochs will overlap by 0%. +Inserting 7638 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560.......................................6600.................... +...................6640.......................................6680.......... +.............................6720.......................................6760 +.......................................6800.............................. +.........6840.......................................6880.................... +...................6920.......................................6960.......... +.............................7000.......................................7040 +.......................................7080.............................. +.........7120.......................................7160.................... +...................7200.......................................7240.......... +.............................7280.......................................7320 +.......................................7360.............................. +.........7400.......................................7440.................... +...................7480.......................................7520.......... +.............................7560.......................................7600 +...................................... +Sorting the event table. +Splitting the data into 7638 1.00-s epochs +pop_epoch():7638 epochs selected +Epoching... +pop_epoch():7638 epochs generated +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +Scaling components to RMS microvolt +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Scaling components to RMS microvolt +Scaling components to RMS microvolt +EEG.icaact not present. Recomputed from data. + +Features Extraction: +GDSF - General Discontinuity Spatial Feature... +SED - Spatial Eye Difference... +SAD - Spatial Average Difference... +Temporal Kurtosis... +Maximum epoch variance... +Computing EM thresholds... +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index + +par_id = + + 1x8 cell array + + Columns 1 through 6 + + {'sub-3000001'} {'all'} {'eeg'} {'s1'} {'r1'} {'e1'} + + Columns 7 through 8 + + {'filtered'} {'data - 1-s epochs'} + +. + +Artifact Identification: +Horizontal Eye Movements... +End Horizontal Eye Movement Detection +Vertical Eye Movements... +Eye Blinks... +End Blink Detection +Generic Discontinuities... + +Results in . +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Saving dataset... +Scaling components to RMS microvolt +Computing projection .... +pop_editeventfield(): creating new field 'observation' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'eventType' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'targetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'congruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'responded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'accuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'rt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'extraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidTrial' +pop-editeventfield(): updating urevent structure +Event resorted by increasing latencies. +pop_epoch():1678 epochs selected +Epoching... +pop_epoch():1678 epochs generated +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'observation' made uniform +eeg_checkset note: value format of event field 'eventType' made uniform +eeg_checkset note: value format of event field 'targetDir' made uniform +eeg_checkset note: value format of event field 'congruency' made uniform +eeg_checkset note: value format of event field 'prevTargetDir' made uniform +eeg_checkset note: value format of event field 'prevCongruency' made uniform +eeg_checkset note: value format of event field 'nextTargetDir' made uniform +eeg_checkset note: value format of event field 'nextCongruency' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +pop_rmbase(): Removing baseline... +1 channel selected +52/1678 trials marked for rejection +1 channel selected +63/1678 trials marked for rejection +1 channel selected +36/1678 trials marked for rejection +1 channel selected +29/1678 trials marked for rejection +1 channel selected +34/1678 trials marked for rejection +66/1678 trials rejected +Removing 66 trial(s)... +Pop_select: removing 234 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +8/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +3/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +3/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +7/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +3/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +9/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +48/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +6/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +15/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +14/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +11/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +12/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +5/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +9/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +7/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +5/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +12/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +23/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +11/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +244/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +8/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +112/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +25/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +6/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +16/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +6/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1612 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +21/1612 trials marked for rejection +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 33 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 32 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 28 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 43 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 7 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 6 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5586 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 7 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 8 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5586 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5586 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 8 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 8 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 13 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 12 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 8 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 8 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 7 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 5 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5582 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5584 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5583 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1611 trial(s)... +Pop_select: removing 5585 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +14/1612 trials rejected +Removing 14 trial(s)... +Pop_select: removing 46 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +0/1598 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Interpolating 3 channels... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Re-referencing data +Scaling components to RMS microvolt +Error: some channels not used for ICA decomposition are used for rereferencing + the ICA decomposition has been removed +Saving dataset... + + + +*** Processing subject 1 (sub-3000002_all_eeg_s1_r1_e1.vhdr) *** + + +pop_loadbv(): reading header file +Done. +pop_loadbv(): reading EEG data +pop_loadbv(): scaling EEG data +pop_loadbv(): reading marker file +Done. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +eeg_checkset warning: number of columns in data (64) does not match the number of channels (63): corrected +eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed +[Warning: channel labels should not be empty, creating unique labels] +Warning: the size of the channel location structure does not match with + number of channels. Channel information have been removed. +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 50:26= - 10%, ETE 45:31= \ 15%, ETE 42:25= | 20%, ETE 39:45= / 25%, ETE 36:58= - 30%, ETE 34:25= \ 35%, ETE 31:50= | 40%, ETE 29:19= / 45%, ETE 26:48= - 50%, ETE 24:19= \ 55%, ETE 21:51= | 60%, ETE 19:23= / 65%, ETE 16:57= - 70%, ETE 14:35= \ 75%, ETE 12:10= | 80%, ETE 09:43= / 85%, ETE 07:17= - 90%, ETE 04:51= \ 95%, ETE 02:26=| 100%, ETE 00:00 +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 00:58= - 10%, ETE 00:37= \ 15%, ETE 00:30= | 20%, ETE 00:25= / 25%, ETE 00:22= - 30%, ETE 00:20= \ 35%, ETE 00:18= | 40%, ETE 00:16= / 45%, ETE 00:15= - 50%, ETE 00:13= \ 55%, ETE 00:12= | 60%, ETE 00:10= / 65%, ETE 00:09= - 70%, ETE 00:08= \ 75%, ETE 00:07= | 80%, ETE 00:05= / 85%, ETE 00:04= - 90%, ETE 00:03= \ 95%, ETE 00:02=| 100%, ETE 00:00 +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Saving dataset... +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 03:31= - 10%, ETE 03:04= \ 15%, ETE 02:48= | 20%, ETE 02:36= / 25%, ETE 02:27= - 30%, ETE 02:22= \ 35%, ETE 02:16= | 40%, ETE 02:06= / 45%, ETE 01:54= - 50%, ETE 01:43= \ 55%, ETE 01:32= | 60%, ETE 01:21= / 65%, ETE 01:10= - 70%, ETE 01:00= \ 75%, ETE 00:51= | 80%, ETE 00:40= / 85%, ETE 00:30= - 90%, ETE 00:20= \ 95%, ETE 00:10=| 100%, ETE 00:00 +The input dataset will be split into 6720 epochs of 1 s +Epochs will overlap by 0%. +Inserting 6720 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560.......................................6600.................... +...................6640.......................................6680.......... +.............................6720 +Sorting the event table. +Splitting the data into 6720 1.00-s epochs +pop_epoch():6720 epochs selected +Epoching... +pop_epoch():6720 epochs generated +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +2/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +1/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +3/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +1/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +4/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +10/6719 trials marked for rejection + +1 channel selected +1/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +2/6719 trials marked for rejection +1 channel selected +1/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +11/6719 trials marked for rejection + +1 channel selected +3/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +2/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +3/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +1/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +11/6719 trials marked for rejection + +1 channel selected +10/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +1/6719 trials marked for rejection + +1 channel selected +2/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +9/6719 trials marked for rejection + +1 channel selected +2/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +10/6719 trials marked for rejection + +1 channel selected +2/6719 trials marked for rejection +1 channel selected +2/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +11/6719 trials marked for rejection + +1 channel selected +11/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +1 channel selected +67/6719 trials marked for rejection + +1 channel selected +61/6719 trials marked for rejection +1 channel selected +0/6719 trials marked for rejection + +1 channel selected +0/6719 trials marked for rejection +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +62 channel selected +104/6719 trials marked for rejection + +62 channel selected +90/6719 trials marked for rejection +113/6719 trials rejected +Removing 113 trial(s)... +Pop_select: removing 230 unreferenced events +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform + +Attempting to convert data matrix to double precision for more accurate ICA results. + +Input data size [62,6606000] = 62 channels, 6606000 frames/nFinding 62 ICA components using extended ICA. +Kurtosis will be calculated initially every 1 blocks using 6000 data points. +Decomposing 1718 frames per ICA weight ((3844)^2 = 6606000 weights, Initial learning rate will be 0.001, block size 79. +Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg. +Training will end when wchange < 1e-07 or after 512 steps. +Online bias adjustment will be used. +Removing mean of each channel ... +Final training data range: -979.41 to 999.326 +Computing the sphering matrix... +Starting weights are the identity matrix ... +Sphering the data ... +Beginning ICA training ... first training step may be slow ... +Lowering learning rate to 0.0009 and starting again. +Lowering learning rate to 0.00081 and starting again. +Lowering learning rate to 0.000729 and starting again. +Lowering learning rate to 0.0006561 and starting again. +Lowering learning rate to 0.00059049 and starting again. +Lowering learning rate to 0.000531441 and starting again. +Lowering learning rate to 0.000478297 and starting again. +Lowering learning rate to 0.000430467 and starting again. +Lowering learning rate to 0.00038742 and starting again. +Lowering learning rate to 0.000348678 and starting again. +step 1 - lrate 0.000349, wchange 43.91225755, angledelta 0.0 deg +step 2 - lrate 0.000349, wchange 4.95111471, angledelta 0.0 deg +Lowering learning rate to 0.000313811 and starting again. +step 1 - lrate 0.000314, wchange 44.61210317, angledelta 0.0 deg +step 2 - lrate 0.000314, wchange 4.12148365, angledelta 0.0 deg +Lowering learning rate to 0.00028243 and starting again. +step 1 - lrate 0.000282, wchange 41.11485937, angledelta 0.0 deg +step 2 - lrate 0.000282, wchange 3.50861920, angledelta 0.0 deg +step 3 - lrate 0.000282, wchange 4.91417291, angledelta 89.2 deg +step 4 - lrate 0.000277, wchange 5.90012421, angledelta 115.5 deg +step 5 - lrate 0.000271, wchange 4.49133719, angledelta 123.1 deg +step 6 - lrate 0.000266, wchange 3.33793284, angledelta 111.1 deg +step 7 - lrate 0.000261, wchange 2.60954775, angledelta 120.5 deg +step 8 - lrate 0.000255, wchange 3.45189411, angledelta 111.2 deg +step 9 - lrate 0.000250, wchange 3.94625225, angledelta 119.7 deg +step 10 - lrate 0.000245, wchange 2.94778563, angledelta 118.6 deg +step 11 - lrate 0.000240, wchange 3.71104805, angledelta 109.8 deg +step 12 - lrate 0.000235, wchange 1.46974428, angledelta 108.3 deg +step 13 - lrate 0.000231, wchange 2.63998730, angledelta 93.0 deg +step 14 - lrate 0.000226, wchange 3.98651175, angledelta 112.2 deg +step 15 - lrate 0.000222, wchange 2.35345267, angledelta 104.8 deg +step 16 - lrate 0.000217, wchange 3.37799139, angledelta 103.0 deg +step 17 - lrate 0.000213, wchange 3.48456508, angledelta 122.6 deg +step 18 - lrate 0.000209, wchange 2.96222381, angledelta 124.8 deg +step 19 - lrate 0.000204, wchange 1.34330010, angledelta 114.1 deg +step 20 - lrate 0.000200, wchange 1.94002207, angledelta 130.7 deg +step 21 - lrate 0.000196, wchange 0.81994761, angledelta 104.7 deg +step 22 - lrate 0.000192, wchange 2.74060442, angledelta 96.1 deg +step 23 - lrate 0.000189, wchange 2.27924885, angledelta 144.9 deg +step 24 - lrate 0.000185, wchange 3.17558074, angledelta 139.6 deg +step 25 - lrate 0.000181, wchange 2.31696347, angledelta 133.1 deg +step 26 - lrate 0.000177, wchange 1.50495349, angledelta 126.0 deg +step 27 - lrate 0.000174, wchange 1.28442474, angledelta 114.2 deg +step 28 - lrate 0.000170, wchange 1.83465043, angledelta 119.5 deg +step 29 - lrate 0.000167, wchange 1.81180752, angledelta 127.4 deg +step 30 - lrate 0.000164, wchange 1.28027563, angledelta 137.3 deg +step 31 - lrate 0.000160, wchange 3.16628522, angledelta 119.7 deg +step 32 - lrate 0.000157, wchange 1.50605864, angledelta 121.5 deg +step 33 - lrate 0.000154, wchange 1.94852397, angledelta 124.3 deg +step 34 - lrate 0.000151, wchange 0.86937939, angledelta 100.9 deg +step 35 - lrate 0.000148, wchange 1.35917065, angledelta 104.6 deg +step 36 - lrate 0.000145, wchange 1.69874592, angledelta 97.5 deg +step 37 - lrate 0.000142, wchange 1.64086582, angledelta 121.8 deg +step 38 - lrate 0.000139, wchange 1.39332077, angledelta 120.8 deg +step 39 - lrate 0.000136, wchange 1.06002665, angledelta 120.3 deg +step 40 - lrate 0.000134, wchange 2.77357636, angledelta 129.8 deg +step 41 - lrate 0.000131, wchange 3.14323482, angledelta 147.9 deg +step 42 - lrate 0.000128, wchange 0.72428394, angledelta 104.8 deg +step 43 - lrate 0.000126, wchange 1.21930240, angledelta 94.3 deg +step 44 - lrate 0.000123, wchange 2.18833391, angledelta 134.3 deg +step 45 - lrate 0.000121, wchange 0.87865466, angledelta 132.6 deg +step 46 - lrate 0.000118, wchange 0.53508560, angledelta 149.0 deg +step 47 - lrate 0.000116, wchange 1.41641188, angledelta 128.7 deg +step 48 - lrate 0.000114, wchange 0.54612432, angledelta 127.6 deg +step 49 - lrate 0.000112, wchange 1.14261260, angledelta 121.9 deg +step 50 - lrate 0.000109, wchange 0.30552328, angledelta 98.3 deg +step 51 - lrate 0.000107, wchange 1.27077953, angledelta 117.9 deg +step 52 - lrate 0.000105, wchange 0.13053856, angledelta 109.4 deg +step 53 - lrate 0.000103, wchange 0.84246741, angledelta 101.4 deg +step 54 - lrate 0.000101, wchange 0.74449008, angledelta 99.8 deg +step 55 - lrate 0.000099, wchange 0.80281265, angledelta 101.6 deg +step 56 - lrate 0.000097, wchange 0.24192254, angledelta 102.0 deg +step 57 - lrate 0.000095, wchange 0.84919575, angledelta 108.0 deg +step 58 - lrate 0.000093, wchange 0.19483061, angledelta 100.1 deg +step 59 - lrate 0.000091, wchange 1.02601774, angledelta 85.9 deg +step 60 - lrate 0.000089, wchange 0.94835644, angledelta 128.5 deg +step 61 - lrate 0.000088, wchange 0.10614186, angledelta 111.3 deg +step 62 - lrate 0.000086, wchange 0.11706644, angledelta 112.1 deg +step 63 - lrate 0.000084, wchange 0.77496962, angledelta 99.9 deg +step 64 - lrate 0.000082, wchange 0.12438765, angledelta 101.8 deg +step 65 - lrate 0.000081, wchange 0.10205540, angledelta 118.2 deg +step 66 - lrate 0.000079, wchange 0.11737438, angledelta 108.0 deg +step 67 - lrate 0.000078, wchange 0.10810795, angledelta 123.9 deg +step 68 - lrate 0.000076, wchange 0.08804621, angledelta 115.5 deg +step 69 - lrate 0.000074, wchange 0.13278082, angledelta 113.7 deg +step 70 - lrate 0.000073, wchange 0.15069354, angledelta 130.4 deg +step 71 - lrate 0.000071, wchange 0.13465440, angledelta 132.5 deg +step 72 - lrate 0.000070, wchange 0.10241267, angledelta 125.8 deg +step 73 - lrate 0.000069, wchange 0.13437077, angledelta 117.1 deg +step 74 - lrate 0.000067, wchange 0.09058972, angledelta 126.3 deg +step 75 - lrate 0.000066, wchange 0.10848435, angledelta 117.7 deg +step 76 - lrate 0.000065, wchange 0.11064049, angledelta 132.1 deg +step 77 - lrate 0.000063, wchange 0.08022603, angledelta 126.4 deg +step 78 - lrate 0.000062, wchange 0.08259595, angledelta 118.4 deg +step 79 - lrate 0.000061, wchange 0.12254829, angledelta 129.9 deg +step 80 - lrate 0.000060, wchange 0.10294781, angledelta 134.0 deg +step 81 - lrate 0.000058, wchange 0.05990612, angledelta 104.2 deg +step 82 - lrate 0.000057, wchange 0.07552446, angledelta 120.0 deg +step 83 - lrate 0.000056, wchange 0.06452621, angledelta 112.5 deg +step 84 - lrate 0.000055, wchange 0.07010980, angledelta 119.2 deg +step 85 - lrate 0.000054, wchange 0.06771087, angledelta 117.9 deg +step 86 - lrate 0.000053, wchange 0.05844877, angledelta 114.8 deg +step 87 - lrate 0.000052, wchange 0.06830773, angledelta 112.1 deg +step 88 - lrate 0.000051, wchange 0.08133415, angledelta 126.8 deg +step 89 - lrate 0.000050, wchange 0.08368481, angledelta 127.6 deg +step 90 - lrate 0.000049, wchange 0.06989271, angledelta 124.3 deg +step 91 - lrate 0.000048, wchange 0.05854326, angledelta 116.9 deg +step 92 - lrate 0.000047, wchange 0.07081370, angledelta 120.5 deg +step 93 - lrate 0.000046, wchange 0.07185101, angledelta 122.9 deg +step 94 - lrate 0.000045, wchange 0.07058534, angledelta 128.9 deg +step 95 - lrate 0.000044, wchange 0.06991133, angledelta 128.3 deg +step 96 - lrate 0.000043, wchange 0.04415194, angledelta 121.9 deg +step 97 - lrate 0.000042, wchange 0.04756700, angledelta 111.4 deg +step 98 - lrate 0.000041, wchange 0.04879691, angledelta 124.7 deg +step 99 - lrate 0.000041, wchange 0.04420659, angledelta 112.0 deg +step 100 - lrate 0.000040, wchange 0.07588013, angledelta 124.3 deg +step 101 - lrate 0.000039, wchange 0.08346854, angledelta 140.7 deg +step 102 - lrate 0.000038, wchange 0.04135425, angledelta 115.1 deg +step 103 - lrate 0.000037, wchange 0.06885215, angledelta 116.2 deg +step 104 - lrate 0.000037, wchange 0.04413309, angledelta 107.5 deg +step 105 - lrate 0.000036, wchange 0.04246754, angledelta 117.5 deg +step 106 - lrate 0.000035, wchange 0.04804605, angledelta 102.2 deg +step 107 - lrate 0.000035, wchange 0.04447599, angledelta 123.2 deg +step 108 - lrate 0.000034, wchange 0.04317540, angledelta 116.6 deg +step 109 - lrate 0.000033, wchange 0.03324969, angledelta 120.1 deg +step 110 - lrate 0.000033, wchange 0.03706347, angledelta 115.5 deg +step 111 - lrate 0.000032, wchange 0.05982739, angledelta 129.8 deg +step 112 - lrate 0.000031, wchange 0.06754604, angledelta 137.8 deg +step 113 - lrate 0.000031, wchange 0.02926647, angledelta 104.6 deg +step 114 - lrate 0.000030, wchange 0.04130006, angledelta 119.6 deg +step 115 - lrate 0.000029, wchange 0.03741168, angledelta 125.9 deg +step 116 - lrate 0.000029, wchange 0.04048109, angledelta 118.9 deg +step 117 - lrate 0.000028, wchange 0.03904802, angledelta 134.4 deg +step 118 - lrate 0.000028, wchange 0.02629260, angledelta 109.4 deg +step 119 - lrate 0.000027, wchange 0.02830776, angledelta 118.7 deg +step 120 - lrate 0.000027, wchange 0.04073402, angledelta 112.6 deg +step 121 - lrate 0.000026, wchange 0.03878396, angledelta 121.0 deg +step 122 - lrate 0.000026, wchange 0.03463587, angledelta 132.0 deg +step 123 - lrate 0.000025, wchange 0.03357164, angledelta 130.4 deg +step 124 - lrate 0.000025, wchange 0.03528238, angledelta 128.6 deg +step 125 - lrate 0.000024, wchange 0.02742862, angledelta 123.6 deg +step 126 - lrate 0.000024, wchange 0.02504358, angledelta 122.3 deg +step 127 - lrate 0.000023, wchange 0.02557362, angledelta 118.6 deg +step 128 - lrate 0.000023, wchange 0.02697644, angledelta 116.4 deg +step 129 - lrate 0.000022, wchange 0.03124718, angledelta 118.9 deg +step 130 - lrate 0.000022, wchange 0.02673529, angledelta 116.8 deg +step 131 - lrate 0.000021, wchange 0.03549573, angledelta 123.2 deg +step 132 - lrate 0.000021, wchange 0.04560227, angledelta 134.3 deg +step 133 - lrate 0.000020, wchange 0.02942798, angledelta 112.6 deg +step 134 - lrate 0.000020, wchange 0.02723659, angledelta 123.9 deg +step 135 - lrate 0.000020, wchange 0.01897195, angledelta 122.7 deg +step 136 - lrate 0.000019, wchange 0.02601030, angledelta 124.7 deg +step 137 - lrate 0.000019, wchange 0.02981319, angledelta 130.4 deg +step 138 - lrate 0.000018, wchange 0.02058061, angledelta 118.1 deg +step 139 - lrate 0.000018, wchange 0.02071087, angledelta 119.8 deg +step 140 - lrate 0.000018, wchange 0.02133653, angledelta 124.6 deg +step 141 - lrate 0.000017, wchange 0.02704284, angledelta 123.5 deg +step 142 - lrate 0.000017, wchange 0.02149451, angledelta 134.2 deg +step 143 - lrate 0.000017, wchange 0.01786256, angledelta 124.7 deg +step 144 - lrate 0.000016, wchange 0.02176826, angledelta 120.6 deg +step 145 - lrate 0.000016, wchange 0.02340440, angledelta 127.4 deg +step 146 - lrate 0.000016, wchange 0.02334991, angledelta 130.2 deg +step 147 - lrate 0.000015, wchange 0.02001172, angledelta 117.6 deg +step 148 - lrate 0.000015, wchange 0.01662078, angledelta 127.6 deg +step 149 - lrate 0.000015, wchange 0.02037554, angledelta 101.5 deg +step 150 - lrate 0.000014, wchange 0.02027827, angledelta 125.7 deg +step 151 - lrate 0.000014, wchange 0.01858976, angledelta 100.8 deg +step 152 - lrate 0.000014, wchange 0.02180477, angledelta 123.6 deg +step 153 - lrate 0.000014, wchange 0.01554667, angledelta 122.6 deg +step 154 - lrate 0.000013, wchange 0.01251293, angledelta 121.8 deg +step 155 - lrate 0.000013, wchange 0.01370952, angledelta 117.9 deg +step 156 - lrate 0.000013, wchange 0.01729738, angledelta 123.7 deg +step 157 - lrate 0.000013, wchange 0.02342386, angledelta 130.0 deg +step 158 - lrate 0.000012, wchange 0.01205658, angledelta 123.9 deg +step 159 - lrate 0.000012, wchange 0.01654018, angledelta 104.0 deg +step 160 - lrate 0.000012, wchange 0.01453040, angledelta 132.6 deg +step 161 - lrate 0.000012, wchange 0.01111611, angledelta 107.0 deg +step 162 - lrate 0.000011, wchange 0.01111169, angledelta 108.6 deg +step 163 - lrate 0.000011, wchange 0.01316286, angledelta 124.9 deg +step 164 - lrate 0.000011, wchange 0.00906936, angledelta 117.1 deg +step 165 - lrate 0.000011, wchange 0.01351941, angledelta 117.5 deg +step 166 - lrate 0.000010, wchange 0.01657281, angledelta 134.6 deg +step 167 - lrate 0.000010, wchange 0.01117928, angledelta 120.5 deg +step 168 - lrate 0.000010, wchange 0.01083068, angledelta 115.6 deg +step 169 - lrate 0.000010, wchange 0.01170248, angledelta 119.2 deg +step 170 - lrate 0.000010, wchange 0.00787207, angledelta 115.4 deg +step 171 - lrate 0.000009, wchange 0.00753843, angledelta 118.7 deg +step 172 - lrate 0.000009, wchange 0.01178427, angledelta 116.0 deg +step 173 - lrate 0.000009, wchange 0.01139710, angledelta 128.7 deg +step 174 - lrate 0.000009, wchange 0.00888465, angledelta 117.8 deg +step 175 - lrate 0.000009, wchange 0.00910123, angledelta 122.6 deg +step 176 - lrate 0.000009, wchange 0.00680952, angledelta 104.0 deg +step 177 - lrate 0.000008, wchange 0.01189581, angledelta 124.5 deg +step 178 - lrate 0.000008, wchange 0.01038520, angledelta 130.0 deg +step 179 - lrate 0.000008, wchange 0.00960078, angledelta 124.7 deg +step 180 - lrate 0.000008, wchange 0.00744608, angledelta 116.0 deg +step 181 - lrate 0.000008, wchange 0.00833593, angledelta 120.6 deg +step 182 - lrate 0.000008, wchange 0.00702786, angledelta 114.7 deg +step 183 - lrate 0.000007, wchange 0.01000374, angledelta 122.0 deg +step 184 - lrate 0.000007, wchange 0.00883133, angledelta 131.0 deg +step 185 - lrate 0.000007, wchange 0.00772355, angledelta 118.8 deg +step 186 - lrate 0.000007, wchange 0.00857354, angledelta 122.1 deg +step 187 - lrate 0.000007, wchange 0.00655695, angledelta 114.1 deg +step 188 - lrate 0.000007, wchange 0.00804358, angledelta 116.0 deg +step 189 - lrate 0.000007, wchange 0.00714024, angledelta 123.3 deg +step 190 - lrate 0.000006, wchange 0.00726542, angledelta 112.3 deg +step 191 - lrate 0.000006, wchange 0.01133866, angledelta 129.5 deg +step 192 - lrate 0.000006, wchange 0.00877498, angledelta 129.2 deg +step 193 - lrate 0.000006, wchange 0.00443512, angledelta 117.6 deg +step 194 - lrate 0.000006, wchange 0.00443656, angledelta 116.0 deg +step 195 - lrate 0.000006, wchange 0.00770885, angledelta 114.8 deg +step 196 - lrate 0.000006, wchange 0.00521205, angledelta 127.8 deg +step 197 - lrate 0.000006, wchange 0.00709273, angledelta 92.7 deg +step 198 - lrate 0.000005, wchange 0.00649112, angledelta 131.4 deg +step 199 - lrate 0.000005, wchange 0.00706546, angledelta 101.7 deg +step 200 - lrate 0.000005, wchange 0.01043687, angledelta 126.4 deg +step 201 - lrate 0.000005, wchange 0.00597398, angledelta 120.5 deg +step 202 - lrate 0.000005, wchange 0.00384838, angledelta 118.5 deg +step 203 - lrate 0.000005, wchange 0.00551170, angledelta 120.5 deg +step 204 - lrate 0.000005, wchange 0.00482360, angledelta 123.1 deg +step 205 - lrate 0.000005, wchange 0.00503794, angledelta 120.6 deg +step 206 - lrate 0.000005, wchange 0.00568759, angledelta 117.8 deg +step 207 - lrate 0.000005, wchange 0.00489640, angledelta 119.7 deg +step 208 - lrate 0.000004, wchange 0.00383646, angledelta 114.6 deg +step 209 - lrate 0.000004, wchange 0.00603770, angledelta 113.5 deg +step 210 - lrate 0.000004, wchange 0.00437715, angledelta 122.6 deg +step 211 - lrate 0.000004, wchange 0.00328576, angledelta 112.9 deg +step 212 - lrate 0.000004, wchange 0.00386086, angledelta 117.9 deg +step 213 - lrate 0.000004, wchange 0.00471006, angledelta 121.9 deg +step 214 - lrate 0.000004, wchange 0.00372626, angledelta 113.3 deg +step 215 - lrate 0.000004, wchange 0.00278482, angledelta 113.4 deg +step 216 - lrate 0.000004, wchange 0.00450159, angledelta 117.2 deg +step 217 - lrate 0.000004, wchange 0.00332581, angledelta 107.5 deg +step 218 - lrate 0.000004, wchange 0.00504597, angledelta 117.3 deg +step 219 - lrate 0.000004, wchange 0.00328865, angledelta 106.7 deg +step 220 - lrate 0.000004, wchange 0.00426972, angledelta 119.4 deg +step 221 - lrate 0.000003, wchange 0.00380298, angledelta 124.2 deg +step 222 - lrate 0.000003, wchange 0.00457648, angledelta 127.0 deg +step 223 - lrate 0.000003, wchange 0.00418961, angledelta 125.9 deg +step 224 - lrate 0.000003, wchange 0.00509566, angledelta 124.6 deg +step 225 - lrate 0.000003, wchange 0.00435681, angledelta 136.0 deg +step 226 - lrate 0.000003, wchange 0.00297684, angledelta 115.8 deg +step 227 - lrate 0.000003, wchange 0.00260507, angledelta 113.9 deg +step 228 - lrate 0.000003, wchange 0.00663692, angledelta 112.8 deg +step 229 - lrate 0.000003, wchange 0.00506452, angledelta 136.1 deg +step 230 - lrate 0.000003, wchange 0.00273955, angledelta 107.1 deg +step 231 - lrate 0.000003, wchange 0.00216621, angledelta 112.8 deg +step 232 - lrate 0.000003, wchange 0.00281959, angledelta 119.2 deg +step 233 - lrate 0.000003, wchange 0.00430858, angledelta 107.1 deg +step 234 - lrate 0.000003, wchange 0.00466708, angledelta 138.1 deg +step 235 - lrate 0.000003, wchange 0.00275899, angledelta 112.7 deg +step 236 - lrate 0.000003, wchange 0.00262659, angledelta 123.4 deg +step 237 - lrate 0.000002, wchange 0.00263733, angledelta 117.6 deg +step 238 - lrate 0.000002, wchange 0.00224501, angledelta 126.8 deg +step 239 - lrate 0.000002, wchange 0.00212790, angledelta 119.7 deg +step 240 - lrate 0.000002, wchange 0.00224227, angledelta 112.7 deg +step 241 - lrate 0.000002, wchange 0.00298800, angledelta 124.7 deg +step 242 - lrate 0.000002, wchange 0.00256687, angledelta 109.7 deg +step 243 - lrate 0.000002, wchange 0.00259268, angledelta 123.3 deg +step 244 - lrate 0.000002, wchange 0.00204541, angledelta 114.7 deg +step 245 - lrate 0.000002, wchange 0.00257924, angledelta 119.1 deg +step 246 - lrate 0.000002, wchange 0.00309173, angledelta 127.6 deg +step 247 - lrate 0.000002, wchange 0.00231810, angledelta 124.9 deg +step 248 - lrate 0.000002, wchange 0.00199742, angledelta 126.6 deg +step 249 - lrate 0.000002, wchange 0.00204156, angledelta 114.4 deg +step 250 - lrate 0.000002, wchange 0.00221098, angledelta 127.2 deg +step 251 - lrate 0.000002, wchange 0.00220131, angledelta 120.4 deg +step 252 - lrate 0.000002, wchange 0.00297468, angledelta 119.2 deg +step 253 - lrate 0.000002, wchange 0.00270448, angledelta 133.8 deg +step 254 - lrate 0.000002, wchange 0.00199137, angledelta 121.1 deg +step 255 - lrate 0.000002, wchange 0.00265228, angledelta 134.5 deg +step 256 - lrate 0.000002, wchange 0.00169331, angledelta 129.6 deg +step 257 - lrate 0.000002, wchange 0.00121042, angledelta 116.1 deg +step 258 - lrate 0.000002, wchange 0.00157013, angledelta 110.3 deg +step 259 - lrate 0.000002, wchange 0.00196495, angledelta 126.0 deg +step 260 - lrate 0.000002, wchange 0.00153794, angledelta 125.6 deg +step 261 - lrate 0.000002, wchange 0.00183671, angledelta 107.5 deg +step 262 - lrate 0.000002, wchange 0.00218250, angledelta 114.8 deg +step 263 - lrate 0.000001, wchange 0.00183322, angledelta 124.0 deg +step 264 - lrate 0.000001, wchange 0.00117849, angledelta 125.0 deg +step 265 - lrate 0.000001, wchange 0.00115872, angledelta 125.2 deg +step 266 - lrate 0.000001, wchange 0.00230281, angledelta 119.4 deg +step 267 - lrate 0.000001, wchange 0.00263636, angledelta 135.4 deg +step 268 - lrate 0.000001, wchange 0.00123854, angledelta 122.6 deg +step 269 - lrate 0.000001, wchange 0.00144756, angledelta 125.0 deg +step 270 - lrate 0.000001, wchange 0.00121226, angledelta 120.9 deg +step 271 - lrate 0.000001, wchange 0.00132524, angledelta 121.6 deg +step 272 - lrate 0.000001, wchange 0.00134634, angledelta 133.1 deg +step 273 - lrate 0.000001, wchange 0.00089384, angledelta 113.2 deg +step 274 - lrate 0.000001, wchange 0.00128361, angledelta 115.6 deg +step 275 - lrate 0.000001, wchange 0.00129968, angledelta 135.4 deg +step 276 - lrate 0.000001, wchange 0.00080598, angledelta 125.3 deg +step 277 - lrate 0.000001, wchange 0.00062627, angledelta 110.7 deg +step 278 - lrate 0.000001, wchange 0.00120291, angledelta 125.0 deg +step 279 - lrate 0.000001, wchange 0.00099585, angledelta 120.7 deg +step 280 - lrate 0.000001, wchange 0.00104465, angledelta 128.9 deg +step 281 - lrate 0.000001, wchange 0.00224592, angledelta 115.1 deg +step 282 - lrate 0.000001, wchange 0.00150860, angledelta 128.2 deg +step 283 - lrate 0.000001, wchange 0.00103785, angledelta 112.3 deg +step 284 - lrate 0.000001, wchange 0.00064876, angledelta 113.1 deg +step 285 - lrate 0.000001, wchange 0.00090387, angledelta 100.3 deg +step 286 - lrate 0.000001, wchange 0.00095724, angledelta 120.5 deg +step 287 - lrate 0.000001, wchange 0.00109073, angledelta 110.5 deg +step 288 - lrate 0.000001, wchange 0.00101869, angledelta 122.9 deg +step 289 - lrate 0.000001, wchange 0.00088393, angledelta 123.9 deg +step 290 - lrate 0.000001, wchange 0.00068888, angledelta 120.9 deg +step 291 - lrate 0.000001, wchange 0.00068487, angledelta 118.3 deg +step 292 - lrate 0.000001, wchange 0.00079563, angledelta 114.9 deg +step 293 - lrate 0.000001, wchange 0.00086817, angledelta 119.6 deg +step 294 - lrate 0.000001, wchange 0.00057724, angledelta 102.3 deg +step 295 - lrate 0.000001, wchange 0.00101054, angledelta 128.0 deg +step 296 - lrate 0.000001, wchange 0.00050542, angledelta 120.8 deg +step 297 - lrate 0.000001, wchange 0.00069250, angledelta 112.5 deg +step 298 - lrate 0.000001, wchange 0.00065247, angledelta 125.4 deg +step 299 - lrate 0.000001, wchange 0.00059167, angledelta 116.0 deg +step 300 - lrate 0.000001, wchange 0.00055057, angledelta 122.6 deg +step 301 - lrate 0.000001, wchange 0.00050002, angledelta 122.7 deg +step 302 - lrate 0.000001, wchange 0.00051259, angledelta 116.3 deg +step 303 - lrate 0.000001, wchange 0.00046791, angledelta 113.3 deg +step 304 - lrate 0.000001, wchange 0.00052995, angledelta 119.2 deg +step 305 - lrate 0.000001, wchange 0.00058706, angledelta 120.8 deg +step 306 - lrate 0.000001, wchange 0.00059358, angledelta 129.3 deg +step 307 - lrate 0.000001, wchange 0.00040636, angledelta 124.1 deg +step 308 - lrate 0.000001, wchange 0.00045402, angledelta 104.3 deg +step 309 - lrate 0.000001, wchange 0.00058044, angledelta 126.2 deg +step 310 - lrate 0.000001, wchange 0.00050897, angledelta 112.2 deg +step 311 - lrate 0.000001, wchange 0.00043039, angledelta 128.6 deg +step 312 - lrate 0.000001, wchange 0.00072805, angledelta 119.7 deg +step 313 - lrate 0.000001, wchange 0.00056827, angledelta 124.4 deg +step 314 - lrate 0.000001, wchange 0.00050644, angledelta 116.0 deg +step 315 - lrate 0.000001, wchange 0.00042895, angledelta 126.4 deg +step 316 - lrate 0.000001, wchange 0.00043812, angledelta 122.3 deg +step 317 - lrate 0.000000, wchange 0.00044518, angledelta 114.6 deg +step 318 - lrate 0.000000, wchange 0.00047873, angledelta 123.5 deg +step 319 - lrate 0.000000, wchange 0.00046800, angledelta 116.1 deg +step 320 - lrate 0.000000, wchange 0.00040545, angledelta 124.2 deg +step 321 - lrate 0.000000, wchange 0.00030402, angledelta 113.5 deg +step 322 - lrate 0.000000, wchange 0.00041928, angledelta 110.2 deg +step 323 - lrate 0.000000, wchange 0.00039000, angledelta 124.7 deg +step 324 - lrate 0.000000, wchange 0.00030729, angledelta 120.4 deg +step 325 - lrate 0.000000, wchange 0.00032399, angledelta 123.2 deg +step 326 - lrate 0.000000, wchange 0.00040582, angledelta 123.1 deg +step 327 - lrate 0.000000, wchange 0.00026079, angledelta 103.4 deg +step 328 - lrate 0.000000, wchange 0.00033062, angledelta 120.6 deg +step 329 - lrate 0.000000, wchange 0.00029090, angledelta 116.4 deg +step 330 - lrate 0.000000, wchange 0.00027321, angledelta 126.5 deg +step 331 - lrate 0.000000, wchange 0.00020084, angledelta 121.2 deg +step 332 - lrate 0.000000, wchange 0.00025318, angledelta 118.5 deg +step 333 - lrate 0.000000, wchange 0.00023771, angledelta 119.7 deg +step 334 - lrate 0.000000, wchange 0.00017596, angledelta 111.3 deg +step 335 - lrate 0.000000, wchange 0.00028336, angledelta 115.3 deg +step 336 - lrate 0.000000, wchange 0.00028750, angledelta 136.7 deg +step 337 - lrate 0.000000, wchange 0.00023186, angledelta 123.9 deg +step 338 - lrate 0.000000, wchange 0.00019611, angledelta 125.0 deg +step 339 - lrate 0.000000, wchange 0.00014229, angledelta 111.1 deg +step 340 - lrate 0.000000, wchange 0.00013325, angledelta 121.9 deg +step 341 - lrate 0.000000, wchange 0.00016733, angledelta 117.8 deg +step 342 - lrate 0.000000, wchange 0.00018834, angledelta 124.8 deg +step 343 - lrate 0.000000, wchange 0.00016622, angledelta 120.5 deg +step 344 - lrate 0.000000, wchange 0.00012638, angledelta 109.7 deg +step 345 - lrate 0.000000, wchange 0.00017785, angledelta 117.8 deg +step 346 - lrate 0.000000, wchange 0.00016198, angledelta 128.0 deg +step 347 - lrate 0.000000, wchange 0.00013658, angledelta 125.4 deg +step 348 - lrate 0.000000, wchange 0.00011959, angledelta 126.6 deg +step 349 - lrate 0.000000, wchange 0.00012181, angledelta 114.4 deg +step 350 - lrate 0.000000, wchange 0.00015703, angledelta 121.8 deg +step 351 - lrate 0.000000, wchange 0.00018861, angledelta 128.8 deg +step 352 - lrate 0.000000, wchange 0.00013500, angledelta 131.8 deg +step 353 - lrate 0.000000, wchange 0.00010986, angledelta 124.1 deg +step 354 - lrate 0.000000, wchange 0.00009430, angledelta 119.5 deg +step 355 - lrate 0.000000, wchange 0.00007643, angledelta 121.2 deg +step 356 - lrate 0.000000, wchange 0.00006754, angledelta 114.9 deg +step 357 - lrate 0.000000, wchange 0.00007162, angledelta 117.0 deg +step 358 - lrate 0.000000, wchange 0.00009498, angledelta 120.4 deg +step 359 - lrate 0.000000, wchange 0.00009429, angledelta 119.8 deg +step 360 - lrate 0.000000, wchange 0.00007889, angledelta 117.9 deg +step 361 - lrate 0.000000, wchange 0.00008608, angledelta 112.7 deg +step 362 - lrate 0.000000, wchange 0.00007770, angledelta 117.6 deg +step 363 - lrate 0.000000, wchange 0.00006752, angledelta 117.8 deg +step 364 - lrate 0.000000, wchange 0.00004966, angledelta 119.2 deg +step 365 - lrate 0.000000, wchange 0.00006071, angledelta 103.9 deg +step 366 - lrate 0.000000, wchange 0.00007612, angledelta 128.8 deg +step 367 - lrate 0.000000, wchange 0.00004768, angledelta 106.1 deg +step 368 - lrate 0.000000, wchange 0.00004483, angledelta 117.6 deg +step 369 - lrate 0.000000, wchange 0.00005989, angledelta 111.6 deg +step 370 - lrate 0.000000, wchange 0.00004871, angledelta 118.2 deg +step 371 - lrate 0.000000, wchange 0.00004623, angledelta 122.7 deg +step 372 - lrate 0.000000, wchange 0.00005150, angledelta 118.6 deg +step 373 - lrate 0.000000, wchange 0.00003538, angledelta 114.1 deg +step 374 - lrate 0.000000, wchange 0.00002727, angledelta 112.1 deg +step 375 - lrate 0.000000, wchange 0.00002739, angledelta 112.8 deg +step 376 - lrate 0.000000, wchange 0.00002645, angledelta 116.1 deg +step 377 - lrate 0.000000, wchange 0.00002956, angledelta 109.4 deg +step 378 - lrate 0.000000, wchange 0.00003226, angledelta 122.4 deg +step 379 - lrate 0.000000, wchange 0.00002465, angledelta 121.6 deg +step 380 - lrate 0.000000, wchange 0.00002683, angledelta 121.9 deg +step 381 - lrate 0.000000, wchange 0.00001984, angledelta 115.1 deg +step 382 - lrate 0.000000, wchange 0.00002605, angledelta 117.8 deg +step 383 - lrate 0.000000, wchange 0.00002175, angledelta 123.9 deg +step 384 - lrate 0.000000, wchange 0.00001834, angledelta 108.1 deg +step 385 - lrate 0.000000, wchange 0.00002174, angledelta 117.9 deg +step 386 - lrate 0.000000, wchange 0.00001782, angledelta 109.8 deg +step 387 - lrate 0.000000, wchange 0.00001387, angledelta 113.9 deg +step 388 - lrate 0.000000, wchange 0.00002284, angledelta 102.6 deg +step 389 - lrate 0.000000, wchange 0.00001257, angledelta 110.9 deg +step 390 - lrate 0.000000, wchange 0.00001327, angledelta 112.2 deg +step 391 - lrate 0.000000, wchange 0.00001103, angledelta 116.0 deg +step 392 - lrate 0.000000, wchange 0.00001584, angledelta 111.2 deg +step 393 - lrate 0.000000, wchange 0.00001491, angledelta 124.1 deg +step 394 - lrate 0.000000, wchange 0.00000947, angledelta 118.6 deg +step 395 - lrate 0.000000, wchange 0.00001097, angledelta 115.5 deg +step 396 - lrate 0.000000, wchange 0.00001176, angledelta 117.8 deg +step 397 - lrate 0.000000, wchange 0.00001125, angledelta 112.1 deg +step 398 - lrate 0.000000, wchange 0.00000817, angledelta 117.5 deg +step 399 - lrate 0.000000, wchange 0.00000917, angledelta 106.1 deg +step 400 - lrate 0.000000, wchange 0.00001360, angledelta 119.5 deg +step 401 - lrate 0.000000, wchange 0.00000735, angledelta 116.9 deg +step 402 - lrate 0.000000, wchange 0.00000674, angledelta 102.1 deg +step 403 - lrate 0.000000, wchange 0.00000667, angledelta 102.7 deg +step 404 - lrate 0.000000, wchange 0.00000625, angledelta 115.0 deg +step 405 - lrate 0.000000, wchange 0.00000501, angledelta 113.2 deg +step 406 - lrate 0.000000, wchange 0.00000447, angledelta 109.6 deg +step 407 - lrate 0.000000, wchange 0.00000380, angledelta 109.1 deg +step 408 - lrate 0.000000, wchange 0.00000479, angledelta 104.6 deg +step 409 - lrate 0.000000, wchange 0.00000402, angledelta 116.1 deg +step 410 - lrate 0.000000, wchange 0.00000629, angledelta 108.7 deg +step 411 - lrate 0.000000, wchange 0.00000508, angledelta 127.4 deg +step 412 - lrate 0.000000, wchange 0.00000348, angledelta 100.7 deg +step 413 - lrate 0.000000, wchange 0.00000482, angledelta 116.5 deg +step 414 - lrate 0.000000, wchange 0.00000302, angledelta 91.8 deg +step 415 - lrate 0.000000, wchange 0.00000274, angledelta 115.2 deg +step 416 - lrate 0.000000, wchange 0.00000333, angledelta 116.7 deg +step 417 - lrate 0.000000, wchange 0.00000263, angledelta 112.4 deg +step 418 - lrate 0.000000, wchange 0.00000221, angledelta 110.4 deg +step 419 - lrate 0.000000, wchange 0.00000239, angledelta 108.1 deg +step 420 - lrate 0.000000, wchange 0.00000137, angledelta 105.1 deg +step 421 - lrate 0.000000, wchange 0.00000210, angledelta 103.8 deg +step 422 - lrate 0.000000, wchange 0.00000185, angledelta 109.7 deg +step 423 - lrate 0.000000, wchange 0.00000215, angledelta 115.4 deg +step 424 - lrate 0.000000, wchange 0.00000138, angledelta 88.8 deg +step 425 - lrate 0.000000, wchange 0.00000108, angledelta 98.1 deg +step 426 - lrate 0.000000, wchange 0.00000109, angledelta 108.8 deg +step 427 - lrate 0.000000, wchange 0.00000152, angledelta 93.1 deg +step 428 - lrate 0.000000, wchange 0.00000092, angledelta 105.0 deg +step 429 - lrate 0.000000, wchange 0.00000103, angledelta 110.3 deg +step 430 - lrate 0.000000, wchange 0.00000158, angledelta 108.9 deg +step 431 - lrate 0.000000, wchange 0.00000089, angledelta 114.9 deg +step 432 - lrate 0.000000, wchange 0.00000074, angledelta 109.2 deg +step 433 - lrate 0.000000, wchange 0.00000105, angledelta 102.7 deg +step 434 - lrate 0.000000, wchange 0.00000089, angledelta 93.7 deg +step 435 - lrate 0.000000, wchange 0.00000066, angledelta 109.0 deg +step 436 - lrate 0.000000, wchange 0.00000087, angledelta 96.0 deg +step 437 - lrate 0.000000, wchange 0.00000065, angledelta 114.4 deg +step 438 - lrate 0.000000, wchange 0.00000057, angledelta 111.1 deg +step 439 - lrate 0.000000, wchange 0.00000051, angledelta 104.6 deg +step 440 - lrate 0.000000, wchange 0.00000040, angledelta 96.3 deg +step 441 - lrate 0.000000, wchange 0.00000043, angledelta 103.9 deg +step 442 - lrate 0.000000, wchange 0.00000040, angledelta 95.6 deg +step 443 - lrate 0.000000, wchange 0.00000044, angledelta 102.5 deg +step 444 - lrate 0.000000, wchange 0.00000033, angledelta 105.1 deg +step 445 - lrate 0.000000, wchange 0.00000032, angledelta 92.8 deg +step 446 - lrate 0.000000, wchange 0.00000039, angledelta 113.4 deg +step 447 - lrate 0.000000, wchange 0.00000037, angledelta 80.3 deg +step 448 - lrate 0.000000, wchange 0.00000021, angledelta 101.6 deg +step 449 - lrate 0.000000, wchange 0.00000030, angledelta 89.6 deg +step 450 - lrate 0.000000, wchange 0.00000023, angledelta 112.5 deg +step 451 - lrate 0.000000, wchange 0.00000023, angledelta 88.6 deg +step 452 - lrate 0.000000, wchange 0.00000016, angledelta 109.2 deg +step 453 - lrate 0.000000, wchange 0.00000017, angledelta 86.9 deg +step 454 - lrate 0.000000, wchange 0.00000016, angledelta 91.2 deg +step 455 - lrate 0.000000, wchange 0.00000019, angledelta 109.6 deg +step 456 - lrate 0.000000, wchange 0.00000017, angledelta 104.7 deg +step 457 - lrate 0.000000, wchange 0.00000011, angledelta 90.6 deg +step 458 - lrate 0.000000, wchange 0.00000011, angledelta 96.5 deg +step 459 - lrate 0.000000, wchange 0.00000009, angledelta 105.0 deg +Sorting components in descending order of mean projected variance ... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +The input dataset will be split into 6720 epochs of 1 s +Epochs will overlap by 0%. +Inserting 6720 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560.......................................6600.................... +...................6640.......................................6680.......... +.............................6720 +Sorting the event table. +Splitting the data into 6720 1.00-s epochs +pop_epoch():6720 epochs selected +Epoching... +pop_epoch():6720 epochs generated +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +Scaling components to RMS microvolt +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Scaling components to RMS microvolt +Scaling components to RMS microvolt +EEG.icaact not present. Recomputed from data. + +Features Extraction: +GDSF - General Discontinuity Spatial Feature... +SED - Spatial Eye Difference... +SAD - Spatial Average Difference... +Temporal Kurtosis... +Maximum epoch variance... +Computing EM thresholds... +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index + +par_id = + + 1x8 cell array + + Columns 1 through 6 + + {'sub-3000002'} {'all'} {'eeg'} {'s1'} {'r1'} {'e1'} + + Columns 7 through 8 + + {'filtered'} {'data - 1-s epochs'} + +. + +Artifact Identification: +Horizontal Eye Movements... +End Horizontal Eye Movement Detection +Vertical Eye Movements... +Eye Blinks... +End Blink Detection +Generic Discontinuities... + +Results in . +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Saving dataset... +Scaling components to RMS microvolt +Computing projection .... +pop_editeventfield(): creating new field 'observation' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'eventType' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'targetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'congruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'responded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'accuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'rt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'extraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidTrial' +pop-editeventfield(): updating urevent structure +Event resorted by increasing latencies. +pop_epoch():1834 epochs selected +Epoching... +pop_epoch():1834 epochs generated +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'observation' made uniform +eeg_checkset note: value format of event field 'eventType' made uniform +eeg_checkset note: value format of event field 'targetDir' made uniform +eeg_checkset note: value format of event field 'congruency' made uniform +eeg_checkset note: value format of event field 'prevTargetDir' made uniform +eeg_checkset note: value format of event field 'prevCongruency' made uniform +eeg_checkset note: value format of event field 'nextTargetDir' made uniform +eeg_checkset note: value format of event field 'nextCongruency' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +pop_rmbase(): Removing baseline... +1 channel selected +0/1834 trials marked for rejection +1 channel selected +0/1834 trials marked for rejection +1 channel selected +0/1834 trials marked for rejection +1 channel selected +0/1834 trials marked for rejection +1 channel selected +0/1834 trials marked for rejection +1 channel selected +0/1834 trials marked for rejection +0/1834 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +3/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +3/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1834 trials marked for rejection +Scaling components to RMS microvolt +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6655 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6655 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6655 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6655 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6656 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6658 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6657 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1833 trial(s)... +Pop_select: removing 6659 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +0/1834 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +0/1834 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Interpolating 2 channels... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Re-referencing data +Scaling components to RMS microvolt +Error: some channels not used for ICA decomposition are used for rereferencing + the ICA decomposition has been removed +Saving dataset... +>> \ No newline at end of file diff --git a/code/thrive_eeg/slurm-10425874.out b/code/thrive_eeg/slurm-10425874.out new file mode 100644 index 0000000..322e460 --- /dev/null +++ b/code/thrive_eeg/slurm-10425874.out @@ -0,0 +1,37848 @@ +/home/data/NDClab/datasets/thrive-dataset/code/thrive_eeg +n051.panther.net +Wed Jun 21 12:55:25 EDT 2023 + + < M A T L A B (R) > + Copyright 1984-2021 The MathWorks, Inc. + R2021b (9.11.0.1769968) 64-bit (glnxa64) + September 17, 2021 + + +To get started, type doc. +For product information, visit www.mathworks.com. + +>> >> >> >> >> >> Starting parallel pool (parpool) using the 'local' profile ... +Connected to the parallel pool (number of workers: 4). + +ans = + + ProcessPool with properties: + + Connected: true + NumWorkers: 4 + Cluster: local + AttachedFiles: {} + AutoAddClientPath: true + IdleTimeout: 30 minutes (30 minutes remaining) + SpmdEnabled: true + +>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> + + +*** Processing subject 1 (sub-3000004_all_eeg_s1_r1_e1.vhdr) *** + + +pop_loadbv(): reading header file +Done. +pop_loadbv(): reading EEG data +pop_loadbv(): scaling EEG data +pop_loadbv(): reading marker file +Done. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +eeg_checkset warning: number of columns in data (64) does not match the number of channels (63): corrected +eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed +[Warning: channel labels should not be empty, creating unique labels] +Warning: the size of the channel location structure does not match with + number of channels. Channel information have been removed. +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 39:14= - 10%, ETE 34:38= \ 15%, ETE 31:52= | 20%, ETE 29:34= / 25%, ETE 27:30= - 30%, ETE 25:38= \ 35%, ETE 23:42= | 40%, ETE 21:49= / 45%, ETE 19:58= - 50%, ETE 18:06= \ 55%, ETE 16:15= | 60%, ETE 14:25= / 65%, ETE 12:36= - 70%, ETE 10:47= \ 75%, ETE 08:58= | 80%, ETE 07:10= / 85%, ETE 05:23= - 90%, ETE 03:35= \ 95%, ETE 01:48=| 100%, ETE 00:00 +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 00:52= - 10%, ETE 00:32= \ 15%, ETE 00:25= | 20%, ETE 00:21= / 25%, ETE 00:18= - 30%, ETE 00:16= \ 35%, ETE 00:14= | 40%, ETE 00:13= / 45%, ETE 00:12= - 50%, ETE 00:10= \ 55%, ETE 00:09= | 60%, ETE 00:08= / 65%, ETE 00:07= - 70%, ETE 00:06= \ 75%, ETE 00:05= | 80%, ETE 00:04= / 85%, ETE 00:03= - 90%, ETE 00:02= \ 95%, ETE 00:01=| 100%, ETE 00:00 +Removing 3 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Saving dataset... +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 02:29= - 10%, ETE 02:11= \ 15%, ETE 02:01= | 20%, ETE 01:52= / 25%, ETE 01:45= - 30%, ETE 01:37= \ 35%, ETE 01:30= | 40%, ETE 01:23= / 45%, ETE 01:16= - 50%, ETE 01:09= \ 55%, ETE 01:02= | 60%, ETE 00:55= / 65%, ETE 00:48= - 70%, ETE 00:41= \ 75%, ETE 00:35= | 80%, ETE 00:28= / 85%, ETE 00:21= - 90%, ETE 00:14= \ 95%, ETE 00:07=| 100%, ETE 00:00 +The input dataset will be split into 4957 epochs of 1 s +Epochs will overlap by 0%. +Inserting 4957 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +................. +Sorting the event table. +Splitting the data into 4957 1.00-s epochs +pop_epoch():4957 epochs selected +Epoching... +pop_epoch():4957 epochs generated +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +4/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +4/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +6/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +1/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +1/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +2/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +10/4956 trials marked for rejection + +1 channel selected +1/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +5/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +1/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +1/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +2/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +1/4956 trials marked for rejection + +1 channel selected +1/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +2/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +1 channel selected +0/4956 trials marked for rejection + +1 channel selected +0/4956 trials marked for rejection +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +60 channel selected +12/4956 trials marked for rejection + +60 channel selected +22/4956 trials marked for rejection +30/4956 trials rejected +Removing 30 trial(s)... +Pop_select: removing 70 unreferenced events +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform + +Attempting to convert data matrix to double precision for more accurate ICA results. + +Input data size [60,4926000] = 60 channels, 4926000 frames/nFinding 60 ICA components using extended ICA. +Kurtosis will be calculated initially every 1 blocks using 6000 data points. +Decomposing 1368 frames per ICA weight ((3600)^2 = 4926000 weights, Initial learning rate will be 0.001, block size 78. +Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg. +Training will end when wchange < 1e-07 or after 512 steps. +Online bias adjustment will be used. +Removing mean of each channel ... +Final training data range: -960.291 to 852.487 +Computing the sphering matrix... +Starting weights are the identity matrix ... +Sphering the data ... +Beginning ICA training ... first training step may be slow ... +IdleTimeout has been reached. +Parallel pool using the 'local' profile is shutting down. +Lowering learning rate to 0.0009 and starting again. +Lowering learning rate to 0.00081 and starting again. +Lowering learning rate to 0.000729 and starting again. +Lowering learning rate to 0.0006561 and starting again. +Lowering learning rate to 0.00059049 and starting again. +Lowering learning rate to 0.000531441 and starting again. +Lowering learning rate to 0.000478297 and starting again. +Lowering learning rate to 0.000430467 and starting again. +Lowering learning rate to 0.00038742 and starting again. +Lowering learning rate to 0.000348678 and starting again. +Lowering learning rate to 0.000313811 and starting again. +Lowering learning rate to 0.00028243 and starting again. +Lowering learning rate to 0.000254187 and starting again. +Lowering learning rate to 0.000228768 and starting again. +Lowering learning rate to 0.000205891 and starting again. +step 1 - lrate 0.000206, wchange 30.80814723, angledelta 0.0 deg +step 2 - lrate 0.000206, wchange 3.70548819, angledelta 0.0 deg +step 3 - lrate 0.000206, wchange 2.32576617, angledelta 86.7 deg +step 4 - lrate 0.000202, wchange 1.68316459, angledelta 123.2 deg +step 5 - lrate 0.000198, wchange 1.58838319, angledelta 110.1 deg +step 6 - lrate 0.000194, wchange 0.46677774, angledelta 129.9 deg +step 7 - lrate 0.000190, wchange 0.90211372, angledelta 119.2 deg +step 8 - lrate 0.000186, wchange 0.92085317, angledelta 94.0 deg +step 9 - lrate 0.000182, wchange 2.99612587, angledelta 115.7 deg +step 10 - lrate 0.000179, wchange 0.70978986, angledelta 122.3 deg +step 11 - lrate 0.000175, wchange 1.55565256, angledelta 113.5 deg +step 12 - lrate 0.000172, wchange 0.98675882, angledelta 124.5 deg +step 13 - lrate 0.000168, wchange 2.32092019, angledelta 133.3 deg +step 14 - lrate 0.000165, wchange 2.55059859, angledelta 140.2 deg +step 15 - lrate 0.000162, wchange 0.91430285, angledelta 123.2 deg +step 16 - lrate 0.000158, wchange 1.07554655, angledelta 92.9 deg +step 17 - lrate 0.000155, wchange 1.15427119, angledelta 129.5 deg +step 18 - lrate 0.000152, wchange 0.85052135, angledelta 108.5 deg +step 19 - lrate 0.000149, wchange 1.97607596, angledelta 102.1 deg +step 20 - lrate 0.000146, wchange 0.84480577, angledelta 128.3 deg +step 21 - lrate 0.000143, wchange 1.29764529, angledelta 109.1 deg +step 22 - lrate 0.000140, wchange 2.25940083, angledelta 129.4 deg +step 23 - lrate 0.000137, wchange 1.07660361, angledelta 131.6 deg +step 24 - lrate 0.000135, wchange 0.54077702, angledelta 146.1 deg +step 25 - lrate 0.000132, wchange 0.46848246, angledelta 122.3 deg +step 26 - lrate 0.000129, wchange 0.51629792, angledelta 120.6 deg +step 27 - lrate 0.000127, wchange 0.55846017, angledelta 146.7 deg +step 28 - lrate 0.000124, wchange 0.23120754, angledelta 124.0 deg +step 29 - lrate 0.000122, wchange 0.13079599, angledelta 129.4 deg +step 30 - lrate 0.000119, wchange 0.14240039, angledelta 119.8 deg +step 31 - lrate 0.000117, wchange 0.25514826, angledelta 124.8 deg +step 32 - lrate 0.000115, wchange 1.17863076, angledelta 125.7 deg +step 33 - lrate 0.000112, wchange 0.93643083, angledelta 126.9 deg +step 34 - lrate 0.000110, wchange 0.38365816, angledelta 101.8 deg +step 35 - lrate 0.000108, wchange 0.47613111, angledelta 145.7 deg +step 36 - lrate 0.000106, wchange 0.16716696, angledelta 77.0 deg +step 37 - lrate 0.000104, wchange 0.91007013, angledelta 115.7 deg +step 38 - lrate 0.000102, wchange 0.12614302, angledelta 84.8 deg +step 39 - lrate 0.000099, wchange 1.87307214, angledelta 80.1 deg +step 40 - lrate 0.000097, wchange 0.25136867, angledelta 133.6 deg +step 41 - lrate 0.000096, wchange 0.14627087, angledelta 137.1 deg +step 42 - lrate 0.000094, wchange 0.96360476, angledelta 120.7 deg +step 43 - lrate 0.000092, wchange 0.19077689, angledelta 127.2 deg +step 44 - lrate 0.000090, wchange 1.69617988, angledelta 90.9 deg +step 45 - lrate 0.000088, wchange 1.38039719, angledelta 137.9 deg +step 46 - lrate 0.000086, wchange 1.18324752, angledelta 165.0 deg +step 47 - lrate 0.000085, wchange 0.22715441, angledelta 129.0 deg +step 48 - lrate 0.000083, wchange 0.16392143, angledelta 129.0 deg +step 49 - lrate 0.000081, wchange 0.15031634, angledelta 114.4 deg +step 50 - lrate 0.000080, wchange 0.10478592, angledelta 107.6 deg +step 51 - lrate 0.000078, wchange 0.09090771, angledelta 114.6 deg +step 52 - lrate 0.000077, wchange 0.07786575, angledelta 116.1 deg +step 53 - lrate 0.000075, wchange 0.11240305, angledelta 112.3 deg +step 54 - lrate 0.000073, wchange 0.07292503, angledelta 119.4 deg +step 55 - lrate 0.000072, wchange 0.08313142, angledelta 104.4 deg +step 56 - lrate 0.000071, wchange 0.08988493, angledelta 119.7 deg +step 57 - lrate 0.000069, wchange 0.07821480, angledelta 124.5 deg +step 58 - lrate 0.000068, wchange 0.08213861, angledelta 116.2 deg +step 59 - lrate 0.000066, wchange 0.10104840, angledelta 125.4 deg +step 60 - lrate 0.000065, wchange 0.06399379, angledelta 120.0 deg +step 61 - lrate 0.000064, wchange 0.08050623, angledelta 108.3 deg +step 62 - lrate 0.000063, wchange 0.10516656, angledelta 135.1 deg +step 63 - lrate 0.000061, wchange 0.05587061, angledelta 115.9 deg +step 64 - lrate 0.000060, wchange 0.06807601, angledelta 119.2 deg +step 65 - lrate 0.000059, wchange 0.07978529, angledelta 124.3 deg +step 66 - lrate 0.000058, wchange 0.09105342, angledelta 127.8 deg +step 67 - lrate 0.000057, wchange 0.06000092, angledelta 120.2 deg +step 68 - lrate 0.000055, wchange 0.06783669, angledelta 104.2 deg +step 69 - lrate 0.000054, wchange 0.06096365, angledelta 124.2 deg +step 70 - lrate 0.000053, wchange 0.04919963, angledelta 107.8 deg +step 71 - lrate 0.000052, wchange 0.05718867, angledelta 122.2 deg +step 72 - lrate 0.000051, wchange 0.07413616, angledelta 128.3 deg +step 73 - lrate 0.000050, wchange 0.04717587, angledelta 101.0 deg +step 74 - lrate 0.000049, wchange 0.13216525, angledelta 122.7 deg +step 75 - lrate 0.000048, wchange 0.04632193, angledelta 108.7 deg +step 76 - lrate 0.000047, wchange 0.04542119, angledelta 117.6 deg +step 77 - lrate 0.000046, wchange 0.08811137, angledelta 101.1 deg +step 78 - lrate 0.000045, wchange 0.05512856, angledelta 132.3 deg +step 79 - lrate 0.000044, wchange 0.06056173, angledelta 109.6 deg +step 80 - lrate 0.000043, wchange 0.05522590, angledelta 125.6 deg +step 81 - lrate 0.000043, wchange 0.05173387, angledelta 131.8 deg +step 82 - lrate 0.000042, wchange 0.07764018, angledelta 120.5 deg +step 83 - lrate 0.000041, wchange 0.06190825, angledelta 139.4 deg +step 84 - lrate 0.000040, wchange 0.04369928, angledelta 119.0 deg +step 85 - lrate 0.000039, wchange 0.03851601, angledelta 118.0 deg +step 86 - lrate 0.000038, wchange 0.04865124, angledelta 114.3 deg +step 87 - lrate 0.000038, wchange 0.04148084, angledelta 117.8 deg +step 88 - lrate 0.000037, wchange 0.04456470, angledelta 110.8 deg +step 89 - lrate 0.000036, wchange 0.06528009, angledelta 132.7 deg +step 90 - lrate 0.000036, wchange 0.03963211, angledelta 117.0 deg +step 91 - lrate 0.000035, wchange 0.02945109, angledelta 116.2 deg +step 92 - lrate 0.000034, wchange 0.02730325, angledelta 113.5 deg +step 93 - lrate 0.000033, wchange 0.03256625, angledelta 112.2 deg +step 94 - lrate 0.000033, wchange 0.04058792, angledelta 126.1 deg +step 95 - lrate 0.000032, wchange 0.03293865, angledelta 125.3 deg +step 96 - lrate 0.000031, wchange 0.02969307, angledelta 119.9 deg +step 97 - lrate 0.000031, wchange 0.02948972, angledelta 116.4 deg +step 98 - lrate 0.000030, wchange 0.03779468, angledelta 108.7 deg +step 99 - lrate 0.000030, wchange 0.04071023, angledelta 131.9 deg +step 100 - lrate 0.000029, wchange 0.02958770, angledelta 102.9 deg +step 101 - lrate 0.000028, wchange 0.02792782, angledelta 111.6 deg +step 102 - lrate 0.000028, wchange 0.04563291, angledelta 98.2 deg +step 103 - lrate 0.000027, wchange 0.05249048, angledelta 140.5 deg +step 104 - lrate 0.000027, wchange 0.04976408, angledelta 142.9 deg +step 105 - lrate 0.000026, wchange 0.02995035, angledelta 137.5 deg +step 106 - lrate 0.000026, wchange 0.02247670, angledelta 112.0 deg +step 107 - lrate 0.000025, wchange 0.02811109, angledelta 122.4 deg +step 108 - lrate 0.000025, wchange 0.06618102, angledelta 128.5 deg +step 109 - lrate 0.000024, wchange 0.06410515, angledelta 144.7 deg +step 110 - lrate 0.000024, wchange 0.03975787, angledelta 137.6 deg +step 111 - lrate 0.000023, wchange 0.01776190, angledelta 120.1 deg +step 112 - lrate 0.000023, wchange 0.02948355, angledelta 102.7 deg +step 113 - lrate 0.000022, wchange 0.02862352, angledelta 128.6 deg +step 114 - lrate 0.000022, wchange 0.02166932, angledelta 115.3 deg +step 115 - lrate 0.000021, wchange 0.02233751, angledelta 117.7 deg +step 116 - lrate 0.000021, wchange 0.02213141, angledelta 123.5 deg +step 117 - lrate 0.000021, wchange 0.02420620, angledelta 131.0 deg +step 118 - lrate 0.000020, wchange 0.02505668, angledelta 128.0 deg +step 119 - lrate 0.000020, wchange 0.02171485, angledelta 98.9 deg +step 120 - lrate 0.000019, wchange 0.02005044, angledelta 121.7 deg +step 121 - lrate 0.000019, wchange 0.01967504, angledelta 124.7 deg +step 122 - lrate 0.000019, wchange 0.02804071, angledelta 127.6 deg +step 123 - lrate 0.000018, wchange 0.01794441, angledelta 124.1 deg +step 124 - lrate 0.000018, wchange 0.02749891, angledelta 132.3 deg +step 125 - lrate 0.000018, wchange 0.03510375, angledelta 138.6 deg +step 126 - lrate 0.000017, wchange 0.03892009, angledelta 134.3 deg +step 127 - lrate 0.000017, wchange 0.02023945, angledelta 117.9 deg +step 128 - lrate 0.000016, wchange 0.01745964, angledelta 121.1 deg +step 129 - lrate 0.000016, wchange 0.01426755, angledelta 111.7 deg +step 130 - lrate 0.000016, wchange 0.01497603, angledelta 117.4 deg +step 131 - lrate 0.000016, wchange 0.01595522, angledelta 112.0 deg +step 132 - lrate 0.000015, wchange 0.01605156, angledelta 126.7 deg +step 133 - lrate 0.000015, wchange 0.01594716, angledelta 103.5 deg +step 134 - lrate 0.000015, wchange 0.02034672, angledelta 125.2 deg +step 135 - lrate 0.000014, wchange 0.01641981, angledelta 127.8 deg +step 136 - lrate 0.000014, wchange 0.01494149, angledelta 123.1 deg +step 137 - lrate 0.000014, wchange 0.01625523, angledelta 131.3 deg +step 138 - lrate 0.000013, wchange 0.02257198, angledelta 130.4 deg +step 139 - lrate 0.000013, wchange 0.01469135, angledelta 133.8 deg +step 140 - lrate 0.000013, wchange 0.00985077, angledelta 108.5 deg +step 141 - lrate 0.000013, wchange 0.02399991, angledelta 118.3 deg +step 142 - lrate 0.000012, wchange 0.01716365, angledelta 121.1 deg +step 143 - lrate 0.000012, wchange 0.01885403, angledelta 108.6 deg +step 144 - lrate 0.000012, wchange 0.00869873, angledelta 117.7 deg +step 145 - lrate 0.000012, wchange 0.00896471, angledelta 121.5 deg +step 146 - lrate 0.000011, wchange 0.01108751, angledelta 127.6 deg +step 147 - lrate 0.000011, wchange 0.00924886, angledelta 122.9 deg +step 148 - lrate 0.000011, wchange 0.00939706, angledelta 118.3 deg +step 149 - lrate 0.000011, wchange 0.01170523, angledelta 124.4 deg +step 150 - lrate 0.000011, wchange 0.01080084, angledelta 125.8 deg +step 151 - lrate 0.000010, wchange 0.01038283, angledelta 122.5 deg +step 152 - lrate 0.000010, wchange 0.00894356, angledelta 126.2 deg +step 153 - lrate 0.000010, wchange 0.00904005, angledelta 114.5 deg +step 154 - lrate 0.000010, wchange 0.01408306, angledelta 126.6 deg +step 155 - lrate 0.000010, wchange 0.02101765, angledelta 127.5 deg +step 156 - lrate 0.000009, wchange 0.02542629, angledelta 140.4 deg +step 157 - lrate 0.000009, wchange 0.01403212, angledelta 142.9 deg +step 158 - lrate 0.000009, wchange 0.00939915, angledelta 125.3 deg +step 159 - lrate 0.000009, wchange 0.00681237, angledelta 120.3 deg +step 160 - lrate 0.000009, wchange 0.00839442, angledelta 111.8 deg +step 161 - lrate 0.000008, wchange 0.01021726, angledelta 134.2 deg +step 162 - lrate 0.000008, wchange 0.02167519, angledelta 127.0 deg +step 163 - lrate 0.000008, wchange 0.01060283, angledelta 139.5 deg +step 164 - lrate 0.000008, wchange 0.01314791, angledelta 81.5 deg +step 165 - lrate 0.000008, wchange 0.01777233, angledelta 139.1 deg +step 166 - lrate 0.000008, wchange 0.00848807, angledelta 131.6 deg +step 167 - lrate 0.000007, wchange 0.00994296, angledelta 118.9 deg +step 168 - lrate 0.000007, wchange 0.01010913, angledelta 136.1 deg +step 169 - lrate 0.000007, wchange 0.00675444, angledelta 102.1 deg +step 170 - lrate 0.000007, wchange 0.00561669, angledelta 128.4 deg +step 171 - lrate 0.000007, wchange 0.00613579, angledelta 101.2 deg +step 172 - lrate 0.000007, wchange 0.00870721, angledelta 124.2 deg +step 173 - lrate 0.000007, wchange 0.00900501, angledelta 126.7 deg +step 174 - lrate 0.000007, wchange 0.00666059, angledelta 126.1 deg +step 175 - lrate 0.000006, wchange 0.00576543, angledelta 125.4 deg +step 176 - lrate 0.000006, wchange 0.00509362, angledelta 123.1 deg +step 177 - lrate 0.000006, wchange 0.00810583, angledelta 108.0 deg +step 178 - lrate 0.000006, wchange 0.00656149, angledelta 130.1 deg +step 179 - lrate 0.000006, wchange 0.00522178, angledelta 108.0 deg +step 180 - lrate 0.000006, wchange 0.00569928, angledelta 119.4 deg +step 181 - lrate 0.000006, wchange 0.00473645, angledelta 107.6 deg +step 182 - lrate 0.000006, wchange 0.00557544, angledelta 125.0 deg +step 183 - lrate 0.000005, wchange 0.00460012, angledelta 113.3 deg +step 184 - lrate 0.000005, wchange 0.00451580, angledelta 120.8 deg +step 185 - lrate 0.000005, wchange 0.00457319, angledelta 117.6 deg +step 186 - lrate 0.000005, wchange 0.00311344, angledelta 113.9 deg +step 187 - lrate 0.000005, wchange 0.00398967, angledelta 111.4 deg +step 188 - lrate 0.000005, wchange 0.00537731, angledelta 119.9 deg +step 189 - lrate 0.000005, wchange 0.00675778, angledelta 126.6 deg +step 190 - lrate 0.000005, wchange 0.00459384, angledelta 124.0 deg +step 191 - lrate 0.000005, wchange 0.00352274, angledelta 108.6 deg +step 192 - lrate 0.000005, wchange 0.00862110, angledelta 123.5 deg +step 193 - lrate 0.000004, wchange 0.00713093, angledelta 136.7 deg +step 194 - lrate 0.000004, wchange 0.00635031, angledelta 135.3 deg +step 195 - lrate 0.000004, wchange 0.00389846, angledelta 111.4 deg +step 196 - lrate 0.000004, wchange 0.00465194, angledelta 115.4 deg +step 197 - lrate 0.000004, wchange 0.00366931, angledelta 99.9 deg +step 198 - lrate 0.000004, wchange 0.00522307, angledelta 126.7 deg +step 199 - lrate 0.000004, wchange 0.00376398, angledelta 131.5 deg +step 200 - lrate 0.000004, wchange 0.00412188, angledelta 124.9 deg +step 201 - lrate 0.000004, wchange 0.00280126, angledelta 123.9 deg +step 202 - lrate 0.000004, wchange 0.00380670, angledelta 112.0 deg +step 203 - lrate 0.000004, wchange 0.00423441, angledelta 122.4 deg +step 204 - lrate 0.000004, wchange 0.00250942, angledelta 118.3 deg +step 205 - lrate 0.000003, wchange 0.00331657, angledelta 107.8 deg +step 206 - lrate 0.000003, wchange 0.00326193, angledelta 130.4 deg +step 207 - lrate 0.000003, wchange 0.00320380, angledelta 130.5 deg +step 208 - lrate 0.000003, wchange 0.00508803, angledelta 132.4 deg +step 209 - lrate 0.000003, wchange 0.00339316, angledelta 127.8 deg +step 210 - lrate 0.000003, wchange 0.00221130, angledelta 112.3 deg +step 211 - lrate 0.000003, wchange 0.00242166, angledelta 118.0 deg +step 212 - lrate 0.000003, wchange 0.00265393, angledelta 125.4 deg +step 213 - lrate 0.000003, wchange 0.00341485, angledelta 117.4 deg +step 214 - lrate 0.000003, wchange 0.00609851, angledelta 112.7 deg +step 215 - lrate 0.000003, wchange 0.00489809, angledelta 141.7 deg +step 216 - lrate 0.000003, wchange 0.00277988, angledelta 115.1 deg +step 217 - lrate 0.000003, wchange 0.00433837, angledelta 132.9 deg +step 218 - lrate 0.000003, wchange 0.00326861, angledelta 132.7 deg +step 219 - lrate 0.000003, wchange 0.00204298, angledelta 108.3 deg +step 220 - lrate 0.000003, wchange 0.00200568, angledelta 112.8 deg +step 221 - lrate 0.000003, wchange 0.00195645, angledelta 124.1 deg +step 222 - lrate 0.000002, wchange 0.00175525, angledelta 111.2 deg +step 223 - lrate 0.000002, wchange 0.00186674, angledelta 107.1 deg +step 224 - lrate 0.000002, wchange 0.00190049, angledelta 114.4 deg +step 225 - lrate 0.000002, wchange 0.00237562, angledelta 114.7 deg +step 226 - lrate 0.000002, wchange 0.00208747, angledelta 134.9 deg +step 227 - lrate 0.000002, wchange 0.00161245, angledelta 115.1 deg +step 228 - lrate 0.000002, wchange 0.00142678, angledelta 123.8 deg +step 229 - lrate 0.000002, wchange 0.00144014, angledelta 111.4 deg +step 230 - lrate 0.000002, wchange 0.00182523, angledelta 122.6 deg +step 231 - lrate 0.000002, wchange 0.00144302, angledelta 106.8 deg +step 232 - lrate 0.000002, wchange 0.00172335, angledelta 127.8 deg +step 233 - lrate 0.000002, wchange 0.00193350, angledelta 116.0 deg +step 234 - lrate 0.000002, wchange 0.00229978, angledelta 132.7 deg +step 235 - lrate 0.000002, wchange 0.00158053, angledelta 109.6 deg +step 236 - lrate 0.000002, wchange 0.00154165, angledelta 115.0 deg +step 237 - lrate 0.000002, wchange 0.00131760, angledelta 122.3 deg +step 238 - lrate 0.000002, wchange 0.00123837, angledelta 113.1 deg +step 239 - lrate 0.000002, wchange 0.00178390, angledelta 127.9 deg +step 240 - lrate 0.000002, wchange 0.00192791, angledelta 135.2 deg +step 241 - lrate 0.000002, wchange 0.00153946, angledelta 136.5 deg +step 242 - lrate 0.000002, wchange 0.00138187, angledelta 126.3 deg +step 243 - lrate 0.000002, wchange 0.00149915, angledelta 124.7 deg +step 244 - lrate 0.000002, wchange 0.00102564, angledelta 118.5 deg +step 245 - lrate 0.000002, wchange 0.00119434, angledelta 119.1 deg +step 246 - lrate 0.000002, wchange 0.00129809, angledelta 113.3 deg +step 247 - lrate 0.000001, wchange 0.00111910, angledelta 112.2 deg +step 248 - lrate 0.000001, wchange 0.00160069, angledelta 122.4 deg +step 249 - lrate 0.000001, wchange 0.00085550, angledelta 114.1 deg +step 250 - lrate 0.000001, wchange 0.00113421, angledelta 117.2 deg +step 251 - lrate 0.000001, wchange 0.00118795, angledelta 126.5 deg +step 252 - lrate 0.000001, wchange 0.00119207, angledelta 121.8 deg +step 253 - lrate 0.000001, wchange 0.00087290, angledelta 124.4 deg +step 254 - lrate 0.000001, wchange 0.00125495, angledelta 120.1 deg +step 255 - lrate 0.000001, wchange 0.00078762, angledelta 133.2 deg +step 256 - lrate 0.000001, wchange 0.00070360, angledelta 109.5 deg +step 257 - lrate 0.000001, wchange 0.00092144, angledelta 115.8 deg +step 258 - lrate 0.000001, wchange 0.00114284, angledelta 117.4 deg +step 259 - lrate 0.000001, wchange 0.00107585, angledelta 126.4 deg +step 260 - lrate 0.000001, wchange 0.00069706, angledelta 117.6 deg +step 261 - lrate 0.000001, wchange 0.00084660, angledelta 115.1 deg +step 262 - lrate 0.000001, wchange 0.00114903, angledelta 133.4 deg +step 263 - lrate 0.000001, wchange 0.00097102, angledelta 125.1 deg +step 264 - lrate 0.000001, wchange 0.00078084, angledelta 129.3 deg +step 265 - lrate 0.000001, wchange 0.00060899, angledelta 107.6 deg +step 266 - lrate 0.000001, wchange 0.00136893, angledelta 113.8 deg +step 267 - lrate 0.000001, wchange 0.00118661, angledelta 135.8 deg +step 268 - lrate 0.000001, wchange 0.00082353, angledelta 132.5 deg +step 269 - lrate 0.000001, wchange 0.00059444, angledelta 121.9 deg +step 270 - lrate 0.000001, wchange 0.00064804, angledelta 100.6 deg +step 271 - lrate 0.000001, wchange 0.00063264, angledelta 123.6 deg +step 272 - lrate 0.000001, wchange 0.00068744, angledelta 127.4 deg +step 273 - lrate 0.000001, wchange 0.00090480, angledelta 131.2 deg +step 274 - lrate 0.000001, wchange 0.00074017, angledelta 125.9 deg +step 275 - lrate 0.000001, wchange 0.00072284, angledelta 131.5 deg +step 276 - lrate 0.000001, wchange 0.00060709, angledelta 116.6 deg +step 277 - lrate 0.000001, wchange 0.00074472, angledelta 125.0 deg +step 278 - lrate 0.000001, wchange 0.00048088, angledelta 112.5 deg +step 279 - lrate 0.000001, wchange 0.00039810, angledelta 117.5 deg +step 280 - lrate 0.000001, wchange 0.00038864, angledelta 124.6 deg +step 281 - lrate 0.000001, wchange 0.00046165, angledelta 113.8 deg +step 282 - lrate 0.000001, wchange 0.00048099, angledelta 110.2 deg +step 283 - lrate 0.000001, wchange 0.00066279, angledelta 126.9 deg +step 284 - lrate 0.000001, wchange 0.00039730, angledelta 111.0 deg +step 285 - lrate 0.000001, wchange 0.00036939, angledelta 110.0 deg +step 286 - lrate 0.000001, wchange 0.00043141, angledelta 115.5 deg +step 287 - lrate 0.000001, wchange 0.00044077, angledelta 123.4 deg +step 288 - lrate 0.000001, wchange 0.00091645, angledelta 124.5 deg +step 289 - lrate 0.000001, wchange 0.00052903, angledelta 125.6 deg +step 290 - lrate 0.000001, wchange 0.00036186, angledelta 98.5 deg +step 291 - lrate 0.000001, wchange 0.00034415, angledelta 105.3 deg +step 292 - lrate 0.000001, wchange 0.00042228, angledelta 117.8 deg +step 293 - lrate 0.000001, wchange 0.00048236, angledelta 119.7 deg +step 294 - lrate 0.000001, wchange 0.00032787, angledelta 101.4 deg +step 295 - lrate 0.000001, wchange 0.00036576, angledelta 121.4 deg +step 296 - lrate 0.000001, wchange 0.00024179, angledelta 115.3 deg +step 297 - lrate 0.000001, wchange 0.00019357, angledelta 114.6 deg +step 298 - lrate 0.000001, wchange 0.00031643, angledelta 114.1 deg +step 299 - lrate 0.000001, wchange 0.00040837, angledelta 124.2 deg +step 300 - lrate 0.000001, wchange 0.00030238, angledelta 129.9 deg +step 301 - lrate 0.000001, wchange 0.00025028, angledelta 115.7 deg +step 302 - lrate 0.000000, wchange 0.00037850, angledelta 122.4 deg +step 303 - lrate 0.000000, wchange 0.00038631, angledelta 110.6 deg +step 304 - lrate 0.000000, wchange 0.00023982, angledelta 109.8 deg +step 305 - lrate 0.000000, wchange 0.00020578, angledelta 119.0 deg +step 306 - lrate 0.000000, wchange 0.00047631, angledelta 111.4 deg +step 307 - lrate 0.000000, wchange 0.00023290, angledelta 129.1 deg +step 308 - lrate 0.000000, wchange 0.00018598, angledelta 116.0 deg +step 309 - lrate 0.000000, wchange 0.00016766, angledelta 117.2 deg +step 310 - lrate 0.000000, wchange 0.00022030, angledelta 116.8 deg +step 311 - lrate 0.000000, wchange 0.00022787, angledelta 120.1 deg +step 312 - lrate 0.000000, wchange 0.00022759, angledelta 128.0 deg +step 313 - lrate 0.000000, wchange 0.00016313, angledelta 106.4 deg +step 314 - lrate 0.000000, wchange 0.00017933, angledelta 119.1 deg +step 315 - lrate 0.000000, wchange 0.00013452, angledelta 116.7 deg +step 316 - lrate 0.000000, wchange 0.00015837, angledelta 108.8 deg +step 317 - lrate 0.000000, wchange 0.00015198, angledelta 120.1 deg +step 318 - lrate 0.000000, wchange 0.00018337, angledelta 94.5 deg +step 319 - lrate 0.000000, wchange 0.00036592, angledelta 127.0 deg +step 320 - lrate 0.000000, wchange 0.00022469, angledelta 130.3 deg +step 321 - lrate 0.000000, wchange 0.00014406, angledelta 120.7 deg +step 322 - lrate 0.000000, wchange 0.00015301, angledelta 113.3 deg +step 323 - lrate 0.000000, wchange 0.00022264, angledelta 137.9 deg +step 324 - lrate 0.000000, wchange 0.00012124, angledelta 119.5 deg +step 325 - lrate 0.000000, wchange 0.00011974, angledelta 113.3 deg +step 326 - lrate 0.000000, wchange 0.00009065, angledelta 118.0 deg +step 327 - lrate 0.000000, wchange 0.00012692, angledelta 108.8 deg +step 328 - lrate 0.000000, wchange 0.00017519, angledelta 117.4 deg +step 329 - lrate 0.000000, wchange 0.00010607, angledelta 126.7 deg +step 330 - lrate 0.000000, wchange 0.00009633, angledelta 118.4 deg +step 331 - lrate 0.000000, wchange 0.00007974, angledelta 95.2 deg +step 332 - lrate 0.000000, wchange 0.00007343, angledelta 118.5 deg +step 333 - lrate 0.000000, wchange 0.00007071, angledelta 114.5 deg +step 334 - lrate 0.000000, wchange 0.00007344, angledelta 118.0 deg +step 335 - lrate 0.000000, wchange 0.00008314, angledelta 105.5 deg +step 336 - lrate 0.000000, wchange 0.00004712, angledelta 123.5 deg +step 337 - lrate 0.000000, wchange 0.00004365, angledelta 111.8 deg +step 338 - lrate 0.000000, wchange 0.00004110, angledelta 117.5 deg +step 339 - lrate 0.000000, wchange 0.00004538, angledelta 112.5 deg +step 340 - lrate 0.000000, wchange 0.00005637, angledelta 113.2 deg +step 341 - lrate 0.000000, wchange 0.00006555, angledelta 104.0 deg +step 342 - lrate 0.000000, wchange 0.00004395, angledelta 123.5 deg +step 343 - lrate 0.000000, wchange 0.00004395, angledelta 106.7 deg +step 344 - lrate 0.000000, wchange 0.00004567, angledelta 119.3 deg +step 345 - lrate 0.000000, wchange 0.00003773, angledelta 110.3 deg +step 346 - lrate 0.000000, wchange 0.00002975, angledelta 119.2 deg +step 347 - lrate 0.000000, wchange 0.00003833, angledelta 108.8 deg +step 348 - lrate 0.000000, wchange 0.00003390, angledelta 100.6 deg +step 349 - lrate 0.000000, wchange 0.00002833, angledelta 116.7 deg +step 350 - lrate 0.000000, wchange 0.00002275, angledelta 108.5 deg +step 351 - lrate 0.000000, wchange 0.00002239, angledelta 101.3 deg +step 352 - lrate 0.000000, wchange 0.00003634, angledelta 119.5 deg +step 353 - lrate 0.000000, wchange 0.00002148, angledelta 114.3 deg +step 354 - lrate 0.000000, wchange 0.00001880, angledelta 108.2 deg +step 355 - lrate 0.000000, wchange 0.00002253, angledelta 114.5 deg +step 356 - lrate 0.000000, wchange 0.00002384, angledelta 106.5 deg +step 357 - lrate 0.000000, wchange 0.00001924, angledelta 114.8 deg +step 358 - lrate 0.000000, wchange 0.00002438, angledelta 108.4 deg +step 359 - lrate 0.000000, wchange 0.00001833, angledelta 126.5 deg +step 360 - lrate 0.000000, wchange 0.00001564, angledelta 96.6 deg +step 361 - lrate 0.000000, wchange 0.00001763, angledelta 116.0 deg +step 362 - lrate 0.000000, wchange 0.00001746, angledelta 80.3 deg +step 363 - lrate 0.000000, wchange 0.00002731, angledelta 124.3 deg +step 364 - lrate 0.000000, wchange 0.00002403, angledelta 137.1 deg +step 365 - lrate 0.000000, wchange 0.00001835, angledelta 107.0 deg +step 366 - lrate 0.000000, wchange 0.00002080, angledelta 120.6 deg +step 367 - lrate 0.000000, wchange 0.00000955, angledelta 98.1 deg +step 368 - lrate 0.000000, wchange 0.00001407, angledelta 113.8 deg +step 369 - lrate 0.000000, wchange 0.00001052, angledelta 123.5 deg +step 370 - lrate 0.000000, wchange 0.00000811, angledelta 117.6 deg +step 371 - lrate 0.000000, wchange 0.00000735, angledelta 109.5 deg +step 372 - lrate 0.000000, wchange 0.00001484, angledelta 100.6 deg +step 373 - lrate 0.000000, wchange 0.00001487, angledelta 138.3 deg +step 374 - lrate 0.000000, wchange 0.00000644, angledelta 99.9 deg +step 375 - lrate 0.000000, wchange 0.00000760, angledelta 100.7 deg +step 376 - lrate 0.000000, wchange 0.00000658, angledelta 119.6 deg +step 377 - lrate 0.000000, wchange 0.00000482, angledelta 102.3 deg +step 378 - lrate 0.000000, wchange 0.00000662, angledelta 110.8 deg +step 379 - lrate 0.000000, wchange 0.00000460, angledelta 105.5 deg +step 380 - lrate 0.000000, wchange 0.00000645, angledelta 109.5 deg +step 381 - lrate 0.000000, wchange 0.00000345, angledelta 93.4 deg +step 382 - lrate 0.000000, wchange 0.00000837, angledelta 101.0 deg +step 383 - lrate 0.000000, wchange 0.00000344, angledelta 116.4 deg +step 384 - lrate 0.000000, wchange 0.00000486, angledelta 95.1 deg +step 385 - lrate 0.000000, wchange 0.00000375, angledelta 105.3 deg +step 386 - lrate 0.000000, wchange 0.00000394, angledelta 117.9 deg +step 387 - lrate 0.000000, wchange 0.00000463, angledelta 114.9 deg +step 388 - lrate 0.000000, wchange 0.00000249, angledelta 108.8 deg +step 389 - lrate 0.000000, wchange 0.00000184, angledelta 108.5 deg +step 390 - lrate 0.000000, wchange 0.00000189, angledelta 114.5 deg +step 391 - lrate 0.000000, wchange 0.00000191, angledelta 90.9 deg +step 392 - lrate 0.000000, wchange 0.00000157, angledelta 109.2 deg +step 393 - lrate 0.000000, wchange 0.00000413, angledelta 86.2 deg +step 394 - lrate 0.000000, wchange 0.00000218, angledelta 126.1 deg +step 395 - lrate 0.000000, wchange 0.00000152, angledelta 110.0 deg +step 396 - lrate 0.000000, wchange 0.00000130, angledelta 105.8 deg +step 397 - lrate 0.000000, wchange 0.00000148, angledelta 107.8 deg +step 398 - lrate 0.000000, wchange 0.00000162, angledelta 120.1 deg +step 399 - lrate 0.000000, wchange 0.00000094, angledelta 110.0 deg +step 400 - lrate 0.000000, wchange 0.00000118, angledelta 99.8 deg +step 401 - lrate 0.000000, wchange 0.00000099, angledelta 112.0 deg +step 402 - lrate 0.000000, wchange 0.00000093, angledelta 98.1 deg +step 403 - lrate 0.000000, wchange 0.00000101, angledelta 117.9 deg +step 404 - lrate 0.000000, wchange 0.00000067, angledelta 102.1 deg +step 405 - lrate 0.000000, wchange 0.00000070, angledelta 105.7 deg +step 406 - lrate 0.000000, wchange 0.00000064, angledelta 101.2 deg +step 407 - lrate 0.000000, wchange 0.00000092, angledelta 99.7 deg +step 408 - lrate 0.000000, wchange 0.00000046, angledelta 94.7 deg +step 409 - lrate 0.000000, wchange 0.00000053, angledelta 100.4 deg +step 410 - lrate 0.000000, wchange 0.00000043, angledelta 101.7 deg +step 411 - lrate 0.000000, wchange 0.00000052, angledelta 109.2 deg +step 412 - lrate 0.000000, wchange 0.00000046, angledelta 103.0 deg +step 413 - lrate 0.000000, wchange 0.00000051, angledelta 106.2 deg +step 414 - lrate 0.000000, wchange 0.00000035, angledelta 100.4 deg +step 415 - lrate 0.000000, wchange 0.00000034, angledelta 93.3 deg +step 416 - lrate 0.000000, wchange 0.00000049, angledelta 112.1 deg +step 417 - lrate 0.000000, wchange 0.00000038, angledelta 85.2 deg +step 418 - lrate 0.000000, wchange 0.00000029, angledelta 108.4 deg +step 419 - lrate 0.000000, wchange 0.00000029, angledelta 101.6 deg +step 420 - lrate 0.000000, wchange 0.00000026, angledelta 101.9 deg +step 421 - lrate 0.000000, wchange 0.00000029, angledelta 108.8 deg +step 422 - lrate 0.000000, wchange 0.00000017, angledelta 102.7 deg +step 423 - lrate 0.000000, wchange 0.00000032, angledelta 87.7 deg +step 424 - lrate 0.000000, wchange 0.00000015, angledelta 87.3 deg +step 425 - lrate 0.000000, wchange 0.00000021, angledelta 111.7 deg +step 426 - lrate 0.000000, wchange 0.00000024, angledelta 92.1 deg +step 427 - lrate 0.000000, wchange 0.00000023, angledelta 114.3 deg +step 428 - lrate 0.000000, wchange 0.00000013, angledelta 83.6 deg +step 429 - lrate 0.000000, wchange 0.00000014, angledelta 98.2 deg +step 430 - lrate 0.000000, wchange 0.00000011, angledelta 101.0 deg +step 431 - lrate 0.000000, wchange 0.00000011, angledelta 88.5 deg +step 432 - lrate 0.000000, wchange 0.00000009, angledelta 97.2 deg +Sorting components in descending order of mean projected variance ... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +The input dataset will be split into 4957 epochs of 1 s +Epochs will overlap by 0%. +Inserting 4957 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +................. +Sorting the event table. +Splitting the data into 4957 1.00-s epochs +pop_epoch():4957 epochs selected +Epoching... +pop_epoch():4957 epochs generated +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +Scaling components to RMS microvolt +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Scaling components to RMS microvolt +Scaling components to RMS microvolt +EEG.icaact not present. Recomputed from data. + +Features Extraction: +GDSF - General Discontinuity Spatial Feature... +SED - Spatial Eye Difference... +SAD - Spatial Average Difference... +Temporal Kurtosis... +Maximum epoch variance... +Computing EM thresholds... +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index + +par_id = + + 1x8 cell array + + Columns 1 through 6 + + {'sub-3000004'} {'all'} {'eeg'} {'s1'} {'r1'} {'e1'} + + Columns 7 through 8 + + {'filtered'} {'data - 1-s epochs'} + +. + +Artifact Identification: +Horizontal Eye Movements... +End Horizontal Eye Movement Detection +Vertical Eye Movements... +Eye Blinks... +End Blink Detection +Generic Discontinuities... + +Results in . +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Saving dataset... +Scaling components to RMS microvolt +Computing projection .... +pop_editeventfield(): creating new field 'observation' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'eventType' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'targetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'congruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'responded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'accuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'rt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'extraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidTrial' +pop-editeventfield(): updating urevent structure +Event resorted by increasing latencies. +pop_epoch():1616 epochs selected +Epoching... +pop_epoch():1616 epochs generated +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'observation' made uniform +eeg_checkset note: value format of event field 'eventType' made uniform +eeg_checkset note: value format of event field 'targetDir' made uniform +eeg_checkset note: value format of event field 'congruency' made uniform +eeg_checkset note: value format of event field 'prevTargetDir' made uniform +eeg_checkset note: value format of event field 'prevCongruency' made uniform +eeg_checkset note: value format of event field 'nextTargetDir' made uniform +eeg_checkset note: value format of event field 'nextCongruency' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +pop_rmbase(): Removing baseline... +1 channel selected +9/1616 trials marked for rejection +1 channel selected +4/1616 trials marked for rejection +1 channel selected +3/1616 trials marked for rejection +1 channel selected +4/1616 trials marked for rejection +11/1616 trials rejected +Removing 11 trial(s)... +Pop_select: removing 34 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +23/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +6/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +7/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +1/1605 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1605 trials marked for rejection +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5435 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5435 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5435 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5435 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 3 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 8 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 2 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 4 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5436 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5437 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5438 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5439 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1604 trial(s)... +Pop_select: removing 5440 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +1/1605 trials rejected +Removing 1 trial(s)... +Pop_select: removing 2 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +0/1604 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Interpolating 4 channels... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Re-referencing data +Scaling components to RMS microvolt +Error: some channels not used for ICA decomposition are used for rereferencing + the ICA decomposition has been removed +Saving dataset... + + + +*** Processing subject 1 (sub-3000003_all_eeg_s1_r1_e1.vhdr) *** + + +pop_loadbv(): reading header file +Done. +pop_loadbv(): reading EEG data +pop_loadbv(): scaling EEG data +pop_loadbv(): reading marker file +Done. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +eeg_checkset warning: number of columns in data (64) does not match the number of channels (63): corrected +eeg_checkset warning: number of channels different in data and channel file/struct: channel file/struct removed +[Warning: channel labels should not be empty, creating unique labels] +Warning: the size of the channel location structure does not match with + number of channels. Channel information have been removed. +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 50:56= - 10%, ETE 45:58= \ 15%, ETE 42:44= | 20%, ETE 39:53= / 25%, ETE 37:13= - 30%, ETE 34:36= \ 35%, ETE 32:03= | 40%, ETE 29:32= / 45%, ETE 27:02= - 50%, ETE 24:33= \ 55%, ETE 22:04= | 60%, ETE 19:36= / 65%, ETE 17:09= - 70%, ETE 14:41= \ 75%, ETE 12:14= | 80%, ETE 09:47= / 85%, ETE 07:20= - 90%, ETE 04:54= \ 95%, ETE 02:27=| 100%, ETE 00:00 +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 01:19= - 10%, ETE 00:47= \ 15%, ETE 00:36= | 20%, ETE 00:30= / 25%, ETE 00:26= - 30%, ETE 00:22= \ 35%, ETE 00:20= | 40%, ETE 00:18= / 45%, ETE 00:16= - 50%, ETE 00:14= \ 55%, ETE 00:13= | 60%, ETE 00:11= / 65%, ETE 00:10= - 70%, ETE 00:08= \ 75%, ETE 00:07= | 80%, ETE 00:05= / 85%, ETE 00:04= - 90%, ETE 00:03= \ 95%, ETE 00:02=| 100%, ETE 00:00 +Removing 4 channel(s)... +Event resorted by increasing latencies. +Removing 1 channel(s)... +Event resorted by increasing latencies. +Saving dataset... +pop_firws() - filtering the data +firfilt(): | | 0%= / 5%, ETE 03:47= - 10%, ETE 03:09= \ 15%, ETE 02:50= | 20%, ETE 02:36= / 25%, ETE 02:24= - 30%, ETE 02:13= \ 35%, ETE 02:03= | 40%, ETE 01:53= / 45%, ETE 01:43= - 50%, ETE 01:33= \ 55%, ETE 01:24= | 60%, ETE 01:14= / 65%, ETE 01:05= - 70%, ETE 00:56= \ 75%, ETE 00:46= | 80%, ETE 00:37= / 85%, ETE 00:28= - 90%, ETE 00:19= \ 95%, ETE 00:10=| 100%, ETE 00:00 +The input dataset will be split into 6568 epochs of 1 s +Epochs will overlap by 0%. +Inserting 6568 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560........ +Sorting the event table. +Splitting the data into 6568 1.00-s epochs +pop_epoch():6568 epochs selected +Epoching... +pop_epoch():6568 epochs generated +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +7/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +15/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +2/6567 trials marked for rejection + +1 channel selected +1/6567 trials marked for rejection +1 channel selected +2/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +6/6567 trials marked for rejection +1 channel selected +855/6567 trials marked for rejection + +1 channel selected +280/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +3/6567 trials marked for rejection + +1 channel selected +12/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +3/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +1/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +729/6567 trials marked for rejection + +1 channel selected +343/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +7/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +13/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +6/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +3/6567 trials marked for rejection +1 channel selected +1/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +2/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +0/6567 trials marked for rejection + +1 channel selected +0/6567 trials marked for rejection +1 channel selected +5/6567 trials marked for rejection + +1 channel selected +4/6567 trials marked for rejection +1 channel selected +3212/6567 trials marked for rejection + +1 channel selected +5/6567 trials marked for rejection +Removing 1 channel(s)... +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +58 channel selected +1080/6567 trials marked for rejection + +58 channel selected +547/6567 trials marked for rejection +1103/6567 trials rejected +Removing 1103 trial(s)... +Pop_select: removing 2496 unreferenced events +Warning: spectral data were removed because of the change in the numner of points +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform + +Attempting to convert data matrix to double precision for more accurate ICA results. + +Input data size [58,5464000] = 58 channels, 5464000 frames/nFinding 58 ICA components using extended ICA. +Kurtosis will be calculated initially every 1 blocks using 6000 data points. +Decomposing 1624 frames per ICA weight ((3364)^2 = 5464000 weights, Initial learning rate will be 0.001, block size 78. +Learning rate will be multiplied by 0.98 whenever angledelta >= 60 deg. +Training will end when wchange < 1e-07 or after 512 steps. +Online bias adjustment will be used. +Removing mean of each channel ... +Final training data range: -998.312 to 998.465 +Computing the sphering matrix... +Starting weights are the identity matrix ... +Sphering the data ... +Beginning ICA training ... first training step may be slow ... +Lowering learning rate to 0.0009 and starting again. +Lowering learning rate to 0.00081 and starting again. +Lowering learning rate to 0.000729 and starting again. +Lowering learning rate to 0.0006561 and starting again. +Lowering learning rate to 0.00059049 and starting again. +Lowering learning rate to 0.000531441 and starting again. +Lowering learning rate to 0.000478297 and starting again. +Lowering learning rate to 0.000430467 and starting again. +Lowering learning rate to 0.00038742 and starting again. +Lowering learning rate to 0.000348678 and starting again. +Lowering learning rate to 0.000313811 and starting again. +Lowering learning rate to 0.00028243 and starting again. +Lowering learning rate to 0.000254187 and starting again. +Lowering learning rate to 0.000228768 and starting again. +step 1 - lrate 0.000229, wchange 34.05538814, angledelta 0.0 deg +step 2 - lrate 0.000229, wchange 4.96113905, angledelta 0.0 deg +step 3 - lrate 0.000229, wchange 6.13223469, angledelta 84.8 deg +Lowering learning rate to 0.000201773 and starting again. +step 1 - lrate 0.000202, wchange 36.33002536, angledelta 0.0 deg +step 2 - lrate 0.000202, wchange 3.39407187, angledelta 0.0 deg +step 3 - lrate 0.000202, wchange 3.41655217, angledelta 85.1 deg +step 4 - lrate 0.000198, wchange 2.26799177, angledelta 115.7 deg +step 5 - lrate 0.000194, wchange 4.00441120, angledelta 113.1 deg +step 6 - lrate 0.000190, wchange 1.93065082, angledelta 120.7 deg +step 7 - lrate 0.000186, wchange 2.72236997, angledelta 116.6 deg +step 8 - lrate 0.000182, wchange 2.13643412, angledelta 121.6 deg +step 9 - lrate 0.000179, wchange 3.01636219, angledelta 114.6 deg +step 10 - lrate 0.000175, wchange 2.27924643, angledelta 121.2 deg +step 11 - lrate 0.000172, wchange 2.34079176, angledelta 113.9 deg +step 12 - lrate 0.000168, wchange 2.36999664, angledelta 126.6 deg +step 13 - lrate 0.000165, wchange 1.51605959, angledelta 126.5 deg +step 14 - lrate 0.000162, wchange 1.62393235, angledelta 123.1 deg +step 15 - lrate 0.000158, wchange 2.27635219, angledelta 116.5 deg +step 16 - lrate 0.000155, wchange 0.67482937, angledelta 93.2 deg +step 17 - lrate 0.000152, wchange 1.48615078, angledelta 112.6 deg +step 18 - lrate 0.000149, wchange 2.68596040, angledelta 106.6 deg +step 19 - lrate 0.000146, wchange 1.26615213, angledelta 117.0 deg +step 20 - lrate 0.000143, wchange 1.75018155, angledelta 132.1 deg +step 21 - lrate 0.000140, wchange 2.46713763, angledelta 123.1 deg +step 22 - lrate 0.000137, wchange 0.45169272, angledelta 109.4 deg +step 23 - lrate 0.000135, wchange 0.84248733, angledelta 116.9 deg +step 24 - lrate 0.000132, wchange 1.13403755, angledelta 113.6 deg +step 25 - lrate 0.000129, wchange 1.24032518, angledelta 122.2 deg +step 26 - lrate 0.000127, wchange 0.94533171, angledelta 89.2 deg +step 27 - lrate 0.000124, wchange 0.86717399, angledelta 125.8 deg +step 28 - lrate 0.000122, wchange 0.88088146, angledelta 154.3 deg +step 29 - lrate 0.000119, wchange 1.74731923, angledelta 132.9 deg +step 30 - lrate 0.000117, wchange 0.74088316, angledelta 118.3 deg +step 31 - lrate 0.000115, wchange 1.29160129, angledelta 122.6 deg +step 32 - lrate 0.000112, wchange 0.38705973, angledelta 114.1 deg +step 33 - lrate 0.000110, wchange 0.43615963, angledelta 145.2 deg +step 34 - lrate 0.000108, wchange 1.85212050, angledelta 117.7 deg +step 35 - lrate 0.000106, wchange 0.20641611, angledelta 110.5 deg +step 36 - lrate 0.000104, wchange 0.76454628, angledelta 86.4 deg +step 37 - lrate 0.000102, wchange 0.89385596, angledelta 90.3 deg +step 38 - lrate 0.000099, wchange 0.13588616, angledelta 113.6 deg +step 39 - lrate 0.000097, wchange 0.13978591, angledelta 117.1 deg +step 40 - lrate 0.000096, wchange 0.13575712, angledelta 121.5 deg +step 41 - lrate 0.000094, wchange 0.09360919, angledelta 114.6 deg +step 42 - lrate 0.000092, wchange 0.80944448, angledelta 92.4 deg +step 43 - lrate 0.000090, wchange 0.13574289, angledelta 127.9 deg +step 44 - lrate 0.000088, wchange 0.52504142, angledelta 75.5 deg +step 45 - lrate 0.000086, wchange 0.10268275, angledelta 82.5 deg +step 46 - lrate 0.000085, wchange 0.10545713, angledelta 122.4 deg +step 47 - lrate 0.000083, wchange 0.60453657, angledelta 101.9 deg +step 48 - lrate 0.000081, wchange 0.11094342, angledelta 100.5 deg +step 49 - lrate 0.000080, wchange 0.12318706, angledelta 115.4 deg +step 50 - lrate 0.000078, wchange 0.09932867, angledelta 102.0 deg +step 51 - lrate 0.000077, wchange 0.11902728, angledelta 126.1 deg +step 52 - lrate 0.000075, wchange 0.11148883, angledelta 123.9 deg +step 53 - lrate 0.000073, wchange 0.08670973, angledelta 123.5 deg +step 54 - lrate 0.000072, wchange 0.08111034, angledelta 108.4 deg +step 55 - lrate 0.000071, wchange 0.09371380, angledelta 112.0 deg +step 56 - lrate 0.000069, wchange 0.08685896, angledelta 127.1 deg +step 57 - lrate 0.000068, wchange 0.07523949, angledelta 116.1 deg +step 58 - lrate 0.000066, wchange 0.06077217, angledelta 105.5 deg +step 59 - lrate 0.000065, wchange 0.09939821, angledelta 116.0 deg +step 60 - lrate 0.000064, wchange 0.09040790, angledelta 129.7 deg +step 61 - lrate 0.000063, wchange 0.06464295, angledelta 110.6 deg +step 62 - lrate 0.000061, wchange 0.08571734, angledelta 122.9 deg +step 63 - lrate 0.000060, wchange 0.05938441, angledelta 118.0 deg +step 64 - lrate 0.000059, wchange 0.08025988, angledelta 120.1 deg +step 65 - lrate 0.000058, wchange 0.08615795, angledelta 124.4 deg +step 66 - lrate 0.000057, wchange 0.09545033, angledelta 127.6 deg +step 67 - lrate 0.000055, wchange 0.11980395, angledelta 133.5 deg +step 68 - lrate 0.000054, wchange 0.06016400, angledelta 116.7 deg +step 69 - lrate 0.000053, wchange 0.07738655, angledelta 107.6 deg +step 70 - lrate 0.000052, wchange 0.07194210, angledelta 120.2 deg +step 71 - lrate 0.000051, wchange 0.05458097, angledelta 122.9 deg +step 72 - lrate 0.000050, wchange 0.06573793, angledelta 113.3 deg +step 73 - lrate 0.000049, wchange 0.05585847, angledelta 124.5 deg +step 74 - lrate 0.000048, wchange 0.04702023, angledelta 120.8 deg +step 75 - lrate 0.000047, wchange 0.04761867, angledelta 117.2 deg +step 76 - lrate 0.000046, wchange 0.04851862, angledelta 104.0 deg +step 77 - lrate 0.000045, wchange 0.04595442, angledelta 116.3 deg +step 78 - lrate 0.000044, wchange 0.06628198, angledelta 122.7 deg +step 79 - lrate 0.000043, wchange 0.05993978, angledelta 127.8 deg +step 80 - lrate 0.000043, wchange 0.06418918, angledelta 111.6 deg +step 81 - lrate 0.000042, wchange 0.04504165, angledelta 103.5 deg +step 82 - lrate 0.000041, wchange 0.05257429, angledelta 114.1 deg +step 83 - lrate 0.000040, wchange 0.04691541, angledelta 120.5 deg +step 84 - lrate 0.000039, wchange 0.06212448, angledelta 122.1 deg +step 85 - lrate 0.000038, wchange 0.08011578, angledelta 123.9 deg +step 86 - lrate 0.000038, wchange 0.05512684, angledelta 125.6 deg +step 87 - lrate 0.000037, wchange 0.04926708, angledelta 126.9 deg +step 88 - lrate 0.000036, wchange 0.08956569, angledelta 122.1 deg +step 89 - lrate 0.000036, wchange 0.04222843, angledelta 125.8 deg +step 90 - lrate 0.000035, wchange 0.05234639, angledelta 110.4 deg +step 91 - lrate 0.000034, wchange 0.03304620, angledelta 123.1 deg +step 92 - lrate 0.000033, wchange 0.03927226, angledelta 120.0 deg +step 93 - lrate 0.000033, wchange 0.07856037, angledelta 124.3 deg +step 94 - lrate 0.000032, wchange 0.03410033, angledelta 111.9 deg +step 95 - lrate 0.000031, wchange 0.03144866, angledelta 115.6 deg +step 96 - lrate 0.000031, wchange 0.03587408, angledelta 126.5 deg +step 97 - lrate 0.000030, wchange 0.03808278, angledelta 122.3 deg +step 98 - lrate 0.000030, wchange 0.02452013, angledelta 113.4 deg +step 99 - lrate 0.000029, wchange 0.02759030, angledelta 114.1 deg +step 100 - lrate 0.000028, wchange 0.02925525, angledelta 124.5 deg +step 101 - lrate 0.000028, wchange 0.03127797, angledelta 111.2 deg +step 102 - lrate 0.000027, wchange 0.03560575, angledelta 130.6 deg +step 103 - lrate 0.000027, wchange 0.02874208, angledelta 131.2 deg +step 104 - lrate 0.000026, wchange 0.03034718, angledelta 123.9 deg +step 105 - lrate 0.000026, wchange 0.03402676, angledelta 115.8 deg +step 106 - lrate 0.000025, wchange 0.03356967, angledelta 119.4 deg +step 107 - lrate 0.000025, wchange 0.03858818, angledelta 127.8 deg +step 108 - lrate 0.000024, wchange 0.01900490, angledelta 104.7 deg +step 109 - lrate 0.000024, wchange 0.02283885, angledelta 116.5 deg +step 110 - lrate 0.000023, wchange 0.02828433, angledelta 123.3 deg +step 111 - lrate 0.000023, wchange 0.02318543, angledelta 124.3 deg +step 112 - lrate 0.000022, wchange 0.03113709, angledelta 110.3 deg +step 113 - lrate 0.000022, wchange 0.02847202, angledelta 125.6 deg +step 114 - lrate 0.000021, wchange 0.02681077, angledelta 122.2 deg +step 115 - lrate 0.000021, wchange 0.02758837, angledelta 125.3 deg +step 116 - lrate 0.000021, wchange 0.02487181, angledelta 127.0 deg +step 117 - lrate 0.000020, wchange 0.02366215, angledelta 104.8 deg +step 118 - lrate 0.000020, wchange 0.01925332, angledelta 128.8 deg +step 119 - lrate 0.000019, wchange 0.01795179, angledelta 119.4 deg +step 120 - lrate 0.000019, wchange 0.02031363, angledelta 119.1 deg +step 121 - lrate 0.000019, wchange 0.01980341, angledelta 113.3 deg +step 122 - lrate 0.000018, wchange 0.01686311, angledelta 121.7 deg +step 123 - lrate 0.000018, wchange 0.01582739, angledelta 121.2 deg +step 124 - lrate 0.000018, wchange 0.01875678, angledelta 113.3 deg +step 125 - lrate 0.000017, wchange 0.01600305, angledelta 115.3 deg +step 126 - lrate 0.000017, wchange 0.01642267, angledelta 121.5 deg +step 127 - lrate 0.000016, wchange 0.01730614, angledelta 117.3 deg +step 128 - lrate 0.000016, wchange 0.01790766, angledelta 128.8 deg +step 129 - lrate 0.000016, wchange 0.01534992, angledelta 112.4 deg +step 130 - lrate 0.000016, wchange 0.01329589, angledelta 119.8 deg +step 131 - lrate 0.000015, wchange 0.01468404, angledelta 121.0 deg +step 132 - lrate 0.000015, wchange 0.01320264, angledelta 116.3 deg +step 133 - lrate 0.000015, wchange 0.01494597, angledelta 128.7 deg +step 134 - lrate 0.000014, wchange 0.01165646, angledelta 117.1 deg +step 135 - lrate 0.000014, wchange 0.01378089, angledelta 111.5 deg +step 136 - lrate 0.000014, wchange 0.01539351, angledelta 125.1 deg +step 137 - lrate 0.000013, wchange 0.01110651, angledelta 119.7 deg +step 138 - lrate 0.000013, wchange 0.01234892, angledelta 113.6 deg +step 139 - lrate 0.000013, wchange 0.02396057, angledelta 125.6 deg +step 140 - lrate 0.000013, wchange 0.01357782, angledelta 127.0 deg +step 141 - lrate 0.000012, wchange 0.01560018, angledelta 102.2 deg +step 142 - lrate 0.000012, wchange 0.01124288, angledelta 114.0 deg +step 143 - lrate 0.000012, wchange 0.01598416, angledelta 113.0 deg +step 144 - lrate 0.000012, wchange 0.00892877, angledelta 112.1 deg +step 145 - lrate 0.000011, wchange 0.01376245, angledelta 121.1 deg +step 146 - lrate 0.000011, wchange 0.01207349, angledelta 117.3 deg +step 147 - lrate 0.000011, wchange 0.01214783, angledelta 121.5 deg +step 148 - lrate 0.000011, wchange 0.01369070, angledelta 121.7 deg +step 149 - lrate 0.000011, wchange 0.00944651, angledelta 116.1 deg +step 150 - lrate 0.000010, wchange 0.00933396, angledelta 112.1 deg +step 151 - lrate 0.000010, wchange 0.00754711, angledelta 118.6 deg +step 152 - lrate 0.000010, wchange 0.00825210, angledelta 118.2 deg +step 153 - lrate 0.000010, wchange 0.00941393, angledelta 126.4 deg +step 154 - lrate 0.000010, wchange 0.00847014, angledelta 121.7 deg +step 155 - lrate 0.000009, wchange 0.01160456, angledelta 126.5 deg +step 156 - lrate 0.000009, wchange 0.01084367, angledelta 130.7 deg +step 157 - lrate 0.000009, wchange 0.01023858, angledelta 127.8 deg +step 158 - lrate 0.000009, wchange 0.01150055, angledelta 128.3 deg +step 159 - lrate 0.000009, wchange 0.00895486, angledelta 121.7 deg +step 160 - lrate 0.000008, wchange 0.00830532, angledelta 118.9 deg +step 161 - lrate 0.000008, wchange 0.00962041, angledelta 119.2 deg +step 162 - lrate 0.000008, wchange 0.00789888, angledelta 122.1 deg +step 163 - lrate 0.000008, wchange 0.00715520, angledelta 101.3 deg +step 164 - lrate 0.000008, wchange 0.00926303, angledelta 128.7 deg +step 165 - lrate 0.000008, wchange 0.00854835, angledelta 123.0 deg +step 166 - lrate 0.000007, wchange 0.00734307, angledelta 127.1 deg +step 167 - lrate 0.000007, wchange 0.00991750, angledelta 101.5 deg +step 168 - lrate 0.000007, wchange 0.00960818, angledelta 133.0 deg +step 169 - lrate 0.000007, wchange 0.00605060, angledelta 112.8 deg +step 170 - lrate 0.000007, wchange 0.00969077, angledelta 116.5 deg +step 171 - lrate 0.000007, wchange 0.00707787, angledelta 121.4 deg +step 172 - lrate 0.000007, wchange 0.00589704, angledelta 126.6 deg +step 173 - lrate 0.000007, wchange 0.00484458, angledelta 117.2 deg +step 174 - lrate 0.000006, wchange 0.00530255, angledelta 109.5 deg +step 175 - lrate 0.000006, wchange 0.00535305, angledelta 127.3 deg +step 176 - lrate 0.000006, wchange 0.00554198, angledelta 112.3 deg +step 177 - lrate 0.000006, wchange 0.00576758, angledelta 127.5 deg +step 178 - lrate 0.000006, wchange 0.00537849, angledelta 119.0 deg +step 179 - lrate 0.000006, wchange 0.00573633, angledelta 120.4 deg +step 180 - lrate 0.000006, wchange 0.00494480, angledelta 121.2 deg +step 181 - lrate 0.000006, wchange 0.00757670, angledelta 125.0 deg +step 182 - lrate 0.000005, wchange 0.00691699, angledelta 132.0 deg +step 183 - lrate 0.000005, wchange 0.00544139, angledelta 120.4 deg +step 184 - lrate 0.000005, wchange 0.00465031, angledelta 119.1 deg +step 185 - lrate 0.000005, wchange 0.00417909, angledelta 115.6 deg +step 186 - lrate 0.000005, wchange 0.00343398, angledelta 118.2 deg +step 187 - lrate 0.000005, wchange 0.00398847, angledelta 106.4 deg +step 188 - lrate 0.000005, wchange 0.00383245, angledelta 121.4 deg +step 189 - lrate 0.000005, wchange 0.00421612, angledelta 119.2 deg +step 190 - lrate 0.000005, wchange 0.00388312, angledelta 114.9 deg +step 191 - lrate 0.000005, wchange 0.00704165, angledelta 115.2 deg +step 192 - lrate 0.000004, wchange 0.00500336, angledelta 128.4 deg +step 193 - lrate 0.000004, wchange 0.00295781, angledelta 106.6 deg +step 194 - lrate 0.000004, wchange 0.00373787, angledelta 116.8 deg +step 195 - lrate 0.000004, wchange 0.00349479, angledelta 109.9 deg +step 196 - lrate 0.000004, wchange 0.00373703, angledelta 121.1 deg +step 197 - lrate 0.000004, wchange 0.00521869, angledelta 117.3 deg +step 198 - lrate 0.000004, wchange 0.00520533, angledelta 129.1 deg +step 199 - lrate 0.000004, wchange 0.00410822, angledelta 95.7 deg +step 200 - lrate 0.000004, wchange 0.00601998, angledelta 127.1 deg +step 201 - lrate 0.000004, wchange 0.00317604, angledelta 119.9 deg +step 202 - lrate 0.000004, wchange 0.00368267, angledelta 111.1 deg +step 203 - lrate 0.000004, wchange 0.00406414, angledelta 101.4 deg +step 204 - lrate 0.000003, wchange 0.00639749, angledelta 131.8 deg +step 205 - lrate 0.000003, wchange 0.00575878, angledelta 127.6 deg +step 206 - lrate 0.000003, wchange 0.00434102, angledelta 138.4 deg +step 207 - lrate 0.000003, wchange 0.00261475, angledelta 114.7 deg +step 208 - lrate 0.000003, wchange 0.00285908, angledelta 122.7 deg +step 209 - lrate 0.000003, wchange 0.00257013, angledelta 112.3 deg +step 210 - lrate 0.000003, wchange 0.00307532, angledelta 125.0 deg +step 211 - lrate 0.000003, wchange 0.00321988, angledelta 103.5 deg +step 212 - lrate 0.000003, wchange 0.00417234, angledelta 130.7 deg +step 213 - lrate 0.000003, wchange 0.00338594, angledelta 129.6 deg +step 214 - lrate 0.000003, wchange 0.00261707, angledelta 107.4 deg +step 215 - lrate 0.000003, wchange 0.00274293, angledelta 124.7 deg +step 216 - lrate 0.000003, wchange 0.00245637, angledelta 124.0 deg +step 217 - lrate 0.000003, wchange 0.00184132, angledelta 114.3 deg +step 218 - lrate 0.000003, wchange 0.00247483, angledelta 114.5 deg +step 219 - lrate 0.000003, wchange 0.00228270, angledelta 127.6 deg +step 220 - lrate 0.000003, wchange 0.00172663, angledelta 118.2 deg +step 221 - lrate 0.000002, wchange 0.00235534, angledelta 110.9 deg +step 222 - lrate 0.000002, wchange 0.00311897, angledelta 127.5 deg +step 223 - lrate 0.000002, wchange 0.00314151, angledelta 123.0 deg +step 224 - lrate 0.000002, wchange 0.00258375, angledelta 133.1 deg +step 225 - lrate 0.000002, wchange 0.00326078, angledelta 123.2 deg +step 226 - lrate 0.000002, wchange 0.00325197, angledelta 137.9 deg +step 227 - lrate 0.000002, wchange 0.00176180, angledelta 121.8 deg +step 228 - lrate 0.000002, wchange 0.00171886, angledelta 117.8 deg +step 229 - lrate 0.000002, wchange 0.00164706, angledelta 118.0 deg +step 230 - lrate 0.000002, wchange 0.00203206, angledelta 126.3 deg +step 231 - lrate 0.000002, wchange 0.00160755, angledelta 127.7 deg +step 232 - lrate 0.000002, wchange 0.00159987, angledelta 107.4 deg +step 233 - lrate 0.000002, wchange 0.00172630, angledelta 123.6 deg +step 234 - lrate 0.000002, wchange 0.00254775, angledelta 116.8 deg +step 235 - lrate 0.000002, wchange 0.00191125, angledelta 125.8 deg +step 236 - lrate 0.000002, wchange 0.00187970, angledelta 104.5 deg +step 237 - lrate 0.000002, wchange 0.00365842, angledelta 130.9 deg +step 238 - lrate 0.000002, wchange 0.00197316, angledelta 129.5 deg +step 239 - lrate 0.000002, wchange 0.00128568, angledelta 114.1 deg +step 240 - lrate 0.000002, wchange 0.00201452, angledelta 112.7 deg +step 241 - lrate 0.000002, wchange 0.00199642, angledelta 135.8 deg +step 242 - lrate 0.000002, wchange 0.00116634, angledelta 114.1 deg +step 243 - lrate 0.000002, wchange 0.00135975, angledelta 103.9 deg +step 244 - lrate 0.000002, wchange 0.00146111, angledelta 125.5 deg +step 245 - lrate 0.000002, wchange 0.00154213, angledelta 99.2 deg +step 246 - lrate 0.000001, wchange 0.00139417, angledelta 124.2 deg +step 247 - lrate 0.000001, wchange 0.00192414, angledelta 119.3 deg +step 248 - lrate 0.000001, wchange 0.00136884, angledelta 130.2 deg +step 249 - lrate 0.000001, wchange 0.00153732, angledelta 131.5 deg +step 250 - lrate 0.000001, wchange 0.00216895, angledelta 130.1 deg +step 251 - lrate 0.000001, wchange 0.00147165, angledelta 131.0 deg +step 252 - lrate 0.000001, wchange 0.00115687, angledelta 119.5 deg +step 253 - lrate 0.000001, wchange 0.00120523, angledelta 121.6 deg +step 254 - lrate 0.000001, wchange 0.00084897, angledelta 119.7 deg +step 255 - lrate 0.000001, wchange 0.00111540, angledelta 109.0 deg +step 256 - lrate 0.000001, wchange 0.00113820, angledelta 127.9 deg +step 257 - lrate 0.000001, wchange 0.00084175, angledelta 114.8 deg +step 258 - lrate 0.000001, wchange 0.00116305, angledelta 120.5 deg +step 259 - lrate 0.000001, wchange 0.00087187, angledelta 125.1 deg +step 260 - lrate 0.000001, wchange 0.00081592, angledelta 108.3 deg +step 261 - lrate 0.000001, wchange 0.00068047, angledelta 106.0 deg +step 262 - lrate 0.000001, wchange 0.00073143, angledelta 121.4 deg +step 263 - lrate 0.000001, wchange 0.00125914, angledelta 109.2 deg +step 264 - lrate 0.000001, wchange 0.00100177, angledelta 131.3 deg +step 265 - lrate 0.000001, wchange 0.00085364, angledelta 106.0 deg +step 266 - lrate 0.000001, wchange 0.00097416, angledelta 127.9 deg +step 267 - lrate 0.000001, wchange 0.00113243, angledelta 126.5 deg +step 268 - lrate 0.000001, wchange 0.00100608, angledelta 132.9 deg +step 269 - lrate 0.000001, wchange 0.00056665, angledelta 111.7 deg +step 270 - lrate 0.000001, wchange 0.00105829, angledelta 116.6 deg +step 271 - lrate 0.000001, wchange 0.00059938, angledelta 101.5 deg +step 272 - lrate 0.000001, wchange 0.00119901, angledelta 122.8 deg +step 273 - lrate 0.000001, wchange 0.00070437, angledelta 132.4 deg +step 274 - lrate 0.000001, wchange 0.00063391, angledelta 86.9 deg +step 275 - lrate 0.000001, wchange 0.00140589, angledelta 135.6 deg +step 276 - lrate 0.000001, wchange 0.00078667, angledelta 131.3 deg +step 277 - lrate 0.000001, wchange 0.00057318, angledelta 120.4 deg +step 278 - lrate 0.000001, wchange 0.00051394, angledelta 120.0 deg +step 279 - lrate 0.000001, wchange 0.00053535, angledelta 110.6 deg +step 280 - lrate 0.000001, wchange 0.00048410, angledelta 118.5 deg +step 281 - lrate 0.000001, wchange 0.00048230, angledelta 116.1 deg +step 282 - lrate 0.000001, wchange 0.00047949, angledelta 125.6 deg +step 283 - lrate 0.000001, wchange 0.00041446, angledelta 122.3 deg +step 284 - lrate 0.000001, wchange 0.00090005, angledelta 121.0 deg +step 285 - lrate 0.000001, wchange 0.00100353, angledelta 142.4 deg +step 286 - lrate 0.000001, wchange 0.00047169, angledelta 117.9 deg +step 287 - lrate 0.000001, wchange 0.00045083, angledelta 111.2 deg +step 288 - lrate 0.000001, wchange 0.00035626, angledelta 124.7 deg +step 289 - lrate 0.000001, wchange 0.00030709, angledelta 117.4 deg +step 290 - lrate 0.000001, wchange 0.00036944, angledelta 107.4 deg +step 291 - lrate 0.000001, wchange 0.00104088, angledelta 122.1 deg +step 292 - lrate 0.000001, wchange 0.00087458, angledelta 143.5 deg +step 293 - lrate 0.000001, wchange 0.00064530, angledelta 137.9 deg +step 294 - lrate 0.000001, wchange 0.00033731, angledelta 128.9 deg +step 295 - lrate 0.000001, wchange 0.00027817, angledelta 106.7 deg +step 296 - lrate 0.000001, wchange 0.00031477, angledelta 125.2 deg +step 297 - lrate 0.000001, wchange 0.00027952, angledelta 109.6 deg +step 298 - lrate 0.000001, wchange 0.00041107, angledelta 114.0 deg +step 299 - lrate 0.000001, wchange 0.00022480, angledelta 116.4 deg +step 300 - lrate 0.000001, wchange 0.00040898, angledelta 112.0 deg +step 301 - lrate 0.000000, wchange 0.00024694, angledelta 127.1 deg +step 302 - lrate 0.000000, wchange 0.00032203, angledelta 122.4 deg +step 303 - lrate 0.000000, wchange 0.00026283, angledelta 119.3 deg +step 304 - lrate 0.000000, wchange 0.00028333, angledelta 111.2 deg +step 305 - lrate 0.000000, wchange 0.00023680, angledelta 121.8 deg +step 306 - lrate 0.000000, wchange 0.00021117, angledelta 108.2 deg +step 307 - lrate 0.000000, wchange 0.00019683, angledelta 117.2 deg +step 308 - lrate 0.000000, wchange 0.00024087, angledelta 119.1 deg +step 309 - lrate 0.000000, wchange 0.00045570, angledelta 123.2 deg +step 310 - lrate 0.000000, wchange 0.00018032, angledelta 106.4 deg +step 311 - lrate 0.000000, wchange 0.00028112, angledelta 118.1 deg +step 312 - lrate 0.000000, wchange 0.00018533, angledelta 106.3 deg +step 313 - lrate 0.000000, wchange 0.00028482, angledelta 123.2 deg +step 314 - lrate 0.000000, wchange 0.00022542, angledelta 129.4 deg +step 315 - lrate 0.000000, wchange 0.00017841, angledelta 126.7 deg +step 316 - lrate 0.000000, wchange 0.00015464, angledelta 112.7 deg +step 317 - lrate 0.000000, wchange 0.00015024, angledelta 120.6 deg +step 318 - lrate 0.000000, wchange 0.00012683, angledelta 118.4 deg +step 319 - lrate 0.000000, wchange 0.00019489, angledelta 105.9 deg +step 320 - lrate 0.000000, wchange 0.00013184, angledelta 125.1 deg +step 321 - lrate 0.000000, wchange 0.00012052, angledelta 112.9 deg +step 322 - lrate 0.000000, wchange 0.00014234, angledelta 121.7 deg +step 323 - lrate 0.000000, wchange 0.00017820, angledelta 125.8 deg +step 324 - lrate 0.000000, wchange 0.00011410, angledelta 115.5 deg +step 325 - lrate 0.000000, wchange 0.00019692, angledelta 112.8 deg +step 326 - lrate 0.000000, wchange 0.00011969, angledelta 121.2 deg +step 327 - lrate 0.000000, wchange 0.00014782, angledelta 107.4 deg +step 328 - lrate 0.000000, wchange 0.00029093, angledelta 125.1 deg +step 329 - lrate 0.000000, wchange 0.00033663, angledelta 146.4 deg +step 330 - lrate 0.000000, wchange 0.00008602, angledelta 118.9 deg +step 331 - lrate 0.000000, wchange 0.00009034, angledelta 113.2 deg +step 332 - lrate 0.000000, wchange 0.00007529, angledelta 120.0 deg +step 333 - lrate 0.000000, wchange 0.00006927, angledelta 113.9 deg +step 334 - lrate 0.000000, wchange 0.00007215, angledelta 116.6 deg +step 335 - lrate 0.000000, wchange 0.00007866, angledelta 110.1 deg +step 336 - lrate 0.000000, wchange 0.00010292, angledelta 127.8 deg +step 337 - lrate 0.000000, wchange 0.00006060, angledelta 118.4 deg +step 338 - lrate 0.000000, wchange 0.00006629, angledelta 107.9 deg +step 339 - lrate 0.000000, wchange 0.00005561, angledelta 113.7 deg +step 340 - lrate 0.000000, wchange 0.00006253, angledelta 119.3 deg +step 341 - lrate 0.000000, wchange 0.00005762, angledelta 111.9 deg +step 342 - lrate 0.000000, wchange 0.00006466, angledelta 126.5 deg +step 343 - lrate 0.000000, wchange 0.00004555, angledelta 114.7 deg +step 344 - lrate 0.000000, wchange 0.00004136, angledelta 107.7 deg +step 345 - lrate 0.000000, wchange 0.00007412, angledelta 122.8 deg +step 346 - lrate 0.000000, wchange 0.00004062, angledelta 117.8 deg +step 347 - lrate 0.000000, wchange 0.00008982, angledelta 107.8 deg +step 348 - lrate 0.000000, wchange 0.00004743, angledelta 120.6 deg +step 349 - lrate 0.000000, wchange 0.00006560, angledelta 89.3 deg +step 350 - lrate 0.000000, wchange 0.00005136, angledelta 133.5 deg +step 351 - lrate 0.000000, wchange 0.00005338, angledelta 126.8 deg +step 352 - lrate 0.000000, wchange 0.00003162, angledelta 127.2 deg +step 353 - lrate 0.000000, wchange 0.00003002, angledelta 96.1 deg +step 354 - lrate 0.000000, wchange 0.00003547, angledelta 120.8 deg +step 355 - lrate 0.000000, wchange 0.00004223, angledelta 130.1 deg +step 356 - lrate 0.000000, wchange 0.00002878, angledelta 123.2 deg +step 357 - lrate 0.000000, wchange 0.00003745, angledelta 126.3 deg +step 358 - lrate 0.000000, wchange 0.00005777, angledelta 133.0 deg +step 359 - lrate 0.000000, wchange 0.00002709, angledelta 129.5 deg +step 360 - lrate 0.000000, wchange 0.00002216, angledelta 114.1 deg +step 361 - lrate 0.000000, wchange 0.00002306, angledelta 106.4 deg +step 362 - lrate 0.000000, wchange 0.00002527, angledelta 121.6 deg +step 363 - lrate 0.000000, wchange 0.00001486, angledelta 97.0 deg +step 364 - lrate 0.000000, wchange 0.00001489, angledelta 119.4 deg +step 365 - lrate 0.000000, wchange 0.00001238, angledelta 114.6 deg +step 366 - lrate 0.000000, wchange 0.00001185, angledelta 114.6 deg +step 367 - lrate 0.000000, wchange 0.00001218, angledelta 109.6 deg +step 368 - lrate 0.000000, wchange 0.00002067, angledelta 121.7 deg +step 369 - lrate 0.000000, wchange 0.00001042, angledelta 108.2 deg +step 370 - lrate 0.000000, wchange 0.00001412, angledelta 119.2 deg +step 371 - lrate 0.000000, wchange 0.00001791, angledelta 118.3 deg +step 372 - lrate 0.000000, wchange 0.00001030, angledelta 112.9 deg +step 373 - lrate 0.000000, wchange 0.00001208, angledelta 114.7 deg +step 374 - lrate 0.000000, wchange 0.00000848, angledelta 113.9 deg +step 375 - lrate 0.000000, wchange 0.00000924, angledelta 120.3 deg +step 376 - lrate 0.000000, wchange 0.00000812, angledelta 119.8 deg +step 377 - lrate 0.000000, wchange 0.00000952, angledelta 108.5 deg +step 378 - lrate 0.000000, wchange 0.00000775, angledelta 116.6 deg +step 379 - lrate 0.000000, wchange 0.00000569, angledelta 111.8 deg +step 380 - lrate 0.000000, wchange 0.00000583, angledelta 103.8 deg +step 381 - lrate 0.000000, wchange 0.00000624, angledelta 115.1 deg +step 382 - lrate 0.000000, wchange 0.00000595, angledelta 100.5 deg +step 383 - lrate 0.000000, wchange 0.00000628, angledelta 114.3 deg +step 384 - lrate 0.000000, wchange 0.00000390, angledelta 112.6 deg +step 385 - lrate 0.000000, wchange 0.00000352, angledelta 111.3 deg +step 386 - lrate 0.000000, wchange 0.00000418, angledelta 109.1 deg +step 387 - lrate 0.000000, wchange 0.00000470, angledelta 118.2 deg +step 388 - lrate 0.000000, wchange 0.00000356, angledelta 101.2 deg +step 389 - lrate 0.000000, wchange 0.00000346, angledelta 109.8 deg +step 390 - lrate 0.000000, wchange 0.00000203, angledelta 108.8 deg +step 391 - lrate 0.000000, wchange 0.00000234, angledelta 108.4 deg +step 392 - lrate 0.000000, wchange 0.00000235, angledelta 111.6 deg +step 393 - lrate 0.000000, wchange 0.00000286, angledelta 96.5 deg +step 394 - lrate 0.000000, wchange 0.00000301, angledelta 117.2 deg +step 395 - lrate 0.000000, wchange 0.00000199, angledelta 115.0 deg +step 396 - lrate 0.000000, wchange 0.00000184, angledelta 107.0 deg +step 397 - lrate 0.000000, wchange 0.00000250, angledelta 110.3 deg +step 398 - lrate 0.000000, wchange 0.00000137, angledelta 105.6 deg +step 399 - lrate 0.000000, wchange 0.00000141, angledelta 102.8 deg +step 400 - lrate 0.000000, wchange 0.00000137, angledelta 111.3 deg +step 401 - lrate 0.000000, wchange 0.00000153, angledelta 99.0 deg +step 402 - lrate 0.000000, wchange 0.00000157, angledelta 111.8 deg +step 403 - lrate 0.000000, wchange 0.00000133, angledelta 105.3 deg +step 404 - lrate 0.000000, wchange 0.00000078, angledelta 96.2 deg +step 405 - lrate 0.000000, wchange 0.00000091, angledelta 95.1 deg +step 406 - lrate 0.000000, wchange 0.00000090, angledelta 106.1 deg +step 407 - lrate 0.000000, wchange 0.00000111, angledelta 109.0 deg +step 408 - lrate 0.000000, wchange 0.00000085, angledelta 99.1 deg +step 409 - lrate 0.000000, wchange 0.00000067, angledelta 93.8 deg +step 410 - lrate 0.000000, wchange 0.00000074, angledelta 108.1 deg +step 411 - lrate 0.000000, wchange 0.00000065, angledelta 101.8 deg +step 412 - lrate 0.000000, wchange 0.00000059, angledelta 103.0 deg +step 413 - lrate 0.000000, wchange 0.00000078, angledelta 114.3 deg +step 414 - lrate 0.000000, wchange 0.00000047, angledelta 114.1 deg +step 415 - lrate 0.000000, wchange 0.00000048, angledelta 94.3 deg +step 416 - lrate 0.000000, wchange 0.00000037, angledelta 102.2 deg +step 417 - lrate 0.000000, wchange 0.00000044, angledelta 93.1 deg +step 418 - lrate 0.000000, wchange 0.00000036, angledelta 107.7 deg +step 419 - lrate 0.000000, wchange 0.00000030, angledelta 97.8 deg +step 420 - lrate 0.000000, wchange 0.00000030, angledelta 99.9 deg +step 421 - lrate 0.000000, wchange 0.00000032, angledelta 96.8 deg +step 422 - lrate 0.000000, wchange 0.00000031, angledelta 105.9 deg +step 423 - lrate 0.000000, wchange 0.00000022, angledelta 100.5 deg +step 424 - lrate 0.000000, wchange 0.00000025, angledelta 107.3 deg +step 425 - lrate 0.000000, wchange 0.00000021, angledelta 108.8 deg +step 426 - lrate 0.000000, wchange 0.00000021, angledelta 94.6 deg +step 427 - lrate 0.000000, wchange 0.00000020, angledelta 92.1 deg +step 428 - lrate 0.000000, wchange 0.00000013, angledelta 110.3 deg +step 429 - lrate 0.000000, wchange 0.00000013, angledelta 101.1 deg +step 430 - lrate 0.000000, wchange 0.00000038, angledelta 89.7 deg +step 431 - lrate 0.000000, wchange 0.00000016, angledelta 70.3 deg +step 432 - lrate 0.000000, wchange 0.00000029, angledelta 117.5 deg +step 433 - lrate 0.000000, wchange 0.00000014, angledelta 72.5 deg +step 434 - lrate 0.000000, wchange 0.00000009, angledelta 102.1 deg +Sorting components in descending order of mean projected variance ... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Removing 1 channel(s)... +Event resorted by increasing latencies. +Scaling components to RMS microvolt +The input dataset will be split into 6568 epochs of 1 s +Epochs will overlap by 0%. +Inserting 6568 type '999' events: .......................................40 +.......................................80.............................. +.........120.......................................160.................... +...................200.......................................240.......... +.............................280.......................................320 +.......................................360.............................. +.........400.......................................440.................... +...................480.......................................520.......... +.............................560.......................................600 +.......................................640.............................. +.........680.......................................720.................... +...................760.......................................800.......... +.............................840.......................................880 +.......................................920.............................. +.........960.......................................1000.................... +...................1040.......................................1080.......... +.............................1120.......................................1160 +.......................................1200.............................. +.........1240.......................................1280.................... +...................1320.......................................1360.......... +.............................1400.......................................1440 +.......................................1480.............................. +.........1520.......................................1560.................... +...................1600.......................................1640.......... +.............................1680.......................................1720 +.......................................1760.............................. +.........1800.......................................1840.................... +...................1880.......................................1920.......... +.............................1960.......................................2000 +.......................................2040.............................. +.........2080.......................................2120.................... +...................2160.......................................2200.......... +.............................2240.......................................2280 +.......................................2320.............................. +.........2360.......................................2400.................... +...................2440.......................................2480.......... +.............................2520.......................................2560 +.......................................2600.............................. +.........2640.......................................2680.................... +...................2720.......................................2760.......... +.............................2800.......................................2840 +.......................................2880.............................. +.........2920.......................................2960.................... +...................3000.......................................3040.......... +.............................3080.......................................3120 +.......................................3160.............................. +.........3200.......................................3240.................... +...................3280.......................................3320.......... +.............................3360.......................................3400 +.......................................3440.............................. +.........3480.......................................3520.................... +...................3560.......................................3600.......... +.............................3640.......................................3680 +.......................................3720.............................. +.........3760.......................................3800.................... +...................3840.......................................3880.......... +.............................3920.......................................3960 +.......................................4000.............................. +.........4040.......................................4080.................... +...................4120.......................................4160.......... +.............................4200.......................................4240 +.......................................4280.............................. +.........4320.......................................4360.................... +...................4400.......................................4440.......... +.............................4480.......................................4520 +.......................................4560.............................. +.........4600.......................................4640.................... +...................4680.......................................4720.......... +.............................4760.......................................4800 +.......................................4840.............................. +.........4880.......................................4920.................... +...................4960.......................................5000.......... +.............................5040.......................................5080 +.......................................5120.............................. +.........5160.......................................5200.................... +...................5240.......................................5280.......... +.............................5320.......................................5360 +.......................................5400.............................. +.........5440.......................................5480.................... +...................5520.......................................5560.......... +.............................5600.......................................5640 +.......................................5680.............................. +.........5720.......................................5760.................... +...................5800.......................................5840.......... +.............................5880.......................................5920 +.......................................5960.............................. +.........6000.......................................6040.................... +...................6080.......................................6120.......... +.............................6160.......................................6200 +.......................................6240.............................. +.........6280.......................................6320.................... +...................6360.......................................6400.......... +.............................6440.......................................6480 +.......................................6520.............................. +.........6560........ +Sorting the event table. +Splitting the data into 6568 1.00-s epochs +pop_epoch():6568 epochs selected +Epoching... +pop_epoch():6568 epochs generated +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'duration' (filling with 0) +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Event resorted by increasing latencies. +Scaling components to RMS microvolt +pop_epoch(): checking epochs for data discontinuity +Removing 1 trial(s)... +Pop_select: removing 3 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'channel' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'bvmknum' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'code' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'code' made uniform +Scaling components to RMS microvolt +Scaling components to RMS microvolt +EEG.icaact not present. Recomputed from data. + +Features Extraction: +GDSF - General Discontinuity Spatial Feature... +SED - Spatial Eye Difference... +SAD - Spatial Average Difference... +Temporal Kurtosis... +Maximum epoch variance... +Computing EM thresholds... +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index +.Computing spectra (window length 100; fft length: 256; overlap 0): +. +Click on each trace for channel/component index + +par_id = + + 1x8 cell array + + Columns 1 through 6 + + {'sub-3000003'} {'all'} {'eeg'} {'s1'} {'r1'} {'e1'} + + Columns 7 through 8 + + {'filtered'} {'data - 1-s epochs'} + +. + +Artifact Identification: +Horizontal Eye Movements... +End Horizontal Eye Movement Detection +Vertical Eye Movements... +Eye Blinks... +End Blink Detection +Generic Discontinuities... + +Results in . +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Saving dataset... +Scaling components to RMS microvolt +Computing projection .... +pop_editeventfield(): creating new field 'observation' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'eventType' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'targetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'congruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'responded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'accuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'rt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'extraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'validTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'prevValidTrial' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextTargetDir' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextCongruency' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextResponded' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextAccuracy' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidRt' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextExtraResponse' +pop-editeventfield(): updating urevent structure +pop_editeventfield(): creating new field 'nextValidTrial' +pop-editeventfield(): updating urevent structure +Event resorted by increasing latencies. +pop_epoch():1693 epochs selected +Epoching... +pop_epoch():1693 epochs generated +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +eeg_checkset note: value format of event field 'observation' made uniform +eeg_checkset note: value format of event field 'eventType' made uniform +eeg_checkset note: value format of event field 'targetDir' made uniform +eeg_checkset note: value format of event field 'congruency' made uniform +eeg_checkset note: value format of event field 'prevTargetDir' made uniform +eeg_checkset note: value format of event field 'prevCongruency' made uniform +eeg_checkset note: value format of event field 'nextTargetDir' made uniform +eeg_checkset note: value format of event field 'nextCongruency' made uniform +Event resorted by increasing latencies. +pop_epoch(): checking epochs for data discontinuity +pop_rmbase(): Removing baseline... +1 channel selected +0/1693 trials marked for rejection +1 channel selected +0/1693 trials marked for rejection +1 channel selected +0/1693 trials marked for rejection +1 channel selected +1/1693 trials marked for rejection +1 channel selected +0/1693 trials marked for rejection +1 channel selected +0/1693 trials marked for rejection +1/1693 trials rejected +Removing 1 trial(s)... +Pop_select: removing 2 unreferenced events +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +2/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +3/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +10/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +4/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +1 channel selected +0/1692 trials marked for rejection +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6005 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6000 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6005 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6005 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6005 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Removing 1 channel(s)... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Scaling components to RMS microvolt +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6001 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6003 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6002 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +Removing 1691 trial(s)... +Pop_select: removing 6004 unreferenced events +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Using spherical interpolation +Scaling components to RMS microvolt +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Interpolating missing channels... +0/1692 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +0/1692 trials rejected +Scaling components to RMS microvolt +eeg_checkset: found empty values for field 'bvtime' + filling with values of other events in the same epochs +eeg_checkset: found empty values for field 'visible' + filling with values of other events in the same epochs +Event resorted by increasing latencies. +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Using spherical interpolation +Interpolating 6 channels... +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Scaling components to RMS microvolt +Re-referencing data +Scaling components to RMS microvolt +Error: some channels not used for ICA decomposition are used for rereferencing + the ICA decomposition has been removed +Saving dataset... +>> \ No newline at end of file diff --git a/code/thrive_eeg/thrive_batch_01.sh b/code/thrive_eeg/thrive_batch_01.sh new file mode 100644 index 0000000..177b055 --- /dev/null +++ b/code/thrive_eeg/thrive_batch_01.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + + +#SBATCH --job-name=Kia_thrive_MADE # create a short name for your job +#SBATCH --nodes=1 # node count +#SBATCH --ntasks=1 # total number of tasks across all nodes +#SBATCH --cpus-per-task=4 +#SBATCH --time=1000:00:00 # total run time limit (HH:MM:SS) +#SBATCH --mail-type=end # send email when job ends +#SBATCH --mail-user=khoss005@fiu.edu + +module load matlab-2021b +pwd; hostname; date + + +matlab -nodisplay < MADE_pipeline_v1_0_thrive_01.m \ No newline at end of file diff --git a/code/thrive_eeg/thrive_batch_02.sh b/code/thrive_eeg/thrive_batch_02.sh new file mode 100644 index 0000000..a2709c7 --- /dev/null +++ b/code/thrive_eeg/thrive_batch_02.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + + +#SBATCH --job-name=Kia_thrive_MADE # create a short name for your job +#SBATCH --nodes=1 # node count +#SBATCH --ntasks=1 # total number of tasks across all nodes +#SBATCH --cpus-per-task=4 +#SBATCH --time=1000:00:00 # total run time limit (HH:MM:SS) +#SBATCH --mail-type=end # send email when job ends +#SBATCH --mail-user=khoss005@fiu.edu + +module load matlab-2021b +pwd; hostname; date + + +matlab -nodisplay < MADE_pipeline_v1_0_thrive_02.m \ No newline at end of file diff --git a/code/thrive_eeg/thrive_batch_03.sh b/code/thrive_eeg/thrive_batch_03.sh new file mode 100644 index 0000000..b9a7584 --- /dev/null +++ b/code/thrive_eeg/thrive_batch_03.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + + +#SBATCH --job-name=Kia_thrive_MADE # create a short name for your job +#SBATCH --nodes=1 # node count +#SBATCH --ntasks=1 # total number of tasks across all nodes +#SBATCH --cpus-per-task=4 +#SBATCH --time=1000:00:00 # total run time limit (HH:MM:SS) +#SBATCH --mail-type=end # send email when job ends +#SBATCH --mail-user=khoss005@fiu.edu + +module load matlab-2021b +pwd; hostname; date + + +matlab -nodisplay < MADE_pipeline_v1_0_thrive_03.m \ No newline at end of file diff --git a/data-monitoring/.~lock.central-tracker_thrive-dataset.csv# b/data-monitoring/.~lock.central-tracker_thrive-dataset.csv# new file mode 100644 index 0000000..911d38a --- /dev/null +++ b/data-monitoring/.~lock.central-tracker_thrive-dataset.csv# @@ -0,0 +1 @@ +,dhunt,v002.panther.net,20.09.2023 16:09,file:///home/dhunt/.config/libreoffice/4; \ No newline at end of file diff --git a/data-monitoring/central-tracker_thrive-dataset.csv b/data-monitoring/central-tracker_thrive-dataset.csv new file mode 100755 index 0000000..40cc9df --- /dev/null +++ b/data-monitoring/central-tracker_thrive-dataset.csv @@ -0,0 +1,120 @@ +id,consent,assent,arrow-alert-v1-1_psychopy_s1_r1_e1,arrow-alert-v1-1_psychopy_s2_r1_e1,arrow-alert-v1-1_psychopy_s3_r1_e1,arrow-alert-v1-2_psychopy_s1_r1_e1,arrow-alert-v1-2_psychopy_s2_r1_e1,arrow-alert-v1-2_psychopy_s3_r1_e1,arrow-alert_psychopy_s1_r1_e1,arrow-alert_psychopy_s2_r1_e1,arrow-alert_psychopy_s3_r1_e1,all_audacity_s1_r1_e1,all_audacity_s2_r1_e1,all_audacity_s3_r1_e1,all_zoom_s1_r1_e1,all_zoom_s2_r1_e1,all_zoom_s3_r1_e1,all_eeg_s1_r1_e1,all_eeg_s2_r1_e1,all_eeg_s3_r1_e1,all_digi_s1_r1_e1,all_digi_s2_r1_e1,all_digi_s3_r1_e1,iqs_clinician_s1_r1_e1,iqs_clinician_s2_r1_e1,iqs_clinician_s3_r1_e1,bbs_RA_s1_r1_e1,bbs_RA_s2_r1_e1,bbs_RA_s3_r1_e1,bfne_b_s1_r1_e1,bfne_b_s2_r1_e1,bfne_b_s3_r1_e1,fpe_s1_r1_e1,fpe_s2_r1_e1,fpe_s3_r1_e1,spaic_s1_r1_e1,spaic_s2_r1_e1,spaic_s3_r1_e1,esi_s1_r1_e1,esi_s2_r1_e1,esi_s3_r1_e1,ats_s1_r1_e1,ats_s2_r1_e1,ats_s3_r1_e1,pints_s1_r1_e1,pints_s2_r1_e1,pints_s3_r1_e1,swcq_s1_r1_e1,swcq_s2_r1_e1,swcq_s3_r1_e1,rcads_s1_r1_e1,rcads_s2_r1_e1,rcads_s3_r1_e1,rpeq_s1_r1_e1,rpeq_s2_r1_e1,rpeq_s3_r1_e1,tsis_s1_r1_e1,tsis_s2_r1_e1,tsis_s3_r1_e1,casi_s1_r1_e1,casi_s2_r1_e1,casi_s3_r1_e1,sassy_s1_r1_e1,sassy_s2_r1_e1,sassy_s3_r1_e1,socrew_s1_r1_e1,socrew_s2_r1_e1,socrew_s3_r1_e1,erqca_s1_r1_e1,erqca_s2_r1_e1,erqca_s3_r1_e1,oopjr_s1_r1_e1,oopjr_s2_r1_e1,oopjr_s3_r1_e1,ocic_s1_r1_e1,ocic_s2_r1_e1,ocic_s3_r1_e1,mss_s1_r1_e1,mss_s2_r1_e1,mss_s3_r1_e1,edshvsc_s1_r1_e1,edshvsc_s2_r1_e1,edshvsc_s3_r1_e1,psb_s1_r1_e1,psb_s2_r1_e1,psb_s3_r1_e1,pds_s1_r1_e1,pds_s2_r1_e1,pds_s3_r1_e1,cyber_s1_r1_e1,cyber_s2_r1_e1,cyber_s3_r1_e1,dsmxc_s1_r1_e1,dsmxc_s2_r1_e1,dsmxc_s3_r1_e1,csisbnow_s1_r1_e1,csisbnow_s2_r1_e1,csisbnow_s3_r1_e1,csisblife_s1_r1_e1,csisblife_s2_r1_e1,csisblife_s3_r1_e1,lsasca_s1_r1_e1,lsasca_s2_r1_e1,lsasca_s3_r1_e1,abq_s1_r1_e1,abq_s2_r1_e1,abq_s3_r1_e1,bstad_s1_r1_e1,bstad_s2_r1_e1,bstad_s3_r1_e1,physinfo_s1_r1_e1,physinfo_s2_r1_e1,physinfo_s3_r1_e1,rpbic_s1_r1_e1,rpbic_s2_r1_e1,rpbic_s3_r1_e1,identitya_s1_r1_e1,identitya_s2_r1_e1,identitya_s3_r1_e1,masi_b_s1_r1_e1,masi_b_s2_r1_e1,masi_b_s3_r1_e1,via_s1_r1_e1,via_s2_r1_e1,via_s3_r1_e1,texi_b_s1_r1_e1,texi_b_s2_r1_e1,texi_b_s3_r1_e1,yssm_s1_r1_e1,yssm_s2_r1_e1,yssm_s3_r1_e1,selfnowa_s1_r1_e1,selfnowa_s2_r1_e1,selfnowa_s3_r1_e1,initstatec_s1_r1_e1,initstatec_s2_r1_e1,initstatec_s3_r1_e1,posttaske_s1_r1_e1,posttaske_s2_r1_e1,posttaske_s3_r1_e1,initstatec_s1_r1_e2,initstatec_s2_r1_e2,initstatec_s3_r1_e2,posttaske_s1_r1_e2,posttaske_s2_r1_e2,posttaske_s3_r1_e2,dyada_s1_r1_e1,dyada_s2_r1_e1,dyada_s3_r1_e1,initstated_s1_r1_e1,initstated_s2_r1_e1,initstated_s3_r1_e1,posttaskf_s1_r1_e1,posttaskf_s2_r1_e1,posttaskf_s3_r1_e1,dyadb_s1_r1_e1,dyadb_s2_r1_e1,dyadb_s3_r1_e1,selfnowa_s1_r1_e2,selfnowa_s2_r1_e2,selfnowa_s3_r1_e2,infosht_s1_r1_e1,infosht_s2_r1_e1,infosht_s3_r1_e1,txrxa_s1_r1_e1,txrxa_s2_r1_e1,txrxa_s3_r1_e1,demo_d_s1_r1_e1,demo_d_s2_r1_e1,demo_d_s3_r1_e1,bfnep_b_s1_r1_e1,bfnep_b_s2_r1_e1,bfnep_b_s3_r1_e1,fpep_s1_r1_e1,fpep_s2_r1_e1,fpep_s3_r1_e1,spaip_s1_r1_e1,spaip_s2_r1_e1,spaip_s3_r1_e1,esip_s1_r1_e1,esip_s2_r1_e1,esip_s3_r1_e1,pscei_s1_r1_e1,pscei_s2_r1_e1,pscei_s3_r1_e1,dersp_s1_r1_e1,dersp_s2_r1_e1,dersp_s3_r1_e1,rcadsp_s1_r1_e1,rcadsp_s2_r1_e1,rcadsp_s3_r1_e1,rpeqp_s1_r1_e1,rpeqp_s2_r1_e1,rpeqp_s3_r1_e1,edshvsp_s1_r1_e1,edshvsp_s2_r1_e1,edshvsp_s3_r1_e1,physinfop_s1_r1_e1,physinfop_s2_r1_e1,physinfop_s3_r1_e1,psbp_s1_r1_e1,psbp_s2_r1_e1,psbp_s3_r1_e1,pdsp_s1_r1_e1,pdsp_s2_r1_e1,pdsp_s3_r1_e1,lsasp_s1_r1_e1,lsasp_s2_r1_e1,lsasp_s3_r1_e1,eatq_s1_r1_e1,eatq_s2_r1_e1,eatq_s3_r1_e1,fasap_s1_r1_e1,fasap_s2_r1_e1,fasap_s3_r1_e1,rsrip_s1_r1_e1,rsrip_s2_r1_e1,rsrip_s3_r1_e1,scaredp_s1_r1_e1,scaredp_s2_r1_e1,scaredp_s3_r1_e1,texip_b_s1_r1_e1,texip_b_s2_r1_e1,texip_b_s3_r1_e1,yssmp_s1_r1_e1,yssmp_s2_r1_e1,yssmp_s3_r1_e1,adexi_b_s1_r1_e1,adexi_b_s2_r1_e1,adexi_b_s3_r1_e1,bfne_b_parent_s1_r1_e1,bfne_b_parent_s2_r1_e1,bfne_b_parent_s3_r1_e1,erq_s1_r1_e1,erq_s2_r1_e1,erq_s3_r1_e1,fpe_parent_s1_r1_e1,fpe_parent_s2_r1_e1,fpe_parent_s3_r1_e1,masi_b_parent_s1_r1_e1,masi_b_parent_s2_r1_e1,masi_b_parent_s3_r1_e1,phq8_s1_r1_e1,phq8_s2_r1_e1,phq8_s3_r1_e1,pints_parent_s1_r1_e1,pints_parent_s2_r1_e1,pints_parent_s3_r1_e1,pss_s1_r1_e1,pss_s2_r1_e1,pss_s3_r1_e1,scaared_b_s1_r1_e1,scaared_b_s2_r1_e1,scaared_b_s3_r1_e1,via_parent_s1_r1_e1,via_parent_s2_r1_e1,via_parent_s3_r1_e1,rpbip_s1_r1_e1,rpbip_s2_r1_e1,rpbip_s3_r1_e1,bfne_b_scrdTotal_s1_r1_e1,bfne_b_scrdTotal_s2_r1_e1,bfne_b_scrdTotal_s3_r1_e1,fpe_scrdTotal_s1_r1_e1,fpe_scrdTotal_s2_r1_e1,fpe_scrdTotal_s3_r1_e1,spaic_scrdTotal_s1_r1_e1,spaic_scrdTotal_s2_r1_e1,spaic_scrdTotal_s3_r1_e1,esi_scrdTotal_s1_r1_e1,esi_scrdTotal_s2_r1_e1,esi_scrdTotal_s3_r1_e1,ats_scrdTotal_s1_r1_e1,ats_scrdTotal_s2_r1_e1,ats_scrdTotal_s3_r1_e1,ats_scrdStd_s1_r1_e1,ats_scrdStd_s2_r1_e1,ats_scrdStd_s3_r1_e1,ats_scrdGen_s1_r1_e1,ats_scrdGen_s2_r1_e1,ats_scrdGen_s3_r1_e1,ats_scrdCrit_s1_r1_e1,ats_scrdCrit_s2_r1_e1,ats_scrdCrit_s3_r1_e1,pints_scrdTotal_s1_r1_e1,pints_scrdTotal_s2_r1_e1,pints_scrdTotal_s3_r1_e1,swcq_scrdTotal_s1_r1_e1,swcq_scrdTotal_s2_r1_e1,swcq_scrdTotal_s3_r1_e1,swcq_scrdAca_s1_r1_e1,swcq_scrdAca_s2_r1_e1,swcq_scrdAca_s3_r1_e1,swcq_scrdSoc_s1_r1_e1,swcq_scrdSoc_s2_r1_e1,swcq_scrdSoc_s3_r1_e1,rcads_scrdTotal_s1_r1_e1,rcads_scrdTotal_s2_r1_e1,rcads_scrdTotal_s3_r1_e1,rcads_scrdAnx_s1_r1_e1,rcads_scrdAnx_s2_r1_e1,rcads_scrdAnx_s3_r1_e1,rcads_scrdDep_s1_r1_e1,rcads_scrdDep_s2_r1_e1,rcads_scrdDep_s3_r1_e1,rpeq_scrdOv_s1_r1_e1,rpeq_scrdOv_s2_r1_e1,rpeq_scrdOv_s3_r1_e1,rpeq_scrdRel_s1_r1_e1,rpeq_scrdRel_s2_r1_e1,rpeq_scrdRel_s3_r1_e1,rpeq_scrdRep_s1_r1_e1,rpeq_scrdRep_s2_r1_e1,rpeq_scrdRep_s3_r1_e1,rpeq_scrdPro_s1_r1_e1,rpeq_scrdPro_s2_r1_e1,rpeq_scrdPro_s3_r1_e1,tsis_scrdSIP_s1_r1_e1,tsis_scrdSIP_s2_r1_e1,tsis_scrdSIP_s3_r1_e1,casi_scrdTotal_s1_r1_e1,casi_scrdTotal_s2_r1_e1,casi_scrdTotal_s3_r1_e1,sassy_scrdSocRej_s1_r1_e1,sassy_scrdSocRej_s2_r1_e1,sassy_scrdSocRej_s3_r1_e1,socrew_scrdTotal_s1_r1_e1,socrew_scrdTotal_s2_r1_e1,socrew_scrdTotal_s3_r1_e1,socrew_scrdLike_s1_r1_e1,socrew_scrdLike_s2_r1_e1,socrew_scrdLike_s3_r1_e1,socrew_scrdWant_s1_r1_e1,socrew_scrdWant_s2_r1_e1,socrew_scrdWant_s3_r1_e1,socrew_scrdEff_s1_r1_e1,socrew_scrdEff_s2_r1_e1,socrew_scrdEff_s3_r1_e1,erqca_scrdCogRea_s1_r1_e1,erqca_scrdCogRea_s2_r1_e1,erqca_scrdCogRea_s3_r1_e1,erqca_scrdExpSup_s1_r1_e1,erqca_scrdExpSup_s2_r1_e1,erqca_scrdExpSup_s3_r1_e1,oopjr_scrdTotal_s1_r1_e1,oopjr_scrdTotal_s2_r1_e1,oopjr_scrdTotal_s3_r1_e1,ocic_scrdTotal_s1_r1_e1,ocic_scrdTotal_s2_r1_e1,ocic_scrdTotal_s3_r1_e1,ocic_scrdDoubt_s1_r1_e1,ocic_scrdDoubt_s2_r1_e1,ocic_scrdDoubt_s3_r1_e1,ocic_scrdObs_s1_r1_e1,ocic_scrdObs_s2_r1_e1,ocic_scrdObs_s3_r1_e1,ocic_scrdHoard_s1_r1_e1,ocic_scrdHoard_s2_r1_e1,ocic_scrdHoard_s3_r1_e1,ocic_scrdWash_s1_r1_e1,ocic_scrdWash_s2_r1_e1,ocic_scrdWash_s3_r1_e1,ocic_scrdOrder_s1_r1_e1,ocic_scrdOrder_s2_r1_e1,ocic_scrdOrder_s3_r1_e1,ocic_scrdNeu_s1_r1_e1,ocic_scrdNeu_s2_r1_e1,ocic_scrdNeu_s3_r1_e1,mss_scrdSDS_s1_r1_e1,mss_scrdSDS_s2_r1_e1,mss_scrdSDS_s3_r1_e1,edshvsc_scrdEdsEver_s1_r1_e1,edshvsc_scrdEdsEver_s2_r1_e1,edshvsc_scrdEdsEver_s3_r1_e1,edshvsc_scrdEdsFreq_s1_r1_e1,edshvsc_scrdEdsFreq_s2_r1_e1,edshvsc_scrdEdsFreq_s3_r1_e1,edshvsc_scrdEdsChron_s1_r1_e1,edshvsc_scrdEdsChron_s2_r1_e1,edshvsc_scrdEdsChron_s3_r1_e1,edshvsc_scrdHvsEver_s1_r1_e1,edshvsc_scrdHvsEver_s2_r1_e1,edshvsc_scrdHvsEver_s3_r1_e1,edshvsc_scrdHvsFreq_s1_r1_e1,edshvsc_scrdHvsFreq_s2_r1_e1,edshvsc_scrdHvsFreq_s3_r1_e1,psb_scrdTotal_s1_r1_e1,psb_scrdTotal_s2_r1_e1,psb_scrdTotal_s3_r1_e1,pds_scrdFem_s1_r1_e1,pds_scrdFem_s2_r1_e1,pds_scrdFem_s3_r1_e1,pds_scrdMal_s1_r1_e1,pds_scrdMal_s2_r1_e1,pds_scrdMal_s3_r1_e1,lsasca_scrdTotal_s1_r1_e1,lsasca_scrdTotal_s2_r1_e1,lsasca_scrdTotal_s3_r1_e1,lsasca_scrdTotAnx_s1_r1_e1,lsasca_scrdTotAnx_s2_r1_e1,lsasca_scrdTotAnx_s3_r1_e1,lsasca_scrdAnxInt_s1_r1_e1,lsasca_scrdAnxInt_s2_r1_e1,lsasca_scrdAnxInt_s3_r1_e1,lsasca_scrdAnxPer_s1_r1_e1,lsasca_scrdAnxPer_s2_r1_e1,lsasca_scrdAnxPer_s3_r1_e1,lsasca_scrdTotAvo_s1_r1_e1,lsasca_scrdTotAvo_s2_r1_e1,lsasca_scrdTotAvo_s3_r1_e1,lsasca_scrdAvoInt_s1_r1_e1,lsasca_scrdAvoInt_s2_r1_e1,lsasca_scrdAvoInt_s3_r1_e1,lsasca_scrdAvoPer_s1_r1_e1,lsasca_scrdAvoPer_s2_r1_e1,lsasca_scrdAvoPer_s3_r1_e1,abq_scrdTotal_s1_r1_e1,abq_scrdTotal_s2_r1_e1,abq_scrdTotal_s3_r1_e1,abq_scrdEng_s1_r1_e1,abq_scrdEng_s2_r1_e1,abq_scrdEng_s3_r1_e1,abq_scrdDis_s1_r1_e1,abq_scrdDis_s2_r1_e1,abq_scrdDis_s3_r1_e1,rpbic_scrdAcc_s1_r1_e1,rpbic_scrdAcc_s2_r1_e1,rpbic_scrdAcc_s3_r1_e1,rpbic_scrdPsyC_s1_r1_e1,rpbic_scrdPsyC_s2_r1_e1,rpbic_scrdPsyC_s3_r1_e1,masi_b_scrdTotal_s1_r1_e1,masi_b_scrdTotal_s2_r1_e1,masi_b_scrdTotal_s3_r1_e1,masi_b_scrdAccPro_s1_r1_e1,masi_b_scrdAccPro_s2_r1_e1,masi_b_scrdAccPro_s3_r1_e1,masi_b_scrdAccCon_s1_r1_e1,masi_b_scrdAccCon_s2_r1_e1,masi_b_scrdAccCon_s3_r1_e1,via_scrdHer_s1_r1_e1,via_scrdHer_s2_r1_e1,via_scrdHer_s3_r1_e1,via_scrdMain_s1_r1_e1,via_scrdMain_s2_r1_e1,via_scrdMain_s3_r1_e1,texi_b_scrdInh_s1_r1_e1,texi_b_scrdInh_s2_r1_e1,texi_b_scrdInh_s3_r1_e1,texi_b_scrdWm_s1_r1_e1,texi_b_scrdWm_s2_r1_e1,texi_b_scrdWm_s3_r1_e1,bfnep_b_scrdTotal_s1_r1_e1,bfnep_b_scrdTotal_s2_r1_e1,bfnep_b_scrdTotal_s3_r1_e1,fpep_scrdTotal_s1_r1_e1,fpep_scrdTotal_s2_r1_e1,fpep_scrdTotal_s3_r1_e1,spaip_scrdTotal_s1_r1_e1,spaip_scrdTotal_s2_r1_e1,spaip_scrdTotal_s3_r1_e1,esip_scrdTotal_s1_r1_e1,esip_scrdTotal_s2_r1_e1,esip_scrdTotal_s3_r1_e1,pscei_scrdTotal_s1_r1_e1,pscei_scrdTotal_s2_r1_e1,pscei_scrdTotal_s3_r1_e1,dersp_scrdCat_s1_r1_e1,dersp_scrdCat_s2_r1_e1,dersp_scrdCat_s3_r1_e1,dersp_scrdNeg_s1_r1_e1,dersp_scrdNeg_s2_r1_e1,dersp_scrdNeg_s3_r1_e1,dersp_scrdAtt_s1_r1_e1,dersp_scrdAtt_s2_r1_e1,dersp_scrdAtt_s3_r1_e1,dersp_scrdDis_s1_r1_e1,dersp_scrdDis_s2_r1_e1,dersp_scrdDis_s3_r1_e1,rcadsp_scrdTotal_s1_r1_e1,rcadsp_scrdTotal_s2_r1_e1,rcadsp_scrdTotal_s3_r1_e1,rcadsp_scrdAnx_s1_r1_e1,rcadsp_scrdAnx_s2_r1_e1,rcadsp_scrdAnx_s3_r1_e1,rcadsp_scrdDep_s1_r1_e1,rcadsp_scrdDep_s2_r1_e1,rcadsp_scrdDep_s3_r1_e1,rpeqp_scrdOv_s1_r1_e1,rpeqp_scrdOv_s2_r1_e1,rpeqp_scrdOv_s3_r1_e1,rpeqp_scrdRel_s1_r1_e1,rpeqp_scrdRel_s2_r1_e1,rpeqp_scrdRel_s3_r1_e1,rpeqp_scrdRep_s1_r1_e1,rpeqp_scrdRep_s2_r1_e1,rpeqp_scrdRep_s3_r1_e1,rpeqp_scrdPro_s1_r1_e1,rpeqp_scrdPro_s2_r1_e1,rpeqp_scrdPro_s3_r1_e1,edshvsp_scrdEdsEver_s1_r1_e1,edshvsp_scrdEdsEver_s2_r1_e1,edshvsp_scrdEdsEver_s3_r1_e1,edshvsp_scrdEdsFreq_s1_r1_e1,edshvsp_scrdEdsFreq_s2_r1_e1,edshvsp_scrdEdsFreq_s3_r1_e1,edshvsp_scrdEdsChron_s1_r1_e1,edshvsp_scrdEdsChron_s2_r1_e1,edshvsp_scrdEdsChron_s3_r1_e1,edshvsp_scrdHvsEver_s1_r1_e1,edshvsp_scrdHvsEver_s2_r1_e1,edshvsp_scrdHvsEver_s3_r1_e1,edshvsp_scrdHvsFreq_s1_r1_e1,edshvsp_scrdHvsFreq_s2_r1_e1,edshvsp_scrdHvsFreq_s3_r1_e1,psbp_scrdTotal_s1_r1_e1,psbp_scrdTotal_s2_r1_e1,psbp_scrdTotal_s3_r1_e1,pdsp_scrdFem_s1_r1_e1,pdsp_scrdFem_s2_r1_e1,pdsp_scrdFem_s3_r1_e1,pdsp_scrdMal_s1_r1_e1,pdsp_scrdMal_s2_r1_e1,pdsp_scrdMal_s3_r1_e1,lsasp_scrdTotal_s1_r1_e1,lsasp_scrdTotal_s2_r1_e1,lsasp_scrdTotal_s3_r1_e1,lsasp_scrdTotAnx_s1_r1_e1,lsasp_scrdTotAnx_s2_r1_e1,lsasp_scrdTotAnx_s3_r1_e1,lsasp_scrdAnxInt_s1_r1_e1,lsasp_scrdAnxInt_s2_r1_e1,lsasp_scrdAnxInt_s3_r1_e1,lsasp_scrdAnxPer_s1_r1_e1,lsasp_scrdAnxPer_s2_r1_e1,lsasp_scrdAnxPer_s3_r1_e1,lsasp_scrdTotAvo_s1_r1_e1,lsasp_scrdTotAvo_s2_r1_e1,lsasp_scrdTotAvo_s3_r1_e1,lsasp_scrdAvoInt_s1_r1_e1,lsasp_scrdAvoInt_s2_r1_e1,lsasp_scrdAvoInt_s3_r1_e1,lsasp_scrdAvoPer_s1_r1_e1,lsasp_scrdAvoPer_s2_r1_e1,lsasp_scrdAvoPer_s3_r1_e1,eatq_scrdAC_s1_r1_e1,eatq_scrdAC_s2_r1_e1,eatq_scrdAC_s3_r1_e1,eatq_scrdAff_s1_r1_e1,eatq_scrdAff_s2_r1_e1,eatq_scrdAff_s3_r1_e1,eatq_scrdAgg_s1_r1_e1,eatq_scrdAgg_s2_r1_e1,eatq_scrdAgg_s3_r1_e1,eatq_scrdAtt_s1_r1_e1,eatq_scrdAtt_s2_r1_e1,eatq_scrdAtt_s3_r1_e1,eatq_scrdDM_s1_r1_e1,eatq_scrdDM_s2_r1_e1,eatq_scrdDM_s3_r1_e1,eatq_scrdFear_s1_r1_e1,eatq_scrdFear_s2_r1_e1,eatq_scrdFear_s3_r1_e1,eatq_scrdFrus_s1_r1_e1,eatq_scrdFrus_s2_r1_e1,eatq_scrdFrus_s3_r1_e1,fasap_scrdAcc_s1_r1_e1,fasap_scrdAcc_s2_r1_e1,fasap_scrdAcc_s3_r1_e1,fasap_scrdPart_s1_r1_e1,fasap_scrdPart_s2_r1_e1,fasap_scrdPart_s3_r1_e1,fasap_scrdMod_s1_r1_e1,fasap_scrdMod_s2_r1_e1,fasap_scrdMod_s3_r1_e1,fasap_scrdDist_s1_r1_e1,fasap_scrdDist_s2_r1_e1,fasap_scrdDist_s3_r1_e1,fasap_scrdCons_s1_r1_e1,fasap_scrdCons_s2_r1_e1,fasap_scrdCons_s3_r1_e1,rsrip_scrdTotal_s1_r1_e1,rsrip_scrdTotal_s2_r1_e1,rsrip_scrdTotal_s3_r1_e1,rsrip_scrdSocSch_s1_r1_e1,rsrip_scrdSocSch_s2_r1_e1,rsrip_scrdSocSch_s3_r1_e1,rsrip_scrdFear_s1_r1_e1,rsrip_scrdFear_s2_r1_e1,rsrip_scrdFear_s3_r1_e1,scaredp_scrdTotal_s1_r1_e1,scaredp_scrdTotal_s2_r1_e1,scaredp_scrdTotal_s3_r1_e1,scaredp_scrdPan_s1_r1_e1,scaredp_scrdPan_s2_r1_e1,scaredp_scrdPan_s3_r1_e1,scaredp_scrdGA_s1_r1_e1,scaredp_scrdGA_s2_r1_e1,scaredp_scrdGA_s3_r1_e1,scaredp_scrdSep_s1_r1_e1,scaredp_scrdSep_s2_r1_e1,scaredp_scrdSep_s3_r1_e1,scaredp_scrdSA_s1_r1_e1,scaredp_scrdSA_s2_r1_e1,scaredp_scrdSA_s3_r1_e1,scaredp_scrdAvo_s1_r1_e1,scaredp_scrdAvo_s2_r1_e1,scaredp_scrdAvo_s3_r1_e1,texip_b_scrdInh_s1_r1_e1,texip_b_scrdInh_s2_r1_e1,texip_b_scrdInh_s3_r1_e1,texip_b_scrdWm_s1_r1_e1,texip_b_scrdWm_s2_r1_e1,texip_b_scrdWm_s3_r1_e1,adexi_b_scrdTotal_s1_r1_e1,adexi_b_scrdTotal_s2_r1_e1,adexi_b_scrdTotal_s3_r1_e1,adexi_b_scrdInh_s1_r1_e1,adexi_b_scrdInh_s2_r1_e1,adexi_b_scrdInh_s3_r1_e1,adexi_b_scrdWm_s1_r1_e1,adexi_b_scrdWm_s2_r1_e1,adexi_b_scrdWm_s3_r1_e1,bfne_b_parent_scrdTotal_s1_r1_e1,bfne_b_parent_scrdTotal_s2_r1_e1,bfne_b_parent_scrdTotal_s3_r1_e1,erq_scrdCogRea_s1_r1_e1,erq_scrdCogRea_s2_r1_e1,erq_scrdCogRea_s3_r1_e1,erq_scrdExpSup_s1_r1_e1,erq_scrdExpSup_s2_r1_e1,erq_scrdExpSup_s3_r1_e1,fpe_parent_scrdTotal_s1_r1_e1,fpe_parent_scrdTotal_s2_r1_e1,fpe_parent_scrdTotal_s3_r1_e1,masi_b_parent_scrdTotal_s1_r1_e1,masi_b_parent_scrdTotal_s2_r1_e1,masi_b_parent_scrdTotal_s3_r1_e1,masi_b_parent_scrdAccPro_s1_r1_e1,masi_b_parent_scrdAccPro_s2_r1_e1,masi_b_parent_scrdAccPro_s3_r1_e1,masi_b_parent_scrdAccCon_s1_r1_e1,masi_b_parent_scrdAccCon_s2_r1_e1,masi_b_parent_scrdAccCon_s3_r1_e1,phq8_scrdTotal_s1_r1_e1,phq8_scrdTotal_s2_r1_e1,phq8_scrdTotal_s3_r1_e1,pints_parent_scrdTotal_s1_r1_e1,pints_parent_scrdTotal_s2_r1_e1,pints_parent_scrdTotal_s3_r1_e1,pss_scrdTotal_s1_r1_e1,pss_scrdTotal_s2_r1_e1,pss_scrdTotal_s3_r1_e1,scaared_b_scrdTotal_s1_r1_e1,scaared_b_scrdTotal_s2_r1_e1,scaared_b_scrdTotal_s3_r1_e1,scaared_b_scrdPaSo_s1_r1_e1,scaared_b_scrdPaSo_s2_r1_e1,scaared_b_scrdPaSo_s3_r1_e1,scaared_b_scrdGA_s1_r1_e1,scaared_b_scrdGA_s2_r1_e1,scaared_b_scrdGA_s3_r1_e1,scaared_b_scrdSep_s1_r1_e1,scaared_b_scrdSep_s2_r1_e1,scaared_b_scrdSep_s3_r1_e1,scaared_b_scrdSoc_s1_r1_e1,scaared_b_scrdSoc_s2_r1_e1,scaared_b_scrdSoc_s3_r1_e1,via_parent_scrdHer_s1_r1_e1,via_parent_scrdHer_s2_r1_e1,via_parent_scrdHer_s3_r1_e1,via_parent_scrdMain_s1_r1_e1,via_parent_scrdMain_s2_r1_e1,via_parent_scrdMain_s3_r1_e1,rpbip_scrdAcc_s1_r1_e1,rpbip_scrdAcc_s2_r1_e1,rpbip_scrdAcc_s3_r1_e1,rpbip_scrdPsyC_s1_r1_e1,rpbip_scrdPsyC_s2_r1_e1,rpbip_scrdPsyC_s3_r1_e1,pidentityiqs_s1_r1_e1,pidentityiqs_s2_r1_e1,pidentityiqs_s3_r1_e1,pidentitybbs_s1_r1_e1,pidentitybbs_s2_r1_e1,pidentitybbs_s3_r1_e1,plangiqs_s1_r1_e1,plangiqs_s2_r1_e1,plangiqs_s3_r1_e1,plangbbs_s1_r1_e1,plangbbs_s2_r1_e1,plangbbs_s3_r1_e1,all_eeg_total_epochs_after_artifact_rejection_s1_r1_e1,all_eeg_preprocessing_s1_r1_e1_complete +3000001,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,1.0,,0,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1598.0,2.0 +3000002,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,1.0,,0,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,0,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1834.0,2.0 +3000003,1,1,1,,,0,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,1.0,,0,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1692.0,2.0 +3000004,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,1.0,,0,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,0.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1604.0,2.0 +3000005,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,1.0,,0,1.0,,0,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,1.0,,1,0.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,0,0.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1,1.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,0.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,1646.0,2.0 +3000006,1,1,1,,,0,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000007,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000008,0,1,1,,,0,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,736.0,2.0 +3000009,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,0,,,0,,,0,,,1,,,1,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000010,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000011,1,1,1,,,0,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,2005.0,2.0 +3000012,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1693.0,2.0 +3000013,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000014,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000015,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,454.0,2.0 +3000016,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000017,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000018,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000019,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000020,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000021,1,1,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,0,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1,0.0,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1714.0,2.0 +3000022,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1867.0,2.0 +3000023,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,1640.0,2.0 +3000024,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,0.0,,,1.0,,,0.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,1,,,1.0,,,, +3000025,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000026,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000027,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000028,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000029,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000030,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000031,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000032,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000033,1,1,0,,,1,,,1,,,0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000034,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000035,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000036,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000037,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000038,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000039,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000040,1,1,0,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000041,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000042,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000043,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000044,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000045,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000046,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000047,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000048,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000049,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000050,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000051,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000052,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000053,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000054,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000055,1,1,0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000056,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000057,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000058,1,1,0,,,0,,,0,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000059,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000060,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000061,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000062,1,1,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000063,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000064,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000065,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000066,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000067,1,1,0,,,0,,,0,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000068,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000069,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,1,,,1.0,,,, +3000070,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000071,1,1,0,,,0,,,0,,,1,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000072,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,2,,,2.0,,,, +3000073,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000074,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000075,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000076,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,2,,,,,,, +3000077,1,1,0,,,1,,,1,,,1,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000078,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,2,,,,,,, +3000079,1,1,0,,,1,,,1,,,1,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,0,,,1,,,1,,,1,,,0,,,1,,,0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000080,1,1,0,,,1,,,1,,,1,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000081,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000082,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000083,1,1,0,,,1,,,1,,,1,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000084,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000085,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000086,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000087,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000088,1,1,0,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000089,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000090,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000091,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000092,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000093,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000094,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,2,,,,,,, +3000095,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,1,,,1.0,,,, +3000096,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,2,,,,,,, +3000097,1,1,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000098,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000099,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000100,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000101,1,1,0,,,1,,,1,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,0.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000102,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000103,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000104,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,2,,,2.0,,,, +3000105,1,1,0,,,1,,,1,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,0.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,1.0,,,8,,,8.0,,,1,,,1.0,,,, +3000106,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,1,,,1.0,,,, +3000107,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000108,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000109,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,1,,,1.0,,,, +3000110,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,1,,,1.0,,,, +3000111,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000112,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000113,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,2,,,2.0,,,, +3000114,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000115,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000116,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000117,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,1,,,,,,, +3000118,1,1,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0,,,1,,,1,,,1,,,1,,,1,,,1,,,1,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,0.0,,,8,,,8.0,,,2,,,2.0,,,, +3000119,0,0,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,2,,,,,,, diff --git a/data-monitoring/central-tracker_thrive-dataset_viewable.csv b/data-monitoring/central-tracker_thrive-dataset_viewable.csv new file mode 100644 index 0000000..94943b5 --- /dev/null +++ b/data-monitoring/central-tracker_thrive-dataset_viewable.csv @@ -0,0 +1,120 @@ +id,consent,assent,arrow-alert-v1-1_psychopy_s1_r1_e1,arrow-alert-v1-2_psychopy_s1_r1_e1,arrow-alert_psychopy_s1_r1_e1,all_audacity_s1_r1_e1,all_zoom_s1_r1_e1,all_eeg_s1_r1_e1,all_digi_s1_r1_e1,iqs_clinician_s1_r1_e1,bbs_RA_s1_r1_e1,bfne_b_s1_r1_e1,fpe_s1_r1_e1,spaic_s1_r1_e1,esi_s1_r1_e1,ats_s1_r1_e1,pints_s1_r1_e1,swcq_s1_r1_e1,rcads_s1_r1_e1,rpeq_s1_r1_e1,tsis_s1_r1_e1,casi_s1_r1_e1,sassy_s1_r1_e1,socrew_s1_r1_e1,erqca_s1_r1_e1,oopjr_s1_r1_e1,ocic_s1_r1_e1,mss_s1_r1_e1,edshvsc_s1_r1_e1,psb_s1_r1_e1,pds_s1_r1_e1,cyber_s1_r1_e1,dsmxc_s1_r1_e1,csisbnow_s1_r1_e1,csisblife_s1_r1_e1,lsasca_s1_r1_e1,abq_s1_r1_e1,bstad_s1_r1_e1,physinfo_s1_r1_e1,rpbic_s1_r1_e1,identitya_s1_r1_e1,masi_b_s1_r1_e1,via_s1_r1_e1,texi_b_s1_r1_e1,yssm_s1_r1_e1,selfnowa_s1_r1_e1,initstatec_s1_r1_e1,posttaske_s1_r1_e1,initstatec_s1_r1_e2,posttaske_s1_r1_e2,dyada_s1_r1_e1,initstated_s1_r1_e1,posttaskf_s1_r1_e1,dyadb_s1_r1_e1,selfnowa_s1_r1_e2,infosht_s1_r1_e1,txrxa_s1_r1_e1,demo_d_s1_r1_e1,bfnep_b_s1_r1_e1,fpep_s1_r1_e1,spaip_s1_r1_e1,esip_s1_r1_e1,pscei_s1_r1_e1,dersp_s1_r1_e1,rcadsp_s1_r1_e1,rpeqp_s1_r1_e1,edshvsp_s1_r1_e1,physinfop_s1_r1_e1,psbp_s1_r1_e1,pdsp_s1_r1_e1,lsasp_s1_r1_e1,eatq_s1_r1_e1,fasap_s1_r1_e1,rsrip_s1_r1_e1,scaredp_s1_r1_e1,texip_b_s1_r1_e1,yssmp_s1_r1_e1,adexi_b_s1_r1_e1,bfne_b_parent_s1_r1_e1,erq_s1_r1_e1,fpe_parent_s1_r1_e1,masi_b_parent_s1_r1_e1,phq8_s1_r1_e1,pints_parent_s1_r1_e1,pss_s1_r1_e1,scaared_b_s1_r1_e1,via_parent_s1_r1_e1,rpbip_s1_r1_e1,bfne_b_scrdTotal_s1_r1_e1,bfne_b_scrdTotal_s2_r1_e1,fpe_scrdTotal_s1_r1_e1,fpe_scrdTotal_s2_r1_e1,spaic_scrdTotal_s1_r1_e1,spaic_scrdTotal_s2_r1_e1,esi_scrdTotal_s1_r1_e1,esi_scrdTotal_s2_r1_e1,ats_scrdTotal_s1_r1_e1,ats_scrdTotal_s2_r1_e1,ats_scrdStd_s1_r1_e1,ats_scrdStd_s2_r1_e1,ats_scrdGen_s1_r1_e1,ats_scrdGen_s2_r1_e1,ats_scrdCrit_s1_r1_e1,ats_scrdCrit_s2_r1_e1,pints_scrdTotal_s1_r1_e1,pints_scrdTotal_s2_r1_e1,swcq_scrdTotal_s1_r1_e1,swcq_scrdTotal_s2_r1_e1,swcq_scrdAca_s1_r1_e1,swcq_scrdAca_s2_r1_e1,swcq_scrdSoc_s1_r1_e1,swcq_scrdSoc_s2_r1_e1,rcads_scrdTotal_s1_r1_e1,rcads_scrdTotal_s2_r1_e1,rcads_scrdAnx_s1_r1_e1,rcads_scrdAnx_s2_r1_e1,rcads_scrdDep_s1_r1_e1,rcads_scrdDep_s2_r1_e1,rpeq_scrdOv_s1_r1_e1,rpeq_scrdOv_s2_r1_e1,rpeq_scrdRel_s1_r1_e1,rpeq_scrdRel_s2_r1_e1,rpeq_scrdRep_s1_r1_e1,rpeq_scrdRep_s2_r1_e1,rpeq_scrdPro_s1_r1_e1,rpeq_scrdPro_s2_r1_e1,tsis_scrdSIP_s1_r1_e1,tsis_scrdSIP_s2_r1_e1,casi_scrdTotal_s1_r1_e1,casi_scrdTotal_s2_r1_e1,sassy_scrdSocRej_s1_r1_e1,sassy_scrdSocRej_s2_r1_e1,socrew_scrdTotal_s1_r1_e1,socrew_scrdTotal_s2_r1_e1,socrew_scrdLike_s1_r1_e1,socrew_scrdLike_s2_r1_e1,socrew_scrdWant_s1_r1_e1,socrew_scrdWant_s2_r1_e1,socrew_scrdEff_s1_r1_e1,socrew_scrdEff_s2_r1_e1,erqca_scrdCogRea_s1_r1_e1,erqca_scrdCogRea_s2_r1_e1,erqca_scrdExpSup_s1_r1_e1,erqca_scrdExpSup_s2_r1_e1,oopjr_scrdTotal_s1_r1_e1,oopjr_scrdTotal_s2_r1_e1,ocic_scrdTotal_s1_r1_e1,ocic_scrdTotal_s2_r1_e1,ocic_scrdDoubt_s1_r1_e1,ocic_scrdDoubt_s2_r1_e1,ocic_scrdObs_s1_r1_e1,ocic_scrdObs_s2_r1_e1,ocic_scrdHoard_s1_r1_e1,ocic_scrdHoard_s2_r1_e1,ocic_scrdWash_s1_r1_e1,ocic_scrdWash_s2_r1_e1,ocic_scrdOrder_s1_r1_e1,ocic_scrdOrder_s2_r1_e1,ocic_scrdNeu_s1_r1_e1,ocic_scrdNeu_s2_r1_e1,mss_scrdSDS_s1_r1_e1,mss_scrdSDS_s2_r1_e1,edshvsc_scrdEdsEver_s1_r1_e1,edshvsc_scrdEdsEver_s2_r1_e1,edshvsc_scrdEdsFreq_s1_r1_e1,edshvsc_scrdEdsFreq_s2_r1_e1,edshvsc_scrdEdsChron_s1_r1_e1,edshvsc_scrdEdsChron_s2_r1_e1,edshvsc_scrdHvsEver_s1_r1_e1,edshvsc_scrdHvsEver_s2_r1_e1,edshvsc_scrdHvsFreq_s1_r1_e1,edshvsc_scrdHvsFreq_s2_r1_e1,psb_scrdTotal_s1_r1_e1,psb_scrdTotal_s2_r1_e1,pds_scrdFem_s1_r1_e1,pds_scrdFem_s2_r1_e1,pds_scrdMal_s1_r1_e1,pds_scrdMal_s2_r1_e1,lsasca_scrdTotal_s1_r1_e1,lsasca_scrdTotal_s2_r1_e1,lsasca_scrdTotAnx_s1_r1_e1,lsasca_scrdTotAnx_s2_r1_e1,lsasca_scrdAnxInt_s1_r1_e1,lsasca_scrdAnxInt_s2_r1_e1,lsasca_scrdAnxPer_s1_r1_e1,lsasca_scrdAnxPer_s2_r1_e1,lsasca_scrdTotAvo_s1_r1_e1,lsasca_scrdTotAvo_s2_r1_e1,lsasca_scrdAvoInt_s1_r1_e1,lsasca_scrdAvoInt_s2_r1_e1,lsasca_scrdAvoPer_s1_r1_e1,lsasca_scrdAvoPer_s2_r1_e1,abq_scrdTotal_s1_r1_e1,abq_scrdEng_s1_r1_e1,abq_scrdDis_s1_r1_e1,rpbic_scrdAcc_s1_r1_e1,rpbic_scrdPsyC_s1_r1_e1,masi_b_scrdTotal_s1_r1_e1,masi_b_scrdAccPro_s1_r1_e1,masi_b_scrdAccCon_s1_r1_e1,via_scrdHer_s1_r1_e1,via_scrdMain_s1_r1_e1,texi_b_scrdInh_s1_r1_e1,texi_b_scrdWm_s1_r1_e1,bfnep_b_scrdTotal_s1_r1_e1,bfnep_b_scrdTotal_s2_r1_e1,fpep_scrdTotal_s1_r1_e1,fpep_scrdTotal_s2_r1_e1,spaip_scrdTotal_s1_r1_e1,spaip_scrdTotal_s2_r1_e1,esip_scrdTotal_s1_r1_e1,esip_scrdTotal_s2_r1_e1,pscei_scrdTotal_s1_r1_e1,pscei_scrdTotal_s2_r1_e1,dersp_scrdCat_s1_r1_e1,dersp_scrdCat_s2_r1_e1,dersp_scrdNeg_s1_r1_e1,dersp_scrdNeg_s2_r1_e1,dersp_scrdAtt_s1_r1_e1,dersp_scrdAtt_s2_r1_e1,dersp_scrdDis_s1_r1_e1,dersp_scrdDis_s2_r1_e1,rcadsp_scrdTotal_s1_r1_e1,rcadsp_scrdTotal_s2_r1_e1,rcadsp_scrdAnx_s1_r1_e1,rcadsp_scrdAnx_s2_r1_e1,rcadsp_scrdDep_s1_r1_e1,rcadsp_scrdDep_s2_r1_e1,rpeqp_scrdOv_s1_r1_e1,rpeqp_scrdOv_s2_r1_e1,rpeqp_scrdRel_s1_r1_e1,rpeqp_scrdRel_s2_r1_e1,rpeqp_scrdRep_s1_r1_e1,rpeqp_scrdRep_s2_r1_e1,rpeqp_scrdPro_s1_r1_e1,rpeqp_scrdPro_s2_r1_e1,edshvsp_scrdEdsEver_s1_r1_e1,edshvsp_scrdEdsEver_s2_r1_e1,edshvsp_scrdEdsFreq_s1_r1_e1,edshvsp_scrdEdsFreq_s2_r1_e1,edshvsp_scrdEdsChron_s1_r1_e1,edshvsp_scrdEdsChron_s2_r1_e1,edshvsp_scrdHvsEver_s1_r1_e1,edshvsp_scrdHvsEver_s2_r1_e1,edshvsp_scrdHvsFreq_s1_r1_e1,edshvsp_scrdHvsFreq_s2_r1_e1,psbp_scrdTotal_s1_r1_e1,psbp_scrdTotal_s2_r1_e1,pdsp_scrdFem_s1_r1_e1,pdsp_scrdFem_s2_r1_e1,pdsp_scrdMal_s1_r1_e1,pdsp_scrdMal_s2_r1_e1,lsasp_scrdTotal_s1_r1_e1,lsasp_scrdTotal_s2_r1_e1,lsasp_scrdTotAnx_s1_r1_e1,lsasp_scrdTotAnx_s2_r1_e1,lsasp_scrdAnxInt_s1_r1_e1,lsasp_scrdAnxInt_s2_r1_e1,lsasp_scrdAnxPer_s1_r1_e1,lsasp_scrdAnxPer_s2_r1_e1,lsasp_scrdTotAvo_s1_r1_e1,lsasp_scrdTotAvo_s2_r1_e1,lsasp_scrdAvoInt_s1_r1_e1,lsasp_scrdAvoInt_s2_r1_e1,lsasp_scrdAvoPer_s1_r1_e1,lsasp_scrdAvoPer_s2_r1_e1,eatq_scrdAC_s1_r1_e1,eatq_scrdAff_s1_r1_e1,eatq_scrdAgg_s1_r1_e1,eatq_scrdAtt_s1_r1_e1,eatq_scrdDM_s1_r1_e1,eatq_scrdFear_s1_r1_e1,eatq_scrdFrus_s1_r1_e1,fasap_scrdAcc_s1_r1_e1,fasap_scrdPart_s1_r1_e1,fasap_scrdMod_s1_r1_e1,fasap_scrdDist_s1_r1_e1,fasap_scrdCons_s1_r1_e1,rsrip_scrdTotal_s1_r1_e1,rsrip_scrdSocSch_s1_r1_e1,rsrip_scrdFear_s1_r1_e1,scaredp_scrdTotal_s1_r1_e1,scaredp_scrdPan_s1_r1_e1,scaredp_scrdGA_s1_r1_e1,scaredp_scrdSep_s1_r1_e1,scaredp_scrdSA_s1_r1_e1,scaredp_scrdAvo_s1_r1_e1,texip_b_scrdInh_s1_r1_e1,texip_b_scrdWm_s1_r1_e1,adexi_b_scrdTotal_s1_r1_e1,adexi_b_scrdInh_s1_r1_e1,adexi_b_scrdWm_s1_r1_e1,bfne_b_parent_scrdTotal_s1_r1_e1,erq_scrdCogRea_s1_r1_e1,erq_scrdExpSup_s1_r1_e1,fpe_parent_scrdTotal_s1_r1_e1,masi_b_parent_scrdTotal_s1_r1_e1,masi_b_parent_scrdAccPro_s1_r1_e1,masi_b_parent_scrdAccCon_s1_r1_e1,phq8_scrdTotal_s1_r1_e1,pints_parent_scrdTotal_s1_r1_e1,pss_scrdTotal_s1_r1_e1,scaared_b_scrdTotal_s1_r1_e1,scaared_b_scrdPaSo_s1_r1_e1,scaared_b_scrdGA_s1_r1_e1,scaared_b_scrdSep_s1_r1_e1,scaared_b_scrdSoc_s1_r1_e1,via_parent_scrdHer_s1_r1_e1,via_parent_scrdMain_s1_r1_e1,rpbip_scrdAcc_s1_r1_e1,rpbip_scrdPsyC_s1_r1_e1,pidentityiqs_s1_r1_e1,pidentitybbs_s1_r1_e1,plangiqs_s1_r1_e1,plangbbs_s1_r1_e1,all_eeg_total_epochs_after_artifact_rejection_s1_r1_e1,all_eeg_preprocessing_s1_r1_e1_complete +3000001,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,1.0,0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,1598.0,2.0 +3000002,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,1.0,0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,1834.0,2.0 +3000003,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,1.0,0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,1692.0,2.0 +3000004,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,1.0,0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,1604.0,2.0 +3000005,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,1.0,0,1.0,0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,0.0,0,0.0,1,0.0,1,0.0,1,1.0,1,0.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,0,0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,2,2.0,1646.0,2.0 +3000006,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000007,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000008,0,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,736.0,2.0 +3000009,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,0,NA,0,NA,0,NA,1,NA,1,NA,0,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000010,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000011,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,2005.0,2.0 +3000012,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,1693.0,2.0 +3000013,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000014,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000015,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,454.0,2.0 +3000016,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000017,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000018,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000019,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000020,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000021,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,0,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1,0.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,1714.0,2.0 +3000022,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,1867.0,2.0 +3000023,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,1640.0,2.0 +3000024,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,8,8.0,1,1.0,NA,NA +3000025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000026,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000027,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000028,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000029,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000030,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000031,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000032,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000033,1,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000034,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000035,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000036,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000037,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000038,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000039,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000040,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000041,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000042,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000043,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000044,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000045,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000046,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000047,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000048,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000049,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000050,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000051,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000052,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000053,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000054,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000055,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000056,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000057,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000058,1,1,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000059,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000060,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000061,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000062,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000063,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000064,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000065,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000066,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000067,1,1,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000069,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,1,1.0,NA,NA +3000070,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000071,1,1,0,0,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000072,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,2,2.0,NA,NA +3000073,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000074,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000076,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,2,NA,NA,NA +3000077,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000078,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,2,NA,NA,NA +3000079,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,0,NA,1,NA,1,NA,1,NA,0,NA,1,NA,0,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000080,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000081,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000082,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000083,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000084,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000086,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000087,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000088,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000089,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000090,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000092,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000093,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000094,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,2,NA,NA,NA +3000095,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,1,1.0,NA,NA +3000096,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,2,NA,NA,NA +3000097,1,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000098,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000099,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,8,8.0,2,2.0,NA,NA +3000100,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000101,1,1,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000102,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000104,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,2,2.0,NA,NA +3000105,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,8,8.0,1,1.0,NA,NA +3000106,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,1,1.0,NA,NA +3000107,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000109,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,1,1.0,NA,NA +3000110,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,1,1.0,NA,NA +3000111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000113,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,2,2.0,NA,NA +3000114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000115,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000116,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,1,NA,NA,NA +3000118,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,1,NA,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8,8.0,2,2.0,NA,NA +3000119,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,0,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,8,NA,2,NA,NA,NA diff --git a/data-monitoring/check-id.py b/data-monitoring/check-id.py new file mode 100755 index 0000000..d3c734a --- /dev/null +++ b/data-monitoring/check-id.py @@ -0,0 +1,27 @@ +import sys +import pandas as pd +import math + +if __name__ == "__main__": + id = sys.argv[1] + file = sys.argv[2] + + # extract id col + if pd.__version__ >= "1.4.0": + file_df = pd.read_csv(file, on_bad_lines="skip") + else: + file_df = pd.read_csv(file, error_bad_lines=False, warn_bad_lines=False) + if "id" in file_df: + id_col = file_df["id"] + elif "participant" in file_df: + id_col = file_df["participant"] + else: + print("Error: cannot find id or participant column in", file) + + # check if first ids match vals listed + if isinstance(id_col[0], float) and math.isnan(id_col[0]): + print("Error: nan value seen in ID for", file, "file") + #if not id_col[0] == int(id): + else: + if not int(id_col[0]) == int(id): + print("Error: ID value in", file, "does not match", id) diff --git a/data-monitoring/data-dictionary/.~lock.central-tracker_datadict.csv# b/data-monitoring/data-dictionary/.~lock.central-tracker_datadict.csv# new file mode 100644 index 0000000..f625774 --- /dev/null +++ b/data-monitoring/data-dictionary/.~lock.central-tracker_datadict.csv# @@ -0,0 +1 @@ +,dhunt,v002.panther.net,20.09.2023 15:58,file:///home/dhunt/.config/libreoffice/4; \ No newline at end of file diff --git a/data-monitoring/data-dictionary/central-tracker_datadict.csv b/data-monitoring/data-dictionary/central-tracker_datadict.csv index 8d02fb2..0ab4083 100644 Binary files a/data-monitoring/data-dictionary/central-tracker_datadict.csv and b/data-monitoring/data-dictionary/central-tracker_datadict.csv differ diff --git a/data-monitoring/data-dictionary/datadict_definitions.csv b/data-monitoring/data-dictionary/datadict_definitions.csv deleted file mode 100644 index 3347475..0000000 --- a/data-monitoring/data-dictionary/datadict_definitions.csv +++ /dev/null @@ -1,11 +0,0 @@ -variable,exact name of data variable -description,"human-readable description of the variable, starting with one of the official data types: consent, psychopy, eeg, digi, audio, video, redcap_data, redcap_scrd, custom" -detail,"for questionnaire items, content of the specific question; for all other variables, clarification of how the variable value is calculated/derived" -allowedSuffix,"sX_rX_eX, where s=session, r=run, and e=event" -valueType,"indication of the computer-readable value type used for the variable (i.e., Integer, Real, Logical, Char, Time)" -allowedValues,"all allowed values for the variable: Integers and Real numbers as [x,y]; Logical as 0, 1; Likert/Categorical as 1, 2, 3; Char as ""text""" -valueInfo,indication of how allowed values are determined; categorical-type options may be separated by | (vertical bar) or ; (semicolon) -naValueType,"indication of how NA values are flagged (NA, NaN, etc.)" -activeStatus,indication of whether variable is currently being used/collected -replacement,"for inactive variables, indication of any variable that was used in replacement" -provenance,"indication of whether variable is collected directly from the participant and by what platform (direct-redcap, direct-psychopy, direct-pavlovia) or, if not direct, the origin of its derivation (that is, the script the calculates it, specified as code-SCRIPT, such as code-instruments or code-preproc.R, or the protocol used for manual coding, such as manual-errorCoding)" \ No newline at end of file diff --git a/data-monitoring/data-dictionary/readme.md b/data-monitoring/data-dictionary/readme.md new file mode 100644 index 0000000..c6187f3 --- /dev/null +++ b/data-monitoring/data-dictionary/readme.md @@ -0,0 +1,15 @@ +# Datadict Column Definitions + +The columns below are expected in the central tracker datadict: + +* **variable**: exact name of data variable; for non-questionnaire data (psychopy, audio, video, eeg, digi), the variable name should be "\_\"; for questionnaire data (redcap_data and redcap_scrd), the variable name should be the exact questionnaire or subscore name, except in the case that a self-report survey is administered to both parent and child (in which case, "_parent" is appended to the end of the variable name for the parent self-report to distinguish it from the child self-report) +* **datatype**: type of data; e.g., consent, psychopy, eeg, digi, audio, video, redcap_data, redcap_scrd, or other data type; for combination rows, the dataType is listed as "combination" and the provenance is updated accordingly to designate the variables that should be combined +* **description**: human-readable description of the variable +* **detail**: clarification of how the variable value is calculated/derived +* **allowedSuffix**: sX_rX_eX, where s=session, r=run, and e=event; separated by commas +* **measureUnit**: indication of the computer-readable value type used for the variable (i.e., Integer, Real, Logical, Char, Time) +* **allowedValues**: all allowed values for the variable, separated by commas: Integers and Real numbers as [x,y] (with integer sets separated by commas); Logical as 0, 1; Likert/Categorical as 1, 2, 3; Char as "text" +* **valueInfo**: indication of the meanings of the allowed values; categorical-type options may be separated by \| (vertical bar) or ; (semicolon) +* **naValueType**: indication of how NA values are flagged (NA, NaN, etc.) +* **provenance**: indication of whether variable is collected directly from the participant and by what platform (direct-psychopy, direct-pavlovia) or, if not direct, the origin of its derivation (that is, the script the calculates it, specified as code-SCRIPT, such as code-instruments or code-preproc.R, or the protocol used for manual coding, such as manual-errorCoding). for REDCap data, provenance will specify the REDCap file and the exact variable within that file that the row corresponds to (file: "\", variable:"\"); if the variable name is the same as what is listed in the variable column, the provenance can simply state variable: "". for combination rows, the provenance will specify the variables that should be combined in that row (variables: "\","\") +* **expectedFileExt**: the file extensions expected for each data type, separated by commas (e.g., ".eeg, .vmrk, .vhdr" for EEG data); if multiple extensions are allowed but not necessarily all expected, extensions can be separated by \| (vertical bar) (e.g., ".zip.gpg \| .tar.gz.gpg"); if this is not relevant, type NA diff --git a/data-monitoring/data-monitoring-log.md b/data-monitoring/data-monitoring-log.md new file mode 100644 index 0000000..efc1bec --- /dev/null +++ b/data-monitoring/data-monitoring-log.md @@ -0,0 +1,127 @@ +2023-09-14_14:48:27 Data monitoring status for job 11145039: error; 277 errors seen, check slurm-11145039_errorlog.out for more info +2023-09-14_15:19:09 Data monitoring status for job 11145040: error; 42 errors seen, check slurm-11145040_errorlog.out for more info +2023-09-15_13:23:38 Data monitoring status for job 11145160: error; 43 errors seen, check slurm-11145160_errorlog.out for more info +2023-09-15_13:32:37 Data monitoring status for job 11145164: error; 43 errors seen, check slurm-11145164_errorlog.out for more info +2023-09-15_13:37:58 Data monitoring status for job 11145168: error; 41 errors seen, check slurm-11145168_errorlog.out for more info +2023-09-18_12:31:15 Data monitoring status for job 11154772: error; 41 errors seen, check slurm-11154772_errorlog.out for more info +2023-09-18_13:30:02 Data monitoring status for job 11156040: error; 41 errors seen, check slurm-11156040_errorlog.out for more info +2023-09-18_15:08:26 Data monitoring status for job 11156083: error; 41 errors seen, check slurm-11156083_errorlog.out for more info +2023-09-18_16:45:51 Data monitoring status for job 11156177: error; 41 errors seen, check slurm-11156177_errorlog.out for more info +2023-09-20_15:19:00 Data monitoring status for job 11170145: error; 42 errors seen, check slurm-11170145_errorlog.out for more info +2023-09-20_15:36:05 Data monitoring status for job 11170151: error; 42 errors seen, check slurm-11170151_errorlog.out for more info +2023-09-20_15:49:33 Data monitoring status for job 11170152: error; 41 errors seen, check slurm-11170152_errorlog.out for more info +2023-09-20_16:05:41 Data monitoring status for job 11170153: error; 41 errors seen, check slurm-11170153_errorlog.out for more info +2023-09-20_16:13:04 Data monitoring status for job 11170154: error; 41 errors seen, check slurm-11170154_errorlog.out for more info +2023-09-20_16:19:30 Data monitoring status for job 11170155: error; 41 errors seen, check slurm-11170155_errorlog.out for more info +2023-09-20_16:22:35 Data monitoring status for job 11170156: error; 41 errors seen, check slurm-11170156_errorlog.out for more info +2023-09-20_16:28:44 Data monitoring status for job 11170157: error; 41 errors seen, check slurm-11170157_errorlog.out for more info +2023-10-02_11:12:15 Data monitoring status for job 11224746: error; 27 errors seen, check slurm-11224746_errorlog.out for more info +2023-10-02_11:37:47 Data monitoring status for job 11224748: error; 29 errors seen, check slurm-11224748_errorlog.out for more info +2023-10-02_11:53:27 Data monitoring status for job 11224750: error; 30 errors seen, check slurm-11224750_errorlog.out for more info +2023-10-02_12:07:16 Data monitoring status for job 11224755: error; 26 errors seen, check slurm-11224755_errorlog.out for more info +2023-10-02_17:33:17 Data monitoring status for job 11224830: error; 12 errors seen, check slurm-11224830_errorlog.out for more info +2023-10-02_17:38:00 Data monitoring status for job 11224833: error; 12 errors seen, check slurm-11224833_errorlog.out for more info +2023-10-02_17:44:54 Data monitoring status for job 11224836: error; 10 errors seen, check slurm-11224836_errorlog.out for more info +2023-10-23_11:00:40 Data monitoring status for job 11325779: success +2023-10-23_12:11:27 Data monitoring status for job 11325786: success +2023-10-23_12:38:57 Data monitoring status for job 11328627: success +2023-10-23_14:46:23 Data monitoring status for job 11330326: error; 35 errors seen, check slurm-11330326_errorlog.out for more info +2023-10-23_15:00:00 Data monitoring status for job 11330379: error; 25 errors seen, check slurm-11330379_errorlog.out for more info +2023-10-23_15:02:24 Data monitoring status for job 11330381: error; 35 errors seen, check slurm-11330381_errorlog.out for more info +2023-10-23_15:10:28 Data monitoring status for job 11330386: error; 35 errors seen, check slurm-11330386_errorlog.out for more info +2023-10-25_11:53:31 Data monitoring status for job 11348556: error; 35 errors seen, check slurm-11348556_errorlog.out for more info +2023-10-25_12:56:41 Data monitoring status for job 11348560: error; 35 errors seen, check slurm-11348560_errorlog.out for more info +2023-10-27_16:09:10 Data monitoring status for job 11348997: error; 35 errors seen, check slurm-11348997_errorlog.out for more info +2023-11-02_12:26:41 Data monitoring status for job 11366141: error; 5 errors seen, check slurm-11366141_errorlog.out for more info +2023-11-07_11:44:39 Data monitoring status for job 11411099: error; 5 errors seen, check slurm-11411099_errorlog.out for more info +2023-11-07_11:51:31 Data monitoring status for job 11411101: error; 1 errors seen, check slurm-11411101_errorlog.out for more info +2023-11-07_12:00:35 Data monitoring status for job 11411102: error; 1 errors seen, check slurm-11411102_errorlog.out for more info +2023-11-07_12:27:22 Data monitoring status for job 11411113: error; 1 errors seen, check slurm-11411113_errorlog.out for more info +2023-11-07_14:12:59 Data monitoring status for job 11411384: error; 1 errors seen, check slurm-11411384_errorlog.out for more info +2023-11-07_14:35:16 Data monitoring status for job 11411435: error; 1 errors seen, check slurm-11411435_errorlog.out for more info +2023-11-07_15:36:48 Data monitoring status for job 11411455: error; 111 errors seen, check slurm-11411455_errorlog.out for more info +2023-11-08_17:00:55 Data monitoring status for job 11414281: error; 92 errors seen, check slurm-11414281_errorlog.out for more info +2023-11-17_17:06:08 Preprocessing ran: view slurm-11441129.out file to see effects. +2023-11-17_17:13:06 Preprocessing ran: view slurm-11441222.out file to see effects. +2023-11-21_10:59:10 Data monitoring status for job 11493134: error; 50 errors seen, check slurm-11493134_errorlog.out for more info +2023-11-21_11:32:18 Data monitoring status for job 11493188: error; 50 errors seen, check slurm-11493188_errorlog.out for more info +2023-11-21_17:00:32 Preprocessing ran: view slurm-11493890.out file to see effects. +2023-11-21_17:21:27 Preprocessing ran: view slurm-11493910.out file to see effects. +2023-11-21_17:36:10 Preprocessing ran: view slurm-11493929.out file to see effects. +2023-11-21_17:41:52 Preprocessing ran: view slurm-11494033.out file to see effects. +2023-11-24_17:08:37 Preprocessing ran: view slurm-11511481.out file to see effects. +2023-11-24_17:14:22 Preprocessing ran: view slurm-11511491.out file to see effects. +2023-11-24_17:16:41 Preprocessing ran: view slurm-11511494.out file to see effects. +2023-11-24_17:20:02 Preprocessing ran: view slurm-11511498.out file to see effects. +2023-11-24_17:22:41 Preprocessing ran: view slurm-11511500.out file to see effects. +2023-11-24_17:37:20 Data monitoring status for job 11511519: error; 37 errors seen, check slurm-11511519_errorlog.out for more info +2023-11-24_17:44:14 Data monitoring status for job 11511523: error; 37 errors seen, check slurm-11511523_errorlog.out for more info +2023-11-24_17:50:58 Data monitoring status for job 11511529: error; 36 errors seen, check slurm-11511529_errorlog.out for more info +2023-11-24_17:54:42 Preprocessing ran: view slurm-11511539.out file to see effects. +2023-11-27_15:13:02 Preprocessing ran: view slurm-11533592.out file to see effects. +2023-11-27_15:17:09 Preprocessing ran: view slurm-11533593.out file to see effects. +2023-11-27_15:40:36 Preprocessing ran: view slurm-11533598.out file to see effects. +2023-11-27_15:45:46 Preprocessing ran: view slurm-11533600.out file to see effects. +2023-11-28_15:48:11 Preprocessing ran: view slurm-11541883.out file to see effects. +2023-11-29_12:52:41 Preprocessing ran: view slurm-11554646.out file to see effects. +2023-11-29_13:03:00 Preprocessing ran: view slurm-11554881.out file to see effects. +2023-11-30_17:22:38 Preprocessing ran: view slurm-11564266.out file to see effects. +2023-11-30_17:37:39 Preprocessing ran: view slurm-11564319.out file to see effects. +2023-11-30_17:46:03 Preprocessing ran: view slurm-11564375.out file to see effects. +2023-11-30_17:53:50 Preprocessing ran: view slurm-11564382.out file to see effects. +2023-11-30_17:56:49 Preprocessing ran: view slurm-11564385.out file to see effects. +2023-12-01_16:13:18 Preprocessing ran: view slurm-11580343.out file to see effects. +2023-12-01_16:50:05 Preprocessing ran: view slurm-11580355.out file to see effects. +2023-12-01_16:51:07 Preprocessing ran: view slurm-11580356.out file to see effects. +2023-12-01_16:55:51 Preprocessing ran: view slurm-11580359.out file to see effects. +2023-12-01_17:05:14 Preprocessing ran: view slurm-11580363.out file to see effects. +2023-12-01_17:23:57 Preprocessing ran: view slurm-11580370.out file to see effects. +2023-12-01_17:33:11 Data monitoring status for job 11580374: error; 36 errors seen, check slurm-11580374_errorlog.out for more info +2023-12-01_17:36:12 Preprocessing ran: view slurm-11580375.out file to see effects. +2023-12-01_18:00:19 Data monitoring status for job 11582016: error; 36 errors seen, check slurm-11582016_errorlog.out for more info +2023-12-01_18:03:44 Preprocessing ran: view slurm-11582017.out file to see effects. +2023-12-01_22:11:43 Data monitoring status for job 11585036: error; 36 errors seen, check slurm-11585036_errorlog.out for more info +2023-12-01_22:13:55 Preprocessing ran: view slurm-11585037.out file to see effects. +2023-12-04_11:33:13 Data monitoring status for job 11600679: error; 42 errors seen, check slurm-11600679_errorlog.out for more info +2023-12-04_13:02:49 Preprocessing ran: view slurm-11604594.out file to see effects. +2023-12-04_13:24:48 Data monitoring status for job 11604710: error; 9 errors seen, check slurm-11604710_errorlog.out for more info +2023-12-04_13:47:16 Preprocessing ran: view slurm-11604827.out file to see effects. +2023-12-04_13:55:46 Data monitoring status for job 11604829: error; 9 errors seen, check slurm-11604829_errorlog.out for more info +2023-12-04_13:59:07 Preprocessing ran: view slurm-11604831.out file to see effects. +2023-12-04_14:45:59 Data monitoring status for job 11604832: error; 8 errors seen, check slurm-11604832_errorlog.out for more info +2023-12-04_14:49:39 Preprocessing ran: view slurm-11604833.out file to see effects. +2023-12-04_15:00:36 Data monitoring status for job 11604835: error; 8 errors seen, check slurm-11604835_errorlog.out for more info +2023-12-04_15:05:05 Preprocessing ran: view slurm-11604836.out file to see effects. +2023-12-04_17:40:58 Data monitoring status for job 11605613: error; 2 errors seen, check slurm-11605613_errorlog.out for more info +2023-12-04_17:43:16 Preprocessing ran: view slurm-11605644.out file to see effects. +2023-12-04_18:33:47 Data monitoring status for job 11606101: error; 2 errors seen, check slurm-11606101_errorlog.out for more info +2023-12-04_18:37:27 Preprocessing ran: view slurm-11606128.out file to see effects. +2023-12-05_16:26:01 Data monitoring status for job 11612748: error; 2 errors seen, check slurm-11612748_errorlog.out for more info +2023-12-05_16:32:58 Preprocessing ran: view slurm-11612749.out file to see effects. +2023-12-05_16:42:06 Preprocessing ran: view slurm-11612750.out file to see effects. +2023-12-05_17:44:52 Data monitoring status for job 11612757: error; 2 errors seen, check slurm-11612757_errorlog.out for more info +2023-12-05_17:48:20 Preprocessing ran: view slurm-11612758.out file to see effects. +2023-12-05_18:02:11 Preprocessing ran: view slurm-11612762.out file to see effects. +2023-12-07_16:37:00 Data monitoring status for job 11640787: error; 4 errors seen, check slurm-11640787_errorlog.out for more info +2023-12-07_16:40:56 Preprocessing ran: view slurm-11640855.out file to see effects. +2023-12-07_17:26:09 Data monitoring status for job 11641635: error; 4 errors seen, check slurm-11641635_errorlog.out for more info +2023-12-07_17:28:20 Preprocessing ran: view slurm-11641693.out file to see effects. +2023-12-07_17:32:17 Preprocessing ran: view slurm-11641747.out file to see effects. +2023-12-18_12:00:26 Data monitoring status for job 11650934: error; 14 errors seen, check slurm-11650934_errorlog.out for more info +2023-12-18_12:07:20 Data monitoring status for job 11650936: error; 12 errors seen, check slurm-11650936_errorlog.out for more info +2024-01-04_16:15:36 Data monitoring status for job 87105: error; 21 errors seen, check slurm-87105_errorlog.out for more info +2024-01-12_14:00:51 Data monitoring status for job 129162: error; 27 errors seen, check slurm-129162_errorlog.out for more info +2024-01-12_14:22:36 Data monitoring status for job 129165: error; 27 errors seen, check slurm-129165_errorlog.out for more info +2024-01-12_14:42:05 Data monitoring status for job 129169: error; 26 errors seen, check slurm-129169_errorlog.out for more info +2024-01-24_16:48:43 Data monitoring status for job 152775: error; 48 errors seen, check slurm-152775_errorlog.out for more info +2024-02-08_16:49:23 Data monitoring status for job 180203: error; 47 errors seen, check slurm-180203_errorlog.out for more info +2024-02-08_16:59:42 Data monitoring status for job 180205: error; 42 errors seen, check slurm-180205_errorlog.out for more info +2024-02-14_14:02:24 Preprocessing ran: view slurm-196734.out file to see effects. +2024-02-14_14:03:51 Data monitoring status for job 196733: error; 37 errors seen, check slurm-196733_errorlog.out for more info +2024-02-15_15:29:22 Preprocessing ran: view slurm-199250.out file to see effects. +2024-02-16_12:54:00 Preprocessing ran: view slurm-201367.out file to see effects. +2024-02-19_11:19:21 Data monitoring status for job 201880: error; 85 errors seen, check slurm-201880_errorlog.out for more info +2024-02-21_14:31:13 Data monitoring status for job 210190: error; 125 errors seen, check slurm-210190_errorlog.out for more info +2024-02-21_14:37:36 Preprocessing ran: view slurm-210191.out file to see effects. +2024-02-23_17:38:40 Data monitoring status for job 215703: error; 118 errors seen, check slurm-215703_errorlog.out for more info +2024-02-23_17:53:20 Preprocessing ran: view slurm-215706.out file to see effects. diff --git a/data-monitoring/hallMonitor.sh b/data-monitoring/hallMonitor.sh new file mode 100755 index 0000000..8be96df --- /dev/null +++ b/data-monitoring/hallMonitor.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# init proj specific variables +dataset="/home/data/NDClab/datasets/thrive-dataset" +childdata="true" +[[ $childdata == true ]] && childdata="true" + +# determine if sourcedata/raw has session folders, reproduce session+run structure in checked +ses_re='^s[0-9]+_r[0-9]+$' +ses_names=() +for i in $(find $dataset/sourcedata/raw -maxdepth 1 -type d); do + if [[ $(basename $i) =~ $ses_re ]]; then ses_names+=($(basename $i)/); fi +done +IFS=$'\n' && ses_names=($(sort <<<"${ses_names[*]}")) && unset IFS +[[ ${#ses_names[@]} -eq 0 ]] && ses_names="none" + +# load in functions & variables +source /home/data/NDClab/tools/lab-devOps/scripts/monitor/tools.sh + +usage() { echo "Usage: sh hallMonitor.sh [-m/-r] [string list of replacement or mapping]" 1>&2; exit 1; } + +echo "checking that the data dictionary is up to date since last setup" +output=$( python ${dataset}/data-monitoring/check-datadict.py $dataset) +echo -e "$output" + +echo "calling verify-copy.py" +output=$( python ${dataset}/data-monitoring/verify-copy.py $dataset) +echo -e "$output" + + +error_detected=false + +for ses in ${ses_names[@]} +do + [[ $ses == "none" ]] && ses="" # if no session directories set ses to empty + if [ ! -d $raw/${ses}redcap ]; then + echo "No redcap folder found in $raw/$ses directory" + redcaps=("") + else + echo "Accessing $raw/${ses}redcap" + # if redcap does not exist in checked, create it + if [ ! -e "$check/redcap" ]; then + mkdir -p $check/redcap + fi + + # store file names in array and get most recent file, check if stem is correct + redcaps=($( get_new_redcaps $raw/${ses}redcap )) + for redcap_file in ${redcaps[@]}; do + if [[ "$redcap_file" =~ "Error:" ]]; then + echo -e "$redcap_file" + echo -e "\t ${RED}Error detected in redcap. View above${NC}" + error_detected=true + continue + fi + echo -e "\t Newest Redcap found: $redcap_file" + + # move only if data does not already exist in checked + cmp --silent "$raw/${ses}redcap/$redcap_file" "$check/redcap/$redcap_file" + same_file=$(echo $?) + if [ -f "$check/redcap/$redcap_file" ] && [ $same_file -eq 0 ]; then + echo -e "\t redcap/$redcap_file already exists in checked, skipping copy \n" + continue + fi + + echo -e "\t ${GREEN}Data passes criteria${NC}" + + + echo -e "\t copying $redcap_file to $check/$dir" + cp $raw/${ses}redcap/$redcap_file $check/\redcap + + # rename columns in checked using replace or map + while getopts ":rm" opt; do + case ${opt} in + r) + python ${dataset}/data-monitoring/rename-cols.py $check/$dir/$redcap_file "replace" $2 ;; + m) + python ${dataset}/data-monitoring/rename-cols.py $check/$dir/$redcap_file "map" $2 ;; + :) + esac + done + done + fi + + if [[ ! ${redcaps[*]} == "" ]]; then + echo "updating tracker, ses: $ses, redcaps: ${redcaps[*]}" + command=$(echo "echo $raw/${ses}redcap/{$(echo ${redcaps[*]} | sed 's/ /,/g')}") + redcap_files=$(eval $command); redcap_files=${redcap_files// /,} # comma separated list of redcaps in optional session folder + [[ ${redcaps[*]} == "" ]] && redcap_files=none + [[ $ses == "" ]] && ses="none" + if [[ $ses == "none" ]]; then + # update trackers + output=$( python ${dataset}/data-monitoring/update-tracker.py "${check}" $dataset $redcap_files $ses $childdata) + echo "args: ${dataset}/data-monitoring/update-tracker.py "${check}" $dataset $redcap_files ${ses} $childdata" + echo -e "$output" + else + ses_re='^.*'${ses:0:-1}'.*$' + output=$( python ${dataset}/data-monitoring/update-tracker.py "${check}" $dataset $redcap_files ${ses:0:-1} $childdata) + echo "args: ${dataset}/data-monitoring/update-tracker.py "${check}" $dataset $redcap_files ${ses:0:-1} $childdata" + echo -e "$output" + fi + fi + +done + diff --git a/data-monitoring/hallMonitor.sub b/data-monitoring/hallMonitor.sub new file mode 100755 index 0000000..b062a98 --- /dev/null +++ b/data-monitoring/hallMonitor.sub @@ -0,0 +1,27 @@ +#!/bin/bash + +#SBATCH --nodes=1 # node count +#SBATCH --ntasks=1 # total number of tasks across all nodes +#SBATCH --time=00:24:00 # total run time limit (HH:MM:SS) +#SBATCH --account=iacc_gbuzzell + +# load python modules and execute +#module load miniconda3-4.5.11-gcc-8.2.0-oqs2mbg +#./hallMonitor.sh +module load singularity-3.8.2 +singularity exec -e /home/data/NDClab/tools/containers/python-3.8/python-3.8.simg ./hallMonitor.sh + +source /home/data/NDClab/tools/lab-devOps/scripts/monitor/tools.sh +logfile="data-monitoring-log.md" +NUMERRORS=$(cat slurm-${SLURM_JOB_ID}.out | grep "Error: " | wc -l) +if [[ $NUMERRORS -gt 0 ]]; then + cat slurm-${SLURM_JOB_ID}.out | grep "Error: " > slurm-${SLURM_JOB_ID}_errorlog.out + error_detected="true" +else + error_detected="false" +fi +if [ $error_detected = true ]; then + update_log "error; $NUMERRORS errors seen, check slurm-${SLURM_JOB_ID}_errorlog.out for more info" $logfile +else + update_log "success" $logfile +fi diff --git a/data-monitoring/preprocess.sub b/data-monitoring/preprocess.sub new file mode 100755 index 0000000..683572d --- /dev/null +++ b/data-monitoring/preprocess.sub @@ -0,0 +1,63 @@ +#!/bin/bash +#SBATCH --nodes=1 # node count +#SBATCH --ntasks=1 # total number of tasks across all nodes +#SBATCH --cpus-per-task=1 # CPUS to use when using data parallelization +#SBATCH --time=00:30:00 # total run time limit (HH:MM:SS) +#SBATCH --output=%x-%j.out + +# A slurm script to run ALL of preprocessing + +# load functions and variables +source /home/data/NDClab/tools/lab-devOps/scripts/monitor/tools.sh + +# load modules +module load singularity-3.5.3 +module load r-4.0.2-gcc-8.2.0-tf4pnwr +module load miniconda3-4.5.11-gcc-8.2.0-oqs2mbg + +# automatically get project name +dataset=$(dirname $(pwd)) +output_path="${dataset}/derivatives/preprocessed" +data_source="${dataset}/sourcedata/checked/redcap/" +data_dict="${dataset}/data-monitoring/data-dictionary/central-tracker_datadict.csv" +log="${dataset}/data-monitoring/data-monitoring-log.md" + +dir="$(basename $dataset)" +tracker="${dataset}/data-monitoring/central-tracker_${dir}.csv" +datadict="${dataset}/data-monitoring/data-dictionary/central-tracker_datadict.csv" + +# constant paths +sing_image="/home/data/NDClab/tools/instruments/containers/singularity/inst-container.simg" +json_scorer="/home/data/NDClab/tools/instruments/scripts/json_scorer.py" +survey_data="/home/data/NDClab/tools/instruments/scripts/surveys.json" +id_col_script="/home/data/NDClab/tools/instruments/scripts/get_id_col.py" + +# get most recent redcap file for processing +input_files=$( get_new_redcaps $data_source) +echo "Found newest redcaps: ${input_files}" + +for input_file in ${input_files} +do + idcol=$(python3 $id_col_script "${data_source}/${input_file}" $data_dict) + # run instruments to preprocess survey data + singularity exec --bind $dataset,/home/data/NDClab/tools/instruments \ + $sing_image \ + python3 $json_scorer \ + "${data_source}/${input_file}" \ + $survey_data \ + $output_path \ + $idcol \ + $datadict \ + $tracker +done + +# insert singularity scripts here + +if [[ ! -f "$log" ]]; then + echo "$log does not exist, skipping log." + exit 0 +fi +now=`date '+%Y-%m-%d_%T'` +echo "${now} Preprocessing ran: view slurm-${SLURM_JOB_ID}.out file to see effects." >> $log + +# zoom, redcap_data, redcap_scrd, psychopy, eeg, audio, digi diff --git a/data-monitoring/rename-cols.py b/data-monitoring/rename-cols.py new file mode 100755 index 0000000..1488c84 --- /dev/null +++ b/data-monitoring/rename-cols.py @@ -0,0 +1,21 @@ +import sys +import pandas as pd +import re + +if __name__ == "__main__": + file_path = sys.argv[1] + option = sys.argv[2] + col_maps = sys.argv[3] + + file_df = pd.read_csv(file_path, index_col="record_id") + + if option == "map": + col_maps = col_maps.split(",") + for vals in col_maps: + map = vals.split(":") + orig = map[0] + new = map[1] + file_df = file_df.rename(columns=lambda s: re.sub("^" + orig + "_", new + "_", s)) + elif option == "replace": + file_df.columns = col_maps.split(",") + file_df.to_csv(file_path) \ No newline at end of file diff --git a/data-monitoring/update-tracker.py b/data-monitoring/update-tracker.py new file mode 100755 index 0000000..576f59b --- /dev/null +++ b/data-monitoring/update-tracker.py @@ -0,0 +1,456 @@ +import pandas as pd +import sys +from os.path import basename, normpath, join, isdir, isfile, splitext +from os import listdir, walk +import pathlib +import re +import math +import datetime +from collections import defaultdict + +# list hallMonitor key + +completed = "_complete" + +class c: + RED = '\033[31m' + GREEN = '\033[32m' + ENDC = '\033[0m' + BOLD = '\033[1m' + UNDERLINE = '\033[4m' + +# TODO: Make this occur once during construction +def get_redcap_columns(datadict_df): + df = datadict_df + # filter for prov + cols = {} + key_counter = defaultdict(lambda: 0) + allowed_duplicate_columns = [] + for _, row in df.iterrows(): + if row["dataType"] not in ["consent", "assent", "redcap_data"]: #just redcap data + continue + if isinstance(row["allowedSuffix"], float) and math.isnan(row["allowedSuffix"]): + allowed_suffixes = [""] + else: + allowed_suffixes = row["allowedSuffix"].split(", ") + allowed_suffixes = [x for x in allowed_suffixes if x.startswith(session)] # only from same session + allowed_suffixes = ["_" + ses for ses in allowed_suffixes] + prov = row["provenance"].split(" ") + if "file:" in prov and "variable:" in prov: + idx = prov.index("file:") + rc_filename = prov[idx+1].strip("\";,") + idx = prov.index("variable:") + rc_variable = prov[idx+1].strip("\";,") + if rc_variable == "": + rc_variable = row["variable"].lower() + if not rc_filename in cols.keys(): + cols[rc_filename] = {} + if "id:" in prov: + idx = prov.index("id:") + rc_idcol = prov[idx+1].strip("\";,") + cols[rc_filename]["id_column"] = rc_idcol + else: + continue + for ses_tag in allowed_suffixes: + #var = row["variable"] + var = row["variable"] + cols[rc_filename][rc_variable + ses_tag + completed] = var + ses_tag + key_counter[rc_variable + ses_tag + completed] += 1 + # also map Sp. surveys to same column name in central tracker if completed + surv_match = re.match('^([a-zA-Z0-9\-]+)(_[a-z])?(_scrd[a-zA-Z]+)?(_[a-zA-Z]{2,})?$', rc_variable) + if surv_match and "redcap_data" in row["dataType"]: + surv_version = '' if not surv_match.group(2) else surv_match.group(2) + scrd_str = '' if not surv_match.group(3) else surv_match.group(3) + multiple_report_tag = '' if not surv_match.group(4) else surv_match.group(4) + surv_esp = surv_match.group(1) + 'es' + surv_version + scrd_str + multiple_report_tag + ses_tag + cols[rc_filename][surv_esp + completed] = var + ses_tag + key_counter[surv_esp + completed] += 1 + if "consent" in row["dataType"]: + cols[rc_filename][rc_variable + "es" + completed] = var + for key, value in key_counter.items(): + if value > 1: + allowed_duplicate_columns.append(key) + return cols, allowed_duplicate_columns + +def get_tasks(datadict_df): + df = datadict_df + tasks_dict = dict() + task_vars = [] + for _, row in df.iterrows(): + if not isinstance(row["expectedFileExt"], float): + task_vars.append(row["variable"]) + for _, row in df.iterrows(): + if row["variable"] in task_vars: + if isinstance(row["dataType"], str) and isinstance(row["expectedFileExt"], str): + tasks_dict[row["variable"]] = [row["dataType"], row["expectedFileExt"], row["allowedSuffix"]] + else: + print(c.RED + "Error: Must have dataType, expectedFileExt, and allowedSuffix fields in datadict for ", row["variable"], ", skipping." + c.ENDC) + return tasks_dict + +def get_IDs(datadict_df): + df_dd = datadict_df + id_desc = df_dd.set_index("variable").loc["id", "provenance"].split(" ") + # ID description column should contain redcap and variable from which to read IDs, in format 'file: "{name of redcap}"; variable: "{column name}"' + for i in id_desc: + if "file:" in i: + idx = id_desc.index(i)+1 + id_rc = id_desc[idx].strip("\"\';,()") + elif "variable:" in i: + idx = id_desc.index(i)+1 + var = id_desc[idx].strip("\"\';,()") + if "id_rc" not in locals() or "var" not in locals(): + sys.exit("Can\'t find redcap column to read IDs from in datadict") + + redcap_files = [join(checked_path,"redcap",f) for f in listdir(join(checked_path,"redcap")) if isfile(join(checked_path,"redcap",f))] + for redcap in redcap_files: + + rc_re = re.match('^' + id_rc + '.*_data_(\d{4}-\d{2}-\d{2}_\d{4}).*$', basename(redcap).lower()) + if rc_re: + timestamp = rc_re.group(1) + date = datetime.datetime.strptime(timestamp,'%Y-%m-%d_%H%M') + if "newest_date" not in locals(): + newest_date = date + consent_redcap = redcap + else: + if date > newest_date: + newest_date = date + consent_redcap = redcap + + if "consent_redcap" not in locals(): + sys.exit("Can\'t find" + id_rc + "redcap to read IDs from") + consent_redcap = pd.read_csv(consent_redcap, index_col=var) + ids = consent_redcap.index.tolist() + return ids + +def get_study_no(datadict_df): + allowed_vals = datadict_df.set_index("variable").loc["id", "allowedValues"] + allowed_vals = allowed_vals.replace(" ", "") + intervals = re.split("[\[\]]", allowed_vals) + intervals = list(filter(lambda x: x not in [",", ""], intervals)) + return intervals[0][0:2] # first two digits should be study no. + +def fill_combination_columns(tracker_df, dd_df): + combos_dict = dict() + for _, row in dd_df.iterrows(): + if row["dataType"] == "combination": + idx = row["provenance"].split(" ").index("variables:") + vars = "".join(row["provenance"].split(" ")[idx+1:]).split(",") + vars = [var.strip("\"") for var in vars] + for ses in row["allowedSuffix"].split(", "): + combos_dict[row["variable"]+"_"+ses] = [var+"_"+ses for var in vars] + for key, cols in combos_dict.items(): + if len(cols) == 0: + print(c.RED + "Error: columns to combine not found for combination variable: " + key + ", can\'t update column." + c.ENDC) + del combos_dict[key] + for combined_col, cols in combos_dict.items(): + for id, row in tracker_df.iterrows(): + present = False + for col in cols: + try: + if str(tracker_df.loc[id, col]) == "1": + present = True + except KeyError as e_msg: + sys.exit(c.RED + "Error: KeyError:" + e_msg + ", please fix central tracker." + c.ENDC) + if present: + tracker_df.loc[id, combined_col] = "1" + else: + tracker_df.loc[id, combined_col] = "0" + if not any(tracker_df.loc[:, combined_col] == "1"): + tracker_df.loc[:, combined_col] = "" # all zeros columns leave blank + +def parent_columns(datadict_df): + parent_info = dict() + for _, row in datadict_df.iterrows(): + if row["dataType"] == "parent_identity": + prov = row["provenance"].split(" ") + if "file:" in prov and "variable:" in prov: + idx = prov.index("file:") + rc_filename = prov[idx+1].strip("\";") + idx = prov.index("variable:") + rc_variable = prov[idx+1].strip("\";") + parent_info.setdefault(rc_filename,[]).append(row["variable"]) + else: + continue + rc_df = pd.read_csv(all_redcap_paths[rc_filename]) + parent_ids = list(rc_df.loc[:, rc_variable]) + for id in parent_ids: + if re.search(study_no + '[089](\d{4})', str(id)): + child_id = study_no + '0' + re.search(study_no + '([089])(\d{4})', str(id)).group(2) + child_id = int(child_id) + parent = re.search(study_no + '([089])(\d{4})', str(id)).group(1) + else: + continue + try: + for suf in row["allowedSuffix"].split(", "): + if re.match("^" + session + "_e[0-9]+$", suf): + tracker_df.loc[child_id, row["variable"] + "_" + suf] = parent + except: + continue + elif row["dataType"] == "parent_lang": + prov = row["provenance"].split(" ") + if "file:" in prov and "variable:" in prov: + idx = prov.index("file:") + rc_filename = prov[idx+1].strip("\";") + idx = prov.index("variable:") + rc_variable = prov[idx+1].strip("\";") + parent_info.setdefault(rc_filename,[]).append(row["variable"]) + else: + continue + rc_df = pd.read_csv(all_redcap_paths[rc_filename], index_col="record_id") + for col in rc_df.columns: + lang_re = re.match(rc_variable + "_(s[0-9]+_r[0-9]+_e[0-9]+)", col) + if lang_re: + for _, rc_row in rc_df.iterrows(): + if re.search(study_no + '[089](\d{4})', str(rc_row.name)): + child_id = study_no + '0' + re.search(study_no + '([089])(\d{4})', str(rc_row.name)).group(2) + child_id = int(child_id) + if str(rc_row[col]) == "1" or str(rc_row[col]) == "2": + try: + for suf in row["allowedSuffix"].split(", "): + if re.match("^" + session + "_e[0-9]+$", suf): + tracker_df.loc[child_id, row["variable"] + "_" + suf] = str(rc_row[col]) + except: + continue + else: + print("Error: unknown value seen for parent language, should be 1 for English and 2 for Spanish.") + return parent_info + +if __name__ == "__main__": + checked_path = sys.argv[1] + dataset = sys.argv[2] + redcaps = sys.argv[3] + session = sys.argv[4] + child = sys.argv[5] + + redcaps = redcaps.split(',') + if session == "none": + session = "" + ses_tag = "" + else: + ses_tag = "_" + session + + DATA_DICT = dataset + "/data-monitoring/data-dictionary/central-tracker_datadict.csv" + df_dd = pd.read_csv(DATA_DICT) + redcheck_columns, allowed_duplicate_columns = get_redcap_columns(df_dd) + tasks_dict = get_tasks(df_dd) + ids = get_IDs(df_dd) + study_no = get_study_no(df_dd) + + # extract project path from dataset + proj_name = basename(normpath(dataset)) + + data_tracker_file = "{}/data-monitoring/central-tracker_{}.csv".format(dataset, proj_name) + tracker_df = pd.read_csv(data_tracker_file) + + tracker_ids = tracker_df["id"].tolist() + new_subjects = list(set(ids).difference(tracker_ids)) + if len(new_subjects) > 0: + new_subjects_df = pd.DataFrame({"id": new_subjects}) + tracker_df = tracker_df.append(new_subjects_df) + tracker_df = tracker_df.set_index("id") + tracker_df.sort_index(axis="index", inplace=True) + + subjects = tracker_df.index.to_list() + + all_redcap_columns = dict() # list of all redcap columns whose names should be mirrored in central tracker + all_redcap_paths = dict() + + if redcaps[0] != "none": + all_rc_dfs = dict() + all_rc_subjects = dict() + for expected_rc in redcheck_columns.keys(): + present = False + for redcap in redcaps: + if expected_rc in basename(redcap.lower()) and present == False: + redcap_path = redcap + all_redcap_paths[expected_rc] = redcap_path + present = True + elif expected_rc in basename(redcap.lower()) and present == True: + sys.error(c.RED + "Error: multiple redcaps found with name specified in datadict, " + redcap_path + " and " + redcap + ", exiting." + c.ENDC) + if present == False: + sys.exit(c.RED + "Error: can't find redcap specified in datadict " + expected_rc + ", exiting." + c.ENDC) + if "id_column" in redcheck_columns[expected_rc].keys(): + id_col = redcheck_columns[expected_rc]["id_column"] + for column in pd.read_csv(redcap_path).columns: + if column.startswith(id_col): + all_rc_dfs[expected_rc] = pd.read_csv(redcap_path, index_col = column) + else: + id_col = "record_id" + all_rc_dfs[expected_rc] = pd.read_csv(redcap_path, index_col = id_col) + # If hallMonitor passes "redcap" arg, data exists and passed checks + vals = pd.read_csv(redcap_path, header=None, nrows=1).iloc[0,:].value_counts() + # Exit if duplicate column names in redcap + if any(vals.values != 1): + dupes = [] + for rc_col in vals.keys(): + if vals[rc_col] > 1: + dupes.append(rc_col) + sys.exit(c.RED + 'Error: Duplicate columns found in redcap ' + redcap_path + ': ' + ', '.join(dupes) + '. Exiting' + c.ENDC) + for expected_rc in redcheck_columns.keys(): + rc_df = all_rc_dfs[expected_rc] + rc_subjects = [] + rc_ids = rc_df.index.tolist() + if child == 'true': + for id in rc_ids: + if re.search(study_no + '[089](\d{4})', str(id)): + child_id = int(study_no + '0' + re.search(study_no + '[089](\d{4})', str(id)).group(1)) + rc_subjects.append(child_id) + else: + rc_subjects = rc_ids + rc_subjects.sort() + + all_rc_subjects[expected_rc] = rc_subjects + + all_keys = dict() + for key, value in redcheck_columns[expected_rc].items(): + all_keys[key] = value + if key.startswith("consent") or key.startswith("assent") or key.startswith("id_column"): + #if key.startswith("consent") or key.startswith("assent") or key.startswith("id_column") or key.startswith("demo_e"): + continue + if not re.match('^.*es(_[a-zA-Z])?_s[0-9]+_r[0-9]+_e[0-9]+_complete', key) and key not in all_rc_dfs[expected_rc].columns: + other_rcs = [] + other_rc_dfs = {rc: all_rc_dfs[rc] for rc in all_rc_dfs if rc != expected_rc} + for redcap, other_rc_df in other_rc_dfs.items(): + if key in other_rc_df.columns: + other_rcs.append(redcap) + if len(other_rcs) >= 1: + sys.exit(c.RED + "Error: can\'t find " + key + " in " + expected_rc + " redcap, but found in " + ", ".join(other_rcs) + " redcaps, exiting." + c.ENDC) + else: + sys.exit(c.RED + "Error: can\'t find " + key + " in " + expected_rc + " redcap, exiting." + c.ENDC) + + for index, row in rc_df.iterrows(): + if (isinstance(index, float) or isinstance(index, int)) and not math.isnan(index): + id = int(row.name) + else: + print("skipping nan value in ", str(all_redcap_paths[expected_rc]), ": ", str(index)) + continue + if child == 'true': + if re.search(study_no + '[089](\d{4})', str(id)): + child_id = study_no + '0' + re.search(study_no + '[089](\d{4})', str(id)).group(1) + child_id = int(child_id) + else: + print(str(id), "doesn't match expected child or parent id format of \"" + study_no +"{0,8, or 9}XXXX\", skipping") + continue + else: + child_id = id + if child_id not in tracker_df.index: + print(child_id, "missing in tracker file, skipping") + continue + + keys_in_redcap = dict() + for key, value in all_keys.items(): + try: + val = rc_df.loc[id, key] + keys_in_redcap[key] = value + try: + if tracker_df.loc[child_id, value] == "1": + # if value already set continue + continue + else: + tracker_df.loc[child_id, value] = "1" if val == 2 else "0" + except: + tracker_df.loc[child_id, value] = "1" if val == 2 else "0" + except Exception as e_msg: + continue + + # for subject IDs missing from redcap, fill in "0" in redcap columns + for subj in set(subjects).difference(rc_subjects): + for key, value in keys_in_redcap.items(): + if re.match('^.*' + session + '_e[0-9]+$', value): + try: + tracker_df.loc[subj, value] = "0" + except Exception as e_msg: + continue + + duplicate_cols = [] + # drop any duplicate columns ending in ".NUMBER" + for col, _ in tracker_df.iteritems(): + if re.match('^.*\.[0-9]+$', col): + duplicate_cols.append(col) + tracker_df.drop(columns=duplicate_cols, inplace=True) + tracker_df.to_csv(data_tracker_file) + + for col in rc_df.columns: + if col.endswith(completed): + all_redcap_columns.setdefault(col,[]).append(all_redcap_paths[expected_rc]) + + parent_info = parent_columns(df_dd) + + for expected_rc in redcheck_columns.keys(): + if expected_rc in parent_info.keys(): + for subj in set(subjects).difference(all_rc_subjects[expected_rc]): + for col in tracker_df.columns: + for var in parent_info[expected_rc]: + if re.match('^' + var + '_' + session + '_e[0-9]+$', col): + try: + tracker_df.loc[subj, col] = "NA" + except Exception as e_msg: + continue + + all_duplicate_cols = [] + redcaps_of_duplicates = [] + for col, rcs in all_redcap_columns.items(): + if len(all_redcap_columns[col]) > 1 and col not in allowed_duplicate_columns: + all_duplicate_cols.append(col) + redcaps_of_duplicates.append(', '.join(rcs)) + if len(all_duplicate_cols) > 0: + errmsg = c.RED + "Error: Duplicate columns were found across Redcaps: " + for i in range(0, len(all_duplicate_cols)): + errmsg = errmsg + all_duplicate_cols[i] + " in " + redcaps_of_duplicates[i] + "; " + sys.exit(errmsg + "Exiting." + c.ENDC) + else: + sys.exit('Can\'t find redcaps in ' + dataset + '/sourcedata/raw/redcap, skipping ') + + for task, values in tasks_dict.items(): + datatype = values[0] + file_exts = values[1].split(", ") + file_sfxs = values[2].split(", ") + for subj in subjects: + subdir = "sub-" + str(subj) + dir_id = int(subj) + for sfx in file_sfxs: + suf_re = re.match('^(s[0-9]+_r[0-9]+)_e[0-9]+$', sfx) + if suf_re and suf_re.group(1) == session: + try: + corrected = False + for filename in listdir(join(checked_path, subdir, session, datatype)): + if re.match('^[Dd]eviation.*$', filename): + corrected = True + break + all_files_present = True + for ext in file_exts: + file_present = False + for filename in listdir(join(checked_path, subdir, session, datatype)): + if corrected: + if re.match('^sub-' + str(dir_id) + '_' + task + '_' + sfx + '[a-zA-Z0-9_-]*\\' + ext + '$', filename): + # when deviation.txt file present allow string between suffix and ext (e.g. "s1_r1_e1_firstrun_practice.eeg") + file_present = True + break + else: + if re.match('^sub-' + str(dir_id) + '_' + task + '_' + sfx + '\\' + ext + '$', filename): + file_present = True + break + if not file_present: + all_files_present = False + if all_files_present: + tracker_df.loc[dir_id, task + "_" + sfx] = "1" + else: + tracker_df.loc[dir_id, task + "_" + sfx] = "0" + except: + tracker_df.loc[dir_id, task + "_" + sfx] = "0" + + fill_combination_columns(tracker_df, df_dd) + + tracker_df.to_csv(data_tracker_file) + + # Create more readable csv with no blank columns + tracker_df = pd.read_csv(data_tracker_file, index_col="id") + data_tracker_filename = splitext(data_tracker_file)[0] + tracker_df_no_blank_columns = tracker_df.loc[:, tracker_df.notnull().any(axis=0)] + tracker_df_no_blank_columns = tracker_df_no_blank_columns.fillna("NA") + tracker_df_no_blank_columns.to_csv(data_tracker_filename + "_viewable.csv") + + # make remaining empty values equal to 0 + # tracker_df[collabel] = tracker_df[collabel].fillna("0") + + print(c.GREEN + "Success: {} data tracker updated.".format(', '.join([dtype[0] for dtype in list(tasks_dict.values())])) + c.ENDC) diff --git a/data-monitoring/verify-copy.py b/data-monitoring/verify-copy.py new file mode 100755 index 0000000..35f0ce2 --- /dev/null +++ b/data-monitoring/verify-copy.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python3 + +import sys +from os import listdir, makedirs, system +from os.path import join, isdir, isfile, splitext + +import shutil +import pandas as pd +import re +import math +import subprocess +from collections import defaultdict + +class c: + RED = '\033[31m' + GREEN = '\033[32m' + ENDC = '\033[0m' + BOLD = '\033[1m' + UNDERLINE = '\033[4m' + +def allowed_val(allowed_vals, value): + allowed_vals = allowed_vals.replace(" ", "") + intervals = re.split("[\[\]]", allowed_vals) + intervals = list(filter(lambda x: x not in [",", ""], intervals)) + allowed = False + for interval in intervals: + lower = float(interval.split(",")[0]) + upper = float(interval.split(",")[1]) + if lower <= int(value) <= upper: + allowed = True + break + return allowed + +def check_number_of_files(path, datatype, tasks, corrected): + if corrected: + print("deviation.txt seen in ", path, ", continuing.") + return + for raw_file in listdir(path): + file_re = re.match('^sub-([0-9]{7})_(.*)_(s[0-9]+_r[0-9]+_e[0-9]+)\.([a-z0-9.]+)$', raw_file) + if re.match('^[Dd]eviation$', raw_file): + print("deviation.txt seen in", path, ", continuing.") + return + if not file_re: + print("unexpected file format seen in", join(path, raw_file)) + if file_re and file_re.group(2) not in tasks: + print("unexpected task name seen in", join(path, raw_file)) + taskssum = 0 + already_counted = [] + for task in tasks: + comb = False + for row in combination_rows.keys(): + if task in already_counted: + comb = True + break + if task in combination_rows[row] and row not in already_counted: + comb = True + already_counted.extend(combination_rows[row]) + taskssum += len(dd_dict[task][2].split(",")) # number files expected from expectedFileExt # assume combination rows expect same # files + break + if not comb: + # not a combination row + taskssum += len(dd_dict[task][2].split(",")) # number files expected from expectedFileExt + obs_files = len(listdir(path)) + if obs_files > taskssum: + print(c.RED + "Error: number of", datatype, "data files in subject folder", sub, str(obs_files), "greater than the expected number", str(taskssum) + c.ENDC) + if obs_files < taskssum: + print(c.RED + "Error: number of", datatype, "data files in subject folder", sub, str(obs_files), "less than the expected number", str(taskssum) + c.ENDC) + tasks_seen = [] + for raw_file in listdir(path): + file_re = re.match('^sub-([0-9]+)_(.*)_(s[0-9]+_r[0-9]+_e[0-9]+)\.([a-z0-9]+)$', raw_file) + if file_re and file_re.group(2) not in tasks_seen: + tasks_seen.append(file_re.group(2)) + for key in combination_rows.keys(): + combination_rows_seen = set(tasks_seen).intersection(set(combination_rows[key])) + if len(combination_rows_seen) > 1: + print(c.RED + "Error: multiple different combination rows", str(combination_rows_seen), "seen in subject folder", sub, ": ", str(path), ", only one expected." + c.ENDC) + +def check_filenames(path, sub, ses, datatype, allowed_suffixes, possible_exts, numfiles, var, corrected): + task_files_counter = defaultdict(lambda: 0) + task_names = [] + for raw_file in listdir(path): + for task in task_vars: + if re.match('^sub-([0-9]{7})_('+task +')_(s[0-9]+_r[0-9]+_e[0-9]+)\.([a-z0-9.]+)$', raw_file): + if task not in task_names: + task_names.append(task) + task_files_counter[task] += 1 + if corrected: + print("deviation.txt seen in ", path, ", continuing.") + for raw_file in listdir(path): + # still check that files are in the correct subject folder and session folder + file_re = re.match("^(sub-[0-9]*)_([a-zA-Z0-9_-]*_)?(s[0-9]*_r[0-9]*)_e[0-9]*.*$", raw_file) + if file_re and file_re.group(1) != sub: + print(c.RED + "Error: file from subject", file_re.group(1), "found in", sub, "folder:", path + c.ENDC) + if file_re and len(ses) > 0 and file_re.group(3) != ses: + print(c.RED + "Error: file from session", file_re.group(3), "found in", ses, "folder:", path + c.ENDC) + return + for raw_file in listdir(path): + #check sub-#, check session folder, check extension + file_re = re.match("^(sub-([0-9]*))_([a-zA-Z0-9_-]*)_((s([0-9]*)_r([0-9]*))_e([0-9]*))((?:\.[a-zA-Z]+)*)$", raw_file) + if file_re: + if file_re.group(1) != sub: + print(c.RED + "Error: file from subject", file_re.group(1), "found in", sub, "folder:", join(path, raw_file) + c.ENDC) + if file_re.group(5) != ses and len(ses) > 0: + print(c.RED + "Error: file from session", file_re.group(5), "found in", ses, "folder:", join(path, raw_file) + c.ENDC) + if file_re.group(9) not in possible_exts and len(file_re.group(9)) > 0: + print(c.RED + "Error: file with extension", file_re.group(9), "found, doesn\'t match expected extensions", ", ".join(possible_exts), ":", join(path, raw_file) + c.ENDC) + if file_re.group(2) != '' and not allowed_val(allowed_subs, file_re.group(2)): + print(c.RED + "Error: subject number", file_re.group(2), "not an allowed subject value", allowed_subs, "in file:", join(path, raw_file) + c.ENDC) + if file_re.group(3) not in dd_dict.keys(): + print(c.RED + "Error: variable name", file_re.group(3), "does not match any datadict variables, in file:", join(path, raw_file) + c.ENDC) + if datatype not in file_re.group(3): + print(c.RED + "Error: variable name", file_re.group(3), "does not contain the name of the enclosing datatype folder", datatype, "in file:", join(path, raw_file) + c.ENDC) + if file_re.group(4) not in allowed_suffixes: + print(c.RED + "Error: suffix", file_re.group(4), "not in allowed suffixes", ", ".join(allowed_suffixes), "in file:", join(path, raw_file) + c.ENDC) + if file_re.group(2) == "": + print(c.RED + "Error: subject # missing from file:", join(path, raw_file) + c.ENDC) + if file_re.group(3) == "": + print(c.RED + "Error: variable name missing from file:", join(path, raw_file) + c.ENDC) + if file_re.group(6) == "": + print(c.RED + "Error: session # missing from file:", join(path, raw_file) + c.ENDC) + if file_re.group(7) == "": + print(c.RED + "Error: run # missing from file:", join(path, raw_file) + c.ENDC) + if file_re.group(8) == "": + print(c.RED + "Error: event # missing from file:", join(path, raw_file) + c.ENDC) + if file_re.group(9) == "": + print(c.RED + "Error: extension missing from file, does\'nt match expected extensions", ", ".join(possible_exts), ":", join(path, raw_file) + c.ENDC) + if datatype == "psychopy" and file_re.group(9) == ".csv" and file_re.group(2) != "": + # Call check-id.py for psychopy files + subprocess.run(["python3", "check-id.py", file_re.group(2), join(path, raw_file)], shell=False) + else: + print(c.RED + "Error: file ", join(path, raw_file), " does not match naming convention __." + c.ENDC) + combination = False + for dict_var, values in combination_rows.items(): + if var in values: + combination = True + combination_var = dict_var + break + for ext in possible_exts: + file_present = False + for ext2 in ext.split("|"): # in case of multiple options for extensions i.e. .zip.gpg|.tar.gpg + for suf in allowed_suffixes: + #if combination: + # combination_file_present = False + # for eitheror_var in combination_rows[combination_var]: + # if isfile(join(path, sub+'_'+eitheror_var+'_'+suf+ext2)): + # if combination_file_present: + # second_file_seen = sub+'_'+eitheror_var+'_'+suf+ext2 + # print(c.RED + "Error: both", file_seen, "and", second_file_seen, "found in", path + ", should have only one or the other" + c.ENDC) + # else: + # file_present = True + # combination_file_present = True + # file_seen = sub+'_'+eitheror_var+'_'+suf+ext2 + if combination: + for eitheror_var in combination_rows[combination_var]: + if isfile(join(path, sub+'_'+eitheror_var+'_'+suf+ext2)): + file_present = True + break + else: + if isfile(join(path, sub+'_'+var+'_'+suf+ext2)): + file_present = True + break + if not file_present: + print(c.RED + "Error: no such file", sub+'_'+var+'_sX_rX_eX'+ext, "can be found in", path + c.ENDC) + +if __name__ == "__main__": + dataset = sys.argv[1] + + raw = join(dataset,"sourcedata","raw") + checked = join(dataset,"sourcedata","checked") + + datadict = "{}/data-monitoring/data-dictionary/central-tracker_datadict.csv".format(dataset) + + sessions = False + for dir in listdir(join(dataset,"sourcedata","raw")): + if re.match("s[0-9]+_r[0-9]+(_e[0-9]+)?", dir): + sessions = True + break + + df_dd = pd.read_csv(datadict, index_col = "variable") + dd_dict = dict() + + task_vars = [] + combination_rows = {} + for _, row in df_dd.iterrows(): + if not isinstance(row["expectedFileExt"], float): + task_vars.append(row.name) + if row["dataType"] == "combination": + idx = row["provenance"].split(" ").index("variables:") + vars = "".join(row["provenance"].split(" ")[idx+1:]).split(",") + vars = [var.strip("\"") for var in vars] + combination_rows[row.name] = vars + + # build dict of expected files/datatypes from datadict + for var, row in df_dd.iterrows(): + if row.name in task_vars: + dd_dict[var] = [row["dataType"], row["allowedSuffix"], row["expectedFileExt"], row["allowedValues"]] + + allowed_subs = df_dd.loc["id", "allowedValues"] + + # now search sourcedata/raw for correct files + for variable, values in dd_dict.items(): + print("Verifying files in raw for:", variable) + datatype = values[0] + allowed_suffixes = values[1].split(", ") + fileexts = values[2].split(", ") # with or without . ? + allowed_vals = values[3].split(", ") + possible_exts = sum([ext.split('|') for ext in fileexts], []) + numfiles = len(fileexts) + + if sessions: + expected_sessions = [] + for ses in allowed_suffixes: + ses_re = re.match("(s[0-9]+_r[0-9]+)(_e[0-9]+)?", ses) + if ses_re: + expected_sessions.append(ses_re.group(1)) + else: + expected_sessions = [""] + for ses in expected_sessions: + if isdir(join(raw, ses, datatype)): + for subject in listdir(join(raw, ses, datatype)): + if not re.match("^sub-[0-9]+$", subject): + print(c.RED + "Error: subject directory ", subject, " does not match sub-# convention" + c.ENDC) + continue + path = join(raw, ses, datatype, subject) + # check that files in raw match conventions + corrected = False + for raw_file in listdir(path): + if re.match('^[Dd]eviation.*$', raw_file): + corrected = True + break + check_filenames(path, subject, ses, datatype, allowed_suffixes, possible_exts, numfiles, variable, corrected) + # copy to checked + for suffix in allowed_suffixes: + presence = False + copied_files = [] + for req_ext in fileexts: + for ext in req_ext.split('|'): + for raw_file in listdir(join(raw, ses, datatype, subject)): + if re.match(subject + "_" + variable + "_" + suffix + ext, raw_file): + presence = True + # copy file to checked, unless "deviation" is seen + if not isdir(join(checked, subject, ses, datatype)): + print(c.GREEN + "Creating ", join(subject, ses, datatype), " directory in checked" + c.ENDC) + makedirs(join(checked, subject, ses, datatype)) + if not isfile(join(checked, subject, ses, datatype, raw_file)) and splitext(raw_file)[1] != '.gpg': + print(c.GREEN + "Copying ", raw_file, " to checked" + c.ENDC) + system('cp -p ' + join(raw, ses, datatype, subject, raw_file) + ' ' + join(checked, subject, ses, datatype, raw_file)) + copied_files.append(raw_file) + else: + print(c.RED + "Error: can\'t find", datatype, "directory under", raw+"/"+ses + c.ENDC) + print("Verifying numbers of files in subdirectories in raw") + datatype_folders = [] + for subdir in dd_dict.values(): + if subdir[0] not in datatype_folders: + datatype_folders.append(subdir[0]) + for session_folder in listdir(raw): + if isdir(join(raw, session_folder)): + for datatype_folder in datatype_folders: + tasks = [] + for task, vals in dd_dict.items(): + if vals[0] == datatype_folder: + tasks.append(task) + if isdir(join(raw, session_folder, datatype_folder)): + for sub in listdir(join(raw, session_folder, datatype_folder)): + path = join(raw, session_folder, datatype_folder, sub) + corrected = False + for raw_file in listdir(path): + if re.match('^[Dd]eviation.*$', raw_file): + corrected = True + break + check_number_of_files(path, datatype_folder, tasks, corrected) + # do same filename checks for checked files + for variable, values in dd_dict.items(): + print("Verifying files in checked for:", variable) + variable = variable + datatype = values[0] + allowed_suffixes = values[1].split(", ") + fileexts = values[2].split(", ") # with or without . ? + allowed_vals = values[3].split(", ") + possible_exts = sum([ext.split('|') for ext in fileexts], []) + numfiles = len(fileexts) + + if sessions: + expected_sessions = [] + for ses in allowed_suffixes: + ses_re = re.match("(s[0-9]+_r[0-9]+)(_e[0-9]+)?", ses) + if ses_re: + expected_sessions.append(ses_re.group(1)) + else: + expected_sessions = [""] + for sub in listdir(checked): + if sub.startswith("sub-"): + for ses in expected_sessions: + if isdir(join(checked, sub, ses, datatype)): + # check that files in checked match conventions + path = join(checked, sub, ses, datatype) + corrected = False + for raw_file in listdir(path): + if re.match('^[Dd]eviation.*$', raw_file): + corrected = True + break + check_filenames(path, sub, ses, datatype, allowed_suffixes, possible_exts, numfiles, variable, corrected) + print("Verifying numbers of files in subdirectories in checked") + for sub in listdir(checked): + if isdir(join(checked, sub)): + for session_folder in listdir(join(checked, sub)): + if isdir(join(checked, sub, session_folder)): + for datatype_folder in datatype_folders: + tasks = [] + for task, vals in dd_dict.items(): + if vals[0] == datatype_folder: + tasks.append(task) + path = join(checked, sub, session_folder, datatype_folder) + if isdir(path): + corrected = False + for raw_file in listdir(path): + if re.match('^[Dd]eviation.*$', raw_file): + corrected = True + break + check_number_of_files(path, datatype_folder, tasks, corrected) diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0.psyexp b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0.psyexp new file mode 100755 index 0000000..edd9dbb --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0.psyexp @@ -0,0 +1,2983 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0.py b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0.py new file mode 100755 index 0000000..b815caa --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0.py @@ -0,0 +1,4004 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5), + on March 30, 2023, at 10:09 +If you publish work using this script the most relevant publication is: + + Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) + PsychoPy2: Experiments in behavior made easy Behav Res 51: 195. + https://doi.org/10.3758/s13428-018-01193-y + +""" + +# --- Import packages --- +from psychopy import locale_setup +from psychopy import prefs +prefs.hardware['audioLib'] = 'ptb' +from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout +from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, + STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) + +import numpy as np # whole numpy lib is available, prepend 'np.' +from numpy import (sin, cos, tan, log, log10, pi, average, + sqrt, std, deg2rad, rad2deg, linspace, asarray) +from numpy.random import random, randint, normal, shuffle, choice as randchoice +import os # handy system and path functions +import sys # to get file system encoding + +import psychopy.iohub as io +from psychopy.hardware import keyboard + + + +# Ensure that relative paths start from the same directory as this script +_thisDir = os.path.dirname(os.path.abspath(__file__)) +os.chdir(_thisDir) +# Store info about the experiment session +psychopyVersion = '2022.2.5' +expName = 'arrow-alert_v0' # from the Builder filename that created this script +expInfo = { + 'id': '1', + 'counterbalance': ['A1', 'A2', 'B1', 'B2', 'C1', 'C2'], + 'session': '1', + 'run': '1', +} +# --- Show participant info dialog -- +dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName) +if dlg.OK == False: + core.quit() # user pressed cancel +expInfo['date'] = data.getDateStr() # add a simple timestamp +expInfo['expName'] = expName +expInfo['psychopyVersion'] = psychopyVersion + +# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc +filename = _thisDir + os.sep + u'data/%s_%s_%s_%s_%s_%s' % (expInfo['id'], expInfo['counterbalance'], expInfo['session'], expInfo['run'], expName, expInfo['date']) + +# An ExperimentHandler isn't essential but helps with data saving +thisExp = data.ExperimentHandler(name=expName, version='', + extraInfo=expInfo, runtimeInfo=None, + originPath='C:\\Users\\NDCLab\\Desktop\\Experiments\\thrive\\arrow-alert-v0\\arrow-alert_v0.py', + savePickle=True, saveWideText=True, + dataFileName=filename) +# save a log file for detail verbose info +logFile = logging.LogFile(filename+'.log', level=logging.DEBUG) +logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file + +endExpNow = False # flag for 'escape' or other condition => quit the exp +frameTolerance = 0.001 # how close to onset before 'same' frame + +# Start Code - component code to be run after the window creation + +# --- Setup the Window --- +win = visual.Window( + size=[1920, 1080], fullscr=True, screen=0, + winType='pyglet', allowStencil=False, + monitor='testMonitor', color=[-1,-1,-1], colorSpace='rgb', + blendMode='avg', useFBO=True, + units='height') +win.mouseVisible = False +# store frame rate of monitor if we can measure it +expInfo['frameRate'] = win.getActualFrameRate() +if expInfo['frameRate'] != None: + frameDur = 1.0 / round(expInfo['frameRate']) +else: + frameDur = 1.0 / 60.0 # could not measure, so guess +# --- Setup input devices --- +ioConfig = {} + +# Setup iohub keyboard +ioConfig['Keyboard'] = dict(use_keymap='psychopy') + +ioSession = '1' +if 'session' in expInfo: + ioSession = str(expInfo['session']) +ioServer = io.launchHubServer(window=win, **ioConfig) +eyetracker = None + +# create a default keyboard (e.g. to check for escape) +defaultKeyboard = keyboard.Keyboard(backend='iohub') + +# --- Initialize components for Routine "JS_code" --- + +# --- Initialize components for Routine "setup" --- +# Run 'Begin Experiment' code from setup_code +import serial #used for sending eeg triggers +import time #indirerctly used for sending eeg triggers (how long to wait before clearing port) + +win.mouseVisible = False #hide mouse cursor +port = serial.Serial('COM4') #open specified port (COM3) for sending eeg triggers to +PulseWidth = 0.002 #how long to wait before clearing port after sending trigger (2 ms is sufficient at 1000 hz sampling rate) + +port.write([0x00]) #clear serial port +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else + +# --- Initialize components for Routine "welcome" --- +text = visual.TextStim(win=win, name='text', + text=kia, + font='Open Sans', + pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=0.0); +welcome_text = visual.TextStim(win=win, name='welcome_text', + text='Arrow Game\n\nWelcome to the arrow game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\n\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +welcome_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "welcome2" --- +welcome_text_2 = visual.TextStim(win=win, name='welcome_text_2', + text='Arrow Game\n\nWelcome to the arrow game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\nPress the right button to continue\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +welcome_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight" --- +instructRight_text = visual.TextStim(win=win, name='instructRight_text', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg = visual.ImageStim( + win=win, + name='instructRight_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1 = visual.ImageStim( + win=win, + name='instructRight_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1 = visual.ImageStim( + win=win, + name='instructRight_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight_2" --- +instructRight_text_2 = visual.TextStim(win=win, name='instructRight_text_2', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg_2 = visual.ImageStim( + win=win, + name='instructRight_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft" --- +instructLeft_text = visual.TextStim(win=win, name='instructLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg = visual.ImageStim( + win=win, + name='instructLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft_2" --- +instructLeft_text_2 = visual.TextStim(win=win, name='instructLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight" --- +instructInconRight_text = visual.TextStim(win=win, name='instructInconRight_text', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg = visual.ImageStim( + win=win, + name='instructIncon_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight_2" --- +instructInconRight_text_2 = visual.TextStim(win=win, name='instructInconRight_text_2', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg_2 = visual.ImageStim( + win=win, + name='instructIncon_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft" --- +instructInconLeft_text = visual.TextStim(win=win, name='instructInconLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft_2" --- +instructInconLeft_text_2 = visual.TextStim(win=win, name='instructInconLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders" --- +# Run 'Begin Experiment' code from prac_initAcc_code +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText = visual.TextStim(win=win, name='prac_blockText', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text = visual.TextStim(win=win, name='prac_reminder_text', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders_2" --- +# Run 'Begin Experiment' code from prac_initAcc_code_2 +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText_2 = visual.TextStim(win=win, name='prac_blockText_2', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text_2 = visual.TextStim(win=win, name='prac_reminder_text_2', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\nTo get ready, rest your right and left thumbs on the right and left buttons, then press the right button when you are ready to begin.\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=0.0) + +# --- Initialize components for Routine "prac_stimRoutine" --- +# Run 'Begin Experiment' code from prac_isi_code +#initialize the thisISI variable +thisISI = 0 +prac_centerImg = visual.ImageStim( + win=win, + name='prac_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +prac_rightImg1 = visual.ImageStim( + win=win, + name='prac_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +prac_rightImg2 = visual.ImageStim( + win=win, + name='prac_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +prac_leftImg1 = visual.ImageStim( + win=win, + name='prac_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +prac_leftImg2 = visual.ImageStim( + win=win, + name='prac_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +prac_fixImg = visual.ImageStim( + win=win, + name='prac_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +prac_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockFeed" --- +prac_blockFeed_text = visual.TextStim(win=win, name='prac_blockFeed_text', + text='', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +prac_pressContinue = visual.TextStim(win=win, name='prac_pressContinue', + text='Experimenter: press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +prac_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_condition" --- +# Run 'Begin Experiment' code from condition_init_blockCounter +#initialize the following variables at the start of the condition +blockCounter = 0 +condition_whichCondition_text = visual.TextStim(win=win, name='condition_whichCondition_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +condition_reminder_text = visual.TextStim(win=win, name='condition_reminder_text', + text='Experimenter: provide instructions and then press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.8, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +condition_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "oberve_other" --- + +# --- Initialize components for Routine "task_blockReminders" --- +task_blockText = visual.TextStim(win=win, name='task_blockText', + text='', + font='Arial', + pos=(0, .1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +task_blockReminders_text = visual.TextStim(win=win, name='task_blockReminders_text', + text='Remember to limit blinking to about about once every ten seconds (or less).\n\nPlease try to relax the muscles in your face, neck, and shoulders. \n\nRest your right and left thumbs on the right and left buttons. When you are ready, press the right button to begin.\n', + font='Arial', + pos=(0, -.25), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blockReminders_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=0.0) + +# --- Initialize components for Routine "task_stimRoutine" --- +# Run 'Begin Experiment' code from task_isi_code +#no need to initialize thisISI, as already done in practice code snippit +task_centerImg = visual.ImageStim( + win=win, + name='task_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +task_rightImg1 = visual.ImageStim( + win=win, + name='task_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +task_rightImg2 = visual.ImageStim( + win=win, + name='task_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +task_leftImg1 = visual.ImageStim( + win=win, + name='task_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +task_leftImg2 = visual.ImageStim( + win=win, + name='task_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +task_fixImg = visual.ImageStim( + win=win, + name='task_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +task_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockFeed" --- +task_blockFeed_text = visual.TextStim(win=win, name='task_blockFeed_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +task_blackFeed_text3 = visual.TextStim(win=win, name='task_blackFeed_text3', + text='Please wait', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +task_blockFeed_text2 = visual.TextStim(win=win, name='task_blockFeed_text2', + text='', + font='Arial', + pos=(0, -0.3), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-3.0); +task_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_conditionComplete" --- +conditionComplete_text = visual.TextStim(win=win, name='conditionComplete_text', + text='Please ring bell and wait for experimenter to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=0.0); +conditionComplete_key_resp = keyboard.Keyboard() + +# Create some handy timers +globalClock = core.Clock() # to track the time since experiment started +routineTimer = core.Clock() # to track time remaining of each (possibly non-slip) routine + +# --- Prepare to start Routine "JS_code" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +JS_codeComponents = [] +for thisComponent in JS_codeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "JS_code" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "JS_code" --- +for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "JS_code" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "setup" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +setupComponents = [] +for thisComponent in setupComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "setup" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in setupComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "setup" --- +for thisComponent in setupComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "setup" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp.keys = [] +welcome_keyResp.rt = [] +_welcome_keyResp_allKeys = [] +# keep track of which components have finished +welcomeComponents = [text, welcome_text, welcome_keyResp] +for thisComponent in welcomeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *text* updates + if text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + text.frameNStart = frameN # exact frame index + text.tStart = t # local t and not account for scr refresh + text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'text.started') + text.setAutoDraw(True) + if text.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > text.tStartRefresh + 1.0-frameTolerance: + # keep track of stop time/frame for later + text.tStop = t # not accounting for scr refresh + text.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'text.stopped') + text.setAutoDraw(False) + + # *welcome_text* updates + if welcome_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text.frameNStart = frameN # exact frame index + welcome_text.tStart = t # local t and not account for scr refresh + welcome_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text, 'tStartRefresh') # time at next scr refresh + welcome_text.setAutoDraw(True) + + # *welcome_keyResp* updates + waitOnFlip = False + if welcome_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp.frameNStart = frameN # exact frame index + welcome_keyResp.tStart = t # local t and not account for scr refresh + welcome_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp, 'tStartRefresh') # time at next scr refresh + welcome_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp.getKeys(keyList=['c'], waitRelease=False) + _welcome_keyResp_allKeys.extend(theseKeys) + if len(_welcome_keyResp_allKeys): + welcome_keyResp.keys = _welcome_keyResp_allKeys[-1].name # just the last key pressed + welcome_keyResp.rt = _welcome_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcomeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome" --- +for thisComponent in welcomeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp_2.keys = [] +welcome_keyResp_2.rt = [] +_welcome_keyResp_2_allKeys = [] +# keep track of which components have finished +welcome2Components = [welcome_text_2, welcome_keyResp_2] +for thisComponent in welcome2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_text_2* updates + if welcome_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text_2.frameNStart = frameN # exact frame index + welcome_text_2.tStart = t # local t and not account for scr refresh + welcome_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text_2, 'tStartRefresh') # time at next scr refresh + welcome_text_2.setAutoDraw(True) + + # *welcome_keyResp_2* updates + waitOnFlip = False + if welcome_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp_2.frameNStart = frameN # exact frame index + welcome_keyResp_2.tStart = t # local t and not account for scr refresh + welcome_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp_2, 'tStartRefresh') # time at next scr refresh + welcome_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _welcome_keyResp_2_allKeys.extend(theseKeys) + if len(_welcome_keyResp_2_allKeys): + welcome_keyResp_2.keys = _welcome_keyResp_2_allKeys[-1].name # just the last key pressed + welcome_keyResp_2.rt = _welcome_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcome2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome2" --- +for thisComponent in welcome2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp.keys = [] +insructRight_keyResp.rt = [] +_insructRight_keyResp_allKeys = [] +# keep track of which components have finished +instructRightComponents = [instructRight_text, instructRight_centerImg, instructRight_rightImg1, instructRight_rightImg2, instructRight_leftImg1, instructRight_leftImg2, insructRight_keyResp] +for thisComponent in instructRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text* updates + if instructRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text.frameNStart = frameN # exact frame index + instructRight_text.tStart = t # local t and not account for scr refresh + instructRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text, 'tStartRefresh') # time at next scr refresh + instructRight_text.setAutoDraw(True) + + # *instructRight_centerImg* updates + if instructRight_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg.frameNStart = frameN # exact frame index + instructRight_centerImg.tStart = t # local t and not account for scr refresh + instructRight_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg.setAutoDraw(True) + + # *instructRight_rightImg1* updates + if instructRight_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1.frameNStart = frameN # exact frame index + instructRight_rightImg1.tStart = t # local t and not account for scr refresh + instructRight_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1.setAutoDraw(True) + + # *instructRight_rightImg2* updates + if instructRight_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2.frameNStart = frameN # exact frame index + instructRight_rightImg2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2.setAutoDraw(True) + + # *instructRight_leftImg1* updates + if instructRight_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1.frameNStart = frameN # exact frame index + instructRight_leftImg1.tStart = t # local t and not account for scr refresh + instructRight_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1.setAutoDraw(True) + + # *instructRight_leftImg2* updates + if instructRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2.frameNStart = frameN # exact frame index + instructRight_leftImg2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2.setAutoDraw(True) + + # *insructRight_keyResp* updates + waitOnFlip = False + if insructRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp.frameNStart = frameN # exact frame index + insructRight_keyResp.tStart = t # local t and not account for scr refresh + insructRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructRight_keyResp_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_allKeys): + insructRight_keyResp.keys = _insructRight_keyResp_allKeys[-1].name # just the last key pressed + insructRight_keyResp.rt = _insructRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight" --- +for thisComponent in instructRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp_2.keys = [] +insructRight_keyResp_2.rt = [] +_insructRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructRight_2Components = [instructRight_text_2, instructRight_centerImg_2, instructRight_rightImg1_2, instructRight_rightImg2_2, instructRight_leftImg1_2, instructRight_leftImg2_2, insructRight_keyResp_2] +for thisComponent in instructRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text_2* updates + if instructRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text_2.frameNStart = frameN # exact frame index + instructRight_text_2.tStart = t # local t and not account for scr refresh + instructRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text_2, 'tStartRefresh') # time at next scr refresh + instructRight_text_2.setAutoDraw(True) + + # *instructRight_centerImg_2* updates + if instructRight_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg_2.frameNStart = frameN # exact frame index + instructRight_centerImg_2.tStart = t # local t and not account for scr refresh + instructRight_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg_2.setAutoDraw(True) + + # *instructRight_rightImg1_2* updates + if instructRight_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1_2.frameNStart = frameN # exact frame index + instructRight_rightImg1_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1_2.setAutoDraw(True) + + # *instructRight_rightImg2_2* updates + if instructRight_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2_2.frameNStart = frameN # exact frame index + instructRight_rightImg2_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2_2.setAutoDraw(True) + + # *instructRight_leftImg1_2* updates + if instructRight_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1_2.frameNStart = frameN # exact frame index + instructRight_leftImg1_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1_2.setAutoDraw(True) + + # *instructRight_leftImg2_2* updates + if instructRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2_2.frameNStart = frameN # exact frame index + instructRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2_2.setAutoDraw(True) + + # *insructRight_keyResp_2* updates + waitOnFlip = False + if insructRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp_2.frameNStart = frameN # exact frame index + insructRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_2_allKeys): + insructRight_keyResp_2.keys = _insructRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructRight_keyResp_2.rt = _insructRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight_2" --- +for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp.keys = [] +instructLeft_keyResp.rt = [] +_instructLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructLeftComponents = [instructLeft_text, instructLeft_centerImg, instructLeft_rightImg1, instructLeft_rightImg2, instructLeft_leftImg1, instructLeft_leftImg2, instructLeft_keyResp] +for thisComponent in instructLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text* updates + if instructLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text.frameNStart = frameN # exact frame index + instructLeft_text.tStart = t # local t and not account for scr refresh + instructLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text, 'tStartRefresh') # time at next scr refresh + instructLeft_text.setAutoDraw(True) + + # *instructLeft_centerImg* updates + if instructLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg.frameNStart = frameN # exact frame index + instructLeft_centerImg.tStart = t # local t and not account for scr refresh + instructLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg.setAutoDraw(True) + + # *instructLeft_rightImg1* updates + if instructLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1.frameNStart = frameN # exact frame index + instructLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1.setAutoDraw(True) + + # *instructLeft_rightImg2* updates + if instructLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2.frameNStart = frameN # exact frame index + instructLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2.setAutoDraw(True) + + # *instructLeft_leftImg1* updates + if instructLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1.frameNStart = frameN # exact frame index + instructLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1.setAutoDraw(True) + + # *instructLeft_leftImg2* updates + if instructLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2.frameNStart = frameN # exact frame index + instructLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2.setAutoDraw(True) + + # *instructLeft_keyResp* updates + waitOnFlip = False + if instructLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp.frameNStart = frameN # exact frame index + instructLeft_keyResp.tStart = t # local t and not account for scr refresh + instructLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_allKeys): + instructLeft_keyResp.keys = _instructLeft_keyResp_allKeys[-1].name # just the last key pressed + instructLeft_keyResp.rt = _instructLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft" --- +for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp_2.keys = [] +instructLeft_keyResp_2.rt = [] +_instructLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructLeft_2Components = [instructLeft_text_2, instructLeft_centerImg_2, instructLeft_rightImg1_2, instructLeft_rightImg2_2, instructLeft_leftImg1_2, instructLeft_leftImg2_2, instructLeft_keyResp_2] +for thisComponent in instructLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text_2* updates + if instructLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text_2.frameNStart = frameN # exact frame index + instructLeft_text_2.tStart = t # local t and not account for scr refresh + instructLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructLeft_text_2.setAutoDraw(True) + + # *instructLeft_centerImg_2* updates + if instructLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg_2.frameNStart = frameN # exact frame index + instructLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg_2.setAutoDraw(True) + + # *instructLeft_rightImg1_2* updates + if instructLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1_2.setAutoDraw(True) + + # *instructLeft_rightImg2_2* updates + if instructLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2_2.setAutoDraw(True) + + # *instructLeft_leftImg1_2* updates + if instructLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1_2.setAutoDraw(True) + + # *instructLeft_leftImg2_2* updates + if instructLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2_2.setAutoDraw(True) + + # *instructLeft_keyResp_2* updates + waitOnFlip = False + if instructLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp_2.frameNStart = frameN # exact frame index + instructLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_2_allKeys): + instructLeft_keyResp_2.keys = _instructLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructLeft_keyResp_2.rt = _instructLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft_2" --- +for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp.keys = [] +insructInconRight_keyResp.rt = [] +_insructInconRight_keyResp_allKeys = [] +# keep track of which components have finished +instructInconRightComponents = [instructInconRight_text, instructIncon_centerImg, instructIncon_rightImg1, instructIncon_rightImg2, instructIncon_leftImg1, instructInconRight_leftImg2, insructInconRight_keyResp] +for thisComponent in instructInconRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text* updates + if instructInconRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text.frameNStart = frameN # exact frame index + instructInconRight_text.tStart = t # local t and not account for scr refresh + instructInconRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text, 'tStartRefresh') # time at next scr refresh + instructInconRight_text.setAutoDraw(True) + + # *instructIncon_centerImg* updates + if instructIncon_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg.frameNStart = frameN # exact frame index + instructIncon_centerImg.tStart = t # local t and not account for scr refresh + instructIncon_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg.setAutoDraw(True) + + # *instructIncon_rightImg1* updates + if instructIncon_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1.frameNStart = frameN # exact frame index + instructIncon_rightImg1.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1.setAutoDraw(True) + + # *instructIncon_rightImg2* updates + if instructIncon_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2.frameNStart = frameN # exact frame index + instructIncon_rightImg2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2.setAutoDraw(True) + + # *instructIncon_leftImg1* updates + if instructIncon_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1.frameNStart = frameN # exact frame index + instructIncon_leftImg1.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1.setAutoDraw(True) + + # *instructInconRight_leftImg2* updates + if instructInconRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2.setAutoDraw(True) + + # *insructInconRight_keyResp* updates + waitOnFlip = False + if insructInconRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp.frameNStart = frameN # exact frame index + insructInconRight_keyResp.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructInconRight_keyResp_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_allKeys): + insructInconRight_keyResp.keys = _insructInconRight_keyResp_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp.rt = _insructInconRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight" --- +for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp_2.keys = [] +insructInconRight_keyResp_2.rt = [] +_insructInconRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconRight_2Components = [instructInconRight_text_2, instructIncon_centerImg_2, instructIncon_rightImg1_2, instructIncon_rightImg2_2, instructIncon_leftImg1_2, instructInconRight_leftImg2_2, insructInconRight_keyResp_2] +for thisComponent in instructInconRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text_2* updates + if instructInconRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text_2.frameNStart = frameN # exact frame index + instructInconRight_text_2.tStart = t # local t and not account for scr refresh + instructInconRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_text_2.setAutoDraw(True) + + # *instructIncon_centerImg_2* updates + if instructIncon_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg_2.frameNStart = frameN # exact frame index + instructIncon_centerImg_2.tStart = t # local t and not account for scr refresh + instructIncon_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg_2.setAutoDraw(True) + + # *instructIncon_rightImg1_2* updates + if instructIncon_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1_2.frameNStart = frameN # exact frame index + instructIncon_rightImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1_2.setAutoDraw(True) + + # *instructIncon_rightImg2_2* updates + if instructIncon_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2_2.frameNStart = frameN # exact frame index + instructIncon_rightImg2_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2_2.setAutoDraw(True) + + # *instructIncon_leftImg1_2* updates + if instructIncon_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1_2.frameNStart = frameN # exact frame index + instructIncon_leftImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1_2.setAutoDraw(True) + + # *instructInconRight_leftImg2_2* updates + if instructInconRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2_2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2_2.setAutoDraw(True) + + # *insructInconRight_keyResp_2* updates + waitOnFlip = False + if insructInconRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp_2.frameNStart = frameN # exact frame index + insructInconRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructInconRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_2_allKeys): + insructInconRight_keyResp_2.keys = _insructInconRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp_2.rt = _insructInconRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight_2" --- +for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp.keys = [] +instructInconLeft_keyResp.rt = [] +_instructInconLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructInconLeftComponents = [instructInconLeft_text, instructInconLeft_centerImg, instructInconLeft_rightImg1, instructInconLeft_rightImg2, instructInconLeft_leftImg1, instructInconLeft_leftImg2, instructInconLeft_keyResp] +for thisComponent in instructInconLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text* updates + if instructInconLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text.frameNStart = frameN # exact frame index + instructInconLeft_text.tStart = t # local t and not account for scr refresh + instructInconLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text.setAutoDraw(True) + + # *instructInconLeft_centerImg* updates + if instructInconLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg.frameNStart = frameN # exact frame index + instructInconLeft_centerImg.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg.setAutoDraw(True) + + # *instructInconLeft_rightImg1* updates + if instructInconLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1.setAutoDraw(True) + + # *instructInconLeft_rightImg2* updates + if instructInconLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2.setAutoDraw(True) + + # *instructInconLeft_leftImg1* updates + if instructInconLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1.setAutoDraw(True) + + # *instructInconLeft_leftImg2* updates + if instructInconLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2.setAutoDraw(True) + + # *instructInconLeft_keyResp* updates + waitOnFlip = False + if instructInconLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp.frameNStart = frameN # exact frame index + instructInconLeft_keyResp.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructInconLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_allKeys): + instructInconLeft_keyResp.keys = _instructInconLeft_keyResp_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp.rt = _instructInconLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft" --- +for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp_2.keys = [] +instructInconLeft_keyResp_2.rt = [] +_instructInconLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconLeft_2Components = [instructInconLeft_text_2, instructInconLeft_centerImg_2, instructInconLeft_rightImg1_2, instructInconLeft_rightImg2_2, instructInconLeft_leftImg1_2, instructInconLeft_leftImg2_2, instructInconLeft_keyResp_2] +for thisComponent in instructInconLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text_2* updates + if instructInconLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text_2.frameNStart = frameN # exact frame index + instructInconLeft_text_2.tStart = t # local t and not account for scr refresh + instructInconLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text_2.setAutoDraw(True) + + # *instructInconLeft_centerImg_2* updates + if instructInconLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg_2.frameNStart = frameN # exact frame index + instructInconLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg_2.setAutoDraw(True) + + # *instructInconLeft_rightImg1_2* updates + if instructInconLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1_2.setAutoDraw(True) + + # *instructInconLeft_rightImg2_2* updates + if instructInconLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2_2.setAutoDraw(True) + + # *instructInconLeft_leftImg1_2* updates + if instructInconLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1_2.setAutoDraw(True) + + # *instructInconLeft_leftImg2_2* updates + if instructInconLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2_2.setAutoDraw(True) + + # *instructInconLeft_keyResp_2* updates + waitOnFlip = False + if instructInconLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp_2.frameNStart = frameN # exact frame index + instructInconLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructInconLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_2_allKeys): + instructInconLeft_keyResp_2.keys = _instructInconLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp_2.rt = _instructInconLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft_2" --- +for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# set up handler to look after randomisation of conditions etc +prac_block_loop = data.TrialHandler(nReps=1, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='prac_block_loop') +thisExp.addLoop(prac_block_loop) # add the loop to the experiment +thisPrac_block_loop = prac_block_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) +if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + +for thisPrac_block_loop in prac_block_loop: + currentLoop = prac_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) + if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp.keys = [] + prac_reminder_keyResp.rt = [] + _prac_reminder_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockRemindersComponents = [prac_blockText, prac_reminder_text, prac_reminder_keyResp] + for thisComponent in prac_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText* updates + if prac_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText.frameNStart = frameN # exact frame index + prac_blockText.tStart = t # local t and not account for scr refresh + prac_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText.started') + prac_blockText.setAutoDraw(True) + + # *prac_reminder_text* updates + if prac_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text.frameNStart = frameN # exact frame index + prac_reminder_text.tStart = t # local t and not account for scr refresh + prac_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text.started') + prac_reminder_text.setAutoDraw(True) + + # *prac_reminder_keyResp* updates + waitOnFlip = False + if prac_reminder_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp.frameNStart = frameN # exact frame index + prac_reminder_keyResp.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp.started') + prac_reminder_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_reminder_keyResp_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_allKeys): + prac_reminder_keyResp.keys = _prac_reminder_keyResp_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp.rt = _prac_reminder_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders" --- + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp.keys in ['', [], None]: # No response was made + prac_reminder_keyResp.keys = None + prac_block_loop.addData('prac_reminder_keyResp.keys',prac_reminder_keyResp.keys) + if prac_reminder_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp.rt', prac_reminder_keyResp.rt) + # the Routine "prac_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "prac_blockReminders_2" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp_2.keys = [] + prac_reminder_keyResp_2.rt = [] + _prac_reminder_keyResp_2_allKeys = [] + # keep track of which components have finished + prac_blockReminders_2Components = [prac_blockText_2, prac_reminder_text_2, prac_reminder_keyResp_2] + for thisComponent in prac_blockReminders_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders_2" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText_2* updates + if prac_blockText_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText_2.frameNStart = frameN # exact frame index + prac_blockText_2.tStart = t # local t and not account for scr refresh + prac_blockText_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText_2.started') + prac_blockText_2.setAutoDraw(True) + + # *prac_reminder_text_2* updates + if prac_reminder_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text_2.frameNStart = frameN # exact frame index + prac_reminder_text_2.tStart = t # local t and not account for scr refresh + prac_reminder_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text_2.started') + prac_reminder_text_2.setAutoDraw(True) + + # *prac_reminder_keyResp_2* updates + waitOnFlip = False + if prac_reminder_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp_2.frameNStart = frameN # exact frame index + prac_reminder_keyResp_2.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp_2.started') + prac_reminder_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _prac_reminder_keyResp_2_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_2_allKeys): + prac_reminder_keyResp_2.keys = _prac_reminder_keyResp_2_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp_2.rt = _prac_reminder_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders_2" --- + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp_2.keys in ['', [], None]: # No response was made + prac_reminder_keyResp_2.keys = None + prac_block_loop.addData('prac_reminder_keyResp_2.keys',prac_reminder_keyResp_2.keys) + if prac_reminder_keyResp_2.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp_2.rt', prac_reminder_keyResp_2.rt) + # the Routine "prac_blockReminders_2" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + prac_trial_loop = data.TrialHandler(nReps=10, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions('prac_trials.xlsx'), + seed=None, name='prac_trial_loop') + thisExp.addLoop(prac_trial_loop) # add the loop to the experiment + thisPrac_trial_loop = prac_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + for thisPrac_trial_loop in prac_trial_loop: + currentLoop = prac_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + prac_trial_loop.addData('ISI', thisISI) + + + # show in console for debugging + #print('thisISI: ', thisISI) + prac_centerImg.setImage(middleStim) + prac_rightImg1.setImage(rightStim1) + prac_rightImg2.setImage(rightStim2) + prac_leftImg1.setImage(leftStim1) + prac_leftImg2.setImage(leftStim1) + prac_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from prac_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + prac_stim_keyResp.keys = [] + prac_stim_keyResp.rt = [] + _prac_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from prac_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + prac_stimRoutineComponents = [prac_centerImg, prac_rightImg1, prac_rightImg2, prac_leftImg1, prac_leftImg2, prac_fixImg, prac_stim_keyResp] + for thisComponent in prac_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_centerImg* updates + if prac_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_centerImg.frameNStart = frameN # exact frame index + prac_centerImg.tStart = t # local t and not account for scr refresh + prac_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.started') + prac_centerImg.setAutoDraw(True) + if prac_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_centerImg.tStop = t # not accounting for scr refresh + prac_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.stopped') + prac_centerImg.setAutoDraw(False) + + # *prac_rightImg1* updates + if prac_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg1.frameNStart = frameN # exact frame index + prac_rightImg1.tStart = t # local t and not account for scr refresh + prac_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.started') + prac_rightImg1.setAutoDraw(True) + if prac_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg1.tStop = t # not accounting for scr refresh + prac_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.stopped') + prac_rightImg1.setAutoDraw(False) + + # *prac_rightImg2* updates + if prac_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg2.frameNStart = frameN # exact frame index + prac_rightImg2.tStart = t # local t and not account for scr refresh + prac_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.started') + prac_rightImg2.setAutoDraw(True) + if prac_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg2.tStop = t # not accounting for scr refresh + prac_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.stopped') + prac_rightImg2.setAutoDraw(False) + + # *prac_leftImg1* updates + if prac_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg1.frameNStart = frameN # exact frame index + prac_leftImg1.tStart = t # local t and not account for scr refresh + prac_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.started') + prac_leftImg1.setAutoDraw(True) + if prac_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg1.tStop = t # not accounting for scr refresh + prac_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.stopped') + prac_leftImg1.setAutoDraw(False) + + # *prac_leftImg2* updates + if prac_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg2.frameNStart = frameN # exact frame index + prac_leftImg2.tStart = t # local t and not account for scr refresh + prac_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.started') + prac_leftImg2.setAutoDraw(True) + if prac_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg2.tStop = t # not accounting for scr refresh + prac_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.stopped') + prac_leftImg2.setAutoDraw(False) + + # *prac_fixImg* updates + if prac_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_fixImg.frameNStart = frameN # exact frame index + prac_fixImg.tStart = t # local t and not account for scr refresh + prac_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.started') + prac_fixImg.setAutoDraw(True) + if prac_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_fixImg.tStop = t # not accounting for scr refresh + prac_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.stopped') + prac_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from prac_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if prac_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 1: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x01]) #hexcode = 1; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 2: + stimTriggerSent = True + port.write([0x02]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 3: + stimTriggerSent = True + port.write([0x03]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 4: + stimTriggerSent = True + port.write([0x04]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *prac_stim_keyResp* updates + waitOnFlip = False + if prac_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_stim_keyResp.frameNStart = frameN # exact frame index + prac_stim_keyResp.tStart = t # local t and not account for scr refresh + prac_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.started') + prac_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_stim_keyResp.tStop = t # not accounting for scr refresh + prac_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.stopped') + prac_stim_keyResp.status = FINISHED + if prac_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _prac_stim_keyResp_allKeys.extend(theseKeys) + if len(_prac_stim_keyResp_allKeys): + prac_stim_keyResp.keys = [key.name for key in _prac_stim_keyResp_allKeys] # storing all keys + prac_stim_keyResp.rt = [key.rt for key in _prac_stim_keyResp_allKeys] + # Run 'Each Frame' code from prac_respTrigger_code + if prac_stim_keyResp.keys and len(prac_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(prac_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(prac_stim_keyResp.keys) < 2: #if this is the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(prac_stim_keyResp.keys) >= 2: #if this is NOT the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_stimRoutine" --- + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_stim_keyResp.keys in ['', [], None]: # No response was made + prac_stim_keyResp.keys = None + prac_trial_loop.addData('prac_stim_keyResp.keys',prac_stim_keyResp.keys) + if prac_stim_keyResp.keys != None: # we had a response + prac_trial_loop.addData('prac_stim_keyResp.rt', prac_stim_keyResp.rt) + # Run 'End Routine' code from prac_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from prac_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if prac_stim_keyResp.keys: #if at least one response was made this trial + if prac_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif prac_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + prac_trial_loop.addData('accuracy', accuracy) + # the Routine "prac_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10 repeats of 'prac_trial_loop' + + + # --- Prepare to start Routine "prac_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockAcc >= .75: #if accuracy >= 75% then say practice is complete and end practice loop to continue to main exp + outPut = 'You will now play the real game' #feedback presented + prac_block_loop.finished = True #end practice loop to continue to main exp + elif blockAcc <= .75: #if accuracy < 75% then say that practice needs to be repeated and DO NOT end practice loop, instead, allow it to repeat + outPut = 'Please try the practice again' #feedback presented + prac_block_loop.finished = False #DO NOT end practice loop and allow to repeat + + #reset the following variables to zero before the next practice block starts + trialNum = 0 + numCorr = 0 + prac_blockFeed_text.setText(outPut) + prac_blockFeed_keyResp.keys = [] + prac_blockFeed_keyResp.rt = [] + _prac_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockFeedComponents = [prac_blockFeed_text, prac_pressContinue, prac_blockFeed_keyResp] + for thisComponent in prac_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockFeed_text* updates + if prac_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_text.frameNStart = frameN # exact frame index + prac_blockFeed_text.tStart = t # local t and not account for scr refresh + prac_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_text.started') + prac_blockFeed_text.setAutoDraw(True) + + # *prac_pressContinue* updates + if prac_pressContinue.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_pressContinue.frameNStart = frameN # exact frame index + prac_pressContinue.tStart = t # local t and not account for scr refresh + prac_pressContinue.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_pressContinue, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_pressContinue.started') + prac_pressContinue.setAutoDraw(True) + + # *prac_blockFeed_keyResp* updates + waitOnFlip = False + if prac_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_keyResp.frameNStart = frameN # exact frame index + prac_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + prac_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_keyResp.started') + prac_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_blockFeed_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_prac_blockFeed_keyResp_allKeys): + prac_blockFeed_keyResp.keys = _prac_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + prac_blockFeed_keyResp.rt = _prac_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockFeed" --- + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_blockFeed_keyResp.keys in ['', [], None]: # No response was made + prac_blockFeed_keyResp.keys = None + prac_block_loop.addData('prac_blockFeed_keyResp.keys',prac_blockFeed_keyResp.keys) + if prac_blockFeed_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_blockFeed_keyResp.rt', prac_blockFeed_keyResp.rt) + # the Routine "prac_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 1 repeats of 'prac_block_loop' + + +# set up handler to look after randomisation of conditions etc +task_condition_loop = data.TrialHandler(nReps=1.0, method='sequential', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions("condition_"+expInfo['counterbalance']+".xlsx"), + seed=None, name='task_condition_loop') +thisExp.addLoop(task_condition_loop) # add the loop to the experiment +thisTask_condition_loop = task_condition_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) +if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + +for thisTask_condition_loop in task_condition_loop: + currentLoop = task_condition_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) + if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_condition" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from condition_init_blockCounter + #reset the following variables at the start of the experiment + blockCounter = 0 + condition_whichCondition_text.setText(conditionText) + condition_keyResp.keys = [] + condition_keyResp.rt = [] + _condition_keyResp_allKeys = [] + # keep track of which components have finished + task_conditionComponents = [condition_whichCondition_text, condition_reminder_text, condition_keyResp] + for thisComponent in task_conditionComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_condition" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *condition_whichCondition_text* updates + if condition_whichCondition_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_whichCondition_text.frameNStart = frameN # exact frame index + condition_whichCondition_text.tStart = t # local t and not account for scr refresh + condition_whichCondition_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_whichCondition_text, 'tStartRefresh') # time at next scr refresh + condition_whichCondition_text.setAutoDraw(True) + + # *condition_reminder_text* updates + if condition_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_reminder_text.frameNStart = frameN # exact frame index + condition_reminder_text.tStart = t # local t and not account for scr refresh + condition_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_reminder_text, 'tStartRefresh') # time at next scr refresh + condition_reminder_text.setAutoDraw(True) + + # *condition_keyResp* updates + waitOnFlip = False + if condition_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_keyResp.frameNStart = frameN # exact frame index + condition_keyResp.tStart = t # local t and not account for scr refresh + condition_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_keyResp, 'tStartRefresh') # time at next scr refresh + condition_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(condition_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(condition_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if condition_keyResp.status == STARTED and not waitOnFlip: + theseKeys = condition_keyResp.getKeys(keyList=['c'], waitRelease=False) + _condition_keyResp_allKeys.extend(theseKeys) + if len(_condition_keyResp_allKeys): + condition_keyResp.keys = _condition_keyResp_allKeys[-1].name # just the last key pressed + condition_keyResp.rt = _condition_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_condition" --- + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if condition_keyResp.keys in ['', [], None]: # No response was made + condition_keyResp.keys = None + task_condition_loop.addData('condition_keyResp.keys',condition_keyResp.keys) + if condition_keyResp.keys != None: # we had a response + task_condition_loop.addData('condition_keyResp.rt', condition_keyResp.rt) + # the Routine "task_condition" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "oberve_other" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from observe_other_code + if conditionText == 'Observe other': + task_block_loop.finished = True + # keep track of which components have finished + oberve_otherComponents = [] + for thisComponent in oberve_otherComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "oberve_other" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in oberve_otherComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "oberve_other" --- + for thisComponent in oberve_otherComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "oberve_other" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # set up handler to look after randomisation of conditions etc + task_block_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='task_block_loop') + thisExp.addLoop(task_block_loop) # add the loop to the experiment + thisTask_block_loop = task_block_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + for thisTask_block_loop in task_block_loop: + currentLoop = task_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from task_blockReminder_code + blockCounter = blockCounter +1 + + if blockCounter == 1: + blockNumText = 'Block 1 of 10' + elif blockCounter == 2: + blockNumText = 'Block 2 of 10' + elif blockCounter == 3: + blockNumText = 'Block 3 of 10' + elif blockCounter == 4: + blockNumText = 'Block 4 of 10' + elif blockCounter == 5: + blockNumText = 'Block 5 of 10' + elif blockCounter == 6: + blockNumText = 'Block 6 of 10' + elif blockCounter == 7: + blockNumText = 'Block 7 of 10' + elif blockCounter == 8: + blockNumText = 'Block 8 of 10' + elif blockCounter == 9: + blockNumText = 'Block 9 of 10' + elif blockCounter == 10: + blockNumText = 'Block 10 of 10' + task_blockText.setText(blockNumText) + task_blockReminders_keyResp.keys = [] + task_blockReminders_keyResp.rt = [] + _task_blockReminders_keyResp_allKeys = [] + # keep track of which components have finished + task_blockRemindersComponents = [task_blockText, task_blockReminders_text, task_blockReminders_keyResp] + for thisComponent in task_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockText* updates + if task_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockText.frameNStart = frameN # exact frame index + task_blockText.tStart = t # local t and not account for scr refresh + task_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockText.started') + task_blockText.setAutoDraw(True) + + # *task_blockReminders_text* updates + if task_blockReminders_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_text.frameNStart = frameN # exact frame index + task_blockReminders_text.tStart = t # local t and not account for scr refresh + task_blockReminders_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_text, 'tStartRefresh') # time at next scr refresh + task_blockReminders_text.setAutoDraw(True) + + # *task_blockReminders_keyResp* updates + waitOnFlip = False + if task_blockReminders_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_keyResp.frameNStart = frameN # exact frame index + task_blockReminders_keyResp.tStart = t # local t and not account for scr refresh + task_blockReminders_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockReminders_keyResp.started') + task_blockReminders_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockReminders_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockReminders_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockReminders_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockReminders_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockReminders_keyResp_allKeys.extend(theseKeys) + if len(_task_blockReminders_keyResp_allKeys): + task_blockReminders_keyResp.keys = _task_blockReminders_keyResp_allKeys[-1].name # just the last key pressed + task_blockReminders_keyResp.rt = _task_blockReminders_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockReminders" --- + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockReminders_keyResp.keys in ['', [], None]: # No response was made + task_blockReminders_keyResp.keys = None + task_block_loop.addData('task_blockReminders_keyResp.keys',task_blockReminders_keyResp.keys) + if task_blockReminders_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockReminders_keyResp.rt', task_blockReminders_keyResp.rt) + # the Routine "task_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + task_trial_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions(whichCondition), + seed=None, name='task_trial_loop') + thisExp.addLoop(task_trial_loop) # add the loop to the experiment + thisTask_trial_loop = task_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + for thisTask_trial_loop in task_trial_loop: + currentLoop = task_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from task_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + task_trial_loop.addData('ISI', thisISI) + + task_centerImg.setImage(middleStim) + task_rightImg1.setImage(rightStim1) + task_rightImg2.setImage(rightStim2) + task_leftImg1.setImage(leftStim1) + task_leftImg2.setImage(leftStim1) + task_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from task_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + task_stim_keyResp.keys = [] + task_stim_keyResp.rt = [] + _task_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from task_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + task_stimRoutineComponents = [task_centerImg, task_rightImg1, task_rightImg2, task_leftImg1, task_leftImg2, task_fixImg, task_stim_keyResp] + for thisComponent in task_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_centerImg* updates + if task_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_centerImg.frameNStart = frameN # exact frame index + task_centerImg.tStart = t # local t and not account for scr refresh + task_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.started') + task_centerImg.setAutoDraw(True) + if task_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_centerImg.tStop = t # not accounting for scr refresh + task_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.stopped') + task_centerImg.setAutoDraw(False) + + # *task_rightImg1* updates + if task_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg1.frameNStart = frameN # exact frame index + task_rightImg1.tStart = t # local t and not account for scr refresh + task_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.started') + task_rightImg1.setAutoDraw(True) + if task_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg1.tStop = t # not accounting for scr refresh + task_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.stopped') + task_rightImg1.setAutoDraw(False) + + # *task_rightImg2* updates + if task_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg2.frameNStart = frameN # exact frame index + task_rightImg2.tStart = t # local t and not account for scr refresh + task_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.started') + task_rightImg2.setAutoDraw(True) + if task_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg2.tStop = t # not accounting for scr refresh + task_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.stopped') + task_rightImg2.setAutoDraw(False) + + # *task_leftImg1* updates + if task_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg1.frameNStart = frameN # exact frame index + task_leftImg1.tStart = t # local t and not account for scr refresh + task_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.started') + task_leftImg1.setAutoDraw(True) + if task_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg1.tStop = t # not accounting for scr refresh + task_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.stopped') + task_leftImg1.setAutoDraw(False) + + # *task_leftImg2* updates + if task_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg2.frameNStart = frameN # exact frame index + task_leftImg2.tStart = t # local t and not account for scr refresh + task_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.started') + task_leftImg2.setAutoDraw(True) + if task_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg2.tStop = t # not accounting for scr refresh + task_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.stopped') + task_leftImg2.setAutoDraw(False) + + # *task_fixImg* updates + if task_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_fixImg.frameNStart = frameN # exact frame index + task_fixImg.tStart = t # local t and not account for scr refresh + task_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.started') + task_fixImg.setAutoDraw(True) + if task_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_fixImg.tStop = t # not accounting for scr refresh + task_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.stopped') + task_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from task_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if task_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 41: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x29]) #hexcode = 41; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 42: + stimTriggerSent = True + port.write([0x2A]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 43: + stimTriggerSent = True + port.write([0x2B]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 44: + stimTriggerSent = True + port.write([0x2C]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 51: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x33]) #hexcode = 51; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 52: + stimTriggerSent = True + port.write([0x34]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 53: + stimTriggerSent = True + port.write([0x35]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 54: + stimTriggerSent = True + port.write([0x36]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *task_stim_keyResp* updates + waitOnFlip = False + if task_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_stim_keyResp.frameNStart = frameN # exact frame index + task_stim_keyResp.tStart = t # local t and not account for scr refresh + task_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.started') + task_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_stim_keyResp.tStop = t # not accounting for scr refresh + task_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.stopped') + task_stim_keyResp.status = FINISHED + if task_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _task_stim_keyResp_allKeys.extend(theseKeys) + if len(_task_stim_keyResp_allKeys): + task_stim_keyResp.keys = [key.name for key in _task_stim_keyResp_allKeys] # storing all keys + task_stim_keyResp.rt = [key.rt for key in _task_stim_keyResp_allKeys] + # Run 'Each Frame' code from task_respTrigger_code + if task_stim_keyResp.keys and len(task_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(task_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(task_stim_keyResp.keys) < 2: #if this is the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(task_stim_keyResp.keys) >= 2: #if this is NOT the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_stimRoutine" --- + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_stim_keyResp.keys in ['', [], None]: # No response was made + task_stim_keyResp.keys = None + task_trial_loop.addData('task_stim_keyResp.keys',task_stim_keyResp.keys) + if task_stim_keyResp.keys != None: # we had a response + task_trial_loop.addData('task_stim_keyResp.rt', task_stim_keyResp.rt) + # Run 'End Routine' code from task_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from task_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if task_stim_keyResp.keys: #if at least one response was made this trial + if task_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif task_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + task_trial_loop.addData('accuracy', accuracy) + # the Routine "task_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_trial_loop' + + + # --- Prepare to start Routine "task_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from task_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockCounter < 10: + if blockAcc >= .75: + if blockAcc < .9: + blockFeed = 'Good job' + blockFeedCat = 1 + elif blockAcc >= .9: + blockFeed = 'Respond faster' + blockFeedCat = 2 + elif blockAcc < .75: + blockFeed = 'Respond more accurately' + blockFeedCat = 3 + elif blockCounter == 10: + 'You have completed all blocks' + + # save this block's feedback to our output file + task_trial_loop.addData('blockFeedCat', blockFeedCat) + + #reset the following variables to zero before next block starts + trialNum = 0 + numCorr = 0 + task_blockFeed_text.setText(blockFeed) + task_blockFeed_text2.setText('Press the right button to continue') + task_blockFeed_keyResp.keys = [] + task_blockFeed_keyResp.rt = [] + _task_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + task_blockFeedComponents = [task_blockFeed_text, task_blackFeed_text3, task_blockFeed_text2, task_blockFeed_keyResp] + for thisComponent in task_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockFeed_text* updates + if task_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text.frameNStart = frameN # exact frame index + task_blockFeed_text.tStart = t # local t and not account for scr refresh + task_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_text.started') + task_blockFeed_text.setAutoDraw(True) + + # *task_blackFeed_text3* updates + if task_blackFeed_text3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blackFeed_text3.frameNStart = frameN # exact frame index + task_blackFeed_text3.tStart = t # local t and not account for scr refresh + task_blackFeed_text3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blackFeed_text3, 'tStartRefresh') # time at next scr refresh + task_blackFeed_text3.setAutoDraw(True) + if task_blackFeed_text3.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_blackFeed_text3.tStartRefresh + 10-frameTolerance: + # keep track of stop time/frame for later + task_blackFeed_text3.tStop = t # not accounting for scr refresh + task_blackFeed_text3.frameNStop = frameN # exact frame index + task_blackFeed_text3.setAutoDraw(False) + + # *task_blockFeed_text2* updates + if task_blockFeed_text2.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text2.frameNStart = frameN # exact frame index + task_blockFeed_text2.tStart = t # local t and not account for scr refresh + task_blockFeed_text2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text2, 'tStartRefresh') # time at next scr refresh + task_blockFeed_text2.setAutoDraw(True) + + # *task_blockFeed_keyResp* updates + waitOnFlip = False + if task_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_keyResp.frameNStart = frameN # exact frame index + task_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + task_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_keyResp.started') + task_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockFeed_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_task_blockFeed_keyResp_allKeys): + task_blockFeed_keyResp.keys = _task_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + task_blockFeed_keyResp.rt = _task_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockFeed" --- + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockFeed_keyResp.keys in ['', [], None]: # No response was made + task_blockFeed_keyResp.keys = None + task_block_loop.addData('task_blockFeed_keyResp.keys',task_blockFeed_keyResp.keys) + if task_blockFeed_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockFeed_keyResp.rt', task_blockFeed_keyResp.rt) + # the Routine "task_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_block_loop' + + + # --- Prepare to start Routine "task_conditionComplete" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + conditionComplete_key_resp.keys = [] + conditionComplete_key_resp.rt = [] + _conditionComplete_key_resp_allKeys = [] + # keep track of which components have finished + task_conditionCompleteComponents = [conditionComplete_text, conditionComplete_key_resp] + for thisComponent in task_conditionCompleteComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_conditionComplete" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *conditionComplete_text* updates + if conditionComplete_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_text.frameNStart = frameN # exact frame index + conditionComplete_text.tStart = t # local t and not account for scr refresh + conditionComplete_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_text, 'tStartRefresh') # time at next scr refresh + conditionComplete_text.setAutoDraw(True) + + # *conditionComplete_key_resp* updates + waitOnFlip = False + if conditionComplete_key_resp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_key_resp.frameNStart = frameN # exact frame index + conditionComplete_key_resp.tStart = t # local t and not account for scr refresh + conditionComplete_key_resp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_key_resp, 'tStartRefresh') # time at next scr refresh + conditionComplete_key_resp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(conditionComplete_key_resp.clock.reset) # t=0 on next screen flip + win.callOnFlip(conditionComplete_key_resp.clearEvents, eventType='keyboard') # clear events on next screen flip + if conditionComplete_key_resp.status == STARTED and not waitOnFlip: + theseKeys = conditionComplete_key_resp.getKeys(keyList=['c'], waitRelease=False) + _conditionComplete_key_resp_allKeys.extend(theseKeys) + if len(_conditionComplete_key_resp_allKeys): + conditionComplete_key_resp.keys = _conditionComplete_key_resp_allKeys[-1].name # just the last key pressed + conditionComplete_key_resp.rt = _conditionComplete_key_resp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_conditionComplete" --- + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if conditionComplete_key_resp.keys in ['', [], None]: # No response was made + conditionComplete_key_resp.keys = None + task_condition_loop.addData('conditionComplete_key_resp.keys',conditionComplete_key_resp.keys) + if conditionComplete_key_resp.keys != None: # we had a response + task_condition_loop.addData('conditionComplete_key_resp.rt', conditionComplete_key_resp.rt) + # the Routine "task_conditionComplete" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 1.0 repeats of 'task_condition_loop' + +# Run 'End Experiment' code from setup_code +win.mouseVisible = True #make the mouse cursor visable again +port.write([0xFF]) #set port values back to default state (FF) +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else +port.close() #close port opened at start of exp + +# --- End experiment --- +# Flip one final time so any remaining win.callOnFlip() +# and win.timeOnFlip() tasks get executed before quitting +win.flip() + +# these shouldn't be strictly necessary (should auto-save) +thisExp.saveAsWideText(filename+'.csv', delim='auto') +thisExp.saveAsPickle(filename) +logging.flush() +# make sure everything is closed down +if eyetracker: + eyetracker.setConnectionState(False) +thisExp.abort() # or data files will save again on exit +win.close() +core.quit() diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0_lastrun.py b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0_lastrun.py new file mode 100755 index 0000000..9f848d5 --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/arrow-alert_v0_lastrun.py @@ -0,0 +1,3975 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5), + on April 05, 2023, at 14:15 +If you publish work using this script the most relevant publication is: + + Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) + PsychoPy2: Experiments in behavior made easy Behav Res 51: 195. + https://doi.org/10.3758/s13428-018-01193-y + +""" + +# --- Import packages --- +from psychopy import locale_setup +from psychopy import prefs +prefs.hardware['audioLib'] = 'ptb' +from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout +from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, + STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) + +import numpy as np # whole numpy lib is available, prepend 'np.' +from numpy import (sin, cos, tan, log, log10, pi, average, + sqrt, std, deg2rad, rad2deg, linspace, asarray) +from numpy.random import random, randint, normal, shuffle, choice as randchoice +import os # handy system and path functions +import sys # to get file system encoding + +import psychopy.iohub as io +from psychopy.hardware import keyboard + + + +# Ensure that relative paths start from the same directory as this script +_thisDir = os.path.dirname(os.path.abspath(__file__)) +os.chdir(_thisDir) +# Store info about the experiment session +psychopyVersion = '2022.2.5' +expName = 'Arrow_Alert' # from the Builder filename that created this script +expInfo = { + 'id': '1', + 'counterbalance': ['A1', 'A2', 'B1', 'B2', 'C1', 'C2'], + 'session': '1', + 'run': '1', +} +# --- Show participant info dialog -- +dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName) +if dlg.OK == False: + core.quit() # user pressed cancel +expInfo['date'] = data.getDateStr() # add a simple timestamp +expInfo['expName'] = expName +expInfo['psychopyVersion'] = psychopyVersion + +# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc +filename = _thisDir + os.sep + u'data/%s_%s_%s_%s_%s_%s' % (expInfo['id'], expInfo['counterbalance'], expInfo['session'], expInfo['run'], expName, expInfo['date']) + +# An ExperimentHandler isn't essential but helps with data saving +thisExp = data.ExperimentHandler(name=expName, version='', + extraInfo=expInfo, runtimeInfo=None, + originPath='C:\\Users\\NDCLab\\Desktop\\Experiments\\thrive\\arrow-alert-v0 -timingTest_block_level_triggerloss\\arrow-alert_v0_lastrun.py', + savePickle=True, saveWideText=True, + dataFileName=filename) +# save a log file for detail verbose info +logFile = logging.LogFile(filename+'.log', level=logging.DEBUG) +logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file + +endExpNow = False # flag for 'escape' or other condition => quit the exp +frameTolerance = 0.001 # how close to onset before 'same' frame + +# Start Code - component code to be run after the window creation + +# --- Setup the Window --- +win = visual.Window( + size=[1920, 1080], fullscr=True, screen=0, + winType='pyglet', allowStencil=False, + monitor='testMonitor', color=[-1,-1,-1], colorSpace='rgb', + blendMode='avg', useFBO=True, + units='height') +win.mouseVisible = False +# store frame rate of monitor if we can measure it +expInfo['frameRate'] = win.getActualFrameRate() +if expInfo['frameRate'] != None: + frameDur = 1.0 / round(expInfo['frameRate']) +else: + frameDur = 1.0 / 60.0 # could not measure, so guess +# --- Setup input devices --- +ioConfig = {} + +# Setup iohub keyboard +ioConfig['Keyboard'] = dict(use_keymap='psychopy') + +ioSession = '1' +if 'session' in expInfo: + ioSession = str(expInfo['session']) +ioServer = io.launchHubServer(window=win, **ioConfig) +eyetracker = None + +# create a default keyboard (e.g. to check for escape) +defaultKeyboard = keyboard.Keyboard(backend='iohub') + +# --- Initialize components for Routine "JS_code" --- + +# --- Initialize components for Routine "setup" --- +# Run 'Begin Experiment' code from setup_code +import serial #used for sending eeg triggers +import time #indirerctly used for sending eeg triggers (how long to wait before clearing port) + +win.mouseVisible = False #hide mouse cursor +port = serial.Serial('COM4') #open specified port (COM3) for sending eeg triggers to +# Kia: The following 2 lines are preventing the trigger loss +port.close() +port.open() + +PulseWidth = 0.002 #how long to wait before clearing port after sending trigger (2 ms is sufficient at 1000 hz sampling rate) + +port.write([0x00]) #clear serial port +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else + +# --- Initialize components for Routine "welcome" --- +welcome_text = visual.TextStim(win=win, name='welcome_text', + text='Arrow Alert Game\n\nWelcome to the arrow alert game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\n\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +welcome_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "welcome2" --- +welcome_text_2 = visual.TextStim(win=win, name='welcome_text_2', + text='Arrow Game\n\nWelcome to the arrow game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\nPress the right button to continue\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +welcome_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight" --- +instructRight_text = visual.TextStim(win=win, name='instructRight_text', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg = visual.ImageStim( + win=win, + name='instructRight_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1 = visual.ImageStim( + win=win, + name='instructRight_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1 = visual.ImageStim( + win=win, + name='instructRight_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight_2" --- +instructRight_text_2 = visual.TextStim(win=win, name='instructRight_text_2', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg_2 = visual.ImageStim( + win=win, + name='instructRight_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft" --- +instructLeft_text = visual.TextStim(win=win, name='instructLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg = visual.ImageStim( + win=win, + name='instructLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft_2" --- +instructLeft_text_2 = visual.TextStim(win=win, name='instructLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight" --- +instructInconRight_text = visual.TextStim(win=win, name='instructInconRight_text', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg = visual.ImageStim( + win=win, + name='instructIncon_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight_2" --- +instructInconRight_text_2 = visual.TextStim(win=win, name='instructInconRight_text_2', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg_2 = visual.ImageStim( + win=win, + name='instructIncon_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft" --- +instructInconLeft_text = visual.TextStim(win=win, name='instructInconLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft_2" --- +instructInconLeft_text_2 = visual.TextStim(win=win, name='instructInconLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders" --- +# Run 'Begin Experiment' code from prac_initAcc_code +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText = visual.TextStim(win=win, name='prac_blockText', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text = visual.TextStim(win=win, name='prac_reminder_text', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders_2" --- +# Run 'Begin Experiment' code from prac_initAcc_code_2 +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText_2 = visual.TextStim(win=win, name='prac_blockText_2', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text_2 = visual.TextStim(win=win, name='prac_reminder_text_2', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\nTo get ready, rest your right and left thumbs on the right and left buttons, then press the right button when you are ready to begin.\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) + +# --- Initialize components for Routine "prac_stimRoutine" --- +# Run 'Begin Experiment' code from prac_isi_code +#initialize the thisISI variable +thisISI = 0 +prac_centerImg = visual.ImageStim( + win=win, + name='prac_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=[.4, .4], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +prac_rightImg1 = visual.ImageStim( + win=win, + name='prac_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +prac_rightImg2 = visual.ImageStim( + win=win, + name='prac_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +prac_leftImg1 = visual.ImageStim( + win=win, + name='prac_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +prac_leftImg2 = visual.ImageStim( + win=win, + name='prac_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +prac_fixImg = visual.ImageStim( + win=win, + name='prac_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +prac_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockFeed" --- +prac_blockFeed_text = visual.TextStim(win=win, name='prac_blockFeed_text', + text='', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +prac_pressContinue = visual.TextStim(win=win, name='prac_pressContinue', + text='Experimenter: press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +prac_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_condition" --- +# Run 'Begin Experiment' code from condition_init_blockCounter +#initialize the following variables at the start of the condition +blockCounter = 0 + +# To skip routines in case of "observe other", +# we will need to use endTask. +# see begin routine tab for more. +endTask = 0 +condition_whichCondition_text = visual.TextStim(win=win, name='condition_whichCondition_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +condition_reminder_text = visual.TextStim(win=win, name='condition_reminder_text', + text='Experimenter: provide instructions and then press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.8, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +condition_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockReminders" --- +task_blockText = visual.TextStim(win=win, name='task_blockText', + text='', + font='Arial', + pos=(0, .1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +task_blockReminders_text = visual.TextStim(win=win, name='task_blockReminders_text', + text='Remember to limit blinking to about about once every ten seconds (or less).\n\nPlease try to relax the muscles in your face, neck, and shoulders. \n\nRest your right and left thumbs on the right and left buttons. When you are ready, press the right button to begin.\n', + font='Arial', + pos=(0, -.25), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blockReminders_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) + +# --- Initialize components for Routine "task_stimRoutine" --- +# Run 'Begin Experiment' code from task_isi_code +#no need to initialize thisISI, as already done in practice code snippit +task_centerImg = visual.ImageStim( + win=win, + name='task_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +task_rightImg1 = visual.ImageStim( + win=win, + name='task_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +task_rightImg2 = visual.ImageStim( + win=win, + name='task_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +task_leftImg1 = visual.ImageStim( + win=win, + name='task_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +task_leftImg2 = visual.ImageStim( + win=win, + name='task_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +task_fixImg = visual.ImageStim( + win=win, + name='task_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-7.0) +task_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockFeed" --- +task_blockFeed_text = visual.TextStim(win=win, name='task_blockFeed_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blackFeed_text3 = visual.TextStim(win=win, name='task_blackFeed_text3', + text='Please wait', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-3.0); +task_blockFeed_text2 = visual.TextStim(win=win, name='task_blockFeed_text2', + text='', + font='Arial', + pos=(0, -0.3), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-4.0); +task_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_conditionComplete" --- +conditionComplete_text = visual.TextStim(win=win, name='conditionComplete_text', + text='Please ring bell and wait for experimenter to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=0.0); +conditionComplete_key_resp = keyboard.Keyboard() + +# Create some handy timers +globalClock = core.Clock() # to track the time since experiment started +routineTimer = core.Clock() # to track time remaining of each (possibly non-slip) routine + +# --- Prepare to start Routine "JS_code" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +JS_codeComponents = [] +for thisComponent in JS_codeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "JS_code" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "JS_code" --- +for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "JS_code" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "setup" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +setupComponents = [] +for thisComponent in setupComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "setup" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in setupComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "setup" --- +for thisComponent in setupComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "setup" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp.keys = [] +welcome_keyResp.rt = [] +_welcome_keyResp_allKeys = [] +# keep track of which components have finished +welcomeComponents = [welcome_text, welcome_keyResp] +for thisComponent in welcomeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_text* updates + if welcome_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text.frameNStart = frameN # exact frame index + welcome_text.tStart = t # local t and not account for scr refresh + welcome_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text, 'tStartRefresh') # time at next scr refresh + welcome_text.setAutoDraw(True) + + # *welcome_keyResp* updates + waitOnFlip = False + if welcome_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp.frameNStart = frameN # exact frame index + welcome_keyResp.tStart = t # local t and not account for scr refresh + welcome_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp, 'tStartRefresh') # time at next scr refresh + welcome_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp.getKeys(keyList=['c'], waitRelease=False) + _welcome_keyResp_allKeys.extend(theseKeys) + if len(_welcome_keyResp_allKeys): + welcome_keyResp.keys = _welcome_keyResp_allKeys[-1].name # just the last key pressed + welcome_keyResp.rt = _welcome_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcomeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome" --- +for thisComponent in welcomeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp_2.keys = [] +welcome_keyResp_2.rt = [] +_welcome_keyResp_2_allKeys = [] +# keep track of which components have finished +welcome2Components = [welcome_text_2, welcome_keyResp_2] +for thisComponent in welcome2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_text_2* updates + if welcome_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text_2.frameNStart = frameN # exact frame index + welcome_text_2.tStart = t # local t and not account for scr refresh + welcome_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text_2, 'tStartRefresh') # time at next scr refresh + welcome_text_2.setAutoDraw(True) + + # *welcome_keyResp_2* updates + waitOnFlip = False + if welcome_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp_2.frameNStart = frameN # exact frame index + welcome_keyResp_2.tStart = t # local t and not account for scr refresh + welcome_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp_2, 'tStartRefresh') # time at next scr refresh + welcome_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _welcome_keyResp_2_allKeys.extend(theseKeys) + if len(_welcome_keyResp_2_allKeys): + welcome_keyResp_2.keys = _welcome_keyResp_2_allKeys[-1].name # just the last key pressed + welcome_keyResp_2.rt = _welcome_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcome2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome2" --- +for thisComponent in welcome2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp.keys = [] +insructRight_keyResp.rt = [] +_insructRight_keyResp_allKeys = [] +# keep track of which components have finished +instructRightComponents = [instructRight_text, instructRight_centerImg, instructRight_rightImg1, instructRight_rightImg2, instructRight_leftImg1, instructRight_leftImg2, insructRight_keyResp] +for thisComponent in instructRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text* updates + if instructRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text.frameNStart = frameN # exact frame index + instructRight_text.tStart = t # local t and not account for scr refresh + instructRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text, 'tStartRefresh') # time at next scr refresh + instructRight_text.setAutoDraw(True) + + # *instructRight_centerImg* updates + if instructRight_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg.frameNStart = frameN # exact frame index + instructRight_centerImg.tStart = t # local t and not account for scr refresh + instructRight_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg.setAutoDraw(True) + + # *instructRight_rightImg1* updates + if instructRight_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1.frameNStart = frameN # exact frame index + instructRight_rightImg1.tStart = t # local t and not account for scr refresh + instructRight_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1.setAutoDraw(True) + + # *instructRight_rightImg2* updates + if instructRight_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2.frameNStart = frameN # exact frame index + instructRight_rightImg2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2.setAutoDraw(True) + + # *instructRight_leftImg1* updates + if instructRight_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1.frameNStart = frameN # exact frame index + instructRight_leftImg1.tStart = t # local t and not account for scr refresh + instructRight_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1.setAutoDraw(True) + + # *instructRight_leftImg2* updates + if instructRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2.frameNStart = frameN # exact frame index + instructRight_leftImg2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2.setAutoDraw(True) + + # *insructRight_keyResp* updates + waitOnFlip = False + if insructRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp.frameNStart = frameN # exact frame index + insructRight_keyResp.tStart = t # local t and not account for scr refresh + insructRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructRight_keyResp_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_allKeys): + insructRight_keyResp.keys = _insructRight_keyResp_allKeys[-1].name # just the last key pressed + insructRight_keyResp.rt = _insructRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight" --- +for thisComponent in instructRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp_2.keys = [] +insructRight_keyResp_2.rt = [] +_insructRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructRight_2Components = [instructRight_text_2, instructRight_centerImg_2, instructRight_rightImg1_2, instructRight_rightImg2_2, instructRight_leftImg1_2, instructRight_leftImg2_2, insructRight_keyResp_2] +for thisComponent in instructRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text_2* updates + if instructRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text_2.frameNStart = frameN # exact frame index + instructRight_text_2.tStart = t # local t and not account for scr refresh + instructRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text_2, 'tStartRefresh') # time at next scr refresh + instructRight_text_2.setAutoDraw(True) + + # *instructRight_centerImg_2* updates + if instructRight_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg_2.frameNStart = frameN # exact frame index + instructRight_centerImg_2.tStart = t # local t and not account for scr refresh + instructRight_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg_2.setAutoDraw(True) + + # *instructRight_rightImg1_2* updates + if instructRight_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1_2.frameNStart = frameN # exact frame index + instructRight_rightImg1_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1_2.setAutoDraw(True) + + # *instructRight_rightImg2_2* updates + if instructRight_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2_2.frameNStart = frameN # exact frame index + instructRight_rightImg2_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2_2.setAutoDraw(True) + + # *instructRight_leftImg1_2* updates + if instructRight_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1_2.frameNStart = frameN # exact frame index + instructRight_leftImg1_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1_2.setAutoDraw(True) + + # *instructRight_leftImg2_2* updates + if instructRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2_2.frameNStart = frameN # exact frame index + instructRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2_2.setAutoDraw(True) + + # *insructRight_keyResp_2* updates + waitOnFlip = False + if insructRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp_2.frameNStart = frameN # exact frame index + insructRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_2_allKeys): + insructRight_keyResp_2.keys = _insructRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructRight_keyResp_2.rt = _insructRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight_2" --- +for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp.keys = [] +instructLeft_keyResp.rt = [] +_instructLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructLeftComponents = [instructLeft_text, instructLeft_centerImg, instructLeft_rightImg1, instructLeft_rightImg2, instructLeft_leftImg1, instructLeft_leftImg2, instructLeft_keyResp] +for thisComponent in instructLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text* updates + if instructLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text.frameNStart = frameN # exact frame index + instructLeft_text.tStart = t # local t and not account for scr refresh + instructLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text, 'tStartRefresh') # time at next scr refresh + instructLeft_text.setAutoDraw(True) + + # *instructLeft_centerImg* updates + if instructLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg.frameNStart = frameN # exact frame index + instructLeft_centerImg.tStart = t # local t and not account for scr refresh + instructLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg.setAutoDraw(True) + + # *instructLeft_rightImg1* updates + if instructLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1.frameNStart = frameN # exact frame index + instructLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1.setAutoDraw(True) + + # *instructLeft_rightImg2* updates + if instructLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2.frameNStart = frameN # exact frame index + instructLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2.setAutoDraw(True) + + # *instructLeft_leftImg1* updates + if instructLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1.frameNStart = frameN # exact frame index + instructLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1.setAutoDraw(True) + + # *instructLeft_leftImg2* updates + if instructLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2.frameNStart = frameN # exact frame index + instructLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2.setAutoDraw(True) + + # *instructLeft_keyResp* updates + waitOnFlip = False + if instructLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp.frameNStart = frameN # exact frame index + instructLeft_keyResp.tStart = t # local t and not account for scr refresh + instructLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_allKeys): + instructLeft_keyResp.keys = _instructLeft_keyResp_allKeys[-1].name # just the last key pressed + instructLeft_keyResp.rt = _instructLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft" --- +for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp_2.keys = [] +instructLeft_keyResp_2.rt = [] +_instructLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructLeft_2Components = [instructLeft_text_2, instructLeft_centerImg_2, instructLeft_rightImg1_2, instructLeft_rightImg2_2, instructLeft_leftImg1_2, instructLeft_leftImg2_2, instructLeft_keyResp_2] +for thisComponent in instructLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text_2* updates + if instructLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text_2.frameNStart = frameN # exact frame index + instructLeft_text_2.tStart = t # local t and not account for scr refresh + instructLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructLeft_text_2.setAutoDraw(True) + + # *instructLeft_centerImg_2* updates + if instructLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg_2.frameNStart = frameN # exact frame index + instructLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg_2.setAutoDraw(True) + + # *instructLeft_rightImg1_2* updates + if instructLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1_2.setAutoDraw(True) + + # *instructLeft_rightImg2_2* updates + if instructLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2_2.setAutoDraw(True) + + # *instructLeft_leftImg1_2* updates + if instructLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1_2.setAutoDraw(True) + + # *instructLeft_leftImg2_2* updates + if instructLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2_2.setAutoDraw(True) + + # *instructLeft_keyResp_2* updates + waitOnFlip = False + if instructLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp_2.frameNStart = frameN # exact frame index + instructLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_2_allKeys): + instructLeft_keyResp_2.keys = _instructLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructLeft_keyResp_2.rt = _instructLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft_2" --- +for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp.keys = [] +insructInconRight_keyResp.rt = [] +_insructInconRight_keyResp_allKeys = [] +# keep track of which components have finished +instructInconRightComponents = [instructInconRight_text, instructIncon_centerImg, instructIncon_rightImg1, instructIncon_rightImg2, instructIncon_leftImg1, instructInconRight_leftImg2, insructInconRight_keyResp] +for thisComponent in instructInconRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text* updates + if instructInconRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text.frameNStart = frameN # exact frame index + instructInconRight_text.tStart = t # local t and not account for scr refresh + instructInconRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text, 'tStartRefresh') # time at next scr refresh + instructInconRight_text.setAutoDraw(True) + + # *instructIncon_centerImg* updates + if instructIncon_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg.frameNStart = frameN # exact frame index + instructIncon_centerImg.tStart = t # local t and not account for scr refresh + instructIncon_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg.setAutoDraw(True) + + # *instructIncon_rightImg1* updates + if instructIncon_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1.frameNStart = frameN # exact frame index + instructIncon_rightImg1.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1.setAutoDraw(True) + + # *instructIncon_rightImg2* updates + if instructIncon_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2.frameNStart = frameN # exact frame index + instructIncon_rightImg2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2.setAutoDraw(True) + + # *instructIncon_leftImg1* updates + if instructIncon_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1.frameNStart = frameN # exact frame index + instructIncon_leftImg1.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1.setAutoDraw(True) + + # *instructInconRight_leftImg2* updates + if instructInconRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2.setAutoDraw(True) + + # *insructInconRight_keyResp* updates + waitOnFlip = False + if insructInconRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp.frameNStart = frameN # exact frame index + insructInconRight_keyResp.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructInconRight_keyResp_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_allKeys): + insructInconRight_keyResp.keys = _insructInconRight_keyResp_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp.rt = _insructInconRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight" --- +for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp_2.keys = [] +insructInconRight_keyResp_2.rt = [] +_insructInconRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconRight_2Components = [instructInconRight_text_2, instructIncon_centerImg_2, instructIncon_rightImg1_2, instructIncon_rightImg2_2, instructIncon_leftImg1_2, instructInconRight_leftImg2_2, insructInconRight_keyResp_2] +for thisComponent in instructInconRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text_2* updates + if instructInconRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text_2.frameNStart = frameN # exact frame index + instructInconRight_text_2.tStart = t # local t and not account for scr refresh + instructInconRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_text_2.setAutoDraw(True) + + # *instructIncon_centerImg_2* updates + if instructIncon_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg_2.frameNStart = frameN # exact frame index + instructIncon_centerImg_2.tStart = t # local t and not account for scr refresh + instructIncon_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg_2.setAutoDraw(True) + + # *instructIncon_rightImg1_2* updates + if instructIncon_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1_2.frameNStart = frameN # exact frame index + instructIncon_rightImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1_2.setAutoDraw(True) + + # *instructIncon_rightImg2_2* updates + if instructIncon_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2_2.frameNStart = frameN # exact frame index + instructIncon_rightImg2_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2_2.setAutoDraw(True) + + # *instructIncon_leftImg1_2* updates + if instructIncon_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1_2.frameNStart = frameN # exact frame index + instructIncon_leftImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1_2.setAutoDraw(True) + + # *instructInconRight_leftImg2_2* updates + if instructInconRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2_2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2_2.setAutoDraw(True) + + # *insructInconRight_keyResp_2* updates + waitOnFlip = False + if insructInconRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp_2.frameNStart = frameN # exact frame index + insructInconRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructInconRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_2_allKeys): + insructInconRight_keyResp_2.keys = _insructInconRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp_2.rt = _insructInconRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight_2" --- +for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp.keys = [] +instructInconLeft_keyResp.rt = [] +_instructInconLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructInconLeftComponents = [instructInconLeft_text, instructInconLeft_centerImg, instructInconLeft_rightImg1, instructInconLeft_rightImg2, instructInconLeft_leftImg1, instructInconLeft_leftImg2, instructInconLeft_keyResp] +for thisComponent in instructInconLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text* updates + if instructInconLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text.frameNStart = frameN # exact frame index + instructInconLeft_text.tStart = t # local t and not account for scr refresh + instructInconLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text.setAutoDraw(True) + + # *instructInconLeft_centerImg* updates + if instructInconLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg.frameNStart = frameN # exact frame index + instructInconLeft_centerImg.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg.setAutoDraw(True) + + # *instructInconLeft_rightImg1* updates + if instructInconLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1.setAutoDraw(True) + + # *instructInconLeft_rightImg2* updates + if instructInconLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2.setAutoDraw(True) + + # *instructInconLeft_leftImg1* updates + if instructInconLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1.setAutoDraw(True) + + # *instructInconLeft_leftImg2* updates + if instructInconLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2.setAutoDraw(True) + + # *instructInconLeft_keyResp* updates + waitOnFlip = False + if instructInconLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp.frameNStart = frameN # exact frame index + instructInconLeft_keyResp.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructInconLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_allKeys): + instructInconLeft_keyResp.keys = _instructInconLeft_keyResp_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp.rt = _instructInconLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft" --- +for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp_2.keys = [] +instructInconLeft_keyResp_2.rt = [] +_instructInconLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconLeft_2Components = [instructInconLeft_text_2, instructInconLeft_centerImg_2, instructInconLeft_rightImg1_2, instructInconLeft_rightImg2_2, instructInconLeft_leftImg1_2, instructInconLeft_leftImg2_2, instructInconLeft_keyResp_2] +for thisComponent in instructInconLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text_2* updates + if instructInconLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text_2.frameNStart = frameN # exact frame index + instructInconLeft_text_2.tStart = t # local t and not account for scr refresh + instructInconLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text_2.setAutoDraw(True) + + # *instructInconLeft_centerImg_2* updates + if instructInconLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg_2.frameNStart = frameN # exact frame index + instructInconLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg_2.setAutoDraw(True) + + # *instructInconLeft_rightImg1_2* updates + if instructInconLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1_2.setAutoDraw(True) + + # *instructInconLeft_rightImg2_2* updates + if instructInconLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2_2.setAutoDraw(True) + + # *instructInconLeft_leftImg1_2* updates + if instructInconLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1_2.setAutoDraw(True) + + # *instructInconLeft_leftImg2_2* updates + if instructInconLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2_2.setAutoDraw(True) + + # *instructInconLeft_keyResp_2* updates + waitOnFlip = False + if instructInconLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp_2.frameNStart = frameN # exact frame index + instructInconLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructInconLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_2_allKeys): + instructInconLeft_keyResp_2.keys = _instructInconLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp_2.rt = _instructInconLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft_2" --- +for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# set up handler to look after randomisation of conditions etc +prac_block_loop = data.TrialHandler(nReps=99, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='prac_block_loop') +thisExp.addLoop(prac_block_loop) # add the loop to the experiment +thisPrac_block_loop = prac_block_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) +if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + +for thisPrac_block_loop in prac_block_loop: + currentLoop = prac_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) + if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_initAcc_code + # Kia: The following 2 lines are preventing the trigger loss + port.close() + port.open() + prac_reminder_keyResp.keys = [] + prac_reminder_keyResp.rt = [] + _prac_reminder_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockRemindersComponents = [prac_blockText, prac_reminder_text, prac_reminder_keyResp] + for thisComponent in prac_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText* updates + if prac_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText.frameNStart = frameN # exact frame index + prac_blockText.tStart = t # local t and not account for scr refresh + prac_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText.started') + prac_blockText.setAutoDraw(True) + + # *prac_reminder_text* updates + if prac_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text.frameNStart = frameN # exact frame index + prac_reminder_text.tStart = t # local t and not account for scr refresh + prac_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text.started') + prac_reminder_text.setAutoDraw(True) + + # *prac_reminder_keyResp* updates + waitOnFlip = False + if prac_reminder_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp.frameNStart = frameN # exact frame index + prac_reminder_keyResp.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp.started') + prac_reminder_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_reminder_keyResp_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_allKeys): + prac_reminder_keyResp.keys = _prac_reminder_keyResp_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp.rt = _prac_reminder_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders" --- + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp.keys in ['', [], None]: # No response was made + prac_reminder_keyResp.keys = None + prac_block_loop.addData('prac_reminder_keyResp.keys',prac_reminder_keyResp.keys) + if prac_reminder_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp.rt', prac_reminder_keyResp.rt) + # the Routine "prac_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "prac_blockReminders_2" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp_2.keys = [] + prac_reminder_keyResp_2.rt = [] + _prac_reminder_keyResp_2_allKeys = [] + # keep track of which components have finished + prac_blockReminders_2Components = [prac_blockText_2, prac_reminder_text_2, prac_reminder_keyResp_2] + for thisComponent in prac_blockReminders_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders_2" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText_2* updates + if prac_blockText_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText_2.frameNStart = frameN # exact frame index + prac_blockText_2.tStart = t # local t and not account for scr refresh + prac_blockText_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText_2.started') + prac_blockText_2.setAutoDraw(True) + + # *prac_reminder_text_2* updates + if prac_reminder_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text_2.frameNStart = frameN # exact frame index + prac_reminder_text_2.tStart = t # local t and not account for scr refresh + prac_reminder_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text_2.started') + prac_reminder_text_2.setAutoDraw(True) + + # *prac_reminder_keyResp_2* updates + waitOnFlip = False + if prac_reminder_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp_2.frameNStart = frameN # exact frame index + prac_reminder_keyResp_2.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp_2.started') + prac_reminder_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _prac_reminder_keyResp_2_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_2_allKeys): + prac_reminder_keyResp_2.keys = _prac_reminder_keyResp_2_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp_2.rt = _prac_reminder_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders_2" --- + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp_2.keys in ['', [], None]: # No response was made + prac_reminder_keyResp_2.keys = None + prac_block_loop.addData('prac_reminder_keyResp_2.keys',prac_reminder_keyResp_2.keys) + if prac_reminder_keyResp_2.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp_2.rt', prac_reminder_keyResp_2.rt) + # the Routine "prac_blockReminders_2" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + prac_trial_loop = data.TrialHandler(nReps=10, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions('prac_trials.xlsx'), + seed=None, name='prac_trial_loop') + thisExp.addLoop(prac_trial_loop) # add the loop to the experiment + thisPrac_trial_loop = prac_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + for thisPrac_trial_loop in prac_trial_loop: + currentLoop = prac_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + prac_trial_loop.addData('ISI', thisISI) + + + # show in console for debugging + #print('thisISI: ', thisISI) + prac_centerImg.setImage(middleStim) + prac_rightImg1.setImage(rightStim1) + prac_rightImg2.setImage(rightStim2) + prac_leftImg1.setImage(leftStim1) + prac_leftImg2.setImage(leftStim1) + prac_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from prac_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + prac_stim_keyResp.keys = [] + prac_stim_keyResp.rt = [] + _prac_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from prac_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + prac_stimRoutineComponents = [prac_centerImg, prac_rightImg1, prac_rightImg2, prac_leftImg1, prac_leftImg2, prac_fixImg, prac_stim_keyResp] + for thisComponent in prac_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_centerImg* updates + if prac_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_centerImg.frameNStart = frameN # exact frame index + prac_centerImg.tStart = t # local t and not account for scr refresh + prac_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.started') + prac_centerImg.setAutoDraw(True) + if prac_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_centerImg.tStop = t # not accounting for scr refresh + prac_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.stopped') + prac_centerImg.setAutoDraw(False) + + # *prac_rightImg1* updates + if prac_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg1.frameNStart = frameN # exact frame index + prac_rightImg1.tStart = t # local t and not account for scr refresh + prac_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.started') + prac_rightImg1.setAutoDraw(True) + if prac_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg1.tStop = t # not accounting for scr refresh + prac_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.stopped') + prac_rightImg1.setAutoDraw(False) + + # *prac_rightImg2* updates + if prac_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg2.frameNStart = frameN # exact frame index + prac_rightImg2.tStart = t # local t and not account for scr refresh + prac_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.started') + prac_rightImg2.setAutoDraw(True) + if prac_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg2.tStop = t # not accounting for scr refresh + prac_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.stopped') + prac_rightImg2.setAutoDraw(False) + + # *prac_leftImg1* updates + if prac_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg1.frameNStart = frameN # exact frame index + prac_leftImg1.tStart = t # local t and not account for scr refresh + prac_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.started') + prac_leftImg1.setAutoDraw(True) + if prac_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg1.tStop = t # not accounting for scr refresh + prac_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.stopped') + prac_leftImg1.setAutoDraw(False) + + # *prac_leftImg2* updates + if prac_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg2.frameNStart = frameN # exact frame index + prac_leftImg2.tStart = t # local t and not account for scr refresh + prac_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.started') + prac_leftImg2.setAutoDraw(True) + if prac_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg2.tStop = t # not accounting for scr refresh + prac_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.stopped') + prac_leftImg2.setAutoDraw(False) + + # *prac_fixImg* updates + if prac_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_fixImg.frameNStart = frameN # exact frame index + prac_fixImg.tStart = t # local t and not account for scr refresh + prac_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.started') + prac_fixImg.setAutoDraw(True) + if prac_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_fixImg.tStop = t # not accounting for scr refresh + prac_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.stopped') + prac_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from prac_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if prac_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 1: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x01]) #hexcode = 1; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 2: + stimTriggerSent = True + port.write([0x02]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 3: + stimTriggerSent = True + port.write([0x03]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 4: + stimTriggerSent = True + port.write([0x04]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *prac_stim_keyResp* updates + waitOnFlip = False + if prac_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_stim_keyResp.frameNStart = frameN # exact frame index + prac_stim_keyResp.tStart = t # local t and not account for scr refresh + prac_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.started') + prac_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_stim_keyResp.tStop = t # not accounting for scr refresh + prac_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.stopped') + prac_stim_keyResp.status = FINISHED + if prac_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _prac_stim_keyResp_allKeys.extend(theseKeys) + if len(_prac_stim_keyResp_allKeys): + prac_stim_keyResp.keys = [key.name for key in _prac_stim_keyResp_allKeys] # storing all keys + prac_stim_keyResp.rt = [key.rt for key in _prac_stim_keyResp_allKeys] + # Run 'Each Frame' code from prac_respTrigger_code + if prac_stim_keyResp.keys and len(prac_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(prac_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(prac_stim_keyResp.keys) < 2: #if this is the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(prac_stim_keyResp.keys) >= 2: #if this is NOT the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_stimRoutine" --- + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_stim_keyResp.keys in ['', [], None]: # No response was made + prac_stim_keyResp.keys = None + prac_trial_loop.addData('prac_stim_keyResp.keys',prac_stim_keyResp.keys) + if prac_stim_keyResp.keys != None: # we had a response + prac_trial_loop.addData('prac_stim_keyResp.rt', prac_stim_keyResp.rt) + # Run 'End Routine' code from prac_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from prac_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if prac_stim_keyResp.keys: #if at least one response was made this trial + if prac_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif prac_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + prac_trial_loop.addData('accuracy', accuracy) + # the Routine "prac_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10 repeats of 'prac_trial_loop' + + + # --- Prepare to start Routine "prac_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockAcc >= .75: #if accuracy >= 75% then say practice is complete and end practice loop to continue to main exp + outPut = 'You will now play the real game' #feedback presented + prac_block_loop.finished = True #end practice loop to continue to main exp + elif blockAcc <= .75: #if accuracy < 75% then say that practice needs to be repeated and DO NOT end practice loop, instead, allow it to repeat + outPut = 'Please try the practice again' #feedback presented + prac_block_loop.finished = False #DO NOT end practice loop and allow to repeat + + #reset the following variables to zero before the next practice block starts + trialNum = 0 + numCorr = 0 + prac_blockFeed_text.setText(outPut) + prac_blockFeed_keyResp.keys = [] + prac_blockFeed_keyResp.rt = [] + _prac_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockFeedComponents = [prac_blockFeed_text, prac_pressContinue, prac_blockFeed_keyResp] + for thisComponent in prac_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockFeed_text* updates + if prac_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_text.frameNStart = frameN # exact frame index + prac_blockFeed_text.tStart = t # local t and not account for scr refresh + prac_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_text.started') + prac_blockFeed_text.setAutoDraw(True) + + # *prac_pressContinue* updates + if prac_pressContinue.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_pressContinue.frameNStart = frameN # exact frame index + prac_pressContinue.tStart = t # local t and not account for scr refresh + prac_pressContinue.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_pressContinue, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_pressContinue.started') + prac_pressContinue.setAutoDraw(True) + + # *prac_blockFeed_keyResp* updates + waitOnFlip = False + if prac_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_keyResp.frameNStart = frameN # exact frame index + prac_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + prac_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_keyResp.started') + prac_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_blockFeed_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_prac_blockFeed_keyResp_allKeys): + prac_blockFeed_keyResp.keys = _prac_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + prac_blockFeed_keyResp.rt = _prac_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockFeed" --- + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_blockFeed_keyResp.keys in ['', [], None]: # No response was made + prac_blockFeed_keyResp.keys = None + prac_block_loop.addData('prac_blockFeed_keyResp.keys',prac_blockFeed_keyResp.keys) + if prac_blockFeed_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_blockFeed_keyResp.rt', prac_blockFeed_keyResp.rt) + # the Routine "prac_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 99 repeats of 'prac_block_loop' + + +# set up handler to look after randomisation of conditions etc +task_condition_loop = data.TrialHandler(nReps=1.0, method='sequential', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions("condition_"+expInfo['counterbalance']+".xlsx"), + seed=None, name='task_condition_loop') +thisExp.addLoop(task_condition_loop) # add the loop to the experiment +thisTask_condition_loop = task_condition_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) +if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + +for thisTask_condition_loop in task_condition_loop: + currentLoop = task_condition_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) + if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_condition" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from condition_init_blockCounter + #reset the following variables at the start of the experiment + blockCounter = 0 + + + if conditionText == 'Observe other': + endTask = 1 + elif conditionText == 'Observed': + endTask = 0 + elif conditionText == 'Alone': + endTask = 0 + condition_whichCondition_text.setText(conditionText) + condition_keyResp.keys = [] + condition_keyResp.rt = [] + _condition_keyResp_allKeys = [] + # keep track of which components have finished + task_conditionComponents = [condition_whichCondition_text, condition_reminder_text, condition_keyResp] + for thisComponent in task_conditionComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_condition" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *condition_whichCondition_text* updates + if condition_whichCondition_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_whichCondition_text.frameNStart = frameN # exact frame index + condition_whichCondition_text.tStart = t # local t and not account for scr refresh + condition_whichCondition_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_whichCondition_text, 'tStartRefresh') # time at next scr refresh + condition_whichCondition_text.setAutoDraw(True) + + # *condition_reminder_text* updates + if condition_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_reminder_text.frameNStart = frameN # exact frame index + condition_reminder_text.tStart = t # local t and not account for scr refresh + condition_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_reminder_text, 'tStartRefresh') # time at next scr refresh + condition_reminder_text.setAutoDraw(True) + + # *condition_keyResp* updates + waitOnFlip = False + if condition_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_keyResp.frameNStart = frameN # exact frame index + condition_keyResp.tStart = t # local t and not account for scr refresh + condition_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_keyResp, 'tStartRefresh') # time at next scr refresh + condition_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(condition_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(condition_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if condition_keyResp.status == STARTED and not waitOnFlip: + theseKeys = condition_keyResp.getKeys(keyList=['c'], waitRelease=False) + _condition_keyResp_allKeys.extend(theseKeys) + if len(_condition_keyResp_allKeys): + condition_keyResp.keys = _condition_keyResp_allKeys[-1].name # just the last key pressed + condition_keyResp.rt = _condition_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_condition" --- + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if condition_keyResp.keys in ['', [], None]: # No response was made + condition_keyResp.keys = None + task_condition_loop.addData('condition_keyResp.keys',condition_keyResp.keys) + if condition_keyResp.keys != None: # we had a response + task_condition_loop.addData('condition_keyResp.rt', condition_keyResp.rt) + # the Routine "task_condition" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # set up handler to look after randomisation of conditions etc + task_block_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='task_block_loop') + thisExp.addLoop(task_block_loop) # add the loop to the experiment + thisTask_block_loop = task_block_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + for thisTask_block_loop in task_block_loop: + currentLoop = task_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from task_blockReminder_code + # Kia: The following 2 lines are preventing the trigger loss + port.close() + port.open() + + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + blockCounter = blockCounter +1 + + if blockCounter == 1: + blockNumText = 'Block 1 of 10' + elif blockCounter == 2: + blockNumText = 'Block 2 of 10' + elif blockCounter == 3: + blockNumText = 'Block 3 of 10' + elif blockCounter == 4: + blockNumText = 'Block 4 of 10' + elif blockCounter == 5: + blockNumText = 'Block 5 of 10' + elif blockCounter == 6: + blockNumText = 'Block 6 of 10' + elif blockCounter == 7: + blockNumText = 'Block 7 of 10' + elif blockCounter == 8: + blockNumText = 'Block 8 of 10' + elif blockCounter == 9: + blockNumText = 'Block 9 of 10' + elif blockCounter == 10: + blockNumText = 'Block 10 of 10' + task_blockText.setText(blockNumText) + task_blockReminders_keyResp.keys = [] + task_blockReminders_keyResp.rt = [] + _task_blockReminders_keyResp_allKeys = [] + # keep track of which components have finished + task_blockRemindersComponents = [task_blockText, task_blockReminders_text, task_blockReminders_keyResp] + for thisComponent in task_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockText* updates + if task_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockText.frameNStart = frameN # exact frame index + task_blockText.tStart = t # local t and not account for scr refresh + task_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockText.started') + task_blockText.setAutoDraw(True) + + # *task_blockReminders_text* updates + if task_blockReminders_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_text.frameNStart = frameN # exact frame index + task_blockReminders_text.tStart = t # local t and not account for scr refresh + task_blockReminders_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_text, 'tStartRefresh') # time at next scr refresh + task_blockReminders_text.setAutoDraw(True) + + # *task_blockReminders_keyResp* updates + waitOnFlip = False + if task_blockReminders_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_keyResp.frameNStart = frameN # exact frame index + task_blockReminders_keyResp.tStart = t # local t and not account for scr refresh + task_blockReminders_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockReminders_keyResp.started') + task_blockReminders_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockReminders_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockReminders_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockReminders_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockReminders_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockReminders_keyResp_allKeys.extend(theseKeys) + if len(_task_blockReminders_keyResp_allKeys): + task_blockReminders_keyResp.keys = _task_blockReminders_keyResp_allKeys[-1].name # just the last key pressed + task_blockReminders_keyResp.rt = _task_blockReminders_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockReminders" --- + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockReminders_keyResp.keys in ['', [], None]: # No response was made + task_blockReminders_keyResp.keys = None + task_block_loop.addData('task_blockReminders_keyResp.keys',task_blockReminders_keyResp.keys) + if task_blockReminders_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockReminders_keyResp.rt', task_blockReminders_keyResp.rt) + # the Routine "task_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + task_trial_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions(whichCondition), + seed=None, name='task_trial_loop') + thisExp.addLoop(task_trial_loop) # add the loop to the experiment + thisTask_trial_loop = task_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + for thisTask_trial_loop in task_trial_loop: + currentLoop = task_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code_2 + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_trial_loop.finished = True + task_block_loop.finished = True + + # Run 'Begin Routine' code from task_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + task_trial_loop.addData('ISI', thisISI) + + task_centerImg.setImage(middleStim) + task_rightImg1.setImage(rightStim1) + task_rightImg2.setImage(rightStim2) + task_leftImg1.setImage(leftStim1) + task_leftImg2.setImage(leftStim1) + task_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from task_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + task_stim_keyResp.keys = [] + task_stim_keyResp.rt = [] + _task_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from task_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + task_stimRoutineComponents = [task_centerImg, task_rightImg1, task_rightImg2, task_leftImg1, task_leftImg2, task_fixImg, task_stim_keyResp] + for thisComponent in task_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_centerImg* updates + if task_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_centerImg.frameNStart = frameN # exact frame index + task_centerImg.tStart = t # local t and not account for scr refresh + task_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.started') + task_centerImg.setAutoDraw(True) + if task_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_centerImg.tStop = t # not accounting for scr refresh + task_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.stopped') + task_centerImg.setAutoDraw(False) + + # *task_rightImg1* updates + if task_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg1.frameNStart = frameN # exact frame index + task_rightImg1.tStart = t # local t and not account for scr refresh + task_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.started') + task_rightImg1.setAutoDraw(True) + if task_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg1.tStop = t # not accounting for scr refresh + task_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.stopped') + task_rightImg1.setAutoDraw(False) + + # *task_rightImg2* updates + if task_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg2.frameNStart = frameN # exact frame index + task_rightImg2.tStart = t # local t and not account for scr refresh + task_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.started') + task_rightImg2.setAutoDraw(True) + if task_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg2.tStop = t # not accounting for scr refresh + task_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.stopped') + task_rightImg2.setAutoDraw(False) + + # *task_leftImg1* updates + if task_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg1.frameNStart = frameN # exact frame index + task_leftImg1.tStart = t # local t and not account for scr refresh + task_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.started') + task_leftImg1.setAutoDraw(True) + if task_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg1.tStop = t # not accounting for scr refresh + task_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.stopped') + task_leftImg1.setAutoDraw(False) + + # *task_leftImg2* updates + if task_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg2.frameNStart = frameN # exact frame index + task_leftImg2.tStart = t # local t and not account for scr refresh + task_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.started') + task_leftImg2.setAutoDraw(True) + if task_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg2.tStop = t # not accounting for scr refresh + task_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.stopped') + task_leftImg2.setAutoDraw(False) + + # *task_fixImg* updates + if task_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_fixImg.frameNStart = frameN # exact frame index + task_fixImg.tStart = t # local t and not account for scr refresh + task_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.started') + task_fixImg.setAutoDraw(True) + if task_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_fixImg.tStop = t # not accounting for scr refresh + task_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.stopped') + task_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from task_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if task_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 41: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x29]) #hexcode = 41; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 42: + stimTriggerSent = True + port.write([0x2A]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 43: + stimTriggerSent = True + port.write([0x2B]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 44: + stimTriggerSent = True + port.write([0x2C]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 51: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x33]) #hexcode = 51; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 52: + stimTriggerSent = True + port.write([0x34]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 53: + stimTriggerSent = True + port.write([0x35]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 54: + stimTriggerSent = True + port.write([0x36]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *task_stim_keyResp* updates + waitOnFlip = False + if task_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_stim_keyResp.frameNStart = frameN # exact frame index + task_stim_keyResp.tStart = t # local t and not account for scr refresh + task_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.started') + task_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_stim_keyResp.tStop = t # not accounting for scr refresh + task_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.stopped') + task_stim_keyResp.status = FINISHED + if task_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _task_stim_keyResp_allKeys.extend(theseKeys) + if len(_task_stim_keyResp_allKeys): + task_stim_keyResp.keys = [key.name for key in _task_stim_keyResp_allKeys] # storing all keys + task_stim_keyResp.rt = [key.rt for key in _task_stim_keyResp_allKeys] + # Run 'Each Frame' code from task_respTrigger_code + if task_stim_keyResp.keys and len(task_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(task_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(task_stim_keyResp.keys) < 2: #if this is the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(task_stim_keyResp.keys) >= 2: #if this is NOT the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_stimRoutine" --- + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_stim_keyResp.keys in ['', [], None]: # No response was made + task_stim_keyResp.keys = None + task_trial_loop.addData('task_stim_keyResp.keys',task_stim_keyResp.keys) + if task_stim_keyResp.keys != None: # we had a response + task_trial_loop.addData('task_stim_keyResp.rt', task_stim_keyResp.rt) + # Run 'End Routine' code from task_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from task_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if task_stim_keyResp.keys: #if at least one response was made this trial + if task_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif task_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + task_trial_loop.addData('accuracy', accuracy) + # the Routine "task_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_trial_loop' + + + # --- Prepare to start Routine "task_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code_3 + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + # Run 'Begin Routine' code from task_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockCounter < 10: + if blockAcc >= .75: + if blockAcc < .9: + blockFeed = 'Good job' + blockFeedCat = 1 + elif blockAcc >= .9: + blockFeed = 'Respond faster' + blockFeedCat = 2 + elif blockAcc < .75: + blockFeed = 'Respond more accurately' + blockFeedCat = 3 + elif blockCounter == 10: + 'You have completed all blocks' + + # save this block's feedback to our output file + task_trial_loop.addData('blockFeedCat', blockFeedCat) + + #reset the following variables to zero before next block starts + trialNum = 0 + numCorr = 0 + task_blockFeed_text.setText(blockFeed) + task_blockFeed_text2.setText('Press the right button to continue') + task_blockFeed_keyResp.keys = [] + task_blockFeed_keyResp.rt = [] + _task_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + task_blockFeedComponents = [task_blockFeed_text, task_blackFeed_text3, task_blockFeed_text2, task_blockFeed_keyResp] + for thisComponent in task_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockFeed_text* updates + if task_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text.frameNStart = frameN # exact frame index + task_blockFeed_text.tStart = t # local t and not account for scr refresh + task_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_text.started') + task_blockFeed_text.setAutoDraw(True) + + # *task_blackFeed_text3* updates + if task_blackFeed_text3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blackFeed_text3.frameNStart = frameN # exact frame index + task_blackFeed_text3.tStart = t # local t and not account for scr refresh + task_blackFeed_text3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blackFeed_text3, 'tStartRefresh') # time at next scr refresh + task_blackFeed_text3.setAutoDraw(True) + if task_blackFeed_text3.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_blackFeed_text3.tStartRefresh + 10-frameTolerance: + # keep track of stop time/frame for later + task_blackFeed_text3.tStop = t # not accounting for scr refresh + task_blackFeed_text3.frameNStop = frameN # exact frame index + task_blackFeed_text3.setAutoDraw(False) + + # *task_blockFeed_text2* updates + if task_blockFeed_text2.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text2.frameNStart = frameN # exact frame index + task_blockFeed_text2.tStart = t # local t and not account for scr refresh + task_blockFeed_text2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text2, 'tStartRefresh') # time at next scr refresh + task_blockFeed_text2.setAutoDraw(True) + + # *task_blockFeed_keyResp* updates + waitOnFlip = False + if task_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_keyResp.frameNStart = frameN # exact frame index + task_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + task_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_keyResp.started') + task_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockFeed_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_task_blockFeed_keyResp_allKeys): + task_blockFeed_keyResp.keys = _task_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + task_blockFeed_keyResp.rt = _task_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockFeed" --- + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockFeed_keyResp.keys in ['', [], None]: # No response was made + task_blockFeed_keyResp.keys = None + task_block_loop.addData('task_blockFeed_keyResp.keys',task_blockFeed_keyResp.keys) + if task_blockFeed_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockFeed_keyResp.rt', task_blockFeed_keyResp.rt) + # the Routine "task_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_block_loop' + + + # --- Prepare to start Routine "task_conditionComplete" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + conditionComplete_key_resp.keys = [] + conditionComplete_key_resp.rt = [] + _conditionComplete_key_resp_allKeys = [] + # keep track of which components have finished + task_conditionCompleteComponents = [conditionComplete_text, conditionComplete_key_resp] + for thisComponent in task_conditionCompleteComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_conditionComplete" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *conditionComplete_text* updates + if conditionComplete_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_text.frameNStart = frameN # exact frame index + conditionComplete_text.tStart = t # local t and not account for scr refresh + conditionComplete_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_text, 'tStartRefresh') # time at next scr refresh + conditionComplete_text.setAutoDraw(True) + + # *conditionComplete_key_resp* updates + waitOnFlip = False + if conditionComplete_key_resp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_key_resp.frameNStart = frameN # exact frame index + conditionComplete_key_resp.tStart = t # local t and not account for scr refresh + conditionComplete_key_resp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_key_resp, 'tStartRefresh') # time at next scr refresh + conditionComplete_key_resp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(conditionComplete_key_resp.clock.reset) # t=0 on next screen flip + win.callOnFlip(conditionComplete_key_resp.clearEvents, eventType='keyboard') # clear events on next screen flip + if conditionComplete_key_resp.status == STARTED and not waitOnFlip: + theseKeys = conditionComplete_key_resp.getKeys(keyList=['c'], waitRelease=False) + _conditionComplete_key_resp_allKeys.extend(theseKeys) + if len(_conditionComplete_key_resp_allKeys): + conditionComplete_key_resp.keys = _conditionComplete_key_resp_allKeys[-1].name # just the last key pressed + conditionComplete_key_resp.rt = _conditionComplete_key_resp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_conditionComplete" --- + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if conditionComplete_key_resp.keys in ['', [], None]: # No response was made + conditionComplete_key_resp.keys = None + task_condition_loop.addData('conditionComplete_key_resp.keys',conditionComplete_key_resp.keys) + if conditionComplete_key_resp.keys != None: # we had a response + task_condition_loop.addData('conditionComplete_key_resp.rt', conditionComplete_key_resp.rt) + # the Routine "task_conditionComplete" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 1.0 repeats of 'task_condition_loop' + +# Run 'End Experiment' code from setup_code +win.mouseVisible = True #make the mouse cursor visable again +port.write([0xFF]) #set port values back to default state (FF) +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else +port.close() #close port opened at start of exp + +# --- End experiment --- +# Flip one final time so any remaining win.callOnFlip() +# and win.timeOnFlip() tasks get executed before quitting +win.flip() + +# these shouldn't be strictly necessary (should auto-save) +thisExp.saveAsWideText(filename+'.csv', delim='auto') +thisExp.saveAsPickle(filename) +logging.flush() +# make sure everything is closed down +if eyetracker: + eyetracker.setConnectionState(False) +thisExp.abort() # or data files will save again on exit +win.close() +core.quit() diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_A1.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_A1.xlsx new file mode 100755 index 0000000..5330938 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_A1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_A2.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_A2.xlsx new file mode 100755 index 0000000..a526247 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_A2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_B1.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_B1.xlsx new file mode 100755 index 0000000..4362c3f Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_B1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_B2.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_B2.xlsx new file mode 100755 index 0000000..f6ce344 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_B2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_C1.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_C1.xlsx new file mode 100755 index 0000000..d67534a Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_C1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_C2.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_C2.xlsx new file mode 100755 index 0000000..fe92b47 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/condition_C2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/fixationCross.png b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/fixationCross.png new file mode 100755 index 0000000..7767763 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/fixationCross.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/leftArrow.png b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/leftArrow.png new file mode 100755 index 0000000..5a40335 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/leftArrow.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/pptFiles.zip b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/pptFiles.zip new file mode 100755 index 0000000..7724f83 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/pptFiles.zip differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/rightArrow.png b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/rightArrow.png new file mode 100755 index 0000000..a0fbd55 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/img/rightArrow.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/nonsocial_task_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/nonsocial_task_trials.xlsx new file mode 100755 index 0000000..eb4162f Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/nonsocial_task_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/prac_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/prac_trials.xlsx new file mode 100755 index 0000000..a48c0a6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/prac_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/readme.md b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/readme.md new file mode 100755 index 0000000..e69de29 diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/social_task_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/social_task_trials.xlsx new file mode 100755 index 0000000..e74acd4 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/social_task_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/~$toDo.rtf b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/~$toDo.rtf new file mode 100755 index 0000000..ae13dc6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_block_level_triggerloss/~$toDo.rtf differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0.psyexp b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0.psyexp new file mode 100755 index 0000000..f97b819 --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0.psyexp @@ -0,0 +1,3017 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0.py b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0.py new file mode 100755 index 0000000..68e173a --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0.py @@ -0,0 +1,3975 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5), + on April 05, 2023, at 09:56 +If you publish work using this script the most relevant publication is: + + Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) + PsychoPy2: Experiments in behavior made easy Behav Res 51: 195. + https://doi.org/10.3758/s13428-018-01193-y + +""" + +# --- Import packages --- +from psychopy import locale_setup +from psychopy import prefs +prefs.hardware['audioLib'] = 'ptb' +from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout +from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, + STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) + +import numpy as np # whole numpy lib is available, prepend 'np.' +from numpy import (sin, cos, tan, log, log10, pi, average, + sqrt, std, deg2rad, rad2deg, linspace, asarray) +from numpy.random import random, randint, normal, shuffle, choice as randchoice +import os # handy system and path functions +import sys # to get file system encoding + +import psychopy.iohub as io +from psychopy.hardware import keyboard + + + +# Ensure that relative paths start from the same directory as this script +_thisDir = os.path.dirname(os.path.abspath(__file__)) +os.chdir(_thisDir) +# Store info about the experiment session +psychopyVersion = '2022.2.5' +expName = 'Arrow_Alert' # from the Builder filename that created this script +expInfo = { + 'id': '1', + 'counterbalance': ['A1', 'A2', 'B1', 'B2', 'C1', 'C2'], + 'session': '1', + 'run': '1', +} +# --- Show participant info dialog -- +dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName) +if dlg.OK == False: + core.quit() # user pressed cancel +expInfo['date'] = data.getDateStr() # add a simple timestamp +expInfo['expName'] = expName +expInfo['psychopyVersion'] = psychopyVersion + +# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc +filename = _thisDir + os.sep + u'data/%s_%s_%s_%s_%s_%s' % (expInfo['id'], expInfo['counterbalance'], expInfo['session'], expInfo['run'], expName, expInfo['date']) + +# An ExperimentHandler isn't essential but helps with data saving +thisExp = data.ExperimentHandler(name=expName, version='', + extraInfo=expInfo, runtimeInfo=None, + originPath='C:\\Users\\NDCLab\\Desktop\\Experiments\\thrive\\arrow-alert-v0\\arrow-alert_v0.py', + savePickle=True, saveWideText=True, + dataFileName=filename) +# save a log file for detail verbose info +logFile = logging.LogFile(filename+'.log', level=logging.DEBUG) +logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file + +endExpNow = False # flag for 'escape' or other condition => quit the exp +frameTolerance = 0.001 # how close to onset before 'same' frame + +# Start Code - component code to be run after the window creation + +# --- Setup the Window --- +win = visual.Window( + size=[1920, 1080], fullscr=True, screen=0, + winType='pyglet', allowStencil=False, + monitor='testMonitor', color=[-1,-1,-1], colorSpace='rgb', + blendMode='avg', useFBO=True, + units='height') +win.mouseVisible = False +# store frame rate of monitor if we can measure it +expInfo['frameRate'] = win.getActualFrameRate() +if expInfo['frameRate'] != None: + frameDur = 1.0 / round(expInfo['frameRate']) +else: + frameDur = 1.0 / 60.0 # could not measure, so guess +# --- Setup input devices --- +ioConfig = {} + +# Setup iohub keyboard +ioConfig['Keyboard'] = dict(use_keymap='psychopy') + +ioSession = '1' +if 'session' in expInfo: + ioSession = str(expInfo['session']) +ioServer = io.launchHubServer(window=win, **ioConfig) +eyetracker = None + +# create a default keyboard (e.g. to check for escape) +defaultKeyboard = keyboard.Keyboard(backend='iohub') + +# --- Initialize components for Routine "JS_code" --- + +# --- Initialize components for Routine "setup" --- +# Run 'Begin Experiment' code from setup_code +import serial #used for sending eeg triggers +import time #indirerctly used for sending eeg triggers (how long to wait before clearing port) + +win.mouseVisible = False #hide mouse cursor +port = serial.Serial('COM4') #open specified port (COM3) for sending eeg triggers to +# Kia: The following 2 lines are preventing the trigger loss +port.close() +port.open() + +PulseWidth = 0.002 #how long to wait before clearing port after sending trigger (2 ms is sufficient at 1000 hz sampling rate) + +port.write([0x00]) #clear serial port +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else + +# --- Initialize components for Routine "welcome" --- +welcome_text = visual.TextStim(win=win, name='welcome_text', + text='Arrow Alert Game\n\nWelcome to the arrow alert game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\n\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +welcome_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "welcome2" --- +welcome_text_2 = visual.TextStim(win=win, name='welcome_text_2', + text='Arrow Game\n\nWelcome to the arrow game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\nPress the right button to continue\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +welcome_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight" --- +instructRight_text = visual.TextStim(win=win, name='instructRight_text', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg = visual.ImageStim( + win=win, + name='instructRight_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1 = visual.ImageStim( + win=win, + name='instructRight_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1 = visual.ImageStim( + win=win, + name='instructRight_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight_2" --- +instructRight_text_2 = visual.TextStim(win=win, name='instructRight_text_2', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg_2 = visual.ImageStim( + win=win, + name='instructRight_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft" --- +instructLeft_text = visual.TextStim(win=win, name='instructLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg = visual.ImageStim( + win=win, + name='instructLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft_2" --- +instructLeft_text_2 = visual.TextStim(win=win, name='instructLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight" --- +instructInconRight_text = visual.TextStim(win=win, name='instructInconRight_text', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg = visual.ImageStim( + win=win, + name='instructIncon_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight_2" --- +instructInconRight_text_2 = visual.TextStim(win=win, name='instructInconRight_text_2', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg_2 = visual.ImageStim( + win=win, + name='instructIncon_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft" --- +instructInconLeft_text = visual.TextStim(win=win, name='instructInconLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft_2" --- +instructInconLeft_text_2 = visual.TextStim(win=win, name='instructInconLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders" --- +# Run 'Begin Experiment' code from prac_initAcc_code +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText = visual.TextStim(win=win, name='prac_blockText', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text = visual.TextStim(win=win, name='prac_reminder_text', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders_2" --- +# Run 'Begin Experiment' code from prac_initAcc_code_2 +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText_2 = visual.TextStim(win=win, name='prac_blockText_2', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text_2 = visual.TextStim(win=win, name='prac_reminder_text_2', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\nTo get ready, rest your right and left thumbs on the right and left buttons, then press the right button when you are ready to begin.\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) + +# --- Initialize components for Routine "prac_stimRoutine" --- +# Run 'Begin Experiment' code from prac_isi_code +#initialize the thisISI variable +thisISI = 0 +prac_centerImg = visual.ImageStim( + win=win, + name='prac_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=[.4, .4], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +prac_rightImg1 = visual.ImageStim( + win=win, + name='prac_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +prac_rightImg2 = visual.ImageStim( + win=win, + name='prac_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +prac_leftImg1 = visual.ImageStim( + win=win, + name='prac_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +prac_leftImg2 = visual.ImageStim( + win=win, + name='prac_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +prac_fixImg = visual.ImageStim( + win=win, + name='prac_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +prac_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockFeed" --- +prac_blockFeed_text = visual.TextStim(win=win, name='prac_blockFeed_text', + text='', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +prac_pressContinue = visual.TextStim(win=win, name='prac_pressContinue', + text='Experimenter: press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +prac_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_condition" --- +# Run 'Begin Experiment' code from condition_init_blockCounter +#initialize the following variables at the start of the condition +blockCounter = 0 + +# To skip routines in case of "observe other", +# we will need to use endTask. +# see begin routine tab for more. +endTask = 0 +condition_whichCondition_text = visual.TextStim(win=win, name='condition_whichCondition_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +condition_reminder_text = visual.TextStim(win=win, name='condition_reminder_text', + text='Experimenter: provide instructions and then press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.8, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +condition_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockReminders" --- +task_blockText = visual.TextStim(win=win, name='task_blockText', + text='', + font='Arial', + pos=(0, .1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +task_blockReminders_text = visual.TextStim(win=win, name='task_blockReminders_text', + text='Remember to limit blinking to about about once every ten seconds (or less).\n\nPlease try to relax the muscles in your face, neck, and shoulders. \n\nRest your right and left thumbs on the right and left buttons. When you are ready, press the right button to begin.\n', + font='Arial', + pos=(0, -.25), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blockReminders_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) + +# --- Initialize components for Routine "task_stimRoutine" --- +# Run 'Begin Experiment' code from task_isi_code +#no need to initialize thisISI, as already done in practice code snippit +task_centerImg = visual.ImageStim( + win=win, + name='task_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +task_rightImg1 = visual.ImageStim( + win=win, + name='task_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +task_rightImg2 = visual.ImageStim( + win=win, + name='task_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +task_leftImg1 = visual.ImageStim( + win=win, + name='task_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +task_leftImg2 = visual.ImageStim( + win=win, + name='task_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +task_fixImg = visual.ImageStim( + win=win, + name='task_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-7.0) +task_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockFeed" --- +task_blockFeed_text = visual.TextStim(win=win, name='task_blockFeed_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blackFeed_text3 = visual.TextStim(win=win, name='task_blackFeed_text3', + text='Please wait', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-3.0); +task_blockFeed_text2 = visual.TextStim(win=win, name='task_blockFeed_text2', + text='', + font='Arial', + pos=(0, -0.3), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-4.0); +task_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_conditionComplete" --- +conditionComplete_text = visual.TextStim(win=win, name='conditionComplete_text', + text='Please ring bell and wait for experimenter to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=0.0); +conditionComplete_key_resp = keyboard.Keyboard() + +# Create some handy timers +globalClock = core.Clock() # to track the time since experiment started +routineTimer = core.Clock() # to track time remaining of each (possibly non-slip) routine + +# --- Prepare to start Routine "JS_code" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +JS_codeComponents = [] +for thisComponent in JS_codeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "JS_code" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "JS_code" --- +for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "JS_code" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "setup" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +setupComponents = [] +for thisComponent in setupComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "setup" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in setupComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "setup" --- +for thisComponent in setupComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "setup" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp.keys = [] +welcome_keyResp.rt = [] +_welcome_keyResp_allKeys = [] +# keep track of which components have finished +welcomeComponents = [welcome_text, welcome_keyResp] +for thisComponent in welcomeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_text* updates + if welcome_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text.frameNStart = frameN # exact frame index + welcome_text.tStart = t # local t and not account for scr refresh + welcome_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text, 'tStartRefresh') # time at next scr refresh + welcome_text.setAutoDraw(True) + + # *welcome_keyResp* updates + waitOnFlip = False + if welcome_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp.frameNStart = frameN # exact frame index + welcome_keyResp.tStart = t # local t and not account for scr refresh + welcome_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp, 'tStartRefresh') # time at next scr refresh + welcome_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp.getKeys(keyList=['c'], waitRelease=False) + _welcome_keyResp_allKeys.extend(theseKeys) + if len(_welcome_keyResp_allKeys): + welcome_keyResp.keys = _welcome_keyResp_allKeys[-1].name # just the last key pressed + welcome_keyResp.rt = _welcome_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcomeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome" --- +for thisComponent in welcomeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp_2.keys = [] +welcome_keyResp_2.rt = [] +_welcome_keyResp_2_allKeys = [] +# keep track of which components have finished +welcome2Components = [welcome_text_2, welcome_keyResp_2] +for thisComponent in welcome2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_text_2* updates + if welcome_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text_2.frameNStart = frameN # exact frame index + welcome_text_2.tStart = t # local t and not account for scr refresh + welcome_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text_2, 'tStartRefresh') # time at next scr refresh + welcome_text_2.setAutoDraw(True) + + # *welcome_keyResp_2* updates + waitOnFlip = False + if welcome_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp_2.frameNStart = frameN # exact frame index + welcome_keyResp_2.tStart = t # local t and not account for scr refresh + welcome_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp_2, 'tStartRefresh') # time at next scr refresh + welcome_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _welcome_keyResp_2_allKeys.extend(theseKeys) + if len(_welcome_keyResp_2_allKeys): + welcome_keyResp_2.keys = _welcome_keyResp_2_allKeys[-1].name # just the last key pressed + welcome_keyResp_2.rt = _welcome_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcome2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome2" --- +for thisComponent in welcome2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp.keys = [] +insructRight_keyResp.rt = [] +_insructRight_keyResp_allKeys = [] +# keep track of which components have finished +instructRightComponents = [instructRight_text, instructRight_centerImg, instructRight_rightImg1, instructRight_rightImg2, instructRight_leftImg1, instructRight_leftImg2, insructRight_keyResp] +for thisComponent in instructRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text* updates + if instructRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text.frameNStart = frameN # exact frame index + instructRight_text.tStart = t # local t and not account for scr refresh + instructRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text, 'tStartRefresh') # time at next scr refresh + instructRight_text.setAutoDraw(True) + + # *instructRight_centerImg* updates + if instructRight_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg.frameNStart = frameN # exact frame index + instructRight_centerImg.tStart = t # local t and not account for scr refresh + instructRight_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg.setAutoDraw(True) + + # *instructRight_rightImg1* updates + if instructRight_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1.frameNStart = frameN # exact frame index + instructRight_rightImg1.tStart = t # local t and not account for scr refresh + instructRight_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1.setAutoDraw(True) + + # *instructRight_rightImg2* updates + if instructRight_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2.frameNStart = frameN # exact frame index + instructRight_rightImg2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2.setAutoDraw(True) + + # *instructRight_leftImg1* updates + if instructRight_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1.frameNStart = frameN # exact frame index + instructRight_leftImg1.tStart = t # local t and not account for scr refresh + instructRight_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1.setAutoDraw(True) + + # *instructRight_leftImg2* updates + if instructRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2.frameNStart = frameN # exact frame index + instructRight_leftImg2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2.setAutoDraw(True) + + # *insructRight_keyResp* updates + waitOnFlip = False + if insructRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp.frameNStart = frameN # exact frame index + insructRight_keyResp.tStart = t # local t and not account for scr refresh + insructRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructRight_keyResp_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_allKeys): + insructRight_keyResp.keys = _insructRight_keyResp_allKeys[-1].name # just the last key pressed + insructRight_keyResp.rt = _insructRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight" --- +for thisComponent in instructRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp_2.keys = [] +insructRight_keyResp_2.rt = [] +_insructRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructRight_2Components = [instructRight_text_2, instructRight_centerImg_2, instructRight_rightImg1_2, instructRight_rightImg2_2, instructRight_leftImg1_2, instructRight_leftImg2_2, insructRight_keyResp_2] +for thisComponent in instructRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text_2* updates + if instructRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text_2.frameNStart = frameN # exact frame index + instructRight_text_2.tStart = t # local t and not account for scr refresh + instructRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text_2, 'tStartRefresh') # time at next scr refresh + instructRight_text_2.setAutoDraw(True) + + # *instructRight_centerImg_2* updates + if instructRight_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg_2.frameNStart = frameN # exact frame index + instructRight_centerImg_2.tStart = t # local t and not account for scr refresh + instructRight_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg_2.setAutoDraw(True) + + # *instructRight_rightImg1_2* updates + if instructRight_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1_2.frameNStart = frameN # exact frame index + instructRight_rightImg1_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1_2.setAutoDraw(True) + + # *instructRight_rightImg2_2* updates + if instructRight_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2_2.frameNStart = frameN # exact frame index + instructRight_rightImg2_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2_2.setAutoDraw(True) + + # *instructRight_leftImg1_2* updates + if instructRight_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1_2.frameNStart = frameN # exact frame index + instructRight_leftImg1_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1_2.setAutoDraw(True) + + # *instructRight_leftImg2_2* updates + if instructRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2_2.frameNStart = frameN # exact frame index + instructRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2_2.setAutoDraw(True) + + # *insructRight_keyResp_2* updates + waitOnFlip = False + if insructRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp_2.frameNStart = frameN # exact frame index + insructRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_2_allKeys): + insructRight_keyResp_2.keys = _insructRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructRight_keyResp_2.rt = _insructRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight_2" --- +for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp.keys = [] +instructLeft_keyResp.rt = [] +_instructLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructLeftComponents = [instructLeft_text, instructLeft_centerImg, instructLeft_rightImg1, instructLeft_rightImg2, instructLeft_leftImg1, instructLeft_leftImg2, instructLeft_keyResp] +for thisComponent in instructLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text* updates + if instructLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text.frameNStart = frameN # exact frame index + instructLeft_text.tStart = t # local t and not account for scr refresh + instructLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text, 'tStartRefresh') # time at next scr refresh + instructLeft_text.setAutoDraw(True) + + # *instructLeft_centerImg* updates + if instructLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg.frameNStart = frameN # exact frame index + instructLeft_centerImg.tStart = t # local t and not account for scr refresh + instructLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg.setAutoDraw(True) + + # *instructLeft_rightImg1* updates + if instructLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1.frameNStart = frameN # exact frame index + instructLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1.setAutoDraw(True) + + # *instructLeft_rightImg2* updates + if instructLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2.frameNStart = frameN # exact frame index + instructLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2.setAutoDraw(True) + + # *instructLeft_leftImg1* updates + if instructLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1.frameNStart = frameN # exact frame index + instructLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1.setAutoDraw(True) + + # *instructLeft_leftImg2* updates + if instructLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2.frameNStart = frameN # exact frame index + instructLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2.setAutoDraw(True) + + # *instructLeft_keyResp* updates + waitOnFlip = False + if instructLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp.frameNStart = frameN # exact frame index + instructLeft_keyResp.tStart = t # local t and not account for scr refresh + instructLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_allKeys): + instructLeft_keyResp.keys = _instructLeft_keyResp_allKeys[-1].name # just the last key pressed + instructLeft_keyResp.rt = _instructLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft" --- +for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp_2.keys = [] +instructLeft_keyResp_2.rt = [] +_instructLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructLeft_2Components = [instructLeft_text_2, instructLeft_centerImg_2, instructLeft_rightImg1_2, instructLeft_rightImg2_2, instructLeft_leftImg1_2, instructLeft_leftImg2_2, instructLeft_keyResp_2] +for thisComponent in instructLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text_2* updates + if instructLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text_2.frameNStart = frameN # exact frame index + instructLeft_text_2.tStart = t # local t and not account for scr refresh + instructLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructLeft_text_2.setAutoDraw(True) + + # *instructLeft_centerImg_2* updates + if instructLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg_2.frameNStart = frameN # exact frame index + instructLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg_2.setAutoDraw(True) + + # *instructLeft_rightImg1_2* updates + if instructLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1_2.setAutoDraw(True) + + # *instructLeft_rightImg2_2* updates + if instructLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2_2.setAutoDraw(True) + + # *instructLeft_leftImg1_2* updates + if instructLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1_2.setAutoDraw(True) + + # *instructLeft_leftImg2_2* updates + if instructLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2_2.setAutoDraw(True) + + # *instructLeft_keyResp_2* updates + waitOnFlip = False + if instructLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp_2.frameNStart = frameN # exact frame index + instructLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_2_allKeys): + instructLeft_keyResp_2.keys = _instructLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructLeft_keyResp_2.rt = _instructLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft_2" --- +for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp.keys = [] +insructInconRight_keyResp.rt = [] +_insructInconRight_keyResp_allKeys = [] +# keep track of which components have finished +instructInconRightComponents = [instructInconRight_text, instructIncon_centerImg, instructIncon_rightImg1, instructIncon_rightImg2, instructIncon_leftImg1, instructInconRight_leftImg2, insructInconRight_keyResp] +for thisComponent in instructInconRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text* updates + if instructInconRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text.frameNStart = frameN # exact frame index + instructInconRight_text.tStart = t # local t and not account for scr refresh + instructInconRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text, 'tStartRefresh') # time at next scr refresh + instructInconRight_text.setAutoDraw(True) + + # *instructIncon_centerImg* updates + if instructIncon_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg.frameNStart = frameN # exact frame index + instructIncon_centerImg.tStart = t # local t and not account for scr refresh + instructIncon_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg.setAutoDraw(True) + + # *instructIncon_rightImg1* updates + if instructIncon_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1.frameNStart = frameN # exact frame index + instructIncon_rightImg1.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1.setAutoDraw(True) + + # *instructIncon_rightImg2* updates + if instructIncon_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2.frameNStart = frameN # exact frame index + instructIncon_rightImg2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2.setAutoDraw(True) + + # *instructIncon_leftImg1* updates + if instructIncon_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1.frameNStart = frameN # exact frame index + instructIncon_leftImg1.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1.setAutoDraw(True) + + # *instructInconRight_leftImg2* updates + if instructInconRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2.setAutoDraw(True) + + # *insructInconRight_keyResp* updates + waitOnFlip = False + if insructInconRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp.frameNStart = frameN # exact frame index + insructInconRight_keyResp.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructInconRight_keyResp_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_allKeys): + insructInconRight_keyResp.keys = _insructInconRight_keyResp_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp.rt = _insructInconRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight" --- +for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp_2.keys = [] +insructInconRight_keyResp_2.rt = [] +_insructInconRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconRight_2Components = [instructInconRight_text_2, instructIncon_centerImg_2, instructIncon_rightImg1_2, instructIncon_rightImg2_2, instructIncon_leftImg1_2, instructInconRight_leftImg2_2, insructInconRight_keyResp_2] +for thisComponent in instructInconRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text_2* updates + if instructInconRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text_2.frameNStart = frameN # exact frame index + instructInconRight_text_2.tStart = t # local t and not account for scr refresh + instructInconRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_text_2.setAutoDraw(True) + + # *instructIncon_centerImg_2* updates + if instructIncon_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg_2.frameNStart = frameN # exact frame index + instructIncon_centerImg_2.tStart = t # local t and not account for scr refresh + instructIncon_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg_2.setAutoDraw(True) + + # *instructIncon_rightImg1_2* updates + if instructIncon_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1_2.frameNStart = frameN # exact frame index + instructIncon_rightImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1_2.setAutoDraw(True) + + # *instructIncon_rightImg2_2* updates + if instructIncon_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2_2.frameNStart = frameN # exact frame index + instructIncon_rightImg2_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2_2.setAutoDraw(True) + + # *instructIncon_leftImg1_2* updates + if instructIncon_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1_2.frameNStart = frameN # exact frame index + instructIncon_leftImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1_2.setAutoDraw(True) + + # *instructInconRight_leftImg2_2* updates + if instructInconRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2_2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2_2.setAutoDraw(True) + + # *insructInconRight_keyResp_2* updates + waitOnFlip = False + if insructInconRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp_2.frameNStart = frameN # exact frame index + insructInconRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructInconRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_2_allKeys): + insructInconRight_keyResp_2.keys = _insructInconRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp_2.rt = _insructInconRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight_2" --- +for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp.keys = [] +instructInconLeft_keyResp.rt = [] +_instructInconLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructInconLeftComponents = [instructInconLeft_text, instructInconLeft_centerImg, instructInconLeft_rightImg1, instructInconLeft_rightImg2, instructInconLeft_leftImg1, instructInconLeft_leftImg2, instructInconLeft_keyResp] +for thisComponent in instructInconLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text* updates + if instructInconLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text.frameNStart = frameN # exact frame index + instructInconLeft_text.tStart = t # local t and not account for scr refresh + instructInconLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text.setAutoDraw(True) + + # *instructInconLeft_centerImg* updates + if instructInconLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg.frameNStart = frameN # exact frame index + instructInconLeft_centerImg.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg.setAutoDraw(True) + + # *instructInconLeft_rightImg1* updates + if instructInconLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1.setAutoDraw(True) + + # *instructInconLeft_rightImg2* updates + if instructInconLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2.setAutoDraw(True) + + # *instructInconLeft_leftImg1* updates + if instructInconLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1.setAutoDraw(True) + + # *instructInconLeft_leftImg2* updates + if instructInconLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2.setAutoDraw(True) + + # *instructInconLeft_keyResp* updates + waitOnFlip = False + if instructInconLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp.frameNStart = frameN # exact frame index + instructInconLeft_keyResp.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructInconLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_allKeys): + instructInconLeft_keyResp.keys = _instructInconLeft_keyResp_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp.rt = _instructInconLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft" --- +for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp_2.keys = [] +instructInconLeft_keyResp_2.rt = [] +_instructInconLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconLeft_2Components = [instructInconLeft_text_2, instructInconLeft_centerImg_2, instructInconLeft_rightImg1_2, instructInconLeft_rightImg2_2, instructInconLeft_leftImg1_2, instructInconLeft_leftImg2_2, instructInconLeft_keyResp_2] +for thisComponent in instructInconLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text_2* updates + if instructInconLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text_2.frameNStart = frameN # exact frame index + instructInconLeft_text_2.tStart = t # local t and not account for scr refresh + instructInconLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text_2.setAutoDraw(True) + + # *instructInconLeft_centerImg_2* updates + if instructInconLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg_2.frameNStart = frameN # exact frame index + instructInconLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg_2.setAutoDraw(True) + + # *instructInconLeft_rightImg1_2* updates + if instructInconLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1_2.setAutoDraw(True) + + # *instructInconLeft_rightImg2_2* updates + if instructInconLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2_2.setAutoDraw(True) + + # *instructInconLeft_leftImg1_2* updates + if instructInconLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1_2.setAutoDraw(True) + + # *instructInconLeft_leftImg2_2* updates + if instructInconLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2_2.setAutoDraw(True) + + # *instructInconLeft_keyResp_2* updates + waitOnFlip = False + if instructInconLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp_2.frameNStart = frameN # exact frame index + instructInconLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructInconLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_2_allKeys): + instructInconLeft_keyResp_2.keys = _instructInconLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp_2.rt = _instructInconLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft_2" --- +for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# set up handler to look after randomisation of conditions etc +prac_block_loop = data.TrialHandler(nReps=99, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='prac_block_loop') +thisExp.addLoop(prac_block_loop) # add the loop to the experiment +thisPrac_block_loop = prac_block_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) +if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + +for thisPrac_block_loop in prac_block_loop: + currentLoop = prac_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) + if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_initAcc_code + # Kia: The following 2 lines are preventing the trigger loss + port.close() + port.open() + prac_reminder_keyResp.keys = [] + prac_reminder_keyResp.rt = [] + _prac_reminder_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockRemindersComponents = [prac_blockText, prac_reminder_text, prac_reminder_keyResp] + for thisComponent in prac_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText* updates + if prac_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText.frameNStart = frameN # exact frame index + prac_blockText.tStart = t # local t and not account for scr refresh + prac_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText.started') + prac_blockText.setAutoDraw(True) + + # *prac_reminder_text* updates + if prac_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text.frameNStart = frameN # exact frame index + prac_reminder_text.tStart = t # local t and not account for scr refresh + prac_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text.started') + prac_reminder_text.setAutoDraw(True) + + # *prac_reminder_keyResp* updates + waitOnFlip = False + if prac_reminder_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp.frameNStart = frameN # exact frame index + prac_reminder_keyResp.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp.started') + prac_reminder_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_reminder_keyResp_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_allKeys): + prac_reminder_keyResp.keys = _prac_reminder_keyResp_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp.rt = _prac_reminder_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders" --- + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp.keys in ['', [], None]: # No response was made + prac_reminder_keyResp.keys = None + prac_block_loop.addData('prac_reminder_keyResp.keys',prac_reminder_keyResp.keys) + if prac_reminder_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp.rt', prac_reminder_keyResp.rt) + # the Routine "prac_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "prac_blockReminders_2" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp_2.keys = [] + prac_reminder_keyResp_2.rt = [] + _prac_reminder_keyResp_2_allKeys = [] + # keep track of which components have finished + prac_blockReminders_2Components = [prac_blockText_2, prac_reminder_text_2, prac_reminder_keyResp_2] + for thisComponent in prac_blockReminders_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders_2" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText_2* updates + if prac_blockText_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText_2.frameNStart = frameN # exact frame index + prac_blockText_2.tStart = t # local t and not account for scr refresh + prac_blockText_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText_2.started') + prac_blockText_2.setAutoDraw(True) + + # *prac_reminder_text_2* updates + if prac_reminder_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text_2.frameNStart = frameN # exact frame index + prac_reminder_text_2.tStart = t # local t and not account for scr refresh + prac_reminder_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text_2.started') + prac_reminder_text_2.setAutoDraw(True) + + # *prac_reminder_keyResp_2* updates + waitOnFlip = False + if prac_reminder_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp_2.frameNStart = frameN # exact frame index + prac_reminder_keyResp_2.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp_2.started') + prac_reminder_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _prac_reminder_keyResp_2_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_2_allKeys): + prac_reminder_keyResp_2.keys = _prac_reminder_keyResp_2_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp_2.rt = _prac_reminder_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders_2" --- + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp_2.keys in ['', [], None]: # No response was made + prac_reminder_keyResp_2.keys = None + prac_block_loop.addData('prac_reminder_keyResp_2.keys',prac_reminder_keyResp_2.keys) + if prac_reminder_keyResp_2.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp_2.rt', prac_reminder_keyResp_2.rt) + # the Routine "prac_blockReminders_2" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + prac_trial_loop = data.TrialHandler(nReps=10, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions('prac_trials.xlsx'), + seed=None, name='prac_trial_loop') + thisExp.addLoop(prac_trial_loop) # add the loop to the experiment + thisPrac_trial_loop = prac_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + for thisPrac_trial_loop in prac_trial_loop: + currentLoop = prac_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + prac_trial_loop.addData('ISI', thisISI) + + + # show in console for debugging + #print('thisISI: ', thisISI) + prac_centerImg.setImage(middleStim) + prac_rightImg1.setImage(rightStim1) + prac_rightImg2.setImage(rightStim2) + prac_leftImg1.setImage(leftStim1) + prac_leftImg2.setImage(leftStim1) + prac_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from prac_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + prac_stim_keyResp.keys = [] + prac_stim_keyResp.rt = [] + _prac_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from prac_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + prac_stimRoutineComponents = [prac_centerImg, prac_rightImg1, prac_rightImg2, prac_leftImg1, prac_leftImg2, prac_fixImg, prac_stim_keyResp] + for thisComponent in prac_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_centerImg* updates + if prac_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_centerImg.frameNStart = frameN # exact frame index + prac_centerImg.tStart = t # local t and not account for scr refresh + prac_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.started') + prac_centerImg.setAutoDraw(True) + if prac_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_centerImg.tStop = t # not accounting for scr refresh + prac_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.stopped') + prac_centerImg.setAutoDraw(False) + + # *prac_rightImg1* updates + if prac_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg1.frameNStart = frameN # exact frame index + prac_rightImg1.tStart = t # local t and not account for scr refresh + prac_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.started') + prac_rightImg1.setAutoDraw(True) + if prac_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg1.tStop = t # not accounting for scr refresh + prac_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.stopped') + prac_rightImg1.setAutoDraw(False) + + # *prac_rightImg2* updates + if prac_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg2.frameNStart = frameN # exact frame index + prac_rightImg2.tStart = t # local t and not account for scr refresh + prac_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.started') + prac_rightImg2.setAutoDraw(True) + if prac_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg2.tStop = t # not accounting for scr refresh + prac_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.stopped') + prac_rightImg2.setAutoDraw(False) + + # *prac_leftImg1* updates + if prac_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg1.frameNStart = frameN # exact frame index + prac_leftImg1.tStart = t # local t and not account for scr refresh + prac_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.started') + prac_leftImg1.setAutoDraw(True) + if prac_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg1.tStop = t # not accounting for scr refresh + prac_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.stopped') + prac_leftImg1.setAutoDraw(False) + + # *prac_leftImg2* updates + if prac_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg2.frameNStart = frameN # exact frame index + prac_leftImg2.tStart = t # local t and not account for scr refresh + prac_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.started') + prac_leftImg2.setAutoDraw(True) + if prac_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg2.tStop = t # not accounting for scr refresh + prac_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.stopped') + prac_leftImg2.setAutoDraw(False) + + # *prac_fixImg* updates + if prac_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_fixImg.frameNStart = frameN # exact frame index + prac_fixImg.tStart = t # local t and not account for scr refresh + prac_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.started') + prac_fixImg.setAutoDraw(True) + if prac_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_fixImg.tStop = t # not accounting for scr refresh + prac_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.stopped') + prac_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from prac_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if prac_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 1: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x01]) #hexcode = 1; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 2: + stimTriggerSent = True + port.write([0x02]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 3: + stimTriggerSent = True + port.write([0x03]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 4: + stimTriggerSent = True + port.write([0x04]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *prac_stim_keyResp* updates + waitOnFlip = False + if prac_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_stim_keyResp.frameNStart = frameN # exact frame index + prac_stim_keyResp.tStart = t # local t and not account for scr refresh + prac_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.started') + prac_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_stim_keyResp.tStop = t # not accounting for scr refresh + prac_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.stopped') + prac_stim_keyResp.status = FINISHED + if prac_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _prac_stim_keyResp_allKeys.extend(theseKeys) + if len(_prac_stim_keyResp_allKeys): + prac_stim_keyResp.keys = [key.name for key in _prac_stim_keyResp_allKeys] # storing all keys + prac_stim_keyResp.rt = [key.rt for key in _prac_stim_keyResp_allKeys] + # Run 'Each Frame' code from prac_respTrigger_code + if prac_stim_keyResp.keys and len(prac_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(prac_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(prac_stim_keyResp.keys) < 2: #if this is the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(prac_stim_keyResp.keys) >= 2: #if this is NOT the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_stimRoutine" --- + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_stim_keyResp.keys in ['', [], None]: # No response was made + prac_stim_keyResp.keys = None + prac_trial_loop.addData('prac_stim_keyResp.keys',prac_stim_keyResp.keys) + if prac_stim_keyResp.keys != None: # we had a response + prac_trial_loop.addData('prac_stim_keyResp.rt', prac_stim_keyResp.rt) + # Run 'End Routine' code from prac_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from prac_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if prac_stim_keyResp.keys: #if at least one response was made this trial + if prac_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif prac_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + prac_trial_loop.addData('accuracy', accuracy) + # the Routine "prac_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10 repeats of 'prac_trial_loop' + + + # --- Prepare to start Routine "prac_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockAcc >= .75: #if accuracy >= 75% then say practice is complete and end practice loop to continue to main exp + outPut = 'You will now play the real game' #feedback presented + prac_block_loop.finished = True #end practice loop to continue to main exp + elif blockAcc <= .75: #if accuracy < 75% then say that practice needs to be repeated and DO NOT end practice loop, instead, allow it to repeat + outPut = 'Please try the practice again' #feedback presented + prac_block_loop.finished = False #DO NOT end practice loop and allow to repeat + + #reset the following variables to zero before the next practice block starts + trialNum = 0 + numCorr = 0 + prac_blockFeed_text.setText(outPut) + prac_blockFeed_keyResp.keys = [] + prac_blockFeed_keyResp.rt = [] + _prac_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockFeedComponents = [prac_blockFeed_text, prac_pressContinue, prac_blockFeed_keyResp] + for thisComponent in prac_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockFeed_text* updates + if prac_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_text.frameNStart = frameN # exact frame index + prac_blockFeed_text.tStart = t # local t and not account for scr refresh + prac_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_text.started') + prac_blockFeed_text.setAutoDraw(True) + + # *prac_pressContinue* updates + if prac_pressContinue.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_pressContinue.frameNStart = frameN # exact frame index + prac_pressContinue.tStart = t # local t and not account for scr refresh + prac_pressContinue.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_pressContinue, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_pressContinue.started') + prac_pressContinue.setAutoDraw(True) + + # *prac_blockFeed_keyResp* updates + waitOnFlip = False + if prac_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_keyResp.frameNStart = frameN # exact frame index + prac_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + prac_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_keyResp.started') + prac_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_blockFeed_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_prac_blockFeed_keyResp_allKeys): + prac_blockFeed_keyResp.keys = _prac_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + prac_blockFeed_keyResp.rt = _prac_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockFeed" --- + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_blockFeed_keyResp.keys in ['', [], None]: # No response was made + prac_blockFeed_keyResp.keys = None + prac_block_loop.addData('prac_blockFeed_keyResp.keys',prac_blockFeed_keyResp.keys) + if prac_blockFeed_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_blockFeed_keyResp.rt', prac_blockFeed_keyResp.rt) + # the Routine "prac_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 99 repeats of 'prac_block_loop' + + +# set up handler to look after randomisation of conditions etc +task_condition_loop = data.TrialHandler(nReps=1.0, method='sequential', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions("condition_"+expInfo['counterbalance']+".xlsx"), + seed=None, name='task_condition_loop') +thisExp.addLoop(task_condition_loop) # add the loop to the experiment +thisTask_condition_loop = task_condition_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) +if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + +for thisTask_condition_loop in task_condition_loop: + currentLoop = task_condition_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) + if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_condition" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from condition_init_blockCounter + #reset the following variables at the start of the experiment + blockCounter = 0 + + + if conditionText == 'Observe other': + endTask = 1 + elif conditionText == 'Observed': + endTask = 0 + elif conditionText == 'Alone': + endTask = 0 + condition_whichCondition_text.setText(conditionText) + condition_keyResp.keys = [] + condition_keyResp.rt = [] + _condition_keyResp_allKeys = [] + # keep track of which components have finished + task_conditionComponents = [condition_whichCondition_text, condition_reminder_text, condition_keyResp] + for thisComponent in task_conditionComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_condition" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *condition_whichCondition_text* updates + if condition_whichCondition_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_whichCondition_text.frameNStart = frameN # exact frame index + condition_whichCondition_text.tStart = t # local t and not account for scr refresh + condition_whichCondition_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_whichCondition_text, 'tStartRefresh') # time at next scr refresh + condition_whichCondition_text.setAutoDraw(True) + + # *condition_reminder_text* updates + if condition_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_reminder_text.frameNStart = frameN # exact frame index + condition_reminder_text.tStart = t # local t and not account for scr refresh + condition_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_reminder_text, 'tStartRefresh') # time at next scr refresh + condition_reminder_text.setAutoDraw(True) + + # *condition_keyResp* updates + waitOnFlip = False + if condition_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_keyResp.frameNStart = frameN # exact frame index + condition_keyResp.tStart = t # local t and not account for scr refresh + condition_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_keyResp, 'tStartRefresh') # time at next scr refresh + condition_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(condition_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(condition_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if condition_keyResp.status == STARTED and not waitOnFlip: + theseKeys = condition_keyResp.getKeys(keyList=['c'], waitRelease=False) + _condition_keyResp_allKeys.extend(theseKeys) + if len(_condition_keyResp_allKeys): + condition_keyResp.keys = _condition_keyResp_allKeys[-1].name # just the last key pressed + condition_keyResp.rt = _condition_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_condition" --- + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if condition_keyResp.keys in ['', [], None]: # No response was made + condition_keyResp.keys = None + task_condition_loop.addData('condition_keyResp.keys',condition_keyResp.keys) + if condition_keyResp.keys != None: # we had a response + task_condition_loop.addData('condition_keyResp.rt', condition_keyResp.rt) + # the Routine "task_condition" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # set up handler to look after randomisation of conditions etc + task_block_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='task_block_loop') + thisExp.addLoop(task_block_loop) # add the loop to the experiment + thisTask_block_loop = task_block_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + for thisTask_block_loop in task_block_loop: + currentLoop = task_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from task_blockReminder_code + # Kia: The following 2 lines are preventing the trigger loss + port.close() + port.open() + + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + blockCounter = blockCounter +1 + + if blockCounter == 1: + blockNumText = 'Block 1 of 10' + elif blockCounter == 2: + blockNumText = 'Block 2 of 10' + elif blockCounter == 3: + blockNumText = 'Block 3 of 10' + elif blockCounter == 4: + blockNumText = 'Block 4 of 10' + elif blockCounter == 5: + blockNumText = 'Block 5 of 10' + elif blockCounter == 6: + blockNumText = 'Block 6 of 10' + elif blockCounter == 7: + blockNumText = 'Block 7 of 10' + elif blockCounter == 8: + blockNumText = 'Block 8 of 10' + elif blockCounter == 9: + blockNumText = 'Block 9 of 10' + elif blockCounter == 10: + blockNumText = 'Block 10 of 10' + task_blockText.setText(blockNumText) + task_blockReminders_keyResp.keys = [] + task_blockReminders_keyResp.rt = [] + _task_blockReminders_keyResp_allKeys = [] + # keep track of which components have finished + task_blockRemindersComponents = [task_blockText, task_blockReminders_text, task_blockReminders_keyResp] + for thisComponent in task_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockText* updates + if task_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockText.frameNStart = frameN # exact frame index + task_blockText.tStart = t # local t and not account for scr refresh + task_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockText.started') + task_blockText.setAutoDraw(True) + + # *task_blockReminders_text* updates + if task_blockReminders_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_text.frameNStart = frameN # exact frame index + task_blockReminders_text.tStart = t # local t and not account for scr refresh + task_blockReminders_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_text, 'tStartRefresh') # time at next scr refresh + task_blockReminders_text.setAutoDraw(True) + + # *task_blockReminders_keyResp* updates + waitOnFlip = False + if task_blockReminders_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_keyResp.frameNStart = frameN # exact frame index + task_blockReminders_keyResp.tStart = t # local t and not account for scr refresh + task_blockReminders_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockReminders_keyResp.started') + task_blockReminders_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockReminders_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockReminders_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockReminders_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockReminders_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockReminders_keyResp_allKeys.extend(theseKeys) + if len(_task_blockReminders_keyResp_allKeys): + task_blockReminders_keyResp.keys = _task_blockReminders_keyResp_allKeys[-1].name # just the last key pressed + task_blockReminders_keyResp.rt = _task_blockReminders_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockReminders" --- + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockReminders_keyResp.keys in ['', [], None]: # No response was made + task_blockReminders_keyResp.keys = None + task_block_loop.addData('task_blockReminders_keyResp.keys',task_blockReminders_keyResp.keys) + if task_blockReminders_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockReminders_keyResp.rt', task_blockReminders_keyResp.rt) + # the Routine "task_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + task_trial_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions(whichCondition), + seed=None, name='task_trial_loop') + thisExp.addLoop(task_trial_loop) # add the loop to the experiment + thisTask_trial_loop = task_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + for thisTask_trial_loop in task_trial_loop: + currentLoop = task_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code_2 + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_trial_loop.finished = True + task_block_loop.finished = True + + # Run 'Begin Routine' code from task_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + task_trial_loop.addData('ISI', thisISI) + + task_centerImg.setImage(middleStim) + task_rightImg1.setImage(rightStim1) + task_rightImg2.setImage(rightStim2) + task_leftImg1.setImage(leftStim1) + task_leftImg2.setImage(leftStim1) + task_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from task_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + task_stim_keyResp.keys = [] + task_stim_keyResp.rt = [] + _task_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from task_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + task_stimRoutineComponents = [task_centerImg, task_rightImg1, task_rightImg2, task_leftImg1, task_leftImg2, task_fixImg, task_stim_keyResp] + for thisComponent in task_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_centerImg* updates + if task_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_centerImg.frameNStart = frameN # exact frame index + task_centerImg.tStart = t # local t and not account for scr refresh + task_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.started') + task_centerImg.setAutoDraw(True) + if task_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_centerImg.tStop = t # not accounting for scr refresh + task_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.stopped') + task_centerImg.setAutoDraw(False) + + # *task_rightImg1* updates + if task_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg1.frameNStart = frameN # exact frame index + task_rightImg1.tStart = t # local t and not account for scr refresh + task_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.started') + task_rightImg1.setAutoDraw(True) + if task_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg1.tStop = t # not accounting for scr refresh + task_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.stopped') + task_rightImg1.setAutoDraw(False) + + # *task_rightImg2* updates + if task_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg2.frameNStart = frameN # exact frame index + task_rightImg2.tStart = t # local t and not account for scr refresh + task_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.started') + task_rightImg2.setAutoDraw(True) + if task_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg2.tStop = t # not accounting for scr refresh + task_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.stopped') + task_rightImg2.setAutoDraw(False) + + # *task_leftImg1* updates + if task_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg1.frameNStart = frameN # exact frame index + task_leftImg1.tStart = t # local t and not account for scr refresh + task_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.started') + task_leftImg1.setAutoDraw(True) + if task_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg1.tStop = t # not accounting for scr refresh + task_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.stopped') + task_leftImg1.setAutoDraw(False) + + # *task_leftImg2* updates + if task_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg2.frameNStart = frameN # exact frame index + task_leftImg2.tStart = t # local t and not account for scr refresh + task_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.started') + task_leftImg2.setAutoDraw(True) + if task_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg2.tStop = t # not accounting for scr refresh + task_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.stopped') + task_leftImg2.setAutoDraw(False) + + # *task_fixImg* updates + if task_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_fixImg.frameNStart = frameN # exact frame index + task_fixImg.tStart = t # local t and not account for scr refresh + task_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.started') + task_fixImg.setAutoDraw(True) + if task_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_fixImg.tStop = t # not accounting for scr refresh + task_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.stopped') + task_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from task_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if task_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 41: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x29]) #hexcode = 41; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 42: + stimTriggerSent = True + port.write([0x2A]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 43: + stimTriggerSent = True + port.write([0x2B]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 44: + stimTriggerSent = True + port.write([0x2C]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 51: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x33]) #hexcode = 51; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 52: + stimTriggerSent = True + port.write([0x34]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 53: + stimTriggerSent = True + port.write([0x35]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 54: + stimTriggerSent = True + port.write([0x36]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *task_stim_keyResp* updates + waitOnFlip = False + if task_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_stim_keyResp.frameNStart = frameN # exact frame index + task_stim_keyResp.tStart = t # local t and not account for scr refresh + task_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.started') + task_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_stim_keyResp.tStop = t # not accounting for scr refresh + task_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.stopped') + task_stim_keyResp.status = FINISHED + if task_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _task_stim_keyResp_allKeys.extend(theseKeys) + if len(_task_stim_keyResp_allKeys): + task_stim_keyResp.keys = [key.name for key in _task_stim_keyResp_allKeys] # storing all keys + task_stim_keyResp.rt = [key.rt for key in _task_stim_keyResp_allKeys] + # Run 'Each Frame' code from task_respTrigger_code + if task_stim_keyResp.keys and len(task_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(task_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(task_stim_keyResp.keys) < 2: #if this is the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(task_stim_keyResp.keys) >= 2: #if this is NOT the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_stimRoutine" --- + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_stim_keyResp.keys in ['', [], None]: # No response was made + task_stim_keyResp.keys = None + task_trial_loop.addData('task_stim_keyResp.keys',task_stim_keyResp.keys) + if task_stim_keyResp.keys != None: # we had a response + task_trial_loop.addData('task_stim_keyResp.rt', task_stim_keyResp.rt) + # Run 'End Routine' code from task_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from task_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if task_stim_keyResp.keys: #if at least one response was made this trial + if task_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif task_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + task_trial_loop.addData('accuracy', accuracy) + # the Routine "task_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_trial_loop' + + + # --- Prepare to start Routine "task_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code_3 + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + # Run 'Begin Routine' code from task_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockCounter < 10: + if blockAcc >= .75: + if blockAcc < .9: + blockFeed = 'Good job' + blockFeedCat = 1 + elif blockAcc >= .9: + blockFeed = 'Respond faster' + blockFeedCat = 2 + elif blockAcc < .75: + blockFeed = 'Respond more accurately' + blockFeedCat = 3 + elif blockCounter == 10: + 'You have completed all blocks' + + # save this block's feedback to our output file + task_trial_loop.addData('blockFeedCat', blockFeedCat) + + #reset the following variables to zero before next block starts + trialNum = 0 + numCorr = 0 + task_blockFeed_text.setText(blockFeed) + task_blockFeed_text2.setText('Press the right button to continue') + task_blockFeed_keyResp.keys = [] + task_blockFeed_keyResp.rt = [] + _task_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + task_blockFeedComponents = [task_blockFeed_text, task_blackFeed_text3, task_blockFeed_text2, task_blockFeed_keyResp] + for thisComponent in task_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockFeed_text* updates + if task_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text.frameNStart = frameN # exact frame index + task_blockFeed_text.tStart = t # local t and not account for scr refresh + task_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_text.started') + task_blockFeed_text.setAutoDraw(True) + + # *task_blackFeed_text3* updates + if task_blackFeed_text3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blackFeed_text3.frameNStart = frameN # exact frame index + task_blackFeed_text3.tStart = t # local t and not account for scr refresh + task_blackFeed_text3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blackFeed_text3, 'tStartRefresh') # time at next scr refresh + task_blackFeed_text3.setAutoDraw(True) + if task_blackFeed_text3.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_blackFeed_text3.tStartRefresh + 10-frameTolerance: + # keep track of stop time/frame for later + task_blackFeed_text3.tStop = t # not accounting for scr refresh + task_blackFeed_text3.frameNStop = frameN # exact frame index + task_blackFeed_text3.setAutoDraw(False) + + # *task_blockFeed_text2* updates + if task_blockFeed_text2.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text2.frameNStart = frameN # exact frame index + task_blockFeed_text2.tStart = t # local t and not account for scr refresh + task_blockFeed_text2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text2, 'tStartRefresh') # time at next scr refresh + task_blockFeed_text2.setAutoDraw(True) + + # *task_blockFeed_keyResp* updates + waitOnFlip = False + if task_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_keyResp.frameNStart = frameN # exact frame index + task_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + task_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_keyResp.started') + task_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockFeed_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_task_blockFeed_keyResp_allKeys): + task_blockFeed_keyResp.keys = _task_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + task_blockFeed_keyResp.rt = _task_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockFeed" --- + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockFeed_keyResp.keys in ['', [], None]: # No response was made + task_blockFeed_keyResp.keys = None + task_block_loop.addData('task_blockFeed_keyResp.keys',task_blockFeed_keyResp.keys) + if task_blockFeed_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockFeed_keyResp.rt', task_blockFeed_keyResp.rt) + # the Routine "task_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_block_loop' + + + # --- Prepare to start Routine "task_conditionComplete" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + conditionComplete_key_resp.keys = [] + conditionComplete_key_resp.rt = [] + _conditionComplete_key_resp_allKeys = [] + # keep track of which components have finished + task_conditionCompleteComponents = [conditionComplete_text, conditionComplete_key_resp] + for thisComponent in task_conditionCompleteComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_conditionComplete" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *conditionComplete_text* updates + if conditionComplete_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_text.frameNStart = frameN # exact frame index + conditionComplete_text.tStart = t # local t and not account for scr refresh + conditionComplete_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_text, 'tStartRefresh') # time at next scr refresh + conditionComplete_text.setAutoDraw(True) + + # *conditionComplete_key_resp* updates + waitOnFlip = False + if conditionComplete_key_resp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_key_resp.frameNStart = frameN # exact frame index + conditionComplete_key_resp.tStart = t # local t and not account for scr refresh + conditionComplete_key_resp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_key_resp, 'tStartRefresh') # time at next scr refresh + conditionComplete_key_resp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(conditionComplete_key_resp.clock.reset) # t=0 on next screen flip + win.callOnFlip(conditionComplete_key_resp.clearEvents, eventType='keyboard') # clear events on next screen flip + if conditionComplete_key_resp.status == STARTED and not waitOnFlip: + theseKeys = conditionComplete_key_resp.getKeys(keyList=['c'], waitRelease=False) + _conditionComplete_key_resp_allKeys.extend(theseKeys) + if len(_conditionComplete_key_resp_allKeys): + conditionComplete_key_resp.keys = _conditionComplete_key_resp_allKeys[-1].name # just the last key pressed + conditionComplete_key_resp.rt = _conditionComplete_key_resp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_conditionComplete" --- + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if conditionComplete_key_resp.keys in ['', [], None]: # No response was made + conditionComplete_key_resp.keys = None + task_condition_loop.addData('conditionComplete_key_resp.keys',conditionComplete_key_resp.keys) + if conditionComplete_key_resp.keys != None: # we had a response + task_condition_loop.addData('conditionComplete_key_resp.rt', conditionComplete_key_resp.rt) + # the Routine "task_conditionComplete" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 1.0 repeats of 'task_condition_loop' + +# Run 'End Experiment' code from setup_code +win.mouseVisible = True #make the mouse cursor visable again +port.write([0xFF]) #set port values back to default state (FF) +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else +port.close() #close port opened at start of exp + +# --- End experiment --- +# Flip one final time so any remaining win.callOnFlip() +# and win.timeOnFlip() tasks get executed before quitting +win.flip() + +# these shouldn't be strictly necessary (should auto-save) +thisExp.saveAsWideText(filename+'.csv', delim='auto') +thisExp.saveAsPickle(filename) +logging.flush() +# make sure everything is closed down +if eyetracker: + eyetracker.setConnectionState(False) +thisExp.abort() # or data files will save again on exit +win.close() +core.quit() diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0_lastrun.py b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0_lastrun.py new file mode 100755 index 0000000..91d128e --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/arrow-alert_v0_lastrun.py @@ -0,0 +1,3985 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5), + on April 05, 2023, at 12:24 +If you publish work using this script the most relevant publication is: + + Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) + PsychoPy2: Experiments in behavior made easy Behav Res 51: 195. + https://doi.org/10.3758/s13428-018-01193-y + +""" + +# --- Import packages --- +from psychopy import locale_setup +from psychopy import prefs +prefs.hardware['audioLib'] = 'ptb' +from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout +from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, + STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) + +import numpy as np # whole numpy lib is available, prepend 'np.' +from numpy import (sin, cos, tan, log, log10, pi, average, + sqrt, std, deg2rad, rad2deg, linspace, asarray) +from numpy.random import random, randint, normal, shuffle, choice as randchoice +import os # handy system and path functions +import sys # to get file system encoding + +import psychopy.iohub as io +from psychopy.hardware import keyboard + + + +# Ensure that relative paths start from the same directory as this script +_thisDir = os.path.dirname(os.path.abspath(__file__)) +os.chdir(_thisDir) +# Store info about the experiment session +psychopyVersion = '2022.2.5' +expName = 'Arrow_Alert' # from the Builder filename that created this script +expInfo = { + 'id': '1', + 'counterbalance': ['A1', 'A2', 'B1', 'B2', 'C1', 'C2'], + 'session': '1', + 'run': '1', +} +# --- Show participant info dialog -- +dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName) +if dlg.OK == False: + core.quit() # user pressed cancel +expInfo['date'] = data.getDateStr() # add a simple timestamp +expInfo['expName'] = expName +expInfo['psychopyVersion'] = psychopyVersion + +# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc +filename = _thisDir + os.sep + u'data/%s_%s_%s_%s_%s_%s' % (expInfo['id'], expInfo['counterbalance'], expInfo['session'], expInfo['run'], expName, expInfo['date']) + +# An ExperimentHandler isn't essential but helps with data saving +thisExp = data.ExperimentHandler(name=expName, version='', + extraInfo=expInfo, runtimeInfo=None, + originPath='C:\\Users\\NDCLab\\Desktop\\Experiments\\thrive\\arrow-alert-v0 -trial_level_triggerLoss\\arrow-alert_v0_lastrun.py', + savePickle=True, saveWideText=True, + dataFileName=filename) +# save a log file for detail verbose info +logFile = logging.LogFile(filename+'.log', level=logging.DEBUG) +logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file + +endExpNow = False # flag for 'escape' or other condition => quit the exp +frameTolerance = 0.001 # how close to onset before 'same' frame + +# Start Code - component code to be run after the window creation + +# --- Setup the Window --- +win = visual.Window( + size=[1920, 1080], fullscr=True, screen=0, + winType='pyglet', allowStencil=False, + monitor='testMonitor', color=[-1,-1,-1], colorSpace='rgb', + blendMode='avg', useFBO=True, + units='height') +win.mouseVisible = False +# store frame rate of monitor if we can measure it +expInfo['frameRate'] = win.getActualFrameRate() +if expInfo['frameRate'] != None: + frameDur = 1.0 / round(expInfo['frameRate']) +else: + frameDur = 1.0 / 60.0 # could not measure, so guess +# --- Setup input devices --- +ioConfig = {} + +# Setup iohub keyboard +ioConfig['Keyboard'] = dict(use_keymap='psychopy') + +ioSession = '1' +if 'session' in expInfo: + ioSession = str(expInfo['session']) +ioServer = io.launchHubServer(window=win, **ioConfig) +eyetracker = None + +# create a default keyboard (e.g. to check for escape) +defaultKeyboard = keyboard.Keyboard(backend='iohub') + +# --- Initialize components for Routine "JS_code" --- + +# --- Initialize components for Routine "setup" --- +# Run 'Begin Experiment' code from setup_code +import serial #used for sending eeg triggers +import time #indirerctly used for sending eeg triggers (how long to wait before clearing port) + +win.mouseVisible = False #hide mouse cursor +port = serial.Serial('COM4') #open specified port (COM4) for sending eeg triggers to +# Kia: The following 2 lines are preventing the trigger loss +port.close() +port.open() + +PulseWidth = 0.002 #how long to wait before clearing port after sending trigger (2 ms is sufficient at 1000 hz sampling rate) + +port.write([0x00]) #clear serial port +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else + +# --- Initialize components for Routine "welcome" --- +welcome_text = visual.TextStim(win=win, name='welcome_text', + text='Arrow Alert Game\n\nWelcome to the arrow alert game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\n\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +welcome_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "welcome2" --- +welcome_text_2 = visual.TextStim(win=win, name='welcome_text_2', + text='Arrow Alert Game\n\nWelcome to the arrow alert game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\nPress the right button to continue\n', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +welcome_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight" --- +instructRight_text = visual.TextStim(win=win, name='instructRight_text', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg = visual.ImageStim( + win=win, + name='instructRight_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1 = visual.ImageStim( + win=win, + name='instructRight_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1 = visual.ImageStim( + win=win, + name='instructRight_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight_2" --- +instructRight_text_2 = visual.TextStim(win=win, name='instructRight_text_2', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg_2 = visual.ImageStim( + win=win, + name='instructRight_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft" --- +instructLeft_text = visual.TextStim(win=win, name='instructLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg = visual.ImageStim( + win=win, + name='instructLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft_2" --- +instructLeft_text_2 = visual.TextStim(win=win, name='instructLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight" --- +instructInconRight_text = visual.TextStim(win=win, name='instructInconRight_text', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg = visual.ImageStim( + win=win, + name='instructIncon_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight_2" --- +instructInconRight_text_2 = visual.TextStim(win=win, name='instructInconRight_text_2', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond based on the direction of the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg_2 = visual.ImageStim( + win=win, + name='instructIncon_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft" --- +instructInconLeft_text = visual.TextStim(win=win, name='instructInconLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft_2" --- +instructInconLeft_text_2 = visual.TextStim(win=win, name='instructInconLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders" --- +# Run 'Begin Experiment' code from prac_initAcc_code +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText = visual.TextStim(win=win, name='prac_blockText', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text = visual.TextStim(win=win, name='prac_reminder_text', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders_2" --- +# Run 'Begin Experiment' code from prac_initAcc_code_2 +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText_2 = visual.TextStim(win=win, name='prac_blockText_2', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text_2 = visual.TextStim(win=win, name='prac_reminder_text_2', + text='You will now practice responding to the arrows. Remember to always respond to the direction of the MIDDLE arrow.\n\nRespond as quickly as you can without making mistakes.\n\nTo get ready, rest your right and left thumbs on the right and left buttons, then press the right button when you are ready to begin.\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) + +# --- Initialize components for Routine "prac_stimRoutine" --- +# Run 'Begin Experiment' code from prac_isi_code +#initialize the thisISI variable +thisISI = 0 +prac_centerImg = visual.ImageStim( + win=win, + name='prac_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=[.4, .4], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +prac_rightImg1 = visual.ImageStim( + win=win, + name='prac_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +prac_rightImg2 = visual.ImageStim( + win=win, + name='prac_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +prac_leftImg1 = visual.ImageStim( + win=win, + name='prac_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=[.04, .04], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +prac_leftImg2 = visual.ImageStim( + win=win, + name='prac_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +prac_fixImg = visual.ImageStim( + win=win, + name='prac_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-7.0) +prac_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockFeed" --- +prac_blockFeed_text = visual.TextStim(win=win, name='prac_blockFeed_text', + text='', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +prac_pressContinue = visual.TextStim(win=win, name='prac_pressContinue', + text='Experimenter: press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +prac_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_condition" --- +# Run 'Begin Experiment' code from condition_init_blockCounter +#initialize the following variables at the start of the condition +blockCounter = 0 + +# To skip routines in case of "observe other", +# we will need to use endTask. +# see begin routine tab for more. +endTask = 0 +condition_whichCondition_text = visual.TextStim(win=win, name='condition_whichCondition_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +condition_reminder_text = visual.TextStim(win=win, name='condition_reminder_text', + text='Experimenter: provide instructions and then press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.8, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +condition_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockReminders" --- +task_blockText = visual.TextStim(win=win, name='task_blockText', + text='', + font='Arial', + pos=(0, .1), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +task_blockReminders_text = visual.TextStim(win=win, name='task_blockReminders_text', + text='Remember to limit blinking to about about once every ten seconds (or less).\n\nPlease try to relax the muscles in your face, neck, and shoulders. \n\nRest your right and left thumbs on the right and left buttons. When you are ready, press the right button to begin.\n', + font='Arial', + pos=(0, -.25), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blockReminders_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) + +# --- Initialize components for Routine "task_stimRoutine" --- +# Run 'Begin Experiment' code from task_isi_code +#no need to initialize thisISI, as already done in practice code snippit +task_centerImg = visual.ImageStim( + win=win, + name='task_centerImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +task_rightImg1 = visual.ImageStim( + win=win, + name='task_rightImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +task_rightImg2 = visual.ImageStim( + win=win, + name='task_rightImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +task_leftImg1 = visual.ImageStim( + win=win, + name='task_leftImg1', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.05, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +task_leftImg2 = visual.ImageStim( + win=win, + name='task_leftImg2', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.1, 0), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-7.0) +task_fixImg = visual.ImageStim( + win=win, + name='task_fixImg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.05), size=(.015, .015), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-8.0) +task_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockFeed" --- +task_blockFeed_text = visual.TextStim(win=win, name='task_blockFeed_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blackFeed_text3 = visual.TextStim(win=win, name='task_blackFeed_text3', + text='Please wait', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-3.0); +task_blockFeed_text2 = visual.TextStim(win=win, name='task_blockFeed_text2', + text='', + font='Arial', + pos=(0, -0.3), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-4.0); +task_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_conditionComplete" --- +conditionComplete_text = visual.TextStim(win=win, name='conditionComplete_text', + text='Please ring bell and wait for experimenter to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=0.0); +conditionComplete_key_resp = keyboard.Keyboard() + +# Create some handy timers +globalClock = core.Clock() # to track the time since experiment started +routineTimer = core.Clock() # to track time remaining of each (possibly non-slip) routine + +# --- Prepare to start Routine "JS_code" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +JS_codeComponents = [] +for thisComponent in JS_codeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "JS_code" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "JS_code" --- +for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "JS_code" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "setup" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +setupComponents = [] +for thisComponent in setupComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "setup" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in setupComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "setup" --- +for thisComponent in setupComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "setup" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp.keys = [] +welcome_keyResp.rt = [] +_welcome_keyResp_allKeys = [] +# keep track of which components have finished +welcomeComponents = [welcome_text, welcome_keyResp] +for thisComponent in welcomeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_text* updates + if welcome_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text.frameNStart = frameN # exact frame index + welcome_text.tStart = t # local t and not account for scr refresh + welcome_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text, 'tStartRefresh') # time at next scr refresh + welcome_text.setAutoDraw(True) + + # *welcome_keyResp* updates + waitOnFlip = False + if welcome_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp.frameNStart = frameN # exact frame index + welcome_keyResp.tStart = t # local t and not account for scr refresh + welcome_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp, 'tStartRefresh') # time at next scr refresh + welcome_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp.getKeys(keyList=['c'], waitRelease=False) + _welcome_keyResp_allKeys.extend(theseKeys) + if len(_welcome_keyResp_allKeys): + welcome_keyResp.keys = _welcome_keyResp_allKeys[-1].name # just the last key pressed + welcome_keyResp.rt = _welcome_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcomeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome" --- +for thisComponent in welcomeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp_2.keys = [] +welcome_keyResp_2.rt = [] +_welcome_keyResp_2_allKeys = [] +# keep track of which components have finished +welcome2Components = [welcome_text_2, welcome_keyResp_2] +for thisComponent in welcome2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_text_2* updates + if welcome_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text_2.frameNStart = frameN # exact frame index + welcome_text_2.tStart = t # local t and not account for scr refresh + welcome_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text_2, 'tStartRefresh') # time at next scr refresh + welcome_text_2.setAutoDraw(True) + + # *welcome_keyResp_2* updates + waitOnFlip = False + if welcome_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp_2.frameNStart = frameN # exact frame index + welcome_keyResp_2.tStart = t # local t and not account for scr refresh + welcome_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp_2, 'tStartRefresh') # time at next scr refresh + welcome_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _welcome_keyResp_2_allKeys.extend(theseKeys) + if len(_welcome_keyResp_2_allKeys): + welcome_keyResp_2.keys = _welcome_keyResp_2_allKeys[-1].name # just the last key pressed + welcome_keyResp_2.rt = _welcome_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcome2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome2" --- +for thisComponent in welcome2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp.keys = [] +insructRight_keyResp.rt = [] +_insructRight_keyResp_allKeys = [] +# keep track of which components have finished +instructRightComponents = [instructRight_text, instructRight_centerImg, instructRight_rightImg1, instructRight_rightImg2, instructRight_leftImg1, instructRight_leftImg2, insructRight_keyResp] +for thisComponent in instructRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text* updates + if instructRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text.frameNStart = frameN # exact frame index + instructRight_text.tStart = t # local t and not account for scr refresh + instructRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text, 'tStartRefresh') # time at next scr refresh + instructRight_text.setAutoDraw(True) + + # *instructRight_centerImg* updates + if instructRight_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg.frameNStart = frameN # exact frame index + instructRight_centerImg.tStart = t # local t and not account for scr refresh + instructRight_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg.setAutoDraw(True) + + # *instructRight_rightImg1* updates + if instructRight_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1.frameNStart = frameN # exact frame index + instructRight_rightImg1.tStart = t # local t and not account for scr refresh + instructRight_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1.setAutoDraw(True) + + # *instructRight_rightImg2* updates + if instructRight_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2.frameNStart = frameN # exact frame index + instructRight_rightImg2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2.setAutoDraw(True) + + # *instructRight_leftImg1* updates + if instructRight_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1.frameNStart = frameN # exact frame index + instructRight_leftImg1.tStart = t # local t and not account for scr refresh + instructRight_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1.setAutoDraw(True) + + # *instructRight_leftImg2* updates + if instructRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2.frameNStart = frameN # exact frame index + instructRight_leftImg2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2.setAutoDraw(True) + + # *insructRight_keyResp* updates + waitOnFlip = False + if insructRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp.frameNStart = frameN # exact frame index + insructRight_keyResp.tStart = t # local t and not account for scr refresh + insructRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructRight_keyResp_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_allKeys): + insructRight_keyResp.keys = _insructRight_keyResp_allKeys[-1].name # just the last key pressed + insructRight_keyResp.rt = _insructRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight" --- +for thisComponent in instructRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp_2.keys = [] +insructRight_keyResp_2.rt = [] +_insructRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructRight_2Components = [instructRight_text_2, instructRight_centerImg_2, instructRight_rightImg1_2, instructRight_rightImg2_2, instructRight_leftImg1_2, instructRight_leftImg2_2, insructRight_keyResp_2] +for thisComponent in instructRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text_2* updates + if instructRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text_2.frameNStart = frameN # exact frame index + instructRight_text_2.tStart = t # local t and not account for scr refresh + instructRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text_2, 'tStartRefresh') # time at next scr refresh + instructRight_text_2.setAutoDraw(True) + + # *instructRight_centerImg_2* updates + if instructRight_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg_2.frameNStart = frameN # exact frame index + instructRight_centerImg_2.tStart = t # local t and not account for scr refresh + instructRight_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg_2.setAutoDraw(True) + + # *instructRight_rightImg1_2* updates + if instructRight_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1_2.frameNStart = frameN # exact frame index + instructRight_rightImg1_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1_2.setAutoDraw(True) + + # *instructRight_rightImg2_2* updates + if instructRight_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2_2.frameNStart = frameN # exact frame index + instructRight_rightImg2_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2_2.setAutoDraw(True) + + # *instructRight_leftImg1_2* updates + if instructRight_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1_2.frameNStart = frameN # exact frame index + instructRight_leftImg1_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1_2.setAutoDraw(True) + + # *instructRight_leftImg2_2* updates + if instructRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2_2.frameNStart = frameN # exact frame index + instructRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2_2.setAutoDraw(True) + + # *insructRight_keyResp_2* updates + waitOnFlip = False + if insructRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp_2.frameNStart = frameN # exact frame index + insructRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_2_allKeys): + insructRight_keyResp_2.keys = _insructRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructRight_keyResp_2.rt = _insructRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight_2" --- +for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp.keys = [] +instructLeft_keyResp.rt = [] +_instructLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructLeftComponents = [instructLeft_text, instructLeft_centerImg, instructLeft_rightImg1, instructLeft_rightImg2, instructLeft_leftImg1, instructLeft_leftImg2, instructLeft_keyResp] +for thisComponent in instructLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text* updates + if instructLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text.frameNStart = frameN # exact frame index + instructLeft_text.tStart = t # local t and not account for scr refresh + instructLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text, 'tStartRefresh') # time at next scr refresh + instructLeft_text.setAutoDraw(True) + + # *instructLeft_centerImg* updates + if instructLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg.frameNStart = frameN # exact frame index + instructLeft_centerImg.tStart = t # local t and not account for scr refresh + instructLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg.setAutoDraw(True) + + # *instructLeft_rightImg1* updates + if instructLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1.frameNStart = frameN # exact frame index + instructLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1.setAutoDraw(True) + + # *instructLeft_rightImg2* updates + if instructLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2.frameNStart = frameN # exact frame index + instructLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2.setAutoDraw(True) + + # *instructLeft_leftImg1* updates + if instructLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1.frameNStart = frameN # exact frame index + instructLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1.setAutoDraw(True) + + # *instructLeft_leftImg2* updates + if instructLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2.frameNStart = frameN # exact frame index + instructLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2.setAutoDraw(True) + + # *instructLeft_keyResp* updates + waitOnFlip = False + if instructLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp.frameNStart = frameN # exact frame index + instructLeft_keyResp.tStart = t # local t and not account for scr refresh + instructLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_allKeys): + instructLeft_keyResp.keys = _instructLeft_keyResp_allKeys[-1].name # just the last key pressed + instructLeft_keyResp.rt = _instructLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft" --- +for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp_2.keys = [] +instructLeft_keyResp_2.rt = [] +_instructLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructLeft_2Components = [instructLeft_text_2, instructLeft_centerImg_2, instructLeft_rightImg1_2, instructLeft_rightImg2_2, instructLeft_leftImg1_2, instructLeft_leftImg2_2, instructLeft_keyResp_2] +for thisComponent in instructLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text_2* updates + if instructLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text_2.frameNStart = frameN # exact frame index + instructLeft_text_2.tStart = t # local t and not account for scr refresh + instructLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructLeft_text_2.setAutoDraw(True) + + # *instructLeft_centerImg_2* updates + if instructLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg_2.frameNStart = frameN # exact frame index + instructLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg_2.setAutoDraw(True) + + # *instructLeft_rightImg1_2* updates + if instructLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1_2.setAutoDraw(True) + + # *instructLeft_rightImg2_2* updates + if instructLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2_2.setAutoDraw(True) + + # *instructLeft_leftImg1_2* updates + if instructLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1_2.setAutoDraw(True) + + # *instructLeft_leftImg2_2* updates + if instructLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2_2.setAutoDraw(True) + + # *instructLeft_keyResp_2* updates + waitOnFlip = False + if instructLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp_2.frameNStart = frameN # exact frame index + instructLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_2_allKeys): + instructLeft_keyResp_2.keys = _instructLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructLeft_keyResp_2.rt = _instructLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft_2" --- +for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp.keys = [] +insructInconRight_keyResp.rt = [] +_insructInconRight_keyResp_allKeys = [] +# keep track of which components have finished +instructInconRightComponents = [instructInconRight_text, instructIncon_centerImg, instructIncon_rightImg1, instructIncon_rightImg2, instructIncon_leftImg1, instructInconRight_leftImg2, insructInconRight_keyResp] +for thisComponent in instructInconRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text* updates + if instructInconRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text.frameNStart = frameN # exact frame index + instructInconRight_text.tStart = t # local t and not account for scr refresh + instructInconRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text, 'tStartRefresh') # time at next scr refresh + instructInconRight_text.setAutoDraw(True) + + # *instructIncon_centerImg* updates + if instructIncon_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg.frameNStart = frameN # exact frame index + instructIncon_centerImg.tStart = t # local t and not account for scr refresh + instructIncon_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg.setAutoDraw(True) + + # *instructIncon_rightImg1* updates + if instructIncon_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1.frameNStart = frameN # exact frame index + instructIncon_rightImg1.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1.setAutoDraw(True) + + # *instructIncon_rightImg2* updates + if instructIncon_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2.frameNStart = frameN # exact frame index + instructIncon_rightImg2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2.setAutoDraw(True) + + # *instructIncon_leftImg1* updates + if instructIncon_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1.frameNStart = frameN # exact frame index + instructIncon_leftImg1.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1.setAutoDraw(True) + + # *instructInconRight_leftImg2* updates + if instructInconRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2.setAutoDraw(True) + + # *insructInconRight_keyResp* updates + waitOnFlip = False + if insructInconRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp.frameNStart = frameN # exact frame index + insructInconRight_keyResp.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructInconRight_keyResp_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_allKeys): + insructInconRight_keyResp.keys = _insructInconRight_keyResp_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp.rt = _insructInconRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight" --- +for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp_2.keys = [] +insructInconRight_keyResp_2.rt = [] +_insructInconRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconRight_2Components = [instructInconRight_text_2, instructIncon_centerImg_2, instructIncon_rightImg1_2, instructIncon_rightImg2_2, instructIncon_leftImg1_2, instructInconRight_leftImg2_2, insructInconRight_keyResp_2] +for thisComponent in instructInconRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text_2* updates + if instructInconRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text_2.frameNStart = frameN # exact frame index + instructInconRight_text_2.tStart = t # local t and not account for scr refresh + instructInconRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_text_2.setAutoDraw(True) + + # *instructIncon_centerImg_2* updates + if instructIncon_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg_2.frameNStart = frameN # exact frame index + instructIncon_centerImg_2.tStart = t # local t and not account for scr refresh + instructIncon_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg_2.setAutoDraw(True) + + # *instructIncon_rightImg1_2* updates + if instructIncon_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1_2.frameNStart = frameN # exact frame index + instructIncon_rightImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1_2.setAutoDraw(True) + + # *instructIncon_rightImg2_2* updates + if instructIncon_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2_2.frameNStart = frameN # exact frame index + instructIncon_rightImg2_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2_2.setAutoDraw(True) + + # *instructIncon_leftImg1_2* updates + if instructIncon_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1_2.frameNStart = frameN # exact frame index + instructIncon_leftImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1_2.setAutoDraw(True) + + # *instructInconRight_leftImg2_2* updates + if instructInconRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2_2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2_2.setAutoDraw(True) + + # *insructInconRight_keyResp_2* updates + waitOnFlip = False + if insructInconRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp_2.frameNStart = frameN # exact frame index + insructInconRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructInconRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_2_allKeys): + insructInconRight_keyResp_2.keys = _insructInconRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp_2.rt = _insructInconRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight_2" --- +for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp.keys = [] +instructInconLeft_keyResp.rt = [] +_instructInconLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructInconLeftComponents = [instructInconLeft_text, instructInconLeft_centerImg, instructInconLeft_rightImg1, instructInconLeft_rightImg2, instructInconLeft_leftImg1, instructInconLeft_leftImg2, instructInconLeft_keyResp] +for thisComponent in instructInconLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text* updates + if instructInconLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text.frameNStart = frameN # exact frame index + instructInconLeft_text.tStart = t # local t and not account for scr refresh + instructInconLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text.setAutoDraw(True) + + # *instructInconLeft_centerImg* updates + if instructInconLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg.frameNStart = frameN # exact frame index + instructInconLeft_centerImg.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg.setAutoDraw(True) + + # *instructInconLeft_rightImg1* updates + if instructInconLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1.setAutoDraw(True) + + # *instructInconLeft_rightImg2* updates + if instructInconLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2.setAutoDraw(True) + + # *instructInconLeft_leftImg1* updates + if instructInconLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1.setAutoDraw(True) + + # *instructInconLeft_leftImg2* updates + if instructInconLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2.setAutoDraw(True) + + # *instructInconLeft_keyResp* updates + waitOnFlip = False + if instructInconLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp.frameNStart = frameN # exact frame index + instructInconLeft_keyResp.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructInconLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_allKeys): + instructInconLeft_keyResp.keys = _instructInconLeft_keyResp_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp.rt = _instructInconLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft" --- +for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp_2.keys = [] +instructInconLeft_keyResp_2.rt = [] +_instructInconLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconLeft_2Components = [instructInconLeft_text_2, instructInconLeft_centerImg_2, instructInconLeft_rightImg1_2, instructInconLeft_rightImg2_2, instructInconLeft_leftImg1_2, instructInconLeft_leftImg2_2, instructInconLeft_keyResp_2] +for thisComponent in instructInconLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text_2* updates + if instructInconLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text_2.frameNStart = frameN # exact frame index + instructInconLeft_text_2.tStart = t # local t and not account for scr refresh + instructInconLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text_2.setAutoDraw(True) + + # *instructInconLeft_centerImg_2* updates + if instructInconLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg_2.frameNStart = frameN # exact frame index + instructInconLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg_2.setAutoDraw(True) + + # *instructInconLeft_rightImg1_2* updates + if instructInconLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1_2.setAutoDraw(True) + + # *instructInconLeft_rightImg2_2* updates + if instructInconLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2_2.setAutoDraw(True) + + # *instructInconLeft_leftImg1_2* updates + if instructInconLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1_2.setAutoDraw(True) + + # *instructInconLeft_leftImg2_2* updates + if instructInconLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2_2.setAutoDraw(True) + + # *instructInconLeft_keyResp_2* updates + waitOnFlip = False + if instructInconLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp_2.frameNStart = frameN # exact frame index + instructInconLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructInconLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_2_allKeys): + instructInconLeft_keyResp_2.keys = _instructInconLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp_2.rt = _instructInconLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft_2" --- +for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# set up handler to look after randomisation of conditions etc +prac_block_loop = data.TrialHandler(nReps=99, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='prac_block_loop') +thisExp.addLoop(prac_block_loop) # add the loop to the experiment +thisPrac_block_loop = prac_block_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) +if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + +for thisPrac_block_loop in prac_block_loop: + currentLoop = prac_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) + if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp.keys = [] + prac_reminder_keyResp.rt = [] + _prac_reminder_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockRemindersComponents = [prac_blockText, prac_reminder_text, prac_reminder_keyResp] + for thisComponent in prac_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText* updates + if prac_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText.frameNStart = frameN # exact frame index + prac_blockText.tStart = t # local t and not account for scr refresh + prac_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText.started') + prac_blockText.setAutoDraw(True) + + # *prac_reminder_text* updates + if prac_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text.frameNStart = frameN # exact frame index + prac_reminder_text.tStart = t # local t and not account for scr refresh + prac_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text.started') + prac_reminder_text.setAutoDraw(True) + + # *prac_reminder_keyResp* updates + waitOnFlip = False + if prac_reminder_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp.frameNStart = frameN # exact frame index + prac_reminder_keyResp.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp.started') + prac_reminder_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_reminder_keyResp_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_allKeys): + prac_reminder_keyResp.keys = _prac_reminder_keyResp_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp.rt = _prac_reminder_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders" --- + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp.keys in ['', [], None]: # No response was made + prac_reminder_keyResp.keys = None + prac_block_loop.addData('prac_reminder_keyResp.keys',prac_reminder_keyResp.keys) + if prac_reminder_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp.rt', prac_reminder_keyResp.rt) + # the Routine "prac_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "prac_blockReminders_2" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp_2.keys = [] + prac_reminder_keyResp_2.rt = [] + _prac_reminder_keyResp_2_allKeys = [] + # keep track of which components have finished + prac_blockReminders_2Components = [prac_blockText_2, prac_reminder_text_2, prac_reminder_keyResp_2] + for thisComponent in prac_blockReminders_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders_2" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText_2* updates + if prac_blockText_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText_2.frameNStart = frameN # exact frame index + prac_blockText_2.tStart = t # local t and not account for scr refresh + prac_blockText_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText_2.started') + prac_blockText_2.setAutoDraw(True) + + # *prac_reminder_text_2* updates + if prac_reminder_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text_2.frameNStart = frameN # exact frame index + prac_reminder_text_2.tStart = t # local t and not account for scr refresh + prac_reminder_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_text_2.started') + prac_reminder_text_2.setAutoDraw(True) + + # *prac_reminder_keyResp_2* updates + waitOnFlip = False + if prac_reminder_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp_2.frameNStart = frameN # exact frame index + prac_reminder_keyResp_2.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp_2.started') + prac_reminder_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _prac_reminder_keyResp_2_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_2_allKeys): + prac_reminder_keyResp_2.keys = _prac_reminder_keyResp_2_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp_2.rt = _prac_reminder_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders_2" --- + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_reminder_keyResp_2.keys in ['', [], None]: # No response was made + prac_reminder_keyResp_2.keys = None + prac_block_loop.addData('prac_reminder_keyResp_2.keys',prac_reminder_keyResp_2.keys) + if prac_reminder_keyResp_2.keys != None: # we had a response + prac_block_loop.addData('prac_reminder_keyResp_2.rt', prac_reminder_keyResp_2.rt) + # the Routine "prac_blockReminders_2" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + prac_trial_loop = data.TrialHandler(nReps=10, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions('prac_trials.xlsx'), + seed=None, name='prac_trial_loop') + thisExp.addLoop(prac_trial_loop) # add the loop to the experiment + thisPrac_trial_loop = prac_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + for thisPrac_trial_loop in prac_trial_loop: + currentLoop = prac_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from trigger_loss_code + # Kia: The following 2 lines are preventing the trigger loss + + + # Run 'Begin Routine' code from prac_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + prac_trial_loop.addData('ISI', thisISI) + + + # show in console for debugging + #print('thisISI: ', thisISI) + prac_centerImg.setImage(middleStim) + prac_rightImg1.setImage(rightStim1) + prac_rightImg2.setImage(rightStim2) + prac_leftImg1.setImage(leftStim1) + prac_leftImg2.setImage(leftStim1) + prac_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from prac_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + prac_stim_keyResp.keys = [] + prac_stim_keyResp.rt = [] + _prac_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from prac_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + prac_stimRoutineComponents = [prac_centerImg, prac_rightImg1, prac_rightImg2, prac_leftImg1, prac_leftImg2, prac_fixImg, prac_stim_keyResp] + for thisComponent in prac_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + # Run 'Each Frame' code from trigger_loss_code + try: + port.close() + port.open() + except: + print("could not open the port") + continue + + + # *prac_centerImg* updates + if prac_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_centerImg.frameNStart = frameN # exact frame index + prac_centerImg.tStart = t # local t and not account for scr refresh + prac_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.started') + prac_centerImg.setAutoDraw(True) + if prac_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_centerImg.tStop = t # not accounting for scr refresh + prac_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.stopped') + prac_centerImg.setAutoDraw(False) + + # *prac_rightImg1* updates + if prac_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg1.frameNStart = frameN # exact frame index + prac_rightImg1.tStart = t # local t and not account for scr refresh + prac_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.started') + prac_rightImg1.setAutoDraw(True) + if prac_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg1.tStop = t # not accounting for scr refresh + prac_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg1.stopped') + prac_rightImg1.setAutoDraw(False) + + # *prac_rightImg2* updates + if prac_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg2.frameNStart = frameN # exact frame index + prac_rightImg2.tStart = t # local t and not account for scr refresh + prac_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.started') + prac_rightImg2.setAutoDraw(True) + if prac_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg2.tStop = t # not accounting for scr refresh + prac_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_rightImg2.stopped') + prac_rightImg2.setAutoDraw(False) + + # *prac_leftImg1* updates + if prac_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg1.frameNStart = frameN # exact frame index + prac_leftImg1.tStart = t # local t and not account for scr refresh + prac_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.started') + prac_leftImg1.setAutoDraw(True) + if prac_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg1.tStop = t # not accounting for scr refresh + prac_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg1.stopped') + prac_leftImg1.setAutoDraw(False) + + # *prac_leftImg2* updates + if prac_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg2.frameNStart = frameN # exact frame index + prac_leftImg2.tStart = t # local t and not account for scr refresh + prac_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.started') + prac_leftImg2.setAutoDraw(True) + if prac_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg2.tStop = t # not accounting for scr refresh + prac_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_leftImg2.stopped') + prac_leftImg2.setAutoDraw(False) + + # *prac_fixImg* updates + if prac_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_fixImg.frameNStart = frameN # exact frame index + prac_fixImg.tStart = t # local t and not account for scr refresh + prac_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.started') + prac_fixImg.setAutoDraw(True) + if prac_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_fixImg.tStop = t # not accounting for scr refresh + prac_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_fixImg.stopped') + prac_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from prac_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if prac_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 1: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x01]) #hexcode = 1; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 2: + stimTriggerSent = True + port.write([0x02]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 3: + stimTriggerSent = True + port.write([0x03]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 4: + stimTriggerSent = True + port.write([0x04]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *prac_stim_keyResp* updates + waitOnFlip = False + if prac_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_stim_keyResp.frameNStart = frameN # exact frame index + prac_stim_keyResp.tStart = t # local t and not account for scr refresh + prac_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.started') + prac_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_stim_keyResp.tStop = t # not accounting for scr refresh + prac_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.stopped') + prac_stim_keyResp.status = FINISHED + if prac_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _prac_stim_keyResp_allKeys.extend(theseKeys) + if len(_prac_stim_keyResp_allKeys): + prac_stim_keyResp.keys = [key.name for key in _prac_stim_keyResp_allKeys] # storing all keys + prac_stim_keyResp.rt = [key.rt for key in _prac_stim_keyResp_allKeys] + # Run 'Each Frame' code from prac_respTrigger_code + if prac_stim_keyResp.keys and len(prac_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(prac_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(prac_stim_keyResp.keys) < 2: #if this is the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(prac_stim_keyResp.keys) >= 2: #if this is NOT the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_stimRoutine" --- + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_stim_keyResp.keys in ['', [], None]: # No response was made + prac_stim_keyResp.keys = None + prac_trial_loop.addData('prac_stim_keyResp.keys',prac_stim_keyResp.keys) + if prac_stim_keyResp.keys != None: # we had a response + prac_trial_loop.addData('prac_stim_keyResp.rt', prac_stim_keyResp.rt) + # Run 'End Routine' code from prac_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from prac_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if prac_stim_keyResp.keys: #if at least one response was made this trial + if prac_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif prac_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + prac_trial_loop.addData('accuracy', accuracy) + # the Routine "prac_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10 repeats of 'prac_trial_loop' + + + # --- Prepare to start Routine "prac_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockAcc >= .75: #if accuracy >= 75% then say practice is complete and end practice loop to continue to main exp + outPut = 'You will now play the real game' #feedback presented + prac_block_loop.finished = True #end practice loop to continue to main exp + elif blockAcc <= .75: #if accuracy < 75% then say that practice needs to be repeated and DO NOT end practice loop, instead, allow it to repeat + outPut = 'Please try the practice again' #feedback presented + prac_block_loop.finished = False #DO NOT end practice loop and allow to repeat + + #reset the following variables to zero before the next practice block starts + trialNum = 0 + numCorr = 0 + prac_blockFeed_text.setText(outPut) + prac_blockFeed_keyResp.keys = [] + prac_blockFeed_keyResp.rt = [] + _prac_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockFeedComponents = [prac_blockFeed_text, prac_pressContinue, prac_blockFeed_keyResp] + for thisComponent in prac_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockFeed_text* updates + if prac_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_text.frameNStart = frameN # exact frame index + prac_blockFeed_text.tStart = t # local t and not account for scr refresh + prac_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_text.started') + prac_blockFeed_text.setAutoDraw(True) + + # *prac_pressContinue* updates + if prac_pressContinue.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_pressContinue.frameNStart = frameN # exact frame index + prac_pressContinue.tStart = t # local t and not account for scr refresh + prac_pressContinue.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_pressContinue, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_pressContinue.started') + prac_pressContinue.setAutoDraw(True) + + # *prac_blockFeed_keyResp* updates + waitOnFlip = False + if prac_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_keyResp.frameNStart = frameN # exact frame index + prac_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + prac_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_keyResp.started') + prac_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_blockFeed_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_prac_blockFeed_keyResp_allKeys): + prac_blockFeed_keyResp.keys = _prac_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + prac_blockFeed_keyResp.rt = _prac_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockFeed" --- + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_blockFeed_keyResp.keys in ['', [], None]: # No response was made + prac_blockFeed_keyResp.keys = None + prac_block_loop.addData('prac_blockFeed_keyResp.keys',prac_blockFeed_keyResp.keys) + if prac_blockFeed_keyResp.keys != None: # we had a response + prac_block_loop.addData('prac_blockFeed_keyResp.rt', prac_blockFeed_keyResp.rt) + # the Routine "prac_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 99 repeats of 'prac_block_loop' + + +# set up handler to look after randomisation of conditions etc +task_condition_loop = data.TrialHandler(nReps=1.0, method='sequential', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions("condition_"+expInfo['counterbalance']+".xlsx"), + seed=None, name='task_condition_loop') +thisExp.addLoop(task_condition_loop) # add the loop to the experiment +thisTask_condition_loop = task_condition_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) +if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + +for thisTask_condition_loop in task_condition_loop: + currentLoop = task_condition_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) + if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_condition" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from condition_init_blockCounter + #reset the following variables at the start of the experiment + blockCounter = 0 + + + if conditionText == 'Observe other': + endTask = 1 + elif conditionText == 'Observed': + endTask = 0 + elif conditionText == 'Alone': + endTask = 0 + condition_whichCondition_text.setText(conditionText) + condition_keyResp.keys = [] + condition_keyResp.rt = [] + _condition_keyResp_allKeys = [] + # keep track of which components have finished + task_conditionComponents = [condition_whichCondition_text, condition_reminder_text, condition_keyResp] + for thisComponent in task_conditionComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_condition" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *condition_whichCondition_text* updates + if condition_whichCondition_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_whichCondition_text.frameNStart = frameN # exact frame index + condition_whichCondition_text.tStart = t # local t and not account for scr refresh + condition_whichCondition_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_whichCondition_text, 'tStartRefresh') # time at next scr refresh + condition_whichCondition_text.setAutoDraw(True) + + # *condition_reminder_text* updates + if condition_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_reminder_text.frameNStart = frameN # exact frame index + condition_reminder_text.tStart = t # local t and not account for scr refresh + condition_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_reminder_text, 'tStartRefresh') # time at next scr refresh + condition_reminder_text.setAutoDraw(True) + + # *condition_keyResp* updates + waitOnFlip = False + if condition_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_keyResp.frameNStart = frameN # exact frame index + condition_keyResp.tStart = t # local t and not account for scr refresh + condition_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_keyResp, 'tStartRefresh') # time at next scr refresh + condition_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(condition_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(condition_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if condition_keyResp.status == STARTED and not waitOnFlip: + theseKeys = condition_keyResp.getKeys(keyList=['c'], waitRelease=False) + _condition_keyResp_allKeys.extend(theseKeys) + if len(_condition_keyResp_allKeys): + condition_keyResp.keys = _condition_keyResp_allKeys[-1].name # just the last key pressed + condition_keyResp.rt = _condition_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_condition" --- + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if condition_keyResp.keys in ['', [], None]: # No response was made + condition_keyResp.keys = None + task_condition_loop.addData('condition_keyResp.keys',condition_keyResp.keys) + if condition_keyResp.keys != None: # we had a response + task_condition_loop.addData('condition_keyResp.rt', condition_keyResp.rt) + # the Routine "task_condition" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # set up handler to look after randomisation of conditions etc + task_block_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='task_block_loop') + thisExp.addLoop(task_block_loop) # add the loop to the experiment + thisTask_block_loop = task_block_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + for thisTask_block_loop in task_block_loop: + currentLoop = task_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from task_blockReminder_code + + + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + blockCounter = blockCounter +1 + + if blockCounter == 1: + blockNumText = 'Block 1 of 10' + elif blockCounter == 2: + blockNumText = 'Block 2 of 10' + elif blockCounter == 3: + blockNumText = 'Block 3 of 10' + elif blockCounter == 4: + blockNumText = 'Block 4 of 10' + elif blockCounter == 5: + blockNumText = 'Block 5 of 10' + elif blockCounter == 6: + blockNumText = 'Block 6 of 10' + elif blockCounter == 7: + blockNumText = 'Block 7 of 10' + elif blockCounter == 8: + blockNumText = 'Block 8 of 10' + elif blockCounter == 9: + blockNumText = 'Block 9 of 10' + elif blockCounter == 10: + blockNumText = 'Block 10 of 10' + task_blockText.setText(blockNumText) + task_blockReminders_keyResp.keys = [] + task_blockReminders_keyResp.rt = [] + _task_blockReminders_keyResp_allKeys = [] + # keep track of which components have finished + task_blockRemindersComponents = [task_blockText, task_blockReminders_text, task_blockReminders_keyResp] + for thisComponent in task_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockText* updates + if task_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockText.frameNStart = frameN # exact frame index + task_blockText.tStart = t # local t and not account for scr refresh + task_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockText.started') + task_blockText.setAutoDraw(True) + + # *task_blockReminders_text* updates + if task_blockReminders_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_text.frameNStart = frameN # exact frame index + task_blockReminders_text.tStart = t # local t and not account for scr refresh + task_blockReminders_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_text, 'tStartRefresh') # time at next scr refresh + task_blockReminders_text.setAutoDraw(True) + + # *task_blockReminders_keyResp* updates + waitOnFlip = False + if task_blockReminders_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_keyResp.frameNStart = frameN # exact frame index + task_blockReminders_keyResp.tStart = t # local t and not account for scr refresh + task_blockReminders_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockReminders_keyResp.started') + task_blockReminders_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockReminders_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockReminders_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockReminders_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockReminders_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockReminders_keyResp_allKeys.extend(theseKeys) + if len(_task_blockReminders_keyResp_allKeys): + task_blockReminders_keyResp.keys = _task_blockReminders_keyResp_allKeys[-1].name # just the last key pressed + task_blockReminders_keyResp.rt = _task_blockReminders_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockReminders" --- + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockReminders_keyResp.keys in ['', [], None]: # No response was made + task_blockReminders_keyResp.keys = None + task_block_loop.addData('task_blockReminders_keyResp.keys',task_blockReminders_keyResp.keys) + if task_blockReminders_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockReminders_keyResp.rt', task_blockReminders_keyResp.rt) + # the Routine "task_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + initFixationComponents = [initFixation_img] + for thisComponent in initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "initFixation" --- + for thisComponent in initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + task_trial_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions(whichCondition), + seed=None, name='task_trial_loop') + thisExp.addLoop(task_trial_loop) # add the loop to the experiment + thisTask_trial_loop = task_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + for thisTask_trial_loop in task_trial_loop: + currentLoop = task_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from trigger_loss_code_2 + # Kia: The following 2 lines are preventing the trigger loss + port.close() + port.open() + # Run 'Begin Routine' code from endTask_code_2 + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_trial_loop.finished = True + task_block_loop.finished = True + + # Run 'Begin Routine' code from task_isi_code + # pick the ISI for the next routine + # this code component is set to 'both' because we need to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + task_trial_loop.addData('ISI', thisISI) + + task_centerImg.setImage(middleStim) + task_rightImg1.setImage(rightStim1) + task_rightImg2.setImage(rightStim2) + task_leftImg1.setImage(leftStim1) + task_leftImg2.setImage(leftStim1) + task_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from task_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + task_stim_keyResp.keys = [] + task_stim_keyResp.rt = [] + _task_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from task_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + task_stimRoutineComponents = [task_centerImg, task_rightImg1, task_rightImg2, task_leftImg1, task_leftImg2, task_fixImg, task_stim_keyResp] + for thisComponent in task_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_centerImg* updates + if task_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_centerImg.frameNStart = frameN # exact frame index + task_centerImg.tStart = t # local t and not account for scr refresh + task_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.started') + task_centerImg.setAutoDraw(True) + if task_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_centerImg.tStop = t # not accounting for scr refresh + task_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.stopped') + task_centerImg.setAutoDraw(False) + + # *task_rightImg1* updates + if task_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg1.frameNStart = frameN # exact frame index + task_rightImg1.tStart = t # local t and not account for scr refresh + task_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.started') + task_rightImg1.setAutoDraw(True) + if task_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg1.tStop = t # not accounting for scr refresh + task_rightImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg1.stopped') + task_rightImg1.setAutoDraw(False) + + # *task_rightImg2* updates + if task_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg2.frameNStart = frameN # exact frame index + task_rightImg2.tStart = t # local t and not account for scr refresh + task_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.started') + task_rightImg2.setAutoDraw(True) + if task_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg2.tStop = t # not accounting for scr refresh + task_rightImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_rightImg2.stopped') + task_rightImg2.setAutoDraw(False) + + # *task_leftImg1* updates + if task_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg1.frameNStart = frameN # exact frame index + task_leftImg1.tStart = t # local t and not account for scr refresh + task_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg1, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.started') + task_leftImg1.setAutoDraw(True) + if task_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg1.tStop = t # not accounting for scr refresh + task_leftImg1.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg1.stopped') + task_leftImg1.setAutoDraw(False) + + # *task_leftImg2* updates + if task_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg2.frameNStart = frameN # exact frame index + task_leftImg2.tStart = t # local t and not account for scr refresh + task_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.started') + task_leftImg2.setAutoDraw(True) + if task_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg2.tStop = t # not accounting for scr refresh + task_leftImg2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_leftImg2.stopped') + task_leftImg2.setAutoDraw(False) + + # *task_fixImg* updates + if task_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_fixImg.frameNStart = frameN # exact frame index + task_fixImg.tStart = t # local t and not account for scr refresh + task_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_fixImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.started') + task_fixImg.setAutoDraw(True) + if task_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_fixImg.tStop = t # not accounting for scr refresh + task_fixImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_fixImg.stopped') + task_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from task_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if task_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 41: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x29]) #hexcode = 41; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 42: + stimTriggerSent = True + port.write([0x2A]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 43: + stimTriggerSent = True + port.write([0x2B]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 44: + stimTriggerSent = True + port.write([0x2C]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 51: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x33]) #hexcode = 51; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 52: + stimTriggerSent = True + port.write([0x34]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 53: + stimTriggerSent = True + port.write([0x35]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 54: + stimTriggerSent = True + port.write([0x36]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *task_stim_keyResp* updates + waitOnFlip = False + if task_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_stim_keyResp.frameNStart = frameN # exact frame index + task_stim_keyResp.tStart = t # local t and not account for scr refresh + task_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.started') + task_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_stim_keyResp.tStop = t # not accounting for scr refresh + task_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.stopped') + task_stim_keyResp.status = FINISHED + if task_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _task_stim_keyResp_allKeys.extend(theseKeys) + if len(_task_stim_keyResp_allKeys): + task_stim_keyResp.keys = [key.name for key in _task_stim_keyResp_allKeys] # storing all keys + task_stim_keyResp.rt = [key.rt for key in _task_stim_keyResp_allKeys] + # Run 'Each Frame' code from task_respTrigger_code + if task_stim_keyResp.keys and len(task_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(task_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(task_stim_keyResp.keys) < 2: #if this is the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(task_stim_keyResp.keys) >= 2: #if this is NOT the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_stimRoutine" --- + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_stim_keyResp.keys in ['', [], None]: # No response was made + task_stim_keyResp.keys = None + task_trial_loop.addData('task_stim_keyResp.keys',task_stim_keyResp.keys) + if task_stim_keyResp.keys != None: # we had a response + task_trial_loop.addData('task_stim_keyResp.rt', task_stim_keyResp.rt) + # Run 'End Routine' code from task_respTrigger_code + + #instead of including here, should instead include something + #in each frame section that computes t at stim onset and then + #when thisISI - t <= .05 (50 ms) and then at that point we throw + #the no-resp marker... + + #if not prac_stim_keyResp.keys or len(prac_stim_keyResp.keys) == 0: + # port.write([0x63]) # 99 + # time.sleep(PulseWidth) + # port.write([0x00]) + # Run 'End Routine' code from task_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if task_stim_keyResp.keys: #if at least one response was made this trial + if task_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif task_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + # save this trial's accuracy to our output file + task_trial_loop.addData('accuracy', accuracy) + # the Routine "task_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_trial_loop' + + + # --- Prepare to start Routine "task_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code_3 + # check for endTask. If this round is observe other condition, we will skip these routines. + if endTask: + continueRoutine = False + task_block_loop.finished = True + + # Run 'Begin Routine' code from task_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockCounter < 10: + if blockAcc >= .75: + if blockAcc < .9: + blockFeed = 'Good job' + blockFeedCat = 1 + elif blockAcc >= .9: + blockFeed = 'Respond faster' + blockFeedCat = 2 + elif blockAcc < .75: + blockFeed = 'Respond more accurately' + blockFeedCat = 3 + elif blockCounter == 10: + 'You have completed all blocks' + + # save this block's feedback to our output file + task_trial_loop.addData('blockFeedCat', blockFeedCat) + + #reset the following variables to zero before next block starts + trialNum = 0 + numCorr = 0 + task_blockFeed_text.setText(blockFeed) + task_blockFeed_text2.setText('Press the right button to continue') + task_blockFeed_keyResp.keys = [] + task_blockFeed_keyResp.rt = [] + _task_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + task_blockFeedComponents = [task_blockFeed_text, task_blackFeed_text3, task_blockFeed_text2, task_blockFeed_keyResp] + for thisComponent in task_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockFeed_text* updates + if task_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text.frameNStart = frameN # exact frame index + task_blockFeed_text.tStart = t # local t and not account for scr refresh + task_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_text.started') + task_blockFeed_text.setAutoDraw(True) + + # *task_blackFeed_text3* updates + if task_blackFeed_text3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blackFeed_text3.frameNStart = frameN # exact frame index + task_blackFeed_text3.tStart = t # local t and not account for scr refresh + task_blackFeed_text3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blackFeed_text3, 'tStartRefresh') # time at next scr refresh + task_blackFeed_text3.setAutoDraw(True) + if task_blackFeed_text3.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_blackFeed_text3.tStartRefresh + 10-frameTolerance: + # keep track of stop time/frame for later + task_blackFeed_text3.tStop = t # not accounting for scr refresh + task_blackFeed_text3.frameNStop = frameN # exact frame index + task_blackFeed_text3.setAutoDraw(False) + + # *task_blockFeed_text2* updates + if task_blockFeed_text2.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text2.frameNStart = frameN # exact frame index + task_blockFeed_text2.tStart = t # local t and not account for scr refresh + task_blockFeed_text2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text2, 'tStartRefresh') # time at next scr refresh + task_blockFeed_text2.setAutoDraw(True) + + # *task_blockFeed_keyResp* updates + waitOnFlip = False + if task_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_keyResp.frameNStart = frameN # exact frame index + task_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + task_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_keyResp.started') + task_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockFeed_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_task_blockFeed_keyResp_allKeys): + task_blockFeed_keyResp.keys = _task_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + task_blockFeed_keyResp.rt = _task_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockFeed" --- + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_blockFeed_keyResp.keys in ['', [], None]: # No response was made + task_blockFeed_keyResp.keys = None + task_block_loop.addData('task_blockFeed_keyResp.keys',task_blockFeed_keyResp.keys) + if task_blockFeed_keyResp.keys != None: # we had a response + task_block_loop.addData('task_blockFeed_keyResp.rt', task_blockFeed_keyResp.rt) + # the Routine "task_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_block_loop' + + + # --- Prepare to start Routine "task_conditionComplete" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + conditionComplete_key_resp.keys = [] + conditionComplete_key_resp.rt = [] + _conditionComplete_key_resp_allKeys = [] + # keep track of which components have finished + task_conditionCompleteComponents = [conditionComplete_text, conditionComplete_key_resp] + for thisComponent in task_conditionCompleteComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_conditionComplete" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *conditionComplete_text* updates + if conditionComplete_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_text.frameNStart = frameN # exact frame index + conditionComplete_text.tStart = t # local t and not account for scr refresh + conditionComplete_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_text, 'tStartRefresh') # time at next scr refresh + conditionComplete_text.setAutoDraw(True) + + # *conditionComplete_key_resp* updates + waitOnFlip = False + if conditionComplete_key_resp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_key_resp.frameNStart = frameN # exact frame index + conditionComplete_key_resp.tStart = t # local t and not account for scr refresh + conditionComplete_key_resp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_key_resp, 'tStartRefresh') # time at next scr refresh + conditionComplete_key_resp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(conditionComplete_key_resp.clock.reset) # t=0 on next screen flip + win.callOnFlip(conditionComplete_key_resp.clearEvents, eventType='keyboard') # clear events on next screen flip + if conditionComplete_key_resp.status == STARTED and not waitOnFlip: + theseKeys = conditionComplete_key_resp.getKeys(keyList=['c'], waitRelease=False) + _conditionComplete_key_resp_allKeys.extend(theseKeys) + if len(_conditionComplete_key_resp_allKeys): + conditionComplete_key_resp.keys = _conditionComplete_key_resp_allKeys[-1].name # just the last key pressed + conditionComplete_key_resp.rt = _conditionComplete_key_resp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_conditionComplete" --- + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if conditionComplete_key_resp.keys in ['', [], None]: # No response was made + conditionComplete_key_resp.keys = None + task_condition_loop.addData('conditionComplete_key_resp.keys',conditionComplete_key_resp.keys) + if conditionComplete_key_resp.keys != None: # we had a response + task_condition_loop.addData('conditionComplete_key_resp.rt', conditionComplete_key_resp.rt) + # the Routine "task_conditionComplete" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 1.0 repeats of 'task_condition_loop' + +# Run 'End Experiment' code from setup_code +win.mouseVisible = True #make the mouse cursor visable again +port.write([0xFF]) #set port values back to default state (FF) +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else +port.close() #close port opened at start of exp + +# --- End experiment --- +# Flip one final time so any remaining win.callOnFlip() +# and win.timeOnFlip() tasks get executed before quitting +win.flip() + +# these shouldn't be strictly necessary (should auto-save) +thisExp.saveAsWideText(filename+'.csv', delim='auto') +thisExp.saveAsPickle(filename) +logging.flush() +# make sure everything is closed down +if eyetracker: + eyetracker.setConnectionState(False) +thisExp.abort() # or data files will save again on exit +win.close() +core.quit() diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_A1.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_A1.xlsx new file mode 100755 index 0000000..5330938 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_A1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_A2.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_A2.xlsx new file mode 100755 index 0000000..a526247 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_A2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_B1.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_B1.xlsx new file mode 100755 index 0000000..4362c3f Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_B1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_B2.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_B2.xlsx new file mode 100755 index 0000000..f6ce344 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_B2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_C1.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_C1.xlsx new file mode 100755 index 0000000..d67534a Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_C1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_C2.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_C2.xlsx new file mode 100755 index 0000000..fe92b47 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/condition_C2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/fixationCross.png b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/fixationCross.png new file mode 100755 index 0000000..7767763 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/fixationCross.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/leftArrow.png b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/leftArrow.png new file mode 100755 index 0000000..5a40335 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/leftArrow.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/pptFiles.zip b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/pptFiles.zip new file mode 100755 index 0000000..7724f83 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/pptFiles.zip differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/rightArrow.png b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/rightArrow.png new file mode 100755 index 0000000..a0fbd55 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/img/rightArrow.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/nonsocial_task_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/nonsocial_task_trials.xlsx new file mode 100755 index 0000000..eb4162f Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/nonsocial_task_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/prac_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/prac_trials.xlsx new file mode 100755 index 0000000..a48c0a6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/prac_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/readme.md b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/readme.md new file mode 100755 index 0000000..e69de29 diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/social_task_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/social_task_trials.xlsx new file mode 100755 index 0000000..e74acd4 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/social_task_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/~$toDo.rtf b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/~$toDo.rtf new file mode 100755 index 0000000..ae13dc6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0-timingTest_trial_level_triggerLoss/~$toDo.rtf differ diff --git a/materials/psychopy_tasks/arrow-alert-v0/~$toDo.rtf b/materials/psychopy_tasks/arrow-alert-v0/~$toDo.rtf new file mode 100755 index 0000000..ae13dc6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v0/~$toDo.rtf differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/arrow alert.zip b/materials/psychopy_tasks/arrow-alert-v1-2/arrow alert.zip new file mode 100755 index 0000000..03267d7 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/arrow alert.zip differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/arrow-alert_v1-2.psyexp b/materials/psychopy_tasks/arrow-alert-v1-2/arrow-alert_v1-2.psyexp new file mode 100755 index 0000000..0659b21 --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v1-2/arrow-alert_v1-2.psyexp @@ -0,0 +1,3881 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/arrow-alert_v1-2_lastrun.py b/materials/psychopy_tasks/arrow-alert-v1-2/arrow-alert_v1-2_lastrun.py new file mode 100755 index 0000000..0eabe11 --- /dev/null +++ b/materials/psychopy_tasks/arrow-alert-v1-2/arrow-alert_v1-2_lastrun.py @@ -0,0 +1,5026 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5), + on October 29, 2023, at 17:01 +If you publish work using this script the most relevant publication is: + + Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) + PsychoPy2: Experiments in behavior made easy Behav Res 51: 195. + https://doi.org/10.3758/s13428-018-01193-y + +""" + +# --- Import packages --- +from psychopy import locale_setup +from psychopy import prefs +prefs.hardware['audioLib'] = 'ptb' +from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout +from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, + STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) + +import numpy as np # whole numpy lib is available, prepend 'np.' +from numpy import (sin, cos, tan, log, log10, pi, average, + sqrt, std, deg2rad, rad2deg, linspace, asarray) +from numpy.random import random, randint, normal, shuffle, choice as randchoice +import os # handy system and path functions +import sys # to get file system encoding + +import psychopy.iohub as io +from psychopy.hardware import keyboard + + + +# Ensure that relative paths start from the same directory as this script +_thisDir = os.path.dirname(os.path.abspath(__file__)) +os.chdir(_thisDir) +# Store info about the experiment session +psychopyVersion = '2022.2.5' +expName = 'arrow-alert-v1-2' # from the Builder filename that created this script +expInfo = { + 'id': '', + 'counterbalance': ['A1', 'A2', 'B1', 'B2', 'C1', 'C2'], + 'skipOther': '0', + 'session': '1', + 'run': '1', +} +# --- Show participant info dialog -- +dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName) +if dlg.OK == False: + core.quit() # user pressed cancel +expInfo['date'] = data.getDateStr() # add a simple timestamp +expInfo['expName'] = expName +expInfo['psychopyVersion'] = psychopyVersion + +# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc +filename = _thisDir + os.sep + u'data/sub-%s_%s_psychopy_s%s_r%s_e1' % (expInfo['id'], expName, expInfo['session'], expInfo['run'], ) + +# An ExperimentHandler isn't essential but helps with data saving +thisExp = data.ExperimentHandler(name=expName, version='', + extraInfo=expInfo, runtimeInfo=None, + originPath='C:\\Users\\NDCLab\\Desktop\\Experiments\\THRIVE\\arrow-alert-v1-2\\arrow-alert_v1-2_lastrun.py', + savePickle=True, saveWideText=True, + dataFileName=filename) +# save a log file for detail verbose info +logFile = logging.LogFile(filename+'.log', level=logging.DEBUG) +logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file + +endExpNow = False # flag for 'escape' or other condition => quit the exp +frameTolerance = 0.001 # how close to onset before 'same' frame + +# Start Code - component code to be run after the window creation + +# --- Setup the Window --- +win = visual.Window( + size=[1920, 1080], fullscr=True, screen=0, + winType='pyglet', allowStencil=False, + monitor='sys-1-asus', color=[-1,-1,-1], colorSpace='rgb', + blendMode='avg', useFBO=True, + units='height') +win.mouseVisible = False +# store frame rate of monitor if we can measure it +expInfo['frameRate'] = win.getActualFrameRate() +if expInfo['frameRate'] != None: + frameDur = 1.0 / round(expInfo['frameRate']) +else: + frameDur = 1.0 / 60.0 # could not measure, so guess +# --- Setup input devices --- +ioConfig = {} + +# Setup iohub keyboard +ioConfig['Keyboard'] = dict(use_keymap='psychopy') + +ioSession = '1' +if 'session' in expInfo: + ioSession = str(expInfo['session']) +ioServer = io.launchHubServer(window=win, **ioConfig) +eyetracker = None + +# create a default keyboard (e.g. to check for escape) +defaultKeyboard = keyboard.Keyboard(backend='iohub') + +# --- Initialize components for Routine "JS_code" --- + +# --- Initialize components for Routine "setup" --- +# Run 'Begin Experiment' code from setup_code +import serial #used for sending eeg triggers +import time #indirerctly used for sending eeg triggers (how long to wait before clearing port) + +win.mouseVisible = False #hide mouse cursor +port = serial.Serial('COM4') # Open specified serial port (COM4) for sending eeg triggers to +PulseWidth = 0.002 #how long to wait before clearing port after sending trigger (2 ms is sufficient at 1000 hz sampling rate) +port.write([0x00]) #clear serial port +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else + +# --- Initialize components for Routine "logo" --- +logo_image = visual.ImageStim( + win=win, + name='logo_image', + image='img/logo2.png', mask=None, anchor='center', + ori=0.0, pos=(0, 0), size=(1.2,.75), + color=[1,1,1], colorSpace='rgb', opacity=None, + flipHoriz=False, flipVert=False, + texRes=128.0, interpolate=True, depth=0.0) +logo_resp = keyboard.Keyboard() + +# --- Initialize components for Routine "welcome" --- +welcome_keyResp = keyboard.Keyboard() +welcome_keyResp2 = keyboard.Keyboard() +welcome_text = visual.TextStim(win=win, name='welcome_text', + text='', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +welcome_text2 = visual.TextStim(win=win, name='welcome_text2', + text='', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-3.0); + +# --- Initialize components for Routine "instructRightSingle" --- +instructRightSingle_keyResp = keyboard.Keyboard() +instructRightSingle_keyResp_2 = keyboard.Keyboard() +instructRightSingle_keyResp_3 = keyboard.Keyboard() +instructRightSingle_keyResp_4 = keyboard.Keyboard() +instructRightSingle_keyResp_5 = keyboard.Keyboard() +instructRightSingle_text = visual.TextStim(win=win, name='instructRightSingle_text', + text='This arrow is pointing to the RIGHT. \n\n\n\n\n\n\n\n\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-5.0); +instructRightSingle_text_2 = visual.TextStim(win=win, name='instructRightSingle_text_2', + text='This arrow is pointing to the RIGHT. \n\nYou can tell this arrow is pointing to the RIGHT by looking at which side the point is on.\n\n\n\n\n\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-6.0); +instructRightSingle_text_3 = visual.TextStim(win=win, name='instructRightSingle_text_3', + text='This arrow is pointing to the RIGHT. \n\nYou can tell this arrow is pointing to the RIGHT by looking at which side the point is on.\n\nThe point is on the RIGHT, so the arrow is pointing this way.\n\n\n\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-7.0); +instructRightSingle_text_4 = visual.TextStim(win=win, name='instructRightSingle_text_4', + text='This arrow is pointing to the RIGHT. \n\nYou can tell this arrow is pointing to the RIGHT by looking at which side the point is on.\n\nThe point is on the RIGHT, so the arrow is pointing this way.\n\nYou would respond to this arrow by pressing the RIGHT button with your RIGHT hand.\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-8.0); +instructRightSingle_text_5 = visual.TextStim(win=win, name='instructRightSingle_text_5', + text='This arrow is pointing to the RIGHT. \n\nYou can tell this arrow is pointing to the RIGHT by looking at which side the point is on.\n\nThe point is on the RIGHT, so the arrow is pointing this way.\n\nYou would respond to this arrow by pressing the RIGHT button with your RIGHT hand.\n\nPress the RIGHT button to continue.\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-9.0); +instructRightSingle_rightArrow = visual.ImageStim( + win=win, + name='instructRightSingle_rightArrow', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.08, .08), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-10.0) +instructRightSingle_rightArrowHighlight = visual.ImageStim( + win=win, + name='instructRightSingle_rightArrowHighlight', + image='img/rightArrowHighlight.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.08, .08), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-11.0) +instructRightSingle_rightArrowSolid = visual.ImageStim( + win=win, + name='instructRightSingle_rightArrowSolid', + image='img/rightArrowSolid.png', mask=None, anchor='center', + ori=0, pos=(0, -.4), size=(.08, .08), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-12.0) + +# --- Initialize components for Routine "instructLeftSingle" --- +instructLeftSingle_keyResp = keyboard.Keyboard() +instructLeftSingle_keyResp_2 = keyboard.Keyboard() +instructLeftSingle_keyResp_3 = keyboard.Keyboard() +instructLeftSingle_keyResp_4 = keyboard.Keyboard() +instructLeftSingle_keyResp_5 = keyboard.Keyboard() +instructLeftSingle_text = visual.TextStim(win=win, name='instructLeftSingle_text', + text='This arrow is pointing to the LEFT. \n\n\n\n\n\n\n\n\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-5.0); +instructLeftSingle_text_2 = visual.TextStim(win=win, name='instructLeftSingle_text_2', + text='This arrow is pointing to the LEFT. \n\nYou can tell this arrow is pointing to the LEFT by looking at which side the point is on.\n\n\n\n\n\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-6.0); +instructLeftSingle_text_3 = visual.TextStim(win=win, name='instructLeftSingle_text_3', + text='This arrow is pointing to the LEFT. \n\nYou can tell this arrow is pointing to the LEFT by looking at which side the point is on.\n\nThe point is on the LEFT, so the arrow is pointing this way.\n\n\n\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-7.0); +instructLeftSingle_text_4 = visual.TextStim(win=win, name='instructLeftSingle_text_4', + text='This arrow is pointing to the LEFT. \n\nYou can tell this arrow is pointing to the LEFT by looking at which side the point is on.\n\nThe point is on the LEFT, so the arrow is pointing this way.\n\nYou would respond to this arrow by pressing the LEFT button with your LEFT hand.\n\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-8.0); +instructLeftSingle_text_5 = visual.TextStim(win=win, name='instructLeftSingle_text_5', + text='This arrow is pointing to the LEFT. \n\nYou can tell this arrow is pointing to the LEFT by looking at which side the point is on.\n\nThe point is on the LEFT, so the arrow is pointing this way.\n\nYou would respond to this arrow by pressing the LEFT button with your LEFT hand.\n\nPress the LEFT button to continue.\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-9.0); +instructLeftSingle_leftArrow = visual.ImageStim( + win=win, + name='instructLeftSingle_leftArrow', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.08, .08), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-10.0) +instructLeftSingle_leftArrowHighlight = visual.ImageStim( + win=win, + name='instructLeftSingle_leftArrowHighlight', + image='img/leftArrowHighlight.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.08, .08), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-11.0) +instructLeftSingle_leftArrowSolid = visual.ImageStim( + win=win, + name='instructLeftSingle_leftArrowSolid', + image='img/leftArrowSolid.png', mask=None, anchor='center', + ori=0, pos=(0, -.4), size=(.08, .08), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-12.0) + +# --- Initialize components for Routine "instructMiddle" --- +instructMiddle_keyResp = keyboard.Keyboard() +instructMiddle_keyResp2 = keyboard.Keyboard() +welcome_text_2 = visual.TextStim(win=win, name='welcome_text_2', + text='', + font='Arial', + units='height', pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +welcome_text2_2 = visual.TextStim(win=win, name='welcome_text2_2', + text='', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-3.0); + +# --- Initialize components for Routine "instructRight" --- +instructRight_text = visual.TextStim(win=win, name='instructRight_text', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg = visual.ImageStim( + win=win, + name='instructRight_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1 = visual.ImageStim( + win=win, + name='instructRight_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1 = visual.ImageStim( + win=win, + name='instructRight_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructRight_2" --- +instructRight_text_2 = visual.TextStim(win=win, name='instructRight_text_2', + text='Below, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructRight_centerImg_2 = visual.ImageStim( + win=win, + name='instructRight_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructRight_rightImg1_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructRight_rightImg2_2 = visual.ImageStim( + win=win, + name='instructRight_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructRight_leftImg1_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructRight_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft" --- +instructLeft_text = visual.TextStim(win=win, name='instructLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg = visual.ImageStim( + win=win, + name='instructLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructLeft_2" --- +instructLeft_text_2 = visual.TextStim(win=win, name='instructLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructLeft_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight" --- +instructInconRight_text = visual.TextStim(win=win, name='instructInconRight_text', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond to the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg = visual.ImageStim( + win=win, + name='instructIncon_centerImg', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconRight_2" --- +instructInconRight_text_2 = visual.TextStim(win=win, name='instructInconRight_text_2', + text='Sometimes the MIDDLE arrow will point in a different direction from the other arrows. However, your goal is to always respond to the MIDDLE arrow.\n\nBelow, the MIDDLE arrow is pointing to the right, so you would respond by pressing the right button with your right hand.\n\nPress the right button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructIncon_centerImg_2 = visual.ImageStim( + win=win, + name='instructIncon_centerImg_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructIncon_rightImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructIncon_rightImg2_2 = visual.ImageStim( + win=win, + name='instructIncon_rightImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructIncon_leftImg1_2 = visual.ImageStim( + win=win, + name='instructIncon_leftImg1_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconRight_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconRight_leftImg2_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +insructInconRight_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft" --- +instructInconLeft_text = visual.TextStim(win=win, name='instructInconLeft_text', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "instructInconLeft_2" --- +instructInconLeft_text_2 = visual.TextStim(win=win, name='instructInconLeft_text_2', + text='Below, the MIDDLE arrow is pointing to the left, so you would respond by pressing the left button with your left hand.\n\nPress the left button to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=0.0); +instructInconLeft_centerImg_2 = visual.ImageStim( + win=win, + name='instructInconLeft_centerImg_2', + image='img/leftArrow.png', mask=None, anchor='center', + ori=0, pos=(0, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +instructInconLeft_rightImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +instructInconLeft_rightImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_rightImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +instructInconLeft_leftImg1_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg1_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.05, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +instructInconLeft_leftImg2_2 = visual.ImageStim( + win=win, + name='instructInconLeft_leftImg2_2', + image='img/rightArrow.png', mask=None, anchor='center', + ori=0, pos=(-.1, -.3), size=(.04, .04), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +instructInconLeft_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "respond_onceInstruct" --- +respond_once_text = visual.TextStim(win=win, name='respond_once_text', + text='Each time you see the arrows appear, respond as quickly as you can without making mistakes.\n\nHowever, only respond once each time you see the arrows appear. Even if you think you made the wrong response, do not respond again until you see the next set of arrows appear.\n\nExperimenter: demonstrate how to respond', + font='Open Sans', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=1.0, + languageStyle='LTR', + depth=0.0); +respond_once_key_resp1 = keyboard.Keyboard() + +# --- Initialize components for Routine "eeg_trigger_check" --- +# Run 'Begin Experiment' code from triggerCheck_code +#initialize usb connected variable +usbConnected = 1 +triggerIssue_text = visual.TextStim(win=win, name='triggerIssue_text', + text='EEG EQUIPMENT ISSUE: please ring bell for experimenter', + font='Open Sans', + pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); + +# --- Initialize components for Routine "prac_blockReminders" --- +# Run 'Begin Experiment' code from prac_initAcc_code +#initialize the following variables at the start of experiment +trialNum = 0 +accuracy = 0 +numCorr = 0 +blockAcc = 0 +prac_blockText = visual.TextStim(win=win, name='prac_blockText', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +prac_reminder_text = visual.TextStim(win=win, name='prac_reminder_text', + text='Remember to limit blinking to about once every ten seconds. Try to relax the muscles in your face, neck, and shoulders. \n\nRespond as quickly as you can without making mistakes. Only respond once each time you see the arrows appear.\n\nAlways respond to the direction of the MIDDLE arrow.\n\nTo get ready, rest your thumbs on the right and left buttons.\n\n', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +prac_reminder_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockReminders_2" --- +prac_blockText_2 = visual.TextStim(win=win, name='prac_blockText_2', + text='Practice', + font='Arial', + pos=(0, .3), height=0.06, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=0.0); +prac_reminder_text_2 = visual.TextStim(win=win, name='prac_reminder_text_2', + text='Remember to limit blinking to about once every ten seconds. Try to relax the muscles in your face, neck, and shoulders. \n\nRespond as quickly as you can without making mistakes. Only respond once each time you see the arrows appear.\n\nAlways respond to the direction of the MIDDLE arrow.\n\nTo get ready, rest your thumbs on the right and left buttons.\n\nPress the right button to begin.', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +prac_reminder_keyResp_2 = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_initFixation" --- +initFixation_img_2 = visual.ImageStim( + win=win, + name='initFixation_img_2', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.71), size=(.24, .24), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=0.0) + +# --- Initialize components for Routine "prac_stimRoutine" --- +# Run 'Begin Experiment' code from prac_isi_code +#initialize the thisISI variable +thisISI = 0 +prac_centerImg = visual.ImageStim( + win=win, + name='prac_centerImg', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=[.6, .6], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) +prac_rightImg1 = visual.ImageStim( + win=win, + name='prac_rightImg1', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(.71, 0), size=[.6, .6], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +prac_rightImg2 = visual.ImageStim( + win=win, + name='prac_rightImg2', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(1.42, 0), size=[.6, .6], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +prac_leftImg1 = visual.ImageStim( + win=win, + name='prac_leftImg1', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.71, 0), size=[.6, .6], + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +prac_leftImg2 = visual.ImageStim( + win=win, + name='prac_leftImg2', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(-1.42, 0), size=(.6, .6), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +prac_fixImg = visual.ImageStim( + win=win, + name='prac_fixImg', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.71), size=(.24, .24), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-6.0) +prac_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "prac_blockFeed" --- +prac_blockFeed_text = visual.TextStim(win=win, name='prac_blockFeed_text', + text='', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-1.0); +prac_pressContinue = visual.TextStim(win=win, name='prac_pressContinue', + text='Experimenter: press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +prac_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_condition" --- +# Run 'Begin Experiment' code from condition_init_blockCounter +#initialize the following variables at the start of the condition +blockCounter = 0 +endCondition = 0 +condition_whichCondition_text = visual.TextStim(win=win, name='condition_whichCondition_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.22, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +condition_reminder_text = visual.TextStim(win=win, name='condition_reminder_text', + text='Experimenter: provide instructions and then press key to continue', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=1.8, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-2.0); +condition_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "eeg_trigger_check" --- +# Run 'Begin Experiment' code from triggerCheck_code +#initialize usb connected variable +usbConnected = 1 +triggerIssue_text = visual.TextStim(win=win, name='triggerIssue_text', + text='EEG EQUIPMENT ISSUE: please ring bell for experimenter', + font='Open Sans', + pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); + +# --- Initialize components for Routine "task_blockReminders" --- +task_blockText = visual.TextStim(win=win, name='task_blockText', + text='', + font='Arial', + pos=(0, .14), height=0.12, wrapWidth=1.8, ori=0.0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +task_blockReminders_text = visual.TextStim(win=win, name='task_blockReminders_text', + text='Remember to limit blinking to about once every ten seconds. Try to relax the muscles in your face, neck, and shoulders. \n\nRespond as quickly as you can without making mistakes. Only respond once each time you see the arrows appear.\n\nAlways respond to the direction of the MIDDLE arrow.\n\nTo get ready, rest your thumbs on the right and left buttons.\n\nPress the right button to begin.', + font='Arial', + pos=(0, -.19), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blockReminders_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_initFixation" --- +initFixation_img = visual.ImageStim( + win=win, + name='initFixation_img', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.71), size=(.24, .24), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-1.0) + +# --- Initialize components for Routine "task_stimRoutine" --- +# Run 'Begin Experiment' code from task_isi_code +#no need to initialize thisISI, as already done in practice code snippit +task_centerImg = visual.ImageStim( + win=win, + name='task_centerImg', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, 0), size=(.6, .6), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-2.0) +task_rightImg1 = visual.ImageStim( + win=win, + name='task_rightImg1', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(.71, 0), size=(.6, .6), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-3.0) +task_rightImg2 = visual.ImageStim( + win=win, + name='task_rightImg2', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(1.42, 0), size=(.6, .6), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-4.0) +task_leftImg1 = visual.ImageStim( + win=win, + name='task_leftImg1', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(-.71, 0), size=(.6, .6), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-5.0) +task_leftImg2 = visual.ImageStim( + win=win, + name='task_leftImg2', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(-1.42, 0), size=(.6, .6), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=True, + texRes=512, interpolate=True, depth=-6.0) +task_fixImg = visual.ImageStim( + win=win, + name='task_fixImg', units='deg', + image='sin', mask=None, anchor='center', + ori=0, pos=(0, -.71), size=(.24, .24), + color=[1,1,1], colorSpace='rgb', opacity=1, + flipHoriz=False, flipVert=False, + texRes=512, interpolate=True, depth=-7.0) +task_stim_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_blockFeed" --- +task_blockFeed_text = visual.TextStim(win=win, name='task_blockFeed_text', + text='', + font='Arial', + pos=(0, 0.1), height=0.12, wrapWidth=1.8, ori=0, + color=[-0.3,-0.3,-0.3], colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-2.0); +task_blackFeed_text3 = visual.TextStim(win=win, name='task_blackFeed_text3', + text='Please wait', + font='Arial', + pos=(0, -.3), height=0.04, wrapWidth=None, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-3.0); +task_blockFeed_text2 = visual.TextStim(win=win, name='task_blockFeed_text2', + text='', + font='Arial', + pos=(0, -0.3), height=0.04, wrapWidth=1.3, ori=0, + color='white', colorSpace='rgb', opacity=1, + languageStyle='LTR', + depth=-4.0); +task_blockFeed_keyResp = keyboard.Keyboard() + +# --- Initialize components for Routine "task_conditionComplete" --- +conditionComplete_text = visual.TextStim(win=win, name='conditionComplete_text', + text='Please ring bell and wait for experimenter to continue', + font='Arial', + pos=(0, 0), height=0.04, wrapWidth=1.3, ori=0.0, + color='white', colorSpace='rgb', opacity=None, + languageStyle='LTR', + depth=-1.0); +conditionComplete_key_resp = keyboard.Keyboard() + +# Create some handy timers +globalClock = core.Clock() # to track the time since experiment started +routineTimer = core.Clock() # to track time remaining of each (possibly non-slip) routine + +# --- Prepare to start Routine "JS_code" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +JS_codeComponents = [] +for thisComponent in JS_codeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "JS_code" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "JS_code" --- +for thisComponent in JS_codeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "JS_code" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "setup" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +setupComponents = [] +for thisComponent in setupComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "setup" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in setupComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "setup" --- +for thisComponent in setupComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "setup" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "logo" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +logo_resp.keys = [] +logo_resp.rt = [] +_logo_resp_allKeys = [] +# keep track of which components have finished +logoComponents = [logo_image, logo_resp] +for thisComponent in logoComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "logo" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *logo_image* updates + if logo_image.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + logo_image.frameNStart = frameN # exact frame index + logo_image.tStart = t # local t and not account for scr refresh + logo_image.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(logo_image, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'logo_image.started') + logo_image.setAutoDraw(True) + + # *logo_resp* updates + waitOnFlip = False + if logo_resp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + logo_resp.frameNStart = frameN # exact frame index + logo_resp.tStart = t # local t and not account for scr refresh + logo_resp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(logo_resp, 'tStartRefresh') # time at next scr refresh + logo_resp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(logo_resp.clock.reset) # t=0 on next screen flip + win.callOnFlip(logo_resp.clearEvents, eventType='keyboard') # clear events on next screen flip + if logo_resp.status == STARTED and not waitOnFlip: + theseKeys = logo_resp.getKeys(keyList=['c'], waitRelease=False) + _logo_resp_allKeys.extend(theseKeys) + if len(_logo_resp_allKeys): + logo_resp.keys = _logo_resp_allKeys[-1].name # just the last key pressed + logo_resp.rt = _logo_resp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in logoComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "logo" --- +for thisComponent in logoComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "logo" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "welcome" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +welcome_keyResp.keys = [] +welcome_keyResp.rt = [] +_welcome_keyResp_allKeys = [] +welcome_keyResp2.keys = [] +welcome_keyResp2.rt = [] +_welcome_keyResp2_allKeys = [] +welcome_text.setText('Arrow Alert \n\nWelcome to the Arrow Alert game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the arrows, and to respond as quickly as you can without making mistakes. \n\n\n') +welcome_text2.setText('Arrow Alert \n\nWelcome to the Arrow Alert game. In this game, arrows will be quickly flashed on the screen. Your goal is to respond to the direction of the arrows, and to respond as quickly as you can without making mistakes. \n\nPress the right button to continue\n') +# keep track of which components have finished +welcomeComponents = [welcome_keyResp, welcome_keyResp2, welcome_text, welcome_text2] +for thisComponent in welcomeComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "welcome" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *welcome_keyResp* updates + waitOnFlip = False + if welcome_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_keyResp.frameNStart = frameN # exact frame index + welcome_keyResp.tStart = t # local t and not account for scr refresh + welcome_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp, 'tStartRefresh') # time at next scr refresh + welcome_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(welcome_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(welcome_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if welcome_keyResp.status == STARTED: + if bool(welcome_keyResp.keys): + # keep track of stop time/frame for later + welcome_keyResp.tStop = t # not accounting for scr refresh + welcome_keyResp.frameNStop = frameN # exact frame index + welcome_keyResp.status = FINISHED + if welcome_keyResp.status == STARTED and not waitOnFlip: + theseKeys = welcome_keyResp.getKeys(keyList=['c'], waitRelease=False) + _welcome_keyResp_allKeys.extend(theseKeys) + if len(_welcome_keyResp_allKeys): + welcome_keyResp.keys = _welcome_keyResp_allKeys[-1].name # just the last key pressed + welcome_keyResp.rt = _welcome_keyResp_allKeys[-1].rt + + # *welcome_keyResp2* updates + if welcome_keyResp2.status == NOT_STARTED and welcome_keyResp.keys: + # keep track of start time/frame for later + welcome_keyResp2.frameNStart = frameN # exact frame index + welcome_keyResp2.tStart = t # local t and not account for scr refresh + welcome_keyResp2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_keyResp2, 'tStartRefresh') # time at next scr refresh + welcome_keyResp2.status = STARTED + # keyboard checking is just starting + welcome_keyResp2.clock.reset() # now t=0 + welcome_keyResp2.clearEvents(eventType='keyboard') + if welcome_keyResp2.status == STARTED: + theseKeys = welcome_keyResp2.getKeys(keyList=['8'], waitRelease=False) + _welcome_keyResp2_allKeys.extend(theseKeys) + if len(_welcome_keyResp2_allKeys): + welcome_keyResp2.keys = _welcome_keyResp2_allKeys[-1].name # just the last key pressed + welcome_keyResp2.rt = _welcome_keyResp2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # *welcome_text* updates + if welcome_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text.frameNStart = frameN # exact frame index + welcome_text.tStart = t # local t and not account for scr refresh + welcome_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text, 'tStartRefresh') # time at next scr refresh + welcome_text.setAutoDraw(True) + + # *welcome_text2* updates + if welcome_text2.status == NOT_STARTED and welcome_keyResp.keys: + # keep track of start time/frame for later + welcome_text2.frameNStart = frameN # exact frame index + welcome_text2.tStart = t # local t and not account for scr refresh + welcome_text2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'welcome_text2.started') + welcome_text2.setAutoDraw(True) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in welcomeComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "welcome" --- +for thisComponent in welcomeComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "welcome" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRightSingle" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructRightSingle_keyResp.keys = [] +instructRightSingle_keyResp.rt = [] +_instructRightSingle_keyResp_allKeys = [] +instructRightSingle_keyResp_2.keys = [] +instructRightSingle_keyResp_2.rt = [] +_instructRightSingle_keyResp_2_allKeys = [] +instructRightSingle_keyResp_3.keys = [] +instructRightSingle_keyResp_3.rt = [] +_instructRightSingle_keyResp_3_allKeys = [] +instructRightSingle_keyResp_4.keys = [] +instructRightSingle_keyResp_4.rt = [] +_instructRightSingle_keyResp_4_allKeys = [] +instructRightSingle_keyResp_5.keys = [] +instructRightSingle_keyResp_5.rt = [] +_instructRightSingle_keyResp_5_allKeys = [] +# keep track of which components have finished +instructRightSingleComponents = [instructRightSingle_keyResp, instructRightSingle_keyResp_2, instructRightSingle_keyResp_3, instructRightSingle_keyResp_4, instructRightSingle_keyResp_5, instructRightSingle_text, instructRightSingle_text_2, instructRightSingle_text_3, instructRightSingle_text_4, instructRightSingle_text_5, instructRightSingle_rightArrow, instructRightSingle_rightArrowHighlight, instructRightSingle_rightArrowSolid] +for thisComponent in instructRightSingleComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRightSingle" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRightSingle_keyResp* updates + waitOnFlip = False + if instructRightSingle_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRightSingle_keyResp.frameNStart = frameN # exact frame index + instructRightSingle_keyResp.tStart = t # local t and not account for scr refresh + instructRightSingle_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_keyResp, 'tStartRefresh') # time at next scr refresh + instructRightSingle_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructRightSingle_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructRightSingle_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructRightSingle_keyResp.status == STARTED: + if bool(instructRightSingle_keyResp.keys): + # keep track of stop time/frame for later + instructRightSingle_keyResp.tStop = t # not accounting for scr refresh + instructRightSingle_keyResp.frameNStop = frameN # exact frame index + instructRightSingle_keyResp.status = FINISHED + if instructRightSingle_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructRightSingle_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructRightSingle_keyResp_allKeys.extend(theseKeys) + if len(_instructRightSingle_keyResp_allKeys): + instructRightSingle_keyResp.keys = _instructRightSingle_keyResp_allKeys[-1].name # just the last key pressed + instructRightSingle_keyResp.rt = _instructRightSingle_keyResp_allKeys[-1].rt + + # *instructRightSingle_keyResp_2* updates + waitOnFlip = False + if instructRightSingle_keyResp_2.status == NOT_STARTED and instructRightSingle_keyResp.keys: + # keep track of start time/frame for later + instructRightSingle_keyResp_2.frameNStart = frameN # exact frame index + instructRightSingle_keyResp_2.tStart = t # local t and not account for scr refresh + instructRightSingle_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructRightSingle_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructRightSingle_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructRightSingle_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructRightSingle_keyResp_2.status == STARTED: + if bool(instructRightSingle_keyResp_2.keys): + # keep track of stop time/frame for later + instructRightSingle_keyResp_2.tStop = t # not accounting for scr refresh + instructRightSingle_keyResp_2.frameNStop = frameN # exact frame index + instructRightSingle_keyResp_2.status = FINISHED + if instructRightSingle_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructRightSingle_keyResp_2.getKeys(keyList=['c'], waitRelease=False) + _instructRightSingle_keyResp_2_allKeys.extend(theseKeys) + if len(_instructRightSingle_keyResp_2_allKeys): + instructRightSingle_keyResp_2.keys = _instructRightSingle_keyResp_2_allKeys[-1].name # just the last key pressed + instructRightSingle_keyResp_2.rt = _instructRightSingle_keyResp_2_allKeys[-1].rt + + # *instructRightSingle_keyResp_3* updates + waitOnFlip = False + if instructRightSingle_keyResp_3.status == NOT_STARTED and instructRightSingle_keyResp_2.keys: + # keep track of start time/frame for later + instructRightSingle_keyResp_3.frameNStart = frameN # exact frame index + instructRightSingle_keyResp_3.tStart = t # local t and not account for scr refresh + instructRightSingle_keyResp_3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_keyResp_3, 'tStartRefresh') # time at next scr refresh + instructRightSingle_keyResp_3.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructRightSingle_keyResp_3.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructRightSingle_keyResp_3.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructRightSingle_keyResp_3.status == STARTED: + if bool(instructRightSingle_keyResp_3.keys): + # keep track of stop time/frame for later + instructRightSingle_keyResp_3.tStop = t # not accounting for scr refresh + instructRightSingle_keyResp_3.frameNStop = frameN # exact frame index + instructRightSingle_keyResp_3.status = FINISHED + if instructRightSingle_keyResp_3.status == STARTED and not waitOnFlip: + theseKeys = instructRightSingle_keyResp_3.getKeys(keyList=['c'], waitRelease=False) + _instructRightSingle_keyResp_3_allKeys.extend(theseKeys) + if len(_instructRightSingle_keyResp_3_allKeys): + instructRightSingle_keyResp_3.keys = _instructRightSingle_keyResp_3_allKeys[-1].name # just the last key pressed + instructRightSingle_keyResp_3.rt = _instructRightSingle_keyResp_3_allKeys[-1].rt + + # *instructRightSingle_keyResp_4* updates + waitOnFlip = False + if instructRightSingle_keyResp_4.status == NOT_STARTED and instructRightSingle_keyResp_3.keys: + # keep track of start time/frame for later + instructRightSingle_keyResp_4.frameNStart = frameN # exact frame index + instructRightSingle_keyResp_4.tStart = t # local t and not account for scr refresh + instructRightSingle_keyResp_4.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_keyResp_4, 'tStartRefresh') # time at next scr refresh + instructRightSingle_keyResp_4.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructRightSingle_keyResp_4.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructRightSingle_keyResp_4.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructRightSingle_keyResp_4.status == STARTED: + if bool(instructRightSingle_keyResp_4.keys): + # keep track of stop time/frame for later + instructRightSingle_keyResp_4.tStop = t # not accounting for scr refresh + instructRightSingle_keyResp_4.frameNStop = frameN # exact frame index + instructRightSingle_keyResp_4.status = FINISHED + if instructRightSingle_keyResp_4.status == STARTED and not waitOnFlip: + theseKeys = instructRightSingle_keyResp_4.getKeys(keyList=['c'], waitRelease=False) + _instructRightSingle_keyResp_4_allKeys.extend(theseKeys) + if len(_instructRightSingle_keyResp_4_allKeys): + instructRightSingle_keyResp_4.keys = _instructRightSingle_keyResp_4_allKeys[-1].name # just the last key pressed + instructRightSingle_keyResp_4.rt = _instructRightSingle_keyResp_4_allKeys[-1].rt + + # *instructRightSingle_keyResp_5* updates + waitOnFlip = False + if instructRightSingle_keyResp_5.status == NOT_STARTED and instructRightSingle_keyResp_4.keys: + # keep track of start time/frame for later + instructRightSingle_keyResp_5.frameNStart = frameN # exact frame index + instructRightSingle_keyResp_5.tStart = t # local t and not account for scr refresh + instructRightSingle_keyResp_5.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_keyResp_5, 'tStartRefresh') # time at next scr refresh + instructRightSingle_keyResp_5.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructRightSingle_keyResp_5.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructRightSingle_keyResp_5.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructRightSingle_keyResp_5.status == STARTED: + if bool(instructRightSingle_keyResp_5.keys): + # keep track of stop time/frame for later + instructRightSingle_keyResp_5.tStop = t # not accounting for scr refresh + instructRightSingle_keyResp_5.frameNStop = frameN # exact frame index + instructRightSingle_keyResp_5.status = FINISHED + if instructRightSingle_keyResp_5.status == STARTED and not waitOnFlip: + theseKeys = instructRightSingle_keyResp_5.getKeys(keyList=['8'], waitRelease=False) + _instructRightSingle_keyResp_5_allKeys.extend(theseKeys) + if len(_instructRightSingle_keyResp_5_allKeys): + instructRightSingle_keyResp_5.keys = _instructRightSingle_keyResp_5_allKeys[-1].name # just the last key pressed + instructRightSingle_keyResp_5.rt = _instructRightSingle_keyResp_5_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # *instructRightSingle_text* updates + if instructRightSingle_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRightSingle_text.frameNStart = frameN # exact frame index + instructRightSingle_text.tStart = t # local t and not account for scr refresh + instructRightSingle_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_text, 'tStartRefresh') # time at next scr refresh + instructRightSingle_text.setAutoDraw(True) + + # *instructRightSingle_text_2* updates + if instructRightSingle_text_2.status == NOT_STARTED and instructRightSingle_keyResp.keys: + # keep track of start time/frame for later + instructRightSingle_text_2.frameNStart = frameN # exact frame index + instructRightSingle_text_2.tStart = t # local t and not account for scr refresh + instructRightSingle_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_text_2, 'tStartRefresh') # time at next scr refresh + instructRightSingle_text_2.setAutoDraw(True) + + # *instructRightSingle_text_3* updates + if instructRightSingle_text_3.status == NOT_STARTED and instructRightSingle_keyResp_2.keys: + # keep track of start time/frame for later + instructRightSingle_text_3.frameNStart = frameN # exact frame index + instructRightSingle_text_3.tStart = t # local t and not account for scr refresh + instructRightSingle_text_3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_text_3, 'tStartRefresh') # time at next scr refresh + instructRightSingle_text_3.setAutoDraw(True) + + # *instructRightSingle_text_4* updates + if instructRightSingle_text_4.status == NOT_STARTED and instructRightSingle_keyResp_3.keys: + # keep track of start time/frame for later + instructRightSingle_text_4.frameNStart = frameN # exact frame index + instructRightSingle_text_4.tStart = t # local t and not account for scr refresh + instructRightSingle_text_4.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_text_4, 'tStartRefresh') # time at next scr refresh + instructRightSingle_text_4.setAutoDraw(True) + + # *instructRightSingle_text_5* updates + if instructRightSingle_text_5.status == NOT_STARTED and instructRightSingle_keyResp_4.keys: + # keep track of start time/frame for later + instructRightSingle_text_5.frameNStart = frameN # exact frame index + instructRightSingle_text_5.tStart = t # local t and not account for scr refresh + instructRightSingle_text_5.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_text_5, 'tStartRefresh') # time at next scr refresh + instructRightSingle_text_5.setAutoDraw(True) + + # *instructRightSingle_rightArrow* updates + if instructRightSingle_rightArrow.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRightSingle_rightArrow.frameNStart = frameN # exact frame index + instructRightSingle_rightArrow.tStart = t # local t and not account for scr refresh + instructRightSingle_rightArrow.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_rightArrow, 'tStartRefresh') # time at next scr refresh + instructRightSingle_rightArrow.setAutoDraw(True) + + # *instructRightSingle_rightArrowHighlight* updates + if instructRightSingle_rightArrowHighlight.status == NOT_STARTED and instructRightSingle_keyResp.keys: + # keep track of start time/frame for later + instructRightSingle_rightArrowHighlight.frameNStart = frameN # exact frame index + instructRightSingle_rightArrowHighlight.tStart = t # local t and not account for scr refresh + instructRightSingle_rightArrowHighlight.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_rightArrowHighlight, 'tStartRefresh') # time at next scr refresh + instructRightSingle_rightArrowHighlight.setAutoDraw(True) + + # *instructRightSingle_rightArrowSolid* updates + if instructRightSingle_rightArrowSolid.status == NOT_STARTED and instructRightSingle_keyResp_2.keys: + # keep track of start time/frame for later + instructRightSingle_rightArrowSolid.frameNStart = frameN # exact frame index + instructRightSingle_rightArrowSolid.tStart = t # local t and not account for scr refresh + instructRightSingle_rightArrowSolid.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRightSingle_rightArrowSolid, 'tStartRefresh') # time at next scr refresh + instructRightSingle_rightArrowSolid.setAutoDraw(True) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRightSingleComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRightSingle" --- +for thisComponent in instructRightSingleComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRightSingle" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeftSingle" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeftSingle_keyResp.keys = [] +instructLeftSingle_keyResp.rt = [] +_instructLeftSingle_keyResp_allKeys = [] +instructLeftSingle_keyResp_2.keys = [] +instructLeftSingle_keyResp_2.rt = [] +_instructLeftSingle_keyResp_2_allKeys = [] +instructLeftSingle_keyResp_3.keys = [] +instructLeftSingle_keyResp_3.rt = [] +_instructLeftSingle_keyResp_3_allKeys = [] +instructLeftSingle_keyResp_4.keys = [] +instructLeftSingle_keyResp_4.rt = [] +_instructLeftSingle_keyResp_4_allKeys = [] +instructLeftSingle_keyResp_5.keys = [] +instructLeftSingle_keyResp_5.rt = [] +_instructLeftSingle_keyResp_5_allKeys = [] +# keep track of which components have finished +instructLeftSingleComponents = [instructLeftSingle_keyResp, instructLeftSingle_keyResp_2, instructLeftSingle_keyResp_3, instructLeftSingle_keyResp_4, instructLeftSingle_keyResp_5, instructLeftSingle_text, instructLeftSingle_text_2, instructLeftSingle_text_3, instructLeftSingle_text_4, instructLeftSingle_text_5, instructLeftSingle_leftArrow, instructLeftSingle_leftArrowHighlight, instructLeftSingle_leftArrowSolid] +for thisComponent in instructLeftSingleComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeftSingle" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeftSingle_keyResp* updates + waitOnFlip = False + if instructLeftSingle_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeftSingle_keyResp.frameNStart = frameN # exact frame index + instructLeftSingle_keyResp.tStart = t # local t and not account for scr refresh + instructLeftSingle_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_keyResp, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeftSingle_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeftSingle_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeftSingle_keyResp.status == STARTED: + if bool(instructLeftSingle_keyResp.keys): + # keep track of stop time/frame for later + instructLeftSingle_keyResp.tStop = t # not accounting for scr refresh + instructLeftSingle_keyResp.frameNStop = frameN # exact frame index + instructLeftSingle_keyResp.status = FINISHED + if instructLeftSingle_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructLeftSingle_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructLeftSingle_keyResp_allKeys.extend(theseKeys) + if len(_instructLeftSingle_keyResp_allKeys): + instructLeftSingle_keyResp.keys = _instructLeftSingle_keyResp_allKeys[-1].name # just the last key pressed + instructLeftSingle_keyResp.rt = _instructLeftSingle_keyResp_allKeys[-1].rt + + # *instructLeftSingle_keyResp_2* updates + waitOnFlip = False + if instructLeftSingle_keyResp_2.status == NOT_STARTED and instructLeftSingle_keyResp.keys: + # keep track of start time/frame for later + instructLeftSingle_keyResp_2.frameNStart = frameN # exact frame index + instructLeftSingle_keyResp_2.tStart = t # local t and not account for scr refresh + instructLeftSingle_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeftSingle_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeftSingle_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeftSingle_keyResp_2.status == STARTED: + if bool(instructLeftSingle_keyResp_2.keys): + # keep track of stop time/frame for later + instructLeftSingle_keyResp_2.tStop = t # not accounting for scr refresh + instructLeftSingle_keyResp_2.frameNStop = frameN # exact frame index + instructLeftSingle_keyResp_2.status = FINISHED + if instructLeftSingle_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructLeftSingle_keyResp_2.getKeys(keyList=['c'], waitRelease=False) + _instructLeftSingle_keyResp_2_allKeys.extend(theseKeys) + if len(_instructLeftSingle_keyResp_2_allKeys): + instructLeftSingle_keyResp_2.keys = _instructLeftSingle_keyResp_2_allKeys[-1].name # just the last key pressed + instructLeftSingle_keyResp_2.rt = _instructLeftSingle_keyResp_2_allKeys[-1].rt + + # *instructLeftSingle_keyResp_3* updates + waitOnFlip = False + if instructLeftSingle_keyResp_3.status == NOT_STARTED and instructLeftSingle_keyResp_2.keys: + # keep track of start time/frame for later + instructLeftSingle_keyResp_3.frameNStart = frameN # exact frame index + instructLeftSingle_keyResp_3.tStart = t # local t and not account for scr refresh + instructLeftSingle_keyResp_3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_keyResp_3, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_keyResp_3.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeftSingle_keyResp_3.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeftSingle_keyResp_3.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeftSingle_keyResp_3.status == STARTED: + if bool(instructLeftSingle_keyResp_3.keys): + # keep track of stop time/frame for later + instructLeftSingle_keyResp_3.tStop = t # not accounting for scr refresh + instructLeftSingle_keyResp_3.frameNStop = frameN # exact frame index + instructLeftSingle_keyResp_3.status = FINISHED + if instructLeftSingle_keyResp_3.status == STARTED and not waitOnFlip: + theseKeys = instructLeftSingle_keyResp_3.getKeys(keyList=['c'], waitRelease=False) + _instructLeftSingle_keyResp_3_allKeys.extend(theseKeys) + if len(_instructLeftSingle_keyResp_3_allKeys): + instructLeftSingle_keyResp_3.keys = _instructLeftSingle_keyResp_3_allKeys[-1].name # just the last key pressed + instructLeftSingle_keyResp_3.rt = _instructLeftSingle_keyResp_3_allKeys[-1].rt + + # *instructLeftSingle_keyResp_4* updates + waitOnFlip = False + if instructLeftSingle_keyResp_4.status == NOT_STARTED and instructLeftSingle_keyResp_3.keys: + # keep track of start time/frame for later + instructLeftSingle_keyResp_4.frameNStart = frameN # exact frame index + instructLeftSingle_keyResp_4.tStart = t # local t and not account for scr refresh + instructLeftSingle_keyResp_4.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_keyResp_4, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_keyResp_4.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeftSingle_keyResp_4.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeftSingle_keyResp_4.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeftSingle_keyResp_4.status == STARTED: + if bool(instructLeftSingle_keyResp_4.keys): + # keep track of stop time/frame for later + instructLeftSingle_keyResp_4.tStop = t # not accounting for scr refresh + instructLeftSingle_keyResp_4.frameNStop = frameN # exact frame index + instructLeftSingle_keyResp_4.status = FINISHED + if instructLeftSingle_keyResp_4.status == STARTED and not waitOnFlip: + theseKeys = instructLeftSingle_keyResp_4.getKeys(keyList=['c'], waitRelease=False) + _instructLeftSingle_keyResp_4_allKeys.extend(theseKeys) + if len(_instructLeftSingle_keyResp_4_allKeys): + instructLeftSingle_keyResp_4.keys = _instructLeftSingle_keyResp_4_allKeys[-1].name # just the last key pressed + instructLeftSingle_keyResp_4.rt = _instructLeftSingle_keyResp_4_allKeys[-1].rt + + # *instructLeftSingle_keyResp_5* updates + waitOnFlip = False + if instructLeftSingle_keyResp_5.status == NOT_STARTED and instructLeftSingle_keyResp_4.keys: + # keep track of start time/frame for later + instructLeftSingle_keyResp_5.frameNStart = frameN # exact frame index + instructLeftSingle_keyResp_5.tStart = t # local t and not account for scr refresh + instructLeftSingle_keyResp_5.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_keyResp_5, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_keyResp_5.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeftSingle_keyResp_5.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeftSingle_keyResp_5.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeftSingle_keyResp_5.status == STARTED: + if bool(instructLeftSingle_keyResp_5.keys): + # keep track of stop time/frame for later + instructLeftSingle_keyResp_5.tStop = t # not accounting for scr refresh + instructLeftSingle_keyResp_5.frameNStop = frameN # exact frame index + instructLeftSingle_keyResp_5.status = FINISHED + if instructLeftSingle_keyResp_5.status == STARTED and not waitOnFlip: + theseKeys = instructLeftSingle_keyResp_5.getKeys(keyList=['1'], waitRelease=False) + _instructLeftSingle_keyResp_5_allKeys.extend(theseKeys) + if len(_instructLeftSingle_keyResp_5_allKeys): + instructLeftSingle_keyResp_5.keys = _instructLeftSingle_keyResp_5_allKeys[-1].name # just the last key pressed + instructLeftSingle_keyResp_5.rt = _instructLeftSingle_keyResp_5_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # *instructLeftSingle_text* updates + if instructLeftSingle_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeftSingle_text.frameNStart = frameN # exact frame index + instructLeftSingle_text.tStart = t # local t and not account for scr refresh + instructLeftSingle_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_text, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_text.setAutoDraw(True) + + # *instructLeftSingle_text_2* updates + if instructLeftSingle_text_2.status == NOT_STARTED and instructLeftSingle_keyResp.keys: + # keep track of start time/frame for later + instructLeftSingle_text_2.frameNStart = frameN # exact frame index + instructLeftSingle_text_2.tStart = t # local t and not account for scr refresh + instructLeftSingle_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_text_2, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_text_2.setAutoDraw(True) + + # *instructLeftSingle_text_3* updates + if instructLeftSingle_text_3.status == NOT_STARTED and instructLeftSingle_keyResp_2.keys: + # keep track of start time/frame for later + instructLeftSingle_text_3.frameNStart = frameN # exact frame index + instructLeftSingle_text_3.tStart = t # local t and not account for scr refresh + instructLeftSingle_text_3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_text_3, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_text_3.setAutoDraw(True) + + # *instructLeftSingle_text_4* updates + if instructLeftSingle_text_4.status == NOT_STARTED and instructLeftSingle_keyResp_3.keys: + # keep track of start time/frame for later + instructLeftSingle_text_4.frameNStart = frameN # exact frame index + instructLeftSingle_text_4.tStart = t # local t and not account for scr refresh + instructLeftSingle_text_4.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_text_4, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_text_4.setAutoDraw(True) + + # *instructLeftSingle_text_5* updates + if instructLeftSingle_text_5.status == NOT_STARTED and instructLeftSingle_keyResp_4.keys: + # keep track of start time/frame for later + instructLeftSingle_text_5.frameNStart = frameN # exact frame index + instructLeftSingle_text_5.tStart = t # local t and not account for scr refresh + instructLeftSingle_text_5.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_text_5, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_text_5.setAutoDraw(True) + + # *instructLeftSingle_leftArrow* updates + if instructLeftSingle_leftArrow.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeftSingle_leftArrow.frameNStart = frameN # exact frame index + instructLeftSingle_leftArrow.tStart = t # local t and not account for scr refresh + instructLeftSingle_leftArrow.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_leftArrow, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_leftArrow.setAutoDraw(True) + + # *instructLeftSingle_leftArrowHighlight* updates + if instructLeftSingle_leftArrowHighlight.status == NOT_STARTED and instructLeftSingle_keyResp.keys: + # keep track of start time/frame for later + instructLeftSingle_leftArrowHighlight.frameNStart = frameN # exact frame index + instructLeftSingle_leftArrowHighlight.tStart = t # local t and not account for scr refresh + instructLeftSingle_leftArrowHighlight.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_leftArrowHighlight, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_leftArrowHighlight.setAutoDraw(True) + + # *instructLeftSingle_leftArrowSolid* updates + if instructLeftSingle_leftArrowSolid.status == NOT_STARTED and instructLeftSingle_keyResp_2.keys: + # keep track of start time/frame for later + instructLeftSingle_leftArrowSolid.frameNStart = frameN # exact frame index + instructLeftSingle_leftArrowSolid.tStart = t # local t and not account for scr refresh + instructLeftSingle_leftArrowSolid.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeftSingle_leftArrowSolid, 'tStartRefresh') # time at next scr refresh + instructLeftSingle_leftArrowSolid.setAutoDraw(True) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeftSingleComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeftSingle" --- +for thisComponent in instructLeftSingleComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeftSingle" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructMiddle" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructMiddle_keyResp.keys = [] +instructMiddle_keyResp.rt = [] +_instructMiddle_keyResp_allKeys = [] +instructMiddle_keyResp2.keys = [] +instructMiddle_keyResp2.rt = [] +_instructMiddle_keyResp2_allKeys = [] +welcome_text_2.setText('During the game, five arrows will appear at a time. They will be quickly flashed on the screen. Your goal is to respond to the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\n\n') +welcome_text2_2.setText('During the game, five arrows will appear at a time. They will be quickly flashed on the screen. Your goal is to respond to the MIDDLE arrow, and to respond as quickly as you can without making mistakes. \n\nIf the MIDDLE arrow is pointing to the right, use your right hand to press the right button. If the MIDDLE arrow is pointing to the left, use your left hand to press the left button. \n\nPress the right button to continue\n') +# keep track of which components have finished +instructMiddleComponents = [instructMiddle_keyResp, instructMiddle_keyResp2, welcome_text_2, welcome_text2_2] +for thisComponent in instructMiddleComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructMiddle" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructMiddle_keyResp* updates + waitOnFlip = False + if instructMiddle_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructMiddle_keyResp.frameNStart = frameN # exact frame index + instructMiddle_keyResp.tStart = t # local t and not account for scr refresh + instructMiddle_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructMiddle_keyResp, 'tStartRefresh') # time at next scr refresh + instructMiddle_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructMiddle_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructMiddle_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructMiddle_keyResp.status == STARTED: + if bool(instructMiddle_keyResp.keys): + # keep track of stop time/frame for later + instructMiddle_keyResp.tStop = t # not accounting for scr refresh + instructMiddle_keyResp.frameNStop = frameN # exact frame index + instructMiddle_keyResp.status = FINISHED + if instructMiddle_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructMiddle_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructMiddle_keyResp_allKeys.extend(theseKeys) + if len(_instructMiddle_keyResp_allKeys): + instructMiddle_keyResp.keys = _instructMiddle_keyResp_allKeys[-1].name # just the last key pressed + instructMiddle_keyResp.rt = _instructMiddle_keyResp_allKeys[-1].rt + + # *instructMiddle_keyResp2* updates + if instructMiddle_keyResp2.status == NOT_STARTED and instructMiddle_keyResp.keys: + # keep track of start time/frame for later + instructMiddle_keyResp2.frameNStart = frameN # exact frame index + instructMiddle_keyResp2.tStart = t # local t and not account for scr refresh + instructMiddle_keyResp2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructMiddle_keyResp2, 'tStartRefresh') # time at next scr refresh + instructMiddle_keyResp2.status = STARTED + # keyboard checking is just starting + instructMiddle_keyResp2.clock.reset() # now t=0 + instructMiddle_keyResp2.clearEvents(eventType='keyboard') + if instructMiddle_keyResp2.status == STARTED: + theseKeys = instructMiddle_keyResp2.getKeys(keyList=['8'], waitRelease=False) + _instructMiddle_keyResp2_allKeys.extend(theseKeys) + if len(_instructMiddle_keyResp2_allKeys): + instructMiddle_keyResp2.keys = _instructMiddle_keyResp2_allKeys[-1].name # just the last key pressed + instructMiddle_keyResp2.rt = _instructMiddle_keyResp2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # *welcome_text_2* updates + if welcome_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + welcome_text_2.frameNStart = frameN # exact frame index + welcome_text_2.tStart = t # local t and not account for scr refresh + welcome_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text_2, 'tStartRefresh') # time at next scr refresh + welcome_text_2.setAutoDraw(True) + + # *welcome_text2_2* updates + if welcome_text2_2.status == NOT_STARTED and instructMiddle_keyResp.keys: + # keep track of start time/frame for later + welcome_text2_2.frameNStart = frameN # exact frame index + welcome_text2_2.tStart = t # local t and not account for scr refresh + welcome_text2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(welcome_text2_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'welcome_text2_2.started') + welcome_text2_2.setAutoDraw(True) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructMiddleComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructMiddle" --- +for thisComponent in instructMiddleComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructMiddle" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp.keys = [] +insructRight_keyResp.rt = [] +_insructRight_keyResp_allKeys = [] +# keep track of which components have finished +instructRightComponents = [instructRight_text, instructRight_centerImg, instructRight_rightImg1, instructRight_rightImg2, instructRight_leftImg1, instructRight_leftImg2, insructRight_keyResp] +for thisComponent in instructRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text* updates + if instructRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text.frameNStart = frameN # exact frame index + instructRight_text.tStart = t # local t and not account for scr refresh + instructRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text, 'tStartRefresh') # time at next scr refresh + instructRight_text.setAutoDraw(True) + + # *instructRight_centerImg* updates + if instructRight_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg.frameNStart = frameN # exact frame index + instructRight_centerImg.tStart = t # local t and not account for scr refresh + instructRight_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg.setAutoDraw(True) + + # *instructRight_rightImg1* updates + if instructRight_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1.frameNStart = frameN # exact frame index + instructRight_rightImg1.tStart = t # local t and not account for scr refresh + instructRight_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1.setAutoDraw(True) + + # *instructRight_rightImg2* updates + if instructRight_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2.frameNStart = frameN # exact frame index + instructRight_rightImg2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2.setAutoDraw(True) + + # *instructRight_leftImg1* updates + if instructRight_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1.frameNStart = frameN # exact frame index + instructRight_leftImg1.tStart = t # local t and not account for scr refresh + instructRight_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1.setAutoDraw(True) + + # *instructRight_leftImg2* updates + if instructRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2.frameNStart = frameN # exact frame index + instructRight_leftImg2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2.setAutoDraw(True) + + # *insructRight_keyResp* updates + waitOnFlip = False + if insructRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp.frameNStart = frameN # exact frame index + insructRight_keyResp.tStart = t # local t and not account for scr refresh + insructRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructRight_keyResp_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_allKeys): + insructRight_keyResp.keys = _insructRight_keyResp_allKeys[-1].name # just the last key pressed + insructRight_keyResp.rt = _insructRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight" --- +for thisComponent in instructRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructRight_keyResp_2.keys = [] +insructRight_keyResp_2.rt = [] +_insructRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructRight_2Components = [instructRight_text_2, instructRight_centerImg_2, instructRight_rightImg1_2, instructRight_rightImg2_2, instructRight_leftImg1_2, instructRight_leftImg2_2, insructRight_keyResp_2] +for thisComponent in instructRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructRight_text_2* updates + if instructRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_text_2.frameNStart = frameN # exact frame index + instructRight_text_2.tStart = t # local t and not account for scr refresh + instructRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_text_2, 'tStartRefresh') # time at next scr refresh + instructRight_text_2.setAutoDraw(True) + + # *instructRight_centerImg_2* updates + if instructRight_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_centerImg_2.frameNStart = frameN # exact frame index + instructRight_centerImg_2.tStart = t # local t and not account for scr refresh + instructRight_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructRight_centerImg_2.setAutoDraw(True) + + # *instructRight_rightImg1_2* updates + if instructRight_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg1_2.frameNStart = frameN # exact frame index + instructRight_rightImg1_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg1_2.setAutoDraw(True) + + # *instructRight_rightImg2_2* updates + if instructRight_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_rightImg2_2.frameNStart = frameN # exact frame index + instructRight_rightImg2_2.tStart = t # local t and not account for scr refresh + instructRight_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_rightImg2_2.setAutoDraw(True) + + # *instructRight_leftImg1_2* updates + if instructRight_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg1_2.frameNStart = frameN # exact frame index + instructRight_leftImg1_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg1_2.setAutoDraw(True) + + # *instructRight_leftImg2_2* updates + if instructRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructRight_leftImg2_2.frameNStart = frameN # exact frame index + instructRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructRight_leftImg2_2.setAutoDraw(True) + + # *insructRight_keyResp_2* updates + waitOnFlip = False + if insructRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructRight_keyResp_2.frameNStart = frameN # exact frame index + insructRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructRight_keyResp_2_allKeys): + insructRight_keyResp_2.keys = _insructRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructRight_keyResp_2.rt = _insructRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructRight_2" --- +for thisComponent in instructRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp.keys = [] +instructLeft_keyResp.rt = [] +_instructLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructLeftComponents = [instructLeft_text, instructLeft_centerImg, instructLeft_rightImg1, instructLeft_rightImg2, instructLeft_leftImg1, instructLeft_leftImg2, instructLeft_keyResp] +for thisComponent in instructLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text* updates + if instructLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text.frameNStart = frameN # exact frame index + instructLeft_text.tStart = t # local t and not account for scr refresh + instructLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text, 'tStartRefresh') # time at next scr refresh + instructLeft_text.setAutoDraw(True) + + # *instructLeft_centerImg* updates + if instructLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg.frameNStart = frameN # exact frame index + instructLeft_centerImg.tStart = t # local t and not account for scr refresh + instructLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg.setAutoDraw(True) + + # *instructLeft_rightImg1* updates + if instructLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1.frameNStart = frameN # exact frame index + instructLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1.setAutoDraw(True) + + # *instructLeft_rightImg2* updates + if instructLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2.frameNStart = frameN # exact frame index + instructLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2.setAutoDraw(True) + + # *instructLeft_leftImg1* updates + if instructLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1.frameNStart = frameN # exact frame index + instructLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1.setAutoDraw(True) + + # *instructLeft_leftImg2* updates + if instructLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2.frameNStart = frameN # exact frame index + instructLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2.setAutoDraw(True) + + # *instructLeft_keyResp* updates + waitOnFlip = False + if instructLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp.frameNStart = frameN # exact frame index + instructLeft_keyResp.tStart = t # local t and not account for scr refresh + instructLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_allKeys): + instructLeft_keyResp.keys = _instructLeft_keyResp_allKeys[-1].name # just the last key pressed + instructLeft_keyResp.rt = _instructLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft" --- +for thisComponent in instructLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructLeft_keyResp_2.keys = [] +instructLeft_keyResp_2.rt = [] +_instructLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructLeft_2Components = [instructLeft_text_2, instructLeft_centerImg_2, instructLeft_rightImg1_2, instructLeft_rightImg2_2, instructLeft_leftImg1_2, instructLeft_leftImg2_2, instructLeft_keyResp_2] +for thisComponent in instructLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructLeft_text_2* updates + if instructLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_text_2.frameNStart = frameN # exact frame index + instructLeft_text_2.tStart = t # local t and not account for scr refresh + instructLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructLeft_text_2.setAutoDraw(True) + + # *instructLeft_centerImg_2* updates + if instructLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_centerImg_2.frameNStart = frameN # exact frame index + instructLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructLeft_centerImg_2.setAutoDraw(True) + + # *instructLeft_rightImg1_2* updates + if instructLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg1_2.setAutoDraw(True) + + # *instructLeft_rightImg2_2* updates + if instructLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_rightImg2_2.setAutoDraw(True) + + # *instructLeft_leftImg1_2* updates + if instructLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg1_2.setAutoDraw(True) + + # *instructLeft_leftImg2_2* updates + if instructLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructLeft_leftImg2_2.setAutoDraw(True) + + # *instructLeft_keyResp_2* updates + waitOnFlip = False + if instructLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructLeft_keyResp_2.frameNStart = frameN # exact frame index + instructLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructLeft_keyResp_2_allKeys): + instructLeft_keyResp_2.keys = _instructLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructLeft_keyResp_2.rt = _instructLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructLeft_2" --- +for thisComponent in instructLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp.keys = [] +insructInconRight_keyResp.rt = [] +_insructInconRight_keyResp_allKeys = [] +# keep track of which components have finished +instructInconRightComponents = [instructInconRight_text, instructIncon_centerImg, instructIncon_rightImg1, instructIncon_rightImg2, instructIncon_leftImg1, instructInconRight_leftImg2, insructInconRight_keyResp] +for thisComponent in instructInconRightComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text* updates + if instructInconRight_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text.frameNStart = frameN # exact frame index + instructInconRight_text.tStart = t # local t and not account for scr refresh + instructInconRight_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text, 'tStartRefresh') # time at next scr refresh + instructInconRight_text.setAutoDraw(True) + + # *instructIncon_centerImg* updates + if instructIncon_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg.frameNStart = frameN # exact frame index + instructIncon_centerImg.tStart = t # local t and not account for scr refresh + instructIncon_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg.setAutoDraw(True) + + # *instructIncon_rightImg1* updates + if instructIncon_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1.frameNStart = frameN # exact frame index + instructIncon_rightImg1.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1.setAutoDraw(True) + + # *instructIncon_rightImg2* updates + if instructIncon_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2.frameNStart = frameN # exact frame index + instructIncon_rightImg2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2.setAutoDraw(True) + + # *instructIncon_leftImg1* updates + if instructIncon_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1.frameNStart = frameN # exact frame index + instructIncon_leftImg1.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1.setAutoDraw(True) + + # *instructInconRight_leftImg2* updates + if instructInconRight_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2.setAutoDraw(True) + + # *insructInconRight_keyResp* updates + waitOnFlip = False + if insructInconRight_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp.frameNStart = frameN # exact frame index + insructInconRight_keyResp.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp.getKeys(keyList=['c'], waitRelease=False) + _insructInconRight_keyResp_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_allKeys): + insructInconRight_keyResp.keys = _insructInconRight_keyResp_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp.rt = _insructInconRight_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight" --- +for thisComponent in instructInconRightComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconRight_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +insructInconRight_keyResp_2.keys = [] +insructInconRight_keyResp_2.rt = [] +_insructInconRight_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconRight_2Components = [instructInconRight_text_2, instructIncon_centerImg_2, instructIncon_rightImg1_2, instructIncon_rightImg2_2, instructIncon_leftImg1_2, instructInconRight_leftImg2_2, insructInconRight_keyResp_2] +for thisComponent in instructInconRight_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconRight_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconRight_text_2* updates + if instructInconRight_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_text_2.frameNStart = frameN # exact frame index + instructInconRight_text_2.tStart = t # local t and not account for scr refresh + instructInconRight_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_text_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_text_2.setAutoDraw(True) + + # *instructIncon_centerImg_2* updates + if instructIncon_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_centerImg_2.frameNStart = frameN # exact frame index + instructIncon_centerImg_2.tStart = t # local t and not account for scr refresh + instructIncon_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructIncon_centerImg_2.setAutoDraw(True) + + # *instructIncon_rightImg1_2* updates + if instructIncon_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg1_2.frameNStart = frameN # exact frame index + instructIncon_rightImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg1_2.setAutoDraw(True) + + # *instructIncon_rightImg2_2* updates + if instructIncon_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_rightImg2_2.frameNStart = frameN # exact frame index + instructIncon_rightImg2_2.tStart = t # local t and not account for scr refresh + instructIncon_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructIncon_rightImg2_2.setAutoDraw(True) + + # *instructIncon_leftImg1_2* updates + if instructIncon_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructIncon_leftImg1_2.frameNStart = frameN # exact frame index + instructIncon_leftImg1_2.tStart = t # local t and not account for scr refresh + instructIncon_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructIncon_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructIncon_leftImg1_2.setAutoDraw(True) + + # *instructInconRight_leftImg2_2* updates + if instructInconRight_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconRight_leftImg2_2.frameNStart = frameN # exact frame index + instructInconRight_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconRight_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconRight_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconRight_leftImg2_2.setAutoDraw(True) + + # *insructInconRight_keyResp_2* updates + waitOnFlip = False + if insructInconRight_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + insructInconRight_keyResp_2.frameNStart = frameN # exact frame index + insructInconRight_keyResp_2.tStart = t # local t and not account for scr refresh + insructInconRight_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(insructInconRight_keyResp_2, 'tStartRefresh') # time at next scr refresh + insructInconRight_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(insructInconRight_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(insructInconRight_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if insructInconRight_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = insructInconRight_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _insructInconRight_keyResp_2_allKeys.extend(theseKeys) + if len(_insructInconRight_keyResp_2_allKeys): + insructInconRight_keyResp_2.keys = _insructInconRight_keyResp_2_allKeys[-1].name # just the last key pressed + insructInconRight_keyResp_2.rt = _insructInconRight_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconRight_2" --- +for thisComponent in instructInconRight_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconRight_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp.keys = [] +instructInconLeft_keyResp.rt = [] +_instructInconLeft_keyResp_allKeys = [] +# keep track of which components have finished +instructInconLeftComponents = [instructInconLeft_text, instructInconLeft_centerImg, instructInconLeft_rightImg1, instructInconLeft_rightImg2, instructInconLeft_leftImg1, instructInconLeft_leftImg2, instructInconLeft_keyResp] +for thisComponent in instructInconLeftComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text* updates + if instructInconLeft_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text.frameNStart = frameN # exact frame index + instructInconLeft_text.tStart = t # local t and not account for scr refresh + instructInconLeft_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text.setAutoDraw(True) + + # *instructInconLeft_centerImg* updates + if instructInconLeft_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg.frameNStart = frameN # exact frame index + instructInconLeft_centerImg.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg.setAutoDraw(True) + + # *instructInconLeft_rightImg1* updates + if instructInconLeft_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1.setAutoDraw(True) + + # *instructInconLeft_rightImg2* updates + if instructInconLeft_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2.setAutoDraw(True) + + # *instructInconLeft_leftImg1* updates + if instructInconLeft_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1.setAutoDraw(True) + + # *instructInconLeft_leftImg2* updates + if instructInconLeft_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2.setAutoDraw(True) + + # *instructInconLeft_keyResp* updates + waitOnFlip = False + if instructInconLeft_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp.frameNStart = frameN # exact frame index + instructInconLeft_keyResp.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp.getKeys(keyList=['c'], waitRelease=False) + _instructInconLeft_keyResp_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_allKeys): + instructInconLeft_keyResp.keys = _instructInconLeft_keyResp_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp.rt = _instructInconLeft_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft" --- +for thisComponent in instructInconLeftComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "instructInconLeft_2" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +instructInconLeft_keyResp_2.keys = [] +instructInconLeft_keyResp_2.rt = [] +_instructInconLeft_keyResp_2_allKeys = [] +# keep track of which components have finished +instructInconLeft_2Components = [instructInconLeft_text_2, instructInconLeft_centerImg_2, instructInconLeft_rightImg1_2, instructInconLeft_rightImg2_2, instructInconLeft_leftImg1_2, instructInconLeft_leftImg2_2, instructInconLeft_keyResp_2] +for thisComponent in instructInconLeft_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "instructInconLeft_2" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *instructInconLeft_text_2* updates + if instructInconLeft_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_text_2.frameNStart = frameN # exact frame index + instructInconLeft_text_2.tStart = t # local t and not account for scr refresh + instructInconLeft_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_text_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_text_2.setAutoDraw(True) + + # *instructInconLeft_centerImg_2* updates + if instructInconLeft_centerImg_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_centerImg_2.frameNStart = frameN # exact frame index + instructInconLeft_centerImg_2.tStart = t # local t and not account for scr refresh + instructInconLeft_centerImg_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_centerImg_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_centerImg_2.setAutoDraw(True) + + # *instructInconLeft_rightImg1_2* updates + if instructInconLeft_rightImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg1_2.setAutoDraw(True) + + # *instructInconLeft_rightImg2_2* updates + if instructInconLeft_rightImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_rightImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_rightImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_rightImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_rightImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_rightImg2_2.setAutoDraw(True) + + # *instructInconLeft_leftImg1_2* updates + if instructInconLeft_leftImg1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg1_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg1_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg1_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg1_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg1_2.setAutoDraw(True) + + # *instructInconLeft_leftImg2_2* updates + if instructInconLeft_leftImg2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_leftImg2_2.frameNStart = frameN # exact frame index + instructInconLeft_leftImg2_2.tStart = t # local t and not account for scr refresh + instructInconLeft_leftImg2_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_leftImg2_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_leftImg2_2.setAutoDraw(True) + + # *instructInconLeft_keyResp_2* updates + waitOnFlip = False + if instructInconLeft_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + instructInconLeft_keyResp_2.frameNStart = frameN # exact frame index + instructInconLeft_keyResp_2.tStart = t # local t and not account for scr refresh + instructInconLeft_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(instructInconLeft_keyResp_2, 'tStartRefresh') # time at next scr refresh + instructInconLeft_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(instructInconLeft_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(instructInconLeft_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if instructInconLeft_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = instructInconLeft_keyResp_2.getKeys(keyList=['1'], waitRelease=False) + _instructInconLeft_keyResp_2_allKeys.extend(theseKeys) + if len(_instructInconLeft_keyResp_2_allKeys): + instructInconLeft_keyResp_2.keys = _instructInconLeft_keyResp_2_allKeys[-1].name # just the last key pressed + instructInconLeft_keyResp_2.rt = _instructInconLeft_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "instructInconLeft_2" --- +for thisComponent in instructInconLeft_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "instructInconLeft_2" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# --- Prepare to start Routine "respond_onceInstruct" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +respond_once_key_resp1.keys = [] +respond_once_key_resp1.rt = [] +_respond_once_key_resp1_allKeys = [] +# keep track of which components have finished +respond_onceInstructComponents = [respond_once_text, respond_once_key_resp1] +for thisComponent in respond_onceInstructComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "respond_onceInstruct" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *respond_once_text* updates + if respond_once_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + respond_once_text.frameNStart = frameN # exact frame index + respond_once_text.tStart = t # local t and not account for scr refresh + respond_once_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(respond_once_text, 'tStartRefresh') # time at next scr refresh + respond_once_text.setAutoDraw(True) + + # *respond_once_key_resp1* updates + waitOnFlip = False + if respond_once_key_resp1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + respond_once_key_resp1.frameNStart = frameN # exact frame index + respond_once_key_resp1.tStart = t # local t and not account for scr refresh + respond_once_key_resp1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(respond_once_key_resp1, 'tStartRefresh') # time at next scr refresh + respond_once_key_resp1.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(respond_once_key_resp1.clock.reset) # t=0 on next screen flip + win.callOnFlip(respond_once_key_resp1.clearEvents, eventType='keyboard') # clear events on next screen flip + if respond_once_key_resp1.status == STARTED and not waitOnFlip: + theseKeys = respond_once_key_resp1.getKeys(keyList=['c'], waitRelease=False) + _respond_once_key_resp1_allKeys.extend(theseKeys) + if len(_respond_once_key_resp1_allKeys): + respond_once_key_resp1.keys = _respond_once_key_resp1_allKeys[-1].name # just the last key pressed + respond_once_key_resp1.rt = _respond_once_key_resp1_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in respond_onceInstructComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "respond_onceInstruct" --- +for thisComponent in respond_onceInstructComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "respond_onceInstruct" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# set up handler to look after randomisation of conditions etc +prac_block_loop = data.TrialHandler(nReps=99, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='prac_block_loop') +thisExp.addLoop(prac_block_loop) # add the loop to the experiment +thisPrac_block_loop = prac_block_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) +if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + +for thisPrac_block_loop in prac_block_loop: + currentLoop = prac_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_block_loop.rgb) + if thisPrac_block_loop != None: + for paramName in thisPrac_block_loop: + exec('{} = thisPrac_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "eeg_trigger_check" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from triggerCheck_code + #(re)open trigger port. This is done in case the connection failed, + #in which case triggers will no longer be sent until the port is reopened. + + #At start of routine, we try to close/open the port. This will usually be + #succesful, causing us to end the routine altogether. However, it will fail if + #the usb is unplugged. In this latter case, the routine will then run code each + #frame to constantly check for the usb being plugged back in, before continuing. + + try: + #if usb connected, port will close/open and routine will end + port.close() + port.open() + usbConnected = 1 #if successful, set usbConnectd to 1 + continueRoutine = False #if successful, end the routine + + except: #if port close/open fails, then set usbConnected to 0. Routine will loop each frame until fixed. + usbConnected = 0 #if failure, set usbConnected to 0 + # keep track of which components have finished + eeg_trigger_checkComponents = [triggerIssue_text] + for thisComponent in eeg_trigger_checkComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "eeg_trigger_check" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + # Run 'Each Frame' code from triggerCheck_code + #if the usb is not connected, then keep trying to open port to determine when it has been reconnected. + if usbConnected == 0: + + try: + #if usb connected, port will close/open and routine will end + port.close() + port.open() + usbConnected = 1 #if successful, set usbConnectd to 1 + #send trigger to indicate that there was a connection issue that is now resolved + port.write([0x63]) #hexcode = 99; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + #if successful, end the routine + continueRoutine = False + + except: #if usb not connected, routine will continue (keep checking port and keep showing message) + usbConnected = 0 #if failure, set usbConnectd to 0 + time.sleep(0.5) #wait .5 secs before checking again, to not overload the system + + # *triggerIssue_text* updates + if triggerIssue_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + triggerIssue_text.frameNStart = frameN # exact frame index + triggerIssue_text.tStart = t # local t and not account for scr refresh + triggerIssue_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(triggerIssue_text, 'tStartRefresh') # time at next scr refresh + triggerIssue_text.setAutoDraw(True) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in eeg_trigger_checkComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "eeg_trigger_check" --- + for thisComponent in eeg_trigger_checkComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "eeg_trigger_check" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "prac_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp.keys = [] + prac_reminder_keyResp.rt = [] + _prac_reminder_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockRemindersComponents = [prac_blockText, prac_reminder_text, prac_reminder_keyResp] + for thisComponent in prac_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText* updates + if prac_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText.frameNStart = frameN # exact frame index + prac_blockText.tStart = t # local t and not account for scr refresh + prac_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText, 'tStartRefresh') # time at next scr refresh + prac_blockText.setAutoDraw(True) + + # *prac_reminder_text* updates + if prac_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text.frameNStart = frameN # exact frame index + prac_reminder_text.tStart = t # local t and not account for scr refresh + prac_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text, 'tStartRefresh') # time at next scr refresh + prac_reminder_text.setAutoDraw(True) + + # *prac_reminder_keyResp* updates + waitOnFlip = False + if prac_reminder_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp.frameNStart = frameN # exact frame index + prac_reminder_keyResp.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp, 'tStartRefresh') # time at next scr refresh + prac_reminder_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp.getKeys(keyList=['c'], waitRelease=False) + _prac_reminder_keyResp_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_allKeys): + prac_reminder_keyResp.keys = _prac_reminder_keyResp_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp.rt = _prac_reminder_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders" --- + for thisComponent in prac_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "prac_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "prac_blockReminders_2" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + prac_reminder_keyResp_2.keys = [] + prac_reminder_keyResp_2.rt = [] + _prac_reminder_keyResp_2_allKeys = [] + # keep track of which components have finished + prac_blockReminders_2Components = [prac_blockText_2, prac_reminder_text_2, prac_reminder_keyResp_2] + for thisComponent in prac_blockReminders_2Components: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockReminders_2" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockText_2* updates + if prac_blockText_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockText_2.frameNStart = frameN # exact frame index + prac_blockText_2.tStart = t # local t and not account for scr refresh + prac_blockText_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockText_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockText_2.started') + prac_blockText_2.setAutoDraw(True) + + # *prac_reminder_text_2* updates + if prac_reminder_text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_text_2.frameNStart = frameN # exact frame index + prac_reminder_text_2.tStart = t # local t and not account for scr refresh + prac_reminder_text_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_text_2, 'tStartRefresh') # time at next scr refresh + prac_reminder_text_2.setAutoDraw(True) + + # *prac_reminder_keyResp_2* updates + waitOnFlip = False + if prac_reminder_keyResp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_reminder_keyResp_2.frameNStart = frameN # exact frame index + prac_reminder_keyResp_2.tStart = t # local t and not account for scr refresh + prac_reminder_keyResp_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_reminder_keyResp_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_reminder_keyResp_2.started') + prac_reminder_keyResp_2.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_reminder_keyResp_2.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_reminder_keyResp_2.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_reminder_keyResp_2.status == STARTED and not waitOnFlip: + theseKeys = prac_reminder_keyResp_2.getKeys(keyList=['8'], waitRelease=False) + _prac_reminder_keyResp_2_allKeys.extend(theseKeys) + if len(_prac_reminder_keyResp_2_allKeys): + prac_reminder_keyResp_2.keys = _prac_reminder_keyResp_2_allKeys[-1].name # just the last key pressed + prac_reminder_keyResp_2.rt = _prac_reminder_keyResp_2_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockReminders_2" --- + for thisComponent in prac_blockReminders_2Components: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "prac_blockReminders_2" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "prac_initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + initFixation_img_2.setImage('img/fixationCross.png') + # keep track of which components have finished + prac_initFixationComponents = [initFixation_img_2] + for thisComponent in prac_initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img_2* updates + if initFixation_img_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img_2.frameNStart = frameN # exact frame index + initFixation_img_2.tStart = t # local t and not account for scr refresh + initFixation_img_2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img_2, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img_2.started') + initFixation_img_2.setAutoDraw(True) + if initFixation_img_2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img_2.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img_2.tStop = t # not accounting for scr refresh + initFixation_img_2.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img_2.stopped') + initFixation_img_2.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_initFixation" --- + for thisComponent in prac_initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + prac_trial_loop = data.TrialHandler(nReps=10, method='fullRandom', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions('prac_trials.xlsx'), + seed=None, name='prac_trial_loop') + thisExp.addLoop(prac_trial_loop) # add the loop to the experiment + thisPrac_trial_loop = prac_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + for thisPrac_trial_loop in prac_trial_loop: + currentLoop = prac_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisPrac_trial_loop.rgb) + if thisPrac_trial_loop != None: + for paramName in thisPrac_trial_loop: + exec('{} = thisPrac_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "prac_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_isi_code + # pick the ISI for the next routine + # for the online version, this code component should be set to 'both' to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + prac_trial_loop.addData('ISI', thisISI) + + + # show in console for debugging + #print('thisISI: ', thisISI) + prac_centerImg.setImage(middleStim) + prac_rightImg1.setImage(rightStim1) + prac_rightImg2.setImage(rightStim2) + prac_leftImg1.setImage(leftStim1) + prac_leftImg2.setImage(leftStim1) + prac_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from prac_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + prac_stim_keyResp.keys = [] + prac_stim_keyResp.rt = [] + _prac_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from prac_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + prac_stimRoutineComponents = [prac_centerImg, prac_rightImg1, prac_rightImg2, prac_leftImg1, prac_leftImg2, prac_fixImg, prac_stim_keyResp] + for thisComponent in prac_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_centerImg* updates + if prac_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_centerImg.frameNStart = frameN # exact frame index + prac_centerImg.tStart = t # local t and not account for scr refresh + prac_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.started') + prac_centerImg.setAutoDraw(True) + if prac_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_centerImg.tStop = t # not accounting for scr refresh + prac_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_centerImg.stopped') + prac_centerImg.setAutoDraw(False) + + # *prac_rightImg1* updates + if prac_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg1.frameNStart = frameN # exact frame index + prac_rightImg1.tStart = t # local t and not account for scr refresh + prac_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg1, 'tStartRefresh') # time at next scr refresh + prac_rightImg1.setAutoDraw(True) + if prac_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg1.tStop = t # not accounting for scr refresh + prac_rightImg1.frameNStop = frameN # exact frame index + prac_rightImg1.setAutoDraw(False) + + # *prac_rightImg2* updates + if prac_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_rightImg2.frameNStart = frameN # exact frame index + prac_rightImg2.tStart = t # local t and not account for scr refresh + prac_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_rightImg2, 'tStartRefresh') # time at next scr refresh + prac_rightImg2.setAutoDraw(True) + if prac_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_rightImg2.tStop = t # not accounting for scr refresh + prac_rightImg2.frameNStop = frameN # exact frame index + prac_rightImg2.setAutoDraw(False) + + # *prac_leftImg1* updates + if prac_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg1.frameNStart = frameN # exact frame index + prac_leftImg1.tStart = t # local t and not account for scr refresh + prac_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg1, 'tStartRefresh') # time at next scr refresh + prac_leftImg1.setAutoDraw(True) + if prac_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg1.tStop = t # not accounting for scr refresh + prac_leftImg1.frameNStop = frameN # exact frame index + prac_leftImg1.setAutoDraw(False) + + # *prac_leftImg2* updates + if prac_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_leftImg2.frameNStart = frameN # exact frame index + prac_leftImg2.tStart = t # local t and not account for scr refresh + prac_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_leftImg2, 'tStartRefresh') # time at next scr refresh + prac_leftImg2.setAutoDraw(True) + if prac_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + prac_leftImg2.tStop = t # not accounting for scr refresh + prac_leftImg2.frameNStop = frameN # exact frame index + prac_leftImg2.setAutoDraw(False) + + # *prac_fixImg* updates + if prac_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_fixImg.frameNStart = frameN # exact frame index + prac_fixImg.tStart = t # local t and not account for scr refresh + prac_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_fixImg, 'tStartRefresh') # time at next scr refresh + prac_fixImg.setAutoDraw(True) + if prac_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_fixImg.tStop = t # not accounting for scr refresh + prac_fixImg.frameNStop = frameN # exact frame index + prac_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from prac_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if prac_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 1: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x01]) #hexcode = 1; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 2: + stimTriggerSent = True + port.write([0x02]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 3: + stimTriggerSent = True + port.write([0x03]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 4: + stimTriggerSent = True + port.write([0x04]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *prac_stim_keyResp* updates + waitOnFlip = False + if prac_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_stim_keyResp.frameNStart = frameN # exact frame index + prac_stim_keyResp.tStart = t # local t and not account for scr refresh + prac_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.started') + prac_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > prac_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + prac_stim_keyResp.tStop = t # not accounting for scr refresh + prac_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_stim_keyResp.stopped') + prac_stim_keyResp.status = FINISHED + if prac_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _prac_stim_keyResp_allKeys.extend(theseKeys) + if len(_prac_stim_keyResp_allKeys): + prac_stim_keyResp.keys = [key.name for key in _prac_stim_keyResp_allKeys] # storing all keys + prac_stim_keyResp.rt = [key.rt for key in _prac_stim_keyResp_allKeys] + # Run 'Each Frame' code from prac_respTrigger_code + if prac_stim_keyResp.keys and len(prac_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(prac_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial (-1 is the last position) + if len(prac_stim_keyResp.keys) < 2: #if this is the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(prac_stim_keyResp.keys) >= 2: #if this is NOT the first response + if prac_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif prac_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_stimRoutine" --- + for thisComponent in prac_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if prac_stim_keyResp.keys in ['', [], None]: # No response was made + prac_stim_keyResp.keys = None + prac_trial_loop.addData('prac_stim_keyResp.keys',prac_stim_keyResp.keys) + if prac_stim_keyResp.keys != None: # we had a response + prac_trial_loop.addData('prac_stim_keyResp.rt', prac_stim_keyResp.rt) + # Run 'End Routine' code from prac_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if prac_stim_keyResp.keys: #if at least one response was made this trial + if prac_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif prac_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + elif not prac_stim_keyResp.keys: # if no response was made + accuracy = 0 + + # save this trial's accuracy to our output file + prac_trial_loop.addData('accuracy', accuracy) + # the Routine "prac_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10 repeats of 'prac_trial_loop' + + + # --- Prepare to start Routine "prac_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from prac_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockAcc >= .75: #if accuracy >= 75% then say practice is complete and end practice loop to continue to main exp + outPut = 'You will now play the real game' #feedback presented + prac_block_loop.finished = True #end practice loop to continue to main exp + elif blockAcc <= .75: #if accuracy < 75% then say that practice needs to be repeated and DO NOT end practice loop, instead, allow it to repeat + outPut = 'Please try the practice again' #feedback presented + prac_block_loop.finished = False #DO NOT end practice loop and allow to repeat + + #reset the following variables to zero before the next practice block starts + trialNum = 0 + numCorr = 0 + prac_blockFeed_text.setText(outPut) + prac_blockFeed_keyResp.keys = [] + prac_blockFeed_keyResp.rt = [] + _prac_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + prac_blockFeedComponents = [prac_blockFeed_text, prac_pressContinue, prac_blockFeed_keyResp] + for thisComponent in prac_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "prac_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *prac_blockFeed_text* updates + if prac_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_text.frameNStart = frameN # exact frame index + prac_blockFeed_text.tStart = t # local t and not account for scr refresh + prac_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'prac_blockFeed_text.started') + prac_blockFeed_text.setAutoDraw(True) + + # *prac_pressContinue* updates + if prac_pressContinue.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_pressContinue.frameNStart = frameN # exact frame index + prac_pressContinue.tStart = t # local t and not account for scr refresh + prac_pressContinue.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_pressContinue, 'tStartRefresh') # time at next scr refresh + prac_pressContinue.setAutoDraw(True) + + # *prac_blockFeed_keyResp* updates + waitOnFlip = False + if prac_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + prac_blockFeed_keyResp.frameNStart = frameN # exact frame index + prac_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + prac_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(prac_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + prac_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(prac_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(prac_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if prac_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = prac_blockFeed_keyResp.getKeys(keyList=['c','s'], waitRelease=False) + _prac_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_prac_blockFeed_keyResp_allKeys): + prac_blockFeed_keyResp.keys = _prac_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + prac_blockFeed_keyResp.rt = _prac_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "prac_blockFeed" --- + for thisComponent in prac_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # Run 'End Routine' code from prac_blockFeed_code + if prac_blockFeed_keyResp.keys[-1] == 's': + prac_block_loop.finished = True #end practice loop to continue to main exp + # the Routine "prac_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 99 repeats of 'prac_block_loop' + + +# set up handler to look after randomisation of conditions etc +task_condition_loop = data.TrialHandler(nReps=1.0, method='sequential', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions("condition_"+expInfo['counterbalance']+".xlsx"), + seed=None, name='task_condition_loop') +thisExp.addLoop(task_condition_loop) # add the loop to the experiment +thisTask_condition_loop = task_condition_loop.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) +if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + +for thisTask_condition_loop in task_condition_loop: + currentLoop = task_condition_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_condition_loop.rgb) + if thisTask_condition_loop != None: + for paramName in thisTask_condition_loop: + exec('{} = thisTask_condition_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_condition" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from condition_init_blockCounter + #reset the following variables at the start of the experiment + blockCounter = 0 + + if conditionText == 'Observe other': + endCondition = 1 # skip all trials for this condition; participant will not play game. + if expInfo['skipOther'] == '1': #skip 'observe other' screen + continueRoutine = False + elif conditionText == 'Observed': + endCondition = 0 # participant will play game. + elif conditionText == 'Alone': + endCondition = 0 # participant will play game. + condition_whichCondition_text.setText(conditionText) + condition_keyResp.keys = [] + condition_keyResp.rt = [] + _condition_keyResp_allKeys = [] + # keep track of which components have finished + task_conditionComponents = [condition_whichCondition_text, condition_reminder_text, condition_keyResp] + for thisComponent in task_conditionComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_condition" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *condition_whichCondition_text* updates + if condition_whichCondition_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_whichCondition_text.frameNStart = frameN # exact frame index + condition_whichCondition_text.tStart = t # local t and not account for scr refresh + condition_whichCondition_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_whichCondition_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'condition_whichCondition_text.started') + condition_whichCondition_text.setAutoDraw(True) + + # *condition_reminder_text* updates + if condition_reminder_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_reminder_text.frameNStart = frameN # exact frame index + condition_reminder_text.tStart = t # local t and not account for scr refresh + condition_reminder_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_reminder_text, 'tStartRefresh') # time at next scr refresh + condition_reminder_text.setAutoDraw(True) + + # *condition_keyResp* updates + waitOnFlip = False + if condition_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + condition_keyResp.frameNStart = frameN # exact frame index + condition_keyResp.tStart = t # local t and not account for scr refresh + condition_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(condition_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'condition_keyResp.started') + condition_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(condition_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(condition_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if condition_keyResp.status == STARTED and not waitOnFlip: + theseKeys = condition_keyResp.getKeys(keyList=['c'], waitRelease=False) + _condition_keyResp_allKeys.extend(theseKeys) + if len(_condition_keyResp_allKeys): + condition_keyResp.keys = _condition_keyResp_allKeys[-1].name # just the last key pressed + condition_keyResp.rt = _condition_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_condition" --- + for thisComponent in task_conditionComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "task_condition" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # set up handler to look after randomisation of conditions etc + task_block_loop = data.TrialHandler(nReps=10.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='task_block_loop') + thisExp.addLoop(task_block_loop) # add the loop to the experiment + thisTask_block_loop = task_block_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + for thisTask_block_loop in task_block_loop: + currentLoop = task_block_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_block_loop.rgb) + if thisTask_block_loop != None: + for paramName in thisTask_block_loop: + exec('{} = thisTask_block_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "eeg_trigger_check" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from triggerCheck_code + #(re)open trigger port. This is done in case the connection failed, + #in which case triggers will no longer be sent until the port is reopened. + + #At start of routine, we try to close/open the port. This will usually be + #succesful, causing us to end the routine altogether. However, it will fail if + #the usb is unplugged. In this latter case, the routine will then run code each + #frame to constantly check for the usb being plugged back in, before continuing. + + try: + #if usb connected, port will close/open and routine will end + port.close() + port.open() + usbConnected = 1 #if successful, set usbConnectd to 1 + continueRoutine = False #if successful, end the routine + + except: #if port close/open fails, then set usbConnected to 0. Routine will loop each frame until fixed. + usbConnected = 0 #if failure, set usbConnected to 0 + # keep track of which components have finished + eeg_trigger_checkComponents = [triggerIssue_text] + for thisComponent in eeg_trigger_checkComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "eeg_trigger_check" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + # Run 'Each Frame' code from triggerCheck_code + #if the usb is not connected, then keep trying to open port to determine when it has been reconnected. + if usbConnected == 0: + + try: + #if usb connected, port will close/open and routine will end + port.close() + port.open() + usbConnected = 1 #if successful, set usbConnectd to 1 + #send trigger to indicate that there was a connection issue that is now resolved + port.write([0x63]) #hexcode = 99; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + #if successful, end the routine + continueRoutine = False + + except: #if usb not connected, routine will continue (keep checking port and keep showing message) + usbConnected = 0 #if failure, set usbConnectd to 0 + time.sleep(0.5) #wait .5 secs before checking again, to not overload the system + + # *triggerIssue_text* updates + if triggerIssue_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + triggerIssue_text.frameNStart = frameN # exact frame index + triggerIssue_text.tStart = t # local t and not account for scr refresh + triggerIssue_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(triggerIssue_text, 'tStartRefresh') # time at next scr refresh + triggerIssue_text.setAutoDraw(True) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in eeg_trigger_checkComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "eeg_trigger_check" --- + for thisComponent in eeg_trigger_checkComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "eeg_trigger_check" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "task_blockReminders" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from task_blockReminder_code + if endCondition: # skip all trials for this condition; participant will not play game. + task_block_loop.finished = True + continueRoutine = False + + blockCounter = blockCounter +1 + + if blockCounter == 1: + blockNumText = 'Block 1 of 10' + elif blockCounter == 2: + blockNumText = 'Block 2 of 10' + elif blockCounter == 3: + blockNumText = 'Block 3 of 10' + elif blockCounter == 4: + blockNumText = 'Block 4 of 10' + elif blockCounter == 5: + blockNumText = 'Block 5 of 10' + elif blockCounter == 6: + blockNumText = 'Block 6 of 10' + elif blockCounter == 7: + blockNumText = 'Block 7 of 10' + elif blockCounter == 8: + blockNumText = 'Block 8 of 10' + elif blockCounter == 9: + blockNumText = 'Block 9 of 10' + elif blockCounter == 10: + blockNumText = 'Block 10 of 10' + task_blockText.setText(blockNumText) + task_blockReminders_keyResp.keys = [] + task_blockReminders_keyResp.rt = [] + _task_blockReminders_keyResp_allKeys = [] + # keep track of which components have finished + task_blockRemindersComponents = [task_blockText, task_blockReminders_text, task_blockReminders_keyResp] + for thisComponent in task_blockRemindersComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockReminders" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockText* updates + if task_blockText.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockText.frameNStart = frameN # exact frame index + task_blockText.tStart = t # local t and not account for scr refresh + task_blockText.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockText, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockText.started') + task_blockText.setAutoDraw(True) + + # *task_blockReminders_text* updates + if task_blockReminders_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_text.frameNStart = frameN # exact frame index + task_blockReminders_text.tStart = t # local t and not account for scr refresh + task_blockReminders_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_text, 'tStartRefresh') # time at next scr refresh + task_blockReminders_text.setAutoDraw(True) + + # *task_blockReminders_keyResp* updates + waitOnFlip = False + if task_blockReminders_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockReminders_keyResp.frameNStart = frameN # exact frame index + task_blockReminders_keyResp.tStart = t # local t and not account for scr refresh + task_blockReminders_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockReminders_keyResp, 'tStartRefresh') # time at next scr refresh + task_blockReminders_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockReminders_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockReminders_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockReminders_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockReminders_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockReminders_keyResp_allKeys.extend(theseKeys) + if len(_task_blockReminders_keyResp_allKeys): + task_blockReminders_keyResp.keys = _task_blockReminders_keyResp_allKeys[-1].name # just the last key pressed + task_blockReminders_keyResp.rt = _task_blockReminders_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockReminders" --- + for thisComponent in task_blockRemindersComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "task_blockReminders" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + + # --- Prepare to start Routine "task_initFixation" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code + if endCondition: # skip all trials for this condition; participant will not play game. + task_block_loop.finished = True + continueRoutine = False + initFixation_img.setImage('img/fixationCross.png') + # keep track of which components have finished + task_initFixationComponents = [initFixation_img] + for thisComponent in task_initFixationComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_initFixation" --- + while continueRoutine and routineTimer.getTime() < 3.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *initFixation_img* updates + if initFixation_img.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + initFixation_img.frameNStart = frameN # exact frame index + initFixation_img.tStart = t # local t and not account for scr refresh + initFixation_img.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(initFixation_img, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.started') + initFixation_img.setAutoDraw(True) + if initFixation_img.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > initFixation_img.tStartRefresh + 3-frameTolerance: + # keep track of stop time/frame for later + initFixation_img.tStop = t # not accounting for scr refresh + initFixation_img.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'initFixation_img.stopped') + initFixation_img.setAutoDraw(False) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_initFixationComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_initFixation" --- + for thisComponent in task_initFixationComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-3.000000) + + # set up handler to look after randomisation of conditions etc + task_trial_loop = data.TrialHandler(nReps=10.0, method='fullRandom', + extraInfo=expInfo, originPath=-1, + trialList=data.importConditions(whichCondition), + seed=None, name='task_trial_loop') + thisExp.addLoop(task_trial_loop) # add the loop to the experiment + thisTask_trial_loop = task_trial_loop.trialList[0] # so we can initialise stimuli with some values + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + for thisTask_trial_loop in task_trial_loop: + currentLoop = task_trial_loop + # abbreviate parameter names if possible (e.g. rgb = thisTask_trial_loop.rgb) + if thisTask_trial_loop != None: + for paramName in thisTask_trial_loop: + exec('{} = thisTask_trial_loop[paramName]'.format(paramName)) + + # --- Prepare to start Routine "task_stimRoutine" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code_2 + if endCondition: # skip all trials for this condition; participant will not play game. + task_trial_loop.finished = True + task_block_loop.finished = True + continueRoutine = False + # Run 'Begin Routine' code from task_isi_code + # pick the ISI for the next routine + # for the online version, this code component should be set to 'both' to remove the 'np' + # at the start of np.linspace (this is a python library JS won't know what to call. + + # make range from a to b in n stepsizes + ISIRange = np.linspace(1500, 2000, 500) + + # picking from a shuffled array is easier for random selection in JS + shuffle(ISIRange) + thisISI = ISIRange[0]/1000 # the first item of the shuffled array + + # save this ISI to our output file + task_trial_loop.addData('ISI', thisISI) + + task_centerImg.setImage(middleStim) + task_rightImg1.setImage(rightStim1) + task_rightImg2.setImage(rightStim2) + task_leftImg1.setImage(leftStim1) + task_leftImg2.setImage(leftStim1) + task_fixImg.setImage('img/fixationCross.png') + # Run 'Begin Routine' code from task_stimTrigger_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + task_stim_keyResp.keys = [] + task_stim_keyResp.rt = [] + _task_stim_keyResp_allKeys = [] + # Run 'Begin Routine' code from task_respTrigger_code + #clear out the keys_counbted variable at the start of the trial + #this variable will hold the keys that have had eeg triggers thrown + #already within a given trial. + keys_counted = [] + # keep track of which components have finished + task_stimRoutineComponents = [task_centerImg, task_rightImg1, task_rightImg2, task_leftImg1, task_leftImg2, task_fixImg, task_stim_keyResp] + for thisComponent in task_stimRoutineComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_stimRoutine" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_centerImg* updates + if task_centerImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_centerImg.frameNStart = frameN # exact frame index + task_centerImg.tStart = t # local t and not account for scr refresh + task_centerImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_centerImg, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.started') + task_centerImg.setAutoDraw(True) + if task_centerImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_centerImg.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_centerImg.tStop = t # not accounting for scr refresh + task_centerImg.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_centerImg.stopped') + task_centerImg.setAutoDraw(False) + + # *task_rightImg1* updates + if task_rightImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg1.frameNStart = frameN # exact frame index + task_rightImg1.tStart = t # local t and not account for scr refresh + task_rightImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg1, 'tStartRefresh') # time at next scr refresh + task_rightImg1.setAutoDraw(True) + if task_rightImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg1.tStop = t # not accounting for scr refresh + task_rightImg1.frameNStop = frameN # exact frame index + task_rightImg1.setAutoDraw(False) + + # *task_rightImg2* updates + if task_rightImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_rightImg2.frameNStart = frameN # exact frame index + task_rightImg2.tStart = t # local t and not account for scr refresh + task_rightImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_rightImg2, 'tStartRefresh') # time at next scr refresh + task_rightImg2.setAutoDraw(True) + if task_rightImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_rightImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_rightImg2.tStop = t # not accounting for scr refresh + task_rightImg2.frameNStop = frameN # exact frame index + task_rightImg2.setAutoDraw(False) + + # *task_leftImg1* updates + if task_leftImg1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg1.frameNStart = frameN # exact frame index + task_leftImg1.tStart = t # local t and not account for scr refresh + task_leftImg1.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg1, 'tStartRefresh') # time at next scr refresh + task_leftImg1.setAutoDraw(True) + if task_leftImg1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg1.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg1.tStop = t # not accounting for scr refresh + task_leftImg1.frameNStop = frameN # exact frame index + task_leftImg1.setAutoDraw(False) + + # *task_leftImg2* updates + if task_leftImg2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_leftImg2.frameNStart = frameN # exact frame index + task_leftImg2.tStart = t # local t and not account for scr refresh + task_leftImg2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_leftImg2, 'tStartRefresh') # time at next scr refresh + task_leftImg2.setAutoDraw(True) + if task_leftImg2.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_leftImg2.tStartRefresh + .2-frameTolerance: + # keep track of stop time/frame for later + task_leftImg2.tStop = t # not accounting for scr refresh + task_leftImg2.frameNStop = frameN # exact frame index + task_leftImg2.setAutoDraw(False) + + # *task_fixImg* updates + if task_fixImg.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_fixImg.frameNStart = frameN # exact frame index + task_fixImg.tStart = t # local t and not account for scr refresh + task_fixImg.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_fixImg, 'tStartRefresh') # time at next scr refresh + task_fixImg.setAutoDraw(True) + if task_fixImg.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_fixImg.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_fixImg.tStop = t # not accounting for scr refresh + task_fixImg.frameNStop = frameN # exact frame index + task_fixImg.setAutoDraw(False) + # Run 'Each Frame' code from task_stimTrigger_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + if task_centerImg.status == STARTED and not stimTriggerSent: + if stimNum == 41: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x29]) #hexcode = 41; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 42: + stimTriggerSent = True + port.write([0x2A]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 43: + stimTriggerSent = True + port.write([0x2B]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 44: + stimTriggerSent = True + port.write([0x2C]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 51: #code denoting which stimulus array was sent (from excel file) + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x33]) #hexcode = 51; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + elif stimNum == 52: + stimTriggerSent = True + port.write([0x34]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 53: + stimTriggerSent = True + port.write([0x35]) + time.sleep(PulseWidth) + port.write([0x00]) + elif stimNum == 54: + stimTriggerSent = True + port.write([0x36]) + time.sleep(PulseWidth) + port.write([0x00]) + + # *task_stim_keyResp* updates + waitOnFlip = False + if task_stim_keyResp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_stim_keyResp.frameNStart = frameN # exact frame index + task_stim_keyResp.tStart = t # local t and not account for scr refresh + task_stim_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_stim_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.started') + task_stim_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_stim_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_stim_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_stim_keyResp.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_stim_keyResp.tStartRefresh + thisISI-frameTolerance: + # keep track of stop time/frame for later + task_stim_keyResp.tStop = t # not accounting for scr refresh + task_stim_keyResp.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_stim_keyResp.stopped') + task_stim_keyResp.status = FINISHED + if task_stim_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_stim_keyResp.getKeys(keyList=['1','8'], waitRelease=False) + _task_stim_keyResp_allKeys.extend(theseKeys) + if len(_task_stim_keyResp_allKeys): + task_stim_keyResp.keys = [key.name for key in _task_stim_keyResp_allKeys] # storing all keys + task_stim_keyResp.rt = [key.rt for key in _task_stim_keyResp_allKeys] + # Run 'Each Frame' code from task_respTrigger_code + if task_stim_keyResp.keys and len(task_stim_keyResp.keys) > len(keys_counted):# A key response has been made but we haven't yet "counted" it + keys_counted.append(task_stim_keyResp.keys[-1]) #add this response to list of keys pressed this trial + if len(task_stim_keyResp.keys) < 2: #if this is the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #correct response + port.write([0x0B]) # 11 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #error response + port.write([0x0C])# 12 + time.sleep(PulseWidth) + port.write([0x00]) + elif len(task_stim_keyResp.keys) >= 2: #if this is NOT the first response + if task_stim_keyResp.keys[-1] == '1': + if target == 'left': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'right': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + elif task_stim_keyResp.keys[-1] == '8': + if target == 'right': #technically correct response, but not the first response made + port.write([0x15]) # 21 + time.sleep(PulseWidth) + port.write([0x00]) + elif target == 'left': #technically error response, but not the first response made + port.write([0x16])# 22 + time.sleep(PulseWidth) + port.write([0x00]) + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_stimRoutine" --- + for thisComponent in task_stimRoutineComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # check responses + if task_stim_keyResp.keys in ['', [], None]: # No response was made + task_stim_keyResp.keys = None + task_trial_loop.addData('task_stim_keyResp.keys',task_stim_keyResp.keys) + if task_stim_keyResp.keys != None: # we had a response + task_trial_loop.addData('task_stim_keyResp.rt', task_stim_keyResp.rt) + # Run 'End Routine' code from task_accuracy_code + trialNum = trialNum + 1 #iterate trial number for this block + + if task_stim_keyResp.keys: #if at least one response was made this trial + if task_stim_keyResp.keys[0] == '1': #if the FIRST button pressed was a '1' + if target == 'left': #if a left target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'right': #if a right target stim was shown this trial + accuracy = 0 #mark this trial as an error + elif task_stim_keyResp.keys[0] == '8': #if the FIRST button pressed was a '8' + if target == 'right': #if a right target stim was shown this trial + accuracy = 1 #mark this trial as correct + numCorr = numCorr +1 #iterate number of correct responses for this block + elif target == 'left': #if a left target stim was shown this trial + accuracy = 0 #mark this trial as an error + + elif not task_stim_keyResp.keys: # if no response was made + accuracy = 0 + + # save this trial's accuracy to our output file + task_trial_loop.addData('accuracy', accuracy) + # the Routine "task_stimRoutine" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_trial_loop' + + + # --- Prepare to start Routine "task_blockFeed" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from endTask_code_3 + if endCondition: # skip all trials for this condition; participant will not play game. + task_block_loop.finished = True + continueRoutine = False + # Run 'Begin Routine' code from task_blockFeed_code + blockAcc = numCorr / trialNum #compute accuracy for this block + + if blockCounter < 10: + if blockAcc >= .75: + if blockAcc < .9: + blockFeed = 'Good job' + blockFeedCat = 1 + elif blockAcc >= .9: + blockFeed = 'Respond faster' + blockFeedCat = 2 + elif blockAcc < .75: + blockFeed = 'Respond more accurately' + blockFeedCat = 3 + elif blockCounter == 10: + 'You have completed all blocks' + + # save this block's feedback to our output file + task_trial_loop.addData('blockFeedCat', blockFeedCat) + + #reset the following variables to zero before next block starts + trialNum = 0 + numCorr = 0 + task_blockFeed_text.setText(blockFeed) + task_blockFeed_text2.setText('Press the right button to continue') + task_blockFeed_keyResp.keys = [] + task_blockFeed_keyResp.rt = [] + _task_blockFeed_keyResp_allKeys = [] + # keep track of which components have finished + task_blockFeedComponents = [task_blockFeed_text, task_blackFeed_text3, task_blockFeed_text2, task_blockFeed_keyResp] + for thisComponent in task_blockFeedComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_blockFeed" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *task_blockFeed_text* updates + if task_blockFeed_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text.frameNStart = frameN # exact frame index + task_blockFeed_text.tStart = t # local t and not account for scr refresh + task_blockFeed_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_text.started') + task_blockFeed_text.setAutoDraw(True) + + # *task_blackFeed_text3* updates + if task_blackFeed_text3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + task_blackFeed_text3.frameNStart = frameN # exact frame index + task_blackFeed_text3.tStart = t # local t and not account for scr refresh + task_blackFeed_text3.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blackFeed_text3, 'tStartRefresh') # time at next scr refresh + task_blackFeed_text3.setAutoDraw(True) + if task_blackFeed_text3.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > task_blackFeed_text3.tStartRefresh + 10-frameTolerance: + # keep track of stop time/frame for later + task_blackFeed_text3.tStop = t # not accounting for scr refresh + task_blackFeed_text3.frameNStop = frameN # exact frame index + task_blackFeed_text3.setAutoDraw(False) + + # *task_blockFeed_text2* updates + if task_blockFeed_text2.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_text2.frameNStart = frameN # exact frame index + task_blockFeed_text2.tStart = t # local t and not account for scr refresh + task_blockFeed_text2.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_text2, 'tStartRefresh') # time at next scr refresh + task_blockFeed_text2.setAutoDraw(True) + + # *task_blockFeed_keyResp* updates + waitOnFlip = False + if task_blockFeed_keyResp.status == NOT_STARTED and tThisFlip >= 10-frameTolerance: + # keep track of start time/frame for later + task_blockFeed_keyResp.frameNStart = frameN # exact frame index + task_blockFeed_keyResp.tStart = t # local t and not account for scr refresh + task_blockFeed_keyResp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(task_blockFeed_keyResp, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'task_blockFeed_keyResp.started') + task_blockFeed_keyResp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(task_blockFeed_keyResp.clock.reset) # t=0 on next screen flip + win.callOnFlip(task_blockFeed_keyResp.clearEvents, eventType='keyboard') # clear events on next screen flip + if task_blockFeed_keyResp.status == STARTED and not waitOnFlip: + theseKeys = task_blockFeed_keyResp.getKeys(keyList=['8'], waitRelease=False) + _task_blockFeed_keyResp_allKeys.extend(theseKeys) + if len(_task_blockFeed_keyResp_allKeys): + task_blockFeed_keyResp.keys = _task_blockFeed_keyResp_allKeys[-1].name # just the last key pressed + task_blockFeed_keyResp.rt = _task_blockFeed_keyResp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_blockFeed" --- + for thisComponent in task_blockFeedComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "task_blockFeed" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + + # completed 10.0 repeats of 'task_block_loop' + + + # --- Prepare to start Routine "task_conditionComplete" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from stimTask_code_4 + if endCondition: # skip all trials for this condition; participant will not play game. + continueRoutine = False + conditionComplete_key_resp.keys = [] + conditionComplete_key_resp.rt = [] + _conditionComplete_key_resp_allKeys = [] + # keep track of which components have finished + task_conditionCompleteComponents = [conditionComplete_text, conditionComplete_key_resp] + for thisComponent in task_conditionCompleteComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "task_conditionComplete" --- + while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # *conditionComplete_text* updates + if conditionComplete_text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_text.frameNStart = frameN # exact frame index + conditionComplete_text.tStart = t # local t and not account for scr refresh + conditionComplete_text.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_text, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'conditionComplete_text.started') + conditionComplete_text.setAutoDraw(True) + + # *conditionComplete_key_resp* updates + waitOnFlip = False + if conditionComplete_key_resp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: + # keep track of start time/frame for later + conditionComplete_key_resp.frameNStart = frameN # exact frame index + conditionComplete_key_resp.tStart = t # local t and not account for scr refresh + conditionComplete_key_resp.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(conditionComplete_key_resp, 'tStartRefresh') # time at next scr refresh + conditionComplete_key_resp.status = STARTED + # keyboard checking is just starting + waitOnFlip = True + win.callOnFlip(conditionComplete_key_resp.clock.reset) # t=0 on next screen flip + win.callOnFlip(conditionComplete_key_resp.clearEvents, eventType='keyboard') # clear events on next screen flip + if conditionComplete_key_resp.status == STARTED and not waitOnFlip: + theseKeys = conditionComplete_key_resp.getKeys(keyList=['c'], waitRelease=False) + _conditionComplete_key_resp_allKeys.extend(theseKeys) + if len(_conditionComplete_key_resp_allKeys): + conditionComplete_key_resp.keys = _conditionComplete_key_resp_allKeys[-1].name # just the last key pressed + conditionComplete_key_resp.rt = _conditionComplete_key_resp_allKeys[-1].rt + # a response ends the routine + continueRoutine = False + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "task_conditionComplete" --- + for thisComponent in task_conditionCompleteComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + # the Routine "task_conditionComplete" was not non-slip safe, so reset the non-slip timer + routineTimer.reset() + thisExp.nextEntry() + +# completed 1.0 repeats of 'task_condition_loop' + +# Run 'End Experiment' code from setup_code +win.mouseVisible = True #make the mouse cursor visable again +port.write([0xFF]) #set port values back to default state (FF) +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else +port.close() #close port opened at start of exp + +# --- End experiment --- +# Flip one final time so any remaining win.callOnFlip() +# and win.timeOnFlip() tasks get executed before quitting +win.flip() + +# these shouldn't be strictly necessary (should auto-save) +thisExp.saveAsWideText(filename+'.csv', delim='auto') +thisExp.saveAsPickle(filename) +logging.flush() +# make sure everything is closed down +if eyetracker: + eyetracker.setConnectionState(False) +thisExp.abort() # or data files will save again on exit +win.close() +core.quit() diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/condition_A1.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/condition_A1.xlsx new file mode 100755 index 0000000..6bb1fb3 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/condition_A1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/condition_A2.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/condition_A2.xlsx new file mode 100755 index 0000000..5c730d0 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/condition_A2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/condition_B1.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/condition_B1.xlsx new file mode 100755 index 0000000..48f4556 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/condition_B1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/condition_B2.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/condition_B2.xlsx new file mode 100755 index 0000000..3b0147e Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/condition_B2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/condition_C1.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/condition_C1.xlsx new file mode 100755 index 0000000..11b6536 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/condition_C1.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/condition_C2.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/condition_C2.xlsx new file mode 100755 index 0000000..35f18a6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/condition_C2.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/blankSquare.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/blankSquare.png new file mode 100755 index 0000000..5bfa2c8 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/blankSquare.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/fixationCross.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/fixationCross.png new file mode 100755 index 0000000..7767763 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/fixationCross.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrow.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrow.png new file mode 100755 index 0000000..5a40335 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrow.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrowHighlight.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrowHighlight.png new file mode 100755 index 0000000..f90803c Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrowHighlight.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrowSolid.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrowSolid.png new file mode 100755 index 0000000..ae8d57f Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/leftArrowSolid.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/logo2.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/logo2.png new file mode 100755 index 0000000..e289506 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/logo2.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/pptFiles.zip b/materials/psychopy_tasks/arrow-alert-v1-2/img/pptFiles.zip new file mode 100755 index 0000000..7724f83 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/pptFiles.zip differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrow.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrow.png new file mode 100755 index 0000000..a0fbd55 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrow.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrowHighlight.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrowHighlight.png new file mode 100755 index 0000000..3d92a18 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrowHighlight.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrowSolid.png b/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrowSolid.png new file mode 100755 index 0000000..3da86f7 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/img/rightArrowSolid.png differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/nonsocial_task_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/nonsocial_task_trials.xlsx new file mode 100755 index 0000000..eb4162f Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/nonsocial_task_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/prac_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/prac_trials.xlsx new file mode 100755 index 0000000..a48c0a6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/prac_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/readme.md b/materials/psychopy_tasks/arrow-alert-v1-2/readme.md new file mode 100755 index 0000000..e69de29 diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/social_task_trials.xlsx b/materials/psychopy_tasks/arrow-alert-v1-2/social_task_trials.xlsx new file mode 100755 index 0000000..e74acd4 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/social_task_trials.xlsx differ diff --git a/materials/psychopy_tasks/arrow-alert-v1-2/~$toDo.rtf b/materials/psychopy_tasks/arrow-alert-v1-2/~$toDo.rtf new file mode 100755 index 0000000..ae13dc6 Binary files /dev/null and b/materials/psychopy_tasks/arrow-alert-v1-2/~$toDo.rtf differ diff --git a/materials/psychopy_tasks/timestamp-v1-1/readme.md b/materials/psychopy_tasks/timestamp-v1-1/readme.md new file mode 100755 index 0000000..e69de29 diff --git a/materials/psychopy_tasks/timestamp-v1-1/stimuli/sine-200z-1s_100ms-fade.wav b/materials/psychopy_tasks/timestamp-v1-1/stimuli/sine-200z-1s_100ms-fade.wav new file mode 100755 index 0000000..2480c4f Binary files /dev/null and b/materials/psychopy_tasks/timestamp-v1-1/stimuli/sine-200z-1s_100ms-fade.wav differ diff --git a/materials/psychopy_tasks/timestamp-v1-1/stimuli/x-image.png b/materials/psychopy_tasks/timestamp-v1-1/stimuli/x-image.png new file mode 100755 index 0000000..d6c11b2 Binary files /dev/null and b/materials/psychopy_tasks/timestamp-v1-1/stimuli/x-image.png differ diff --git a/materials/psychopy_tasks/timestamp-v1-1/timestamp-v1-1.psyexp b/materials/psychopy_tasks/timestamp-v1-1/timestamp-v1-1.psyexp new file mode 100755 index 0000000..70b9938 --- /dev/null +++ b/materials/psychopy_tasks/timestamp-v1-1/timestamp-v1-1.psyexp @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/materials/psychopy_tasks/timestamp-v1-1/timestamp-v1-1_lastrun.py b/materials/psychopy_tasks/timestamp-v1-1/timestamp-v1-1_lastrun.py new file mode 100755 index 0000000..4277eaf --- /dev/null +++ b/materials/psychopy_tasks/timestamp-v1-1/timestamp-v1-1_lastrun.py @@ -0,0 +1,333 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +This experiment was created using PsychoPy3 Experiment Builder (v2022.2.5), + on October 29, 2023, at 18:18 +If you publish work using this script the most relevant publication is: + + Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) + PsychoPy2: Experiments in behavior made easy Behav Res 51: 195. + https://doi.org/10.3758/s13428-018-01193-y + +""" + +# --- Import packages --- +from psychopy import locale_setup +from psychopy import prefs +prefs.hardware['audioLib'] = 'ptb' +from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout +from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, + STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) + +import numpy as np # whole numpy lib is available, prepend 'np.' +from numpy import (sin, cos, tan, log, log10, pi, average, + sqrt, std, deg2rad, rad2deg, linspace, asarray) +from numpy.random import random, randint, normal, shuffle, choice as randchoice +import os # handy system and path functions +import sys # to get file system encoding + +import psychopy.iohub as io +from psychopy.hardware import keyboard + + + +# Ensure that relative paths start from the same directory as this script +_thisDir = os.path.dirname(os.path.abspath(__file__)) +os.chdir(_thisDir) +# Store info about the experiment session +psychopyVersion = '2022.2.5' +expName = 'timestamp-v1-1' # from the Builder filename that created this script +expInfo = { + 'id': '', + 'session': '1', + 'run': '1', +} +# --- Show participant info dialog -- +dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName) +if dlg.OK == False: + core.quit() # user pressed cancel +expInfo['date'] = data.getDateStr() # add a simple timestamp +expInfo['expName'] = expName +expInfo['psychopyVersion'] = psychopyVersion + +# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc +filename = _thisDir + os.sep + u'data/sub-%s_%s_s%s_r%s_e1' % (expInfo['id'], expName, expInfo['session'], expInfo['run'], ) + +# An ExperimentHandler isn't essential but helps with data saving +thisExp = data.ExperimentHandler(name=expName, version='', + extraInfo=expInfo, runtimeInfo=None, + originPath='C:\\Users\\NDCLab\\Desktop\\Experiments\\THRIVE\\timestamp-v1-1\\timestamp-v1-1_lastrun.py', + savePickle=True, saveWideText=True, + dataFileName=filename) +# save a log file for detail verbose info +logFile = logging.LogFile(filename+'.log', level=logging.EXP) +logging.console.setLevel(logging.WARNING) # this outputs to the screen, not a file + +endExpNow = False # flag for 'escape' or other condition => quit the exp +frameTolerance = 0.001 # how close to onset before 'same' frame + +# Start Code - component code to be run after the window creation + +# --- Setup the Window --- +win = visual.Window( + size=[1920, 1080], fullscr=True, screen=0, + winType='pyglet', allowStencil=False, + monitor='sys-1-asus', color=[0,0,0], colorSpace='rgb', + blendMode='avg', useFBO=True, + units='height') +win.mouseVisible = False +# store frame rate of monitor if we can measure it +expInfo['frameRate'] = win.getActualFrameRate() +if expInfo['frameRate'] != None: + frameDur = 1.0 / round(expInfo['frameRate']) +else: + frameDur = 1.0 / 60.0 # could not measure, so guess +# --- Setup input devices --- +ioConfig = {} + +# Setup iohub keyboard +ioConfig['Keyboard'] = dict(use_keymap='psychopy') + +ioSession = '1' +if 'session' in expInfo: + ioSession = str(expInfo['session']) +ioServer = io.launchHubServer(window=win, **ioConfig) +eyetracker = None + +# create a default keyboard (e.g. to check for escape) +defaultKeyboard = keyboard.Keyboard(backend='iohub') + +# --- Initialize components for Routine "setup" --- +# Run 'Begin Experiment' code from setup_code +import serial #used for sending eeg triggers +import time #indirerctly used for sending eeg triggers (how long to wait before clearing port) + +win.mouseVisible = False #hide mouse cursor +port = serial.Serial('COM4') #open specified port (COM3) for sending eeg triggers to +PulseWidth = 0.002 #how long to wait before clearing port after sending trigger (2 ms is sufficient at 1000 hz sampling rate) + +port.write([0x00]) #clear serial port +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else + +# --- Initialize components for Routine "trial" --- +image = visual.ImageStim( + win=win, + name='image', + image='stimuli/x-image.png', mask=None, anchor='center', + ori=0.0, pos=(0, 0), size=(0.5, 0.5), + color=[1,1,1], colorSpace='rgb', opacity=None, + flipHoriz=False, flipVert=False, + texRes=128.0, interpolate=True, depth=-1.0) +sound1 = sound.Sound('stimuli/sine-200z-1s_100ms-fade.wav', secs=1.0, stereo=True, hamming=False, + name='sound1') +sound1.setVolume(75.0) + +# Create some handy timers +globalClock = core.Clock() # to track the time since experiment started +routineTimer = core.Clock() # to track time remaining of each (possibly non-slip) routine + +# --- Prepare to start Routine "setup" --- +continueRoutine = True +routineForceEnded = False +# update component parameters for each repeat +# keep track of which components have finished +setupComponents = [] +for thisComponent in setupComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED +# reset timers +t = 0 +_timeToFirstFrame = win.getFutureFlipTime(clock="now") +frameN = -1 + +# --- Run Routine "setup" --- +while continueRoutine: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in setupComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + +# --- Ending Routine "setup" --- +for thisComponent in setupComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) +# the Routine "setup" was not non-slip safe, so reset the non-slip timer +routineTimer.reset() + +# set up handler to look after randomisation of conditions etc +trials = data.TrialHandler(nReps=5000.0, method='random', + extraInfo=expInfo, originPath=-1, + trialList=[None], + seed=None, name='trials') +thisExp.addLoop(trials) # add the loop to the experiment +thisTrial = trials.trialList[0] # so we can initialise stimuli with some values +# abbreviate parameter names if possible (e.g. rgb = thisTrial.rgb) +if thisTrial != None: + for paramName in thisTrial: + exec('{} = thisTrial[paramName]'.format(paramName)) + +for thisTrial in trials: + currentLoop = trials + # abbreviate parameter names if possible (e.g. rgb = thisTrial.rgb) + if thisTrial != None: + for paramName in thisTrial: + exec('{} = thisTrial[paramName]'.format(paramName)) + + # --- Prepare to start Routine "trial" --- + continueRoutine = True + routineForceEnded = False + # update component parameters for each repeat + # Run 'Begin Routine' code from stim_code + #set stimTriggerSent to false at the start of the trial. this way + #when the stimulus is shown, we can change it to True. This variable + #is used to ensure we only throw the stimulus EEG trigger once. + stimTriggerSent = False + sound1.setSound('stimuli/sine-200z-1s_100ms-fade.wav', secs=1.0, hamming=False) + sound1.setVolume(75.0, log=False) + # keep track of which components have finished + trialComponents = [image, sound1] + for thisComponent in trialComponents: + thisComponent.tStart = None + thisComponent.tStop = None + thisComponent.tStartRefresh = None + thisComponent.tStopRefresh = None + if hasattr(thisComponent, 'status'): + thisComponent.status = NOT_STARTED + # reset timers + t = 0 + _timeToFirstFrame = win.getFutureFlipTime(clock="now") + frameN = -1 + + # --- Run Routine "trial" --- + while continueRoutine and routineTimer.getTime() < 6.0: + # get current time + t = routineTimer.getTime() + tThisFlip = win.getFutureFlipTime(clock=routineTimer) + tThisFlipGlobal = win.getFutureFlipTime(clock=None) + frameN = frameN + 1 # number of completed frames (so 0 is the first frame) + # update/draw components on each frame + # Run 'Each Frame' code from stim_code + #the first if statement below ensures that the subsequent if statements (and throwing of triggers) + #only occurs once per trial. That is, only when the stimulus is presented (.status = STARTED) and + #stimTriggerSent is still False. Once a trigger is sent, we change stimTriggerSent to True so that + #the stimulus eeg trigger will not be sent again for this trial + #note that we do not send seperate triggers for image/sound, instead, a trigger is sent for + #the image onset, and then a seperate trigger is initiated by the stimTrak hardware upon + #recieving the actual audio signal. + if image.status == STARTED and not stimTriggerSent: + stimTriggerSent = True #switch stimTriggerSent to True so that the stimulus eeg trigger will not be sent again this trial + port.write([0x58]) #hexcode = 88; eeg trigger sent + time.sleep(PulseWidth) #how long to wait before clearing trigger port + port.write([0x00]) #clear trigger port by sending hexcode = 0 + + # *image* updates + if image.status == NOT_STARTED and tThisFlip >= 5-frameTolerance: + # keep track of start time/frame for later + image.frameNStart = frameN # exact frame index + image.tStart = t # local t and not account for scr refresh + image.tStartRefresh = tThisFlipGlobal # on global time + win.timeOnFlip(image, 'tStartRefresh') # time at next scr refresh + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'image.started') + image.setAutoDraw(True) + if image.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > image.tStartRefresh + 1-frameTolerance: + # keep track of stop time/frame for later + image.tStop = t # not accounting for scr refresh + image.frameNStop = frameN # exact frame index + # add timestamp to datafile + thisExp.timestampOnFlip(win, 'image.stopped') + image.setAutoDraw(False) + # start/stop sound1 + if sound1.status == NOT_STARTED and t >= 5-frameTolerance: + # keep track of start time/frame for later + sound1.frameNStart = frameN # exact frame index + sound1.tStart = t # local t and not account for scr refresh + sound1.tStartRefresh = tThisFlipGlobal # on global time + sound1.play() # start the sound (it finishes automatically) + if sound1.status == STARTED: + # is it time to stop? (based on global clock, using actual start) + if tThisFlipGlobal > sound1.tStartRefresh + 1.0-frameTolerance: + # keep track of stop time/frame for later + sound1.tStop = t # not accounting for scr refresh + sound1.frameNStop = frameN # exact frame index + sound1.stop() + + # check for quit (typically the Esc key) + if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]): + core.quit() + + # check if all components have finished + if not continueRoutine: # a component has requested a forced-end of Routine + routineForceEnded = True + break + continueRoutine = False # will revert to True if at least one component still running + for thisComponent in trialComponents: + if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: + continueRoutine = True + break # at least one component has not yet finished + + # refresh the screen + if continueRoutine: # don't flip if this routine is over or we'll get a blank screen + win.flip() + + # --- Ending Routine "trial" --- + for thisComponent in trialComponents: + if hasattr(thisComponent, "setAutoDraw"): + thisComponent.setAutoDraw(False) + sound1.stop() # ensure sound has stopped at end of routine + # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) + if routineForceEnded: + routineTimer.reset() + else: + routineTimer.addTime(-6.000000) + thisExp.nextEntry() + +# completed 5000.0 repeats of 'trials' + +# Run 'End Experiment' code from setup_code +win.mouseVisible = True #make the mouse cursor visable again +port.write([0xFF]) #set port values back to default state (FF) +time.sleep(PulseWidth) #wait PulseWidth amount of time before doing anything else +port.close() #close port opened at start of exp + +# --- End experiment --- +# Flip one final time so any remaining win.callOnFlip() +# and win.timeOnFlip() tasks get executed before quitting +win.flip() + +# these shouldn't be strictly necessary (should auto-save) +thisExp.saveAsWideText(filename+'.csv', delim='auto') +thisExp.saveAsPickle(filename) +logging.flush() +# make sure everything is closed down +if eyetracker: + eyetracker.setConnectionState(False) +thisExp.abort() # or data files will save again on exit +win.close() +core.quit() diff --git a/materials/questionnaires/ThriveBbsChildS1R1.pdf b/materials/questionnaires/ThriveBbsChildS1R1.pdf new file mode 100644 index 0000000..2be5e55 Binary files /dev/null and b/materials/questionnaires/ThriveBbsChildS1R1.pdf differ diff --git a/materials/questionnaires/ThriveBbsParentS1R1.pdf b/materials/questionnaires/ThriveBbsParentS1R1.pdf new file mode 100644 index 0000000..1cfa555 Binary files /dev/null and b/materials/questionnaires/ThriveBbsParentS1R1.pdf differ diff --git a/materials/questionnaires/ThriveIqsChildS1R1.pdf b/materials/questionnaires/ThriveIqsChildS1R1.pdf new file mode 100644 index 0000000..afd7d0d Binary files /dev/null and b/materials/questionnaires/ThriveIqsChildS1R1.pdf differ diff --git a/materials/questionnaires/ThriveIqsParentS1R1.pdf b/materials/questionnaires/ThriveIqsParentS1R1.pdf new file mode 100644 index 0000000..db30615 Binary files /dev/null and b/materials/questionnaires/ThriveIqsParentS1R1.pdf differ